@zackbart/connecta 0.12.2 → 0.14.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.
- package/CHANGELOG.md +324 -0
- package/README.md +4 -1
- package/dist/catalog-service.d.ts +41 -0
- package/dist/catalog-service.d.ts.map +1 -1
- package/dist/catalog-service.js +127 -11
- package/dist/catalog-service.js.map +1 -1
- package/dist/connectors/api.d.ts +5 -4
- package/dist/connectors/api.d.ts.map +1 -1
- package/dist/connectors/api.js +5 -1
- package/dist/connectors/api.js.map +1 -1
- package/dist/connectors/remote-mcp.d.ts +5 -4
- package/dist/connectors/remote-mcp.d.ts.map +1 -1
- package/dist/connectors/remote-mcp.js.map +1 -1
- package/dist/execute.d.ts.map +1 -1
- package/dist/execute.js +12 -10
- package/dist/execute.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/meta-tools.d.ts.map +1 -1
- package/dist/meta-tools.js +5 -4
- package/dist/meta-tools.js.map +1 -1
- package/dist/providers/cloudflare.d.ts +53 -0
- package/dist/providers/cloudflare.d.ts.map +1 -0
- package/dist/providers/cloudflare.js +1385 -0
- package/dist/providers/cloudflare.js.map +1 -0
- package/dist/providers/linear.d.ts +44 -0
- package/dist/providers/linear.d.ts.map +1 -0
- package/dist/providers/linear.js +243 -0
- package/dist/providers/linear.js.map +1 -0
- package/dist/providers/mixpanel.d.ts +21 -0
- package/dist/providers/mixpanel.d.ts.map +1 -0
- package/dist/providers/mixpanel.js +191 -0
- package/dist/providers/mixpanel.js.map +1 -0
- package/dist/providers/notion.d.ts +39 -0
- package/dist/providers/notion.d.ts.map +1 -0
- package/dist/providers/notion.js +1625 -0
- package/dist/providers/notion.js.map +1 -0
- package/dist/providers/stripe.d.ts +37 -0
- package/dist/providers/stripe.d.ts.map +1 -0
- package/dist/providers/stripe.js +232 -0
- package/dist/providers/stripe.js.map +1 -0
- package/dist/skills.d.ts +7 -9
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +58 -24
- package/dist/skills.js.map +1 -1
- package/dist/types.d.ts +26 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/documentation/cloudflare.md +268 -0
- package/documentation/code-mode.md +6 -6
- package/documentation/connectors.md +122 -4
- package/documentation/linear.md +144 -0
- package/documentation/meta-tools.md +91 -8
- package/documentation/mixpanel.md +77 -0
- package/documentation/notion.md +233 -0
- package/documentation/stripe.md +202 -0
- package/ethos.md +8 -3
- package/package.json +21 -1
- package/src/catalog-service.ts +174 -10
- package/src/connectors/api.ts +10 -4
- package/src/connectors/remote-mcp.ts +5 -3
- package/src/execute.ts +18 -10
- package/src/index.ts +1 -0
- package/src/meta-tools.ts +10 -4
- package/src/providers/cloudflare.ts +1696 -0
- package/src/providers/linear.ts +301 -0
- package/src/providers/mixpanel.ts +228 -0
- package/src/providers/notion.ts +1879 -0
- package/src/providers/stripe.ts +306 -0
- package/src/skills.ts +64 -23
- package/src/types.ts +27 -6
- package/src/version.ts +1 -1
- package/templates/node/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -189,13 +189,17 @@ export interface Connector {
|
|
|
189
189
|
*/
|
|
190
190
|
callAdmission?: ConnectorCallAdmissionPolicy;
|
|
191
191
|
/**
|
|
192
|
-
* Optional agent-facing usage guide
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
192
|
+
* Optional agent-facing usage guide for this connector. A string preserves
|
|
193
|
+
* the original markdown-only contract. The structured form can add a short
|
|
194
|
+
* discovery summary and require review when even a complete compact schema
|
|
195
|
+
* cannot describe correct use (for example a generic API wrapper or a
|
|
196
|
+
* cross-operation sequencing rule).
|
|
197
|
+
*
|
|
198
|
+
* Listed by `skills` as `connector:<id>` and returned verbatim by
|
|
199
|
+
* `skills({ name: "connector:<id>" })`. The guide remains deployment-owned
|
|
200
|
+
* configuration; no runtime registration or shared mutable copy exists.
|
|
197
201
|
*/
|
|
198
|
-
usageGuide?: string;
|
|
202
|
+
usageGuide?: string | ConnectorUsageGuide;
|
|
199
203
|
/** Optional operator-managed credential slot rendered on /credentials. */
|
|
200
204
|
credential?: ConnectorCredentialConfig;
|
|
201
205
|
/** Optional server-side check used by /credentials' Test action. */
|
|
@@ -267,6 +271,22 @@ export interface Connector {
|
|
|
267
271
|
*/
|
|
268
272
|
handleRequest?(request: Request, ctx: ConnectorContext): Promise<Response | null>;
|
|
269
273
|
}
|
|
274
|
+
export interface ConnectorUsageGuide {
|
|
275
|
+
/** Markdown returned verbatim by `skills({ name: "connector:<id>" })`. */
|
|
276
|
+
content: string;
|
|
277
|
+
/**
|
|
278
|
+
* Bounded discovery hint describing the conventions the guide covers. When
|
|
279
|
+
* omitted, Connecta derives a summary from the guide's first meaningful line.
|
|
280
|
+
*/
|
|
281
|
+
summary?: string;
|
|
282
|
+
/**
|
|
283
|
+
* Require review before every operation on this connector. Reserve this for
|
|
284
|
+
* cases whose correct arguments or sequence cannot be expressed by the
|
|
285
|
+
* downstream tool schema; mutations and truncated schemas are required
|
|
286
|
+
* automatically and do not need this flag.
|
|
287
|
+
*/
|
|
288
|
+
required?: boolean;
|
|
289
|
+
}
|
|
270
290
|
/** Result of one sandboxed code execution. */
|
|
271
291
|
export interface ExecuteResult {
|
|
272
292
|
result: unknown;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,sDAAsD;AACtD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD,+DAA+D;AAC/D,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACzC,GAAG,CACD,GAAG,EAAE,MAAM,EACX,KAAK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AM,CAAC;CACrB;AAED,qEAAqE;AACrE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,kBAAkB,CAAC,CACjB,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACpD;;;OAGG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,+EAA+E;IAC/E,cAAc,CAAC,CACb,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,GACd,QAAQ,GAAG,IAAI,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IAC9C,sCAAsC;IACtC,SAAS,CACP,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,GACd,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACrC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* a bump that forgets this file fails the build rather than shipping a stale
|
|
5
5
|
* version to `/health` and to downstream MCP handshakes.
|
|
6
6
|
*/
|
|
7
|
-
export declare const CONNECTA_VERSION = "0.
|
|
7
|
+
export declare const CONNECTA_VERSION = "0.14.0";
|
|
8
8
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# Cloudflare prebuilt connection
|
|
2
|
+
|
|
3
|
+
Import `cloudflare()` independently from
|
|
4
|
+
`@zackbart/connecta/providers/cloudflare`. It is a deliberate, hand-written
|
|
5
|
+
surface over Cloudflare's v4 REST API — fourteen tools with complete schemas,
|
|
6
|
+
lean projections, typed failures, and a rate-limit budget matching the
|
|
7
|
+
documented one. It adds no provider dependency, imports nothing outside
|
|
8
|
+
Connecta, and is not reachable from Connecta's root entry.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { cloudflare } from "@zackbart/connecta/providers/cloudflare";
|
|
12
|
+
|
|
13
|
+
const edge = cloudflare("cloudflare_prod", {
|
|
14
|
+
title: "Production edge",
|
|
15
|
+
purpose: "DNS and cache administration for the production estate",
|
|
16
|
+
zoneId: "0a1b2c3d4e5f60718293a4b5c6d7e8f9",
|
|
17
|
+
accountId: "9f8e7d6c5b4a30291817263544332211",
|
|
18
|
+
instructions: "Never purge the whole zone during business hours.",
|
|
19
|
+
});
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The `id` owns the ordinary connector namespaces; use a different id for every
|
|
23
|
+
Cloudflare account or estate. `purpose` is required because an agent choosing
|
|
24
|
+
between a production and a staging instance needs to know which one answers the
|
|
25
|
+
question. Account `instructions` are appended to the maintained guide and
|
|
26
|
+
cannot change the connector's safety classification.
|
|
27
|
+
|
|
28
|
+
## No SDK, on purpose
|
|
29
|
+
|
|
30
|
+
Cloudflare publishes an official `cloudflare` npm SDK, and this connection does
|
|
31
|
+
not use it. The SDK's value is typed request wrappers and pagination helpers.
|
|
32
|
+
Both are things this connection replaces rather than consumes: an agent needs a
|
|
33
|
+
projected result and a `page.hasMore` boolean, not Cloudflare's full response
|
|
34
|
+
object, so the SDK's types would be re-projected away at the boundary. What the
|
|
35
|
+
dependency would cost is real — an optional peer with its own install step and
|
|
36
|
+
version skew, an import that never belongs in the root graph, and a second
|
|
37
|
+
opinion about what a Cloudflare call looks like.
|
|
38
|
+
|
|
39
|
+
The API itself does not need one. It is Bearer-token JSON over `fetch` with a
|
|
40
|
+
uniform `{ success, errors, messages, result, result_info }` envelope. Writing
|
|
41
|
+
that by hand is about two hundred lines, keeps the provider Workers-clean, and
|
|
42
|
+
means `@zackbart/connecta/providers/cloudflare` installs and runs with nothing
|
|
43
|
+
extra. `test/package-surface.test.ts` pins the claim: the `cloudflare` package
|
|
44
|
+
must not appear in `dependencies`, `peerDependencies`, or `devDependencies`,
|
|
45
|
+
and every import in the provider must be relative.
|
|
46
|
+
|
|
47
|
+
## Credentials
|
|
48
|
+
|
|
49
|
+
The connection declares one operator-managed credential: a scoped Cloudflare
|
|
50
|
+
API token, sent as `Authorization: Bearer <token>`. Create it under My Profile →
|
|
51
|
+
API Tokens → Create Token. Do not use a Global API Key — it carries every
|
|
52
|
+
permission on the account and cannot be scoped.
|
|
53
|
+
|
|
54
|
+
Grant only what the deployment needs:
|
|
55
|
+
|
|
56
|
+
| Tools | Token permission | Scope |
|
|
57
|
+
| --- | --- | --- |
|
|
58
|
+
| `list_zones`, `get_zone` | Zone Read | Zone |
|
|
59
|
+
| `list_dns_records`, `get_dns_record` | DNS Read | Zone |
|
|
60
|
+
| `create_dns_record`, `update_dns_record`, `delete_dns_record` | DNS Write | Zone |
|
|
61
|
+
| `purge_cache` | Cache Purge | Zone |
|
|
62
|
+
| `list_worker_scripts` | Workers Scripts Read | Account |
|
|
63
|
+
| `list_kv_namespaces` | Workers KV Storage Read | Account |
|
|
64
|
+
| `list_r2_buckets` | Workers R2 Storage Read | Account |
|
|
65
|
+
| `list_pages_projects` | Cloudflare Pages Read | Account |
|
|
66
|
+
|
|
67
|
+
Those are the names as they appear in the token editor. "Cache Purge" is a
|
|
68
|
+
single permission with no Read/Write split, and Cloudflare's own reference
|
|
69
|
+
renders a few labels differently between its Dashboard and API tabs — if a name
|
|
70
|
+
above does not match what you see, look for the same noun with the other verb.
|
|
71
|
+
|
|
72
|
+
`verify_api_token` needs no permission beyond the token existing, which is what
|
|
73
|
+
makes it the right first call when something fails. The `/credentials` Test
|
|
74
|
+
action runs the same verification against the candidate token before it is
|
|
75
|
+
stored.
|
|
76
|
+
|
|
77
|
+
Cloudflare rate-limits *authentication failures* aggressively and separately
|
|
78
|
+
from the global limit: a few requests with a bad token return HTTP 429 with
|
|
79
|
+
code `10502`, "Too many authentication failures". That surfaces here as
|
|
80
|
+
`rate_limited`, not `auth_required`, which is correct — the token may well be
|
|
81
|
+
fine by the time the window clears — but it means a broken token should be
|
|
82
|
+
diagnosed once with `verify_api_token` rather than by retrying real calls.
|
|
83
|
+
|
|
84
|
+
## Scoping
|
|
85
|
+
|
|
86
|
+
`zoneId` and `accountId` are deployment defaults, not restrictions. When a
|
|
87
|
+
default is set, the corresponding argument drops out of the tool's `required`
|
|
88
|
+
list and calls that omit it use the default; a call may still pass a different
|
|
89
|
+
id. When no default is set, the argument is required and the schema's own
|
|
90
|
+
description names the discovery tool that produces it — `list_zones` for a
|
|
91
|
+
zone, `list_accounts` for an account.
|
|
92
|
+
|
|
93
|
+
That is the discovery flow worth knowing: Cloudflare addresses almost
|
|
94
|
+
everything by an opaque 32-character id, and an agent that only knows a domain
|
|
95
|
+
name must call `list_zones` with `name: "example.com"` first. Configuring
|
|
96
|
+
`zoneId` removes that hop entirely for a single-zone deployment.
|
|
97
|
+
|
|
98
|
+
`list_zones` is the one tool a configured `accountId` deliberately does *not*
|
|
99
|
+
reach. It is the discovery step, and a default that quietly filtered it would
|
|
100
|
+
be a restriction in all but name — one with no argument that escapes it, since
|
|
101
|
+
an empty `accountId` would fall back to the default again. A deployment that
|
|
102
|
+
wants zones from one account passes `accountId` explicitly, and the property
|
|
103
|
+
says so.
|
|
104
|
+
|
|
105
|
+
## Tools
|
|
106
|
+
|
|
107
|
+
Ten reads, all annotated `readOnlyHint: true` and therefore admissible from
|
|
108
|
+
`call_tool` and `execute_code`:
|
|
109
|
+
|
|
110
|
+
`verify_api_token`, `list_accounts`, `list_zones`, `get_zone`,
|
|
111
|
+
`list_dns_records`, `get_dns_record`, `list_worker_scripts`,
|
|
112
|
+
`list_kv_namespaces`, `list_r2_buckets`, `list_pages_projects`.
|
|
113
|
+
|
|
114
|
+
Four writes, all routed through `call_destructive_tool`:
|
|
115
|
+
|
|
116
|
+
- `create_dns_record` is additive and leaves `destructiveHint` unset —
|
|
117
|
+
`readOnlyHint: false` already routes it for approval, and asserting
|
|
118
|
+
destruction only inflates the copy a human sees.
|
|
119
|
+
- `update_dns_record`, `delete_dns_record`, and `purge_cache` change or discard
|
|
120
|
+
live state and are annotated `destructiveHint: true`.
|
|
121
|
+
|
|
122
|
+
Every tool carries a complete hand-written input schema: closed
|
|
123
|
+
(`additionalProperties: false`), with an accurate `required` list, an `enum` on
|
|
124
|
+
every constrained field, per-endpoint `perPage` bounds, and a description on
|
|
125
|
+
every property — the last of which `test/cloudflare-provider.test.ts` asserts
|
|
126
|
+
rather than leaves as a claim. This is the point of the connection. A generated
|
|
127
|
+
wrapper around the same API exposed `arguments?: {}[]` in its compact schema and
|
|
128
|
+
pushed the real parameter list into operation documentation, so an agent had to
|
|
129
|
+
read a doc page before it could make a call. Here the compact schema is enough.
|
|
130
|
+
|
|
131
|
+
### Where the `perPage` bounds come from
|
|
132
|
+
|
|
133
|
+
`strictValidation` is on, so an out-of-range `perPage` is refused locally
|
|
134
|
+
before it reaches Cloudflare. That is only a favor when the bound is really
|
|
135
|
+
Cloudflare's, so the schemas record which ones are and the descriptions say so
|
|
136
|
+
out loud:
|
|
137
|
+
|
|
138
|
+
| Tool | `perPage` | Default | Whose bound |
|
|
139
|
+
| --- | --- | --- | --- |
|
|
140
|
+
| `list_accounts`, `list_zones` | 5–50 | 20 | Cloudflare's, as documented |
|
|
141
|
+
| `list_kv_namespaces` | 1–1000 | 20 | Cloudflare's, as documented |
|
|
142
|
+
| `list_dns_records` | 1–1000 | 100 | Cloudflare's minimum; the ceiling is ours |
|
|
143
|
+
| `list_pages_projects` | 1–100 | — | Ours entirely |
|
|
144
|
+
|
|
145
|
+
Two need the note. Cloudflare's schema documents `per_page` on
|
|
146
|
+
`/zones/{id}/dns_records` as 1 to **5,000,000** — a nominal ceiling no listing
|
|
147
|
+
will honor — so this connection caps it at 1,000, the same conservative-reading
|
|
148
|
+
move as the [one-variant purge rule](#cache-purging): a local cap an agent is
|
|
149
|
+
told about beats a page size that fails somewhere inside Cloudflare. And
|
|
150
|
+
`/accounts/{id}/pages/projects` documents no bounds and no default at all, so
|
|
151
|
+
1 to 100 is a choice made here and labeled as one.
|
|
152
|
+
|
|
153
|
+
### DNS record types
|
|
154
|
+
|
|
155
|
+
Cloudflare accepts 21 record types, exported as `CLOUDFLARE_DNS_RECORD_TYPES`.
|
|
156
|
+
Eight of them take a single `content` string; the other thirteen (CAA, CERT,
|
|
157
|
+
DNSKEY, DS, HTTPS, LOC, NAPTR, SMIMEA, SRV, SSHFP, SVCB, TLSA, URI) take a
|
|
158
|
+
per-type structured `data` object with its own field set.
|
|
159
|
+
|
|
160
|
+
`list_dns_records` filters on all 21. `create_dns_record` and
|
|
161
|
+
`update_dns_record` accept only the eight content-based types, exported as
|
|
162
|
+
`CLOUDFLARE_CONTENT_DNS_RECORD_TYPES`. Supporting the rest would mean either a
|
|
163
|
+
free-form `data` passthrough — the untyped `{}` this connection exists to
|
|
164
|
+
avoid — or thirteen more hand-written schemas for record types that are rare in
|
|
165
|
+
day-to-day zone administration. Structured-data records stay fully readable;
|
|
166
|
+
only creating and updating them is out of scope, and the enum says so rather
|
|
167
|
+
than letting the call reach Cloudflare and 400.
|
|
168
|
+
|
|
169
|
+
### Cache purging
|
|
170
|
+
|
|
171
|
+
`purge_cache` takes exactly one variant per call: `everything: true`, or one of
|
|
172
|
+
`files`, `tags`, `hosts`, or `prefixes`. Cloudflare caps a purge at 100
|
|
173
|
+
operations per request (500 files on Enterprise), and all four targeted methods
|
|
174
|
+
are available on every plan — tag, host, and prefix purging is no longer
|
|
175
|
+
Enterprise-only.
|
|
176
|
+
|
|
177
|
+
The one-variant rule is this connection's contract, not a documented API
|
|
178
|
+
restriction. Cloudflare's schema models the body as `anyOf`, which does not
|
|
179
|
+
forbid combining, and the only explicit exclusivity statement in its
|
|
180
|
+
documentation is about the Workers cache binding rather than the REST endpoint.
|
|
181
|
+
Refusing a combined call locally is the conservative reading: an agent gets a
|
|
182
|
+
clear `invalid_args` naming the conflict instead of a purge whose actual scope
|
|
183
|
+
is ambiguous. If a future deployment needs combined tag-and-prefix purging,
|
|
184
|
+
that is a deliberate change to make here, not something to discover in
|
|
185
|
+
production.
|
|
186
|
+
|
|
187
|
+
## Results
|
|
188
|
+
|
|
189
|
+
Reads return Cloudflare's `result` unwrapped and projected: identity and
|
|
190
|
+
description fields kept, plan/permission/meta noise dropped, `snake_case`
|
|
191
|
+
renamed to `camelCase`. A zone comes back as `id`, `name`, `status`, `paused`,
|
|
192
|
+
`type`, `accountId`, `accountName`, `plan`, `nameServers`, and timestamps —
|
|
193
|
+
not the forty-field object Cloudflare sends.
|
|
194
|
+
|
|
195
|
+
Paginated lists add a `page` object derived from `result_info`:
|
|
196
|
+
`{ page, perPage, count, totalCount, totalPages, hasMore }`. `hasMore` is the
|
|
197
|
+
field to branch on.
|
|
198
|
+
|
|
199
|
+
Two endpoints do not work that way, and the schemas say so rather than leaving
|
|
200
|
+
an agent to discover it. `list_r2_buckets` paginates by cursor: its
|
|
201
|
+
`result_info` carries only a cursor, so it returns `nextCursor` instead of
|
|
202
|
+
`page`, and the next call passes it back as `cursor`. `list_worker_scripts`
|
|
203
|
+
reports no counters at all and omits `page` entirely.
|
|
204
|
+
|
|
205
|
+
Every read accepts `raw: true`, which returns the unprojected result for the
|
|
206
|
+
case where a dropped field genuinely matters. It is an escape hatch, not a
|
|
207
|
+
default: the raw shapes are large enough to hit a deployment's result cap.
|
|
208
|
+
|
|
209
|
+
## Typed failures
|
|
210
|
+
|
|
211
|
+
Cloudflare's error envelope carries an array of `{ code, message }` entries and
|
|
212
|
+
sometimes a nested `error_chain`; the connection flattens the whole chain into
|
|
213
|
+
the failure message so the provider's own code number survives to the agent.
|
|
214
|
+
|
|
215
|
+
| Cloudflare | Connecta failure | Agent behavior |
|
|
216
|
+
| --- | --- | --- |
|
|
217
|
+
| 429 | `rate_limited`, retryable | Waits `retryAfterMs` — the `retry-after` header when present, otherwise the full five-minute window |
|
|
218
|
+
| 401 or 403 | `auth_required`, not retryable | Stops and reports which permission is missing |
|
|
219
|
+
| 400 with a credential-shaped code (1001, 6003, 6111, 9103, 9106, 9107) | `auth_required`, not retryable | Stops; the header or key is malformed, not the arguments |
|
|
220
|
+
| 400, 409, 422 | `invalid_args`, not retryable | Repairs the arguments |
|
|
221
|
+
| 404 | `connector_call_failed`, not retryable | Re-runs discovery for the id |
|
|
222
|
+
| 5xx or a transport error | `unavailable`, retryable | Retries |
|
|
223
|
+
|
|
224
|
+
The six credential-shaped codes deserve a caveat: Cloudflare publishes no
|
|
225
|
+
official table mapping error codes to causes, so that set is assembled from
|
|
226
|
+
community reports and probing, not from documentation. The same goes for the
|
|
227
|
+
claim below that `10000` is overloaded — that is an observation about responses
|
|
228
|
+
seen in practice. Treat both as well-supported readings that Cloudflare could
|
|
229
|
+
invalidate without notice, and prefer `verify_api_token` over the code list
|
|
230
|
+
when a diagnosis actually matters.
|
|
231
|
+
|
|
232
|
+
Two ordering decisions are deliberate. The 429 branch is checked before the
|
|
233
|
+
authentication codes, because Cloudflare reuses the generic `10000` code on
|
|
234
|
+
throttled responses and reading a rate limit as an auth failure would tell an
|
|
235
|
+
agent to stop when it should wait. And `10000` is *not* itself treated as an
|
|
236
|
+
auth code: Cloudflare returns it for "Authentication error" but also for
|
|
237
|
+
ordinary validation failures like "Invalid pagination cursor" and
|
|
238
|
+
"domain_name is required", so routing on it would tell an agent its token was
|
|
239
|
+
broken when its arguments were. Genuine `10000` auth failures arrive with 401
|
|
240
|
+
or 403 and are caught by status.
|
|
241
|
+
|
|
242
|
+
Because the connection declares an operator-managed credential rather than an
|
|
243
|
+
OAuth flow, an `auth_required` failure resolves to the `operator_config`
|
|
244
|
+
recovery mode — the fix is a human updating the token, not an authorization
|
|
245
|
+
URL the agent can open. A missing token fails that way before any request is
|
|
246
|
+
made.
|
|
247
|
+
|
|
248
|
+
Some failures never reach Cloudflare at all. A blank scope id, a `purge_cache`
|
|
249
|
+
call with no variant or two, and an `update_dns_record` with nothing to change
|
|
250
|
+
are all refused locally as `invalid_args` with a validation issue attached,
|
|
251
|
+
because a round trip that can only 400 is a wasted call and a worse
|
|
252
|
+
explanation.
|
|
253
|
+
|
|
254
|
+
## Rate limits
|
|
255
|
+
|
|
256
|
+
Cloudflare documents a global limit of
|
|
257
|
+
[1,200 requests per five minutes per user](https://developers.cloudflare.com/fundamentals/api/reference/limits/),
|
|
258
|
+
counted cumulatively across the dashboard, API keys, and API tokens. The
|
|
259
|
+
connection declares a matching rolling-window admission budget plus a
|
|
260
|
+
`maxConcurrency` of 6, overridable with the `maxConcurrency` option.
|
|
261
|
+
|
|
262
|
+
The budget is a best-effort approximation of the per-user limit, not an
|
|
263
|
+
enforcement of it. Each runtime keeps its own counter, so N Worker isolates or
|
|
264
|
+
Node processes serving one deployment can each admit up to 1,200 — and the
|
|
265
|
+
dashboard traffic of a human sharing the account is counted by Cloudflare but
|
|
266
|
+
not by Connecta. `maxConcurrency` is the bound that actually protects a shared
|
|
267
|
+
token, because a single `execute_code` program can fan out far faster than the
|
|
268
|
+
window notices.
|
|
@@ -209,7 +209,7 @@ documented functions as the whole surface.
|
|
|
209
209
|
```js
|
|
210
210
|
const page = await connecta.search({
|
|
211
211
|
query: "pipeline run job logs", // 2–4 distinctive action/object terms
|
|
212
|
-
connector: "ci", //
|
|
212
|
+
connector: "ci", // load one obvious connector, not every catalog
|
|
213
213
|
safety: "readOnly", // or "approvalRequired" / "all"
|
|
214
214
|
limit: 8, // 1–100, default 8
|
|
215
215
|
offset: 0,
|
|
@@ -221,12 +221,12 @@ const page = await connecta.search({
|
|
|
221
221
|
|
|
222
222
|
**S1.** Returns one flat page: `{ tools, total, offset, limit, hasMore }`, plus `nextOffset` when more remains and `matchMode: "partial"` when no tool matched every term. Each entry in `tools` carries `address`, `name`, and — when requested — `description`, `inputSchema`, `outputSchema`, `annotations`, and the connector's `guide`. Compact shapes omit property prose, put required fields first, and cap each shape at 1,024 UTF-8 bytes; capped shapes remain structurally valid with `unknown` types plus `/* truncated */`, and carry `inputSchemaTruncated` or `outputSchemaTruncated`. Use `connecta.describe` (or JSON search) for omitted exact constraints.
|
|
223
223
|
|
|
224
|
-
**S1a.** `safety: "readOnly"` returns exactly the tools available through `connecta.call`, connector shortcuts, and `connecta.batch`; `"approvalRequired"` returns the complementary fail-closed class, including false, missing, and contradictory annotations. Omitted or `"all"` preserves the complete catalog.
|
|
224
|
+
**S1a.** `connector` loads only the named catalog; omit it only when the integration is ambiguous, because an unscoped search fans out across every configured connector. `safety: "readOnly"` returns exactly the tools available through `connecta.call`, connector shortcuts, and `connecta.batch`; `"approvalRequired"` returns the complementary fail-closed class, including false, missing, and contradictory annotations. Omitted or `"all"` preserves the complete catalog. These filters grant no authority and change no admission decision.
|
|
225
225
|
|
|
226
|
-
**S2.**
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
**S2.** A requested object schema carries `inputKeys`, `requiredInputKeys`, and `outputKeys`:
|
|
227
|
+
the same names the rendered schema shows, ready to check before
|
|
228
|
+
building arguments. Match inputs, truncation, safety, and outputs, not lexical
|
|
229
|
+
rank; search distinct operations separately and use `outputKeys`, not guessed roots. A non-object schema — a union, an array, an
|
|
230
230
|
unresolvable `$ref` — carries no lists rather than empty ones, because absent
|
|
231
231
|
means "read the schema" where `[]` would claim the tool takes no fields. The
|
|
232
232
|
lists come from the same walk that renders the compact schema, so a top-level
|
|
@@ -1,15 +1,122 @@
|
|
|
1
1
|
# Connectors
|
|
2
2
|
|
|
3
3
|
Connectors are the boundary between Connecta's fixed meta-tool surface and
|
|
4
|
-
downstream capabilities.
|
|
5
|
-
`
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
downstream capabilities. Prefer a prebuilt connection when Connecta maintains
|
|
5
|
+
one for the provider. Use `api()` to define a deliberate HTTP API surface and
|
|
6
|
+
`remoteMcp()` to aggregate any other MCP endpoint. All three authoring paths
|
|
7
|
+
produce ordinary `Connector` instances and pass through the same catalog,
|
|
8
|
+
read-only admission, credentials, storage, invocation, result-size, and
|
|
9
|
+
activity paths.
|
|
8
10
|
|
|
9
11
|
Connector instances are deployment configuration. They are not registered or
|
|
10
12
|
reconfigured at runtime. Request-local clients, transports, abort signals, and
|
|
11
13
|
catalogs must be released with the request that created them.
|
|
12
14
|
|
|
15
|
+
## Prebuilt connections
|
|
16
|
+
|
|
17
|
+
A prebuilt connection is an independently imported provider constructor, not a
|
|
18
|
+
registry or a second connector interface. It packages behavior Connecta can
|
|
19
|
+
maintain universally: provider endpoints and authentication defaults, tool
|
|
20
|
+
definitions or downstream catalog behavior, schemas and annotations, lean
|
|
21
|
+
result shapes, typed errors, pagination and retry conventions, and a short
|
|
22
|
+
usage guide where schemas cannot carry the advice.
|
|
23
|
+
|
|
24
|
+
The deployment still supplies the account-specific identity and policy:
|
|
25
|
+
|
|
26
|
+
- a unique connector `id`, which owns its address, storage, credential,
|
|
27
|
+
catalog, admission, and activity namespaces;
|
|
28
|
+
- a human-readable `title` and a concrete `purpose` or audience;
|
|
29
|
+
- supported authentication overrides; and
|
|
30
|
+
- account-specific instructions appended to, rather than replacing, the safe
|
|
31
|
+
provider guidance.
|
|
32
|
+
|
|
33
|
+
Imports and registration stay explicit and a la carte:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { mixpanel } from "@zackbart/connecta/providers/mixpanel";
|
|
37
|
+
|
|
38
|
+
const analytics = mixpanel("product_analytics", {
|
|
39
|
+
title: "Product analytics",
|
|
40
|
+
purpose: "Production product decisions for the growth team",
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The constructor may use `remoteMcp()` or `api()` internally. Callers should not
|
|
45
|
+
need to care which transport gives the better agent-facing surface, and the
|
|
46
|
+
choice does not grant the connection different runtime privileges. Two
|
|
47
|
+
instances of the same provider are isolated in exactly the same way as two
|
|
48
|
+
hand-written connectors with different ids.
|
|
49
|
+
|
|
50
|
+
A prebuilt connection's vetted annotations are fill-in only. They classify what
|
|
51
|
+
the downstream leaves unannotated and do not argue with what it states — not an
|
|
52
|
+
explicit `destructiveHint: true` or `readOnlyHint: false` on a name the
|
|
53
|
+
connection files as a read, nor an explicit `readOnlyHint: true` on a name no
|
|
54
|
+
release has classified at all. Silence on an unclassified name still means not
|
|
55
|
+
read-only, so catalog drift fails closed. The fail-closed read-only invariant
|
|
56
|
+
is unchanged by the authoring path.
|
|
57
|
+
|
|
58
|
+
Prebuilt means preferred when available, not mandatory. A deployment may mix
|
|
59
|
+
prebuilt connections, custom `remoteMcp()` connections, and custom `api()`
|
|
60
|
+
connections. Connecta makes no completeness promise: providers without a
|
|
61
|
+
maintained prebuilt connection continue to use the public primitives without
|
|
62
|
+
loss of support.
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
import { createConnecta, remoteMcp, api } from "@zackbart/connecta";
|
|
66
|
+
import { mixpanel } from "@zackbart/connecta/providers/mixpanel";
|
|
67
|
+
import { quickJsExecutor } from "@zackbart/connecta/quickjs";
|
|
68
|
+
|
|
69
|
+
export const connecta = createConnecta({
|
|
70
|
+
executor: quickJsExecutor(),
|
|
71
|
+
connectors: [
|
|
72
|
+
// Maintained prebuilt connection.
|
|
73
|
+
mixpanel("product_analytics", {
|
|
74
|
+
purpose: "Production product decisions for the growth team",
|
|
75
|
+
}),
|
|
76
|
+
// Custom downstream MCP server, no prebuilt connection needed.
|
|
77
|
+
remoteMcp("deploy_tools", {
|
|
78
|
+
url: "https://mcp.internal.example/deploys",
|
|
79
|
+
description: "In-house deployment and rollback tooling",
|
|
80
|
+
}),
|
|
81
|
+
// Deliberate in-house HTTP surface, hand-written tool by hand-written tool.
|
|
82
|
+
api("billing", {
|
|
83
|
+
description: "Internal billing reads",
|
|
84
|
+
credential: { label: "Billing API token" },
|
|
85
|
+
tools: [
|
|
86
|
+
{
|
|
87
|
+
name: "get_invoice",
|
|
88
|
+
description: "Fetch one invoice by id.",
|
|
89
|
+
annotations: { readOnlyHint: true },
|
|
90
|
+
inputSchema: {
|
|
91
|
+
type: "object",
|
|
92
|
+
properties: { id: { type: "string" } },
|
|
93
|
+
required: ["id"],
|
|
94
|
+
},
|
|
95
|
+
handler: async ({ id }, ctx) => {
|
|
96
|
+
const response = await fetch(
|
|
97
|
+
`https://billing.internal.example/invoices/${id}`,
|
|
98
|
+
{ headers: { Authorization: `Bearer ${await ctx.credential?.get()}` } },
|
|
99
|
+
);
|
|
100
|
+
return response.json();
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
}),
|
|
105
|
+
],
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
All three are ordinary `Connector` instances by the time the registry sees
|
|
110
|
+
them. Nothing in the list is privileged by how it was authored.
|
|
111
|
+
|
|
112
|
+
Maintained provider guides:
|
|
113
|
+
|
|
114
|
+
- [Cloudflare](./cloudflare.md)
|
|
115
|
+
- [Linear](./linear.md)
|
|
116
|
+
- [Mixpanel](./mixpanel.md)
|
|
117
|
+
- [Notion](./notion.md)
|
|
118
|
+
- [Stripe](./stripe.md)
|
|
119
|
+
|
|
13
120
|
## MCP version skew
|
|
14
121
|
|
|
15
122
|
Connecta deliberately sits between protocol generations
|
|
@@ -53,6 +160,17 @@ Tool calls must use the shared invocation path. That keeps direct calls, batch
|
|
|
53
160
|
children, and code-mode host calls aligned on safety, retries, admission,
|
|
54
161
|
timeouts, validation, result guards, and typed failures.
|
|
55
162
|
|
|
163
|
+
Connector usage guides are configuration too. `usageGuide` accepts the
|
|
164
|
+
historical markdown string or `{ content, summary?, required? }`; the latter
|
|
165
|
+
lets discovery explain what the guide covers without loading it. The summary
|
|
166
|
+
is only a bounded routing hint. Mark a guide `required` only when no complete
|
|
167
|
+
tool schema can describe correct use, such as a generic operation wrapper or a
|
|
168
|
+
mandatory cross-tool sequence. Mutations and truncated compact schemas already
|
|
169
|
+
produce automatic review requirements. Two deployments may reuse the same
|
|
170
|
+
constant and override its summary or requirement in their own config, but
|
|
171
|
+
Connecta stores no runtime template and never lets one deployment's guide apply
|
|
172
|
+
to another.
|
|
173
|
+
|
|
56
174
|
For remote MCP tools, that path checks the catalog's advertised `inputSchema`
|
|
57
175
|
before provider dispatch. Supported mismatches become bounded, payload-free
|
|
58
176
|
`invalid_args` findings; a schema the local validator cannot evaluate passes
|