@zackbart/connecta 0.3.0 → 0.4.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 +143 -0
- package/README.md +34 -14
- package/SECURITY.md +1 -1
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +62 -0
- package/dist/catalog.js.map +1 -1
- package/dist/connectors/api.d.ts +10 -0
- package/dist/connectors/api.d.ts.map +1 -1
- package/dist/connectors/api.js +16 -39
- package/dist/connectors/api.js.map +1 -1
- package/dist/connectors/remote-mcp.d.ts +14 -1
- package/dist/connectors/remote-mcp.d.ts.map +1 -1
- package/dist/connectors/remote-mcp.js +29 -0
- package/dist/connectors/remote-mcp.js.map +1 -1
- package/dist/credentials.d.ts +2 -1
- package/dist/credentials.d.ts.map +1 -1
- package/dist/credentials.js +4 -2
- package/dist/credentials.js.map +1 -1
- package/dist/errors.d.ts +20 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +39 -1
- package/dist/errors.js.map +1 -1
- package/dist/executors/quickjs.d.ts.map +1 -1
- package/dist/executors/quickjs.js +32 -4
- package/dist/executors/quickjs.js.map +1 -1
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +45 -1
- package/dist/index.js.map +1 -1
- package/dist/json-schema.d.ts +3 -0
- package/dist/json-schema.d.ts.map +1 -0
- package/dist/json-schema.js +6 -0
- package/dist/json-schema.js.map +1 -0
- package/dist/meta-tools.d.ts +34 -2
- package/dist/meta-tools.d.ts.map +1 -1
- package/dist/meta-tools.js +104 -15
- package/dist/meta-tools.js.map +1 -1
- package/dist/server.d.ts +4 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +34 -6
- package/dist/server.js.map +1 -1
- package/dist/storage/file.d.ts.map +1 -1
- package/dist/storage/file.js +19 -3
- package/dist/storage/file.js.map +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +13 -9
- package/dist/ui.js.map +1 -1
- package/dist/validate.d.ts +71 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +96 -0
- package/dist/validate.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -1
- package/src/catalog.ts +61 -0
- package/src/connectors/api.ts +25 -50
- package/src/connectors/remote-mcp.ts +52 -0
- package/src/credentials.ts +6 -3
- package/src/errors.ts +45 -2
- package/src/executors/quickjs.ts +32 -4
- package/src/index.ts +94 -1
- package/src/json-schema.ts +11 -0
- package/src/meta-tools.ts +156 -28
- package/src/server.ts +39 -6
- package/src/storage/file.ts +18 -2
- package/src/ui.ts +13 -8
- package/src/validate.ts +154 -0
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,149 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this package are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.4.1 — 2026-07-25
|
|
6
|
+
|
|
7
|
+
A security-hardening release from a full audit of the codebase. Every change is
|
|
8
|
+
backward-compatible: new safety that could alter behavior is opt-in or a
|
|
9
|
+
generous default, and existing well-behaved deployments are unaffected. No
|
|
10
|
+
sandbox-escape, RCE, or XSS was found; the items below are the real gaps.
|
|
11
|
+
|
|
12
|
+
### Security
|
|
13
|
+
|
|
14
|
+
- **QuickJS sandbox log memory is now bounded.** `execute_code`'s `console.log`
|
|
15
|
+
capped only the *number* of retained entries (200), not their size, so
|
|
16
|
+
untrusted guest code — the sandbox's explicit threat model — could
|
|
17
|
+
`console.log("x".repeat(25_000_000))` two hundred times and retain multiple
|
|
18
|
+
GB of host memory, OOMing the Node process. Each entry is now truncated to 8k
|
|
19
|
+
chars and the cumulative buffer to 256k, both at capture time. Small logs are
|
|
20
|
+
byte-for-byte unchanged.
|
|
21
|
+
|
|
22
|
+
- **The `fileStorage` state file is now owner-only.** It holds downstream OAuth
|
|
23
|
+
access/refresh tokens in cleartext on the Node backend and was written with
|
|
24
|
+
no mode (world-readable `0644`), so any local user could read long-lived
|
|
25
|
+
tokens. The directory is now `0700`, the temp file `0600` (the atomic rename
|
|
26
|
+
preserves it), and an existing loose-mode file is repaired to `0600` on load.
|
|
27
|
+
Repair is best-effort so a non-POSIX filesystem can't block startup.
|
|
28
|
+
|
|
29
|
+
- **Cleartext-credential and destination guard on `remoteMcp`.** Static
|
|
30
|
+
`headers` credentials were attached with no scheme check, so an `http://`
|
|
31
|
+
`url` sent bearer tokens / API keys in cleartext. `remoteMcp` now warns at
|
|
32
|
+
construction when headers-auth targets a non-https, non-loopback URL, and a
|
|
33
|
+
new opt-in `requireHttps` makes that a hard error. A `NOTE` documents the
|
|
34
|
+
residual redirect-following SSRF in the SDK's fetch transport (a malicious
|
|
35
|
+
downstream could 3xx-redirect to an internal address); a full guard needs
|
|
36
|
+
manual redirect handling in the SDK and is deferred to a non-patch release.
|
|
37
|
+
|
|
38
|
+
- **Construction-time warnings for insecure deployment shapes.**
|
|
39
|
+
`createConnecta` now emits a one-time `logger.warn` when: no inbound `auth`
|
|
40
|
+
is configured while credential/OAuth connectors are present (any caller
|
|
41
|
+
reaches the credential vault — connecta's trust model is single-domain, so an
|
|
42
|
+
open or open-signup deployment grants every caller full access); `publicUrl`
|
|
43
|
+
is unset while OAuth connectors exist (the downstream `redirect_uri` is
|
|
44
|
+
derived from the attacker-influenced inbound `Host` header — set `publicUrl`
|
|
45
|
+
to a fixed https origin); or a connector exposes `finishAuth` but not
|
|
46
|
+
`verifyState` (its `/oauth/callback` would exchange any delivered `code`).
|
|
47
|
+
The shipped `remoteMcp` implements `verifyState`, so the last fires only for
|
|
48
|
+
hand-rolled connectors. Full per-actor authorization remains an architectural
|
|
49
|
+
change for a future release.
|
|
50
|
+
|
|
51
|
+
- **The discovery meta-tools no longer hang on a stuck downstream.**
|
|
52
|
+
`list_connectors`, `search_tools`, and `describe_tools` fanned out live
|
|
53
|
+
probes to every connector with no deadline, so one hung downstream stalled
|
|
54
|
+
the whole call. Bounded by the new `probeTimeoutMs` (below); a timed-out
|
|
55
|
+
connector degrades to an unavailable/errored entry. The bound is
|
|
56
|
+
caller-facing — the registry takes no `AbortSignal` yet, so the underlying
|
|
57
|
+
fetch is not cancelled; real cancellation is a documented follow-up.
|
|
58
|
+
|
|
59
|
+
- **`/ui` now ships a nonce-based script CSP.** The operator page carried no
|
|
60
|
+
script-restricting CSP, so any future escaping regression would be directly
|
|
61
|
+
exploitable. It now sends a per-request `script-src 'nonce-…' 'strict-dynamic'
|
|
62
|
+
https: 'unsafe-inline'; object-src 'none'; base-uri 'none'; frame-ancestors
|
|
63
|
+
'none'`. `'strict-dynamic'` keeps Clerk's runtime-injected scripts working;
|
|
64
|
+
the `https:`/`'unsafe-inline'` fallbacks are ignored by modern browsers and
|
|
65
|
+
only cover legacy ones; and no `default-src` is set so Clerk's network/fonts
|
|
66
|
+
and the inline styles stay unrestricted. Operator `branding` `productUrl`/
|
|
67
|
+
`ownerUrl` values are now scheme-gated (a `javascript:` URL is dropped rather
|
|
68
|
+
than rendered as a link), and credential metadata omits `lastFour` for values
|
|
69
|
+
shorter than 12 chars so a short secret doesn't leak half of itself.
|
|
70
|
+
|
|
71
|
+
### Added
|
|
72
|
+
|
|
73
|
+
- `RemoteMcpOptions.requireHttps` (default `false`) — reject a non-`https://`
|
|
74
|
+
(non-loopback) `url` at construction, and `RemoteMcpOptions.logger` for the
|
|
75
|
+
cleartext-credential warning.
|
|
76
|
+
- `ApiOptions.strictValidation` (default `false`) and
|
|
77
|
+
`ValidateToolInputOptions.failClosed` (default `false`) — reject a call whose
|
|
78
|
+
`inputSchema` the validator cannot evaluate instead of passing the raw
|
|
79
|
+
arguments through. The default remains fail-open (a broken schema does not
|
|
80
|
+
break an otherwise working tool); `api()` also now eagerly compiles each tool
|
|
81
|
+
schema at construction so a bad one warns once at startup rather than
|
|
82
|
+
silently on first use.
|
|
83
|
+
- `ConnectaConfig.probeTimeoutMs` (default `30_000`) — per-connector deadline
|
|
84
|
+
for the `list_connectors`/`search_tools`/`describe_tools` fan-out. Generous
|
|
85
|
+
by default so it trips only on a pathological hang; does not apply to
|
|
86
|
+
`call_tool`/`batch_call`, which carry `defaultToolTimeoutMs`.
|
|
87
|
+
|
|
88
|
+
## 0.4.0 — 2026-07-25
|
|
89
|
+
|
|
90
|
+
### Added
|
|
91
|
+
|
|
92
|
+
- `ConnectorCallError` accepts `retryAfterMs` — the wait window a connector
|
|
93
|
+
already knows (a `Retry-After` header, say) and until now had no way to
|
|
94
|
+
report. It round-trips into the value-mode error envelope as
|
|
95
|
+
`error.retryAfterMs` (and `errorDetails.retryAfterMs` in `batch_call`), so an
|
|
96
|
+
agent that receives the failure can schedule a re-issue instead of guessing,
|
|
97
|
+
and the engine's retry loop waits that long in place of its exponential
|
|
98
|
+
guess. A reported window is honoured exactly or not at all: up to 10 s the
|
|
99
|
+
engine waits it in full; beyond that it declines the retry and returns the
|
|
100
|
+
failure immediately rather than retrying inside a rate-limit window it was
|
|
101
|
+
told about. The reported value is never capped.
|
|
102
|
+
- `ConnectaConfig.defaultToolTimeoutMs` — a deadline for `call_tool`/
|
|
103
|
+
`batch_call` calls that pass no `timeoutMs`, giving the connector both a
|
|
104
|
+
budget (`ctx.timeoutMs`) and a cancellation signal (`ctx.signal`) on the
|
|
105
|
+
common path, as `execute_code` host calls have always had. **Opt-in and unset
|
|
106
|
+
by default**: switching it on globally would put a deadline on every call in
|
|
107
|
+
every existing deployment, and the failure mode is a working long-running
|
|
108
|
+
call starting to time out. An explicit per-call `timeoutMs` always wins.
|
|
109
|
+
- `validateToolInput(schema, args, { address, logger? })` — the argument
|
|
110
|
+
validation `api()` performs, extracted to `src/validate.ts` and exported so
|
|
111
|
+
connectors that implement the `Connector` interface directly can use it too.
|
|
112
|
+
Previously enforcement lived inside `api()`, so a hand-rolled connector whose
|
|
113
|
+
manifest declared `additionalProperties: false` had nothing enforcing it: an
|
|
114
|
+
unknown argument key was silently dropped, an empty body went upstream, and a
|
|
115
|
+
200 was reported back as a successful write. It **returns** the non-retryable
|
|
116
|
+
`invalid_args` `ConnectorCallError` (or `null`) instead of throwing, so the
|
|
117
|
+
connector owns the decision — its own error prose, or stripping a
|
|
118
|
+
connector-wide convention argument the tool schema doesn't declare. `api()`
|
|
119
|
+
now calls it; behaviour is unchanged (`test/api-connector.test.ts` is
|
|
120
|
+
untouched).
|
|
121
|
+
- `@zackbart/connecta/json-schema` — re-exports `Validator` from
|
|
122
|
+
`@cfworker/json-schema`. It was already a direct dependency but not public,
|
|
123
|
+
so downstream build-time validation (a manifest generator asserting its own
|
|
124
|
+
output) resolved it only through npm hoisting.
|
|
125
|
+
|
|
126
|
+
### Fixed
|
|
127
|
+
|
|
128
|
+
- `compactSchema` — the rendering behind `search_tools` and `describe_tools`,
|
|
129
|
+
and for most models the only description of a tool they ever read — dropped
|
|
130
|
+
`const` and did not handle `allOf`. A discriminated union, the standard shape
|
|
131
|
+
for "one of these request bodies", therefore rendered as several textually
|
|
132
|
+
identical branches with the field that selects them erased
|
|
133
|
+
(`{ type: string, emoji: string } | { type: string, external: {…} }`), and a
|
|
134
|
+
schema using `allOf` fell through to raw `JSON.stringify` — on a real
|
|
135
|
+
connector that measured *longer* than the schema it was meant to compact.
|
|
136
|
+
`const` now renders as a literal, so unions are self-documenting again, and
|
|
137
|
+
`allOf` composes with the schema's own shape joined by `&` rather than
|
|
138
|
+
replacing it: a sibling `properties`, `$ref`, `enum`, `const`, or `items` is
|
|
139
|
+
no longer silently dropped, and an empty `allOf` beside real properties no
|
|
140
|
+
longer erases the whole schema.
|
|
141
|
+
- An aborted call — including one the engine itself cancelled at its deadline —
|
|
142
|
+
was classified `connector_call_failed`/`retryable: false`. An aborted `fetch`
|
|
143
|
+
rejects with a `DOMException` named `AbortError` whose message matches
|
|
144
|
+
neither classification regex. `classifyCallError` now checks the name before
|
|
145
|
+
the message text and classifies it as a retryable `timeout`, so connectors
|
|
146
|
+
that pass `ctx.signal` through no longer have to special-case it.
|
|
147
|
+
|
|
5
148
|
## 0.3.0 — 2026-07-24
|
|
6
149
|
|
|
7
150
|
### Added
|
package/README.md
CHANGED
|
@@ -65,9 +65,7 @@ connector configuration, auth policy, domain, bindings, migrations, and secrets.
|
|
|
65
65
|
|
|
66
66
|
```ts
|
|
67
67
|
import { DynamicWorkerExecutor } from "@cloudflare/codemode";
|
|
68
|
-
import {
|
|
69
|
-
api, bearerToken, createConnecta, remoteMcp,
|
|
70
|
-
} from "@zackbart/connecta";
|
|
68
|
+
import { bearerToken, createConnecta, remoteMcp } from "@zackbart/connecta";
|
|
71
69
|
import { clerkAuth } from "@zackbart/connecta/auth/clerk";
|
|
72
70
|
import { cloudflareKvStorage } from "./cloudflare-kv.js";
|
|
73
71
|
|
|
@@ -202,9 +200,11 @@ api("example", {
|
|
|
202
200
|
```
|
|
203
201
|
|
|
204
202
|
Set `credentialEncryptionKey` on `createConnecta` to a base64-encoded 32-byte
|
|
205
|
-
key held in the runtime's secret store (`openssl rand -base64 32`)
|
|
206
|
-
|
|
207
|
-
|
|
203
|
+
key held in the runtime's secret store (`openssl rand -base64 32`) — a connector
|
|
204
|
+
that declares a credential without one fails at construction rather than booting
|
|
205
|
+
with an unusable vault. Credential mutation routes require the configured Clerk
|
|
206
|
+
provider and a same-origin browser request; the static inbound bearer cannot
|
|
207
|
+
administer the vault.
|
|
208
208
|
|
|
209
209
|
Connecta does not bundle service-specific HTTP API connectors. Package consumers
|
|
210
210
|
define them with `api()` (or implement `Connector` directly), keeping endpoint,
|
|
@@ -233,17 +233,37 @@ const connecta = createConnecta({
|
|
|
233
233
|
```
|
|
234
234
|
|
|
235
235
|
One final event is emitted for each resolved connector call made through
|
|
236
|
-
`call_tool`, `batch_call`, or `execute_code`; retries
|
|
237
|
-
`attempts` count. Implementing `list` enables the
|
|
238
|
-
`/ui`; `activityReadGate` can narrow reads
|
|
239
|
-
never change a tool result. Clerk calls
|
|
240
|
-
calls are honestly labeled as bearer
|
|
241
|
-
`bearerToken(secret, { subjectId })` assigns that credential a stable
|
|
236
|
+
`call_tool`, `call_destructive_tool`, `batch_call`, or `execute_code`; retries
|
|
237
|
+
remain one event with an `attempts` count. Implementing `list` enables the
|
|
238
|
+
authenticated Activity tab in `/ui`; `activityReadGate` can narrow reads
|
|
239
|
+
further. Writes are best-effort and never change a tool result. Clerk calls
|
|
240
|
+
carry the Clerk user ID; shared bearer calls are honestly labeled as bearer
|
|
241
|
+
unless `bearerToken(secret, { subjectId })` assigns that credential a stable
|
|
242
|
+
subject. On Workers, pass `ctx` through to `connecta.fetch(request, env, ctx)`
|
|
243
|
+
so async writes settle on `waitUntil`.
|
|
244
|
+
[`examples/worker/src/d1-activity.ts`](./examples/worker/src/d1-activity.ts) is
|
|
245
|
+
a complete D1 implementation with keyset paging and a retention pass.
|
|
246
|
+
|
|
247
|
+
## Operator dashboard
|
|
248
|
+
|
|
249
|
+
`GET /ui` is a read-only dashboard with no build step: connector health, tool
|
|
250
|
+
counts and descriptions with a client-side filter, downstream authorization
|
|
251
|
+
links, the credential controls above, and an Activity tab when an activity store
|
|
252
|
+
is configured. The shell is open because it carries no data; everything it shows
|
|
253
|
+
comes from `/ui/data`, behind the same auth gate as `/mcp`. With Clerk
|
|
254
|
+
configured it signs operators in through Clerk's hosted portal; a bearer-only
|
|
255
|
+
deployment falls back to a pasted token.
|
|
256
|
+
|
|
257
|
+
Every deployment-facing label and mark on `/ui` and the OAuth result pages comes
|
|
258
|
+
from `ConnectaConfig.branding` — `productName`, `ownerName`, their URLs,
|
|
259
|
+
`description`, `pageTitle`, `themeColor`, and `favicon` — each falling back to a
|
|
260
|
+
neutral Connecta default. Nothing about the operator is baked into the package.
|
|
242
261
|
|
|
243
262
|
## Learn more
|
|
244
263
|
|
|
245
264
|
- **[`docs/documentation.md`](./docs/documentation.md)** — how everything works: architecture,
|
|
246
265
|
the meta-tools, connectors, inbound auth, downstream OAuth, storage, running it
|
|
247
|
-
(Node / Workers / Docker), Clerk setup, testing, troubleshooting
|
|
266
|
+
(Node / Workers / Docker), Clerk setup, testing, troubleshooting, code mode,
|
|
267
|
+
the status UI, and activity history.
|
|
248
268
|
- **[`docs/design.md`](./docs/design.md)** — why it's built this way, and the non-goals.
|
|
249
|
-
- **
|
|
269
|
+
- **[`CHANGELOG.md`](./CHANGELOG.md)** — what changed in each release.
|
package/SECURITY.md
CHANGED
|
@@ -16,7 +16,7 @@ CI blocks high and critical production dependency advisories. Moderate findings
|
|
|
16
16
|
are reviewed for reachability and recorded when an upstream package has not yet
|
|
17
17
|
released a compatible fix.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
As of 0.4.0, one such finding remains open:
|
|
20
20
|
`@modelcontextprotocol/sdk@1.29.0` declares `@hono/node-server` 1.x, which is
|
|
21
21
|
covered by `GHSA-frvp-7c67-39w9`. The advisory affects Hono's Windows
|
|
22
22
|
`serve-static` implementation. Connecta does not import that adapter or serve
|
package/dist/catalog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAItD,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,EAAE,OAAO,GACZ,MAAM,GAAG,SAAS,CAMpB;AAiDD,8EAA8E;AAC9E,wBAAgB,SAAS,CACvB,KAAK,EAAE,OAAO,EAAE,EAChB,KAAK,EAAE,MAAM,GACZ,KAAK,CAAC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CASxD;
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAItD,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,EAAE,OAAO,GACZ,MAAM,GAAG,SAAS,CAMpB;AAiDD,8EAA8E;AAC9E,wBAAgB,SAAS,CACvB,KAAK,EAAE,OAAO,EAAE,EAChB,KAAK,EAAE,MAAM,GACZ,KAAK,CAAC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CASxD;AAuID,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAexD"}
|
package/dist/catalog.js
CHANGED
|
@@ -65,6 +65,40 @@ export function rankTools(tools, query) {
|
|
|
65
65
|
function refName(ref) {
|
|
66
66
|
return ref.split("/").pop() ?? ref;
|
|
67
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Whether a schema declares anything renderSchema knows how to render on its
|
|
70
|
+
* own. Used to decide if the non-allOf half of a schema is worth rendering:
|
|
71
|
+
* without this, a plain `{ allOf: [...] }` would render its (empty) local half
|
|
72
|
+
* through the raw-JSON fallback and emit `{} & …`.
|
|
73
|
+
*/
|
|
74
|
+
function declaresShape(s) {
|
|
75
|
+
return (typeof s.$ref === "string" ||
|
|
76
|
+
Array.isArray(s.oneOf) ||
|
|
77
|
+
Array.isArray(s.anyOf) ||
|
|
78
|
+
Array.isArray(s.enum) ||
|
|
79
|
+
s.const !== undefined ||
|
|
80
|
+
s.items !== undefined ||
|
|
81
|
+
s.properties !== undefined ||
|
|
82
|
+
s.type !== undefined);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Parenthesize a top-level union so it doesn't read as part of a surrounding
|
|
86
|
+
* `&`. Only separators outside braces count, so a nested union or a property
|
|
87
|
+
* description containing a pipe doesn't trigger stray parentheses.
|
|
88
|
+
*/
|
|
89
|
+
function grouped(part) {
|
|
90
|
+
let nesting = 0;
|
|
91
|
+
for (let i = 0; i < part.length; i += 1) {
|
|
92
|
+
const char = part[i];
|
|
93
|
+
if (char === "{" || char === "(" || char === "[")
|
|
94
|
+
nesting += 1;
|
|
95
|
+
else if (char === "}" || char === ")" || char === "]")
|
|
96
|
+
nesting -= 1;
|
|
97
|
+
else if (nesting === 0 && part.startsWith(" | ", i))
|
|
98
|
+
return `(${part})`;
|
|
99
|
+
}
|
|
100
|
+
return part;
|
|
101
|
+
}
|
|
68
102
|
function renderSchema(schema, defs, seen, depth) {
|
|
69
103
|
if (depth > 4)
|
|
70
104
|
return "…";
|
|
@@ -72,6 +106,28 @@ function renderSchema(schema, defs, seen, depth) {
|
|
|
72
106
|
return JSON.stringify(schema);
|
|
73
107
|
}
|
|
74
108
|
const s = schema;
|
|
109
|
+
// allOf composes rather than replaces: it is checked before every other
|
|
110
|
+
// keyword, and renders the schema's own shape alongside its members instead
|
|
111
|
+
// of returning early. A schema carrying both allOf and properties (the usual
|
|
112
|
+
// OpenAPI-derived "extend this base" shape, and equally legal with $ref,
|
|
113
|
+
// enum, const, or items) would otherwise silently drop whichever half lost
|
|
114
|
+
// the branch race. The schema's own shape comes first, being the more
|
|
115
|
+
// specific half, and is rendered at the current depth because its members
|
|
116
|
+
// sit at this nesting level, not one below.
|
|
117
|
+
if (Array.isArray(s.allOf)) {
|
|
118
|
+
const { allOf: _members, ...own } = s;
|
|
119
|
+
const parts = declaresShape(own)
|
|
120
|
+
? [renderSchema(own, defs, seen, depth)]
|
|
121
|
+
: [];
|
|
122
|
+
for (const member of s.allOf) {
|
|
123
|
+
parts.push(renderSchema(member, defs, seen, depth + 1));
|
|
124
|
+
}
|
|
125
|
+
if (parts.length === 0)
|
|
126
|
+
return "unknown";
|
|
127
|
+
if (parts.length === 1)
|
|
128
|
+
return parts[0];
|
|
129
|
+
return parts.map(grouped).join(" & ");
|
|
130
|
+
}
|
|
75
131
|
if (typeof s.$ref === "string") {
|
|
76
132
|
const name = refName(s.$ref);
|
|
77
133
|
if (seen.has(name))
|
|
@@ -92,6 +148,12 @@ function renderSchema(schema, defs, seen, depth) {
|
|
|
92
148
|
if (Array.isArray(s.enum)) {
|
|
93
149
|
return s.enum.map((value) => JSON.stringify(value)).join(" | ");
|
|
94
150
|
}
|
|
151
|
+
// Checked before type/properties so a discriminator like
|
|
152
|
+
// { type: "string", const: "emoji" } renders as "emoji" rather than string.
|
|
153
|
+
// JSON.stringify(undefined) returns undefined (not a string), so an explicit
|
|
154
|
+
// `const: undefined` must fall through to the regular type rendering.
|
|
155
|
+
if (s.const !== undefined)
|
|
156
|
+
return JSON.stringify(s.const);
|
|
95
157
|
const type = s.type;
|
|
96
158
|
if (type === "array" || s.items) {
|
|
97
159
|
const items = s.items
|
package/dist/catalog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAEA,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAEvC,MAAM,UAAU,oBAAoB,CAClC,IAAwB,EACxB,IAAa;IAEb,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IACtB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACjD,IAAI,OAAO,CAAC,MAAM,IAAI,0BAA0B;QAAE,OAAO,OAAO,CAAC;IACjE,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,0BAA0B,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC;AAC1E,CAAC;AAED,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC/D,CAAC;AAQD,MAAM,eAAe,GAAG,IAAI,OAAO,EAA+B,CAAC;AAEnE,SAAS,YAAY,CAAC,KAAgB;IACpC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AE,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC;IAAC,MAAM,CAAC;QACP,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IACD,cAAc,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACrC,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/connectors/api.d.ts
CHANGED
|
@@ -31,6 +31,16 @@ export interface ApiOptions {
|
|
|
31
31
|
* on loose coercion.
|
|
32
32
|
*/
|
|
33
33
|
validateArgs?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Fail-closed on a tool whose `inputSchema` the validator cannot evaluate
|
|
36
|
+
* (default false). The default surfaces such a schema as a one-time warning
|
|
37
|
+
* and then passes the raw arguments through, so a broken schema never breaks
|
|
38
|
+
* an otherwise working tool. Set true to instead reject those calls with a
|
|
39
|
+
* non-retryable `invalid_args` ConnectorCallError, so a schema that cannot be
|
|
40
|
+
* enforced never silently admits unvalidated input. Only consulted when
|
|
41
|
+
* `validateArgs` is not false.
|
|
42
|
+
*/
|
|
43
|
+
strictValidation?: boolean;
|
|
34
44
|
tools: ApiTool[];
|
|
35
45
|
}
|
|
36
46
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/connectors/api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/connectors/api.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,SAAS,EACT,yBAAyB,EACzB,yBAAyB,EACzB,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,eAAe,EAEhB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,gBAAgB,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;CAC3E;AAED,MAAM,WAAW,UAAU;IACzB,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mFAAmF;IACnF,UAAU,CAAC,EAAE,yBAAyB,CAAC;IACvC,oDAAoD;IACpD,cAAc,CAAC,EAAE,CACf,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,gBAAgB,KAClB,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACnC,6DAA6D;IAC7D,eAAe,CAAC,EAAE,CAChB,MAAM,EAAE,yBAAyB,EACjC,GAAG,EAAE,gBAAgB,KAClB,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACnC;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,EAAE,OAAO,EAAE,CAAC;CAClB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,SAAS,CAgD3D"}
|
package/dist/connectors/api.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ConnectorCallError } from "../errors.js";
|
|
1
|
+
import { precompileValidator, validateToolInput } from "../validate.js";
|
|
3
2
|
/**
|
|
4
3
|
* A connector defined entirely in code: static tool defs + fetch handlers.
|
|
5
4
|
* Tool inputs are plain JSON Schema objects (bring your own zod-to-json-schema
|
|
@@ -21,27 +20,15 @@ export function api(id, opts) {
|
|
|
21
20
|
}));
|
|
22
21
|
const byName = new Map(opts.tools.map((t) => [t.name, t]));
|
|
23
22
|
const validateArgs = opts.validateArgs ?? true;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const validatorFor = (tool, ctx) => {
|
|
32
|
-
let validator = validators.get(tool.name);
|
|
33
|
-
if (validator === undefined) {
|
|
34
|
-
try {
|
|
35
|
-
validator = new Validator(tool.inputSchema, "2020-12", false);
|
|
36
|
-
validators.set(tool.name, validator);
|
|
37
|
-
}
|
|
38
|
-
catch (err) {
|
|
39
|
-
disableValidation(tool, ctx, err);
|
|
40
|
-
validator = null;
|
|
41
|
-
}
|
|
23
|
+
const strictValidation = opts.strictValidation ?? false;
|
|
24
|
+
if (validateArgs) {
|
|
25
|
+
// Compile each schema now so a validator-hostile inputSchema surfaces once
|
|
26
|
+
// here rather than silently on its first call. Warning-only; never throws.
|
|
27
|
+
for (const t of opts.tools) {
|
|
28
|
+
if (t.inputSchema)
|
|
29
|
+
precompileValidator(t.inputSchema, { address: `${id}.${t.name}` });
|
|
42
30
|
}
|
|
43
|
-
|
|
44
|
-
};
|
|
31
|
+
}
|
|
45
32
|
return {
|
|
46
33
|
id,
|
|
47
34
|
title: opts.title,
|
|
@@ -61,23 +48,13 @@ export function api(id, opts) {
|
|
|
61
48
|
}
|
|
62
49
|
const input = args ?? {};
|
|
63
50
|
if (validateArgs && tool.inputSchema) {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
disableValidation(tool, ctx, err);
|
|
72
|
-
}
|
|
73
|
-
if (result && !result.valid) {
|
|
74
|
-
const units = result.errors.filter((u) => u.instanceLocation !== "#");
|
|
75
|
-
const detail = (units.length > 0 ? units : result.errors)
|
|
76
|
-
.slice(0, 3)
|
|
77
|
-
.map((u) => `${u.instanceLocation}: ${u.error}`)
|
|
78
|
-
.join("; ");
|
|
79
|
-
throw new ConnectorCallError("invalid_args", `Invalid arguments for "${id}.${name}": ${detail || "input does not match the tool's inputSchema"}`);
|
|
80
|
-
}
|
|
51
|
+
const invalid = validateToolInput(tool.inputSchema, input, {
|
|
52
|
+
address: `${id}.${name}`,
|
|
53
|
+
logger: ctx.logger,
|
|
54
|
+
failClosed: strictValidation,
|
|
55
|
+
});
|
|
56
|
+
if (invalid)
|
|
57
|
+
throw invalid;
|
|
81
58
|
}
|
|
82
59
|
return tool.handler(input, ctx);
|
|
83
60
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/connectors/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/connectors/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAgExE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,GAAG,CAAC,EAAU,EAAE,IAAgB;IAC9C,MAAM,IAAI,GAAc,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC7C,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,YAAY,EAAE,CAAC,CAAC,YAAY;QAC5B,WAAW,EAAE,CAAC,CAAC,WAAW;KAC3B,CAAC,CAAC,CAAC;IACJ,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3D,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC;IAC/C,MAAM,g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AI,OAAO;oBAAE,MAAM,OAAO,CAAC;YAC7B,CAAC;YACD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAClC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
2
|
-
import type { Connector, ConnectorContext } from "../types.js";
|
|
2
|
+
import type { Connector, ConnectorContext, Logger } from "../types.js";
|
|
3
3
|
export type RemoteMcpAuth = {
|
|
4
4
|
type: "headers";
|
|
5
5
|
headers: Record<string, string>;
|
|
@@ -12,6 +12,19 @@ export interface RemoteMcpOptions {
|
|
|
12
12
|
title?: string;
|
|
13
13
|
description?: string;
|
|
14
14
|
auth?: RemoteMcpAuth;
|
|
15
|
+
/**
|
|
16
|
+
* Refuse to connect to a non-`https://` `url` at construction (default
|
|
17
|
+
* false). Loopback hosts (`localhost`, `127.0.0.1`, `[::1]`) are always
|
|
18
|
+
* allowed for local development. Off by default, static `headers` credentials
|
|
19
|
+
* over a cleartext connection are warned about but permitted; set this true
|
|
20
|
+
* to make that misconfiguration a hard error instead.
|
|
21
|
+
*/
|
|
22
|
+
requireHttps?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Destination for the cleartext-credential warning emitted at construction.
|
|
25
|
+
* Default console.
|
|
26
|
+
*/
|
|
27
|
+
logger?: Logger;
|
|
15
28
|
/**
|
|
16
29
|
* @internal Testing seam. When set, this transport is used instead of the
|
|
17
30
|
* HTTP transport, letting tests point the connector at an in-process MCP
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-mcp.d.ts","sourceRoot":"","sources":["../../src/connectors/remote-mcp.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAK/E,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,
|
|
1
|
+
{"version":3,"file":"remote-mcp.d.ts","sourceRoot":"","sources":["../../src/connectors/remote-mcp.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAK/E,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAEhB,MAAM,EAEP,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GACpD;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtB,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,SAAS,CAAC;CAC1D;AAwBD;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,SAAS,CA4TvE"}
|
|
@@ -8,6 +8,12 @@ import { CONNECTA_VERSION } from "../version.js";
|
|
|
8
8
|
function msg(err) {
|
|
9
9
|
return err instanceof Error ? err.message : String(err);
|
|
10
10
|
}
|
|
11
|
+
function isLoopbackHost(hostname) {
|
|
12
|
+
return (hostname === "localhost" ||
|
|
13
|
+
hostname === "127.0.0.1" ||
|
|
14
|
+
hostname === "[::1]" ||
|
|
15
|
+
hostname === "::1");
|
|
16
|
+
}
|
|
11
17
|
/**
|
|
12
18
|
* Proxy a downstream remote MCP server. SDK clients and transports are scoped
|
|
13
19
|
* to one inbound request: reused by calls within a batch/execute_code run, but
|
|
@@ -24,6 +30,21 @@ export function remoteMcp(id, opts) {
|
|
|
24
30
|
// from the isolate singleton. Those are request-bound in Cloudflare Workers.
|
|
25
31
|
const states = new WeakMap();
|
|
26
32
|
const isOauth = opts.auth?.type === "oauth";
|
|
33
|
+
const logger = opts.logger ?? console;
|
|
34
|
+
// Check the destination scheme once at construction: buildTransport (and the
|
|
35
|
+
// SDK's fetch) attach any static credentials to every request, so an http://
|
|
36
|
+
// endpoint sends bearer tokens / API keys in cleartext. Loopback is exempt
|
|
37
|
+
// for local development.
|
|
38
|
+
const destination = new URL(opts.url);
|
|
39
|
+
const insecureDestination = destination.protocol !== "https:" && !isLoopbackHost(destination.hostname);
|
|
40
|
+
if (insecureDestination) {
|
|
41
|
+
if (opts.requireHttps) {
|
|
42
|
+
throw new Error(`[connecta] connector "${id}" url ${opts.url} is not https:// (and not loopback) — refusing to connect (requireHttps).`);
|
|
43
|
+
}
|
|
44
|
+
if (opts.auth?.type === "headers") {
|
|
45
|
+
logger.warn(`[connecta] connector "${id}" sends static credentials to ${opts.url} over a non-https:// connection — those tokens will be transmitted in cleartext.`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
27
48
|
/** Typed per-call auth signal; the SDK's UnauthorizedError stays as cause. */
|
|
28
49
|
const authRequiredError = (cause) => new ConnectorCallError("auth_required", `Connector "${id}" requires authorization — call authorize_connector({ connector: "${id}" }) and open the returned URL.`, { cause });
|
|
29
50
|
const stateFor = (ctx) => {
|
|
@@ -46,6 +67,14 @@ export function remoteMcp(id, opts) {
|
|
|
46
67
|
state.provider ??= new KvOAuthProvider(id, ctx.storage, `${ctx.baseUrl}/oauth/callback/${id}`);
|
|
47
68
|
return state.provider;
|
|
48
69
|
};
|
|
70
|
+
// NOTE: StreamableHTTPClientTransport speaks over fetch, which transparently
|
|
71
|
+
// follows 3xx redirects. A malicious or compromised downstream MCP could
|
|
72
|
+
// redirect to an internal address (e.g. http://169.254.169.254/…) and fetch
|
|
73
|
+
// would re-issue the request — potentially carrying static auth headers. The
|
|
74
|
+
// scheme check above only guards the first hop; a fully robust guard (manual
|
|
75
|
+
// redirect handling + per-hop re-validation + stripping auth headers cross-
|
|
76
|
+
// origin) lives in the SDK transport and is deferred to a future non-patch
|
|
77
|
+
// release rather than reimplemented here.
|
|
49
78
|
const buildTransport = (ctx, state) => {
|
|
50
79
|
if (opts._transportFactory)
|
|
51
80
|
return opts._transportFactory(ctx);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-mcp.js","sourceRoot":"","sources":["../../src/connectors/remote-mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AAEnG,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"remote-mcp.js","sourceRoot":"","sources":["../../src/connectors/remote-mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AAEnG,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAwCjD,SAAS,GAAG,CAAC,GAAY;IAC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CAAC,CAAC,uBAAuB,EAAE;wBACnD,OAAO,EAAE,mDAAmD;qBAC7D,CAAC;gBACJ,CAAC;gBACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/C,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/credentials.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ConnectorCredentialValues, KVStorage } from "./types.js";
|
|
2
2
|
export interface CredentialFieldMetadata {
|
|
3
3
|
configured: true;
|
|
4
|
-
|
|
4
|
+
/** Only emitted when the value is long enough that four chars don't leak much. */
|
|
5
|
+
lastFour?: string;
|
|
5
6
|
updatedAt: string;
|
|
6
7
|
}
|
|
7
8
|
export interface CredentialMetadata {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAqBvE,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,IAAI,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAqBvE,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,IAAI,CAAC;IACjB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,IAAI,CAAC;IACjB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;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