managed-deepagents 0.4.2 → 0.4.3-dev.94
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 +78 -35
- 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 +7 -8
- package/dist/channels/index.d.ts.map +1 -1
- package/dist/channels/index.js +6 -5
- package/dist/channels/index.js.map +1 -1
- package/dist/channels/manifest.d.ts +7 -4
- package/dist/channels/manifest.d.ts.map +1 -1
- package/dist/channels/messaging-registry.d.ts +21 -0
- package/dist/channels/messaging-registry.d.ts.map +1 -0
- package/dist/channels/messaging-registry.js +50 -0
- package/dist/channels/messaging-registry.js.map +1 -0
- package/dist/channels/registry-types.d.ts +1 -1
- package/dist/channels/registry.d.ts +4 -3
- package/dist/channels/registry.d.ts.map +1 -1
- package/dist/channels/registry.js +5 -6
- 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 +3 -1
- package/dist/channels/schedule-delivery.js.map +1 -1
- package/dist/channels/slack/adapter.d.ts +1 -2
- package/dist/channels/slack/adapter.d.ts.map +1 -1
- package/dist/channels/slack/adapter.js +0 -2
- package/dist/channels/slack/adapter.js.map +1 -1
- package/dist/channels/slack/http.d.ts +7 -39
- package/dist/channels/slack/http.d.ts.map +1 -1
- package/dist/channels/slack/http.js +64 -122
- package/dist/channels/slack/http.js.map +1 -1
- package/dist/channels/slack/index.d.ts +94 -8
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +144 -6
- package/dist/channels/slack/index.js.map +1 -1
- package/dist/channels/slack/normalize.d.ts +6 -4
- package/dist/channels/slack/normalize.d.ts.map +1 -1
- package/dist/channels/slack/normalize.js +61 -28
- package/dist/channels/slack/normalize.js.map +1 -1
- package/dist/channels/slack/transport.d.ts.map +1 -1
- package/dist/channels/slack/transport.js +3 -2
- package/dist/channels/slack/transport.js.map +1 -1
- package/dist/channels/store.d.ts +14 -0
- package/dist/channels/store.d.ts.map +1 -1
- package/dist/channels/store.js +41 -27
- package/dist/channels/store.js.map +1 -1
- package/dist/connectors/marketplace/catalog.d.ts +96 -0
- package/dist/connectors/marketplace/catalog.d.ts.map +1 -0
- package/dist/connectors/marketplace/catalog.js +213 -0
- package/dist/connectors/marketplace/catalog.js.map +1 -0
- package/dist/connectors/marketplace/fleet-mcp.d.ts +62 -0
- package/dist/connectors/marketplace/fleet-mcp.d.ts.map +1 -0
- package/dist/connectors/marketplace/fleet-mcp.js +215 -0
- package/dist/connectors/marketplace/fleet-mcp.js.map +1 -0
- package/dist/connectors/marketplace/index.d.ts +31 -0
- package/dist/connectors/marketplace/index.d.ts.map +1 -0
- package/dist/connectors/marketplace/index.js +39 -0
- package/dist/connectors/marketplace/index.js.map +1 -0
- package/dist/connectors/marketplace/load.d.ts +14 -0
- package/dist/connectors/marketplace/load.d.ts.map +1 -0
- package/dist/connectors/marketplace/load.js +206 -0
- package/dist/connectors/marketplace/load.js.map +1 -0
- 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/connectors/slack/index.d.ts +24 -0
- package/dist/connectors/slack/index.d.ts.map +1 -0
- package/dist/connectors/slack/index.js +64 -0
- package/dist/connectors/slack/index.js.map +1 -0
- package/dist/connectors/tool-selection.d.ts +55 -0
- package/dist/connectors/tool-selection.d.ts.map +1 -0
- package/dist/connectors/tool-selection.js +112 -0
- package/dist/connectors/tool-selection.js.map +1 -0
- package/dist/connectors/toolserver/catalog.d.ts +326 -0
- package/dist/connectors/toolserver/catalog.d.ts.map +1 -0
- package/dist/connectors/toolserver/catalog.js +415 -0
- package/dist/connectors/toolserver/catalog.js.map +1 -0
- package/dist/connectors/toolserver/connectors.d.ts +698 -0
- package/dist/connectors/toolserver/connectors.d.ts.map +1 -0
- package/dist/connectors/toolserver/connectors.js +13 -0
- package/dist/connectors/toolserver/connectors.js.map +1 -0
- package/dist/connectors/toolserver/index.d.ts +142 -0
- package/dist/connectors/toolserver/index.d.ts.map +1 -0
- package/dist/connectors/toolserver/index.js +105 -0
- package/dist/connectors/toolserver/index.js.map +1 -0
- package/dist/connectors/toolserver/integrations.d.ts +103 -0
- package/dist/connectors/toolserver/integrations.d.ts.map +1 -0
- package/dist/connectors/toolserver/integrations.js +288 -0
- package/dist/connectors/toolserver/integrations.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 +289 -0
- package/dist/connectors/toolserver/load.js.map +1 -0
- package/dist/define-deep-agent.d.ts.map +1 -1
- package/dist/define-deep-agent.js +9 -3
- package/dist/define-deep-agent.js.map +1 -1
- package/dist/extension.d.ts +69 -0
- package/dist/extension.d.ts.map +1 -0
- package/dist/extension.js +108 -0
- package/dist/extension.js.map +1 -0
- package/dist/identity/actor-subject.d.ts +60 -0
- package/dist/identity/actor-subject.d.ts.map +1 -0
- package/dist/identity/actor-subject.js +107 -0
- package/dist/identity/actor-subject.js.map +1 -0
- package/dist/identity/byo-oauth.d.ts +105 -0
- package/dist/identity/byo-oauth.d.ts.map +1 -0
- package/dist/identity/byo-oauth.js +190 -0
- package/dist/identity/byo-oauth.js.map +1 -0
- package/dist/identity/claims.d.ts +16 -0
- package/dist/identity/claims.d.ts.map +1 -0
- package/dist/identity/claims.js +33 -0
- package/dist/identity/claims.js.map +1 -0
- package/dist/identity/connect-inference.d.ts +37 -0
- package/dist/identity/connect-inference.d.ts.map +1 -0
- package/dist/identity/connect-inference.js +53 -0
- package/dist/identity/connect-inference.js.map +1 -0
- package/dist/identity/connect-provider-types.d.ts +35 -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 +39 -13
- 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/define-fleet-connect.d.ts +53 -0
- package/dist/identity/define-fleet-connect.d.ts.map +1 -0
- package/dist/identity/define-fleet-connect.js +76 -0
- package/dist/identity/define-fleet-connect.js.map +1 -0
- package/dist/identity/fleet-connect-hint.d.ts +41 -0
- package/dist/identity/fleet-connect-hint.d.ts.map +1 -0
- package/dist/identity/fleet-connect-hint.js +190 -0
- package/dist/identity/fleet-connect-hint.js.map +1 -0
- package/dist/identity/fleet-connect.d.ts +93 -0
- package/dist/identity/fleet-connect.d.ts.map +1 -0
- package/dist/identity/fleet-connect.js +256 -0
- package/dist/identity/fleet-connect.js.map +1 -0
- package/dist/identity/fleet-integration-connect.d.ts +32 -0
- package/dist/identity/fleet-integration-connect.d.ts.map +1 -0
- package/dist/identity/fleet-integration-connect.js +35 -0
- package/dist/identity/fleet-integration-connect.js.map +1 -0
- package/dist/identity/fleet.d.ts +56 -0
- package/dist/identity/fleet.d.ts.map +1 -0
- package/dist/identity/fleet.js +131 -0
- package/dist/identity/fleet.js.map +1 -0
- package/dist/identity/github/connect-http.d.ts +8 -4
- package/dist/identity/github/connect-http.d.ts.map +1 -1
- package/dist/identity/github/connect-http.js +32 -15
- 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 +51 -49
- 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 +1 -4
- package/dist/identity/github/index.d.ts.map +1 -1
- package/dist/identity/github/index.js +0 -3
- package/dist/identity/github/index.js.map +1 -1
- package/dist/identity/github/oauth.d.ts +18 -20
- package/dist/identity/github/oauth.d.ts.map +1 -1
- package/dist/identity/github/oauth.js +90 -109
- package/dist/identity/github/oauth.js.map +1 -1
- package/dist/identity/google/connect-http.d.ts +37 -0
- package/dist/identity/google/connect-http.d.ts.map +1 -0
- package/dist/identity/google/connect-http.js +42 -0
- package/dist/identity/google/connect-http.js.map +1 -0
- package/dist/identity/google/index.d.ts +7 -0
- package/dist/identity/google/index.d.ts.map +1 -0
- package/dist/identity/google/index.js +6 -0
- package/dist/identity/google/index.js.map +1 -0
- package/dist/identity/google/oauth.d.ts +22 -0
- package/dist/identity/google/oauth.d.ts.map +1 -0
- package/dist/identity/google/oauth.js +48 -0
- package/dist/identity/google/oauth.js.map +1 -0
- package/dist/identity/index.d.ts +40 -64
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +104 -243
- package/dist/identity/index.js.map +1 -1
- package/dist/identity/linkedin/connect-http.d.ts +37 -0
- package/dist/identity/linkedin/connect-http.d.ts.map +1 -0
- package/dist/identity/linkedin/connect-http.js +41 -0
- package/dist/identity/linkedin/connect-http.js.map +1 -0
- package/dist/identity/linkedin/index.d.ts +7 -0
- package/dist/identity/linkedin/index.d.ts.map +1 -0
- package/dist/identity/linkedin/index.js +6 -0
- package/dist/identity/linkedin/index.js.map +1 -0
- package/dist/identity/linkedin/oauth.d.ts +22 -0
- package/dist/identity/linkedin/oauth.d.ts.map +1 -0
- package/dist/identity/linkedin/oauth.js +47 -0
- package/dist/identity/linkedin/oauth.js.map +1 -0
- 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/marketplace/connect-hint.d.ts +31 -0
- package/dist/identity/marketplace/connect-hint.d.ts.map +1 -0
- package/dist/identity/marketplace/connect-hint.js +59 -0
- package/dist/identity/marketplace/connect-hint.js.map +1 -0
- package/dist/identity/marketplace/connect.d.ts +51 -0
- package/dist/identity/marketplace/connect.d.ts.map +1 -0
- package/dist/identity/marketplace/connect.js +88 -0
- package/dist/identity/marketplace/connect.js.map +1 -0
- package/dist/identity/marketplace/index.d.ts +9 -0
- package/dist/identity/marketplace/index.d.ts.map +1 -0
- package/dist/identity/marketplace/index.js +9 -0
- package/dist/identity/marketplace/index.js.map +1 -0
- package/dist/identity/microsoft/connect-http.d.ts +38 -0
- package/dist/identity/microsoft/connect-http.d.ts.map +1 -0
- package/dist/identity/microsoft/connect-http.js +42 -0
- package/dist/identity/microsoft/connect-http.js.map +1 -0
- package/dist/identity/microsoft/index.d.ts +7 -0
- package/dist/identity/microsoft/index.d.ts.map +1 -0
- package/dist/identity/microsoft/index.js +6 -0
- package/dist/identity/microsoft/index.js.map +1 -0
- package/dist/identity/microsoft/oauth.d.ts +24 -0
- package/dist/identity/microsoft/oauth.d.ts.map +1 -0
- package/dist/identity/microsoft/oauth.js +65 -0
- package/dist/identity/microsoft/oauth.js.map +1 -0
- package/dist/identity/oauth-env.d.ts +43 -0
- package/dist/identity/oauth-env.d.ts.map +1 -0
- package/dist/identity/oauth-env.js +66 -0
- package/dist/identity/oauth-env.js.map +1 -0
- package/dist/identity/oauth-tickets.d.ts +37 -0
- package/dist/identity/oauth-tickets.d.ts.map +1 -0
- package/dist/identity/oauth-tickets.js +114 -0
- package/dist/identity/oauth-tickets.js.map +1 -0
- package/dist/identity/options.d.ts +35 -0
- package/dist/identity/options.d.ts.map +1 -0
- package/dist/identity/options.js +80 -0
- package/dist/identity/options.js.map +1 -0
- package/dist/identity/slack/connect-http.d.ts +6 -4
- package/dist/identity/slack/connect-http.d.ts.map +1 -1
- package/dist/identity/slack/connect-http.js +27 -17
- 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 +18 -17
- package/dist/identity/slack/links.d.ts.map +1 -1
- package/dist/identity/slack/links.js +64 -61
- package/dist/identity/slack/links.js.map +1 -1
- package/dist/identity/slack/oauth.d.ts +3 -35
- package/dist/identity/slack/oauth.d.ts.map +1 -1
- package/dist/identity/slack/oauth.js +9 -115
- 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 +91 -54
- package/dist/identity/types.d.ts.map +1 -1
- package/dist/identity/x/connect-http.d.ts +38 -0
- package/dist/identity/x/connect-http.d.ts.map +1 -0
- package/dist/identity/x/connect-http.js +41 -0
- package/dist/identity/x/connect-http.js.map +1 -0
- package/dist/identity/x/index.d.ts +6 -0
- package/dist/identity/x/index.d.ts.map +1 -0
- package/dist/identity/x/index.js +5 -0
- package/dist/identity/x/index.js.map +1 -0
- package/dist/index.d.ts +9 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -11
- package/dist/index.js.map +1 -1
- package/dist/ingress/index.d.ts +52 -0
- package/dist/ingress/index.d.ts.map +1 -0
- package/dist/ingress/index.js +127 -0
- package/dist/ingress/index.js.map +1 -0
- package/dist/memory/define-memory.d.ts +39 -0
- package/dist/memory/define-memory.d.ts.map +1 -0
- package/dist/memory/define-memory.js +78 -0
- package/dist/memory/define-memory.js.map +1 -0
- package/dist/memory/index.d.ts +9 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +8 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/instructions-middleware.d.ts +74 -0
- package/dist/memory/instructions-middleware.d.ts.map +1 -0
- package/dist/memory/instructions-middleware.js +115 -0
- package/dist/memory/instructions-middleware.js.map +1 -0
- package/dist/memory/slices.d.ts +21 -0
- package/dist/memory/slices.d.ts.map +1 -0
- package/dist/memory/slices.js +61 -0
- package/dist/memory/slices.js.map +1 -0
- package/dist/memory/types.d.ts +71 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/memory/types.js +10 -0
- package/dist/memory/types.js.map +1 -0
- package/dist/namespaces.d.ts +262 -0
- package/dist/namespaces.d.ts.map +1 -0
- package/dist/namespaces.js +101 -0
- package/dist/namespaces.js.map +1 -0
- package/dist/runtime/auth.d.ts +43 -32
- package/dist/runtime/auth.d.ts.map +1 -1
- package/dist/runtime/auth.js +225 -125
- 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/backend.js +26 -5
- package/dist/runtime/backend.js.map +1 -1
- package/dist/runtime/channel.d.ts +91 -0
- package/dist/runtime/channel.d.ts.map +1 -0
- package/dist/runtime/channel.js +98 -0
- package/dist/runtime/channel.js.map +1 -0
- package/dist/runtime/connector.d.ts +66 -23
- package/dist/runtime/connector.d.ts.map +1 -1
- package/dist/runtime/connector.js +67 -27
- package/dist/runtime/connector.js.map +1 -1
- package/dist/runtime/cors.d.ts +12 -3
- package/dist/runtime/cors.d.ts.map +1 -1
- package/dist/runtime/cors.js +23 -5
- package/dist/runtime/cors.js.map +1 -1
- package/dist/runtime/credentials.d.ts +8 -8
- package/dist/runtime/credentials.d.ts.map +1 -1
- package/dist/runtime/credentials.js +46 -23
- package/dist/runtime/credentials.js.map +1 -1
- package/dist/runtime/http.d.ts +46 -0
- package/dist/runtime/http.d.ts.map +1 -0
- package/dist/runtime/http.js +53 -0
- package/dist/runtime/http.js.map +1 -0
- package/dist/runtime/identity-http.d.ts +13 -20
- package/dist/runtime/identity-http.d.ts.map +1 -1
- package/dist/runtime/identity-http.js +158 -75
- package/dist/runtime/identity-http.js.map +1 -1
- package/dist/runtime/identity-runtime.d.ts +12 -28
- package/dist/runtime/identity-runtime.d.ts.map +1 -1
- package/dist/runtime/identity-runtime.js +35 -72
- package/dist/runtime/identity-runtime.js.map +1 -1
- package/dist/runtime/index.d.ts +89 -225
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +92 -61
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/memory/index.d.ts +0 -2
- package/dist/runtime/memory/index.d.ts.map +1 -1
- package/dist/runtime/memory/index.js +0 -2
- package/dist/runtime/memory/index.js.map +1 -1
- package/dist/runtime/memory/mounts.d.ts +4 -12
- package/dist/runtime/memory/mounts.d.ts.map +1 -1
- package/dist/runtime/memory/mounts.js +9 -20
- package/dist/runtime/memory/mounts.js.map +1 -1
- package/dist/runtime/recursion-limit.d.ts +22 -0
- package/dist/runtime/recursion-limit.d.ts.map +1 -0
- package/dist/runtime/recursion-limit.js +46 -0
- package/dist/runtime/recursion-limit.js.map +1 -0
- package/dist/runtime/sandbox-manager.d.ts +60 -3
- package/dist/runtime/sandbox-manager.d.ts.map +1 -1
- package/dist/runtime/sandbox-manager.js +326 -26
- package/dist/runtime/sandbox-manager.js.map +1 -1
- package/dist/runtime/sandbox-stream-retry.d.ts +18 -0
- package/dist/runtime/sandbox-stream-retry.d.ts.map +1 -0
- package/dist/runtime/sandbox-stream-retry.js +90 -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 +16 -2
- package/dist/runtime/setup-script.js.map +1 -1
- package/dist/runtime/types.d.ts +16 -0
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/validated-token.d.ts +9 -14
- package/dist/runtime/validated-token.d.ts.map +1 -1
- package/dist/runtime/validated-token.js +79 -106
- package/dist/runtime/validated-token.js.map +1 -1
- package/dist/sandbox.d.ts +17 -42
- package/dist/sandbox.d.ts.map +1 -1
- package/dist/sandbox.js +11 -32
- package/dist/sandbox.js.map +1 -1
- package/dist/schedules.js +8 -9
- package/dist/schedules.js.map +1 -1
- package/dist/types.d.ts +4 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +22 -29
- 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 +0 -198
- 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 +0 -25
- package/dist/channels/github/http.d.ts.map +0 -1
- package/dist/channels/github/http.js +0 -147
- 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 +0 -32
- package/dist/channels/github/normalize.d.ts.map +0 -1
- package/dist/channels/github/normalize.js +0 -152
- package/dist/channels/github/normalize.js.map +0 -1
- package/dist/channels/github/source-thread.d.ts +0 -24
- package/dist/channels/github/source-thread.d.ts.map +0 -1
- package/dist/channels/github/source-thread.js +0 -54
- package/dist/channels/github/source-thread.js.map +0 -1
- package/dist/channels/github/transport.d.ts +0 -19
- package/dist/channels/github/transport.d.ts.map +0 -1
- package/dist/channels/github/transport.js +0 -92
- 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/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/connectors/github/index.d.ts +0 -78
- package/dist/connectors/github/index.d.ts.map +0 -1
- package/dist/connectors/github/index.js +0 -106
- package/dist/connectors/github/index.js.map +0 -1
- package/dist/connectors/github/sandbox.d.ts +0 -54
- package/dist/connectors/github/sandbox.d.ts.map +0 -1
- package/dist/connectors/github/sandbox.js +0 -515
- package/dist/connectors/github/sandbox.js.map +0 -1
- package/dist/connectors/langsmith/index.d.ts +0 -385
- package/dist/connectors/langsmith/index.d.ts.map +0 -1
- package/dist/connectors/langsmith/index.js +0 -431
- package/dist/connectors/langsmith/index.js.map +0 -1
- package/dist/connectors/langsmith/routes.d.ts +0 -247
- package/dist/connectors/langsmith/routes.d.ts.map +0 -1
- package/dist/connectors/langsmith/routes.js +0 -1182
- package/dist/connectors/langsmith/routes.js.map +0 -1
- package/dist/runtime/memory/seed.d.ts +0 -21
- package/dist/runtime/memory/seed.d.ts.map +0 -1
- package/dist/runtime/memory/seed.js +0 -160
- package/dist/runtime/memory/seed.js.map +0 -1
- package/dist/runtime/memory/user-repo.d.ts +0 -19
- package/dist/runtime/memory/user-repo.d.ts.map +0 -1
- package/dist/runtime/memory/user-repo.js +0 -57
- package/dist/runtime/memory/user-repo.js.map +0 -1
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
2
|
import { cors } from "hono/cors";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { bodyLimit } from "hono/body-limit";
|
|
4
|
+
import { registerChannelMessaging, registerConnectorMessaging, } from "../channels/messaging-registry.js";
|
|
5
5
|
import { mountIdentityConnectProviders } from "../identity/connect-provider.js";
|
|
6
|
+
import { enableActorSubjectIntegrationsFromConnectors } from "../identity/actor-subject.js";
|
|
7
|
+
import { FLEET_OAUTH_INTEGRATIONS, scopesForIntegrationConnectorKinds, } from "../connectors/toolserver/integrations.js";
|
|
8
|
+
import { createFleetVaultConnectProvider } from "../identity/fleet-connect.js";
|
|
9
|
+
import { githubIdentityConnectProvider } from "../identity/github/connect-http.js";
|
|
10
|
+
import { createGoogleIdentityConnectProvider } from "../identity/google/connect-http.js";
|
|
11
|
+
import { createLinkedInIdentityConnectProvider } from "../identity/linkedin/connect-http.js";
|
|
12
|
+
import { createMicrosoftIdentityConnectProvider } from "../identity/microsoft/connect-http.js";
|
|
13
|
+
import { marketplaceIdentityConnectProviders } from "../identity/marketplace/index.js";
|
|
14
|
+
import { slackIdentityConnectProvider } from "../identity/slack/connect-http.js";
|
|
15
|
+
import { resolveOauthRedirectBase } from "../identity/oauth-env.js";
|
|
16
|
+
import { createXIdentityConnectProvider } from "../identity/x/connect-http.js";
|
|
6
17
|
import { resolveRequestIdentity } from "./auth.js";
|
|
18
|
+
import { requirementsFromChannels } from "./channel.js";
|
|
19
|
+
import { requirementsFromConnectors } from "./connector.js";
|
|
7
20
|
import { isManagedCorsPath, matchCorsOrigin, MDA_CORS_ALLOW_HEADERS, MDA_CORS_ALLOW_METHODS, resolveCorsAllowlist, } from "./cors.js";
|
|
8
|
-
|
|
21
|
+
const CHANNEL_EVENTS_MAX_BODY_BYTES = 1024 * 1024;
|
|
9
22
|
/** Signals a secured route was reached but no identity is declared to resolve it. */
|
|
10
23
|
class IdentityNotConfiguredError extends Error {
|
|
11
24
|
status = 401;
|
|
@@ -17,42 +30,110 @@ class IdentityNotConfiguredError extends Error {
|
|
|
17
30
|
/**
|
|
18
31
|
* Build the single managed HTTP app mounted via `langgraph.json` `http.app`.
|
|
19
32
|
*
|
|
20
|
-
* It layers
|
|
21
|
-
* - **
|
|
22
|
-
*
|
|
23
|
-
* - **connectors** — each connector
|
|
24
|
-
*
|
|
33
|
+
* It layers onto the built-in LangGraph routes:
|
|
34
|
+
* - **channels** — each channel mounts public Events at `/channels/{name}/events`
|
|
35
|
+
* and may register outbound messaging;
|
|
36
|
+
* - **connectors** — each connector gets a sub-router namespaced under
|
|
37
|
+
* `/connectors/{name}`; `events` mounts connector Events (e.g. GitHub);
|
|
38
|
+
* `http` mounts additional secured/public routes.
|
|
25
39
|
*
|
|
26
40
|
* Connector routes are **secure by default**: MDA resolves and enforces the
|
|
27
41
|
* caller's identity before the handler runs, and a route must opt out of
|
|
28
|
-
* authentication explicitly (`router.public.*`). The
|
|
42
|
+
* authentication explicitly (`router.public.*`). The managed HTTP surface is
|
|
29
43
|
* logged at construction so the (especially unauthenticated) routes are never
|
|
30
44
|
* invisible.
|
|
31
45
|
*/
|
|
32
46
|
export function buildManagedHttpApp(inputs) {
|
|
33
47
|
const app = new Hono();
|
|
34
48
|
mountManagedCors(app);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
49
|
+
const channels = inputs.channels ?? [];
|
|
50
|
+
const connectors = inputs.connectors ?? [];
|
|
51
|
+
registerChannelMessaging(channels);
|
|
52
|
+
registerConnectorMessaging(connectors);
|
|
38
53
|
const mounted = [];
|
|
39
|
-
for (const
|
|
54
|
+
for (const channel of channels) {
|
|
55
|
+
const name = channel.name ?? channel.kind;
|
|
56
|
+
if (!name) {
|
|
57
|
+
throw new Error(`Channel kind "${channel.kind}" has no file-stem name; ` +
|
|
58
|
+
"pass channels through collectChannels before mounting.");
|
|
59
|
+
}
|
|
60
|
+
if (typeof channel.events === "function") {
|
|
61
|
+
mountChannelEvents(app, channel, name, mounted);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
for (const connector of connectors) {
|
|
65
|
+
// Prefer the file-stem name from collectConnectors; fall back to kind for
|
|
66
|
+
// hand-built connectors in unit tests.
|
|
67
|
+
const name = connector.name ?? connector.kind;
|
|
68
|
+
if (!name) {
|
|
69
|
+
throw new Error(`Connector kind "${connector.kind}" has no file-stem name; ` +
|
|
70
|
+
"pass connectors through collectConnectors before mounting.");
|
|
71
|
+
}
|
|
40
72
|
if (typeof connector.http === "function") {
|
|
41
|
-
mountConnectorRoutes(app, connector, inputs.identity?.config, mounted);
|
|
73
|
+
mountConnectorRoutes(app, connector, name, inputs.identity?.config, mounted);
|
|
74
|
+
}
|
|
75
|
+
if (typeof connector.events === "function") {
|
|
76
|
+
mountConnectorEvents(app, connector, name, mounted);
|
|
42
77
|
}
|
|
43
78
|
}
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
|
|
79
|
+
const connectorKinds = connectors.map((connector) => connector.kind ?? connector.name ?? "");
|
|
80
|
+
enableActorSubjectIntegrationsFromConnectors(connectorKinds, inputs.identity?.config?.scope);
|
|
81
|
+
// Connect-with-X is gated for this release — do not call
|
|
82
|
+
// `mountIdentityConnectProviders` / `builtinIdentityConnectCandidates`.
|
|
83
|
+
// Re-enable with identity config, connectorKinds, and
|
|
84
|
+
// `requirementsFromChannels` / `requirementsFromConnectors` results.
|
|
85
|
+
// Keep the helpers referenced so re-enable stays a local edit.
|
|
86
|
+
const _gatedConnectMount = {
|
|
87
|
+
mountIdentityConnectProviders,
|
|
88
|
+
builtinIdentityConnectCandidates,
|
|
89
|
+
requirementsFromChannels,
|
|
90
|
+
requirementsFromConnectors,
|
|
91
|
+
connectorKinds,
|
|
92
|
+
channels,
|
|
93
|
+
connectors,
|
|
94
|
+
};
|
|
95
|
+
if (_gatedConnectMount.connectorKinds.length < 0) {
|
|
96
|
+
throw new Error("unreachable");
|
|
52
97
|
}
|
|
53
98
|
logConnectorSurface(mounted);
|
|
54
99
|
return app;
|
|
55
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Built-in connect providers offered to every identity-enabled deployment. Each
|
|
103
|
+
* one mounts only when its own predicate says the declaration implies it.
|
|
104
|
+
*
|
|
105
|
+
* Fleet vault integrations are constructed with scopes unioned from declared
|
|
106
|
+
* connectors. Google, Microsoft, and LinkedIn keep their BYO OAuth adapters via
|
|
107
|
+
* their integration factories; X uses Fleet auth-sessions only (Host PKCE).
|
|
108
|
+
*/
|
|
109
|
+
function builtinIdentityConnectCandidates(connectorKinds) {
|
|
110
|
+
const fleetProviders = FLEET_OAUTH_INTEGRATIONS.map((integration) => {
|
|
111
|
+
const scopes = scopesForIntegrationConnectorKinds(integration, connectorKinds);
|
|
112
|
+
if (integration.id === "google") {
|
|
113
|
+
return createGoogleIdentityConnectProvider(scopes.length > 0 ? { scopes } : {});
|
|
114
|
+
}
|
|
115
|
+
if (integration.id === "microsoft") {
|
|
116
|
+
return createMicrosoftIdentityConnectProvider(scopes.length > 0 ? { scopes } : {});
|
|
117
|
+
}
|
|
118
|
+
if (integration.id === "linkedin") {
|
|
119
|
+
return createLinkedInIdentityConnectProvider(scopes.length > 0 ? { scopes } : {});
|
|
120
|
+
}
|
|
121
|
+
if (integration.id === "x") {
|
|
122
|
+
return createXIdentityConnectProvider(scopes.length > 0 ? { scopes } : {});
|
|
123
|
+
}
|
|
124
|
+
return createFleetVaultConnectProvider({
|
|
125
|
+
integration,
|
|
126
|
+
...(scopes.length > 0 ? { scopes } : {}),
|
|
127
|
+
resolveRedirectBase: resolveOauthRedirectBase,
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
return [
|
|
131
|
+
githubIdentityConnectProvider,
|
|
132
|
+
...fleetProviders,
|
|
133
|
+
...marketplaceIdentityConnectProviders,
|
|
134
|
+
slackIdentityConnectProvider,
|
|
135
|
+
];
|
|
136
|
+
}
|
|
56
137
|
/**
|
|
57
138
|
* CORS for managed routes only.
|
|
58
139
|
*
|
|
@@ -78,68 +159,71 @@ function mountManagedCors(app) {
|
|
|
78
159
|
return middleware(c, next);
|
|
79
160
|
});
|
|
80
161
|
}
|
|
81
|
-
/**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
162
|
+
/**
|
|
163
|
+
* Mount the conventional public Events route for a channel.
|
|
164
|
+
*
|
|
165
|
+
* Ingress authenticates inside the handler (Slack signatures, …) — these routes
|
|
166
|
+
* stay public at the LangGraph auth layer.
|
|
167
|
+
*/
|
|
168
|
+
function mountChannelEvents(app, channel, name, mounted) {
|
|
169
|
+
const path = `/channels/${name}/events`;
|
|
170
|
+
mounted.push({
|
|
171
|
+
connector: `channel:${name}`,
|
|
172
|
+
method: "post",
|
|
173
|
+
path,
|
|
174
|
+
secured: false,
|
|
175
|
+
absolute: true,
|
|
176
|
+
});
|
|
177
|
+
app.post(path, bodyLimit({
|
|
178
|
+
maxSize: CHANNEL_EVENTS_MAX_BODY_BYTES,
|
|
179
|
+
onError: (c) => c.text("Payload Too Large", 413),
|
|
180
|
+
}), async (c) => {
|
|
181
|
+
const rawBody = await c.req.text();
|
|
182
|
+
return channel.events({
|
|
183
|
+
name,
|
|
184
|
+
request: c.req.raw,
|
|
185
|
+
rawBody,
|
|
186
|
+
channel,
|
|
187
|
+
});
|
|
94
188
|
});
|
|
95
189
|
}
|
|
96
190
|
/**
|
|
97
|
-
* Mount public Events
|
|
191
|
+
* Mount the conventional public Events route for a connector (e.g. GitHub).
|
|
98
192
|
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
193
|
+
* Ingress authenticates inside the handler (GitHub HMAC, …) — these routes stay
|
|
194
|
+
* public at the LangGraph auth layer.
|
|
101
195
|
*/
|
|
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
|
-
});
|
|
196
|
+
function mountConnectorEvents(app, connector, name, mounted) {
|
|
197
|
+
const path = `/connectors/${name}/events`;
|
|
198
|
+
mounted.push({
|
|
199
|
+
connector: name,
|
|
200
|
+
method: "post",
|
|
201
|
+
path,
|
|
202
|
+
secured: false,
|
|
203
|
+
absolute: true,
|
|
204
|
+
});
|
|
205
|
+
app.post(path, async (c) => {
|
|
206
|
+
const rawBody = await c.req.text();
|
|
207
|
+
return connector.events({
|
|
208
|
+
name,
|
|
209
|
+
request: c.req.raw,
|
|
210
|
+
rawBody,
|
|
211
|
+
connector,
|
|
128
212
|
});
|
|
129
|
-
}
|
|
213
|
+
});
|
|
130
214
|
}
|
|
131
215
|
/**
|
|
132
216
|
* Mount a connector's `http` routes on a sub-router namespaced under
|
|
133
|
-
* `/connectors/{
|
|
217
|
+
* `/connectors/{name}`, so connector routes cannot collide with identity/API
|
|
134
218
|
* routes or with each other.
|
|
135
219
|
*
|
|
136
220
|
* The connector's `http` hook must mount synchronously. Async hooks are rejected
|
|
137
221
|
* because LangGraph captures custom routes when the module is imported — a
|
|
138
222
|
* deferred mount leaves those paths as platform 404s.
|
|
139
223
|
*/
|
|
140
|
-
function mountConnectorRoutes(app, connector, cfg, mounted) {
|
|
224
|
+
function mountConnectorRoutes(app, connector, name, cfg, mounted) {
|
|
141
225
|
const sub = new Hono();
|
|
142
|
-
const router = honoConnectorRouter(sub,
|
|
226
|
+
const router = honoConnectorRouter(sub, name, cfg, mounted);
|
|
143
227
|
const ctx = {
|
|
144
228
|
router,
|
|
145
229
|
identity: cfg,
|
|
@@ -154,19 +238,19 @@ function mountConnectorRoutes(app, connector, cfg, mounted) {
|
|
|
154
238
|
const result = connector.http?.(ctx);
|
|
155
239
|
if (result != null &&
|
|
156
240
|
typeof result.then === "function") {
|
|
157
|
-
throw new Error(`Connector "${
|
|
241
|
+
throw new Error(`Connector "${name}" http() returned a Promise. HTTP hooks must ` +
|
|
158
242
|
`mount routes synchronously so LangGraph can capture them at import time.`);
|
|
159
243
|
}
|
|
160
|
-
app.route(`/connectors/${
|
|
244
|
+
app.route(`/connectors/${name}`, sub);
|
|
161
245
|
}
|
|
162
246
|
/**
|
|
163
247
|
* Build the secure-by-default {@link HttpSubRouter} over a Hono sub-app. Secured
|
|
164
248
|
* routes resolve identity (401 on failure) before the handler runs; `public.*`
|
|
165
249
|
* routes skip enforcement. Every registration is recorded in `mounted`.
|
|
166
250
|
*/
|
|
167
|
-
function honoConnectorRouter(sub,
|
|
251
|
+
function honoConnectorRouter(sub, name, cfg, mounted) {
|
|
168
252
|
const secured = (method) => (path, handler) => {
|
|
169
|
-
mounted.push({ connector:
|
|
253
|
+
mounted.push({ connector: name, method, path, secured: true });
|
|
170
254
|
sub[method](path, async (c) => {
|
|
171
255
|
const request = c.req.raw;
|
|
172
256
|
if (!cfg) {
|
|
@@ -183,7 +267,7 @@ function honoConnectorRouter(sub, kind, cfg, mounted) {
|
|
|
183
267
|
});
|
|
184
268
|
};
|
|
185
269
|
const publicRoute = (method) => (path, handler) => {
|
|
186
|
-
mounted.push({ connector:
|
|
270
|
+
mounted.push({ connector: name, method, path, secured: false });
|
|
187
271
|
sub[method](path, (c) => handler(c.req.raw));
|
|
188
272
|
};
|
|
189
273
|
return {
|
|
@@ -221,8 +305,7 @@ function logConnectorSurface(mounted) {
|
|
|
221
305
|
}
|
|
222
306
|
console.info(`[mda] managed HTTP surface (${mounted.length} route(s)):`);
|
|
223
307
|
for (const route of mounted) {
|
|
224
|
-
const full = route.connector.startsWith("
|
|
225
|
-
route.connector.startsWith("identity:")
|
|
308
|
+
const full = route.absolute || route.connector.startsWith("identity:")
|
|
226
309
|
? route.path
|
|
227
310
|
: `/connectors/${route.connector}${route.path}`;
|
|
228
311
|
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;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EACL,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAEhF,OAAO,EAAE,4CAA4C,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EACL,wBAAwB,EACxB,kCAAkC,GACnC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,mCAAmC,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAAE,qCAAqC,EAAE,MAAM,sCAAsC,CAAC;AAC7F,OAAO,EAAE,sCAAsC,EAAE,MAAM,uCAAuC,CAAC;AAC/F,OAAO,EAAE,mCAAmC,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,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../channels/types.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { RuntimeIdentity } 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 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;
|
|
@@ -46,23 +45,6 @@ export interface RuntimeConfigLike extends ConfigurableCarrier {
|
|
|
46
45
|
configurable?: Record<string, unknown>;
|
|
47
46
|
};
|
|
48
47
|
}
|
|
49
|
-
/**
|
|
50
|
-
* The identity portion of the memory namespace (no deployment prefix), shared by
|
|
51
|
-
* hub-repo naming and the `@auth.on.store` boundary check so both agree on
|
|
52
|
-
* exactly which segments identify a namespace.
|
|
53
|
-
*/
|
|
54
|
-
export declare function memoryIdentitySegments(scope: MemoryScope, tenancy: Tenancy, actorId: string | undefined, tenantId: string | undefined): string[];
|
|
55
|
-
/**
|
|
56
|
-
* Dedicated Context Hub repo handle for actor/tenant memory.
|
|
57
|
-
*
|
|
58
|
-
* LangSmith requires `^[a-z][a-z0-9-_]*$`. Naming:
|
|
59
|
-
* - single · actor → `{deploy}--u--{actor}`
|
|
60
|
-
* - multi · actor → `{deploy}--t--{tenant}--u--{actor}`
|
|
61
|
-
* - tenant → `{deploy}--t--{tenant}`
|
|
62
|
-
*
|
|
63
|
-
* Returns `null` for `agent` / `none` (those stay on the deployment repo).
|
|
64
|
-
*/
|
|
65
|
-
export declare function memoryHubRepoHandle(deployRepo: string, scope: MemoryScope, tenancy: Tenancy, actorId: string | undefined, tenantId: string | undefined): string | null;
|
|
66
48
|
/**
|
|
67
49
|
* Make identity ids safe as Context Hub *repo handles*
|
|
68
50
|
* (`^[a-z][a-z0-9-_]*$` — LangSmith `pushAgent` requirement).
|
|
@@ -73,8 +55,10 @@ export declare function memoryHubRepoHandle(deployRepo: string, scope: MemorySco
|
|
|
73
55
|
export declare function sanitizeHubRepoSegment(segment: string): string;
|
|
74
56
|
/**
|
|
75
57
|
* Strip client-supplied identity keys from an incoming `configurable` so a
|
|
76
|
-
* request body can never spoof the
|
|
77
|
-
*
|
|
58
|
+
* request body can never spoof the user the handler resolved. The platform-set
|
|
59
|
+
* `langgraph_auth_user` is preserved — it is the only trusted source. Retired
|
|
60
|
+
* organization/tenant keys stay reserved so they cannot be reintroduced as
|
|
61
|
+
* spoofable fields.
|
|
78
62
|
*/
|
|
79
63
|
export declare function sanitizeConfigurable(configurable: Record<string, unknown> | undefined): Record<string, unknown>;
|
|
80
64
|
//# sourceMappingURL=identity-runtime.d.ts.map
|
|
@@ -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,
|
|
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,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,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,CA2B7B;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;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA0B9D;AAED;;;;;;GAMG;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 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,34 @@ 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 (Array.isArray(user.mda_groups) && user.mda_groups.length > 0) {
|
|
116
|
+
identity.groups = user.mda_groups.map(String);
|
|
106
117
|
}
|
|
107
118
|
if (user.mda_claims && typeof user.mda_claims === "object") {
|
|
108
119
|
identity.claims = user.mda_claims;
|
|
@@ -130,56 +141,6 @@ function deepFreeze(value) {
|
|
|
130
141
|
}
|
|
131
142
|
return value;
|
|
132
143
|
}
|
|
133
|
-
/**
|
|
134
|
-
* The identity portion of the memory namespace (no deployment prefix), shared by
|
|
135
|
-
* hub-repo naming and the `@auth.on.store` boundary check so both agree on
|
|
136
|
-
* exactly which segments identify a namespace.
|
|
137
|
-
*/
|
|
138
|
-
export function memoryIdentitySegments(scope, tenancy, actorId, tenantId) {
|
|
139
|
-
if (scope === "actor") {
|
|
140
|
-
const segments = [];
|
|
141
|
-
if (tenancy === "multi" && tenantId) {
|
|
142
|
-
segments.push(tenantId);
|
|
143
|
-
}
|
|
144
|
-
if (actorId) {
|
|
145
|
-
segments.push(actorId);
|
|
146
|
-
}
|
|
147
|
-
return segments;
|
|
148
|
-
}
|
|
149
|
-
if (scope === "tenant") {
|
|
150
|
-
return tenantId ? [tenantId] : [];
|
|
151
|
-
}
|
|
152
|
-
// "agent" (shared) | "none" (no memory) → no per-identity restriction.
|
|
153
|
-
return [];
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Dedicated Context Hub repo handle for actor/tenant memory.
|
|
157
|
-
*
|
|
158
|
-
* LangSmith requires `^[a-z][a-z0-9-_]*$`. Naming:
|
|
159
|
-
* - single · actor → `{deploy}--u--{actor}`
|
|
160
|
-
* - multi · actor → `{deploy}--t--{tenant}--u--{actor}`
|
|
161
|
-
* - tenant → `{deploy}--t--{tenant}`
|
|
162
|
-
*
|
|
163
|
-
* Returns `null` for `agent` / `none` (those stay on the deployment repo).
|
|
164
|
-
*/
|
|
165
|
-
export function memoryHubRepoHandle(deployRepo, scope, tenancy, actorId, tenantId) {
|
|
166
|
-
if (scope === "none" || scope === "agent") {
|
|
167
|
-
return null;
|
|
168
|
-
}
|
|
169
|
-
const segments = memoryIdentitySegments(scope, tenancy, actorId, tenantId).map(sanitizeHubRepoSegment);
|
|
170
|
-
if (segments.length === 0) {
|
|
171
|
-
return null;
|
|
172
|
-
}
|
|
173
|
-
const base = sanitizeHubRepoSegment(deployRepo);
|
|
174
|
-
if (scope === "tenant") {
|
|
175
|
-
return `${base}--t--${segments[0]}`;
|
|
176
|
-
}
|
|
177
|
-
// actor
|
|
178
|
-
if (tenancy === "multi" && segments.length >= 2) {
|
|
179
|
-
return `${base}--t--${segments[0]}--u--${segments[1]}`;
|
|
180
|
-
}
|
|
181
|
-
return `${base}--u--${segments[0]}`;
|
|
182
|
-
}
|
|
183
144
|
/**
|
|
184
145
|
* Make identity ids safe as Context Hub *repo handles*
|
|
185
146
|
* (`^[a-z][a-z0-9-_]*$` — LangSmith `pushAgent` requirement).
|
|
@@ -218,8 +179,10 @@ export function sanitizeHubRepoSegment(segment) {
|
|
|
218
179
|
}
|
|
219
180
|
/**
|
|
220
181
|
* Strip client-supplied identity keys from an incoming `configurable` so a
|
|
221
|
-
* request body can never spoof the
|
|
222
|
-
*
|
|
182
|
+
* request body can never spoof the user the handler resolved. The platform-set
|
|
183
|
+
* `langgraph_auth_user` is preserved — it is the only trusted source. Retired
|
|
184
|
+
* organization/tenant keys stay reserved so they cannot be reintroduced as
|
|
185
|
+
* spoofable fields.
|
|
223
186
|
*/
|
|
224
187
|
export function sanitizeConfigurable(configurable) {
|
|
225
188
|
if (!configurable) {
|