@zackbart/connecta 0.40.0 → 0.42.0
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.
- package/CHANGELOG.md +148 -0
- package/bin/connecta.mjs +26 -17
- package/bin/meta-tool-names.d.mts +3 -1
- package/bin/meta-tool-names.mjs +4 -1
- package/bin/version.mjs +1 -1
- package/dist/activity.d.ts +32 -5
- package/dist/activity.js +32 -6
- package/dist/advertised-schema.js +15 -0
- package/dist/agent-observation.js +24 -2
- package/dist/agent-routes.js +33 -44
- package/dist/auth/clerk.d.ts +6 -1
- package/dist/auth/clerk.js +16 -0
- package/dist/auth/cloudflare-access.js +49 -7
- package/dist/auth/downstream-oauth/consent.js +79 -29
- package/dist/auth/downstream-oauth/grant-store.js +58 -7
- package/dist/auth/downstream-oauth/refresh-coordinator.js +4 -1
- package/dist/auth/downstream-oauth/refresh-records.js +6 -5
- package/dist/auth/downstream-oauth.js +15 -4
- package/dist/auth/oauth-request-not-sent.js +4 -0
- package/dist/auth/static-oauth.js +77 -39
- package/dist/auth-elicitation.js +118 -61
- package/dist/authorization-handoff.js +36 -3
- package/dist/catalog-cache.js +352 -43
- package/dist/catalog-freshness.js +25 -0
- package/dist/catalog-service.js +408 -78
- package/dist/catalog.js +216 -62
- package/dist/config-defaults.d.ts +2 -1
- package/dist/config-defaults.js +4 -1
- package/dist/config.d.ts +53 -21
- package/dist/config.js +56 -17
- package/dist/connectors/remote-mcp/call.js +1 -1
- package/dist/connectors/remote-mcp/catalog.js +52 -28
- package/dist/connectors/remote-mcp/connection.js +113 -22
- package/dist/connectors/remote-mcp/oauth.js +2 -2
- package/dist/connectors/remote-mcp/resources.js +5 -2
- package/dist/connectors/remote-mcp/transport.js +24 -6
- package/dist/connectors/remote-mcp.js +14 -5
- package/dist/credential-contract.d.ts +3 -1
- package/dist/describe-config.d.ts +4 -2
- package/dist/describe-config.js +1 -0
- package/dist/discovery-health.js +26 -11
- package/dist/downstream-input.js +11 -2
- package/dist/errors.d.ts +60 -4
- package/dist/errors.js +88 -3
- package/dist/execute.js +491 -202
- package/dist/executor-admission.js +2 -0
- package/dist/executor-contract.js +6 -0
- package/dist/executor-result.js +3 -3
- package/dist/executors/quickjs-child.js +14 -5
- package/dist/executors/quickjs-runtime.d.ts +2 -0
- package/dist/executors/quickjs-runtime.js +37 -20
- package/dist/executors/quickjs.js +24 -7
- package/dist/guarded-transport.js +2 -0
- package/dist/guest-functions.js +5 -4
- package/dist/guest-runtime.js +37 -1
- package/dist/guest-types.d.ts +18 -0
- package/dist/http/client.js +14 -2
- package/dist/http/errors.js +9 -4
- package/dist/http/fields.js +17 -5
- package/dist/http/hatch.js +11 -3
- package/dist/http/node-transport.js +110 -4
- package/dist/http/oauth.js +17 -6
- package/dist/http/paging.js +1 -1
- package/dist/http/provider.js +2 -6
- package/dist/http/vendor.js +6 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -21
- package/dist/invocation-failure.js +28 -0
- package/dist/invocation.js +167 -64
- package/dist/membership.d.ts +1 -1
- package/dist/meta-output.js +24 -18
- package/dist/meta-tool-names.d.ts +1 -1
- package/dist/meta-tool-names.js +1 -1
- package/dist/meta-tools.js +286 -73
- package/dist/module-contracts.d.ts +3 -1
- package/dist/native-recovery.js +4 -1
- package/dist/native-tools.js +177 -55
- package/dist/node.d.ts +7 -0
- package/dist/node.js +85 -4
- package/dist/oauth-handoff.js +53 -43
- package/dist/operation-activity.js +104 -0
- package/dist/operation-vocabulary.js +6 -0
- package/dist/operator-record.d.ts +9 -1
- package/dist/operator-record.js +16 -0
- package/dist/operator-ui/generated.js +2 -2
- package/dist/program-result.js +2 -0
- package/dist/program-source.js +1 -1
- package/dist/program-writes.js +112 -19
- package/dist/provider.d.ts +1 -14
- package/dist/provider.js +0 -3
- package/dist/providers/_shared/google/kit.js +2 -2
- package/dist/providers/_shared/google/workspace.d.ts +1 -1
- package/dist/providers/breeze/api.js +2 -2
- package/dist/providers/breeze/index.js +1 -1
- package/dist/providers/breeze/skill.generated.js +1 -1
- package/dist/providers/ccb/api.js +2 -2
- package/dist/providers/ccb/index.js +1 -1
- package/dist/providers/ccb/skill.generated.js +1 -1
- package/dist/providers/cloudflare/api.js +2 -2
- package/dist/providers/cloudflare/index.js +3 -1
- package/dist/providers/cloudflare/skill.generated.js +1 -1
- package/dist/providers/docs/index.js +1 -1
- package/dist/providers/docs/skill.generated.js +1 -1
- package/dist/providers/drive/index.js +1 -1
- package/dist/providers/drive/skill.generated.js +1 -1
- package/dist/providers/forms/index.js +2 -1
- package/dist/providers/forms/skill.generated.js +1 -1
- package/dist/providers/github/api.js +98 -6
- package/dist/providers/github/index.js +8 -3
- package/dist/providers/github/lib/auth.d.ts +3 -1
- package/dist/providers/github/lib/auth.js +43 -12
- package/dist/providers/github/lib/discovery.js +11 -1
- package/dist/providers/github/lib/operations.js +8 -0
- package/dist/providers/github/safety.js +39 -0
- package/dist/providers/github/skill.generated.js +1 -1
- package/dist/providers/github/tools.js +12 -5
- package/dist/providers/gmail/index.js +2 -1
- package/dist/providers/gmail/skill.generated.js +1 -1
- package/dist/providers/granola/index.js +1 -1
- package/dist/providers/granola/skill.generated.js +1 -1
- package/dist/providers/overflow/index.js +3 -1
- package/dist/providers/overflow/skill.generated.js +1 -1
- package/dist/providers/planning-center/index.js +12 -6
- package/dist/providers/planning-center/lib/constants.d.ts +1 -1
- package/dist/providers/planning-center/skill.generated.js +1 -1
- package/dist/providers/quickbooks/api.js +28 -25
- package/dist/providers/quickbooks/index.js +3 -6
- package/dist/providers/quickbooks/lib/writes.js +55 -0
- package/dist/providers/quickbooks/safety.js +17 -5
- package/dist/providers/quickbooks/skill.generated.js +1 -1
- package/dist/providers/sheets/index.js +2 -1
- package/dist/providers/sheets/skill.generated.js +1 -1
- package/dist/providers/slides/index.js +3 -3
- package/dist/providers/slides/skill.generated.js +1 -1
- package/dist/providers/stripe/index.js +2 -2
- package/dist/providers/stripe/skill.generated.js +1 -1
- package/dist/providers/tithely/index.js +2 -1
- package/dist/providers/tithely/skill.generated.js +1 -1
- package/dist/providers/vercel/api.js +3 -2
- package/dist/providers/vercel/skill.generated.js +1 -1
- package/dist/registry.d.ts +36 -4
- package/dist/registry.js +142 -30
- package/dist/resource-read.js +21 -2
- package/dist/result-preview.js +210 -0
- package/dist/result-seal.js +168 -0
- package/dist/route-names.js +53 -0
- package/dist/routes/activity-context.js +1 -0
- package/dist/routes/activity-disclosure.js +26 -4
- package/dist/routes/activity.js +2 -1
- package/dist/routes/connect.js +21 -13
- package/dist/routes/mcp.js +83 -35
- package/dist/routes/shared.d.ts +6 -0
- package/dist/routes/ui-config.js +1 -1
- package/dist/routes/ui-data.js +3 -2
- package/dist/runtime/call.js +15 -10
- package/dist/runtime/native-storage.js +12 -0
- package/dist/runtime/request-reads.js +66 -14
- package/dist/runtime/request-scope.js +38 -2
- package/dist/runtime/run.js +4 -1
- package/dist/sent-secrets.d.ts +20 -0
- package/dist/sent-secrets.js +49 -1
- package/dist/skill-origin.js +16 -0
- package/dist/skills.js +213 -57
- package/dist/storage/d1-driver.js +33 -5
- package/dist/storage/keys.js +16 -7
- package/dist/storage/sql-native.js +60 -3
- package/dist/storage/sql.js +6 -0
- package/dist/timing-trace.js +84 -0
- package/dist/tool-safety.d.ts +33 -0
- package/dist/tool-safety.js +51 -15
- package/dist/types.d.ts +36 -0
- package/dist/url-safety.js +38 -20
- package/dist/usage-guide.js +14 -13
- package/dist/utility-recovery.js +33 -0
- package/dist/validate.js +29 -10
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker.js +60 -15
- package/documentation/architecture.md +152 -43
- package/documentation/auth.md +160 -53
- package/documentation/code-mode.md +396 -119
- package/documentation/deploying.md +35 -10
- package/documentation/hosted-mcp-migration.md +9 -3
- package/documentation/integrating.md +27 -5
- package/documentation/meta-tools.md +761 -157
- package/documentation/operating.md +91 -4
- package/documentation/operator-ui.md +51 -2
- package/documentation/providers.md +34 -20
- package/examples/worker/README.md +3 -3
- package/guides/how-it-works.md +2 -1
- package/guides/safety-and-trust.md +1 -3
- package/package.json +10 -8
- package/templates/node/AGENTS.md +3 -3
- package/templates/node/README.md +1 -1
- package/templates/node/package.json +1 -1
|
@@ -61,6 +61,17 @@ authenticated `admission.requests.maxBodyBytes` default. To accept larger MCP
|
|
|
61
61
|
bodies, configure both core and `listen(..., { maxBodyBytes })`; a smaller
|
|
62
62
|
platform, proxy or adapter cap still wins. See
|
|
63
63
|
[request body limits](./architecture.md#admission-in-two-places).
|
|
64
|
+
`listen(..., { maxInFlightBodyBytes })` caps the body bytes all in-flight
|
|
65
|
+
requests hold together, counted from the first chunk until the response finishes
|
|
66
|
+
or the client leaves. It defaults to 64 MiB, or `maxBodyBytes` when that is
|
|
67
|
+
larger, and may not be set below `maxBodyBytes`. Past it a request gets `503` with
|
|
68
|
+
`Retry-After: 1` and `Connection: close`. Raise it when legitimate concurrent
|
|
69
|
+
large bodies are refused, keeping it within the process's memory budget.
|
|
70
|
+
`listen()` answers `400` with `Connection: close`, before reading any body, when
|
|
71
|
+
`Host` is anything but a host with an optional port, when `X-Forwarded-Proto` is
|
|
72
|
+
anything but `http` or `https`, or when the request target does not start with
|
|
73
|
+
`/`. A reverse proxy must overwrite `X-Forwarded-Proto` with one value; a
|
|
74
|
+
comma-separated chain such as `https,http` is refused.
|
|
64
75
|
A Node host serving `connecta.fetch` without `listen()` has no owned sender:
|
|
65
76
|
every maintained-provider write, every reviewed POST read and every remote MCP
|
|
66
77
|
write is refused before sending. Downstream OAuth credential POSTs also require
|
|
@@ -199,7 +210,9 @@ and `describeConfig()`, and [optional modules](./architecture.md#optional-deploy
|
|
|
199
210
|
owns their composition contracts.
|
|
200
211
|
|
|
201
212
|
Enable `encryptedCredentialVault(storage, key)` before persisting downstream
|
|
202
|
-
OAuth credentials.
|
|
213
|
+
OAuth credentials. With no vault, OAuth grants are stored as plaintext. A
|
|
214
|
+
configured vault without `seal` and `open` refuses construction when any connector
|
|
215
|
+
uses OAuth.
|
|
203
216
|
The platform templates describe the base64 32-byte encryption key. Keep it
|
|
204
217
|
outside the database and source control, and preserve it across upgrades.
|
|
205
218
|
[OAuth state at rest](./auth.md#downstream-oauth-state-at-rest) owns sealing and
|
|
@@ -257,7 +270,7 @@ token and run doctor against a pool that lists the agent:
|
|
|
257
270
|
CONNECTA_TOKEN='<stored-cta-token>' npx connecta doctor --url http://localhost:8787 --pool local-machine
|
|
258
271
|
```
|
|
259
272
|
|
|
260
|
-
Doctor checks health, the required executor, and the current
|
|
273
|
+
Doctor checks health, the required executor, and the current meta-tool set, running a harmless program on each listed program route. A
|
|
261
274
|
`cta_` token is checked at `/agent/<pool>` and needs `--pool`.
|
|
262
275
|
For a Worker protected by Access, `/health` still needs edge admission even
|
|
263
276
|
though `/agent/*` bypasses Access. Use an Access service token admitted by the
|
|
@@ -284,14 +297,15 @@ connector; resolve credentials using [authorization recovery](./meta-tools.md#au
|
|
|
284
297
|
|
|
285
298
|
Use the failed check to choose the next step:
|
|
286
299
|
|
|
287
|
-
| Symptom | Action
|
|
288
|
-
| ----------------------------------- |
|
|
289
|
-
| Connection refused or timeout | Check the public URL, listening process/port, proxy, and Worker deployment.
|
|
290
|
-
| `/health` fails behind Access | Check the Worker-level Access policy and the two service headers above. Do not broaden the agent bypass.
|
|
291
|
-
| Executor check fails | Retain `quickJsExecutor()` and its peer on Node, or `workerExecutor({ loader })`, the codemode peer, and `LOADER` on Workers.
|
|
292
|
-
| MCP 401 | Check the saved token, declared agent, and slot state; rotated/revoked tokens refuse. Use `/agent/<pool>` with `--pool`.
|
|
293
|
-
| MCP 404 | Check the pool name and `members: ["agent:assistant"]`; an existing but inaccessible pool is deliberately indistinguishable from a missing one.
|
|
294
|
-
| Doctor passes but a connector fails | Discover its tools in that pool, check credential status/account ownership, and perform a bounded read. Doctor does not prove downstream access.
|
|
300
|
+
| Symptom | Action |
|
|
301
|
+
| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
302
|
+
| Connection refused or timeout | Check the public URL, listening process/port, proxy, and Worker deployment. |
|
|
303
|
+
| `/health` fails behind Access | Check the Worker-level Access policy and the two service headers above. Do not broaden the agent bypass. |
|
|
304
|
+
| Executor check fails | Retain `quickJsExecutor()` and its peer on Node, or `workerExecutor({ loader })`, the codemode peer, and `LOADER` on Workers. |
|
|
305
|
+
| MCP 401 | Check the saved token, declared agent, and slot state; rotated/revoked tokens refuse. Use `/agent/<pool>` with `--pool`. |
|
|
306
|
+
| MCP 404 | Check the pool name and `members: ["agent:assistant"]`; an existing but inaccessible pool is deliberately indistinguishable from a missing one. |
|
|
307
|
+
| Doctor passes but a connector fails | Discover its tools in that pool, check credential status/account ownership, and perform a bounded read. Doctor does not prove downstream access. |
|
|
308
|
+
| `Native discovery degraded` | The named connectors did not answer and are listed from an older catalog. Check them with a scoped search; tools stay listed but calls check the live catalog. |
|
|
295
309
|
|
|
296
310
|
After a fix, repeat doctor with the same client credentials and pool. Never
|
|
297
311
|
paste a token or raw downstream failure body into a committed diagnostic log.
|
|
@@ -302,6 +316,17 @@ Bump the exact package pin, read the [changelog](../CHANGELOG.md) for every
|
|
|
302
316
|
intervening release, and apply the relevant migration before startup. `init`
|
|
303
317
|
does not merge changes into an existing deployment.
|
|
304
318
|
|
|
319
|
+
A custom vault without `seal` and `open` now refuses construction when any
|
|
320
|
+
connector has OAuth. Before upgrading, add both methods or switch to
|
|
321
|
+
`encryptedCredentialVault(storage, key)`. Existing plaintext grants are sealed on
|
|
322
|
+
first read; see [OAuth state at rest](./auth.md#downstream-oauth-state-at-rest).
|
|
323
|
+
|
|
324
|
+
A deployment using `clerkAuth` must set a fixed URL before upgrading:
|
|
325
|
+
`ConnectaConfig.publicUrl`, or `clerkAuth({ publicUrl })`. Startup otherwise fails
|
|
326
|
+
with a configuration error. Use the origin clients reach, because tokens' `resource`
|
|
327
|
+
must match it exactly; see
|
|
328
|
+
[Clerk OAuth tokens](./auth.md#clerk-oauth-tokens-and-operator-sessions).
|
|
329
|
+
|
|
305
330
|
Before upgrading past 0.37.1 with pre-0.29 state, follow
|
|
306
331
|
[Retired layout migrations](./migration-retired-layouts.md). Version 0.37.1 is
|
|
307
332
|
the last bridge for KV → D1, JSON → SQLite, and OAuth layout-2 conversions.
|
|
@@ -401,7 +401,13 @@ classification: {
|
|
|
401
401
|
},
|
|
402
402
|
```
|
|
403
403
|
|
|
404
|
-
`"read"` sets the effective read class for tool routing and read-only exposure
|
|
404
|
+
`"read"` sets the effective read class for tool routing and read-only exposure
|
|
405
|
+
only when the server is silent about the tool, and asserts that the call is safe
|
|
406
|
+
to repeat. It has no effect on a tool the server explicitly declares a write
|
|
407
|
+
(`readOnlyHint: false`, `destructiveHint: true`, or contradictory hints); that tool
|
|
408
|
+
stays a write and an operator warning names the override.
|
|
409
|
+
`"read-repeatable"` serves such a tool as a read anyway, for a deployment that has
|
|
410
|
+
checked it and accepts that hosts may repeat the call, so the vendor can receive it twice.
|
|
405
411
|
`"write"` selects the host approval path. `"hidden"` omits the tool from search
|
|
406
412
|
and describe and refuses guessed-name calls, including programs. An absent
|
|
407
413
|
runtime tool leaves its override dormant, with one operator warning per catalog
|
|
@@ -411,8 +417,8 @@ when live hints would expose them as reads. Never copy a retired review map
|
|
|
411
417
|
wholesale or use it to broaden access or merely recover an old route.
|
|
412
418
|
|
|
413
419
|
An override does not change replay safety. A call is write-like when either its
|
|
414
|
-
effective class or its source class is write. The source class uses only the server's annotations: missing hints
|
|
415
|
-
|
|
420
|
+
effective class or its source class is write. The source class uses only the server's annotations: missing hints
|
|
421
|
+
and declared writes count as write even when deployment policy serves them as reads. Write-like
|
|
416
422
|
calls get one attempt across OAuth renewal, reconnect, authorization recovery
|
|
417
423
|
and program re-runs. An ambiguous dispatched failure, including timeout or
|
|
418
424
|
cancellation, reports an unknown outcome with no retry or wait advice. Approval,
|
|
@@ -202,7 +202,7 @@ only in deployment code through the existing `classification` map:
|
|
|
202
202
|
|
|
203
203
|
```ts
|
|
204
204
|
classification: {
|
|
205
|
-
crm: { list_tickets: "read", update_ticket: "write", internal_export: "hidden" },
|
|
205
|
+
crm: { list_tickets: "read", save_view: "read-repeatable", update_ticket: "write", internal_export: "hidden" },
|
|
206
206
|
},
|
|
207
207
|
```
|
|
208
208
|
|
|
@@ -210,8 +210,30 @@ classification: {
|
|
|
210
210
|
and describe and refuses guessed-name calls, including programs. An absent
|
|
211
211
|
runtime tool leaves its override dormant with an operator warning once per catalog change; the override
|
|
212
212
|
applies if that exact name returns. Unknown static tool names fail construction.
|
|
213
|
-
No argument can change these rules.
|
|
214
|
-
|
|
213
|
+
No argument can change these rules. `"read"` depends on what the tool's source
|
|
214
|
+
states:
|
|
215
|
+
|
|
216
|
+
- **The source explicitly declares a write** (`readOnlyHint: false`,
|
|
217
|
+
`destructiveHint: true`, or contradictory hints): the tool stays a write and is
|
|
218
|
+
never served read-annotated, because a host may resend a read-annotated call
|
|
219
|
+
after a connection failure. `call_tool` refuses it with the next step, naming
|
|
220
|
+
`call_destructive_tool`. It runs on `call_destructive_tool` and `execute_code`, and
|
|
221
|
+
read-only endpoints and connectors omit and refuse it. An operator warning names the override once per catalog change.
|
|
222
|
+
- **The source is silent** (no `readOnlyHint` and no `destructiveHint: true`): the
|
|
223
|
+
override is the only evidence, so the tool serves as a read with read
|
|
224
|
+
annotations. Setting it asserts that the call is safe to repeat, because the host
|
|
225
|
+
may resend it and Connecta cannot tell a resend from a new call.
|
|
226
|
+
|
|
227
|
+
`"read-repeatable"` is the opt-in for a tool whose source declares a write but which
|
|
228
|
+
you have checked: `crm.save_view` above adds one immutable record. It serves as a read
|
|
229
|
+
on every route, with read annotations, on read-only endpoints, through `call_tool`,
|
|
230
|
+
in programs and under its plain native name. You accept that a host may resend it after
|
|
231
|
+
a connection failure, so the vendor can receive the call twice; only use it where a
|
|
232
|
+
repeat is harmless. Connecta itself still sends it at most once, as the next paragraph
|
|
233
|
+
describes. Prefer `"read"`: if a vendor later declares a write, `"read"` fails safe and
|
|
234
|
+
`"read-repeatable"` does not.
|
|
235
|
+
|
|
236
|
+
Replay and failure decisions treat a call as a write when either its
|
|
215
237
|
effective class or its source class is write. The source class is the verified
|
|
216
238
|
server annotations;
|
|
217
239
|
deployment overrides never change it. A write gets one wire attempt across
|
|
@@ -229,8 +251,8 @@ Remote catalogs evolve. Discovery, direct calls, and programs enforce the
|
|
|
229
251
|
current annotations and `ConnectaConfig.classification` overrides. A leftover
|
|
230
252
|
`classify` option throws at construction and names that map. Provider reviews,
|
|
231
253
|
schema pins, `optional`, and `unlisted: "hide"` are removed. Missing or
|
|
232
|
-
contradictory hints make the source class write
|
|
233
|
-
the effective class read. Review behavior before setting a read override;
|
|
254
|
+
contradictory hints make the source class write. Under `"read"`, contradictory hints also keep
|
|
255
|
+
the effective class write and missing hints do not. `"read-repeatable"` serves either as a read. Review behavior before setting a read override;
|
|
234
256
|
classification does not replace downstream scopes or caller grants.
|
|
235
257
|
|
|
236
258
|
## A hand-written HTTP capability
|