managed-deepagents 0.5.0-dev.78 → 0.5.0-dev.80
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/README.md +50 -8
- package/dist/channels/assistant-text.js +1 -1
- package/dist/channels/assistant-text.js.map +1 -1
- package/dist/channels/binding.d.ts.map +1 -1
- package/dist/channels/binding.js +3 -1
- package/dist/channels/binding.js.map +1 -1
- package/dist/channels/index.d.ts +6 -8
- package/dist/channels/index.d.ts.map +1 -1
- package/dist/channels/index.js +5 -5
- package/dist/channels/index.js.map +1 -1
- package/dist/channels/manifest.d.ts +36 -3
- package/dist/channels/manifest.d.ts.map +1 -1
- package/dist/channels/messaging-registry.d.ts +17 -0
- package/dist/channels/messaging-registry.d.ts.map +1 -0
- package/dist/channels/messaging-registry.js +44 -0
- package/dist/channels/messaging-registry.js.map +1 -0
- package/dist/channels/registry.d.ts +4 -3
- package/dist/channels/registry.d.ts.map +1 -1
- package/dist/channels/registry.js +6 -5
- package/dist/channels/registry.js.map +1 -1
- package/dist/channels/schedule-delivery.d.ts +4 -1
- package/dist/channels/schedule-delivery.d.ts.map +1 -1
- package/dist/channels/schedule-delivery.js +4 -2
- package/dist/channels/schedule-delivery.js.map +1 -1
- package/dist/connectors/github/adapter-core.d.ts +15 -0
- package/dist/connectors/github/adapter-core.d.ts.map +1 -0
- package/dist/connectors/github/adapter-core.js +52 -0
- package/dist/connectors/github/adapter-core.js.map +1 -0
- package/dist/{channels → connectors}/github/define.d.ts +28 -58
- package/dist/connectors/github/define.d.ts.map +1 -0
- package/dist/connectors/github/define.js +72 -0
- package/dist/connectors/github/define.js.map +1 -0
- package/dist/{channels → connectors}/github/http.d.ts +4 -4
- package/dist/connectors/github/http.d.ts.map +1 -0
- package/dist/{channels → connectors}/github/http.js +13 -24
- package/dist/connectors/github/http.js.map +1 -0
- package/dist/connectors/github/index.d.ts +59 -16
- package/dist/connectors/github/index.d.ts.map +1 -1
- package/dist/connectors/github/index.js +159 -73
- package/dist/connectors/github/index.js.map +1 -1
- package/dist/connectors/github/match.d.ts +20 -0
- package/dist/connectors/github/match.d.ts.map +1 -0
- package/dist/connectors/github/match.js +41 -0
- package/dist/connectors/github/match.js.map +1 -0
- package/dist/{channels → connectors}/github/normalize.d.ts +1 -1
- package/dist/connectors/github/normalize.d.ts.map +1 -0
- package/dist/{channels → connectors}/github/normalize.js +2 -2
- package/dist/connectors/github/normalize.js.map +1 -0
- package/dist/connectors/github/sandbox.d.ts.map +1 -1
- package/dist/connectors/github/sandbox.js +30 -23
- package/dist/connectors/github/sandbox.js.map +1 -1
- package/dist/connectors/github/source-thread.d.ts.map +1 -0
- package/dist/connectors/github/source-thread.js.map +1 -0
- package/dist/{channels → connectors}/github/transport.d.ts +7 -1
- package/dist/connectors/github/transport.d.ts.map +1 -0
- package/dist/{channels → connectors}/github/transport.js +18 -4
- package/dist/connectors/github/transport.js.map +1 -0
- package/dist/connectors/langsmith/index.d.ts +29 -17
- package/dist/connectors/langsmith/index.d.ts.map +1 -1
- package/dist/connectors/langsmith/index.js +34 -29
- package/dist/connectors/langsmith/index.js.map +1 -1
- package/dist/connectors/langsmith/routes.d.ts +4 -15
- package/dist/connectors/langsmith/routes.d.ts.map +1 -1
- package/dist/connectors/langsmith/routes.js +63 -72
- package/dist/connectors/langsmith/routes.js.map +1 -1
- package/dist/connectors/mcp/index.d.ts +13 -20
- package/dist/connectors/mcp/index.d.ts.map +1 -1
- package/dist/connectors/mcp/index.js +92 -112
- package/dist/connectors/mcp/index.js.map +1 -1
- package/dist/connectors/mcp/load.d.ts.map +1 -1
- package/dist/connectors/mcp/load.js +16 -40
- package/dist/connectors/mcp/load.js.map +1 -1
- package/dist/{channels → connectors}/slack/adapter-core.d.ts +1 -1
- package/dist/connectors/slack/adapter-core.d.ts.map +1 -0
- package/dist/connectors/slack/adapter-core.js.map +1 -0
- package/dist/{channels → connectors}/slack/adapter.d.ts +3 -4
- package/dist/connectors/slack/adapter.d.ts.map +1 -0
- package/dist/{channels → connectors}/slack/adapter.js +1 -1
- package/dist/connectors/slack/adapter.js.map +1 -0
- package/dist/{channels → connectors}/slack/http.d.ts +6 -40
- package/dist/connectors/slack/http.d.ts.map +1 -0
- package/dist/{channels → connectors}/slack/http.js +22 -125
- package/dist/connectors/slack/http.js.map +1 -0
- package/dist/connectors/slack/index.d.ts +108 -0
- package/dist/connectors/slack/index.d.ts.map +1 -0
- package/dist/connectors/slack/index.js +191 -0
- package/dist/connectors/slack/index.js.map +1 -0
- package/dist/{channels → connectors}/slack/normalize.d.ts +5 -5
- package/dist/connectors/slack/normalize.d.ts.map +1 -0
- package/dist/{channels → connectors}/slack/normalize.js +21 -20
- package/dist/connectors/slack/normalize.js.map +1 -0
- package/dist/connectors/slack/source-thread.d.ts.map +1 -0
- package/dist/connectors/slack/source-thread.js.map +1 -0
- package/dist/{channels → connectors}/slack/transport.d.ts +1 -1
- package/dist/connectors/slack/transport.d.ts.map +1 -0
- package/dist/{channels → connectors}/slack/transport.js +4 -3
- package/dist/connectors/slack/transport.js.map +1 -0
- package/dist/connectors/tool-selection.d.ts +31 -0
- package/dist/connectors/tool-selection.d.ts.map +1 -0
- package/dist/connectors/tool-selection.js +54 -0
- package/dist/connectors/tool-selection.js.map +1 -0
- package/dist/connectors/toolserver/catalog.d.ts +134 -0
- package/dist/connectors/toolserver/catalog.d.ts.map +1 -0
- package/dist/connectors/toolserver/catalog.js +74 -0
- package/dist/connectors/toolserver/catalog.js.map +1 -0
- package/dist/connectors/toolserver/index.d.ts +119 -0
- package/dist/connectors/toolserver/index.d.ts.map +1 -0
- package/dist/connectors/toolserver/index.js +150 -0
- package/dist/connectors/toolserver/index.js.map +1 -0
- package/dist/connectors/toolserver/load.d.ts +55 -0
- package/dist/connectors/toolserver/load.d.ts.map +1 -0
- package/dist/connectors/toolserver/load.js +162 -0
- package/dist/connectors/toolserver/load.js.map +1 -0
- package/dist/extension.d.ts +77 -0
- package/dist/extension.d.ts.map +1 -0
- package/dist/extension.js +127 -0
- package/dist/extension.js.map +1 -0
- package/dist/identity/claims.d.ts +18 -0
- package/dist/identity/claims.d.ts.map +1 -0
- package/dist/identity/claims.js +37 -0
- package/dist/identity/claims.js.map +1 -0
- package/dist/identity/connect-inference.d.ts +28 -0
- package/dist/identity/connect-inference.d.ts.map +1 -0
- package/dist/identity/connect-inference.js +39 -0
- package/dist/identity/connect-inference.js.map +1 -0
- package/dist/identity/connect-provider-types.d.ts +23 -6
- package/dist/identity/connect-provider-types.d.ts.map +1 -1
- package/dist/identity/connect-provider-types.js +3 -1
- package/dist/identity/connect-provider-types.js.map +1 -1
- package/dist/identity/connect-provider.d.ts +9 -4
- package/dist/identity/connect-provider.d.ts.map +1 -1
- package/dist/identity/connect-provider.js +19 -9
- package/dist/identity/connect-provider.js.map +1 -1
- package/dist/identity/credential-resolvers.d.ts +33 -0
- package/dist/identity/credential-resolvers.d.ts.map +1 -0
- package/dist/identity/credential-resolvers.js +62 -0
- package/dist/identity/credential-resolvers.js.map +1 -0
- package/dist/identity/github/connect-http.d.ts +3 -3
- package/dist/identity/github/connect-http.d.ts.map +1 -1
- package/dist/identity/github/connect-http.js +21 -13
- package/dist/identity/github/connect-http.js.map +1 -1
- package/dist/identity/github/credentials-store.d.ts +10 -10
- package/dist/identity/github/credentials-store.d.ts.map +1 -1
- package/dist/identity/github/credentials-store.js +40 -43
- package/dist/identity/github/credentials-store.js.map +1 -1
- package/dist/identity/github/credentials.d.ts +16 -13
- package/dist/identity/github/credentials.d.ts.map +1 -1
- package/dist/identity/github/credentials.js +43 -23
- package/dist/identity/github/credentials.js.map +1 -1
- package/dist/identity/github/index.d.ts +2 -3
- package/dist/identity/github/index.d.ts.map +1 -1
- package/dist/identity/github/index.js +1 -2
- package/dist/identity/github/index.js.map +1 -1
- package/dist/identity/github/oauth.d.ts +3 -3
- package/dist/identity/github/oauth.d.ts.map +1 -1
- package/dist/identity/github/oauth.js +10 -9
- package/dist/identity/github/oauth.js.map +1 -1
- package/dist/identity/index.d.ts +35 -29
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +98 -131
- package/dist/identity/index.js.map +1 -1
- package/dist/identity/loopback.d.ts +27 -2
- package/dist/identity/loopback.d.ts.map +1 -1
- package/dist/identity/loopback.js +61 -8
- package/dist/identity/loopback.js.map +1 -1
- package/dist/identity/options.d.ts +90 -0
- package/dist/identity/options.d.ts.map +1 -0
- package/dist/identity/options.js +171 -0
- package/dist/identity/options.js.map +1 -0
- package/dist/identity/slack/connect-http.d.ts +3 -3
- package/dist/identity/slack/connect-http.d.ts.map +1 -1
- package/dist/identity/slack/connect-http.js +22 -14
- package/dist/identity/slack/connect-http.js.map +1 -1
- package/dist/identity/slack/index.d.ts +1 -2
- package/dist/identity/slack/index.d.ts.map +1 -1
- package/dist/identity/slack/index.js +1 -2
- package/dist/identity/slack/index.js.map +1 -1
- package/dist/identity/slack/links.d.ts +15 -15
- package/dist/identity/slack/links.d.ts.map +1 -1
- package/dist/identity/slack/links.js +50 -53
- package/dist/identity/slack/links.js.map +1 -1
- package/dist/identity/slack/oauth.d.ts +2 -2
- package/dist/identity/slack/oauth.d.ts.map +1 -1
- package/dist/identity/slack/oauth.js +9 -24
- package/dist/identity/slack/oauth.js.map +1 -1
- package/dist/identity/supabase.js +9 -9
- package/dist/identity/supabase.js.map +1 -1
- package/dist/identity/types.d.ts +82 -36
- package/dist/identity/types.d.ts.map +1 -1
- package/dist/index.d.ts +11 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -12
- package/dist/index.js.map +1 -1
- package/dist/ingress/index.d.ts +54 -0
- package/dist/ingress/index.d.ts.map +1 -0
- package/dist/ingress/index.js +128 -0
- package/dist/ingress/index.js.map +1 -0
- package/dist/namespaces.d.ts +76 -0
- package/dist/namespaces.d.ts.map +1 -0
- package/dist/namespaces.js +94 -0
- package/dist/namespaces.js.map +1 -0
- package/dist/runtime/auth.d.ts +18 -14
- package/dist/runtime/auth.d.ts.map +1 -1
- package/dist/runtime/auth.js +88 -68
- package/dist/runtime/auth.js.map +1 -1
- package/dist/runtime/backend.d.ts +1 -1
- package/dist/runtime/backend.d.ts.map +1 -1
- package/dist/runtime/connector.d.ts +66 -23
- package/dist/runtime/connector.d.ts.map +1 -1
- package/dist/runtime/connector.js +63 -27
- package/dist/runtime/connector.js.map +1 -1
- package/dist/runtime/cors.d.ts +2 -3
- package/dist/runtime/cors.d.ts.map +1 -1
- package/dist/runtime/cors.js +2 -7
- package/dist/runtime/cors.js.map +1 -1
- package/dist/runtime/credentials.d.ts.map +1 -1
- package/dist/runtime/credentials.js +39 -14
- package/dist/runtime/credentials.js.map +1 -1
- package/dist/runtime/http.d.ts +47 -0
- package/dist/runtime/http.d.ts.map +1 -0
- package/dist/runtime/http.js +54 -0
- package/dist/runtime/http.js.map +1 -0
- package/dist/runtime/identity-http.d.ts +6 -16
- package/dist/runtime/identity-http.d.ts.map +1 -1
- package/dist/runtime/identity-http.js +71 -54
- package/dist/runtime/identity-http.js.map +1 -1
- package/dist/runtime/identity-runtime.d.ts +18 -17
- package/dist/runtime/identity-runtime.d.ts.map +1 -1
- package/dist/runtime/identity-runtime.js +55 -39
- package/dist/runtime/identity-runtime.js.map +1 -1
- package/dist/runtime/index.d.ts +77 -104
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +36 -35
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/memory/index.d.ts +1 -0
- package/dist/runtime/memory/index.d.ts.map +1 -1
- package/dist/runtime/memory/index.js +1 -0
- package/dist/runtime/memory/index.js.map +1 -1
- package/dist/runtime/memory/lazy-context-backend.d.ts +66 -0
- package/dist/runtime/memory/lazy-context-backend.d.ts.map +1 -0
- package/dist/runtime/memory/lazy-context-backend.js +154 -0
- package/dist/runtime/memory/lazy-context-backend.js.map +1 -0
- package/dist/runtime/memory/user-repo.js +3 -3
- package/dist/runtime/memory/user-repo.js.map +1 -1
- package/dist/runtime/sandbox-manager.d.ts +33 -0
- package/dist/runtime/sandbox-manager.d.ts.map +1 -1
- package/dist/runtime/sandbox-manager.js +173 -9
- package/dist/runtime/sandbox-manager.js.map +1 -1
- package/dist/runtime/sandbox-stream-retry.d.ts +16 -0
- package/dist/runtime/sandbox-stream-retry.d.ts.map +1 -0
- package/dist/runtime/sandbox-stream-retry.js +61 -0
- package/dist/runtime/sandbox-stream-retry.js.map +1 -0
- package/dist/runtime/setup-script.d.ts.map +1 -1
- package/dist/runtime/setup-script.js +4 -2
- package/dist/runtime/setup-script.js.map +1 -1
- package/dist/runtime/validated-token.d.ts +1 -1
- package/dist/runtime/validated-token.d.ts.map +1 -1
- package/dist/runtime/validated-token.js +75 -33
- package/dist/runtime/validated-token.js.map +1 -1
- package/dist/sandbox.d.ts +19 -22
- package/dist/sandbox.d.ts.map +1 -1
- package/dist/sandbox.js +20 -34
- package/dist/sandbox.js.map +1 -1
- package/dist/schedules.js +8 -9
- package/dist/schedules.js.map +1 -1
- package/package.json +18 -28
- package/dist/channels/collect.d.ts +0 -26
- package/dist/channels/collect.d.ts.map +0 -1
- package/dist/channels/collect.js +0 -42
- package/dist/channels/collect.js.map +0 -1
- package/dist/channels/github/adapter-core.d.ts +0 -6
- package/dist/channels/github/adapter-core.d.ts.map +0 -1
- package/dist/channels/github/adapter-core.js +0 -27
- package/dist/channels/github/adapter-core.js.map +0 -1
- package/dist/channels/github/adapter.d.ts +0 -16
- package/dist/channels/github/adapter.d.ts.map +0 -1
- package/dist/channels/github/adapter.js +0 -52
- package/dist/channels/github/adapter.js.map +0 -1
- package/dist/channels/github/define.d.ts.map +0 -1
- package/dist/channels/github/define.js +0 -166
- package/dist/channels/github/define.js.map +0 -1
- package/dist/channels/github/http.d.ts.map +0 -1
- package/dist/channels/github/http.js.map +0 -1
- package/dist/channels/github/index.d.ts +0 -12
- package/dist/channels/github/index.d.ts.map +0 -1
- package/dist/channels/github/index.js +0 -10
- package/dist/channels/github/index.js.map +0 -1
- package/dist/channels/github/normalize.d.ts.map +0 -1
- package/dist/channels/github/normalize.js.map +0 -1
- package/dist/channels/github/source-thread.d.ts.map +0 -1
- package/dist/channels/github/source-thread.js.map +0 -1
- package/dist/channels/github/transport.d.ts.map +0 -1
- package/dist/channels/github/transport.js.map +0 -1
- package/dist/channels/plugin.d.ts +0 -61
- package/dist/channels/plugin.d.ts.map +0 -1
- package/dist/channels/plugin.js +0 -80
- package/dist/channels/plugin.js.map +0 -1
- package/dist/channels/slack/adapter-core.d.ts.map +0 -1
- package/dist/channels/slack/adapter-core.js.map +0 -1
- package/dist/channels/slack/adapter.d.ts.map +0 -1
- package/dist/channels/slack/adapter.js.map +0 -1
- package/dist/channels/slack/define.d.ts +0 -74
- package/dist/channels/slack/define.d.ts.map +0 -1
- package/dist/channels/slack/define.js +0 -160
- package/dist/channels/slack/define.js.map +0 -1
- package/dist/channels/slack/http.d.ts.map +0 -1
- package/dist/channels/slack/http.js.map +0 -1
- package/dist/channels/slack/index.d.ts +0 -18
- package/dist/channels/slack/index.d.ts.map +0 -1
- package/dist/channels/slack/index.js +0 -13
- package/dist/channels/slack/index.js.map +0 -1
- package/dist/channels/slack/normalize.d.ts.map +0 -1
- package/dist/channels/slack/normalize.js.map +0 -1
- package/dist/channels/slack/source-thread.d.ts.map +0 -1
- package/dist/channels/slack/source-thread.js.map +0 -1
- package/dist/channels/slack/transport.d.ts.map +0 -1
- package/dist/channels/slack/transport.js.map +0 -1
- /package/dist/{channels → connectors}/github/source-thread.d.ts +0 -0
- /package/dist/{channels → connectors}/github/source-thread.js +0 -0
- /package/dist/{channels → connectors}/slack/adapter-core.js +0 -0
- /package/dist/{channels → connectors}/slack/source-thread.d.ts +0 -0
- /package/dist/{channels → connectors}/slack/source-thread.js +0 -0
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The managed connector protocol.
|
|
3
3
|
*
|
|
4
|
-
* A connector is
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* Discovery is name-agnostic: the CLI globs modules under `connectors/` that
|
|
10
|
-
* `export default`, imports each default export, and hands them to
|
|
11
|
-
* {@link collectConnectors}, which keeps branded connectors and skips the rest.
|
|
12
|
-
* Entrypoints call the hooks they care about — the agent graph calls
|
|
13
|
-
* {@link Connector.tools}, the managed HTTP app calls {@link Connector.http},
|
|
14
|
-
* and sandbox provisioning calls {@link Connector.sandbox}.
|
|
4
|
+
* A connector is one integration with one external platform. It may contribute
|
|
5
|
+
* tools, HTTP routes, sandbox provisioning, inbound events, and/or a named
|
|
6
|
+
* messaging surface. Discovery is file-based: the CLI globs modules under
|
|
7
|
+
* `connectors/` that export a `connector`, imports each one, and hands them to
|
|
8
|
+
* {@link collectConnectors}, which stamps each with its file-stem `name`.
|
|
15
9
|
*/
|
|
16
10
|
import type { SandboxBackendProtocolV2 } from "deepagents";
|
|
11
|
+
import type { ChannelManifest } from "../channels/manifest.js";
|
|
12
|
+
import type { ChannelTransport } from "../channels/runtime.js";
|
|
17
13
|
import type { IdentityConfig, IdentityDefinition, RuntimeIdentity } from "../identity/index.js";
|
|
18
14
|
import type { ManagedRunConfig } from "./types.js";
|
|
19
15
|
/**
|
|
@@ -56,6 +52,30 @@ export interface HttpContext {
|
|
|
56
52
|
*/
|
|
57
53
|
requireIdentity(request: Request): Promise<RuntimeIdentity>;
|
|
58
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Context handed to {@link Connector.events} for the conventional public
|
|
57
|
+
* inbound route at `/connectors/{name}/events`.
|
|
58
|
+
*/
|
|
59
|
+
export interface EventsContext {
|
|
60
|
+
/** File-stem connector name (route segment). */
|
|
61
|
+
readonly name: string;
|
|
62
|
+
/** The inbound request. */
|
|
63
|
+
readonly request: Request;
|
|
64
|
+
/**
|
|
65
|
+
* Pre-read raw body when the HTTP framework may have consumed `request`
|
|
66
|
+
* (Hono mount passes `await c.req.text()`).
|
|
67
|
+
*/
|
|
68
|
+
readonly rawBody?: string | Uint8Array;
|
|
69
|
+
/** The live connector instance (e.g. GitHub `prompt` callbacks). */
|
|
70
|
+
readonly connector: Connector;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Deploy/runtime requirements a connector declares.
|
|
74
|
+
*
|
|
75
|
+
* Generalizes the former channel manifest: required env, permissions, opaque
|
|
76
|
+
* provider config, and optional provider connection provisioning.
|
|
77
|
+
*/
|
|
78
|
+
export type ConnectorRequirements = ChannelManifest;
|
|
59
79
|
/**
|
|
60
80
|
* Context handed to {@link Connector.sandbox} when a managed sandbox is created
|
|
61
81
|
* or reused for a thread. Connectors close over their own config and use
|
|
@@ -117,19 +137,37 @@ export type PublicRouteHandler = (request: Request) => Response | Promise<Respon
|
|
|
117
137
|
export type ConnectorToolList = unknown[];
|
|
118
138
|
/**
|
|
119
139
|
* A managed connector. Implement at least one of {@link Connector.tools},
|
|
120
|
-
* {@link Connector.http},
|
|
121
|
-
*
|
|
140
|
+
* {@link Connector.http}, {@link Connector.sandbox}, {@link Connector.events},
|
|
141
|
+
* {@link Connector.messaging}, or {@link Connector.requirements}; a connector
|
|
142
|
+
* implementing none does nothing and is rejected by {@link collectConnectors}.
|
|
122
143
|
*/
|
|
123
144
|
export interface Connector {
|
|
124
145
|
readonly [CONNECTOR_BRAND]: true;
|
|
125
|
-
/**
|
|
146
|
+
/**
|
|
147
|
+
* Diagnostic / provider label (e.g. `"mcp_servers"`, `"langsmith"`, `"slack"`).
|
|
148
|
+
* HTTP mounts use {@link name}, not kind.
|
|
149
|
+
*/
|
|
126
150
|
readonly kind: string;
|
|
151
|
+
/**
|
|
152
|
+
* File-stem instance name, stamped by {@link collectConnectors}. Mount
|
|
153
|
+
* namespace and messaging address (`runtime.channel` / `deliverTo`).
|
|
154
|
+
*/
|
|
155
|
+
readonly name?: string;
|
|
127
156
|
/** Contribute tools during agent-graph construction. MCP implements this. */
|
|
128
157
|
tools?(ctx: ToolContext): ConnectorToolList | Promise<ConnectorToolList>;
|
|
129
158
|
/** Mount HTTP routes during managed-app construction. LangSmith implements this. */
|
|
130
159
|
http?(ctx: HttpContext): void | Promise<void>;
|
|
131
160
|
/** Provision/refresh sandbox state when a managed sandbox is created or reused. */
|
|
132
161
|
sandbox?(ctx: SandboxContext): void | Promise<void>;
|
|
162
|
+
/**
|
|
163
|
+
* Handle `POST /connectors/{name}/events` (verify + normalize + ACK + work).
|
|
164
|
+
* Public by construction; provider signature verification is the adapter's job.
|
|
165
|
+
*/
|
|
166
|
+
events?(ctx: EventsContext): Response | Promise<Response>;
|
|
167
|
+
/** Build outbound messaging transport for `runtime.channel` / schedule delivery. */
|
|
168
|
+
messaging?(env: NodeJS.ProcessEnv): ChannelTransport | undefined;
|
|
169
|
+
/** Deploy/runtime requirements (env, permissions, connection, provider config). */
|
|
170
|
+
requirements?(name: string): ConnectorRequirements;
|
|
133
171
|
}
|
|
134
172
|
/**
|
|
135
173
|
* Run the `tools` hook of every connector that implements it and concatenate the
|
|
@@ -144,13 +182,20 @@ export declare function loadConnectorTools(connectors: readonly Connector[], ctx
|
|
|
144
182
|
export declare function runConnectorSandboxHooks(connectors: readonly Connector[] | undefined, ctx: SandboxContext): Promise<void>;
|
|
145
183
|
/** True when at least one connector implements {@link Connector.sandbox}. */
|
|
146
184
|
export declare function hasSandboxConnectors(connectors: readonly Connector[] | undefined): boolean;
|
|
185
|
+
/** True when any connector can start an ingress run via {@link Connector.events}. */
|
|
186
|
+
export declare function hasIngressConnectors(connectors: readonly Connector[] | undefined): boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Build the requirements map (file-stem → manifest) from connectors that
|
|
189
|
+
* implement {@link Connector.requirements}.
|
|
190
|
+
*/
|
|
191
|
+
export declare function requirementsFromConnectors(connectors: readonly Connector[]): Record<string, ConnectorRequirements>;
|
|
147
192
|
/** A discovered `connectors/` module paired with its source path for diagnostics. */
|
|
148
193
|
export interface DiscoveredConnectorModule {
|
|
149
194
|
/** Project-relative path of the module, used in error messages. */
|
|
150
195
|
readonly source: string;
|
|
151
|
-
/** The imported module namespace; its
|
|
196
|
+
/** The imported module namespace; its `connector` export is the connector. */
|
|
152
197
|
readonly module: {
|
|
153
|
-
|
|
198
|
+
connector?: unknown;
|
|
154
199
|
} & Record<string, unknown>;
|
|
155
200
|
}
|
|
156
201
|
/** Narrow an arbitrary value to a {@link Connector} by its brand and hooks. */
|
|
@@ -158,13 +203,11 @@ export declare function isConnector(value: unknown): value is Connector;
|
|
|
158
203
|
/**
|
|
159
204
|
* Validate and collect the connectors discovered under `connectors/`.
|
|
160
205
|
*
|
|
161
|
-
* Each module should expose exactly one connector as
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
* that implements no hooks is still a hard error
|
|
166
|
-
* broken). Duplicate connector objects (re-exported from two modules) are
|
|
167
|
-
* de-duplicated by identity.
|
|
206
|
+
* Each module should expose exactly one connector as `export const connector`.
|
|
207
|
+
* The file stem becomes the instance {@link Connector.name} (mount namespace and
|
|
208
|
+
* messaging address). Duplicate stems are a hard error. Modules with no such
|
|
209
|
+
* export, or whose `connector` is not branded, are skipped. A branded connector
|
|
210
|
+
* that implements no hooks is still a hard error.
|
|
168
211
|
*/
|
|
169
212
|
export declare function collectConnectors(modules: readonly DiscoveredConnectorModule[]): Connector[];
|
|
170
213
|
//# sourceMappingURL=connector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../src/runtime/connector.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../src/runtime/connector.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,eAAe,EAChB,MAAM,sBAA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wBAAgB,oBAAoB,CAClC,UAAU,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,GAC3C,OAAO,CAIT;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,SAAS,SAAS,EAAE,GAC/B,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CASvC;AAED,qFAAqF;AACrF,MAAM,WAAW,yBAAyB;IACxC,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpE;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAM9D;AAaD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,SAAS,yBAAyB,EAAE,GAC5C,SAAS,EAAE,CAoCb"}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The managed connector protocol.
|
|
3
3
|
*
|
|
4
|
-
* A connector is
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* Discovery is name-agnostic: the CLI globs modules under `connectors/` that
|
|
10
|
-
* `export default`, imports each default export, and hands them to
|
|
11
|
-
* {@link collectConnectors}, which keeps branded connectors and skips the rest.
|
|
12
|
-
* Entrypoints call the hooks they care about — the agent graph calls
|
|
13
|
-
* {@link Connector.tools}, the managed HTTP app calls {@link Connector.http},
|
|
14
|
-
* and sandbox provisioning calls {@link Connector.sandbox}.
|
|
4
|
+
* A connector is one integration with one external platform. It may contribute
|
|
5
|
+
* tools, HTTP routes, sandbox provisioning, inbound events, and/or a named
|
|
6
|
+
* messaging surface. Discovery is file-based: the CLI globs modules under
|
|
7
|
+
* `connectors/` that export a `connector`, imports each one, and hands them to
|
|
8
|
+
* {@link collectConnectors}, which stamps each with its file-stem `name`.
|
|
15
9
|
*/
|
|
16
10
|
/**
|
|
17
11
|
* Realm-global brand marking a value as a managed connector. `Symbol.for` keeps
|
|
@@ -48,6 +42,24 @@ export async function runConnectorSandboxHooks(connectors, ctx) {
|
|
|
48
42
|
export function hasSandboxConnectors(connectors) {
|
|
49
43
|
return (connectors ?? []).some((connector) => typeof connector.sandbox === "function");
|
|
50
44
|
}
|
|
45
|
+
/** True when any connector can start an ingress run via {@link Connector.events}. */
|
|
46
|
+
export function hasIngressConnectors(connectors) {
|
|
47
|
+
return (connectors ?? []).some((connector) => typeof connector.events === "function");
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Build the requirements map (file-stem → manifest) from connectors that
|
|
51
|
+
* implement {@link Connector.requirements}.
|
|
52
|
+
*/
|
|
53
|
+
export function requirementsFromConnectors(connectors) {
|
|
54
|
+
const out = {};
|
|
55
|
+
for (const connector of connectors) {
|
|
56
|
+
if (typeof connector.requirements !== "function" || !connector.name) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
out[connector.name] = connector.requirements(connector.name);
|
|
60
|
+
}
|
|
61
|
+
return out;
|
|
62
|
+
}
|
|
51
63
|
/** Narrow an arbitrary value to a {@link Connector} by its brand and hooks. */
|
|
52
64
|
export function isConnector(value) {
|
|
53
65
|
if (typeof value !== "object" || value === null) {
|
|
@@ -56,37 +68,61 @@ export function isConnector(value) {
|
|
|
56
68
|
const branded = value[CONNECTOR_BRAND];
|
|
57
69
|
return branded === true;
|
|
58
70
|
}
|
|
71
|
+
function connectorHasHook(connector) {
|
|
72
|
+
return (typeof connector.tools === "function" ||
|
|
73
|
+
typeof connector.http === "function" ||
|
|
74
|
+
typeof connector.sandbox === "function" ||
|
|
75
|
+
typeof connector.events === "function" ||
|
|
76
|
+
typeof connector.messaging === "function" ||
|
|
77
|
+
typeof connector.requirements === "function");
|
|
78
|
+
}
|
|
59
79
|
/**
|
|
60
80
|
* Validate and collect the connectors discovered under `connectors/`.
|
|
61
81
|
*
|
|
62
|
-
* Each module should expose exactly one connector as
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* that implements no hooks is still a hard error
|
|
67
|
-
* broken). Duplicate connector objects (re-exported from two modules) are
|
|
68
|
-
* de-duplicated by identity.
|
|
82
|
+
* Each module should expose exactly one connector as `export const connector`.
|
|
83
|
+
* The file stem becomes the instance {@link Connector.name} (mount namespace and
|
|
84
|
+
* messaging address). Duplicate stems are a hard error. Modules with no such
|
|
85
|
+
* export, or whose `connector` is not branded, are skipped. A branded connector
|
|
86
|
+
* that implements no hooks is still a hard error.
|
|
69
87
|
*/
|
|
70
88
|
export function collectConnectors(modules) {
|
|
71
89
|
const collected = [];
|
|
72
|
-
const
|
|
90
|
+
const seenObjects = new Set();
|
|
91
|
+
const seenNames = new Set();
|
|
73
92
|
for (const { source, module } of modules) {
|
|
74
|
-
const candidate = module.
|
|
93
|
+
const candidate = module.connector;
|
|
75
94
|
if (candidate === undefined || !isConnector(candidate)) {
|
|
76
95
|
continue;
|
|
77
96
|
}
|
|
78
|
-
if (
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
`\`tools\`, \`http\`, or \`sandbox\` and would do nothing.`);
|
|
97
|
+
if (!connectorHasHook(candidate)) {
|
|
98
|
+
throw new Error(`${source} connector (kind "${candidate.kind}") implements none of ` +
|
|
99
|
+
`\`tools\`, \`http\`, \`sandbox\`, \`events\`, \`messaging\`, or ` +
|
|
100
|
+
`\`requirements\` and would do nothing.`);
|
|
83
101
|
}
|
|
84
|
-
|
|
102
|
+
const name = connectorStemName(source);
|
|
103
|
+
if (seenNames.has(name)) {
|
|
104
|
+
throw new Error(`duplicate connector name '${name}' from connectors/`);
|
|
105
|
+
}
|
|
106
|
+
seenNames.add(name);
|
|
107
|
+
if (seenObjects.has(candidate)) {
|
|
85
108
|
continue;
|
|
86
109
|
}
|
|
87
|
-
|
|
110
|
+
seenObjects.add(candidate);
|
|
111
|
+
Object.defineProperty(candidate, "name", {
|
|
112
|
+
value: name,
|
|
113
|
+
enumerable: false,
|
|
114
|
+
writable: false,
|
|
115
|
+
configurable: true,
|
|
116
|
+
});
|
|
88
117
|
collected.push(candidate);
|
|
89
118
|
}
|
|
90
119
|
return collected;
|
|
91
120
|
}
|
|
121
|
+
function connectorStemName(source) {
|
|
122
|
+
const base = source.replace(/^.*\//, "").replace(/\.(ts|js|mts|mjs|py)$/, "");
|
|
123
|
+
if (!base || base === "connector") {
|
|
124
|
+
throw new Error(`invalid connector path "${source}": use connectors/<name>.ts (not connector.ts)`);
|
|
125
|
+
}
|
|
126
|
+
return base;
|
|
127
|
+
}
|
|
92
128
|
//# sourceMappingURL=connector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector.js","sourceRoot":"","sources":["../../src/runtime/connector.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"connector.js","sourceRoot":"","sources":["../../src/runtime/connector.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAaH;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAkB,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AA8K1E;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,UAAgC,EAChC,GAAG,GAAgB,EAAE;IAErB,MAAM,KAAK,GAAc,EAAE,CAAC;IAC5B,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,OAAO,SAAS,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;YAC1C,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,wBA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AAC,IAAI,CAAC,CAAC;QACpB,IAAI,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YAC/B,SAAS;QACX,CAAC;QACD,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC3B,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE;YACvC,KAAK,EAAE,IAAI;YACX,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,IAAI;SACnB,CAAC,CAAC;QACH,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC;IAC9E,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,WAAW,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CACb,2BAA2B,MAAM,gDAAgD,CAClF,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/runtime/cors.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CORS allowlist helpers for managed HTTP routes (`/identity`, `/connectors
|
|
3
|
-
* `/channels`).
|
|
2
|
+
* CORS allowlist helpers for managed HTTP routes (`/identity`, `/connectors`).
|
|
4
3
|
*
|
|
5
4
|
* LangGraph applies `CORS_ALLOW_ORIGINS` to built-in Agent Server routes, but
|
|
6
5
|
* GET responses from the custom `http.app` do not always receive those headers.
|
|
@@ -11,7 +10,7 @@
|
|
|
11
10
|
* {@link MDA_PUBLIC_APP_URL_ENV} plus optional {@link MDA_CORS_ORIGINS_ENV}.
|
|
12
11
|
*/
|
|
13
12
|
/** Path prefixes that receive managed-app CORS (not built-in Agent Server routes). */
|
|
14
|
-
export declare const MDA_CORS_PATH_PREFIXES: readonly ["/identity", "/connectors"
|
|
13
|
+
export declare const MDA_CORS_PATH_PREFIXES: readonly ["/identity", "/connectors"];
|
|
15
14
|
/** Comma-separated extra browser origins allowed for managed HTTP CORS. */
|
|
16
15
|
export declare const MDA_CORS_ORIGINS_ENV = "MDA_CORS_ORIGINS";
|
|
17
16
|
/** Headers browser clients send on identity / connector fetches. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cors.d.ts","sourceRoot":"","sources":["../../src/runtime/cors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cors.d.ts","sourceRoot":"","sources":["../../src/runtime/cors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,sFAAsF;AACtF,eAAO,MAAM,sBAAsB,YAAI,WAAW,EAAE,aAAa,CAAU,CAAC;AAE5E,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AAEvD,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,YACjC,eAAe,EACf,cAAc,EACd,QAAQ,EACR,WAAW,EACX,WAAW,CACH,CAAC;AAEX,eAAO,MAAM,sBAAsB,YACjC,KAAK,EACL,MAAM,EACN,KAAK,EACL,QAAQ,EACR,SAAS,CACD,CAAC;AAEX,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAIvD;AAED,qEAAqE;AACrE,wBAAgB,oBAAoB,CAClC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,EAAE,CAaV;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EAAE,GAClB,MAAM,GAAG,SAAS,CA+BpB"}
|
package/dist/runtime/cors.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CORS allowlist helpers for managed HTTP routes (`/identity`, `/connectors
|
|
3
|
-
* `/channels`).
|
|
2
|
+
* CORS allowlist helpers for managed HTTP routes (`/identity`, `/connectors`).
|
|
4
3
|
*
|
|
5
4
|
* LangGraph applies `CORS_ALLOW_ORIGINS` to built-in Agent Server routes, but
|
|
6
5
|
* GET responses from the custom `http.app` do not always receive those headers.
|
|
@@ -12,11 +11,7 @@
|
|
|
12
11
|
*/
|
|
13
12
|
import { MDA_PUBLIC_APP_URL_ENV } from "../identity/slack/oauth.js";
|
|
14
13
|
/** Path prefixes that receive managed-app CORS (not built-in Agent Server routes). */
|
|
15
|
-
export const MDA_CORS_PATH_PREFIXES = [
|
|
16
|
-
"/identity",
|
|
17
|
-
"/connectors",
|
|
18
|
-
"/channels",
|
|
19
|
-
];
|
|
14
|
+
export const MDA_CORS_PATH_PREFIXES = ["/identity", "/connectors"];
|
|
20
15
|
/** Comma-separated extra browser origins allowed for managed HTTP CORS. */
|
|
21
16
|
export const MDA_CORS_ORIGINS_ENV = "MDA_CORS_ORIGINS";
|
|
22
17
|
/** Headers browser clients send on identity / connector fetches. */
|
package/dist/runtime/cors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cors.js","sourceRoot":"","sources":["../../src/runtime/cors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cors.js","sourceRoot":"","sources":["../../src/runtime/cors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,sFAAsF;AACtF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,WAAW,EAAE,aAAa,CAAU,CAAC;AAE5E,2EAA2E;AAC3E,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEvD,oEAAoE;AACpE,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,eAAe;IACf,cAAc;IACd,QAAQ;IACR,WAAW;IACX,WAAW;CACH,CAAC;AAEX,MAAM,CAAC,MAAM,sBA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AI,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/B,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,WAAmB,CAAC;IACxB,IAAI,CAAC;QACH,WAAW,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE,CAAC;QAChC,IAAI,WAAmB,CAAC;QACxB,IAAI,CAAC;YACH,WAAW,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC;QACtC,CAAC;QAAC,MAAM,CAAC;YACP,SAAS;QACX,CAAC;QACD,IACE,WAAW,KAAK,WAAW;YAC3B,WAAW,CAAC,QAAQ,CAAC,IAAI,WAAW,EAAE,CAAC,EACvC,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/runtime/credentials.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/runtime/credentials.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAGV,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAG9B;;;;;;;;;;;;;GAaG;AAEH,6EAA6E;AAC7E,eAAO,MAAM,6BAA6B,8BAA8B,CAAC;AAKzE,4DAA4D;AAC5D,MAAM,WAAW,oBAAoB;IACnC,2EAA2E;IAC3E,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,GAAG,CACD,MAAM,EAAE,gBAAgB,EACxB,OAAO,CAAC,EAAE,oBAAoB,GAC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{ fetchWithTimeout, PROVIDER_HTTP_TIMEOUT_MS } from "./http.js";
|
|
2
4
|
/**
|
|
3
5
|
* Component 5 — Credentials, custom mode.
|
|
4
6
|
*
|
|
@@ -82,7 +84,7 @@ export function clearCredentialCacheForTests() {
|
|
|
82
84
|
* run's resolved identity; every `for(target)` call is scoped to that actor.
|
|
83
85
|
*/
|
|
84
86
|
export function createCredentialsProvider(cfg, identity, deps, cache = defaultCache) {
|
|
85
|
-
if (cfg.
|
|
87
|
+
if (cfg.scope.credentials !== "custom" || !cfg.credentials) {
|
|
86
88
|
return undefined;
|
|
87
89
|
}
|
|
88
90
|
const resolved = {
|
|
@@ -115,22 +117,45 @@ async function resolveCredential(cfg, identity, target, deps) {
|
|
|
115
117
|
if (!creds) {
|
|
116
118
|
throw new Error("No credentials resolver is configured for this deployment.");
|
|
117
119
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
return resolveOne(selectResolver(creds, target), identity, target, deps, creds);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Pick the resolver for this target: the single one, or the map entry whose key
|
|
124
|
+
* matches `target.name`.
|
|
125
|
+
*/
|
|
126
|
+
function selectResolver(creds, target) {
|
|
127
|
+
if (isSingleCredentialResolver(creds)) {
|
|
128
|
+
return creds;
|
|
129
|
+
}
|
|
130
|
+
const entry = Object.hasOwn(creds, target.name)
|
|
131
|
+
? creds[target.name]
|
|
132
|
+
: undefined;
|
|
133
|
+
if (!entry) {
|
|
134
|
+
const configured = credentialTargetNames(creds).join(", ");
|
|
135
|
+
throw new Error(`runtime.credentials.for(...) has no resolver for target "${target.name}". ` +
|
|
136
|
+
`Configured targets: ${configured}.`);
|
|
137
|
+
}
|
|
138
|
+
return entry;
|
|
139
|
+
}
|
|
140
|
+
async function resolveOne(config, identity, target, deps, creds) {
|
|
141
|
+
const label = isSingleCredentialResolver(creds)
|
|
142
|
+
? "resolver"
|
|
143
|
+
: `resolver for "${target.name}"`;
|
|
144
|
+
if ("resolve" in config) {
|
|
145
|
+
return normalizeResolved(await config.resolve({ identity, target }), label);
|
|
121
146
|
}
|
|
122
147
|
const assertion = await deps.signAssertion(identity, target);
|
|
123
|
-
return callTokenExchange(
|
|
148
|
+
return callTokenExchange(config.endpoint.url, assertion, deps);
|
|
124
149
|
}
|
|
125
150
|
async function callTokenExchange(url, assertion, deps) {
|
|
126
|
-
const response = await
|
|
151
|
+
const response = await fetchWithTimeout(url, {
|
|
127
152
|
method: "POST",
|
|
128
153
|
headers: {
|
|
129
154
|
"content-type": "application/json",
|
|
130
155
|
authorization: `Bearer ${assertion}`,
|
|
131
156
|
},
|
|
132
157
|
body: JSON.stringify({ assertion }),
|
|
133
|
-
});
|
|
158
|
+
}, PROVIDER_HTTP_TIMEOUT_MS, deps.fetch);
|
|
134
159
|
if (!response.ok) {
|
|
135
160
|
throw new Error(`Credential token-exchange endpoint ${url} responded ${response.status}.`);
|
|
136
161
|
}
|
|
@@ -144,25 +169,25 @@ async function defaultSignAssertion(identity, target) {
|
|
|
144
169
|
}
|
|
145
170
|
const issuedAt = Math.floor(Date.now() / 1000);
|
|
146
171
|
return new SignJWT({
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
172
|
+
user_id: identity.user.id,
|
|
173
|
+
user_kind: identity.user.kind,
|
|
174
|
+
organization_id: identity.organization?.id,
|
|
150
175
|
target: { kind: target.kind, name: target.name, intent: target.intent },
|
|
151
176
|
})
|
|
152
177
|
.setProtectedHeader({ alg: "HS256" })
|
|
153
|
-
.setSubject(identity.
|
|
178
|
+
.setSubject(identity.user.id)
|
|
154
179
|
.setIssuedAt(issuedAt)
|
|
155
180
|
.setExpirationTime(issuedAt + ASSERTION_TTL_SECONDS)
|
|
156
181
|
.sign(new TextEncoder().encode(secret));
|
|
157
182
|
}
|
|
158
183
|
/**
|
|
159
|
-
* The cache key that discriminates a minted credential: the
|
|
184
|
+
* The cache key that discriminates a minted credential: the user + organization it
|
|
160
185
|
* belongs to, plus the target's kind/name/intent/thread and metadata.
|
|
161
186
|
*/
|
|
162
187
|
function cacheKey(identity, target) {
|
|
163
188
|
return stableStringify([
|
|
164
|
-
identity.
|
|
165
|
-
identity.
|
|
189
|
+
identity.user.id,
|
|
190
|
+
identity.organization?.id ?? null,
|
|
166
191
|
target.kind,
|
|
167
192
|
target.name,
|
|
168
193
|
target.intent ?? null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/runtime/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/runtime/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EACL,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAS9B,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAEvE;;;;;;;;;;;;;GAaG;AAEH,6EAA6E;AAC7E,MAAM,CAAC,MAAM,6BAA6B,GAAG,2BAA2B,CAAC;AAEzE,iEAAiE;AACjE,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAwCjC,kEAAkE;AAClE,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACxD,kDAAkD;AAClD,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,OAAO,eAAe;IAIP,YAAY;IACZ,UAAU;IAJZ,OAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;IAEzD,YACmB,YAAY,GAAW,yBAAyB,EAChD,UAAU,GAAW,4BAA4B;4BADjD,YAAY;0BACZ,UAAU;IAC1B,CAAC;IAEJ,GAAG,CAAC,GAAW,EAAE,KAAa;QAC5B,MAAM,GAAG,GAAG,IAAI,CAAC,O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,KAAK,QAAQ,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CACb,cAAc,WAAW,YAAY,IAAI,qBAAqB,CAC/D,CAAC;QACJ,CAAC;QACD,iBAAiB,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC;IACxC,CAAC;IACD,MAAM,MAAM,GAAuB,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAClE,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CACb,cAAc,WAAW,uCAAuC,CACjE,CAAC;QACJ,CAAC;QACD,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;IAC/B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounded outbound HTTP for the managed runtime.
|
|
3
|
+
*
|
|
4
|
+
* Node's `fetch` has no default timeout, so a peer that accepts the connection
|
|
5
|
+
* and never responds pins the caller forever. On the auth path that turns one
|
|
6
|
+
* hung IdP into a fully unavailable deployment: every request parks in token
|
|
7
|
+
* verification holding a request slot, and the fail-closed 401 never runs.
|
|
8
|
+
*
|
|
9
|
+
* Every outbound call in this package goes through {@link fetchWithTimeout}.
|
|
10
|
+
* Budgets mirror the Python runtime so the two stay behavior-compatible.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Auth/authz-path calls: OIDC discovery, token introspection, thread-ownership
|
|
14
|
+
* proof. Mirrors `_validated_token.py` (`timeout=10`) and
|
|
15
|
+
* `connectors/langsmith/routes.py` (`_THREAD_ACCESS_TIMEOUT_S`).
|
|
16
|
+
*/
|
|
17
|
+
export declare const AUTH_HTTP_TIMEOUT_MS = 10000;
|
|
18
|
+
/**
|
|
19
|
+
* Provider egress: Slack/GitHub APIs, OAuth code exchange, credential
|
|
20
|
+
* token exchange. Mirrors the Python runtime's `timeout=30`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const PROVIDER_HTTP_TIMEOUT_MS = 30000;
|
|
23
|
+
/**
|
|
24
|
+
* Remote JWKS fetches performed inside `jose`. Passed explicitly to
|
|
25
|
+
* `createRemoteJWKSet` rather than relying on the library default.
|
|
26
|
+
*/
|
|
27
|
+
export declare const JWKS_HTTP_TIMEOUT_MS = 5000;
|
|
28
|
+
/**
|
|
29
|
+
* `fetch` with a hard wall-clock budget.
|
|
30
|
+
*
|
|
31
|
+
* The request is aborted with a `TimeoutError` once `timeoutMs` elapses; a
|
|
32
|
+
* caller-supplied `init.signal` still aborts as usual.
|
|
33
|
+
*
|
|
34
|
+
* The budget spans the whole exchange, body included: a peer that sends headers
|
|
35
|
+
* and then stalls rejects at `response.json()`/`.text()`, *after* this call has
|
|
36
|
+
* already resolved. Callers that map a network failure to a specific status must
|
|
37
|
+
* put the body read under the same mapping, or a stalled body takes a different
|
|
38
|
+
* path than a stalled connection.
|
|
39
|
+
*
|
|
40
|
+
* @param input - Request URL.
|
|
41
|
+
* @param init - Request init, or `undefined`.
|
|
42
|
+
* @param timeoutMs - Abort budget in milliseconds.
|
|
43
|
+
* @param fetchImpl - Fetch override (tests, or an injected transport).
|
|
44
|
+
* @returns The response, or a rejection once the budget elapses.
|
|
45
|
+
*/
|
|
46
|
+
export declare function fetchWithTimeout(input: string | URL, init: RequestInit | undefined, timeoutMs: number, fetchImpl?: typeof fetch): Promise<Response>;
|
|
47
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/runtime/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAE/C;;;GAGG;AACH,eAAO,MAAM,oBAAoB,OAAQ,CAAC;AAE1C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,GAAG,GAAG,EACnB,IAAI,EAAE,WAAW,GAAG,SAAS,EAC7B,SAAS,EAAE,MAAM,EACjB,SAAS,GAAE,OAAO,KAAa,GAC9B,OAAO,CAAC,QAAQ,CAAC,CAOnB"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounded outbound HTTP for the managed runtime.
|
|
3
|
+
*
|
|
4
|
+
* Node's `fetch` has no default timeout, so a peer that accepts the connection
|
|
5
|
+
* and never responds pins the caller forever. On the auth path that turns one
|
|
6
|
+
* hung IdP into a fully unavailable deployment: every request parks in token
|
|
7
|
+
* verification holding a request slot, and the fail-closed 401 never runs.
|
|
8
|
+
*
|
|
9
|
+
* Every outbound call in this package goes through {@link fetchWithTimeout}.
|
|
10
|
+
* Budgets mirror the Python runtime so the two stay behavior-compatible.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Auth/authz-path calls: OIDC discovery, token introspection, thread-ownership
|
|
14
|
+
* proof. Mirrors `_validated_token.py` (`timeout=10`) and
|
|
15
|
+
* `connectors/langsmith/routes.py` (`_THREAD_ACCESS_TIMEOUT_S`).
|
|
16
|
+
*/
|
|
17
|
+
export const AUTH_HTTP_TIMEOUT_MS = 10_000;
|
|
18
|
+
/**
|
|
19
|
+
* Provider egress: Slack/GitHub APIs, OAuth code exchange, credential
|
|
20
|
+
* token exchange. Mirrors the Python runtime's `timeout=30`.
|
|
21
|
+
*/
|
|
22
|
+
export const PROVIDER_HTTP_TIMEOUT_MS = 30_000;
|
|
23
|
+
/**
|
|
24
|
+
* Remote JWKS fetches performed inside `jose`. Passed explicitly to
|
|
25
|
+
* `createRemoteJWKSet` rather than relying on the library default.
|
|
26
|
+
*/
|
|
27
|
+
export const JWKS_HTTP_TIMEOUT_MS = 5_000;
|
|
28
|
+
/**
|
|
29
|
+
* `fetch` with a hard wall-clock budget.
|
|
30
|
+
*
|
|
31
|
+
* The request is aborted with a `TimeoutError` once `timeoutMs` elapses; a
|
|
32
|
+
* caller-supplied `init.signal` still aborts as usual.
|
|
33
|
+
*
|
|
34
|
+
* The budget spans the whole exchange, body included: a peer that sends headers
|
|
35
|
+
* and then stalls rejects at `response.json()`/`.text()`, *after* this call has
|
|
36
|
+
* already resolved. Callers that map a network failure to a specific status must
|
|
37
|
+
* put the body read under the same mapping, or a stalled body takes a different
|
|
38
|
+
* path than a stalled connection.
|
|
39
|
+
*
|
|
40
|
+
* @param input - Request URL.
|
|
41
|
+
* @param init - Request init, or `undefined`.
|
|
42
|
+
* @param timeoutMs - Abort budget in milliseconds.
|
|
43
|
+
* @param fetchImpl - Fetch override (tests, or an injected transport).
|
|
44
|
+
* @returns The response, or a rejection once the budget elapses.
|
|
45
|
+
*/
|
|
46
|
+
export function fetchWithTimeout(input, init, timeoutMs, fetchImpl = fetch) {
|
|
47
|
+
const timeout = AbortSignal.timeout(timeoutMs);
|
|
48
|
+
const caller = init?.signal;
|
|
49
|
+
return fetchImpl(input, {
|
|
50
|
+
...init,
|
|
51
|
+
signal: caller ? AbortSignal.any([caller, timeout]) : timeout,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/runtime/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAmB,EACnB,IAA6B,EAC7B,SAAiB,EACjB,SAAS,GAAiB,KAAK;IAE/B,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC;IAC5B,OAAO,SAAS,CAAC,KAAK,EAAE;QACtB,GAAG,IAAI;QACP,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO;KAC9D,CAAC,CAAC;AACL,CAAC"}
|