@zackbart/connecta 0.24.3 → 0.24.4

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 (67) hide show
  1. package/AGENTS.md +18 -20
  2. package/CHANGELOG.md +64 -1
  3. package/README.md +5 -6
  4. package/dist/branding.d.ts +31 -2
  5. package/dist/branding.js +116 -8
  6. package/dist/connectors/api.d.ts +1 -1
  7. package/dist/connectors/api.js +10 -2
  8. package/dist/connectors/guarded-fetch.d.ts +5 -1
  9. package/dist/connectors/guarded-fetch.js +34 -4
  10. package/dist/connectors/remote-mcp.js +8 -4
  11. package/dist/errors.d.ts +11 -3
  12. package/dist/errors.js +2 -1
  13. package/dist/index.d.ts +1 -1
  14. package/dist/index.js +12 -1
  15. package/dist/meta-tools.js +105 -29
  16. package/dist/operator-ui/generated.js +2 -2
  17. package/dist/operator-ui/view.d.ts +38 -1
  18. package/dist/operator-ui/view.js +71 -0
  19. package/dist/providers/cloudflare.d.ts +14 -2
  20. package/dist/providers/cloudflare.js +107 -16
  21. package/dist/providers/linear.d.ts +26 -4
  22. package/dist/providers/linear.js +19 -4
  23. package/dist/providers/mixpanel.d.ts +16 -3
  24. package/dist/providers/mixpanel.js +13 -2
  25. package/dist/providers/notion.d.ts +8 -1
  26. package/dist/providers/notion.js +83 -10
  27. package/dist/providers/revenuecat.d.ts +30 -4
  28. package/dist/providers/revenuecat.js +42 -4
  29. package/dist/providers/stripe.d.ts +7 -1
  30. package/dist/providers/stripe.js +30 -4
  31. package/dist/providers/vercel.js +11 -1
  32. package/dist/registry.d.ts +12 -4
  33. package/dist/registry.js +22 -8
  34. package/dist/types.d.ts +37 -0
  35. package/dist/ui.js +18 -10
  36. package/dist/version.d.ts +1 -1
  37. package/dist/version.js +1 -1
  38. package/documentation/architecture.md +193 -181
  39. package/documentation/auth.md +197 -176
  40. package/documentation/code-mode.md +426 -321
  41. package/documentation/meta-tools.md +356 -416
  42. package/examples/worker/AGENTS.md +2 -1
  43. package/examples/worker/README.md +12 -10
  44. package/examples/worker/src/index.ts +12 -15
  45. package/package.json +1 -2
  46. package/templates/node/.env.example +3 -3
  47. package/templates/node/AGENTS.md +5 -4
  48. package/templates/node/README.md +2 -1
  49. package/templates/node/package.json +1 -1
  50. package/templates/node/src/index.ts +23 -22
  51. package/documentation/call-admission.md +0 -158
  52. package/documentation/cloudflare.md +0 -471
  53. package/documentation/connector-guides.md +0 -176
  54. package/documentation/connectors.md +0 -431
  55. package/documentation/linear.md +0 -193
  56. package/documentation/mixpanel.md +0 -160
  57. package/documentation/notion.md +0 -308
  58. package/documentation/operations.md +0 -359
  59. package/documentation/operator-ui.md +0 -135
  60. package/documentation/optional-modules-upgrade.md +0 -243
  61. package/documentation/provider-conventions.md +0 -729
  62. package/documentation/request-admission.md +0 -204
  63. package/documentation/revenuecat.md +0 -305
  64. package/documentation/storage-and-credentials.md +0 -254
  65. package/documentation/stripe.md +0 -262
  66. package/documentation/upgrading.md +0 -768
  67. package/documentation/vercel.md +0 -241
@@ -1,241 +0,0 @@
1
- # Vercel
2
-
3
- Import `vercel()` independently from `@zackbart/connecta/providers/vercel`.
4
- It offers two explicit provider surfaces:
5
-
6
- | `surface` | Contract owner | Authentication | Best fit |
7
- | --- | --- | --- | --- |
8
- | `"api"` or omitted | Connecta's hand-written schemas and projections | Vercel access token | Stable named operations, guarded REST hatches, environment variables, domains, and deployment lifecycle |
9
- | `"mcp"` | Vercel's live MCP catalog and schemas | OAuth | Vercel's newest agent tools, documentation search, observability, purchases, toolbar comments, and direct deployment |
10
-
11
- The choice belongs to deployment configuration. It never changes during an
12
- agent run, and neither surface receives different Connecta privileges. Use two
13
- connector ids when a deployment needs both.
14
-
15
- ```ts
16
- import { vercel } from "@zackbart/connecta/providers/vercel";
17
-
18
- const hostingApi = vercel("hosting_api", {
19
- surface: "api",
20
- purpose: "Production web applications for the product team",
21
- teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
22
- });
23
-
24
- const hostingMcp = vercel("hosting_mcp", {
25
- surface: "mcp",
26
- purpose: "Production diagnosis and Vercel-native agent workflows",
27
- });
28
- ```
29
-
30
- Omitting `surface` still selects `"api"`, so existing configurations do not
31
- change behavior.
32
-
33
- ## API surface
34
-
35
- The API surface is a hand-written `api()` connection over Vercel's public REST
36
- API. It owns 18 named operations and three provider-relative REST hatches. It
37
- adds no provider dependency, imports no `node:` builtin, and is not reachable
38
- from Connecta's root entry.
39
-
40
- The deployment stores one Vercel access token in Connecta's credential vault.
41
- Create the token in Vercel Account Settings under Tokens. Scope it to the
42
- personal account or team this connection needs and give it an expiration date.
43
- The operator UI's Test action calls `GET /v2/user` and reports the authenticated
44
- username, email, name, or id. Connecta never probes it in the background.
45
-
46
- This surface is authored rather than generated. No OpenAPI document creates
47
- tools at runtime. The named operations are reviewed, projected, classified,
48
- and tested by hand. The published OpenAPI document is used only by
49
- `npm run drift:check` to compare the 19 named endpoints this surface calls.
50
-
51
- ## Configuration
52
-
53
- ```ts
54
- vercel("hosting", {
55
- surface: "api",
56
- title: "Production hosting",
57
- authScope: "shared",
58
- purpose: "Customer-facing sites owned by Platform",
59
- teamId: "team_...",
60
- defaultPageSize: 20,
61
- instructions: "Never promote the docs project from this connection.",
62
- maxResultBytes: 512_000,
63
- callAdmission: {
64
- rules: [{ maxConcurrency: 6 }],
65
- },
66
- });
67
- ```
68
-
69
- `purpose` is required and blank text throws at construction. `teamId` is a
70
- default, not a hidden lock. Named account-scoped tools accept a `teamId`
71
- override; pass `null` to target the token owner's personal account explicitly.
72
- Without a configured default or an override, Vercel uses that personal account.
73
- `list_teams` returns the ids needed to reach a team.
74
-
75
- `defaultPageSize` defaults to 20 and must be a whole number from 1 through 100.
76
- Vercel meters endpoints separately, so the connection invents no global request
77
- budget. A deployment may supply `callAdmission` when it has its own concurrency
78
- or call-rate requirement.
79
-
80
- `baseUrl` exists for a test double or an HTTPS proxy. The guarded transport
81
- confines every path under that base, refuses redirects, prevents request headers
82
- from replacing `Authorization`, passes `ctx.signal`, and stops reading at 8 MiB.
83
- The runtime-log read also returns at most 500 rows and stops a stream that stays
84
- open past 10 seconds. HTTP is accepted only for a loopback test double.
85
-
86
- ## MCP surface
87
-
88
- The MCP surface proxies Vercel's official hosted endpoint at
89
- `https://mcp.vercel.com` and uses OAuth. Connecta does not copy Vercel's schemas
90
- into this repository. Each complete `tools/list` response is preserved as the
91
- live catalog, cached under the connector id, and invalidated when authorization
92
- changes.
93
-
94
- Connecta does vendor one thing: the 32 tool names and their release-reviewed
95
- read, additive-write, or destructive-write verdicts from Vercel's
96
- [official MCP tool reference](https://vercel.com/docs/agent-resources/vercel-mcp/tools).
97
- Those verdicts fill in missing annotations and keep reviewed destructive tools
98
- off the read-only execution path. A new tool remains fail-closed until a release
99
- classifies it. The provider check needs no schema digest because Connecta does
100
- not serve a schema snapshot.
101
-
102
- This separation matters when diagnosing a schema mismatch:
103
-
104
- - On `surface: "api"`, the schema in `src/providers/vercel.ts` is Connecta's
105
- contract and its tests must prove the behavior.
106
- - On `surface: "mcp"`, Vercel's live `tools/list` response is the contract.
107
- Connecta does not rewrite it. `search_tools` with compact schemas is a lossy
108
- preview; use `describe` with JSON format when the exact schema matters.
109
-
110
- [integrations.sh's Vercel record](https://integrations.sh/vercel.com/) remains
111
- useful discovery evidence. The contract check uses Vercel's official setup and
112
- tool pages instead. Neither source replaces the live MCP schemas.
113
-
114
- ## API named tools
115
-
116
- | Tool | What it does |
117
- | --- | --- |
118
- | `list_teams` | Lists teams the token can reach. |
119
- | `list_projects` | Searches or lists lean project summaries. |
120
- | `get_project` | Reads build settings, Git identity, and the production deployment. |
121
- | `list_deployments` | Filters deployments by project, target, state, branch, or SHA. |
122
- | `get_deployment` | Reads one deployment by id or hostname. |
123
- | `get_build_logs` | Reads at most 1,000 existing build events with live following disabled. |
124
- | `get_runtime_logs` | Reads a 1–500 row runtime-log snapshot and stops a stream open past 10 seconds. |
125
- | `list_project_domains` | Lists verification, redirect, branch, and custom-environment state. |
126
- | `add_project_domain` | Adds a regular, redirect, branch, or custom-environment domain. |
127
- | `verify_project_domain` | Rechecks a pending domain after its DNS challenge is complete. |
128
- | `remove_project_domain` | Removes a project domain, optionally with domains redirecting to it. |
129
- | `list_project_env_vars` | Lists metadata without asking Vercel to decrypt values. |
130
- | `upsert_project_env_var` | Creates or replaces one variable. |
131
- | `update_project_env_var` | Patches one variable by its id. |
132
- | `delete_project_env_var` | Removes one variable from future deployments. |
133
- | `promote_deployment` | Promotes an existing build to production without rebuilding. |
134
- | `cancel_deployment` | Cancels work that is queued, initializing, or building. |
135
- | `delete_deployment` | Permanently removes a deployment and its URL. |
136
-
137
- Every read returns a lean projection by default. Projects drop security,
138
- billing, and presentation settings. Deployments keep state, target, timestamps,
139
- creator, and Git identity. Domain reads keep the verification challenge because
140
- dropping it would make an unverified result unusable. The project, deployment,
141
- domain, and build-log reads accept `raw: true` when a Vercel field omitted by
142
- the projection matters.
143
-
144
- `raw: true` preserves unprojected list items while keeping the named tool's
145
- declared envelope: list calls still return their item key and `page`, and build
146
- logs still return `{ events }`.
147
-
148
- ## Environment values are write-only here
149
-
150
- `list_project_env_vars` sends `decrypt=false`, then drops `value` even if
151
- Vercel returns one anyway. It returns the key, id, storage type, visibility,
152
- targets, branch, custom-environment ids, comment, and timestamps. The create and
153
- update tools accept a value as input, but their result projection drops it too.
154
-
155
- That boundary is deliberate. An agent can audit placement and make a requested
156
- change without filling its context with database URLs or API keys. Sensitive
157
- values cannot be read back from Vercel in any case. The generic
158
- `vercel_api_get` hatch returns the endpoint's untouched response, so a caller
159
- that deliberately requests an endpoint capable of decrypting a non-sensitive
160
- value has asked to cross the named tool's safer boundary.
161
-
162
- Environment changes affect future deployments. They do not rewrite a value
163
- already embedded in an existing deployment, and none of the environment tools
164
- triggers a deployment on its own.
165
-
166
- ## REST hatches
167
-
168
- Vercel's API is too large and changes too often for every operation to deserve
169
- a permanent named tool.
170
-
171
- - `vercel_api_get` accepts only GET and is explicitly read-only.
172
- - `vercel_api_mutate` accepts JSON POST, PUT, PATCH, and DELETE. It always
173
- crosses `call_destructive_tool`.
174
- - `vercel_api_upload` accepts POST or PUT with exactly one explicit UTF-8 or
175
- base64 body. It also crosses `call_destructive_tool`.
176
-
177
- All three take a path beginning with `/` and including Vercel's version, such
178
- as `/v1/edge-config`. Query parameters are name/value rows rather than a string
179
- to parse. They use the configured default team unless the caller passes
180
- `personalAccount: true`; that flag cannot be combined with a `teamId` or `slug`
181
- query row. The upload hatch accepts endpoint-specific headers such as a digest,
182
- but refuses credential, cookie, host, content-type, content-length, and
183
- transfer-encoding headers. It reads no local file. The caller supplies the
184
- bytes, content type, and any checksum the endpoint requires.
185
-
186
- Use a named tool when one exists. A named tool wins on argument validation,
187
- result size, or safety routing. The hatch is for products such as Edge Config,
188
- feature flags, drains, checks, security, and team settings that are not worth a
189
- large permanent catalog.
190
-
191
- ## Pagination
192
-
193
- The four list families expose one connector-wide contract:
194
-
195
- ```ts
196
- {
197
- items: [],
198
- page: { hasMore: true, nextCursor: "opaque" }
199
- }
200
- ```
201
-
202
- The item key is `teams`, `projects`, `deployments`, or `domains`. Pass
203
- `nextCursor` back as `cursor` unchanged. Vercel uses different parameter names
204
- and cursor types behind the four endpoints. The connector owns that mapping so
205
- programs do not parse timestamps or branch on provider-specific pagination.
206
-
207
- Environment-variable listing has no pagination in Vercel's published contract
208
- and returns `{ variables }` without a false page object.
209
-
210
- ## Typed failures
211
-
212
- - HTTP 401 and 403 become `auth_required`. Vercel uses 403 both for a bad token
213
- and for a token outside the requested team or operation scope.
214
- - HTTP 404 becomes `not_found`. Re-list the owning project, deployment, domain,
215
- or environment variable before using the id again.
216
- - HTTP 400, 409, and 422 become `invalid_args`.
217
- - HTTP 429 becomes `rate_limited`. `Retry-After` wins; otherwise the connector
218
- derives the delay from `X-RateLimit-Reset`.
219
- - HTTP 5xx becomes `unavailable`.
220
-
221
- The error text keeps Vercel's error code and message. It never parses prose to
222
- invent a class.
223
-
224
- ## No SDK on purpose
225
-
226
- The connection imports only Connecta modules and Web APIs. `@vercel/sdk` is not
227
- a dependency or optional peer. Direct fetch keeps the root Workers-safe, avoids
228
- shipping the generated model graph, and lets the reviewed named operations and
229
- the REST hatches share one guarded transport.
230
-
231
- The trade is API drift, handled explicitly. `scripts/drift/vercel-endpoints.json`
232
- records the method, versioned path, specification revision, and request/response
233
- digest for every fixed endpoint. Before a release,
234
- `npm run providers:check -- --provider vercel` compares those rows with
235
- Vercel's published OpenAPI document at `https://openapi.vercel.sh/`, compares
236
- the vendored MCP inventory with Vercel's official tool reference, and checks
237
- the endpoint and OAuth support in Vercel's setup page. It states that live MCP
238
- schemas are not vendored and that the live `tools/list` response remains their
239
- runtime authority. The API hatches are absent from the endpoint manifest
240
- because deployment code chooses their path at call time. No Vercel credential
241
- is needed for this check.