@zackbart/connecta 0.33.0 → 0.34.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 (86) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +99 -128
  3. package/SECURITY.md +1 -1
  4. package/bin/version.mjs +1 -1
  5. package/dist/activity.d.ts +3 -0
  6. package/dist/branding.d.ts +7 -0
  7. package/dist/branding.js +76 -9
  8. package/dist/catalog-service.js +15 -1
  9. package/dist/config-value-sources.js +6 -1
  10. package/dist/config.d.ts +13 -2
  11. package/dist/config.js +36 -2
  12. package/dist/connector-caller.js +2 -1
  13. package/dist/describe-config.d.ts +3 -1
  14. package/dist/describe-config.js +1 -0
  15. package/dist/execute.js +1 -11
  16. package/dist/fix-prompt.js +2 -2
  17. package/dist/index.js +1 -0
  18. package/dist/membership.d.ts +2 -0
  19. package/dist/oauth-callback-outcome.js +2 -2
  20. package/dist/operator-ui/agents.d.ts +1 -1
  21. package/dist/operator-ui/agents.js +16 -16
  22. package/dist/operator-ui/config-summary.js +562 -0
  23. package/dist/operator-ui/connection-map.js +375 -0
  24. package/dist/operator-ui/endpoints.js +44 -15
  25. package/dist/operator-ui/fix-prompts.js +1 -1
  26. package/dist/operator-ui/generated.js +4 -4
  27. package/dist/operator-ui/member-page.js +13 -28
  28. package/dist/operator-ui/overview.js +134 -0
  29. package/dist/operator-ui/view.d.ts +27 -22
  30. package/dist/operator-ui/view.js +104 -88
  31. package/dist/page-styles.js +5 -3
  32. package/dist/providers/_shared/google/workspace.d.ts +6 -4
  33. package/dist/providers/_shared/google/workspace.js +6 -2
  34. package/dist/providers/ccb/index.js +1 -1
  35. package/dist/providers/docs/index.js +1 -1
  36. package/dist/providers/docs/skill.generated.js +2 -2
  37. package/dist/providers/drive/index.js +1 -1
  38. package/dist/providers/drive/skill.generated.js +2 -2
  39. package/dist/providers/forms/index.js +1 -1
  40. package/dist/providers/forms/skill.generated.js +2 -2
  41. package/dist/providers/gmail/index.js +1 -1
  42. package/dist/providers/gmail/skill.generated.js +2 -2
  43. package/dist/providers/mixpanel/skill.generated.js +3 -3
  44. package/dist/providers/notion/skill.generated.js +1 -1
  45. package/dist/providers/overflow/index.js +1 -1
  46. package/dist/providers/overflow/skill.generated.js +2 -2
  47. package/dist/providers/planning-center/index.js +1 -1
  48. package/dist/providers/planning-center/skill.generated.js +4 -4
  49. package/dist/providers/revenuecat/skill.generated.js +2 -2
  50. package/dist/providers/sheets/index.js +1 -1
  51. package/dist/providers/sheets/skill.generated.js +2 -2
  52. package/dist/providers/slides/index.js +1 -1
  53. package/dist/providers/slides/skill.generated.js +2 -2
  54. package/dist/providers/tithely/index.js +1 -1
  55. package/dist/providers/vercel/index.js +1 -1
  56. package/dist/providers/vercel/skill.generated.js +1 -1
  57. package/dist/registry.js +15 -0
  58. package/dist/routes/mcp.js +20 -13
  59. package/dist/routes/oauth.js +2 -2
  60. package/dist/skills.js +10 -0
  61. package/dist/storage/sql.js +5 -1
  62. package/dist/types.d.ts +18 -7
  63. package/dist/ui.js +9 -4
  64. package/dist/usage-guide.js +1 -1
  65. package/dist/version.d.ts +1 -1
  66. package/dist/version.js +1 -1
  67. package/documentation/README.md +2 -2
  68. package/documentation/architecture.md +18 -13
  69. package/documentation/auth.md +183 -67
  70. package/documentation/code-mode.md +23 -5
  71. package/documentation/deploying.md +5 -1
  72. package/documentation/integrating.md +9 -6
  73. package/documentation/meta-tools.md +36 -22
  74. package/documentation/migration-0.33.md +21 -13
  75. package/documentation/migration-0.34.md +67 -0
  76. package/documentation/operator-tests.md +46 -20
  77. package/documentation/operator-ui.md +294 -104
  78. package/examples/worker/AGENTS.md +15 -9
  79. package/examples/worker/README.md +41 -14
  80. package/examples/worker/src/connecta.config.ts +5 -4
  81. package/examples/worker/wrangler.jsonc +1 -1
  82. package/package.json +19 -19
  83. package/templates/node/AGENTS.md +13 -7
  84. package/templates/node/README.md +14 -11
  85. package/templates/node/package.json +1 -1
  86. package/templates/node/src/connecta.config.ts +2 -2
@@ -4,8 +4,9 @@
4
4
  * One MCP endpoint aggregating a downstream remote MCP and an HTTP API, guarded
5
5
  * by Cloudflare Access. It needs three resources and nothing else: one D1
6
6
  * database (CONNECTA_DB) holding every piece of state, the Worker Loader
7
- * binding (LOADER) behind execute_code, and one secret
8
- * (CREDENTIAL_ENCRYPTION_KEY) sealing credentials in that database. Access
7
+ * binding (LOADER) behind execute_code, and two secrets: DOWNSTREAM_TOKEN for
8
+ * the example Notion connector and CREDENTIAL_ENCRYPTION_KEY sealing
9
+ * credentials in that database. Access
9
10
  * admits the request before this Worker runs and supplies trusted human
10
11
  * identity through ctx.access. Machines use stored cta_ tokens inside connecta.
11
12
  *
@@ -16,7 +17,7 @@
16
17
  *
17
18
  * Setup (this example has no package.json of its own — it self-references the
18
19
  * installed `@zackbart/connecta` package):
19
- * 1. `npm install` in the connecta package root (../../ from here) so the
20
+ * 1. `pnpm install` in the connecta repository root (../../ from here) so the
20
21
  * package import and wrangler resolve. A copy in its own repository
21
22
  * installs `@zackbart/connecta @cloudflare/codemode` instead. Codemode is
22
23
  * an optional peer.
@@ -90,7 +91,7 @@ export default defineConfig((env: Env) => {
90
91
  // alone is refused everywhere.
91
92
  auth: [cloudflareAccessAuth()],
92
93
  // Machine clients are agents declared here by name, each with one cta_
93
- // token. An Access-authenticated operator issues, rotates, and revokes it
94
+ // token. A signed-in maintainer issues, rotates, and revokes it
94
95
  // in the operator UI; removing a name stops its token on the next request.
95
96
  agents: ["ci"],
96
97
  // Always installed over the same D1 storage. An agent with no issued token
@@ -18,7 +18,7 @@
18
18
  "CONNECTA_MAINTAINERS": "operator@example.com",
19
19
  },
20
20
 
21
- // Local-only Access identity. Remove this block to exercise the
21
+ // Local-only Access identity (Wrangler 4.123.0 or later). Remove this block to exercise the
22
22
  // unauthenticated path in `wrangler dev`; production identity comes from the
23
23
  // Worker-level Access application, not from this file.
24
24
  "access": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zackbart/connecta",
3
- "version": "0.33.0",
3
+ "version": "0.34.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.",
@@ -8,6 +8,7 @@
8
8
  "engines": {
9
9
  "node": ">=22.13.0"
10
10
  },
11
+ "packageManager": "pnpm@12.4.2",
11
12
  "publishConfig": {
12
13
  "access": "public"
13
14
  },
@@ -187,20 +188,20 @@
187
188
  "build:operator-ui": "node scripts/build-operator-ui.mjs",
188
189
  "check:operator-ui": "node scripts/build-operator-ui.mjs --check",
189
190
  "check:clerk-sdk": "node scripts/build-clerk-sdk.mjs --check",
190
- "build": "npm run providers:generate && npm run clean && tsc -p tsconfig.build.json && node scripts/prune-declarations.mjs",
191
+ "build": "pnpm run providers:generate && pnpm run clean && tsc -p tsconfig.build.json && node scripts/prune-declarations.mjs",
191
192
  "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.operator-ui.json --noEmit",
192
193
  "test": "vitest run",
193
194
  "test:browser:install": "playwright install chromium",
194
195
  "test:browser": "playwright test",
195
196
  "test:browser:snapshots": "node scripts/update-operator-snapshots.mjs",
196
- "pretest:browser:snapshots": "npm run build:operator-ui",
197
+ "pretest:browser:snapshots": "pnpm run build:operator-ui",
197
198
  "test:node": "vitest run --project node",
198
199
  "test:workers": "vitest run --project workers",
199
200
  "check:docs": "node scripts/check-doc-links.mjs",
200
201
  "check:lint": "oxlint -D correctness --report-unused-disable-directives .",
201
202
  "check:unused": "knip --include dependencies,unlisted,exports,nsExports,types,nsTypes",
202
203
  "check:examples": "tsc -p tsconfig.template.node.json && tsc -p tsconfig.examples.worker.json",
203
- "check:security": "npm audit --omit=dev --audit-level=moderate",
204
+ "check:security": "pnpm audit --prod --audit-level moderate",
204
205
  "check:package": "node scripts/check-package.mjs",
205
206
  "check:declarations": "node scripts/check-declarations.mjs --dist .",
206
207
  "check:bundle": "node scripts/bundle-size.mjs",
@@ -211,23 +212,23 @@
211
212
  "eval:smoke": "tsx eval/run-smoke.ts",
212
213
  "eval:perf": "tsx eval/run-perf.ts",
213
214
  "eval:report": "tsx eval/report.ts",
214
- "check:core": "npm run format:check && npm run check:providers-generated && npm run check:docs && npm run check:changes && npm run check:operator-ui && npm run check:clerk-sdk && npm run check:lint && npm run check:unused && npm run typecheck && npm run test && npm run build && npm run check:declarations && npm run check:bundle && npm run check:examples",
215
+ "check:core": "pnpm run format:check && pnpm run check:providers-generated && pnpm run check:docs && pnpm run check:changes && pnpm run check:operator-ui && pnpm run check:clerk-sdk && pnpm run check:lint && pnpm run check:unused && pnpm run typecheck && pnpm run test && pnpm run build && pnpm run check:declarations && pnpm run check:bundle && pnpm run check:examples",
215
216
  "check:fast": "node scripts/check-fast.mjs",
216
- "check": "npm run check:core && npm run test:browser",
217
- "release:check": "npm run check && npm run check:security && npm run check:package",
218
- "prepack": "npm run check",
217
+ "check": "pnpm run check:core && pnpm run test:browser",
218
+ "release:check": "pnpm run check && pnpm run check:security && pnpm run check:package",
219
+ "prepack": "pnpm run check",
219
220
  "check:changes": "node scripts/changelog.mjs --check && node scripts/check-node-suites.mjs && node --test scripts/changelog.test.mjs",
220
221
  "changelog:assemble": "node scripts/changelog.mjs",
221
222
  "providers:generate": "tsx scripts/generate-providers.mjs",
222
223
  "check:providers-generated": "tsx scripts/generate-providers.mjs --check",
223
- "prebuild": "node scripts/generate-version.mjs && npm run build:operator-ui",
224
- "pretest": "node scripts/generate-version.mjs && npm run build:operator-ui",
225
- "pretest:node": "node scripts/generate-version.mjs && npm run build:operator-ui",
226
- "pretest:workers": "node scripts/generate-version.mjs && npm run build:operator-ui",
227
- "pretest:browser": "npm run build:operator-ui",
228
- "pretypecheck": "node scripts/generate-version.mjs && npm run build:operator-ui",
229
- "precheck:bundle": "npm run build:operator-ui",
230
- "precheck:fast": "npm run check:operator-ui",
224
+ "prebuild": "node scripts/generate-version.mjs && pnpm run build:operator-ui",
225
+ "pretest": "node scripts/generate-version.mjs && pnpm run build:operator-ui",
226
+ "pretest:node": "node scripts/generate-version.mjs && pnpm run build:operator-ui",
227
+ "pretest:workers": "node scripts/generate-version.mjs && pnpm run build:operator-ui",
228
+ "pretest:browser": "pnpm run build:operator-ui",
229
+ "pretypecheck": "node scripts/generate-version.mjs && pnpm run build:operator-ui",
230
+ "precheck:bundle": "pnpm run build:operator-ui",
231
+ "precheck:fast": "pnpm run check:operator-ui",
231
232
  "eval:regrade": "tsx eval/regrade.ts",
232
233
  "eval:compare": "tsx eval/compare.ts",
233
234
  "format": "oxfmt --write .",
@@ -263,8 +264,8 @@
263
264
  "@cloudflare/codemode": "^0.5.0",
264
265
  "@cloudflare/vitest-pool-workers": "^0.18.8",
265
266
  "@cloudflare/workers-types": "^4.20250101.0 || ^5.0.0",
266
- "@fontsource-variable/geist": "^5.3.0",
267
- "@fontsource-variable/geist-mono": "^5.3.0",
267
+ "@fontsource-variable/hanken-grotesk": "^5.3.0",
268
+ "@fontsource-variable/jetbrains-mono": "^5.3.0",
268
269
  "@playwright/test": "^1.62.0",
269
270
  "@radix-ui/react-dialog": "^1.2.0",
270
271
  "@radix-ui/react-slot": "^1.4.0",
@@ -273,7 +274,6 @@
273
274
  "@tailwindcss/oxide": "^4.3.3",
274
275
  "@tanstack/react-query": "^5.104.1",
275
276
  "@tanstack/react-router": "^1.170.41",
276
- "@tanstack/react-table": "^8.21.3",
277
277
  "@types/node": "^22.0.0",
278
278
  "@types/react": "^19.3.0",
279
279
  "@types/react-dom": "^19.3.0",
@@ -42,13 +42,19 @@ tokens, upgrading, and diagnosis with `connecta doctor` to their procedures.
42
42
  - Organize agent pools by connecta's agent pool layout:
43
43
  `node_modules/@zackbart/connecta/documentation/auth.md#organizing-an-agents-pools`
44
44
  ([online](https://github.com/zackbart/connecta/blob/main/documentation/auth.md#organizing-an-agents-pools)).
45
- Each agent keeps one Connecta connection whose client picks the pool per
46
- turn: base pool `<agent>` (shared connectors, no `owner`) outside a
47
- one-on-one, and `<agent>-<user>` (the base plus that user's own connector
48
- ids, `owner` set to their Workspace address) only with that user. Never list
49
- another person in a `<agent>-<user>` pool: its per-user connectors act as
50
- that user for every member. Never add a second Connecta connection or mount
51
- downstream tools directly.
45
+ Each agent keeps one Connecta connection whose harness, never the model,
46
+ picks the pool per turn. Tiers are nested pools of shared connectors with
47
+ no `owner`, each spreading the tool list below. Recommended names are
48
+ `<agent>` for the lowest and `<agent>-<tier>` above it; any named pool,
49
+ including an existing `team` or `leadership` pool, may be a tier if all its
50
+ human members are cleared for it. A chat gets the most capable tier everyone
51
+ present is cleared for, and the lowest when anyone present is unknown.
52
+ `<agent>-<user>` (that user's highest tier plus their own connector ids,
53
+ `owner` set to their Workspace address) is used only in a one-on-one with
54
+ that user. List only cleared people in a tier, and never another person in
55
+ a `<agent>-<user>` pool: its per-user connectors act as that user for every
56
+ member. Never add a second Connecta connection or mount downstream tools
57
+ directly.
52
58
  - Brand the operator UI in `operatorUi({ branding })`: product and owner names,
53
59
  description, favicon, and `theme` (`accent`, `radius`, `fontFamily`,
54
60
  `monoFamily`, `colorScheme`). Ask the deployment's owner for their brand
@@ -55,6 +55,8 @@ npm start
55
55
  ```
56
56
 
57
57
  The local commands read the process environment; they do not load `.env`.
58
+ To run them with the values in `.env`, export it into the shell first:
59
+ `set -a; . ./.env; set +a`.
58
60
  Compose reads `.env` for the container commands below. Keep the returned
59
61
  secret in a client secret store and out of source control and logs. A
60
62
  rotation cannot recover an old secret; only the hash persists. An agent has no
@@ -118,9 +120,9 @@ server, then copy the old file into the database once, before the first start:
118
120
  npx connecta migrate-state .connecta-state.json .connecta.sqlite
119
121
  ```
120
122
 
121
- In the container, run it against the volume, e.g. `docker compose run --rm
122
- connecta npx connecta migrate-state /data/connecta-state.json
123
- /data/connecta.sqlite`. It copies every live entry with its expiry, keeps any
123
+ In the container, mount the old file and import it into the volume:
124
+ `docker compose run --rm -v "$PWD/.connecta-state.json:/import/state.json:ro"
125
+ connecta npx connecta migrate-state /import/state.json /data/connecta.sqlite`. It copies every live entry with its expiry, keeps any
124
126
  key the database already holds, and never changes the old file; delete that
125
127
  once the deployment is verified. The 0.28 activity log
126
128
  (`.connecta-activity.jsonl`) is not imported; history starts fresh.
@@ -139,9 +141,9 @@ off. `.env.example` lists each one, and `npm run typecheck` checks every module
139
141
  whether or not it is switched on.
140
142
 
141
143
  The template explicitly enables `ui: operatorUi()` from
142
- `@zackbart/connecta/ui`. Open `http://localhost:8787/` and supply a
143
- declared agent's token to inspect Connections. Sign in with Clerk for human
144
- connection management. Omit that option and import for an API-only
144
+ `@zackbart/connecta/ui`. Open `http://localhost:8787/` and sign in with
145
+ Clerk as a maintainer to inspect Connections and manage connections. Agent
146
+ `cta_` tokens are refused by every human route, the operator UI included. Omit that option and import for an API-only
145
147
  server. OAuth callbacks remain in core even with no UI.
146
148
 
147
149
  The page labels each tool as a read or write and each endpoint as writable or
@@ -215,13 +217,13 @@ Keep this key outside the database. Losing it makes saved values unreadable;
215
217
  upgrades must reuse it. The shipped `time` connector declares no credential
216
218
  slot. Add `credential: { label: "API token" }` to an `api()` connector and read
217
219
  it through `await ctx.credential?.get()`, or use a Notion
218
- connector with `auth: { type: "token" }`, which declares its own slot. Authorized humans manage the slot inside that
219
- connection on `/`; there is no separate Credentials tab.
220
+ connector with `auth: { type: "token" }`, which declares its own slot. Maintainers manage the slot on that
221
+ connector's Connection tab (`/connectors/<id>`); there is no separate Credentials tab.
220
222
 
221
223
  In 0.25.0, this vault also seals downstream OAuth tokens on their first read.
222
224
  That is a one-way state migration for those tokens: rolling back to 0.24.x
223
225
  requires authorizing each OAuth connector again. See the
224
- [0.25.0 changelog](../../CHANGELOG.md#0250--2026-09-23) before upgrading a
226
+ [0.25.0 changelog](https://github.com/zackbart/connecta/blob/main/CHANGELOG.md#0250--2026-09-23) before upgrading a
225
227
  deployment with existing OAuth connections.
226
228
 
227
229
  A saved replacement takes effect on the next call. Connecta tests credentials
@@ -273,10 +275,11 @@ from `CONNECTA_TOKEN`; it never accepts the secret as a command-line argument.
273
275
  Remote URLs must use HTTPS.
274
276
 
275
277
  A fully-wired deployment reports exactly the same line as a bare one —
276
- connector count, QuickJS executed, six tools, plus any catalog drift:
278
+ connector count, the executor, the tool count, the negotiated MCP version, and
279
+ the package version:
277
280
 
278
281
  ```text
279
- Connecta doctor passed: 1 connector(s), QuickJS executed, prescribed six-tool surface.
282
+ Connecta doctor passed: 1 connector(s), QuickJS executed, prescribed 6-tool surface, MCP <version>, package <version>.
280
283
  ```
281
284
 
282
285
  `QuickJS` is this deployment's sandbox, reported by the deployment itself —
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@clerk/backend": "^3.12.0",
21
- "@zackbart/connecta": "0.33.0",
21
+ "@zackbart/connecta": "0.34.0",
22
22
  "quickjs-emscripten": "0.32.0"
23
23
  },
24
24
  "devDependencies": {
@@ -92,8 +92,8 @@ export default defineConfig((env: Env) => {
92
92
  // /mcp/<name>, and "agent:<name>" for a declared agent at /agent/<name>.
93
93
  // A member connects their own account on the pool's personal connectors.
94
94
  // `npm run doctor` checks /agent/local-machine with its token. The starter
95
- // pool is the agent's base pool (shared connectors, no owner), named after
96
- // the agent as the agent pool layout requires.
95
+ // pool is the agent's base pool, its lowest tier (shared connectors, no
96
+ // owner), named after the agent as the agent pool layout requires.
97
97
  pools: { "local-machine": { tools: ["time"], members: ["agent:local-machine"] } },
98
98
  // Machine clients are agents declared here by name, each with one cta_
99
99
  // token. Issue or rotate one locally with