@zackbart/connecta 0.34.0 → 0.35.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 (428) hide show
  1. package/CHANGELOG.md +393 -0
  2. package/README.md +62 -105
  3. package/SECURITY.md +3 -2
  4. package/bin/connecta.mjs +41 -16
  5. package/bin/version.mjs +1 -1
  6. package/dist/access-tokens.d.ts +2 -1
  7. package/dist/access-tokens.js +66 -30
  8. package/dist/activity.d.ts +1 -1
  9. package/dist/activity.js +2 -0
  10. package/dist/agent-config.d.ts +23 -0
  11. package/dist/agent-config.js +59 -0
  12. package/dist/agent-description.js +16 -0
  13. package/dist/agent-identity.js +4 -4
  14. package/dist/agent-observation.js +39 -0
  15. package/dist/auth/clerk-sdk/client.d.ts +2 -0
  16. package/dist/auth/clerk-sdk/generated.js +554 -563
  17. package/dist/auth/clerk-transport.js +70 -3
  18. package/dist/auth/clerk.d.ts +13 -0
  19. package/dist/auth/clerk.js +653 -246
  20. package/dist/auth/cloudflare-access.js +46 -42
  21. package/dist/auth/downstream-client-metadata.js +2 -2
  22. package/dist/auth/downstream-oauth.js +2051 -1160
  23. package/dist/auth/downstream-revocation.js +88 -88
  24. package/dist/auth/native-call.js +20 -0
  25. package/dist/auth/native.js +184 -0
  26. package/dist/auth/oauth-start-reset.js +11 -5
  27. package/dist/auth/oauth-token-response.js +121 -102
  28. package/dist/auth/oauth-v2-migration.js +97 -78
  29. package/dist/auth/renewable-grant.js +10 -0
  30. package/dist/auth/static-oauth.js +663 -271
  31. package/dist/auth/vercel-agent.js +266 -0
  32. package/dist/auth-admission.js +204 -0
  33. package/dist/auth-elicitation.js +350 -241
  34. package/dist/authorization-handoff.js +164 -90
  35. package/dist/call-admission-context.js +3 -10
  36. package/dist/call-admission.js +2 -0
  37. package/dist/call-classification.js +9 -0
  38. package/dist/call-recovery.js +32 -13
  39. package/dist/canonical-json.js +8 -0
  40. package/dist/catalog-cache.js +369 -213
  41. package/dist/catalog-service.js +659 -530
  42. package/dist/catalog.js +5 -1
  43. package/dist/concurrency.js +0 -25
  44. package/dist/config-defaults.d.ts +1 -0
  45. package/dist/config-defaults.js +1 -0
  46. package/dist/config-schema.d.ts +3 -1
  47. package/dist/config-schema.js +13 -3
  48. package/dist/config.d.ts +40 -6
  49. package/dist/config.js +40 -26
  50. package/dist/connector-caller.d.ts +4 -0
  51. package/dist/connector-caller.js +17 -4
  52. package/dist/connectors/api-connector.d.ts +15 -7
  53. package/dist/connectors/api-connector.js +147 -57
  54. package/dist/connectors/guarded-fetch.d.ts +51 -17
  55. package/dist/connectors/guarded-fetch.js +215 -121
  56. package/dist/connectors/negotiation-cache.js +20 -10
  57. package/dist/connectors/option-shapes.js +1 -1
  58. package/dist/connectors/remote-mcp.d.ts +12 -30
  59. package/dist/connectors/remote-mcp.js +960 -564
  60. package/dist/d1.js +10 -243
  61. package/dist/derived-context.js +5 -0
  62. package/dist/describe-config.d.ts +5 -1
  63. package/dist/describe-config.js +3 -0
  64. package/dist/downstream-input.js +347 -260
  65. package/dist/errors.d.ts +87 -6
  66. package/dist/errors.js +114 -4
  67. package/dist/execute.js +87 -50
  68. package/dist/executor-admission.js +3 -0
  69. package/dist/executors/quickjs.js +163 -112
  70. package/dist/guarded-transport.js +50 -0
  71. package/dist/guest-runtime.js +1 -1
  72. package/dist/http/client.js +439 -0
  73. package/dist/http/errors.js +558 -0
  74. package/dist/http/fields.js +49 -0
  75. package/dist/http/hatch-paging.js +318 -0
  76. package/dist/http/hatch.js +1279 -0
  77. package/dist/http/json-schema.js +267 -0
  78. package/dist/http/node-transport.js +241 -0
  79. package/dist/http/oauth.js +162 -0
  80. package/dist/http/paging.js +228 -0
  81. package/dist/http/provider.js +221 -0
  82. package/dist/http/safety.js +82 -0
  83. package/dist/http/services.js +79 -0
  84. package/dist/http/tools.js +383 -0
  85. package/dist/http/vendor-index.js +138 -0
  86. package/dist/http/vendor.js +448 -0
  87. package/dist/http/write-request.js +66 -0
  88. package/dist/http-policy.d.ts +11 -0
  89. package/dist/http-policy.js +45 -0
  90. package/dist/inbound-credential.js +1 -1
  91. package/dist/index.d.ts +2 -2
  92. package/dist/index.js +4 -0
  93. package/dist/invocation-auth.js +30 -19
  94. package/dist/invocation.js +221 -87
  95. package/dist/mcp-result.js +0 -4
  96. package/dist/membership.d.ts +4 -0
  97. package/dist/meta-output.js +1 -1
  98. package/dist/meta-tools.js +534 -408
  99. package/dist/native-recovery.js +52 -0
  100. package/dist/native-tools.js +382 -0
  101. package/dist/node.d.ts +4 -3
  102. package/dist/node.js +45 -8
  103. package/dist/oauth-handoff.js +177 -104
  104. package/dist/oauth-partition.js +6 -20
  105. package/dist/oauth-sealing.js +6 -7
  106. package/dist/operation-vocabulary.js +101 -0
  107. package/dist/operator-record.d.ts +2 -2
  108. package/dist/operator-record.js +17 -4
  109. package/dist/operator-ui/agents.d.ts +5 -4
  110. package/dist/operator-ui/agents.js +17 -7
  111. package/dist/operator-ui/config-summary.js +8 -4
  112. package/dist/operator-ui/connection-map.js +9 -6
  113. package/dist/operator-ui/contract.d.ts +7 -3
  114. package/dist/operator-ui/endpoints.js +5 -14
  115. package/dist/operator-ui/fix-prompts.d.ts +1 -1
  116. package/dist/operator-ui/fix-prompts.js +0 -8
  117. package/dist/operator-ui/generated.js +3 -3
  118. package/dist/operator-ui/health.js +52 -0
  119. package/dist/operator-ui/model.d.ts +2 -3
  120. package/dist/operator-ui/overview.js +11 -19
  121. package/dist/operator-ui/setup-commands.js +0 -4
  122. package/dist/operator-ui/view.d.ts +5 -29
  123. package/dist/operator-ui/view.js +3 -59
  124. package/dist/program-writes.js +47 -26
  125. package/dist/provider-call-facts.d.ts +115 -0
  126. package/dist/provider-call-facts.js +182 -0
  127. package/dist/provider-call.d.ts +112 -0
  128. package/dist/provider-call.js +271 -0
  129. package/dist/provider.d.ts +71 -32
  130. package/dist/provider.js +134 -40
  131. package/dist/providers/_shared/google/hatch.js +91 -0
  132. package/dist/providers/_shared/google/kit.js +537 -0
  133. package/dist/providers/_shared/google/result-size.js +15 -2
  134. package/dist/providers/_shared/google/service-account.d.ts +2 -1
  135. package/dist/providers/_shared/google/service-account.js +8 -4
  136. package/dist/providers/_shared/google/workspace.d.ts +8 -209
  137. package/dist/providers/_shared/google/workspace.js +7 -426
  138. package/dist/providers/_shared/rest/compact-index.js +86 -0
  139. package/dist/providers/_shared/rest/dispatch.js +3 -23
  140. package/dist/providers/_shared/rest/kit.js +546 -0
  141. package/dist/providers/_shared/rest/operation-index.js +230 -14
  142. package/dist/providers/_shared/rest/response-media.js +11 -0
  143. package/dist/providers/_shared/rest/tools.js +101 -78
  144. package/dist/providers/_shared/rest/value-safety.js +353 -195
  145. package/dist/providers/_shared/sensitive-fields.js +27 -0
  146. package/dist/providers/breeze/api.js +584 -0
  147. package/dist/providers/breeze/index.d.ts +3 -3
  148. package/dist/providers/breeze/index.js +67 -1420
  149. package/dist/providers/breeze/openapi.generated.js +60 -0
  150. package/dist/providers/breeze/skill.generated.js +2 -6
  151. package/dist/providers/breeze/tools.js +696 -0
  152. package/dist/providers/ccb/api.js +496 -0
  153. package/dist/providers/ccb/index.d.ts +17 -37
  154. package/dist/providers/ccb/index.js +77 -1702
  155. package/dist/providers/ccb/lib/constants.d.ts +34 -0
  156. package/dist/providers/ccb/lib/constants.js +74 -0
  157. package/dist/providers/ccb/lib/guide.js +9 -0
  158. package/dist/providers/ccb/lib/verdicts.js +387 -0
  159. package/dist/providers/ccb/openapi.generated.js +397 -0
  160. package/dist/providers/ccb/safety.js +295 -0
  161. package/dist/providers/ccb/skill.generated.js +2 -6
  162. package/dist/providers/ccb/tools.js +853 -0
  163. package/dist/providers/cloudflare/api.js +1066 -0
  164. package/dist/providers/cloudflare/index.d.ts +7 -22
  165. package/dist/providers/cloudflare/index.js +80 -194
  166. package/dist/providers/cloudflare/lib/config.d.ts +16 -0
  167. package/dist/providers/cloudflare/lib/config.js +2 -0
  168. package/dist/providers/cloudflare/lib/discovery.js +29 -0
  169. package/dist/providers/cloudflare/{graphql.js → lib/graphql.js} +1 -1
  170. package/dist/providers/cloudflare/lib/hatch.js +103 -0
  171. package/dist/providers/cloudflare/lib/path-bounds.js +28 -0
  172. package/dist/providers/cloudflare/lib/response-media.js +75 -0
  173. package/dist/providers/cloudflare/openapi.generated.js +3299 -3208
  174. package/dist/providers/cloudflare/{value-safety.js → safety.js} +538 -18
  175. package/dist/providers/cloudflare/skill.generated.js +2 -10
  176. package/dist/providers/cloudflare/tools.js +360 -0
  177. package/dist/providers/docs/api.js +51 -0
  178. package/dist/providers/docs/index.d.ts +1 -12
  179. package/dist/providers/docs/index.js +53 -1165
  180. package/dist/providers/docs/lib/constants.d.ts +18 -0
  181. package/dist/providers/docs/lib/constants.js +18 -0
  182. package/dist/providers/docs/lib/discovery.js +26 -0
  183. package/dist/providers/docs/lib/requests.js +48 -0
  184. package/dist/providers/docs/lib/schemas.js +168 -0
  185. package/dist/providers/docs/openapi.generated.js +16 -0
  186. package/dist/providers/docs/safety.js +54 -0
  187. package/dist/providers/docs/skill.generated.js +2 -6
  188. package/dist/providers/docs/tools.js +802 -0
  189. package/dist/providers/drive/api.js +177 -0
  190. package/dist/providers/drive/index.d.ts +1 -12
  191. package/dist/providers/drive/index.js +38 -1448
  192. package/dist/providers/drive/lib/constants.d.ts +6 -0
  193. package/dist/providers/drive/lib/constants.js +6 -0
  194. package/dist/providers/drive/lib/contracts.js +532 -0
  195. package/dist/providers/drive/lib/hatch.js +197 -0
  196. package/dist/providers/drive/openapi.generated.js +77 -0
  197. package/dist/providers/drive/safety.js +90 -0
  198. package/dist/providers/drive/skill.generated.js +2 -6
  199. package/dist/providers/drive/tools.js +1290 -0
  200. package/dist/providers/forms/api.js +71 -0
  201. package/dist/providers/forms/index.d.ts +1 -12
  202. package/dist/providers/forms/index.js +49 -1145
  203. package/dist/providers/forms/lib/constants.d.ts +14 -0
  204. package/dist/providers/forms/lib/constants.js +19 -0
  205. package/dist/providers/forms/lib/hatch.js +72 -0
  206. package/dist/providers/forms/openapi.generated.js +23 -0
  207. package/dist/providers/forms/safety.js +34 -0
  208. package/dist/providers/forms/skill.generated.js +2 -8
  209. package/dist/providers/forms/tools.js +1024 -0
  210. package/dist/providers/github/api.js +150 -0
  211. package/dist/providers/github/index.d.ts +4 -5
  212. package/dist/providers/github/index.js +30 -87
  213. package/dist/providers/github/{auth.d.ts → lib/auth.d.ts} +5 -3
  214. package/dist/providers/github/{auth.js → lib/auth.js} +40 -43
  215. package/dist/providers/github/lib/discovery.js +132 -0
  216. package/dist/providers/github/lib/operations.js +58 -0
  217. package/dist/providers/github/{scope.d.ts → lib/scope.d.ts} +2 -0
  218. package/dist/providers/github/{scope.js → lib/scope.js} +25 -1
  219. package/dist/providers/github/openapi.generated.js +1216 -0
  220. package/dist/providers/github/safety.js +216 -0
  221. package/dist/providers/github/skill.generated.js +2 -5
  222. package/dist/providers/github/tools.js +506 -0
  223. package/dist/providers/gmail/api.js +114 -0
  224. package/dist/providers/gmail/index.d.ts +1 -12
  225. package/dist/providers/gmail/index.js +73 -1621
  226. package/dist/providers/gmail/lib/constants.d.ts +13 -0
  227. package/dist/providers/gmail/lib/constants.js +16 -0
  228. package/dist/providers/gmail/lib/index.js +173 -0
  229. package/dist/providers/gmail/lib/schemas.js +176 -0
  230. package/dist/providers/gmail/lib/threading.js +120 -0
  231. package/dist/providers/gmail/openapi.generated.js +92 -0
  232. package/dist/providers/gmail/safety.js +21 -0
  233. package/dist/providers/gmail/skill.generated.js +2 -6
  234. package/dist/providers/gmail/tools.js +1435 -0
  235. package/dist/providers/overflow/api.js +1008 -0
  236. package/dist/providers/overflow/index.d.ts +3 -17
  237. package/dist/providers/overflow/index.js +60 -1488
  238. package/dist/providers/overflow/skill.generated.js +2 -5
  239. package/dist/providers/overflow/tools.js +873 -0
  240. package/dist/providers/planning-center/api.js +467 -0
  241. package/dist/providers/planning-center/index.d.ts +6 -35
  242. package/dist/providers/planning-center/index.js +69 -2445
  243. package/dist/providers/planning-center/lib/constants.d.ts +58 -0
  244. package/dist/providers/planning-center/lib/constants.js +83 -0
  245. package/dist/providers/planning-center/lib/discovery.js +40 -0
  246. package/dist/providers/planning-center/lib/guide.js +39 -0
  247. package/dist/providers/planning-center/lib/json-api.js +83 -0
  248. package/dist/providers/planning-center/lib/verdicts.js +1758 -0
  249. package/dist/providers/planning-center/openapi.generated.js +1764 -0
  250. package/dist/providers/planning-center/safety.js +188 -0
  251. package/dist/providers/planning-center/skill.generated.js +2 -27
  252. package/dist/providers/planning-center/tools.js +1010 -0
  253. package/dist/providers/sheets/api.js +133 -0
  254. package/dist/providers/sheets/index.d.ts +4 -16
  255. package/dist/providers/sheets/index.js +61 -1172
  256. package/dist/providers/sheets/lib/constants.d.ts +14 -0
  257. package/dist/providers/sheets/lib/constants.js +14 -0
  258. package/dist/providers/sheets/lib/hatch.js +163 -0
  259. package/dist/providers/sheets/lib/requests.js +105 -0
  260. package/dist/providers/sheets/lib/schemas.js +138 -0
  261. package/dist/providers/sheets/openapi.generated.js +30 -0
  262. package/dist/providers/sheets/safety.js +27 -0
  263. package/dist/providers/sheets/skill.generated.js +2 -7
  264. package/dist/providers/sheets/tools.js +734 -0
  265. package/dist/providers/slides/api.js +147 -0
  266. package/dist/providers/slides/index.d.ts +2 -10
  267. package/dist/providers/slides/index.js +48 -2555
  268. package/dist/providers/slides/lib/constants.d.ts +11 -0
  269. package/dist/providers/slides/lib/constants.js +11 -0
  270. package/dist/providers/slides/lib/requests.js +60 -0
  271. package/dist/providers/slides/lib/schemas.js +565 -0
  272. package/dist/providers/slides/openapi.generated.js +18 -0
  273. package/dist/providers/slides/skill.generated.js +2 -6
  274. package/dist/providers/slides/tools.js +1968 -0
  275. package/dist/providers/stripe/api.js +401 -0
  276. package/dist/providers/stripe/index.d.ts +7 -27
  277. package/dist/providers/stripe/index.js +75 -191
  278. package/dist/providers/stripe/lib/config.d.ts +4 -0
  279. package/dist/providers/stripe/lib/config.js +2 -0
  280. package/dist/providers/stripe/openapi.generated.js +4 -3
  281. package/dist/providers/stripe/{value-safety.js → safety.js} +5 -5
  282. package/dist/providers/stripe/skill.generated.js +2 -10
  283. package/dist/providers/stripe/tools.js +77 -0
  284. package/dist/providers/tithely/api.js +531 -0
  285. package/dist/providers/tithely/index.d.ts +19 -0
  286. package/dist/providers/tithely/index.js +86 -965
  287. package/dist/providers/tithely/skill.generated.js +2 -5
  288. package/dist/providers/tithely/tools.js +426 -0
  289. package/dist/providers/vercel/api.js +551 -0
  290. package/dist/providers/vercel/index.d.ts +11 -25
  291. package/dist/providers/vercel/index.js +67 -261
  292. package/dist/providers/vercel/lib/config.d.ts +2 -0
  293. package/dist/providers/vercel/lib/config.js +2 -0
  294. package/dist/providers/vercel/lib/index.js +117 -0
  295. package/dist/providers/vercel/lib/logs.js +100 -0
  296. package/dist/providers/vercel/lib/pin.js +270 -0
  297. package/dist/providers/vercel/openapi.generated.js +398 -376
  298. package/dist/providers/vercel/{value-safety.js → safety.js} +261 -42
  299. package/dist/providers/vercel/skill.generated.js +2 -7
  300. package/dist/providers/vercel/tools.js +642 -0
  301. package/dist/redaction-identity.js +47 -0
  302. package/dist/redaction-marker.js +125 -0
  303. package/dist/registry.d.ts +30 -28
  304. package/dist/registry.js +446 -413
  305. package/dist/routes/access-tokens.js +1 -1
  306. package/dist/routes/actor-labels.js +1 -1
  307. package/dist/routes/connect.js +1 -1
  308. package/dist/routes/dispatch.js +103 -0
  309. package/dist/routes/mcp.js +170 -79
  310. package/dist/routes/oauth.js +3 -1
  311. package/dist/routes/operator.js +2 -2
  312. package/dist/routes/shared.d.ts +5 -4
  313. package/dist/routes/shared.js +244 -177
  314. package/dist/routes/skills.js +10 -8
  315. package/dist/routes/ui-config.js +27 -3
  316. package/dist/routes/ui-data.js +29 -22
  317. package/dist/routes/ui.js +1 -1
  318. package/dist/runtime/call-admission.js +0 -26
  319. package/dist/runtime/call-entry.js +30 -0
  320. package/dist/runtime/call.js +556 -0
  321. package/dist/runtime/connector-scope.js +7 -0
  322. package/dist/runtime/credential-probe.js +34 -0
  323. package/dist/runtime/executor.js +40 -0
  324. package/dist/runtime/native-storage.js +63 -0
  325. package/dist/runtime/registry.js +27 -0
  326. package/dist/runtime/request-scope.js +72 -0
  327. package/dist/runtime/run.js +15 -7
  328. package/dist/runtime/shared-read.js +34 -5
  329. package/dist/runtime/storage.js +34 -21
  330. package/dist/sent-secrets.d.ts +194 -37
  331. package/dist/sent-secrets.js +1743 -340
  332. package/dist/server.js +5 -56
  333. package/dist/skills.js +330 -224
  334. package/dist/sqlite.js +15 -14
  335. package/dist/storage/d1-copy.js +255 -0
  336. package/dist/storage/d1-driver.js +15 -0
  337. package/dist/storage/keys.js +28 -0
  338. package/dist/storage/sql-driver.js +88 -0
  339. package/dist/storage/sql-native.js +544 -0
  340. package/dist/storage/sql-schema.d.ts +6 -0
  341. package/dist/storage/sql-schema.js +15 -0
  342. package/dist/storage/sql.d.ts +14 -20
  343. package/dist/storage/sql.js +29 -535
  344. package/dist/timeout.js +0 -26
  345. package/dist/tool-safety.js +20 -10
  346. package/dist/types.d.ts +11 -99
  347. package/dist/upward.js +3 -0
  348. package/dist/usage-guide.js +3 -1
  349. package/dist/validate.d.ts +4 -2
  350. package/dist/validate.js +86 -9
  351. package/dist/version.d.ts +1 -1
  352. package/dist/version.js +1 -1
  353. package/dist/worker.js +312 -292
  354. package/dist/workspace-subject.js +5 -1
  355. package/dist/write-outcome.js +454 -34
  356. package/documentation/README.md +27 -7
  357. package/documentation/architecture.md +2550 -186
  358. package/documentation/auth.md +821 -98
  359. package/documentation/code-mode.md +56 -21
  360. package/documentation/deploying.md +164 -20
  361. package/documentation/hosted-mcp-migration.md +460 -0
  362. package/documentation/integrating.md +144 -105
  363. package/documentation/meta-tools.md +411 -34
  364. package/documentation/operating.md +28 -4
  365. package/documentation/operator-tests.md +11 -2
  366. package/documentation/operator-ui.md +103 -33
  367. package/documentation/provider-auth-migration.md +38 -63
  368. package/documentation/provider-migration-0.29.md +10 -5
  369. package/documentation/provider-migration-0.35.md +975 -0
  370. package/documentation/providers.md +965 -0
  371. package/examples/worker/AGENTS.md +23 -9
  372. package/examples/worker/README.md +254 -135
  373. package/examples/worker/alchemy.run.ts +116 -0
  374. package/examples/worker/gitignore +10 -0
  375. package/examples/worker/src/connecta.config.ts +23 -21
  376. package/examples/worker/wrangler.jsonc +14 -5
  377. package/guides/connecting-agents.md +157 -0
  378. package/guides/how-it-works.md +156 -0
  379. package/guides/safety-and-trust.md +153 -0
  380. package/package.json +27 -42
  381. package/templates/node/.env.example +3 -0
  382. package/templates/node/README.md +22 -2
  383. package/templates/node/docker-compose.yml +1 -0
  384. package/templates/node/package.json +3 -2
  385. package/templates/node/src/connecta.config.ts +8 -0
  386. package/dist/catalog-drift.d.ts +0 -134
  387. package/dist/catalog-drift.js +0 -493
  388. package/dist/providers/_shared/request-token.js +0 -83
  389. package/dist/providers/_shared/rest/operation-index.d.ts +0 -133
  390. package/dist/providers/_shared/rest/tools.d.ts +0 -141
  391. package/dist/providers/_shared/rest/value-safety.d.ts +0 -201
  392. package/dist/providers/basecamp/index.d.ts +0 -43
  393. package/dist/providers/basecamp/index.js +0 -997
  394. package/dist/providers/basecamp/skill.generated.js +0 -9
  395. package/dist/providers/cloudflare/rest.d.ts +0 -37
  396. package/dist/providers/cloudflare/rest.js +0 -1078
  397. package/dist/providers/github/hosted.js +0 -218
  398. package/dist/providers/github/rest.js +0 -321
  399. package/dist/providers/infisical/index.d.ts +0 -7
  400. package/dist/providers/infisical/index.js +0 -713
  401. package/dist/providers/infisical/skill.generated.js +0 -8
  402. package/dist/providers/linear/index.d.ts +0 -55
  403. package/dist/providers/linear/index.js +0 -352
  404. package/dist/providers/linear/skill.generated.js +0 -8
  405. package/dist/providers/mixpanel/index.d.ts +0 -57
  406. package/dist/providers/mixpanel/index.js +0 -468
  407. package/dist/providers/mixpanel/operations.js +0 -20
  408. package/dist/providers/mixpanel/rest.js +0 -603
  409. package/dist/providers/mixpanel/skill.generated.js +0 -10
  410. package/dist/providers/mixpanel/value-safety.js +0 -16
  411. package/dist/providers/notion/index.d.ts +0 -65
  412. package/dist/providers/notion/index.js +0 -368
  413. package/dist/providers/notion/openapi.generated.js +0 -75
  414. package/dist/providers/notion/rest.d.ts +0 -24
  415. package/dist/providers/notion/rest.js +0 -1226
  416. package/dist/providers/notion/skill.generated.js +0 -11
  417. package/dist/providers/notion/value-safety.js +0 -56
  418. package/dist/providers/revenuecat/index.d.ts +0 -49
  419. package/dist/providers/revenuecat/index.js +0 -557
  420. package/dist/providers/revenuecat/skill.generated.js +0 -11
  421. package/dist/providers/stripe/rest.d.ts +0 -14
  422. package/dist/providers/stripe/rest.js +0 -402
  423. package/dist/providers/vercel/rest.d.ts +0 -20
  424. package/dist/providers/vercel/rest.js +0 -1020
  425. package/dist/providers/wispr-flow/index.d.ts +0 -14
  426. package/dist/providers/wispr-flow/index.js +0 -117
  427. package/dist/providers/wispr-flow/skill.generated.js +0 -8
  428. /package/dist/providers/github/{key.js → lib/key.js} +0 -0
@@ -0,0 +1,153 @@
1
+ # Safety and trust
2
+
3
+ Connecta helps limit tool access. It does not approve every action or
4
+ guarantee that returned business data is safe to share. Your operator—the
5
+ person or team running the server—chooses accounts, access, and approval rules.
6
+
7
+ With authentication configured, Connecta checks who is calling and which
8
+ tools they can use. Without configured authentication, the main `/mcp`
9
+ endpoint serves its whole tool list to anyone who can reach it.
10
+
11
+ The [operator documentation](../documentation/README.md) owns exact setup
12
+ and behavior. This guide explains the boundaries and their limits.
13
+
14
+ ## A timeout can leave a change's status unknown
15
+
16
+ A **write** changes something: a record, payment, permission, or other service
17
+ state. The service might apply it even when no answer comes back. Check the
18
+ current record or service history before trying again.
19
+
20
+ For tools classified as writes, once Connecta sends a change, it never
21
+ automatically sends it again. This includes a timeout or a lost response.
22
+ That does not promise the service completed it exactly once. A new request
23
+ or a rerun of a program can repeat the action.
24
+
25
+ ```mermaid
26
+ sequenceDiagram
27
+ participant A as Agent
28
+ participant C as Connecta
29
+ participant S as Service
30
+ A->>C: Request a write
31
+ C->>S: Send once
32
+ S->>S: The write may have applied
33
+ S--xC: Response lost or deadline reached
34
+ C-->>A: Outcome unknown, do not blindly repeat
35
+ A->>C: Check current state or history
36
+ C->>S: Read available evidence
37
+ S-->>C: Current state or history
38
+ C-->>A: Investigate further if still uncertain
39
+ ```
40
+
41
+ An **unknown outcome** means Connecta cannot prove whether the change
42
+ happened. A read may help, but may not settle it. If the answer is still
43
+ unclear, stop and investigate.
44
+
45
+ Do not repeat a successful change just to recover its output either.
46
+ The [write contract](../documentation/code-mode.md#writes) and
47
+ [result recovery guide](../documentation/meta-tools.md#paging-with-connectaresult)
48
+ explain how to check the service or retrieve retained output.
49
+
50
+ ## Read-only blocks actions that change data
51
+
52
+ A read-only pool hides tools marked as writes and refuses attempts to call
53
+ them before sending anything. Guessing a tool name or asking from a program
54
+ does not bypass it. A whole service connection can also be read-only; a
55
+ writable pool cannot reopen that connection for writes.
56
+
57
+ ```mermaid
58
+ flowchart LR
59
+ Call["Requested action"] --> Allowed{"Pool allows this tool?"}
60
+ Allowed -->|No| Refuse["Refuse"]
61
+ Allowed -->|Yes| Write{"Marked as a write?"}
62
+ Write -->|No| Run["Check inputs and send"]
63
+ Write -->|Yes| ReadOnly{"Pool or connection read-only?"}
64
+ ReadOnly -->|Yes| Refuse
65
+ ReadOnly -->|No| Run
66
+ ```
67
+
68
+ Read-only protection and the single-attempt rule depend on truthful
69
+ classification: the labels identifying actions that change data. Missing
70
+ or contradictory read hints count as writes, but a service can mislabel an
71
+ action and an operator can override its label. Use restricted service
72
+ credentials as another boundary where possible.
73
+
74
+ The AI app owns approvals. It may ask based on an earlier tool label. If a
75
+ read becomes a write, a writable pool can execute it without a fresh
76
+ approval; a read-only pool refuses it. Connecta does not pause a program to
77
+ ask a person partway through.
78
+
79
+ See [read-only setup](../documentation/integrating.md#make-one-connection-read-only)
80
+ and the [write policy](../documentation/code-mode.md#writes) for exact rules.
81
+
82
+ ## Keep credentials private and enable the vault
83
+
84
+ The agent receives tool results without needing the service credential used
85
+ to make the call. Redaction removes known secrets from output, but is not a
86
+ general detector for every secret or piece of personal data in a record.
87
+
88
+ With the encrypted credential vault configured, Connecta seals stored
89
+ downstream credentials and OAuth tokens and binds each to its connector and
90
+ owner. Without a vault, stored OAuth tokens are kept in plaintext, so enable
91
+ the vault **before connecting accounts**. Follow
92
+ [shared credential setup](../documentation/auth.md#connect-a-shared-credential)
93
+ and [OAuth storage rules](../documentation/auth.md#downstream-oauth-state-at-rest).
94
+
95
+ Maintained integrations also withhold reviewed sensitive values. A value
96
+ shown as `[redacted]` is unavailable, not a usable credential. Redaction
97
+ covers known values and supported forms; a malicious service can transform
98
+ data into forms outside that coverage.
99
+
100
+ Connecta's activity, status, and logs omit arguments, results, program source,
101
+ and raw downstream error text. Your AI app, proxies, and other logging systems
102
+ need their own data-handling policies. Keep agent tokens in the app's secret
103
+ store, outside prompts, source files, and logs.
104
+
105
+ The [operator data contract](../documentation/operator-ui.md#operator-data-contract)
106
+ explains activity disclosure.
107
+
108
+ ## A credential proves an agent, not a person
109
+
110
+ Anyone holding an agent's `cta_` token can act as that agent. Vercel workload
111
+ identity uses a signed project token instead. It removes the separately
112
+ provisioned Connecta secret, while still trusting whoever can obtain the
113
+ project token.
114
+
115
+ ```mermaid
116
+ flowchart TB
117
+ Saved["Agent-token holder"] --> Agent["Declared agent"]
118
+ Project["Trusted Vercel project-token holder"] --> Agent
119
+ Agent --> Pools["Configured pools"]
120
+ Pools --> Accounts["Assigned service accounts"]
121
+ ```
122
+
123
+ Trust project code, build steps, and services receiving a Vercel token with
124
+ the same agent access. Preview or development environments should be enabled
125
+ only if they deserve that access too. A token holder may obtain fresh tokens,
126
+ so access can outlast the original token's expiry.
127
+
128
+ When both methods are enabled, stopping one leaves the other active.
129
+ Removing the declared agent stops both. Revocation does not recall requests
130
+ already admitted. Neither method identifies the human chatting with the agent.
131
+
132
+ The [token guide](../documentation/auth.md#issue-rotate-or-revoke-an-agent-token)
133
+ and [Vercel trust guide](../documentation/auth.md#vercel-workload-credentials)
134
+ own availability, project/environment choices, and revocation details.
135
+
136
+ ## What the operator remains responsible for
137
+
138
+ | Decision | Why it matters |
139
+ | ------------------------------ | ---------------------------------------------------------------------------------------------------- |
140
+ | Inbound authentication | Without configured `auth`, plain `/mcp` serves the whole catalog to anyone who can reach it. |
141
+ | Enable the credential vault | Encrypt stored credentials and OAuth tokens before connecting accounts. |
142
+ | Pool membership and tools | Each member can use every action that pool grants. |
143
+ | Service permissions | A shared credential uses the same account for every member. |
144
+ | Approval policy | A writable pool can run unattended; the Eve helper defaults to that behavior. |
145
+ | Tool classification | Labels must match the service's actual behavior. |
146
+ | Deployment and secret handling | Enable the credential vault; protect storage, encryption keys, backups, ingress, and the agent host. |
147
+ | Conversation routing | Keep private results out of broader chats. |
148
+ | Uncertain changes | Check the service before requesting another change. |
149
+
150
+ For concrete steps, use [deployment operations](../documentation/deploying.md),
151
+ [agent pool layout](../documentation/auth.md#organizing-an-agents-pools), and
152
+ [Connecting agents](./connecting-agents.md). The [security policy](../SECURITY.md)
153
+ explains how to report a problem.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zackbart/connecta",
3
- "version": "0.34.0",
3
+ "version": "0.35.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.",
@@ -33,6 +33,7 @@
33
33
  "bin",
34
34
  "dist",
35
35
  "documentation",
36
+ "guides",
36
37
  "examples/worker",
37
38
  "templates",
38
39
  "README.md",
@@ -74,10 +75,6 @@
74
75
  "types": "./dist/auth/cloudflare-access.d.ts",
75
76
  "import": "./dist/auth/cloudflare-access.js"
76
77
  },
77
- "./providers/basecamp": {
78
- "types": "./dist/providers/basecamp/index.d.ts",
79
- "import": "./dist/providers/basecamp/index.js"
80
- },
81
78
  "./providers/breeze": {
82
79
  "types": "./dist/providers/breeze/index.d.ts",
83
80
  "import": "./dist/providers/breeze/index.js"
@@ -110,22 +107,6 @@
110
107
  "types": "./dist/providers/gmail/index.d.ts",
111
108
  "import": "./dist/providers/gmail/index.js"
112
109
  },
113
- "./providers/infisical": {
114
- "types": "./dist/providers/infisical/index.d.ts",
115
- "import": "./dist/providers/infisical/index.js"
116
- },
117
- "./providers/linear": {
118
- "types": "./dist/providers/linear/index.d.ts",
119
- "import": "./dist/providers/linear/index.js"
120
- },
121
- "./providers/mixpanel": {
122
- "types": "./dist/providers/mixpanel/index.d.ts",
123
- "import": "./dist/providers/mixpanel/index.js"
124
- },
125
- "./providers/notion": {
126
- "types": "./dist/providers/notion/index.d.ts",
127
- "import": "./dist/providers/notion/index.js"
128
- },
129
110
  "./providers/overflow": {
130
111
  "types": "./dist/providers/overflow/index.d.ts",
131
112
  "import": "./dist/providers/overflow/index.js"
@@ -134,10 +115,6 @@
134
115
  "types": "./dist/providers/planning-center/index.d.ts",
135
116
  "import": "./dist/providers/planning-center/index.js"
136
117
  },
137
- "./providers/revenuecat": {
138
- "types": "./dist/providers/revenuecat/index.d.ts",
139
- "import": "./dist/providers/revenuecat/index.js"
140
- },
141
118
  "./providers/sheets": {
142
119
  "types": "./dist/providers/sheets/index.d.ts",
143
120
  "import": "./dist/providers/sheets/index.js"
@@ -158,10 +135,6 @@
158
135
  "types": "./dist/providers/vercel/index.d.ts",
159
136
  "import": "./dist/providers/vercel/index.js"
160
137
  },
161
- "./providers/wispr-flow": {
162
- "types": "./dist/providers/wispr-flow/index.d.ts",
163
- "import": "./dist/providers/wispr-flow/index.js"
164
- },
165
138
  "./ui": {
166
139
  "types": "./dist/ui.d.ts",
167
140
  "import": "./dist/ui.js"
@@ -194,8 +167,10 @@
194
167
  "test:browser:install": "playwright install chromium",
195
168
  "test:browser": "playwright test",
196
169
  "test:browser:snapshots": "node scripts/update-operator-snapshots.mjs",
170
+ "goldens:update": "node scripts/update-goldens.mjs",
171
+ "pregoldens:update": "node scripts/generate-version.mjs && pnpm run build:operator-ui",
197
172
  "pretest:browser:snapshots": "pnpm run build:operator-ui",
198
- "test:node": "vitest run --project node",
173
+ "test:node": "vitest run --config vitest.config.node.ts",
199
174
  "test:workers": "vitest run --project workers",
200
175
  "check:docs": "node scripts/check-doc-links.mjs",
201
176
  "check:lint": "oxlint -D correctness --report-unused-disable-directives .",
@@ -205,19 +180,20 @@
205
180
  "check:package": "node scripts/check-package.mjs",
206
181
  "check:declarations": "node scripts/check-declarations.mjs --dist .",
207
182
  "check:bundle": "node scripts/bundle-size.mjs",
208
- "providers:check": "tsx scripts/drift-check.mjs --specs --docs",
183
+ "providers:check": "tsx scripts/drift-check.mjs --specs --manual",
209
184
  "drift:check": "tsx scripts/drift-check.mjs",
210
185
  "eval:selftest": "tsx eval/selftest.ts",
211
186
  "eval:agent": "tsx eval/run-agent.ts",
212
187
  "eval:smoke": "tsx eval/run-smoke.ts",
213
188
  "eval:perf": "tsx eval/run-perf.ts",
214
189
  "eval:report": "tsx eval/report.ts",
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",
216
- "check:fast": "node scripts/check-fast.mjs",
217
- "check": "pnpm run check:core && pnpm run test:browser",
218
- "release:check": "pnpm run check && pnpm run check:security && pnpm run check:package",
190
+ "check:static": "node --test scripts/check-provider-exemptions.test.mjs && 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",
191
+ "check:build": "pnpm run build && pnpm run check:declarations && pnpm run check:bundle",
192
+ "check:fast": "pnpm run check:static && vitest run --config vitest.config.node.ts --changed origin/main --passWithNoTests",
193
+ "check": "pnpm run check:static && pnpm run test && pnpm run check:build",
194
+ "release:check": "pnpm run release:check:core && pnpm run release:check:eve",
219
195
  "prepack": "pnpm run check",
220
- "check:changes": "node scripts/changelog.mjs --check && node scripts/check-node-suites.mjs && node --test scripts/changelog.test.mjs",
196
+ "check:changes": "node scripts/changelog.mjs --check && node --test scripts/changelog.test.mjs",
221
197
  "changelog:assemble": "node scripts/changelog.mjs",
222
198
  "providers:generate": "tsx scripts/generate-providers.mjs",
223
199
  "check:providers-generated": "tsx scripts/generate-providers.mjs --check",
@@ -228,25 +204,29 @@
228
204
  "pretest:browser": "pnpm run build:operator-ui",
229
205
  "pretypecheck": "node scripts/generate-version.mjs && pnpm run build:operator-ui",
230
206
  "precheck:bundle": "pnpm run build:operator-ui",
231
- "precheck:fast": "pnpm run check:operator-ui",
232
207
  "eval:regrade": "tsx eval/regrade.ts",
233
208
  "eval:compare": "tsx eval/compare.ts",
234
209
  "format": "oxfmt --write .",
235
210
  "format:check": "oxfmt --check .",
236
- "providers:spec": "tsx scripts/generate-openapi.mjs"
211
+ "providers:spec": "tsx scripts/generate-openapi.mjs",
212
+ "check:eve-package": "node scripts/check-eve-package.mjs",
213
+ "release:check:core": "pnpm run check && pnpm run test:browser && pnpm run check:examples && pnpm run check:security && pnpm run check:package",
214
+ "release:check:eve": "pnpm --filter @zackbart/connecta-eve run check && pnpm run check:eve-package && pnpm run check:security:eve",
215
+ "check:security:eve": "pnpm --dir packages/connecta-eve audit --audit-level moderate"
237
216
  },
238
217
  "dependencies": {
239
218
  "@cfworker/json-schema": "^4.1.1",
240
219
  "@modelcontextprotocol/client": "2.3.1",
241
220
  "@modelcontextprotocol/server": "2.3.1",
242
221
  "acorn": "^8.19.0",
243
- "effect": "^4.0.0",
244
- "zod": "^4.4.3"
222
+ "effect": "4.0.5",
223
+ "zod": "^4.6.6"
245
224
  },
246
225
  "peerDependencies": {
247
226
  "@clerk/backend": "^3.12.0",
248
227
  "@cloudflare/codemode": "^0.4.4 || ^0.5.0",
249
- "quickjs-emscripten": "^0.32.0"
228
+ "quickjs-emscripten": "^0.32.0",
229
+ "undici": "6.29.1"
250
230
  },
251
231
  "peerDependenciesMeta": {
252
232
  "@clerk/backend": {
@@ -257,6 +237,9 @@
257
237
  },
258
238
  "quickjs-emscripten": {
259
239
  "optional": true
240
+ },
241
+ "undici": {
242
+ "optional": true
260
243
  }
261
244
  },
262
245
  "devDependencies": {
@@ -264,6 +247,7 @@
264
247
  "@cloudflare/codemode": "^0.5.0",
265
248
  "@cloudflare/vitest-pool-workers": "^0.18.8",
266
249
  "@cloudflare/workers-types": "^4.20250101.0 || ^5.0.0",
250
+ "@effect/platform-node": "4.0.5",
267
251
  "@fontsource-variable/hanken-grotesk": "^5.3.0",
268
252
  "@fontsource-variable/jetbrains-mono": "^5.3.0",
269
253
  "@playwright/test": "^1.62.0",
@@ -277,8 +261,8 @@
277
261
  "@types/node": "^22.0.0",
278
262
  "@types/react": "^19.3.0",
279
263
  "@types/react-dom": "^19.3.0",
264
+ "alchemy": "2.0.0-beta.83",
280
265
  "cmdk": "^1.1.1",
281
- "commonmark": "^0.31.2",
282
266
  "esbuild": "^0.28.0",
283
267
  "knip": "^6.29.0",
284
268
  "oxfmt": "0.72.0",
@@ -289,6 +273,7 @@
289
273
  "tailwindcss": "^4.3.3",
290
274
  "tsx": "^4.23.1",
291
275
  "typescript": "^5.9.3",
276
+ "undici": "6.29.1",
292
277
  "vitest": "^4.1.6",
293
278
  "wrangler": "^4.114.0"
294
279
  }
@@ -26,6 +26,9 @@ CONNECTA_DATABASE=
26
26
  # may write a credential; machine access tokens grant no interactive authority.
27
27
  CLERK_PUBLISHABLE_KEY=
28
28
  CLERK_SECRET_KEY=
29
+ # Optional with Clerk: the one Clerk Organization (org_...) whose members this
30
+ # deployment admits, when one Clerk instance serves several deployments.
31
+ CLERK_ORGANIZATION_ID=
29
32
  # Required with Clerk: comma-separated Clerk user ids of the maintainers, who
30
33
  # alone use plain /mcp and the operator UI.
31
34
  CONNECTA_MAINTAINERS=
@@ -18,6 +18,21 @@ npm run --silent rotate-token -- local-machine
18
18
  npm start
19
19
  ```
20
20
 
21
+ Keep the template's pinned `undici` dependency and its `listen` import from
22
+ `@zackbart/connecta/node`. `listen` installs the owned HTTP transport used by
23
+ every maintained-provider request, reads included, remote MCP writes, and
24
+ downstream OAuth token, registration and revocation POSTs.
25
+ Without `listen()`, maintained-provider writes, reviewed POST reads and remote
26
+ MCP writes are refused before sending; downstream OAuth credential POSTs also
27
+ require the owned sender. It connects directly by default. For an HTTP(S) CONNECT
28
+ proxy, configure `listen(connecta, { port, proxy: "http://proxy.example.com:8080" })`
29
+ in `src/index.ts`. Ambient proxy variables and host dispatchers do not configure
30
+ the owned sender. Remote MCP reads and OAuth discovery GETs retain native fetch
31
+ and need their own host proxy policy. An uncertain refresh requires fresh
32
+ authorization rather than replaying the spent token. See
33
+ [Node transport requirements](https://github.com/zackbart/connecta/blob/main/documentation/deploying.md#start-on-node)
34
+ for proxy credentials and TLS trust.
35
+
21
36
  The manifest approves only `esbuild@0.28.2` to run its install script. `tsx`
22
37
  uses esbuild to run this TypeScript source, so that script is part of the
23
38
  prescribed runtime path. npm 11 therefore installs without an unreviewed-script
@@ -173,6 +188,11 @@ Enable `aud_claim_enabled: true` in Clerk's instance OAuth application settings
173
188
  (`PATCH /v1/instance/oauth_application_settings` in Clerk's Backend API), then
174
189
  read the setting back. Both JWT and opaque OAuth tokens are supported.
175
190
  Leave `allowedOAuthClientIds` omitted or `[]` to require bound tokens.
191
+ To share one Clerk instance across deployments, give each deployment its own
192
+ Clerk Organization and set `CLERK_ORGANIZATION_ID` to its `org_` id: only that
193
+ Organization's members sign in, and maintainers and pool members still come
194
+ from `src/connecta.config.ts`. [Clerk Organizations](https://github.com/zackbart/connecta/blob/main/documentation/auth.md#one-clerk-instance-one-organization-per-deployment)
195
+ lists the Clerk setup and the isolation tradeoff.
176
196
 
177
197
  Connecta's protected-resource metadata advertises the exact public `/mcp` or
178
198
  `/mcp/<pool>` URL as `resource` and Clerk as the authorization server. MCP
@@ -216,8 +236,8 @@ node -e "console.log(crypto.randomBytes(32).toString('base64'))"
216
236
  Keep this key outside the database. Losing it makes saved values unreadable;
217
237
  upgrades must reuse it. The shipped `time` connector declares no credential
218
238
  slot. Add `credential: { label: "API token" }` to an `api()` connector and read
219
- it through `await ctx.credential?.get()`, or use a Notion
220
- connector with `auth: { type: "token" }`, which declares its own slot. Maintainers manage the slot on that
239
+ it through `await ctx.credential?.get()`, or use a Stripe
240
+ connector with `auth: { type: "apiKey" }`, which declares its own slot. Maintainers manage the slot on that
221
241
  connector's Connection tab (`/connectors/<id>`); there is no separate Credentials tab.
222
242
 
223
243
  In 0.25.0, this vault also seals downstream OAuth tokens on their first read.
@@ -28,6 +28,7 @@ services:
28
28
  # on when set and off when empty.
29
29
  CLERK_PUBLISHABLE_KEY: ${CLERK_PUBLISHABLE_KEY:-}
30
30
  CLERK_SECRET_KEY: ${CLERK_SECRET_KEY:-}
31
+ CLERK_ORGANIZATION_ID: ${CLERK_ORGANIZATION_ID:-}
31
32
  CONNECTA_MAINTAINERS: ${CONNECTA_MAINTAINERS:-}
32
33
  CONNECTA_CREDENTIAL_KEY: ${CONNECTA_CREDENTIAL_KEY:-}
33
34
  CONNECTA_ACTIVITY: ${CONNECTA_ACTIVITY:-}
@@ -18,8 +18,9 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@clerk/backend": "^3.12.0",
21
- "@zackbart/connecta": "0.34.0",
22
- "quickjs-emscripten": "0.32.0"
21
+ "@zackbart/connecta": "0.35.0",
22
+ "quickjs-emscripten": "0.32.0",
23
+ "undici": "6.29.1"
23
24
  },
24
25
  "devDependencies": {
25
26
  "@types/node": "^22.0.0",
@@ -25,6 +25,7 @@ export interface Env {
25
25
  CONNECTA_DATABASE?: string;
26
26
  CLERK_PUBLISHABLE_KEY?: string;
27
27
  CLERK_SECRET_KEY?: string;
28
+ CLERK_ORGANIZATION_ID?: string;
28
29
  CONNECTA_MAINTAINERS?: string;
29
30
  CONNECTA_CREDENTIAL_KEY?: string;
30
31
  CONNECTA_ACTIVITY?: string;
@@ -43,6 +44,10 @@ export default defineConfig((env: Env) => {
43
44
  if (Boolean(clerkPublishableKey) !== Boolean(clerkSecretKey)) {
44
45
  throw new Error("Operator sign-in needs both CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY.");
45
46
  }
47
+ const clerkOrganizationId = set("CLERK_ORGANIZATION_ID");
48
+ if (clerkOrganizationId && !clerkSecretKey) {
49
+ throw new Error("CLERK_ORGANIZATION_ID needs CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY.");
50
+ }
46
51
  const clerk =
47
52
  clerkPublishableKey && clerkSecretKey
48
53
  ? clerkAuth({
@@ -51,6 +56,9 @@ export default defineConfig((env: Env) => {
51
56
  // Enable Clerk aud_claim_enabled; hosts request the MCP URL as
52
57
  // resource. Bound JWT and opaque tokens are the default.
53
58
  publicUrl,
59
+ // One Clerk instance can serve many deployments, one Organization
60
+ // each: with CLERK_ORGANIZATION_ID set, only its members sign in.
61
+ ...(clerkOrganizationId ? { organizationId: clerkOrganizationId } : {}),
54
62
  // Restrict who may sign in with `allowedDomains: ["acme.com"]`, or
55
63
  // `gate` for anything a domain cannot express. Absent, every
56
64
  // authenticated Clerk user is admitted.
@@ -1,134 +0,0 @@
1
- import type { CatalogDriftCounts, CatalogDriftReport, Connector, Logger, ToolClassification, ToolDef } from "./types.js";
2
- /**
3
- * Rebuild a drift report as bounded counts and a canonical timestamp.
4
- *
5
- * `Connector.catalogDrift()` sits on the open plugin seam, and what it returns
6
- * lands in the body of unauthenticated `/health`, on connector status, in the
7
- * operator page, and in `connecta doctor`. TypeScript constrains neither an
8
- * extra enumerable property nor what `observedAt` holds at runtime, so "counts
9
- * and a time and nothing else" is *made* true here — at the boundary where
10
- * third-party output becomes a response — rather than trusted. A report whose
11
- * `observedAt` names no instant is no observation connecta can date, and is
12
- * dropped whole (INV-6): a plugin forwarding a downstream's report could
13
- * otherwise put any text there. The activity path reconstructs its five
14
- * fields for the same reason.
15
- */
16
- export declare function boundedCatalogDrift(report: CatalogDriftReport | undefined): CatalogDriftReport | undefined;
17
- /**
18
- * What a release decided a tool does. `"read-only"` is observational;
19
- * `"destructive"` modifies or removes state that already exists; `"additive"`
20
- * only brings something new into being. Both writes leave the read-only path
21
- * — the distinction decides whether the connection asserts `destructiveHint`,
22
- * which shapes the approval copy a human reads.
23
- */
24
- type VettedVerdict = "read-only" | "additive" | "destructive";
25
- /** One tool as a release reviewed it. */
26
- interface VettedToolRecord {
27
- verdict: VettedVerdict;
28
- /**
29
- * Digest of the input and output schemas that release read, or undefined
30
- * when no release has recorded them. Undefined is not "unchanged": a
31
- * manifest with no digest cannot report a schema change, and says so by
32
- * counting none. The credential-free provider check does not create or
33
- * update schema digests; the live `tools/list` response remains the schema
34
- * agents receive ([#351](https://github.com/zackbart/connecta/issues/351)).
35
- */
36
- schemaDigest?: string;
37
- }
38
- /**
39
- * The vetted manifest one hosted-MCP proxy ships: every tool name a release
40
- * reviewed, what it reviewed it as, and — where a release recorded them — the
41
- * schemas it read. This is the single per-provider source P13 asks for, so the
42
- * classification the connector applies and the classification a drift check
43
- * compares against cannot disagree.
44
- */
45
- export interface VettedCatalog {
46
- unlisted?: "hide";
47
- /** Manifest format. Bumped when the comparison itself changes shape. */
48
- version: 1;
49
- tools: ReadonlyMap<string, VettedToolRecord>;
50
- }
51
- export interface VettedCatalogInput {
52
- /** Names whose contract is observational rather than mutating. */
53
- reads: ReadonlySet<string>;
54
- /** Names that write, with the verdict that shapes the approval copy. */
55
- writes: ReadonlyMap<string, "additive" | "destructive">;
56
- /**
57
- * Schemas this release reviewed, as `name` → digest from
58
- * {@link vettedSchemaDigest}. Omit entirely until a release has actually
59
- * read them; an invented digest reports drift that never happened.
60
- */
61
- schemaDigests?: Readonly<Record<string, string>>;
62
- }
63
- /**
64
- * Digest the schemas of one downstream tool.
65
- *
66
- * Canonical rather than literal, unlike the catalog fingerprint in
67
- * `src/catalog-fingerprint.ts`: that one is deliberately conservative because a
68
- * spurious cache write is cheap, while a spurious drift finding spends a
69
- * maintainer's attention on a downstream that reordered its JSON keys.
70
- * Description and annotations are excluded — a reworded description is P1's
71
- * business, and an annotation change is already its own drift category.
72
- *
73
- * Rejects rather than digesting part of a schema: a digest that ignored some
74
- * leaf would let a reviewed read keep its verdict after that leaf changed.
75
- */
76
- export declare function vettedSchemaDigest(tool: ToolDef): Promise<string>;
77
- /**
78
- * Build a provider's manifest from the lists it already maintains.
79
- *
80
- * Throws when a name is classified twice, because a tool that is both a read
81
- * and a write is a review mistake that must not boot: the annotation the
82
- * connector would apply depends on which branch runs first, and "safe by
83
- * default" cannot be decided by ordering.
84
- */
85
- export declare function vettedCatalog(input: VettedCatalogInput): VettedCatalog;
86
- /** Validate a {@link ToolClassification} and build the manifest it describes. */
87
- export declare function reviewedCatalog(classification: ToolClassification, owner: string): VettedCatalog;
88
- /**
89
- * Validate a {@link ToolClassification} and return a deep-frozen copy of it:
90
- * what a connector carries as `classification`, so neither the caller's
91
- * original object nor a write through the connector can change a verdict
92
- * after review.
93
- */
94
- export declare function reviewedClassification(classification: ToolClassification, owner: string): ToolClassification;
95
- /**
96
- * Compare a live catalog with the manifest and count what moved.
97
- *
98
- * Counts only, and by construction: there is nowhere here to put a tool name,
99
- * a schema, or a downstream string, so no later surface has to remember to
100
- * strip one. Reads nothing but the tools it was handed — the caller already
101
- * fetched them to serve a request, and this function never fetches anything.
102
- */
103
- export declare function detectCatalogDrift(catalog: VettedCatalog, tools: readonly ToolDef[]): Promise<CatalogDriftCounts>;
104
- /**
105
- * The review `connector.classification` declares, or undefined when it
106
- * declares none. Throws on a malformed one (INV-11).
107
- */
108
- export declare function catalogReviewOf(connector: Connector): VettedCatalog | undefined;
109
- /**
110
- * Classify downstream facts with a review: what the registry serves on every
111
- * read, from whichever cache layer the facts came from.
112
- *
113
- * Every tool returned is a fresh object, so nothing a caller does to one can
114
- * reach the facts, `memo`, or a later read. `memo` holds digest verification
115
- * per facts array; the registry passes one only for deep-frozen arrays it
116
- * owns. A failed verification is not kept, so the next read tries again, and
117
- * meanwhile no digested review vouches for a read (INV-1).
118
- */
119
- export declare function classifyCatalog(catalog: VettedCatalog, connectorId: string, facts: readonly ToolDef[], logger: Logger, memo?: WeakMap<readonly ToolDef[], ReadonlySet<string>>, overrides?: Readonly<Record<string, "read" | "write">>): Promise<ToolDef[]>;
120
- /**
121
- * Compare a listing a refresh just received with the connector's review, and
122
- * keep the counts as its latest observation.
123
- *
124
- * The check happens where the tools are already in hand, while serving a
125
- * refresh the deployment asked for. It adds no request of its own, which is
126
- * the whole boundary: connecta watches a contract while it is serving a
127
- * refresh, and never initiates one to go looking
128
- * ([#179](https://github.com/zackbart/connecta/issues/179),
129
- * [#343](https://github.com/zackbart/connecta/issues/343)).
130
- */
131
- export declare function observeReviewedDrift(connector: Connector, catalog: VettedCatalog, listed: readonly ToolDef[], logger: Logger): Promise<void>;
132
- /** The latest drift {@link observeReviewedDrift} kept for `connector`. */
133
- export declare function observedCatalogDrift(connector: Connector): CatalogDriftReport | undefined;
134
- export {};