@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.
Files changed (92) hide show
  1. package/dist/agentic-workflow/jsonTypes.d.ts +2 -12
  2. package/dist/agentic-workflow/nodes/AgentNode.d.ts +2 -3
  3. package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
  4. package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
  5. package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
  6. package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
  7. package/dist/cdn/3LILAJUD.js +2 -0
  8. package/dist/cdn/{GPZJANRQ.js → 4AGGYAWS.js} +1 -1
  9. package/dist/cdn/4F7Y4RNW.js +2 -0
  10. package/dist/cdn/{H6IJRTHM.js → 6ADMWEVE.js} +1 -1
  11. package/dist/cdn/{B6CJG5UH.js → 6U4GTCLJ.js} +14 -14
  12. package/dist/cdn/7BCQMK6D.js +2 -0
  13. package/dist/cdn/7QOC7FQE.js +2 -0
  14. package/dist/cdn/ADJ63EDN.js +3 -0
  15. package/dist/cdn/ATFNWFKG.js +2 -0
  16. package/dist/cdn/CZLLPKMS.js +2 -0
  17. package/dist/cdn/{JSMNXHYG.js → EAOKCWED.js} +6 -6
  18. package/dist/cdn/EBNVLMUU.js +2 -0
  19. package/dist/cdn/G5XE5D36.js +2 -0
  20. package/dist/cdn/{U3XIDLHO.js → HPU6K67Y.js} +1 -1
  21. package/dist/cdn/IBZ2NEAO.js +2 -0
  22. package/dist/cdn/{TYZ3FRGW.js → J4R7KYJ3.js} +6 -6
  23. package/dist/cdn/{GZGDLURS.js → KP2FWABJ.js} +1 -1
  24. package/dist/cdn/LM2IGECE.js +2 -0
  25. package/dist/cdn/LXQFE5PJ.js +2 -0
  26. package/dist/cdn/{GOKLRL6M.js → MAPKEX67.js} +1 -1
  27. package/dist/cdn/{EZYONVBU.js → MYH43WYG.js} +1 -1
  28. package/dist/cdn/NLEBWLVV.js +2 -0
  29. package/dist/cdn/{UB6PAQZ7.js → NPBXE4EQ.js} +1 -1
  30. package/dist/cdn/{FZ4CURWW.js → NZJ6LLYY.js} +1 -1
  31. package/dist/cdn/ORRMONGJ.js +2 -0
  32. package/dist/cdn/QUMNJVKX.js +2 -0
  33. package/dist/cdn/RHYNE5OE.js +2 -0
  34. package/dist/cdn/W7OT3KRG.js +18 -0
  35. package/dist/cdn/XCNN7BQ3.js +2 -0
  36. package/dist/cdn/{DUSILSNJ.js → XHGVCL22.js} +3 -3
  37. package/dist/cdn/XLHTQ7CF.js +2 -0
  38. package/dist/cdn/ZWBFTKHF.js +2 -0
  39. package/dist/cdn/agent-utils/index.js +1 -1
  40. package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
  41. package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
  42. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
  43. package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
  44. package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
  45. package/dist/cdn/index.js +1 -1
  46. package/dist/chunks/adapter.js +64 -67
  47. package/dist/chunks/converterUtils.js +66 -48
  48. package/dist/chunks/dataExplorationGraph.js +121 -195
  49. package/dist/chunks/fieldStatistics.js +79 -0
  50. package/dist/chunks/layerStylingGraph.js +9 -9
  51. package/dist/components/arcgis-assistant/customElement.d.ts +30 -1
  52. package/dist/components/arcgis-assistant/customElement.js +133 -135
  53. package/dist/components/arcgis-assistant-agent/customElement.js +152 -184
  54. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
  55. package/dist/components/arcgis-assistant-interrupt/customElement.js +10 -11
  56. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +12 -8
  57. package/dist/components/arcgis-assistant-message/customElement.d.ts +3 -0
  58. package/dist/components/arcgis-assistant-message/customElement.js +9 -8
  59. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +3 -0
  60. package/dist/components/arcgis-assistant-message-loading/customElement.js +11 -10
  61. package/dist/components/arcgis-assistant-message-text/customElement.js +4 -4
  62. package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
  63. package/dist/components/arcgis-assistant-user-message/customElement.js +13 -10
  64. package/dist/docs/api.json +1 -1
  65. package/dist/docs/docs.json +1 -1
  66. package/dist/docs/vscode.html-custom-data.json +1 -1
  67. package/dist/docs/web-types.json +1 -1
  68. package/dist/loader.js +4 -4
  69. package/dist/types/lumina.d.ts +2 -2
  70. package/dist/types/preact.d.ts +2 -2
  71. package/dist/types/react.d.ts +2 -2
  72. package/dist/types/stencil.d.ts +2 -2
  73. package/package.json +8 -6
  74. package/dist/agentic-workflow/nodes/support/Prompt.d.ts +0 -20
  75. package/dist/cdn/2GH3K5JP.js +0 -2
  76. package/dist/cdn/2SQKAJ73.js +0 -2
  77. package/dist/cdn/2Y4DTOGT.js +0 -2
  78. package/dist/cdn/3S5G5SIX.js +0 -2
  79. package/dist/cdn/5TI2F5XX.js +0 -2
  80. package/dist/cdn/BWLXDT75.js +0 -2
  81. package/dist/cdn/DCSZPL7R.js +0 -2
  82. package/dist/cdn/DOXBIASP.js +0 -18
  83. package/dist/cdn/FSGIG7UN.js +0 -2
  84. package/dist/cdn/GLBE7OW2.js +0 -2
  85. package/dist/cdn/KKLAQF3Z.js +0 -2
  86. package/dist/cdn/KLYNL2ZT.js +0 -2
  87. package/dist/cdn/LZP3OBKS.js +0 -3
  88. package/dist/cdn/OKMZQXBQ.js +0 -2
  89. package/dist/cdn/RCFAXADI.js +0 -2
  90. package/dist/cdn/T4ECSHM7.js +0 -2
  91. package/dist/cdn/WSHWQDO2.js +0 -2
  92. 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 W } from "../../chunks/runtime.js";
3
- import { LitElement as L } from "@arcgis/lumina";
4
- import { b as G, i as z } from "../../chunks/utils3.js";
5
- import J from "@arcgis/core/portal/PortalItem.js";
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 B } from "../../agent-utils/BaseAgent.js";
9
- import v from "@arcgis/core/core/Error.js";
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 Z } from "../../chunks/graph.js";
12
- import O from "@arcgis/core/core/Accessor.js";
13
- import { LLMAgent as H } from "../../agent-utils/LLMAgent.js";
14
- import { PromptTemplate as U } from "@langchain/core/prompts";
15
- import { Annotation as C } from "@langchain/langgraph";
16
- import { b as V, d as K } from "../../chunks/state.js";
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 Q } from "../../chunks/baseAgentState.js";
29
- var X = Object.defineProperty, Y = Object.getOwnPropertyDescriptor, _ = (t, e, r, s) => {
30
- for (var o = s > 1 ? void 0 : s ? Y(e, r) : e, a = t.length - 1, i; a >= 0; a--)
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 && X(e, r, o), o;
32
+ return s && o && K(e, r, o), o;
33
33
  };
34
- let p = class extends O {
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 k = Object.defineProperty, tt = Object.getOwnPropertyDescriptor, N = (t, e, r, s) => {
71
- for (var o = s > 1 ? void 0 : s ? tt(e, r) : e, a = t.length - 1, i; a >= 0; a--)
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 && k(e, r, o), o;
73
+ return s && o && X(e, r, o), o;
74
74
  };
75
- let m = class extends O {
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
- N([
101
+ v([
102
102
  n()
103
103
  ], m.prototype, "id", 2);
104
- N([
104
+ v([
105
105
  n()
106
106
  ], m.prototype, "label", 2);
107
- N([
107
+ v([
108
108
  n()
109
109
  ], m.prototype, "type", 2);
110
- m = N([
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 = D(o);
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 D(t) {
122
+ function $(t) {
160
123
  let e;
161
124
  switch (t.type) {
162
125
  case "array":
163
- e = c.array(t.items ? D(t.items) : c.unknown());
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 rt = /* @__PURE__ */ new Map([
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 st(t) {
254
- const e = rt.get(t);
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 at = Object.defineProperty, it = Object.getOwnPropertyDescriptor, S = (t, e, r, s) => {
260
- for (var o = s > 1 ? void 0 : s ? it(e, r) : e, a = t.length - 1, i; a >= 0; a--)
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 && at(e, r, o), o;
233
+ return s && o && et(e, r, o), o;
263
234
  };
264
- let h = class extends O {
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 st(this.name)];
245
+ return [await tt(this.name)];
275
246
  }
276
247
  static fromJSON(t) {
277
- return new h({
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
- S([
255
+ N([
285
256
  n()
286
- ], h.prototype, "name", 2);
287
- S([
257
+ ], d.prototype, "name", 2);
258
+ N([
288
259
  n()
289
- ], h.prototype, "requireApproval", 2);
290
- S([
260
+ ], d.prototype, "requireApproval", 2);
261
+ N([
291
262
  n()
292
- ], h.prototype, "type", 2);
293
- h = S([
263
+ ], d.prototype, "type", 2);
264
+ d = N([
294
265
  l("ArcgisTool")
295
- ], h);
296
- var nt = Object.defineProperty, ct = Object.getOwnPropertyDescriptor, R = (t) => {
266
+ ], d);
267
+ var rt = Object.defineProperty, st = Object.getOwnPropertyDescriptor, J = (t) => {
297
268
  throw TypeError(t);
298
- }, y = (t, e, r, s) => {
299
- for (var o = s > 1 ? void 0 : s ? ct(e, r) : e, a = t.length - 1, i; a >= 0; a--)
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 && nt(e, r, o), o;
302
- }, pt = (t, e, r) => e.has(t) || R("Cannot " + r), mt = (t, e, r) => e.has(t) ? R("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), ut = (t, e, r) => (pt(t, e, "access private method"), r), P, F;
303
- let d = class extends m {
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), mt(this, P), this.type = "agent-node";
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 ??= ut(this, P, F).call(this);
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, A = i ?? o.outputMessage;
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: A }
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 d({
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.prompt && (typeof t.prompt == "string" ? e.prompt = u.fromJSON({
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
- P = /* @__PURE__ */ new WeakSet();
361
- F = async function() {
362
- const t = this.prompt?.messages?.[0].content;
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 H({
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
- y([
347
+ w([
380
348
  n()
381
- ], d.prototype, "type", 2);
382
- y([
349
+ ], u.prototype, "type", 2);
350
+ w([
383
351
  n()
384
- ], d.prototype, "prompt", 2);
385
- y([
352
+ ], u.prototype, "prompt", 2);
353
+ w([
386
354
  n()
387
- ], d.prototype, "outputSchema", 2);
388
- y([
355
+ ], u.prototype, "outputSchema", 2);
356
+ w([
389
357
  n()
390
- ], d.prototype, "tools", 2);
391
- d = y([
358
+ ], u.prototype, "tools", 2);
359
+ u = w([
392
360
  l("AgentNode")
393
- ], d);
394
- var dt = Object.defineProperty, lt = Object.getOwnPropertyDescriptor, E = (t, e, r, s) => {
395
- for (var o = s > 1 ? void 0 : s ? lt(e, r) : e, a = t.length - 1, i; a >= 0; a--)
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 && dt(e, r, o), o;
365
+ return s && o && ct(e, r, o), o;
398
366
  };
399
- let g = class extends m {
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 U.fromTemplate(this.message, { templateFormat: "mustache" }).format(t);
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 g({
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
- E([
402
+ A([
435
403
  n()
436
- ], g.prototype, "type", 2);
437
- E([
404
+ ], h.prototype, "type", 2);
405
+ A([
438
406
  n()
439
- ], g.prototype, "message", 2);
440
- g = E([
407
+ ], h.prototype, "message", 2);
408
+ h = A([
441
409
  l("EndMessageNode")
442
- ], g);
443
- var ht = Object.defineProperty, gt = Object.getOwnPropertyDescriptor, q = (t, e, r, s) => {
444
- for (var o = s > 1 ? void 0 : s ? gt(e, r) : e, a = t.length - 1, i; a >= 0; a--)
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 && ht(e, r, o), o;
414
+ return s && o && mt(e, r, o), o;
447
415
  };
448
- let w = class extends m {
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 w({
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
- q([
437
+ D([
470
438
  n()
471
- ], w.prototype, "type", 2);
472
- w = q([
439
+ ], _.prototype, "type", 2);
440
+ _ = D([
473
441
  l("StartNode")
474
- ], w);
475
- function ft(t) {
442
+ ], _);
443
+ function dt(t) {
476
444
  switch (t.type) {
477
445
  case "agent_node":
478
- return d.fromJSON(t);
446
+ return u.fromJSON(t);
479
447
  case "end_message_node":
480
- return g.fromJSON(t);
448
+ return h.fromJSON(t);
481
449
  case "start_node":
482
- return w.fromJSON(t);
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 _t(t = {}) {
455
+ function lt(t = {}) {
488
456
  const e = Object.keys(t);
489
- if (V(e), e.includes("nodes"))
457
+ if (H(e), e.includes("nodes"))
490
458
  throw new Error("node state cannot define reserved field: nodes.");
491
- const r = K(t);
492
- return C.Root({
459
+ const r = U(t);
460
+ return x.Root({
493
461
  ...r,
494
- nodes: C({
462
+ nodes: x({
495
463
  reducer: (s, o) => ({ ...s, ...o }),
496
464
  default: () => ({})
497
465
  }),
498
- ...Q()
466
+ ...V()
499
467
  });
500
468
  }
501
- function M(t) {
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 _t(r);
475
+ return lt(r);
508
476
  }
509
- class x {
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 x(
486
+ return new P(
519
487
  e,
520
488
  e.graph.edges.map((r) => p.fromJSON(r)),
521
- e.graph.nodes.map((r) => ft(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 = M(this.getSchemas()), s = this.nodes.find((i) => i.type === "start-node")?.id, o = {}, a = [];
545
- for (const [i, A] of this.nodes.entries()) {
546
- const b = e[i];
547
- b && (b.runtimeNode && (o[A.id] = b.runtimeNode), a.push(...b.edges));
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: () => Z(o, a, r, { entryNode: s }),
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 wt = Object.defineProperty, yt = Object.getOwnPropertyDescriptor, $ = (t, e, r, s) => {
570
- for (var o = s > 1 ? void 0 : s ? yt(e, r) : e, a = t.length - 1, i; a >= 0; a--)
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 && wt(e, r, o), o;
540
+ return s && o && ht(e, r, o), o;
573
541
  };
574
- const bt = () => {
542
+ const ft = () => {
575
543
  throw new Error("WebAgent must be loaded before it can run.");
576
544
  };
577
- let f = class extends B {
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 v("web-agent:load-portal-item", "Failed to load portal item", { error: r });
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 v("web-agent:missing-title", "The portal item is missing a title");
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 v("web-agent:missing-source-json", "The source JSON is missing");
564
+ throw new b("web-agent:missing-source-json", "The source JSON is missing");
597
565
  if (!this.sourceJSON.description)
598
- throw new v("web-agent:missing-description", "The source JSON is missing a description");
599
- const t = x.fromJSON(this.sourceJSON);
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", M([])), this._set("createGraph", bt);
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: J })
617
- ], f.prototype, "portalItem", 2);
618
- $([
583
+ E([
584
+ n({ type: C })
585
+ ], g.prototype, "portalItem", 2);
586
+ E([
619
587
  n()
620
- ], f.prototype, "sourceJSON", 2);
621
- f = $([
588
+ ], g.prototype, "sourceJSON", 2);
589
+ g = E([
622
590
  l("WebAgent")
623
- ], f);
624
- class vt extends L {
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 G(this.context) ? await this.context() : this.context;
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 f({ portalItem: new J({ id: this.itemId, portal: r }) });
637
- } else this.workflow && (e = new f({ sourceJSON: this.workflow }));
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 = z(this);
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
- W("arcgis-assistant-agent", vt);
614
+ q("arcgis-assistant-agent", _t);
647
615
  export {
648
- vt as ArcgisAssistantAgent
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;