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,24 +1,12 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
2
|
import type { IdentityDefinition } from "../identity/index.js";
|
|
3
|
-
import type {
|
|
4
|
-
import type { Connector } from "./connector.js";
|
|
3
|
+
import type { Connector, ConnectorRequirements } from "./connector.js";
|
|
5
4
|
/** Inputs the managed HTTP app is built from. */
|
|
6
5
|
export interface ManagedHttpAppInputs {
|
|
7
6
|
/** The declared identity, if the project opts into managed identity. */
|
|
8
7
|
identity?: IdentityDefinition;
|
|
9
|
-
/** Discovered connectors; those implementing
|
|
8
|
+
/** Discovered connectors; those implementing hooks mount routes / messaging. */
|
|
10
9
|
connectors?: Connector[];
|
|
11
|
-
/**
|
|
12
|
-
* Channel manifests (optional when {@link channelDefinitions} is present).
|
|
13
|
-
* Prefer live definitions — manifests are derived via `toManifest`.
|
|
14
|
-
*/
|
|
15
|
-
channels?: Record<string, ChannelManifest>;
|
|
16
|
-
/**
|
|
17
|
-
* Live channel declarations from `_mda_channels`. Keyed by file-stem name.
|
|
18
|
-
* When set, adapters are registered and manifests are derived from each
|
|
19
|
-
* branded definition's `toManifest`.
|
|
20
|
-
*/
|
|
21
|
-
channelDefinitions?: Record<string, unknown>;
|
|
22
10
|
}
|
|
23
11
|
/**
|
|
24
12
|
* Build the single managed HTTP app mounted via `langgraph.json` `http.app`.
|
|
@@ -26,8 +14,9 @@ export interface ManagedHttpAppInputs {
|
|
|
26
14
|
* It layers two concerns onto the built-in LangGraph routes:
|
|
27
15
|
* - **identity** — public guest issuance (`POST /identity/guest`) when the
|
|
28
16
|
* declared identity enables a guest provider;
|
|
29
|
-
* - **connectors** — each connector
|
|
30
|
-
*
|
|
17
|
+
* - **connectors** — each connector gets a sub-router namespaced under
|
|
18
|
+
* `/connectors/{name}`; `events` mounts the conventional public inbound
|
|
19
|
+
* route; `http` mounts additional secured/public routes.
|
|
31
20
|
*
|
|
32
21
|
* Connector routes are **secure by default**: MDA resolves and enforces the
|
|
33
22
|
* caller's identity before the handler runs, and a route must opt out of
|
|
@@ -36,4 +25,5 @@ export interface ManagedHttpAppInputs {
|
|
|
36
25
|
* invisible.
|
|
37
26
|
*/
|
|
38
27
|
export declare function buildManagedHttpApp(inputs: ManagedHttpAppInputs): Hono;
|
|
28
|
+
export type { ConnectorRequirements };
|
|
39
29
|
//# sourceMappingURL=identity-http.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-http.d.ts","sourceRoot":"","sources":["../../src/runtime/identity-http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,OAAO,KAAK,EAAkB,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"identity-http.d.ts","sourceRoot":"","sources":["../../src/runtime/identity-http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,OAAO,KAAK,EAAkB,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAO/E,OAAO,KAAK,EACV,SAAS,EACT,qBAAqB,EAKtB,MAAM,gBAAgB,CAAC;AAWxB,iDAAiD;AACjD,MAAM,WAAW,oBAAoB;IACnC,wEAAwE;IACxE,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,gFAAgF;IAChF,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;CAC1B;AAyBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CA8DtE;AA4ND,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
2
|
import { cors } from "hono/cors";
|
|
3
|
-
import {
|
|
4
|
-
import { getChannelAdapter } from "../channels/registry.js";
|
|
3
|
+
import { registerConnectorMessaging } from "../channels/messaging-registry.js";
|
|
5
4
|
import { mountIdentityConnectProviders } from "../identity/connect-provider.js";
|
|
5
|
+
import { githubIdentityConnectProvider } from "../identity/github/connect-http.js";
|
|
6
|
+
import { slackIdentityConnectProvider } from "../identity/slack/connect-http.js";
|
|
6
7
|
import { resolveRequestIdentity } from "./auth.js";
|
|
8
|
+
import { requirementsFromConnectors } from "./connector.js";
|
|
7
9
|
import { isManagedCorsPath, matchCorsOrigin, MDA_CORS_ALLOW_HEADERS, MDA_CORS_ALLOW_METHODS, resolveCorsAllowlist, } from "./cors.js";
|
|
8
10
|
import { issueGuestToken } from "./validated-token.js";
|
|
9
11
|
/** Signals a secured route was reached but no identity is declared to resolve it. */
|
|
@@ -20,8 +22,9 @@ class IdentityNotConfiguredError extends Error {
|
|
|
20
22
|
* It layers two concerns onto the built-in LangGraph routes:
|
|
21
23
|
* - **identity** — public guest issuance (`POST /identity/guest`) when the
|
|
22
24
|
* declared identity enables a guest provider;
|
|
23
|
-
* - **connectors** — each connector
|
|
24
|
-
*
|
|
25
|
+
* - **connectors** — each connector gets a sub-router namespaced under
|
|
26
|
+
* `/connectors/{name}`; `events` mounts the conventional public inbound
|
|
27
|
+
* route; `http` mounts additional secured/public routes.
|
|
25
28
|
*
|
|
26
29
|
* Connector routes are **secure by default**: MDA resolves and enforces the
|
|
27
30
|
* caller's identity before the handler runs, and a route must opt out of
|
|
@@ -35,24 +38,49 @@ export function buildManagedHttpApp(inputs) {
|
|
|
35
38
|
if (inputs.identity) {
|
|
36
39
|
mountIdentityRoutes(app, inputs.identity);
|
|
37
40
|
}
|
|
41
|
+
const connectors = inputs.connectors ?? [];
|
|
42
|
+
registerConnectorMessaging(connectors);
|
|
38
43
|
const mounted = [];
|
|
39
|
-
for (const connector of
|
|
44
|
+
for (const connector of connectors) {
|
|
45
|
+
// Prefer the file-stem name from collectConnectors; fall back to kind for
|
|
46
|
+
// hand-built connectors in unit tests.
|
|
47
|
+
const name = connector.name ?? connector.kind;
|
|
48
|
+
if (!name) {
|
|
49
|
+
throw new Error(`Connector kind "${connector.kind}" has no file-stem name; ` +
|
|
50
|
+
"pass connectors through collectConnectors before mounting.");
|
|
51
|
+
}
|
|
40
52
|
if (typeof connector.http === "function") {
|
|
41
|
-
mountConnectorRoutes(app, connector, inputs.identity?.config, mounted);
|
|
53
|
+
mountConnectorRoutes(app, connector, name, inputs.identity?.config, mounted);
|
|
54
|
+
}
|
|
55
|
+
if (typeof connector.events === "function") {
|
|
56
|
+
mountConnectorEvents(app, connector, name, mounted);
|
|
42
57
|
}
|
|
43
58
|
}
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
: inputs.channels;
|
|
48
|
-
mountChannelRoutes(app, channels, inputs.channelDefinitions, mounted);
|
|
49
|
-
// Connect-with-X: only providers listed on identity.connect.
|
|
59
|
+
const requirements = requirementsFromConnectors(connectors);
|
|
60
|
+
// Connect-with-X: providers listed on identity.connect, plus built-ins the
|
|
61
|
+
// rest of the identity declaration implies.
|
|
50
62
|
if (inputs.identity) {
|
|
51
|
-
|
|
63
|
+
const cfg = inputs.identity.config;
|
|
64
|
+
mountIdentityConnectProviders(app, cfg, {
|
|
65
|
+
channels: requirements,
|
|
66
|
+
hasIdentity: true,
|
|
67
|
+
scope: cfg.scope,
|
|
68
|
+
...(cfg.credentials ? { credentials: cfg.credentials } : {}),
|
|
69
|
+
}, mounted, {
|
|
70
|
+
providers: cfg.connect ?? [],
|
|
71
|
+
candidates: builtinIdentityConnectCandidates(),
|
|
72
|
+
});
|
|
52
73
|
}
|
|
53
74
|
logConnectorSurface(mounted);
|
|
54
75
|
return app;
|
|
55
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Built-in connect providers offered to every identity-enabled deployment. Each
|
|
79
|
+
* one mounts only when its own predicate says the declaration implies it.
|
|
80
|
+
*/
|
|
81
|
+
function builtinIdentityConnectCandidates() {
|
|
82
|
+
return [githubIdentityConnectProvider, slackIdentityConnectProvider];
|
|
83
|
+
}
|
|
56
84
|
/**
|
|
57
85
|
* CORS for managed routes only.
|
|
58
86
|
*
|
|
@@ -81,7 +109,7 @@ function mountManagedCors(app) {
|
|
|
81
109
|
/** Mount the public identity routes (guest issuance) onto `app`. */
|
|
82
110
|
function mountIdentityRoutes(app, identity) {
|
|
83
111
|
const http = identity.config.ingress.http;
|
|
84
|
-
if (http === "
|
|
112
|
+
if (http === "backend") {
|
|
85
113
|
return;
|
|
86
114
|
}
|
|
87
115
|
const guestProvider = http.providers.find((provider) => provider.guest?.issue);
|
|
@@ -94,52 +122,42 @@ function mountIdentityRoutes(app, identity) {
|
|
|
94
122
|
});
|
|
95
123
|
}
|
|
96
124
|
/**
|
|
97
|
-
* Mount public Events
|
|
125
|
+
* Mount the conventional public Events route for a connector.
|
|
98
126
|
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
127
|
+
* Ingress authenticates inside the handler (Slack signatures, GitHub HMAC, …)
|
|
128
|
+
* — these routes stay public at the LangGraph auth layer.
|
|
101
129
|
*/
|
|
102
|
-
function
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
app.post(path, async (c) => {
|
|
119
|
-
// Read the body through Hono so signature verification sees the same
|
|
120
|
-
// bytes the provider signed (platform middleware may otherwise consume `raw`).
|
|
121
|
-
const rawBody = await c.req.text();
|
|
122
|
-
return adapter.handleEventsRequest(c.req.raw, {
|
|
123
|
-
name,
|
|
124
|
-
manifest,
|
|
125
|
-
definition,
|
|
126
|
-
rawBody,
|
|
127
|
-
});
|
|
130
|
+
function mountConnectorEvents(app, connector, name, mounted) {
|
|
131
|
+
const path = `/connectors/${name}/events`;
|
|
132
|
+
mounted.push({
|
|
133
|
+
connector: name,
|
|
134
|
+
method: "post",
|
|
135
|
+
path,
|
|
136
|
+
secured: false,
|
|
137
|
+
absolute: true,
|
|
138
|
+
});
|
|
139
|
+
app.post(path, async (c) => {
|
|
140
|
+
const rawBody = await c.req.text();
|
|
141
|
+
return connector.events({
|
|
142
|
+
name,
|
|
143
|
+
request: c.req.raw,
|
|
144
|
+
rawBody,
|
|
145
|
+
connector,
|
|
128
146
|
});
|
|
129
|
-
}
|
|
147
|
+
});
|
|
130
148
|
}
|
|
131
149
|
/**
|
|
132
150
|
* Mount a connector's `http` routes on a sub-router namespaced under
|
|
133
|
-
* `/connectors/{
|
|
151
|
+
* `/connectors/{name}`, so connector routes cannot collide with identity/API
|
|
134
152
|
* routes or with each other.
|
|
135
153
|
*
|
|
136
154
|
* The connector's `http` hook must mount synchronously. Async hooks are rejected
|
|
137
155
|
* because LangGraph captures custom routes when the module is imported — a
|
|
138
156
|
* deferred mount leaves those paths as platform 404s.
|
|
139
157
|
*/
|
|
140
|
-
function mountConnectorRoutes(app, connector, cfg, mounted) {
|
|
158
|
+
function mountConnectorRoutes(app, connector, name, cfg, mounted) {
|
|
141
159
|
const sub = new Hono();
|
|
142
|
-
const router = honoConnectorRouter(sub,
|
|
160
|
+
const router = honoConnectorRouter(sub, name, cfg, mounted);
|
|
143
161
|
const ctx = {
|
|
144
162
|
router,
|
|
145
163
|
identity: cfg,
|
|
@@ -154,19 +172,19 @@ function mountConnectorRoutes(app, connector, cfg, mounted) {
|
|
|
154
172
|
const result = connector.http?.(ctx);
|
|
155
173
|
if (result != null &&
|
|
156
174
|
typeof result.then === "function") {
|
|
157
|
-
throw new Error(`Connector "${
|
|
175
|
+
throw new Error(`Connector "${name}" http() returned a Promise. HTTP hooks must ` +
|
|
158
176
|
`mount routes synchronously so LangGraph can capture them at import time.`);
|
|
159
177
|
}
|
|
160
|
-
app.route(`/connectors/${
|
|
178
|
+
app.route(`/connectors/${name}`, sub);
|
|
161
179
|
}
|
|
162
180
|
/**
|
|
163
181
|
* Build the secure-by-default {@link HttpSubRouter} over a Hono sub-app. Secured
|
|
164
182
|
* routes resolve identity (401 on failure) before the handler runs; `public.*`
|
|
165
183
|
* routes skip enforcement. Every registration is recorded in `mounted`.
|
|
166
184
|
*/
|
|
167
|
-
function honoConnectorRouter(sub,
|
|
185
|
+
function honoConnectorRouter(sub, name, cfg, mounted) {
|
|
168
186
|
const secured = (method) => (path, handler) => {
|
|
169
|
-
mounted.push({ connector:
|
|
187
|
+
mounted.push({ connector: name, method, path, secured: true });
|
|
170
188
|
sub[method](path, async (c) => {
|
|
171
189
|
const request = c.req.raw;
|
|
172
190
|
if (!cfg) {
|
|
@@ -183,7 +201,7 @@ function honoConnectorRouter(sub, kind, cfg, mounted) {
|
|
|
183
201
|
});
|
|
184
202
|
};
|
|
185
203
|
const publicRoute = (method) => (path, handler) => {
|
|
186
|
-
mounted.push({ connector:
|
|
204
|
+
mounted.push({ connector: name, method, path, secured: false });
|
|
187
205
|
sub[method](path, (c) => handler(c.req.raw));
|
|
188
206
|
};
|
|
189
207
|
return {
|
|
@@ -221,8 +239,7 @@ function logConnectorSurface(mounted) {
|
|
|
221
239
|
}
|
|
222
240
|
console.info(`[mda] managed HTTP surface (${mounted.length} route(s)):`);
|
|
223
241
|
for (const route of mounted) {
|
|
224
|
-
const full = route.connector.startsWith("
|
|
225
|
-
route.connector.startsWith("identity:")
|
|
242
|
+
const full = route.absolute || route.connector.startsWith("identity:")
|
|
226
243
|
? route.path
|
|
227
244
|
: `/connectors/${route.connector}${route.path}`;
|
|
228
245
|
const line = `[mda] ${route.method.toUpperCase().padEnd(6)} ${full}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-http.js","sourceRoot":"","sources":["../../src/runtime/identity-http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"identity-http.js","sourceRoot":"","sources":["../../src/runtime/identity-http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAEhF,OAAO,EAAE,6BAA6B,EA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AAO,CAAC,IAAI,CAAC,+BAA+B,OAAO,CAAC,MAAM,aAAa,CAAC,CAAC;IACzE,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,IAAI,GACR,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC;YACvD,CAAC,CAAC,KAAK,CAAC,IAAI;YACZ,CAAC,CAAC,eAAe,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QACpD,MAAM,IAAI,GAAG,WAAW,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;QACvE,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,uBAAuB,CAAC,CAAC;QAC/C,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,sCAAsC,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RuntimeChannel } from "../channels/types.js";
|
|
2
|
-
import type { MemoryScope, RuntimeIdentity,
|
|
2
|
+
import type { MemoryScope, RuntimeIdentity, OrganizationRequirement } from "../identity/index.js";
|
|
3
3
|
import type { ConfigurableCarrier } from "./types.js";
|
|
4
4
|
/** Override ambient LangGraph configurable resolution. Test-only. */
|
|
5
5
|
export declare function setAmbientConfigurableForTests(loader?: () => Record<string, unknown> | undefined): void;
|
|
@@ -8,14 +8,13 @@ export declare function setAmbientConfigurableForTests(loader?: () => Record<str
|
|
|
8
8
|
* nested `ToolRuntime` shape LangChain passes to tools
|
|
9
9
|
* (`runtime.config.configurable`).
|
|
10
10
|
*
|
|
11
|
-
* When the caller only passes `{ state }` (
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* memory remounts.
|
|
11
|
+
* When the caller only passes `{ state }` (or omits auth), fall back to the
|
|
12
|
+
* ambient LangGraph runnable config so `langgraph_auth_user` still reaches
|
|
13
|
+
* user/organization memory remounts on `LazyPerRunContextBackend`.
|
|
15
14
|
*
|
|
16
15
|
* Also fall back when a runtime `config` is present but its `configurable` bag
|
|
17
16
|
* lacks `langgraph_auth_user` (empty or partial). Returning that bag would skip
|
|
18
|
-
* ambient and break first-turn
|
|
17
|
+
* ambient and break first-turn user memory remounts.
|
|
19
18
|
*/
|
|
20
19
|
export declare function resolveRuntimeConfigurable(runtime: RuntimeConfigLike | undefined): Record<string, unknown> | undefined;
|
|
21
20
|
/** Read `configurable` from a flat runtime or nested `ToolRuntime.config`. */
|
|
@@ -25,11 +24,11 @@ export declare function resolveAmbientConfigurable(): Record<string, unknown> |
|
|
|
25
24
|
/**
|
|
26
25
|
* Build the frozen identity envelope for the current run from the trusted
|
|
27
26
|
* `langgraph_auth_user` the custom-auth handler produced. Returns
|
|
28
|
-
* `undefined` when the deployment has no resolvable
|
|
27
|
+
* `undefined` when the deployment has no resolvable user (identity is opt-in).
|
|
29
28
|
*
|
|
30
|
-
* LangGraph Studio injects a `StudioUser` (no `
|
|
29
|
+
* LangGraph Studio injects a `StudioUser` (no `mda_user_id`) when
|
|
31
30
|
* `x-auth-scheme: langsmith` is present; that maps to a service principal with
|
|
32
|
-
* `source.provider: "studio"` so
|
|
31
|
+
* `source.provider: "studio"` so user-scoped memory/credentials still resolve
|
|
33
32
|
* during local Studio runs.
|
|
34
33
|
*/
|
|
35
34
|
export declare function buildRuntimeIdentity(configurable: Record<string, unknown> | undefined): RuntimeIdentity | undefined;
|
|
@@ -51,18 +50,20 @@ export interface RuntimeConfigLike extends ConfigurableCarrier {
|
|
|
51
50
|
* hub-repo naming and the `@auth.on.store` boundary check so both agree on
|
|
52
51
|
* exactly which segments identify a namespace.
|
|
53
52
|
*/
|
|
54
|
-
export declare function memoryIdentitySegments(scope: MemoryScope,
|
|
53
|
+
export declare function memoryIdentitySegments(scope: MemoryScope, organizations: OrganizationRequirement, userId: string | undefined, organizationId: string | undefined): string[];
|
|
55
54
|
/**
|
|
56
|
-
* Dedicated Context Hub repo handle for
|
|
55
|
+
* Dedicated Context Hub repo handle for user/organization memory.
|
|
57
56
|
*
|
|
58
|
-
* LangSmith requires `^[a-z][a-z0-9-_]*$`.
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* -
|
|
57
|
+
* LangSmith requires `^[a-z][a-z0-9-_]*$`. The `--u--` / `--t--` separators are
|
|
58
|
+
* persisted repo names, so they stay as they are; only the vocabulary around
|
|
59
|
+
* them changed.
|
|
60
|
+
* - optional · user → `{deploy}--u--{user}`
|
|
61
|
+
* - required · user → `{deploy}--t--{organization}--u--{user}`
|
|
62
|
+
* - organization → `{deploy}--t--{organization}`
|
|
62
63
|
*
|
|
63
64
|
* Returns `null` for `agent` / `none` (those stay on the deployment repo).
|
|
64
65
|
*/
|
|
65
|
-
export declare function memoryHubRepoHandle(deployRepo: string, scope: MemoryScope,
|
|
66
|
+
export declare function memoryHubRepoHandle(deployRepo: string, scope: MemoryScope, organizations: OrganizationRequirement, userId: string | undefined, organizationId: string | undefined): string | null;
|
|
66
67
|
/**
|
|
67
68
|
* Make identity ids safe as Context Hub *repo handles*
|
|
68
69
|
* (`^[a-z][a-z0-9-_]*$` — LangSmith `pushAgent` requirement).
|
|
@@ -73,7 +74,7 @@ export declare function memoryHubRepoHandle(deployRepo: string, scope: MemorySco
|
|
|
73
74
|
export declare function sanitizeHubRepoSegment(segment: string): string;
|
|
74
75
|
/**
|
|
75
76
|
* Strip client-supplied identity keys from an incoming `configurable` so a
|
|
76
|
-
* request body can never spoof the
|
|
77
|
+
* request body can never spoof the user/organization the handler resolved. The
|
|
77
78
|
* platform-set `langgraph_auth_user` is preserved — it is the only trusted source.
|
|
78
79
|
*/
|
|
79
80
|
export declare function sanitizeConfigurable(configurable: Record<string, unknown> | undefined): Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-runtime.d.ts","sourceRoot":"","sources":["../../src/runtime/identity-runtime.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"identity-runtime.d.ts","sourceRoot":"","sources":["../../src/runtime/identity-runtime.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,uBAAuB,EACxB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAqCtD,qEAAqE;AACrE,wBAAgB,8BAA8B,CAC5C,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GACjD,IAAI,CAEN;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,iBAAiB,GAAG,SAAS,GACrC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAWrC;AAED,8EAA8E;AAC9E,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,iBAAiB,GAAG,SAAS,GACrC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAMrC;AAED,8DAA8D;AAC9D,wBAAgB,0BAA0B,IACtC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACvB,SAAS,CAcZ;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAChD,eAAe,GAAG,SAAS,CA8B7B;AAwBD;;;;;GAKG;AACH,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,MAAM,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;CACrD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,WAAW,EAClB,aAAa,EAAE,uBAAuB,EACtC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,cAAc,EAAE,MAAM,GAAG,SAAS,GACjC,MAAM,EAAE,CAgBV;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,WAAW,EAClB,aAAa,EAAE,uBAAuB,EACtC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,cAAc,EAAE,MAAM,GAAG,SAAS,GACjC,MAAM,GAAG,IAAI,CAsBf;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA0B9D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAChD,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASzB"}
|
|
@@ -7,13 +7,24 @@ import { trustedChannelSourceProviders } from "../channels/registry-store.js";
|
|
|
7
7
|
const RESERVED_CONFIGURABLE_KEYS = new Set([
|
|
8
8
|
"actor_id",
|
|
9
9
|
"tenant_id",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
10
|
+
"mda_user_id",
|
|
11
|
+
"mda_organization_id",
|
|
12
|
+
"mda_user_email",
|
|
13
13
|
"mda_claims",
|
|
14
|
-
"
|
|
14
|
+
"mda_user_kind",
|
|
15
15
|
"mda_source_provider",
|
|
16
16
|
"mda_source_thread_id",
|
|
17
|
+
/**
|
|
18
|
+
* Current spellings of the fields above. Reserved alongside the legacy names
|
|
19
|
+
* so the `actor` → `user` rename cannot open a spoofing path.
|
|
20
|
+
*/
|
|
21
|
+
"user_id",
|
|
22
|
+
"organization_id",
|
|
23
|
+
"mda_user_id",
|
|
24
|
+
"mda_organization_id",
|
|
25
|
+
"mda_groups",
|
|
26
|
+
"mda_user_type",
|
|
27
|
+
"mda_user_email",
|
|
17
28
|
/** Stamped by the managed channel runner; rebuilt into `runtime.channel`. */
|
|
18
29
|
"mda_channel_binding",
|
|
19
30
|
/** Stamped by compiled cron entries; never client-asserted. */
|
|
@@ -29,14 +40,13 @@ export function setAmbientConfigurableForTests(loader) {
|
|
|
29
40
|
* nested `ToolRuntime` shape LangChain passes to tools
|
|
30
41
|
* (`runtime.config.configurable`).
|
|
31
42
|
*
|
|
32
|
-
* When the caller only passes `{ state }` (
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* memory remounts.
|
|
43
|
+
* When the caller only passes `{ state }` (or omits auth), fall back to the
|
|
44
|
+
* ambient LangGraph runnable config so `langgraph_auth_user` still reaches
|
|
45
|
+
* user/organization memory remounts on `LazyPerRunContextBackend`.
|
|
36
46
|
*
|
|
37
47
|
* Also fall back when a runtime `config` is present but its `configurable` bag
|
|
38
48
|
* lacks `langgraph_auth_user` (empty or partial). Returning that bag would skip
|
|
39
|
-
* ambient and break first-turn
|
|
49
|
+
* ambient and break first-turn user memory remounts.
|
|
40
50
|
*/
|
|
41
51
|
export function resolveRuntimeConfigurable(runtime) {
|
|
42
52
|
const fromRuntime = configurableFromRuntime(runtime);
|
|
@@ -76,33 +86,37 @@ export function resolveAmbientConfigurable() {
|
|
|
76
86
|
/**
|
|
77
87
|
* Build the frozen identity envelope for the current run from the trusted
|
|
78
88
|
* `langgraph_auth_user` the custom-auth handler produced. Returns
|
|
79
|
-
* `undefined` when the deployment has no resolvable
|
|
89
|
+
* `undefined` when the deployment has no resolvable user (identity is opt-in).
|
|
80
90
|
*
|
|
81
|
-
* LangGraph Studio injects a `StudioUser` (no `
|
|
91
|
+
* LangGraph Studio injects a `StudioUser` (no `mda_user_id`) when
|
|
82
92
|
* `x-auth-scheme: langsmith` is present; that maps to a service principal with
|
|
83
|
-
* `source.provider: "studio"` so
|
|
93
|
+
* `source.provider: "studio"` so user-scoped memory/credentials still resolve
|
|
84
94
|
* during local Studio runs.
|
|
85
95
|
*/
|
|
86
96
|
export function buildRuntimeIdentity(configurable) {
|
|
87
97
|
const user = configurable?.langgraph_auth_user;
|
|
88
98
|
const studio = isStudioAuthUser(user);
|
|
89
|
-
const
|
|
90
|
-
if (!user || !
|
|
99
|
+
const userId = user?.mda_user_id ?? (studio ? user?.identity : undefined);
|
|
100
|
+
if (!user || !userId) {
|
|
91
101
|
return undefined;
|
|
92
102
|
}
|
|
103
|
+
const isService = studio || user.mda_user_kind === "service";
|
|
93
104
|
const identity = {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
id: String(
|
|
97
|
-
...(user.
|
|
105
|
+
user: {
|
|
106
|
+
kind: isService ? "service" : "person",
|
|
107
|
+
id: String(userId),
|
|
108
|
+
...(user.mda_user_email ? { email: String(user.mda_user_email) } : {}),
|
|
98
109
|
},
|
|
99
110
|
source: {
|
|
100
111
|
provider: studio ? "studio" : sourceProvider(configurable),
|
|
101
112
|
...(threadId(configurable) ? { threadId: threadId(configurable) } : {}),
|
|
102
113
|
},
|
|
103
114
|
};
|
|
104
|
-
if (user.
|
|
105
|
-
identity.
|
|
115
|
+
if (user.mda_organization_id) {
|
|
116
|
+
identity.organization = { id: String(user.mda_organization_id) };
|
|
117
|
+
}
|
|
118
|
+
if (Array.isArray(user.mda_groups) && user.mda_groups.length > 0) {
|
|
119
|
+
identity.groups = user.mda_groups.map(String);
|
|
106
120
|
}
|
|
107
121
|
if (user.mda_claims && typeof user.mda_claims === "object") {
|
|
108
122
|
identity.claims = user.mda_claims;
|
|
@@ -135,47 +149,49 @@ function deepFreeze(value) {
|
|
|
135
149
|
* hub-repo naming and the `@auth.on.store` boundary check so both agree on
|
|
136
150
|
* exactly which segments identify a namespace.
|
|
137
151
|
*/
|
|
138
|
-
export function memoryIdentitySegments(scope,
|
|
139
|
-
if (scope === "
|
|
152
|
+
export function memoryIdentitySegments(scope, organizations, userId, organizationId) {
|
|
153
|
+
if (scope === "user") {
|
|
140
154
|
const segments = [];
|
|
141
|
-
if (
|
|
142
|
-
segments.push(
|
|
155
|
+
if (organizations === "required" && organizationId) {
|
|
156
|
+
segments.push(organizationId);
|
|
143
157
|
}
|
|
144
|
-
if (
|
|
145
|
-
segments.push(
|
|
158
|
+
if (userId) {
|
|
159
|
+
segments.push(userId);
|
|
146
160
|
}
|
|
147
161
|
return segments;
|
|
148
162
|
}
|
|
149
|
-
if (scope === "
|
|
150
|
-
return
|
|
163
|
+
if (scope === "organization") {
|
|
164
|
+
return organizationId ? [organizationId] : [];
|
|
151
165
|
}
|
|
152
166
|
// "agent" (shared) | "none" (no memory) → no per-identity restriction.
|
|
153
167
|
return [];
|
|
154
168
|
}
|
|
155
169
|
/**
|
|
156
|
-
* Dedicated Context Hub repo handle for
|
|
170
|
+
* Dedicated Context Hub repo handle for user/organization memory.
|
|
157
171
|
*
|
|
158
|
-
* LangSmith requires `^[a-z][a-z0-9-_]*$`.
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* -
|
|
172
|
+
* LangSmith requires `^[a-z][a-z0-9-_]*$`. The `--u--` / `--t--` separators are
|
|
173
|
+
* persisted repo names, so they stay as they are; only the vocabulary around
|
|
174
|
+
* them changed.
|
|
175
|
+
* - optional · user → `{deploy}--u--{user}`
|
|
176
|
+
* - required · user → `{deploy}--t--{organization}--u--{user}`
|
|
177
|
+
* - organization → `{deploy}--t--{organization}`
|
|
162
178
|
*
|
|
163
179
|
* Returns `null` for `agent` / `none` (those stay on the deployment repo).
|
|
164
180
|
*/
|
|
165
|
-
export function memoryHubRepoHandle(deployRepo, scope,
|
|
181
|
+
export function memoryHubRepoHandle(deployRepo, scope, organizations, userId, organizationId) {
|
|
166
182
|
if (scope === "none" || scope === "agent") {
|
|
167
183
|
return null;
|
|
168
184
|
}
|
|
169
|
-
const segments = memoryIdentitySegments(scope,
|
|
185
|
+
const segments = memoryIdentitySegments(scope, organizations, userId, organizationId).map(sanitizeHubRepoSegment);
|
|
170
186
|
if (segments.length === 0) {
|
|
171
187
|
return null;
|
|
172
188
|
}
|
|
173
189
|
const base = sanitizeHubRepoSegment(deployRepo);
|
|
174
|
-
if (scope === "
|
|
190
|
+
if (scope === "organization") {
|
|
175
191
|
return `${base}--t--${segments[0]}`;
|
|
176
192
|
}
|
|
177
|
-
//
|
|
178
|
-
if (
|
|
193
|
+
// user
|
|
194
|
+
if (organizations === "required" && segments.length >= 2) {
|
|
179
195
|
return `${base}--t--${segments[0]}--u--${segments[1]}`;
|
|
180
196
|
}
|
|
181
197
|
return `${base}--u--${segments[0]}`;
|
|
@@ -218,7 +234,7 @@ export function sanitizeHubRepoSegment(segment) {
|
|
|
218
234
|
}
|
|
219
235
|
/**
|
|
220
236
|
* Strip client-supplied identity keys from an incoming `configurable` so a
|
|
221
|
-
* request body can never spoof the
|
|
237
|
+
* request body can never spoof the user/organization the handler resolved. The
|
|
222
238
|
* platform-set `langgraph_auth_user` is preserved — it is the only trusted source.
|
|
223
239
|
*/
|
|
224
240
|
export function sanitizeConfigurable(configurable) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-runtime.js","sourceRoot":"","sources":["../../src/runtime/identity-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAU9E;;;GAGG;AACH,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAC;IACzC,UAAU;IACV,WAAW;IACX,
|
|
1
|
+
{"version":3,"file":"identity-runtime.js","sourceRoot":"","sources":["../../src/runtime/identity-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAA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