@zackbart/connecta 0.34.1 → 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 (429) hide show
  1. package/CHANGELOG.md +363 -0
  2. package/README.md +62 -106
  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 +12 -7
  53. package/dist/connectors/api-connector.js +142 -56
  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/remote-mcp.d.ts +10 -30
  58. package/dist/connectors/remote-mcp.js +955 -563
  59. package/dist/d1.js +10 -243
  60. package/dist/derived-context.js +5 -0
  61. package/dist/describe-config.d.ts +3 -1
  62. package/dist/describe-config.js +2 -0
  63. package/dist/downstream-input.js +347 -260
  64. package/dist/errors.d.ts +87 -6
  65. package/dist/errors.js +114 -4
  66. package/dist/execute.js +87 -50
  67. package/dist/executor-admission.js +3 -0
  68. package/dist/executors/quickjs.js +163 -112
  69. package/dist/guarded-transport.js +50 -0
  70. package/dist/guest-runtime.js +1 -1
  71. package/dist/http/client.js +439 -0
  72. package/dist/http/errors.js +558 -0
  73. package/dist/http/fields.js +49 -0
  74. package/dist/http/hatch-paging.js +318 -0
  75. package/dist/http/hatch.js +1279 -0
  76. package/dist/http/json-schema.js +267 -0
  77. package/dist/http/node-transport.js +241 -0
  78. package/dist/http/oauth.js +162 -0
  79. package/dist/http/paging.js +228 -0
  80. package/dist/http/provider.js +221 -0
  81. package/dist/http/safety.js +82 -0
  82. package/dist/http/services.js +79 -0
  83. package/dist/http/tools.js +383 -0
  84. package/dist/http/vendor-index.js +138 -0
  85. package/dist/http/vendor.js +448 -0
  86. package/dist/http/write-request.js +66 -0
  87. package/dist/http-policy.d.ts +11 -0
  88. package/dist/http-policy.js +45 -0
  89. package/dist/inbound-credential.js +1 -1
  90. package/dist/index.d.ts +2 -2
  91. package/dist/index.js +4 -0
  92. package/dist/invocation-auth.js +30 -19
  93. package/dist/invocation.js +218 -85
  94. package/dist/mcp-result.js +0 -4
  95. package/dist/membership.d.ts +4 -0
  96. package/dist/meta-output.js +1 -1
  97. package/dist/meta-tools.js +531 -406
  98. package/dist/native-recovery.js +52 -0
  99. package/dist/native-tools.js +382 -0
  100. package/dist/node.d.ts +4 -3
  101. package/dist/node.js +45 -8
  102. package/dist/oauth-handoff.js +177 -104
  103. package/dist/oauth-partition.js +6 -20
  104. package/dist/oauth-sealing.js +6 -7
  105. package/dist/operation-vocabulary.js +101 -0
  106. package/dist/operator-record.d.ts +2 -2
  107. package/dist/operator-record.js +17 -4
  108. package/dist/operator-ui/agents.d.ts +5 -4
  109. package/dist/operator-ui/agents.js +17 -7
  110. package/dist/operator-ui/config-summary.js +5 -4
  111. package/dist/operator-ui/connection-map.js +7 -5
  112. package/dist/operator-ui/contract.d.ts +7 -3
  113. package/dist/operator-ui/endpoints.js +4 -13
  114. package/dist/operator-ui/fix-prompts.d.ts +1 -1
  115. package/dist/operator-ui/fix-prompts.js +0 -8
  116. package/dist/operator-ui/generated.js +3 -3
  117. package/dist/operator-ui/model.d.ts +2 -3
  118. package/dist/operator-ui/overview.js +5 -2
  119. package/dist/operator-ui/setup-commands.js +0 -4
  120. package/dist/operator-ui/view.d.ts +2 -25
  121. package/dist/operator-ui/view.js +2 -76
  122. package/dist/program-writes.js +47 -26
  123. package/dist/provider-call-facts.d.ts +115 -0
  124. package/dist/provider-call-facts.js +182 -0
  125. package/dist/provider-call.d.ts +112 -0
  126. package/dist/provider-call.js +271 -0
  127. package/dist/provider.d.ts +65 -31
  128. package/dist/provider.js +116 -39
  129. package/dist/providers/_shared/google/hatch.js +91 -0
  130. package/dist/providers/_shared/google/kit.js +537 -0
  131. package/dist/providers/_shared/google/result-size.js +15 -2
  132. package/dist/providers/_shared/google/service-account.d.ts +2 -1
  133. package/dist/providers/_shared/google/service-account.js +8 -4
  134. package/dist/providers/_shared/google/workspace.d.ts +6 -210
  135. package/dist/providers/_shared/google/workspace.js +6 -425
  136. package/dist/providers/_shared/rest/compact-index.js +86 -0
  137. package/dist/providers/_shared/rest/dispatch.js +3 -23
  138. package/dist/providers/_shared/rest/kit.js +546 -0
  139. package/dist/providers/_shared/rest/operation-index.js +230 -14
  140. package/dist/providers/_shared/rest/response-media.js +11 -0
  141. package/dist/providers/_shared/rest/tools.js +101 -78
  142. package/dist/providers/_shared/rest/value-safety.js +353 -195
  143. package/dist/providers/_shared/sensitive-fields.js +27 -0
  144. package/dist/providers/breeze/api.js +584 -0
  145. package/dist/providers/breeze/index.d.ts +1 -3
  146. package/dist/providers/breeze/index.js +67 -1420
  147. package/dist/providers/breeze/openapi.generated.js +60 -0
  148. package/dist/providers/breeze/skill.generated.js +2 -6
  149. package/dist/providers/breeze/tools.js +696 -0
  150. package/dist/providers/ccb/api.js +496 -0
  151. package/dist/providers/ccb/index.d.ts +15 -37
  152. package/dist/providers/ccb/index.js +77 -1702
  153. package/dist/providers/ccb/lib/constants.d.ts +34 -0
  154. package/dist/providers/ccb/lib/constants.js +74 -0
  155. package/dist/providers/ccb/lib/guide.js +9 -0
  156. package/dist/providers/ccb/lib/verdicts.js +387 -0
  157. package/dist/providers/ccb/openapi.generated.js +397 -0
  158. package/dist/providers/ccb/safety.js +295 -0
  159. package/dist/providers/ccb/skill.generated.js +2 -6
  160. package/dist/providers/ccb/tools.js +853 -0
  161. package/dist/providers/cloudflare/api.js +1066 -0
  162. package/dist/providers/cloudflare/index.d.ts +5 -22
  163. package/dist/providers/cloudflare/index.js +79 -197
  164. package/dist/providers/cloudflare/lib/config.d.ts +16 -0
  165. package/dist/providers/cloudflare/lib/config.js +2 -0
  166. package/dist/providers/cloudflare/lib/discovery.js +29 -0
  167. package/dist/providers/cloudflare/{graphql.js → lib/graphql.js} +1 -1
  168. package/dist/providers/cloudflare/lib/hatch.js +103 -0
  169. package/dist/providers/cloudflare/lib/path-bounds.js +28 -0
  170. package/dist/providers/cloudflare/lib/response-media.js +75 -0
  171. package/dist/providers/cloudflare/openapi.generated.js +4 -3
  172. package/dist/providers/cloudflare/{value-safety.js → safety.js} +487 -0
  173. package/dist/providers/cloudflare/skill.generated.js +2 -10
  174. package/dist/providers/cloudflare/tools.js +360 -0
  175. package/dist/providers/docs/api.js +51 -0
  176. package/dist/providers/docs/index.d.ts +1 -12
  177. package/dist/providers/docs/index.js +53 -1165
  178. package/dist/providers/docs/lib/constants.d.ts +18 -0
  179. package/dist/providers/docs/lib/constants.js +18 -0
  180. package/dist/providers/docs/lib/discovery.js +26 -0
  181. package/dist/providers/docs/lib/requests.js +48 -0
  182. package/dist/providers/docs/lib/schemas.js +168 -0
  183. package/dist/providers/docs/openapi.generated.js +16 -0
  184. package/dist/providers/docs/safety.js +54 -0
  185. package/dist/providers/docs/skill.generated.js +2 -6
  186. package/dist/providers/docs/tools.js +802 -0
  187. package/dist/providers/drive/api.js +177 -0
  188. package/dist/providers/drive/index.d.ts +1 -12
  189. package/dist/providers/drive/index.js +38 -1448
  190. package/dist/providers/drive/lib/constants.d.ts +6 -0
  191. package/dist/providers/drive/lib/constants.js +6 -0
  192. package/dist/providers/drive/lib/contracts.js +532 -0
  193. package/dist/providers/drive/lib/hatch.js +197 -0
  194. package/dist/providers/drive/openapi.generated.js +77 -0
  195. package/dist/providers/drive/safety.js +90 -0
  196. package/dist/providers/drive/skill.generated.js +2 -6
  197. package/dist/providers/drive/tools.js +1290 -0
  198. package/dist/providers/forms/api.js +71 -0
  199. package/dist/providers/forms/index.d.ts +1 -12
  200. package/dist/providers/forms/index.js +49 -1145
  201. package/dist/providers/forms/lib/constants.d.ts +14 -0
  202. package/dist/providers/forms/lib/constants.js +19 -0
  203. package/dist/providers/forms/lib/hatch.js +72 -0
  204. package/dist/providers/forms/openapi.generated.js +23 -0
  205. package/dist/providers/forms/safety.js +34 -0
  206. package/dist/providers/forms/skill.generated.js +2 -8
  207. package/dist/providers/forms/tools.js +1024 -0
  208. package/dist/providers/github/api.js +150 -0
  209. package/dist/providers/github/index.d.ts +4 -5
  210. package/dist/providers/github/index.js +30 -87
  211. package/dist/providers/github/{auth.d.ts → lib/auth.d.ts} +5 -3
  212. package/dist/providers/github/{auth.js → lib/auth.js} +40 -43
  213. package/dist/providers/github/lib/discovery.js +132 -0
  214. package/dist/providers/github/lib/operations.js +58 -0
  215. package/dist/providers/github/{scope.d.ts → lib/scope.d.ts} +2 -0
  216. package/dist/providers/github/{scope.js → lib/scope.js} +25 -1
  217. package/dist/providers/github/openapi.generated.js +1216 -0
  218. package/dist/providers/github/safety.js +216 -0
  219. package/dist/providers/github/skill.generated.js +2 -5
  220. package/dist/providers/github/tools.js +506 -0
  221. package/dist/providers/gmail/api.js +114 -0
  222. package/dist/providers/gmail/index.d.ts +1 -12
  223. package/dist/providers/gmail/index.js +73 -1621
  224. package/dist/providers/gmail/lib/constants.d.ts +13 -0
  225. package/dist/providers/gmail/lib/constants.js +16 -0
  226. package/dist/providers/gmail/lib/index.js +173 -0
  227. package/dist/providers/gmail/lib/schemas.js +176 -0
  228. package/dist/providers/gmail/lib/threading.js +120 -0
  229. package/dist/providers/gmail/openapi.generated.js +92 -0
  230. package/dist/providers/gmail/safety.js +21 -0
  231. package/dist/providers/gmail/skill.generated.js +2 -6
  232. package/dist/providers/gmail/tools.js +1435 -0
  233. package/dist/providers/overflow/api.js +1008 -0
  234. package/dist/providers/overflow/index.d.ts +1 -17
  235. package/dist/providers/overflow/index.js +60 -1488
  236. package/dist/providers/overflow/skill.generated.js +2 -5
  237. package/dist/providers/overflow/tools.js +873 -0
  238. package/dist/providers/planning-center/api.js +467 -0
  239. package/dist/providers/planning-center/index.d.ts +4 -35
  240. package/dist/providers/planning-center/index.js +69 -2445
  241. package/dist/providers/planning-center/lib/constants.d.ts +58 -0
  242. package/dist/providers/planning-center/lib/constants.js +83 -0
  243. package/dist/providers/planning-center/lib/discovery.js +40 -0
  244. package/dist/providers/planning-center/lib/guide.js +39 -0
  245. package/dist/providers/planning-center/lib/json-api.js +83 -0
  246. package/dist/providers/planning-center/lib/verdicts.js +1758 -0
  247. package/dist/providers/planning-center/openapi.generated.js +1764 -0
  248. package/dist/providers/planning-center/safety.js +188 -0
  249. package/dist/providers/planning-center/skill.generated.js +2 -27
  250. package/dist/providers/planning-center/tools.js +1010 -0
  251. package/dist/providers/sheets/api.js +133 -0
  252. package/dist/providers/sheets/index.d.ts +4 -16
  253. package/dist/providers/sheets/index.js +61 -1172
  254. package/dist/providers/sheets/lib/constants.d.ts +14 -0
  255. package/dist/providers/sheets/lib/constants.js +14 -0
  256. package/dist/providers/sheets/lib/hatch.js +163 -0
  257. package/dist/providers/sheets/lib/requests.js +105 -0
  258. package/dist/providers/sheets/lib/schemas.js +138 -0
  259. package/dist/providers/sheets/openapi.generated.js +30 -0
  260. package/dist/providers/sheets/safety.js +27 -0
  261. package/dist/providers/sheets/skill.generated.js +2 -7
  262. package/dist/providers/sheets/tools.js +734 -0
  263. package/dist/providers/slides/api.js +147 -0
  264. package/dist/providers/slides/index.d.ts +2 -10
  265. package/dist/providers/slides/index.js +48 -2555
  266. package/dist/providers/slides/lib/constants.d.ts +11 -0
  267. package/dist/providers/slides/lib/constants.js +11 -0
  268. package/dist/providers/slides/lib/requests.js +60 -0
  269. package/dist/providers/slides/lib/schemas.js +565 -0
  270. package/dist/providers/slides/openapi.generated.js +18 -0
  271. package/dist/providers/slides/skill.generated.js +2 -6
  272. package/dist/providers/slides/tools.js +1968 -0
  273. package/dist/providers/stripe/api.js +401 -0
  274. package/dist/providers/stripe/index.d.ts +5 -27
  275. package/dist/providers/stripe/index.js +74 -210
  276. package/dist/providers/stripe/lib/config.d.ts +4 -0
  277. package/dist/providers/stripe/lib/config.js +2 -0
  278. package/dist/providers/stripe/openapi.generated.js +4 -3
  279. package/dist/providers/stripe/{value-safety.js → safety.js} +5 -5
  280. package/dist/providers/stripe/skill.generated.js +2 -11
  281. package/dist/providers/stripe/tools.js +77 -0
  282. package/dist/providers/tithely/api.js +531 -0
  283. package/dist/providers/tithely/index.d.ts +17 -0
  284. package/dist/providers/tithely/index.js +86 -965
  285. package/dist/providers/tithely/skill.generated.js +2 -5
  286. package/dist/providers/tithely/tools.js +426 -0
  287. package/dist/providers/vercel/api.js +551 -0
  288. package/dist/providers/vercel/index.d.ts +9 -25
  289. package/dist/providers/vercel/index.js +66 -260
  290. package/dist/providers/vercel/lib/config.d.ts +2 -0
  291. package/dist/providers/vercel/lib/config.js +2 -0
  292. package/dist/providers/vercel/lib/index.js +117 -0
  293. package/dist/providers/vercel/lib/logs.js +100 -0
  294. package/dist/providers/vercel/lib/pin.js +270 -0
  295. package/dist/providers/vercel/openapi.generated.js +10 -5
  296. package/dist/providers/vercel/{value-safety.js → safety.js} +247 -38
  297. package/dist/providers/vercel/skill.generated.js +2 -7
  298. package/dist/providers/vercel/tools.js +642 -0
  299. package/dist/redaction-identity.js +47 -0
  300. package/dist/redaction-marker.js +125 -0
  301. package/dist/registry.d.ts +21 -15
  302. package/dist/registry.js +409 -376
  303. package/dist/routes/access-tokens.js +1 -1
  304. package/dist/routes/actor-labels.js +1 -1
  305. package/dist/routes/connect.js +1 -1
  306. package/dist/routes/dispatch.js +103 -0
  307. package/dist/routes/mcp.js +170 -79
  308. package/dist/routes/oauth.js +3 -1
  309. package/dist/routes/operator.js +2 -2
  310. package/dist/routes/shared.d.ts +5 -4
  311. package/dist/routes/shared.js +244 -177
  312. package/dist/routes/skills.js +10 -8
  313. package/dist/routes/ui-config.js +27 -3
  314. package/dist/routes/ui-data.js +21 -20
  315. package/dist/routes/ui.js +1 -1
  316. package/dist/runtime/call-admission.js +0 -26
  317. package/dist/runtime/call-entry.js +30 -0
  318. package/dist/runtime/call.js +556 -0
  319. package/dist/runtime/connector-scope.js +7 -0
  320. package/dist/runtime/credential-probe.js +34 -0
  321. package/dist/runtime/executor.js +40 -0
  322. package/dist/runtime/native-storage.js +63 -0
  323. package/dist/runtime/registry.js +27 -0
  324. package/dist/runtime/request-scope.js +72 -0
  325. package/dist/runtime/run.js +15 -7
  326. package/dist/runtime/shared-read.js +34 -5
  327. package/dist/runtime/storage.js +34 -21
  328. package/dist/sent-secrets.d.ts +194 -37
  329. package/dist/sent-secrets.js +1743 -340
  330. package/dist/server.js +5 -56
  331. package/dist/skills.js +322 -222
  332. package/dist/sqlite.js +15 -14
  333. package/dist/storage/d1-copy.js +255 -0
  334. package/dist/storage/d1-driver.js +15 -0
  335. package/dist/storage/keys.js +28 -0
  336. package/dist/storage/sql-driver.js +88 -0
  337. package/dist/storage/sql-native.js +544 -0
  338. package/dist/storage/sql-schema.d.ts +6 -0
  339. package/dist/storage/sql-schema.js +15 -0
  340. package/dist/storage/sql.d.ts +14 -20
  341. package/dist/storage/sql.js +29 -535
  342. package/dist/timeout.js +0 -26
  343. package/dist/tool-safety.js +20 -10
  344. package/dist/types.d.ts +7 -109
  345. package/dist/upward.js +3 -0
  346. package/dist/usage-guide.js +3 -1
  347. package/dist/validate.d.ts +4 -2
  348. package/dist/validate.js +86 -9
  349. package/dist/version.d.ts +1 -1
  350. package/dist/version.js +1 -1
  351. package/dist/worker.js +312 -292
  352. package/dist/workspace-subject.js +5 -1
  353. package/dist/write-outcome.js +454 -34
  354. package/documentation/README.md +27 -7
  355. package/documentation/architecture.md +2547 -226
  356. package/documentation/auth.md +821 -98
  357. package/documentation/code-mode.md +49 -16
  358. package/documentation/deploying.md +164 -20
  359. package/documentation/hosted-mcp-migration.md +460 -0
  360. package/documentation/integrating.md +129 -144
  361. package/documentation/meta-tools.md +409 -32
  362. package/documentation/operating.md +27 -3
  363. package/documentation/operator-tests.md +3 -0
  364. package/documentation/operator-ui.md +68 -45
  365. package/documentation/provider-auth-migration.md +16 -63
  366. package/documentation/provider-migration-0.29.md +10 -5
  367. package/documentation/provider-migration-0.35.md +975 -0
  368. package/documentation/providers.md +965 -0
  369. package/examples/worker/AGENTS.md +23 -9
  370. package/examples/worker/README.md +254 -135
  371. package/examples/worker/alchemy.run.ts +116 -0
  372. package/examples/worker/gitignore +10 -0
  373. package/examples/worker/src/connecta.config.ts +23 -21
  374. package/examples/worker/wrangler.jsonc +14 -5
  375. package/guides/connecting-agents.md +157 -0
  376. package/guides/how-it-works.md +156 -0
  377. package/guides/safety-and-trust.md +153 -0
  378. package/package.json +27 -46
  379. package/templates/node/.env.example +3 -0
  380. package/templates/node/README.md +22 -2
  381. package/templates/node/docker-compose.yml +1 -0
  382. package/templates/node/package.json +3 -2
  383. package/templates/node/src/connecta.config.ts +8 -0
  384. package/dist/catalog-drift.d.ts +0 -138
  385. package/dist/catalog-drift.js +0 -578
  386. package/dist/providers/_shared/request-token.js +0 -83
  387. package/dist/providers/_shared/rest/operation-index.d.ts +0 -133
  388. package/dist/providers/_shared/rest/tools.d.ts +0 -141
  389. package/dist/providers/_shared/rest/value-safety.d.ts +0 -201
  390. package/dist/providers/basecamp/index.d.ts +0 -45
  391. package/dist/providers/basecamp/index.js +0 -997
  392. package/dist/providers/basecamp/skill.generated.js +0 -9
  393. package/dist/providers/cloudflare/rest.d.ts +0 -37
  394. package/dist/providers/cloudflare/rest.js +0 -1097
  395. package/dist/providers/github/hosted.js +0 -218
  396. package/dist/providers/github/rest.js +0 -321
  397. package/dist/providers/infisical/index.d.ts +0 -7
  398. package/dist/providers/infisical/index.js +0 -713
  399. package/dist/providers/infisical/skill.generated.js +0 -8
  400. package/dist/providers/intercom/index.d.ts +0 -24
  401. package/dist/providers/intercom/index.js +0 -121
  402. package/dist/providers/intercom/skill.generated.js +0 -8
  403. package/dist/providers/linear/index.d.ts +0 -55
  404. package/dist/providers/linear/index.js +0 -537
  405. package/dist/providers/linear/skill.generated.js +0 -8
  406. package/dist/providers/mixpanel/index.d.ts +0 -59
  407. package/dist/providers/mixpanel/index.js +0 -472
  408. package/dist/providers/mixpanel/operations.js +0 -20
  409. package/dist/providers/mixpanel/rest.js +0 -603
  410. package/dist/providers/mixpanel/skill.generated.js +0 -10
  411. package/dist/providers/mixpanel/value-safety.js +0 -16
  412. package/dist/providers/notion/index.d.ts +0 -67
  413. package/dist/providers/notion/index.js +0 -368
  414. package/dist/providers/notion/openapi.generated.js +0 -75
  415. package/dist/providers/notion/rest.d.ts +0 -24
  416. package/dist/providers/notion/rest.js +0 -1226
  417. package/dist/providers/notion/skill.generated.js +0 -11
  418. package/dist/providers/notion/value-safety.js +0 -56
  419. package/dist/providers/revenuecat/index.d.ts +0 -51
  420. package/dist/providers/revenuecat/index.js +0 -697
  421. package/dist/providers/revenuecat/skill.generated.js +0 -11
  422. package/dist/providers/stripe/rest.d.ts +0 -14
  423. package/dist/providers/stripe/rest.js +0 -402
  424. package/dist/providers/vercel/rest.d.ts +0 -20
  425. package/dist/providers/vercel/rest.js +0 -1020
  426. package/dist/providers/wispr-flow/index.d.ts +0 -14
  427. package/dist/providers/wispr-flow/index.js +0 -117
  428. package/dist/providers/wispr-flow/skill.generated.js +0 -8
  429. /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.1",
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,26 +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/intercom": {
118
- "types": "./dist/providers/intercom/index.d.ts",
119
- "import": "./dist/providers/intercom/index.js"
120
- },
121
- "./providers/linear": {
122
- "types": "./dist/providers/linear/index.d.ts",
123
- "import": "./dist/providers/linear/index.js"
124
- },
125
- "./providers/mixpanel": {
126
- "types": "./dist/providers/mixpanel/index.d.ts",
127
- "import": "./dist/providers/mixpanel/index.js"
128
- },
129
- "./providers/notion": {
130
- "types": "./dist/providers/notion/index.d.ts",
131
- "import": "./dist/providers/notion/index.js"
132
- },
133
110
  "./providers/overflow": {
134
111
  "types": "./dist/providers/overflow/index.d.ts",
135
112
  "import": "./dist/providers/overflow/index.js"
@@ -138,10 +115,6 @@
138
115
  "types": "./dist/providers/planning-center/index.d.ts",
139
116
  "import": "./dist/providers/planning-center/index.js"
140
117
  },
141
- "./providers/revenuecat": {
142
- "types": "./dist/providers/revenuecat/index.d.ts",
143
- "import": "./dist/providers/revenuecat/index.js"
144
- },
145
118
  "./providers/sheets": {
146
119
  "types": "./dist/providers/sheets/index.d.ts",
147
120
  "import": "./dist/providers/sheets/index.js"
@@ -162,10 +135,6 @@
162
135
  "types": "./dist/providers/vercel/index.d.ts",
163
136
  "import": "./dist/providers/vercel/index.js"
164
137
  },
165
- "./providers/wispr-flow": {
166
- "types": "./dist/providers/wispr-flow/index.d.ts",
167
- "import": "./dist/providers/wispr-flow/index.js"
168
- },
169
138
  "./ui": {
170
139
  "types": "./dist/ui.d.ts",
171
140
  "import": "./dist/ui.js"
@@ -198,8 +167,10 @@
198
167
  "test:browser:install": "playwright install chromium",
199
168
  "test:browser": "playwright test",
200
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",
201
172
  "pretest:browser:snapshots": "pnpm run build:operator-ui",
202
- "test:node": "vitest run --project node",
173
+ "test:node": "vitest run --config vitest.config.node.ts",
203
174
  "test:workers": "vitest run --project workers",
204
175
  "check:docs": "node scripts/check-doc-links.mjs",
205
176
  "check:lint": "oxlint -D correctness --report-unused-disable-directives .",
@@ -209,19 +180,20 @@
209
180
  "check:package": "node scripts/check-package.mjs",
210
181
  "check:declarations": "node scripts/check-declarations.mjs --dist .",
211
182
  "check:bundle": "node scripts/bundle-size.mjs",
212
- "providers:check": "tsx scripts/drift-check.mjs --specs --docs",
183
+ "providers:check": "tsx scripts/drift-check.mjs --specs --manual",
213
184
  "drift:check": "tsx scripts/drift-check.mjs",
214
185
  "eval:selftest": "tsx eval/selftest.ts",
215
186
  "eval:agent": "tsx eval/run-agent.ts",
216
187
  "eval:smoke": "tsx eval/run-smoke.ts",
217
188
  "eval:perf": "tsx eval/run-perf.ts",
218
189
  "eval:report": "tsx eval/report.ts",
219
- "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",
220
- "check:fast": "node scripts/check-fast.mjs",
221
- "check": "pnpm run check:core && pnpm run test:browser",
222
- "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",
223
195
  "prepack": "pnpm run check",
224
- "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",
225
197
  "changelog:assemble": "node scripts/changelog.mjs",
226
198
  "providers:generate": "tsx scripts/generate-providers.mjs",
227
199
  "check:providers-generated": "tsx scripts/generate-providers.mjs --check",
@@ -232,25 +204,29 @@
232
204
  "pretest:browser": "pnpm run build:operator-ui",
233
205
  "pretypecheck": "node scripts/generate-version.mjs && pnpm run build:operator-ui",
234
206
  "precheck:bundle": "pnpm run build:operator-ui",
235
- "precheck:fast": "pnpm run check:operator-ui",
236
207
  "eval:regrade": "tsx eval/regrade.ts",
237
208
  "eval:compare": "tsx eval/compare.ts",
238
209
  "format": "oxfmt --write .",
239
210
  "format:check": "oxfmt --check .",
240
- "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"
241
216
  },
242
217
  "dependencies": {
243
218
  "@cfworker/json-schema": "^4.1.1",
244
219
  "@modelcontextprotocol/client": "2.3.1",
245
220
  "@modelcontextprotocol/server": "2.3.1",
246
221
  "acorn": "^8.19.0",
247
- "effect": "^4.0.0",
248
- "zod": "^4.4.3"
222
+ "effect": "4.0.5",
223
+ "zod": "^4.6.6"
249
224
  },
250
225
  "peerDependencies": {
251
226
  "@clerk/backend": "^3.12.0",
252
227
  "@cloudflare/codemode": "^0.4.4 || ^0.5.0",
253
- "quickjs-emscripten": "^0.32.0"
228
+ "quickjs-emscripten": "^0.32.0",
229
+ "undici": "6.29.1"
254
230
  },
255
231
  "peerDependenciesMeta": {
256
232
  "@clerk/backend": {
@@ -261,6 +237,9 @@
261
237
  },
262
238
  "quickjs-emscripten": {
263
239
  "optional": true
240
+ },
241
+ "undici": {
242
+ "optional": true
264
243
  }
265
244
  },
266
245
  "devDependencies": {
@@ -268,6 +247,7 @@
268
247
  "@cloudflare/codemode": "^0.5.0",
269
248
  "@cloudflare/vitest-pool-workers": "^0.18.8",
270
249
  "@cloudflare/workers-types": "^4.20250101.0 || ^5.0.0",
250
+ "@effect/platform-node": "4.0.5",
271
251
  "@fontsource-variable/hanken-grotesk": "^5.3.0",
272
252
  "@fontsource-variable/jetbrains-mono": "^5.3.0",
273
253
  "@playwright/test": "^1.62.0",
@@ -281,8 +261,8 @@
281
261
  "@types/node": "^22.0.0",
282
262
  "@types/react": "^19.3.0",
283
263
  "@types/react-dom": "^19.3.0",
264
+ "alchemy": "2.0.0-beta.83",
284
265
  "cmdk": "^1.1.1",
285
- "commonmark": "^0.31.2",
286
266
  "esbuild": "^0.28.0",
287
267
  "knip": "^6.29.0",
288
268
  "oxfmt": "0.72.0",
@@ -293,6 +273,7 @@
293
273
  "tailwindcss": "^4.3.3",
294
274
  "tsx": "^4.23.1",
295
275
  "typescript": "^5.9.3",
276
+ "undici": "6.29.1",
296
277
  "vitest": "^4.1.6",
297
278
  "wrangler": "^4.114.0"
298
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.1",
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,138 +0,0 @@
1
- import type { CatalogDriftCounts, CatalogDriftReport, Connector, Logger, ToolClassification, ToolDef } from "./types.js";
2
- /**
3
- * Rebuild a drift report as bounded counts, closed verification facts, and a timestamp.
4
- *
5
- * `Connector.catalogDrift()` sits on the open plugin seam, and what it returns
6
- * lands on authenticated connector status and the operator page. TypeScript
7
- * constrains neither extra enumerable properties nor `observedAt` at runtime.
8
- * Counts, closed verification facts, and a time are rebuilt at the boundary where
9
- * third-party output becomes a response — rather than trusted. A report whose
10
- * `observedAt` names no instant is no observation connecta can date, and is
11
- * dropped whole (INV-6): a plugin forwarding a downstream's report could
12
- * otherwise put any text there. The activity path reconstructs its five
13
- * fields for the same reason.
14
- */
15
- export declare function boundedCatalogDrift(report: CatalogDriftReport | undefined): CatalogDriftReport | undefined;
16
- /**
17
- * What a release decided a tool does. `"read-only"` is observational;
18
- * `"destructive"` modifies or removes state that already exists; `"additive"`
19
- * only brings something new into being. Both writes leave the read-only path
20
- * — the distinction decides whether the connection asserts `destructiveHint`,
21
- * which shapes the approval copy a human reads.
22
- */
23
- type VettedVerdict = "read-only" | "additive" | "destructive";
24
- /** One tool as a release reviewed it. */
25
- interface VettedToolRecord {
26
- verdict: VettedVerdict;
27
- /**
28
- * Digest of the input and output schemas that release read, or undefined
29
- * when no release has recorded them. Undefined is not "unchanged": a
30
- * manifest with no digest cannot report a schema change, and says so by
31
- * counting none and reporting the unpinned coverage. The provider check never
32
- * creates or updates schema digests; live `tools/list` remains the schema
33
- * agents receive ([#351](https://github.com/zackbart/connecta/issues/351)).
34
- */
35
- schemaDigest?: string;
36
- optional?: boolean;
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
- /** Reviewed names that may be absent under plan/permission gating. */
63
- optionalTools?: ReadonlySet<string>;
64
- }
65
- /**
66
- * Digest the schemas of one downstream tool.
67
- *
68
- * Canonical rather than literal, unlike the catalog fingerprint in
69
- * `src/catalog-fingerprint.ts`: that one is deliberately conservative because a
70
- * spurious cache write is cheap, while a spurious drift finding spends a
71
- * maintainer's attention on a downstream that reordered its JSON keys.
72
- * New pins use `sha256-sets-v1:` and sort required, enum, and type arrays only
73
- * at schema keyword locations. Tuple arrays and JSON data keep their order.
74
- * Legacy `sha256:` pins use the original literal-array form, so an upgrade
75
- * cannot silently invalidate a reviewed provider manifest.
76
- * Description and annotations are excluded — a reworded description is P1's
77
- * business, and an annotation change is already its own drift category.
78
- *
79
- * Rejects rather than digesting part of a schema: a digest that ignored some
80
- * leaf would let a reviewed read keep its verdict after that leaf changed.
81
- */
82
- export declare function vettedSchemaDigest(tool: ToolDef, format?: "sets-v1" | "legacy"): Promise<string>;
83
- /**
84
- * Build a provider's manifest from the lists it already maintains.
85
- *
86
- * Throws when a name is classified twice, because a tool that is both a read
87
- * and a write is a review mistake that must not boot: the annotation the
88
- * connector would apply depends on which branch runs first, and "safe by
89
- * default" cannot be decided by ordering.
90
- */
91
- export declare function vettedCatalog(input: VettedCatalogInput): VettedCatalog;
92
- /** Validate a {@link ToolClassification} and build the manifest it describes. */
93
- export declare function reviewedCatalog(classification: ToolClassification, owner: string): VettedCatalog;
94
- /**
95
- * Validate a {@link ToolClassification} and return a deep-frozen copy of it:
96
- * what a connector carries as `classification`, so neither the caller's
97
- * original object nor a write through the connector can change a verdict
98
- * after review.
99
- */
100
- export declare function reviewedClassification(classification: ToolClassification, owner: string): ToolClassification;
101
- /** One whole-schema verification shared by reporting and serving this listing. */
102
- export interface CatalogSchemaVerification {
103
- changed: ReadonlySet<string>;
104
- available: boolean;
105
- }
106
- /**
107
- * Compare a live catalog with the manifest and count what moved.
108
- *
109
- * Counts only, and by construction: there is nowhere here to put a tool name,
110
- * a schema, or a downstream string, so no later surface has to remember to
111
- * strip one. Reads nothing but the tools it was handed — the caller already
112
- * fetched them to serve a request, and this function never fetches anything.
113
- */
114
- export declare function detectCatalogDrift(catalog: VettedCatalog, tools: readonly ToolDef[]): Promise<CatalogDriftCounts>;
115
- /**
116
- * The review `connector.classification` declares, or undefined when it
117
- * declares none. Throws on a malformed one (INV-11).
118
- */
119
- export declare function catalogReviewOf(connector: Connector): VettedCatalog | undefined;
120
- /**
121
- * Classify downstream facts with a review: what the registry serves on every
122
- * read, from whichever cache layer the facts came from.
123
- *
124
- * Every tool returned is fresh. The registry supplies the same whole-schema
125
- * verification it observed for this listing, including failures. Standalone
126
- * callers verify here. No failed verification survives onto a later listing,
127
- * and meanwhile no digested review vouches for a read (INV-1).
128
- */
129
- export declare function classifyCatalog(catalog: VettedCatalog, connectorId: string, facts: readonly ToolDef[], logger: Logger, overrides?: Readonly<Record<string, "read" | "write">>, verification?: CatalogSchemaVerification): Promise<ToolDef[]>;
130
- /**
131
- * Observe tools already fetched by a listing. No probe, persistence, or catalog
132
- * payload: registry-owned partition tokens isolate deployment and subject.
133
- * A digest failure replaces old success, while classification fails closed.
134
- */
135
- export declare function observeReviewedDrift(connector: Connector, catalog: VettedCatalog | undefined, listed: readonly ToolDef[], logger: Logger, partition?: object, droppedTools?: number): Promise<CatalogSchemaVerification | undefined>;
136
- /** Look up only this runtime/catalog partition; never start a listing. */
137
- export declare function observedCatalogDrift(connector: Connector, partition?: object): CatalogDriftReport | undefined;
138
- export {};