@arcgis/ai-components 5.2.0-next.104 → 5.2.0-next.106

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 (176) hide show
  1. package/dist/agent-utils/LLMAgent.js +41 -40
  2. package/dist/agent-utils/middlewares/trace.js +5 -5
  3. package/dist/agents/runtime/skill/createSkillAgent.d.ts +31 -0
  4. package/dist/agents/runtime/skill/createSkillAgent.js +262 -0
  5. package/dist/agents/runtime/skill/loadAgentSkills.d.ts +16 -0
  6. package/dist/agents/runtime/skill/types.d.ts +28 -0
  7. package/dist/agents/runtime/skill/types.js +2 -0
  8. package/dist/agents/tools/filter/setFeatureEffect/adapter.js +20 -19
  9. package/dist/agents/tools/query/getStatistics/adapter.js +4 -3
  10. package/dist/agents/tools/query/getTopFeatures/adapter.js +4 -3
  11. package/dist/agents/tools/query/queryFeatures/adapter.js +4 -3
  12. package/dist/agents/tools/shared/resolveToolArtifact.d.ts +22 -0
  13. package/dist/agents/tools/shared/resolveToolArtifact.js +20 -0
  14. package/dist/agents/tools/shared/types.d.ts +22 -0
  15. package/dist/agents/tools/shared/types.js +6 -0
  16. package/dist/cdn/23C34FEU.js +2 -0
  17. package/dist/cdn/{NZSOJ726.js → 2AMUOR7X.js} +1 -1
  18. package/dist/cdn/2OHRNRNT.js +2 -0
  19. package/dist/cdn/2OUIRKTV.js +2 -0
  20. package/dist/cdn/2S6L3P4Q.js +2 -0
  21. package/dist/cdn/{C4FEETBZ.js → 2W7LK4HA.js} +1 -1
  22. package/dist/cdn/3IOP64NG.js +2 -0
  23. package/dist/cdn/3OH35VXS.js +2 -0
  24. package/dist/cdn/{5K5ZY267.js → 3SD47V7G.js} +1 -1
  25. package/dist/cdn/{7VAQUCBU.js → 3VCPN2KW.js} +1 -1
  26. package/dist/cdn/{LLUGJKAQ.js → 3XDT7MWI.js} +1 -1
  27. package/dist/cdn/{Y7XD7ZRD.js → 4ALF2CJY.js} +1 -1
  28. package/dist/cdn/{HAEFC2SJ.js → 5LMYUEK7.js} +1 -1
  29. package/dist/cdn/{655YIKL3.js → 6GODC6RU.js} +2 -2
  30. package/dist/cdn/{7VUSIGEM.js → 6RAWG2KQ.js} +1 -1
  31. package/dist/cdn/{GCVB5VG4.js → 6YZGKVYB.js} +1 -1
  32. package/dist/cdn/{VLLZ2FFU.js → 725MBCQF.js} +1 -1
  33. package/dist/cdn/74CVYM72.js +19 -0
  34. package/dist/cdn/{CP5BVGJU.js → 7EOS4SGJ.js} +1 -1
  35. package/dist/cdn/{5WYRJMBW.js → 7QIX4PZR.js} +1 -1
  36. package/dist/cdn/7UF3WRLO.js +72 -0
  37. package/dist/cdn/A7BKHIMA.js +2 -0
  38. package/dist/cdn/AFSBL4ZP.js +2 -0
  39. package/dist/cdn/{FG647IP6.js → AGQ5ADFU.js} +1 -1
  40. package/dist/cdn/{5ZFUGNRN.js → BQYF37UD.js} +1 -1
  41. package/dist/cdn/{4RDNI22D.js → BTTBKTFM.js} +4 -4
  42. package/dist/cdn/BVSK2GWP.js +2 -0
  43. package/dist/cdn/CFAC4FN3.js +2 -0
  44. package/dist/cdn/{HDACNIZF.js → D5EKX26R.js} +1 -1
  45. package/dist/cdn/EGN5BCHV.js +2 -0
  46. package/dist/cdn/{BXQ4I5HB.js → EJJFG5DE.js} +2 -2
  47. package/dist/cdn/{ZDV4K4WG.js → EOD5PNOL.js} +1 -1
  48. package/dist/cdn/{OE3GW5LE.js → ES6D4UD6.js} +1 -1
  49. package/dist/cdn/{K2R6XVK3.js → HB72YIII.js} +1 -1
  50. package/dist/cdn/{G2EGT3CF.js → HHBNLCJP.js} +1 -1
  51. package/dist/cdn/HLN5675C.js +2 -0
  52. package/dist/cdn/IFFOSSNB.js +2 -0
  53. package/dist/cdn/IO7DYFL2.js +2 -0
  54. package/dist/cdn/{IBZ2NEAO.js → IRSJXHRN.js} +1 -1
  55. package/dist/cdn/JD2TB7H4.js +2 -0
  56. package/dist/cdn/{ANRQWYU2.js → JKKU4K4C.js} +1 -1
  57. package/dist/cdn/{FUF3NAU7.js → JMNHFKGL.js} +1 -1
  58. package/dist/cdn/{22KHSDJI.js → JWZD3D5E.js} +1 -1
  59. package/dist/cdn/{HKOGIZDQ.js → KJLLN4P4.js} +18 -18
  60. package/dist/cdn/KZ73TZOB.js +2 -0
  61. package/dist/cdn/LEO3USHH.js +2 -0
  62. package/dist/cdn/LNIMGXB4.js +2 -0
  63. package/dist/cdn/MG2W2ZF3.js +2 -0
  64. package/dist/cdn/{NYJYRCGA.js → MSXMHRI7.js} +1 -1
  65. package/dist/cdn/MXAZE2VM.js +179 -0
  66. package/dist/cdn/{EWLXNGKH.js → OL7QBAGS.js} +15 -15
  67. package/dist/cdn/OMF6ITSG.js +2 -0
  68. package/dist/cdn/{Z5W4V7RC.js → OOGADOKQ.js} +1 -1
  69. package/dist/cdn/{KITIP6J2.js → OZ2CM3J2.js} +1 -1
  70. package/dist/cdn/{6YYPVU7H.js → P4GFYBBO.js} +1 -1
  71. package/dist/cdn/PK5KI2XF.js +2 -0
  72. package/dist/cdn/PWFUEBTT.js +2 -0
  73. package/dist/cdn/{HHUQXL3R.js → PYGX4HN7.js} +1 -1
  74. package/dist/cdn/RFVZ7KCG.js +66 -0
  75. package/dist/cdn/{YEZ3AMNX.js → RLB6TK6B.js} +1 -1
  76. package/dist/cdn/{WKTQVBFJ.js → RN6WMVZX.js} +1 -1
  77. package/dist/cdn/{WJXXOKGA.js → ROQGPAR5.js} +1 -1
  78. package/dist/cdn/RSJSRETN.js +2 -0
  79. package/dist/cdn/RSR66KB4.js +2 -0
  80. package/dist/cdn/{7SRLZQVC.js → RZIXMISL.js} +1 -1
  81. package/dist/cdn/{VOKXKU7M.js → S4LELUBK.js} +9 -9
  82. package/dist/cdn/{AI6DYOKR.js → S627D4K7.js} +1 -1
  83. package/dist/cdn/SL4Y7IRG.js +2 -0
  84. package/dist/cdn/STUBN3L5.js +2 -0
  85. package/dist/cdn/T2OYKP3V.js +2 -0
  86. package/dist/cdn/{C4JT4S5E.js → TBYDZN4H.js} +1 -1
  87. package/dist/cdn/{HHFNQR6Z.js → TEI6WXW7.js} +1 -1
  88. package/dist/cdn/{WGO5SER7.js → TFRWUAB6.js} +1 -1
  89. package/dist/cdn/U3ETGDT7.js +2 -0
  90. package/dist/cdn/{KWD2ECTM.js → UAG6GDUG.js} +1 -1
  91. package/dist/cdn/UHICISBZ.js +2 -0
  92. package/dist/cdn/{NNXISHCA.js → VMZZR7MY.js} +2 -2
  93. package/dist/cdn/WW4BEFDF.js +2 -0
  94. package/dist/cdn/XGCQS3N4.js +2 -0
  95. package/dist/cdn/{R2PQVY4O.js → XKH37FLY.js} +1 -1
  96. package/dist/cdn/XQ3NBBQ3.js +2 -0
  97. package/dist/cdn/{7BCQMK6D.js → XTCLJEID.js} +1 -1
  98. package/dist/cdn/{J6SZIQJA.js → Y7LGFSHO.js} +1 -1
  99. package/dist/cdn/ZFOG3KXV.js +2 -0
  100. package/dist/cdn/ZZZB3GES.js +14 -0
  101. package/dist/cdn/agent-utils/index.js +1 -1
  102. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +1 -1
  103. package/dist/cdn/agent-utils/middlewares/middleware.js +1 -1
  104. package/dist/cdn/agent-utils/middlewares/trace.js +1 -1
  105. package/dist/cdn/index.js +1 -1
  106. package/dist/chunks/SKILL.js +5 -0
  107. package/dist/chunks/SKILL2.js +5 -0
  108. package/dist/chunks/SKILL3.js +22 -0
  109. package/dist/chunks/SKILL4.js +5 -0
  110. package/dist/chunks/adapter.js +137 -140
  111. package/dist/chunks/aiFactory.js +94 -0
  112. package/dist/chunks/arcgisKnowledgeGraph.js +14 -13
  113. package/dist/chunks/baseAgentState.js +2 -2
  114. package/dist/chunks/dataExplorationAgent.js +30 -0
  115. package/dist/chunks/generateLayerDescriptions.js +181 -268
  116. package/dist/chunks/helpAgent.js +37 -0
  117. package/dist/chunks/layerStylingGraph.js +91 -76
  118. package/dist/chunks/navigationAgent.js +40 -0
  119. package/dist/chunks/orchestrator.js +13 -12
  120. package/dist/chunks/requireAgentServices.js +11 -0
  121. package/dist/chunks/resolvePointGeometryFilter.js +11 -11
  122. package/dist/components/arcgis-assistant/customElement.d.ts +23 -3
  123. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +17 -6
  124. package/dist/components/arcgis-assistant-help-agent/customElement.js +3 -1
  125. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +1 -0
  126. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +1 -0
  127. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +18 -7
  128. package/dist/docs/api.json +1 -1
  129. package/dist/docs/docs.json +1 -1
  130. package/dist/docs/vscode.html-custom-data.json +1 -1
  131. package/dist/docs/web-types.json +1 -1
  132. package/dist/orchestrator/models/types.d.ts +1 -0
  133. package/dist/orchestrator/providers/arcgis/aiFactory.d.ts +15 -0
  134. package/dist/orchestrator/registry/agentRegistry.d.ts +33 -0
  135. package/dist/orchestrator/types/types.d.ts +17 -0
  136. package/dist/utils/index.d.ts +13 -3
  137. package/dist/utils/index.js +706 -82
  138. package/package.json +10 -6
  139. package/dist/cdn/2EY3BQQX.js +0 -2
  140. package/dist/cdn/2NDBI2VA.js +0 -156
  141. package/dist/cdn/4OGR5QKS.js +0 -2
  142. package/dist/cdn/5FL5BTTX.js +0 -66
  143. package/dist/cdn/5X7EG7D2.js +0 -2
  144. package/dist/cdn/6FCU2KJP.js +0 -2
  145. package/dist/cdn/7BJ4JKLG.js +0 -2
  146. package/dist/cdn/7HS5KX3J.js +0 -2
  147. package/dist/cdn/7UUYJTKT.js +0 -2
  148. package/dist/cdn/7V6OSTFC.js +0 -2
  149. package/dist/cdn/7VYYQ7BT.js +0 -2
  150. package/dist/cdn/ACJTJLZN.js +0 -2
  151. package/dist/cdn/AKD5UOVX.js +0 -2
  152. package/dist/cdn/C7LGDNB3.js +0 -14
  153. package/dist/cdn/CGJINV7H.js +0 -2
  154. package/dist/cdn/CJMUJXPL.js +0 -2
  155. package/dist/cdn/D2SS763Z.js +0 -2
  156. package/dist/cdn/FJO4KNOZ.js +0 -2
  157. package/dist/cdn/G3SF6U2U.js +0 -2
  158. package/dist/cdn/G6CR7JVM.js +0 -22
  159. package/dist/cdn/GL7BPKBN.js +0 -2
  160. package/dist/cdn/JO5ETMPS.js +0 -2
  161. package/dist/cdn/PUHRBGKB.js +0 -2
  162. package/dist/cdn/Q57QWN5W.js +0 -2
  163. package/dist/cdn/QUKNPVAF.js +0 -2
  164. package/dist/cdn/RBE55SWR.js +0 -2
  165. package/dist/cdn/SWH6ZHD4.js +0 -18
  166. package/dist/cdn/SZ2QSSB3.js +0 -2
  167. package/dist/cdn/T4RIGOXB.js +0 -2
  168. package/dist/cdn/W4JQDITQ.js +0 -36
  169. package/dist/cdn/XX6GHMNR.js +0 -2
  170. package/dist/cdn/YLVJA4ZE.js +0 -2
  171. package/dist/cdn/ZOEMBHRF.js +0 -2
  172. package/dist/cdn/ZRVZMPFN.js +0 -2
  173. package/dist/chunks/dataExplorationGraph.js +0 -254
  174. package/dist/chunks/helpGraph.js +0 -133
  175. package/dist/chunks/navigationGraph.js +0 -290
  176. package/dist/chunks/toolCallResponse.js +0 -33
@@ -1,290 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { StateGraph as E, START as $, END as R } from "@langchain/langgraph/web";
3
- import { g as T, t as C, r as F, N as k } from "./adapter.js";
4
- import "@arcgis/core/identity/IdentityManager.js";
5
- import "@arcgis/core/portal/Portal.js";
6
- import "@arcgis/core/request.js";
7
- import "@arcgis/toolkit/string";
8
- import { h as L, i as M } from "./generateLayerDescriptions.js";
9
- import "@langchain/core/messages";
10
- import "@langchain/core/callbacks/dispatch/web";
11
- import "@langchain/core/callbacks/base";
12
- import "@langchain/openai";
13
- import "@arcgis/core/config.js";
14
- import "@arcgis/core/core/reactiveUtils.js";
15
- import "@arcgis/core/layers/FeatureLayer.js";
16
- import { goToAddressTool as A } from "../agents/tools/navigation/goToAddress/adapter.js";
17
- import { goToBookmarkTool as _ } from "../agents/tools/navigation/goToBookmark/adapter.js";
18
- import { goToFeaturesTool as I } from "../agents/tools/navigation/goToFeatures/adapter.js";
19
- import { goToFullExtentTool as q } from "../agents/tools/navigation/goToFullExtent/adapter.js";
20
- import { goToHomeExtentTool as Z } from "../agents/tools/navigation/goToHomeExtent/adapter.js";
21
- import { goToLayerTool as V } from "../agents/tools/navigation/goToLayer/adapter.js";
22
- import { goToScaleTool as j } from "../agents/tools/navigation/goToScale/adapter.js";
23
- import { goToViewpointTool as P } from "../agents/tools/navigation/goToViewpoint/adapter.js";
24
- import { goToZoomTool as z } from "../agents/tools/navigation/goToZoom/adapter.js";
25
- import { f as w } from "./fetchAgentContext.js";
26
- import { h as G } from "./toolCallResponse.js";
27
- import { s as p } from "./index.js";
28
- import "@langchain/core/prompts";
29
- import { ToolNode as O } from "@langchain/langgraph/prebuilt";
30
- import S from "zod";
31
- import { f as y } from "./fetchService.js";
32
- const f = [
33
- A,
34
- _,
35
- I,
36
- q,
37
- Z,
38
- V,
39
- j,
40
- P,
41
- z
42
- ];
43
- async function B(e, t) {
44
- const o = await T("navigation_tool_prompt"), { mapView: s } = w(t, ["mapView"]), c = s.map.bookmarks?.map((u) => u.name).filter(Boolean) ?? [], m = e.vectorSearchLayerResults?.length > 0 ? e.vectorSearchLayerResults.map(
45
- (u, b) => `${b + 1}. layerId=${u.id} | title=${u.title ?? ""} | name=${u.name ?? ""} | score=${u.score.toFixed(2)}`
46
- ).join(`
47
- `) : "", l = e.vectorSearchFieldResults?.length > 0 ? JSON.stringify(e.vectorSearchFieldResults, null, 2) : "", r = e.intent === "goToBookmark" && c.length ? `Available bookmarks:
48
- ${c.map((u) => `- ${u}`).join(`
49
- `)}` : "", a = (e.intent === "goToLayer" || e.intent === "goToFeatures") && e.vectorSearchLayerResults?.length ? `Candidate layers:
50
- ${m}` : "", i = e.intent === "goToFeatures" && e.vectorSearchFieldResults?.length ? `Candidate fields:
51
- ${l}` : "", h = {
52
- intent: e.intent,
53
- bookmarksSection: r,
54
- layersSection: a,
55
- fieldsSection: i,
56
- currentZoom: s.zoom,
57
- assignedTask: e.agentExecutionContext.assignedTask,
58
- userRequest: e.agentExecutionContext.userRequest,
59
- priorSteps: e.agentExecutionContext.priorSteps
60
- }, n = await L({
61
- promptText: o,
62
- modelTier: "fast",
63
- config: t,
64
- inputVariables: h,
65
- tools: f
66
- });
67
- await G(n, t);
68
- const g = (n.tool_calls?.length ?? 0) > 0, v = typeof n.text == "string" ? n.text.trim() : "", N = v.length > 0;
69
- return {
70
- ...e,
71
- navigationInternalState: {
72
- ...e.navigationInternalState,
73
- toolCallMessage: g ? n : void 0
74
- },
75
- // No tool call => surface fallback text now. Tool call => tool node will set output.
76
- outputMessage: g ? e.outputMessage : v,
77
- status: g ? e.status : N ? "success" : "failed"
78
- };
79
- }
80
- const D = (e) => {
81
- const t = typeof e == "string" ? e : String(e);
82
- try {
83
- const o = JSON.parse(t);
84
- if (o && typeof o == "object" && typeof o.text == "string")
85
- return o;
86
- } catch {
87
- console.warn("Failed to parse tool response as JSON:", t);
88
- }
89
- return { text: t };
90
- };
91
- async function J(e, t) {
92
- const o = new O(f, { handleToolErrors: !1 });
93
- try {
94
- const s = e.navigationInternalState.toolCallMessage;
95
- if (!s)
96
- throw new Error("navigationToolCalling: missing navigationInternalState.toolCallMessage");
97
- const { messages: d } = await o.invoke(
98
- {
99
- messages: [s]
100
- },
101
- t
102
- );
103
- let c = "", m, l;
104
- for (const r of d) {
105
- const a = D(r.content), i = r.artifact;
106
- a.text && (c += `${a.text}
107
- `);
108
- const h = i?.sharedStatePatch ?? a.sharedStatePatch;
109
- h && (m = {
110
- ...m,
111
- ...h
112
- }), i?.sharedResourceAdditions && (l = [...l ?? [], ...i.sharedResourceAdditions]);
113
- }
114
- return await p({ text: `Finished executing navigation tool: ${c}` }, t), {
115
- ...e,
116
- outputMessage: c,
117
- sharedStatePatch: m,
118
- sharedResourceAdditions: l,
119
- status: "success",
120
- summary: c ? C(c) : "Navigation executed.",
121
- navigationInternalState: {
122
- ...e.navigationInternalState,
123
- toolCallMessage: void 0
124
- }
125
- };
126
- } catch (s) {
127
- const d = s instanceof Error ? s.message : String(s);
128
- return await p({ text: `Navigation tool execution failed: ${d}` }, t), {
129
- ...e,
130
- outputMessage: `Navigation tool execution failed: ${d}`,
131
- status: "failed",
132
- summary: `Navigation tool execution failed: ${d}`,
133
- navigationInternalState: {
134
- ...e.navigationInternalState,
135
- toolCallMessage: void 0
136
- }
137
- };
138
- }
139
- }
140
- async function H(e, t) {
141
- const o = await T("navigation_intent_prompt"), { mapView: s } = w(t, ["mapView"]), d = f.map((n) => ({
142
- name: n.name,
143
- description: n.description,
144
- schema: n.schema
145
- })), m = s.map.bookmarks?.map((n) => n.name).filter(Boolean) ?? [], l = m.length ? `Available bookmarks:
146
- ${m.map((n) => `- ${n}`).join(`
147
- `)}` : "No bookmarks are available in this map.", r = {
148
- tools: d.map(({ name: n, description: g, schema: v }) => `${n}: ${g}, ${JSON.stringify(v)}`).join(`
149
- `),
150
- bookmarks: l,
151
- assignedTask: e.agentExecutionContext.assignedTask,
152
- userRequest: e.agentExecutionContext.userRequest,
153
- priorSteps: e.agentExecutionContext.priorSteps
154
- }, a = S.object({
155
- intent: S.string()
156
- }), i = await M({
157
- promptText: o,
158
- config: t,
159
- inputVariables: r,
160
- schema: a,
161
- modelTier: "fast"
162
- }), h = typeof i.intent == "string" ? i.intent.trim().replace(/^"|"$/gu, "") : "";
163
- return { ...e, intent: h || "" };
164
- }
165
- const U = 0.7, W = async (e, t) => {
166
- try {
167
- await p(
168
- { text: `Similarity search to find layers: ${e.agentExecutionContext.assignedTask}` },
169
- t
170
- );
171
- const o = y(t, "layerSearch"), s = y(t, "layersAndFieldsRegistry"), d = y(t, "embeddingCache"), m = (await o.searchLayers({
172
- text: e.agentExecutionContext.assignedTask,
173
- minScore: U,
174
- embeddingCache: d
175
- })).map(({ id: r, score: a }) => {
176
- const i = s.get(r)?.layerItem;
177
- return {
178
- id: r,
179
- title: i?.title,
180
- name: i?.name ?? void 0,
181
- score: a
182
- };
183
- });
184
- let l;
185
- return m.length > 0 ? l = `Vector search completed. Matching layers:
186
- ${m.map((r) => `- layerId=${r.id} | title=${r.title ?? ""} | name=${r.name ?? ""} | score=${r.score.toFixed(2)}`).join(`
187
- `)}` : l = "Vector search completed. No matching layers found.", await p({ text: l }, t), {
188
- ...e,
189
- vectorSearchLayerResults: m
190
- };
191
- } catch (o) {
192
- throw await p(
193
- { text: `Error during vector search layers: ${o instanceof Error ? o.message : String(o)}` },
194
- t
195
- ), o;
196
- }
197
- }, x = 0.7, K = 10, Q = async (e, t) => {
198
- try {
199
- await p(
200
- { text: `Similarity search to find fields: ${e.agentExecutionContext.assignedTask}` },
201
- t
202
- );
203
- const o = y(t, "fieldSearch"), s = y(t, "layersAndFieldsRegistry"), d = y(t, "embeddingCache"), c = e.vectorSearchLayerResults?.map((a) => a.id) ?? [];
204
- if (c.length === 0)
205
- return await p({ text: "No candidate layers for field search" }, t), e;
206
- const l = (await o.searchFields({
207
- text: e.agentExecutionContext.assignedTask,
208
- layerIds: c,
209
- minScore: x,
210
- topResults: K,
211
- embeddingCache: d
212
- })).map(({ layerId: a, results: i }) => {
213
- const h = s.get(a)?.fieldRegistry;
214
- return {
215
- layerId: a,
216
- layerName: s.get(a)?.layerItem.name,
217
- results: i.map((n) => {
218
- const g = h?.get(n.name);
219
- return {
220
- name: n.name,
221
- score: n.score,
222
- type: g?.type,
223
- alias: g?.alias,
224
- description: g?.description,
225
- statistics: g?.statistics,
226
- domain: g?.domain
227
- };
228
- })
229
- };
230
- });
231
- let r;
232
- return l.length > 0 ? r = `Vector search completed. Matching layers and fields:
233
- ${l.map(
234
- (a) => `${a.layerName ?? a.layerId}:
235
- ${a.results.map((i) => ` - ${i.name} (${i.score.toFixed(2)})`).join(`
236
- `)}`
237
- ).join(`
238
- `)}` : r = `No vector search field results found for score over ${x}.`, await p({ text: r }, t), {
239
- ...e,
240
- vectorSearchFieldResults: l
241
- };
242
- } catch (o) {
243
- throw await p(
244
- { text: `Error during vector search fields: ${o instanceof Error ? o.message : String(o)}` },
245
- t
246
- ), o;
247
- }
248
- }, X = (e, t) => F(["layerSearch", "layersAndFieldsRegistry"], "Navigation Agent")(e, t), Y = () => new E(k).addNode("requireNavigationServices", X).addNode("intentLLM", H).addNode("vectorSearchLayers", W).addNode("vectorSearchFields", Q).addNode("agent", B).addNode("tools", J).addEdge($, "requireNavigationServices").addEdge("requireNavigationServices", "intentLLM").addConditionalEdges(
249
- "intentLLM",
250
- (t) => t.intent === "goToLayer" || t.intent === "goToFeatures" ? "vectorSearchLayers" : "agent",
251
- {
252
- vectorSearchLayers: "vectorSearchLayers",
253
- agent: "agent"
254
- }
255
- ).addConditionalEdges(
256
- "vectorSearchLayers",
257
- (t) => t.intent === "goToFeatures" ? "vectorSearchFields" : "agent",
258
- {
259
- vectorSearchFields: "vectorSearchFields",
260
- agent: "agent"
261
- }
262
- ).addEdge("vectorSearchFields", "agent").addEdge("agent", "tools").addEdge("tools", R), ee = String.raw`- **navigation** — Enables users to interact with the map by navigating to specific locations, layers, features, or extents.
263
- This includes zooming, panning, centering, or geocoding based on user input. The agent is designed to handle explicit map movement requests. NOTE: DO NOT call this agent if the user asks "show me...", that is meant to be handled by another agent. If the query is about where a certain address is, call this agent.
264
-
265
- Supported actions:
266
- - **Zooming**: Adjust the map's zoom level (e.g., "Zoom to level 10", "Zoom in").
267
- - **Viewpoints**: Navigate to a specific center point with optional zoom or scale (e.g., "Center the map on San Francisco at zoom level 16").
268
- - **Scales**: Set the map to a specific scale (e.g., "Set the map scale to 1:50,000").
269
- - **Layers**: Zoom to the full extent of a specific layer (e.g., "Go to the water mains layer"). For the purposes of link charts, if the user requests to go to the extent of a link chart or the entities/nodes within it, that should be treated as a request to use the goToLayer tool on the link chart layer
270
- - **Features**: Zoom to features in a layer that match a filter (e.g., "Zoom to all schools in the city").
271
- - **Bookmarks**: Navigate to a predefined bookmark extent (e.g., "Go to the Downtown bookmark").
272
- - **Extents**: Reset to the initial web map extent or zoom to the full world extent (e.g., "Reset the map", "Zoom to the full world extent").
273
- - **Addresses**: Zoom to an address or place name (e.g., "Zoom to 1600 Pennsylvania Ave").
274
-
275
- _Example: “Zoom to Texas”_
276
- _Example: “Go to the water mains layer”_
277
- _Example: “Zoom to to the extent of my link chart”_
278
- _Example: “Center the map on San Francisco at scale 50000”_
279
- _Example: “Zoom to the features in the schools layer where city = 'Austin'”_
280
- _Example: “Go to the Downtown bookmark”_
281
- _Example: “Where is Mount Rainier?”_`, Le = {
282
- id: "navigation",
283
- name: "Navigation Agent",
284
- description: ee,
285
- createGraph: Y,
286
- workspace: k
287
- };
288
- export {
289
- Le as N
290
- };
@@ -1,33 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import "@arcgis/core/identity/IdentityManager.js";
3
- import "@arcgis/core/portal/Portal.js";
4
- import "@arcgis/core/request.js";
5
- import "@langchain/langgraph/web";
6
- import "@arcgis/toolkit/string";
7
- import "./generateLayerDescriptions.js";
8
- import "@langchain/core/messages";
9
- import { s as a } from "./index.js";
10
- import "@langchain/core/callbacks/base";
11
- import "@langchain/openai";
12
- import "@arcgis/core/config.js";
13
- import "@arcgis/core/core/reactiveUtils.js";
14
- import "@arcgis/core/layers/FeatureLayer.js";
15
- import "@langchain/core/prompts";
16
- const x = async (t, o) => {
17
- const i = t.tool_calls ?? [];
18
- if (i.length === 0) {
19
- await a({ text: `LLM did not request any tool calls: ${String(t?.content)}` }, o);
20
- return;
21
- }
22
- await Promise.all(
23
- i.map(
24
- async (r) => await a(
25
- { text: `LLM invoked ${r.name} tool with arguments: ${JSON.stringify(r.args, null, 2)}` },
26
- o
27
- )
28
- )
29
- );
30
- };
31
- export {
32
- x as h
33
- };