@zackbart/connecta 0.24.3 → 0.24.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/AGENTS.md +18 -20
  2. package/CHANGELOG.md +64 -1
  3. package/README.md +5 -6
  4. package/dist/branding.d.ts +31 -2
  5. package/dist/branding.js +116 -8
  6. package/dist/connectors/api.d.ts +1 -1
  7. package/dist/connectors/api.js +10 -2
  8. package/dist/connectors/guarded-fetch.d.ts +5 -1
  9. package/dist/connectors/guarded-fetch.js +34 -4
  10. package/dist/connectors/remote-mcp.js +8 -4
  11. package/dist/errors.d.ts +11 -3
  12. package/dist/errors.js +2 -1
  13. package/dist/index.d.ts +1 -1
  14. package/dist/index.js +12 -1
  15. package/dist/meta-tools.js +105 -29
  16. package/dist/operator-ui/generated.js +2 -2
  17. package/dist/operator-ui/view.d.ts +38 -1
  18. package/dist/operator-ui/view.js +71 -0
  19. package/dist/providers/cloudflare.d.ts +14 -2
  20. package/dist/providers/cloudflare.js +107 -16
  21. package/dist/providers/linear.d.ts +26 -4
  22. package/dist/providers/linear.js +19 -4
  23. package/dist/providers/mixpanel.d.ts +16 -3
  24. package/dist/providers/mixpanel.js +13 -2
  25. package/dist/providers/notion.d.ts +8 -1
  26. package/dist/providers/notion.js +83 -10
  27. package/dist/providers/revenuecat.d.ts +30 -4
  28. package/dist/providers/revenuecat.js +42 -4
  29. package/dist/providers/stripe.d.ts +7 -1
  30. package/dist/providers/stripe.js +30 -4
  31. package/dist/providers/vercel.js +11 -1
  32. package/dist/registry.d.ts +12 -4
  33. package/dist/registry.js +22 -8
  34. package/dist/types.d.ts +37 -0
  35. package/dist/ui.js +18 -10
  36. package/dist/version.d.ts +1 -1
  37. package/dist/version.js +1 -1
  38. package/documentation/architecture.md +193 -181
  39. package/documentation/auth.md +197 -176
  40. package/documentation/code-mode.md +426 -321
  41. package/documentation/meta-tools.md +356 -416
  42. package/examples/worker/AGENTS.md +2 -1
  43. package/examples/worker/README.md +12 -10
  44. package/examples/worker/src/index.ts +12 -15
  45. package/package.json +1 -2
  46. package/templates/node/.env.example +3 -3
  47. package/templates/node/AGENTS.md +5 -4
  48. package/templates/node/README.md +2 -1
  49. package/templates/node/package.json +1 -1
  50. package/templates/node/src/index.ts +23 -22
  51. package/documentation/call-admission.md +0 -158
  52. package/documentation/cloudflare.md +0 -471
  53. package/documentation/connector-guides.md +0 -176
  54. package/documentation/connectors.md +0 -431
  55. package/documentation/linear.md +0 -193
  56. package/documentation/mixpanel.md +0 -160
  57. package/documentation/notion.md +0 -308
  58. package/documentation/operations.md +0 -359
  59. package/documentation/operator-ui.md +0 -135
  60. package/documentation/optional-modules-upgrade.md +0 -243
  61. package/documentation/provider-conventions.md +0 -729
  62. package/documentation/request-admission.md +0 -204
  63. package/documentation/revenuecat.md +0 -305
  64. package/documentation/storage-and-credentials.md +0 -254
  65. package/documentation/stripe.md +0 -262
  66. package/documentation/upgrading.md +0 -768
  67. package/documentation/vercel.md +0 -241
@@ -1,768 +0,0 @@
1
- # Upgrading an existing deployment
2
-
3
- For the agent working *inside* a generated deployment rather than inside this
4
- repository. You did not create this project, you cannot re-run `connecta init`
5
- over it, and the thing you are holding is two files' worth of the owner's
6
- intent wrapped in eight files of template that has moved on without it.
7
-
8
- The shape of the job is fixed by two facts. A deployment is
9
- [config-as-code](../ethos.md): `src/index.ts` is the product, everything around
10
- it is scaffolding. And `connecta init` **refuses to merge into an existing
11
- path** — deliberately, because an initializer that overwrites is an initializer
12
- that eventually overwrites a connector set. So an upgrade is not a re-init. It
13
- is: read what you have, bump the pin, reconcile the scaffolding against the
14
- current template with the deployment's own generation as the base, migrate what
15
- the release notes broke, and prove it with `connecta doctor`.
16
-
17
- Work on a branch. Every step below is reversible until you delete the old
18
- lockfile, and you want the diff reviewable by whoever owns this deployment.
19
-
20
- ## 0.24.0 optional modules
21
-
22
- UI, encrypted credentials, activity history, and configured bearer auth now use
23
- explicit module imports. Core keeps the same seven tools and enforcement.
24
- Connecta-issued tokens are removed. Shared and personal auth management require
25
- separate explicit permissions, both denied by default; visibility alone grants
26
- neither. `activityAccess` replaces `operatorAccess` for global history reads.
27
-
28
- Follow the [optional-module migration](./optional-modules-upgrade.md) before
29
- upgrading. It includes the complete before-and-after configuration, team Worker
30
- and personal Node permission examples, issued-token client migration, disabling
31
- features, and verification. Preserve existing connector ids, identity namespaces,
32
- storage, and encryption key. Vault and OAuth records need no format migration;
33
- old issued-token records remain inert rather than being deleted automatically.
34
-
35
- ## 0.23.0 program API pruning
36
-
37
- This update removes MCP Apps rendering, connector shortcut globals,
38
- `connecta.batch`, automatic direct-call retries, and connector-owned HTTP routes. Refresh the client's MCP
39
- instructions and tool definitions after upgrading. The seven top-level tools,
40
- operator pages, credentials, result paging, and media emission remain.
41
-
42
- | Before | After |
43
- | --- | --- |
44
- | Connector `handleRequest(request, ctx)` | Move custom HTTP routes into the existing deployment fetch handler |
45
- | `await tracker.list_issues(args)` | `await connecta.call("tracker.list_issues", args)` using the exact address from discovery |
46
- | `await connecta.batch(calls)` | `Promise.all` over `connecta.call`, or `Promise.allSettled` to keep failures alongside successes |
47
- | `await connecta.ui(html)` | Return the data the client needs to render its own view |
48
- | `call_tool` or `call_destructive_tool` with `maxRetries` | Omit the removed argument; each call makes one attempt and returns typed failures with provider retry hints |
49
-
50
- A connector that still declares `handleRequest` refuses construction. Handle
51
- custom routes in the existing Node or Worker deployment before delegating other
52
- requests to `connecta.fetch`. The deployment owns authentication and security
53
- headers for its custom responses. Connecta returns 404 for unknown paths.
54
- Cloudflare Global API Key authentication and multi-field credentials remain
55
- supported; they need no migration.
56
-
57
- The direct-call schemas reject unknown arguments, including `maxRetries`, before
58
- invocation. Review stored programs and deployment-owned usage guides for the
59
- removed guest functions. Canonical addresses preserve punctuation; do not copy
60
- the old sanitized shortcut into the address string.
61
-
62
- ```js
63
- async () => {
64
- const outcomes = await Promise.allSettled([
65
- connecta.call("tracker.list_issues", { state: "started" }),
66
- connecta.call("tracker.list_projects", {}),
67
- ]);
68
- return outcomes.map((outcome) => outcome.status === "fulfilled"
69
- ? { ok: true, data: outcome.value }
70
- : { ok: false, code: outcome.reason.code, message: outcome.reason.message });
71
- }
72
- ```
73
-
74
- Reduce large successful values before returning. Promise rejection reasons are
75
- Error objects; explicitly select their fields for JSON output. Every call still
76
- passes through the existing read-only checks, admission limits, deadlines, and
77
- 20-call program budget. Rate-limited calls return `retryAfterMs` without waiting;
78
- the client can reissue after that delay. No storage migration is required.
79
-
80
- ## Read what you have first
81
-
82
- Three questions, in order. Answer all three before editing anything — the
83
- second and third are what stop you from "restoring" a file the owner changed on
84
- purpose.
85
-
86
- ### 1. What version is it pinned to
87
-
88
- ```sh
89
- node -p "require('./package.json').dependencies['@zackbart/connecta']"
90
- ```
91
-
92
- `init` writes that pin as an **exact** version, never a range, because the
93
- generated deployment and the package are separate release units
94
- ([operations](./operations.md#deployment-as-a-release-unit)). So the pin is
95
- also a fact about history: it is the version of the CLI that generated this
96
- project, unless someone has bumped it since — which `package-lock.json` will
97
- tell you.
98
-
99
- ```sh
100
- node -p "require('./package-lock.json').packages['node_modules/@zackbart/connecta'].version"
101
- ```
102
-
103
- Pin and lockfile agreeing means nobody has touched the dependency by hand. They
104
- disagreeing is the first thing to reconcile, and the lockfile is usually the
105
- truth about what has actually been running.
106
-
107
- A deployment with no `@zackbart/connecta` entry at all, or one carrying a range
108
- (`^0.14.0`), was not produced by `connecta init` — treat it as the pre-template
109
- case below.
110
-
111
- ### 2. Which template generation it came from
112
-
113
- The pin answers this, and the file layout corroborates it. Two generations
114
- exist so far:
115
-
116
- | Generation | Versions | Layout |
117
- | --- | --- | --- |
118
- | **pre-template** | before 0.10.2 | no `connecta init` existed; hand-written, or copied from the retired `examples/node` |
119
- | **A** | 0.10.2 – 0.15.1 | `.env.example`, `.gitignore`, `AGENTS.md`, `CLAUDE.md`, `README.md`, `package.json`, `src/index.ts`, `tsconfig.json` |
120
- | **B** | 0.16.0 – 0.24.3 | adds `.dockerignore`, `Dockerfile`, `docker-compose.yml`, and `src/file-activity.ts`; `src/index.ts` grows the four commented operator blocks; `.env.example` ships `CONNECTA_TOKEN=` empty |
121
-
122
- Generation A is a decade in template years and identifying it precisely does
123
- not matter, because you are about to reconstruct it exactly rather than guess
124
- at it. What matters is the boundary: a project with no `Dockerfile` is a
125
- generation A project, and the whole container story is a change it has never
126
- seen.
127
-
128
- ### 3. What this deployment changed
129
-
130
- Regenerate the deployment's *own* starting point and diff against it. `init`
131
- pins from the CLI package's version, so an old CLI reproduces its own
132
- generation byte for byte:
133
-
134
- ```sh
135
- SCRATCH=$(mktemp -d) # keep this shell
136
- (cd "$SCRATCH" && npx @zackbart/connecta@0.15.1 init base) # ← the pin from step 1
137
- ```
138
-
139
- `$SCRATCH` is the one scratch path for the whole upgrade — the reconcile step
140
- below generates the current template into it too, and every later command
141
- resolves against it. Run the rest from the deployment root:
142
-
143
- ```sh
144
- diff -ru "$SCRATCH/base" . --exclude node_modules --exclude package-lock.json
145
- ```
146
-
147
- Everything that differs is deployment-owned and survives this upgrade
148
- unconditionally. Everything identical is scaffolding you may replace without
149
- asking. Expect the interesting half to be:
150
-
151
- - **`src/index.ts`** — the connector set, `auth`, `storage`, `publicUrl`, and
152
- whichever operator blocks were uncommented. This file is never overwritten,
153
- only edited.
154
- - **`package.json`** — extra dependencies (`@clerk/backend` if operator
155
- sign-in is on, provider SDKs the owner added, anything a handler imports)
156
- and extra scripts.
157
- - **`.env.example` / deployment docs** — variables the owner's connectors read.
158
- - Whole files that are not in any generation: extra `src/*.ts` modules behind
159
- `api()` handlers, CI workflows, infrastructure.
160
-
161
- Write the list down before you touch anything. You will use it twice: once to
162
- know what to preserve, once to know what to re-verify at the end.
163
-
164
- ## The upgrade
165
-
166
- ### Bump the pin and install
167
-
168
- ```sh
169
- npm pkg set dependencies.@zackbart/connecta=0.24.0
170
- npm install
171
- ```
172
-
173
- Exact, not a range. The reason `init` pins exactly applies just as much on the
174
- way up: a deployment whose connector safety classifications can move under it
175
- during an unrelated `npm install` is not reviewable.
176
-
177
- `quickjs-emscripten` is a direct dependency of the generated project and an
178
- optional peer of the package (`^0.32.0`), so npm will tell you if the pin the
179
- template ships has fallen out of range. Match the template's pin rather than
180
- inventing one. If operator sign-in is enabled, `@clerk/backend` (`^3.12.0`) is
181
- the other optional peer — also a direct dependency of the deployment, because
182
- optional peers never install with core.
183
-
184
- Do not run the build yet. Reconcile first, so a single typecheck answers for
185
- both the new package and the new scaffolding.
186
-
187
- ### Reconcile the scaffolding
188
-
189
- Generate the *current* template beside the base you already made, into the same
190
- `$SCRATCH`:
191
-
192
- ```sh
193
- (cd "$SCRATCH" && npx @zackbart/connecta@0.24.3 init current)
194
- ```
195
-
196
- You now have a three-way merge with a real base: `$SCRATCH/base` is what this
197
- deployment started as, `$SCRATCH/current` is what `init` produces today, and the
198
- deployment is the third leg. For every file:
199
-
200
- | base vs current | deployment vs base | Do |
201
- | --- | --- | --- |
202
- | unchanged | unchanged | nothing |
203
- | unchanged | changed | keep the deployment's version |
204
- | changed | unchanged | take `$SCRATCH/current`'s version |
205
- | changed | changed | merge by hand — this is the only file class that needs judgment |
206
-
207
- `diff3` or `git merge-file` will do the mechanical part. From the deployment
208
- root, with the deployment's file first, the base second, and the current
209
- template third:
210
-
211
- ```sh
212
- git merge-file -p src/index.ts "$SCRATCH/base/src/index.ts" \
213
- "$SCRATCH/current/src/index.ts" > "$SCRATCH/merged-index.ts"
214
- ```
215
-
216
- New files in `$SCRATCH/current` that exist in neither base nor deployment are
217
- pure additions — copy them in. For generation A that is the entire container story
218
- (`Dockerfile`, `docker-compose.yml`, `.dockerignore`) plus
219
- `src/file-activity.ts`.
220
-
221
- Two things are worth knowing before you accept the merge:
222
-
223
- - **`.env.example` is not decoration.** The 0.16.0 template ships
224
- `CONNECTA_TOKEN=` **empty** on purpose: both Compose and `src/index.ts`
225
- refuse to start until an operator sets it, where the old `replace-me` value
226
- started a healthy, port-published deployment whose bearer token was a string
227
- published in a public repository. Take the empty value. Adding the
228
- deployment's own variables underneath is the merge; restoring a placeholder
229
- bearer is not.
230
- - **`src/index.ts` is a merge, not a takeover.** What you are adopting from
231
- `$SCRATCH/current` is the environment reading (`PUBLIC_URL`, `CONNECTA_STATE_FILE`,
232
- treating empty as unset — that is what lets one source serve both `npm start`
233
- and the container) and the commented operator blocks. What you are keeping is
234
- every connector, every credential slot, every handler, and every operator
235
- block this deployment had already uncommented. If a block is live here and
236
- commented in the current template, live wins.
237
-
238
- `AGENTS.md` (and the `CLAUDE.md` symlink beside it) is the deployment's
239
- instruction file for the next agent. Take the current one, then re-append
240
- whatever the owner added — it is usually the only "template" file with real
241
- local content in it.
242
-
243
- ### The pre-template case
244
-
245
- A deployment older than 0.10.2 has no base to diff against. Do not try to
246
- manufacture one. Instead:
247
-
248
- 1. `SCRATCH=$(mktemp -d)`, then
249
- `(cd "$SCRATCH" && npx @zackbart/connecta@0.24.3 init current)` — there is no
250
- `base` leg here, only the current template to read from.
251
- 2. Copy `$SCRATCH/current` into the deployment file by file, **skipping
252
- `src/index.ts`**.
253
- 3. Port the deployment's existing configuration into the new `src/index.ts` by
254
- hand, one connector at a time, reading each version boundary below as you
255
- go.
256
-
257
- It is more work and it is honest work: a project of that vintage predates the
258
- executor requirement, the seven-tool surface, and the `api()` construction
259
- contract, so it needs a read anyway.
260
-
261
- ## Version boundaries
262
-
263
- Only what breaks an existing deployment is listed. Everything else in
264
- [`CHANGELOG.md`](../CHANGELOG.md) is additive, and a boundary absent from this
265
- list is a boundary you can cross with a version bump. The sections run newest
266
- first, so cross them bottom-up: start at the oldest one still above this
267
- deployment's pin and work back up the page, because each boundary assumes the
268
- older ones are already done.
269
-
270
- ### 0.23.0 → 0.24.3
271
-
272
- 0.24.3 validates the browser `Origin` header on `/mcp`. A browser MCP client
273
- hosted on an origin other than `publicUrl` or loopback now gets a 403 until
274
- the deployment lists it in `allowedOrigins` (or sets `"*"` to keep the old
275
- open CORS); clients that send no `Origin`, which is every server-side and CLI
276
- client, are unaffected. The overload and shutdown JSON-RPC error codes moved
277
- from `-32001`/`-32002` to `-31001`/`-31002`; the `data.code` strings are
278
- unchanged. See [request admission](./request-admission.md#origin-before-admission).
279
- `fileStorage` now holds an exclusive lock on its state file: a second process
280
- opening the same file fails at construction, so a deployment that shared one
281
- file between two processes must give each its own. The returned store gained
282
- `close()`. `get_result` stashes are bounded per runtime by the new `results`
283
- config (8 MiB and 64 entries by default) and partitioned by any authenticated
284
- subject, not only by providers that declare an activity namespace.
285
-
286
- Use the [optional-module migration](./optional-modules-upgrade.md) to select
287
- modules, grant auth-management permissions, and migrate issued-token clients.
288
- Preserve storage, encryption keys, and identity namespaces. 0.24.1 adds two
289
- optional settings, `execute.maxHostCalls` and `execute.hostCallTimeoutMs`, for
290
- deployments whose providers legitimately run past the 20-call and 15-second
291
- `execute_code` defaults, and one bounded `warn` log line per failed connector
292
- call; neither needs migration. 0.24.2 adds tool-level
293
- `connectorAccess` grants and optional named pools at `/mcp/<pool>`; a
294
- deployment that declares neither is unchanged. See [pools](./auth.md#pools).
295
-
296
- ### 0.22.3 → 0.23.0
297
-
298
- Migrate stored programs and custom connector routes using the
299
- [0.23.0 migration](#0230-program-api-pruning). Refresh client instructions
300
- and tool definitions so account titles and the revised discovery guidance take
301
- effect. No storage migration is required.
302
-
303
- ### 0.21.2 → 0.22.3
304
-
305
- Connector and user policy remain config-as-code. If `identity.connectorAccess`
306
- is configured, every interactive human may now manage the authentication of
307
- each connector that resolver makes visible. A personal connector changes only
308
- that principal's partition; a shared connector changes the deployment-wide
309
- grant. Keep shared connectors out of a member's view, or change them to
310
- `authScope: "personal"`, when that member must not rotate the shared grant.
311
- `identity.operatorAccess` continues to govern deployment access tokens and
312
- global activity.
313
-
314
- Paged results also move under the authenticated subject's storage partition.
315
- Finish any important in-flight `get_result` sequence before upgrading; its old
316
- result id is not readable from the new partition after deployment. No persisted
317
- connector catalog or credential migration is required.
318
-
319
- ### 0.20.0 → 0.21.2
320
-
321
- 0.21.2 adds no deployment migration beyond 0.21.0. The boundary is additive
322
- for Node and existing Clerk deployments. The new Worker path
323
- uses Cloudflare Access identity directly and removes Clerk only after the edge
324
- cutover has been verified. An agent can perform every repository edit; a human
325
- must attach Access, choose its policy, create service credentials, and enable
326
- Managed OAuth in the Cloudflare dashboard.
327
-
328
- For a Worker currently using Clerk, keep rollback live through the cutover:
329
-
330
- 1. Bump and install 0.21.2. Add the new provider **before** the existing Clerk
331
- provider, but remove nothing:
332
-
333
- ```ts
334
- import { cloudflareAccessAuth } from
335
- "@zackbart/connecta/auth/cloudflare-access";
336
- import { clerkAuth } from "@zackbart/connecta/auth/clerk";
337
-
338
- auth: [
339
- cloudflareAccessAuth(),
340
- // Keep the deployment's existing options and secrets unchanged.
341
- clerkAuth({ /* existing configuration */ }),
342
- ],
343
- ```
344
-
345
- Before Access is attached, the new provider fails closed and the operator
346
- shell selects Clerk. Deploy this state and run doctor with the existing
347
- `CONNECTA_TOKEN`. This separates the package/code change from the edge
348
- change and proves the old path still works.
349
-
350
- 2. In Cloudflare, attach Access to the Worker itself, apply the intended human
351
- policy, and enable Managed OAuth. Through the API this is an Access
352
- application destination of `{ "type": "worker", "worker_id": "<script
353
- tag>" }`, not a hostname application for the `workers.dev` URL: the latter
354
- gates traffic but does not provide `ctx.access`. Create an Access service
355
- token and a **Service Auth** policy for doctor and fully unattended clients.
356
- In the application's Managed OAuth settings, enable Dynamic Client
357
- Registration and add these three **Allowed redirect URIs**:
358
-
359
- ```text
360
- https://claude.ai/api/mcp/auth_callback
361
- https://chatgpt.com/connector_platform_oauth_redirect
362
- https://chatgpt.com/connector/oauth/*
363
- ```
364
-
365
- They map to
366
- `oauth_configuration.dynamic_client_registration.allowed_uris` in the
367
- Access API, not to the identity policy. The two ChatGPT entries cover its
368
- stable and callback-id forms. An empty list fails client registration only
369
- after discovery, so do not treat a working `/.well-known/*` response as
370
- proof that this step is complete.
371
- Do not create a bypass for `/.well-known/*`; Managed OAuth owns that
372
- discovery surface.
373
-
374
- 3. Reconnect interactive MCP clients to `<PUBLIC_URL>/mcp`. Their old Clerk
375
- OAuth tokens are not Cloudflare credentials, so each client performs one new
376
- browser authorization. An agent can edit client configuration and start the
377
- flow; the user still completes the identity-provider prompt. Move CI, cron,
378
- and server-to-server callers from connecta bearers to the two Access service
379
- headers. The cutover warning is literal: once Access is attached, a static
380
- bearer or `cta_…` token by itself is stopped at the edge before connecta can
381
- inspect it.
382
-
383
- 4. Verify the edge path:
384
-
385
- ```sh
386
- CF_ACCESS_CLIENT_ID=… CF_ACCESS_CLIENT_SECRET=… \
387
- npx connecta doctor --url https://connecta.example.workers.dev
388
- ```
389
-
390
- Open `/` as a human and exercise any enabled credential, token, and OAuth
391
- controls. A service token may pass doctor and MCP but must receive 403 from
392
- operator mutations.
393
-
394
- 5. After an observation window, remove `clerkAuth`, its import,
395
- `@clerk/backend`, and the Clerk variables/secrets. Until then they are inert
396
- behind Access but preserve rollback. Rollback order matters: detach Access
397
- first, then the untouched Clerk sessions and connecta bearers reach the
398
- Worker again. Reverting code first cannot help a request the edge still
399
- blocks. There is no storage migration and no token-format conversion.
400
-
401
- If the Worker exposes an intentionally public connector route, create a
402
- more-specific hostname/path Access application with a Bypass policy for that
403
- route only. `/health`, downstream OAuth callbacks, operator shells, and MCP are
404
- private under the canonical whole-Worker shape; doctor knows how to authenticate
405
- its health request.
406
-
407
- ### 0.19.0 → 0.20.0
408
-
409
- Three intake paths become deliberately strict. None changes storage, the two
410
- deployment shapes, or the exact seven-tool MCP surface.
411
-
412
- - `createConnecta` now rejects every unknown own configuration property by its
413
- complete path. Remove typos and options retired before 0.19, including the
414
- top-level `toolkits`, `credentialHealth`, `surface`, and `maxResultBytes`,
415
- plus `credentials.health` and `calls.maxBatchResultBytes`. Connector, auth,
416
- storage, activity-store, logger, deployment-metadata, and executor
417
- implementations remain open objects; their implementation-specific fields
418
- are not configuration typos.
419
- - `call_tool` and `call_destructive_tool` no longer accept `fields`. Put
420
- projection in one `execute_code` program. For a legitimate oversized direct
421
- read, call without `fields` and follow the returned `get_result` action; that
422
- paging path remains part of the seven-tool surface.
423
- - `connecta.ui` accepts one HTML string and is display-only. Remove its second
424
- read-binding argument and any page calls to `connecta.read`. Fetch and shape
425
- data in the program before rendering, then return the same compact summary
426
- the view initially displays. Views cannot call any Connecta tool.
427
-
428
- The Node template layout remains generation B. Reconcile it as usual after the
429
- version bump; no new deployment file or environment variable is required.
430
-
431
- ### 0.18.3 → 0.19.0
432
-
433
- Nothing changes for a deployment. Bump the version and reconcile the template
434
- as usual; no configuration, storage, runtime, or model-facing boundary moved.
435
- The release deletes unreachable compatibility code and consolidates source and
436
- tests behind the same public behavior. Six design records also moved out of the
437
- npm package and now live only at their GitHub URLs. They were maintainer history,
438
- not deployment documentation.
439
-
440
- ### 0.18.2 → 0.18.3
441
-
442
- Nothing throws for an existing deployment, and the version bump alone crosses
443
- this boundary. Successful explicitly read-only calls whose provider declares
444
- no output schema now teach later discovery the result's field names and broad
445
- JSON types. The open optional-field shape is labeled
446
- `outputSchemaSource: "observed"`, lives only in a bounded runtime cache, and
447
- starts cold after 24 hours, a process restart, or Worker isolate eviction. No
448
- configuration or storage migration is involved, and discovery still never
449
- executes a tool.
450
-
451
- ### 0.18.1 → 0.18.2
452
-
453
- Nothing throws for an existing deployment, and the version bump alone crosses
454
- it. The release adds a third `auth` shape to `remoteMcp()` and every maintained
455
- hosted connection — `{ type: "credential" }` — under which the connector
456
- declares an operator slot on `/credentials` and reads the pasted value on each
457
- request. A deployment carrying a static key as a runtime secret
458
- (`auth: { type: "headers", headers: { Authorization: env.KEY } }`) keeps
459
- working unchanged; moving it behind `/credentials` is an edit to the connector's
460
- `auth` and one paste on the operator page, and needs `credentials.encryptionKey`
461
- configured — a deployment without a vault gets a startup warning and
462
- `recovery: "unavailable"` at use for that connector, not a boot failure. Two
463
- Linear notes: the `headers` example in `documentation/linear.md` now shows
464
- `Bearer ${key}` (Linear's MCP server documents that framing), and the credential
465
- shape sends `Bearer` by default; a `headers` connector already sending a bare
466
- key is untouched.
467
-
468
- ### 0.18.0 → 0.18.1
469
-
470
- Nothing throws, no option moves, and every deployment crosses this on the
471
- version bump alone. The release adds one provider subpath,
472
- `@zackbart/connecta/providers/revenuecat`, and rewrites guide text inside the
473
- `mixpanel()` and `stripe()` connections; a deployment that constructs neither
474
- sees no change, and one that does gets better first-line advice for the same
475
- constructor calls. Clients that cache connector guides should refresh them
476
- after upgrading.
477
-
478
- ### 0.17.0 → 0.18.0
479
-
480
- One floor moves and one always-loaded surface shrinks; neither changes a
481
- deployment's configuration.
482
-
483
- **Node 22 is the minimum supported release.** The published engine range and
484
- the Node template both declare `>=22.0.0`, matching the template's
485
- `node:22-slim` image. A Docker deployment already runs Node 22; a bare-metal
486
- deployment on Node 20 must upgrade its runtime before taking this version.
487
- Worker deployments are unaffected (#422).
488
-
489
- **Model-facing guidance is split by load cost.** MCP instructions and tool
490
- definitions now carry route selection, the fail-closed boundary, and minimum
491
- guest syntax. Detailed selection, repair, runtime, and example guidance moved
492
- to the existing `skills({ name: "usage" })` response. Clients that never fetch
493
- the skill keep the same routes and need no deployment change; clients that
494
- cache tool definitions should refresh them after upgrading (#418).
495
-
496
- ### 0.16.1 → 0.17.0
497
-
498
- Two construction rules need a deployment check.
499
-
500
- **A Dynamic Worker executor is loader-only.** The supported construction is
501
- exactly:
502
-
503
- ```ts
504
- new DynamicWorkerExecutor({ loader: env.LOADER })
505
- ```
506
-
507
- Remove `bindings`, `modules`, or `globalOutbound` from that options object.
508
- Those fields grant guest code ambient configuration, code, or egress. This is
509
- the supported sandbox boundary rather than a new Connecta-side inspection of
510
- the third-party executor object. The shipped Worker example was already
511
- loader-only, and Node deployments use `quickJsExecutor()`, so neither needs a
512
- change (#390).
513
-
514
- **An explicit guide summary must fit discovery.** Connecta normalizes
515
- whitespace in `usageGuide.summary` and refuses registry construction when the
516
- result is longer than 120 characters. Shorten it to 120 characters or fewer,
517
- or omit it and let Connecta derive a bounded summary from the guide's opening
518
- prose. A blank explicit summary still takes the derived-summary path (#392).
519
-
520
- ### 0.16.0 → 0.16.1
521
-
522
- Nothing throws, and a Node deployment crosses this on the version bump alone.
523
- The one thing that can stop the upgrade is npm, and only on a Worker:
524
- `@cloudflare/codemode` is now a declared optional peer at `^0.4.4 || ^0.5.0`,
525
- so a `package.json` holding it below that range fails `npm install` with an
526
- `ERESOLVE` conflict instead of installing. Move the pin into the range this
527
- release is tested against. Separately, `cloudflare()` no longer names
528
- `list_zone_settings` — read one setting with `get_zone_setting`, write one with
529
- `update_zone_setting` — and Cloudflare's 404 now arrives as `not_found` rather
530
- than `connector_call_failed`, which matters only to a program that branches on
531
- the code.
532
-
533
- ### 0.15.x → 0.16.0
534
-
535
- The largest one, and it fails loudly. Every item here throws at construction or
536
- fails a specific call; none of it degrades quietly.
537
-
538
- **`api()` enforces its construction contract.** Every hand-written tool now
539
- needs three things, checked when the connector is built:
540
-
541
- - a non-empty `description` — it is what an agent reads to choose the tool;
542
- - an explicit boolean `annotations.readOnlyHint` — `true` for a read, `false`
543
- for work that must cross `call_destructive_tool`;
544
- - an `inputSchema`, if it ships one, that the validator can actually compile.
545
-
546
- The throw names the failing address (`connectorId.toolName`), so this is a
547
- mechanical walk through `src/index.ts`. The one judgment call is the
548
- classification, and the safe answer is written down for you: **a tool that used
549
- to ship unannotated becomes `readOnlyHint: false`**, because unannotated
550
- already routed through `call_destructive_tool`. That is the routing it had.
551
- Writing `true` onto a tool you have not read is not an upgrade, it is a
552
- capability change.
553
-
554
- Connecta infers the classification from nothing — not a name, not a verb, not
555
- an HTTP method, not the other annotations. There is no flag that restores the
556
- old forgiving behavior.
557
-
558
- **`ApiOptions.strictValidation` is gone.** Delete it. Fail-closed schema
559
- handling is the only behavior left, so the option had nothing to switch. A
560
- schema that only reveals itself as unenforceable on first use — an unresolvable
561
- `$ref`, say — now fails that call as non-retryable `invalid_args` instead of
562
- forwarding raw arguments to the handler. `validateArgs: false` still exists and
563
- still means what it said: opting out of enforcement, not out of the schema
564
- being real.
565
-
566
- **`linear()` requires `access`.** Construction throws naming both options.
567
- `access: "read-write"` preserves an existing deployment's behavior exactly;
568
- `"read-only"` binds the connector to Linear's read-only endpoint, whose token
569
- cannot reach the write APIs at all. There is no default because neither guess
570
- is safe — one hands out writes nobody asked for, the other breaks a writing
571
- deployment at Linear, at runtime, where no agent can repair it
572
- ([linear](./linear.md)).
573
-
574
- **`mixpanel()` declares no call-admission budget.** The old hardcoded 600
575
- calls/hour transcribed a limit Mixpanel meters *per user*, which a per-runtime
576
- counter cannot approximate in either direction. Nothing throws — the ceiling is
577
- simply absent. If this deployment was relying on it, pass `callAdmission`
578
- explicitly ([call admission](./call-admission.md)). The default title also now
579
- carries the region (`Mixpanel (us)`), and an unknown `region` throws.
580
-
581
- **Three Cloudflare tools are gone; the connection ships 52.** `set_r2_cors`,
582
- `delete_r2_cors`, and `get_r2_metrics`. Grep the deployment — and any prompt,
583
- skill, or runbook around it — for those names. No capability is lost:
584
- `get_r2_cors` still reads a bucket's policy, CORS writes go through
585
- `cloudflare_api_mutate` at
586
- `PUT`/`DELETE /accounts/{accountId}/r2/buckets/{bucketName}/cors`, and metrics
587
- through `cloudflare_api_get` at `/accounts/{accountId}/r2/metrics`
588
- ([cloudflare](./cloudflare.md)).
589
-
590
- **`cloudflare()` checks an overridden `baseUrl` at construction.** A
591
- non-loopback plain-http origin, URL-embedded credentials, or a query or
592
- fragment now throws where the option is written rather than on the first call.
593
- A deployment pointing Cloudflare at an http proxy must move it to https or bind
594
- it to loopback. The default base is unaffected, so a deployment that never set
595
- `baseUrl` reads nothing here.
596
-
597
- **Cloudflare and Notion refuse redirects and bound their reads.** Both now send
598
- `redirect: "manual"`; a 3xx fails as non-retryable `connector_call_failed`
599
- rather than re-sending the connector's credential to whatever origin `Location`
600
- names. Both also cap the response they will read — 8 MiB for Cloudflare, 4 MiB
601
- for Notion — checked against a declared `Content-Length` and again while the
602
- body streams. Visible only to a deployment that was pulling something enormous
603
- through a tool call, such as a `cloudflare_api_get` on a large R2 object. These
604
- are ceilings on absurdity; anything near them was already past whatever
605
- `maxResultBytes` the deployment set.
606
-
607
- **The shipped defaults fail closed.** Covered under `.env.example` above, and
608
- repeated here because it is the item most likely to be "fixed" backwards: an
609
- empty `CONNECTA_TOKEN` that refuses to boot is the intended state of a fresh
610
- `.env.example`, not a regression.
611
-
612
- ### 0.13.x → 0.14.x
613
-
614
- No API breaks. One behavior change worth knowing: vetted annotations on a
615
- prebuilt connection no longer argue with an explicit downstream annotation in
616
- either direction, so a name the downstream explicitly marks `readOnlyHint:
617
- true` that no release has classified is now callable from `execute_code`
618
- instead of failing closed onto the approval path. Silence on an unclassified
619
- name still means not read-only. The one branch that still outranks the
620
- downstream is a name a release reviewed and filed destructive.
621
-
622
- ### 0.12.x → 0.13.0
623
-
624
- No API breaks; text changed under existing deployments. Served tool
625
- descriptions and the MCP `instructions` string were rewritten, and `skills({})`
626
- now summarizes a connector guide from its first body line rather than its
627
- heading — a guide opening `# Acme` that listed as "Acme" now lists as the
628
- sentence beneath it. If this deployment's connectors carry usage guides, read
629
- their first lines ([connector guides](./connector-guides.md)).
630
-
631
- ### 0.10.x → 0.11.0
632
-
633
- The executor boundary. **Every deployment must configure an executor** and
634
- serves exactly seven tools; construction refuses to boot without one. On Node
635
- that is `quickJsExecutor()` from `@zackbart/connecta/quickjs`; on Workers,
636
- `new DynamicWorkerExecutor({ loader: env.LOADER })` from
637
- `@cloudflare/codemode` plus its paid-plan Worker Loader binding.
638
-
639
- The top-level `list_connectors`, `describe_tools`, and `batch_call`
640
- registrations are gone. Their equivalents live inside `execute_code` as
641
- `connecta.search`, `connecta.describe`, and `connecta.batch`
642
- ([code mode](./code-mode.md)). Anything outside the deployment that called
643
- those three by name — a client config, a prompt, a script — is what actually
644
- breaks here; the deployment file itself only has to gain the executor and drop
645
- `surface`.
646
-
647
- ### 0.6.x → 0.7.0
648
-
649
- Only a pre-template deployment is still down here; every generation A project
650
- was born above this line. Three breaks, and the config one is in the table
651
- below.
652
-
653
- **A connector implementing `finishAuth` without `verifyState` can no longer
654
- complete OAuth** (#62). The callback refuses with the same opaque 400 as every
655
- other refusal, exchanges no code, and logs one operator-grade line naming the
656
- connector and the missing hook. `verifyState` is optional in the type system and
657
- required in practice wherever `finishAuth` is present, so nothing throws at
658
- construction — the flow simply stops completing, which is the one item in this
659
- guide you find by reading rather than by building. It reaches hand-written
660
- connectors only: the shipped `remoteMcp` OAuth provider has always implemented
661
- it. The old behavior was exchanging an authorization code with no CSRF guard at
662
- all, so this is not a hook to stub out with `() => true`.
663
-
664
- **`/`, `/credentials`, and `/activity` are core-owned routes** (#57). They
665
- previously fell through to connector `handleRequest` and then to a 404, so a
666
- connector that served any of the three is now shadowed without warning. `GET /`
667
- returns the operator shell where 0.6.1 returned 404, and a non-GET on those
668
- routes or on `/ui` returns 405 instead of falling through. For the current release, move custom handlers into the deployment: connector
669
- `handleRequest` is now removed. See the [current migration](#0230-program-api-pruning).
670
-
671
- ### Removed options that throw
672
-
673
- These fail at construction rather than falling back to a default, because
674
- silently ignoring a removed option is how a deployment runs a policy its config
675
- file says it has. Releases through 0.19 name the migration in the error. Version
676
- 0.20's strict configuration boundary names the unknown path; this table remains
677
- the migration map:
678
-
679
- | Option | Removed in | Do |
680
- | --- | --- | --- |
681
- | `accessTokens` | 0.24.0 | migrate issued-token clients to provider OAuth or configured bearer auth; old records become inert |
682
- | `credentials` | 0.24.0 | `vault: encryptedCredentialVault(storage, encryptionKey)` from `/credentials` |
683
- | `branding` | 0.24.0 | `ui: operatorUi({ branding })` from `/ui` |
684
- | `identity.operatorAccess` | 0.24.0 | `identity.activityAccess`; grant shared and personal auth management separately |
685
- | `toolkits`, `unscoped` | 0.8.1 (#178) | delete; deploy one instance per audience |
686
- | `credentials.health`, `credentialHealth` | 0.8.1 (#179) | delete; credentials fail at use |
687
- | `surface` | 0.11.0 (#273) | delete; there is one seven-tool surface |
688
- | `calls.maxBatchResultBytes` | 0.11.0 (#273) | delete; program batching is bounded by `execute_code`'s own limits |
689
- | flat v0.6 config paths | 0.7.0 | move into their groups ([operations](./operations.md#configuration)) |
690
-
691
- ## Verify
692
-
693
- In order, and do not skip the last one — the first three prove the package
694
- works, not that this deployment does.
695
-
696
- ```sh
697
- npm run typecheck # ships with the template
698
- CONNECTA_TOKEN=dev-token npm start # in one shell
699
- CONNECTA_TOKEN=dev-token npm run doctor # in another
700
- ```
701
-
702
- `connecta doctor` is the gate. It asserts `/health` reports ok, that
703
- `tools/list` is exactly the seven prescribed names — `authorize_connector`,
704
- `call_destructive_tool`, `call_tool`, `execute_code`, `get_result`,
705
- `search_tools`, `skills` — and that `execute_code` actually runs a program in
706
- the sandbox. It names the executor the deployment reports rather than assuming
707
- one: `QuickJS executed` on the Node template, `DynamicWorkerExecutor executed`
708
- on a Worker. It also *reports* catalog drift without failing on it; drifted
709
- counts here are a maintainer's next task, not a failed upgrade.
710
-
711
- Then exercise this deployment's own connectors, which doctor knows nothing
712
- about — it holds a bearer, and a client key does not get to learn a
713
- deployment's configuration topology. One program covers discovery and a call:
714
-
715
- ```js
716
- // execute_code — an empty query browses the catalog
717
- async () => {
718
- const page = await connecta.search({ query: "", limit: 100 });
719
- return {
720
- total: page.total,
721
- connectors: [...new Set(page.tools.map((t) => t.address.split(".")[0]))],
722
- };
723
- };
724
- ```
725
-
726
- Walk the list from the inventory you wrote down: every connector the owner
727
- configured should appear, every credential slot should still be listed at
728
- `/credentials`, and at least one real read per connector should return data.
729
- A connector whose catalog is empty after an upgrade is usually a credential
730
- that did not survive a state-file path change, not a broken release.
731
-
732
- If the container half is now in play, `cp .env.example .env`, set
733
- `CONNECTA_TOKEN`, and `docker compose up -d --build`, then point doctor at it.
734
- Commit the `package-lock.json` that `npm install` wrote on the host — that is
735
- what puts the image build on the reproducible `npm ci` path instead of
736
- resolving the pin again inside a layer.
737
-
738
- ## What not to do
739
-
740
- Five refusals. Each one is somebody's plausible shortcut, and each one produces
741
- a deployment that is quieter and wrong.
742
-
743
- - **Do not re-init over the top.** `connecta init` refuses to merge into an
744
- existing path and that refusal is load-bearing. Working around it — into a
745
- scratch directory and then `cp -r` over the deployment, or by deleting the
746
- project and regenerating — is how a connector set becomes a `time` connector.
747
- Scratch directories are for reading and diffing, never for copying wholesale.
748
- - **Do not weaken a fail-closed default to get green.** `readOnlyHint: true` on
749
- a tool you have not read, a restored `CONNECTA_TOKEN=replace-me`,
750
- `validateArgs: false` to silence a schema that will not compile, an
751
- annotation "corrected" to match what the downstream claims: all of these turn
752
- a construction error into a running deployment with a wider blast radius than
753
- it had yesterday. The construction throw is the feature. Fix the input.
754
- - **Do not pin back.** A deployment that boots on 0.15.1 and throws on 0.16.0
755
- is a deployment telling you which line to fix, with the address in the error
756
- message. Reverting the pin keeps the same defect and buries the report.
757
- - **Do not copy Connecta internals into the deployment.** If something the
758
- deployment needs is not exported, that is a package issue to file, not a file
759
- to vendor. A deployment that carries a copy of a provider cannot be upgraded
760
- by anyone, including you, next time.
761
- - **Do not add a second project shape.** No alternate entrypoint, no second
762
- container recipe, no parallel configuration path beside `src/index.ts`. There
763
- are exactly two deployment shapes — [`templates/node/`](../templates/node/)
764
- and the Worker example — and a third that is a diff away from one of them is
765
- a shape this repository has already deleted once.
766
-
767
- When something here disagrees with [`ethos.md`](../ethos.md), the ethos wins
768
- and this guide is what needs fixing.