@arcgis/ai-components 5.2.0-next.77 → 5.2.0-next.79
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/agentic-workflow/jsonTypes.d.ts +2 -12
- package/dist/agentic-workflow/nodes/AgentNode.d.ts +2 -3
- package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
- package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
- package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
- package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
- package/dist/cdn/3LILAJUD.js +2 -0
- package/dist/cdn/{GPZJANRQ.js → 4AGGYAWS.js} +1 -1
- package/dist/cdn/4F7Y4RNW.js +2 -0
- package/dist/cdn/{H6IJRTHM.js → 6ADMWEVE.js} +1 -1
- package/dist/cdn/{B6CJG5UH.js → 6U4GTCLJ.js} +14 -14
- package/dist/cdn/7BCQMK6D.js +2 -0
- package/dist/cdn/7QOC7FQE.js +2 -0
- package/dist/cdn/ADJ63EDN.js +3 -0
- package/dist/cdn/ATFNWFKG.js +2 -0
- package/dist/cdn/CZLLPKMS.js +2 -0
- package/dist/cdn/{JSMNXHYG.js → EAOKCWED.js} +6 -6
- package/dist/cdn/EBNVLMUU.js +2 -0
- package/dist/cdn/G5XE5D36.js +2 -0
- package/dist/cdn/{U3XIDLHO.js → HPU6K67Y.js} +1 -1
- package/dist/cdn/IBZ2NEAO.js +2 -0
- package/dist/cdn/{TYZ3FRGW.js → J4R7KYJ3.js} +6 -6
- package/dist/cdn/{GZGDLURS.js → KP2FWABJ.js} +1 -1
- package/dist/cdn/LM2IGECE.js +2 -0
- package/dist/cdn/LXQFE5PJ.js +2 -0
- package/dist/cdn/{GOKLRL6M.js → MAPKEX67.js} +1 -1
- package/dist/cdn/{EZYONVBU.js → MYH43WYG.js} +1 -1
- package/dist/cdn/NLEBWLVV.js +2 -0
- package/dist/cdn/{UB6PAQZ7.js → NPBXE4EQ.js} +1 -1
- package/dist/cdn/{FZ4CURWW.js → NZJ6LLYY.js} +1 -1
- package/dist/cdn/ORRMONGJ.js +2 -0
- package/dist/cdn/QUMNJVKX.js +2 -0
- package/dist/cdn/RHYNE5OE.js +2 -0
- package/dist/cdn/W7OT3KRG.js +18 -0
- package/dist/cdn/XCNN7BQ3.js +2 -0
- package/dist/cdn/{DUSILSNJ.js → XHGVCL22.js} +3 -3
- package/dist/cdn/XLHTQ7CF.js +2 -0
- package/dist/cdn/ZWBFTKHF.js +2 -0
- package/dist/cdn/agent-utils/index.js +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/adapter.js +64 -67
- package/dist/chunks/converterUtils.js +66 -48
- package/dist/chunks/dataExplorationGraph.js +121 -195
- package/dist/chunks/fieldStatistics.js +79 -0
- package/dist/chunks/layerStylingGraph.js +9 -9
- package/dist/components/arcgis-assistant/customElement.d.ts +30 -1
- package/dist/components/arcgis-assistant/customElement.js +133 -135
- package/dist/components/arcgis-assistant-agent/customElement.js +152 -184
- package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
- package/dist/components/arcgis-assistant-interrupt/customElement.js +10 -11
- package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +12 -8
- package/dist/components/arcgis-assistant-message/customElement.d.ts +3 -0
- package/dist/components/arcgis-assistant-message/customElement.js +9 -8
- package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +3 -0
- package/dist/components/arcgis-assistant-message-loading/customElement.js +11 -10
- package/dist/components/arcgis-assistant-message-text/customElement.js +4 -4
- package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
- package/dist/components/arcgis-assistant-user-message/customElement.js +13 -10
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +4 -4
- package/dist/types/lumina.d.ts +2 -2
- package/dist/types/preact.d.ts +2 -2
- package/dist/types/react.d.ts +2 -2
- package/dist/types/stencil.d.ts +2 -2
- package/package.json +8 -6
- package/dist/agentic-workflow/nodes/support/Prompt.d.ts +0 -20
- package/dist/cdn/2GH3K5JP.js +0 -2
- package/dist/cdn/2SQKAJ73.js +0 -2
- package/dist/cdn/2Y4DTOGT.js +0 -2
- package/dist/cdn/3S5G5SIX.js +0 -2
- package/dist/cdn/5TI2F5XX.js +0 -2
- package/dist/cdn/BWLXDT75.js +0 -2
- package/dist/cdn/DCSZPL7R.js +0 -2
- package/dist/cdn/DOXBIASP.js +0 -18
- package/dist/cdn/FSGIG7UN.js +0 -2
- package/dist/cdn/GLBE7OW2.js +0 -2
- package/dist/cdn/KKLAQF3Z.js +0 -2
- package/dist/cdn/KLYNL2ZT.js +0 -2
- package/dist/cdn/LZP3OBKS.js +0 -3
- package/dist/cdn/OKMZQXBQ.js +0 -2
- package/dist/cdn/RCFAXADI.js +0 -2
- package/dist/cdn/T4ECSHM7.js +0 -2
- package/dist/cdn/WSHWQDO2.js +0 -2
- package/dist/cdn/XRE5USHA.js +0 -2
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { LitElement as
|
|
4
|
-
import { b as
|
|
5
|
-
import
|
|
2
|
+
import { c as q } from "../../chunks/runtime.js";
|
|
3
|
+
import { LitElement as M } from "@arcgis/lumina";
|
|
4
|
+
import { b as W, i as L } from "../../chunks/utils3.js";
|
|
5
|
+
import C from "@arcgis/core/portal/PortalItem.js";
|
|
6
6
|
import j from "@arcgis/core/portal/Portal.js";
|
|
7
7
|
import { property as n, subclass as l } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
8
|
-
import { BaseAgent as
|
|
9
|
-
import
|
|
8
|
+
import { BaseAgent as G } from "../../agent-utils/BaseAgent.js";
|
|
9
|
+
import b from "@arcgis/core/core/Error.js";
|
|
10
10
|
import { z as c } from "zod";
|
|
11
|
-
import { c as
|
|
12
|
-
import
|
|
13
|
-
import { LLMAgent as
|
|
14
|
-
import { PromptTemplate as
|
|
15
|
-
import { Annotation as
|
|
16
|
-
import { b as
|
|
11
|
+
import { c as B } from "../../chunks/graph.js";
|
|
12
|
+
import T from "@arcgis/core/core/Accessor.js";
|
|
13
|
+
import { LLMAgent as z } from "../../agent-utils/LLMAgent.js";
|
|
14
|
+
import { PromptTemplate as Z } from "@langchain/core/prompts";
|
|
15
|
+
import { Annotation as x } from "@langchain/langgraph";
|
|
16
|
+
import { b as H, d as U } from "../../chunks/state.js";
|
|
17
17
|
import "@arcgis/core/identity/IdentityManager.js";
|
|
18
18
|
import "@arcgis/core/request.js";
|
|
19
19
|
import "@langchain/langgraph/web";
|
|
@@ -25,13 +25,13 @@ import "@langchain/openai";
|
|
|
25
25
|
import "@arcgis/core/config.js";
|
|
26
26
|
import "@arcgis/core/core/reactiveUtils.js";
|
|
27
27
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
28
|
-
import { a as
|
|
29
|
-
var
|
|
30
|
-
for (var o = s > 1 ? void 0 : s ?
|
|
28
|
+
import { a as V } from "../../chunks/baseAgentState.js";
|
|
29
|
+
var K = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, f = (t, e, r, s) => {
|
|
30
|
+
for (var o = s > 1 ? void 0 : s ? Q(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
31
31
|
(i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
|
|
32
|
-
return s && o &&
|
|
32
|
+
return s && o && K(e, r, o), o;
|
|
33
33
|
};
|
|
34
|
-
let p = class extends
|
|
34
|
+
let p = class extends T {
|
|
35
35
|
//#region Lifecycle
|
|
36
36
|
constructor(t) {
|
|
37
37
|
super(t);
|
|
@@ -49,30 +49,30 @@ let p = class extends O {
|
|
|
49
49
|
}
|
|
50
50
|
//#endregion
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
f([
|
|
53
53
|
n()
|
|
54
54
|
], p.prototype, "id", 2);
|
|
55
|
-
|
|
55
|
+
f([
|
|
56
56
|
n()
|
|
57
57
|
], p.prototype, "sourceAnchorId", 2);
|
|
58
|
-
|
|
58
|
+
f([
|
|
59
59
|
n()
|
|
60
60
|
], p.prototype, "sourceNodeId", 2);
|
|
61
|
-
|
|
61
|
+
f([
|
|
62
62
|
n()
|
|
63
63
|
], p.prototype, "targetAnchorId", 2);
|
|
64
|
-
|
|
64
|
+
f([
|
|
65
65
|
n()
|
|
66
66
|
], p.prototype, "targetNodeId", 2);
|
|
67
|
-
p =
|
|
67
|
+
p = f([
|
|
68
68
|
l("Edge")
|
|
69
69
|
], p);
|
|
70
|
-
var
|
|
71
|
-
for (var o = s > 1 ? void 0 : s ?
|
|
70
|
+
var X = Object.defineProperty, Y = Object.getOwnPropertyDescriptor, v = (t, e, r, s) => {
|
|
71
|
+
for (var o = s > 1 ? void 0 : s ? Y(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
72
72
|
(i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
|
|
73
|
-
return s && o &&
|
|
73
|
+
return s && o && X(e, r, o), o;
|
|
74
74
|
};
|
|
75
|
-
let m = class extends
|
|
75
|
+
let m = class extends T {
|
|
76
76
|
//#region Lifecycle
|
|
77
77
|
constructor(t) {
|
|
78
78
|
super(t);
|
|
@@ -98,69 +98,32 @@ let m = class extends O {
|
|
|
98
98
|
//#region Private Methods
|
|
99
99
|
//#endregion
|
|
100
100
|
};
|
|
101
|
-
|
|
101
|
+
v([
|
|
102
102
|
n()
|
|
103
103
|
], m.prototype, "id", 2);
|
|
104
|
-
|
|
104
|
+
v([
|
|
105
105
|
n()
|
|
106
106
|
], m.prototype, "label", 2);
|
|
107
|
-
|
|
107
|
+
v([
|
|
108
108
|
n()
|
|
109
109
|
], m.prototype, "type", 2);
|
|
110
|
-
m =
|
|
110
|
+
m = v([
|
|
111
111
|
l("BaseNode")
|
|
112
112
|
], m);
|
|
113
|
-
var et = Object.defineProperty, ot = Object.getOwnPropertyDescriptor, T = (t, e, r, s) => {
|
|
114
|
-
for (var o = s > 1 ? void 0 : s ? ot(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
115
|
-
(i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
|
|
116
|
-
return s && o && et(e, r, o), o;
|
|
117
|
-
};
|
|
118
|
-
let u = class extends O {
|
|
119
|
-
//#region Lifecycle
|
|
120
|
-
constructor(t) {
|
|
121
|
-
super(t), this.messages = [];
|
|
122
|
-
}
|
|
123
|
-
//#endregion
|
|
124
|
-
//#region Public Methods
|
|
125
|
-
static fromJSON(t) {
|
|
126
|
-
const e = u._normalizeMessages(t.messages);
|
|
127
|
-
return new u({ id: t.id, messages: e });
|
|
128
|
-
}
|
|
129
|
-
//#endregion
|
|
130
|
-
//#region Private Methods
|
|
131
|
-
static _normalizeMessages(t) {
|
|
132
|
-
return Array.isArray(t) ? t.filter(
|
|
133
|
-
(e) => typeof e.content == "string"
|
|
134
|
-
).map((e) => ({
|
|
135
|
-
content: e.content,
|
|
136
|
-
role: e.role ?? "system"
|
|
137
|
-
})) : [];
|
|
138
|
-
}
|
|
139
|
-
//#endregion
|
|
140
|
-
};
|
|
141
|
-
T([
|
|
142
|
-
n()
|
|
143
|
-
], u.prototype, "id", 2);
|
|
144
|
-
T([
|
|
145
|
-
n()
|
|
146
|
-
], u.prototype, "messages", 2);
|
|
147
|
-
u = T([
|
|
148
|
-
l("Prompt")
|
|
149
|
-
], u);
|
|
150
113
|
function I(t) {
|
|
151
114
|
const e = new Set(t.required), r = Object.fromEntries(
|
|
152
115
|
Object.entries(t.properties).map(([s, o]) => {
|
|
153
|
-
const a =
|
|
116
|
+
const a = $(o);
|
|
154
117
|
return [s, e.has(s) ? a : a.optional()];
|
|
155
118
|
})
|
|
156
119
|
);
|
|
157
120
|
return c.object(r);
|
|
158
121
|
}
|
|
159
|
-
function
|
|
122
|
+
function $(t) {
|
|
160
123
|
let e;
|
|
161
124
|
switch (t.type) {
|
|
162
125
|
case "array":
|
|
163
|
-
e = c.array(t.items ?
|
|
126
|
+
e = c.array(t.items ? $(t.items) : c.unknown());
|
|
164
127
|
break;
|
|
165
128
|
case "boolean":
|
|
166
129
|
e = c.boolean();
|
|
@@ -180,7 +143,7 @@ function D(t) {
|
|
|
180
143
|
}
|
|
181
144
|
return t.description ? e.describe(t.description) : e;
|
|
182
145
|
}
|
|
183
|
-
const
|
|
146
|
+
const k = /* @__PURE__ */ new Map([
|
|
184
147
|
[
|
|
185
148
|
"clear_filters",
|
|
186
149
|
async () => (await import("../../agents/tools/filter/clearFilters/adapter.js")).clearFiltersTool
|
|
@@ -233,6 +196,14 @@ const rt = /* @__PURE__ */ new Map([
|
|
|
233
196
|
"go_to_zoom",
|
|
234
197
|
async () => (await import("../../agents/tools/navigation/goToZoom/adapter.js")).goToZoomTool
|
|
235
198
|
],
|
|
199
|
+
[
|
|
200
|
+
"find_relevant_fields",
|
|
201
|
+
async () => (await import("../../agents/tools/search/findRelevantFields/adapter.js")).findRelevantFieldsTool
|
|
202
|
+
],
|
|
203
|
+
[
|
|
204
|
+
"find_relevant_layers",
|
|
205
|
+
async () => (await import("../../agents/tools/search/findRelevantLayers/adapter.js")).findRelevantLayersTool
|
|
206
|
+
],
|
|
236
207
|
[
|
|
237
208
|
"get_attribute",
|
|
238
209
|
async () => (await import("../../agents/tools/query/getAttribute/adapter.js")).getAttributeTool
|
|
@@ -250,18 +221,18 @@ const rt = /* @__PURE__ */ new Map([
|
|
|
250
221
|
async () => (await import("../../agents/tools/query/queryFeatures/adapter.js")).queryFeaturesTool
|
|
251
222
|
]
|
|
252
223
|
]);
|
|
253
|
-
async function
|
|
254
|
-
const e =
|
|
224
|
+
async function tt(t) {
|
|
225
|
+
const e = k.get(t);
|
|
255
226
|
if (!e)
|
|
256
227
|
throw new Error(`ArcGIS tool is not supported in the browser runtime: ${t}`);
|
|
257
228
|
return await e();
|
|
258
229
|
}
|
|
259
|
-
var
|
|
260
|
-
for (var o = s > 1 ? void 0 : s ?
|
|
230
|
+
var et = Object.defineProperty, ot = Object.getOwnPropertyDescriptor, N = (t, e, r, s) => {
|
|
231
|
+
for (var o = s > 1 ? void 0 : s ? ot(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
261
232
|
(i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
|
|
262
|
-
return s && o &&
|
|
233
|
+
return s && o && et(e, r, o), o;
|
|
263
234
|
};
|
|
264
|
-
let
|
|
235
|
+
let d = class extends T {
|
|
265
236
|
//#region Lifecycle
|
|
266
237
|
constructor(t) {
|
|
267
238
|
super(t), this.type = "arcgis-tool";
|
|
@@ -271,57 +242,57 @@ let h = class extends O {
|
|
|
271
242
|
async createRuntimeTools() {
|
|
272
243
|
if (!this.name)
|
|
273
244
|
throw new Error("ArcgisTool name is required");
|
|
274
|
-
return [await
|
|
245
|
+
return [await tt(this.name)];
|
|
275
246
|
}
|
|
276
247
|
static fromJSON(t) {
|
|
277
|
-
return new
|
|
248
|
+
return new d({
|
|
278
249
|
name: t.name,
|
|
279
250
|
requireApproval: t.require_approval
|
|
280
251
|
});
|
|
281
252
|
}
|
|
282
253
|
//#endregion
|
|
283
254
|
};
|
|
284
|
-
|
|
255
|
+
N([
|
|
285
256
|
n()
|
|
286
|
-
],
|
|
287
|
-
|
|
257
|
+
], d.prototype, "name", 2);
|
|
258
|
+
N([
|
|
288
259
|
n()
|
|
289
|
-
],
|
|
290
|
-
|
|
260
|
+
], d.prototype, "requireApproval", 2);
|
|
261
|
+
N([
|
|
291
262
|
n()
|
|
292
|
-
],
|
|
293
|
-
|
|
263
|
+
], d.prototype, "type", 2);
|
|
264
|
+
d = N([
|
|
294
265
|
l("ArcgisTool")
|
|
295
|
-
],
|
|
296
|
-
var
|
|
266
|
+
], d);
|
|
267
|
+
var rt = Object.defineProperty, st = Object.getOwnPropertyDescriptor, J = (t) => {
|
|
297
268
|
throw TypeError(t);
|
|
298
|
-
},
|
|
299
|
-
for (var o = s > 1 ? void 0 : s ?
|
|
269
|
+
}, w = (t, e, r, s) => {
|
|
270
|
+
for (var o = s > 1 ? void 0 : s ? st(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
300
271
|
(i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
|
|
301
|
-
return s && o &&
|
|
302
|
-
},
|
|
303
|
-
let
|
|
272
|
+
return s && o && rt(e, r, o), o;
|
|
273
|
+
}, at = (t, e, r) => e.has(t) || J("Cannot " + r), it = (t, e, r) => e.has(t) ? J("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), nt = (t, e, r) => (at(t, e, "access private method"), r), S, R;
|
|
274
|
+
let u = class extends m {
|
|
304
275
|
//#region Lifecycle
|
|
305
276
|
constructor(t) {
|
|
306
|
-
super(t),
|
|
277
|
+
super(t), it(this, S), this.type = "agent-node";
|
|
307
278
|
}
|
|
308
279
|
//#endregion
|
|
309
280
|
//#region Public Methods
|
|
310
281
|
createRuntimeNode() {
|
|
311
282
|
let t;
|
|
312
283
|
return async (e, r) => {
|
|
313
|
-
t ??=
|
|
284
|
+
t ??= nt(this, S, R).call(this);
|
|
314
285
|
const o = await (await t).run(e, r), a = this.outputSchema?.safeParse(o);
|
|
315
286
|
if (a && !a.success)
|
|
316
287
|
throw a.error;
|
|
317
|
-
const i = a?.data,
|
|
288
|
+
const i = a?.data, O = i ?? o.outputMessage;
|
|
318
289
|
return {
|
|
319
290
|
agentExecutionContext: o.agentExecutionContext,
|
|
320
291
|
...i ? {} : { outputMessage: o.outputMessage },
|
|
321
292
|
status: o.status,
|
|
322
293
|
summary: o.summary,
|
|
323
294
|
nodes: {
|
|
324
|
-
[this.id]: { output:
|
|
295
|
+
[this.id]: { output: O }
|
|
325
296
|
}
|
|
326
297
|
};
|
|
327
298
|
};
|
|
@@ -344,22 +315,19 @@ let d = class extends m {
|
|
|
344
315
|
};
|
|
345
316
|
}
|
|
346
317
|
static fromJSON(t) {
|
|
347
|
-
const e = new
|
|
318
|
+
const e = new u({
|
|
348
319
|
id: t.id,
|
|
349
320
|
label: t.label,
|
|
321
|
+
prompt: t.prompt?.content,
|
|
350
322
|
type: "agent-node"
|
|
351
323
|
});
|
|
352
|
-
return t.
|
|
353
|
-
id: `prompt_${t.id}`,
|
|
354
|
-
type: "plain_text",
|
|
355
|
-
messages: [{ content: t.prompt, role: "system" }]
|
|
356
|
-
}) : e.prompt = u.fromJSON(t.prompt)), t.structured_output && (e.outputSchema = I(t.structured_output)), e.tools = t.tools?.filter((r) => r.type === "arcgis_tool").map((r) => h.fromJSON(r)), e;
|
|
324
|
+
return t.structured_output && (e.outputSchema = I(t.structured_output)), e.tools = t.tools?.filter((r) => r.type === "arcgis_tool").map((r) => d.fromJSON(r)), e;
|
|
357
325
|
}
|
|
358
326
|
//#endregion
|
|
359
327
|
};
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
const t = this.prompt
|
|
328
|
+
S = /* @__PURE__ */ new WeakSet();
|
|
329
|
+
R = async function() {
|
|
330
|
+
const t = this.prompt;
|
|
363
331
|
if (!t?.trim())
|
|
364
332
|
throw new Error(`WebAgent agent node "${this.id}" requires a prompt.`);
|
|
365
333
|
const e = [];
|
|
@@ -368,7 +336,7 @@ F = async function() {
|
|
|
368
336
|
const s = await r.createRuntimeTools();
|
|
369
337
|
e.push(...s);
|
|
370
338
|
}
|
|
371
|
-
return new
|
|
339
|
+
return new z({
|
|
372
340
|
name: this.id,
|
|
373
341
|
// TODO: change to label
|
|
374
342
|
outputSchema: this.outputSchema,
|
|
@@ -376,27 +344,27 @@ F = async function() {
|
|
|
376
344
|
tools: e
|
|
377
345
|
});
|
|
378
346
|
};
|
|
379
|
-
|
|
347
|
+
w([
|
|
380
348
|
n()
|
|
381
|
-
],
|
|
382
|
-
|
|
349
|
+
], u.prototype, "type", 2);
|
|
350
|
+
w([
|
|
383
351
|
n()
|
|
384
|
-
],
|
|
385
|
-
|
|
352
|
+
], u.prototype, "prompt", 2);
|
|
353
|
+
w([
|
|
386
354
|
n()
|
|
387
|
-
],
|
|
388
|
-
|
|
355
|
+
], u.prototype, "outputSchema", 2);
|
|
356
|
+
w([
|
|
389
357
|
n()
|
|
390
|
-
],
|
|
391
|
-
|
|
358
|
+
], u.prototype, "tools", 2);
|
|
359
|
+
u = w([
|
|
392
360
|
l("AgentNode")
|
|
393
|
-
],
|
|
394
|
-
var
|
|
395
|
-
for (var o = s > 1 ? void 0 : s ?
|
|
361
|
+
], u);
|
|
362
|
+
var ct = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, A = (t, e, r, s) => {
|
|
363
|
+
for (var o = s > 1 ? void 0 : s ? pt(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
396
364
|
(i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
|
|
397
|
-
return s && o &&
|
|
365
|
+
return s && o && ct(e, r, o), o;
|
|
398
366
|
};
|
|
399
|
-
let
|
|
367
|
+
let h = class extends m {
|
|
400
368
|
//#region Lifecycle
|
|
401
369
|
constructor(t) {
|
|
402
370
|
super(t), this.type = "end-message-node";
|
|
@@ -405,7 +373,7 @@ let g = class extends m {
|
|
|
405
373
|
//#region Public Methods
|
|
406
374
|
createRuntimeNode() {
|
|
407
375
|
return async (t) => {
|
|
408
|
-
const e = await
|
|
376
|
+
const e = await Z.fromTemplate(this.message, { templateFormat: "mustache" }).format(t);
|
|
409
377
|
return {
|
|
410
378
|
outputMessage: e,
|
|
411
379
|
status: "success",
|
|
@@ -420,7 +388,7 @@ let g = class extends m {
|
|
|
420
388
|
};
|
|
421
389
|
}
|
|
422
390
|
static fromJSON(t) {
|
|
423
|
-
const e = new
|
|
391
|
+
const e = new h({
|
|
424
392
|
id: t.id,
|
|
425
393
|
label: t.label,
|
|
426
394
|
type: "end-message-node"
|
|
@@ -431,21 +399,21 @@ let g = class extends m {
|
|
|
431
399
|
//#region Private Methods
|
|
432
400
|
//#endregion
|
|
433
401
|
};
|
|
434
|
-
|
|
402
|
+
A([
|
|
435
403
|
n()
|
|
436
|
-
],
|
|
437
|
-
|
|
404
|
+
], h.prototype, "type", 2);
|
|
405
|
+
A([
|
|
438
406
|
n()
|
|
439
|
-
],
|
|
440
|
-
|
|
407
|
+
], h.prototype, "message", 2);
|
|
408
|
+
h = A([
|
|
441
409
|
l("EndMessageNode")
|
|
442
|
-
],
|
|
443
|
-
var
|
|
444
|
-
for (var o = s > 1 ? void 0 : s ?
|
|
410
|
+
], h);
|
|
411
|
+
var mt = Object.defineProperty, ut = Object.getOwnPropertyDescriptor, D = (t, e, r, s) => {
|
|
412
|
+
for (var o = s > 1 ? void 0 : s ? ut(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
445
413
|
(i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
|
|
446
|
-
return s && o &&
|
|
414
|
+
return s && o && mt(e, r, o), o;
|
|
447
415
|
};
|
|
448
|
-
let
|
|
416
|
+
let _ = class extends m {
|
|
449
417
|
//#region Lifecycle
|
|
450
418
|
constructor(t) {
|
|
451
419
|
super(t), this.type = "start-node";
|
|
@@ -456,7 +424,7 @@ let w = class extends m {
|
|
|
456
424
|
return (t) => ({ question: t.agentExecutionContext.userRequest });
|
|
457
425
|
}
|
|
458
426
|
static fromJSON(t) {
|
|
459
|
-
return new
|
|
427
|
+
return new _({
|
|
460
428
|
id: t.id,
|
|
461
429
|
label: t.label,
|
|
462
430
|
type: "start-node"
|
|
@@ -466,47 +434,47 @@ let w = class extends m {
|
|
|
466
434
|
//#region Private Methods
|
|
467
435
|
//#endregion
|
|
468
436
|
};
|
|
469
|
-
|
|
437
|
+
D([
|
|
470
438
|
n()
|
|
471
|
-
],
|
|
472
|
-
|
|
439
|
+
], _.prototype, "type", 2);
|
|
440
|
+
_ = D([
|
|
473
441
|
l("StartNode")
|
|
474
|
-
],
|
|
475
|
-
function
|
|
442
|
+
], _);
|
|
443
|
+
function dt(t) {
|
|
476
444
|
switch (t.type) {
|
|
477
445
|
case "agent_node":
|
|
478
|
-
return
|
|
446
|
+
return u.fromJSON(t);
|
|
479
447
|
case "end_message_node":
|
|
480
|
-
return
|
|
448
|
+
return h.fromJSON(t);
|
|
481
449
|
case "start_node":
|
|
482
|
-
return
|
|
450
|
+
return _.fromJSON(t);
|
|
483
451
|
default:
|
|
484
452
|
throw new Error(`WebAgent node "${t.id}" uses unsupported type "${t.type}".`);
|
|
485
453
|
}
|
|
486
454
|
}
|
|
487
|
-
function
|
|
455
|
+
function lt(t = {}) {
|
|
488
456
|
const e = Object.keys(t);
|
|
489
|
-
if (
|
|
457
|
+
if (H(e), e.includes("nodes"))
|
|
490
458
|
throw new Error("node state cannot define reserved field: nodes.");
|
|
491
|
-
const r =
|
|
492
|
-
return
|
|
459
|
+
const r = U(t);
|
|
460
|
+
return x.Root({
|
|
493
461
|
...r,
|
|
494
|
-
nodes:
|
|
462
|
+
nodes: x({
|
|
495
463
|
reducer: (s, o) => ({ ...s, ...o }),
|
|
496
464
|
default: () => ({})
|
|
497
465
|
}),
|
|
498
|
-
...
|
|
466
|
+
...V()
|
|
499
467
|
});
|
|
500
468
|
}
|
|
501
|
-
function
|
|
469
|
+
function F(t) {
|
|
502
470
|
const e = /* @__PURE__ */ new Set();
|
|
503
471
|
for (const s of t)
|
|
504
472
|
for (const o of Object.keys(s.shape ?? {}))
|
|
505
473
|
o !== "nodes" && e.add(o);
|
|
506
474
|
const r = Object.fromEntries([...e].map((s) => [s, void 0]));
|
|
507
|
-
return
|
|
475
|
+
return lt(r);
|
|
508
476
|
}
|
|
509
|
-
class
|
|
477
|
+
class P {
|
|
510
478
|
//#endregion Private Properties
|
|
511
479
|
//#region Lifecycle
|
|
512
480
|
constructor(e, r, s) {
|
|
@@ -515,10 +483,10 @@ class x {
|
|
|
515
483
|
//#endregion Lifecycle
|
|
516
484
|
//#region Public Methods
|
|
517
485
|
static fromJSON(e) {
|
|
518
|
-
return new
|
|
486
|
+
return new P(
|
|
519
487
|
e,
|
|
520
488
|
e.graph.edges.map((r) => p.fromJSON(r)),
|
|
521
|
-
e.graph.nodes.map((r) =>
|
|
489
|
+
e.graph.nodes.map((r) => dt(r))
|
|
522
490
|
);
|
|
523
491
|
}
|
|
524
492
|
async load() {
|
|
@@ -541,13 +509,13 @@ class x {
|
|
|
541
509
|
}
|
|
542
510
|
generate() {
|
|
543
511
|
this._assertLoaded(), this._nodeCompilations = void 0;
|
|
544
|
-
const e = this._getNodeCompilations(), r =
|
|
545
|
-
for (const [i,
|
|
546
|
-
const
|
|
547
|
-
|
|
512
|
+
const e = this._getNodeCompilations(), r = F(this.getSchemas()), s = this.nodes.find((i) => i.type === "start-node")?.id, o = {}, a = [];
|
|
513
|
+
for (const [i, O] of this.nodes.entries()) {
|
|
514
|
+
const y = e[i];
|
|
515
|
+
y && (y.runtimeNode && (o[O.id] = y.runtimeNode), a.push(...y.edges));
|
|
548
516
|
}
|
|
549
517
|
return {
|
|
550
|
-
createGraph: () =>
|
|
518
|
+
createGraph: () => B(o, a, r, { entryNode: s }),
|
|
551
519
|
workspace: r
|
|
552
520
|
};
|
|
553
521
|
}
|
|
@@ -566,15 +534,15 @@ class x {
|
|
|
566
534
|
}
|
|
567
535
|
//#endregion Private Methods
|
|
568
536
|
}
|
|
569
|
-
var
|
|
570
|
-
for (var o = s > 1 ? void 0 : s ?
|
|
537
|
+
var ht = Object.defineProperty, gt = Object.getOwnPropertyDescriptor, E = (t, e, r, s) => {
|
|
538
|
+
for (var o = s > 1 ? void 0 : s ? gt(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
571
539
|
(i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
|
|
572
|
-
return s && o &&
|
|
540
|
+
return s && o && ht(e, r, o), o;
|
|
573
541
|
};
|
|
574
|
-
const
|
|
542
|
+
const ft = () => {
|
|
575
543
|
throw new Error("WebAgent must be loaded before it can run.");
|
|
576
544
|
};
|
|
577
|
-
let
|
|
545
|
+
let g = class extends G {
|
|
578
546
|
//#region Lifecycle
|
|
579
547
|
constructor(t) {
|
|
580
548
|
super(t);
|
|
@@ -586,17 +554,17 @@ let f = class extends B {
|
|
|
586
554
|
try {
|
|
587
555
|
await this.portalItem.load();
|
|
588
556
|
} catch (r) {
|
|
589
|
-
throw new
|
|
557
|
+
throw new b("web-agent:load-portal-item", "Failed to load portal item", { error: r });
|
|
590
558
|
}
|
|
591
559
|
const e = await this.portalItem.fetchData();
|
|
592
560
|
if (this.sourceJSON = e, !this.portalItem.title)
|
|
593
|
-
throw new
|
|
561
|
+
throw new b("web-agent:missing-title", "The portal item is missing a title");
|
|
594
562
|
}
|
|
595
563
|
if (!this.sourceJSON)
|
|
596
|
-
throw new
|
|
564
|
+
throw new b("web-agent:missing-source-json", "The source JSON is missing");
|
|
597
565
|
if (!this.sourceJSON.description)
|
|
598
|
-
throw new
|
|
599
|
-
const t =
|
|
566
|
+
throw new b("web-agent:missing-description", "The source JSON is missing a description");
|
|
567
|
+
const t = P.fromJSON(this.sourceJSON);
|
|
600
568
|
return await t.load(), this._runtime = t, this.description = this.sourceJSON.description, this.name = this.portalItem?.title ?? `web-agent-${Date.now()}`, this.generate(), this;
|
|
601
569
|
}
|
|
602
570
|
getSchemas() {
|
|
@@ -604,7 +572,7 @@ let f = class extends B {
|
|
|
604
572
|
}
|
|
605
573
|
generate() {
|
|
606
574
|
if (!this._runtime) {
|
|
607
|
-
this._set("workspace",
|
|
575
|
+
this._set("workspace", F([])), this._set("createGraph", ft);
|
|
608
576
|
return;
|
|
609
577
|
}
|
|
610
578
|
const { createGraph: t, workspace: e } = this._runtime.generate();
|
|
@@ -612,38 +580,38 @@ let f = class extends B {
|
|
|
612
580
|
}
|
|
613
581
|
//#endregion
|
|
614
582
|
};
|
|
615
|
-
|
|
616
|
-
n({ type:
|
|
617
|
-
],
|
|
618
|
-
|
|
583
|
+
E([
|
|
584
|
+
n({ type: C })
|
|
585
|
+
], g.prototype, "portalItem", 2);
|
|
586
|
+
E([
|
|
619
587
|
n()
|
|
620
|
-
],
|
|
621
|
-
|
|
588
|
+
], g.prototype, "sourceJSON", 2);
|
|
589
|
+
g = E([
|
|
622
590
|
l("WebAgent")
|
|
623
|
-
],
|
|
624
|
-
class
|
|
591
|
+
], g);
|
|
592
|
+
class _t extends M {
|
|
625
593
|
static {
|
|
626
594
|
this.properties = { agent: 0, context: 0, itemId: 1, workflow: 0 };
|
|
627
595
|
}
|
|
628
596
|
#t;
|
|
629
597
|
async getContext() {
|
|
630
|
-
return
|
|
598
|
+
return W(this.context) ? await this.context() : this.context;
|
|
631
599
|
}
|
|
632
600
|
async load() {
|
|
633
601
|
let e;
|
|
634
602
|
if (this.itemId) {
|
|
635
603
|
const r = j.getDefault();
|
|
636
|
-
e = new
|
|
637
|
-
} else this.workflow && (e = new
|
|
604
|
+
e = new g({ portalItem: new C({ id: this.itemId, portal: r }) });
|
|
605
|
+
} else this.workflow && (e = new g({ sourceJSON: this.workflow }));
|
|
638
606
|
if (e && (await e.load(), this.agent = e.registration), !this.agent)
|
|
639
607
|
throw new Error("Failed to initialize the assistant agent because the agent registration is missing.");
|
|
640
|
-
this.#t =
|
|
608
|
+
this.#t = L(this);
|
|
641
609
|
}
|
|
642
610
|
disconnectedCallback() {
|
|
643
611
|
this.#t?.unregister(this.agent.id), super.disconnectedCallback();
|
|
644
612
|
}
|
|
645
613
|
}
|
|
646
|
-
|
|
614
|
+
q("arcgis-assistant-agent", _t);
|
|
647
615
|
export {
|
|
648
|
-
|
|
616
|
+
_t as ArcgisAssistantAgent
|
|
649
617
|
};
|
|
@@ -13,11 +13,15 @@ export abstract class ArcgisAssistantInterrupt extends LitElement {
|
|
|
13
13
|
enterTextLabel: string;
|
|
14
14
|
submitButtonLabel: string;
|
|
15
15
|
cancelButtonLabel: string;
|
|
16
|
+
approveButtonLabel: string;
|
|
17
|
+
declineButtonLabel: string;
|
|
16
18
|
} & T9nMeta<{
|
|
17
19
|
optionsLabel: string;
|
|
18
20
|
enterTextLabel: string;
|
|
19
21
|
submitButtonLabel: string;
|
|
20
22
|
cancelButtonLabel: string;
|
|
23
|
+
approveButtonLabel: string;
|
|
24
|
+
declineButtonLabel: string;
|
|
21
25
|
}>;
|
|
22
26
|
accessor message: string | undefined;
|
|
23
27
|
accessor options: string[] | undefined;
|