@zackbart/connecta 0.6.1 → 0.7.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 +294 -0
- package/README.md +24 -20
- package/dist/auth/bearer.d.ts +4 -3
- package/dist/auth/bearer.d.ts.map +1 -1
- package/dist/auth/bearer.js +10 -8
- package/dist/auth/bearer.js.map +1 -1
- package/dist/auth/clerk.d.ts +8 -7
- package/dist/auth/clerk.d.ts.map +1 -1
- package/dist/auth/clerk.js +27 -8
- package/dist/auth/clerk.js.map +1 -1
- package/dist/connector-scope.d.ts +13 -0
- package/dist/connector-scope.d.ts.map +1 -0
- package/dist/connector-scope.js +35 -0
- package/dist/connector-scope.js.map +1 -0
- package/dist/connectors/api.d.ts +5 -5
- package/dist/connectors/api.d.ts.map +1 -1
- package/dist/connectors/remote-mcp.d.ts +27 -4
- package/dist/connectors/remote-mcp.d.ts.map +1 -1
- package/dist/connectors/remote-mcp.js +400 -19
- package/dist/connectors/remote-mcp.js.map +1 -1
- package/dist/credential-health.d.ts +8 -5
- package/dist/credential-health.d.ts.map +1 -1
- package/dist/credential-health.js +99 -51
- package/dist/credential-health.js.map +1 -1
- package/dist/credentials.d.ts +51 -2
- package/dist/credentials.d.ts.map +1 -1
- package/dist/credentials.js +68 -3
- package/dist/credentials.js.map +1 -1
- package/dist/execute.d.ts.map +1 -1
- package/dist/execute.js +10 -8
- package/dist/execute.js.map +1 -1
- package/dist/index.d.ts +84 -83
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +74 -24
- package/dist/index.js.map +1 -1
- package/dist/meta-tools.d.ts +28 -3
- package/dist/meta-tools.d.ts.map +1 -1
- package/dist/meta-tools.js +131 -16
- package/dist/meta-tools.js.map +1 -1
- package/dist/registry.d.ts +3 -2
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +4 -3
- package/dist/registry.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +152 -52
- package/dist/server.js.map +1 -1
- package/dist/toolkits.js +1 -1
- package/dist/types.d.ts +41 -27
- package/dist/types.d.ts.map +1 -1
- package/dist/ui.d.ts +24 -10
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +594 -172
- package/dist/ui.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -2
- package/src/auth/bearer.ts +10 -8
- package/src/auth/clerk.ts +28 -9
- package/src/connector-scope.ts +41 -0
- package/src/connectors/api.ts +5 -5
- package/src/connectors/remote-mcp.ts +489 -35
- package/src/credential-health.ts +120 -57
- package/src/credentials.ts +96 -3
- package/src/execute.ts +18 -7
- package/src/index.ts +174 -107
- package/src/meta-tools.ts +173 -24
- package/src/registry.ts +4 -3
- package/src/server.ts +191 -70
- package/src/toolkits.ts +1 -1
- package/src/types.ts +41 -27
- package/src/ui.ts +631 -170
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,300 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this package are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.7.1 — 2026-07-27
|
|
6
|
+
|
|
7
|
+
0.7.1 is a security-and-bounds patch. It closes both redirect paths that could
|
|
8
|
+
let untrusted URL text choose an origin, and it puts hard request and response
|
|
9
|
+
ceilings around discovery. There are no dependency changes and no breaking
|
|
10
|
+
TypeScript changes. There is one intentional runtime hardening to notice:
|
|
11
|
+
`remoteMcp` now rejects downstream redirects by default. A deployment whose MCP
|
|
12
|
+
endpoint legitimately redirects within the same origin can opt into the new
|
|
13
|
+
`redirects: "same-origin"` policy; cross-origin redirects and HTTPS downgrades
|
|
14
|
+
remain impossible.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **`remoteMcp` has an explicit downstream redirect policy** (issue #81).
|
|
19
|
+
`redirects` defaults to `"none"`; `"same-origin"` follows at most five
|
|
20
|
+
manually validated hops with deliberate 301/302/303/307/308 method and body
|
|
21
|
+
semantics. Static headers and OAuth credentials never reach a cross-origin
|
|
22
|
+
target, and policy failures are typed, non-retryable, and sanitized.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- **Discovery requests and generated results are bounded** (issue #82).
|
|
27
|
+
`search_tools` accepts at most 100 results, `describe_tools` accepts at most
|
|
28
|
+
100 raw addresses, and both reject generated results above 256,000 UTF-8
|
|
29
|
+
bytes. Compact, JSON-schema, value, and code-mode paths share the same policy,
|
|
30
|
+
so alternate entry points cannot bypass it.
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- **Inbound HTTP-to-HTTPS upgrades preserve the configured public origin**
|
|
35
|
+
(issue #89). Protocol-relative, backslash, and control-character path forms
|
|
36
|
+
can no longer turn the upgrade response into an open redirect; ordinary
|
|
37
|
+
operator and private API paths still retain their path and query.
|
|
38
|
+
- **Downstream MCP redirects are validated before every target request**
|
|
39
|
+
(issue #81). Redirect loops, excessive chains, scheme downgrades, origin
|
|
40
|
+
changes, and credential-bearing URL targets now fail closed in both Node and
|
|
41
|
+
Workers.
|
|
42
|
+
|
|
43
|
+
## 0.7.0 — 2026-07-27
|
|
44
|
+
|
|
45
|
+
0.7.0 is the surface settlement: one release that finishes moving connecta's
|
|
46
|
+
public shape so that it can stop moving. It arrives from two directions at once.
|
|
47
|
+
A controlled qualification pass against 0.6.1 (issue #86) measured four ways a
|
|
48
|
+
deployment could be worn down — an unbounded cache, an enumerable callback, a
|
|
49
|
+
session leak, and a credential that reports itself usable and then isn't — and
|
|
50
|
+
those are fixed here. Meanwhile the config surface had accumulated eleven flat
|
|
51
|
+
tuning fields, the reference manual had reached 2,600 lines, and the operator UI
|
|
52
|
+
was one page pretending to be three. Those are settled here too, and settling
|
|
53
|
+
them breaks things, which is the argument for doing it in one release instead of
|
|
54
|
+
spreading it across three.
|
|
55
|
+
|
|
56
|
+
**What breaks.** Three things, and each is a compile error or a loud refusal
|
|
57
|
+
rather than a behavior change you have to notice on your own. Every flat 0.6.x
|
|
58
|
+
tuning option is removed in favour of four grouped ones. A connector that
|
|
59
|
+
implements `finishAuth` without `verifyState` can no longer complete OAuth. And
|
|
60
|
+
`/`, `/credentials`, and `/activity` are now core-owned routes, so a connector
|
|
61
|
+
`handleRequest` that served any of them is shadowed. The first is mechanical:
|
|
62
|
+
`createConnecta` throws once, before it reads anything else, naming every legacy
|
|
63
|
+
path it found and its replacement.
|
|
64
|
+
|
|
65
|
+
**What a deployment can ignore.** The defaults and runtime behavior of every
|
|
66
|
+
config option are unchanged — only the paths moved. `/ui` bookmarks keep working
|
|
67
|
+
through a permanent redirect, and all 17 documentation anchors still resolve
|
|
68
|
+
even though the manual is now nine files. If you configure connecta with a
|
|
69
|
+
literal object, do not paginate a downstream MCP server, and write your own
|
|
70
|
+
connectors against `remoteMcp`/`api` rather than hand-rolling `finishAuth`, the
|
|
71
|
+
whole migration is a mechanical rewrite of one config block.
|
|
72
|
+
|
|
73
|
+
### Breaking
|
|
74
|
+
|
|
75
|
+
- **`ConnectaConfig` tuning is grouped by subsystem for 0.7.0** (issue #28).
|
|
76
|
+
The flat 0.6.x options are removed rather than deprecated: TypeScript rejects
|
|
77
|
+
them, and JavaScript callers get one fail-fast error from `createConnecta`
|
|
78
|
+
listing every legacy own property it finds and its replacement. Supplying
|
|
79
|
+
both an old and a new path is still an error; there is no precedence rule or
|
|
80
|
+
compatibility alias. Migrate configuration as follows:
|
|
81
|
+
|
|
82
|
+
| 0.6.x | 0.7.0 |
|
|
83
|
+
|---|---|
|
|
84
|
+
| `activity` | `activity.store` |
|
|
85
|
+
| `activityReadGate` | `activity.readGate` |
|
|
86
|
+
| `activityDeploymentId` | `activity.deploymentId` |
|
|
87
|
+
| `credentialEncryptionKey` | `credentials.encryptionKey` |
|
|
88
|
+
| `credentialHealth` | `credentials.health` |
|
|
89
|
+
| `toolCacheTtlSeconds` | `discovery.catalogTtlSeconds` |
|
|
90
|
+
| `persistToolCatalog` | `discovery.persistCatalog` |
|
|
91
|
+
| `toolCatalogStaleSeconds` | `discovery.staleCatalogSeconds` |
|
|
92
|
+
| `probeTimeoutMs` | `discovery.probeTimeoutMs` |
|
|
93
|
+
| `defaultToolTimeoutMs` | `calls.defaultTimeoutMs` |
|
|
94
|
+
| `maxResultBytes` | `calls.maxResultBytes` |
|
|
95
|
+
|
|
96
|
+
For example:
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
// 0.6.x
|
|
100
|
+
createConnecta({
|
|
101
|
+
connectors,
|
|
102
|
+
storage,
|
|
103
|
+
activity,
|
|
104
|
+
credentialEncryptionKey: env.CONNECTA_CREDENTIAL_KEY,
|
|
105
|
+
toolCacheTtlSeconds: 300,
|
|
106
|
+
defaultToolTimeoutMs: 30_000,
|
|
107
|
+
maxResultBytes: 50_000,
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
// 0.7.0
|
|
111
|
+
createConnecta({
|
|
112
|
+
connectors,
|
|
113
|
+
storage,
|
|
114
|
+
activity: { store: activity },
|
|
115
|
+
credentials: { encryptionKey: env.CONNECTA_CREDENTIAL_KEY },
|
|
116
|
+
discovery: { catalogTtlSeconds: 300 },
|
|
117
|
+
calls: { defaultTimeoutMs: 30_000, maxResultBytes: 50_000 },
|
|
118
|
+
});
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
The defaults and runtime behavior of each option are unchanged. Connector
|
|
122
|
+
definitions keep their per-connector `maxResultBytes`, and structural seams
|
|
123
|
+
such as `storage`, `auth`, `connectors`, `toolkits`, and `executor` remain at
|
|
124
|
+
the top level.
|
|
125
|
+
- **A connector implementing `finishAuth` without `verifyState` can no longer
|
|
126
|
+
complete OAuth** (issue #62). Such a connector previously exchanged the
|
|
127
|
+
authorization code with no CSRF guard at all — connecta had no way to
|
|
128
|
+
establish that it had started the flow being completed. The callback now
|
|
129
|
+
refuses with the same opaque 400 as every other refusal, exchanges no code,
|
|
130
|
+
and logs one operator-grade line naming the connector and the missing hook.
|
|
131
|
+
`verifyState` stays optional in the type system and is required in practice
|
|
132
|
+
wherever `finishAuth` is present. The shipped `remoteMcp` OAuth provider has
|
|
133
|
+
always implemented it, so this reaches hand-written connectors only.
|
|
134
|
+
- **`/`, `/credentials`, and `/activity` are now core-owned routes** (issue
|
|
135
|
+
#57). They previously fell through to connector `handleRequest` and then to a
|
|
136
|
+
404, so a connector serving any of the three is now shadowed without warning.
|
|
137
|
+
`GET /` returns the operator shell where 0.6.1 returned 404, and non-GET on
|
|
138
|
+
those routes and on `/ui` returns 405 rather than falling through.
|
|
139
|
+
|
|
140
|
+
### Added
|
|
141
|
+
|
|
142
|
+
- **`Connector.closeScope?(ctx)`** (issue #66) — an optional, best-effort seam
|
|
143
|
+
for releasing whatever a connector opened for one scope. Called at most once,
|
|
144
|
+
inside a fixed 100 ms completion window: a hook that is absent, throws, or
|
|
145
|
+
never settles cannot replace, corrupt, or delay the result of the operation
|
|
146
|
+
that triggered it. `remoteMcp` implements it, tearing down cached and
|
|
147
|
+
half-open sessions and fencing late connection races. Connectors that do not
|
|
148
|
+
implement it are unaffected.
|
|
149
|
+
|
|
150
|
+
### Changed
|
|
151
|
+
|
|
152
|
+
- **The operator UI is now a direct-linkable three-page set** (issue #57):
|
|
153
|
+
Connections at `/`, Credentials at `/credentials`, and Activity at
|
|
154
|
+
`/activity`. `GET /ui` remains as a permanent `308` compatibility redirect to
|
|
155
|
+
`/`. The pages use semantic navigation, path-specific titles, direct
|
|
156
|
+
load/refresh/bookmark and Back/Forward behavior, and the same restrained
|
|
157
|
+
responsive connector-ledger design. They are three routes over one
|
|
158
|
+
no-build-step client implementation, not copied applications.
|
|
159
|
+
- **Every canonical operator route serves the same open, data-free shell.** The
|
|
160
|
+
nonce CSP, framing denial, referrer policy, HSTS behavior, content-type
|
|
161
|
+
protection, URL gates, and escaping guarantees formerly attached to `/ui`
|
|
162
|
+
apply equally to `/`, `/credentials`, and `/activity`. Deployment data remains
|
|
163
|
+
behind the unchanged private APIs: `/ui/data`, `/ui/activity`, and
|
|
164
|
+
`/ui/credentials/<connectorId>[/test]`.
|
|
165
|
+
- **Vault controls moved out of connector cards and into Credentials.**
|
|
166
|
+
Connections remains read-only status; Credentials preserves Add/Replace/Test/
|
|
167
|
+
Remove, masked metadata, stored-shape recovery, and live feedback without ever
|
|
168
|
+
returning a secret. Its explicit capability states cover eligible Clerk
|
|
169
|
+
operators, bearer-only sessions, missing vaults, and deployments with no
|
|
170
|
+
credential slots without broadening the existing Clerk/user-id/toolkit/
|
|
171
|
+
same-origin mutation boundary. Activity likewise renders an explicit
|
|
172
|
+
not-configured state when `activity.store.list` is absent. OAuth result pages
|
|
173
|
+
now return to `/`.
|
|
174
|
+
- **The reference manual is nine documents instead of one** (issue #61).
|
|
175
|
+
`docs/documentation.md` had reached 2,600 lines; it is now a compatibility
|
|
176
|
+
index that preserves all 17 `#N-…` anchors, so every existing deep link from
|
|
177
|
+
the README, the examples, and source comments still resolves. The prose moved
|
|
178
|
+
to `architecture`, `meta-tools`, `connectors`, `auth`,
|
|
179
|
+
`storage-and-credentials`, `operations`, `code-mode`, `operator-ui`, and
|
|
180
|
+
`toolkits`. A new `npm run check:docs` validates local links, fragments,
|
|
181
|
+
heading slugs, and the legacy-anchor manifest, and runs first in
|
|
182
|
+
`npm run check`. Contributor-facing only: the published package is unchanged
|
|
183
|
+
and docs still ship in no tarball.
|
|
184
|
+
|
|
185
|
+
### Fixed
|
|
186
|
+
|
|
187
|
+
- **`clerkAuth`'s identity-decision cache is bounded at 1,024 identities per
|
|
188
|
+
instance** (issue #70). It never evicted: every distinct identity that reached
|
|
189
|
+
the gate was retained for the lifetime of the isolate. `allowedDomains` made
|
|
190
|
+
that attacker-reachable on an open-signup Clerk instance, since an
|
|
191
|
+
authenticated-but-denied identity is still a cache entry — 100,000 denied
|
|
192
|
+
identities measured at roughly 11.96 MiB retained, with the oldest entry still
|
|
193
|
+
present. Eviction is LRU, so a small active set stays hot, and the only thing
|
|
194
|
+
evicting an entry can cause is a fresh check against Clerk: it can never turn
|
|
195
|
+
a denial into an admission, and it cannot extend an allow past its TTL, since
|
|
196
|
+
a cache hit re-inserts the same record rather than restamping it. The bound is
|
|
197
|
+
deliberately fixed rather than an operator knob, and the ~60 s allow / ~30 s
|
|
198
|
+
deny windows are unchanged.
|
|
199
|
+
- **`/oauth/callback/<id>` no longer lets an unauthenticated caller enumerate
|
|
200
|
+
configured connector ids** (issue #62). 0.6.1 answered `404 Unknown connector
|
|
201
|
+
"<id>"` for an id it did not recognise and a distinct 400 for a state
|
|
202
|
+
mismatch, which made the callback a free directory of every connector a
|
|
203
|
+
deployment had configured. Unknown ids, non-OAuth connectors, missing or
|
|
204
|
+
mismatched state, an absent verifier, and a throwing verifier now return one
|
|
205
|
+
byte-identical 400 — same status, same body, same headers. They also cost the
|
|
206
|
+
same single storage read, so the clock cannot sort the ids the body refuses to
|
|
207
|
+
name. That is cost equalisation rather than constant time, and the
|
|
208
|
+
documentation says so and enumerates what stays distinguishable. The precise
|
|
209
|
+
diagnosis moved to the operator log, bounded and escaped.
|
|
210
|
+
- **Probe-opened downstream MCP sessions are closed instead of abandoned**
|
|
211
|
+
(issue #66). Credential-health sweeps, `list_connectors({ probe: true })`, and
|
|
212
|
+
`/ui/data` each opened downstream sessions and left them for the provider to
|
|
213
|
+
age out — measured at 200 probes opening 200 sessions and explicitly closing
|
|
214
|
+
zero, made continuous by the periodic sweep. Closing now ends the session
|
|
215
|
+
rather than merely dropping the local client: `remoteMcp` issues the
|
|
216
|
+
specification's `DELETE` carrying `Mcp-Session-Id` *before* the close that
|
|
217
|
+
would otherwise abort it, feature-detected and best-effort, while a stateless
|
|
218
|
+
downstream issues none. A downstream that refuses, errors, or never answers is
|
|
219
|
+
closed anyway. One consequence worth knowing: a probing `list_connectors` now
|
|
220
|
+
runs on its own scope rather than the request's — it has to, since a request
|
|
221
|
+
scope cannot be closed — so a request that probes *and* then calls the same
|
|
222
|
+
connector opens two downstream sessions where it opened one. Per-request
|
|
223
|
+
`/mcp` scopes are unchanged.
|
|
224
|
+
- **A credential stored under an older declaration no longer reports itself
|
|
225
|
+
usable and then fails** (issue #69). `/ui`, the credential Test route, and
|
|
226
|
+
credential health each interpreted the stored shape slightly differently, so a
|
|
227
|
+
credential could render as configured and testable and then answer 409 with a
|
|
228
|
+
misleading configure-first message. One pure classifier now answers for all
|
|
229
|
+
three, and it asks about *containment* rather than equality: a stored set is
|
|
230
|
+
fine as long as it holds every field the declaration currently names. A
|
|
231
|
+
missing declared field is drift — which covers every case issue #69 reported,
|
|
232
|
+
including a rename and a swap between the single-value and named shapes in
|
|
233
|
+
either direction — and drift is never auto-migrated. Credentials keeps Replace
|
|
234
|
+
and Remove and hides Test, the test route answers 409 without calling a hook,
|
|
235
|
+
and health records an explicit error rather than a fabricated verdict, checked
|
|
236
|
+
before the freshness gate so a stale `ok` cannot mask a redeploy. Leftover
|
|
237
|
+
keys are explicitly *not* drift: dropping a field from a declaration leaves
|
|
238
|
+
its secret in the vault, but every accessor keeps returning the right value
|
|
239
|
+
and every call keeps working, so calling that drift would tell an operator to
|
|
240
|
+
re-enter a credential that works and that many providers will not reissue in
|
|
241
|
+
readable form. Credentials prints one non-blocking line naming the leftovers
|
|
242
|
+
instead. A repeated drift verdict is charged to the freshness budget rather
|
|
243
|
+
than rewritten on every sweep in every isolate.
|
|
244
|
+
- **A paginated downstream MCP server no longer loses everything after its
|
|
245
|
+
first `tools/list` page** (issue #77). `tools/list` is cursor-paginated in the
|
|
246
|
+
MCP specification and the SDK's `Client.listTools()` returns one page,
|
|
247
|
+
`nextCursor` included, without following it. `remoteMcp()` called it once, so
|
|
248
|
+
a downstream that paged its catalog was split in half without complaint:
|
|
249
|
+
page-one tools were counted, searchable, describable and callable, and every
|
|
250
|
+
tool after them appeared not to exist — missing from `list_connectors` counts,
|
|
251
|
+
`search_tools`, `describe_tools`, and address resolution alike, with nothing
|
|
252
|
+
in any log saying a page had been left behind. That is the wrong failure for
|
|
253
|
+
a product whose premise is progressive discovery over large tool catalogs,
|
|
254
|
+
since large catalogs are exactly the ones that paginate. A catalog refresh now
|
|
255
|
+
walks the whole cursor chain on the same request-scoped client before the
|
|
256
|
+
result is indexed. Cursors are handed back byte-for-byte and never parsed,
|
|
257
|
+
rewritten, or persisted; an empty-string `nextCursor` is treated as *present*
|
|
258
|
+
(pagination ends on an absent one, and a truthiness check there would truncate
|
|
259
|
+
the catalog silently). A downstream that advertises no `nextCursor` is
|
|
260
|
+
unchanged in both directions: one request, sent with no `cursor` param, and
|
|
261
|
+
byte-identical tool definitions. Tools are deduplicated by name, first page
|
|
262
|
+
wins, so an unstable cursor that overlaps pages cannot inflate `toolCount`,
|
|
263
|
+
double a `search_tools` row, or churn the registry into a persistence write
|
|
264
|
+
per refresh. A `nextCursor: null` — a common JSON idiom for end-of-pagination
|
|
265
|
+
that the MCP result schema does not accept — is now reported as a named
|
|
266
|
+
nonconformance instead of a raw Zod dump. Any page that fails fails the whole
|
|
267
|
+
refresh rather than publishing a prefix, so the registry keeps serving the
|
|
268
|
+
last complete catalog through its existing stale fallback.
|
|
269
|
+
|
|
270
|
+
The walk is bounded on **tools**, not pages. A page ceiling is the wrong
|
|
271
|
+
dimension — the server picks the page size, so N pages is N × a number
|
|
272
|
+
connecta cannot observe, and the common conformant idiom of "advertise a
|
|
273
|
+
cursor whenever the page came back full, then serve one empty page to
|
|
274
|
+
terminate" means a well-behaved 10,000-tool server paging at 100 spends 101
|
|
275
|
+
requests. So a refresh now fails immediately on a cursor handed back twice,
|
|
276
|
+
fails on two consecutive pages that add nothing while still promising more
|
|
277
|
+
(one is legal — that empty terminator), caps what it accumulates at
|
|
278
|
+
`MAX_TOOLS` (100,000, the top of the catalog envelope issue #82 benchmarks),
|
|
279
|
+
and keeps `MAX_TOOL_PAGES` (raised to 10,000) only as an unreachable runaway
|
|
280
|
+
backstop. These bounds make an unterminating walk finite and report it as a
|
|
281
|
+
connector error; they do not cancel one that a probe deadline has already
|
|
282
|
+
abandoned, because `withTimeout` bounds the caller's wait rather than the
|
|
283
|
+
work.
|
|
284
|
+
|
|
285
|
+
- **Downstream output-schema validation now covers every page of a paginated
|
|
286
|
+
catalog, not just the last one** (issue #77). The MCP SDK's
|
|
287
|
+
`Client.listTools()` rebuilds its output-schema validators and task-support
|
|
288
|
+
sets from each page it receives, clearing them first — so walking the cursor
|
|
289
|
+
chain left the request-scoped client validating the final page alone. A
|
|
290
|
+
`call_tool` against any earlier-page tool then found no validator and
|
|
291
|
+
silently skipped both the "declared an `outputSchema` but returned no
|
|
292
|
+
`structuredContent`" check and the structured-content validation, and lost
|
|
293
|
+
the required-task guard with them. Enforcement depended on which page a tool
|
|
294
|
+
happened to land on. A completed walk now re-primes that cache once from the
|
|
295
|
+
full aggregated catalog; a test asserts the pinned SDK still provides the
|
|
296
|
+
method it reaches for, so a future bump fails CI rather than quietly
|
|
297
|
+
restoring the gap.
|
|
298
|
+
|
|
5
299
|
## 0.6.1 — 2026-07-26
|
|
6
300
|
|
|
7
301
|
A patch release: three bug fixes and a documentation overhaul. No new
|
package/README.md
CHANGED
|
@@ -62,12 +62,13 @@ platform to administer.
|
|
|
62
62
|
|
|
63
63
|
**Credentials stay server-side.** Downstream tokens live in an AES-GCM encrypted
|
|
64
64
|
vault over the deployment's own storage, with the key held outside it. A
|
|
65
|
-
connector reaches its own credential through `ctx.credential`;
|
|
66
|
-
meta-tools, and
|
|
67
|
-
is an operator action rather than a redeploy — though writing
|
|
68
|
-
deliberately narrower than everything else, requiring a
|
|
69
|
-
operator on a same-origin request, so a bearer-only
|
|
70
|
-
credentials from the browser. Which tools exist
|
|
65
|
+
connector reaches its own credential through `ctx.credential`; the operator
|
|
66
|
+
pages, meta-tools, and code sandbox never expose a secret value. Rotating a token
|
|
67
|
+
at `/credentials` is an operator action rather than a redeploy — though writing
|
|
68
|
+
to the vault is deliberately narrower than everything else, requiring a
|
|
69
|
+
Clerk-authenticated operator on a same-origin request, so a bearer-only
|
|
70
|
+
deployment cannot administer credentials from the browser. Which tools exist
|
|
71
|
+
is still code either way.
|
|
71
72
|
|
|
72
73
|
**Read-only is fail-closed.** Only tools explicitly annotated `readOnlyHint:
|
|
73
74
|
true` are reachable through `call_tool`, `batch_call`, and the sandbox. Missing,
|
|
@@ -93,14 +94,16 @@ generated code, search text, or raw error messages. The exclusion is structural
|
|
|
93
94
|
rather than a redaction pass: the event type has nowhere to put a payload, which
|
|
94
95
|
is what keeps an operations log from becoming something worth stealing.
|
|
95
96
|
|
|
96
|
-
**
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
**Operator pages that cannot administer the deployment.** Connections at `GET /`
|
|
98
|
+
shows connector health, tool counts, and downstream authorization links;
|
|
99
|
+
`/credentials` rotates stored secrets; and `/activity` shows the optional
|
|
100
|
+
payload-free ledger. They share one data-free shell with no build step and use
|
|
101
|
+
authenticated private APIs for deployment data. They cannot add a connector,
|
|
102
|
+
change policy, or alter what an agent may call. Credentials connecta stores are
|
|
103
|
+
also probed for liveness
|
|
101
104
|
proactively — using each connector's own test or status hook, never a downstream
|
|
102
105
|
tool call — so a dead token surfaces as `auth_required` with the URL to open on
|
|
103
|
-
|
|
106
|
+
Connections and in `list_connectors` before an agent's real call trips over it.
|
|
104
107
|
|
|
105
108
|
## When not to use it
|
|
106
109
|
|
|
@@ -154,7 +157,7 @@ const connecta = createConnecta({
|
|
|
154
157
|
],
|
|
155
158
|
});
|
|
156
159
|
|
|
157
|
-
listen(connecta, 8787); // MCP at
|
|
160
|
+
listen(connecta, 8787); // MCP at /mcp; Connections at http://localhost:8787/
|
|
158
161
|
```
|
|
159
162
|
|
|
160
163
|
Point an MCP client at `http://localhost:8787/mcp` with an
|
|
@@ -180,13 +183,14 @@ endpoint, credential, and tool choices stay in your project, declared with
|
|
|
180
183
|
## Learn more
|
|
181
184
|
|
|
182
185
|
- **[Documentation](https://github.com/zackbart/connecta/blob/main/docs/documentation.md)**
|
|
183
|
-
— the reference
|
|
184
|
-
OAuth, storage, Clerk setup, testing, and troubleshooting. Start
|
|
185
|
-
[meta-tools reference](https://github.com/zackbart/connecta/blob/main/docs/
|
|
186
|
-
the [config options](https://github.com/zackbart/connecta/blob/main/docs/
|
|
187
|
-
[code mode](https://github.com/zackbart/connecta/blob/main/docs/
|
|
188
|
-
[toolkits](https://github.com/zackbart/connecta/blob/main/docs/
|
|
189
|
-
|
|
186
|
+
— the reference index for architecture, connectors, inbound auth and
|
|
187
|
+
downstream OAuth, storage, Clerk setup, testing, and troubleshooting. Start
|
|
188
|
+
with the [meta-tools reference](https://github.com/zackbart/connecta/blob/main/docs/meta-tools.md#meta-tools-reference),
|
|
189
|
+
the [config options](https://github.com/zackbart/connecta/blob/main/docs/operations.md#running-it),
|
|
190
|
+
[code mode](https://github.com/zackbart/connecta/blob/main/docs/code-mode.md#code-mode-execute_code),
|
|
191
|
+
[toolkits](https://github.com/zackbart/connecta/blob/main/docs/toolkits.md#toolkits-scoped-views),
|
|
192
|
+
[operator pages](https://github.com/zackbart/connecta/blob/main/docs/operator-ui.md#status-ui),
|
|
193
|
+
or [credential health](https://github.com/zackbart/connecta/blob/main/docs/storage-and-credentials.md#credential-health-proactive-liveness-checks).
|
|
190
194
|
- **[Decisions](https://github.com/zackbart/connecta/blob/main/docs/decisions.md)**
|
|
191
195
|
— what connecta refuses to be, which alternatives lost and why, and the
|
|
192
196
|
invariants a change must preserve.
|
package/dist/auth/bearer.d.ts
CHANGED
|
@@ -9,9 +9,10 @@ export interface BearerTokenOptions extends ToolkitBindingOptions {
|
|
|
9
9
|
* against `secret`. Checked BEFORE the Clerk gate in the server; a mismatch
|
|
10
10
|
* falls through so a co-configured Clerk provider can still admit the request.
|
|
11
11
|
*
|
|
12
|
-
* `toolkits` binds the token to named toolkits (
|
|
13
|
-
* team credential, each naming the view that team may
|
|
14
|
-
* token stays unbound — every declared toolkit plus the
|
|
12
|
+
* `toolkits` binds the token to named toolkits (docs/toolkits.md): one
|
|
13
|
+
* `bearerToken(...)` per team credential, each naming the view that team may
|
|
14
|
+
* open. Omit it and the token stays unbound — every declared toolkit plus the
|
|
15
|
+
* full registry.
|
|
15
16
|
*/
|
|
16
17
|
export declare function bearerToken(secret: string, options?: BearerTokenOptions): InboundAuth;
|
|
17
18
|
//# sourceMappingURL=bearer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bearer.d.ts","sourceRoot":"","sources":["../../src/auth/bearer.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,aAAa,CAAC;AAiB3D,MAAM,WAAW,kBAAmB,SAAQ,qBAAqB;IAC/D,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED
|
|
1
|
+
{"version":3,"file":"bearer.d.ts","sourceRoot":"","sources":["../../src/auth/bearer.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,aAAa,CAAC;AAiB3D,MAAM,WAAW,kBAAmB,SAAQ,qBAAqB;IAC/D,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,kBAAuB,GAC/B,WAAW,CAkDb"}
|
package/dist/auth/bearer.js
CHANGED
|
@@ -19,9 +19,10 @@ function timingSafeEqual(a, b) {
|
|
|
19
19
|
* against `secret`. Checked BEFORE the Clerk gate in the server; a mismatch
|
|
20
20
|
* falls through so a co-configured Clerk provider can still admit the request.
|
|
21
21
|
*
|
|
22
|
-
* `toolkits` binds the token to named toolkits (
|
|
23
|
-
* team credential, each naming the view that team may
|
|
24
|
-
* token stays unbound — every declared toolkit plus the
|
|
22
|
+
* `toolkits` binds the token to named toolkits (docs/toolkits.md): one
|
|
23
|
+
* `bearerToken(...)` per team credential, each naming the view that team may
|
|
24
|
+
* open. Omit it and the token stays unbound — every declared toolkit plus the
|
|
25
|
+
* full registry.
|
|
25
26
|
*/
|
|
26
27
|
export function bearerToken(secret, options = {}) {
|
|
27
28
|
const secretBytes = encoder.encode(secret);
|
|
@@ -30,11 +31,12 @@ export function bearerToken(secret, options = {}) {
|
|
|
30
31
|
: "bearerToken", options);
|
|
31
32
|
if (toolkitBinding && !options.subjectId) {
|
|
32
33
|
// A bound token stands for one team, and both surfaces that report on it —
|
|
33
|
-
// the 403 refusal log (
|
|
34
|
-
// "bearer" without a subjectId. With
|
|
35
|
-
//
|
|
36
|
-
// succeeded. console.warn (as the
|
|
37
|
-
//
|
|
34
|
+
// the 403 refusal log (docs/toolkits.md) and activity events
|
|
35
|
+
// (docs/operator-ui.md) — can only say "bearer" without a subjectId. With
|
|
36
|
+
// several bound tokens that makes an operator unable to tell which
|
|
37
|
+
// credential was refused, or whose call succeeded. console.warn (as the
|
|
38
|
+
// Clerk adapter does) because an adapter is constructed before
|
|
39
|
+
// `createConnecta` has a logger to hand it.
|
|
38
40
|
console.warn("[connecta] bearerToken is bound to toolkits " +
|
|
39
41
|
`(${toolkitBinding.toolkits.join(", ") || "unscoped only"}) but has no ` +
|
|
40
42
|
"subjectId: refusal logs and activity events cannot say which " +
|
package/dist/auth/bearer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bearer.js","sourceRoot":"","sources":["../../src/auth/bearer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,GAEtB,MAAM,gBAAgB,CAAC;AAGxB,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAElC,qFAAqF;AACrF,SAAS,eAAe,CAAC,CAAa,EAAE,CAAa;IACnD,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;QAC1B,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,MAAM,CAAC,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IAAI,KAAK,IAAI,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,CAAC;gBACpE,OAAO;oBACL,EAAE,EAAE,IAAI;oBACR,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBAC/D,CAAC;YACJ,CAAC;YACD,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,QAAQ,EAAE,IAAI,QAAQ,CACpB,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,EACzC;oBACE,MAAM,EAAE,GAAG;oBACX,OAAO,EAAE;wBACP,cAAc,EAAE,kBAAkB;wBAClC,kBAAkB,EAAE,QAAQ;qBAC7B;iBACF,CACF;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/auth/clerk.d.ts
CHANGED
|
@@ -23,9 +23,9 @@ export interface ClerkAuthOptions extends ToolkitBindingOptions {
|
|
|
23
23
|
gate?: (userId: string, clerk: ClerkClient) => boolean | Promise<boolean>;
|
|
24
24
|
/** Advertised scopes in protected-resource metadata. */
|
|
25
25
|
scopes?: string[];
|
|
26
|
-
/** Optional hosted Account Portal sign-in URL for
|
|
26
|
+
/** Optional hosted Account Portal sign-in URL for operator pages. Absolute https only. */
|
|
27
27
|
signInUrl?: string;
|
|
28
|
-
/** Optional hosted Account Portal sign-up URL for
|
|
28
|
+
/** Optional hosted Account Portal sign-up URL for operator pages. Absolute https only. */
|
|
29
29
|
signUpUrl?: string;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
@@ -34,11 +34,12 @@ export interface ClerkAuthOptions extends ToolkitBindingOptions {
|
|
|
34
34
|
* `allowedDomains` and `gate` decide WHO is admitted (both must pass);
|
|
35
35
|
* `toolkits` decides WHICH view the admitted user gets.
|
|
36
36
|
*
|
|
37
|
-
* `toolkits` binds every user this provider admits to those toolkits
|
|
38
|
-
* a per-team split, configure one `clerkAuth(...)` per
|
|
39
|
-
* `gate` naming that team's users, and that team's
|
|
40
|
-
* providers in order and the first that admits the
|
|
41
|
-
* a user one gate rejects falls through to the
|
|
37
|
+
* `toolkits` binds every user this provider admits to those toolkits
|
|
38
|
+
* (docs/toolkits.md). For a per-team split, configure one `clerkAuth(...)` per
|
|
39
|
+
* team — the same keys, a `gate` naming that team's users, and that team's
|
|
40
|
+
* `toolkits`. The server tries providers in order and the first that admits the
|
|
41
|
+
* user supplies the binding, so a user one gate rejects falls through to the
|
|
42
|
+
* next.
|
|
42
43
|
*/
|
|
43
44
|
export declare function clerkAuth(opts: ClerkAuthOptions): InboundAuth;
|
|
44
45
|
export {};
|
package/dist/auth/clerk.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clerk.d.ts","sourceRoot":"","sources":["../../src/auth/clerk.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,aAAa,CAAC;AAE3D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAExD,MAAM,WAAW,gBAAiB,SAAQ,qBAAqB;IAC7D,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;OAUG;IACH,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,8EAA8E;IAC9E,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1E,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"clerk.d.ts","sourceRoot":"","sources":["../../src/auth/clerk.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,aAAa,CAAC;AAE3D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAExD,MAAM,WAAW,gBAAiB,SAAQ,qBAAqB;IAC7D,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;OAUG;IACH,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,8EAA8E;IAC9E,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1E,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA+ID;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,gBAAgB,GAAG,WAAW,CAuP7D"}
|
package/dist/auth/clerk.js
CHANGED
|
@@ -28,6 +28,11 @@ function fapiUrl(publishableKey) {
|
|
|
28
28
|
}
|
|
29
29
|
const GATE_ALLOWED_TTL_MS = 60 * 1000;
|
|
30
30
|
const GATE_FORBIDDEN_TTL_MS = 30 * 1000;
|
|
31
|
+
// Per clerkAuth instance. This is deliberately fixed rather than an operator
|
|
32
|
+
// knob: admission correctness never depends on retaining an entry, and 1,024
|
|
33
|
+
// keeps the common steady identity set hot without letting one-off denied
|
|
34
|
+
// identities define the isolate's lifetime memory footprint.
|
|
35
|
+
const GATE_CACHE_MAX_IDENTITIES = 1_024;
|
|
31
36
|
/**
|
|
32
37
|
* One label of a domain: ASCII letters/digits, interior hyphens only, 63
|
|
33
38
|
* characters at most. ASCII-only is deliberate — an internationalized domain
|
|
@@ -127,11 +132,12 @@ function emailDomain(email) {
|
|
|
127
132
|
* `allowedDomains` and `gate` decide WHO is admitted (both must pass);
|
|
128
133
|
* `toolkits` decides WHICH view the admitted user gets.
|
|
129
134
|
*
|
|
130
|
-
* `toolkits` binds every user this provider admits to those toolkits
|
|
131
|
-
* a per-team split, configure one `clerkAuth(...)` per
|
|
132
|
-
* `gate` naming that team's users, and that team's
|
|
133
|
-
* providers in order and the first that admits the
|
|
134
|
-
* a user one gate rejects falls through to the
|
|
135
|
+
* `toolkits` binds every user this provider admits to those toolkits
|
|
136
|
+
* (docs/toolkits.md). For a per-team split, configure one `clerkAuth(...)` per
|
|
137
|
+
* team — the same keys, a `gate` naming that team's users, and that team's
|
|
138
|
+
* `toolkits`. The server tries providers in order and the first that admits the
|
|
139
|
+
* user supplies the binding, so a user one gate rejects falls through to the
|
|
140
|
+
* next.
|
|
135
141
|
*/
|
|
136
142
|
export function clerkAuth(opts) {
|
|
137
143
|
const clerk = createClerkClient({
|
|
@@ -205,8 +211,16 @@ export function clerkAuth(opts) {
|
|
|
205
211
|
if (!opts.gate && !allowedDomains)
|
|
206
212
|
return true;
|
|
207
213
|
const hit = gateCache.get(userId);
|
|
208
|
-
if (hit
|
|
209
|
-
|
|
214
|
+
if (hit) {
|
|
215
|
+
if (Date.now() < hit.exp) {
|
|
216
|
+
// Map iteration order is the LRU order. Refreshing a valid hit keeps a
|
|
217
|
+
// small active identity set resident when one-off identities churn.
|
|
218
|
+
gateCache.delete(userId);
|
|
219
|
+
gateCache.set(userId, hit);
|
|
220
|
+
return hit.allowed;
|
|
221
|
+
}
|
|
222
|
+
gateCache.delete(userId);
|
|
223
|
+
}
|
|
210
224
|
let allowed = false;
|
|
211
225
|
try {
|
|
212
226
|
allowed =
|
|
@@ -221,6 +235,11 @@ export function clerkAuth(opts) {
|
|
|
221
235
|
exp: Date.now() +
|
|
222
236
|
(allowed ? GATE_ALLOWED_TTL_MS : GATE_FORBIDDEN_TTL_MS),
|
|
223
237
|
});
|
|
238
|
+
if (gateCache.size > GATE_CACHE_MAX_IDENTITIES) {
|
|
239
|
+
const oldest = gateCache.keys().next();
|
|
240
|
+
if (!oldest.done)
|
|
241
|
+
gateCache.delete(oldest.value);
|
|
242
|
+
}
|
|
224
243
|
return allowed;
|
|
225
244
|
};
|
|
226
245
|
return {
|
|
@@ -269,7 +288,7 @@ export function clerkAuth(opts) {
|
|
|
269
288
|
let userId;
|
|
270
289
|
try {
|
|
271
290
|
const state = await clerk.authenticateRequest(request, {
|
|
272
|
-
// MCP clients use Clerk OAuth access tokens; the browser
|
|
291
|
+
// MCP clients use Clerk OAuth access tokens; the browser operator UI
|
|
273
292
|
// uses the signed-in operator's short-lived Clerk session token.
|
|
274
293
|
// authorizedParties must NOT be passed here: OAuth access tokens may
|
|
275
294
|
// be JWTs without an azp claim, and Clerk rejects azp=undefined when
|
package/dist/auth/clerk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clerk.js","sourceRoot":"","sources":["../../src/auth/clerk.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,gFAAgF;AAChF,yBAAyB;AAEzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACL,qBAAqB,GAEtB,MAAM,gBAAgB,CAAC;AAgCxB,MAAM,YAAY,GAAG;IACnB,6BAA6B,EAAE,GAAG;IAClC,8BAA8B,EAAE,oBAAoB;IACpD,8BAA8B,EAC5B,mDAAmD;CACtD,CAAC;AAEF,oEAAoE;AACpE,SAAS,UAAU,CAAC,OAAgB;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4BACT,QAAQ,EAAE,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC;yBAC9C,CAAC;oBACJ,CAAC;gBACH,CAAC;gBACD,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,SAAS,CAAC;YACrC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,IAAI,CACV,+CACE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CACvD,eAAe,UAAU,CAAC,OAAO,CAAC,EAAE,CACrC,CAAC;gBACF,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;YAC9D,CAAC;YACD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;YAC9D,CAAC;YACD,IAAI,CAAC,CAAC,MAAM,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;gBAC/B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,CAAC;YAC9C,CAAC;YACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC9B,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Connector, ConnectorContext } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Tell a connector that a scope owned by the core has ended.
|
|
4
|
+
*
|
|
5
|
+
* Scope teardown is deliberately best-effort: a missing hook is a no-op and a
|
|
6
|
+
* rejected hook is swallowed so cleanup can never replace the probe result that
|
|
7
|
+
* caused it. The hook gets a small, fixed completion window so edge runtimes do
|
|
8
|
+
* not cut off a real close as the response ends, but one that never settles
|
|
9
|
+
* cannot hold the completed probe open indefinitely. Callers own the
|
|
10
|
+
* at-most-once guarantee and must not use the scope again after this returns.
|
|
11
|
+
*/
|
|
12
|
+
export declare function closeConnectorScope(connector: Connector, ctx: ConnectorContext): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=connector-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connector-scope.d.ts","sourceRoot":"","sources":["../src/connector-scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAK9D;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,gBAAgB,GACpB,OAAO,CAAC,IAAI,CAAC,CAsBf"}
|