@arcgis/ai-components 5.2.0-next.11 → 5.2.0-next.13
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/dist/agent-utils/LLMAgent.js +1 -0
- package/dist/cdn/{EBISDZ5H.js → 4UDYY3HL.js} +1 -1
- package/dist/cdn/{ERL2CB2Y.js → 55R6J3FL.js} +5 -5
- package/dist/cdn/ADYIXCSG.js +2 -0
- package/dist/cdn/CAECQD75.js +2 -0
- package/dist/cdn/{34SG44C3.js → CE6VDP2D.js} +1 -1
- package/dist/cdn/{T43LEBBE.js → CFVVQXPJ.js} +18 -18
- package/dist/cdn/CI3QSFPS.js +2 -0
- package/dist/cdn/DEAYZ3MK.js +2 -0
- package/dist/cdn/{Z2G7MP5L.js → DSVMXDPZ.js} +1 -1
- package/dist/cdn/{YLN2BZ5J.js → E2HENO3T.js} +1 -1
- package/dist/cdn/{JLKGS6Y5.js → ET453NAD.js} +1 -1
- package/dist/cdn/FWU6DFIB.js +2 -0
- package/dist/cdn/GPYYAQVI.js +2 -0
- package/dist/cdn/JN744CAW.js +2 -0
- package/dist/cdn/K475UT3E.js +2 -0
- package/dist/cdn/KWTJAVWV.js +2 -0
- package/dist/cdn/{5CV7R5IS.js → LREQ3XAW.js} +1 -1
- package/dist/cdn/M3SWPT3M.js +2 -0
- package/dist/cdn/MAV3DW27.js +4 -0
- package/dist/cdn/MRLTR3UO.js +16 -0
- package/dist/cdn/PB2ODJC7.js +2 -0
- package/dist/cdn/{QCSN44H4.js → QSA4T3BU.js} +1 -1
- package/dist/cdn/RMLXVQZ5.js +2 -0
- package/dist/cdn/SBHLUL3Q.js +2 -0
- package/dist/cdn/{R56X6ZKR.js → SRSFESAD.js} +1 -1
- package/dist/cdn/SWBER53G.js +3 -0
- package/dist/cdn/WH6QQK6N.js +2 -0
- package/dist/cdn/XBW4MWQR.js +2 -0
- package/dist/cdn/Z7UWJ4AI.js +3 -0
- package/dist/cdn/ZOSUDIJH.js +2 -0
- package/dist/cdn/ZPLFFLPF.js +2 -0
- package/dist/cdn/agent-utils/index.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/adapter.js +169 -168
- package/dist/chunks/arcgisKnowledgeGraph.js +3 -2
- package/dist/chunks/dataExplorationGraph.js +3 -2
- package/dist/chunks/generateLayerDescriptions.js +180 -178
- package/dist/chunks/helpGraph.js +3 -2
- package/dist/chunks/layerStylingGraph.js +1 -0
- package/dist/chunks/navigationGraph.js +3 -2
- package/dist/chunks/orchestrator.js +49 -48
- package/dist/chunks/toolCallResponse.js +10 -9
- package/dist/components/arcgis-assistant/customElement.js +54 -48
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +3 -2
- package/dist/components/arcgis-assistant-help-agent/customElement.js +1 -0
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +4 -3
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +1 -0
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +1 -0
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +4 -4
- package/dist/cdn/24QNMEFG.js +0 -2
- package/dist/cdn/3NBDVZ2I.js +0 -2
- package/dist/cdn/53NTYC4I.js +0 -2
- package/dist/cdn/AZGGTNA3.js +0 -2
- package/dist/cdn/B7WJFBOZ.js +0 -2
- package/dist/cdn/DZ2QWNUA.js +0 -3
- package/dist/cdn/F6QHMKF5.js +0 -2
- package/dist/cdn/H2CHHGGH.js +0 -2
- package/dist/cdn/HWKDNS4K.js +0 -4
- package/dist/cdn/IMQ4TVHF.js +0 -16
- package/dist/cdn/IRZDTYO2.js +0 -2
- package/dist/cdn/KHXUWZHB.js +0 -2
- package/dist/cdn/LIFK3QSD.js +0 -2
- package/dist/cdn/O3EN27N5.js +0 -2
- package/dist/cdn/PBO6FZN6.js +0 -2
- package/dist/cdn/Q3ZW4FYA.js +0 -3
- package/dist/cdn/UPEEHMSY.js +0 -2
- package/dist/cdn/WAIFKDR3.js +0 -2
- package/dist/cdn/XON27U6U.js +0 -2
- package/dist/cdn/YUKR4AZW.js +0 -2
package/dist/chunks/helpGraph.js
CHANGED
|
@@ -3,6 +3,7 @@ import { StateGraph as d, START as g, END as i } from "@langchain/langgraph/web"
|
|
|
3
3
|
import { l as h, g as f, f as p, r as x, t as y, H as c } from "./adapter.js";
|
|
4
4
|
import "@arcgis/core/identity/IdentityManager.js";
|
|
5
5
|
import "@arcgis/core/portal/Portal.js";
|
|
6
|
+
import "@arcgis/toolkit/string";
|
|
6
7
|
import { h as S } from "./generateLayerDescriptions.js";
|
|
7
8
|
import "@langchain/core/messages";
|
|
8
9
|
import "@langchain/core/callbacks/dispatch/web";
|
|
@@ -114,7 +115,7 @@ const b = () => new d(c).addNode("requireHelpServices", C).addNode("agent", _).a
|
|
|
114
115
|
|
|
115
116
|
IF the user asks map related queries, but those that are not performed by any of the agents, call this agent so we can respond accordingly.
|
|
116
117
|
_Example: "Create a chart"_
|
|
117
|
-
_Example: "Create a table"_`,
|
|
118
|
+
_Example: "Create a table"_`, V = {
|
|
118
119
|
id: "help",
|
|
119
120
|
name: "Help Agent",
|
|
120
121
|
description: M,
|
|
@@ -122,5 +123,5 @@ const b = () => new d(c).addNode("requireHelpServices", C).addNode("agent", _).a
|
|
|
122
123
|
workspace: c
|
|
123
124
|
};
|
|
124
125
|
export {
|
|
125
|
-
|
|
126
|
+
V as H
|
|
126
127
|
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { NodeInterrupt as E, StateGraph as L, START as w, END as m } from "@langchain/langgraph/web";
|
|
3
3
|
import "@arcgis/core/identity/IdentityManager.js";
|
|
4
4
|
import "@arcgis/core/portal/Portal.js";
|
|
5
|
+
import "@arcgis/toolkit/string";
|
|
5
6
|
import { h as I } from "./generateLayerDescriptions.js";
|
|
6
7
|
import "@langchain/core/messages";
|
|
7
8
|
import { s as i } from "./index.js";
|
|
@@ -3,6 +3,7 @@ import { StateGraph as b, START as $, END as C } from "@langchain/langgraph/web"
|
|
|
3
3
|
import { k as F, m as R, n as L, o as M, p as A, u as _, v as I, w as q, x as Z, g as T, y as k, t as j, f as u, r as P, N as w } from "./adapter.js";
|
|
4
4
|
import "@arcgis/core/identity/IdentityManager.js";
|
|
5
5
|
import "@arcgis/core/portal/Portal.js";
|
|
6
|
+
import "@arcgis/toolkit/string";
|
|
6
7
|
import { h as V, i as z } from "./generateLayerDescriptions.js";
|
|
7
8
|
import "@langchain/core/messages";
|
|
8
9
|
import "@langchain/core/callbacks/dispatch/web";
|
|
@@ -258,7 +259,7 @@ ${r.results.map((d) => ` - ${d.name} (${d.score.toFixed(2)})`).join(`
|
|
|
258
259
|
_Example: “Center the map on San Francisco at scale 50000”_
|
|
259
260
|
_Example: “Zoom to the features in the schools layer where city = 'Austin'”_
|
|
260
261
|
_Example: “Go to the Downtown bookmark”_
|
|
261
|
-
_Example: “Where is Mount Rainier?”_`,
|
|
262
|
+
_Example: “Where is Mount Rainier?”_`, ve = {
|
|
262
263
|
id: "navigation",
|
|
263
264
|
name: "Navigation Agent",
|
|
264
265
|
description: Y,
|
|
@@ -266,5 +267,5 @@ ${r.results.map((d) => ` - ${d.name} (${d.score.toFixed(2)})`).join(`
|
|
|
266
267
|
workspace: w
|
|
267
268
|
};
|
|
268
269
|
export {
|
|
269
|
-
|
|
270
|
+
ve as N
|
|
270
271
|
};
|
|
@@ -3,12 +3,13 @@ import R from "@arcgis/core/identity/IdentityManager.js";
|
|
|
3
3
|
import C from "@arcgis/core/portal/Portal.js";
|
|
4
4
|
import { n as I, o as v, D as k, p as A, q as M, W as F } from "./generateLayerDescriptions.js";
|
|
5
5
|
import { isGraphInterrupt as D, StateGraph as L, START as W, END as $, MemorySaver as j } from "@langchain/langgraph/web";
|
|
6
|
-
import {
|
|
6
|
+
import { generateGuid as q } from "@arcgis/toolkit/string";
|
|
7
|
+
import { HumanMessage as H, AIMessage as P } from "@langchain/core/messages";
|
|
7
8
|
import { s as l } from "./index.js";
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
const
|
|
9
|
+
import * as O from "@arcgis/core/core/reactiveUtils.js";
|
|
10
|
+
import T from "@arcgis/core/layers/FeatureLayer.js";
|
|
11
|
+
import U from "@arcgis/core/request.js";
|
|
12
|
+
const G = async (t) => {
|
|
12
13
|
const e = await N(), r = await I("default"), s = C.getDefault(), a = (await R.getCredential(`${s.url}/sharing`)).token, i = {
|
|
13
14
|
type: "generateEmbeddings",
|
|
14
15
|
webmapEmbeddings: t,
|
|
@@ -27,17 +28,17 @@ const T = async (t) => {
|
|
|
27
28
|
const t = (await import("./embeddings.worker.js")).default;
|
|
28
29
|
return new t();
|
|
29
30
|
}
|
|
30
|
-
},
|
|
31
|
+
}, _ = (t) => {
|
|
31
32
|
t.currentIntent = "none";
|
|
32
|
-
},
|
|
33
|
+
}, V = async (t, e) => {
|
|
33
34
|
const r = v(e);
|
|
34
35
|
if (t.agentExecutionContext.userRequest) {
|
|
35
|
-
const n = new
|
|
36
|
-
t.agentExecutionContext.messages = [...t.agentExecutionContext.messages, n],
|
|
36
|
+
const n = new H(t.agentExecutionContext.userRequest.trim());
|
|
37
|
+
t.agentExecutionContext.messages = [...t.agentExecutionContext.messages, n], _(t);
|
|
37
38
|
}
|
|
38
39
|
const s = r?.services.agentRegistry.list().map((n) => n.agent.id) ?? [];
|
|
39
40
|
return await l({ text: `Available agents: ${[...s].join(", ")}` }, e), await l({ text: "Analyzing user input" }, e), t;
|
|
40
|
-
},
|
|
41
|
+
}, z = async (t, e) => (await l({ text: "Exiting..." }, e), t), w = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Q = (t, e) => {
|
|
41
42
|
if (!w(t)) {
|
|
42
43
|
t !== void 0 && console.warn(`Agent "${e}" returned invalid sharedStatePatch. Ignoring it.`);
|
|
43
44
|
return;
|
|
@@ -53,7 +54,7 @@ const T = async (t) => {
|
|
|
53
54
|
r[s] = { value: n.value };
|
|
54
55
|
}
|
|
55
56
|
return r;
|
|
56
|
-
},
|
|
57
|
+
}, B = (t) => {
|
|
57
58
|
const { previousSharedState: e, patch: r, agentId: s } = t;
|
|
58
59
|
if (!r)
|
|
59
60
|
return e;
|
|
@@ -74,7 +75,7 @@ const T = async (t) => {
|
|
|
74
75
|
return;
|
|
75
76
|
const e = t.trim();
|
|
76
77
|
return e || void 0;
|
|
77
|
-
},
|
|
78
|
+
}, J = (t) => {
|
|
78
79
|
switch (t) {
|
|
79
80
|
case "failed":
|
|
80
81
|
return "Agent failed without a summary.";
|
|
@@ -85,17 +86,17 @@ const T = async (t) => {
|
|
|
85
86
|
default:
|
|
86
87
|
return "Agent completed without a summary.";
|
|
87
88
|
}
|
|
88
|
-
},
|
|
89
|
+
}, K = (t, e) => {
|
|
89
90
|
const r = f(e?.outputMessage), s = f(e?.summary), n = e?.status, a = n === "success" || n === "failed" ? n : "unknown";
|
|
90
91
|
a === "unknown" && console.warn(`Agent "${t}" returned missing/invalid status. Defaulting to "unknown".`);
|
|
91
|
-
const i =
|
|
92
|
+
const i = Q(e?.sharedStatePatch, t);
|
|
92
93
|
return {
|
|
93
94
|
outputMessage: r,
|
|
94
|
-
summary: s ?? r ??
|
|
95
|
+
summary: s ?? r ?? J(a),
|
|
95
96
|
status: a,
|
|
96
97
|
sharedStatePatch: i
|
|
97
98
|
};
|
|
98
|
-
}, E = 4e3,
|
|
99
|
+
}, E = 4e3, X = async (t, e) => {
|
|
99
100
|
const r = v(e);
|
|
100
101
|
if (r?.abortSignal?.aborted)
|
|
101
102
|
return await l({ text: "Run cancelled; skipping agent execution" }, e), {
|
|
@@ -130,7 +131,7 @@ const T = async (t) => {
|
|
|
130
131
|
},
|
|
131
132
|
a
|
|
132
133
|
);
|
|
133
|
-
i =
|
|
134
|
+
i = K(n.agent.name, o), await l({ text: `Finished executing registered agent: ${n.agent.name}` }, e);
|
|
134
135
|
} catch (o) {
|
|
135
136
|
if (D(o))
|
|
136
137
|
throw o;
|
|
@@ -145,7 +146,7 @@ const T = async (t) => {
|
|
|
145
146
|
if (c) {
|
|
146
147
|
const o = c.length > E ? `${c.slice(0, E - 14)}
|
|
147
148
|
[truncated]` : c;
|
|
148
|
-
d.push(new
|
|
149
|
+
d.push(new P(o));
|
|
149
150
|
}
|
|
150
151
|
return {
|
|
151
152
|
...t,
|
|
@@ -165,18 +166,18 @@ const T = async (t) => {
|
|
|
165
166
|
status: i?.status || "unknown"
|
|
166
167
|
}
|
|
167
168
|
],
|
|
168
|
-
sharedState:
|
|
169
|
+
sharedState: B({
|
|
169
170
|
previousSharedState: t.agentExecutionContext.sharedState,
|
|
170
171
|
patch: i.sharedStatePatch,
|
|
171
172
|
agentId: n.agent.id
|
|
172
173
|
})
|
|
173
174
|
}
|
|
174
175
|
};
|
|
175
|
-
},
|
|
176
|
+
}, Y = 3, Z = () => new L(k).addNode("ingestInput", V).addNode("intentLLM", A).addNode("executeRegisteredAgent", X).addNode("exit", z).addEdge(W, "ingestInput").addEdge("ingestInput", "intentLLM").addConditionalEdges("intentLLM", (e) => e.currentIntent === "none" || e.currentIntent === e.lastExecutedAgent ? "exit" : "executeRegisteredAgent").addConditionalEdges(
|
|
176
177
|
"executeRegisteredAgent",
|
|
177
|
-
(e) => e.stepCount >=
|
|
178
|
+
(e) => e.stepCount >= Y || !e.requiresFollowUp ? "exit" : "intentLLM"
|
|
178
179
|
).addEdge("exit", $);
|
|
179
|
-
class
|
|
180
|
+
class ee {
|
|
180
181
|
constructor() {
|
|
181
182
|
this.agentRegistry = /* @__PURE__ */ new Map();
|
|
182
183
|
}
|
|
@@ -193,7 +194,7 @@ class Z {
|
|
|
193
194
|
return [...this.agentRegistry.values()];
|
|
194
195
|
}
|
|
195
196
|
}
|
|
196
|
-
class
|
|
197
|
+
class te {
|
|
197
198
|
/**
|
|
198
199
|
* Create a new InterruptHandler tied to a specific compiled graph and config.
|
|
199
200
|
*/
|
|
@@ -240,7 +241,7 @@ class ee {
|
|
|
240
241
|
this.rejectWait && (this.rejectWait(new Error("Request cancelled by user.")), this.resolveWait = void 0, this.rejectWait = void 0);
|
|
241
242
|
}
|
|
242
243
|
}
|
|
243
|
-
const
|
|
244
|
+
const re = async (t) => {
|
|
244
245
|
try {
|
|
245
246
|
return await (await M()).embedDocuments(t);
|
|
246
247
|
} catch (e) {
|
|
@@ -250,10 +251,10 @@ const te = async (t) => {
|
|
|
250
251
|
const r = e.get(t);
|
|
251
252
|
if (r)
|
|
252
253
|
return r;
|
|
253
|
-
const s = await
|
|
254
|
+
const s = await re([t]);
|
|
254
255
|
return e.set(t, s[0]), s[0];
|
|
255
256
|
};
|
|
256
|
-
async function
|
|
257
|
+
async function ne(t, e, r, s) {
|
|
257
258
|
const n = `req-${Date.now()}`, i = {
|
|
258
259
|
type: "layerSearch",
|
|
259
260
|
precomputedEmbedding: s ? await b(t, s) : void 0,
|
|
@@ -267,7 +268,7 @@ async function re(t, e, r, s) {
|
|
|
267
268
|
e.addEventListener("message", d, { once: !0 }), e.postMessage(i);
|
|
268
269
|
});
|
|
269
270
|
}
|
|
270
|
-
function
|
|
271
|
+
function se(t) {
|
|
271
272
|
const { worker: e } = t;
|
|
272
273
|
return {
|
|
273
274
|
async searchLayers({
|
|
@@ -275,11 +276,11 @@ function ne(t) {
|
|
|
275
276
|
minScore: s,
|
|
276
277
|
embeddingCache: n
|
|
277
278
|
}) {
|
|
278
|
-
return await
|
|
279
|
+
return await ne(r, e, s, n);
|
|
279
280
|
}
|
|
280
281
|
};
|
|
281
282
|
}
|
|
282
|
-
const
|
|
283
|
+
const ae = async ({
|
|
283
284
|
combinedQuery: t,
|
|
284
285
|
layerIds: e,
|
|
285
286
|
embeddingsWorker: r,
|
|
@@ -308,11 +309,11 @@ const se = async ({
|
|
|
308
309
|
r.addEventListener("message", g, { once: !0 }), r.postMessage(d);
|
|
309
310
|
});
|
|
310
311
|
};
|
|
311
|
-
function
|
|
312
|
+
function ie(t) {
|
|
312
313
|
const { worker: e } = t;
|
|
313
314
|
return {
|
|
314
315
|
async searchFields({ text: r, layerIds: s, minScore: n, topResults: a, embeddingCache: i }) {
|
|
315
|
-
return await
|
|
316
|
+
return await ae({
|
|
316
317
|
combinedQuery: r,
|
|
317
318
|
layerIds: s,
|
|
318
319
|
embeddingsWorker: e,
|
|
@@ -323,15 +324,15 @@ function ae(t) {
|
|
|
323
324
|
}
|
|
324
325
|
};
|
|
325
326
|
}
|
|
326
|
-
const
|
|
327
|
+
const oe = (t) => {
|
|
327
328
|
const e = F.safeParse(t);
|
|
328
329
|
if (!e.success)
|
|
329
330
|
throw new Error("Embeddings response validation failed. Regenerate embeddings.");
|
|
330
331
|
return e.data;
|
|
331
|
-
},
|
|
332
|
+
}, ce = (t, e) => {
|
|
332
333
|
const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
|
|
333
334
|
if (e.allLayers.forEach((n) => {
|
|
334
|
-
n instanceof
|
|
335
|
+
n instanceof T && s.set(n.id, n);
|
|
335
336
|
}), t.length !== s.size)
|
|
336
337
|
throw new Error("Layer count mismatch during registry restoration. Regenerate embeddings.");
|
|
337
338
|
for (const n of t) {
|
|
@@ -370,27 +371,27 @@ const ie = (t) => {
|
|
|
370
371
|
});
|
|
371
372
|
}
|
|
372
373
|
return r;
|
|
373
|
-
},
|
|
374
|
+
}, de = async (t) => {
|
|
374
375
|
try {
|
|
375
|
-
return (await
|
|
376
|
+
return (await U(t, {
|
|
376
377
|
responseType: "json"
|
|
377
378
|
})).data;
|
|
378
379
|
} catch (e) {
|
|
379
380
|
throw new Error(`Failed to fetch data from ${t}: ${String(e)}`);
|
|
380
381
|
}
|
|
381
|
-
},
|
|
382
|
+
}, ue = async (t) => {
|
|
382
383
|
const e = t.map;
|
|
383
384
|
if (!e?.portalItem)
|
|
384
385
|
throw new Error("WebMap portal item is missing.");
|
|
385
386
|
const { resources: r } = await e.portalItem.fetchResources(), s = r.find((i) => i.resource.path === "embeddings-v01.json");
|
|
386
387
|
if (!s?.resource.url)
|
|
387
388
|
throw new Error("Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.");
|
|
388
|
-
const n = await
|
|
389
|
-
return
|
|
389
|
+
const n = await de(s.resource.url);
|
|
390
|
+
return oe(n);
|
|
390
391
|
};
|
|
391
392
|
class x {
|
|
392
393
|
constructor() {
|
|
393
|
-
this.orchestratorReady = !1, this.chatHistory = [], this.priorSteps = [], this.sharedState = {}, this.agentRegistry = new
|
|
394
|
+
this.orchestratorReady = !1, this.chatHistory = [], this.priorSteps = [], this.sharedState = {}, this.agentRegistry = new ee(), this.activeRunId = "", this.cancelledRunIds = /* @__PURE__ */ new Set(), this.streamEpoch = 0;
|
|
394
395
|
}
|
|
395
396
|
/**
|
|
396
397
|
* Creates and returns an AI-ready Orchestrator instance.
|
|
@@ -401,12 +402,12 @@ class x {
|
|
|
401
402
|
const r = new x();
|
|
402
403
|
try {
|
|
403
404
|
if (e.view?.map) {
|
|
404
|
-
await
|
|
405
|
-
const s = await
|
|
405
|
+
await O.whenOnce(() => e.view.ready);
|
|
406
|
+
const s = await ue(e.view), n = ce(
|
|
406
407
|
s.layers,
|
|
407
408
|
e.view.map
|
|
408
409
|
);
|
|
409
|
-
r.layersAndFieldsRegistry = n, r.embeddingsWorker = await
|
|
410
|
+
r.layersAndFieldsRegistry = n, r.embeddingsWorker = await G(s);
|
|
410
411
|
}
|
|
411
412
|
return e.agents?.forEach((s) => {
|
|
412
413
|
r.agentRegistry.register(s);
|
|
@@ -430,9 +431,9 @@ class x {
|
|
|
430
431
|
throw new Error("Orchestrator has no registered agents.");
|
|
431
432
|
if (++this.streamEpoch, !e.trim())
|
|
432
433
|
return;
|
|
433
|
-
const r =
|
|
434
|
-
this.activeRunId = r, this.activeAbortController = new AbortController(), this.graph || (this.graph =
|
|
435
|
-
const s = this.embeddingsWorker ?
|
|
434
|
+
const r = q();
|
|
435
|
+
this.activeRunId = r, this.activeAbortController = new AbortController(), this.graph || (this.graph = Z().compile({ checkpointer: new j() }));
|
|
436
|
+
const s = this.embeddingsWorker ? se({ worker: this.embeddingsWorker }) : void 0, n = this.embeddingsWorker ? ie({ worker: this.embeddingsWorker }) : void 0, a = /* @__PURE__ */ new Map(), c = {
|
|
436
437
|
version: "v2",
|
|
437
438
|
streamMode: "custom",
|
|
438
439
|
configurable: {
|
|
@@ -472,7 +473,7 @@ class x {
|
|
|
472
473
|
const m = (await this.graph.getState(c, { subgraphs: !0 })).tasks.find((h) => h.interrupts.length > 0)?.interrupts[0]?.value;
|
|
473
474
|
if (!m)
|
|
474
475
|
break;
|
|
475
|
-
this.currentInterrupt = m, this.interruptHandler = new
|
|
476
|
+
this.currentInterrupt = m, this.interruptHandler = new te(this.graph, c), yield { runId: r, timestamp: Date.now(), type: "interrupt", interrupt: m };
|
|
476
477
|
try {
|
|
477
478
|
const h = await this.interruptHandler.waitForUser(), S = ++this.streamEpoch;
|
|
478
479
|
yield* this.pipeStream(h, S, r);
|
|
@@ -564,5 +565,5 @@ class x {
|
|
|
564
565
|
}
|
|
565
566
|
export {
|
|
566
567
|
x as O,
|
|
567
|
-
|
|
568
|
+
re as g
|
|
568
569
|
};
|
|
@@ -2,30 +2,31 @@
|
|
|
2
2
|
import "@arcgis/core/identity/IdentityManager.js";
|
|
3
3
|
import "@arcgis/core/portal/Portal.js";
|
|
4
4
|
import "@langchain/langgraph/web";
|
|
5
|
+
import "@arcgis/toolkit/string";
|
|
5
6
|
import "./generateLayerDescriptions.js";
|
|
6
7
|
import "@langchain/core/messages";
|
|
7
|
-
import { s as
|
|
8
|
+
import { s as a } from "./index.js";
|
|
8
9
|
import "@langchain/openai";
|
|
9
10
|
import "@arcgis/core/config.js";
|
|
10
11
|
import "@arcgis/core/core/reactiveUtils.js";
|
|
11
12
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
12
13
|
import "@arcgis/core/request.js";
|
|
13
14
|
import "@langchain/core/prompts";
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
17
|
-
await
|
|
15
|
+
const L = async (t, o) => {
|
|
16
|
+
const i = t.tool_calls ?? [];
|
|
17
|
+
if (i.length === 0) {
|
|
18
|
+
await a({ text: `LLM did not request any tool calls: ${String(t?.content)}` }, o);
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
20
21
|
await Promise.all(
|
|
21
|
-
|
|
22
|
-
async (
|
|
23
|
-
{ text: `LLM invoked ${
|
|
22
|
+
i.map(
|
|
23
|
+
async (r) => await a(
|
|
24
|
+
{ text: `LLM invoked ${r.name} tool with arguments: ${JSON.stringify(r.args, null, 2)}` },
|
|
24
25
|
o
|
|
25
26
|
)
|
|
26
27
|
)
|
|
27
28
|
);
|
|
28
29
|
};
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
+
L as h
|
|
31
32
|
};
|