@arcgis/ai-components 5.2.0-next.11 → 5.2.0-next.111

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 (334) hide show
  1. package/LICENSE.md +4 -2
  2. package/README.md +2 -2
  3. package/dist/agent-utils/LLMAgent.d.ts +9 -7
  4. package/dist/agent-utils/LLMAgent.js +63 -60
  5. package/dist/agent-utils/WorkflowAgent.js +14 -15
  6. package/dist/agent-utils/index.d.ts +78 -0
  7. package/dist/agent-utils/index.js +116 -97
  8. package/dist/agent-utils/middlewares/trace.d.ts +2 -0
  9. package/dist/agent-utils/middlewares/trace.js +5 -5
  10. package/dist/agent-utils/types.d.ts +13 -13
  11. package/dist/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
  12. package/dist/agentic-workflow/Edge.d.ts +16 -0
  13. package/dist/agentic-workflow/WebAgent.d.ts +39 -0
  14. package/dist/agentic-workflow/jsonTypes.d.ts +229 -0
  15. package/dist/agentic-workflow/nodes/AgentNode.d.ts +28 -0
  16. package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
  17. package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
  18. package/dist/agentic-workflow/nodes/HumanInTheLoopNode.d.ts +37 -0
  19. package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
  20. package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
  21. package/dist/agentic-workflow/types.d.ts +29 -0
  22. package/dist/agents/runtime/skill/createSkillAgent.d.ts +30 -0
  23. package/dist/agents/runtime/skill/createSkillAgent.js +260 -0
  24. package/dist/agents/runtime/skill/loadAgentSkills.d.ts +16 -0
  25. package/dist/agents/runtime/skill/types.d.ts +20 -0
  26. package/dist/{cdn/WNS5ZUF5.js → agents/runtime/skill/types.js} +1 -1
  27. package/dist/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
  28. package/dist/agents/tools/filter/clearFilters/adapter.js +22 -0
  29. package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
  30. package/dist/agents/tools/filter/resetMap/adapter.js +22 -0
  31. package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
  32. package/dist/agents/tools/filter/setFeatureEffect/adapter.js +122 -0
  33. package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
  34. package/dist/agents/tools/help/listFields/adapter.js +30 -0
  35. package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
  36. package/dist/agents/tools/navigation/goToAddress/adapter.js +60 -0
  37. package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
  38. package/dist/agents/tools/navigation/goToBookmark/adapter.js +30 -0
  39. package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
  40. package/dist/agents/tools/navigation/goToFeatures/adapter.js +50 -0
  41. package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
  42. package/dist/agents/tools/navigation/goToFullExtent/adapter.js +27 -0
  43. package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
  44. package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +24 -0
  45. package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
  46. package/dist/agents/tools/navigation/goToLayer/adapter.js +26 -0
  47. package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
  48. package/dist/agents/tools/navigation/goToScale/adapter.js +21 -0
  49. package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
  50. package/dist/agents/tools/navigation/goToViewpoint/adapter.js +42 -0
  51. package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
  52. package/dist/agents/tools/navigation/goToZoom/adapter.js +21 -0
  53. package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
  54. package/dist/agents/tools/query/getAttribute/adapter.js +40 -0
  55. package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
  56. package/dist/agents/tools/query/getStatistics/adapter.js +158 -0
  57. package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
  58. package/dist/agents/tools/query/getTopFeatures/adapter.js +145 -0
  59. package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
  60. package/dist/agents/tools/query/queryFeatures/adapter.js +131 -0
  61. package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
  62. package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
  63. package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
  64. package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
  65. package/dist/agents/tools/shared/resolveToolArtifact.d.ts +22 -0
  66. package/dist/agents/tools/shared/resolveToolArtifact.js +20 -0
  67. package/dist/agents/tools/shared/types.d.ts +22 -0
  68. package/dist/agents/tools/shared/types.js +6 -0
  69. package/dist/cdn/2BNQ6A6J.js +2 -0
  70. package/dist/cdn/2MWUBKWI.js +2 -0
  71. package/dist/cdn/{F6QHMKF5.js → 2O4DON37.js} +1 -1
  72. package/dist/cdn/2W7LK4HA.js +2 -0
  73. package/dist/cdn/33PB7ALY.js +2 -0
  74. package/dist/cdn/{5CV7R5IS.js → 33SFAZQG.js} +5 -5
  75. package/dist/cdn/34O57OGV.js +2 -0
  76. package/dist/cdn/{5W7S2RS4.js → 3UEKINYC.js} +1 -1
  77. package/dist/cdn/4IU63OWQ.js +2 -0
  78. package/dist/cdn/5A355PGH.js +14 -0
  79. package/dist/cdn/5HBAJ57P.js +2 -0
  80. package/dist/cdn/5MK44FNO.js +2 -0
  81. package/dist/cdn/5Q2XRQS6.js +2 -0
  82. package/dist/cdn/6ECRQVHY.js +2 -0
  83. package/dist/cdn/6OOZSZRJ.js +2 -0
  84. package/dist/cdn/6OUIUXAJ.js +2 -0
  85. package/dist/cdn/{UPEEHMSY.js → 6P44KOKX.js} +1 -1
  86. package/dist/cdn/73TMZQI5.js +2 -0
  87. package/dist/cdn/74CVYM72.js +19 -0
  88. package/dist/cdn/7EHOFQ2P.js +3 -0
  89. package/dist/cdn/7KSFIRXB.js +2 -0
  90. package/dist/cdn/AHCXG7XF.js +2 -0
  91. package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
  92. package/dist/cdn/{Q7TL5Q5N.js → APFZY4PI.js} +1 -1
  93. package/dist/cdn/AVRS6UCQ.js +2 -0
  94. package/dist/cdn/AVZ5Y6BK.js +11 -0
  95. package/dist/cdn/AXTQU5YL.js +56 -0
  96. package/dist/cdn/BBPD2AS7.js +2 -0
  97. package/dist/cdn/BFZ5S7NF.js +2 -0
  98. package/dist/cdn/{6ZW7Z36F.js → BL273EGZ.js} +3 -3
  99. package/dist/cdn/C7JPWFZE.js +2 -0
  100. package/dist/cdn/CCC6LBMY.js +2 -0
  101. package/dist/cdn/{5ZZGKP7N.js → CEKOEHB3.js} +1 -1
  102. package/dist/cdn/CFAC4FN3.js +2 -0
  103. package/dist/cdn/COH3QXWG.js +4 -0
  104. package/dist/cdn/DB2TFPIO.js +2 -0
  105. package/dist/cdn/DE26DAW5.js +2 -0
  106. package/dist/cdn/DG27JEYG.js +50 -0
  107. package/dist/cdn/DKA6PSYN.js +2 -0
  108. package/dist/cdn/DQ2Z65UO.js +3 -0
  109. package/dist/cdn/DWH23NJN.js +2 -0
  110. package/dist/cdn/EDXTPEEU.js +2 -0
  111. package/dist/cdn/ENM3L4AC.js +2 -0
  112. package/dist/cdn/EVMIYZWD.js +2 -0
  113. package/dist/cdn/EYOWRGDP.js +2 -0
  114. package/dist/cdn/EYY367WR.js +2 -0
  115. package/dist/cdn/F5NIRETW.js +2 -0
  116. package/dist/cdn/FCI6M62J.js +2 -0
  117. package/dist/cdn/FDOMMK2M.js +2 -0
  118. package/dist/cdn/FS7GXTTQ.js +6 -0
  119. package/dist/cdn/{T537PKP4.js → FYZATVB3.js} +1 -1
  120. package/dist/cdn/H6P3WP5D.js +14 -0
  121. package/dist/cdn/HHP5YLUI.js +2 -0
  122. package/dist/cdn/HIAQARIQ.js +2 -0
  123. package/dist/cdn/HMIDFTEI.js +2 -0
  124. package/dist/cdn/HMNBUGH2.js +2 -0
  125. package/dist/cdn/HR6GWPKX.js +2 -0
  126. package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
  127. package/dist/cdn/IH26MIYY.js +2 -0
  128. package/dist/cdn/IHP25JWI.js +99 -0
  129. package/dist/cdn/IYLFJCJ2.js +181 -0
  130. package/dist/cdn/J6A4AS7E.js +22 -0
  131. package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
  132. package/dist/cdn/JICNSK6Y.js +6 -0
  133. package/dist/cdn/JQYLMTDP.js +2 -0
  134. package/dist/cdn/K5JVB6FU.js +2 -0
  135. package/dist/cdn/K7XWGSLN.js +2 -0
  136. package/dist/cdn/K7YQIJFT.js +2 -0
  137. package/dist/cdn/KH4V4I3W.js +2 -0
  138. package/dist/cdn/KMLJS2VW.js +2 -0
  139. package/dist/cdn/LAVFUDUG.js +2 -0
  140. package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
  141. package/dist/cdn/LOQ2PKV5.js +208 -0
  142. package/dist/cdn/LXPGQNXQ.js +5 -0
  143. package/dist/cdn/MJSIYEWN.js +2 -0
  144. package/dist/cdn/{ZEYIBYSF.js → MWYBF3F3.js} +1 -1
  145. package/dist/cdn/{24QNMEFG.js → MXTXJKFE.js} +1 -1
  146. package/dist/cdn/NEV6OZN3.js +71 -0
  147. package/dist/cdn/O4NVW75A.js +2 -0
  148. package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
  149. package/dist/cdn/OMF6ITSG.js +2 -0
  150. package/dist/cdn/ONQ6JSBJ.js +2 -0
  151. package/dist/cdn/OZAZ277H.js +2 -0
  152. package/dist/cdn/P4GFYBBO.js +3 -0
  153. package/dist/cdn/P4XZMBU5.js +2 -0
  154. package/dist/cdn/POL6HKCG.js +72 -0
  155. package/dist/cdn/POZYDAU2.js +2 -0
  156. package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
  157. package/dist/cdn/PYGX4HN7.js +2 -0
  158. package/dist/cdn/QNXI3WOF.js +179 -0
  159. package/dist/cdn/{DXVU45KM.js → QRMRID2M.js} +1 -1
  160. package/dist/cdn/R74ZHFA6.js +2 -0
  161. package/dist/cdn/RFVZ7KCG.js +66 -0
  162. package/dist/cdn/RHYNE5OE.js +2 -0
  163. package/dist/cdn/RLEHNAIA.js +2 -0
  164. package/dist/cdn/ROQGPAR5.js +9 -0
  165. package/dist/cdn/RXF2NUOL.js +2 -0
  166. package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
  167. package/dist/cdn/SHI76XUV.js +2 -0
  168. package/dist/cdn/SITY6L4S.js +2 -0
  169. package/dist/cdn/STHBRTTD.js +2 -0
  170. package/dist/cdn/{WAIFKDR3.js → SXM4NUT5.js} +1 -1
  171. package/dist/cdn/SZRJTQ54.js +2 -0
  172. package/dist/cdn/TO2NY7EA.js +2 -0
  173. package/dist/cdn/TPULIO6I.js +34 -0
  174. package/dist/cdn/TVEEQSMF.js +2 -0
  175. package/dist/cdn/TWU3QXAS.js +2 -0
  176. package/dist/cdn/TYATJUNF.js +2 -0
  177. package/dist/cdn/UCTC4JN4.js +3 -0
  178. package/dist/cdn/UDRKUVZP.js +2 -0
  179. package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
  180. package/dist/cdn/UHICISBZ.js +2 -0
  181. package/dist/cdn/UO5PBOQR.js +2 -0
  182. package/dist/cdn/UZLQALHY.js +2 -0
  183. package/dist/cdn/V6HOUZPZ.js +2 -0
  184. package/dist/cdn/{P7DG5T3Z.js → V7Y22FRP.js} +1 -1
  185. package/dist/cdn/VAXH6RUQ.js +134 -0
  186. package/dist/cdn/VNLSYVPE.js +2 -0
  187. package/dist/cdn/VR3CF3ZY.js +2 -0
  188. package/dist/cdn/VWP2B4LB.js +2 -0
  189. package/dist/cdn/VXFQANGJ.js +2 -0
  190. package/dist/cdn/WKZHFSH3.js +2 -0
  191. package/dist/cdn/{AZGGTNA3.js → WSWB3B7B.js} +1 -1
  192. package/dist/cdn/WVP73XWD.js +2 -0
  193. package/dist/cdn/WXQ26G5Q.js +2 -0
  194. package/dist/cdn/XQ3NBBQ3.js +2 -0
  195. package/dist/cdn/{7CYGX4F4.js → YHWYTHID.js} +1 -1
  196. package/dist/cdn/YIZ7PR2G.js +2 -0
  197. package/dist/cdn/Z5XQLSYH.js +2 -0
  198. package/dist/cdn/ZFOG3KXV.js +2 -0
  199. package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
  200. package/dist/cdn/agent-utils/index.js +1 -1
  201. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +1 -2
  202. package/dist/cdn/agent-utils/middlewares/middleware.js +1 -1
  203. package/dist/cdn/agent-utils/middlewares/trace.js +1 -1
  204. package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
  205. package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
  206. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
  207. package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
  208. package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
  209. package/dist/cdn/index.js +1 -1
  210. package/dist/chunks/SKILL.js +5 -0
  211. package/dist/chunks/SKILL2.js +5 -0
  212. package/dist/chunks/SKILL3.js +22 -0
  213. package/dist/chunks/SKILL4.js +5 -0
  214. package/dist/chunks/adapter.js +1126 -2010
  215. package/dist/chunks/aiFactory.js +100 -0
  216. package/dist/chunks/arcgisKnowledgeGraph.js +96 -76
  217. package/dist/chunks/arcgisToolRegistry.js +88 -0
  218. package/dist/chunks/arcgis_knowledge_current_lc_context.js +19 -2
  219. package/dist/chunks/arcgis_knowledge_current_map_context.js +31 -2
  220. package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
  221. package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +116 -27
  222. package/dist/chunks/baseAgentState.js +58 -0
  223. package/dist/chunks/converterUtils.js +66 -41
  224. package/dist/chunks/dataExplorationAgent.js +19 -0
  225. package/dist/chunks/data_explore_query_prompt.js +9 -4
  226. package/dist/chunks/fetchAgentContext.js +13 -0
  227. package/dist/chunks/fetchService.js +10 -0
  228. package/dist/chunks/fieldStatistics.js +79 -0
  229. package/dist/chunks/formatFeatureAttributes.js +132 -0
  230. package/dist/chunks/generateLayerDescriptions.js +183 -307
  231. package/dist/chunks/helpAgent.js +34 -0
  232. package/dist/chunks/help_prompt.js +34 -17
  233. package/dist/chunks/intent_prompt.js +2 -2
  234. package/dist/chunks/layerStylingGraph.js +101 -83
  235. package/dist/chunks/mergeWhereClauses.js +15 -0
  236. package/dist/chunks/navigationAgent.js +27 -0
  237. package/dist/chunks/navigation_intent_prompt.js +8 -2
  238. package/dist/chunks/orchestrator.js +445 -234
  239. package/dist/chunks/requireAgentServices.js +11 -0
  240. package/dist/chunks/resolvePointGeometryFilter.js +92 -0
  241. package/dist/chunks/state.js +39 -45
  242. package/dist/chunks/utils2.js +11 -11
  243. package/dist/components/arcgis-assistant/customElement.d.ts +102 -1
  244. package/dist/components/arcgis-assistant/customElement.js +331 -183
  245. package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
  246. package/dist/components/arcgis-assistant-agent/customElement.js +674 -10
  247. package/dist/components/arcgis-assistant-chat/customElement.js +22 -17
  248. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +34 -8
  249. package/dist/components/arcgis-assistant-help-agent/customElement.js +31 -8
  250. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
  251. package/dist/components/arcgis-assistant-interrupt/customElement.js +11 -12
  252. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +12 -8
  253. package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +1 -1
  254. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +40 -16
  255. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +30 -7
  256. package/dist/components/arcgis-assistant-message/customElement.d.ts +3 -0
  257. package/dist/components/arcgis-assistant-message/customElement.js +9 -8
  258. package/dist/components/arcgis-assistant-message-block/customElement.js +1 -1
  259. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +3 -0
  260. package/dist/components/arcgis-assistant-message-loading/customElement.js +11 -10
  261. package/dist/components/arcgis-assistant-message-text/customElement.d.ts +1 -0
  262. package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
  263. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +33 -9
  264. package/dist/components/arcgis-assistant-speech-input/customElement.js +34 -52
  265. package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
  266. package/dist/components/arcgis-assistant-user-message/customElement.js +15 -10
  267. package/dist/docs/api.json +1 -1
  268. package/dist/docs/docs.json +1 -1
  269. package/dist/docs/vscode.html-custom-data.json +1 -1
  270. package/dist/docs/web-types.json +1 -1
  271. package/dist/loader.js +6 -6
  272. package/dist/oauth-callback.html +1 -1
  273. package/dist/orchestrator/models/types.d.ts +1 -0
  274. package/dist/orchestrator/orchestrator/orchestratorEvents.d.ts +78 -0
  275. package/dist/orchestrator/providers/arcgis/aiFactory.d.ts +15 -0
  276. package/dist/orchestrator/types/types.d.ts +17 -0
  277. package/dist/types/lumina.d.ts +5 -4
  278. package/dist/types/preact.d.ts +5 -4
  279. package/dist/types/react.d.ts +5 -4
  280. package/dist/types/stencil.d.ts +7 -6
  281. package/dist/utils/index.d.ts +75 -39
  282. package/dist/utils/index.js +707 -83
  283. package/package.json +35 -12
  284. package/dist/cdn/34SG44C3.js +0 -72
  285. package/dist/cdn/3JGWGKT6.js +0 -2
  286. package/dist/cdn/3NBDVZ2I.js +0 -2
  287. package/dist/cdn/3VOQD2MR.js +0 -2
  288. package/dist/cdn/53NTYC4I.js +0 -2
  289. package/dist/cdn/5QAHYX7Y.js +0 -5
  290. package/dist/cdn/AXDZBBNL.js +0 -45
  291. package/dist/cdn/B7WJFBOZ.js +0 -2
  292. package/dist/cdn/BX7FSMUU.js +0 -56
  293. package/dist/cdn/CHPQM77M.js +0 -181
  294. package/dist/cdn/DHKUXLU3.js +0 -179
  295. package/dist/cdn/DQSEBKOX.js +0 -2
  296. package/dist/cdn/DZ2QWNUA.js +0 -3
  297. package/dist/cdn/EBISDZ5H.js +0 -2
  298. package/dist/cdn/ERL2CB2Y.js +0 -14
  299. package/dist/cdn/F2AHA4GB.js +0 -54
  300. package/dist/cdn/FUIGPHBH.js +0 -2
  301. package/dist/cdn/H2CHHGGH.js +0 -2
  302. package/dist/cdn/HWKDNS4K.js +0 -4
  303. package/dist/cdn/IMQ4TVHF.js +0 -16
  304. package/dist/cdn/IOD3GDA7.js +0 -2
  305. package/dist/cdn/IR7PTESF.js +0 -2
  306. package/dist/cdn/IRZDTYO2.js +0 -2
  307. package/dist/cdn/JIWK6QK6.js +0 -2
  308. package/dist/cdn/JLKGS6Y5.js +0 -36
  309. package/dist/cdn/K3JCH4XW.js +0 -2
  310. package/dist/cdn/KHXUWZHB.js +0 -2
  311. package/dist/cdn/KMQ3SP4I.js +0 -5
  312. package/dist/cdn/LIFK3QSD.js +0 -2
  313. package/dist/cdn/NXKKG5TK.js +0 -2
  314. package/dist/cdn/O3EN27N5.js +0 -2
  315. package/dist/cdn/O3RFFPU3.js +0 -6
  316. package/dist/cdn/PBO6FZN6.js +0 -2
  317. package/dist/cdn/Q3ZW4FYA.js +0 -3
  318. package/dist/cdn/Q6LRANX6.js +0 -2
  319. package/dist/cdn/QCSN44H4.js +0 -2
  320. package/dist/cdn/R56X6ZKR.js +0 -161
  321. package/dist/cdn/RUURNLTP.js +0 -2
  322. package/dist/cdn/T43LEBBE.js +0 -47
  323. package/dist/cdn/TR4GFL7X.js +0 -2
  324. package/dist/cdn/X4XY5HIE.js +0 -2
  325. package/dist/cdn/XOH56EQ2.js +0 -2
  326. package/dist/cdn/XON27U6U.js +0 -2
  327. package/dist/cdn/YIMNOUTF.js +0 -2
  328. package/dist/cdn/YLN2BZ5J.js +0 -2
  329. package/dist/cdn/YUKR4AZW.js +0 -2
  330. package/dist/cdn/Z2G7MP5L.js +0 -22
  331. package/dist/chunks/dataExplorationGraph.js +0 -310
  332. package/dist/chunks/helpGraph.js +0 -126
  333. package/dist/chunks/navigationGraph.js +0 -270
  334. package/dist/chunks/toolCallResponse.js +0 -31
@@ -1,104 +1,32 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
2
  import { Annotation as p } from "@langchain/langgraph/web";
3
- import m, { z as r } from "zod";
4
- import { ChatPromptTemplate as D, SystemMessagePromptTemplate as K } from "@langchain/core/prompts";
5
- import { s as f } from "./index.js";
6
- import { AIMessage as B, isAIMessage as W, isToolMessage as X } from "@langchain/core/messages";
7
- import { createAgent as H, summarizationMiddleware as J, modelCallLimitMiddleware as G } from "langchain";
8
- import { ChatOpenAI as Q, OpenAIEmbeddings as Y } from "@langchain/openai";
9
- import F from "@arcgis/core/portal/Portal.js";
10
- import Z from "@arcgis/core/identity/IdentityManager.js";
11
- import ee from "@arcgis/core/config.js";
12
- const q = {
13
- advanced: "gpt-5.2",
14
- default: "gpt-5-mini",
15
- fast: "gpt-5.4-nano"
16
- }, k = {
17
- default: "text-embedding-ada-002"
18
- }, M = /* @__PURE__ */ new Map();
19
- let x = null;
20
- const te = () => {
21
- const t = F.getDefault().helperServices;
22
- if (!t?.aiModels?.url)
23
- throw new Error("AI Models Service URL is not defined in the portal's helper services.");
24
- return t.aiModels.url;
25
- }, U = async (e) => {
26
- const t = te();
27
- M.size === 0 && (x || (x = (async () => {
28
- try {
29
- const n = await fetch(`${t}/models`);
30
- if (!n.ok)
31
- throw new Error("Failed to fetch AI service discovery data.");
32
- (await n.json()).models.forEach((o) => M.set(o.name, o));
33
- } catch (n) {
34
- throw x = null, n;
35
- }
36
- })()), await x);
37
- const s = M.get(e);
38
- if (!s)
39
- throw new Error(`Model '${e}' is not available in the discovery service.`);
40
- return s.endpoint;
41
- }, ne = async (e = "default") => await U(q[e]), se = async (e = "default") => await U(k[e]), h = (e, t) => t, P = (e, t) => ({
42
- ...e,
43
- ...t
44
- }), _ = (e = "", t) => {
45
- const s = typeof t == "string" ? t.trim() : "";
46
- if (!s)
47
- return e;
48
- const n = e.trim();
49
- if (!n)
50
- return s;
51
- if (n === s)
52
- return e;
53
- const i = n.split(`
54
-
55
- `);
56
- return i[i.length - 1]?.trim() === s ? e : `${e}
57
-
58
- ${s}`;
59
- }, j = () => ({
60
- userRequest: "",
61
- assignedTask: "",
62
- messages: [],
63
- priorSteps: [],
64
- sharedState: {}
65
- }), ie = () => ({
66
- agentExecutionContext: p({
67
- reducer: P,
68
- default: j
69
- }),
70
- outputMessage: p({
71
- reducer: _,
72
- default: () => ""
73
- }),
74
- summary: p({
75
- reducer: h,
76
- default: () => ""
77
- }),
78
- status: p({
79
- reducer: h
80
- })
81
- }), Pe = () => ({
82
- ...ie(),
83
- sharedStatePatch: p({
84
- reducer: h
85
- })
86
- }), _e = p.Root({
3
+ import { b as j, r as T, m as P, c as q } from "./baseAgentState.js";
4
+ import l, { z as s } from "zod";
5
+ import { ChatPromptTemplate as S, SystemMessagePromptTemplate as N } from "@langchain/core/prompts";
6
+ import { s as g } from "./index.js";
7
+ import { AIMessage as O, isAIMessage as $, isToolMessage as U } from "@langchain/core/messages";
8
+ import { createAgent as V, summarizationMiddleware as L, modelCallLimitMiddleware as z } from "langchain";
9
+ import { c as y, E as W } from "./aiFactory.js";
10
+ const he = p.Root({
87
11
  agentExecutionContext: p({
88
- default: j,
12
+ default: q,
89
13
  reducer: P
90
14
  }),
91
15
  currentIntent: p({
92
16
  default: () => "none",
93
- reducer: h
17
+ reducer: T
18
+ }),
19
+ routing: p({
20
+ default: () => ({ mode: "auto" }),
21
+ reducer: T
94
22
  }),
95
23
  lastExecutedAgent: p({
96
24
  default: () => "",
97
- reducer: h
25
+ reducer: T
98
26
  }),
99
27
  requiresFollowUp: p({
100
28
  default: () => !0,
101
- reducer: h
29
+ reducer: T
102
30
  }),
103
31
  stepCount: p({
104
32
  default: () => 0,
@@ -106,125 +34,82 @@ ${s}`;
106
34
  }),
107
35
  finalOutputMessage: p({
108
36
  default: () => "",
109
- reducer: _
37
+ reducer: j
110
38
  })
111
- }), oe = (e) => {
39
+ }), B = (e) => {
112
40
  if (!e || typeof e != "object" || !("services" in e))
113
41
  return !1;
114
42
  const t = e.services;
115
43
  return !!t && typeof t == "object" && "agentRegistry" in t;
116
- }, re = (e) => {
44
+ }, G = (e) => {
117
45
  const t = e?.configurable;
118
- return oe(t) ? t : void 0;
119
- }, ae = (e, t, s) => {
46
+ return B(t) ? t : void 0;
47
+ }, H = (e, t, i) => {
120
48
  const n = e[t];
121
- return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((i, o) => {
122
- (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(o.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + t + (t.split("/").length !== s ? ". Note that variables only represent file names one level deep." : ""))));
49
+ return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((r, o) => {
50
+ (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(o.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + t + (t.split("/").length !== i ? ". Note that variables only represent file names one level deep." : ""))));
123
51
  });
124
- }, I = async (e) => (await ae(/* @__PURE__ */ Object.assign({ "./field_descriptions_prompt.md": () => import("./field_descriptions_prompt.js"), "./intent_prompt.md": () => import("./intent_prompt.js"), "./layer_descriptions_prompt.md": () => import("./layer_descriptions_prompt.js") }), `./${e}.md`, 2)).default, ce = async (e) => {
125
- const { agent: t, messages: s, config: n } = e;
52
+ }, v = async (e) => (await H(/* @__PURE__ */ Object.assign({ "./field_descriptions_prompt.md": () => import("./field_descriptions_prompt.js"), "./intent_prompt.md": () => import("./intent_prompt.js"), "./layer_descriptions_prompt.md": () => import("./layer_descriptions_prompt.js") }), `./${e}.md`, 2)).default, J = async (e) => {
53
+ const { agent: t, messages: i, config: n } = e;
126
54
  return { structuredResponse: (await t.invoke(
127
55
  {
128
- messages: s
56
+ messages: i
129
57
  },
130
58
  n
131
59
  )).structuredResponse };
132
- }, le = (e) => typeof e == "string" && e.length > 0 ? e : void 0, de = (e) => e && typeof e == "object" && "aborted" in e ? e : void 0, pe = (e) => {
133
- const t = e?.configurable;
134
- return {
135
- conversationId: le(t?.thread_id),
136
- abortSignal: de(t?.abortSignal),
137
- requestId: ee.applicationName
138
- };
139
- }, N = async ({ config: e }) => {
140
- const t = F.getDefault(), n = (await Z.getCredential(`${t.url}/sharing`))?.token;
141
- return async (i, o) => {
142
- const { conversationId: a, abortSignal: d, requestId: c } = pe(e), l = new Headers(o?.headers);
143
- l.delete("Authorization"), l.delete("api-key"), n && n.length > 0 && (l.set("X-Esri-Authorization", `Bearer ${n}`), l.set("X-Esri-Request-Source", "MapsSDK")), a && a.length > 0 && l.set("X-Esri-Conversation-Id", a), c && c.length > 0 && l.set("X-Esri-Request-Id", c);
144
- const u = d && o?.signal ? AbortSignal.any([d, o.signal]) : o?.signal ?? d;
145
- return await fetch(i, {
146
- ...o,
147
- headers: l,
148
- signal: u
149
- });
150
- };
151
- }, b = async (e = {}) => {
152
- const { modelTier: t = "default", temperature: s = 0, config: n } = e, i = q[t], o = await ne(t);
153
- return new Q({
154
- modelName: i,
155
- apiKey: "dummy-key",
156
- // 5-mini does not support temperature parameter
157
- ...t !== "default" && { temperature: s },
158
- configuration: {
159
- baseURL: o,
160
- fetch: await N({ config: n })
161
- }
162
- });
163
- }, je = async (e = {}) => {
164
- const { tier: t = "default", config: s } = e, n = k[t], i = await se(t);
165
- return new Y({
166
- modelName: n,
167
- apiKey: "dummy-key",
168
- configuration: {
169
- baseURL: i,
170
- fetch: await N({ config: s })
171
- },
172
- batchSize: 2048,
173
- maxConcurrency: 10
174
- });
175
- }, me = r.object({
176
- id: r.string().min(1),
177
- name: r.string().min(1),
178
- description: r.string().min(1)
60
+ }, K = s.object({
61
+ id: s.string().min(1),
62
+ name: s.string().min(1),
63
+ description: s.string().min(1)
179
64
  });
180
- r.array(me);
181
- const C = (e) => JSON.stringify(e, null, 2), ue = (e) => {
182
- const t = e.map((n) => n.id), s = r.enum(t);
183
- return r.object({
184
- intent: s.nullable(),
185
- assignedTask: r.string().nullable(),
186
- requiresFollowUp: r.boolean()
65
+ s.array(K);
66
+ const I = (e) => JSON.stringify(e, null, 2), Q = (e) => {
67
+ const t = e.map((n) => n.id), i = s.enum(t);
68
+ return s.object({
69
+ intent: i.nullable(),
70
+ assignedTask: s.string().nullable(),
71
+ requiresFollowUp: s.boolean()
187
72
  });
188
- }, Ne = async (e, t) => {
189
- const s = re(t);
190
- if (s.abortSignal?.aborted)
191
- return await f({ text: "Run cancelled; skipping intent routing" }, t), {
73
+ }, ye = async (e, t) => {
74
+ const i = G(t);
75
+ if (t?.signal?.aborted)
76
+ return await g({ text: "Run cancelled; skipping intent routing" }, t), {
192
77
  ...e,
193
78
  currentIntent: "none",
194
79
  finalOutputMessage: "Operation cancelled.",
195
80
  requiresFollowUp: !1
196
81
  };
197
82
  try {
198
- await f({ text: "Asking LLM to route to an agent" }, t);
199
- const i = s.services.agentRegistry?.list() ?? [], o = i.map(({ agent: g }) => ({
200
- id: g.id,
201
- name: g.name,
202
- description: g.description
83
+ await g({ text: "Asking LLM to route to an agent" }, t);
84
+ const r = i.services.agentRegistry?.list() ?? [], o = r.map(({ agent: u }) => ({
85
+ id: u.id,
86
+ name: u.name,
87
+ description: u.description
203
88
  }));
204
89
  if (!o.length)
205
- return await f({ text: "No agents registered; skipping intent detection" }, t), {
90
+ return await g({ text: "No agents registered; skipping intent detection" }, t), {
206
91
  ...e,
207
92
  currentIntent: "none",
208
93
  finalOutputMessage: "No agents registered; skipping intent detection."
209
94
  };
210
- const a = await I("intent_prompt"), d = C(o), c = ue(o), l = {
211
- registeredAgents: d,
212
- priorSteps: C(e.agentExecutionContext.priorSteps),
95
+ const a = await v("intent_prompt"), c = I(o), m = Q(o), d = {
96
+ registeredAgents: c,
97
+ priorSteps: I(e.agentExecutionContext.priorSteps),
213
98
  userRequest: e.agentExecutionContext.userRequest
214
- }, T = await D.fromTemplate(a).format(l), E = H({
215
- model: await b({
99
+ }, k = await S.fromTemplate(a).format(d), D = V({
100
+ model: await y({
216
101
  modelTier: "fast",
217
102
  config: t
218
103
  }),
219
104
  tools: [],
220
- systemPrompt: T,
221
- responseFormat: c,
105
+ systemPrompt: k,
106
+ responseFormat: m,
222
107
  middleware: [
223
108
  // Preserve recent conversation context while summarizing older messages
224
109
  // to control token usage without losing important intent signals.
225
110
  // The trigger and keep parameters can be tuned based on token limits and behavior.
226
- J({
227
- model: await b({
111
+ L({
112
+ model: await y({
228
113
  modelTier: "fast",
229
114
  config: t
230
115
  }),
@@ -233,36 +118,36 @@ const C = (e) => JSON.stringify(e, null, 2), ue = (e) => {
233
118
  }),
234
119
  // Enforce no loop/retry.
235
120
  // 1 usual LLM call and 1 optional summarization call.
236
- G({ runLimit: 2 })
121
+ z({ runLimit: 2 })
237
122
  ]
238
- }), { structuredResponse: V } = await ce({
239
- agent: E,
123
+ }), { structuredResponse: R } = await J({
124
+ agent: D,
240
125
  messages: e.agentExecutionContext.messages,
241
126
  config: t
242
- }), y = c.parse(
243
- V ?? { intent: null, assignedTask: null, requiresFollowUp: !1 }
244
- ), v = y.intent ?? "none", z = {
127
+ }), f = m.parse(
128
+ R ?? { intent: null, assignedTask: null, requiresFollowUp: !1 }
129
+ ), x = f.intent ?? "none", F = {
245
130
  ...e,
246
- currentIntent: v,
247
- requiresFollowUp: y.requiresFollowUp,
131
+ currentIntent: x,
132
+ requiresFollowUp: f.requiresFollowUp,
248
133
  agentExecutionContext: {
249
134
  ...e.agentExecutionContext,
250
- assignedTask: y.assignedTask ?? ""
135
+ assignedTask: f.assignedTask ?? ""
251
136
  }
252
137
  };
253
- if (v === "none") {
254
- const g = `I could not find an agent that can handle that request. I have access to the following agents: ${i.map(({ agent: L }) => L.name).join(", ")}.
138
+ if (x === "none") {
139
+ const u = `I could not find an agent that can handle that request. I have access to the following agents: ${r.map(({ agent: _ }) => _.name).join(", ")}.
255
140
 
256
141
  Please ask a question that can be answered by one of these agents.`;
257
- return await f({ text: "LLM did not identify a clear intent." }, t), {
142
+ return await g({ text: "LLM did not identify a clear intent." }, t), {
258
143
  ...e,
259
- currentIntent: v,
144
+ currentIntent: x,
260
145
  requiresFollowUp: !1,
261
- finalOutputMessage: g,
146
+ finalOutputMessage: u,
262
147
  agentExecutionContext: {
263
148
  ...e.agentExecutionContext,
264
149
  assignedTask: "",
265
- messages: [...e.agentExecutionContext.messages, new B(g)],
150
+ messages: [...e.agentExecutionContext.messages, new O(u)],
266
151
  priorSteps: [
267
152
  ...e.agentExecutionContext.priorSteps ?? [],
268
153
  {
@@ -275,177 +160,168 @@ Please ask a question that can be answered by one of these agents.`;
275
160
  }
276
161
  };
277
162
  }
278
- return await f(
163
+ return await g(
279
164
  {
280
- text: `Agent picked: ${v}
281
- Task Assigned: ${y.assignedTask ?? ""}
282
- Requires Follow-Up: ${y.requiresFollowUp}`
165
+ text: `Agent picked: ${x}
166
+ Task Assigned: ${f.assignedTask ?? ""}
167
+ Requires Follow-Up: ${f.requiresFollowUp}`
283
168
  },
284
169
  t
285
- ), z;
170
+ ), F;
286
171
  } catch (n) {
287
- throw await f({ text: "Error during intent detection" }, t), new Error(`Error during intent detection: ${n instanceof Error ? n.message : String(n)}`);
172
+ throw await g({ text: "Error during intent detection" }, t), new Error(`Error during intent detection: ${n instanceof Error ? n.message : String(n)}`);
288
173
  }
289
- }, ge = "0.1", w = 1536, fe = "openai", he = k.default, ye = `Name: {name}
174
+ }, X = "0.1", h = 1536, Y = "openai", Z = W.default, ee = `Name: {name}
290
175
  Title: {title}
291
- Description: {description}`, we = `Name: {name}
176
+ Description: {description}`, te = `Name: {name}
292
177
  Alias: {alias}
293
- Description: {description}`, $e = r.object({
294
- schemaVersion: r.literal(ge),
295
- modified: r.number().int().nonnegative(),
296
- embeddings: r.object({
297
- modelProvider: r.literal(fe),
298
- model: r.literal(he),
299
- dimensions: r.literal(w),
300
- templates: r.object({
301
- layer: r.string().default(ye),
302
- field: r.string().default(we)
178
+ Description: {description}`, we = s.object({
179
+ schemaVersion: s.literal(X),
180
+ modified: s.number().int().nonnegative(),
181
+ embeddings: s.object({
182
+ modelProvider: s.literal(Y),
183
+ model: s.literal(Z),
184
+ dimensions: s.literal(h),
185
+ templates: s.object({
186
+ layer: s.string().default(ee),
187
+ field: s.string().default(te)
303
188
  })
304
189
  }),
305
- layers: r.array(
306
- r.object({
307
- id: r.string().min(1),
308
- name: r.string().min(1),
309
- title: r.string().catch(""),
310
- description: r.string().catch(""),
311
- vector: r.array(r.number()).length(w, {
312
- message: `Layer vector must be exactly ${w} dimensions`
190
+ layers: s.array(
191
+ s.object({
192
+ id: s.string().min(1),
193
+ name: s.string().min(1),
194
+ title: s.string().catch(""),
195
+ description: s.string().catch(""),
196
+ vector: s.array(s.number()).length(h, {
197
+ message: `Layer vector must be exactly ${h} dimensions`
313
198
  }),
314
- fields: r.array(
315
- r.object({
316
- name: r.string().min(1),
317
- alias: r.string().catch(""),
318
- description: r.string().catch(""),
319
- vector: r.array(r.number()).length(w, {
320
- message: `Field vector must be exactly ${w} dimensions`
199
+ fields: s.array(
200
+ s.object({
201
+ name: s.string().min(1),
202
+ alias: s.string().catch(""),
203
+ description: s.string().catch(""),
204
+ vector: s.array(s.number()).length(h, {
205
+ message: `Field vector must be exactly ${h} dimensions`
321
206
  })
322
207
  })
323
208
  )
324
209
  })
325
210
  ).default([])
326
- }), be = (e) => {
211
+ }), ne = (e) => {
327
212
  const t = /* @__PURE__ */ new Set();
328
213
  for (const n of e)
329
- if (W(n)) {
330
- const i = n;
331
- i.tool_calls && i.tool_calls.length > 0 && i.tool_calls.forEach((o) => {
214
+ if ($(n)) {
215
+ const r = n;
216
+ r.tool_calls && r.tool_calls.length > 0 && r.tool_calls.forEach((o) => {
332
217
  o.id && t.add(o.id);
333
218
  });
334
219
  }
335
220
  return e.filter((n) => {
336
- if (X(n)) {
337
- const i = n;
338
- return t.has(i.tool_call_id);
221
+ if (U(n)) {
222
+ const r = n;
223
+ return t.has(r.tool_call_id);
339
224
  }
340
225
  return !0;
341
226
  });
342
- }, A = (e, t) => {
343
- const s = K.fromTemplate(e);
344
- return D.fromMessages([s, ...t]);
345
- }, ve = async (e) => {
346
- const { promptText: t, modelTier: s, temperature: n, messages: i, config: o } = e, a = A(t, i ?? []), d = await b({ modelTier: s, temperature: n, config: o });
347
- return a.pipe(d);
348
- }, Oe = async (e) => {
349
- const { promptText: t, modelTier: s = "default", temperature: n = 0, messages: i, inputVariables: o, config: a } = e, c = await (await ve({
227
+ }, M = (e, t) => {
228
+ const i = N.fromTemplate(e);
229
+ return S.fromMessages([i, ...t]);
230
+ }, se = async (e) => {
231
+ const { promptText: t, modelTier: i, messages: n, config: r } = e, o = M(t, n ?? []), a = await y({ modelTier: i, config: r });
232
+ return o.pipe(a);
233
+ }, xe = async (e) => {
234
+ const { promptText: t, modelTier: i = "default", messages: n, inputVariables: r, config: o } = e, c = await (await se({
350
235
  promptText: t,
351
- modelTier: s,
352
- temperature: n,
353
- messages: i,
354
- config: a
355
- })).invoke(o ?? {});
356
- if (typeof c == "string")
357
- return c;
358
- const l = c.content;
359
- return typeof l == "string" ? l : JSON.stringify(l);
360
- }, $ = async (e) => {
361
- const { promptText: t, modelTier: s = "default", temperature: n = 0, messages: i, inputVariables: o, schema: a, config: d } = e, c = A(t, i ?? []), u = (await b({ modelTier: s, temperature: n, config: d })).withStructuredOutput(a);
362
- return await c.pipe(u).invoke(o ?? {});
363
- }, Ve = async (e) => {
364
- const { promptText: t, modelTier: s = "default", temperature: n = 0, messages: i, inputVariables: o, tools: a, config: d } = e, c = a.length > 0 ? be(i ?? []) : i ?? [], l = A(t, c), u = await b({ modelTier: s, temperature: n, config: d });
365
- return await l.pipe(u.bindTools(a)).invoke(o ?? {});
366
- }, xe = m.object({
367
- name: m.string(),
368
- description: m.string(),
369
- valueType: m.string(),
370
- alias: m.string()
371
- }), Te = m.object({
372
- fields: m.array(xe)
373
- }), O = (e, t) => e.getFieldAlias(t) ?? void 0, S = (e, t) => O(e, t.name) ?? t.alias ?? "", Me = (e, t) => {
374
- const s = O(e, t.name);
375
- return !!(s && s !== (t.alias ?? ""));
236
+ modelTier: i,
237
+ messages: n,
238
+ config: o
239
+ })).invoke(r ?? {}, o);
240
+ return typeof c == "string" ? c : c.text;
241
+ }, A = async (e) => {
242
+ const { promptText: t, modelTier: i = "default", messages: n, inputVariables: r, schema: o, config: a } = e, c = M(t, n ?? []), d = (await y({ modelTier: i, config: a })).withStructuredOutput(o);
243
+ return await c.pipe(d).invoke(r ?? {}, a);
244
+ }, Te = async (e) => {
245
+ const { promptText: t, modelTier: i = "default", messages: n, inputVariables: r, tools: o, config: a } = e, c = o.length > 0 ? ne(n ?? []) : n ?? [], m = M(t, c), d = await y({ modelTier: i, config: a });
246
+ return await m.pipe(d.bindTools(o)).invoke(r ?? {}, a);
247
+ }, ie = l.object({
248
+ name: l.string(),
249
+ description: l.string(),
250
+ valueType: l.string(),
251
+ alias: l.string()
252
+ }), oe = l.object({
253
+ fields: l.array(ie)
254
+ }), C = (e, t) => e.getFieldAlias(t) ?? void 0, b = (e, t) => C(e, t.name) ?? t.alias ?? "", re = (e, t) => {
255
+ const i = C(e, t.name);
256
+ return !!(i && i !== (t.alias ?? ""));
376
257
  };
377
- function R(e, t) {
378
- const s = /* @__PURE__ */ new Map();
258
+ function E(e, t) {
259
+ const i = /* @__PURE__ */ new Map();
379
260
  for (const n of e.fields) {
380
- const i = t.fields.find((c) => c.name === n.name), o = S(e, n), a = Me(e, n), d = {
261
+ const r = t.fields.find((m) => m.name === n.name), o = b(e, n), a = re(e, n), c = {
381
262
  name: n.name,
382
263
  type: n.type,
383
- alias: a ? o : i?.alias ?? o,
384
- description: i?.description ?? n.description ?? "",
385
- valueType: i?.valueType ?? n.valueType ?? "",
264
+ alias: a ? o : r?.alias ?? o,
265
+ description: r?.description ?? n.description ?? "",
266
+ valueType: r?.valueType ?? n.valueType ?? "",
386
267
  domain: e.getFieldDomain(n.name) ?? void 0
387
268
  };
388
- s.set(n.name, d);
269
+ i.set(n.name, c);
389
270
  }
390
- return s;
271
+ return i;
391
272
  }
392
- const ze = async (e) => {
393
- const s = await I("field_descriptions_prompt"), n = e.fields.filter((a) => !(S(e, a) && a.description)).map((a) => {
394
- const { name: d, type: c, description: l } = a, u = S(e, a);
395
- return [`Name: ${d}`, `Type: ${c}`, `Alias: ${u}`, `Description: ${l ?? "N/A"}`].join(", ");
273
+ const be = async (e) => {
274
+ const i = await v("field_descriptions_prompt"), n = e.fields.filter((a) => !(b(e, a) && a.description)).map((a) => {
275
+ const { name: c, type: m, description: d } = a, w = b(e, a);
276
+ return [`Name: ${c}`, `Type: ${m}`, `Alias: ${w}`, `Description: ${d ?? "N/A"}`].join(", ");
396
277
  }).join(`
397
278
  `);
398
279
  if (n.length === 0)
399
- return R(e, { fields: [] });
400
- const i = {
280
+ return E(e, { fields: [] });
281
+ const r = {
401
282
  existingItemTitle: e.portalItem?.title,
402
283
  existingItemDescription: e.portalItem?.description,
403
284
  existingLayerTitle: e.title,
404
285
  existingLayerDescription: e.portalItem?.description,
405
286
  fieldInformation: n
406
- }, o = await $({
407
- promptText: s,
408
- schema: Te,
409
- inputVariables: i
287
+ }, o = await A({
288
+ promptText: i,
289
+ schema: oe,
290
+ inputVariables: r
410
291
  });
411
- return R(e, o);
412
- }, Se = m.object({
413
- title: m.string(),
414
- description: m.string(),
415
- name: m.string().nullable()
416
- }), Le = async (e, t) => {
417
- const n = await I("layer_descriptions_prompt"), i = Array.from(t.values()), o = {
418
- fieldInformation: JSON.stringify(i, null, 2),
292
+ return E(e, o);
293
+ }, ae = l.object({
294
+ title: l.string(),
295
+ description: l.string(),
296
+ name: l.string().nullable()
297
+ }), ve = async (e, t) => {
298
+ const n = await v("layer_descriptions_prompt"), r = Array.from(t.values()), o = {
299
+ fieldInformation: JSON.stringify(r, null, 2),
419
300
  existingLayerTitle: e.title,
420
301
  existingLayerDescription: e.portalItem?.description,
421
302
  existingLayerSnippet: e.portalItem?.snippet,
422
303
  layerGeometryType: e.geometryType
423
304
  };
424
- return { ...await $({
305
+ return { ...await A({
425
306
  promptText: n,
426
- schema: Se,
307
+ schema: ae,
427
308
  inputVariables: o
428
309
  }), name: e.title ?? null };
429
310
  };
430
311
  export {
431
- _e as D,
432
- $e as W,
433
- Le as a,
434
- fe as b,
435
- b as c,
436
- w as d,
437
- Oe as e,
438
- we as f,
439
- ze as g,
440
- Ve as h,
441
- $ as i,
442
- ie as j,
443
- Pe as k,
444
- ye as l,
445
- he as m,
446
- se as n,
447
- re as o,
448
- Ne as p,
449
- je as q,
450
- ge as s
312
+ he as D,
313
+ we as W,
314
+ xe as a,
315
+ ye as b,
316
+ be as c,
317
+ ve as d,
318
+ h as e,
319
+ te as f,
320
+ G as g,
321
+ Y as h,
322
+ Te as i,
323
+ A as j,
324
+ ee as l,
325
+ Z as m,
326
+ X as s
451
327
  };
@@ -0,0 +1,34 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import { createSkillAgent as o } from "../agents/runtime/skill/createSkillAgent.js";
3
+ const d = (a, e) => {
4
+ const l = Array.from(a?.values() ?? []).map(({ fieldRegistry: r, layerItem: t }) => {
5
+ const s = Array.from(r.values(), ({ name: i }) => i);
6
+ return {
7
+ title: t.title,
8
+ description: t.description,
9
+ fields: s.slice(0, 10),
10
+ additionalFieldCount: Math.max(s.length - 10, 0)
11
+ };
12
+ }), n = (e?.list() ?? []).map(({ agent: { description: r, id: t, name: s } }) => ({
13
+ id: t,
14
+ name: s,
15
+ description: r
16
+ }));
17
+ return JSON.stringify({ layers: l, agents: n }, null, 2);
18
+ }, p = ({ config: a }) => {
19
+ const e = a?.configurable?.services;
20
+ return d(e?.layersAndFieldsRegistry, e?.agentRegistry);
21
+ }, c = [async () => (await import("./SKILL3.js")).default], m = o({
22
+ id: "help",
23
+ name: "Help Agent",
24
+ description: "Answers questions about the current map, its layers and fields, and available assistant capabilities. Use for general help, unsupported map actions, and unrelated requests that should be redirected to map-related questions.",
25
+ skillLoaders: c,
26
+ modelTier: "default",
27
+ systemPrompt: "You are an ArcGIS map help agent.",
28
+ runtimeContextLoader: p,
29
+ fallbackMessage: "Help request completed.",
30
+ failureMessage: "I couldn't complete the help request."
31
+ });
32
+ export {
33
+ m as H
34
+ };