@zackbart/connecta 0.29.0 → 0.31.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 (116) hide show
  1. package/CHANGELOG.md +99 -0
  2. package/README.md +126 -134
  3. package/bin/connecta.mjs +13 -2
  4. package/bin/version.mjs +1 -1
  5. package/dist/argument-redaction.js +230 -0
  6. package/dist/auth-elicitation.js +14 -9
  7. package/dist/authorization-handoff.js +111 -0
  8. package/dist/call-recovery.js +25 -0
  9. package/dist/catalog-cache.js +2 -2
  10. package/dist/catalog-service.js +103 -63
  11. package/dist/config-schema.d.ts +14 -7
  12. package/dist/config-schema.js +29 -10
  13. package/dist/config.d.ts +2 -0
  14. package/dist/config.js +12 -7
  15. package/dist/connectors/guarded-fetch.d.ts +9 -1
  16. package/dist/connectors/guarded-fetch.js +17 -5
  17. package/dist/connectors/negotiation-cache.js +1 -1
  18. package/dist/downstream-input-context.js +9 -0
  19. package/dist/downstream-input.js +13 -11
  20. package/dist/errors.d.ts +38 -12
  21. package/dist/errors.js +19 -9
  22. package/dist/execute.js +375 -43
  23. package/dist/executor-result.js +11 -9
  24. package/dist/executors/quickjs-child.js +12 -5
  25. package/dist/executors/quickjs-protocol.js +5 -6
  26. package/dist/executors/quickjs-runtime.js +6 -1
  27. package/dist/executors/quickjs.js +20 -4
  28. package/dist/guest-runtime.js +52 -2
  29. package/dist/guest-types.d.ts +47 -5
  30. package/dist/index.d.ts +1 -1
  31. package/dist/invocation.js +72 -14
  32. package/dist/meta-output.js +0 -15
  33. package/dist/meta-tools.js +166 -95
  34. package/dist/oauth-handoff.js +88 -11
  35. package/dist/operator-ui/generated.js +2 -2
  36. package/dist/operator-ui/view.d.ts +9 -0
  37. package/dist/operator-ui/view.js +11 -0
  38. package/dist/program-result.js +5 -0
  39. package/dist/program-writes.js +7 -48
  40. package/dist/provider.d.ts +8 -6
  41. package/dist/provider.js +3 -4
  42. package/dist/providers/_shared/google/workspace.d.ts +1 -1
  43. package/dist/providers/_shared/request-token.js +83 -0
  44. package/dist/providers/_shared/rest/dispatch.js +41 -0
  45. package/dist/providers/_shared/rest/operation-index.d.ts +133 -0
  46. package/dist/providers/_shared/rest/operation-index.js +527 -0
  47. package/dist/providers/_shared/rest/tools.d.ts +141 -0
  48. package/dist/providers/_shared/rest/tools.js +569 -0
  49. package/dist/providers/_shared/rest/value-safety.d.ts +151 -0
  50. package/dist/providers/_shared/rest/value-safety.js +580 -0
  51. package/dist/providers/cloudflare/graphql.js +385 -0
  52. package/dist/providers/cloudflare/index.d.ts +47 -51
  53. package/dist/providers/cloudflare/index.js +188 -1997
  54. package/dist/providers/cloudflare/openapi.generated.js +3347 -0
  55. package/dist/providers/cloudflare/rest.d.ts +37 -0
  56. package/dist/providers/cloudflare/rest.js +1056 -0
  57. package/dist/providers/cloudflare/skill.generated.js +7 -4
  58. package/dist/providers/cloudflare/value-safety.js +1247 -0
  59. package/dist/providers/infisical/index.d.ts +7 -0
  60. package/dist/providers/infisical/index.js +713 -0
  61. package/dist/providers/infisical/skill.generated.js +8 -0
  62. package/dist/providers/notion/index.d.ts +35 -31
  63. package/dist/providers/notion/index.js +60 -1499
  64. package/dist/providers/notion/openapi.generated.js +75 -0
  65. package/dist/providers/notion/rest.d.ts +24 -0
  66. package/dist/providers/notion/rest.js +1067 -0
  67. package/dist/providers/notion/skill.generated.js +5 -4
  68. package/dist/providers/notion/value-safety.js +31 -0
  69. package/dist/providers/stripe/index.d.ts +26 -20
  70. package/dist/providers/stripe/index.js +103 -130
  71. package/dist/providers/stripe/openapi.generated.js +649 -0
  72. package/dist/providers/stripe/rest.d.ts +14 -0
  73. package/dist/providers/stripe/rest.js +395 -0
  74. package/dist/providers/stripe/skill.generated.js +7 -5
  75. package/dist/providers/stripe/value-safety.js +705 -0
  76. package/dist/providers/vercel/index.d.ts +31 -22
  77. package/dist/providers/vercel/index.js +96 -853
  78. package/dist/providers/vercel/openapi.generated.js +456 -0
  79. package/dist/providers/vercel/rest.d.ts +20 -0
  80. package/dist/providers/vercel/rest.js +1002 -0
  81. package/dist/providers/vercel/skill.generated.js +4 -5
  82. package/dist/providers/vercel/value-safety.js +328 -0
  83. package/dist/registry.d.ts +8 -6
  84. package/dist/registry.js +134 -61
  85. package/dist/resource-read.js +4 -1
  86. package/dist/routes/mcp.js +11 -2
  87. package/dist/sent-secrets.d.ts +54 -13
  88. package/dist/sent-secrets.js +770 -231
  89. package/dist/skills.js +26 -16
  90. package/dist/sqlite.js +21 -6
  91. package/dist/storage/keys.js +20 -5
  92. package/dist/storage/memory.js +9 -4
  93. package/dist/storage/sql.js +18 -9
  94. package/dist/types.d.ts +17 -3
  95. package/dist/usage-guide.js +49 -40
  96. package/dist/version.d.ts +1 -1
  97. package/dist/version.js +1 -1
  98. package/dist/worker.js +2 -1
  99. package/dist/write-outcome.js +47 -0
  100. package/documentation/README.md +64 -0
  101. package/documentation/architecture.md +241 -97
  102. package/documentation/auth.md +138 -5
  103. package/documentation/code-mode.md +224 -107
  104. package/documentation/deploying.md +146 -0
  105. package/documentation/integrating.md +170 -0
  106. package/documentation/meta-tools.md +142 -30
  107. package/documentation/operating.md +135 -0
  108. package/documentation/operator-tests.md +4 -0
  109. package/documentation/operator-ui.md +132 -0
  110. package/documentation/provider-auth-migration.md +307 -0
  111. package/documentation/provider-migration-0.29.md +22 -5
  112. package/examples/worker/README.md +9 -2
  113. package/package.json +9 -2
  114. package/templates/node/README.md +9 -2
  115. package/templates/node/package.json +1 -1
  116. package/dist/providers/vercel/mcp-ownership.js +0 -212
@@ -1,10 +1,13 @@
1
1
  // Generated by scripts/generate-providers.mjs; do not edit.
2
2
  export const skill = {
3
- "content": "- This is the explicit `surface: \"api\"` complement. Hosted MCP is the default; configure each under a separate connector id with independent authorization and recovery. Never fall back to another credential after an error or repeat a write to recover its response.\n- Named tools are canonical for reads in read-only programs. `cloudflare_api_get` covers other GET endpoints, including text and byte-preserving `responseType: \"base64\"` downloads. Hosted `search` discovers API contracts; hosted `execute` owns ordinary JSON mutations. Execute remains a write even for a GET-only program.\n- `cloudflare_api_mutate` retains only a demonstrated auth/header gap: Global API Key identity, or R2 bucket endpoints (including bucket creation at the collection) requiring `cf-r2-jurisdiction`, or bucket storage-class edits with `PATCH /accounts/{accountId}/r2/buckets/{bucketName}` and `cf-r2-storage-class: Standard` or `InfrequentAccess`. The vendor request helper cannot send either header. Storage-class edits do not require a jurisdiction header for ordinary buckets. Ordinary headers such as `Accept` do not qualify. Other API-token JSON mutations are refused locally and must use hosted `execute`.\n- `cloudflare_api_upload` retains byte-safe upload bodies, explicit endpoint headers and multipart field/file encoding for Worker scripts, KV values, R2 objects, Images, Stream and Pages uploads. PUT owns Worker scripts, KV values and R2 objects; POST owns Worker versions, Images, Stream collection uploads and Pages uploads. Stream metadata edits, copy-from-URL and direct-upload URL creation use hosted `execute`. Other method/path pairs are refused, regardless of claimed content type. The vendor supports raw/multipart bodies, but its helper returns non-JSON bodies as text and exposes only content type on the request. Use API uploads when those compatibility requirements matter. Raw tools take a path below `/client/v4`; absolute URLs, traversal and embedded query strings are refused. `Authorization`, `Cookie`, `Host`, `Content-Length`, `Content-Type`, and `Transfer-Encoding` are connector-owned headers and cannot be overridden.\n- Useful paths include `/accounts/{accountId}/images/v1`, `/accounts/{accountId}/stream`, `/accounts/{accountId}/d1/database`, `/accounts/{accountId}/queues`, `/accounts/{accountId}/r2/buckets/{bucketName}/cors`, and `/accounts/{accountId}/r2/metrics`. Change CORS with hosted `execute`, except for the explicit legacy-identity/header gaps above.\n- Lists use `page`/`perPage` and return `page.hasMore`; rulesets, R2 buckets/objects and KV keys instead use opaque cursors. `list_worker_scripts` is unpaginated. Use `get_zone_setting` for one setting; Cloudflare deprecated the bulk `/zones/{zoneId}/settings` read. Reads project resource identity and state; `raw: true` returns dropped vendor fields.\n- - Honor vendor rate-limit waits. The documented 1,200 calls per five minutes are cumulative across a user and its tokens.\n- Read state before replacement, rollback or purge. Prefer targeted cache purges in hosted `execute`. Mutations/uploads stay write-classified; approval belongs to the host and program access to the configured pool.\n\n\n- Hosted `execute` owns ordinary mutations. The separate `surface: \"api\"`\n complement owns read-only-program reads, binary/header-compatible uploads\n and legacy Global API Key or R2 jurisdiction/storage-class mutations. Configure distinct\n connector ids and authorize each explicitly; there is no credential fallback.\n- Resolve account and zone ids independently. Defaults do not constrain token permissions. Distinguish missing or revoked credentials from missing product permissions, and honor supplied rate-limit waits.\n- The catalog contains `search` and `execute`. Search runs code against\n Cloudflare's OpenAPI document. Execute runs code that may call any authorized\n Cloudflare API endpoint.\n- Use `search` to find the exact method, path, and fields before writing an\n execute program. Do not guess an endpoint from product naming.\n- Connecta classifies `execute` as a write because it can mix GET, POST,\n PUT, PATCH, and DELETE requests inside one program. Fetch\n `skills({ name: \"usage\" })` for guest calls and routing. The MCP schema\n cannot establish that arbitrary code is read-only.\n- Keep returned values small. Filter and project inside the Cloudflare MCP\n program, then reduce again inside Connecta's `execute_code` when several\n calls must be joined.\n- OAuth and API-token permissions remain the provider-side boundary. An\n `auth_required` failure needs authorization or a token with the required\n Cloudflare permission.\n",
3
+ "content": "- Resolve account and zone ids before acting; never guess one. Ids are 32-character hex strings, and a zone is found by its domain name. Defaults and pins route a connector; Cloudflare's permissions still decide what the credential may do.\n- Read state before replacing, rolling back, or purging. For DNS, PATCH changes the fields you send and PUT replaces the whole record, so read the record first and send its type, name, and content with the change. Prefer a targeted cache purge (files, tags, hosts, or prefixes) over purging everything.\n- Cloudflare reports failures in `errors` with numeric codes and returns `success: false`; read the message instead of retrying the same call.\n- Honor rate-limit waits. Cloudflare documents 1,200 requests per five minutes per user, counted across the dashboard and every token; Connecta's per-runtime window approximates it, and a limited user is blocked for the rest of the window.\n- Treat every create, update, delete, purge, deploy, and upload as a write. For guest calls, classification, and routing, fetch `skills({ name: \"usage\" })`.\n",
4
4
  "instructionsHeading": "Account instructions",
5
5
  "fragments": {
6
- "guide_0": "- This is the explicit `surface: \"api\"` complement. Hosted MCP is the default; configure each under a separate connector id with independent authorization and recovery. Never fall back to another credential after an error or repeat a write to recover its response.\n- Named tools are canonical for reads in read-only programs. `cloudflare_api_get` covers other GET endpoints, including text and byte-preserving `responseType: \"base64\"` downloads. Hosted `search` discovers API contracts; hosted `execute` owns ordinary JSON mutations. Execute remains a write even for a GET-only program.\n- `cloudflare_api_mutate` retains only a demonstrated auth/header gap: Global API Key identity, or R2 bucket endpoints (including bucket creation at the collection) requiring `cf-r2-jurisdiction`, or bucket storage-class edits with `PATCH /accounts/{accountId}/r2/buckets/{bucketName}` and `cf-r2-storage-class: Standard` or `InfrequentAccess`. The vendor request helper cannot send either header. Storage-class edits do not require a jurisdiction header for ordinary buckets. Ordinary headers such as `Accept` do not qualify. Other API-token JSON mutations are refused locally and must use hosted `execute`.\n- `cloudflare_api_upload` retains byte-safe upload bodies, explicit endpoint headers and multipart field/file encoding for Worker scripts, KV values, R2 objects, Images, Stream and Pages uploads. PUT owns Worker scripts, KV values and R2 objects; POST owns Worker versions, Images, Stream collection uploads and Pages uploads. Stream metadata edits, copy-from-URL and direct-upload URL creation use hosted `execute`. Other method/path pairs are refused, regardless of claimed content type. The vendor supports raw/multipart bodies, but its helper returns non-JSON bodies as text and exposes only content type on the request. Use API uploads when those compatibility requirements matter. Raw tools take a path below `/client/v4`; absolute URLs, traversal and embedded query strings are refused. `Authorization`, `Cookie`, `Host`, `Content-Length`, `Content-Type`, and `Transfer-Encoding` are connector-owned headers and cannot be overridden.\n- Useful paths include `/accounts/{accountId}/images/v1`, `/accounts/{accountId}/stream`, `/accounts/{accountId}/d1/database`, `/accounts/{accountId}/queues`, `/accounts/{accountId}/r2/buckets/{bucketName}/cors`, and `/accounts/{accountId}/r2/metrics`. Change CORS with hosted `execute`, except for the explicit legacy-identity/header gaps above.\n- Lists use `page`/`perPage` and return `page.hasMore`; rulesets, R2 buckets/objects and KV keys instead use opaque cursors. `list_worker_scripts` is unpaginated. Use `get_zone_setting` for one setting; Cloudflare deprecated the bulk `/zones/{zoneId}/settings` read. Reads project resource identity and state; `raw: true` returns dropped vendor fields.\n- ",
7
- "guide_1": "- Honor vendor rate-limit waits. The documented 1,200 calls per five minutes are cumulative across a user and its tokens.\n- Read state before replacement, rollback or purge. Prefer targeted cache purges in hosted `execute`. Mutations/uploads stay write-classified; approval belongs to the host and program access to the configured pool.\n",
8
- "guide_2": "\n\n- Hosted `execute` owns ordinary mutations. The separate `surface: \"api\"`\n complement owns read-only-program reads, binary/header-compatible uploads\n and legacy Global API Key or R2 jurisdiction/storage-class mutations. Configure distinct\n connector ids and authorize each explicitly; there is no credential fallback.\n- Resolve account and zone ids independently. Defaults do not constrain token permissions. Distinguish missing or revoked credentials from missing product permissions, and honor supplied rate-limit waits.\n- The catalog contains `search` and `execute`. Search runs code against\n Cloudflare's OpenAPI document. Execute runs code that may call any authorized\n Cloudflare API endpoint.\n- Use `search` to find the exact method, path, and fields before writing an\n execute program. Do not guess an endpoint from product naming.\n- Connecta classifies `execute` as a write because it can mix GET, POST,\n PUT, PATCH, and DELETE requests inside one program. Fetch\n `skills({ name: \"usage\" })` for guest calls and routing. The MCP schema\n cannot establish that arbitrary code is read-only.\n- Keep returned values small. Filter and project inside the Cloudflare MCP\n program, then reduce again inside Connecta's `execute_code` when several\n calls must be joined.\n- OAuth and API-token permissions remain the provider-side boundary. An\n `auth_required` failure needs authorization or a token with the required\n Cloudflare permission.\n"
6
+ "oauth": "\n\n- The catalog is Cloudflare's own `search` and `execute`. `search` runs code against Cloudflare's OpenAPI document; `execute` runs code that may call any Cloudflare API endpoint the OAuth grant allows.\n- Connecta classifies `execute` as a write, even for a program that only reads, because one program can mix GET, POST, PUT, PATCH, and DELETE and no schema proves otherwise. A read-only pool therefore gets only `search` here. Deployments that need API reads from a read-only pool configure an API-token connector, whose `cloudflare_api_read` and named reads are reads.\n- Use `search` to find the exact method, path, and fields before writing an execute program. Do not guess an endpoint from product naming.\n- Keep returned values small. Filter and project inside the Cloudflare program, then reduce again inside Connecta's `execute_code` when several calls must be joined.\n- This connection has none of the REST connector's tools: no `cloudflare_api_*` validation against a pinned index, no `graphql_query`, no `cloudflare_api_upload`, and no account or zone pin. OAuth permissions are the boundary.\n",
7
+ "oauth_tail": "- An `auth_required` failure means this connector's Cloudflare authorization is missing or expired: run `authorize_connector` for this connector id, then retry the same call unchanged.\n",
8
+ "global_warning": "\n\nThis connector holds a Global API Key. It acts as its Cloudflare user with every permission that user has, in every account and zone the user belongs to, and nothing on Cloudflare's side narrows it. A mistaken write can reach production domains, billing, and members across all of them. Prefer reads, state the account and zone of every write, and stop when a request is ambiguous. Writes under `/user` and `/memberships` are refused. R2 accepts API tokens only, so R2 operations fail with this key.\n",
9
+ "key": "\n\n- This is Connecta's REST connector to the Cloudflare v4 API, holding one operator-managed credential. `cloudflare_api_search` finds API operations in a pinned index (not records) and names the tool that calls each; `cloudflare_api_details` returns one operation's parameters and body with types, enums, and required names. Neither sends a request.\n- `cloudflare_api_read` calls GET operations plus reviewed read-only POSTs: analytics queries, Analytics Engine and SQL API queries, Log Explorer SQL, Vectorize queries, KV bulk get, telemetry queries, and validation checks. `cloudflare_api_write` calls every other POST, PUT, PATCH, and DELETE with `method` and `path` stated. D1 `…/query` and `…/raw`, Durable Object queries, Workers AI `…/ai/run`, AI Search and AutoRAG search (query rewriting runs billed models), monetization checks, and flag evaluation are writes: they can change data, cost money, or activate something.\n- Paths are concrete: substitute ids into the template search returned (`/zones/<zone id>/dns_records/<record id>`). Pass `query` and `body` as JSON named as details lists them; text operations (Analytics Engine SQL, Log Explorer SQL, Worker scripts) take a string body, and Vectorize inserts a list of objects sent as NDJSON. R2 calls accept `headers` with `cf-r2-jurisdiction` or `cf-r2-storage-class`. Encode a `/` inside an R2 object key or KV key name as `%2F`.\n- Every call is checked against the pinned index before it is sent. An unknown path returns the nearest operations; an unknown or missing parameter returns `validation.issues` with the accepted names. Nothing reached Cloudflare, so fix the call from that answer.\n- Results arrive as `{ status, data, page? }` with Cloudflare's envelope unwrapped: `data` is the `result`. On a list, pass `page.next` as the `page.param` query argument (`page` for numbered lists, `cursor` for KV, R2, and other cursor lists). Lists belong inside `execute_code`; pass `select` (dot paths such as `id` and `name`) to keep only the fields the question needs.\n- `list_zones` and `list_accounts` resolve names to ids; `verify_credential` separates a bad credential from a missing permission. `graphql_query` runs read-only GraphQL Analytics queries (mutations are refused before sending); filter every `zones` or `accounts` field by `zoneTag` or `accountTag`. A pinned connector sends one query per document, with every fragment it defines used.\n- Multipart, binary, and file bodies go through `cloudflare_api_upload`: Worker scripts and versions, KV values, R2 objects, Pages deployments, Images, Stream, DNS zone-file import, and Snippets. It takes `textBody`, `base64Body`, or multipart `parts`, never a local file.\n- Refused by design: every operation that mints, rotates, or hands back a credential (API tokens, Access service tokens, R2 temporary credentials, tunnel and Mesh node tokens, signing keys, registry credentials, direct-upload URLs, deploy hooks, preview and participant tokens), payment client secrets, URL Scanner captures (results, HAR, DOM, raw responses: they hold the scanned session's cookies and headers; use the scan search for verdicts), and GETs that act (an email unsubscribe, a PagerDuty connect). Stored and embedded secrets (Turnstile, TSIG, webhook and identity-provider secrets, Stream keys, Logpush destination credentials, probe and custom-provider headers, BGP keys, Zaraz variables, Hyperdrive database passwords, RealtimeKit storage credentials, transform-rule header values) and every environment or plain-text binding value (Pages, Containers, Workers, Builds; names and types stay) come back as `\"[redacted]\"` on every method. Notification, RealtimeKit, and data security webhook destinations keep only their scheme and host. Workers KV values are application data and come back as stored. Reviewed operations, and operations that take credentials, report Cloudflare's error codes without its error text. Worker script content is readable: it is code, and secret bindings are not part of it.\n- An `auth_required` failure means the credential is missing, revoked, or malformed: an operator must replace it in this connection in the operator UI, and `authorize_connector` returns that handoff. `provider_permission_denied` means the credential works but lacks this permission or resource, or the call is outside the pin; ask rather than retry.\n",
10
+ "shared": "- Resolve account and zone ids before acting; never guess one. Ids are 32-character hex strings, and a zone is found by its domain name. Defaults and pins route a connector; Cloudflare's permissions still decide what the credential may do.\n- Read state before replacing, rolling back, or purging. For DNS, PATCH changes the fields you send and PUT replaces the whole record, so read the record first and send its type, name, and content with the change. Prefer a targeted cache purge (files, tags, hosts, or prefixes) over purging everything.\n- Cloudflare reports failures in `errors` with numeric codes and returns `success: false`; read the message instead of retrying the same call.\n- Honor rate-limit waits. Cloudflare documents 1,200 requests per five minutes per user, counted across the dashboard and every token; Connecta's per-runtime window approximates it, and a limited user is blocked for the rest of the window.\n- Treat every create, update, delete, purge, deploy, and upload as a write. For guest calls, classification, and routing, fetch `skills({ name: \"usage\" })`.\n",
11
+ "key_tail": "- Cloudflare answers a rate limit with HTTP 429; the failure carries `retryAfterMs`. Failed authentication is limited separately (code 10502), so diagnose a credential once with `verify_credential` rather than retrying calls.\n"
9
12
  }
10
13
  };