@arcgis/ai-components 5.2.0-next.72 → 5.2.0-next.74

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 (147) hide show
  1. package/dist/agent-utils/LLMAgent.d.ts +5 -2
  2. package/dist/agent-utils/LLMAgent.js +1 -1
  3. package/dist/agentic-workflow/jsonTypes.d.ts +8 -1
  4. package/dist/agentic-workflow/nodes/AgentNode.d.ts +2 -0
  5. package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
  6. package/dist/cdn/253R5CBD.js +2 -0
  7. package/dist/cdn/2VBPA27M.js +18 -0
  8. package/dist/cdn/{DWYODVWW.js → 323DHVYA.js} +5 -5
  9. package/dist/cdn/34O57OGV.js +2 -0
  10. package/dist/cdn/{FSMHR7GK.js → 4HDDRBIY.js} +1 -1
  11. package/dist/cdn/4MFEKBKL.js +11 -0
  12. package/dist/cdn/{Y5UFOH54.js → 4NJ2FF7H.js} +1 -1
  13. package/dist/cdn/4YXYLX4H.js +2 -0
  14. package/dist/cdn/5DVRVY4L.js +2 -0
  15. package/dist/cdn/5PJXNTLZ.js +2 -0
  16. package/dist/cdn/5R6QUF5B.js +2 -0
  17. package/dist/cdn/5RVELJU4.js +36 -0
  18. package/dist/cdn/5WLNL4HZ.js +2 -0
  19. package/dist/cdn/66SKMECC.js +2 -0
  20. package/dist/cdn/6CLF7KIK.js +2 -0
  21. package/dist/cdn/{S6ZAQRC6.js → 6KFMRBAA.js} +1 -1
  22. package/dist/cdn/77QFSIWW.js +5 -0
  23. package/dist/cdn/7E2QMWK6.js +2 -0
  24. package/dist/cdn/{HO2YDJI2.js → 7M6VKBTK.js} +1 -1
  25. package/dist/cdn/{HJG7QM2R.js → 7VAQUCBU.js} +1 -1
  26. package/dist/cdn/ACJTJLZN.js +2 -0
  27. package/dist/cdn/AI6DYOKR.js +181 -0
  28. package/dist/cdn/AT4XVTJR.js +44 -0
  29. package/dist/cdn/BS2PFNU4.js +2 -0
  30. package/dist/cdn/CCC6LBMY.js +2 -0
  31. package/dist/cdn/CGXQAB3A.js +2 -0
  32. package/dist/cdn/{M3MRIGDZ.js → CP5BVGJU.js} +1 -1
  33. package/dist/cdn/CWD37QFT.js +2 -0
  34. package/dist/cdn/DY36ATOA.js +2 -0
  35. package/dist/cdn/DYASSC7Z.js +2 -0
  36. package/dist/cdn/EAEQONP7.js +2 -0
  37. package/dist/cdn/EMLOVMD4.js +2 -0
  38. package/dist/cdn/EWLXNGKH.js +208 -0
  39. package/dist/cdn/FAR3DFFK.js +2 -0
  40. package/dist/cdn/FDOMMK2M.js +2 -0
  41. package/dist/cdn/GRHIFCQX.js +2 -0
  42. package/dist/cdn/{S3XUYAUX.js → HHFNQR6Z.js} +1 -1
  43. package/dist/cdn/{WQKNV6KK.js → HMUWQCXU.js} +1 -1
  44. package/dist/cdn/HZ5ARNAM.js +2 -0
  45. package/dist/cdn/I6PD2HSL.js +2 -0
  46. package/dist/cdn/IDUC4CPV.js +2 -0
  47. package/dist/cdn/IRNSIUBT.js +2 -0
  48. package/dist/cdn/{OYNIFMCJ.js → J6SZIQJA.js} +1 -1
  49. package/dist/cdn/K335IAIE.js +2 -0
  50. package/dist/cdn/K33MZ726.js +2 -0
  51. package/dist/cdn/KA3FF3ZO.js +2 -0
  52. package/dist/cdn/{DBHLKLKM.js → KPO4XX6J.js} +1 -1
  53. package/dist/cdn/{I4L45WQS.js → L7XTRDFM.js} +1 -1
  54. package/dist/cdn/LCFIADOZ.js +2 -0
  55. package/dist/cdn/MDM2K3U7.js +2 -0
  56. package/dist/cdn/MM33KJPF.js +2 -0
  57. package/dist/cdn/NIY32GK2.js +2 -0
  58. package/dist/cdn/{3ZPPYCNL.js → ONMNQBPO.js} +1 -1
  59. package/dist/cdn/ONQ6JSBJ.js +2 -0
  60. package/dist/cdn/{6QJFOL6M.js → OWTGH34K.js} +1 -1
  61. package/dist/cdn/{XPTCV6YV.js → PSYRZMX2.js} +1 -1
  62. package/dist/cdn/Q4IQUEZN.js +14 -0
  63. package/dist/cdn/QNNGPA3Q.js +2 -0
  64. package/dist/cdn/QRHZXLZN.js +2 -0
  65. package/dist/cdn/QVOMX3R6.js +2 -0
  66. package/dist/cdn/QZ3NQTNQ.js +2 -0
  67. package/dist/cdn/RADWN4ZP.js +2 -0
  68. package/dist/cdn/RU2T7GUX.js +2 -0
  69. package/dist/cdn/S6OYR4VI.js +156 -0
  70. package/dist/cdn/T2GJLEYV.js +2 -0
  71. package/dist/cdn/TKYI5QRL.js +2 -0
  72. package/dist/cdn/{5SFZS2RD.js → TQXLSW4A.js} +2 -2
  73. package/dist/cdn/{NJJYZP3R.js → U6FBRUM4.js} +1 -1
  74. package/dist/cdn/UIXX3XEN.js +2 -0
  75. package/dist/cdn/UPWAOZXQ.js +2 -0
  76. package/dist/cdn/{5SF6DEMO.js → VNJMTA6O.js} +1 -1
  77. package/dist/cdn/VOKXKU7M.js +56 -0
  78. package/dist/cdn/{33BF35AO.js → VYTYVWR6.js} +4 -4
  79. package/dist/cdn/WMZ24LWS.js +2 -0
  80. package/dist/cdn/{JYVBCHR6.js → WP7ORLSB.js} +1 -1
  81. package/dist/cdn/WS3T73IY.js +2 -0
  82. package/dist/cdn/{UZL6UVE4.js → ZLWWWTH4.js} +1 -1
  83. package/dist/cdn/{PAUIFUMO.js → ZQMBJ6MI.js} +1 -1
  84. package/dist/cdn/agent-utils/index.js +1 -1
  85. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +1 -1
  86. package/dist/cdn/agent-utils/middlewares/middleware.js +1 -1
  87. package/dist/cdn/agent-utils/middlewares/trace.js +1 -1
  88. package/dist/cdn/index.js +1 -1
  89. package/dist/chunks/adapter.js +938 -1938
  90. package/dist/chunks/adapter10.js +21 -0
  91. package/dist/chunks/adapter11.js +30 -0
  92. package/dist/chunks/adapter12.js +22 -0
  93. package/dist/chunks/adapter13.js +22 -0
  94. package/dist/chunks/adapter14.js +109 -0
  95. package/dist/chunks/adapter15.js +40 -0
  96. package/dist/chunks/adapter16.js +154 -0
  97. package/dist/chunks/adapter17.js +141 -0
  98. package/dist/chunks/adapter18.js +127 -0
  99. package/dist/chunks/adapter2.js +52 -0
  100. package/dist/chunks/adapter3.js +30 -0
  101. package/dist/chunks/adapter4.js +50 -0
  102. package/dist/chunks/adapter5.js +27 -0
  103. package/dist/chunks/adapter6.js +24 -0
  104. package/dist/chunks/adapter7.js +26 -0
  105. package/dist/chunks/adapter8.js +21 -0
  106. package/dist/chunks/adapter9.js +42 -0
  107. package/dist/chunks/arcgisKnowledgeGraph.js +5 -5
  108. package/dist/chunks/dataExplorationGraph.js +30 -27
  109. package/dist/chunks/fetchAgentContext.js +13 -0
  110. package/dist/chunks/fetchService.js +10 -0
  111. package/dist/chunks/formatFeatureAttributes.js +132 -0
  112. package/dist/chunks/generateLayerDescriptions.js +145 -148
  113. package/dist/chunks/helpGraph.js +11 -9
  114. package/dist/chunks/layerStylingGraph.js +22 -21
  115. package/dist/chunks/mergeWhereClauses.js +15 -0
  116. package/dist/chunks/navigationGraph.js +68 -57
  117. package/dist/chunks/types.js +59 -0
  118. package/dist/components/arcgis-assistant-agent/customElement.js +404 -279
  119. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +15 -5
  120. package/dist/components/arcgis-assistant-help-agent/customElement.js +21 -5
  121. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +39 -22
  122. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +22 -5
  123. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +13 -5
  124. package/dist/docs/api.json +1 -1
  125. package/dist/docs/docs.json +1 -1
  126. package/dist/docs/web-types.json +1 -1
  127. package/dist/types/stencil.d.ts +2 -2
  128. package/dist/utils/index.d.ts +4 -5
  129. package/dist/utils/index.js +19 -20
  130. package/package.json +8 -8
  131. package/dist/cdn/55M2HE4U.js +0 -2
  132. package/dist/cdn/5RZGG4F2.js +0 -2
  133. package/dist/cdn/BAB3MK4Y.js +0 -2
  134. package/dist/cdn/BMBV6Y2A.js +0 -2
  135. package/dist/cdn/D3RKQSWS.js +0 -2
  136. package/dist/cdn/E7KEOJZG.js +0 -208
  137. package/dist/cdn/IGQFAL3H.js +0 -2
  138. package/dist/cdn/LUY6V4TP.js +0 -181
  139. package/dist/cdn/NSXX2KYS.js +0 -2
  140. package/dist/cdn/OFRFP4BX.js +0 -2
  141. package/dist/cdn/OUFGJV3R.js +0 -2
  142. package/dist/cdn/RWM5T4XB.js +0 -180
  143. package/dist/cdn/SRFLL6ET.js +0 -2
  144. package/dist/cdn/WDOM6Z5O.js +0 -18
  145. package/dist/cdn/WZFC5HUX.js +0 -56
  146. package/dist/cdn/Z4XUJQ2I.js +0 -36
  147. package/dist/cdn/ZJEWP2ND.js +0 -44
@@ -1,19 +1,19 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { c as F } from "../../chunks/runtime.js";
3
- import { LitElement as q } from "@arcgis/lumina";
4
- import { b as G, i as L } from "../../chunks/utils2.js";
5
- import C from "@arcgis/core/portal/PortalItem.js";
6
- import T from "@arcgis/core/portal/Portal.js";
7
- import { property as i, subclass as h } from "@arcgis/core/core/accessorSupport/decorators.js";
8
- import { BaseAgent as j } from "../../agent-utils/BaseAgent.js";
9
- import b from "@arcgis/core/core/Error.js";
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/utils2.js";
5
+ import J from "@arcgis/core/portal/PortalItem.js";
6
+ import j from "@arcgis/core/portal/Portal.js";
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";
10
10
  import { z as c } from "zod";
11
- import { c as z } from "../../chunks/graph.js";
12
- import v from "@arcgis/core/core/Accessor.js";
13
- import { LLMAgent as B } 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 U, d as H } from "../../chunks/state.js";
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";
17
17
  import "@arcgis/core/identity/IdentityManager.js";
18
18
  import "@arcgis/core/request.js";
19
19
  import "@langchain/langgraph/web";
@@ -25,200 +25,315 @@ 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 K } from "../../chunks/baseAgentState.js";
29
- var Q = Object.defineProperty, V = Object.getOwnPropertyDescriptor, f = (e, t, s, o) => {
30
- for (var r = o > 1 ? void 0 : o ? V(t, s) : t, n = e.length - 1, a; n >= 0; n--)
31
- (a = e[n]) && (r = (o ? a(t, s, r) : a(r)) || r);
32
- return o && r && Q(t, s, r), r;
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--)
31
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
32
+ return s && o && X(e, r, o), o;
33
33
  };
34
- let p = class extends v {
34
+ let p = class extends O {
35
35
  //#region Lifecycle
36
- constructor(e) {
37
- super(e);
36
+ constructor(t) {
37
+ super(t);
38
38
  }
39
39
  //#endregion
40
40
  //#region Public Methods
41
- static fromJSON(e) {
41
+ static fromJSON(t) {
42
42
  return new p({
43
- id: e.id,
44
- sourceAnchorId: e.source_anchor_id,
45
- sourceNodeId: e.source_node_id,
46
- targetAnchorId: e.target_anchor_id,
47
- targetNodeId: e.target_node_id
43
+ id: t.id,
44
+ sourceAnchorId: t.source_anchor_id,
45
+ sourceNodeId: t.source_node_id,
46
+ targetAnchorId: t.target_anchor_id,
47
+ targetNodeId: t.target_node_id
48
48
  });
49
49
  }
50
50
  //#endregion
51
51
  };
52
- f([
53
- i()
52
+ _([
53
+ n()
54
54
  ], p.prototype, "id", 2);
55
- f([
56
- i()
55
+ _([
56
+ n()
57
57
  ], p.prototype, "sourceAnchorId", 2);
58
- f([
59
- i()
58
+ _([
59
+ n()
60
60
  ], p.prototype, "sourceNodeId", 2);
61
- f([
62
- i()
61
+ _([
62
+ n()
63
63
  ], p.prototype, "targetAnchorId", 2);
64
- f([
65
- i()
64
+ _([
65
+ n()
66
66
  ], p.prototype, "targetNodeId", 2);
67
- p = f([
68
- h("Edge")
67
+ p = _([
68
+ l("Edge")
69
69
  ], p);
70
- var X = Object.defineProperty, Y = Object.getOwnPropertyDescriptor, y = (e, t, s, o) => {
71
- for (var r = o > 1 ? void 0 : o ? Y(t, s) : t, n = e.length - 1, a; n >= 0; n--)
72
- (a = e[n]) && (r = (o ? a(t, s, r) : a(r)) || r);
73
- return o && r && X(t, s, r), r;
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--)
72
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
73
+ return s && o && k(e, r, o), o;
74
74
  };
75
- let d = class extends v {
75
+ let m = class extends O {
76
76
  //#region Lifecycle
77
- constructor(e) {
78
- super(e);
77
+ constructor(t) {
78
+ super(t);
79
79
  }
80
80
  //#endregion
81
81
  //#region Public Methods
82
82
  async load() {
83
83
  return await Promise.resolve(this);
84
84
  }
85
- compile(e) {
85
+ compile(t) {
86
86
  return {
87
87
  runtimeNode: this.createRuntimeNode(),
88
- edges: e.outgoingEdges.map((t) => ({
88
+ edges: t.outgoingEdges.map((e) => ({
89
89
  from: this.id,
90
- to: t.targetNodeId
90
+ to: e.targetNodeId
91
91
  }))
92
92
  };
93
93
  }
94
- static fromJSON(e) {
94
+ static fromJSON(t) {
95
95
  throw new Error("BaseNode is abstract and cannot be instantiated directly.");
96
96
  }
97
97
  //#endregion
98
98
  //#region Private Methods
99
99
  //#endregion
100
100
  };
101
- y([
102
- i()
103
- ], d.prototype, "id", 2);
104
- y([
105
- i()
106
- ], d.prototype, "label", 2);
107
- y([
108
- i()
109
- ], d.prototype, "type", 2);
110
- d = y([
111
- h("BaseNode")
112
- ], d);
113
- var k = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, S = (e, t, s, o) => {
114
- for (var r = o > 1 ? void 0 : o ? ee(t, s) : t, n = e.length - 1, a; n >= 0; n--)
115
- (a = e[n]) && (r = (o ? a(t, s, r) : a(r)) || r);
116
- return o && r && k(t, s, r), r;
101
+ N([
102
+ n()
103
+ ], m.prototype, "id", 2);
104
+ N([
105
+ n()
106
+ ], m.prototype, "label", 2);
107
+ N([
108
+ n()
109
+ ], m.prototype, "type", 2);
110
+ m = N([
111
+ l("BaseNode")
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
117
  };
118
- let m = class extends v {
118
+ let u = class extends O {
119
119
  //#region Lifecycle
120
- constructor(e) {
121
- super(e), this.messages = [];
120
+ constructor(t) {
121
+ super(t), this.messages = [];
122
122
  }
123
123
  //#endregion
124
124
  //#region Public Methods
125
- static fromJSON(e) {
126
- const t = m._normalizeMessages(e.messages);
127
- return new m({ id: e.id, messages: t });
125
+ static fromJSON(t) {
126
+ const e = u._normalizeMessages(t.messages);
127
+ return new u({ id: t.id, messages: e });
128
128
  }
129
129
  //#endregion
130
130
  //#region Private Methods
131
- static _normalizeMessages(e) {
132
- return Array.isArray(e) ? e.filter(
133
- (t) => typeof t.content == "string"
134
- ).map((t) => ({
135
- content: t.content,
136
- role: t.role ?? "system"
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
137
  })) : [];
138
138
  }
139
139
  //#endregion
140
140
  };
141
- S([
142
- i()
143
- ], m.prototype, "id", 2);
144
- S([
145
- i()
146
- ], m.prototype, "messages", 2);
147
- m = S([
148
- h("Prompt")
149
- ], m);
150
- function I(e) {
151
- const t = new Set(e.required), s = Object.fromEntries(
152
- Object.entries(e.properties).map(([o, r]) => {
153
- const n = J(r);
154
- return [o, t.has(o) ? n : n.optional()];
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
+ function I(t) {
151
+ const e = new Set(t.required), r = Object.fromEntries(
152
+ Object.entries(t.properties).map(([s, o]) => {
153
+ const a = D(o);
154
+ return [s, e.has(s) ? a : a.optional()];
155
155
  })
156
156
  );
157
- return c.object(s);
157
+ return c.object(r);
158
158
  }
159
- function J(e) {
160
- let t;
161
- switch (e.type) {
159
+ function D(t) {
160
+ let e;
161
+ switch (t.type) {
162
162
  case "array":
163
- t = c.array(e.items ? J(e.items) : c.unknown());
163
+ e = c.array(t.items ? D(t.items) : c.unknown());
164
164
  break;
165
165
  case "boolean":
166
- t = c.boolean();
166
+ e = c.boolean();
167
167
  break;
168
168
  case "number":
169
- t = c.number();
169
+ e = c.number();
170
170
  break;
171
171
  case "object":
172
- t = I({
173
- properties: e.properties ?? {},
174
- required: e.required
172
+ e = I({
173
+ properties: t.properties ?? {},
174
+ required: t.required
175
175
  });
176
176
  break;
177
177
  case "string":
178
- t = e.enum?.length ? c.enum(e.enum) : c.string();
178
+ e = t.enum?.length ? c.enum(t.enum) : c.string();
179
179
  break;
180
180
  }
181
- return e.description ? t.describe(e.description) : t;
181
+ return t.description ? e.describe(t.description) : e;
182
182
  }
183
- var te = Object.defineProperty, re = Object.getOwnPropertyDescriptor, $ = (e) => {
184
- throw TypeError(e);
185
- }, N = (e, t, s, o) => {
186
- for (var r = o > 1 ? void 0 : o ? re(t, s) : t, n = e.length - 1, a; n >= 0; n--)
187
- (a = e[n]) && (r = (o ? a(t, s, r) : a(r)) || r);
188
- return o && r && te(t, s, r), r;
189
- }, se = (e, t, s) => t.has(e) || $("Cannot " + s), oe = (e, t, s) => t.has(e) ? $("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), ne = (e, t, s) => (se(e, t, "access private method"), s), O, D;
190
- let u = class extends d {
183
+ const rt = /* @__PURE__ */ new Map([
184
+ [
185
+ "clear_filters",
186
+ async () => (await import("../../chunks/adapter12.js")).clearFiltersTool
187
+ ],
188
+ [
189
+ "reset_map",
190
+ async () => (await import("../../chunks/adapter13.js")).resetMapTool
191
+ ],
192
+ [
193
+ "set_feature_effect",
194
+ async () => (await import("../../chunks/adapter14.js")).setFeatureEffectTool
195
+ ],
196
+ [
197
+ "list_layer_fields",
198
+ async () => (await import("../../chunks/adapter11.js")).listLayerFieldsTool
199
+ ],
200
+ [
201
+ "go_to_address",
202
+ async () => (await import("../../chunks/adapter2.js")).goToAddressTool
203
+ ],
204
+ [
205
+ "go_to_bookmark",
206
+ async () => (await import("../../chunks/adapter3.js")).goToBookmarkTool
207
+ ],
208
+ [
209
+ "go_to_features",
210
+ async () => (await import("../../chunks/adapter4.js")).goToFeaturesTool
211
+ ],
212
+ [
213
+ "go_to_full_extent",
214
+ async () => (await import("../../chunks/adapter5.js")).goToFullExtentTool
215
+ ],
216
+ [
217
+ "go_to_home_extent",
218
+ async () => (await import("../../chunks/adapter6.js")).goToHomeExtentTool
219
+ ],
220
+ [
221
+ "go_to_layer",
222
+ async () => (await import("../../chunks/adapter7.js")).goToLayerTool
223
+ ],
224
+ [
225
+ "go_to_scale",
226
+ async () => (await import("../../chunks/adapter8.js")).goToScaleTool
227
+ ],
228
+ [
229
+ "go_to_viewpoint",
230
+ async () => (await import("../../chunks/adapter9.js")).goToViewpointTool
231
+ ],
232
+ [
233
+ "go_to_zoom",
234
+ async () => (await import("../../chunks/adapter10.js")).goToZoomTool
235
+ ],
236
+ [
237
+ "get_attribute",
238
+ async () => (await import("../../chunks/adapter15.js")).getAttributeTool
239
+ ],
240
+ [
241
+ "get_statistics",
242
+ async () => (await import("../../chunks/adapter16.js")).getStatisticsTool
243
+ ],
244
+ [
245
+ "get_top_features",
246
+ async () => (await import("../../chunks/adapter17.js")).getTopFeaturesTool
247
+ ],
248
+ [
249
+ "query_features",
250
+ async () => (await import("../../chunks/adapter18.js")).queryFeaturesTool
251
+ ]
252
+ ]);
253
+ async function st(t) {
254
+ const e = rt.get(t);
255
+ if (!e)
256
+ throw new Error(`ArcGIS tool is not supported in the browser runtime: ${t}`);
257
+ return await e();
258
+ }
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--)
261
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
262
+ return s && o && at(e, r, o), o;
263
+ };
264
+ let h = class extends O {
191
265
  //#region Lifecycle
192
- constructor(e) {
193
- super(e), oe(this, O), this.type = "agent-node";
266
+ constructor(t) {
267
+ super(t), this.type = "arcgis-tool";
268
+ }
269
+ //#endregion
270
+ //#region Public Methods
271
+ async createRuntimeTools() {
272
+ if (!this.name)
273
+ throw new Error("ArcgisTool name is required");
274
+ return [await st(this.name)];
275
+ }
276
+ static fromJSON(t) {
277
+ return new h({
278
+ name: t.name,
279
+ requireApproval: t.require_approval
280
+ });
281
+ }
282
+ //#endregion
283
+ };
284
+ S([
285
+ n()
286
+ ], h.prototype, "name", 2);
287
+ S([
288
+ n()
289
+ ], h.prototype, "requireApproval", 2);
290
+ S([
291
+ n()
292
+ ], h.prototype, "type", 2);
293
+ h = S([
294
+ l("ArcgisTool")
295
+ ], h);
296
+ var nt = Object.defineProperty, ct = Object.getOwnPropertyDescriptor, R = (t) => {
297
+ 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--)
300
+ (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 {
304
+ //#region Lifecycle
305
+ constructor(t) {
306
+ super(t), mt(this, P), this.type = "agent-node";
194
307
  }
195
308
  //#endregion
196
309
  //#region Public Methods
197
310
  createRuntimeNode() {
198
- return async (e, t) => {
199
- const o = await ne(this, O, D).call(this).run(e, t), r = this.outputSchema?.safeParse(o);
200
- if (r && !r.success)
201
- throw r.error;
202
- const n = r?.data, a = n ?? o.outputMessage;
311
+ let t;
312
+ return async (e, r) => {
313
+ t ??= ut(this, P, F).call(this);
314
+ const o = await (await t).run(e, r), a = this.outputSchema?.safeParse(o);
315
+ if (a && !a.success)
316
+ throw a.error;
317
+ const i = a?.data, A = i ?? o.outputMessage;
203
318
  return {
204
319
  agentExecutionContext: o.agentExecutionContext,
205
- ...n ? {} : { outputMessage: o.outputMessage },
320
+ ...i ? {} : { outputMessage: o.outputMessage },
206
321
  status: o.status,
207
322
  summary: o.summary,
208
323
  nodes: {
209
- [this.id]: { output: a }
324
+ [this.id]: { output: A }
210
325
  }
211
326
  };
212
327
  };
213
328
  }
214
- compile(e) {
215
- const t = e.outgoingEdges[0]?.targetNodeId;
329
+ compile(t) {
330
+ const e = t.outgoingEdges[0]?.targetNodeId;
216
331
  return {
217
332
  runtimeNode: this.createRuntimeNode(),
218
333
  edges: [
219
334
  {
220
335
  from: this.id,
221
- decide: (s) => s.status === "failed" ? void 0 : t
336
+ decide: (r) => r.status === "failed" ? void 0 : e
222
337
  }
223
338
  ],
224
339
  schemas: [
@@ -228,112 +343,122 @@ let u = class extends d {
228
343
  ]
229
344
  };
230
345
  }
231
- static fromJSON(e) {
232
- const t = new u({
233
- id: e.id,
234
- label: e.label,
346
+ static fromJSON(t) {
347
+ const e = new d({
348
+ id: t.id,
349
+ label: t.label,
235
350
  type: "agent-node"
236
351
  });
237
- return e.prompt && (typeof e.prompt == "string" ? t.prompt = m.fromJSON({
238
- id: `prompt_${e.id}`,
352
+ return t.prompt && (typeof t.prompt == "string" ? e.prompt = u.fromJSON({
353
+ id: `prompt_${t.id}`,
239
354
  type: "plain_text",
240
- messages: [{ content: e.prompt, role: "system" }]
241
- }) : t.prompt = m.fromJSON(e.prompt)), e.structured_output && (t.outputSchema = I(e.structured_output)), t;
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;
242
357
  }
243
358
  //#endregion
244
359
  };
245
- O = /* @__PURE__ */ new WeakSet();
246
- D = function() {
247
- const e = this.prompt?.messages?.[0].content;
248
- if (!e?.trim())
360
+ P = /* @__PURE__ */ new WeakSet();
361
+ F = async function() {
362
+ const t = this.prompt?.messages?.[0].content;
363
+ if (!t?.trim())
249
364
  throw new Error(`WebAgent agent node "${this.id}" requires a prompt.`);
250
- return new B({
365
+ const e = [];
366
+ if (this.tools)
367
+ for (const r of this.tools) {
368
+ const s = await r.createRuntimeTools();
369
+ e.push(...s);
370
+ }
371
+ return new H({
251
372
  name: this.id,
252
373
  // TODO: change to label
253
374
  outputSchema: this.outputSchema,
254
- prompt: e
375
+ prompt: t,
376
+ tools: e
255
377
  });
256
378
  };
257
- N([
258
- i()
259
- ], u.prototype, "type", 2);
260
- N([
261
- i()
262
- ], u.prototype, "prompt", 2);
263
- N([
264
- i()
265
- ], u.prototype, "outputSchema", 2);
266
- u = N([
267
- h("AgentNode")
268
- ], u);
269
- var ae = Object.defineProperty, ie = Object.getOwnPropertyDescriptor, P = (e, t, s, o) => {
270
- for (var r = o > 1 ? void 0 : o ? ie(t, s) : t, n = e.length - 1, a; n >= 0; n--)
271
- (a = e[n]) && (r = (o ? a(t, s, r) : a(r)) || r);
272
- return o && r && ae(t, s, r), r;
379
+ y([
380
+ n()
381
+ ], d.prototype, "type", 2);
382
+ y([
383
+ n()
384
+ ], d.prototype, "prompt", 2);
385
+ y([
386
+ n()
387
+ ], d.prototype, "outputSchema", 2);
388
+ y([
389
+ n()
390
+ ], d.prototype, "tools", 2);
391
+ d = y([
392
+ 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--)
396
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
397
+ return s && o && dt(e, r, o), o;
273
398
  };
274
- let l = class extends d {
399
+ let g = class extends m {
275
400
  //#region Lifecycle
276
- constructor(e) {
277
- super(e), this.type = "end-message-node";
401
+ constructor(t) {
402
+ super(t), this.type = "end-message-node";
278
403
  }
279
404
  //#endregion
280
405
  //#region Public Methods
281
406
  createRuntimeNode() {
282
- return async (e) => {
283
- const t = await Z.fromTemplate(this.message, { templateFormat: "mustache" }).format(e);
407
+ return async (t) => {
408
+ const e = await U.fromTemplate(this.message, { templateFormat: "mustache" }).format(t);
284
409
  return {
285
- outputMessage: t,
410
+ outputMessage: e,
286
411
  status: "success",
287
- summary: t
412
+ summary: e
288
413
  };
289
414
  };
290
415
  }
291
- compile(e) {
416
+ compile(t) {
292
417
  return {
293
418
  runtimeNode: this.createRuntimeNode(),
294
419
  edges: []
295
420
  };
296
421
  }
297
- static fromJSON(e) {
298
- const t = new l({
299
- id: e.id,
300
- label: e.label,
422
+ static fromJSON(t) {
423
+ const e = new g({
424
+ id: t.id,
425
+ label: t.label,
301
426
  type: "end-message-node"
302
427
  });
303
- return t.message = e.message, t;
428
+ return e.message = t.message, e;
304
429
  }
305
430
  //#endregion
306
431
  //#region Private Methods
307
432
  //#endregion
308
433
  };
309
- P([
310
- i()
311
- ], l.prototype, "type", 2);
312
- P([
313
- i()
314
- ], l.prototype, "message", 2);
315
- l = P([
316
- h("EndMessageNode")
317
- ], l);
318
- var ce = Object.defineProperty, pe = Object.getOwnPropertyDescriptor, R = (e, t, s, o) => {
319
- for (var r = o > 1 ? void 0 : o ? pe(t, s) : t, n = e.length - 1, a; n >= 0; n--)
320
- (a = e[n]) && (r = (o ? a(t, s, r) : a(r)) || r);
321
- return o && r && ce(t, s, r), r;
434
+ E([
435
+ n()
436
+ ], g.prototype, "type", 2);
437
+ E([
438
+ n()
439
+ ], g.prototype, "message", 2);
440
+ g = E([
441
+ 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--)
445
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
446
+ return s && o && ht(e, r, o), o;
322
447
  };
323
- let _ = class extends d {
448
+ let w = class extends m {
324
449
  //#region Lifecycle
325
- constructor(e) {
326
- super(e), this.type = "start-node";
450
+ constructor(t) {
451
+ super(t), this.type = "start-node";
327
452
  }
328
453
  //#endregion
329
454
  //#region Public Methods
330
455
  createRuntimeNode() {
331
- return (e) => ({ question: e.agentExecutionContext.userRequest });
456
+ return (t) => ({ question: t.agentExecutionContext.userRequest });
332
457
  }
333
- static fromJSON(e) {
334
- return new _({
335
- id: e.id,
336
- label: e.label,
458
+ static fromJSON(t) {
459
+ return new w({
460
+ id: t.id,
461
+ label: t.label,
337
462
  type: "start-node"
338
463
  });
339
464
  }
@@ -341,89 +466,89 @@ let _ = class extends d {
341
466
  //#region Private Methods
342
467
  //#endregion
343
468
  };
344
- R([
345
- i()
346
- ], _.prototype, "type", 2);
347
- _ = R([
348
- h("StartNode")
349
- ], _);
350
- function de(e) {
351
- switch (e.type) {
469
+ q([
470
+ n()
471
+ ], w.prototype, "type", 2);
472
+ w = q([
473
+ l("StartNode")
474
+ ], w);
475
+ function ft(t) {
476
+ switch (t.type) {
352
477
  case "agent_node":
353
- return u.fromJSON(e);
478
+ return d.fromJSON(t);
354
479
  case "end_message_node":
355
- return l.fromJSON(e);
480
+ return g.fromJSON(t);
356
481
  case "start_node":
357
- return _.fromJSON(e);
482
+ return w.fromJSON(t);
358
483
  default:
359
- throw new Error(`WebAgent node "${e.id}" uses unsupported type "${e.type}".`);
484
+ throw new Error(`WebAgent node "${t.id}" uses unsupported type "${t.type}".`);
360
485
  }
361
486
  }
362
- function me(e = {}) {
363
- const t = Object.keys(e);
364
- if (U(t), t.includes("nodes"))
487
+ function _t(t = {}) {
488
+ const e = Object.keys(t);
489
+ if (V(e), e.includes("nodes"))
365
490
  throw new Error("node state cannot define reserved field: nodes.");
366
- const s = H(e);
367
- return x.Root({
368
- ...s,
369
- nodes: x({
370
- reducer: (o, r) => ({ ...o, ...r }),
491
+ const r = K(t);
492
+ return C.Root({
493
+ ...r,
494
+ nodes: C({
495
+ reducer: (s, o) => ({ ...s, ...o }),
371
496
  default: () => ({})
372
497
  }),
373
- ...K()
498
+ ...Q()
374
499
  });
375
500
  }
376
- function M(e) {
377
- const t = /* @__PURE__ */ new Set();
378
- for (const o of e)
379
- for (const r of Object.keys(o.shape ?? {}))
380
- r !== "nodes" && t.add(r);
381
- const s = Object.fromEntries([...t].map((o) => [o, void 0]));
382
- return me(s);
501
+ function M(t) {
502
+ const e = /* @__PURE__ */ new Set();
503
+ for (const s of t)
504
+ for (const o of Object.keys(s.shape ?? {}))
505
+ o !== "nodes" && e.add(o);
506
+ const r = Object.fromEntries([...e].map((s) => [s, void 0]));
507
+ return _t(r);
383
508
  }
384
- class A {
509
+ class x {
385
510
  //#endregion Private Properties
386
511
  //#region Lifecycle
387
- constructor(t, s, o) {
388
- this.sourceJSON = t, this.edges = s, this.nodes = o, this._loaded = !1;
512
+ constructor(e, r, s) {
513
+ this.sourceJSON = e, this.edges = r, this.nodes = s, this._loaded = !1;
389
514
  }
390
515
  //#endregion Lifecycle
391
516
  //#region Public Methods
392
- static fromJSON(t) {
393
- return new A(
394
- t,
395
- t.graph.edges.map((s) => p.fromJSON(s)),
396
- t.graph.nodes.map((s) => de(s))
517
+ static fromJSON(e) {
518
+ return new x(
519
+ e,
520
+ e.graph.edges.map((r) => p.fromJSON(r)),
521
+ e.graph.nodes.map((r) => ft(r))
397
522
  );
398
523
  }
399
524
  async load() {
400
- return this._loadPromise ??= Promise.all(this.nodes.map(async (t) => await t.load())).then(() => {
525
+ return this._loadPromise ??= Promise.all(this.nodes.map(async (e) => await e.load())).then(() => {
401
526
  this._loaded = !0;
402
527
  }), await this._loadPromise, this;
403
528
  }
404
529
  getSchemas() {
405
- const t = Object.fromEntries(
406
- this._getNodeCompilations().flatMap((o, r) => {
407
- const n = this.nodes[r];
408
- return o.schemas?.map((a) => [n.id, a]) ?? [];
530
+ const e = Object.fromEntries(
531
+ this._getNodeCompilations().flatMap((s, o) => {
532
+ const a = this.nodes[o];
533
+ return s.schemas?.map((i) => [a.id, i]) ?? [];
409
534
  })
410
535
  );
411
536
  return [c.object({
412
537
  loopCounts: c.record(c.string(), c.number()).optional(),
413
- nodes: c.object(t).partial().optional(),
538
+ nodes: c.object(e).partial().optional(),
414
539
  question: c.string().optional()
415
540
  })];
416
541
  }
417
542
  generate() {
418
543
  this._assertLoaded(), this._nodeCompilations = void 0;
419
- const t = this._getNodeCompilations(), s = M(this.getSchemas()), o = this.nodes.find((a) => a.type === "start-node")?.id, r = {}, n = [];
420
- for (const [a, W] of this.nodes.entries()) {
421
- const w = t[a];
422
- w && (w.runtimeNode && (r[W.id] = w.runtimeNode), n.push(...w.edges));
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));
423
548
  }
424
549
  return {
425
- createGraph: () => z(r, n, s, { entryNode: o }),
426
- workspace: s
550
+ createGraph: () => Z(o, a, r, { entryNode: s }),
551
+ workspace: r
427
552
  };
428
553
  }
429
554
  //#endregion Public Methods
@@ -434,25 +559,25 @@ class A {
434
559
  }
435
560
  _getNodeCompilations() {
436
561
  return this._assertLoaded(), this._nodeCompilations ??= this.nodes.map(
437
- (t) => t.compile({
438
- outgoingEdges: this.edges.filter((s) => s.sourceNodeId === t.id)
562
+ (e) => e.compile({
563
+ outgoingEdges: this.edges.filter((r) => r.sourceNodeId === e.id)
439
564
  })
440
565
  );
441
566
  }
442
567
  //#endregion Private Methods
443
568
  }
444
- var ue = Object.defineProperty, he = Object.getOwnPropertyDescriptor, E = (e, t, s, o) => {
445
- for (var r = o > 1 ? void 0 : o ? he(t, s) : t, n = e.length - 1, a; n >= 0; n--)
446
- (a = e[n]) && (r = (o ? a(t, s, r) : a(r)) || r);
447
- return o && r && ue(t, s, r), r;
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--)
571
+ (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
572
+ return s && o && wt(e, r, o), o;
448
573
  };
449
- const le = () => {
574
+ const bt = () => {
450
575
  throw new Error("WebAgent must be loaded before it can run.");
451
576
  };
452
- let g = class extends j {
577
+ let f = class extends B {
453
578
  //#region Lifecycle
454
- constructor(e) {
455
- super(e);
579
+ constructor(t) {
580
+ super(t);
456
581
  }
457
582
  //#endregion
458
583
  //#region Public Methods
@@ -460,65 +585,65 @@ let g = class extends j {
460
585
  if (this.portalItem) {
461
586
  try {
462
587
  await this.portalItem.load();
463
- } catch (s) {
464
- throw new b("web-agent:load-portal-item", "Failed to load portal item", { error: s });
588
+ } catch (r) {
589
+ throw new v("web-agent:load-portal-item", "Failed to load portal item", { error: r });
465
590
  }
466
- const t = await this.portalItem.fetchData();
467
- if (this.sourceJSON = t, !this.portalItem.title)
468
- throw new b("web-agent:missing-title", "The portal item is missing a title");
591
+ const e = await this.portalItem.fetchData();
592
+ if (this.sourceJSON = e, !this.portalItem.title)
593
+ throw new v("web-agent:missing-title", "The portal item is missing a title");
469
594
  }
470
595
  if (!this.sourceJSON)
471
- throw new b("web-agent:missing-source-json", "The source JSON is missing");
596
+ throw new v("web-agent:missing-source-json", "The source JSON is missing");
472
597
  if (!this.sourceJSON.description)
473
- throw new b("web-agent:missing-description", "The source JSON is missing a description");
474
- const e = A.fromJSON(this.sourceJSON);
475
- return await e.load(), this._runtime = e, this.description = this.sourceJSON.description, this.name = this.portalItem?.title ?? `web-agent-${Date.now()}`, this.generate(), this;
598
+ throw new v("web-agent:missing-description", "The source JSON is missing a description");
599
+ const t = x.fromJSON(this.sourceJSON);
600
+ return await t.load(), this._runtime = t, this.description = this.sourceJSON.description, this.name = this.portalItem?.title ?? `web-agent-${Date.now()}`, this.generate(), this;
476
601
  }
477
602
  getSchemas() {
478
603
  return this._runtime?.getSchemas() ?? [];
479
604
  }
480
605
  generate() {
481
606
  if (!this._runtime) {
482
- this._set("workspace", M([])), this._set("createGraph", le);
607
+ this._set("workspace", M([])), this._set("createGraph", bt);
483
608
  return;
484
609
  }
485
- const { createGraph: e, workspace: t } = this._runtime.generate();
486
- this._set("workspace", t), this._set("createGraph", e);
610
+ const { createGraph: t, workspace: e } = this._runtime.generate();
611
+ this._set("workspace", e), this._set("createGraph", t);
487
612
  }
488
613
  //#endregion
489
614
  };
490
- E([
491
- i({ type: C })
492
- ], g.prototype, "portalItem", 2);
493
- E([
494
- i()
495
- ], g.prototype, "sourceJSON", 2);
496
- g = E([
497
- h("WebAgent")
498
- ], g);
499
- class ge extends q {
615
+ $([
616
+ n({ type: J })
617
+ ], f.prototype, "portalItem", 2);
618
+ $([
619
+ n()
620
+ ], f.prototype, "sourceJSON", 2);
621
+ f = $([
622
+ l("WebAgent")
623
+ ], f);
624
+ class vt extends L {
500
625
  static {
501
626
  this.properties = { agent: 0, context: 0, itemId: 1, workflow: 0 };
502
627
  }
503
- #e;
628
+ #t;
504
629
  async getContext() {
505
630
  return G(this.context) ? await this.context() : this.context;
506
631
  }
507
632
  async load() {
508
- let t;
633
+ let e;
509
634
  if (this.itemId) {
510
- const s = T.getDefault();
511
- t = new g({ portalItem: new C({ id: this.itemId, portal: s }) });
512
- } else this.workflow && (t = new g({ sourceJSON: this.workflow }));
513
- if (t && (await t.load(), this.agent = t.registration), !this.agent)
635
+ 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 }));
638
+ if (e && (await e.load(), this.agent = e.registration), !this.agent)
514
639
  throw new Error("Failed to initialize the assistant agent because the agent registration is missing.");
515
- this.#e = L(this);
640
+ this.#t = z(this);
516
641
  }
517
642
  disconnectedCallback() {
518
- this.#e?.unregister(this.agent.id), super.disconnectedCallback();
643
+ this.#t?.unregister(this.agent.id), super.disconnectedCallback();
519
644
  }
520
645
  }
521
- F("arcgis-assistant-agent", ge);
646
+ W("arcgis-assistant-agent", vt);
522
647
  export {
523
- ge as ArcgisAssistantAgent
648
+ vt as ArcgisAssistantAgent
524
649
  };