@zackbart/connecta 0.41.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 +61 -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 +2 -1
- package/dist/activity.js +5 -5
- package/dist/advertised-schema.js +15 -0
- package/dist/agent-routes.js +31 -5
- package/dist/auth/downstream-oauth/refresh-coordinator.js +4 -1
- package/dist/auth/downstream-oauth.js +3 -0
- package/dist/auth/static-oauth.js +26 -18
- package/dist/auth-elicitation.js +118 -61
- package/dist/authorization-handoff.js +36 -3
- package/dist/catalog-cache.js +292 -24
- package/dist/catalog-freshness.js +12 -0
- package/dist/catalog-service.js +373 -70
- package/dist/catalog.js +147 -58
- package/dist/config-defaults.d.ts +2 -1
- package/dist/config-defaults.js +4 -1
- package/dist/config.d.ts +43 -17
- package/dist/config.js +26 -10
- package/dist/connectors/remote-mcp/catalog.js +52 -28
- package/dist/connectors/remote-mcp/connection.js +62 -5
- package/dist/connectors/remote-mcp.js +10 -1
- package/dist/describe-config.d.ts +3 -2
- package/dist/discovery-health.js +26 -11
- package/dist/errors.d.ts +52 -3
- package/dist/errors.js +86 -3
- package/dist/execute.js +476 -200
- package/dist/executor-admission.js +2 -0
- package/dist/executor-contract.js +6 -0
- package/dist/executor-result.js +2 -2
- package/dist/executors/quickjs-child.js +13 -4
- package/dist/executors/quickjs-runtime.d.ts +2 -0
- package/dist/executors/quickjs-runtime.js +36 -19
- package/dist/executors/quickjs.js +23 -6
- 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 +7 -2
- package/dist/http/errors.js +9 -4
- package/dist/http/fields.js +17 -5
- package/dist/http/hatch.js +9 -3
- 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 +5 -0
- package/dist/invocation.js +98 -34
- 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 +259 -60
- package/dist/native-recovery.js +4 -1
- package/dist/native-tools.js +166 -51
- package/dist/node.js +3 -1
- package/dist/oauth-handoff.js +53 -43
- package/dist/operation-activity.js +2 -1
- package/dist/operation-vocabulary.js +6 -0
- package/dist/operator-record.d.ts +1 -1
- package/dist/operator-record.js +1 -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 +0 -13
- package/dist/provider.js +0 -3
- package/dist/providers/_shared/google/kit.js +2 -2
- package/dist/providers/breeze/api.js +2 -2
- package/dist/providers/breeze/skill.generated.js +1 -1
- package/dist/providers/ccb/api.js +2 -2
- package/dist/providers/ccb/skill.generated.js +1 -1
- package/dist/providers/cloudflare/api.js +2 -2
- package/dist/providers/cloudflare/index.js +2 -0
- package/dist/providers/cloudflare/skill.generated.js +1 -1
- package/dist/providers/docs/skill.generated.js +1 -1
- package/dist/providers/drive/skill.generated.js +1 -1
- package/dist/providers/forms/index.js +1 -0
- package/dist/providers/forms/skill.generated.js +1 -1
- package/dist/providers/github/api.js +98 -6
- package/dist/providers/github/index.js +7 -2
- 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 +1 -0
- package/dist/providers/gmail/skill.generated.js +1 -1
- package/dist/providers/granola/skill.generated.js +1 -1
- package/dist/providers/overflow/index.js +2 -0
- package/dist/providers/overflow/skill.generated.js +1 -1
- package/dist/providers/planning-center/index.js +11 -5
- 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/index.js +2 -5
- package/dist/providers/quickbooks/skill.generated.js +1 -1
- package/dist/providers/sheets/index.js +1 -0
- package/dist/providers/sheets/skill.generated.js +1 -1
- package/dist/providers/slides/index.js +2 -2
- package/dist/providers/slides/skill.generated.js +1 -1
- package/dist/providers/stripe/skill.generated.js +1 -1
- package/dist/providers/tithely/index.js +1 -0
- package/dist/providers/tithely/skill.generated.js +1 -1
- package/dist/providers/vercel/api.js +2 -2
- package/dist/providers/vercel/skill.generated.js +1 -1
- package/dist/registry.d.ts +36 -4
- package/dist/registry.js +127 -27
- package/dist/result-preview.js +210 -0
- package/dist/result-seal.js +168 -0
- package/dist/route-names.js +13 -4
- package/dist/routes/connect.js +21 -13
- package/dist/routes/mcp.js +55 -26
- package/dist/routes/shared.d.ts +6 -0
- package/dist/runtime/call.js +15 -10
- package/dist/runtime/request-scope.js +36 -1
- package/dist/runtime/run.js +4 -1
- package/dist/sent-secrets.d.ts +20 -0
- package/dist/sent-secrets.js +49 -1
- package/dist/skills.js +100 -33
- package/dist/storage/keys.js +9 -6
- package/dist/storage/sql-native.js +1 -1
- package/dist/tool-safety.d.ts +33 -0
- package/dist/tool-safety.js +51 -15
- package/dist/types.d.ts +31 -0
- package/dist/usage-guide.js +14 -13
- package/dist/validate.js +29 -10
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker.js +28 -8
- package/documentation/architecture.md +104 -42
- package/documentation/auth.md +46 -19
- package/documentation/code-mode.md +378 -116
- package/documentation/deploying.md +10 -9
- package/documentation/hosted-mcp-migration.md +9 -3
- package/documentation/integrating.md +27 -5
- package/documentation/meta-tools.md +655 -153
- package/documentation/operating.md +5 -3
- package/documentation/providers.md +18 -6
- 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 +1 -1
- package/templates/node/AGENTS.md +3 -3
- package/templates/node/README.md +1 -1
- package/templates/node/package.json +1 -1
|
@@ -270,7 +270,7 @@ token and run doctor against a pool that lists the agent:
|
|
|
270
270
|
CONNECTA_TOKEN='<stored-cta-token>' npx connecta doctor --url http://localhost:8787 --pool local-machine
|
|
271
271
|
```
|
|
272
272
|
|
|
273
|
-
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
|
|
274
274
|
`cta_` token is checked at `/agent/<pool>` and needs `--pool`.
|
|
275
275
|
For a Worker protected by Access, `/health` still needs edge admission even
|
|
276
276
|
though `/agent/*` bypasses Access. Use an Access service token admitted by the
|
|
@@ -297,14 +297,15 @@ connector; resolve credentials using [authorization recovery](./meta-tools.md#au
|
|
|
297
297
|
|
|
298
298
|
Use the failed check to choose the next step:
|
|
299
299
|
|
|
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.
|
|
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. |
|
|
308
309
|
|
|
309
310
|
After a fix, repeat doctor with the same client credentials and pool. Never
|
|
310
311
|
paste a token or raw downstream failure body into a committed diagnostic log.
|
|
@@ -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
|