@zackbart/connecta 0.14.2 → 0.15.1
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 +89 -0
- package/dist/catalog-service.d.ts.map +1 -1
- package/dist/catalog-service.js +104 -56
- package/dist/catalog-service.js.map +1 -1
- package/dist/catalog.d.ts +8 -2
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +58 -9
- package/dist/catalog.js.map +1 -1
- package/dist/connectors/api.d.ts +4 -4
- package/dist/connectors/api.js +4 -4
- package/dist/execute.d.ts.map +1 -1
- package/dist/execute.js +8 -7
- package/dist/execute.js.map +1 -1
- package/dist/meta-tools.js +1 -1
- package/dist/meta-tools.js.map +1 -1
- package/dist/providers/cloudflare.d.ts +5 -1
- package/dist/providers/cloudflare.d.ts.map +1 -1
- package/dist/providers/cloudflare.js +203 -70
- package/dist/providers/cloudflare.js.map +1 -1
- package/dist/providers/linear.d.ts.map +1 -1
- package/dist/providers/linear.js +4 -3
- package/dist/providers/linear.js.map +1 -1
- package/dist/providers/mixpanel.d.ts.map +1 -1
- package/dist/providers/mixpanel.js +4 -3
- package/dist/providers/mixpanel.js.map +1 -1
- package/dist/providers/stripe.d.ts.map +1 -1
- package/dist/providers/stripe.js +4 -3
- package/dist/providers/stripe.js.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +97 -17
- package/dist/validate.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/documentation/cloudflare.md +37 -19
- package/documentation/code-mode.md +9 -9
- package/documentation/connectors.md +9 -7
- package/documentation/linear.md +6 -7
- package/documentation/meta-tools.md +56 -13
- package/documentation/mixpanel.md +6 -7
- package/documentation/stripe.md +12 -12
- package/ethos.md +2 -1
- package/package.json +1 -1
- package/src/catalog-service.ts +93 -29
- package/src/catalog.ts +71 -8
- package/src/connectors/api.ts +4 -4
- package/src/execute.ts +8 -7
- package/src/meta-tools.ts +1 -1
- package/src/providers/cloudflare.ts +275 -79
- package/src/providers/linear.ts +4 -3
- package/src/providers/mixpanel.ts +4 -3
- package/src/providers/stripe.ts +4 -3
- package/src/validate.ts +125 -20
- package/src/version.ts +1 -1
- package/templates/node/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe.js","sourceRoot":"","sources":["../../src/providers/stripe.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,GAEV,MAAM,6BAA6B,CAAC;AAcrC,iFAAiF;AACjF,MAAM,CAAC,MAAM,mBAAmB,GAAG,yBAAyB,CAAC;AA2B7D;;;;;;;;;GASG;AACH,MAAM,gBAAgB,GAElB;IACF,UAAU,EAAE;QACV,KAAK,EAAE;YACL;gBACE,cAAc,EAAE,CAAC;gBACjB,cAAc,EAAE,KAAK;gBACrB,YAAY,EAAE,KAAK;gBACnB,MAAM,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE;aACnE;SACF;KACF;IACD,OAAO,EAAE;QACP,KAAK,EAAE;YACL;gBACE,cAAc,EAAE,CAAC;gBACjB,cAAc,EAAE,KAAK;gBACrB,YAAY,EAAE,KAAK;gBACnB,MAAM,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE;aAClE;SACF;KACF;CACF,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC9B,mBAAmB;IACnB,oBAAoB;IACpB,iBAAiB;IACjB,yBAAyB;IACzB,qBAAqB;IACrB,6BAA6B;IAC7B,+BAA+B;CAChC,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,MAAM,WAAW,GAAoD,IAAI,GAAG,CAAC;IAC3E,CAAC,kBAAkB,EAAE,aAAa,CAAC;IACnC,CAAC,eAAe,EAAE,aAAa,CAAC;IAChC,CAAC,eAA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G;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAMjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA6PD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,wBAAwB,GAC7B,kBAAkB,GAAG,IAAI,CAyC3B;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,0BAA0B,GAC/B,IAAI,CAQN"}
|
package/dist/validate.js
CHANGED
|
@@ -7,6 +7,17 @@ import { MAX_ARGUMENT_VALIDATION_ISSUES } from "./errors.js";
|
|
|
7
7
|
// connector are collectable, the same pattern compactSchema uses.
|
|
8
8
|
const validators = new WeakMap();
|
|
9
9
|
const REQUIRED_PROPERTY_RE = /^Instance does not have required property "([^"]+)"\.$/;
|
|
10
|
+
const CONTAINER_VALIDATION_KEYWORDS = new Set([
|
|
11
|
+
"properties",
|
|
12
|
+
"items",
|
|
13
|
+
"allOf",
|
|
14
|
+
"anyOf",
|
|
15
|
+
"oneOf",
|
|
16
|
+
"if",
|
|
17
|
+
"not",
|
|
18
|
+
"patternProperties",
|
|
19
|
+
"additionalProperties",
|
|
20
|
+
]);
|
|
10
21
|
function decodePointerPart(value) {
|
|
11
22
|
return value.replaceAll("~1", "/").replaceAll("~0", "~");
|
|
12
23
|
}
|
|
@@ -31,6 +42,85 @@ function argumentPath(location) {
|
|
|
31
42
|
return "/";
|
|
32
43
|
return location.startsWith("#") ? location.slice(1) || "/" : "/";
|
|
33
44
|
}
|
|
45
|
+
function validationUnitKey(unit) {
|
|
46
|
+
return JSON.stringify([
|
|
47
|
+
unit.keyword,
|
|
48
|
+
unit.keywordLocation,
|
|
49
|
+
unit.instanceLocation,
|
|
50
|
+
unit.error,
|
|
51
|
+
]);
|
|
52
|
+
}
|
|
53
|
+
function childPropertyName(parentLocation, childLocation) {
|
|
54
|
+
const prefix = parentLocation === "#" ? "#/" : `${parentLocation}/`;
|
|
55
|
+
if (!childLocation.startsWith(prefix))
|
|
56
|
+
return undefined;
|
|
57
|
+
const encoded = childLocation.slice(prefix.length);
|
|
58
|
+
return !encoded.includes("/") ? decodePointerPart(encoded) : undefined;
|
|
59
|
+
}
|
|
60
|
+
function schemaDeclaresProperty(schema, property) {
|
|
61
|
+
if (schema === null || typeof schema !== "object" || Array.isArray(schema)) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
const record = schema;
|
|
65
|
+
const properties = record.properties;
|
|
66
|
+
if (properties !== null &&
|
|
67
|
+
typeof properties === "object" &&
|
|
68
|
+
!Array.isArray(properties) &&
|
|
69
|
+
Object.hasOwn(properties, property)) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
const patterns = record.patternProperties;
|
|
73
|
+
if (patterns === null ||
|
|
74
|
+
typeof patterns !== "object" ||
|
|
75
|
+
Array.isArray(patterns)) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
for (const pattern of Object.keys(patterns)) {
|
|
79
|
+
try {
|
|
80
|
+
if (new RegExp(pattern).test(property))
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// The validator owns schema support. An unusable pattern cannot prove
|
|
85
|
+
// that this additional-properties branch is a duplicate.
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
function isDuplicateAdditionalPropertiesBranch(schema, units, index) {
|
|
91
|
+
const unit = units[index];
|
|
92
|
+
const wrapper = units[index - 1];
|
|
93
|
+
if (unit?.keyword !== "false" ||
|
|
94
|
+
wrapper?.keyword !== "additionalProperties" ||
|
|
95
|
+
!wrapper.keywordLocation.endsWith("/additionalProperties")) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
const property = childPropertyName(wrapper.instanceLocation, unit.instanceLocation);
|
|
99
|
+
if (property === undefined)
|
|
100
|
+
return false;
|
|
101
|
+
const parentSchemaLocation = wrapper.keywordLocation.slice(0, -"/additionalProperties".length);
|
|
102
|
+
return schemaDeclaresProperty(pointerValue(schema, parentSchemaLocation || "#"), property);
|
|
103
|
+
}
|
|
104
|
+
function normalizedValidationUnits(schema, units) {
|
|
105
|
+
const seen = new Set();
|
|
106
|
+
return units.filter((unit, index) => {
|
|
107
|
+
if (CONTAINER_VALIDATION_KEYWORDS.has(unit.keyword))
|
|
108
|
+
return false;
|
|
109
|
+
if (isDuplicateAdditionalPropertiesBranch(schema, units, index)) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
const key = validationUnitKey(unit);
|
|
113
|
+
if (seen.has(key))
|
|
114
|
+
return false;
|
|
115
|
+
seen.add(key);
|
|
116
|
+
return true;
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function agentFacingValidationError(unit) {
|
|
120
|
+
return unit.keyword === "false"
|
|
121
|
+
? "Value is not allowed by the declared schema."
|
|
122
|
+
: unit.error;
|
|
123
|
+
}
|
|
34
124
|
function expectedType(schema, unit) {
|
|
35
125
|
if (unit.keyword === "type") {
|
|
36
126
|
const value = pointerValue(schema, unit.keywordLocation);
|
|
@@ -66,19 +156,8 @@ function expectedType(schema, unit) {
|
|
|
66
156
|
return fixed[unit.keyword];
|
|
67
157
|
}
|
|
68
158
|
function validationDetails(schema, units) {
|
|
69
|
-
const leafUnits = units.filter((unit) => ![
|
|
70
|
-
"properties",
|
|
71
|
-
"items",
|
|
72
|
-
"allOf",
|
|
73
|
-
"anyOf",
|
|
74
|
-
"oneOf",
|
|
75
|
-
"if",
|
|
76
|
-
"not",
|
|
77
|
-
"patternProperties",
|
|
78
|
-
"additionalProperties",
|
|
79
|
-
].includes(unit.keyword));
|
|
80
159
|
const issues = [];
|
|
81
|
-
for (const unit of
|
|
160
|
+
for (const unit of units) {
|
|
82
161
|
const missing = unit.keyword === "required"
|
|
83
162
|
? REQUIRED_PROPERTY_RE.exec(unit.error)?.[1]
|
|
84
163
|
: undefined;
|
|
@@ -164,12 +243,13 @@ export function validateToolInput(schema, args, opts) {
|
|
|
164
243
|
return opts.failClosed ? unevaluableSchema(opts.address) : null;
|
|
165
244
|
}
|
|
166
245
|
if (result && !result.valid) {
|
|
167
|
-
const units = result.errors
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
.
|
|
246
|
+
const units = normalizedValidationUnits(schema, result.errors);
|
|
247
|
+
const nestedUnits = units.filter((unit) => unit.instanceLocation !== "#");
|
|
248
|
+
const detail = (nestedUnits.length > 0 ? nestedUnits : units)
|
|
249
|
+
.slice(0, MAX_ARGUMENT_VALIDATION_ISSUES)
|
|
250
|
+
.map((unit) => `${unit.instanceLocation}: ${agentFacingValidationError(unit)}`)
|
|
171
251
|
.join("; ");
|
|
172
|
-
return new ConnectorCallError("invalid_args", `Invalid arguments for "${opts.address}": ${detail || "input does not match the tool's inputSchema"}`, { validation: validationDetails(schema,
|
|
252
|
+
return new ConnectorCallError("invalid_args", `Invalid arguments for "${opts.address}": ${detail || "input does not match the tool's inputSchema"}`, { validation: validationDetails(schema, units) });
|
|
173
253
|
}
|
|
174
254
|
return null;
|
|
175
255
|
}
|
package/dist/validate.js.map
CH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AAC,CAAC;IAC3E,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;IACvD,CAAC;AACH,CAAC"}
|
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.15.1";
|
|
8
8
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -23,6 +23,18 @@ const edge = cloudflare("cloudflare_prod", {
|
|
|
23
23
|
});
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
Use the legacy user-scoped Global API Key when an existing deployment needs it:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
const legacyEdge = cloudflare("cloudflare_legacy", {
|
|
30
|
+
purpose: "Legacy account administration",
|
|
31
|
+
authentication: "globalApiKey",
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The operator UI then asks for the Cloudflare user email and Global API Key as
|
|
36
|
+
separate fields. The default remains a scoped API token.
|
|
37
|
+
|
|
26
38
|
The `id` owns the ordinary connector namespaces; use a different id for every
|
|
27
39
|
Cloudflare account or estate. `purpose` is required because an agent choosing
|
|
28
40
|
between a production and a staging instance needs to know which one answers the
|
|
@@ -40,7 +52,7 @@ dependency would cost is real — an optional peer with its own install step and
|
|
|
40
52
|
version skew, an import that never belongs in the root graph, and a second
|
|
41
53
|
opinion about what a Cloudflare call looks like.
|
|
42
54
|
|
|
43
|
-
The API itself does not need one. It is
|
|
55
|
+
The API itself does not need one. It is authenticated `fetch` with a uniform
|
|
44
56
|
`{ success, errors, messages, result, result_info }` response envelope. JSON,
|
|
45
57
|
raw bytes, and multipart request bodies all use Web APIs, which keeps the
|
|
46
58
|
provider Workers-clean and means `@zackbart/connecta/providers/cloudflare`
|
|
@@ -51,10 +63,16 @@ must be relative.
|
|
|
51
63
|
|
|
52
64
|
## Credentials
|
|
53
65
|
|
|
54
|
-
The
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
The default credential is a scoped Cloudflare API token, sent as
|
|
67
|
+
`Authorization: Bearer <token>`. Create it under My Profile → API Tokens →
|
|
68
|
+
Create Token.
|
|
69
|
+
|
|
70
|
+
Set `authentication: "globalApiKey"` to use the legacy user-scoped scheme. The
|
|
71
|
+
credential form stores two encrypted fields and sends them as `X-Auth-Email`
|
|
72
|
+
and `X-Auth-Key`. The Global API Key has the same access as its Cloudflare user
|
|
73
|
+
across every account and zone that user can reach. It cannot be scoped, only
|
|
74
|
+
one can exist per user, and it has no expiry or IP limits. Cloudflare recommends
|
|
75
|
+
API tokens for new use, but existing Global API Keys remain supported.
|
|
58
76
|
|
|
59
77
|
Grant only what the deployment needs:
|
|
60
78
|
|
|
@@ -83,10 +101,9 @@ scope. "Cache Purge" is a single permission with no Read/Write split, and
|
|
|
83
101
|
Cloudflare's own reference renders a few labels differently between its
|
|
84
102
|
Dashboard and API tabs.
|
|
85
103
|
|
|
86
|
-
`verify_api_token` needs no permission beyond the token existing
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
stored.
|
|
104
|
+
`verify_api_token` needs no permission beyond the token existing. In legacy
|
|
105
|
+
mode, `verify_global_api_key` reads `/user` to confirm the email and key pair.
|
|
106
|
+
The `/credentials` Test action runs the matching check before storage.
|
|
90
107
|
|
|
91
108
|
Cloudflare rate-limits *authentication failures* aggressively and separately
|
|
92
109
|
from the global limit: a few requests with a bad token return HTTP 429 with
|
|
@@ -146,7 +163,8 @@ method classification into user input:
|
|
|
146
163
|
default; `responseType: "text" | "base64"` retrieves scripts, logs, R2
|
|
147
164
|
objects, and media bodies without pretending they have a JSON envelope.
|
|
148
165
|
- `cloudflare_api_mutate` accepts JSON POST, PUT, PATCH, and DELETE. It is always
|
|
149
|
-
destructive, even when a particular POST is merely additive.
|
|
166
|
+
destructive, even when a particular POST is merely additive. It preserves
|
|
167
|
+
ordinary non-envelope JSON from endpoints such as `/graphql`.
|
|
150
168
|
- `cloudflare_api_upload` accepts POST or PUT plus exactly one of raw text,
|
|
151
169
|
base64 bytes, or multipart fields/files. It is always destructive and reads
|
|
152
170
|
no local files.
|
|
@@ -160,7 +178,7 @@ Paths are relative to `/client/v4`. Absolute URLs, protocol-relative paths,
|
|
|
160
178
|
`..` traversal, fragments, and embedded query strings are refused locally;
|
|
161
179
|
query parameters are explicit name/value pairs. These tools reuse the same
|
|
162
180
|
credential, admission budget, abort signal, envelope parsing, and typed failure
|
|
163
|
-
mapping as named tools. They do not widen the
|
|
181
|
+
mapping as named tools. They do not widen the configured credential's access.
|
|
164
182
|
|
|
165
183
|
This is intentionally not OpenAPI ingestion: it creates three stable tools,
|
|
166
184
|
not one tool per Cloudflare operation. For example, an agent can list Images at
|
|
@@ -271,8 +289,8 @@ official table mapping error codes to causes, so that set is assembled from
|
|
|
271
289
|
community reports and probing, not from documentation. The same goes for the
|
|
272
290
|
claim below that `10000` is overloaded — that is an observation about responses
|
|
273
291
|
seen in practice. Treat both as well-supported readings that Cloudflare could
|
|
274
|
-
invalidate without notice
|
|
275
|
-
when a diagnosis
|
|
292
|
+
invalidate without notice. Prefer `verify_api_token` or
|
|
293
|
+
`verify_global_api_key`, as configured, when a diagnosis matters.
|
|
276
294
|
|
|
277
295
|
Two ordering decisions are deliberate. The 429 branch is checked before the
|
|
278
296
|
authentication codes, because Cloudflare reuses the generic `10000` code on
|
|
@@ -280,15 +298,15 @@ throttled responses and reading a rate limit as an auth failure would tell an
|
|
|
280
298
|
agent to stop when it should wait. And `10000` is *not* itself treated as an
|
|
281
299
|
auth code: Cloudflare returns it for "Authentication error" but also for
|
|
282
300
|
ordinary validation failures like "Invalid pagination cursor" and
|
|
283
|
-
"domain_name is required", so routing on it would tell an agent its
|
|
301
|
+
"domain_name is required", so routing on it would tell an agent its credential was
|
|
284
302
|
broken when its arguments were. Genuine `10000` auth failures arrive with 401
|
|
285
303
|
or 403 and are caught by status.
|
|
286
304
|
|
|
287
305
|
Because the connection declares an operator-managed credential rather than an
|
|
288
306
|
OAuth flow, an `auth_required` failure resolves to the `operator_config`
|
|
289
|
-
recovery mode — the fix is a human updating the
|
|
290
|
-
URL the agent can open. A missing
|
|
291
|
-
made.
|
|
307
|
+
recovery mode — the fix is a human updating the credential, not an authorization
|
|
308
|
+
URL the agent can open. A missing credential fails that way before any request
|
|
309
|
+
is made.
|
|
292
310
|
|
|
293
311
|
Some failures never reach Cloudflare at all. A blank scope id, a `purge_cache`
|
|
294
312
|
call with no variant or two, and an `update_dns_record` with nothing to change
|
|
@@ -309,5 +327,5 @@ enforcement of it. Each runtime keeps its own counter, so N Worker isolates or
|
|
|
309
327
|
Node processes serving one deployment can each admit up to 1,200 — and the
|
|
310
328
|
dashboard traffic of a human sharing the account is counted by Cloudflare but
|
|
311
329
|
not by Connecta. `maxConcurrency` is the bound that actually protects a shared
|
|
312
|
-
|
|
313
|
-
window notices.
|
|
330
|
+
credential, because a single `execute_code` program can fan out far faster than
|
|
331
|
+
the window notices.
|
|
@@ -219,21 +219,21 @@ const page = await connecta.search({
|
|
|
219
219
|
});
|
|
220
220
|
```
|
|
221
221
|
|
|
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
|
|
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. Top-level `search_tools` is different: it returns `{ connectors: [{ id, tools }], total, offset, limit, hasMore }`. Complete matches normally precede partial matches, but a partial candidate whose complete normalized tool name occurs in the normalized raw query competes by score; conversational cleanup applies only to scoring terms. Other candidates covering at least two terms fill the page after every complete match; when no complete match exists, the existing any-term fallback remains. Each entry in `tools` carries `address`, `name`, and — when requested — `description`, `inputSchema`, `outputSchema`, `annotations`, and the connector's `guide`. Tool rows expose neither lexical scores nor per-result coverage. An empty or whitespace-only query browses. Non-empty input with no ASCII lexical terms returns no tools and bounded no-match analysis; mixed input searches with its ASCII terms. Compact shapes omit property prose, put required fields first, and cap each shape at 1,024 UTF-8 bytes. Each enum node gets 256 of those bytes. About three near-cap enum nodes can therefore coexist while leaving the final quarter for surrounding syntax; the unchanged global fallback still applies above 1,024 bytes. A capped enum preserves whole values before `unknown` and an exact omitted-value count, while an empty enum renders as `never`. Either cap carries `inputSchemaTruncated` or `outputSchemaTruncated`; a shape-wide cap remains structurally valid with `unknown` types plus `/* truncated */`. Small enums remain complete. Use `connecta.describe` (or JSON search) for omitted exact constraints.
|
|
223
223
|
|
|
224
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.** 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
|
|
226
|
+
**S2.** A requested object schema carries `inputKeys`, `requiredInputKeys`, and `outputKeys`: the same names the rendered schema shows, ready to check before building arguments. Match inputs, truncation, safety, and outputs, not lexical
|
|
229
227
|
rank; search distinct operations separately and use `outputKeys`, not guessed roots. A non-object schema — a union, an array, an
|
|
230
228
|
unresolvable `$ref` — carries no lists rather than empty ones, because absent
|
|
231
229
|
means "read the schema" where `[]` would claim the tool takes no fields. The
|
|
232
230
|
lists come from the same walk that renders the compact schema, so a top-level
|
|
233
231
|
`$ref` resolves and an `allOf` composes rather than reporting an empty list
|
|
234
|
-
beside a schema that plainly shows fields
|
|
235
|
-
|
|
236
|
-
|
|
232
|
+
beside a schema that plainly shows fields. A zero-input object keeps `inputKeys:
|
|
233
|
+
[]` and `requiredInputKeys: []`; an output object with no declared properties
|
|
234
|
+
omits `outputKeys` because it declares no useful inventory. A
|
|
235
|
+
truncated schema omits the corresponding key list rather than repeating a
|
|
236
|
+
large partial inventory. `search_tools`
|
|
237
237
|
carries the same metadata whenever schemas are requested. Code-mode callers
|
|
238
238
|
can set `includeSchemaKeys: false` to buy the bytes back.
|
|
239
239
|
|
|
@@ -384,7 +384,7 @@ type beats keeping the prose.
|
|
|
384
384
|
|
|
385
385
|
**E7.** `retryable` for `unknown_address`, `unknown_tool`, `ambiguous_tool_alias`, and `destructive_tool_requires_approval` is pinned false, never inferred from an address containing `503`, `429`, or `temporar`. The first two carry `nextAction: { function: "connecta.search", arguments: { query, connector?, includeSchemas: "compact" } }` — the same scoped discovery the top-level record names, keyed to the surface the caller actually has. A program cannot call `search_tools`, so it is never told to. Both the message and the derived `query` clamp the address to 512 UTF-8 bytes with a `…` marker: the address is caller-authored and lands in the message, the query, the text content, and `structuredContent`, so an invented 50 KB one would otherwise produce a refusal orders of magnitude past the deployment's result cap. A clipped address still identifies the mistake; a short one — the common case — is exact and untagged.
|
|
386
386
|
|
|
387
|
-
**E8.** A remote MCP tool whose advertised schema rejects the call fails before provider dispatch with `invalid_args`, carrying bounded, value-free `{ path, code, expected }` findings and scoped search recovery keyed `function: "connecta.search"` like every other in-program miss. Unsupported schemas pass through; unrecognized provider prose remains `connector_call_failed`.
|
|
387
|
+
**E8.** A remote MCP tool whose advertised schema rejects the call fails before provider dispatch with `invalid_args`, carrying bounded, value-free `{ path, code, expected }` findings and scoped search recovery keyed `function: "connecta.search"` like every other in-program miss. A declared property reports the schema keyword that failed, never the validator's duplicate `additionalProperties` branch; a truly undeclared property still reports `additionalProperties`. Unsupported schemas pass through; unrecognized provider prose remains `connector_call_failed`.
|
|
388
388
|
|
|
389
389
|
## Results and projection
|
|
390
390
|
|
|
@@ -840,7 +840,7 @@ the upstream `Executor` shape assignable.
|
|
|
840
840
|
| `A3` | `test/guest-api-contract.test.ts`, `test/execute.test.ts` (colliding alias) |
|
|
841
841
|
| `A4` | `test/execute.test.ts` (namespace collisions, reserved namespace) |
|
|
842
842
|
| `A5` | verdict; `A1`–`A3` are its enforcement |
|
|
843
|
-
| `S1`, `S2` | `test/guest-api-contract.test.ts` (flat page, connector guides, schema keys, and the unfiltered browse that replaces `list_connectors`), `test/execute.test.ts` (guide pagination/partial/no-match behavior and `$ref`/`allOf`) |
|
|
843
|
+
| `S1`, `S2` | `test/guest-api-contract.test.ts` (flat page, connector guides, schema keys, and the unfiltered browse that replaces `list_connectors`), `test/execute.test.ts` (guide pagination/partial/no-match behavior and `$ref`/`allOf`), `test/meta-tools.test.ts` (mixed complete/partial ranking and stable pagination) |
|
|
844
844
|
| `S3` | `test/guest-api-contract.test.ts` (typed uncaught bound), `test/execute.test.ts` (count limits, fan-out bound) |
|
|
845
845
|
| `S4` | `test/guest-api-contract.test.ts` (unknown address in `describe`) |
|
|
846
846
|
| `S5` | `test/guest-api-contract.test.ts`, `test/execute.test.ts` (`unwrapMcpResult`) |
|
|
@@ -47,13 +47,15 @@ choice does not grant the connection different runtime privileges. Two
|
|
|
47
47
|
instances of the same provider are isolated in exactly the same way as two
|
|
48
48
|
hand-written connectors with different ids.
|
|
49
49
|
|
|
50
|
-
A prebuilt connection's vetted annotations
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
A prebuilt connection's vetted annotations fill in downstream silence and
|
|
51
|
+
otherwise preserve explicit annotations. This includes an explicit
|
|
52
|
+
`destructiveHint: true` or `readOnlyHint: false` on a vetted read, and an
|
|
53
|
+
explicit `readOnlyHint: true` on a name no release has classified. One narrow
|
|
54
|
+
exception stays fail-closed: a release-reviewed destructive classification
|
|
55
|
+
overrides a contradictory `readOnlyHint: true`, because Connecta has
|
|
56
|
+
independently established that the tool mutates existing state. Silence on an
|
|
57
|
+
unclassified name still means not read-only. The authoring path never weakens
|
|
58
|
+
the fail-closed read-only invariant.
|
|
57
59
|
|
|
58
60
|
Prebuilt means preferred when available, not mandatory. A deployment may mix
|
|
59
61
|
prebuilt connections, custom `remoteMcp()` connections, and custom `api()`
|
package/documentation/linear.md
CHANGED
|
@@ -83,18 +83,17 @@ The wrapper classifies Linear's documented `list_*`, `get_*`, and
|
|
|
83
83
|
downstream leaves unannotated fails closed onto `call_destructive_tool` until a
|
|
84
84
|
Connecta release reviews it.
|
|
85
85
|
|
|
86
|
-
That classification
|
|
87
|
-
|
|
88
|
-
annotation in neither direction. A tool on the read allowlist arriving with
|
|
86
|
+
That classification fills in downstream silence and otherwise preserves
|
|
87
|
+
explicit annotations. A tool on the read allowlist arriving with
|
|
89
88
|
`destructiveHint: true` or `readOnlyHint: false` keeps exactly what the
|
|
90
89
|
downstream said and stays behind `call_destructive_tool`. A tool on neither
|
|
91
90
|
maintained list arriving with `readOnlyHint: true` keeps that too, and stays
|
|
92
91
|
callable from `execute_code`. Both are the downstream telling you this
|
|
93
92
|
release's allowlist is stale, and on a name no release has reviewed its word is
|
|
94
|
-
the only evidence there is.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
the only evidence there is. One narrow fail-closed exception applies to a name
|
|
94
|
+
this release reviewed and filed destructive: a `save_*` tool claiming
|
|
95
|
+
`readOnlyHint: true` is a downstream bug rather than news, and stays on the
|
|
96
|
+
approval path.
|
|
98
97
|
|
|
99
98
|
One detail of Linear's own design shapes the classification: **`save_*` tools
|
|
100
99
|
are upserts.** Omitting a record id creates; supplying one updates in place.
|
|
@@ -46,6 +46,18 @@ read-only calls and returns typed outcomes, and an unfiltered
|
|
|
46
46
|
`connecta.search({})` browses every catalog a program can reach. Live connector
|
|
47
47
|
probing is an operator concern: the operator pages and `/health` own it.
|
|
48
48
|
|
|
49
|
+
The three discovery routes use deliberately different envelopes. These are
|
|
50
|
+
their smallest successful one-tool shapes:
|
|
51
|
+
|
|
52
|
+
```js
|
|
53
|
+
// Top-level search_tools
|
|
54
|
+
{ connectors: [{ id: "ci", tools: [{ name: "get_run", address: "ci.get_run" }] }], total: 1, offset: 0, limit: 8, hasMore: false }
|
|
55
|
+
|
|
56
|
+
// Inside execute_code
|
|
57
|
+
{ tools: [{ name: "get_run", address: "ci.get_run" }], total: 1, offset: 0, limit: 8, hasMore: false } // connecta.search
|
|
58
|
+
{ tools: [{ name: "get_run", address: "ci.get_run", inputSchema: "{ runId: integer }" }] } // connecta.describe
|
|
59
|
+
```
|
|
60
|
+
|
|
49
61
|
## Discovery context
|
|
50
62
|
|
|
51
63
|
Start an unknown-address lookup with two to four distinctive action/object
|
|
@@ -60,8 +72,10 @@ or setting it to `"all"`, preserves the complete configured catalog. This is
|
|
|
60
72
|
only a discovery filter: it neither grants authority nor changes invocation admission.
|
|
61
73
|
`includeSchemas: "compact"` adds each match's input and any declared output
|
|
62
74
|
shape. Bounded plain-object schemas also expose `inputKeys`,
|
|
63
|
-
`requiredInputKeys`, and `outputKeys`; a
|
|
64
|
-
|
|
75
|
+
`requiredInputKeys`, and `outputKeys`; a zero-input object keeps
|
|
76
|
+
`requiredInputKeys: []`, while an output object with no declared properties
|
|
77
|
+
omits `outputKeys`. A truncated shape omits its corresponding list rather than
|
|
78
|
+
repeating a large partial inventory. Matches carry declared
|
|
65
79
|
behavior annotations. Lexical rank is only one signal: select a candidate whose
|
|
66
80
|
required inputs are available, whose schema is complete enough for the call,
|
|
67
81
|
and whose safety and declared outputs fit the work. A reducer uses `outputKeys`
|
|
@@ -75,11 +89,17 @@ Compact search is deliberately a routing view, not a second copy of connector
|
|
|
75
89
|
documentation. Tool purposes are capped at 160 characters, connector
|
|
76
90
|
descriptions and property prose are omitted, required input fields render
|
|
77
91
|
before optional ones, and each input or output shape is capped at 1,024 UTF-8
|
|
78
|
-
bytes.
|
|
79
|
-
|
|
92
|
+
bytes. Within that unchanged total, each enum node may spend at most 256 UTF-8
|
|
93
|
+
bytes. This lets about three near-cap enum nodes coexist while reserving the
|
|
94
|
+
remaining quarter for surrounding syntax; the global fallback still applies
|
|
95
|
+
when the complete shape exceeds 1,024 bytes. A large enum keeps the longest
|
|
96
|
+
whole-value prefix that fits, then adds `unknown` and a comment with the exact
|
|
97
|
+
omitted-value count. An empty enum renders as the valid `never` type. A capped
|
|
98
|
+
object becomes a valid required-first shape with `unknown` types; other shapes
|
|
99
|
+
become `unknown /* truncated */`. Either cap marks the match with
|
|
80
100
|
`inputSchemaTruncated` or `outputSchemaTruncated`; repeat the search with
|
|
81
101
|
`includeSchemas: "json"` or use the existing describe path when exact
|
|
82
|
-
constraints matter.
|
|
102
|
+
constraints matter. Small enums and both exact paths remain complete.
|
|
83
103
|
|
|
84
104
|
## Connector guide selection
|
|
85
105
|
|
|
@@ -176,13 +196,34 @@ set of inflectional variants preserves singular/plural and verb-form recall
|
|
|
176
196
|
without allowing arbitrary mid-word substring matches. Ranking weights each
|
|
177
197
|
query term by its document frequency across the available catalogs in that
|
|
178
198
|
search, so a rare domain term outranks a ubiquitous action while action terms
|
|
179
|
-
still distinguish `get`, `list`, `search`, and write operations.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
199
|
+
still distinguish `get`, `list`, `search`, and write operations. The scorer
|
|
200
|
+
always evaluates useful near-matches instead of letting one broad all-term
|
|
201
|
+
description hide them. Complete matches rank before ordinary partial matches;
|
|
202
|
+
a partial candidate whose complete normalized tool name occurs in the
|
|
203
|
+
normalized raw query competes with complete matches by score, and other
|
|
204
|
+
candidates covering at least two terms fill the remaining page after them.
|
|
205
|
+
Conversational cleanup applies only to scoring terms, never to the exact-name
|
|
206
|
+
phrase check. If no tool covers every non-conversational term, the same scorer
|
|
207
|
+
preserves the wider any-term fallback and marks the result
|
|
208
|
+
`matchMode: "partial"`.
|
|
209
|
+
|
|
210
|
+
Returned tool rows expose neither lexical scores nor per-result query coverage.
|
|
211
|
+
The mixed complete/partial scorer still ranks rare domain terms, action terms,
|
|
212
|
+
and exact tool-name phrases. Select from the returned purpose, address, schema,
|
|
213
|
+
safety, and output shape. Page-level `queryAnalysis` remains the recovery path
|
|
214
|
+
when no single result covers every term or no match exists.
|
|
215
|
+
|
|
216
|
+
Only an empty or whitespace-only query browses. A non-empty query that
|
|
217
|
+
normalizes to no ASCII lexical terms returns no tools instead of unrelated
|
|
218
|
+
browse results. Its bounded `queryAnalysis.unmatchedTerms` contains the clipped
|
|
219
|
+
raw query and guidance asks for ASCII action/object terms. A mixed query still
|
|
220
|
+
searches with its ASCII terms; unsupported characters do not become false
|
|
221
|
+
matches or per-tool coverage terms.
|
|
222
|
+
|
|
223
|
+
Every partial or no-match lexical search also returns bounded page-level
|
|
224
|
+
`queryAnalysis`; an all-term result needs no recovery advice.
|
|
225
|
+
`representedTerms` occur in the current page, `otherResultTerms` occur only in
|
|
226
|
+
another result, and
|
|
186
227
|
`unmatchedTerms` have no lexical match in the catalogs that answered. Partial
|
|
187
228
|
results explain that no single tool covered every term and recommend splitting
|
|
188
229
|
distinct intents. A true negative says that no matching capability is
|
|
@@ -331,7 +372,9 @@ exist. `nextAction` points to discovery scoped to the same connector and tool
|
|
|
331
372
|
name when the compact schema is needed — routed like any other miss, so a
|
|
332
373
|
program is sent to `connecta.search` and a top-level call to `search_tools` —
|
|
333
374
|
while `retry` says to correct the listed arguments and reissue the original
|
|
334
|
-
operation. A schema
|
|
375
|
+
operation. A declared property reports only its failed schema keyword, while a
|
|
376
|
+
truly undeclared property reports `additionalProperties`; validator-internal
|
|
377
|
+
duplicate `additionalProperties` branches never reach the caller. A schema the local
|
|
335
378
|
validator cannot evaluate passes through to the provider. Provider error prose
|
|
336
379
|
is not parsed or guessed, so an unknown format remains
|
|
337
380
|
`connector_call_failed`.
|
|
@@ -49,18 +49,17 @@ documented create, update, edit, merge, dismiss, duplicate, and delete tools as
|
|
|
49
49
|
writes. An unfamiliar tool the downstream leaves unannotated fails closed onto
|
|
50
50
|
`call_destructive_tool` until a Connecta release reviews it.
|
|
51
51
|
|
|
52
|
-
That classification
|
|
53
|
-
|
|
54
|
-
annotation in neither direction. A tool on the read allowlist arriving with
|
|
52
|
+
That classification fills in downstream silence and otherwise preserves
|
|
53
|
+
explicit annotations. A tool on the read allowlist arriving with
|
|
55
54
|
`destructiveHint: true` or `readOnlyHint: false` keeps exactly what the
|
|
56
55
|
downstream said and stays behind `call_destructive_tool`. A tool on neither
|
|
57
56
|
maintained list arriving with `readOnlyHint: true` keeps that too, and stays
|
|
58
57
|
callable from `execute_code`. Both are the downstream telling you this
|
|
59
58
|
release's allowlist is stale, and on a name no release has reviewed its word is
|
|
60
|
-
the only evidence there is.
|
|
61
|
-
|
|
62
|
-
`
|
|
63
|
-
|
|
59
|
+
the only evidence there is. One narrow fail-closed exception applies to a name
|
|
60
|
+
this release reviewed and filed destructive: a `Delete-Dashboard` claiming
|
|
61
|
+
`readOnlyHint: true` is a downstream bug rather than news, and stays on the
|
|
62
|
+
approval path. Maintained writes that only create
|
|
64
63
|
something new (`Create-Dashboard`, `Create-Cohort`, `Create-Metric`, and the
|
|
65
64
|
rest) leave `destructiveHint` unset; `readOnlyHint: false` already routes them
|
|
66
65
|
through the destructive path, and asserting destruction only inflates the
|