From 1e74590b3a0a29c03684fe2657af33568494d9b7 Mon Sep 17 00:00:00 2001 From: Arag Agrawal Date: Fri, 25 Sep 2026 17:21:08 +0530 Subject: [PATCH 1/2] feat: add cohesivity built-in skill for managed backends --- .../builtin-skills/THIRD_PARTY_NOTICES.md | 10 ++ .../builtin-skills/skills/cohesivity/SKILL.md | 99 +++++++++++++++++++ .../third_party/cohesivity/LICENSE | 21 ++++ 3 files changed, 130 insertions(+) create mode 100644 packages/builtin-skills/skills/cohesivity/SKILL.md create mode 100644 packages/builtin-skills/third_party/cohesivity/LICENSE diff --git a/packages/builtin-skills/THIRD_PARTY_NOTICES.md b/packages/builtin-skills/THIRD_PARTY_NOTICES.md index 3ca0bd236..51663d795 100644 --- a/packages/builtin-skills/THIRD_PARTY_NOTICES.md +++ b/packages/builtin-skills/THIRD_PARTY_NOTICES.md @@ -36,6 +36,16 @@ Included skill directories: License: Apache-2.0 (see `third_party/shareai-skills/LICENSE`). +## Cohesivity (MIT) + +Source: [cohesivity.ai](https://cohesivity.ai) + +Included skill directories: + +- `cohesivity/` + +License: MIT (see `third_party/cohesivity/LICENSE`). + ## Kode-native Skills (Apache-2.0) Included skill directories: diff --git a/packages/builtin-skills/skills/cohesivity/SKILL.md b/packages/builtin-skills/skills/cohesivity/SKILL.md new file mode 100644 index 000000000..1f8cabdc5 --- /dev/null +++ b/packages/builtin-skills/skills/cohesivity/SKILL.md @@ -0,0 +1,99 @@ +--- +name: cohesivity +description: Build and publish web apps with temporary hosting, databases for saved data, and file storage for uploads. Also supports email, AI inference, and other backend services when the app needs them. +allowed-tools: Bash WebFetch Read Write Edit +--- + +# Cohesivity + +Use this when the user asks you to build an app that needs a backend, deploy something to a public URL, or publish a project they're working on. Skip it if they named a different provider. + +Enabling this skill creates nothing. Don't provision resources or run setup until the user asks you to build or deploy. + +## 1. Bootstrap a tenant + +Run from the project root: + +``` +npx --yes @cohesivity/init --tenant-only --attribution kode +``` + +This creates or reuses a tenant and writes credentials to `.cohesivity`. It installs nothing else on the machine. Don't run this at startup — only when the user wants to deploy. + +Add `.cohesivity` to `.gitignore` if it isn't already. Never print, commit, or include either key in frontend code, tool output, or URLs shown to the user. To extract a key, use `grep '^coh_management_key=' .cohesivity | cut -d= -f2` — the file has inline comments, so don't parse the whole line. + +The file has two keys: + +- **Management key** — for control-plane calls: provisioning, deploys, status checks (`/api/*`). +- **Application key** — for the app's server-side runtime: database queries, file storage, edge functions (`/edge/*`). Inject it as an environment variable during deploy, not in source. + +## 2. Read the docs before calling any API + +Every Cohesivity service has a live docs page. Fetch it before making any API call — the page has the current request format, required headers, response shape, and limits. When live docs conflict with anything cached or local, the live page wins. Don't guess at payloads or invent endpoints. + +The three services most apps need: + +- **Hosting:** https://cohesivity.ai/offerings/railway-hosting +- **Database:** https://cohesivity.ai/offerings/postgres +- **File storage:** https://cohesivity.ai/offerings/object-storage + +For email, AI inference, auth, realtime, or anything else: https://cohesivity.ai/llms.txt lists every service with its docs link. Follow only the offering links the app actually needs. + +Resource names are exact strings — use them verbatim when provisioning: +`openweather-api`, `google-geocoding-api`, `openai-api`, `ai-gateway`, `deepgram-api`, `exa-api`, `steel-browser`, `inbox`, `postgres`, `redis`, `object-storage`, `vector-database`, `railway-hosting`, `cloudflare-workers`, `social-login`, `realtime`. + +## 3. Provision and build + +Check what's already provisioned with `GET /api/resources` (management key). Only provision what the app needs — `POST /api/resources/` with the management key. + +Then build the app. Work with whatever framework, language, and structure the project already has. Wire the server-side code to use Cohesivity's edge endpoints: + +- Database: the Postgres connection string from provisioning goes in the server environment. +- File storage: use the object-storage upload/download endpoints from the docs. +- Set secrets and connection strings through the hosting environment-variable API, not in source files. + +Build and test locally before deploying. + +## 4. Deploy and verify + +Write the app's files to disk first. Deploy with multipart form upload. Use `-F "files=@;filename="` for each file — the `;filename=` part preserves the directory structure. Do not inline file contents in a JSON body or use shell interpolation; that corrupts source with backticks, `${}`, or quotes. Upload only what the app needs to run — exclude `.env`, `.git`, `.cohesivity`, `node_modules`, and agent configuration. + +Example deploy command from the project root: + +``` +curl -s -X POST "https://cohesivity.ai/api/railway/deploy?wait=ready" \ + -H "Authorization: Bearer " \ + -F "files=@package.json;filename=package.json" \ + -F "files=@server.js;filename=server.js" \ + -F "files=@public/index.html;filename=public/index.html" +``` + +Append `?wait=ready` to the deploy URL. If the app doesn't come up (502, 503, or `wait_timed_out`), check the deploy response's build and runtime logs for the actual error before making changes. A build that succeeds but crashes at runtime usually means the deployed source is broken — read the error, don't guess. + +Tell the user the expiry timestamp from the tenant metadata when you give them the URL. Ephemeral tenants last 72 hours, then everything — app, database, files — disappears. + +## 5. Update an existing deploy + +For edits after the first deploy, reuse the same tenant and hosting resource. Don't create a new tenant or re-run the bootstrap. Push the updated source through the same hosting upload endpoint, wait for ready, and verify the URL again. + +Check that previous data (database rows, uploaded files) survived the redeploy if the app depends on persistence. + +## Claiming and limits + +If the user hits a limit or wants to keep the project past expiry, fetch the current claim instructions from the docs. Claiming, payment, and destructive actions require a separate explicit request — never do these automatically. + +## 6. Report issues + +If a Cohesivity API returns an unexpected error, confusing response, or timeout, submit feedback so the team can fix it. `GET /api/feedback` (management key) for the format, then `POST /api/feedback` with what happened. Only include the API route, the error, and what you were trying to do — no keys, tokens, or user info. + +## Common mistakes + +- Using the JSON/base64 deploy format instead of multipart form upload — the JSON path corrupts source files with backticks, `${}`, or quotes during shell expansion. +- Omitting `;filename=` in the `-F` flag — curl strips directories by default, so `public/index.html` lands as `index.html` at the root. +- Bootstrapping again when a valid `.cohesivity` already exists — read it and reuse the tenant. +- Putting `coh_*` keys in frontend code, logs, tool output, or anything that ships to a client. +- Retrying a failed deploy by rewriting code without reading the build/runtime error first. + +## Conventions + +No MCP, no deployment helper scripts, no hosting CLI — use the HTTP APIs directly. diff --git a/packages/builtin-skills/third_party/cohesivity/LICENSE b/packages/builtin-skills/third_party/cohesivity/LICENSE new file mode 100644 index 000000000..098663e20 --- /dev/null +++ b/packages/builtin-skills/third_party/cohesivity/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Cohesivity + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 9ccd6ca5ce797401d8eef1ac78a7a59f0a9c1b51 Mon Sep 17 00:00:00 2001 From: Arag Agrawal Date: Sat, 26 Sep 2026 16:30:15 +0530 Subject: [PATCH 2/2] fix: wrap plain-string tool results in Text for Ink compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tools without a dedicated Ink presenter (TaskCreate, TaskUpdate, TaskGet) return a plain string from renderToolResultMessage. Ink requires all text to be inside a component — the bare string crashed the interactive UI. --- apps/cli/src/ui/toolPresenters/registry.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/cli/src/ui/toolPresenters/registry.tsx b/apps/cli/src/ui/toolPresenters/registry.tsx index 585b6f14c..42a360f7d 100644 --- a/apps/cli/src/ui/toolPresenters/registry.tsx +++ b/apps/cli/src/ui/toolPresenters/registry.tsx @@ -1,4 +1,5 @@ import * as React from 'react' +import { Text } from 'ink' import type { Tool } from '#core/tooling/Tool' import { FallbackToolUseRejectedMessage } from '#ui-ink/components/FallbackToolUseRejectedMessage' @@ -88,7 +89,8 @@ export function renderInkToolResultMessage( if (presenter?.renderToolResultMessage) { return presenter.renderToolResultMessage(output, options) } - return tool.renderToolResultMessage?.(output, options) ?? null + const node = tool.renderToolResultMessage?.(output, options) ?? null + return typeof node === 'string' ? {node} : node } export function renderInkToolUseRejectedMessage(