managed-deepagents 0.10.5-dev.4 → 0.10.5-dev.6

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.
Files changed (35) hide show
  1. package/README.md +48 -19
  2. package/dist/connection-authorization.d.ts +1 -21
  3. package/dist/connection-authorization.d.ts.map +1 -1
  4. package/dist/connection-authorization.js +1 -30
  5. package/dist/connection-authorization.js.map +1 -1
  6. package/dist/connectors/mcp/index.d.ts +4 -10
  7. package/dist/connectors/mcp/index.d.ts.map +1 -1
  8. package/dist/connectors/mcp/index.js +61 -474
  9. package/dist/connectors/mcp/index.js.map +1 -1
  10. package/dist/connectors/mcp/schema.d.ts.map +1 -1
  11. package/dist/connectors/mcp/schema.js +37 -12
  12. package/dist/connectors/mcp/schema.js.map +1 -1
  13. package/dist/connectors/mcp/types.d.ts +10 -7
  14. package/dist/connectors/mcp/types.d.ts.map +1 -1
  15. package/dist/credential-gate.d.ts +14 -12
  16. package/dist/credential-gate.d.ts.map +1 -1
  17. package/dist/credential-gate.js +28 -171
  18. package/dist/credential-gate.js.map +1 -1
  19. package/dist/tool-gateway/auth.d.ts +50 -0
  20. package/dist/tool-gateway/auth.d.ts.map +1 -0
  21. package/dist/tool-gateway/auth.js +99 -0
  22. package/dist/tool-gateway/auth.js.map +1 -0
  23. package/dist/tool-gateway/cards.d.ts +19 -0
  24. package/dist/tool-gateway/cards.d.ts.map +1 -0
  25. package/dist/tool-gateway/cards.js +198 -0
  26. package/dist/tool-gateway/cards.js.map +1 -0
  27. package/dist/tool-gateway/connect-first.d.ts +21 -0
  28. package/dist/tool-gateway/connect-first.d.ts.map +1 -0
  29. package/dist/tool-gateway/connect-first.js +94 -0
  30. package/dist/tool-gateway/connect-first.js.map +1 -0
  31. package/package.json +7 -7
  32. package/dist/connectors/mcp/langsmith-url.d.ts +0 -5
  33. package/dist/connectors/mcp/langsmith-url.d.ts.map +0 -1
  34. package/dist/connectors/mcp/langsmith-url.js +0 -35
  35. package/dist/connectors/mcp/langsmith-url.js.map +0 -1
package/README.md CHANGED
@@ -1710,6 +1710,7 @@ export const mcp = defineMcp({
1710
1710
  exa: {
1711
1711
  transport: "http",
1712
1712
  url: "https://api.smith.langchain.com/v1/managed-tools/servers/exa/mcp",
1713
+ auth: "langsmith",
1713
1714
  },
1714
1715
  },
1715
1716
  });
@@ -1732,25 +1733,53 @@ from deployed Studio. OAuth completes on
1732
1733
  LangSmith’s platform callback URL. The local UI must show
1733
1734
  `credential_authorization_required` and resume after the user connects.
1734
1735
 
1735
- An agent-owned schedule has no person behind it, so LangSmith MCP servers act
1736
- as the agent there: requests send the deployment key without a user identity,
1737
- and LangSmith uses the credentials a workspace admin connected for the agent
1738
- environment. A server the agent has no credential for is skipped with a warning
1739
- and the run continues. User-owned connections are unavailable in these runs.
1740
-
1741
- When a LangSmith-managed OAuth MCP server needs authorization, the runtime
1742
- reports its connection URL; complete OAuth there, then retry the run. API-key
1743
- MCP servers require the caller to connect the key in LangSmith Tools before
1744
- invoking one of their tools.
1745
-
1746
- A LangSmith tool kit asks for every unconnected provider before the run starts.
1747
- Set `jitAuth: true` on `defineMcp` to ask on use instead: the kit's tools for
1748
- unconnected providers are still offered to the model. When the model calls
1749
- them, the run interrupts once per model step with the connect links for the
1750
- providers those calls need, then runs the calls after it resumes. If the run
1751
- resumes without a connection, or nobody can connect in this run (no signed-in
1752
- caller, or a scheduled run), those calls return a tool error and the run
1753
- continues.
1736
+ For a LangSmith Tool Gateway server or tool kit
1737
+ (`/v1/managed-tools/servers/{id}/mcp` or `/v1/managed-tools/kits/{id}/mcp`,
1738
+ optionally with `?mode=search`), set `auth: "langsmith"`:
1739
+
1740
+ ```ts
1741
+ export const mcp = defineMcp({
1742
+ servers: {
1743
+ kit: {
1744
+ transport: "http",
1745
+ url: "https://api.smith.langchain.com/v1/managed-tools/kits/<kit_id>/mcp",
1746
+ auth: "langsmith",
1747
+ },
1748
+ },
1749
+ });
1750
+ ```
1751
+
1752
+ The server otherwise works like any MCP server. The runtime adds the
1753
+ deployment's LangSmith API key and workspace, and names the run's person with
1754
+ `x-langsmith-identity`. An agent-owned schedule has no person, so it uses the
1755
+ credentials a workspace admin connected for the agent environment; a server
1756
+ the agent has no credential for is skipped with a warning and the run
1757
+ continues. Other runs with no person (channel events, senders who don't map
1758
+ to a user, callers outside a channel's conversation, deployments without
1759
+ `identity.ts`) get no Tool Gateway tools. Tool Gateway's refusals during a
1760
+ call (over a limit, an admin must connect) reach the model as tool errors. To
1761
+ use a profile's admin-connected accounts in every run instead, set
1762
+ `auth: { type: "langsmith", profile: "<profile_id>" }`; a profile needs a
1763
+ service key, so a personal access token used with `mda dev` cannot use one.
1764
+ A server with `auth` cannot also set `connection` or the headers that choose
1765
+ whose credentials Tool Gateway uses (`Authorization`, `X-Api-Key`,
1766
+ `X-Tenant-Id`, `X-LangSmith-Identity`, `X-LangSmith-Profile`), and its URL must
1767
+ be on the deployment's LangSmith API origin.
1768
+
1769
+ A Tool Gateway URL without `auth` still gets `auth: "langsmith"`, with a
1770
+ warning; that default will be removed.
1771
+
1772
+ A single server that needs a connection before it lists its tools shows the
1773
+ connect card before the run starts; one the person still has not connected
1774
+ after that card is skipped for the run.
1775
+
1776
+ During a tool call, Tool Gateway asks for input with standard MCP elicitation:
1777
+ a URL to connect an account, or a form with no fields to approve the call. MDA
1778
+ answers it as the MCP client and shows it with the cards Studio, Agent Builder
1779
+ and Slack already render: the connect card for a link, which finishes on its
1780
+ own once the person connects, and the approval card for an approval. The call
1781
+ then runs again. Parallel calls each show their own card. In a run with no
1782
+ person, these prompts become tool errors and the run continues.
1754
1783
 
1755
1784
  Deploy the project first, then provision its connections with
1756
1785
  `mda connections create`. Agent-owned opaque secrets are scoped to that
@@ -1,5 +1,4 @@
1
1
  /** Resolve user-owned connections or interrupt for authorization. */
2
- import { z } from "zod";
3
2
  import { type AgentAuth } from "./agent-auth.js";
4
3
  export interface PendingCredential {
5
4
  slug: string;
@@ -9,31 +8,12 @@ export interface PendingCredential {
9
8
  /** Optional display label (e.g. MCP server name). Slack prefers this over slug. */
10
9
  provider?: string;
11
10
  }
12
- export declare const pendingCredentialSchema: z.ZodType<PendingCredential>;
13
- /** Tool metadata key naming the credential a tool needs before its first call. */
14
- export declare const CONNECT_ON_USE_METADATA = "mda_connect_on_use";
15
- /** The {@link CONNECT_ON_USE_METADATA} value: the server and credential a tool needs. */
16
- export interface ConnectOnUse {
17
- server: string;
18
- credential: PendingCredential;
19
- }
20
- export declare const connectOnUseSchema: z.ZodType<ConnectOnUse>;
21
11
  /** Interrupt payload when the caller has not granted one or more connections. */
22
12
  export interface CredentialAuthorizationRequiredInterrupt {
23
13
  type: "credential_authorization_required";
24
14
  message: string;
25
15
  credentials: PendingCredential[];
26
16
  }
27
- /**
28
- * A tool call was refused until the caller connects its credentials.
29
- *
30
- * `credentials` is empty when the refusal carried no link to connect from.
31
- */
32
- export declare class ToolCredentialRequiredError extends Error {
33
- readonly provider: string;
34
- readonly credentials: PendingCredential[];
35
- constructor(provider: string, credentials: readonly PendingCredential[]);
36
- }
37
17
  /** The interrupt payload that asks the caller to connect `credentials`. */
38
18
  export declare function credentialAuthorizationInterrupt(credentials: readonly PendingCredential[], message?: string): CredentialAuthorizationRequiredInterrupt;
39
19
  interface UserConnectionGrant {
@@ -44,7 +24,7 @@ interface UserConnectionGrant {
44
24
  /**
45
25
  * Interrupt once with the given missing credentials, then throw.
46
26
  *
47
- * Shared by the credential gate (ordinary MCP connections) and LMT collectors so
27
+ * Shared by the credential gate and Tool Gateway connections so
48
28
  * every missing grant becomes one `credential_authorization_required`.
49
29
  */
50
30
  export declare function raiseCredentialAuthorizationRequired(credentials: readonly PendingCredential[], message?: string): never;
@@ -1 +1 @@
1
- {"version":3,"file":"connection-authorization.d.ts","sourceRoot":"","sources":["../src/connection-authorization.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAGrE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,KAAK,SAAS,E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CAAoC,CAClD,WAAW,EAAE,SAAS,iBAAiB,EAAE,EACzC,OAAO,SAAgC,GACtC,KAAK,CAQP;AAED,0EAA0E;AAC1E,wBAAsB,uCAAuC,CAC3D,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAK9B;AAED,iFAAiF;AACjF,wBAAsB,2BAA2B,CAC/C,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAS9B;AAgCD,wBAAsB,uBAAuB,CAC3C,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,mBAAmB,CAAC,CAa9B"}
1
+ {"version":3,"file":"connection-authorization.d.ts","sourceRoot":"","sources":["../src/connection-authorization.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAIrE,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,iFAAiF;AACjF,MAAM,WAAW,wCAAwC;IACvD,IAAI,EAAE,mCAAmC,CAAC;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,iBAAiB,EAAE,CAAC;CAClC;AAKD,2EAA2E;AAC3E,wBAAgB,gCAAgC,CAC9C,WAAW,EAAE,SAAS,iBAAiB,EAAE,EACzC,OAAO,SAAgC,GACtC,wCAAwC,CAM1C;AAED,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAClD,WAAW,EAAE,SAAS,iBAAiB,EAAE,EACzC,OAAO,SAAgC,GACtC,KAAK,CAQP;AAED,0EAA0E;AAC1E,wBAAsB,uCAAuC,CAC3D,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAK9B;AAED,iFAAiF;AACjF,wBAAsB,2BAA2B,CAC/C,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAS9B;AAgCD,wBAAsB,uBAAuB,CAC3C,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,mBAAmB,CAAC,CAa9B"}
@@ -1,36 +1,7 @@
1
1
  /** Resolve user-owned connections or interrupt for authorization. */
2
2
  import { interrupt } from "@langchain/langgraph";
3
- import { z } from "zod";
4
3
  import { CredentialAuthorizationRequiredError, CredentialStoreError, } from "./agent-auth.js";
5
- export const pendingCredentialSchema = z.object({
6
- slug: z.string(),
7
- kind: z.enum(["oauth2", "secret"]),
8
- connect_url: z.string().optional(),
9
- auth_id: z.string().optional(),
10
- provider: z.string().optional(),
11
- });
12
- /** Tool metadata key naming the credential a tool needs before its first call. */
13
- export const CONNECT_ON_USE_METADATA = "mda_connect_on_use";
14
- export const connectOnUseSchema = z.object({
15
- server: z.string(),
16
- credential: pendingCredentialSchema,
17
- });
18
4
  const DEFAULT_AUTHORIZATION_MESSAGE = "Connect the following integrations to continue.";
19
- /**
20
- * A tool call was refused until the caller connects its credentials.
21
- *
22
- * `credentials` is empty when the refusal carried no link to connect from.
23
- */
24
- export class ToolCredentialRequiredError extends Error {
25
- provider;
26
- credentials;
27
- constructor(provider, credentials) {
28
- super(`${provider} is not connected`);
29
- this.provider = provider;
30
- this.name = "ToolCredentialRequiredError";
31
- this.credentials = [...credentials];
32
- }
33
- }
34
5
  /** The interrupt payload that asks the caller to connect `credentials`. */
35
6
  export function credentialAuthorizationInterrupt(credentials, message = DEFAULT_AUTHORIZATION_MESSAGE) {
36
7
  return {
@@ -42,7 +13,7 @@ export function credentialAuthorizationInterrupt(credentials, message = DEFAULT_
42
13
  /**
43
14
  * Interrupt once with the given missing credentials, then throw.
44
15
  *
45
- * Shared by the credential gate (ordinary MCP connections) and LMT collectors so
16
+ * Shared by the credential gate and Tool Gateway connections so
46
17
  * every missing grant becomes one `credential_authorization_required`.
47
18
  */
48
19
  export function raiseCredentialAuthorizationRequired(credentials, message = DEFAULT_AUTHORIZATION_MESSAGE) {
@@ -1 +1 @@
1
- {"version":3,"file":"connection-authorization.js","sourceRoot":"","sources":["../src/connection-authorization.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAErE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAEL,oCAAoC,EACpC,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AAWzB,MAAM,CAAC,MAAM,uBAAuB,GAAiC,CAAC,CAAC,MAAM,CAAC;IAC5E,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAClC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAEH,kFAAkF;AAClF,MAAM,CAAC,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AAQ5D,MAAM,CAAC,MAA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{
30
30
  * transport: "http",
31
31
  * url: "https://api.smith.langchain.com/v1/managed-tools/servers/68a8938f-f90d-40a9-a1db-0c6263696e70/mcp",
32
+ * auth: "langsmith",
32
33
  * },
33
34
  * },
34
35
  * });
@@ -36,8 +37,6 @@
36
37
  */
37
38
  import type { DynamicStructuredTool } from "@langchain/core/tools";
38
39
  import { type AuthProvider, type HTTPConnection } from "@langchain/mcp-adapters";
39
- import { type AgentAuthContext } from "../../agent-auth.js";
40
- import { type PendingCredential } from "../../connection-authorization.js";
41
40
  import type { CredentialConsumer } from "../../credential-gate.js";
42
41
  import type { McpServerFields, McpServersConfig, McpServersDefinition } from "./types.js";
43
42
  export type * from "./types.js";
@@ -55,16 +54,11 @@ export declare function clearManagedMcpToolsCacheForTests(connectors?: McpServer
55
54
  * The credential gate's view of the declared MCP connectors.
56
55
  *
57
56
  * One consumer per declaration that names a user-owned connection or a
58
- * LangSmith-managed server. Both load after caller identity is available.
57
+ * server with LangSmith auth. User-connected servers need a person; servers
58
+ * with LangSmith auth load as the run's person, or as the agent in an
59
+ * agent-owned schedule.
59
60
  */
60
61
  export declare function mcpCredentialConsumers(connectors: readonly unknown[] | undefined): CredentialConsumer[];
61
- /**
62
- * Collect pending Managed Tools credentials without interrupting.
63
- *
64
- * Incomplete 428s still throw a clear Error. Used by the credential
65
- * gate so Managed Tools misses combine with ordinary connection misses.
66
- */
67
- export declare function collectPendingManagedToolsCredentials(connectors: McpServersDefinition, context: AgentAuthContext): Promise<PendingCredential[]>;
68
62
  /**
69
63
  * A declared server as MDA hands it to the adapter, with the `AuthProvider` it
70
64
  * attaches for a connection (which `RemoteMcpServerConfig` forbids authors to set).
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connectors/mcp/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;A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