@zackbart/connecta 0.31.0 → 0.32.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 (95) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +15 -13
  3. package/bin/connecta.mjs +1 -0
  4. package/bin/version.mjs +1 -1
  5. package/dist/auth-elicitation.js +1 -1
  6. package/dist/catalog-service.js +7 -2
  7. package/dist/config-value-sources.js +6 -3
  8. package/dist/config.d.ts +26 -8
  9. package/dist/config.js +38 -16
  10. package/dist/connector-access.d.ts +2 -1
  11. package/dist/connectors/guarded-fetch.d.ts +9 -0
  12. package/dist/connectors/guarded-fetch.js +7 -0
  13. package/dist/describe-config.d.ts +6 -3
  14. package/dist/describe-config.js +3 -2
  15. package/dist/errors.d.ts +1 -1
  16. package/dist/errors.js +1 -0
  17. package/dist/execute.js +16 -14
  18. package/dist/index.js +4 -3
  19. package/dist/invocation.js +7 -4
  20. package/dist/meta-tools.js +17 -19
  21. package/dist/operator-record.d.ts +2 -2
  22. package/dist/operator-record.js +2 -0
  23. package/dist/operator-ui/contract.d.ts +5 -4
  24. package/dist/operator-ui/generated.js +2 -2
  25. package/dist/operator-ui/model.d.ts +1 -1
  26. package/dist/operator-ui/view.js +1 -0
  27. package/dist/program-writes.js +2 -2
  28. package/dist/provider.d.ts +2 -3
  29. package/dist/providers/_shared/google/workspace.js +1 -1
  30. package/dist/providers/breeze/skill.generated.js +2 -2
  31. package/dist/providers/cloudflare/skill.generated.js +1 -1
  32. package/dist/providers/docs/index.d.ts +1 -1
  33. package/dist/providers/docs/index.js +2 -2
  34. package/dist/providers/drive/index.d.ts +1 -1
  35. package/dist/providers/drive/index.js +1 -1
  36. package/dist/providers/forms/index.d.ts +1 -1
  37. package/dist/providers/forms/index.js +2 -2
  38. package/dist/providers/github/skill.generated.js +2 -2
  39. package/dist/providers/gmail/index.d.ts +1 -1
  40. package/dist/providers/gmail/index.js +274 -23
  41. package/dist/providers/gmail/skill.generated.js +2 -2
  42. package/dist/providers/linear/index.js +1 -1
  43. package/dist/providers/mixpanel/index.d.ts +27 -12
  44. package/dist/providers/mixpanel/index.js +58 -6
  45. package/dist/providers/mixpanel/operations.js +20 -0
  46. package/dist/providers/mixpanel/rest.js +603 -0
  47. package/dist/providers/mixpanel/skill.generated.js +3 -2
  48. package/dist/providers/mixpanel/value-safety.js +16 -0
  49. package/dist/providers/notion/index.js +16 -0
  50. package/dist/providers/notion/rest.js +138 -19
  51. package/dist/providers/notion/skill.generated.js +4 -4
  52. package/dist/providers/planning-center/index.d.ts +27 -0
  53. package/dist/providers/planning-center/index.js +286 -24
  54. package/dist/providers/planning-center/skill.generated.js +24 -4
  55. package/dist/providers/sheets/index.d.ts +1 -1
  56. package/dist/providers/sheets/index.js +3 -3
  57. package/dist/providers/slides/index.d.ts +1 -1
  58. package/dist/providers/slides/index.js +3 -3
  59. package/dist/providers/stripe/skill.generated.js +2 -2
  60. package/dist/providers/vercel/index.js +2 -2
  61. package/dist/providers/vercel/skill.generated.js +2 -2
  62. package/dist/providers/wispr-flow/index.d.ts +14 -0
  63. package/dist/providers/wispr-flow/index.js +117 -0
  64. package/dist/providers/wispr-flow/skill.generated.js +8 -0
  65. package/dist/routes/mcp.js +30 -10
  66. package/dist/routes/operator.js +14 -7
  67. package/dist/routes/ui-config.js +2 -2
  68. package/dist/server.js +3 -0
  69. package/dist/skills.js +5 -4
  70. package/dist/tool-safety.js +13 -5
  71. package/dist/types.d.ts +1 -1
  72. package/dist/ui.d.ts +1 -1
  73. package/dist/ui.js +1 -1
  74. package/dist/usage-guide.js +3 -3
  75. package/dist/version.d.ts +1 -1
  76. package/dist/version.js +1 -1
  77. package/documentation/architecture.md +38 -23
  78. package/documentation/auth.md +86 -27
  79. package/documentation/code-mode.md +81 -72
  80. package/documentation/deploying.md +10 -5
  81. package/documentation/integrating.md +56 -4
  82. package/documentation/meta-tools.md +44 -37
  83. package/documentation/operating.md +11 -8
  84. package/documentation/operator-tests.md +2 -3
  85. package/documentation/operator-ui.md +9 -3
  86. package/documentation/provider-auth-migration.md +5 -4
  87. package/documentation/provider-migration-0.29.md +1 -1
  88. package/examples/worker/AGENTS.md +5 -0
  89. package/examples/worker/src/connecta.config.ts +5 -0
  90. package/package.json +5 -1
  91. package/templates/node/AGENTS.md +6 -4
  92. package/templates/node/README.md +4 -2
  93. package/templates/node/package.json +1 -1
  94. package/templates/node/src/connecta.config.ts +5 -0
  95. package/dist/tool-safety.d.ts +0 -9
@@ -15,14 +15,17 @@ instructions and `skills` usage guide for deployment-specific context.
15
15
  | ------------------------------------------------------------------ | --------------------------------------------------------- |
16
16
  | One known read, with usable arguments and a small result | `call_tool` |
17
17
  | Discover a tool, chain calls, combine services, or reduce a result | `execute_code` |
18
- | One write on a read-only endpoint | `call_destructive_tool` |
18
+ | One known write on a writable endpoint | `call_destructive_tool` |
19
19
  | Obtain connector instructions | `skills` with the returned guide name |
20
20
  | Start a required authentication handoff | `authorize_connector`, using the returned recovery action |
21
21
 
22
- The endpoint's trust is part of its tool descriptions. On a `trusted` endpoint,
23
- programs may write within the caller's grants, and `execute_code` is annotated
24
- as a write. On `read-only`, every write is a separate top-level call. The host
25
- controls approval. Never change pool, identity, or trust to work around a refusal.
22
+ Whether the endpoint is read-only or writable is part of its tool
23
+ descriptions. On a writable endpoint, programs and `call_destructive_tool` may
24
+ write within the caller's grants, and `execute_code` is annotated as a write;
25
+ the client controls approval. On a read-only endpoint, search and describe omit
26
+ write tools and every write call is refused with `read_only_endpoint`, even one
27
+ a connector guide names; tell the user rather than looking for another route. Never change pool, identity, or `readOnly` to work
28
+ around a refusal.
26
29
  [Routing between the call surfaces](./meta-tools.md#routing-between-the-call-surfaces)
27
30
  owns the full decision rules.
28
31
 
@@ -35,9 +38,9 @@ failed catalog or a service outside the caller's grants.
35
38
 
36
39
  For normal reads, keep discovery, calls, and reduction in one program when the
37
40
  schemas suffice; return the answer rather than catalog matches. Use top-level
38
- `search_tools` for catalog inspection or to discover a write on a read-only
39
- endpoint, then dispatch each write with `call_destructive_tool`. An unfamiliar
40
- read result may return a bounded sample for inspection before the next program.
41
+ `search_tools` for catalog inspection or to find one known write on a writable
42
+ endpoint, then dispatch it with `call_destructive_tool`. An unfamiliar read
43
+ result may return a bounded sample for inspection before the next program.
41
44
 
42
45
  Use the exact returned `address`, including punctuation. A TypeScript signature
43
46
  is guidance for writing JavaScript; do not paste types into executable code.
@@ -72,9 +72,8 @@ gh run download RUN_ID --name operator-linux-snapshots \
72
72
 
73
73
  The workflow uploads all generated baselines and never commits them. Review the
74
74
  images and changed files, commit the intentional changes, and push again. The
75
- normal CI browser job must compare and pass against that commit. Opening the
76
- initial PR also runs the update workflow, so the first baselines can be generated
77
- before the workflow reaches main. Later updates use `workflow_dispatch`.
75
+ normal CI browser job must compare and pass against that commit. Snapshot
76
+ updates run only through `workflow_dispatch`.
78
77
 
79
78
  On a matching Linux runner, `npm ci`, install Chromium with the command above,
80
79
  then run `npm run test:browser:snapshots`. The normal command is
@@ -42,7 +42,9 @@ from `connecta/ui`. `src/operator-ui/contract.ts` is also the browser's type
42
42
  source. The response has `schemaVersion: 1`, `config`, `configSources`, `live`, and `you`.
43
43
  `config` is the construction-time `describeConfig()` snapshot, filtered to
44
44
  visible connectors, granted tools, classification overrides, and admitted
45
- pools. Pool tools are the intersection with the caller's identity grants.
45
+ pools. `config.hasGrant` reports whether deployment code configures a grant for
46
+ plain `/mcp`; Access displays that fact and Config includes its provenance.
47
+ Pool tools are the intersection with the caller's identity grants.
46
48
  `configSources` labels each serialized leaf as `default` or `config`, based on
47
49
  option presence rather than equality with the default. Factory descriptions carry
48
50
  relative `optionSources` paths so resolved module and transport defaults retain
@@ -52,6 +54,10 @@ ids and pool names and are filtered after disclosure; hidden values leave no
52
54
  provenance keys. It contains no source code or credential material.
53
55
  Every response is private, `no-store` JSON. Only GET is allowed, with the
54
56
  same auth gate and identity partition as `/ui/data` and `/ui/connectors/:id`.
57
+ These catalog reads, activity reads, and connector auth routes also require
58
+ admission through the default `/mcp` grant. Refusals return private JSON 404s;
59
+ there is no per-pool UI view. Public HTML shells and static assets carry no
60
+ catalog data. Access-token management retains its interactive permission gate.
55
61
 
56
62
  `live.connectors` carries status and problem codes, complete registry tools
57
63
  with their final read/write classification, catalog age in milliseconds, and
@@ -69,7 +75,7 @@ personal connectors to the caller's activity identity. Each retained fact
69
75
  copies a validated timestamp and outcome only. A null call means unknown or
70
76
  absent in that window, not proof of no calls. `live.activity` distinguishes
71
77
  available, unconfigured, forbidden, and unavailable history. `you` names no
72
- identity or auth material; it reports grants, root and admitted-pool trust,
78
+ identity or auth material; it reports grants, whether the root and admitted pools are read-only,
73
79
  and effective activity, token, and per-connector auth permissions.
74
80
 
75
81
  `connecta doctor --config` fetches this authenticated contract and prints only
@@ -112,7 +118,7 @@ id and typed actor when available, otherwise a fresh id and system actor. No
112
118
  names, descriptions or schemas enter the event. Private catalog changes require
113
119
  a matching principal owner even when the connector uses shared auth. Empty credential declarations
114
120
  report `credential_required` before running a connector status or catalog probe.
115
- The Access adapter reports inbound provider kinds, admitted pools, grants, trust
121
+ The Access adapter reports inbound provider kinds, admitted pools, grants, read-only endpoints
116
122
  and endpoint setup; token controls retain their existing permission gate.
117
123
  Configuration remains in deployment code. The UI mutates only credentials,
118
124
  OAuth connections and client tokens through the existing routes.
@@ -183,8 +183,8 @@ connector beside the token connector.
183
183
 
184
184
  The hosted connection now lists `filter_project_envs`, `get_project_env`,
185
185
  `create_project_env`, and `edit_project_env`, which 0.29 hid. The two reads can
186
- return decrypted values, so they are reviewed as writes and the pool trust
187
- policy gates them. Vercel admits only reviewed and approved MCP clients to its
186
+ return decrypted values, so they are reviewed as writes, and a `readOnly`
187
+ endpoint refuses them. Vercel admits only reviewed and approved MCP clients to its
188
188
  hosted server; if authorization is refused for that reason, the deployment
189
189
  needs Vercel's approval or a token connector. The
190
190
  [Vercel skill](https://github.com/zackbart/connecta/blob/main/src/providers/vercel/SKILL.md)
@@ -245,8 +245,9 @@ hooks) and redacts stored secrets on every result. A pinned connector refuses
245
245
  operations that name no account or zone unless they are reviewed safe, such
246
246
  as `/certificates` and `/memberships/{id}`.
247
247
 
248
- Read-only pools: hosted `execute` is always a write, even for a program that
249
- only reads, so a read-only pool on an OAuth connector reaches only `search`.
248
+ Read-only endpoints: hosted `execute` is always a write, even for a program
249
+ that only reads, so a `readOnly` endpoint on an OAuth connector reaches only
250
+ `search`.
250
251
  Use an API-token connector for read-only API access.
251
252
 
252
253
  Lost on each path. OAuth has no index validation, named tools, GraphQL tool,
@@ -58,7 +58,7 @@ complement. Replace `update_r2_bucket` with `cloudflare_api_mutate` using
58
58
  `cf-r2-storage-class` set to `Standard` or `InfrequentAccess`. Omit the body;
59
59
  include `cf-r2-jurisdiction` only when the bucket needs it. This remains a write.
60
60
  `execute` remains a write even when its program only calls GET.
61
- Trusted pools may execute writes; read-only pools use direct host-approved writes.
61
+ Writable endpoints may run `execute`; `readOnly` endpoints refuse it.
62
62
 
63
63
  Vercel's `surface` and ownership rules were later replaced: `auth` now selects
64
64
  the implementation. See the [provider auth migration](./provider-auth-migration.md#vercel).
@@ -37,6 +37,11 @@ This repository is deployment configuration, not a copy of Connecta itself.
37
37
  Import it from `@zackbart/connecta/worker`; direct upstream
38
38
  `new DynamicWorkerExecutor()` construction throws at boot. Keep the
39
39
  `@cloudflare/codemode` optional peer installed.
40
+ - Keep the required `readOnly` choice in `src/connecta.config.ts`; startup
41
+ fails without it. `true` omits write tools from search and describe and
42
+ refuses every write call; `false` lets them run with MCP host approval. Named
43
+ pools inherit it unless they set their own `readOnly`. Do not configure the
44
+ removed `trust`.
40
45
  - Keep credentials in Worker secrets. Never commit credential values, Access
41
46
  service-token secrets, or `CREDENTIAL_ENCRYPTION_KEY`.
42
47
  - All state lives in the one D1 database bound as `CONNECTA_DB`, through
@@ -69,6 +69,11 @@ export default defineConfig((env: Env) => {
69
69
  return {
70
70
  publicUrl: env.PUBLIC_URL,
71
71
  storage,
72
+ // Required: can /mcp write? false lets call_destructive_tool and programs
73
+ // write, with the MCP client approving; true leaves write tools out of
74
+ // search and describe and refuses every write call. Pools inherit it
75
+ // unless they set their own readOnly. Startup fails without it.
76
+ readOnly: false,
72
77
  // Required adapter owns each run's handles; direct upstream construction throws.
73
78
  executor: workerExecutor({ loader: env.LOADER }),
74
79
  // Access owns edge admission and proves human identity for MCP and the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zackbart/connecta",
3
- "version": "0.31.0",
3
+ "version": "0.32.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "One MCP to rule them all — a single MCP endpoint aggregating many downstream connectors behind a code-first surface of six meta-tools.",
@@ -157,6 +157,10 @@
157
157
  "types": "./dist/providers/vercel/index.d.ts",
158
158
  "import": "./dist/providers/vercel/index.js"
159
159
  },
160
+ "./providers/wispr-flow": {
161
+ "types": "./dist/providers/wispr-flow/index.d.ts",
162
+ "import": "./dist/providers/wispr-flow/index.js"
163
+ },
160
164
  "./ui": {
161
165
  "types": "./dist/ui.d.ts",
162
166
  "import": "./dist/ui.js"
@@ -5,10 +5,12 @@ This repository is deployment configuration, not a copy of Connecta itself.
5
5
  - Edit `src/connecta.config.ts` for connectors, authentication, storage, public
6
6
  URL, and optional modules. `src/index.ts` only starts it.
7
7
  - Keep `executor: quickJsExecutor()` for the prescribed six-tool code-first
8
- surface. Root and named pools default to `trust: "read-only"`: programs
9
- may read, and writes use `call_destructive_tool`. Explicit `trusted` pools
10
- also permit program writes and annotate `execute_code` as a write. Approval
11
- belongs to the MCP host. Do not configure the removed `execute.approval`.
8
+ surface. Keep the required `readOnly` choice in the config: `false` lets
9
+ `call_destructive_tool` and programs write and annotates `execute_code` as
10
+ a write; `true` omits write tools from search and describe and refuses every
11
+ write call. Named pools inherit it unless they set their own `readOnly`.
12
+ Approval belongs to the MCP host. Do not configure the removed `trust` or
13
+ `execute.approval`.
12
14
  - Keep credentials in environment variables or an external secret store.
13
15
  Never commit `.env`, `.connecta.sqlite` (and its `-wal`/`-shm` files),
14
16
  tokens, or credential values.
@@ -125,8 +125,10 @@ stored machine token to inspect Connections. Sign in with Clerk for human
125
125
  connection management. Omit that option and import for an API-only
126
126
  server. OAuth callbacks remain in core even with no UI.
127
127
 
128
- The page labels each tool as a read or write. Trusted programs may write;
129
- read-only pools use `call_destructive_tool`, with approval controlled by the host. For
128
+ The page labels each tool as a read or write and each endpoint as writable or
129
+ read-only. `src/connecta.config.ts` must set `readOnly`: a read-only endpoint
130
+ refuses every write call and leaves write tools out of search, and the host
131
+ controls approval on a writable one. For
130
132
  classified connection failures it offers a fixed repair prompt, and its
131
133
  endpoint section has client setup commands for `/mcp` and any pool available
132
134
  to the signed-in identity. Those commands contain no bearer token.
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@clerk/backend": "^3.12.0",
20
- "@zackbart/connecta": "0.31.0",
20
+ "@zackbart/connecta": "0.32.0",
21
21
  "quickjs-emscripten": "0.32.0"
22
22
  },
23
23
  "devDependencies": {
@@ -68,6 +68,11 @@ export default defineConfig((env: Env) => {
68
68
  return {
69
69
  storage,
70
70
  publicUrl,
71
+ // Required: can /mcp write? false lets call_destructive_tool and programs
72
+ // write, with the MCP client approving; true leaves write tools out of
73
+ // search and describe and refuses every write call. Pools inherit it
74
+ // unless they set their own readOnly. Startup fails without it.
75
+ readOnly: false,
71
76
  // Required: model-written programs run in a bounded QuickJS child.
72
77
  executor: quickJsExecutor(),
73
78
  auth: clerk ? [clerk] : [],
@@ -1,9 +0,0 @@
1
- import type { ToolDef, ToolVerdict } from "./types.js";
2
- export type PoolTrust = "trusted" | "read-only";
3
- /** Deployment override, then verified provider review, then fail-closed hints. */
4
- export declare function classifyTool(definition: ToolDef, override?: "read" | "write", review?: {
5
- verdict: ToolVerdict;
6
- stale?: boolean;
7
- }): "read" | "write";
8
- /** The only permission decision for a connector call. Approval is host-owned. */
9
- export declare function surfaceAllowsTool(classification: ToolDef["classification"], surface: string, trust?: PoolTrust): boolean;