@zackbart/connecta 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +403 -0
- package/README.md +163 -308
- 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 +3 -3
- package/dist/connectors/remote-mcp.d.ts.map +1 -1
- package/dist/connectors/remote-mcp.js +309 -10
- package/dist/connectors/remote-mcp.js.map +1 -1
- package/dist/credential-health.d.ts +20 -9
- package/dist/credential-health.d.ts.map +1 -1
- package/dist/credential-health.js +127 -63
- package/dist/credential-health.js.map +1 -1
- package/dist/credentials.d.ts +84 -1
- package/dist/credentials.d.ts.map +1 -1
- package/dist/credentials.js +109 -2
- package/dist/credentials.js.map +1 -1
- package/dist/index.d.ts +83 -82
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +101 -31
- package/dist/index.js.map +1 -1
- package/dist/meta-tools.d.ts +3 -3
- package/dist/meta-tools.d.ts.map +1 -1
- package/dist/meta-tools.js +16 -7
- 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 +154 -52
- package/dist/server.js.map +1 -1
- package/dist/skills.js +2 -2
- package/dist/skills.js.map +1 -1
- package/dist/toolkits.js +1 -1
- package/dist/types.d.ts +51 -26
- package/dist/types.d.ts.map +1 -1
- package/dist/ui.d.ts +52 -21
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +665 -196
- 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 +348 -25
- package/src/credential-health.ts +151 -71
- package/src/credentials.ts +166 -3
- package/src/index.ts +202 -113
- package/src/meta-tools.ts +22 -7
- package/src/registry.ts +4 -3
- package/src/server.ts +197 -71
- package/src/skills.ts +2 -2
- package/src/toolkits.ts +1 -1
- package/src/types.ts +51 -26
- package/src/ui.ts +703 -195
- package/src/version.ts +1 -1
package/dist/credentials.js
CHANGED
|
@@ -3,6 +3,113 @@ const IV_BYTES = 12;
|
|
|
3
3
|
const MAX_CREDENTIAL_BYTES = 16_384;
|
|
4
4
|
const encoder = new TextEncoder();
|
|
5
5
|
const decoder = new TextDecoder();
|
|
6
|
+
/** Operator-safe explanation shared by every surface that detects shape drift. */
|
|
7
|
+
export const STORED_CREDENTIAL_SHAPE_MISMATCH_ERROR = "Stored credential fields do not match this connector's current declaration. Replace the credential before using or testing this connector.";
|
|
8
|
+
/**
|
|
9
|
+
* Compare a connector's current declaration with the keys in its stored
|
|
10
|
+
* credential. Values are deliberately ignored: callers may pass decrypted
|
|
11
|
+
* values or `/credentials`' masked field metadata and get the same answer.
|
|
12
|
+
*
|
|
13
|
+
* The test is CONTAINMENT, not equality: the stored key set is compatible when
|
|
14
|
+
* it holds every field currently declared — the reserved `value` key for a
|
|
15
|
+
* single-value declaration, every declared name for a named one. Anything the
|
|
16
|
+
* declaration asks for and the vault does not have is `mismatch`, which is
|
|
17
|
+
* precisely what a renamed field, a newly added field, or a swap between the
|
|
18
|
+
* two shapes produces. The swap needs no special case: `value` is never one of
|
|
19
|
+
* the declared names, so single→named and named→single each leave the declared
|
|
20
|
+
* side unsatisfied. An empty stored map (reachable through a hand-written
|
|
21
|
+
* plaintext) satisfies nothing and is a mismatch too.
|
|
22
|
+
*
|
|
23
|
+
* Extra keys are NOT drift. They are what *dropping* a field leaves behind, and
|
|
24
|
+
* every accessor a connector actually uses — `ctx.credential.get("apiKey")`,
|
|
25
|
+
* `getAll().apiKey` — keeps returning the right secret across that redeploy.
|
|
26
|
+
* Calling it drift would order an operator to re-enter a working secret that
|
|
27
|
+
* many providers will not reissue in readable form. The leftovers come back as
|
|
28
|
+
* `undeclared` instead, for a surface to mention without blocking anything.
|
|
29
|
+
*/
|
|
30
|
+
export function storedCredentialShape(config, stored) {
|
|
31
|
+
if (!stored)
|
|
32
|
+
return { state: "missing" };
|
|
33
|
+
const mode = config.fields?.length
|
|
34
|
+
? "multiple"
|
|
35
|
+
: "single";
|
|
36
|
+
const declared = new Set(mode === "multiple" ? config.fields.map((field) => field.name) : ["value"]);
|
|
37
|
+
const actual = Object.keys(stored);
|
|
38
|
+
const present = new Set(actual);
|
|
39
|
+
for (const field of declared) {
|
|
40
|
+
if (!present.has(field)) {
|
|
41
|
+
return {
|
|
42
|
+
state: "mismatch",
|
|
43
|
+
mode,
|
|
44
|
+
message: STORED_CREDENTIAL_SHAPE_MISMATCH_ERROR,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
state: "valid",
|
|
50
|
+
mode,
|
|
51
|
+
undeclared: actual.filter((field) => !declared.has(field)).sort(),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/** How many leftover field names an advisory names before it summarizes. */
|
|
55
|
+
const UNDECLARED_SAMPLE = 5;
|
|
56
|
+
/**
|
|
57
|
+
* The one sentence describing leftover stored fields, so every surface words it
|
|
58
|
+
* the same way. Names only — the values stay in the vault, and a field name from
|
|
59
|
+
* a previous declaration is not a secret. Deliberately reassuring: nothing is
|
|
60
|
+
* broken, and the only thing an operator gains by acting is that a connector
|
|
61
|
+
* iterating `getAll()` stops seeing a field its code no longer knows about.
|
|
62
|
+
*/
|
|
63
|
+
export function describeUndeclaredCredentialFields(fields) {
|
|
64
|
+
const shown = fields.slice(0, UNDECLARED_SAMPLE);
|
|
65
|
+
const rest = fields.length - shown.length;
|
|
66
|
+
const named = shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
|
|
67
|
+
return fields.length === 1
|
|
68
|
+
? `Stored credential also holds a field this connector no longer declares (${named}). It keeps working; replace the credential to drop it.`
|
|
69
|
+
: `Stored credential also holds fields this connector no longer declares (${named}). It keeps working; replace the credential to drop them.`;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The one rule deciding whether a connector's credential can be tested — read
|
|
73
|
+
* by /credentials' `testable` flag, by `POST /ui/credentials/<id>/test` when
|
|
74
|
+
* it picks a hook, and by the construction-time mismatch warning, so those
|
|
75
|
+
* three cannot drift apart.
|
|
76
|
+
*
|
|
77
|
+
* The declared credential *shape* selects the hook: named `credential.fields`
|
|
78
|
+
* are tested as a set by `testCredentials`, a single-value `credential` by
|
|
79
|
+
* `testCredential` on the vault's reserved `value` field. The other hook is
|
|
80
|
+
* never substituted — it would be handed a shape the connector never declared —
|
|
81
|
+
* so a connector implementing only the mismatched hook is not testable, and
|
|
82
|
+
* says so at construction rather than under an operator's click.
|
|
83
|
+
*/
|
|
84
|
+
export function credentialTestRule(connector) {
|
|
85
|
+
if (!connector.credential)
|
|
86
|
+
return { mode: null };
|
|
87
|
+
if (connector.credential.fields?.length) {
|
|
88
|
+
if (connector.testCredentials)
|
|
89
|
+
return { mode: "multiple" };
|
|
90
|
+
return connector.testCredential
|
|
91
|
+
? { mode: null, mismatch: { shape: "multiple", hook: "testCredential" } }
|
|
92
|
+
: { mode: null };
|
|
93
|
+
}
|
|
94
|
+
if (connector.testCredential)
|
|
95
|
+
return { mode: "single" };
|
|
96
|
+
return connector.testCredentials
|
|
97
|
+
? { mode: null, mismatch: { shape: "single", hook: "testCredentials" } }
|
|
98
|
+
: { mode: null };
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* One clause naming a mismatch, shared by the startup warning and the test
|
|
102
|
+
* route's 400 so an operator reads the same explanation in both places.
|
|
103
|
+
*/
|
|
104
|
+
export function describeCredentialTestMismatch(mismatch) {
|
|
105
|
+
return mismatch.shape === "multiple"
|
|
106
|
+
? "it declares named credential fields, which only " +
|
|
107
|
+
"`testCredentials(values, ctx)` can test, but implements " +
|
|
108
|
+
"`testCredential`"
|
|
109
|
+
: "it declares a single-value credential, which only " +
|
|
110
|
+
"`testCredential(value, ctx)` can test, but implements " +
|
|
111
|
+
"`testCredentials`";
|
|
112
|
+
}
|
|
6
113
|
function storageKey(connectorId) {
|
|
7
114
|
return `conn:${connectorId}:credential:v1`;
|
|
8
115
|
}
|
|
@@ -18,7 +125,7 @@ function base64ToBytes(value) {
|
|
|
18
125
|
binary = atob(value);
|
|
19
126
|
}
|
|
20
127
|
catch {
|
|
21
|
-
throw new Error("
|
|
128
|
+
throw new Error("credentials.encryptionKey must be a base64-encoded 32-byte key");
|
|
22
129
|
}
|
|
23
130
|
return Uint8Array.from(binary, (char) => char.charCodeAt(0));
|
|
24
131
|
}
|
|
@@ -94,7 +201,7 @@ export class CredentialVault {
|
|
|
94
201
|
this.storage = storage;
|
|
95
202
|
const raw = base64ToBytes(encryptionKey.trim());
|
|
96
203
|
if (raw.byteLength !== KEY_BYTES) {
|
|
97
|
-
throw new Error("
|
|
204
|
+
throw new Error("credentials.encryptionKey must be a base64-encoded 32-byte key");
|
|
98
205
|
}
|
|
99
206
|
this.key = crypto.subtle.importKey("raw", raw, { name: "AES-GCM" }, false, ["encrypt", "decrypt"]);
|
|
100
207
|
}
|
package/dist/credentials.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[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,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAE,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,WAAmB;QAC9B,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;IACrD,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,80 @@ import { type ToolkitConfig } from "./toolkits.js";
|
|
|
3
3
|
import type { ActivityReadGate, ActivityStore } from "./activity.js";
|
|
4
4
|
import type { CredentialCheckResult, CredentialHealthConfig } from "./credential-health.js";
|
|
5
5
|
import type { Connector, ConnectaBranding, Executor, InboundAuth, KVStorage, Logger } from "./types.js";
|
|
6
|
+
/** Payload-free activity storage and operator-read policy. */
|
|
7
|
+
export interface ConnectaActivityConfig {
|
|
8
|
+
/**
|
|
9
|
+
* Privacy-minimal downstream tool activity storage. Writes are best-effort
|
|
10
|
+
* and never change tool results. Implement `list` to enable the Activity UI.
|
|
11
|
+
*/
|
|
12
|
+
store: ActivityStore;
|
|
13
|
+
/**
|
|
14
|
+
* Optional authorization gate for the Activity read API. MCP authentication
|
|
15
|
+
* is still required first. Omit to admit every authenticated actor.
|
|
16
|
+
*/
|
|
17
|
+
readGate?: ActivityReadGate;
|
|
18
|
+
/** Stable deployment label included in activity events, e.g. "production". */
|
|
19
|
+
deploymentId?: string;
|
|
20
|
+
}
|
|
21
|
+
/** Operator-vault encryption and proactive credential-health tuning. */
|
|
22
|
+
export interface ConnectaCredentialsConfig {
|
|
23
|
+
/**
|
|
24
|
+
* Base64-encoded 32-byte AES key for credentials managed on /credentials.
|
|
25
|
+
* Keep this in the runtime's secret store, never in KV or source control.
|
|
26
|
+
*/
|
|
27
|
+
encryptionKey?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Tuning for proactive credential liveness checks that let a connector's
|
|
30
|
+
* status flip to `auth_required` before an agent's call fails. Defaults: one
|
|
31
|
+
* check per connector per 15 minutes, four in flight, 30 seconds each,
|
|
32
|
+
* triggered opportunistically by inbound authenticated traffic.
|
|
33
|
+
*
|
|
34
|
+
* Optional even without an encryption key because downstream OAuth connectors
|
|
35
|
+
* manage their own grants. `Connecta.checkCredentials()` runs the same checks
|
|
36
|
+
* on demand for a Worker cron trigger or Node interval.
|
|
37
|
+
*/
|
|
38
|
+
health?: CredentialHealthConfig;
|
|
39
|
+
}
|
|
40
|
+
/** Tool-catalog caching, persistence, stale fallback, and probe deadlines. */
|
|
41
|
+
export interface ConnectaDiscoveryConfig {
|
|
42
|
+
/** Tool-list cache TTL (seconds). Default 300. */
|
|
43
|
+
catalogTtlSeconds?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Persist serializable remote tool catalogs in storage so cold isolates can
|
|
46
|
+
* discover tools without a downstream handshake. Default true.
|
|
47
|
+
*/
|
|
48
|
+
persistCatalog?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* How long an expired persisted catalog remains available as a fallback
|
|
51
|
+
* when a live refresh fails. Default 3600 seconds.
|
|
52
|
+
*/
|
|
53
|
+
staleCatalogSeconds?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Deadline (ms) for each downstream probe/catalog call fanned out by
|
|
56
|
+
* `list_connectors`, `search_tools`, and `describe_tools`. Defaults to
|
|
57
|
+
* 30_000. A timed-out connector degrades independently; this does not apply
|
|
58
|
+
* to tool calls or currently abort the underlying fetch.
|
|
59
|
+
*/
|
|
60
|
+
probeTimeoutMs?: number;
|
|
61
|
+
}
|
|
62
|
+
/** Deployment-wide call deadlines and inline-result paging threshold. */
|
|
63
|
+
export interface ConnectaCallsConfig {
|
|
64
|
+
/**
|
|
65
|
+
* Deadline (ms) for `call_tool`/`batch_call` calls that pass no `timeoutMs`.
|
|
66
|
+
* An explicit per-call value wins. Opt-in: unset by default, so existing
|
|
67
|
+
* long-running calls gain no surprise deadline.
|
|
68
|
+
*
|
|
69
|
+
* This bounds one attempt, not all retries. `execute_code` host calls are
|
|
70
|
+
* unaffected because they already carry their own bound.
|
|
71
|
+
*/
|
|
72
|
+
defaultTimeoutMs?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Max inline result size (bytes) before truncation and `get_result` paging.
|
|
75
|
+
* Must be a finite whole number >= 1; invalid values warn and fall back to
|
|
76
|
+
* 50_000. Connectors may override it individually.
|
|
77
|
+
*/
|
|
78
|
+
maxResultBytes?: number;
|
|
79
|
+
}
|
|
6
80
|
export interface ConnectaConfig {
|
|
7
81
|
connectors: Connector[];
|
|
8
82
|
/**
|
|
@@ -37,18 +111,6 @@ export interface ConnectaConfig {
|
|
|
37
111
|
* address, or an address naming no tool on an in-code connector all throw.
|
|
38
112
|
*/
|
|
39
113
|
toolkits?: ToolkitConfig;
|
|
40
|
-
/**
|
|
41
|
-
* Privacy-minimal downstream tool activity storage. Writes are best-effort
|
|
42
|
-
* and never change tool results. Implement `list` to enable the Activity UI.
|
|
43
|
-
*/
|
|
44
|
-
activity?: ActivityStore;
|
|
45
|
-
/**
|
|
46
|
-
* Optional authorization gate for the Activity read API. MCP authentication
|
|
47
|
-
* is still required first. Omit to admit every authenticated actor.
|
|
48
|
-
*/
|
|
49
|
-
activityReadGate?: ActivityReadGate;
|
|
50
|
-
/** Stable deployment label included in activity events, e.g. "production". */
|
|
51
|
-
activityDeploymentId?: string;
|
|
52
114
|
/** Inbound auth adapters. Includes bearerToken(...); omit for open (dev). */
|
|
53
115
|
auth?: InboundAuth | InboundAuth[];
|
|
54
116
|
/** KVStorage impl. Defaults to memoryStorage(). */
|
|
@@ -58,78 +120,17 @@ export interface ConnectaConfig {
|
|
|
58
120
|
* HTTPS URL also redirects matching inbound HTTP requests to HTTPS.
|
|
59
121
|
*/
|
|
60
122
|
publicUrl?: string;
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
123
|
+
/** Payload-free tool activity storage and operator-read policy. */
|
|
124
|
+
activity?: ConnectaActivityConfig;
|
|
125
|
+
/** Operator credential vault and proactive liveness-check settings. */
|
|
126
|
+
credentials?: ConnectaCredentialsConfig;
|
|
127
|
+
/** Tool-catalog caching, persistence, stale fallback, and probe deadlines. */
|
|
128
|
+
discovery?: ConnectaDiscoveryConfig;
|
|
129
|
+
/** Deployment-wide call deadlines and result paging threshold. */
|
|
130
|
+
calls?: ConnectaCallsConfig;
|
|
66
131
|
/** Optional browser UI and OAuth result-page labels. */
|
|
67
132
|
branding?: ConnectaBranding;
|
|
68
133
|
logger?: Logger;
|
|
69
|
-
/** Tool-list cache TTL (seconds). Default 300. */
|
|
70
|
-
toolCacheTtlSeconds?: number;
|
|
71
|
-
/**
|
|
72
|
-
* Persist serializable remote tool catalogs in storage so cold isolates can
|
|
73
|
-
* discover tools without a downstream handshake. Default true.
|
|
74
|
-
*/
|
|
75
|
-
persistToolCatalog?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* How long an expired persisted catalog remains available as a fallback
|
|
78
|
-
* when a live refresh fails. Default 3600 seconds.
|
|
79
|
-
*/
|
|
80
|
-
toolCatalogStaleSeconds?: number;
|
|
81
|
-
/**
|
|
82
|
-
* Max inline result size (bytes) before call_tool/batch_call truncate and
|
|
83
|
-
* stash the full text for get_result paging. Must be a whole number of bytes
|
|
84
|
-
* >= 1; anything else (0, negative, fractional, NaN, Infinity) warns at
|
|
85
|
-
* startup and falls back to the default 50_000.
|
|
86
|
-
*/
|
|
87
|
-
maxResultBytes?: number;
|
|
88
|
-
/**
|
|
89
|
-
* Deadline (ms) applied to call_tool/batch_call calls that pass no
|
|
90
|
-
* `timeoutMs`, giving the connector both a budget (`ctx.timeoutMs`) and a
|
|
91
|
-
* cancellation signal (`ctx.signal`). An explicit per-call `timeoutMs` always
|
|
92
|
-
* wins. **Opt-in — undefined by default**, because switching it on globally
|
|
93
|
-
* would put a deadline on every call in an existing deployment and the
|
|
94
|
-
* failure mode is a working long-running call starting to time out.
|
|
95
|
-
* `execute_code` host calls are unaffected; they already carry a 15 s bound.
|
|
96
|
-
*
|
|
97
|
-
* Bounds a single attempt, not the whole call — the same as an explicit
|
|
98
|
-
* `timeoutMs` has always done. A call that also passes `maxRetries` can
|
|
99
|
-
* therefore run to roughly `(maxRetries + 1)` times this value plus backoff.
|
|
100
|
-
* `maxRetries` defaults to 0, so this is the total for every call that does
|
|
101
|
-
* not explicitly ask to retry.
|
|
102
|
-
*/
|
|
103
|
-
defaultToolTimeoutMs?: number;
|
|
104
|
-
/**
|
|
105
|
-
* Deadline (ms) applied to each individual downstream probe/catalog call that
|
|
106
|
-
* the discovery meta-tools fan out — `list_connectors` (with `probe`),
|
|
107
|
-
* `search_tools`, and `describe_tools` — so a single hung connector can no
|
|
108
|
-
* longer stall the whole meta-tool call. **Defaults to a generous 30_000**,
|
|
109
|
-
* chosen to trip only on a pathological hang, not on a realistically slow
|
|
110
|
-
* probe, so having it on by default will not break existing deployments.
|
|
111
|
-
* Bounds one downstream call, not the whole fan-out: a connector that outruns
|
|
112
|
-
* it degrades to an unavailable/errored entry while the rest are unaffected.
|
|
113
|
-
*
|
|
114
|
-
* Does NOT apply to `call_tool`/`batch_call` — those carry their own budget
|
|
115
|
-
* via `defaultToolTimeoutMs` or a per-call `timeoutMs`. Note this bounds the
|
|
116
|
-
* caller-facing wait only; the underlying fetch is not currently aborted, so
|
|
117
|
-
* real cancellation of the downstream request is a deferred follow-up.
|
|
118
|
-
*/
|
|
119
|
-
probeTimeoutMs?: number;
|
|
120
|
-
/**
|
|
121
|
-
* Tuning for the proactive credential liveness checks (issue #24) that let a
|
|
122
|
-
* connector's status flip to `auth_required` *before* an agent's call fails.
|
|
123
|
-
* Defaults are safe to leave alone: at most one check per connector per 15
|
|
124
|
-
* minutes, four in flight, 30 s each, triggered opportunistically by inbound
|
|
125
|
-
* authenticated traffic. Only connectors holding a credential connecta stores
|
|
126
|
-
* — an operator-managed `credential`, or a downstream-OAuth grant — are ever
|
|
127
|
-
* checked, and a check never calls a downstream tool.
|
|
128
|
-
*
|
|
129
|
-
* `Connecta.checkCredentials()` is the same check on demand, for a Worker cron
|
|
130
|
-
* trigger or a Node interval.
|
|
131
|
-
*/
|
|
132
|
-
credentialHealth?: CredentialHealthConfig;
|
|
133
134
|
serverInfo?: {
|
|
134
135
|
name?: string;
|
|
135
136
|
version?: string;
|
|
@@ -171,7 +172,7 @@ export interface Connecta {
|
|
|
171
172
|
*
|
|
172
173
|
* Returns one outcome per connector considered, including why a connector was
|
|
173
174
|
* skipped (`fresh` is the rate limit: a connector checked less than
|
|
174
|
-
* `
|
|
175
|
+
* `credentials.health.intervalSeconds` ago is not re-checked unless `force`).
|
|
175
176
|
* Never rejects on a connector failure — a broken connector becomes an `error`
|
|
176
177
|
* verdict. Needs a base URL for connector contexts: `publicUrl` supplies it,
|
|
177
178
|
* or pass one.
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,SAAS,EACT,MAAM,EACP,MAAM,YAAY,CAAC;AAEpB,8DAA8D;AAC9D,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,KAAK,EAAE,aAAa,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,8EAA8E;IAC9E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wEAAwE;AACxE,MAAM,WA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AAe,CAAC;AAClD,YAAY,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAI9C,YAAY,EACV,qBAAqB,EACrB,aAAa,EACb,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAGvB,YAAY,EACV,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAClF,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC/D,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,yBAAyB,EACzB,yBAAyB,EACzB,8BAA8B,EAC9B,yBAAyB,EACzB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,UAAU,EACV,UAAU,EACV,SAAS,EACT,MAAM,EACN,OAAO,EACP,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CredentialVault } from "./credentials.js";
|
|
1
|
+
import { CredentialVault, credentialTestRule, describeCredentialTestMismatch, } from "./credentials.js";
|
|
2
2
|
import { Registry } from "./registry.js";
|
|
3
3
|
import { createFetchHandler } from "./server.js";
|
|
4
4
|
import { droppedBrandingUrls, droppedUiAuthUrls } from "./ui.js";
|
|
@@ -21,10 +21,56 @@ function normalizeAuth(auth) {
|
|
|
21
21
|
return rank(a) - rank(b);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
+
const LEGACY_CONFIG_MIGRATIONS = [
|
|
25
|
+
["activityReadGate", "activity.readGate"],
|
|
26
|
+
["activityDeploymentId", "activity.deploymentId"],
|
|
27
|
+
["credentialEncryptionKey", "credentials.encryptionKey"],
|
|
28
|
+
["credentialHealth", "credentials.health"],
|
|
29
|
+
["toolCacheTtlSeconds", "discovery.catalogTtlSeconds"],
|
|
30
|
+
["persistToolCatalog", "discovery.persistCatalog"],
|
|
31
|
+
["toolCatalogStaleSeconds", "discovery.staleCatalogSeconds"],
|
|
32
|
+
["probeTimeoutMs", "discovery.probeTimeoutMs"],
|
|
33
|
+
["defaultToolTimeoutMs", "calls.defaultTimeoutMs"],
|
|
34
|
+
["maxResultBytes", "calls.maxResultBytes"],
|
|
35
|
+
];
|
|
36
|
+
const hasOwn = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
37
|
+
/**
|
|
38
|
+
* Fail closed at the public boundary: a JavaScript caller on the v0.6 shape
|
|
39
|
+
* must receive one complete migration error, never silently lose an option to
|
|
40
|
+
* a default. This runs before createConnecta reads any other config field.
|
|
41
|
+
*/
|
|
42
|
+
function assertNoLegacyConfig(config) {
|
|
43
|
+
const candidate = config;
|
|
44
|
+
const found = [];
|
|
45
|
+
if (hasOwn(candidate, "activity")) {
|
|
46
|
+
const activity = candidate.activity;
|
|
47
|
+
const isObject = typeof activity === "object" && activity !== null;
|
|
48
|
+
// A valid v0.6 ActivityStore can itself own a backend field named `store`.
|
|
49
|
+
// Its required `record` method (including a prototype method) therefore
|
|
50
|
+
// takes precedence over the otherwise-new wrapper shape.
|
|
51
|
+
const hasLegacyRecord = isObject &&
|
|
52
|
+
typeof activity.record === "function";
|
|
53
|
+
if (activity !== undefined &&
|
|
54
|
+
(!isObject ||
|
|
55
|
+
hasLegacyRecord ||
|
|
56
|
+
!hasOwn(activity, "store"))) {
|
|
57
|
+
found.push(["activity", "activity.store"]);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
for (const migration of LEGACY_CONFIG_MIGRATIONS) {
|
|
61
|
+
if (hasOwn(candidate, migration[0]))
|
|
62
|
+
found.push(migration);
|
|
63
|
+
}
|
|
64
|
+
if (found.length === 0)
|
|
65
|
+
return;
|
|
66
|
+
throw new Error("Unsupported v0.6.x ConnectaConfig options. Migrate each path for v0.7.0:\n" +
|
|
67
|
+
found.map(([oldPath, newPath]) => `- ${oldPath} -> ${newPath}`).join("\n"));
|
|
68
|
+
}
|
|
24
69
|
/**
|
|
25
70
|
* One-time construction warnings for deployment shapes that run fine but are
|
|
26
71
|
* usually unintended. Warning-only — never throws and never changes behavior;
|
|
27
|
-
* each condition emits at most one `logger.warn
|
|
72
|
+
* each deployment-wide condition emits at most one `logger.warn`, and each
|
|
73
|
+
* per-connector condition at most one per connector it names.
|
|
28
74
|
*/
|
|
29
75
|
function warnInsecureConfig(config, inboundAuth, toolkits, logger) {
|
|
30
76
|
const oauthConnectors = config.connectors.filter((c) => c.finishAuth);
|
|
@@ -108,52 +154,76 @@ function warnInsecureConfig(config, inboundAuth, toolkits, logger) {
|
|
|
108
154
|
"used as an href, so it must be an absolute http(s) URL (favicon.href " +
|
|
109
155
|
"may also be a root-relative path). The default is rendered instead.");
|
|
110
156
|
}
|
|
111
|
-
//
|
|
112
|
-
// offers one,
|
|
113
|
-
// provider's frontendApiUrl
|
|
114
|
-
//
|
|
115
|
-
//
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
//
|
|
157
|
+
// Operator shells render exactly one provider's browser sign-in config — the
|
|
158
|
+
// first that offers one, matching the server route's `find` — and that
|
|
159
|
+
// provider's URLs reach the browser: frontendApiUrl as the loader's
|
|
160
|
+
// `<script src>`, signInUrl/signUpUrl as the addresses ClerkJS navigates to.
|
|
161
|
+
// Gate-or-drop like a branding href: rendering drops a rejected value and the
|
|
162
|
+
// operator page then reports that Clerk could not load or quietly signs in
|
|
163
|
+
// through Clerk's defaults — both confusing symptoms without this line naming
|
|
164
|
+
// the cause. Checking only the rendered provider keeps the claim true — a
|
|
165
|
+
// later provider's uiAuth never reaches the page, so there is nothing there
|
|
166
|
+
// to warn about.
|
|
119
167
|
const uiAuthProvider = inboundAuth.find((provider) => provider.uiAuth);
|
|
120
168
|
const droppedUiAuth = droppedUiAuthUrls(uiAuthProvider?.uiAuth);
|
|
121
169
|
if (uiAuthProvider && droppedUiAuth.length > 0) {
|
|
122
170
|
logger.warn(`[connecta] inbound auth provider "${uiAuthProvider.kind}" had ` +
|
|
123
|
-
`${droppedUiAuth.join(", ")} dropped:
|
|
124
|
-
"
|
|
125
|
-
"
|
|
171
|
+
`${droppedUiAuth.join(", ")} dropped: every uiAuth URL reaches the ` +
|
|
172
|
+
"browser — as the sign-in loader's source, or as a place Clerk sends " +
|
|
173
|
+
"the operator — so each must be an absolute https URL. A dropped " +
|
|
174
|
+
"value reaches no part of the page: without frontendApiUrl the operator shell renders " +
|
|
175
|
+
"no loader and cannot start a sign-in, and without signInUrl/signUpUrl " +
|
|
176
|
+
"it signs in through Clerk's defaults.");
|
|
177
|
+
}
|
|
178
|
+
// A credential test hook that cannot test the declared credential shape.
|
|
179
|
+
// The shape picks the hook (see `credentialTestRule`) and the other one is
|
|
180
|
+
// never substituted, so the connector is simply not testable: /credentials offers no
|
|
181
|
+
// Test action and the route answers 400. Without this line the only way to
|
|
182
|
+
// discover the mistake is to click a button that isn't there.
|
|
183
|
+
for (const connector of config.connectors) {
|
|
184
|
+
const { mismatch } = credentialTestRule(connector);
|
|
185
|
+
if (!mismatch)
|
|
186
|
+
continue;
|
|
187
|
+
logger.warn(`[connecta] connector "${connector.id}" cannot test its credential: ` +
|
|
188
|
+
`${describeCredentialTestMismatch(mismatch)}. /credentials offers no Test ` +
|
|
189
|
+
`action and POST /ui/credentials/${connector.id}/test answers 400 ` +
|
|
190
|
+
"until the matching hook is implemented.");
|
|
126
191
|
}
|
|
127
|
-
// OAuth connectors whose callback
|
|
128
|
-
//
|
|
192
|
+
// OAuth connectors whose callback cannot perform a state/CSRF check. The
|
|
193
|
+
// public route refuses every callback for these connectors rather than hand
|
|
194
|
+
// an unverified code to finishAuth, so this warning explains why auth cannot
|
|
195
|
+
// complete instead of describing a vulnerability the server permits.
|
|
129
196
|
for (const connector of oauthConnectors) {
|
|
130
197
|
if (!connector.verifyState) {
|
|
131
198
|
logger.warn(`[connecta] connector "${connector.id}" has an OAuth callback with no ` +
|
|
132
|
-
`state/CSRF check: /oauth/callback/${connector.id}
|
|
133
|
-
"
|
|
199
|
+
`state/CSRF check: /oauth/callback/${connector.id} refuses every ` +
|
|
200
|
+
"callback rather than exchange an unverified code. Implement " +
|
|
201
|
+
"`verifyState` to complete authorization (the shipped remoteMcp " +
|
|
134
202
|
"connector already does).");
|
|
135
203
|
}
|
|
136
204
|
}
|
|
137
205
|
}
|
|
138
206
|
export function createConnecta(config) {
|
|
207
|
+
assertNoLegacyConfig(config);
|
|
139
208
|
const storage = config.storage ?? memoryStorage();
|
|
140
209
|
const logger = config.logger ?? defaultLogger();
|
|
141
210
|
const credentialConnectors = config.connectors.filter((c) => c.credential);
|
|
142
|
-
|
|
143
|
-
|
|
211
|
+
const encryptionKey = config.credentials?.encryptionKey;
|
|
212
|
+
if (credentialConnectors.length > 0 && !encryptionKey) {
|
|
213
|
+
throw new Error(`credentials.encryptionKey is required by connector credentials: ${credentialConnectors.map((c) => c.id).join(", ")}`);
|
|
144
214
|
}
|
|
145
|
-
const credentialVault =
|
|
146
|
-
? new CredentialVault(storage,
|
|
215
|
+
const credentialVault = encryptionKey
|
|
216
|
+
? new CredentialVault(storage, encryptionKey)
|
|
147
217
|
: undefined;
|
|
148
218
|
const registry = new Registry(config.connectors, {
|
|
149
219
|
storage,
|
|
150
220
|
logger,
|
|
151
221
|
credentialVault,
|
|
152
|
-
toolCacheTtlSeconds: config.
|
|
153
|
-
persistToolCatalog: config.
|
|
154
|
-
toolCatalogStaleSeconds: config.
|
|
155
|
-
maxResultBytes: config.maxResultBytes,
|
|
156
|
-
credentialHealth: config.
|
|
222
|
+
toolCacheTtlSeconds: config.discovery?.catalogTtlSeconds,
|
|
223
|
+
persistToolCatalog: config.discovery?.persistCatalog,
|
|
224
|
+
toolCatalogStaleSeconds: config.discovery?.staleCatalogSeconds,
|
|
225
|
+
maxResultBytes: config.calls?.maxResultBytes,
|
|
226
|
+
credentialHealth: config.credentials?.health,
|
|
157
227
|
});
|
|
158
228
|
// Throws on every structural mistake it can see (see resolveToolkits): a
|
|
159
229
|
// typo must not become a scope the operator never wrote. Note this is about
|
|
@@ -176,12 +246,12 @@ export function createConnecta(config) {
|
|
|
176
246
|
version: config.serverInfo?.version ?? CONNECTA_VERSION,
|
|
177
247
|
},
|
|
178
248
|
logger,
|
|
179
|
-
activity: config.activity,
|
|
180
|
-
activityReadGate: config.
|
|
181
|
-
activityDeploymentId: config.
|
|
249
|
+
activity: config.activity?.store,
|
|
250
|
+
activityReadGate: config.activity?.readGate,
|
|
251
|
+
activityDeploymentId: config.activity?.deploymentId,
|
|
182
252
|
executor: config.executor,
|
|
183
|
-
defaultToolTimeoutMs: config.
|
|
184
|
-
probeTimeoutMs: config.probeTimeoutMs,
|
|
253
|
+
defaultToolTimeoutMs: config.calls?.defaultTimeoutMs,
|
|
254
|
+
probeTimeoutMs: config.discovery?.probeTimeoutMs,
|
|
185
255
|
credentialVault,
|
|
186
256
|
deploymentInfo: config.deploymentInfo,
|
|
187
257
|
branding: config.branding,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OA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E,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AA2DhD,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/meta-tools.d.ts
CHANGED
|
@@ -169,9 +169,9 @@ export interface SkillArgs {
|
|
|
169
169
|
* optional tenth tool, is registered separately by registerExecuteTool.)
|
|
170
170
|
*
|
|
171
171
|
* The deployment-wide result-size cap is read off the registry view rather than
|
|
172
|
-
* passed in: `ConnectaConfig.maxResultBytes` and the per-connector
|
|
173
|
-
* the only places a cap is set, so there is one answer to where a
|
|
174
|
-
* sets it (issue #44).
|
|
172
|
+
* passed in: `ConnectaConfig.calls.maxResultBytes` and the per-connector
|
|
173
|
+
* override are the only places a cap is set, so there is one answer to where a
|
|
174
|
+
* deployment sets it (issue #44).
|
|
175
175
|
*/
|
|
176
176
|
export declare function createMetaTools(registry: RegistryView, baseUrl: string, opts?: {
|
|
177
177
|
/** Deadline applied when a call passes no `timeoutMs`. Off when unset. */
|