@zackbart/connecta 0.22.3 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +5 -0
- package/CHANGELOG.md +82 -0
- package/README.md +19 -11
- package/dist/activity-friction.d.ts +3 -0
- package/dist/activity-friction.js +19 -0
- package/dist/activity.d.ts +11 -2
- package/dist/activity.js +15 -19
- package/dist/auth/downstream-oauth.d.ts +2 -1
- package/dist/auth/downstream-oauth.js +10 -1
- package/dist/branding.d.ts +67 -0
- package/dist/branding.js +176 -0
- package/dist/catalog-service.d.ts +1 -6
- package/dist/catalog-service.js +3 -53
- package/dist/connectors/remote-mcp.js +3 -5
- package/dist/credential-contract.d.ts +24 -0
- package/dist/credential-contract.js +1 -0
- package/dist/credential-rules.d.ts +85 -0
- package/dist/credential-rules.js +107 -0
- package/dist/credentials.d.ts +4 -100
- package/dist/credentials.js +3 -107
- package/dist/errors.d.ts +1 -1
- package/dist/execute.d.ts +5 -52
- package/dist/execute.js +40 -347
- package/dist/executors/quickjs-protocol.d.ts +0 -7
- package/dist/executors/quickjs-protocol.js +2 -10
- package/dist/executors/quickjs.js +1 -1
- package/dist/index.d.ts +23 -56
- package/dist/index.js +30 -58
- package/dist/invocation.d.ts +0 -33
- package/dist/invocation.js +56 -124
- package/dist/meta-tools.d.ts +7 -6
- package/dist/meta-tools.js +14 -21
- package/dist/module-contracts.d.ts +19 -0
- package/dist/module-contracts.js +1 -0
- package/dist/operator-ui/generated.js +2 -2
- package/dist/operator-ui/model.d.ts +6 -3
- package/dist/operator-ui/view.d.ts +2 -18
- package/dist/operator-ui/view.js +3 -20
- package/dist/registry.d.ts +4 -1
- package/dist/registry.js +8 -6
- package/dist/routes/activity.js +1 -1
- package/dist/routes/credentials.js +5 -2
- package/dist/routes/mcp.js +7 -51
- package/dist/routes/oauth-management.d.ts +2 -0
- package/dist/routes/oauth-management.js +108 -0
- package/dist/routes/oauth.d.ts +0 -1
- package/dist/routes/oauth.js +21 -121
- package/dist/routes/shared.d.ts +19 -17
- package/dist/routes/shared.js +48 -44
- package/dist/routes/ui.js +36 -33
- package/dist/server.d.ts +1 -2
- package/dist/server.js +7 -45
- package/dist/skills.d.ts +1 -1
- package/dist/skills.js +55 -19
- package/dist/types.d.ts +3 -15
- package/dist/ui.d.ts +15 -70
- package/dist/ui.js +176 -317
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/documentation/architecture.md +31 -26
- package/documentation/auth.md +65 -111
- package/documentation/call-admission.md +10 -11
- package/documentation/cloudflare.md +1 -1
- package/documentation/code-mode.md +65 -260
- package/documentation/connectors.md +8 -6
- package/documentation/linear.md +1 -1
- package/documentation/meta-tools.md +37 -18
- package/documentation/mixpanel.md +1 -1
- package/documentation/notion.md +2 -2
- package/documentation/operations.md +19 -23
- package/documentation/operator-ui.md +82 -104
- package/documentation/optional-modules-upgrade.md +243 -0
- package/documentation/provider-conventions.md +7 -5
- package/documentation/revenuecat.md +1 -1
- package/documentation/storage-and-credentials.md +59 -40
- package/documentation/stripe.md +1 -1
- package/documentation/upgrading.md +83 -8
- package/ethos.md +36 -43
- package/examples/worker/AGENTS.md +3 -1
- package/examples/worker/README.md +68 -84
- package/examples/worker/src/d1-activity.ts +1 -1
- package/examples/worker/src/index.ts +11 -6
- package/package.json +18 -2
- package/templates/node/AGENTS.md +8 -6
- package/templates/node/README.md +56 -67
- package/templates/node/package.json +1 -1
- package/templates/node/src/file-activity.ts +1 -1
- package/templates/node/src/index.ts +11 -12
- package/dist/access-tokens.d.ts +0 -31
- package/dist/access-tokens.js +0 -236
- package/dist/apps-shell.d.ts +0 -37
- package/dist/apps-shell.js +0 -174
- package/dist/routes/access-tokens.d.ts +0 -6
- package/dist/routes/access-tokens.js +0 -83
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# Upgrade to 0.24.0 optional modules
|
|
2
|
+
|
|
3
|
+
This is a breaking configuration change. Core still owns the same seven tools,
|
|
4
|
+
connector discovery, execution, invocation, and enforcement. UI, encrypted
|
|
5
|
+
credential storage, activity history, and configured bearer authentication now
|
|
6
|
+
have explicit imports. Select features when constructing the deployment;
|
|
7
|
+
there is no runtime plugin installation or registration.
|
|
8
|
+
|
|
9
|
+
Do this migration in the deployment repository on a branch. Do not re-run
|
|
10
|
+
`connecta init`, replace the connector set, or copy a template over local code.
|
|
11
|
+
The examples below omit unchanged connectors, executors, and storage adapters.
|
|
12
|
+
Install and pin `@zackbart/connecta@0.24.0` after completing the migration.
|
|
13
|
+
|
|
14
|
+
### Configuration and import changes
|
|
15
|
+
|
|
16
|
+
| Before | After |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| UI implicitly available | Import `operatorUi` from `@zackbart/connecta/ui` and set `ui: operatorUi()` |
|
|
19
|
+
| Root `branding` | `ui: operatorUi({ branding })` |
|
|
20
|
+
| `credentials: { encryptionKey }` | Import `encryptedCredentialVault` from `@zackbart/connecta/credentials`; set `vault: encryptedCredentialVault(storage, encryptionKey)` |
|
|
21
|
+
| `activity: { store, deploymentId, readGate }` | Import `activityHistory` from `@zackbart/connecta/activity`; set `activity: activityHistory({ store, deploymentId, readGate })` |
|
|
22
|
+
| Root `bearerToken` import | Import from `@zackbart/connecta/auth/bearer`; preserve its token and subject configuration |
|
|
23
|
+
| `accessTokens: { ... }` | Remove after migrating every client that uses a Connecta-issued token |
|
|
24
|
+
| `identity.operatorAccess` | `identity.activityAccess` for global activity reads; grant auth management separately |
|
|
25
|
+
| Visibility implicitly permits auth changes | Explicit `credentialAdministration` for shared auth and `personalConnection` for personal auth; both default to `"none"` |
|
|
26
|
+
|
|
27
|
+
Removed configuration is refused at construction. Do not silence TypeScript
|
|
28
|
+
errors with casts; they identify decisions this upgrade needs you to make.
|
|
29
|
+
|
|
30
|
+
Before:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { createConnecta, bearerToken } from "@zackbart/connecta";
|
|
34
|
+
|
|
35
|
+
const connecta = createConnecta({
|
|
36
|
+
connectors,
|
|
37
|
+
executor,
|
|
38
|
+
storage,
|
|
39
|
+
auth: [bearerToken(token), interactiveAuth],
|
|
40
|
+
branding,
|
|
41
|
+
credentials: { encryptionKey },
|
|
42
|
+
accessTokens: {},
|
|
43
|
+
activity: { store: activityStore, deploymentId: "production" },
|
|
44
|
+
identity: {
|
|
45
|
+
connectorAccess,
|
|
46
|
+
operatorAccess: isOwner,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
After, with the same features except issued tokens:
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import { createConnecta } from "@zackbart/connecta";
|
|
55
|
+
import { bearerToken } from "@zackbart/connecta/auth/bearer";
|
|
56
|
+
import { operatorUi } from "@zackbart/connecta/ui";
|
|
57
|
+
import { encryptedCredentialVault } from "@zackbart/connecta/credentials";
|
|
58
|
+
import { activityHistory } from "@zackbart/connecta/activity";
|
|
59
|
+
|
|
60
|
+
const connecta = createConnecta({
|
|
61
|
+
connectors,
|
|
62
|
+
executor,
|
|
63
|
+
storage,
|
|
64
|
+
auth: [bearerToken(token), interactiveAuth],
|
|
65
|
+
ui: operatorUi({ branding }),
|
|
66
|
+
vault: encryptedCredentialVault(storage, encryptionKey),
|
|
67
|
+
activity: activityHistory({ store: activityStore, deploymentId: "production" }),
|
|
68
|
+
identity: {
|
|
69
|
+
connectorAccess,
|
|
70
|
+
credentialAdministration: ({ principal }) =>
|
|
71
|
+
principal && isOwner(principal) ? "all" : "none",
|
|
72
|
+
personalConnection: () => "all",
|
|
73
|
+
activityAccess: isOwner,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`personalConnection: () => "all"` permits visible personal connections for
|
|
79
|
+
interactive principals. It does not permit shared grant changes or create a
|
|
80
|
+
principal for bearer or service identities. Use an explicit list of connector
|
|
81
|
+
ids if only some personal connections should be connectable.
|
|
82
|
+
|
|
83
|
+
### Decide permissions explicitly
|
|
84
|
+
|
|
85
|
+
A teammate who can use a shared connector should not automatically be able to
|
|
86
|
+
replace the credentials everybody uses. Preserve the existing
|
|
87
|
+
`connectorAccess` resolver, then add the two management resolvers. They return
|
|
88
|
+
`"all"`, `"none"`, or declared connector ids and intersect with visibility.
|
|
89
|
+
Thrown resolvers and unknown ids fail closed. Literal deployment-provided
|
|
90
|
+
secrets remain configuration; UI permissions do not make them editable.
|
|
91
|
+
|
|
92
|
+
For a team Worker using Cloudflare Access:
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
import { cloudflareAccessAuth } from "@zackbart/connecta/auth/cloudflare-access";
|
|
96
|
+
|
|
97
|
+
import type { ConnectaConfig } from "@zackbart/connecta";
|
|
98
|
+
|
|
99
|
+
const identity: NonNullable<ConnectaConfig["identity"]> = {
|
|
100
|
+
connectorAccess: ({ principal }) =>
|
|
101
|
+
principal?.id === "owner-access-id" ? "all" : ["shared_docs", "personal_linear"],
|
|
102
|
+
credentialAdministration: ({ principal }) =>
|
|
103
|
+
principal?.id === "owner-access-id" ? "all" : "none",
|
|
104
|
+
personalConnection: () => ["personal_linear"],
|
|
105
|
+
activityAccess: ({ id }) => id === "owner-access-id",
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
createConnecta({
|
|
109
|
+
connectors, executor, storage,
|
|
110
|
+
auth: cloudflareAccessAuth(),
|
|
111
|
+
identity,
|
|
112
|
+
ui: operatorUi(),
|
|
113
|
+
vault: encryptedCredentialVault(storage, encryptionKey),
|
|
114
|
+
});
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Use ids declared in this deployment and the real identity provider's stable
|
|
118
|
+
principal id. The strings above are illustrative, not a BePresent access
|
|
119
|
+
policy. Retain the Worker `ctx` forwarding and Worker-level Access application
|
|
120
|
+
with Managed OAuth. Access owns admission and identity; these resolvers own
|
|
121
|
+
Connecta permissions. Do not introduce a second user roster.
|
|
122
|
+
|
|
123
|
+
For a personal Node deployment with Clerk and a configured client bearer:
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
import type { AuthenticatedIdentity } from "@zackbart/connecta";
|
|
127
|
+
|
|
128
|
+
const isOwner = ({ principal }: AuthenticatedIdentity) =>
|
|
129
|
+
principal?.id === "owner-clerk-id";
|
|
130
|
+
|
|
131
|
+
createConnecta({
|
|
132
|
+
connectors, executor, storage,
|
|
133
|
+
auth: [bearerToken(token, { subjectId: "static-token" }), clerk],
|
|
134
|
+
ui: operatorUi({ branding }),
|
|
135
|
+
vault: encryptedCredentialVault(storage, encryptionKey),
|
|
136
|
+
identity: {
|
|
137
|
+
connectorAccess: () => "all",
|
|
138
|
+
credentialAdministration: identity => isOwner(identity) ? "all" : "none",
|
|
139
|
+
personalConnection: identity => isOwner(identity) ? "all" : "none",
|
|
140
|
+
activityAccess: ({ id }) => id === "owner-clerk-id",
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
This preserves shared-connector MCP access for the configured bearer while
|
|
146
|
+
reserving auth changes for the owner signing in through Clerk. The bearer does
|
|
147
|
+
not inherit the owner's personal connections. To make invocation owner-only
|
|
148
|
+
as well, restrict inbound admission or `connectorAccess` explicitly. Do not
|
|
149
|
+
replace an existing identity resolver with `"all"` just to match this example.
|
|
150
|
+
|
|
151
|
+
`activityAccess` receives an `IdentityReference` with `id` and `namespace`,
|
|
152
|
+
while management resolvers receive an `AuthenticatedIdentity` with `principal`.
|
|
153
|
+
`activityAccess` defaults to interactive humans. Set it deliberately for a team
|
|
154
|
+
if global activity must remain owner-only. Omitting it is broader than an old
|
|
155
|
+
owner-only `operatorAccess` resolver.
|
|
156
|
+
|
|
157
|
+
### Migrate issued-token clients before upgrading
|
|
158
|
+
|
|
159
|
+
Connecta no longer issues or authenticates `cta_` tokens. The Tokens tab and
|
|
160
|
+
its creation, rename, and revocation endpoints are removed. Existing token
|
|
161
|
+
secrets immediately stop admitting requests to the upgraded deployment;
|
|
162
|
+
removing `accessTokens` alone does not migrate clients.
|
|
163
|
+
|
|
164
|
+
1. Inventory clients using issued tokens while the old deployment can still
|
|
165
|
+
identify them. Do not paste secrets into logs, documentation, or a migration
|
|
166
|
+
issue.
|
|
167
|
+
2. Move interactive clients to the configured identity provider's OAuth flow.
|
|
168
|
+
On Workers, use Cloudflare Access Managed OAuth and keep the required client
|
|
169
|
+
redirect allowlist. On Node, use the configured interactive provider.
|
|
170
|
+
3. If an actual unattended Node client remains, configure the optional
|
|
171
|
+
`bearerToken` adapter and update that client. Preserve stable `subjectId`
|
|
172
|
+
values for existing configured bearers. On Workers, Access service tokens
|
|
173
|
+
provide edge admission; a Connecta bearer alone cannot cross Access.
|
|
174
|
+
4. Verify each replacement client before removing `accessTokens` and deploying
|
|
175
|
+
the new package. An issued token previously inherited its creator's personal
|
|
176
|
+
principal; a configured bearer does not. Clients needing personal grants
|
|
177
|
+
must use a human identity flow.
|
|
178
|
+
|
|
179
|
+
Stored issued-token records become inert. They are not deleted automatically
|
|
180
|
+
and are not converted into configured bearer credentials. No storage sweep is
|
|
181
|
+
required for this upgrade. If rolling back to an older binary, remember that it
|
|
182
|
+
understands those old records again; retire or revoke old tokens in the old
|
|
183
|
+
system before migration if rollback must not restore them.
|
|
184
|
+
|
|
185
|
+
### Preserve vault and OAuth state
|
|
186
|
+
|
|
187
|
+
Pass the existing storage adapter and the same encryption key to
|
|
188
|
+
`encryptedCredentialVault`. Do not generate a replacement key as part of this
|
|
189
|
+
refactor. Keep connector ids, identity namespaces, principal ids, and owner
|
|
190
|
+
partitions stable. The encrypted vault binds connector and owner into its
|
|
191
|
+
AES-GCM context; moving records between owners does not migrate ownership.
|
|
192
|
+
|
|
193
|
+
No vault record, OAuth grant, or catalog storage-format migration is required.
|
|
194
|
+
Downstream OAuth continues to use connector storage, independently of the vault
|
|
195
|
+
module. Existing activity stores and retention policies remain deployment-owned;
|
|
196
|
+
wrap the existing store in `activityHistory` rather than creating a new database.
|
|
197
|
+
A replacement `CredentialVault` must preserve connector and owner isolation.
|
|
198
|
+
|
|
199
|
+
### Omit features you do not need
|
|
200
|
+
|
|
201
|
+
Omit `ui` and its import for an API-only deployment. UI shells, data APIs, and
|
|
202
|
+
auth mutation routes disappear. Core `/mcp`, `/health`, auth metadata, and OAuth
|
|
203
|
+
callbacks remain. An authorized interactive MCP caller can use
|
|
204
|
+
`authorize_connector` and complete OAuth without UI. Static credential recovery
|
|
205
|
+
returns `unavailable` without a mounted UI or vault, instead of a missing page.
|
|
206
|
+
UI-free callbacks use neutral branding and offer no dead return link.
|
|
207
|
+
|
|
208
|
+
Omit `activity` and its imports to stop recording and remove the Activity tab.
|
|
209
|
+
Remove deployment-only store wiring or database bindings only if nothing else
|
|
210
|
+
uses them. Existing history is not deleted. Diagnostic output is separate;
|
|
211
|
+
set `logger: "silent"` only when you also want to suppress it.
|
|
212
|
+
|
|
213
|
+
Omit `vault` when credentials come entirely from deployment configuration or
|
|
214
|
+
OAuth. A connector declaring a vault slot then remains unmanageable; do not
|
|
215
|
+
omit it while expecting stored vault credentials to keep resolving.
|
|
216
|
+
|
|
217
|
+
There is no generic module list. Keep ordinary explicit imports and the typed
|
|
218
|
+
configuration slots. The implementations may ship in the package, but core
|
|
219
|
+
does not load them merely because the package is installed.
|
|
220
|
+
|
|
221
|
+
### Verify the upgraded deployment
|
|
222
|
+
|
|
223
|
+
- Run the deployment's typecheck and build with the new imports and exact pin.
|
|
224
|
+
Keep its connector declarations, executor, and custom routing intact.
|
|
225
|
+
- Run `connecta doctor` against the running deployment using its actual inbound
|
|
226
|
+
authentication. Confirm the same seven tools and a working executor.
|
|
227
|
+
- Sign in as an owner and a teammate. Confirm visibility, shared auth controls,
|
|
228
|
+
personal connection controls, and activity access match code. A member may
|
|
229
|
+
invoke a shared connector while having no authority to change its grant.
|
|
230
|
+
- Open Connections. Its configured list should appear before downstream details;
|
|
231
|
+
one slow or failing provider should not delay the other cards. OAuth starts
|
|
232
|
+
only after an explicit action, and action feedback does not await other probes.
|
|
233
|
+
- Read existing vault-backed and personal OAuth connections without re-entering
|
|
234
|
+
secrets. Exercise one permitted auth flow and confirm other principals cannot
|
|
235
|
+
manage it. With UI omitted, verify OAuth callback completion and the honest
|
|
236
|
+
unavailable response for static credential handoff.
|
|
237
|
+
- Update bookmarks and operator instructions to the connection-centered UI.
|
|
238
|
+
There is no separate Credentials or Tokens tab. Verify optional Activity and
|
|
239
|
+
the absence of UI routes in a deployment that omits the UI.
|
|
240
|
+
|
|
241
|
+
Keep the old pin, configuration, and storage backup available until these checks
|
|
242
|
+
pass. This guide changes package configuration; it does not authorize or perform
|
|
243
|
+
any deployment, credential rotation, or storage deletion.
|
|
@@ -237,8 +237,8 @@ not send the agent to `authorize_connector`, you do not repair the argument
|
|
|
237
237
|
object. You re-address — look the id up again, or accept the absence and carry
|
|
238
238
|
on — and a program looping over ids inside `execute_code` can continue past
|
|
239
239
|
`not_found` where `connector_call_failed` would have to abort the run, reading
|
|
240
|
-
the code
|
|
241
|
-
|
|
240
|
+
the code from a caught error or a rejected promise. The guest bridge preserves
|
|
241
|
+
the typed classification. That
|
|
242
242
|
control-flow difference is the H11 test being met; it is not a label for the
|
|
243
243
|
cause.
|
|
244
244
|
|
|
@@ -416,13 +416,15 @@ default. The provider's own headless credential — a personal API key, a
|
|
|
416
416
|
restricted key, a service account — is supported two ways: explicit `headers`
|
|
417
417
|
auth, documented as a secret rather than configuration, and `{ type:
|
|
418
418
|
"credential" }`, which declares an operator slot and takes the same secret from
|
|
419
|
-
|
|
419
|
+
the connection UI at `/` instead. Either way it is paired with the narrowest mode the
|
|
420
420
|
deployment can use, and the framing matches the provider's *published* contract
|
|
421
421
|
for the MCP endpoint — not a convention borrowed from that provider's other
|
|
422
422
|
APIs, and not this repository's earlier example, which is the same claim wearing
|
|
423
423
|
a circle. `requireHttps` is set. Recovery from an expired authorization is the
|
|
424
424
|
ordinary `auth_required` → `authorize_connector` route, which returns the
|
|
425
|
-
consent URL for OAuth and
|
|
425
|
+
consent URL for permitted OAuth starts and a connection UI handoff at `/` for
|
|
426
|
+
a declared slot when UI and vault are mounted. Missing modules yield
|
|
427
|
+
`unavailable`; never advertise a route the deployment cannot serve.
|
|
426
428
|
|
|
427
429
|
*Why:* one route back from an expired credential is what keeps a failed call
|
|
428
430
|
from becoming an abandoned task. *Cost:* wrong-tool selection.
|
|
@@ -442,7 +444,7 @@ deployment file to read — and a dead, revoked, or absent credential fails loud
|
|
|
442
444
|
at use as `auth_required` with the `authorize_connector` route attached (P9).
|
|
443
445
|
|
|
444
446
|
`testCredential` exists only behind the operator-pressed Test action on
|
|
445
|
-
|
|
447
|
+
the connection UI at `/`, and only for a declared slot. It connects with the stored value
|
|
446
448
|
and reports how many tools the downstream served, which is the whole honest
|
|
447
449
|
check for a proxy: which account, project, or mode a key reaches is the
|
|
448
450
|
provider's answer, not Connecta's. That is not the shape
|
|
@@ -81,7 +81,7 @@ connectors: [
|
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
Neither key has to be a runtime secret. Declare the slot instead and each
|
|
84
|
-
connector's key is pasted, tested, and rotated on
|
|
84
|
+
connector's key is pasted, tested, and rotated on the connection UI at `/`:
|
|
85
85
|
|
|
86
86
|
```ts
|
|
87
87
|
connectors: [
|
|
@@ -1,39 +1,59 @@
|
|
|
1
1
|
# Storage and credentials
|
|
2
2
|
|
|
3
|
-
The core `KVStorage`
|
|
4
|
-
implement `list(prefix)`.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
3
|
+
The core `KVStorage` contract supports `get`, `set`, and `delete`; adapters may
|
|
4
|
+
also implement `list(prefix)`. Core uses storage for connector state, catalogs,
|
|
5
|
+
and result paging. The vault is an explicit independent option:
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { encryptedCredentialVault } from "@zackbart/connecta/credentials";
|
|
9
|
+
|
|
10
|
+
createConnecta({
|
|
11
|
+
connectors,
|
|
12
|
+
executor,
|
|
13
|
+
storage,
|
|
14
|
+
vault: encryptedCredentialVault(storage, encryptionKey),
|
|
15
|
+
});
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`encryptionKey` is a base64 32-byte AES key. The factory implements the
|
|
19
|
+
root-exported `CredentialVault` contract. Core depends on the contract without
|
|
20
|
+
importing the encrypted implementation; deployments may supply their own.
|
|
21
|
+
A replacement must isolate both connector id and optional owner, preserve
|
|
22
|
+
metadata-only reads for the UI, and keep plaintext confined to host credential
|
|
23
|
+
resolution. The built-in AES-GCM implementation binds connector and owner into
|
|
24
|
+
authenticated encryption context. Sharing a backend is not permission to share
|
|
25
|
+
a principal's credentials.
|
|
26
|
+
|
|
27
|
+
Connectors declare a human-managed `credential` slot in code. The vault exposes
|
|
28
|
+
read access only through that connector's `ctx.credential`. Values, masked
|
|
29
|
+
values, call arguments, and raw errors never enter model recovery or activity.
|
|
30
|
+
Omitting the vault leaves literal deployment-provided secrets and downstream
|
|
31
|
+
OAuth available, but declared vault slots cannot be managed.
|
|
32
|
+
|
|
33
|
+
Credentials fail at use. Proactive liveness probing remains removed by
|
|
34
|
+
[the 0.9 decision](../ethos.md). Operator-triggered tests and local credential
|
|
35
|
+
shape checks remain. `authorize_connector` returns a human credential handoff
|
|
36
|
+
only when both a vault and the UI are configured. Without either, recovery is
|
|
37
|
+
`unavailable` and explains the missing configuration.
|
|
38
|
+
|
|
39
|
+
A static bearer may invoke a connector but never mutate its auth as a browser
|
|
40
|
+
user. Interactive users need visibility plus `credentialAdministration` for
|
|
41
|
+
shared auth or `personalConnection` for their own personal auth. Both management
|
|
42
|
+
permissions default to none. Saving, testing, replacing, or removing a value
|
|
43
|
+
never returns it. The vault is read for each call, so a saved replacement takes
|
|
44
|
+
effect without restarting the deployment.
|
|
45
|
+
|
|
46
|
+
## Storage continuity
|
|
47
|
+
|
|
48
|
+
This module extraction changes no encrypted record keys, owner partitions, or
|
|
49
|
+
OAuth storage format. Reuse the existing storage and encryption key when
|
|
50
|
+
constructing `encryptedCredentialVault`. Keep connector ids, principal ids, and
|
|
51
|
+
identity namespaces unchanged. Losing the encryption key makes old vault
|
|
52
|
+
values unreadable; changing identity context selects another personal partition.
|
|
53
|
+
|
|
54
|
+
Removed Connecta-issued token records remain inert in storage. This upgrade
|
|
55
|
+
does not delete them, convert them to another credential, or migrate their
|
|
56
|
+
clients automatically.
|
|
37
57
|
|
|
38
58
|
## Shared and personal auth
|
|
39
59
|
|
|
@@ -54,8 +74,7 @@ Personal connectors disappear from a request that has no stable human
|
|
|
54
74
|
principal. For a principal that can see one, connecta partitions connector
|
|
55
75
|
storage, encrypted vault records, catalog caches, OAuth generations, and
|
|
56
76
|
observed result shapes under an opaque SHA-256 identity key. Results used by
|
|
57
|
-
`get_result` are partitioned by the authenticated subject, so one
|
|
58
|
-
page another token's call even when both tokens belong to the same principal.
|
|
77
|
+
`get_result` are partitioned by the authenticated subject, so one authenticated subject cannot page another subject's call.
|
|
59
78
|
|
|
60
79
|
Literal `auth: { type: "headers" }` cannot be personal because its secret lives
|
|
61
80
|
in deployment code. `remoteMcp()` refuses that combination at construction.
|
|
@@ -73,7 +92,7 @@ remoteMcp("revenuecat_bepresent", {
|
|
|
73
92
|
```
|
|
74
93
|
|
|
75
94
|
The connector, its endpoint, and the credential *slot* stay declared in code;
|
|
76
|
-
only the secret arrives through
|
|
95
|
+
only the secret arrives through the connection UI at `/`. That is the same boundary
|
|
77
96
|
`api()` has always had, and the reason a project-wide key no longer has to be a
|
|
78
97
|
Worker secret or an environment variable
|
|
79
98
|
([#439](https://github.com/zackbart/connecta/issues/439)).
|
|
@@ -99,8 +118,8 @@ redaction that keeps part of a secret is still a leak.
|
|
|
99
118
|
An empty slot is not a boot failure and not a silently absent connector. The
|
|
100
119
|
connector is present, its status reads `auth_required`, calls fail with the same
|
|
101
120
|
typed error a missing OAuth grant produces, and `authorize_connector` returns
|
|
102
|
-
|
|
103
|
-
`
|
|
121
|
+
a connection UI handoff at `/` when UI and vault are configured. Without either,
|
|
122
|
+
it returns `unavailable` and explains what is missing.
|
|
104
123
|
|
|
105
124
|
The vault is read before any cached downstream client is trusted, so a rotation
|
|
106
125
|
lands on the next call rather than the next deploy. Connecta compares a SHA-256
|
|
@@ -111,7 +130,7 @@ message. A cleartext `http://` destination warns at construction here exactly as
|
|
|
111
130
|
it does for literal headers — who owns the secret changed, not what the wire
|
|
112
131
|
carries.
|
|
113
132
|
|
|
114
|
-
|
|
133
|
+
The connection UI Test action connects with the stored value and reports how many
|
|
115
134
|
tools the downstream served. That is the whole honest check for a proxy: which
|
|
116
135
|
account, project, or mode the key reaches is the provider's answer, not
|
|
117
136
|
Connecta's.
|
package/documentation/stripe.md
CHANGED
|
@@ -95,7 +95,7 @@ Use a restricted key, not a secret key, and scope it to the operations the
|
|
|
95
95
|
agent actually needs; Stripe's own guidance is to "limit your agent's access to
|
|
96
96
|
exactly the functionality it requires". Keep it in the runtime's secret store.
|
|
97
97
|
|
|
98
|
-
The same key can come from
|
|
98
|
+
The same key can come from the connection UI at `/` instead:
|
|
99
99
|
|
|
100
100
|
```ts
|
|
101
101
|
stripe("stripe_sandbox", {
|
|
@@ -17,6 +17,66 @@ the release notes broke, and prove it with `connecta doctor`.
|
|
|
17
17
|
Work on a branch. Every step below is reversible until you delete the old
|
|
18
18
|
lockfile, and you want the diff reviewable by whoever owns this deployment.
|
|
19
19
|
|
|
20
|
+
## 0.24.0 optional modules
|
|
21
|
+
|
|
22
|
+
UI, encrypted credentials, activity history, and configured bearer auth now use
|
|
23
|
+
explicit module imports. Core keeps the same seven tools and enforcement.
|
|
24
|
+
Connecta-issued tokens are removed. Shared and personal auth management require
|
|
25
|
+
separate explicit permissions, both denied by default; visibility alone grants
|
|
26
|
+
neither. `activityAccess` replaces `operatorAccess` for global history reads.
|
|
27
|
+
|
|
28
|
+
Follow the [optional-module migration](./optional-modules-upgrade.md) before
|
|
29
|
+
upgrading. It includes the complete before-and-after configuration, team Worker
|
|
30
|
+
and personal Node permission examples, issued-token client migration, disabling
|
|
31
|
+
features, and verification. Preserve existing connector ids, identity namespaces,
|
|
32
|
+
storage, and encryption key. Vault and OAuth records need no format migration;
|
|
33
|
+
old issued-token records remain inert rather than being deleted automatically.
|
|
34
|
+
|
|
35
|
+
## 0.23.0 program API pruning
|
|
36
|
+
|
|
37
|
+
This update removes MCP Apps rendering, connector shortcut globals,
|
|
38
|
+
`connecta.batch`, automatic direct-call retries, and connector-owned HTTP routes. Refresh the client's MCP
|
|
39
|
+
instructions and tool definitions after upgrading. The seven top-level tools,
|
|
40
|
+
operator pages, credentials, result paging, and media emission remain.
|
|
41
|
+
|
|
42
|
+
| Before | After |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| Connector `handleRequest(request, ctx)` | Move custom HTTP routes into the existing deployment fetch handler |
|
|
45
|
+
| `await tracker.list_issues(args)` | `await connecta.call("tracker.list_issues", args)` using the exact address from discovery |
|
|
46
|
+
| `await connecta.batch(calls)` | `Promise.all` over `connecta.call`, or `Promise.allSettled` to keep failures alongside successes |
|
|
47
|
+
| `await connecta.ui(html)` | Return the data the client needs to render its own view |
|
|
48
|
+
| `call_tool` or `call_destructive_tool` with `maxRetries` | Omit the removed argument; each call makes one attempt and returns typed failures with provider retry hints |
|
|
49
|
+
|
|
50
|
+
A connector that still declares `handleRequest` refuses construction. Handle
|
|
51
|
+
custom routes in the existing Node or Worker deployment before delegating other
|
|
52
|
+
requests to `connecta.fetch`. The deployment owns authentication and security
|
|
53
|
+
headers for its custom responses. Connecta returns 404 for unknown paths.
|
|
54
|
+
Cloudflare Global API Key authentication and multi-field credentials remain
|
|
55
|
+
supported; they need no migration.
|
|
56
|
+
|
|
57
|
+
The direct-call schemas reject unknown arguments, including `maxRetries`, before
|
|
58
|
+
invocation. Review stored programs and deployment-owned usage guides for the
|
|
59
|
+
removed guest functions. Canonical addresses preserve punctuation; do not copy
|
|
60
|
+
the old sanitized shortcut into the address string.
|
|
61
|
+
|
|
62
|
+
```js
|
|
63
|
+
async () => {
|
|
64
|
+
const outcomes = await Promise.allSettled([
|
|
65
|
+
connecta.call("tracker.list_issues", { state: "started" }),
|
|
66
|
+
connecta.call("tracker.list_projects", {}),
|
|
67
|
+
]);
|
|
68
|
+
return outcomes.map((outcome) => outcome.status === "fulfilled"
|
|
69
|
+
? { ok: true, data: outcome.value }
|
|
70
|
+
: { ok: false, code: outcome.reason.code, message: outcome.reason.message });
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Reduce large successful values before returning. Promise rejection reasons are
|
|
75
|
+
Error objects; explicitly select their fields for JSON output. Every call still
|
|
76
|
+
passes through the existing read-only checks, admission limits, deadlines, and
|
|
77
|
+
20-call program budget. Rate-limited calls return `retryAfterMs` without waiting;
|
|
78
|
+
the client can reissue after that delay. No storage migration is required.
|
|
79
|
+
|
|
20
80
|
## Read what you have first
|
|
21
81
|
|
|
22
82
|
Three questions, in order. Answer all three before editing anything — the
|
|
@@ -57,7 +117,7 @@ exist so far:
|
|
|
57
117
|
| --- | --- | --- |
|
|
58
118
|
| **pre-template** | before 0.10.2 | no `connecta init` existed; hand-written, or copied from the retired `examples/node` |
|
|
59
119
|
| **A** | 0.10.2 – 0.15.1 | `.env.example`, `.gitignore`, `AGENTS.md`, `CLAUDE.md`, `README.md`, `package.json`, `src/index.ts`, `tsconfig.json` |
|
|
60
|
-
| **B** | 0.16.0 – 0.
|
|
120
|
+
| **B** | 0.16.0 – 0.24.0 | adds `.dockerignore`, `Dockerfile`, `docker-compose.yml`, and `src/file-activity.ts`; `src/index.ts` grows the four commented operator blocks; `.env.example` ships `CONNECTA_TOKEN=` empty |
|
|
61
121
|
|
|
62
122
|
Generation A is a decade in template years and identifying it precisely does
|
|
63
123
|
not matter, because you are about to reconstruct it exactly rather than guess
|
|
@@ -106,7 +166,7 @@ know what to preserve, once to know what to re-verify at the end.
|
|
|
106
166
|
### Bump the pin and install
|
|
107
167
|
|
|
108
168
|
```sh
|
|
109
|
-
npm pkg set dependencies.@zackbart/connecta=0.
|
|
169
|
+
npm pkg set dependencies.@zackbart/connecta=0.24.0
|
|
110
170
|
npm install
|
|
111
171
|
```
|
|
112
172
|
|
|
@@ -130,7 +190,7 @@ Generate the *current* template beside the base you already made, into the same
|
|
|
130
190
|
`$SCRATCH`:
|
|
131
191
|
|
|
132
192
|
```sh
|
|
133
|
-
(cd "$SCRATCH" && npx @zackbart/connecta@0.
|
|
193
|
+
(cd "$SCRATCH" && npx @zackbart/connecta@0.24.0 init current)
|
|
134
194
|
```
|
|
135
195
|
|
|
136
196
|
You now have a three-way merge with a real base: `$SCRATCH/base` is what this
|
|
@@ -186,7 +246,7 @@ A deployment older than 0.10.2 has no base to diff against. Do not try to
|
|
|
186
246
|
manufacture one. Instead:
|
|
187
247
|
|
|
188
248
|
1. `SCRATCH=$(mktemp -d)`, then
|
|
189
|
-
`(cd "$SCRATCH" && npx @zackbart/connecta@0.
|
|
249
|
+
`(cd "$SCRATCH" && npx @zackbart/connecta@0.24.0 init current)` — there is no
|
|
190
250
|
`base` leg here, only the current template to read from.
|
|
191
251
|
2. Copy `$SCRATCH/current` into the deployment file by file, **skipping
|
|
192
252
|
`src/index.ts`**.
|
|
@@ -207,6 +267,19 @@ first, so cross them bottom-up: start at the oldest one still above this
|
|
|
207
267
|
deployment's pin and work back up the page, because each boundary assumes the
|
|
208
268
|
older ones are already done.
|
|
209
269
|
|
|
270
|
+
### 0.23.0 → 0.24.0
|
|
271
|
+
|
|
272
|
+
Use the [optional-module migration](./optional-modules-upgrade.md) to select
|
|
273
|
+
modules, grant auth-management permissions, and migrate issued-token clients.
|
|
274
|
+
Preserve storage, encryption keys, and identity namespaces.
|
|
275
|
+
|
|
276
|
+
### 0.22.3 → 0.23.0
|
|
277
|
+
|
|
278
|
+
Migrate stored programs and custom connector routes using the
|
|
279
|
+
[0.23.0 migration](#0230-program-api-pruning). Refresh client instructions
|
|
280
|
+
and tool definitions so account titles and the revised discovery guidance take
|
|
281
|
+
effect. No storage migration is required.
|
|
282
|
+
|
|
210
283
|
### 0.21.2 → 0.22.3
|
|
211
284
|
|
|
212
285
|
Connector and user policy remain config-as-code. If `identity.connectorAccess`
|
|
@@ -572,10 +645,8 @@ all, so this is not a hook to stub out with `() => true`.
|
|
|
572
645
|
previously fell through to connector `handleRequest` and then to a 404, so a
|
|
573
646
|
connector that served any of the three is now shadowed without warning. `GET /`
|
|
574
647
|
returns the operator shell where 0.6.1 returned 404, and a non-GET on those
|
|
575
|
-
routes or on `/ui` returns 405 instead of falling through.
|
|
576
|
-
|
|
577
|
-
built-in routes miss, so it can add a route and never shadow one
|
|
578
|
-
([architecture](./architecture.md)).
|
|
648
|
+
routes or on `/ui` returns 405 instead of falling through. For the current release, move custom handlers into the deployment: connector
|
|
649
|
+
`handleRequest` is now removed. See the [current migration](#0230-program-api-pruning).
|
|
579
650
|
|
|
580
651
|
### Removed options that throw
|
|
581
652
|
|
|
@@ -587,6 +658,10 @@ the migration map:
|
|
|
587
658
|
|
|
588
659
|
| Option | Removed in | Do |
|
|
589
660
|
| --- | --- | --- |
|
|
661
|
+
| `accessTokens` | 0.24.0 | migrate issued-token clients to provider OAuth or configured bearer auth; old records become inert |
|
|
662
|
+
| `credentials` | 0.24.0 | `vault: encryptedCredentialVault(storage, encryptionKey)` from `/credentials` |
|
|
663
|
+
| `branding` | 0.24.0 | `ui: operatorUi({ branding })` from `/ui` |
|
|
664
|
+
| `identity.operatorAccess` | 0.24.0 | `identity.activityAccess`; grant shared and personal auth management separately |
|
|
590
665
|
| `toolkits`, `unscoped` | 0.8.1 (#178) | delete; deploy one instance per audience |
|
|
591
666
|
| `credentials.health`, `credentialHealth` | 0.8.1 (#179) | delete; credentials fail at use |
|
|
592
667
|
| `surface` | 0.11.0 (#273) | delete; there is one seven-tool surface |
|