@zackbart/connecta 0.40.0 → 0.41.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 +87 -0
- package/bin/version.mjs +1 -1
- package/dist/activity.d.ts +30 -4
- package/dist/activity.js +28 -2
- package/dist/agent-observation.js +24 -2
- package/dist/agent-routes.js +4 -41
- 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-records.js +6 -5
- package/dist/auth/downstream-oauth.js +12 -4
- package/dist/auth/oauth-request-not-sent.js +4 -0
- package/dist/auth/static-oauth.js +51 -21
- package/dist/catalog-cache.js +62 -21
- package/dist/catalog-freshness.js +13 -0
- package/dist/catalog-service.js +39 -12
- package/dist/catalog.js +103 -38
- package/dist/config.d.ts +10 -4
- package/dist/config.js +30 -7
- package/dist/connectors/remote-mcp/call.js +1 -1
- package/dist/connectors/remote-mcp/connection.js +52 -18
- 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 +4 -4
- package/dist/credential-contract.d.ts +3 -1
- package/dist/describe-config.d.ts +1 -0
- package/dist/describe-config.js +1 -0
- package/dist/downstream-input.js +11 -2
- package/dist/errors.d.ts +8 -1
- package/dist/errors.js +2 -0
- package/dist/execute.js +20 -7
- package/dist/executor-result.js +1 -1
- package/dist/executors/quickjs-child.js +1 -1
- package/dist/executors/quickjs-runtime.js +1 -1
- package/dist/executors/quickjs.js +1 -1
- package/dist/guarded-transport.js +2 -0
- package/dist/http/client.js +7 -0
- package/dist/http/hatch.js +2 -0
- package/dist/http/node-transport.js +110 -4
- package/dist/http/oauth.js +17 -6
- package/dist/index.js +10 -21
- package/dist/invocation-failure.js +28 -0
- package/dist/invocation.js +72 -33
- package/dist/membership.d.ts +1 -1
- package/dist/meta-tools.js +27 -13
- package/dist/module-contracts.d.ts +3 -1
- package/dist/native-tools.js +11 -4
- package/dist/node.d.ts +7 -0
- package/dist/node.js +82 -3
- package/dist/operation-activity.js +103 -0
- package/dist/operator-record.d.ts +8 -0
- package/dist/operator-record.js +15 -0
- package/dist/operator-ui/generated.js +2 -2
- package/dist/provider.d.ts +1 -1
- package/dist/providers/_shared/google/workspace.d.ts +1 -1
- package/dist/providers/breeze/index.js +1 -1
- package/dist/providers/ccb/index.js +1 -1
- package/dist/providers/cloudflare/index.js +1 -1
- package/dist/providers/docs/index.js +1 -1
- package/dist/providers/drive/index.js +1 -1
- package/dist/providers/forms/index.js +1 -1
- package/dist/providers/github/index.js +1 -1
- package/dist/providers/gmail/index.js +1 -1
- package/dist/providers/granola/index.js +1 -1
- package/dist/providers/overflow/index.js +1 -1
- package/dist/providers/planning-center/index.js +1 -1
- package/dist/providers/planning-center/lib/constants.d.ts +1 -1
- package/dist/providers/quickbooks/api.js +28 -25
- package/dist/providers/quickbooks/index.js +1 -1
- 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 +1 -1
- package/dist/providers/slides/index.js +1 -1
- package/dist/providers/stripe/index.js +2 -2
- package/dist/providers/tithely/index.js +1 -1
- package/dist/providers/vercel/api.js +1 -0
- package/dist/registry.js +16 -4
- package/dist/resource-read.js +21 -2
- package/dist/route-names.js +44 -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/mcp.js +32 -13
- package/dist/routes/ui-config.js +1 -1
- package/dist/routes/ui-data.js +3 -2
- package/dist/runtime/native-storage.js +12 -0
- package/dist/runtime/request-reads.js +66 -14
- package/dist/runtime/request-scope.js +2 -1
- package/dist/skill-origin.js +16 -0
- package/dist/skills.js +132 -43
- package/dist/storage/d1-driver.js +33 -5
- package/dist/storage/keys.js +7 -1
- package/dist/storage/sql-native.js +60 -3
- package/dist/storage/sql.js +6 -0
- package/dist/timing-trace.js +84 -0
- package/dist/types.d.ts +5 -0
- package/dist/url-safety.js +38 -20
- package/dist/utility-recovery.js +33 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker.js +33 -8
- package/documentation/architecture.md +48 -1
- package/documentation/auth.md +116 -36
- package/documentation/code-mode.md +61 -46
- package/documentation/deploying.md +25 -1
- package/documentation/meta-tools.md +113 -11
- package/documentation/operating.md +86 -1
- package/documentation/operator-ui.md +51 -2
- package/documentation/providers.md +16 -14
- package/package.json +10 -8
- package/templates/node/package.json +1 -1
|
@@ -1113,9 +1113,18 @@ fields that are otherwise operator- and connector-authored, so `connectorId`
|
|
|
1113
1113
|
and `toolName` clamp at 128 UTF-8 bytes (`address` at 257) with a `…` marker:
|
|
1114
1114
|
payload-free _by construction_ means the event has nowhere to put a payload.
|
|
1115
1115
|
|
|
1116
|
-
**V4.**
|
|
1117
|
-
|
|
1118
|
-
|
|
1116
|
+
**V4.** By default the execution and its utility operations emit no events.
|
|
1117
|
+
With `activityHistory({ operations: true })`, each executed search, describe,
|
|
1118
|
+
result page and skill read adds a `kind: "operation"` row, and the whole program
|
|
1119
|
+
adds a `program` row with host-call counts. Utility attempts refused above the
|
|
1120
|
+
execution boundary remain represented by the program's host-call accounting.
|
|
1121
|
+
Rows use fixed operation names rather than argument-supplied addresses or IDs;
|
|
1122
|
+
they carry timings, typed outcomes/codes and serialized return byte counts,
|
|
1123
|
+
never program source or payloads. The existing detached sink handles storage,
|
|
1124
|
+
and these rows do not count as calls or friction. The
|
|
1125
|
+
[operation-history contract](./operator-ui.md#opt-in-to-operation-history)
|
|
1126
|
+
owns opt-in cost, scope and owner disclosure rules. Recording history changes
|
|
1127
|
+
no authorization or capability state.
|
|
1119
1128
|
|
|
1120
1129
|
**V5.** A write a program issues after it has already returned is not
|
|
1121
1130
|
sent and records nothing: it was never an attempt (`W9`).
|
|
@@ -1337,6 +1346,12 @@ receive a fixed description.
|
|
|
1337
1346
|
|
|
1338
1347
|
### Verification
|
|
1339
1348
|
|
|
1349
|
+
The QuickJS child imports only the guest runtime, IPC helpers and dependency-light
|
|
1350
|
+
error/route constants. `test/purity.node.test.ts` walks its emitted import graph
|
|
1351
|
+
to exclude server orchestration, Effect and the MCP SDK. The shared
|
|
1352
|
+
`InvocationFailure` constructor preserves host error identity across existing
|
|
1353
|
+
exports and typed IPC reconstruction.
|
|
1354
|
+
|
|
1340
1355
|
The earlier alternatives are in [decision history](https://github.com/zackbart/connecta/blob/main/decisions/0001-ethos-verdict-table.md)
|
|
1341
1356
|
([#267](https://github.com/zackbart/connecta/issues/267),
|
|
1342
1357
|
[#270](https://github.com/zackbart/connecta/issues/270)).
|
|
@@ -1350,49 +1365,49 @@ rejection, and branded adapter acceptance across module copies.
|
|
|
1350
1365
|
declaration against `GuestApi`, checks arguments in both directions, and rejects
|
|
1351
1366
|
invented, mistyped, and missing members and authored blocks the host refuses.
|
|
1352
1367
|
|
|
1353
|
-
| Clauses | Test
|
|
1354
|
-
| ---------------------- |
|
|
1355
|
-
| `P1`, `P5` | both guest-contract executors (TypeScript syntax, trailing terminators, wrapper recovery), `test/program-source.test.ts` (which semicolons and wrappers are recovered), `test/quickjs-executor.node.test.ts` (`normalizeCode`)
|
|
1356
|
-
| `P2`, `X5` | `test/guest-api-contract.test.ts` (Dynamic globals plus loader-only filesystem, HTTP, environment, egress, DNS, and local `data:` boundaries), `test/guest-api-contract-quickjs.node.test.ts` (exact absent globals and blocked imports), `test/deployment-shapes.node.test.ts` (loader-only Worker construction)
|
|
1357
|
-
| `P3`, `X9` | `test/guest-api-contract.test.ts`, `test/execute.test.ts`
|
|
1358
|
-
| `P4` | `test/guest-api-contract.test.ts` (no cross-run leakage), `test/execute.test.ts` (one catalog load per connector per execution)
|
|
1359
|
-
| `A1`, `A2` | `test/guest-api-contract.test.ts`, `test/execute.test.ts` (canonical addressing), `test/server.test.ts` (bounded live connector inventory)
|
|
1360
|
-
| `S1`, `S1a`, `S2` | `test/guest-api-contract.test.ts` (flat page, connector guides, schema keys, unfiltered browse), `test/execute.test.ts` (guide pagination/partial/no-match behavior and `$ref`/`allOf`), `test/meta-tools-search.test.ts` (mixed complete/partial ranking, stable pagination, the two safety classes), `test/typescript-signatures.test.ts` (the TypeScript format over provider and pathological schemas, search/describe parity, observed labeling)
|
|
1361
|
-
| `S3` | `test/guest-api-contract.test.ts` (typed uncaught bound), `test/execute.test.ts` (count limits, fan-out bound)
|
|
1362
|
-
| `S4` | both guest-contract executors (ordered mixed describe results with unknown-address, unknown-tool suggestion, and catalog-failure details), `test/meta-tools-search.test.ts` (top-level routing, no-suggestion, catalog-failure, and hostile-input bounds)
|
|
1363
|
-
| `S5`, `S6` | `test/guest-api-contract.test.ts`, `test/execute.test.ts` (`unwrapMcpResult`, fail-closed annotations, activity parity)
|
|
1364
|
-
| `S7` | `test/guest-api-contract.test.ts`, `test/execute.test.ts` (parallel calls and shared admission)
|
|
1365
|
-
| `S8`, `E1`, `X11` | both guest-contract executors (caught call, discovery, utility, removed-function, and forgery cases; typed promise rejections), `test/quickjs-executor.node.test.ts` (oversized messages, private transport, forged outcomes)
|
|
1366
|
-
| `S9` | `test/result-shapes.test.ts` (value exclusion, bounds, merging, LRU and time expiry, runtime isolation, read-only admission, declared precedence, definition invalidation, unwrapped MCP results, discovery provenance, copy isolation, failure isolation)
|
|
1367
|
-
| `S10` | `test/resource-read.test.ts` (qualified routing, whole-connector grants, personal credentials, redaction, admission, timeout, cancellation and downstream MCP reads), both guest-contract executors (successful resource reads and caught/uncaught typed failures)
|
|
1368
|
-
| `E2`, `E8` | `test/guest-api-contract.test.ts` (code → `retryable`, caught, parallel, and uncaught validation recovery, a conflict's bounded `current`), `test/meta-tools-call.test.ts` (direct, destructive, provider fallback), `test/validate.test.ts` (bounded payload-free findings), `test/errors.test.ts`
|
|
1369
|
-
| `E3`, `E4` | `test/guest-api-contract.test.ts`, `test/execute.test.ts` (`auth_required`, destructive reroute), `test/identity-write-journey.node.test.ts` (read-only refusals before validation or dispatch, actual QuickJS)
|
|
1370
|
-
| `E5` | `test/guest-api-contract.test.ts` (execution-failure channel, in-flight `cancelled`), `test/execute.test.ts` (admission), `test/executor-admission.test.ts`, `test/quickjs-executor.node.test.ts` (mid-run shutdown)
|
|
1371
|
-
| `E6`, `X8` | `test/guest-api-contract.test.ts` (unknown and inherited members, retained error identities), `test/quickjs-executor.node.test.ts`
|
|
1372
|
-
| `E7` | `test/guest-api-contract.test.ts` (refusals about a `503`-named connector), `test/errors.test.ts`
|
|
1373
|
-
| `R1`, `R2`, `R3`, `R4` | `test/guest-api-contract.test.ts` and `test/guest-api-contract-quickjs.node.test.ts` (small pass-through, shared return paging and unavailable fallback, no repeated writes, live authority), `test/program-result-cases.ts` (reconstruction, redaction, notice survives a 2,000-character spill)
|
|
1374
|
-
| `M6`, `M9` | verdicts; `R2`'s guard, `M1`'s strict typing, and `M2`'s collect-then-deliver are their enforcement
|
|
1375
|
-
| `R5` | `test/guest-api-contract.test.ts`
|
|
1376
|
-
| `R6`–`R8` | `test/guest-api-contract.test.ts` (normal result keys), `test/execute.test.ts` (opt-in operation aggregates, failure paths, payload exclusion)
|
|
1377
|
-
| `Y1`, `Y2`, `Y3` | `test/guest-api-contract.test.ts` (one attempt per call, retryable flags by code)
|
|
1378
|
-
| `Y4` | `test/meta-tools-call.test.ts`, `test/call-admission.test.ts` (one attempt, retry hints, caller reissue)
|
|
1379
|
-
| `L1`, `L2` | `test/guest-api-contract.test.ts` (in-flight call fails `cancelled`), `test/execute.test.ts` (cancels outstanding host calls, discovery included, and refuses discovery after the run; a cancelled wedged executor, or one whose `acquire()` ignores the signal, returns promptly and releases its lease)
|
|
1380
|
-
| `L3`, `X1` | `test/guest-api-contract.test.ts` (short-deadline executors), `test/execute.test.ts` (the watchdog ends a never-settling executor, frees the default pool, spares a slow run, and falls back from an unusable value)
|
|
1381
|
-
| `L4`, `L8` | `test/guest-api-contract.test.ts`, `test/execute.test.ts` (shared discovery/call budgets and terminal catch-and-continue loops and queued-write cancellation on both executors)
|
|
1382
|
-
| `L5`, `L7`, `X2` | `test/quickjs-executor.node.test.ts` (CPU, heap), `test/execute.test.ts` and `test/executor-admission.test.ts` (bounded admission and queue), `test/executor-requests.test.ts` (queued handoffs and refusal shape across separate workerd requests), `test/request-context.node.test.ts` (queued and QuickJS host-call request context)
|
|
1383
|
-
| `L6`, `X10` | `test/guest-api-contract-quickjs.node.test.ts` and `test/guest-api-contract.test.ts` (whole oversized reads and one-write pageable handles), `test/sqlite-storage.node.test.ts` and `test/storage-sql-d1.test.ts` (SQL stash and native D1 fault probes), `test/quickjs-executor.node.test.ts` (bridge and IPC bounds for arguments and result; the address in the over-bound message)
|
|
1384
|
-
| `V1`–`V4` | `test/guest-api-contract.test.ts` (dispatched calls, every refusal class including an address no connector owns, the friction each derives, no event
|
|
1385
|
-
| `V5`, `W9` | `test/program-writes.test.ts` (unawaited program drain, failed-program accounting), `test/identity-write-journey.node.test.ts` (committed ambiguity, reconciliation and physical writes), `test/invocation-pipeline.test.ts` (the gate after validation, an unrecorded refusal)
|
|
1386
|
-
| `W10`, `W12` | `test/identity-write-journey.node.test.ts` (real HTTP/MCP and QuickJS: write budget, read-only discovery and refusal, named guide, pool inheritance/reopening and connector policy), `test/program-writes.test.ts` (construction refusals and classification drift), `test/browser/operator-ui.spec.ts` (the badge)
|
|
1387
|
-
| `M1` | `test/guest-api-contract.test.ts` (invalid emits throw catchably, accept nothing), `test/execute-emit.test.ts` (rejected shapes, bounded native snapshots, paging before metadata traversal, and cyclic presentation refusal)
|
|
1388
|
-
| `M2`, `M3` | `test/guest-api-contract.test.ts` (delivery order, truncated return plus delivered blocks), `test/execute-emit.test.ts` (envelope, `structuredContent`, byte-for-byte no-emit path)
|
|
1389
|
-
| `M4` | `test/guest-api-contract.test.ts` (discard is visible), `test/execute-emit.test.ts` (structured and plain paths), `test/quickjs-executor.node.test.ts` (mid-run shutdown)
|
|
1390
|
-
| `M5`, `M7` | `test/execute-emit.test.ts` (both budgets fail the crossing block; host-call budget untouched)
|
|
1391
|
-
| `M8` | two arms passing one case table, `test/codemode-compat.test.ts`
|
|
1392
|
-
| `M10` | `test/execute-emit.test.ts` (aggregate present, numbers only, absent when nothing emitted)
|
|
1393
|
-
| `X4` | `test/guest-api-contract.test.ts` (string logs only), `test/quickjs-executor.node.test.ts` (logs before cancellation)
|
|
1394
|
-
| `X3`, `X6` | `test/quickjs-executor.node.test.ts` (cancels a running child, never-settling await), `test/execute.test.ts` (a wedged executor stops being awaited)
|
|
1395
|
-
| `X7` | `P3`'s tests; the Workers superset is deliberately unused
|
|
1368
|
+
| Clauses | Test |
|
|
1369
|
+
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1370
|
+
| `P1`, `P5` | both guest-contract executors (TypeScript syntax, trailing terminators, wrapper recovery), `test/program-source.test.ts` (which semicolons and wrappers are recovered), `test/quickjs-executor.node.test.ts` (`normalizeCode`) |
|
|
1371
|
+
| `P2`, `X5` | `test/guest-api-contract.test.ts` (Dynamic globals plus loader-only filesystem, HTTP, environment, egress, DNS, and local `data:` boundaries), `test/guest-api-contract-quickjs.node.test.ts` (exact absent globals and blocked imports), `test/deployment-shapes.node.test.ts` (loader-only Worker construction) |
|
|
1372
|
+
| `P3`, `X9` | `test/guest-api-contract.test.ts`, `test/execute.test.ts` |
|
|
1373
|
+
| `P4` | `test/guest-api-contract.test.ts` (no cross-run leakage), `test/execute.test.ts` (one catalog load per connector per execution) |
|
|
1374
|
+
| `A1`, `A2` | `test/guest-api-contract.test.ts`, `test/execute.test.ts` (canonical addressing), `test/server.test.ts` (bounded live connector inventory) |
|
|
1375
|
+
| `S1`, `S1a`, `S2` | `test/guest-api-contract.test.ts` (flat page, connector guides, schema keys, unfiltered browse), `test/execute.test.ts` (guide pagination/partial/no-match behavior and `$ref`/`allOf`), `test/meta-tools-search.test.ts` (mixed complete/partial ranking, stable pagination, the two safety classes), `test/typescript-signatures.test.ts` (the TypeScript format over provider and pathological schemas, search/describe parity, observed labeling) |
|
|
1376
|
+
| `S3` | `test/guest-api-contract.test.ts` (typed uncaught bound), `test/execute.test.ts` (count limits, fan-out bound) |
|
|
1377
|
+
| `S4` | both guest-contract executors (ordered mixed describe results with unknown-address, unknown-tool suggestion, and catalog-failure details), `test/meta-tools-search.test.ts` (top-level routing, no-suggestion, catalog-failure, and hostile-input bounds) |
|
|
1378
|
+
| `S5`, `S6` | `test/guest-api-contract.test.ts`, `test/execute.test.ts` (`unwrapMcpResult`, fail-closed annotations, activity parity) |
|
|
1379
|
+
| `S7` | `test/guest-api-contract.test.ts`, `test/execute.test.ts` (parallel calls and shared admission) |
|
|
1380
|
+
| `S8`, `E1`, `X11` | both guest-contract executors (caught call, discovery, utility, removed-function, and forgery cases; typed promise rejections), `test/quickjs-executor.node.test.ts` (oversized messages, private transport, forged outcomes) |
|
|
1381
|
+
| `S9` | `test/result-shapes.test.ts` (value exclusion, bounds, merging, LRU and time expiry, runtime isolation, read-only admission, declared precedence, definition invalidation, unwrapped MCP results, discovery provenance, copy isolation, failure isolation) |
|
|
1382
|
+
| `S10` | `test/resource-read.test.ts` (qualified routing, whole-connector grants, personal credentials, redaction, admission, timeout, cancellation and downstream MCP reads), both guest-contract executors (successful resource reads and caught/uncaught typed failures) |
|
|
1383
|
+
| `E2`, `E8` | `test/guest-api-contract.test.ts` (code → `retryable`, caught, parallel, and uncaught validation recovery, a conflict's bounded `current`), `test/meta-tools-call.test.ts` (direct, destructive, provider fallback), `test/validate.test.ts` (bounded payload-free findings), `test/errors.test.ts` |
|
|
1384
|
+
| `E3`, `E4` | `test/guest-api-contract.test.ts`, `test/execute.test.ts` (`auth_required`, destructive reroute), `test/identity-write-journey.node.test.ts` (read-only refusals before validation or dispatch, actual QuickJS) |
|
|
1385
|
+
| `E5` | `test/guest-api-contract.test.ts` (execution-failure channel, in-flight `cancelled`), `test/execute.test.ts` (admission), `test/executor-admission.test.ts`, `test/quickjs-executor.node.test.ts` (mid-run shutdown) |
|
|
1386
|
+
| `E6`, `X8` | `test/guest-api-contract.test.ts` (unknown and inherited members, retained error identities), `test/quickjs-executor.node.test.ts` |
|
|
1387
|
+
| `E7` | `test/guest-api-contract.test.ts` (refusals about a `503`-named connector), `test/errors.test.ts` |
|
|
1388
|
+
| `R1`, `R2`, `R3`, `R4` | `test/guest-api-contract.test.ts` and `test/guest-api-contract-quickjs.node.test.ts` (small pass-through, shared return paging and unavailable fallback, no repeated writes, live authority), `test/program-result-cases.ts` (reconstruction, redaction, notice survives a 2,000-character spill) |
|
|
1389
|
+
| `M6`, `M9` | verdicts; `R2`'s guard, `M1`'s strict typing, and `M2`'s collect-then-deliver are their enforcement |
|
|
1390
|
+
| `R5` | `test/guest-api-contract.test.ts` |
|
|
1391
|
+
| `R6`–`R8` | `test/guest-api-contract.test.ts` (normal result keys), `test/execute.test.ts` (opt-in operation aggregates, failure paths, payload exclusion) |
|
|
1392
|
+
| `Y1`, `Y2`, `Y3` | `test/guest-api-contract.test.ts` (one attempt per call, retryable flags by code) |
|
|
1393
|
+
| `Y4` | `test/meta-tools-call.test.ts`, `test/call-admission.test.ts` (one attempt, retry hints, caller reissue) |
|
|
1394
|
+
| `L1`, `L2` | `test/guest-api-contract.test.ts` (in-flight call fails `cancelled`), `test/execute.test.ts` (cancels outstanding host calls, discovery included, and refuses discovery after the run; a cancelled wedged executor, or one whose `acquire()` ignores the signal, returns promptly and releases its lease) |
|
|
1395
|
+
| `L3`, `X1` | `test/guest-api-contract.test.ts` (short-deadline executors), `test/execute.test.ts` (the watchdog ends a never-settling executor, frees the default pool, spares a slow run, and falls back from an unusable value) |
|
|
1396
|
+
| `L4`, `L8` | `test/guest-api-contract.test.ts`, `test/execute.test.ts` (shared discovery/call budgets and terminal catch-and-continue loops and queued-write cancellation on both executors) |
|
|
1397
|
+
| `L5`, `L7`, `X2` | `test/quickjs-executor.node.test.ts` (CPU, heap), `test/execute.test.ts` and `test/executor-admission.test.ts` (bounded admission and queue), `test/executor-requests.test.ts` (queued handoffs and refusal shape across separate workerd requests), `test/request-context.node.test.ts` (queued and QuickJS host-call request context) |
|
|
1398
|
+
| `L6`, `X10` | `test/guest-api-contract-quickjs.node.test.ts` and `test/guest-api-contract.test.ts` (whole oversized reads and one-write pageable handles), `test/sqlite-storage.node.test.ts` and `test/storage-sql-d1.test.ts` (SQL stash and native D1 fault probes), `test/quickjs-executor.node.test.ts` (bridge and IPC bounds for arguments and result; the address in the over-bound message) |
|
|
1399
|
+
| `V1`–`V4` | `test/guest-api-contract.test.ts` (dispatched calls, every refusal class including an address no connector owns, the friction each derives, no execution event by default), `test/identity-write-journey.node.test.ts` (opt-in real-program utility/program rows, payload exclusion and detached writes), `test/activity.test.ts` (the shared code → friction table, the identity clamp, the one-attempt floor), `test/browser/operator-ui.spec.ts` (identity changes), `test/sql-storage-contract.ts`, run by `test/sqlite-storage.node.test.ts` (historical activity rows still round-trip) |
|
|
1400
|
+
| `V5`, `W9` | `test/program-writes.test.ts` (unawaited program drain, failed-program accounting), `test/identity-write-journey.node.test.ts` (committed ambiguity, reconciliation and physical writes), `test/invocation-pipeline.test.ts` (the gate after validation, an unrecorded refusal) |
|
|
1401
|
+
| `W10`, `W12` | `test/identity-write-journey.node.test.ts` (real HTTP/MCP and QuickJS: write budget, read-only discovery and refusal, named guide, pool inheritance/reopening and connector policy), `test/program-writes.test.ts` (construction refusals and classification drift), `test/browser/operator-ui.spec.ts` (the badge) |
|
|
1402
|
+
| `M1` | `test/guest-api-contract.test.ts` (invalid emits throw catchably, accept nothing), `test/execute-emit.test.ts` (rejected shapes, bounded native snapshots, paging before metadata traversal, and cyclic presentation refusal) |
|
|
1403
|
+
| `M2`, `M3` | `test/guest-api-contract.test.ts` (delivery order, truncated return plus delivered blocks), `test/execute-emit.test.ts` (envelope, `structuredContent`, byte-for-byte no-emit path) |
|
|
1404
|
+
| `M4` | `test/guest-api-contract.test.ts` (discard is visible), `test/execute-emit.test.ts` (structured and plain paths), `test/quickjs-executor.node.test.ts` (mid-run shutdown) |
|
|
1405
|
+
| `M5`, `M7` | `test/execute-emit.test.ts` (both budgets fail the crossing block; host-call budget untouched) |
|
|
1406
|
+
| `M8` | two arms passing one case table, `test/codemode-compat.test.ts` |
|
|
1407
|
+
| `M10` | `test/execute-emit.test.ts` (aggregate present, numbers only, absent when nothing emitted) |
|
|
1408
|
+
| `X4` | `test/guest-api-contract.test.ts` (string logs only), `test/quickjs-executor.node.test.ts` (logs before cancellation) |
|
|
1409
|
+
| `X3`, `X6` | `test/quickjs-executor.node.test.ts` (cancels a running child, never-settling await), `test/execute.test.ts` (a wedged executor stops being awaited) |
|
|
1410
|
+
| `X7` | `P3`'s tests; the Workers superset is deliberately unused |
|
|
1396
1411
|
|
|
1397
1412
|
The surface itself is checked by `test/server.test.ts` (the exact six-tool list)
|
|
1398
1413
|
and `test/program-writes.test.ts` (deployment policy and classification construction refusals).
|
|
@@ -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
|
|
@@ -302,6 +315,17 @@ Bump the exact package pin, read the [changelog](../CHANGELOG.md) for every
|
|
|
302
315
|
intervening release, and apply the relevant migration before startup. `init`
|
|
303
316
|
does not merge changes into an existing deployment.
|
|
304
317
|
|
|
318
|
+
A custom vault without `seal` and `open` now refuses construction when any
|
|
319
|
+
connector has OAuth. Before upgrading, add both methods or switch to
|
|
320
|
+
`encryptedCredentialVault(storage, key)`. Existing plaintext grants are sealed on
|
|
321
|
+
first read; see [OAuth state at rest](./auth.md#downstream-oauth-state-at-rest).
|
|
322
|
+
|
|
323
|
+
A deployment using `clerkAuth` must set a fixed URL before upgrading:
|
|
324
|
+
`ConnectaConfig.publicUrl`, or `clerkAuth({ publicUrl })`. Startup otherwise fails
|
|
325
|
+
with a configuration error. Use the origin clients reach, because tokens' `resource`
|
|
326
|
+
must match it exactly; see
|
|
327
|
+
[Clerk OAuth tokens](./auth.md#clerk-oauth-tokens-and-operator-sessions).
|
|
328
|
+
|
|
305
329
|
Before upgrading past 0.37.1 with pre-0.29 state, follow
|
|
306
330
|
[Retired layout migrations](./migration-retired-layouts.md). Version 0.37.1 is
|
|
307
331
|
the last bridge for KV → D1, JSON → SQLite, and OAuth layout-2 conversions.
|
|
@@ -120,9 +120,11 @@ read-only endpoint nothing writes: `search_tools`, `connecta.search`, and
|
|
|
120
120
|
`connecta.describe` omit write tools as if the connector lacked them, and
|
|
121
121
|
every write call through `call_tool`, `call_destructive_tool`, or a program is
|
|
122
122
|
refused before validation or dispatch with `read_only_endpoint`,
|
|
123
|
-
`retryable: false`, and
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
`retryable: false`, and an explicit statement that no write route exists here.
|
|
124
|
+
Bootstrap instructions state the serving endpoint’s actual write policy. Connector
|
|
125
|
+
guides preserve their authored Markdown and prepend the effective read-only
|
|
126
|
+
endpoint or connection restriction: steps that change data will be refused.
|
|
127
|
+
The agent reports the limitation and can ask the operator for a writable connection. Connecta
|
|
126
128
|
never pauses, replays, or approves a program.
|
|
127
129
|
|
|
128
130
|
Both search routes return the flat page specified under
|
|
@@ -373,7 +375,7 @@ even when a connector has that id, whose guide stays at `connector:usage` or
|
|
|
373
375
|
`Connector "<id>" has no usage guide.`; any other unknown name fails as an
|
|
374
376
|
unknown skill. Names containing `:`, including URIs, never fall back to a bare
|
|
375
377
|
id. MCP `skills/get` resolves names the same way; `resources/read` accepts only
|
|
376
|
-
document URIs.
|
|
378
|
+
document URIs. Canonical names and document/root URIs take priority over compatibility aliases. An alias shared by multiple guides fails as ambiguous; use the canonical URI.
|
|
377
379
|
|
|
378
380
|
A connector-scoped lexical miss keeps that connector's guide metadata under
|
|
379
381
|
`queryAnalysis`. This matters for generic wrappers whose broad tool name
|
|
@@ -405,12 +407,16 @@ connector inventory, budgets, the endpoint's read-only setting, and whether any
|
|
|
405
407
|
visible connector has a guide. No catalog outcome, call, authorization state,
|
|
406
408
|
or other live status reaches `tools/list` or the instructions, so the
|
|
407
409
|
always-loaded surface stays byte-stable for a client's prompt cache.
|
|
408
|
-
|
|
410
|
+
Instructions reflect the surface and endpoint write policy, subject to connector
|
|
411
|
+
restrictions. When all admitted connectors are read-only, instructions state that
|
|
412
|
+
writes are unavailable. They also include pool scope: at
|
|
409
413
|
`/mcp/<pool>` and `/agent/<pool>`, a pool that sets a
|
|
410
|
-
[`description`](./auth.md#pools) has it
|
|
414
|
+
[`description`](./auth.md#pools) has it placed first after `Use skills. `, so
|
|
411
415
|
the model learns that endpoint's scope, for example
|
|
412
|
-
`
|
|
413
|
-
|
|
416
|
+
`Use skills. Team tier: shared tools only. For someone's own mail or files, ask them to message you one-on-one.`
|
|
417
|
+
The guide pointer precedes the scope so both appear in the first 512 characters
|
|
418
|
+
for a description of up to 500 characters. The routing rules follow. Meta instructions use compact equivalent routing rules
|
|
419
|
+
when a scope is present. Plain `/mcp` never carries one. The description changes no tool or tool
|
|
414
420
|
description, and `initialize` and `server/discover` stay `cacheScope: "private"`,
|
|
415
421
|
so a client keeps what it learned per endpoint. Connector
|
|
416
422
|
guides stay scoped to the deployment that listed them even when two deployments
|
|
@@ -419,17 +425,36 @@ the short conditional guide pointers in its tool definitions.
|
|
|
419
425
|
|
|
420
426
|
### Native Skills extension
|
|
421
427
|
|
|
428
|
+
The [Skills extension](https://github.com/modelcontextprotocol/ext-skills) is Beta under
|
|
429
|
+
[SEP-3392](https://modelcontextprotocol.io/seps/3392-extension-lifecycle): breaking
|
|
430
|
+
revisions can reuse its ID. The released settings define no `revision`; Connecta
|
|
431
|
+
refuses downstream declarations with an explicit revision rather than enabling
|
|
432
|
+
unknown semantics. Upward handlers remain Connecta-owned to preserve caller views.
|
|
433
|
+
|
|
422
434
|
Connecta declares `resources: {}` and `io.modelcontextprotocol/skills`, then
|
|
423
435
|
serves `skills/list`, `skills/get`, `resources/list` and `resources/read` from
|
|
424
436
|
the same registry as `skills` and `connecta.skill`. These methods return
|
|
425
|
-
`resultType: "complete"
|
|
437
|
+
`resultType: "complete"` and `cacheScope: "private"`. Local-only caller views
|
|
438
|
+
advertise `ttlMs: 300000` (five minutes); any visible downstream skill source
|
|
439
|
+
keeps `ttlMs: 0`, including reads of local guides on that view. Clients must key
|
|
440
|
+
private caches by endpoint and authenticated caller. No request-bound catalog or
|
|
441
|
+
digest promise is retained across requests. Listing pages
|
|
426
442
|
contain at most five complete skills: usage first, required connector guides
|
|
427
443
|
next, other connector guides, downstream skills, then the investigation guide.
|
|
428
444
|
Subsequent pages use `cursor`/`nextCursor`. Local lookup works without listing.
|
|
429
445
|
|
|
430
446
|
The local document URIs are `skill://connecta/usage/SKILL.md` and
|
|
431
447
|
`skill://connecta/connectors/<slug>/SKILL.md`. A valid Agent Skills connector ID
|
|
432
|
-
is its slug; other IDs use
|
|
448
|
+
is its slug; other IDs use a readable normalized ID slug plus a 12-character
|
|
449
|
+
SHA-256 suffix. Generated slugs reserve every configured connector ID and append
|
|
450
|
+
a deterministic numeric suffix on collision. Avoid a connector ID equal to another
|
|
451
|
+
connector's generated name: allocation depends on the IDs a catalog can see, so
|
|
452
|
+
adding one moves the other guide to a suffixed name.
|
|
453
|
+
The former `connector-<48-character-hash>` names, roots and file URIs remain
|
|
454
|
+
resolvable aliases. Construction warns, without rejecting a guide, when its
|
|
455
|
+
summary has no English task verb or operation noun from the advisory heuristic
|
|
456
|
+
(for example, a credential-only scope statement). Set `usageGuide.summary`
|
|
457
|
+
to say when to load it; non-English prose may produce a false-positive warning.
|
|
433
458
|
The suffix makes each
|
|
434
459
|
document a valid Agent Skills file; the roots `skill://connecta/usage` and
|
|
435
460
|
`skill://connecta/connectors/<connector-id>` also resolve. Provider guides are
|
|
@@ -459,6 +484,19 @@ from skill manifests; neither skill catalogs nor file bodies enter its response
|
|
|
459
484
|
cache. A failed or malformed opted-in listing fails the entire skills catalog,
|
|
460
485
|
with no partial cache. Known local guides remain readable during an outage.
|
|
461
486
|
|
|
487
|
+
On `skills` and program `connecta.skill` reads, downstream text is prefixed with
|
|
488
|
+
a fixed third-party origin sentence naming the connector (bounded to 128 ID
|
|
489
|
+
characters). This prefix has no closing delimiter. `skills` listings carry the
|
|
490
|
+
same sentence before each downstream description, collapsed to one line, in text
|
|
491
|
+
and structured output. Program `connecta.read` applies it to text contents whose
|
|
492
|
+
URI uses the `skill:` scheme or ends in `SKILL.md`; a downstream's other resources
|
|
493
|
+
are returned as ordinary data, and binary contents are not labeled. Maintained and
|
|
494
|
+
deployment guides remain unlabeled. Native `skills/get` metadata and `resources/read`
|
|
495
|
+
contents stay unchanged so original manifest digests remain verifiable; adding a
|
|
496
|
+
label there would break integrity checks. A native host must attach its own origin
|
|
497
|
+
label when it loads verified content into model context, as the Skills extension
|
|
498
|
+
requires.
|
|
499
|
+
|
|
462
500
|
Downstream files are proxied byte-exact, including CRLF and binary supporting
|
|
463
501
|
files, within 512 files and 16 MiB per skill. Catalog metadata is bounded to
|
|
464
502
|
1,024 entries and 8 MiB. The existing request-scoped agent boundary redacts
|
|
@@ -1129,11 +1167,47 @@ Activity records each of these refusals with the coarse `friction` class derived
|
|
|
1129
1167
|
from its typed error code — `tool_not_found`, `schema_retry`,
|
|
1130
1168
|
`destructive_reroute`, `auth_required` — and clamps the caller-authored
|
|
1131
1169
|
`connectorId`, `toolName`, and `address` it keeps, both under
|
|
1132
|
-
[code mode](./code-mode.md#activity)'s `V2` and `V3`.
|
|
1170
|
+
[code mode](./code-mode.md#activity)'s `V2` and `V3`. Optional
|
|
1171
|
+
[operation history](./operator-ui.md#opt-in-to-operation-history) records
|
|
1172
|
+
search, skill and result reads with fixed names, without arguments or payloads;
|
|
1173
|
+
it is off by default and separate from downstream-call counts. A `call_tool` result too
|
|
1133
1174
|
large to return inline is the one exception: it is friction
|
|
1134
1175
|
(`result_too_large`) on a call whose `outcome` is still `"success"`, so it
|
|
1135
1176
|
carries no `errorCode`.
|
|
1136
1177
|
|
|
1178
|
+
Recovery actions outside the tool namespace use `nextAction.action` and a
|
|
1179
|
+
`purpose`: `reconnect_host` repairs inbound HTTP authentication (separate from
|
|
1180
|
+
connector OAuth), `contact_operator` reports catalog or utility availability,
|
|
1181
|
+
`inspect_capabilities` requests a supporting client/operation, and
|
|
1182
|
+
`recover_result` requests a retained handle or an honest missing-output report.
|
|
1183
|
+
Unsupported task, Skills, and resource capabilities use the non-retryable
|
|
1184
|
+
`unsupported_capability` code with `inspect_capabilities`. Missing or expired handles have `code: not_found`; storage outages retain
|
|
1185
|
+
`code: unavailable`. Neither action authorizes anything or replays writes.
|
|
1186
|
+
Unknown skill names and connectors without a guide retain their local lookup
|
|
1187
|
+
diagnostic with `code: not_found` and a `nextAction` calling `skills` with no
|
|
1188
|
+
name to discover available names. They do not request service restoration.
|
|
1189
|
+
The search output schema describes action discriminators compactly; action
|
|
1190
|
+
advice is additive, while catalog error and authorization handoff fields retain
|
|
1191
|
+
their detailed contracts.
|
|
1192
|
+
A spent read continuation's fresh-call action takes precedence over generic
|
|
1193
|
+
retry advice, while auth and provider permission repair prerequisites and unknown-write reconciliation remain
|
|
1194
|
+
in force. HTTP 401/403 responses preserve the adapter status and challenge. JSON responses
|
|
1195
|
+
carry the host recovery envelope. Custom non-JSON responses preserve their body
|
|
1196
|
+
and lifetime, with the same typed facts in `Connecta-Error-Code`,
|
|
1197
|
+
`Connecta-Recovery`, and JSON-encoded `Connecta-Next-Action` headers (also exposed
|
|
1198
|
+
to cross-origin hosts).
|
|
1199
|
+
|
|
1200
|
+
## Recovery limits
|
|
1201
|
+
|
|
1202
|
+
Typed `invalid_args` failures without validation findings point to scoped schema
|
|
1203
|
+
inspection. `not_found` asks the caller to verify the resource id, account and
|
|
1204
|
+
visibility. `unavailable` asks the operator to restore connector availability.
|
|
1205
|
+
These use `nextAction` for an executable action and `retry` for explicit limits.
|
|
1206
|
+
An uncertain write has no safe replay action: read its target to reconcile its
|
|
1207
|
+
outcome before deciding on any fresh operation. Host authentication requires
|
|
1208
|
+
reconnecting the host; downstream authorization handoffs repair credentials;
|
|
1209
|
+
provider permission denial requires the resource owner to grant access.
|
|
1210
|
+
|
|
1137
1211
|
## Argument recovery
|
|
1138
1212
|
|
|
1139
1213
|
Standard API hatches refuse marker containment in request paths and query
|
|
@@ -1452,6 +1526,13 @@ pool's surface.
|
|
|
1452
1526
|
|
|
1453
1527
|
`search_tools`, `call_tool`, and `call_destructive_tool` are not listed. Auth failures still carry their handoff in the error envelope.
|
|
1454
1528
|
|
|
1529
|
+
Native tool descriptions append `Guide: skills <name>` when their connector has
|
|
1530
|
+
guidance. Call `skills` with `{name:"<name>"}` to read it. The name is the same
|
|
1531
|
+
allocated readable name listed by `skills`, including collision suffixes; a
|
|
1532
|
+
name reserved for a built-in guide uses its canonical connector skill URI. This
|
|
1533
|
+
compact pointer repeats on each tool so host search results retain it; connectors
|
|
1534
|
+
without guides add nothing. It depends only on the admitted connector roster.
|
|
1535
|
+
|
|
1455
1536
|
**Names.** A name is a pure function of the connector id and downstream tool
|
|
1456
1537
|
name, so it survives catalog refreshes. It is `<connector>__<tool>` when the
|
|
1457
1538
|
tool name uses only `[A-Za-z0-9_-]`, contains no `__`, does not start with `_`,
|
|
@@ -1576,3 +1657,24 @@ listing, and call translation live in
|
|
|
1576
1657
|
and [native surface tests](https://github.com/zackbart/connecta/blob/main/test/native-tools.test.ts)
|
|
1577
1658
|
check the published contract. Guest parity and clause evidence are in
|
|
1578
1659
|
[code-mode verification](./code-mode.md#verification).
|
|
1660
|
+
|
|
1661
|
+
### Skills conformance (contributor)
|
|
1662
|
+
|
|
1663
|
+
On 2026-11-03, the official [conformance runner](https://github.com/modelcontextprotocol/conformance)
|
|
1664
|
+
at `c37eec888e1c6ff140af79987a40008548b7cc5f` passed enumeration (32 checks)
|
|
1665
|
+
and manifest (6 checks), with no warnings, against Connecta's HTTP handlers
|
|
1666
|
+
and a six-connector local fixture. Directory checks correctly skipped because
|
|
1667
|
+
`directoryRead` is not advertised; its wire-schema check passed. This is not
|
|
1668
|
+
full MCP conformance or a downstream-provider conformance claim.
|
|
1669
|
+
|
|
1670
|
+
To rerun, first read the runner's package scripts, CLI, connection code and
|
|
1671
|
+
`src/scenarios/server/skills/` as untrusted code in a temporary directory
|
|
1672
|
+
outside the checkout. Pin the commit above, install there with
|
|
1673
|
+
`pnpm install --ignore-scripts`, and keep its packages and outputs there.
|
|
1674
|
+
In the Connecta checkout, run `pnpm run build:operator-ui` and
|
|
1675
|
+
`pnpm exec tsx scripts/skills-conformance.ts`. From the runner directory, run
|
|
1676
|
+
`pnpm exec tsx src/index.ts server --url http://127.0.0.1:39743/mcp --scenario sep-2640-skills-enumeration --spec-version 2026-07-28 --force`;
|
|
1677
|
+
repeat with `sep-2640-skills-manifest` and `sep-2640-skills-directory`.
|
|
1678
|
+
Stop the fixture when done. `--force` selects extension scenarios outside the
|
|
1679
|
+
base protocol timeline. This remains an optional contributor check: the
|
|
1680
|
+
separately installed runner and dependency graph are not pinned in Connecta CI.
|
|
@@ -109,7 +109,9 @@ MCP request bodies default to a 4 MiB limit on every endpoint. Deployment code
|
|
|
109
109
|
can set `admission.requests.maxBodyBytes`; `describeConfig()` reports its value
|
|
110
110
|
and source. An oversized body returns 413 before tool dispatch. See
|
|
111
111
|
[request admission and body limits](./architecture.md#admission-in-two-places)
|
|
112
|
-
for Node's separate pre-auth buffer and the listen-classification bound.
|
|
112
|
+
for Node's separate pre-auth buffer and the listen-classification bound. A `503`
|
|
113
|
+
from Node before auth means all in-flight bodies together passed
|
|
114
|
+
[`maxInFlightBodyBytes`](./deploying.md#start-on-node).
|
|
113
115
|
|
|
114
116
|
Direct calls may return a preview and a result handle. Page the handle through
|
|
115
117
|
`connecta.result` in a program using the returned offset and byte limits, or
|
|
@@ -162,3 +164,86 @@ and [execution](https://github.com/zackbart/connecta/blob/main/src/execute.ts).
|
|
|
162
164
|
and [guest-contract tests](https://github.com/zackbart/connecta/blob/main/test/guest-api-contract.test.ts)
|
|
163
165
|
check the contracts. Executor-specific evidence is indexed in
|
|
164
166
|
[code-mode verification](./code-mode.md#verification).
|
|
167
|
+
|
|
168
|
+
## Sample payload-free timing on Workers
|
|
169
|
+
|
|
170
|
+
Set `timingTraceSampleRate` in deployment code passed to `createConnecta`:
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
const app = createConnecta({
|
|
174
|
+
// ...the deployment's connectors, storage, auth and executor
|
|
175
|
+
timingTraceSampleRate: 0.1, // sample 10% of MCP requests; default 0 (off)
|
|
176
|
+
});
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
The rate must be a finite number from 0 through 1. Set 1 for a short diagnostic
|
|
180
|
+
window, then return it to 0. Sampling is independent of the caller's
|
|
181
|
+
`diagnostics` argument. Enable Workers observability logs in the deployment's
|
|
182
|
+
Wrangler configuration (`observability.logs.enabled: true`). Its own sampling
|
|
183
|
+
may reduce captured records further. The configured logger receives
|
|
184
|
+
`connecta.timing` and one structured object when the MCP response body closes;
|
|
185
|
+
`logger: "silent"` suppresses these records too. Consume or close streaming
|
|
186
|
+
responses to finish their trace. An isolate-first-request flag means the first
|
|
187
|
+
MCP request that reaches tracing in that isolate, including unsampled requests;
|
|
188
|
+
it does not measure module boot.
|
|
189
|
+
|
|
190
|
+
Each version-1 record contains elapsed request time, the first-request flag,
|
|
191
|
+
weak-reference availability and aggregate operation families. Each family has
|
|
192
|
+
`count`, `durationMs`, `bytes`, `statements`, `items` and `absent` totals.
|
|
193
|
+
`catalog.accepted` counts complete accepted catalogs, serialized bytes and tools. Invocation
|
|
194
|
+
`catalog`, `admission`, `connector` and `result` durations reuse the existing
|
|
195
|
+
`diagnostics` segments. `catalog.cache.lookup` counts cache probes; `catalog.cache.hit` counts accepted
|
|
196
|
+
unexpired entries. Lookups without hits can include misses, expiry, invalid
|
|
197
|
+
entries or interrupted reads; they are not proof of live relisting.
|
|
198
|
+
`catalog.validated.hit`/`miss` report immutable validation reuse.
|
|
199
|
+
`catalog.decode` counts JSON decodes and their UTF-8 input bytes;
|
|
200
|
+
`catalog.validate` and `catalog.intake` count those stages without timing them.
|
|
201
|
+
These three count-only families always have `durationMs: 0`.
|
|
202
|
+
`catalog.chunks` records accepted chunk bytes and counts. These counters do not
|
|
203
|
+
identify a connector, owner or private/public partition.
|
|
204
|
+
Concurrent spans can overlap; do not sum them as wall time.
|
|
205
|
+
`memo.hit`, `memo.miss` and `memo.fresh` describe the request-read memo
|
|
206
|
+
(`absent` counts null values, not cache failures). `d1.read`, `d1.write` and
|
|
207
|
+
`d1.batch` count physical native D1 trips and SQL statements, including
|
|
208
|
+
failed attempts. Batch count is one trip; statements is the batch length.
|
|
209
|
+
All native D1 work carrying the request context shares these totals, including
|
|
210
|
+
admission, credential and catalog work. Comparing them with `catalog` duration
|
|
211
|
+
(the diagnostics `catalogMs` segment) does not isolate catalog storage.
|
|
212
|
+
Returned D1 bytes measure serialized application results, not Cloudflare's wire
|
|
213
|
+
encoding. Memo bytes measure UTF-8 stored values. Result bytes use the existing
|
|
214
|
+
invocation measurement. No keys, tool names, owner identity, arguments, results,
|
|
215
|
+
credentials or error text enter the record. Records retain totals only.
|
|
216
|
+
|
|
217
|
+
On production Workers, `performance.now()` advances only across I/O. Durations
|
|
218
|
+
are I/O-spanning elapsed observations, not CPU attribution: zero is ambiguous,
|
|
219
|
+
and CPU work can appear in a later I/O interval. D1 durations are therefore not
|
|
220
|
+
pure storage latency. Use counts, sizes, cache outcomes and the isolate-first-request
|
|
221
|
+
flag to compare warm direct and one-call program requests with the same catalog.
|
|
222
|
+
For per-invocation CPU, use Workers' invocation telemetry field
|
|
223
|
+
[`$workers.cpuTimeMs`](https://developers.cloudflare.com/workers/observability/query-builder/).
|
|
224
|
+
Deeper attribution requires [CPU profiling](https://developers.cloudflare.com/workers/runtime-apis/performance/).
|
|
225
|
+
|
|
226
|
+
Only work carrying the MCP request's native context contributes D1 counters;
|
|
227
|
+
standalone operator/background or custom Promise adapter work is outside that
|
|
228
|
+
request trace. Sampling does not add reads, change TTLs, bypass generation or
|
|
229
|
+
credential fences, or start authorization.
|
|
230
|
+
|
|
231
|
+
For example, query a ten-minute window for a neutral Worker `assistant` (replace
|
|
232
|
+
the millisecond timestamps with the window you need):
|
|
233
|
+
|
|
234
|
+
```sh
|
|
235
|
+
cf --profile assistant o11y telemetry query \
|
|
236
|
+
--query-id 00000000-0000-4000-8000-000000000001 \
|
|
237
|
+
--view events --limit 100 \
|
|
238
|
+
--timeframe-from 1793700000000 --timeframe-to 1793700600000 \
|
|
239
|
+
--parameters-order-by-value count --parameters-order-by-order desc \
|
|
240
|
+
--parameters-calculations '[{"operator":"count","alias":"count"}]' \
|
|
241
|
+
--parameters-filters '[{"key":"$workers.scriptName","operation":"eq","type":"string","value":"assistant"}]'
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Select `connecta.timing` messages in the returned events and inspect their
|
|
245
|
+
structured operation totals. Use the profile belonging to your deployment.
|
|
246
|
+
The example reads telemetry only; it changes no Worker settings.
|
|
247
|
+
|
|
248
|
+
The example passes CLI dry-run validation; server acceptance has not been verified.
|
|
249
|
+
Use `--dry-run` to validate the request locally without querying telemetry.
|