@zackbart/connecta 0.28.1 → 0.29.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 +788 -5
- package/README.md +62 -42
- package/bin/connecta.mjs +110 -139
- package/bin/meta-tool-names.d.mts +2 -0
- package/bin/meta-tool-names.mjs +9 -0
- package/bin/version.mjs +3 -0
- package/dist/access-tokens.js +53 -63
- package/dist/activity-request.js +8 -0
- package/dist/activity.d.ts +76 -42
- package/dist/activity.js +110 -42
- package/dist/auth/clerk-sdk/client.d.ts +65 -0
- package/dist/auth/clerk-sdk/client.js +5 -0
- package/dist/auth/clerk-sdk/generated.js +1845 -0
- package/dist/auth/clerk-transport.js +19 -0
- package/dist/auth/clerk.d.ts +17 -7
- package/dist/auth/clerk.js +189 -107
- package/dist/auth/cloudflare-access.js +25 -26
- package/dist/auth/downstream-client-metadata.d.ts +29 -0
- package/dist/auth/downstream-client-metadata.js +133 -0
- package/dist/auth/downstream-oauth.js +1584 -1580
- package/dist/auth/downstream-revocation.js +106 -0
- package/dist/auth/oauth-token-response.js +231 -0
- package/dist/auth/oauth-v2-migration.js +116 -0
- package/dist/auth/static-oauth.js +93 -71
- package/dist/auth-elicitation.js +283 -0
- package/dist/branding.d.ts +8 -16
- package/dist/branding.js +26 -59
- package/dist/byte-read-response.js +39 -0
- package/dist/call-admission.js +12 -16
- package/dist/catalog-cache.js +739 -0
- package/dist/catalog-drift.d.ts +50 -15
- package/dist/catalog-drift.js +365 -128
- package/dist/catalog-fingerprint.js +2 -4
- package/dist/catalog-freshness.js +13 -0
- package/dist/catalog-limits.js +2 -2
- package/dist/catalog-service.js +368 -224
- package/dist/catalog.js +43 -84
- package/dist/concurrency.js +3 -4
- package/dist/config-defaults.d.ts +39 -0
- package/dist/config-defaults.js +46 -0
- package/dist/config-schema.d.ts +181 -0
- package/dist/config-schema.js +435 -0
- package/dist/config-value-sources.js +102 -0
- package/dist/config.d.ts +631 -0
- package/dist/config.js +503 -0
- package/dist/connector-access.d.ts +1 -0
- package/dist/connector-access.js +13 -15
- package/dist/connector-caller.d.ts +8 -0
- package/dist/connector-caller.js +15 -6
- package/dist/connector-scope.js +1 -1
- package/dist/connectors/api-connector.d.ts +59 -7
- package/dist/connectors/api-connector.js +106 -19
- package/dist/connectors/api.js +4 -1
- package/dist/connectors/guarded-fetch.d.ts +144 -0
- package/dist/connectors/guarded-fetch.js +84 -35
- package/dist/connectors/negotiation-cache.js +46 -0
- package/dist/connectors/option-shapes.js +27 -0
- package/dist/connectors/remote-mcp.d.ts +30 -4
- package/dist/connectors/remote-mcp.js +1774 -320
- package/dist/connectors/resource-uri.js +335 -0
- package/dist/credential-contract.d.ts +10 -0
- package/dist/credential-rules.js +1 -3
- package/dist/credential-url.js +108 -0
- package/dist/credentials.d.ts +6 -1
- package/dist/credentials.js +27 -18
- package/dist/d1.d.ts +130 -0
- package/dist/d1.js +290 -0
- package/dist/describe-config.d.ts +165 -0
- package/dist/describe-config.js +315 -0
- package/dist/described.js +106 -0
- package/dist/downstream-input-context.js +119 -0
- package/dist/downstream-input.js +323 -0
- package/dist/errors.d.ts +97 -20
- package/dist/errors.js +158 -80
- package/dist/execute.js +453 -305
- package/dist/executor-admission.d.ts +1 -0
- package/dist/executor-admission.js +11 -15
- package/dist/executor-contract.d.ts +20 -0
- package/dist/executor-contract.js +48 -0
- package/dist/executor-result.js +24 -9
- package/dist/executors/quickjs-child.js +3 -4
- package/dist/executors/quickjs-runtime.js +147 -59
- package/dist/executors/quickjs.js +29 -35
- package/dist/favicon.js +1 -2
- package/dist/fix-prompt.js +1 -3
- package/dist/guest-runtime.js +188 -0
- package/dist/guest-types.d.ts +176 -0
- package/dist/guest-types.js +1 -0
- package/dist/html-security.js +24 -0
- package/dist/identity.js +1 -3
- package/dist/inbound-credential.js +52 -0
- package/dist/index.d.ts +24 -256
- package/dist/index.js +65 -478
- package/dist/invocation-auth.js +69 -0
- package/dist/invocation.js +230 -73
- package/dist/json-schema.d.ts +1 -1
- package/dist/mcp-client-context.js +35 -0
- package/dist/mcp-result.js +11 -7
- package/dist/meta-output.js +76 -0
- package/dist/meta-tool-names.d.ts +2 -0
- package/dist/meta-tool-names.js +3 -0
- package/dist/meta-tools.js +285 -209
- package/dist/module-contracts.d.ts +8 -23
- package/dist/node.d.ts +0 -2
- package/dist/node.js +2 -2
- package/dist/oauth-callback-outcome.js +1 -3
- package/dist/oauth-handoff.js +117 -0
- package/dist/oauth-sealing.js +20 -0
- package/dist/operator-record.d.ts +137 -0
- package/dist/operator-record.js +420 -0
- package/dist/operator-ui/assets.js +31 -0
- package/dist/operator-ui/contract.d.ts +72 -0
- package/dist/operator-ui/contract.js +1 -0
- package/dist/operator-ui/fix-prompts.d.ts +18 -0
- package/dist/operator-ui/generated.js +5 -4
- package/dist/operator-ui/model.d.ts +12 -87
- package/dist/operator-ui/model.js +2 -9
- package/dist/operator-ui/setup-commands.js +1 -3
- package/dist/operator-ui/view.d.ts +323 -0
- package/dist/operator-ui/view.js +62 -189
- package/dist/page-styles.js +2 -3
- package/dist/program-source.js +14 -2
- package/dist/{exempt-writes.js → program-writes.js} +55 -18
- package/dist/provider.d.ts +142 -0
- package/dist/provider.js +187 -0
- package/dist/providers/_shared/google/result-size.js +57 -0
- package/dist/providers/_shared/google/service-account.d.ts +58 -0
- package/dist/providers/_shared/google/service-account.js +500 -0
- package/dist/providers/_shared/google/workspace.d.ts +276 -0
- package/dist/providers/_shared/google/workspace.js +518 -0
- package/dist/providers/{basecamp.d.ts → basecamp/index.d.ts} +6 -28
- package/dist/providers/basecamp/index.js +997 -0
- package/dist/providers/basecamp/skill.generated.js +9 -0
- package/dist/providers/{breeze.d.ts → breeze/index.d.ts} +2 -2
- package/dist/providers/{breeze.js → breeze/index.js} +184 -140
- package/dist/providers/breeze/skill.generated.js +9 -0
- package/dist/providers/{ccb.d.ts → ccb/index.d.ts} +2 -2
- package/dist/providers/{ccb.js → ccb/index.js} +271 -116
- package/dist/providers/ccb/skill.generated.js +9 -0
- package/dist/providers/{cloudflare.d.ts → cloudflare/index.d.ts} +8 -7
- package/dist/providers/{cloudflare.js → cloudflare/index.js} +171 -738
- package/dist/providers/cloudflare/skill.generated.js +10 -0
- package/dist/providers/docs/index.d.ts +54 -0
- package/dist/providers/docs/index.js +1237 -0
- package/dist/providers/docs/skill.generated.js +9 -0
- package/dist/providers/drive/index.d.ts +53 -0
- package/dist/providers/drive/index.js +1523 -0
- package/dist/providers/drive/skill.generated.js +9 -0
- package/dist/providers/forms/index.d.ts +54 -0
- package/dist/providers/forms/index.js +1217 -0
- package/dist/providers/forms/skill.generated.js +11 -0
- package/dist/providers/github/auth.d.ts +32 -0
- package/dist/providers/github/auth.js +361 -0
- package/dist/providers/github/hosted.js +218 -0
- package/dist/providers/github/index.d.ts +13 -0
- package/dist/providers/github/index.js +140 -0
- package/dist/providers/github/key.js +100 -0
- package/dist/providers/github/rest.js +321 -0
- package/dist/providers/github/scope.d.ts +29 -0
- package/dist/providers/github/scope.js +124 -0
- package/dist/providers/github/skill.generated.js +8 -0
- package/dist/providers/gmail/index.d.ts +51 -0
- package/dist/providers/gmail/index.js +1436 -0
- package/dist/providers/gmail/skill.generated.js +9 -0
- package/dist/providers/{linear.d.ts → linear/index.d.ts} +11 -14
- package/dist/providers/linear/index.js +352 -0
- package/dist/providers/linear/skill.generated.js +8 -0
- package/dist/providers/{mixpanel.d.ts → mixpanel/index.d.ts} +5 -10
- package/dist/providers/mixpanel/index.js +416 -0
- package/dist/providers/mixpanel/skill.generated.js +9 -0
- package/dist/providers/{notion.d.ts → notion/index.d.ts} +8 -8
- package/dist/providers/{notion.js → notion/index.js} +226 -239
- package/dist/providers/notion/skill.generated.js +10 -0
- package/dist/providers/{overflow.d.ts → overflow/index.d.ts} +2 -2
- package/dist/providers/{overflow.js → overflow/index.js} +74 -111
- package/dist/providers/overflow/skill.generated.js +8 -0
- package/dist/providers/{planning-center.d.ts → planning-center/index.d.ts} +2 -2
- package/dist/providers/{planning-center.js → planning-center/index.js} +264 -104
- package/dist/providers/planning-center/skill.generated.js +10 -0
- package/dist/providers/{revenuecat.d.ts → revenuecat/index.d.ts} +5 -10
- package/dist/providers/revenuecat/index.js +557 -0
- package/dist/providers/revenuecat/skill.generated.js +11 -0
- package/dist/providers/sheets/index.d.ts +54 -0
- package/dist/providers/sheets/index.js +1237 -0
- package/dist/providers/sheets/skill.generated.js +10 -0
- package/dist/providers/slides/index.d.ts +53 -0
- package/dist/providers/slides/index.js +2645 -0
- package/dist/providers/slides/skill.generated.js +9 -0
- package/dist/providers/{stripe.d.ts → stripe/index.d.ts} +5 -12
- package/dist/providers/stripe/index.js +266 -0
- package/dist/providers/stripe/skill.generated.js +11 -0
- package/dist/providers/{tithely.d.ts → tithely/index.d.ts} +2 -2
- package/dist/providers/{tithely.js → tithely/index.js} +60 -91
- package/dist/providers/tithely/skill.generated.js +8 -0
- package/dist/providers/{vercel.d.ts → vercel/index.d.ts} +8 -8
- package/dist/providers/vercel/index.js +1038 -0
- package/dist/providers/vercel/mcp-ownership.js +212 -0
- package/dist/providers/vercel/skill.generated.js +11 -0
- package/dist/registry.d.ts +108 -171
- package/dist/registry.js +513 -925
- package/dist/request-state.js +21 -0
- package/dist/resource-read.js +100 -0
- package/dist/result-shapes.js +17 -49
- package/dist/retired-toolkits.js +1 -1
- package/dist/routes/access-tokens.js +3 -6
- package/dist/routes/activity-context.js +21 -0
- package/dist/routes/activity-disclosure.js +40 -0
- package/dist/routes/activity.js +59 -21
- package/dist/routes/actor-labels.js +3 -50
- package/dist/routes/connect.js +221 -0
- package/dist/routes/credentials.js +15 -27
- package/dist/routes/mcp.js +356 -130
- package/dist/routes/oauth-client-metadata.js +15 -0
- package/dist/routes/oauth-management.js +45 -107
- package/dist/routes/oauth.js +110 -57
- package/dist/routes/operator.js +3 -3
- package/dist/routes/shared.d.ts +25 -64
- package/dist/routes/shared.js +160 -80
- package/dist/routes/skills.js +30 -0
- package/dist/routes/ui-config.js +225 -0
- package/dist/routes/ui-data.js +40 -35
- package/dist/routes/ui.js +66 -56
- package/dist/runtime/admission.js +4 -2
- package/dist/runtime/call-admission.js +3 -1
- package/dist/runtime/connector-scope.js +1 -4
- package/dist/runtime/run.js +10 -39
- package/dist/runtime/services.js +12 -117
- package/dist/runtime/shared-read.js +1 -3
- package/dist/runtime/storage.js +8 -1
- package/dist/sent-secrets.d.ts +52 -0
- package/dist/sent-secrets.js +474 -0
- package/dist/server.js +28 -71
- package/dist/skills.js +406 -174
- package/dist/sqlite.d.ts +48 -0
- package/dist/sqlite.js +166 -0
- package/dist/storage/keys.js +428 -0
- package/dist/storage/memory.js +7 -0
- package/dist/storage/sql.d.ts +66 -0
- package/dist/storage/sql.js +534 -0
- package/dist/timeout.js +4 -2
- package/dist/tool-name.js +17 -0
- package/dist/tool-safety.d.ts +9 -35
- package/dist/tool-safety.js +20 -40
- package/dist/types.d.ts +320 -54
- package/dist/types.js +0 -1
- package/dist/ui.d.ts +7 -19
- package/dist/ui.js +76 -90
- package/dist/url-safety.js +3 -6
- package/dist/usage-guide.js +137 -0
- package/dist/validate.d.ts +7 -0
- package/dist/validate.js +309 -47
- package/dist/version.d.ts +1 -7
- package/dist/version.js +3 -7
- package/dist/worker.d.ts +11 -0
- package/dist/worker.js +434 -0
- package/documentation/architecture.md +664 -231
- package/documentation/auth.md +936 -546
- package/documentation/code-mode.md +501 -312
- package/documentation/meta-tools.md +449 -200
- package/documentation/operator-tests.md +93 -0
- package/documentation/provider-migration-0.29.md +60 -0
- package/examples/worker/AGENTS.md +34 -12
- package/examples/worker/README.md +286 -255
- package/examples/worker/kv-to-d1.wrangler.jsonc +26 -0
- package/examples/worker/scripts/copy-kv-to-d1.mjs +162 -0
- package/examples/worker/src/connecta.config.ts +151 -0
- package/examples/worker/src/index.ts +14 -197
- package/examples/worker/wrangler.jsonc +15 -35
- package/package.json +120 -54
- package/templates/node/.dockerignore +1 -2
- package/templates/node/.env.example +20 -21
- package/templates/node/AGENTS.md +21 -17
- package/templates/node/Dockerfile +3 -5
- package/templates/node/README.md +133 -58
- package/templates/node/docker-compose.yml +11 -12
- package/templates/node/package.json +4 -2
- package/templates/node/src/connecta.config.ts +119 -0
- package/templates/node/src/index.ts +9 -154
- package/templates/node/src/provision-token.ts +17 -0
- package/AGENTS.md +0 -170
- package/dist/artifacts/connector.d.ts +0 -58
- package/dist/artifacts/connector.js +0 -730
- package/dist/artifacts/document.js +0 -86
- package/dist/artifacts/guide.js +0 -140
- package/dist/artifacts/html-scan.js +0 -329
- package/dist/artifacts/json.js +0 -78
- package/dist/artifacts/kv-store.d.ts +0 -20
- package/dist/artifacts/kv-store.js +0 -140
- package/dist/artifacts/markdown.js +0 -478
- package/dist/artifacts/module.d.ts +0 -37
- package/dist/artifacts/module.js +0 -66
- package/dist/artifacts/operations.d.ts +0 -197
- package/dist/artifacts/operations.js +0 -1002
- package/dist/artifacts/refresh.d.ts +0 -55
- package/dist/artifacts/refresh.js +0 -236
- package/dist/artifacts/routes.js +0 -206
- package/dist/artifacts/types.d.ts +0 -214
- package/dist/artifacts/types.js +0 -22
- package/dist/artifacts/validate.d.ts +0 -62
- package/dist/artifacts/validate.js +0 -651
- package/dist/artifacts.d.ts +0 -6
- package/dist/artifacts.js +0 -9
- package/dist/auth/bearer.d.ts +0 -11
- package/dist/auth/bearer.js +0 -50
- package/dist/providers/basecamp.js +0 -445
- package/dist/providers/linear.js +0 -217
- package/dist/providers/mixpanel.js +0 -247
- package/dist/providers/revenuecat.js +0 -317
- package/dist/providers/stripe.js +0 -253
- package/dist/providers/vercel.js +0 -1253
- package/dist/storage/file.d.ts +0 -15
- package/dist/storage/file.js +0 -455
- package/ethos.md +0 -93
- package/examples/worker/src/cloudflare-kv.ts +0 -43
- package/examples/worker/src/d1-activity-row.ts +0 -155
- package/examples/worker/src/d1-activity.ts +0 -147
- package/examples/worker/src/d1-storage.ts +0 -138
- package/examples/worker/src/r2-artifact-blobs.ts +0 -29
- package/templates/node/src/file-activity.ts +0 -182
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,631 @@
|
|
|
1
|
+
import type { ConnectorGrant } from "./connector-access.js";
|
|
2
|
+
import type { CredentialVault } from "./credential-contract.js";
|
|
3
|
+
import { type ConfigInput, type ConfigOutput } from "./config-schema.js";
|
|
4
|
+
import type { AccessTokensModule, ActivityModule, OperatorSurface } from "./module-contracts.js";
|
|
5
|
+
import type { AuthenticatedIdentity, Connector, Executor, IdentityReference, InboundAuth, KVStorage, Logger } from "./types.js";
|
|
6
|
+
/** Config-owned identity rules for one deployment and tenant. */
|
|
7
|
+
export type ConnectorPermission = "all" | "none" | readonly string[];
|
|
8
|
+
declare const discovery: {
|
|
9
|
+
/**
|
|
10
|
+
* Maximum connector catalogs/status probes fetched at once by discovery
|
|
11
|
+
* operations. Default 4.
|
|
12
|
+
*/
|
|
13
|
+
concurrency: import("./config-schema.js").Field<number, number, true>;
|
|
14
|
+
/** Fallback tool-list TTL when the downstream omits ttlMs. Default 300 seconds. */
|
|
15
|
+
catalogTtlSeconds: import("./config-schema.js").Field<number, number, true>;
|
|
16
|
+
/** Floor for positive downstream hints. Zero hints always disable reuse. Default 0. */
|
|
17
|
+
catalogMinTtlSeconds: import("./config-schema.js").Field<number, number, true>;
|
|
18
|
+
/** Ceiling for downstream hints and the fallback, capped by the SDK at 24h. Default 86400. */
|
|
19
|
+
catalogMaxTtlSeconds: import("./config-schema.js").Field<number, number, true>;
|
|
20
|
+
/**
|
|
21
|
+
* Deadline (ms) for each downstream probe/catalog call fanned out by
|
|
22
|
+
* `search_tools` and by `connecta.search`/`connecta.describe` inside
|
|
23
|
+
* `execute_code`. Defaults to 30_000. A timed-out connector degrades
|
|
24
|
+
* independently; this does not apply to tool calls. Catalog walks receive the
|
|
25
|
+
* same cancellation signal, which aborts an in-flight page where supported and
|
|
26
|
+
* prevents another from starting.
|
|
27
|
+
*/
|
|
28
|
+
probeTimeoutMs: import("./config-schema.js").Field<number, number, true>;
|
|
29
|
+
};
|
|
30
|
+
declare const calls: {
|
|
31
|
+
/**
|
|
32
|
+
* Deadline (ms) for `call_tool`/`call_destructive_tool` calls that pass no
|
|
33
|
+
* `timeoutMs`. An explicit per-call value wins. Opt-in: unset by default, so
|
|
34
|
+
* existing long-running calls gain no surprise deadline.
|
|
35
|
+
*
|
|
36
|
+
* Each call makes one attempt. `execute_code` host calls are
|
|
37
|
+
* unaffected because they already carry their own bound.
|
|
38
|
+
*/
|
|
39
|
+
defaultTimeoutMs: import("./config-schema.js").Field<number, number | undefined, true>;
|
|
40
|
+
/**
|
|
41
|
+
* Max inline result size (bytes) before truncation and `connecta.result` paging.
|
|
42
|
+
* A positive whole number; default 24_000. Connectors may override it
|
|
43
|
+
* individually.
|
|
44
|
+
*/
|
|
45
|
+
maxResultBytes: import("./config-schema.js").Field<number, number, true>;
|
|
46
|
+
};
|
|
47
|
+
declare const results: {
|
|
48
|
+
/** Stored bytes, including the paging envelope. Default 8 MiB. Zero disables stashing. */
|
|
49
|
+
maxStashBytes: import("./config-schema.js").Field<number, number, true>;
|
|
50
|
+
/** Stored or in-flight entries. Default 64. Zero disables stashing. */
|
|
51
|
+
maxStashEntries: import("./config-schema.js").Field<number, number, true>;
|
|
52
|
+
};
|
|
53
|
+
declare const execute: {
|
|
54
|
+
/**
|
|
55
|
+
* Aggregate serialized bytes `connecta.emit` accepts per run. Default
|
|
56
|
+
* 4_000_000 — a transport bound, not a context bound: emitted image/audio
|
|
57
|
+
* blocks reach the model as media, not base64 text.
|
|
58
|
+
*/
|
|
59
|
+
maxEmittedBytes: import("./config-schema.js").Field<number, number, true>;
|
|
60
|
+
/** Content blocks `connecta.emit` accepts per run. Default 32. */
|
|
61
|
+
maxEmittedBlocks: import("./config-schema.js").Field<number, number, true>;
|
|
62
|
+
/** Host calls one program may make. Default 20. */
|
|
63
|
+
maxHostCalls: import("./config-schema.js").Field<number, number, true>;
|
|
64
|
+
/**
|
|
65
|
+
* Deadline for each host call a program makes, in milliseconds. Default
|
|
66
|
+
* 15_000. Raise it for providers whose legitimate calls run longer, such as
|
|
67
|
+
* analytics queries; `call_tool`'s own `timeoutMs` is unaffected.
|
|
68
|
+
*/
|
|
69
|
+
hostCallTimeoutMs: import("./config-schema.js").Field<number, number, true>;
|
|
70
|
+
/**
|
|
71
|
+
* Hard ceiling on one execution, in milliseconds, enforced outside the
|
|
72
|
+
* sandbox. Default 120_000, above both executors' own deadlines (QuickJS
|
|
73
|
+
* 30_000, the Dynamic Worker 60_000), so it only ends a run whose executor
|
|
74
|
+
* never settled; that run fails as unresponsive and its admission slot is
|
|
75
|
+
* released. Keep it above any raised executor deadline.
|
|
76
|
+
*/
|
|
77
|
+
watchdogMs: import("./config-schema.js").Field<number, number, true>;
|
|
78
|
+
/**
|
|
79
|
+
* Trusted-pool writes one program may send, on top of the host-call
|
|
80
|
+
* budget every call already spends. Default 10.
|
|
81
|
+
*/
|
|
82
|
+
maxWrites: import("./config-schema.js").Field<number, number, true>;
|
|
83
|
+
};
|
|
84
|
+
declare const codeAdmission: {
|
|
85
|
+
/** Simultaneous work admitted to this pool. */
|
|
86
|
+
concurrency: import("./config-schema.js").Field<number, number, true>;
|
|
87
|
+
/** Callers allowed to wait behind active work. Set zero to fail fast. */
|
|
88
|
+
maxQueueSize: import("./config-schema.js").Field<number, number, true>;
|
|
89
|
+
/** Maximum queue wait in milliseconds. */
|
|
90
|
+
queueTimeoutMs: import("./config-schema.js").Field<number, number, true>;
|
|
91
|
+
/** Retry hint returned with overload failures, in milliseconds. */
|
|
92
|
+
retryAfterMs: import("./config-schema.js").Field<number, number, true>;
|
|
93
|
+
};
|
|
94
|
+
declare const requestAdmission: {
|
|
95
|
+
/** Hard lifetime of an admitted /mcp request. Default 300,000 ms. */
|
|
96
|
+
maxDurationMs: import("./config-schema.js").Field<number, number, true>;
|
|
97
|
+
/** Simultaneous work admitted to this pool. */
|
|
98
|
+
concurrency: import("./config-schema.js").Field<number, number, true>;
|
|
99
|
+
/** Callers allowed to wait behind active work. Set zero to fail fast. */
|
|
100
|
+
maxQueueSize: import("./config-schema.js").Field<number, number, true>;
|
|
101
|
+
/** Maximum queue wait in milliseconds. */
|
|
102
|
+
queueTimeoutMs: import("./config-schema.js").Field<number, number, true>;
|
|
103
|
+
/** Retry hint returned with overload failures, in milliseconds. */
|
|
104
|
+
retryAfterMs: import("./config-schema.js").Field<number, number, true>;
|
|
105
|
+
};
|
|
106
|
+
declare const admission: {
|
|
107
|
+
/**
|
|
108
|
+
* The `/mcp` request boundary. Defaults to 16 active, 32 queued, and a
|
|
109
|
+
* 5-second maximum wait.
|
|
110
|
+
*/
|
|
111
|
+
requests: import("./config-schema.js").Field<{
|
|
112
|
+
maxDurationMs?: number | undefined;
|
|
113
|
+
concurrency?: number | undefined;
|
|
114
|
+
maxQueueSize?: number | undefined;
|
|
115
|
+
queueTimeoutMs?: number | undefined;
|
|
116
|
+
retryAfterMs?: number | undefined;
|
|
117
|
+
}, {
|
|
118
|
+
readonly maxDurationMs: number;
|
|
119
|
+
readonly concurrency: number;
|
|
120
|
+
readonly maxQueueSize: number;
|
|
121
|
+
readonly queueTimeoutMs: number;
|
|
122
|
+
readonly retryAfterMs: number;
|
|
123
|
+
}, true> & {
|
|
124
|
+
readonly shape: {
|
|
125
|
+
/** Hard lifetime of an admitted /mcp request. Default 300,000 ms. */
|
|
126
|
+
maxDurationMs: import("./config-schema.js").Field<number, number, true>;
|
|
127
|
+
/** Simultaneous work admitted to this pool. */
|
|
128
|
+
concurrency: import("./config-schema.js").Field<number, number, true>;
|
|
129
|
+
/** Callers allowed to wait behind active work. Set zero to fail fast. */
|
|
130
|
+
maxQueueSize: import("./config-schema.js").Field<number, number, true>;
|
|
131
|
+
/** Maximum queue wait in milliseconds. */
|
|
132
|
+
queueTimeoutMs: import("./config-schema.js").Field<number, number, true>;
|
|
133
|
+
/** Retry hint returned with overload failures, in milliseconds. */
|
|
134
|
+
retryAfterMs: import("./config-schema.js").Field<number, number, true>;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Fallback pool for an `executor` that does not implement its own `acquire`.
|
|
139
|
+
* Defaults to 2 active, 8 queued, and a 5-second maximum wait. Bounded
|
|
140
|
+
* executors (including `quickJsExecutor`) keep their own tighter pool.
|
|
141
|
+
*/
|
|
142
|
+
code: import("./config-schema.js").Field<{
|
|
143
|
+
concurrency?: number | undefined;
|
|
144
|
+
maxQueueSize?: number | undefined;
|
|
145
|
+
queueTimeoutMs?: number | undefined;
|
|
146
|
+
retryAfterMs?: number | undefined;
|
|
147
|
+
}, {
|
|
148
|
+
readonly concurrency: number;
|
|
149
|
+
readonly maxQueueSize: number;
|
|
150
|
+
readonly queueTimeoutMs: number;
|
|
151
|
+
readonly retryAfterMs: number;
|
|
152
|
+
}, true> & {
|
|
153
|
+
readonly shape: {
|
|
154
|
+
/** Simultaneous work admitted to this pool. */
|
|
155
|
+
concurrency: import("./config-schema.js").Field<number, number, true>;
|
|
156
|
+
/** Callers allowed to wait behind active work. Set zero to fail fast. */
|
|
157
|
+
maxQueueSize: import("./config-schema.js").Field<number, number, true>;
|
|
158
|
+
/** Maximum queue wait in milliseconds. */
|
|
159
|
+
queueTimeoutMs: import("./config-schema.js").Field<number, number, true>;
|
|
160
|
+
/** Retry hint returned with overload failures, in milliseconds. */
|
|
161
|
+
retryAfterMs: import("./config-schema.js").Field<number, number, true>;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
declare const identity: {
|
|
166
|
+
/**
|
|
167
|
+
* What this admitted identity may discover and call: `"all"`, or a list
|
|
168
|
+
* whose entries are connector ids (the whole connector) and `connector.tool`
|
|
169
|
+
* addresses (that tool only), or `{ tool: "connector.tool",
|
|
170
|
+
* requireReadOnly: true }` for an exact tool only while its loaded catalog
|
|
171
|
+
* explicitly classifies it read-only. Grants are additive: an unrestricted
|
|
172
|
+
* connector or address grant wins over the guarded form. An address naming
|
|
173
|
+
* a tool the catalog lacks is unreachable and warned once, never widened.
|
|
174
|
+
*/
|
|
175
|
+
connectorAccess: import("./config-schema.js").Field<(identity: Readonly<AuthenticatedIdentity>) => "all" | readonly ConnectorGrant[] | Promise<"all" | readonly ConnectorGrant[]>, ((identity: Readonly<AuthenticatedIdentity>) => "all" | readonly ConnectorGrant[] | Promise<"all" | readonly ConnectorGrant[]>) | undefined, true>;
|
|
176
|
+
/** Global payload-free activity reads. Defaults to interactive humans. */
|
|
177
|
+
activityAccess: import("./config-schema.js").Field<(principal: Readonly<IdentityReference>) => boolean | Promise<boolean>, ((principal: Readonly<IdentityReference>) => boolean | Promise<boolean>) | undefined, true>;
|
|
178
|
+
/** Shared credential and OAuth administration. Defaults to none. */
|
|
179
|
+
credentialAdministration: import("./config-schema.js").Field<(identity: Readonly<AuthenticatedIdentity>) => ConnectorPermission | Promise<ConnectorPermission>, ((identity: Readonly<AuthenticatedIdentity>) => ConnectorPermission | Promise<ConnectorPermission>) | undefined, true>;
|
|
180
|
+
/** Client-token lifecycle management by interactive humans. Defaults to false. */
|
|
181
|
+
accessTokenManagement: import("./config-schema.js").Field<(identity: Readonly<AuthenticatedIdentity>) => boolean | Promise<boolean>, ((identity: Readonly<AuthenticatedIdentity>) => boolean | Promise<boolean>) | undefined, true>;
|
|
182
|
+
/** Connecting or changing the caller's personal account. Defaults to none. */
|
|
183
|
+
personalConnection: import("./config-schema.js").Field<(identity: Readonly<AuthenticatedIdentity>) => ConnectorPermission | Promise<ConnectorPermission>, ((identity: Readonly<AuthenticatedIdentity>) => ConnectorPermission | Promise<ConnectorPermission>) | undefined, true>;
|
|
184
|
+
};
|
|
185
|
+
declare const pool: {
|
|
186
|
+
/** Programs may write only in trusted pools. Default read-only. */
|
|
187
|
+
trust: import("./config-schema.js").Field<"trusted" | "read-only", "trusted" | "read-only", true>;
|
|
188
|
+
/** Connector ids and exact `connector.tool` addresses in this pool. */
|
|
189
|
+
tools: import("./config-schema.js").Field<readonly string[], readonly string[], false>;
|
|
190
|
+
/**
|
|
191
|
+
* Whether this admitted identity may open the pool. Denied by default:
|
|
192
|
+
* a pool with no grant serves nobody. A false return, a throw, and an
|
|
193
|
+
* undeclared pool name are the same 404.
|
|
194
|
+
*/
|
|
195
|
+
grant: import("./config-schema.js").Field<(identity: Readonly<AuthenticatedIdentity>) => boolean | Promise<boolean>, ((identity: Readonly<AuthenticatedIdentity>) => boolean | Promise<boolean>) | undefined, true>;
|
|
196
|
+
};
|
|
197
|
+
declare const connectaConfig: {
|
|
198
|
+
connectors: import("./config-schema.js").Field<Connector[], readonly Connector[], false>;
|
|
199
|
+
/** Inbound auth adapters, such as clerkAuth(...); omit for open (dev). */
|
|
200
|
+
auth: import("./config-schema.js").Field<InboundAuth | InboundAuth[], readonly InboundAuth[], true>;
|
|
201
|
+
/** Code-derived connection visibility and independent management permissions. */
|
|
202
|
+
identity: import("./config-schema.js").Field<{
|
|
203
|
+
connectorAccess?: ((identity: Readonly<AuthenticatedIdentity>) => "all" | readonly ConnectorGrant[] | Promise<"all" | readonly ConnectorGrant[]>) | undefined;
|
|
204
|
+
activityAccess?: ((principal: Readonly<IdentityReference>) => boolean | Promise<boolean>) | undefined;
|
|
205
|
+
credentialAdministration?: ((identity: Readonly<AuthenticatedIdentity>) => ConnectorPermission | Promise<ConnectorPermission>) | undefined;
|
|
206
|
+
accessTokenManagement?: ((identity: Readonly<AuthenticatedIdentity>) => boolean | Promise<boolean>) | undefined;
|
|
207
|
+
personalConnection?: ((identity: Readonly<AuthenticatedIdentity>) => ConnectorPermission | Promise<ConnectorPermission>) | undefined;
|
|
208
|
+
}, {
|
|
209
|
+
readonly connectorAccess: ((identity: Readonly<AuthenticatedIdentity>) => "all" | readonly ConnectorGrant[] | Promise<"all" | readonly ConnectorGrant[]>) | undefined;
|
|
210
|
+
readonly activityAccess: ((principal: Readonly<IdentityReference>) => boolean | Promise<boolean>) | undefined;
|
|
211
|
+
readonly credentialAdministration: ((identity: Readonly<AuthenticatedIdentity>) => ConnectorPermission | Promise<ConnectorPermission>) | undefined;
|
|
212
|
+
readonly accessTokenManagement: ((identity: Readonly<AuthenticatedIdentity>) => boolean | Promise<boolean>) | undefined;
|
|
213
|
+
readonly personalConnection: ((identity: Readonly<AuthenticatedIdentity>) => ConnectorPermission | Promise<ConnectorPermission>) | undefined;
|
|
214
|
+
}, true> & {
|
|
215
|
+
readonly shape: {
|
|
216
|
+
/**
|
|
217
|
+
* What this admitted identity may discover and call: `"all"`, or a list
|
|
218
|
+
* whose entries are connector ids (the whole connector) and `connector.tool`
|
|
219
|
+
* addresses (that tool only), or `{ tool: "connector.tool",
|
|
220
|
+
* requireReadOnly: true }` for an exact tool only while its loaded catalog
|
|
221
|
+
* explicitly classifies it read-only. Grants are additive: an unrestricted
|
|
222
|
+
* connector or address grant wins over the guarded form. An address naming
|
|
223
|
+
* a tool the catalog lacks is unreachable and warned once, never widened.
|
|
224
|
+
*/
|
|
225
|
+
connectorAccess: import("./config-schema.js").Field<(identity: Readonly<AuthenticatedIdentity>) => "all" | readonly ConnectorGrant[] | Promise<"all" | readonly ConnectorGrant[]>, ((identity: Readonly<AuthenticatedIdentity>) => "all" | readonly ConnectorGrant[] | Promise<"all" | readonly ConnectorGrant[]>) | undefined, true>;
|
|
226
|
+
/** Global payload-free activity reads. Defaults to interactive humans. */
|
|
227
|
+
activityAccess: import("./config-schema.js").Field<(principal: Readonly<IdentityReference>) => boolean | Promise<boolean>, ((principal: Readonly<IdentityReference>) => boolean | Promise<boolean>) | undefined, true>;
|
|
228
|
+
/** Shared credential and OAuth administration. Defaults to none. */
|
|
229
|
+
credentialAdministration: import("./config-schema.js").Field<(identity: Readonly<AuthenticatedIdentity>) => ConnectorPermission | Promise<ConnectorPermission>, ((identity: Readonly<AuthenticatedIdentity>) => ConnectorPermission | Promise<ConnectorPermission>) | undefined, true>;
|
|
230
|
+
/** Client-token lifecycle management by interactive humans. Defaults to false. */
|
|
231
|
+
accessTokenManagement: import("./config-schema.js").Field<(identity: Readonly<AuthenticatedIdentity>) => boolean | Promise<boolean>, ((identity: Readonly<AuthenticatedIdentity>) => boolean | Promise<boolean>) | undefined, true>;
|
|
232
|
+
/** Connecting or changing the caller's personal account. Defaults to none. */
|
|
233
|
+
personalConnection: import("./config-schema.js").Field<(identity: Readonly<AuthenticatedIdentity>) => ConnectorPermission | Promise<ConnectorPermission>, ((identity: Readonly<AuthenticatedIdentity>) => ConnectorPermission | Promise<ConnectorPermission>) | undefined, true>;
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
/** Named tool pools, each served at `/mcp/<name>` to identities its grant admits. */
|
|
237
|
+
pools: import("./config-schema.js").Field<Record<string, {
|
|
238
|
+
trust?: "trusted" | "read-only" | undefined;
|
|
239
|
+
grant?: ((identity: Readonly<AuthenticatedIdentity>) => boolean | Promise<boolean>) | undefined;
|
|
240
|
+
tools: readonly string[];
|
|
241
|
+
}>, Readonly<Record<string, {
|
|
242
|
+
readonly trust: "trusted" | "read-only";
|
|
243
|
+
readonly tools: readonly string[];
|
|
244
|
+
readonly grant: ((identity: Readonly<AuthenticatedIdentity>) => boolean | Promise<boolean>) | undefined;
|
|
245
|
+
}>> | undefined, true>;
|
|
246
|
+
/** Trust of the default /mcp endpoint. Default read-only. */
|
|
247
|
+
trust: import("./config-schema.js").Field<"trusted" | "read-only", "trusted" | "read-only", true>;
|
|
248
|
+
/** Exact connector id -> tool name -> verdict. Unknown names fail at catalog publication. */
|
|
249
|
+
classification: import("./config-schema.js").Field<Record<string, Record<string, "read" | "write">>, Readonly<Record<string, Readonly<Record<string, "read" | "write">>>> | undefined, true>;
|
|
250
|
+
/**
|
|
251
|
+
* The deployment's one store: `d1Storage(env.CONNECTA_DB)` from
|
|
252
|
+
* `@zackbart/connecta/d1` on Workers, `sqliteStorage(path)` from
|
|
253
|
+
* `@zackbart/connecta/sqlite` on Node. Defaults to memoryStorage(), which
|
|
254
|
+
* forgets everything on restart.
|
|
255
|
+
*/
|
|
256
|
+
storage: import("./config-schema.js").Field<KVStorage, KVStorage, true>;
|
|
257
|
+
/**
|
|
258
|
+
* Public base URL. Defaults to the request origin per-request. Configuring an
|
|
259
|
+
* HTTPS URL also redirects matching inbound HTTP requests to HTTPS.
|
|
260
|
+
*/
|
|
261
|
+
publicUrl: import("./config-schema.js").Field<string, string | undefined, true>;
|
|
262
|
+
/**
|
|
263
|
+
* Exact browser MCP origins, or "*". Defaults to publicUrl's origin and
|
|
264
|
+
* HTTP(S) loopback origins at any port. Originless clients are admitted.
|
|
265
|
+
*/
|
|
266
|
+
allowedOrigins: import("./config-schema.js").Field<readonly string[] | "*", readonly string[] | "*" | undefined, true>;
|
|
267
|
+
/** Optional recorder and reader, created by activityHistory() from /activity. */
|
|
268
|
+
activity: import("./config-schema.js").Field<ActivityModule, ActivityModule | undefined, true>;
|
|
269
|
+
/** Replaceable owner-partitioned credential storage. Omit for config-owned secrets. */
|
|
270
|
+
vault: import("./config-schema.js").Field<CredentialVault, CredentialVault | undefined, true>;
|
|
271
|
+
/** Optional connection UI, created by operatorUi() from /ui. */
|
|
272
|
+
ui: import("./config-schema.js").Field<OperatorSurface, OperatorSurface | undefined, true>;
|
|
273
|
+
/** Optional managed client tokens, created by accessTokens() from /auth/access-tokens. */
|
|
274
|
+
accessTokens: import("./config-schema.js").Field<AccessTokensModule, AccessTokensModule | undefined, true>;
|
|
275
|
+
/** Tool-catalog TTL bounds and probe deadlines. */
|
|
276
|
+
discovery: import("./config-schema.js").Field<{
|
|
277
|
+
concurrency?: number | undefined;
|
|
278
|
+
catalogTtlSeconds?: number | undefined;
|
|
279
|
+
catalogMinTtlSeconds?: number | undefined;
|
|
280
|
+
catalogMaxTtlSeconds?: number | undefined;
|
|
281
|
+
probeTimeoutMs?: number | undefined;
|
|
282
|
+
}, {
|
|
283
|
+
readonly concurrency: number;
|
|
284
|
+
readonly catalogTtlSeconds: number;
|
|
285
|
+
readonly catalogMinTtlSeconds: number;
|
|
286
|
+
readonly catalogMaxTtlSeconds: number;
|
|
287
|
+
readonly probeTimeoutMs: number;
|
|
288
|
+
}, true> & {
|
|
289
|
+
readonly shape: {
|
|
290
|
+
/**
|
|
291
|
+
* Maximum connector catalogs/status probes fetched at once by discovery
|
|
292
|
+
* operations. Default 4.
|
|
293
|
+
*/
|
|
294
|
+
concurrency: import("./config-schema.js").Field<number, number, true>;
|
|
295
|
+
/** Fallback tool-list TTL when the downstream omits ttlMs. Default 300 seconds. */
|
|
296
|
+
catalogTtlSeconds: import("./config-schema.js").Field<number, number, true>;
|
|
297
|
+
/** Floor for positive downstream hints. Zero hints always disable reuse. Default 0. */
|
|
298
|
+
catalogMinTtlSeconds: import("./config-schema.js").Field<number, number, true>;
|
|
299
|
+
/** Ceiling for downstream hints and the fallback, capped by the SDK at 24h. Default 86400. */
|
|
300
|
+
catalogMaxTtlSeconds: import("./config-schema.js").Field<number, number, true>;
|
|
301
|
+
/**
|
|
302
|
+
* Deadline (ms) for each downstream probe/catalog call fanned out by
|
|
303
|
+
* `search_tools` and by `connecta.search`/`connecta.describe` inside
|
|
304
|
+
* `execute_code`. Defaults to 30_000. A timed-out connector degrades
|
|
305
|
+
* independently; this does not apply to tool calls. Catalog walks receive the
|
|
306
|
+
* same cancellation signal, which aborts an in-flight page where supported and
|
|
307
|
+
* prevents another from starting.
|
|
308
|
+
*/
|
|
309
|
+
probeTimeoutMs: import("./config-schema.js").Field<number, number, true>;
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
/** Deployment-wide call deadlines and result paging threshold. */
|
|
313
|
+
calls: import("./config-schema.js").Field<{
|
|
314
|
+
defaultTimeoutMs?: number | undefined;
|
|
315
|
+
maxResultBytes?: number | undefined;
|
|
316
|
+
}, {
|
|
317
|
+
readonly defaultTimeoutMs: number | undefined;
|
|
318
|
+
readonly maxResultBytes: number;
|
|
319
|
+
}, true> & {
|
|
320
|
+
readonly shape: {
|
|
321
|
+
/**
|
|
322
|
+
* Deadline (ms) for `call_tool`/`call_destructive_tool` calls that pass no
|
|
323
|
+
* `timeoutMs`. An explicit per-call value wins. Opt-in: unset by default, so
|
|
324
|
+
* existing long-running calls gain no surprise deadline.
|
|
325
|
+
*
|
|
326
|
+
* Each call makes one attempt. `execute_code` host calls are
|
|
327
|
+
* unaffected because they already carry their own bound.
|
|
328
|
+
*/
|
|
329
|
+
defaultTimeoutMs: import("./config-schema.js").Field<number, number | undefined, true>;
|
|
330
|
+
/**
|
|
331
|
+
* Max inline result size (bytes) before truncation and `connecta.result` paging.
|
|
332
|
+
* A positive whole number; default 24_000. Connectors may override it
|
|
333
|
+
* individually.
|
|
334
|
+
*/
|
|
335
|
+
maxResultBytes: import("./config-schema.js").Field<number, number, true>;
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
/** Runtime-wide transient result stash limits, shared across subjects. */
|
|
339
|
+
results: import("./config-schema.js").Field<{
|
|
340
|
+
maxStashBytes?: number | undefined;
|
|
341
|
+
maxStashEntries?: number | undefined;
|
|
342
|
+
}, {
|
|
343
|
+
readonly maxStashBytes: number;
|
|
344
|
+
readonly maxStashEntries: number;
|
|
345
|
+
}, true> & {
|
|
346
|
+
readonly shape: {
|
|
347
|
+
/** Stored bytes, including the paging envelope. Default 8 MiB. Zero disables stashing. */
|
|
348
|
+
maxStashBytes: import("./config-schema.js").Field<number, number, true>;
|
|
349
|
+
/** Stored or in-flight entries. Default 64. Zero disables stashing. */
|
|
350
|
+
maxStashEntries: import("./config-schema.js").Field<number, number, true>;
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
/** Budgets for execute_code programs: host calls, writes, and `connecta.emit`. */
|
|
354
|
+
execute: import("./config-schema.js").Field<{
|
|
355
|
+
maxEmittedBytes?: number | undefined;
|
|
356
|
+
maxEmittedBlocks?: number | undefined;
|
|
357
|
+
maxHostCalls?: number | undefined;
|
|
358
|
+
hostCallTimeoutMs?: number | undefined;
|
|
359
|
+
watchdogMs?: number | undefined;
|
|
360
|
+
maxWrites?: number | undefined;
|
|
361
|
+
}, {
|
|
362
|
+
readonly maxEmittedBytes: number;
|
|
363
|
+
readonly maxEmittedBlocks: number;
|
|
364
|
+
readonly maxHostCalls: number;
|
|
365
|
+
readonly hostCallTimeoutMs: number;
|
|
366
|
+
readonly watchdogMs: number;
|
|
367
|
+
readonly maxWrites: number;
|
|
368
|
+
}, true> & {
|
|
369
|
+
readonly shape: {
|
|
370
|
+
/**
|
|
371
|
+
* Aggregate serialized bytes `connecta.emit` accepts per run. Default
|
|
372
|
+
* 4_000_000 — a transport bound, not a context bound: emitted image/audio
|
|
373
|
+
* blocks reach the model as media, not base64 text.
|
|
374
|
+
*/
|
|
375
|
+
maxEmittedBytes: import("./config-schema.js").Field<number, number, true>;
|
|
376
|
+
/** Content blocks `connecta.emit` accepts per run. Default 32. */
|
|
377
|
+
maxEmittedBlocks: import("./config-schema.js").Field<number, number, true>;
|
|
378
|
+
/** Host calls one program may make. Default 20. */
|
|
379
|
+
maxHostCalls: import("./config-schema.js").Field<number, number, true>;
|
|
380
|
+
/**
|
|
381
|
+
* Deadline for each host call a program makes, in milliseconds. Default
|
|
382
|
+
* 15_000. Raise it for providers whose legitimate calls run longer, such as
|
|
383
|
+
* analytics queries; `call_tool`'s own `timeoutMs` is unaffected.
|
|
384
|
+
*/
|
|
385
|
+
hostCallTimeoutMs: import("./config-schema.js").Field<number, number, true>;
|
|
386
|
+
/**
|
|
387
|
+
* Hard ceiling on one execution, in milliseconds, enforced outside the
|
|
388
|
+
* sandbox. Default 120_000, above both executors' own deadlines (QuickJS
|
|
389
|
+
* 30_000, the Dynamic Worker 60_000), so it only ends a run whose executor
|
|
390
|
+
* never settled; that run fails as unresponsive and its admission slot is
|
|
391
|
+
* released. Keep it above any raised executor deadline.
|
|
392
|
+
*/
|
|
393
|
+
watchdogMs: import("./config-schema.js").Field<number, number, true>;
|
|
394
|
+
/**
|
|
395
|
+
* Trusted-pool writes one program may send, on top of the host-call
|
|
396
|
+
* budget every call already spends. Default 10.
|
|
397
|
+
*/
|
|
398
|
+
maxWrites: import("./config-schema.js").Field<number, number, true>;
|
|
399
|
+
};
|
|
400
|
+
};
|
|
401
|
+
/**
|
|
402
|
+
* Runtime-portable server-memory boundaries. `/health` and operator routes
|
|
403
|
+
* do not consume these permits, so they remain responsive during MCP
|
|
404
|
+
* saturation.
|
|
405
|
+
*/
|
|
406
|
+
admission: import("./config-schema.js").Field<{
|
|
407
|
+
requests?: {
|
|
408
|
+
maxDurationMs?: number | undefined;
|
|
409
|
+
concurrency?: number | undefined;
|
|
410
|
+
maxQueueSize?: number | undefined;
|
|
411
|
+
queueTimeoutMs?: number | undefined;
|
|
412
|
+
retryAfterMs?: number | undefined;
|
|
413
|
+
} | undefined;
|
|
414
|
+
code?: {
|
|
415
|
+
concurrency?: number | undefined;
|
|
416
|
+
maxQueueSize?: number | undefined;
|
|
417
|
+
queueTimeoutMs?: number | undefined;
|
|
418
|
+
retryAfterMs?: number | undefined;
|
|
419
|
+
} | undefined;
|
|
420
|
+
}, {
|
|
421
|
+
readonly requests: {
|
|
422
|
+
readonly maxDurationMs: number;
|
|
423
|
+
readonly concurrency: number;
|
|
424
|
+
readonly maxQueueSize: number;
|
|
425
|
+
readonly queueTimeoutMs: number;
|
|
426
|
+
readonly retryAfterMs: number;
|
|
427
|
+
};
|
|
428
|
+
readonly code: {
|
|
429
|
+
readonly concurrency: number;
|
|
430
|
+
readonly maxQueueSize: number;
|
|
431
|
+
readonly queueTimeoutMs: number;
|
|
432
|
+
readonly retryAfterMs: number;
|
|
433
|
+
};
|
|
434
|
+
}, true> & {
|
|
435
|
+
readonly shape: {
|
|
436
|
+
/**
|
|
437
|
+
* The `/mcp` request boundary. Defaults to 16 active, 32 queued, and a
|
|
438
|
+
* 5-second maximum wait.
|
|
439
|
+
*/
|
|
440
|
+
requests: import("./config-schema.js").Field<{
|
|
441
|
+
maxDurationMs?: number | undefined;
|
|
442
|
+
concurrency?: number | undefined;
|
|
443
|
+
maxQueueSize?: number | undefined;
|
|
444
|
+
queueTimeoutMs?: number | undefined;
|
|
445
|
+
retryAfterMs?: number | undefined;
|
|
446
|
+
}, {
|
|
447
|
+
readonly maxDurationMs: number;
|
|
448
|
+
readonly concurrency: number;
|
|
449
|
+
readonly maxQueueSize: number;
|
|
450
|
+
readonly queueTimeoutMs: number;
|
|
451
|
+
readonly retryAfterMs: number;
|
|
452
|
+
}, true> & {
|
|
453
|
+
readonly shape: {
|
|
454
|
+
/** Hard lifetime of an admitted /mcp request. Default 300,000 ms. */
|
|
455
|
+
maxDurationMs: import("./config-schema.js").Field<number, number, true>;
|
|
456
|
+
/** Simultaneous work admitted to this pool. */
|
|
457
|
+
concurrency: import("./config-schema.js").Field<number, number, true>;
|
|
458
|
+
/** Callers allowed to wait behind active work. Set zero to fail fast. */
|
|
459
|
+
maxQueueSize: import("./config-schema.js").Field<number, number, true>;
|
|
460
|
+
/** Maximum queue wait in milliseconds. */
|
|
461
|
+
queueTimeoutMs: import("./config-schema.js").Field<number, number, true>;
|
|
462
|
+
/** Retry hint returned with overload failures, in milliseconds. */
|
|
463
|
+
retryAfterMs: import("./config-schema.js").Field<number, number, true>;
|
|
464
|
+
};
|
|
465
|
+
};
|
|
466
|
+
/**
|
|
467
|
+
* Fallback pool for an `executor` that does not implement its own `acquire`.
|
|
468
|
+
* Defaults to 2 active, 8 queued, and a 5-second maximum wait. Bounded
|
|
469
|
+
* executors (including `quickJsExecutor`) keep their own tighter pool.
|
|
470
|
+
*/
|
|
471
|
+
code: import("./config-schema.js").Field<{
|
|
472
|
+
concurrency?: number | undefined;
|
|
473
|
+
maxQueueSize?: number | undefined;
|
|
474
|
+
queueTimeoutMs?: number | undefined;
|
|
475
|
+
retryAfterMs?: number | undefined;
|
|
476
|
+
}, {
|
|
477
|
+
readonly concurrency: number;
|
|
478
|
+
readonly maxQueueSize: number;
|
|
479
|
+
readonly queueTimeoutMs: number;
|
|
480
|
+
readonly retryAfterMs: number;
|
|
481
|
+
}, true> & {
|
|
482
|
+
readonly shape: {
|
|
483
|
+
/** Simultaneous work admitted to this pool. */
|
|
484
|
+
concurrency: import("./config-schema.js").Field<number, number, true>;
|
|
485
|
+
/** Callers allowed to wait behind active work. Set zero to fail fast. */
|
|
486
|
+
maxQueueSize: import("./config-schema.js").Field<number, number, true>;
|
|
487
|
+
/** Maximum queue wait in milliseconds. */
|
|
488
|
+
queueTimeoutMs: import("./config-schema.js").Field<number, number, true>;
|
|
489
|
+
/** Retry hint returned with overload failures, in milliseconds. */
|
|
490
|
+
retryAfterMs: import("./config-schema.js").Field<number, number, true>;
|
|
491
|
+
};
|
|
492
|
+
};
|
|
493
|
+
};
|
|
494
|
+
};
|
|
495
|
+
/** Diagnostic output. Use "silent" to disable all diagnostic logging. */
|
|
496
|
+
logger: import("./config-schema.js").Field<Logger | "silent", Logger, true>;
|
|
497
|
+
serverInfo: import("./config-schema.js").Field<{
|
|
498
|
+
name?: string | undefined;
|
|
499
|
+
version?: string | undefined;
|
|
500
|
+
title?: string | undefined;
|
|
501
|
+
websiteUrl?: string | undefined;
|
|
502
|
+
icons?: {
|
|
503
|
+
mimeType?: string | undefined;
|
|
504
|
+
sizes?: string[] | undefined;
|
|
505
|
+
src: string;
|
|
506
|
+
}[] | undefined;
|
|
507
|
+
}, {
|
|
508
|
+
readonly name: string | undefined;
|
|
509
|
+
readonly version: string | undefined;
|
|
510
|
+
readonly title: string | undefined;
|
|
511
|
+
readonly websiteUrl: string | undefined;
|
|
512
|
+
readonly icons: readonly {
|
|
513
|
+
readonly src: string;
|
|
514
|
+
readonly mimeType: string | undefined;
|
|
515
|
+
readonly sizes: readonly string[] | undefined;
|
|
516
|
+
}[] | undefined;
|
|
517
|
+
}, true> & {
|
|
518
|
+
readonly shape: {
|
|
519
|
+
name: import("./config-schema.js").Field<string, string | undefined, true>;
|
|
520
|
+
version: import("./config-schema.js").Field<string, string | undefined, true>;
|
|
521
|
+
/** Human-readable name clients may show instead of `name`. */
|
|
522
|
+
title: import("./config-schema.js").Field<string, string | undefined, true>;
|
|
523
|
+
/** Homepage clients may link from the server listing: an absolute http(s) URL. */
|
|
524
|
+
websiteUrl: import("./config-schema.js").Field<string, string | undefined, true>;
|
|
525
|
+
/** MCP icons-spec entries; clients render these instead of a scraped favicon. */
|
|
526
|
+
icons: import("./config-schema.js").Field<{
|
|
527
|
+
mimeType?: string | undefined;
|
|
528
|
+
sizes?: string[] | undefined;
|
|
529
|
+
src: string;
|
|
530
|
+
}[], readonly {
|
|
531
|
+
readonly src: string;
|
|
532
|
+
readonly mimeType: string | undefined;
|
|
533
|
+
readonly sizes: readonly string[] | undefined;
|
|
534
|
+
}[] | undefined, true>;
|
|
535
|
+
};
|
|
536
|
+
};
|
|
537
|
+
/** Deployment metadata exposed by /health (for example a Worker version). */
|
|
538
|
+
deploymentInfo: import("./config-schema.js").Field<Record<string, unknown>, Record<string, unknown> | undefined, true>;
|
|
539
|
+
/**
|
|
540
|
+
* Required sandbox for `execute_code`. Workers use
|
|
541
|
+
* `workerExecutor({ loader: env.LOADER })` from
|
|
542
|
+
* `@zackbart/connecta/worker`; Node uses `quickJsExecutor()` from
|
|
543
|
+
* `@zackbart/connecta/quickjs`. Direct upstream DynamicWorkerExecutor
|
|
544
|
+
* construction throws because its request-owned handles cannot be released.
|
|
545
|
+
* Custom sandboxes explicitly opt in with
|
|
546
|
+
* `customExecutor(myExecutor, { lifecycle: "self-managed" })`.
|
|
547
|
+
*/
|
|
548
|
+
executor: import("./config-schema.js").Field<Executor, Executor, false>;
|
|
549
|
+
};
|
|
550
|
+
/** A deployment's whole configuration, passed to `createConnecta`. */
|
|
551
|
+
export type ConnectaConfig = ConfigInput<typeof connectaConfig>;
|
|
552
|
+
/** Tool-catalog TTL bounds and probe deadlines. */
|
|
553
|
+
export type ConnectaDiscoveryConfig = ConfigInput<typeof discovery>;
|
|
554
|
+
/** Deployment-wide call deadlines and inline-result paging thresholds. */
|
|
555
|
+
export type ConnectaCallsConfig = ConfigInput<typeof calls>;
|
|
556
|
+
/** Runtime-wide bounds for transient direct-call result paging. */
|
|
557
|
+
export type ConnectaResultsConfig = ConfigInput<typeof results>;
|
|
558
|
+
/** Budgets for execute_code programs: host calls and rich output (`connecta.emit`). */
|
|
559
|
+
export type ConnectaExecuteConfig = ConfigInput<typeof execute>;
|
|
560
|
+
export type AdmissionPoolConfig = ConfigInput<typeof codeAdmission>;
|
|
561
|
+
export type RequestAdmissionConfig = ConfigInput<typeof requestAdmission>;
|
|
562
|
+
/** Runtime-portable server-memory boundaries for `/mcp` and fallback code-mode work. */
|
|
563
|
+
export type ConnectaAdmissionConfig = ConfigInput<typeof admission>;
|
|
564
|
+
export type ConnectaIdentityConfig = ConfigInput<typeof identity>;
|
|
565
|
+
/**
|
|
566
|
+
* A named tool pool served at `/mcp/<name>`. The pool is the slice a client
|
|
567
|
+
* pointed at that endpoint may see; the identity's own `connectorAccess`
|
|
568
|
+
* remains its ceiling and the pool can only narrow it.
|
|
569
|
+
*/
|
|
570
|
+
export type ConnectaPoolConfig = ConfigInput<typeof pool>;
|
|
571
|
+
type Parsed = ConfigOutput<typeof connectaConfig>;
|
|
572
|
+
/**
|
|
573
|
+
* The configuration a Connecta runs with: validated, every default applied,
|
|
574
|
+
* auth ordered, and `serverInfo` named and versioned. Built once by createConnecta; nothing downstream re-derives it.
|
|
575
|
+
*/
|
|
576
|
+
export interface ResolvedConfig extends Omit<Parsed, "serverInfo"> {
|
|
577
|
+
/** `serverInfo` with its name and version defaults applied. */
|
|
578
|
+
readonly serverInfo: {
|
|
579
|
+
readonly name: string;
|
|
580
|
+
readonly version: string;
|
|
581
|
+
readonly title?: string;
|
|
582
|
+
readonly websiteUrl?: string;
|
|
583
|
+
readonly icons?: Array<{
|
|
584
|
+
src: string;
|
|
585
|
+
mimeType?: string;
|
|
586
|
+
sizes?: string[];
|
|
587
|
+
}>;
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Validate a configuration and apply every default. Unknown keys are refused
|
|
592
|
+
* first, before any value is read, so a typo beside a getter or a secret
|
|
593
|
+
* neither runs it nor echoes it; then each present value is checked in
|
|
594
|
+
* schema order and the first mistake throws with its path.
|
|
595
|
+
*/
|
|
596
|
+
export declare function resolveConfig(config: ConnectaConfig): ResolvedConfig;
|
|
597
|
+
/**
|
|
598
|
+
* {@link resolveConfig}, also returning the plain copy it resolved: the
|
|
599
|
+
* configuration as read through property descriptors, which is what any later
|
|
600
|
+
* question about what the deployment set explicitly must read, never the
|
|
601
|
+
* caller's object, whose getters or Proxy traps must not run.
|
|
602
|
+
*/
|
|
603
|
+
export declare function readConfig(config: ConnectaConfig): {
|
|
604
|
+
input: ConnectaConfig;
|
|
605
|
+
resolved: ResolvedConfig;
|
|
606
|
+
};
|
|
607
|
+
/**
|
|
608
|
+
* Declare a deployment's configuration as a function of its environment:
|
|
609
|
+
* `process.env` on Node, the Worker's `env` bindings on Workers. Optional
|
|
610
|
+
* modules are ordinary type-checked expressions —
|
|
611
|
+
* `vault: env.KEY ? encryptedCredentialVault(storage, env.KEY) : undefined` —
|
|
612
|
+
* rather than commented blocks, and the entry file stays a few lines: it
|
|
613
|
+
* imports the default export of its `connecta.config.ts` and calls
|
|
614
|
+
* `createConnecta(config(process.env))`.
|
|
615
|
+
*
|
|
616
|
+
* The factory runs when the entry calls it, never at import, so a Worker can
|
|
617
|
+
* import it at global scope. Validation still happens in createConnecta.
|
|
618
|
+
*/
|
|
619
|
+
export declare function defineConfig<Env>(factory: (env: Env) => ConnectaConfig): (env: Env) => ConnectaConfig;
|
|
620
|
+
/** The execute_code budgets a runner enforces, read from one resolved config. */
|
|
621
|
+
export declare function executeLimits(config: ResolvedConfig): {
|
|
622
|
+
discoveryConcurrency: number;
|
|
623
|
+
probeTimeoutMs: number;
|
|
624
|
+
maxEmittedBytes: number;
|
|
625
|
+
maxEmittedBlocks: number;
|
|
626
|
+
maxHostCalls: number;
|
|
627
|
+
hostCallTimeoutMs: number;
|
|
628
|
+
watchdogMs: number;
|
|
629
|
+
maxWrites: number;
|
|
630
|
+
};
|
|
631
|
+
export {};
|