managed-deepagents 0.6.2-dev.5 → 0.6.2-dev.51
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 +25 -9
- package/dist/agent-auth.d.ts +129 -0
- package/dist/agent-auth.d.ts.map +1 -0
- package/dist/agent-auth.js +393 -0
- package/dist/agent-auth.js.map +1 -0
- package/dist/channels/manifest.d.ts +4 -0
- package/dist/channels/manifest.d.ts.map +1 -1
- package/dist/channels/schedule-delivery.d.ts +2 -0
- package/dist/channels/schedule-delivery.d.ts.map +1 -1
- package/dist/channels/schedule-delivery.js +40 -4
- package/dist/channels/schedule-delivery.js.map +1 -1
- package/dist/channels/trigger/client.d.ts +1 -0
- package/dist/channels/trigger/client.d.ts.map +1 -1
- package/dist/channels/trigger/client.js +19 -8
- package/dist/channels/trigger/client.js.map +1 -1
- package/dist/channels/trigger/http.js +1 -1
- package/dist/channels/trigger/http.js.map +1 -1
- package/dist/channels/trigger/types.d.ts +1 -1
- package/dist/channels/trigger/types.d.ts.map +1 -1
- package/dist/connections.d.ts +74 -0
- package/dist/connections.d.ts.map +1 -0
- package/dist/connections.js +280 -0
- package/dist/connections.js.map +1 -0
- package/dist/connectors/mcp/index.d.ts +36 -95
- package/dist/connectors/mcp/index.d.ts.map +1 -1
- package/dist/connectors/mcp/index.js +266 -57
- package/dist/connectors/mcp/index.js.map +1 -1
- package/dist/connectors/mcp/schema.d.ts +17 -0
- package/dist/connectors/mcp/schema.d.ts.map +1 -0
- package/dist/connectors/mcp/schema.js +122 -0
- package/dist/connectors/mcp/schema.js.map +1 -0
- package/dist/connectors/mcp/types.d.ts +81 -0
- package/dist/connectors/mcp/types.d.ts.map +1 -0
- package/dist/connectors/mcp/types.js +2 -0
- package/dist/connectors/mcp/types.js.map +1 -0
- package/dist/connectors/tool-selection.d.ts +10 -19
- package/dist/connectors/tool-selection.d.ts.map +1 -1
- package/dist/connectors/tool-selection.js +33 -59
- package/dist/connectors/tool-selection.js.map +1 -1
- package/dist/credential-gate.d.ts +40 -0
- package/dist/credential-gate.d.ts.map +1 -0
- package/dist/credential-gate.js +227 -0
- package/dist/credential-gate.js.map +1 -0
- package/dist/extension.d.ts +3 -3
- package/dist/extension.js +2 -2
- package/dist/identity/index.d.ts +1 -1
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js.map +1 -1
- package/dist/identity/types.d.ts +79 -5
- package/dist/identity/types.d.ts.map +1 -1
- package/dist/index.d.ts +9 -34
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -6
- package/dist/index.js.map +1 -1
- package/dist/namespaces.d.ts +12 -29
- package/dist/namespaces.d.ts.map +1 -1
- package/dist/namespaces.js +26 -9
- package/dist/namespaces.js.map +1 -1
- package/dist/runtime/auth.d.ts +31 -4
- package/dist/runtime/auth.d.ts.map +1 -1
- package/dist/runtime/auth.js +58 -3
- package/dist/runtime/auth.js.map +1 -1
- package/dist/runtime/http.d.ts +1 -1
- package/dist/runtime/http.d.ts.map +1 -1
- package/dist/runtime/http.js.map +1 -1
- package/dist/runtime/identity-runtime.d.ts +65 -5
- package/dist/runtime/identity-runtime.d.ts.map +1 -1
- package/dist/runtime/identity-runtime.js +148 -0
- package/dist/runtime/identity-runtime.js.map +1 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +13 -8
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/managed-middleware.d.ts +2 -2
- package/dist/runtime/managed-middleware.js +6 -6
- package/dist/runtime/managed-tools.d.ts +19 -15
- package/dist/runtime/managed-tools.d.ts.map +1 -1
- package/dist/runtime/managed-tools.js +14 -13
- package/dist/runtime/managed-tools.js.map +1 -1
- package/dist/runtime/types.d.ts +2 -2
- package/package.json +8 -8
- package/dist/connectors/mcp/load.d.ts +0 -12
- package/dist/connectors/mcp/load.d.ts.map +0 -1
- package/dist/connectors/mcp/load.js +0 -122
- package/dist/connectors/mcp/load.js.map +0 -1
package/README.md
CHANGED
|
@@ -167,7 +167,7 @@ my-agent/
|
|
|
167
167
|
middleware/ # optional middleware
|
|
168
168
|
skills/ # optional skills synced to Context Hub
|
|
169
169
|
sandbox/ # LangSmith sandbox (`mda init` includes this; delete to opt out)
|
|
170
|
-
|
|
170
|
+
mcp.ts # optional MCP server declaration
|
|
171
171
|
```
|
|
172
172
|
|
|
173
173
|
The CLI copies your project files into the managed build and generates the entry
|
|
@@ -241,27 +241,43 @@ export const sandbox = defineSandbox({
|
|
|
241
241
|
Put `GHCR_TOKEN` in the project `.env` or process environment. Its value is
|
|
242
242
|
used only to reconcile the registry and never enters the build or snapshot.
|
|
243
243
|
|
|
244
|
-
## MCP
|
|
244
|
+
## MCP Servers
|
|
245
245
|
|
|
246
|
-
Add `
|
|
247
|
-
|
|
248
|
-
server.
|
|
249
|
-
|
|
246
|
+
Add root `mcp.ts` to attach MCP servers. The file must export a named `mcp`.
|
|
247
|
+
By default, MDA exposes every tool loaded from each declared
|
|
248
|
+
server. In `mda dev`, an agent-owned connection reads from
|
|
249
|
+
`MDA_DEV_<SLUG>` with the slug uppercased and hyphens changed to underscores.
|
|
250
|
+
Hosted deployments resolve workspace connections from Agent Auth:
|
|
251
|
+
|
|
252
|
+
The old `connectors/mcp.ts` file API remains available with a warning during
|
|
253
|
+
`0.7.x`. It will be removed in `0.8.0`.
|
|
250
254
|
|
|
251
255
|
```ts
|
|
252
|
-
import {
|
|
256
|
+
import { defineMCP, connections } from "managed-deepagents";
|
|
253
257
|
|
|
254
|
-
export const
|
|
255
|
-
|
|
258
|
+
export const mcp = defineMCP({
|
|
259
|
+
servers: {
|
|
256
260
|
langchainDocs: {
|
|
257
261
|
transport: "http",
|
|
258
262
|
url: "https://docs.langchain.com/mcp",
|
|
259
263
|
includeTools: ["search", "fetch"],
|
|
264
|
+
connection: connections.get("docs-token", { type: "agent" }),
|
|
260
265
|
},
|
|
261
266
|
},
|
|
262
267
|
});
|
|
263
268
|
```
|
|
264
269
|
|
|
270
|
+
For this example, set `MDA_DEV_DOCS_TOKEN`.
|
|
271
|
+
|
|
272
|
+
A user-owned connection — `connections.get(slug, { type: "user" })` — resolves
|
|
273
|
+
per caller via OAuth. The pre-run credential gate interrupts the run
|
|
274
|
+
when a grant is missing. `mda dev` has no deployment to hold user grants, so
|
|
275
|
+
a user-owned connection fails there with an actionable error; deploy the agent
|
|
276
|
+
to exercise one.
|
|
277
|
+
|
|
278
|
+
Provision workspace connections with `mda connections create` before deploy.
|
|
279
|
+
`mda connections check` verifies manifest slugs exist in the workspace.
|
|
280
|
+
|
|
265
281
|
Use `includeTools` or `excludeTools` inside a server config to select a subset.
|
|
266
282
|
Tool names are raw MCP tool names before the managed `{server}__` prefix is
|
|
267
283
|
applied, so `includeTools: ["search"]` on server `langchainDocs` exposes
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Auth client used by `credentials.get` and the pre-run credential gate.
|
|
3
|
+
*
|
|
4
|
+
* Talks to the shipped Agent Auth APIs (credentials + oauth-authorization-sessions),
|
|
5
|
+
* not the aspirational `credentials/mint` endpoint.
|
|
6
|
+
*/
|
|
7
|
+
export declare const AGENT_AUTH_TIMEOUT_MS = 10000;
|
|
8
|
+
export declare const AGENT_AUTH_PROVIDER_PAGE_SIZE = 100;
|
|
9
|
+
export declare const AGENT_AUTH_MAX_PROVIDER_PAGES = 20;
|
|
10
|
+
export interface AgentAuthHttpConfig {
|
|
11
|
+
apiKey?: string;
|
|
12
|
+
workspaceId?: string;
|
|
13
|
+
/** Agent Builder service JWT. Required to list/read workspace-owned credentials. */
|
|
14
|
+
serviceKey?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Query string for listing credentials filtered by owner and kind. */
|
|
17
|
+
export declare function agentAuthCredentialQuery(options: {
|
|
18
|
+
ownerType: string;
|
|
19
|
+
ownerId: string;
|
|
20
|
+
kind: string;
|
|
21
|
+
pageSize?: number;
|
|
22
|
+
cursor?: string;
|
|
23
|
+
}): string;
|
|
24
|
+
export declare function agentAuthHeaders(config: AgentAuthHttpConfig): Record<string, string>;
|
|
25
|
+
/** One Agent Auth HTTP call: no redirects, bounded timeout, JSON body. */
|
|
26
|
+
export declare function requestAgentAuthJson(options: {
|
|
27
|
+
url: string;
|
|
28
|
+
init?: Omit<RequestInit, "headers" | "signal">;
|
|
29
|
+
config: AgentAuthHttpConfig;
|
|
30
|
+
timeoutMs: number;
|
|
31
|
+
fetchImpl: typeof fetch;
|
|
32
|
+
}): Promise<{
|
|
33
|
+
ok: boolean;
|
|
34
|
+
status: number;
|
|
35
|
+
body: Record<string, unknown>;
|
|
36
|
+
}>;
|
|
37
|
+
export interface AgentAuthContext {
|
|
38
|
+
baseUrl: string;
|
|
39
|
+
/** Deployment id, passed to oauth-authorization-sessions as `agent_id`. */
|
|
40
|
+
agentId: string;
|
|
41
|
+
/** Authenticated caller, used as `owner_id` for user credentials. */
|
|
42
|
+
principalId: string;
|
|
43
|
+
apiKey?: string;
|
|
44
|
+
workspaceId?: string;
|
|
45
|
+
/** Agent Builder service JWT for workspace-owned credential material. */
|
|
46
|
+
serviceKey?: string;
|
|
47
|
+
}
|
|
48
|
+
/** One credential slug the caller has not granted, with its connect URL. */
|
|
49
|
+
export interface PendingAuthorization {
|
|
50
|
+
slug: string;
|
|
51
|
+
connectUrl: string;
|
|
52
|
+
authId: string;
|
|
53
|
+
}
|
|
54
|
+
export declare class CredentialAuthorizationRequiredError extends Error {
|
|
55
|
+
readonly slugs: readonly string[];
|
|
56
|
+
readonly name = "CredentialAuthorizationRequiredError";
|
|
57
|
+
constructor(slugs: readonly string[]);
|
|
58
|
+
}
|
|
59
|
+
export declare class AgentAuthUnknownProviderError extends Error {
|
|
60
|
+
readonly slug: string;
|
|
61
|
+
readonly name = "AgentAuthUnknownProviderError";
|
|
62
|
+
constructor(slug: string);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Agent Auth could not answer. Callers pass a fixed message: a response body
|
|
66
|
+
* can quote secret material, so it never reaches this error.
|
|
67
|
+
*/
|
|
68
|
+
export declare class CredentialStoreError extends Error {
|
|
69
|
+
readonly status?: number | undefined;
|
|
70
|
+
readonly name: string;
|
|
71
|
+
constructor(message: string, status?: number | undefined);
|
|
72
|
+
}
|
|
73
|
+
export interface WorkspaceConnection {
|
|
74
|
+
connectionId: string;
|
|
75
|
+
kind: string;
|
|
76
|
+
ownerPolicy: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Bound Agent Auth HTTP client. One instance per caller/run; headers, origin,
|
|
80
|
+
* and the request timeout stay on the instance rather than each call site.
|
|
81
|
+
*/
|
|
82
|
+
export declare class AgentAuth {
|
|
83
|
+
#private;
|
|
84
|
+
readonly context: AgentAuthContext;
|
|
85
|
+
constructor(context: AgentAuthContext, fetchImpl?: typeof fetch, timeoutMs?: number);
|
|
86
|
+
/** List workspace connections and return the row for `slug`, if any. */
|
|
87
|
+
findWorkspaceConnection(slug: string): Promise<WorkspaceConnection | undefined>;
|
|
88
|
+
/** Workspace credential id for an agent-owned opaque secret grant. */
|
|
89
|
+
findWorkspaceCredentialId(slug: string): Promise<string | undefined>;
|
|
90
|
+
/**
|
|
91
|
+
* Resolve the credential id for a secret connection row.
|
|
92
|
+
*
|
|
93
|
+
* With an Agent Builder service key, prefer GET-for-owner / workspace list.
|
|
94
|
+
* Personal API keys may only list agent-owned credentials.
|
|
95
|
+
*/
|
|
96
|
+
findSecretCredentialId(connection: WorkspaceConnection, slug: string): Promise<string | undefined>;
|
|
97
|
+
/** Read a caller-owned opaque secret grant for a workspace connection slug. */
|
|
98
|
+
readUserSecret(slug: string): Promise<string | undefined>;
|
|
99
|
+
/** Read an OAuth access token stored on a workspace connection row. */
|
|
100
|
+
readConnectionAccessToken(connectionId: string): Promise<string | undefined>;
|
|
101
|
+
/**
|
|
102
|
+
* Read the caller's OAuth access token for a slug without starting a session.
|
|
103
|
+
*
|
|
104
|
+
* Reads never mint, so a caller can be probed repeatedly — on every replay of
|
|
105
|
+
* an interrupted node, for instance — without leaving authorization sessions
|
|
106
|
+
* behind.
|
|
107
|
+
*
|
|
108
|
+
* @returns The access token, or `undefined` when the caller must connect.
|
|
109
|
+
*/
|
|
110
|
+
readUserAccessToken(slug: string): Promise<string | undefined>;
|
|
111
|
+
/**
|
|
112
|
+
* Start an OAuth authorization session for a slug the caller has not granted.
|
|
113
|
+
*
|
|
114
|
+
* @returns The pending session, including the user-facing connect URL.
|
|
115
|
+
*/
|
|
116
|
+
startAuthorizationSession(slug: string): Promise<PendingAuthorization>;
|
|
117
|
+
/** oauth-providers has no slug filter, so the match is made across pages. */
|
|
118
|
+
resolveOAuthProviderId(slug: string): Promise<string>;
|
|
119
|
+
/** The credential key is `credential_id`, never `id`. */
|
|
120
|
+
findCredentialId(options: {
|
|
121
|
+
ownerType: string;
|
|
122
|
+
ownerId: string;
|
|
123
|
+
kind: string;
|
|
124
|
+
slug: string;
|
|
125
|
+
}): Promise<string | undefined>;
|
|
126
|
+
/** @returns The secret, or `undefined` when Agent Auth has no value (404). */
|
|
127
|
+
readSecret(credentialId: string): Promise<string | undefined>;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=agent-auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-auth.d.ts","sourceRoot":"","sources":["../src/agent-auth.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAC5C,eAAO,MAAM,6BAA6B,MAAM,CAAC;AACjD,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oFAAoF;IACpF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,uEAAuE;AACvE,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB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B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CASnE;IAED;;;;OAIG;IACG,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAqC3E;IAED,6EAA6E;IACvE,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAoC1D;IAED,yDAAyD;IACnD,gBAAgB,CAAC,OAAO,EAAE;QAC9B,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAuC9B;IAED,8EAA8E;IACxE,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAalE;CAqCF"}
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Auth client used by `credentials.get` and the pre-run credential gate.
|
|
3
|
+
*
|
|
4
|
+
* Talks to the shipped Agent Auth APIs (credentials + oauth-authorization-sessions),
|
|
5
|
+
* not the aspirational `credentials/mint` endpoint.
|
|
6
|
+
*/
|
|
7
|
+
import { fetchWithTimeout } from "./runtime/http.js";
|
|
8
|
+
export const AGENT_AUTH_TIMEOUT_MS = 10_000;
|
|
9
|
+
export const AGENT_AUTH_PROVIDER_PAGE_SIZE = 100;
|
|
10
|
+
export const AGENT_AUTH_MAX_PROVIDER_PAGES = 20;
|
|
11
|
+
/** Query string for listing credentials filtered by owner and kind. */
|
|
12
|
+
export function agentAuthCredentialQuery(options) {
|
|
13
|
+
const params = new URLSearchParams({
|
|
14
|
+
owner_type: options.ownerType,
|
|
15
|
+
owner_id: options.ownerId,
|
|
16
|
+
kind: options.kind,
|
|
17
|
+
});
|
|
18
|
+
if (options.pageSize !== undefined) {
|
|
19
|
+
params.set("page_size", String(options.pageSize));
|
|
20
|
+
}
|
|
21
|
+
if (options.cursor) {
|
|
22
|
+
params.set("cursor", options.cursor);
|
|
23
|
+
}
|
|
24
|
+
return params.toString();
|
|
25
|
+
}
|
|
26
|
+
export function agentAuthHeaders(config) {
|
|
27
|
+
const headers = {
|
|
28
|
+
accept: "application/json",
|
|
29
|
+
"content-type": "application/json",
|
|
30
|
+
"x-langsmith-product": "mda",
|
|
31
|
+
};
|
|
32
|
+
const serviceKey = config.serviceKey?.trim();
|
|
33
|
+
if (serviceKey) {
|
|
34
|
+
headers["x-service-key"] = serviceKey;
|
|
35
|
+
}
|
|
36
|
+
const apiKey = config.apiKey?.trim();
|
|
37
|
+
if (apiKey) {
|
|
38
|
+
headers["x-api-key"] = apiKey;
|
|
39
|
+
}
|
|
40
|
+
const workspaceId = config.workspaceId?.trim();
|
|
41
|
+
if (workspaceId) {
|
|
42
|
+
headers["x-tenant-id"] = workspaceId;
|
|
43
|
+
}
|
|
44
|
+
return headers;
|
|
45
|
+
}
|
|
46
|
+
/** One Agent Auth HTTP call: no redirects, bounded timeout, JSON body. */
|
|
47
|
+
export async function requestAgentAuthJson(options) {
|
|
48
|
+
const response = await fetchWithTimeout(options.url, {
|
|
49
|
+
...options.init,
|
|
50
|
+
redirect: "error",
|
|
51
|
+
headers: agentAuthHeaders(options.config),
|
|
52
|
+
}, options.timeoutMs, options.fetchImpl);
|
|
53
|
+
const decoded = await response.json().catch(() => ({}));
|
|
54
|
+
return {
|
|
55
|
+
ok: response.ok,
|
|
56
|
+
status: response.status,
|
|
57
|
+
body: decoded && typeof decoded === "object"
|
|
58
|
+
? decoded
|
|
59
|
+
: {},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export class CredentialAuthorizationRequiredError extends Error {
|
|
63
|
+
slugs;
|
|
64
|
+
name = "CredentialAuthorizationRequiredError";
|
|
65
|
+
constructor(slugs) {
|
|
66
|
+
super(`the caller has not connected: ${slugs.join(", ")}. ` +
|
|
67
|
+
"Declare the credential on a connector so the pre-run gate can request it.");
|
|
68
|
+
this.slugs = slugs;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
export class AgentAuthUnknownProviderError extends Error {
|
|
72
|
+
slug;
|
|
73
|
+
name = "AgentAuthUnknownProviderError";
|
|
74
|
+
constructor(slug) {
|
|
75
|
+
super(`Agent Auth has no OAuth provider registered for slug "${slug}". ` +
|
|
76
|
+
"Register the provider or fix the credential slug.");
|
|
77
|
+
this.slug = slug;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Agent Auth could not answer. Callers pass a fixed message: a response body
|
|
82
|
+
* can quote secret material, so it never reaches this error.
|
|
83
|
+
*/
|
|
84
|
+
export class CredentialStoreError extends Error {
|
|
85
|
+
status;
|
|
86
|
+
name = "CredentialStoreError";
|
|
87
|
+
constructor(message, status) {
|
|
88
|
+
super(status === undefined ? message : `${message} (status ${status})`);
|
|
89
|
+
this.status = status;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Bound Agent Auth HTTP client. One instance per caller/run; headers, origin,
|
|
94
|
+
* and the request timeout stay on the instance rather than each call site.
|
|
95
|
+
*/
|
|
96
|
+
export class AgentAuth {
|
|
97
|
+
context;
|
|
98
|
+
#fetchImpl;
|
|
99
|
+
#timeoutMs;
|
|
100
|
+
constructor(context, fetchImpl = fetch, timeoutMs = AGENT_AUTH_TIMEOUT_MS) {
|
|
101
|
+
this.context = context;
|
|
102
|
+
this.#fetchImpl = fetchImpl;
|
|
103
|
+
this.#timeoutMs = timeoutMs;
|
|
104
|
+
}
|
|
105
|
+
/** List workspace connections and return the row for `slug`, if any. */
|
|
106
|
+
async findWorkspaceConnection(slug) {
|
|
107
|
+
if (!this.context.workspaceId?.trim()) {
|
|
108
|
+
throw new CredentialStoreError("connections are not configured: LANGSMITH_WORKSPACE_ID is not set");
|
|
109
|
+
}
|
|
110
|
+
let cursor;
|
|
111
|
+
for (let page = 0; page < AGENT_AUTH_MAX_PROVIDER_PAGES; page += 1) {
|
|
112
|
+
const params = new URLSearchParams({
|
|
113
|
+
page_size: String(AGENT_AUTH_PROVIDER_PAGE_SIZE),
|
|
114
|
+
});
|
|
115
|
+
if (cursor) {
|
|
116
|
+
params.set("cursor", cursor);
|
|
117
|
+
}
|
|
118
|
+
const { ok, status, body } = await this.#request(`/v1/agent-auth/connections?${params.toString()}`, { method: "GET" });
|
|
119
|
+
if (!ok) {
|
|
120
|
+
throw new CredentialStoreError("Agent Auth list connections failed", status);
|
|
121
|
+
}
|
|
122
|
+
const items = Array.isArray(body.items) ? body.items : [];
|
|
123
|
+
const match = items.find((item) => !!item &&
|
|
124
|
+
typeof item === "object" &&
|
|
125
|
+
String(item.slug) === slug);
|
|
126
|
+
if (match) {
|
|
127
|
+
const connectionId = String(match.id ?? match.connection_id ?? match.credential_id ?? "");
|
|
128
|
+
const kind = connectionCredentialKind(match);
|
|
129
|
+
const ownerPolicy = typeof match.owner_policy === "string" ? match.owner_policy : "";
|
|
130
|
+
if (!connectionId || !kind) {
|
|
131
|
+
throw new CredentialStoreError("Agent Auth connection row missing id or kind");
|
|
132
|
+
}
|
|
133
|
+
return { connectionId, kind, ownerPolicy };
|
|
134
|
+
}
|
|
135
|
+
const next = body.next_cursor;
|
|
136
|
+
if (typeof next !== "string" || !next || next === cursor) {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
cursor = next;
|
|
140
|
+
}
|
|
141
|
+
throw new CredentialStoreError("Agent Auth connection list returned too many pages");
|
|
142
|
+
}
|
|
143
|
+
/** Workspace credential id for an agent-owned opaque secret grant. */
|
|
144
|
+
async findWorkspaceCredentialId(slug) {
|
|
145
|
+
const connection = await this.findWorkspaceConnection(slug);
|
|
146
|
+
if (!connection) {
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
return await this.findSecretCredentialId(connection, slug);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Resolve the credential id for a secret connection row.
|
|
153
|
+
*
|
|
154
|
+
* With an Agent Builder service key, prefer GET-for-owner / workspace list.
|
|
155
|
+
* Personal API keys may only list agent-owned credentials.
|
|
156
|
+
*/
|
|
157
|
+
async findSecretCredentialId(connection, slug) {
|
|
158
|
+
if (connection.kind !== "secret") {
|
|
159
|
+
return undefined;
|
|
160
|
+
}
|
|
161
|
+
const workspaceId = this.context.workspaceId?.trim();
|
|
162
|
+
if (!workspaceId) {
|
|
163
|
+
throw new CredentialStoreError("connections are not configured: LANGSMITH_WORKSPACE_ID is not set");
|
|
164
|
+
}
|
|
165
|
+
if (this.context.serviceKey?.trim()) {
|
|
166
|
+
const fromOwner = await this.#credentialIdForOwner(connection.connectionId, "workspace", workspaceId);
|
|
167
|
+
if (fromOwner) {
|
|
168
|
+
return fromOwner;
|
|
169
|
+
}
|
|
170
|
+
return await this.findCredentialId({
|
|
171
|
+
ownerType: "workspace",
|
|
172
|
+
ownerId: workspaceId,
|
|
173
|
+
kind: "secret",
|
|
174
|
+
slug,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
return await this.findCredentialId({
|
|
178
|
+
ownerType: "agent",
|
|
179
|
+
ownerId: this.context.agentId,
|
|
180
|
+
kind: "secret",
|
|
181
|
+
slug,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Read credential_id from GET /connections/{id}?credential_owner_*.
|
|
186
|
+
* Workspace owners require the Agent Builder service identity.
|
|
187
|
+
*/
|
|
188
|
+
async #credentialIdForOwner(connectionId, ownerType, ownerId) {
|
|
189
|
+
const params = new URLSearchParams({
|
|
190
|
+
credential_owner_type: ownerType,
|
|
191
|
+
credential_owner_id: ownerId,
|
|
192
|
+
});
|
|
193
|
+
const { ok, status, body } = await this.#request(`/v1/agent-auth/connections/${encodeURIComponent(connectionId)}?${params.toString()}`, { method: "GET" });
|
|
194
|
+
if (status === 404) {
|
|
195
|
+
return undefined;
|
|
196
|
+
}
|
|
197
|
+
if (!ok) {
|
|
198
|
+
throw new CredentialStoreError("Agent Auth get connection for owner failed", status);
|
|
199
|
+
}
|
|
200
|
+
return connectionCredentialId(body);
|
|
201
|
+
}
|
|
202
|
+
/** Read a caller-owned opaque secret grant for a workspace connection slug. */
|
|
203
|
+
async readUserSecret(slug) {
|
|
204
|
+
const credentialId = await this.findCredentialId({
|
|
205
|
+
ownerType: "user",
|
|
206
|
+
ownerId: this.context.principalId,
|
|
207
|
+
kind: "secret",
|
|
208
|
+
slug,
|
|
209
|
+
});
|
|
210
|
+
if (!credentialId) {
|
|
211
|
+
return undefined;
|
|
212
|
+
}
|
|
213
|
+
return await this.readSecret(credentialId);
|
|
214
|
+
}
|
|
215
|
+
/** Read an OAuth access token stored on a workspace connection row. */
|
|
216
|
+
async readConnectionAccessToken(connectionId) {
|
|
217
|
+
return await this.#fetchAccessToken(connectionId);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Read the caller's OAuth access token for a slug without starting a session.
|
|
221
|
+
*
|
|
222
|
+
* Reads never mint, so a caller can be probed repeatedly — on every replay of
|
|
223
|
+
* an interrupted node, for instance — without leaving authorization sessions
|
|
224
|
+
* behind.
|
|
225
|
+
*
|
|
226
|
+
* @returns The access token, or `undefined` when the caller must connect.
|
|
227
|
+
*/
|
|
228
|
+
async readUserAccessToken(slug) {
|
|
229
|
+
const credentialId = await this.findCredentialId({
|
|
230
|
+
ownerType: "user",
|
|
231
|
+
ownerId: this.context.principalId,
|
|
232
|
+
kind: "oauth2",
|
|
233
|
+
slug,
|
|
234
|
+
});
|
|
235
|
+
if (!credentialId)
|
|
236
|
+
return undefined;
|
|
237
|
+
return await this.#fetchAccessToken(credentialId);
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Start an OAuth authorization session for a slug the caller has not granted.
|
|
241
|
+
*
|
|
242
|
+
* @returns The pending session, including the user-facing connect URL.
|
|
243
|
+
*/
|
|
244
|
+
async startAuthorizationSession(slug) {
|
|
245
|
+
const connection = await this.findWorkspaceConnection(slug);
|
|
246
|
+
if (!connection) {
|
|
247
|
+
throw new CredentialStoreError(`workspace connection ${JSON.stringify(slug)} is not configured`);
|
|
248
|
+
}
|
|
249
|
+
if (connection.kind !== "oauth2") {
|
|
250
|
+
throw new CredentialStoreError(`connection ${JSON.stringify(slug)} is not an OAuth connection`);
|
|
251
|
+
}
|
|
252
|
+
const { ok, status, body } = await this.#request("/v1/agent-auth/oauth-authorization-sessions", {
|
|
253
|
+
method: "POST",
|
|
254
|
+
body: JSON.stringify({
|
|
255
|
+
connection_id: connection.connectionId,
|
|
256
|
+
principal_id: this.context.principalId,
|
|
257
|
+
agent_id: this.context.agentId,
|
|
258
|
+
}),
|
|
259
|
+
});
|
|
260
|
+
if (!ok) {
|
|
261
|
+
throw new CredentialStoreError("Agent Auth create oauth-authorization-session failed", status);
|
|
262
|
+
}
|
|
263
|
+
const authId = String(body.id ?? "");
|
|
264
|
+
const connectUrl = String(body.verification_url ?? "");
|
|
265
|
+
if (!authId || !connectUrl) {
|
|
266
|
+
throw new CredentialStoreError("Agent Auth oauth-authorization-session missing id or verification_url");
|
|
267
|
+
}
|
|
268
|
+
return { slug, connectUrl, authId };
|
|
269
|
+
}
|
|
270
|
+
/** oauth-providers has no slug filter, so the match is made across pages. */
|
|
271
|
+
async resolveOAuthProviderId(slug) {
|
|
272
|
+
let cursor;
|
|
273
|
+
for (let page = 0; page < AGENT_AUTH_MAX_PROVIDER_PAGES; page += 1) {
|
|
274
|
+
const params = new URLSearchParams({
|
|
275
|
+
page_size: String(AGENT_AUTH_PROVIDER_PAGE_SIZE),
|
|
276
|
+
});
|
|
277
|
+
if (cursor)
|
|
278
|
+
params.set("cursor", cursor);
|
|
279
|
+
const { ok, status, body } = await this.#request(`/v1/agent-auth/oauth-providers?${params.toString()}`, { method: "GET" });
|
|
280
|
+
if (!ok) {
|
|
281
|
+
throw new CredentialStoreError("Agent Auth list oauth-providers failed", status);
|
|
282
|
+
}
|
|
283
|
+
const items = Array.isArray(body.items) ? body.items : [];
|
|
284
|
+
const match = items.find((item) => !!item &&
|
|
285
|
+
typeof item === "object" &&
|
|
286
|
+
String(item.slug) === slug);
|
|
287
|
+
if (match?.id) {
|
|
288
|
+
return String(match.id);
|
|
289
|
+
}
|
|
290
|
+
const next = body.next_cursor;
|
|
291
|
+
if (typeof next !== "string" || !next || next === cursor) {
|
|
292
|
+
throw new AgentAuthUnknownProviderError(slug);
|
|
293
|
+
}
|
|
294
|
+
cursor = next;
|
|
295
|
+
}
|
|
296
|
+
throw new CredentialStoreError("Agent Auth oauth-provider list returned too many pages");
|
|
297
|
+
}
|
|
298
|
+
/** The credential key is `credential_id`, never `id`. */
|
|
299
|
+
async findCredentialId(options) {
|
|
300
|
+
let cursor;
|
|
301
|
+
for (let page = 0; page < AGENT_AUTH_MAX_PROVIDER_PAGES; page += 1) {
|
|
302
|
+
const { ok, status, body } = await this.#request(`/v1/agent-auth/credentials?${agentAuthCredentialQuery({
|
|
303
|
+
ownerType: options.ownerType,
|
|
304
|
+
ownerId: options.ownerId,
|
|
305
|
+
kind: options.kind,
|
|
306
|
+
pageSize: AGENT_AUTH_PROVIDER_PAGE_SIZE,
|
|
307
|
+
cursor,
|
|
308
|
+
})}`, { method: "GET" });
|
|
309
|
+
if (!ok) {
|
|
310
|
+
throw new CredentialStoreError("Agent Auth list credentials failed", status);
|
|
311
|
+
}
|
|
312
|
+
const items = Array.isArray(body.items) ? body.items : [];
|
|
313
|
+
const match = items.find((item) => !!item &&
|
|
314
|
+
typeof item === "object" &&
|
|
315
|
+
String(item.slug) === options.slug);
|
|
316
|
+
const id = match?.credential_id;
|
|
317
|
+
if (typeof id === "string" && id) {
|
|
318
|
+
return id;
|
|
319
|
+
}
|
|
320
|
+
const next = body.next_cursor;
|
|
321
|
+
if (typeof next !== "string" || !next || next === cursor) {
|
|
322
|
+
return undefined;
|
|
323
|
+
}
|
|
324
|
+
cursor = next;
|
|
325
|
+
}
|
|
326
|
+
throw new CredentialStoreError("Agent Auth credential list returned too many pages");
|
|
327
|
+
}
|
|
328
|
+
/** @returns The secret, or `undefined` when Agent Auth has no value (404). */
|
|
329
|
+
async readSecret(credentialId) {
|
|
330
|
+
const { ok, status, body } = await this.#request(`/v1/agent-auth/credentials/${encodeURIComponent(credentialId)}/secret`, { method: "GET" });
|
|
331
|
+
if (status === 404) {
|
|
332
|
+
return undefined;
|
|
333
|
+
}
|
|
334
|
+
if (!ok) {
|
|
335
|
+
throw new CredentialStoreError("Agent Auth get secret failed", status);
|
|
336
|
+
}
|
|
337
|
+
const secret = body.secret;
|
|
338
|
+
return typeof secret === "string" && secret.length > 0 ? secret : undefined;
|
|
339
|
+
}
|
|
340
|
+
async #fetchAccessToken(credentialId) {
|
|
341
|
+
const { ok, status, body } = await this.#request(`/v1/agent-auth/credentials/${encodeURIComponent(credentialId)}/oauth2`, { method: "GET" });
|
|
342
|
+
if (isAuthorizationRequired(status, body)) {
|
|
343
|
+
return undefined;
|
|
344
|
+
}
|
|
345
|
+
if (!ok) {
|
|
346
|
+
throw new CredentialStoreError("Agent Auth get oauth2 failed", status);
|
|
347
|
+
}
|
|
348
|
+
const oauth2 = body.oauth2 && typeof body.oauth2 === "object"
|
|
349
|
+
? body.oauth2
|
|
350
|
+
: body;
|
|
351
|
+
const token = oauth2.access_token;
|
|
352
|
+
return typeof token === "string" && token ? token : undefined;
|
|
353
|
+
}
|
|
354
|
+
async #request(path, init = {}) {
|
|
355
|
+
return await requestAgentAuthJson({
|
|
356
|
+
url: `${this.context.baseUrl}${path}`,
|
|
357
|
+
init,
|
|
358
|
+
config: this.context,
|
|
359
|
+
timeoutMs: this.#timeoutMs,
|
|
360
|
+
fetchImpl: this.#fetchImpl,
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
/** Agent Auth answers 409 when a stored grant has lapsed and needs re-auth. */
|
|
365
|
+
function isAuthorizationRequired(status, body) {
|
|
366
|
+
if (status !== 409) {
|
|
367
|
+
return false;
|
|
368
|
+
}
|
|
369
|
+
const detail = String(body.detail ?? body.title ?? body.error ?? "").toLowerCase();
|
|
370
|
+
return (body.error === "authorization_required" ||
|
|
371
|
+
detail.includes("authorization is required") ||
|
|
372
|
+
detail.includes("oauth authorization"));
|
|
373
|
+
}
|
|
374
|
+
/** Prefer nested `credential.kind`; accept legacy top-level `kind`. */
|
|
375
|
+
function connectionCredentialKind(item) {
|
|
376
|
+
const credential = item.credential;
|
|
377
|
+
if (credential && typeof credential === "object") {
|
|
378
|
+
const kind = credential.kind;
|
|
379
|
+
if (typeof kind === "string" && kind) {
|
|
380
|
+
return kind;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
return typeof item.kind === "string" ? item.kind : "";
|
|
384
|
+
}
|
|
385
|
+
function connectionCredentialId(body) {
|
|
386
|
+
const credential = body.credential;
|
|
387
|
+
if (!credential || typeof credential !== "object") {
|
|
388
|
+
return undefined;
|
|
389
|
+
}
|
|
390
|
+
const id = credential.credential_id;
|
|
391
|
+
return typeof id === "string" && id ? id : undefined;
|
|
392
|
+
}
|
|
393
|
+
//# sourceMappingURL=agent-auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-auth.js","sourceRoot":"","sources":["../src/agent-auth.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAC5C,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AACjD,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,CAAC;AAShD,uEAAuE;AACvE,MAAM,UAAU,wBAAwB,CAAC,OAMxC;IACC,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;QACjC,UAAU,EAAE,OAAO,CAAC,SAAS;QAC7B,QAAQ,EAAE,OAAO,CAAC,OAAO;QACzB,IAAI,EAAE,OAAO,CAAC,IAAI;KACnB,C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AC;AACJ,CAAC;AAED,uEAAuE;AACvE,SAAS,wBAAwB,CAAC,IAA6B;IAC7D,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACnC,IAAI,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QACjD,MAAM,IAAI,GAAI,UAAsC,CAAC,IAAI,CAAC;QAC1D,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,EAAE,CAAC;YACrC,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AACxD,CAAC;AAED,SAAS,sBAAsB,CAC7B,IAA6B;IAE7B,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACnC,IAAI,CAAC,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QAClD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,EAAE,GAAI,UAAsC,CAAC,aAAa,CAAC;IACjE,OAAO,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC"}
|
|
@@ -31,6 +31,10 @@ export interface ChannelManifest {
|
|
|
31
31
|
requiredPermissions: readonly string[];
|
|
32
32
|
/** Env vars deploy must ensure when this channel is present. */
|
|
33
33
|
requiredEnv: readonly string[];
|
|
34
|
+
/** User-owned connection slugs that must exist in the workspace vault. */
|
|
35
|
+
userConnections?: readonly string[];
|
|
36
|
+
/** Agent-owned connection slugs referenced by this connector. */
|
|
37
|
+
agentConnections?: readonly string[];
|
|
34
38
|
/** Opaque-to-core provider config (Slack filters/conversation, …). */
|
|
35
39
|
providerConfig: JsonObject;
|
|
36
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/channels/manifest.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,2EAA2E;AAC3E,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,uFAAuF;IACvF,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,QAAQ,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAC;IACtC,iEAAiE;IACjE,SAAS,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,gEAAgE;IAChE,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,sEAAsE;IACtE,cAAc,EAAE,UAAU,CAAC;CAC5B"}
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/channels/manifest.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,2EAA2E;AAC3E,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,uFAAuF;IACvF,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,QAAQ,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAC;IACtC,iEAAiE;IACjE,SAAS,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,gEAAgE;IAChE,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,0EAA0E;IAC1E,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,sEAAsE;IACtE,cAAc,EAAE,UAAU,CAAC;CAC5B"}
|
|
@@ -48,6 +48,8 @@ export interface DeliverScheduleResultInput {
|
|
|
48
48
|
threadId?: string;
|
|
49
49
|
}) => Promise<unknown>;
|
|
50
50
|
}
|
|
51
|
+
/** Return the deployment ID supplied by the managed runtime. */
|
|
52
|
+
export declare function getDeploymentId(env?: NodeJS.ProcessEnv): string | undefined;
|
|
51
53
|
/**
|
|
52
54
|
* Post schedule result text to the configured channel. Soft-fails (logs) on
|
|
53
55
|
* missing token / provider errors so cron runs are not marked failed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule-delivery.d.ts","sourceRoot":"","sources":["../../src/channels/schedule-delivery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"schedule-delivery.d.ts","sourceRoot":"","sources":["../../src/channels/schedule-delivery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAO1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAMjD,uEAAuE;AACvE,wBAAgB,2BAA2B,CACzC,MAAM,CAAC,EAAE,MAAM;IAAE,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,GAC3E,IAAI,CAEN;AAED,uDAAuD;AACvD,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EACE;QAAE,IAAI,EAAE,uBAAuB,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,GACzD;QAA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