@arcgis/ai-components 5.2.0-next.6 → 5.2.0-next.61

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 (208) hide show
  1. package/README.md +2 -2
  2. package/dist/agent-utils/FunctionAgent.d.ts +2 -2
  3. package/dist/agent-utils/LLMAgent.d.ts +2 -2
  4. package/dist/agent-utils/LLMAgent.js +2 -1
  5. package/dist/agent-utils/WorkflowAgent.d.ts +2 -2
  6. package/dist/agent-utils/index.d.ts +177 -0
  7. package/dist/agent-utils/index.js +167 -0
  8. package/dist/agent-utils/middlewares/trace.d.ts +2 -0
  9. package/dist/agent-utils/middlewares/trace.js +25 -33
  10. package/dist/agent-utils/tools/FunctionTool.d.ts +2 -2
  11. package/dist/agent-utils/types.d.ts +36 -7
  12. package/dist/agent-utils/workflows/ConditionalWorkflow.d.ts +2 -2
  13. package/dist/agent-utils/workflows/LoopWorkflow.d.ts +2 -2
  14. package/dist/agent-utils/workflows/ParallelWorkflow.d.ts +2 -2
  15. package/dist/agent-utils/workflows/RouterWorkflow.d.ts +2 -2
  16. package/dist/agent-utils/workflows/SequentialWorkflow.d.ts +2 -2
  17. package/dist/agent-utils/workflows/SwitchWorkflow.d.ts +2 -2
  18. package/dist/cdn/242OOJML.js +2 -0
  19. package/dist/cdn/275NKWUE.js +22 -0
  20. package/dist/cdn/2WDZIJQR.js +2 -0
  21. package/dist/cdn/2XQAM2Q3.js +4 -0
  22. package/dist/cdn/3DJDRAGV.js +2 -0
  23. package/dist/cdn/{AMP6IALT.js → 3UEKINYC.js} +1 -1
  24. package/dist/cdn/3YCSUTGV.js +14 -0
  25. package/dist/cdn/3ZPPYCNL.js +2 -0
  26. package/dist/cdn/434TAA3J.js +2 -0
  27. package/dist/cdn/4CEMUECT.js +2 -0
  28. package/dist/cdn/57OMVTIU.js +2 -0
  29. package/dist/cdn/5L7VPEQM.js +2 -0
  30. package/dist/cdn/6U7TEAAJ.js +2 -0
  31. package/dist/cdn/7NP7WGR5.js +2 -0
  32. package/dist/cdn/AHLLB5QW.js +2 -0
  33. package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
  34. package/dist/cdn/APFZY4PI.js +2 -0
  35. package/dist/cdn/AYMUK2MC.js +36 -0
  36. package/dist/cdn/BE7ZN5FZ.js +2 -0
  37. package/dist/cdn/BI3LK5D3.js +2 -0
  38. package/dist/cdn/{FL4W4VYN.js → BL273EGZ.js} +17 -1
  39. package/dist/cdn/BSP6IJY4.js +2 -0
  40. package/dist/cdn/{5ZZGKP7N.js → CEKOEHB3.js} +1 -1
  41. package/dist/cdn/CWZEQ4R6.js +2 -0
  42. package/dist/cdn/{VOQX4AVB.js → FC45FF2D.js} +6 -4
  43. package/dist/cdn/FNPLHH4E.js +3 -0
  44. package/dist/cdn/FVDFPK3V.js +18 -0
  45. package/dist/cdn/{ZLXN7NMF.js → FYZATVB3.js} +10 -8
  46. package/dist/cdn/GLOALVJR.js +3 -0
  47. package/dist/cdn/HBLRVXEB.js +2 -0
  48. package/dist/cdn/HJG7QM2R.js +9 -0
  49. package/dist/cdn/HLO655UO.js +2 -0
  50. package/dist/cdn/HPSVZVAR.js +2 -0
  51. package/dist/cdn/HQXPPYMD.js +2 -0
  52. package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
  53. package/dist/cdn/ICYUPLZM.js +56 -0
  54. package/dist/cdn/IEHPNCTL.js +2 -0
  55. package/dist/cdn/IHP25JWI.js +99 -0
  56. package/dist/cdn/J6A4AS7E.js +22 -0
  57. package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
  58. package/dist/cdn/JHFOZPBP.js +2 -0
  59. package/dist/cdn/L4SS54EZ.js +2 -0
  60. package/dist/cdn/LHLO6PTD.js +2 -0
  61. package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
  62. package/dist/cdn/LUJCH5V7.js +2 -0
  63. package/dist/cdn/LUY6V4TP.js +181 -0
  64. package/dist/cdn/M3MRIGDZ.js +2 -0
  65. package/dist/cdn/MSDNERUF.js +2 -0
  66. package/dist/cdn/MWYBF3F3.js +66 -0
  67. package/dist/cdn/NEV6OZN3.js +71 -0
  68. package/dist/cdn/NQROZZHC.js +65 -0
  69. package/dist/cdn/NSER3L4A.js +2 -0
  70. package/dist/cdn/OI7EGYZU.js +2 -0
  71. package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
  72. package/dist/cdn/OY2P2O47.js +180 -0
  73. package/dist/cdn/OYNIFMCJ.js +2 -0
  74. package/dist/cdn/PJ3UN2RU.js +2 -0
  75. package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
  76. package/dist/cdn/PVE7Q43N.js +2 -0
  77. package/dist/cdn/QBINZNXI.js +9 -0
  78. package/dist/cdn/QZLE7B6X.js +2 -0
  79. package/dist/cdn/R74ZHFA6.js +2 -0
  80. package/dist/cdn/RAAV47KU.js +3 -0
  81. package/dist/cdn/RLEHNAIA.js +2 -0
  82. package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
  83. package/dist/cdn/SLXOVE7Y.js +2 -0
  84. package/dist/cdn/TFT6HK3O.js +208 -0
  85. package/dist/cdn/THXUE6R4.js +2 -0
  86. package/dist/cdn/TPULIO6I.js +34 -0
  87. package/dist/cdn/U4Z5XNJ5.js +2 -0
  88. package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
  89. package/dist/cdn/UZLQALHY.js +2 -0
  90. package/dist/cdn/V6HOUZPZ.js +2 -0
  91. package/dist/cdn/VAXH6RUQ.js +134 -0
  92. package/dist/cdn/{H7422XUG.js → VCXSQWGA.js} +1 -1
  93. package/dist/cdn/VXFQANGJ.js +2 -0
  94. package/dist/cdn/WHOZT5H5.js +48 -0
  95. package/dist/cdn/WY7B6IMH.js +2 -0
  96. package/dist/cdn/XCRR2EEG.js +6 -0
  97. package/dist/cdn/XVPBO2JC.js +2 -0
  98. package/dist/cdn/YHQJ66WJ.js +2 -0
  99. package/dist/cdn/ZS6SXJP2.js +2 -0
  100. package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
  101. package/dist/cdn/agent-utils/index.js +2 -0
  102. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +3 -0
  103. package/dist/cdn/agent-utils/middlewares/middleware.js +2 -0
  104. package/dist/cdn/agent-utils/middlewares/trace.js +2 -0
  105. package/dist/cdn/index.js +1 -1
  106. package/dist/chunks/adapter.js +1794 -1597
  107. package/dist/chunks/arcgisKnowledgeGraph.js +127 -72
  108. package/dist/chunks/arcgis_knowledge_current_lc_context.js +19 -2
  109. package/dist/chunks/arcgis_knowledge_current_map_context.js +31 -2
  110. package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
  111. package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +116 -27
  112. package/dist/chunks/converterUtils.js +39 -32
  113. package/dist/chunks/dataExplorationGraph.js +140 -114
  114. package/dist/chunks/data_explore_query_prompt.js +9 -4
  115. package/dist/chunks/generateLayerDescriptions.js +239 -225
  116. package/dist/chunks/helpGraph.js +30 -23
  117. package/dist/chunks/help_prompt.js +34 -17
  118. package/dist/chunks/index.js +11 -0
  119. package/dist/chunks/intent_prompt.js +16 -0
  120. package/dist/chunks/layerStylingGraph.js +25 -21
  121. package/dist/chunks/navigationGraph.js +70 -62
  122. package/dist/chunks/navigation_intent_prompt.js +8 -2
  123. package/dist/chunks/orchestrator.js +110 -108
  124. package/dist/chunks/slottableRequestUtils.js +3 -7
  125. package/dist/chunks/state.js +1 -1
  126. package/dist/chunks/summarize_query_response_prompt.js +9 -7
  127. package/dist/chunks/toolCallResponse.js +13 -10
  128. package/dist/chunks/utils2.js +8 -8
  129. package/dist/components/arcgis-assistant/customElement.d.ts +27 -0
  130. package/dist/components/arcgis-assistant/customElement.js +386 -152
  131. package/dist/components/arcgis-assistant/index.js +2 -3
  132. package/dist/components/arcgis-assistant/types.d.ts +14 -1
  133. package/dist/components/arcgis-assistant-agent/customElement.js +5 -1
  134. package/dist/components/arcgis-assistant-chat/customElement.d.ts +2 -1
  135. package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
  136. package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +2 -0
  137. package/dist/components/arcgis-assistant-chat-entry/customElement.js +25 -18
  138. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +12 -6
  139. package/dist/components/arcgis-assistant-help-agent/customElement.js +9 -3
  140. package/dist/components/arcgis-assistant-interrupt/customElement.js +12 -8
  141. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +20 -0
  142. package/dist/components/arcgis-assistant-interrupt-preview/index.js +2 -0
  143. package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +7 -7
  144. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +18 -12
  145. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +11 -5
  146. package/dist/components/arcgis-assistant-message/customElement.d.ts +2 -0
  147. package/dist/components/arcgis-assistant-message/customElement.js +28 -26
  148. package/dist/components/arcgis-assistant-message/index.js +2 -0
  149. package/dist/components/arcgis-assistant-message-block/customElement.js +18 -11
  150. package/dist/components/arcgis-assistant-message-block/index.js +1 -0
  151. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +4 -0
  152. package/dist/components/arcgis-assistant-message-loading/customElement.js +10 -10
  153. package/dist/components/arcgis-assistant-message-loading/index.js +1 -0
  154. package/dist/components/arcgis-assistant-message-text/customElement.d.ts +1 -0
  155. package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
  156. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +12 -6
  157. package/dist/components/arcgis-assistant-speech-input/customElement.js +29 -46
  158. package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +8 -8
  159. package/dist/components/arcgis-assistant-user-message/customElement.js +10 -8
  160. package/dist/docs/api.json +1 -1
  161. package/dist/docs/docs.json +1 -1
  162. package/dist/docs/vscode.html-custom-data.json +1 -1
  163. package/dist/docs/web-types.json +1 -1
  164. package/dist/loader.js +7 -6
  165. package/dist/oauth-callback.html +1 -1
  166. package/dist/types/lumina.d.ts +7 -6
  167. package/dist/types/preact.d.ts +7 -6
  168. package/dist/types/react.d.ts +7 -6
  169. package/dist/types/stencil.d.ts +7 -6
  170. package/dist/utils/index.d.ts +94 -47
  171. package/dist/utils/index.js +80 -65
  172. package/package.json +13 -12
  173. package/dist/cdn/2AXF774U.js +0 -2
  174. package/dist/cdn/3NI46YCE.js +0 -2
  175. package/dist/cdn/3PKJWIC3.js +0 -2
  176. package/dist/cdn/462JBSEV.js +0 -422
  177. package/dist/cdn/47FWPQ2A.js +0 -16
  178. package/dist/cdn/5QAHYX7Y.js +0 -5
  179. package/dist/cdn/7BCR6TUO.js +0 -2
  180. package/dist/cdn/7GH7VSB2.js +0 -2
  181. package/dist/cdn/7PLV4QH6.js +0 -2
  182. package/dist/cdn/AEJHYRGT.js +0 -166
  183. package/dist/cdn/AO7BQHKC.js +0 -2
  184. package/dist/cdn/AXDZBBNL.js +0 -45
  185. package/dist/cdn/BFZJNJL6.js +0 -22
  186. package/dist/cdn/DDLZOMUY.js +0 -2
  187. package/dist/cdn/DHOVCT6R.js +0 -2
  188. package/dist/cdn/F2AHA4GB.js +0 -54
  189. package/dist/cdn/FX5JFRDL.js +0 -2
  190. package/dist/cdn/GCQLVNNC.js +0 -14
  191. package/dist/cdn/HB5A5R2E.js +0 -2
  192. package/dist/cdn/JV4SI65E.js +0 -108
  193. package/dist/cdn/KMQ3SP4I.js +0 -5
  194. package/dist/cdn/MH5RPXHM.js +0 -2
  195. package/dist/cdn/NAUXSHIE.js +0 -72
  196. package/dist/cdn/NVI3I46B.js +0 -2
  197. package/dist/cdn/OAVEHGB6.js +0 -2
  198. package/dist/cdn/OH64RMOR.js +0 -4
  199. package/dist/cdn/P6OPJQMC.js +0 -3
  200. package/dist/cdn/QR54T33D.js +0 -2
  201. package/dist/cdn/R6HV42YW.js +0 -3
  202. package/dist/cdn/RVOAPUBN.js +0 -2
  203. package/dist/cdn/SXDLXCIM.js +0 -2
  204. package/dist/cdn/USMDJUFS.js +0 -2
  205. package/dist/cdn/V2P4AIGG.js +0 -2
  206. package/dist/cdn/V7OJRG26.js +0 -36
  207. package/dist/cdn/Y333DGV6.js +0 -2
  208. package/dist/cdn/YIMNOUTF.js +0 -2
@@ -3,15 +3,19 @@ import { StateGraph as E, START as $, END as C } from "@langchain/langgraph/web"
3
3
  import { k as F, m as R, n as L, o as M, p as A, u as _, v as I, w as q, x as Z, g as T, y as k, t as j, f as u, r as P, N as w } from "./adapter.js";
4
4
  import "@arcgis/core/identity/IdentityManager.js";
5
5
  import "@arcgis/core/portal/Portal.js";
6
- import { j as V, s as h, i as z } from "./generateLayerDescriptions.js";
6
+ import "@arcgis/core/request.js";
7
+ import "@arcgis/toolkit/string";
8
+ import { h as V, i as z } from "./generateLayerDescriptions.js";
7
9
  import "@langchain/core/messages";
8
10
  import "@langchain/core/callbacks/dispatch/web";
9
11
  import "@langchain/openai";
12
+ import "@arcgis/core/config.js";
10
13
  import "@arcgis/core/core/reactiveUtils.js";
11
14
  import "@arcgis/core/layers/FeatureLayer.js";
12
- import "@arcgis/core/request.js";
15
+ import { h as G } from "./toolCallResponse.js";
16
+ import { s as h } from "./index.js";
13
17
  import "@langchain/core/prompts";
14
- import { ToolNode as G } from "@langchain/langgraph/prebuilt";
18
+ import { ToolNode as O } from "@langchain/langgraph/prebuilt";
15
19
  import x from "zod";
16
20
  const S = [
17
21
  F,
@@ -24,19 +28,19 @@ const S = [
24
28
  q,
25
29
  Z
26
30
  ];
27
- async function O(e, t) {
28
- const o = await T("navigation_tool_prompt"), { mapView: s } = k(t), i = s.map.bookmarks?.map((p) => p.name).filter(Boolean) ?? [], c = e.vectorSearchLayerResults?.length > 0 ? e.vectorSearchLayerResults.map(
31
+ async function B(e, t) {
32
+ const o = await T("navigation_tool_prompt"), { mapView: s } = k(t), i = s.map.bookmarks?.map((p) => p.name).filter(Boolean) ?? [], l = e.vectorSearchLayerResults?.length > 0 ? e.vectorSearchLayerResults.map(
29
33
  (p, b) => `${b + 1}. layerId=${p.id} | title=${p.title ?? ""} | name=${p.name ?? ""} | score=${p.score.toFixed(2)}`
30
34
  ).join(`
31
- `) : "", l = e.vectorSearchFieldResults?.length > 0 ? JSON.stringify(e.vectorSearchFieldResults, null, 2) : "", a = e.intent === "goToBookmark" && i.length ? `Available bookmarks:
35
+ `) : "", c = e.vectorSearchFieldResults?.length > 0 ? JSON.stringify(e.vectorSearchFieldResults, null, 2) : "", a = e.intent === "goToBookmark" && i.length ? `Available bookmarks:
32
36
  ${i.map((p) => `- ${p}`).join(`
33
37
  `)}` : "", r = (e.intent === "goToLayer" || e.intent === "goToFeatures") && e.vectorSearchLayerResults?.length ? `Candidate layers:
34
- ${c}` : "", d = e.intent === "goToFeatures" && e.vectorSearchFieldResults?.length ? `Candidate fields:
35
- ${l}` : "", y = {
38
+ ${l}` : "", g = e.intent === "goToFeatures" && e.vectorSearchFieldResults?.length ? `Candidate fields:
39
+ ${c}` : "", y = {
36
40
  intent: e.intent,
37
41
  bookmarksSection: a,
38
42
  layersSection: r,
39
- fieldsSection: d,
43
+ fieldsSection: g,
40
44
  currentZoom: s.zoom,
41
45
  assignedTask: e.agentExecutionContext.assignedTask,
42
46
  userRequest: e.agentExecutionContext.userRequest,
@@ -44,9 +48,12 @@ ${l}` : "", y = {
44
48
  }, n = await V({
45
49
  promptText: o,
46
50
  modelTier: "fast",
51
+ config: t,
47
52
  inputVariables: y,
48
53
  tools: S
49
- }), m = (n.tool_calls?.length ?? 0) > 0, v = typeof n.text == "string" ? n.text.trim() : "", N = v.length > 0;
54
+ });
55
+ await G(n, t);
56
+ const m = (n.tool_calls?.length ?? 0) > 0, v = typeof n.text == "string" ? n.text.trim() : "", N = v.length > 0;
50
57
  return {
51
58
  ...e,
52
59
  navigationInternalState: {
@@ -58,7 +65,7 @@ ${l}` : "", y = {
58
65
  status: m ? e.status : N ? "success" : "failed"
59
66
  };
60
67
  }
61
- const B = (e) => {
68
+ const D = (e) => {
62
69
  const t = typeof e == "string" ? e : String(e);
63
70
  try {
64
71
  const o = JSON.parse(t);
@@ -69,31 +76,31 @@ const B = (e) => {
69
76
  }
70
77
  return { text: t };
71
78
  };
72
- async function D(e, t) {
73
- const o = new G(S);
79
+ async function J(e, t) {
80
+ const o = new O(S, { handleToolErrors: !1 });
74
81
  try {
75
82
  const s = e.navigationInternalState.toolCallMessage;
76
83
  if (!s)
77
84
  throw new Error("navigationToolCalling: missing navigationInternalState.toolCallMessage");
78
- const { messages: g } = await o.invoke(
85
+ const { messages: d } = await o.invoke(
79
86
  {
80
87
  messages: [s]
81
88
  },
82
89
  t
83
90
  );
84
- let i = "", c;
85
- for (const l of g) {
86
- const a = B(l.content);
91
+ let i = "", l;
92
+ for (const c of d) {
93
+ const a = D(c.content);
87
94
  a.text && (i += `${a.text}
88
- `), a.sharedStatePatch && (c = {
89
- ...c,
95
+ `), a.sharedStatePatch && (l = {
96
+ ...l,
90
97
  ...a.sharedStatePatch
91
98
  });
92
99
  }
93
100
  return await h({ text: `Finished executing navigation tool: ${i}` }, t), {
94
101
  ...e,
95
102
  outputMessage: i,
96
- sharedStatePatch: c,
103
+ sharedStatePatch: l,
97
104
  status: "success",
98
105
  summary: i ? j(i) : "Navigation executed.",
99
106
  navigationInternalState: {
@@ -102,12 +109,12 @@ async function D(e, t) {
102
109
  }
103
110
  };
104
111
  } catch (s) {
105
- const g = s instanceof Error ? s.message : String(s);
106
- return await h({ text: `Navigation tool execution failed: ${g}` }, t), {
112
+ const d = s instanceof Error ? s.message : String(s);
113
+ return await h({ text: `Navigation tool execution failed: ${d}` }, t), {
107
114
  ...e,
108
- outputMessage: `Navigation tool execution failed: ${g}`,
115
+ outputMessage: `Navigation tool execution failed: ${d}`,
109
116
  status: "failed",
110
- summary: `Navigation tool execution failed: ${g}`,
117
+ summary: `Navigation tool execution failed: ${d}`,
111
118
  navigationInternalState: {
112
119
  ...e.navigationInternalState,
113
120
  toolCallMessage: void 0
@@ -115,55 +122,56 @@ async function D(e, t) {
115
122
  };
116
123
  }
117
124
  }
118
- async function J(e, t) {
119
- const o = await T("navigation_intent_prompt"), { mapView: s } = k(t), g = S.map((n) => ({
125
+ async function H(e, t) {
126
+ const o = await T("navigation_intent_prompt"), { mapView: s } = k(t), d = S.map((n) => ({
120
127
  name: n.name,
121
128
  description: n.description,
122
129
  schema: n.schema
123
- })), c = s.map.bookmarks?.map((n) => n.name).filter(Boolean) ?? [], l = c.length ? `Available bookmarks:
124
- ${c.map((n) => `- ${n}`).join(`
125
- `)}` : "", a = {
126
- tools: g.map(({ name: n, description: m, schema: v }) => `${n}: ${m}, ${JSON.stringify(v)}`).join(`
130
+ })), l = s.map.bookmarks?.map((n) => n.name).filter(Boolean) ?? [], c = l.length ? `Available bookmarks:
131
+ ${l.map((n) => `- ${n}`).join(`
132
+ `)}` : "No bookmarks are available in this map.", a = {
133
+ tools: d.map(({ name: n, description: m, schema: v }) => `${n}: ${m}, ${JSON.stringify(v)}`).join(`
127
134
  `),
128
- bookmarks: l,
135
+ bookmarks: c,
129
136
  assignedTask: e.agentExecutionContext.assignedTask,
130
137
  userRequest: e.agentExecutionContext.userRequest,
131
138
  priorSteps: e.agentExecutionContext.priorSteps
132
139
  }, r = x.object({
133
140
  intent: x.string()
134
- }), d = await z({
141
+ }), g = await z({
135
142
  promptText: o,
143
+ config: t,
136
144
  inputVariables: a,
137
145
  schema: r,
138
146
  modelTier: "fast"
139
- }), y = typeof d.intent == "string" ? d.intent.trim().replace(/^"|"$/gu, "") : "";
147
+ }), y = typeof g.intent == "string" ? g.intent.trim().replace(/^"|"$/gu, "") : "";
140
148
  return { ...e, intent: y || "" };
141
149
  }
142
- const H = 0.7, U = async (e, t) => {
150
+ const U = 0.7, W = async (e, t) => {
143
151
  try {
144
152
  await h(
145
153
  { text: `Similarity search to find layers: ${e.agentExecutionContext.assignedTask}` },
146
154
  t
147
155
  );
148
- const o = u(t, "layerSearch"), s = u(t, "layersAndFieldsRegistry"), g = u(t, "embeddingCache"), c = (await o.searchLayers({
156
+ const o = u(t, "layerSearch"), s = u(t, "layersAndFieldsRegistry"), d = u(t, "embeddingCache"), l = (await o.searchLayers({
149
157
  text: e.agentExecutionContext.assignedTask,
150
- minScore: H,
151
- embeddingCache: g
158
+ minScore: U,
159
+ embeddingCache: d
152
160
  })).map(({ id: a, score: r }) => {
153
- const d = s.get(a)?.layerItem;
161
+ const g = s.get(a)?.layerItem;
154
162
  return {
155
163
  id: a,
156
- title: d?.title,
157
- name: d?.name ?? void 0,
164
+ title: g?.title,
165
+ name: g?.name ?? void 0,
158
166
  score: r
159
167
  };
160
168
  });
161
- let l;
162
- return c.length > 0 ? l = `Vector search completed. Matching layers:
163
- ${c.map((a) => `- layerId=${a.id} | title=${a.title ?? ""} | name=${a.name ?? ""} | score=${a.score.toFixed(2)}`).join(`
164
- `)}` : l = "Vector search completed. No matching layers found.", await h({ text: l }, t), {
169
+ let c;
170
+ return l.length > 0 ? c = `Vector search completed. Matching layers:
171
+ ${l.map((a) => `- layerId=${a.id} | title=${a.title ?? ""} | name=${a.name ?? ""} | score=${a.score.toFixed(2)}`).join(`
172
+ `)}` : c = "Vector search completed. No matching layers found.", await h({ text: c }, t), {
165
173
  ...e,
166
- vectorSearchLayerResults: c
174
+ vectorSearchLayerResults: l
167
175
  };
168
176
  } catch (o) {
169
177
  throw await h(
@@ -171,27 +179,27 @@ ${c.map((a) => `- layerId=${a.id} | title=${a.title ?? ""} | name=${a.name ?? ""
171
179
  t
172
180
  ), o;
173
181
  }
174
- }, f = 0.7, W = 10, K = async (e, t) => {
182
+ }, f = 0.7, K = 10, Q = async (e, t) => {
175
183
  try {
176
184
  await h(
177
185
  { text: `Similarity search to find fields: ${e.agentExecutionContext.assignedTask}` },
178
186
  t
179
187
  );
180
- const o = u(t, "fieldSearch"), s = u(t, "layersAndFieldsRegistry"), g = u(t, "embeddingCache"), i = e.vectorSearchLayerResults?.map((r) => r.id) ?? [];
188
+ const o = u(t, "fieldSearch"), s = u(t, "layersAndFieldsRegistry"), d = u(t, "embeddingCache"), i = e.vectorSearchLayerResults?.map((r) => r.id) ?? [];
181
189
  if (i.length === 0)
182
190
  return await h({ text: "No candidate layers for field search" }, t), e;
183
- const l = (await o.searchFields({
191
+ const c = (await o.searchFields({
184
192
  text: e.agentExecutionContext.assignedTask,
185
193
  layerIds: i,
186
194
  minScore: f,
187
- topResults: W,
188
- embeddingCache: g
189
- })).map(({ layerId: r, results: d }) => {
195
+ topResults: K,
196
+ embeddingCache: d
197
+ })).map(({ layerId: r, results: g }) => {
190
198
  const y = s.get(r)?.fieldRegistry;
191
199
  return {
192
200
  layerId: r,
193
201
  layerName: s.get(r)?.layerItem.name,
194
- results: d.map((n) => {
202
+ results: g.map((n) => {
195
203
  const m = y?.get(n.name);
196
204
  return {
197
205
  name: n.name,
@@ -205,15 +213,15 @@ ${c.map((a) => `- layerId=${a.id} | title=${a.title ?? ""} | name=${a.name ?? ""
205
213
  };
206
214
  });
207
215
  let a;
208
- return l.length > 0 ? a = `Vector search completed. Matching layers and fields:
209
- ${l.map(
216
+ return c.length > 0 ? a = `Vector search completed. Matching layers and fields:
217
+ ${c.map(
210
218
  (r) => `${r.layerName ?? r.layerId}:
211
- ${r.results.map((d) => ` - ${d.name} (${d.score.toFixed(2)})`).join(`
219
+ ${r.results.map((g) => ` - ${g.name} (${g.score.toFixed(2)})`).join(`
212
220
  `)}`
213
221
  ).join(`
214
222
  `)}` : a = `No vector search field results found for score over ${f}.`, await h({ text: a }, t), {
215
223
  ...e,
216
- vectorSearchFieldResults: l
224
+ vectorSearchFieldResults: c
217
225
  };
218
226
  } catch (o) {
219
227
  throw await h(
@@ -221,7 +229,7 @@ ${r.results.map((d) => ` - ${d.name} (${d.score.toFixed(2)})`).join(`
221
229
  t
222
230
  ), o;
223
231
  }
224
- }, Q = (e, t) => P(["layerSearch", "layersAndFieldsRegistry"], "Navigation Agent")(e, t), X = () => new E(w).addNode("requireNavigationServices", Q).addNode("intentLLM", J).addNode("vectorSearchLayers", U).addNode("vectorSearchFields", K).addNode("agent", O).addNode("tools", D).addEdge($, "requireNavigationServices").addEdge("requireNavigationServices", "intentLLM").addConditionalEdges(
232
+ }, X = (e, t) => P(["layerSearch", "layersAndFieldsRegistry"], "Navigation Agent")(e, t), Y = () => new E(w).addNode("requireNavigationServices", X).addNode("intentLLM", H).addNode("vectorSearchLayers", W).addNode("vectorSearchFields", Q).addNode("agent", B).addNode("tools", J).addEdge($, "requireNavigationServices").addEdge("requireNavigationServices", "intentLLM").addConditionalEdges(
225
233
  "intentLLM",
226
234
  (t) => t.intent === "goToLayer" || t.intent === "goToFeatures" ? "vectorSearchLayers" : "agent",
227
235
  {
@@ -235,7 +243,7 @@ ${r.results.map((d) => ` - ${d.name} (${d.score.toFixed(2)})`).join(`
235
243
  vectorSearchFields: "vectorSearchFields",
236
244
  agent: "agent"
237
245
  }
238
- ).addEdge("vectorSearchFields", "agent").addEdge("agent", "tools").addEdge("tools", C), Y = String.raw`- **navigation** — Enables users to interact with the map by navigating to specific locations, layers, features, or extents.
246
+ ).addEdge("vectorSearchFields", "agent").addEdge("agent", "tools").addEdge("tools", C), ee = String.raw`- **navigation** — Enables users to interact with the map by navigating to specific locations, layers, features, or extents.
239
247
  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.
240
248
 
241
249
  Supported actions:
@@ -254,13 +262,13 @@ ${r.results.map((d) => ` - ${d.name} (${d.score.toFixed(2)})`).join(`
254
262
  _Example: “Center the map on San Francisco at scale 50000”_
255
263
  _Example: “Zoom to the features in the schools layer where city = 'Austin'”_
256
264
  _Example: “Go to the Downtown bookmark”_
257
- _Example: “Where is Mount Rainier?”_`, pe = {
265
+ _Example: “Where is Mount Rainier?”_`, xe = {
258
266
  id: "navigation",
259
267
  name: "Navigation Agent",
260
- description: Y,
261
- createGraph: X,
268
+ description: ee,
269
+ createGraph: Y,
262
270
  workspace: w
263
271
  };
264
272
  export {
265
- pe as N
273
+ xe as N
266
274
  };
@@ -36,8 +36,14 @@ This is the order of preference in case of overlap:
36
36
 
37
37
  For example, "Where is Yosemite National Park". This is an address, but:
38
38
  A map that contains a bookmark with Yosemite National Park should prefer the bookmark.
39
- A map that has the National Parks layer, for example, should prefer the feature.
40
- If these do not exist, geocode and go to that address.
39
+ If bookmark does not exist, a map that has the National Parks layer, for example, should prefer the feature.
40
+ If both of these do not exist, geocode and go to that address.
41
+
42
+ Additional mapping guidance:
43
+
44
+ - "zoom/go to [layer]" with no filter → prefer \`goToLayer\`.
45
+ - "zoom/go to [features] where/with ..." (has a condition/filter) → prefer \`goToFeatures\`.
46
+ - Explicit numeric zoom/scale/viewpoint requests → prefer the matching zoom/scale/viewpoint tool.
41
47
 
42
48
  Return the name of the tool as a string.
43
49
  `;