@zackbart/connecta 0.38.0 → 0.40.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.
Files changed (180) hide show
  1. package/CHANGELOG.md +91 -0
  2. package/README.md +3 -2
  3. package/bin/connecta.mjs +4 -8
  4. package/bin/version.mjs +1 -1
  5. package/dist/access-tokens.js +6 -4
  6. package/dist/agent-routes.js +231 -0
  7. package/dist/auth/downstream-oauth/consent.js +519 -0
  8. package/dist/auth/downstream-oauth/grant-store.js +439 -0
  9. package/dist/auth/downstream-oauth/refresh-coordinator.js +562 -0
  10. package/dist/auth/downstream-oauth/refresh-records.js +447 -0
  11. package/dist/auth/downstream-oauth/sdk-hooks.js +242 -0
  12. package/dist/auth/downstream-oauth.js +66 -2382
  13. package/dist/auth/native.js +37 -0
  14. package/dist/auth/oauth-grant.js +13 -0
  15. package/dist/auth/static-oauth.js +153 -131
  16. package/dist/auth-elicitation.js +7 -1
  17. package/dist/authorization-handoff.js +11 -5
  18. package/dist/catalog-cache.js +219 -59
  19. package/dist/catalog-policy.js +18 -0
  20. package/dist/catalog-service.js +284 -47
  21. package/dist/catalog.js +18 -2
  22. package/dist/config.d.ts +16 -11
  23. package/dist/config.js +9 -6
  24. package/dist/connector-caller.d.ts +1 -1
  25. package/dist/connector-health.js +59 -0
  26. package/dist/connector-status.js +117 -0
  27. package/dist/connectors/api-connector.d.ts +7 -2
  28. package/dist/connectors/api-connector.js +7 -4
  29. package/dist/connectors/negotiation-cache.js +22 -4
  30. package/dist/connectors/remote-mcp/call.js +164 -0
  31. package/dist/connectors/remote-mcp/catalog.js +278 -0
  32. package/dist/connectors/remote-mcp/config.js +263 -0
  33. package/dist/connectors/remote-mcp/connection.js +682 -0
  34. package/dist/connectors/remote-mcp/errors.js +488 -0
  35. package/dist/connectors/remote-mcp/oauth.js +473 -0
  36. package/dist/connectors/remote-mcp/resources.js +473 -0
  37. package/dist/connectors/remote-mcp/runtime.js +1 -0
  38. package/dist/connectors/remote-mcp/transport.js +555 -0
  39. package/dist/connectors/remote-mcp.js +62 -2863
  40. package/dist/credential-contract.d.ts +23 -0
  41. package/dist/credential-reads.js +17 -0
  42. package/dist/credential-verification.js +53 -0
  43. package/dist/credentials.d.ts +7 -0
  44. package/dist/credentials.js +60 -25
  45. package/dist/describe-config.d.ts +12 -2
  46. package/dist/describe-config.js +2 -0
  47. package/dist/discovery-health.js +199 -0
  48. package/dist/downstream-input.js +2 -0
  49. package/dist/errors.d.ts +55 -17
  50. package/dist/errors.js +95 -41
  51. package/dist/execute.js +152 -114
  52. package/dist/executor-result.js +3 -1
  53. package/dist/guest-functions.js +83 -0
  54. package/dist/guest-runtime.js +60 -19
  55. package/dist/guest-types.d.ts +19 -5
  56. package/dist/http/argument-problems.js +35 -0
  57. package/dist/http/errors.js +5 -4
  58. package/dist/http/fields.js +192 -13
  59. package/dist/http/hatch-response.js +73 -0
  60. package/dist/http/hatch.js +88 -23
  61. package/dist/http/oauth.js +3 -2
  62. package/dist/http/provider.js +32 -4
  63. package/dist/http/safety.js +8 -0
  64. package/dist/http/tools.js +44 -23
  65. package/dist/index.d.ts +1 -1
  66. package/dist/index.js +9 -2
  67. package/dist/invocation.js +26 -8
  68. package/dist/membership.d.ts +13 -5
  69. package/dist/membership.js +34 -2
  70. package/dist/meta-tools.js +54 -31
  71. package/dist/native-recovery.js +4 -16
  72. package/dist/native-tools.js +5 -2
  73. package/dist/oauth-sealing.js +10 -0
  74. package/dist/operation-vocabulary.js +135 -13
  75. package/dist/operator-record.d.ts +2 -2
  76. package/dist/operator-record.js +1 -0
  77. package/dist/operator-ui/contract.d.ts +10 -0
  78. package/dist/operator-ui/generated.js +2 -2
  79. package/dist/operator-ui/model.d.ts +22 -1
  80. package/dist/provider-call-facts.js +6 -2
  81. package/dist/providers/_shared/rest/operation-index.js +48 -50
  82. package/dist/providers/_shared/rest/value-safety.js +80 -0
  83. package/dist/providers/breeze/api.js +7 -1
  84. package/dist/providers/breeze/skill.generated.js +1 -1
  85. package/dist/providers/breeze/tools.js +4 -3
  86. package/dist/providers/ccb/api.js +2 -1
  87. package/dist/providers/ccb/index.js +5 -0
  88. package/dist/providers/ccb/skill.generated.js +1 -1
  89. package/dist/providers/cloudflare/api.js +8 -1
  90. package/dist/providers/cloudflare/skill.generated.js +1 -1
  91. package/dist/providers/docs/lib/schemas.js +24 -22
  92. package/dist/providers/docs/safety.js +2 -0
  93. package/dist/providers/docs/skill.generated.js +1 -1
  94. package/dist/providers/docs/tools.js +2 -4
  95. package/dist/providers/drive/api.js +1 -0
  96. package/dist/providers/drive/lib/contracts.js +8 -5
  97. package/dist/providers/drive/skill.generated.js +1 -1
  98. package/dist/providers/drive/tools.js +11 -16
  99. package/dist/providers/forms/api.js +1 -0
  100. package/dist/providers/forms/skill.generated.js +1 -1
  101. package/dist/providers/forms/tools.js +10 -7
  102. package/dist/providers/github/api.js +1 -0
  103. package/dist/providers/github/lib/discovery.js +1 -1
  104. package/dist/providers/github/skill.generated.js +1 -1
  105. package/dist/providers/github/tools.js +61 -17
  106. package/dist/providers/gmail/lib/schemas.js +60 -50
  107. package/dist/providers/gmail/skill.generated.js +1 -1
  108. package/dist/providers/gmail/tools.js +7 -5
  109. package/dist/providers/granola/index.js +2 -0
  110. package/dist/providers/granola/skill.generated.js +1 -1
  111. package/dist/providers/overflow/api.js +7 -1
  112. package/dist/providers/overflow/skill.generated.js +1 -1
  113. package/dist/providers/planning-center/api.js +3 -1
  114. package/dist/providers/planning-center/lib/constants.d.ts +1 -1
  115. package/dist/providers/planning-center/skill.generated.js +1 -1
  116. package/dist/providers/quickbooks/safety.js +80 -39
  117. package/dist/providers/quickbooks/skill.generated.js +1 -1
  118. package/dist/providers/sheets/api.js +1 -0
  119. package/dist/providers/sheets/skill.generated.js +1 -1
  120. package/dist/providers/sheets/tools.js +13 -14
  121. package/dist/providers/slides/skill.generated.js +1 -1
  122. package/dist/providers/slides/tools.js +15 -13
  123. package/dist/providers/stripe/skill.generated.js +1 -1
  124. package/dist/providers/tithely/api.js +3 -1
  125. package/dist/providers/tithely/skill.generated.js +1 -1
  126. package/dist/providers/vercel/api.js +1 -1
  127. package/dist/providers/vercel/skill.generated.js +1 -1
  128. package/dist/providers/vercel/tools.js +4 -3
  129. package/dist/registry.d.ts +10 -4
  130. package/dist/registry.js +41 -13
  131. package/dist/routes/credentials.js +129 -60
  132. package/dist/routes/dispatch.js +5 -1
  133. package/dist/routes/mcp.js +30 -14
  134. package/dist/routes/operator.js +2 -2
  135. package/dist/routes/shared.d.ts +6 -1
  136. package/dist/routes/shared.js +7 -1
  137. package/dist/routes/ui-config.js +2 -2
  138. package/dist/routes/ui-data.js +126 -20
  139. package/dist/routes/ui.js +16 -0
  140. package/dist/runtime/call.js +7 -2
  141. package/dist/runtime/native-storage.js +12 -0
  142. package/dist/runtime/request-reads.js +207 -0
  143. package/dist/runtime/request-scope.js +16 -0
  144. package/dist/runtime/storage.js +12 -0
  145. package/dist/skills.js +37 -20
  146. package/dist/storage/keys.js +53 -3
  147. package/dist/storage/memory.js +8 -2
  148. package/dist/storage/sql-native.js +53 -1
  149. package/dist/storage/sql.js +12 -2
  150. package/dist/storage-digest.js +32 -0
  151. package/dist/timeout.js +8 -0
  152. package/dist/types.d.ts +33 -0
  153. package/dist/usage-guide.js +16 -35
  154. package/dist/validate.d.ts +3 -0
  155. package/dist/validate.js +220 -158
  156. package/dist/version.d.ts +1 -1
  157. package/dist/version.js +1 -1
  158. package/dist/write-outcome.js +0 -3
  159. package/documentation/README.md +13 -13
  160. package/documentation/architecture.md +385 -20
  161. package/documentation/auth.md +233 -64
  162. package/documentation/code-mode.md +122 -39
  163. package/documentation/deploying.md +6 -3
  164. package/documentation/integrating.md +16 -2
  165. package/documentation/meta-tools.md +240 -49
  166. package/documentation/migration-0.33.md +5 -1
  167. package/documentation/migration-0.34.md +3 -1
  168. package/documentation/operator-tests.md +1 -1
  169. package/documentation/operator-ui.md +105 -12
  170. package/documentation/pool-membership-upgrade.md +44 -0
  171. package/documentation/providers.md +105 -0
  172. package/examples/worker/AGENTS.md +10 -10
  173. package/examples/worker/README.md +4 -3
  174. package/examples/worker/src/connecta.config.ts +1 -0
  175. package/guides/connecting-agents.md +2 -1
  176. package/guides/how-it-works.md +4 -2
  177. package/package.json +1 -1
  178. package/templates/node/AGENTS.md +13 -12
  179. package/templates/node/package.json +1 -1
  180. package/templates/node/src/connecta.config.ts +1 -0
@@ -114,7 +114,12 @@ Connecta passes exactly one provider, named `connecta`. An executor must:
114
114
  1. **Expose each provider as a guest global** whose properties are its `fns`,
115
115
  called with the program's arguments and awaited. Connecta supplies `search`,
116
116
  `describe`, `call`, `read`, `result`, `skill`, and `emit`; the prelude also
117
- binds the guest's `skills` alias to `skill`.
117
+ binds the guest's `skills` alias to `skill`. Connecta also supplies
118
+ `unawaited`, which the built-in prelude calls at most once, after a failed
119
+ program read a result field off an unawaited call. It spends no host call;
120
+ the host admits one notice per run and ends the run with `budget_exceeded`
121
+ on any further call, so a bridge that exposes it directly gains no
122
+ uncounted round trips.
118
123
  2. **Evaluate `prelude` after the provider globals exist and before the
119
124
  program.** It is trusted host code that installs the immutable namespace
120
125
  and waits for emission acknowledgements. Capture runner intrinsics first;
@@ -197,8 +202,10 @@ is preserved; no JavaScript identifier conversion takes place.
197
202
 
198
203
  **A2.** Connectors create no guest globals, so an id resembling a JavaScript
199
204
  builtin, or one that would collide after sanitization, stays usable through its
200
- canonical address. The bounded connector inventory in the tool description shows
201
- canonical ids with bounded configured titles when present. Clauses A3–A5
205
+ canonical address. The bounded connector inventory in the tool description names
206
+ every connector by canonical id, adding a bounded configured title only when it
207
+ says more than the id, and each guide's fetch call (see
208
+ [meta-tools](./meta-tools.md#discovery-context)). Clauses A3–A5
202
209
  belonged to shortcut dispatch and stay retired; nothing reuses those ids.
203
210
 
204
211
  ## The surface
@@ -219,7 +226,7 @@ const page = await connecta.search({
219
226
  limit: 8, // 1–100, default 8
220
227
  offset: 0,
221
228
  fullDescriptions: false,
222
- includeSchemas: "json", // default; or "compact" / "typescript"
229
+ includeSchemas: "typescript", // default; or "json" / "compact"
223
230
  includeSchemaKeys: true, // default true in code mode
224
231
  });
225
232
  ```
@@ -236,18 +243,26 @@ query browses; non-empty input with no ASCII lexical terms returns no tools plus
236
243
  bounded no-match analysis in `queryAnalysis`; mixed input searches with its
237
244
  ASCII terms.
238
245
 
239
- Each entry carries `address`, `name`, the configured `connectorTitle` when
240
- present (normalized whitespace, at most 120 UTF-8 bytes), and — when requested —
241
- `description`, `inputSchema`, `outputSchema`, and `annotations`. An entry whose
242
- connector carries a usage guide also carries `guide` (the skill name) and a
243
- bounded `guideSummary`, requested or not. An output shape learned under `S9`
246
+ The first page may also carry `readyCalls`: complete operation reads to pass
247
+ unchanged as `connecta.call(entry.address, entry.args)`
248
+ ([fully determined operations](./meta-tools.md#discovery-context) only).
249
+
250
+ Each entry carries `address`, `name`, and — when requested — `description`,
251
+ the rendered schemas, and `annotations`. The page's `connectors` map holds each
252
+ row's connector facts once, keyed by the id before the address's first dot: the
253
+ configured `title` when present (normalized whitespace, at most 120 UTF-8
254
+ bytes), and `guide` (the skill name) with a bounded `guideSummary` when the
255
+ connector carries a usage guide, requested or not. An output shape learned under `S9`
244
256
  also carries `outputSchemaSource: "observed"`; provider declarations carry no
245
257
  source marker.
246
258
 
247
- Programs default to `includeSchemas: "json"`: `inputSchema` and available
248
- `outputSchema` are JSON Schema values, labeled `schemaFormat: "json"`.
249
- Explicit `includeSchemas: "compact"` returns strings labeled
250
- `schemaFormat: "text"`; TypeScript signatures carry the same text label.
259
+ Programs default to `includeSchemas: "typescript"`: each row carries one
260
+ `signature` string for its input and available output, labeled
261
+ `schemaFormat: "text"`, with `inputKeys`, `requiredInputKeys`, and `outputKeys`
262
+ for code to check. A signature is about half the bytes of the JSON rows.
263
+ Explicit `includeSchemas: "json"` returns `inputSchema` and available
264
+ `outputSchema` as JSON Schema values, labeled `schemaFormat: "json"`, and
265
+ `includeSchemas: "compact"` returns compact strings labeled `schemaFormat: "text"`.
251
266
  Compact shapes omit property prose and put required fields first, under these
252
267
  bounds:
253
268
 
@@ -351,8 +366,14 @@ says so inside its `Promise<…>`.
351
366
  ### connecta.call
352
367
 
353
368
  The published `GuestApi` type describes the supplied global for editors.
354
- The executable usage guide checks its API notation against those declarations;
355
- programs still use plain JavaScript.
369
+ The `execute_code` description declares a compact subset of it inline: argument
370
+ shapes that match what `GuestApi` accepts, result fields it returns, and no
371
+ others. Authored emit blocks are the exact variants `M1` accepts;
372
+ forwarded blocks are the native variants from `result.content`. It also
373
+ states that search and describe return objects rather than arrays, that a call
374
+ result over 1 MiB returns a paged handle, and that every function except `emit`
375
+ spends a host call (`M7`). `GuestApi`'s `emit` takes no paged handle, which the
376
+ host refuses. Programs still use plain JavaScript.
356
377
 
357
378
  ```js
358
379
  const { data: run, format } = await connecta.call("ci.get_run", { runId: 42 });
@@ -411,10 +432,12 @@ mismatches, revoked access, and old entries without bindings are `not_found`, as
411
432
  are unknown or expired ids; a storage failure is `unavailable`. IDs are random UUIDs.
412
433
  The `get_result` meta-tool is removed.
413
434
 
414
- `await connecta.skill(name)` resolves the same URI or compatibility name as
415
- top-level `skills`, within the admitted connector view. It reads the registry
416
- behind native `skills/get` and `resources/read`, including opted-in downstream
417
- skills. It returns
435
+ `await connecta.skill(name)` resolves the same URI, compatibility name, or bare
436
+ connector id as top-level `skills`, within the admitted connector view; built-in
437
+ names stay reserved (see
438
+ [meta-tools](./meta-tools.md#connector-guides-and-skills)). It reads the
439
+ registry behind native `skills/get` and `resources/read`, including opted-in
440
+ downstream skills. It returns
418
441
  `{ name, format: "text", text }`; an unknown name is `not_found`. It also
419
442
  accepts the top-level tool's `{ name }` object, and `connecta.skills` is an
420
443
  undeclared alias of `connecta.skill` with the same host-call accounting, because
@@ -628,8 +651,20 @@ when empty. An empty string reports `program_error` with
628
651
  **E6.** A guest `TypeError`, `ReferenceError`, syntax error, invented API, or
629
652
  program-authored throw is `program_error`. `details.name` is a bounded engine
630
653
  error name; `details.line` is the source line when the runtime supplies one,
631
- otherwise null. Fixed hints repair imports/require/filesystem access, shadowed
632
- `connecta`, and invented globals such as `callTool`.
654
+ otherwise null. `message` is `Program <name>: <engine message>`, naming the
655
+ error once even when an executor reports a prefixed message. Fixed hints repair
656
+ imports/require/filesystem access, shadowed `connecta`, invented globals such
657
+ as `callTool`, and a missing `await`. Detection is at runtime, never from
658
+ source: the Promise each `connecta.*` call except `emit` returns has
659
+ non-enumerable getters for result fields (`data`, `format`, `content`, `tools`,
660
+ `catalogErrors`, `total`, `text`, `resultId`, `hasMore`, `nextOffset`). Reading
661
+ one before `await`, as in `connecta.call(...).data` or
662
+ `const { tools } = connecta.search(...)`, returns undefined as before and sets
663
+ a per-run flag. When that program then fails, the prelude reports the flag
664
+ through the uncounted `unawaited` host function before the failure crosses,
665
+ and the hint is `connecta.* returns a Promise; await it`. Awaiting, `then`,
666
+ `Promise.all`, and `Promise.allSettled` never read those fields. Hints are
667
+ fixed text; no program source, field name, or value enters them.
633
668
 
634
669
  An unchanged uncaught host error retains its classification through Error
635
670
  identity. A new error containing its message is a new program error. Copied
@@ -663,13 +698,14 @@ past the deployment's result cap. A clipped address still identifies the mistake
663
698
  by its position; a short one is exact and untagged.
664
699
 
665
700
  **E8.** A remote MCP tool whose advertised schema rejects the call fails before
666
- provider dispatch with `invalid_args`, carrying bounded, value-free
667
- `{ path, code, expected }` findings and the same scoped
668
- `function: "connecta.search"` recovery every other in-program miss gets. A
669
- declared property reports the schema keyword that failed, never the validator's
670
- duplicate `additionalProperties` branch; a truly undeclared property still
671
- reports `additionalProperties`. Unsupported schemas pass through; unrecognized
672
- provider prose remains `connector_call_failed`.
701
+ provider dispatch with `invalid_args`, carrying every bounded
702
+ `{ path, expected, received? }` finding, one corrected `example` when it can be
703
+ built, and the same scoped `function: "connecta.search"` recovery every other
704
+ in-program miss gets ([argument recovery](./meta-tools.md#argument-recovery)).
705
+ A declared property reports the constraint that failed, never the validator's
706
+ duplicate `additionalProperties` branch; a truly undeclared property reports
707
+ the accepted keys. Unsupported schemas pass through; unrecognized provider
708
+ prose remains `connector_call_failed`.
673
709
 
674
710
  ## Results and projection
675
711
 
@@ -938,17 +974,17 @@ deadline past the ceiling means raising the ceiling too.
938
974
  **L4.** Per-execution bounds that are contract, identical in both executors
939
975
  because connecta enforces them above the sandbox:
940
976
 
941
- | Bound | Value |
942
- | --------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
943
- | Host calls per execution, shared by every guest call except `emit` | 20 by default, `execute.maxHostCalls` |
944
- | Writes per run on a writable endpoint, on top of the host calls they also spend (`W10`) | 10 by default, `execute.maxWrites` |
945
- | Deadline per host call | `connecta.call`: its `timeoutMs`, else `calls.defaultTimeoutMs`, else `execute.hostCallTimeoutMs` (15 s); `result`, `skill` and `read`: `execute.hostCallTimeoutMs`. One deadline covers catalog resolution, admission, the connector call, and result processing |
946
- | Discovery page | ≤ 100 tools, ≤ 256,000 serialized bytes |
947
- | `describe` addresses | ≤ 100 |
948
- | `describe` nearby suggestions | ≤ 3 canonical addresses per failed entry |
949
- | Caller text echoed by `describe` recovery | ≤ 512 UTF-8 bytes per field, plus `…` |
950
- | Result | 24,000 serialized characters by default, `execute.maxResultChars` (4,000–1,000,000) |
951
- | Logs presented to the model | 4,000 characters |
977
+ | Bound | Value |
978
+ | ---------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
979
+ | Host calls per execution, shared by every guest call except `emit` and the single `unawaited` notice | 20 by default, `execute.maxHostCalls` |
980
+ | Writes per run on a writable endpoint, on top of the host calls they also spend (`W10`) | 10 by default, `execute.maxWrites` |
981
+ | Deadline per host call | `connecta.call`: its `timeoutMs`, else `calls.defaultTimeoutMs`, else `execute.hostCallTimeoutMs` (15 s); `result`, `skill` and `read`: `execute.hostCallTimeoutMs`. One deadline covers catalog resolution, admission, the connector call, and result processing |
982
+ | Discovery page | ≤ 100 tools, ≤ 256,000 serialized bytes |
983
+ | `describe` addresses | ≤ 100 |
984
+ | `describe` nearby suggestions | ≤ 3 canonical addresses per failed entry |
985
+ | Caller text echoed by `describe` recovery | ≤ 512 UTF-8 bytes per field, plus `…` |
986
+ | Result | 24,000 serialized characters by default, `execute.maxResultChars` (4,000–1,000,000) |
987
+ | Logs presented to the model | 4,000 characters |
952
988
 
953
989
  For any tool whose output declares `page`, continue while `page.hasMore` is true.
954
990
  When approaching the program's host-call limit, return `page.nextCursor` before
@@ -1310,6 +1346,9 @@ and on the Worker adapter with a real Miniflare Loader in `test/guest-api-contra
1310
1346
  Titles name clauses; executor-independent clauses run in both arms.
1311
1347
  `test/codemode-compat.test.ts` pins upstream shape compatibility, minified upstream
1312
1348
  rejection, and branded adapter acceptance across module copies.
1349
+ `test/package-surface.node.test.ts` compiles the description's compact guest
1350
+ declaration against `GuestApi`, checks arguments in both directions, and rejects
1351
+ invented, mistyped, and missing members and authored blocks the host refuses.
1313
1352
 
1314
1353
  | Clauses | Test |
1315
1354
  | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -1357,3 +1396,47 @@ rejection, and branded adapter acceptance across module copies.
1357
1396
 
1358
1397
  The surface itself is checked by `test/server.test.ts` (the exact six-tool list)
1359
1398
  and `test/program-writes.test.ts` (deployment policy and classification construction refusals).
1399
+
1400
+ ### Adding a guest function
1401
+
1402
+ `src/guest-functions.ts` lists every `connecta.<name>` function once, as
1403
+ guest-safe data with no host code or imports. The guest runtime builds the
1404
+ frozen namespace from it, so the runtime source stays one self-contained string
1405
+ that QuickJS and the Worker executor evaluate unchanged. `execute.ts` admits
1406
+ each bridge call by the entry's budget class and binds it by name to a host
1407
+ implementation, and the `execute_code` description joins each entry's compact
1408
+ declaration and names the functions that spend no host call.
1409
+
1410
+ | Function | Budget | Purpose |
1411
+ | ----------- | ---------- | -------------------------------------------------------------------------- |
1412
+ | `search` | `hostCall` | Searches the catalog and returns one flat page of `{ tools }`. |
1413
+ | `describe` | `hostCall` | Describes exact addresses, one entry per address in order. |
1414
+ | `call` | `hostCall` | Calls one tool and inlines transfer pages and native content. |
1415
+ | `read` | `hostCall` | Reads one advertised resource URI. |
1416
+ | `result` | `hostCall` | Pages a retained result by page or UTF-8 byte offset. |
1417
+ | `skill` | `hostCall` | Fetches a skill's text by exact name. |
1418
+ | `emit` | `emission` | Forwards a content block to the client; needs no await. |
1419
+ | `unawaited` | `once` | Tells the host a failed program read a result field off an unawaited call. |
1420
+
1421
+ A `hostCall` function spends one host call on entry (`L4`, `M7`) and returns a
1422
+ Promise whose result fields mark an unawaited read. The runtime wraps
1423
+ `provider.<name>`, or its own local of that name when the entry is `wrapped`,
1424
+ as `call` is. An `emission` function spends none, is bounded by the emission
1425
+ collector and an attempt cap, and returns a tracked thenable. A `once`
1426
+ function accepts one call per run, ends the run on a second, and is called only
1427
+ by the runtime, never from the namespace.
1428
+
1429
+ To add a function:
1430
+
1431
+ 1. Add its entry to `GUEST_FUNCTIONS`: name, budget class, compact
1432
+ declaration and a one-line JSDoc purpose. A `wrapped` function also needs a
1433
+ guest-side local of the same name in `guestInitializer`.
1434
+ 2. Add the member to `GuestApi` in `src/guest-types.ts`. The package-surface
1435
+ declaration test fails until the compact declaration and `GuestApi` agree.
1436
+ 3. Bind its host implementation in `sandboxProvider`'s `operations` in
1437
+ `src/execute.ts`. Typecheck fails while a registry entry has no binding.
1438
+ 4. Add behavior cases to `test/guest-contract-cases.ts`, which run on both
1439
+ executors. The namespace-membership and missing-await cases cover the new
1440
+ entry without edits.
1441
+ 5. Document its clause in this guide and add its row to the table above; the
1442
+ package-surface test compares the table with the registry.
@@ -207,9 +207,11 @@ existing-record migration.
207
207
 
208
208
  One deployment serves one tenant and may admit several people. Node uses Clerk
209
209
  for human auth; Access is Workers-only. With inbound auth, `maintainers` is
210
- required: only they reach plain `/mcp` and the operator UI. Everyone else
211
- reaches a pool that lists them in `members`: people at `/mcp/<pool>`, agents
212
- at `/agent/<pool>`. Maintainers alone administer shared credentials, manage
210
+ required: they receive the whole catalog at plain `/mcp` and the operator UI.
211
+ Everyone else reaches a pool that lists them in `members`: people at
212
+ `/mcp/<pool>`, agents at `/agent/<pool>`. A person in exactly one pool may also
213
+ use plain `/mcp`, which serves them that pool, so one client URL can be handed
214
+ to every person; a person in several pools must use `/mcp/<pool>`. Maintainers alone administer shared credentials, manage
213
215
  agent tokens, and read activity; members connect their own accounts on
214
216
  personal connectors in their pools.
215
217
  [Auth](./auth.md#principals-visibility-and-operators) owns maintainers and members;
@@ -332,6 +334,7 @@ and [Eve agents](./meta-tools.md#eve-agents).
332
334
 
333
335
  - [Provider migration for 0.35](./provider-migration-0.35.md) collects provider upgrade actions for 0.35.0, including removal of Infisical, Notion, and Mixpanel factories.
334
336
  - [Migration to 0.34](./migration-0.34.md) covers the Overview landing page, Endpoints at `/endpoints`, default browser titles, and Workspace discovery in owner-less agent pools. No storage migration or token rotation is needed from 0.33.
337
+ - [Split mixed pools](./pool-membership-upgrade.md) before starting a deployment that lists people and agents together; mixed membership now throws at construction.
335
338
  - [Migration to 0.33](./migration-0.33.md) maps every removed access option to `maintainers`, pool `members`, and `agents`, moves agents to `/agent/<pool>`, and covers pool owners, token revisions, operator contract v2 with its operator route changes, and the pre-auth listen fix.
336
339
  - [Tokens issued before agents](./auth.md#agent-tokens-and-upgrading-from-earlier-tokens) stop admitting until each machine's token is bound once to a declared agent with `npm run adopt-token -- <token-id> <agent>` (Node) or `AccessTokenManager.adopt`, which keeps its secret. Human-bound tokens stay refused; issue those agents new tokens. Pool members name `"agent:<name>"` instead of matching token record ids.
337
340
  - [Retired layout migrations](./migration-retired-layouts.md) requires completing Node JSON → SQLite, Workers KV → D1, and every OAuth layout-2 grant conversion on 0.37.1 before upgrading. The new package no longer supplies those migrations.
@@ -57,6 +57,7 @@ const crm = remoteMcp("crm", {
57
57
  });
58
58
  const base = ["crm", "tickets"]; // the agent's lowest tier
59
59
  // connectors: [crm, tickets], agents: ["assistant"],
60
+ // Agent tiers list only agents; people use a separate pool sharing base.
60
61
  // pools: { assistant: { tools: base, members: ["agent:assistant"] } }
61
62
  ```
62
63
 
@@ -267,6 +268,14 @@ which binds the grant to configured API origins and manages authentication.
267
268
  [Downstream OAuth on api()](./auth.md#downstream-oauth-on-api) owns a concrete
268
269
  HTTP example and the client setup contract.
269
270
 
271
+ Text a handler writes for the agent that names a Connecta route, such as "call
272
+ authorize_connector" in an auth error, uses `ctx.routes` (`ctx.routes.authorize`,
273
+ `ctx.routes.read`, `ctx.routes.write`, `ctx.routes.search`, `ctx.routes.program`,
274
+ `ctx.routes.skills`). Connecta sets it on every context it builds to the names of
275
+ the surface serving the call: the meta-tool names on the default surface, and
276
+ the native contract's wording on a native pool. It is optional in the type, so
277
+ fall back to the meta names for a context built elsewhere.
278
+
270
279
  Mark every side-effecting tool `readOnlyHint: false`. On a writable endpoint
271
280
  writes use `call_destructive_tool` or a program, within the caller's grants; a
272
281
  `readOnly` endpoint refuses them and omits them from search. Client approval is independent of
@@ -305,6 +314,11 @@ literal header credentials with personal scope. Review
305
314
  [management permissions](./auth.md#management-permissions) before exposing a
306
315
  new integration or its authentication controls.
307
316
 
317
+ Plain `/mcp` serves maintainers the whole catalog and every other person their
318
+ single pool, so one URL can serve the meta-tools to `alice` and a native pool's
319
+ tools to `bob`. After changing a pool's `tools`, `readOnly`, `surface` or
320
+ `executeCode`, check it as a member at plain `/mcp` as well as at `/mcp/<pool>`.
321
+
308
322
  After editing configuration, run the deployment's typecheck and doctor, then
309
323
  perform a bounded read. Add negative checks for target restrictions and writes
310
324
  when authoring a handler or provider. Follow repository verification policy
@@ -331,8 +345,8 @@ check shared behavior. Provider-specific tests remain beside each provider.
331
345
 
332
346
  Use [`@zackbart/connecta-eve`](https://github.com/zackbart/connecta/blob/main/packages/connecta-eve/README.md)
333
347
  in the Eve app for an app-owned connection and endpoint instructions refreshed
334
- once per turn. It requires Node 24 and Eve 0.86.x, and installs separately from
335
- Connecta. Follow its README for the two agent files, token environment variables,
348
+ once per turn. It installs separately from Connecta. Follow its README for the
349
+ supported Node and Eve versions, the two agent files, token environment variables,
336
350
  optional write approval and Vercel OIDC token source. Configure the server's
337
351
  [agent and pool membership](./auth.md#issue-rotate-or-revoke-an-agent-token)
338
352
  before connecting.