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

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 (371) hide show
  1. package/LICENSE.md +4 -2
  2. package/README.md +2 -2
  3. package/dist/agent-utils/BaseAgent.js +1 -1
  4. package/dist/agent-utils/FunctionAgent.js +1 -1
  5. package/dist/agent-utils/LLMAgent.d.ts +5 -2
  6. package/dist/agent-utils/LLMAgent.js +7 -4
  7. package/dist/agent-utils/WorkflowAgent.js +15 -16
  8. package/dist/agent-utils/index.d.ts +78 -0
  9. package/dist/agent-utils/index.js +117 -98
  10. package/dist/agent-utils/middlewares/humanInTheLoop.js +1 -1
  11. package/dist/agent-utils/middlewares/middleware.js +1 -1
  12. package/dist/agent-utils/middlewares/trace.d.ts +2 -0
  13. package/dist/agent-utils/middlewares/trace.js +1 -1
  14. package/dist/agent-utils/middlewares/types.js +1 -1
  15. package/dist/agent-utils/tools/FunctionTool.js +1 -1
  16. package/dist/agent-utils/types.d.ts +13 -13
  17. package/dist/agent-utils/workflows/ConditionalWorkflow.js +1 -1
  18. package/dist/agent-utils/workflows/LoopWorkflow.js +1 -1
  19. package/dist/agent-utils/workflows/ParallelWorkflow.js +1 -1
  20. package/dist/agent-utils/workflows/RouterWorkflow.js +1 -1
  21. package/dist/agent-utils/workflows/SequentialWorkflow.js +1 -1
  22. package/dist/agent-utils/workflows/SwitchWorkflow.js +1 -1
  23. package/dist/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
  24. package/dist/agentic-workflow/Edge.d.ts +16 -0
  25. package/dist/agentic-workflow/WebAgent.d.ts +39 -0
  26. package/dist/agentic-workflow/jsonTypes.d.ts +189 -0
  27. package/dist/agentic-workflow/nodes/AgentNode.d.ts +28 -0
  28. package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
  29. package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
  30. package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
  31. package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
  32. package/dist/agentic-workflow/types.d.ts +29 -0
  33. package/dist/agents/runtime/skill/createSkillAgent.d.ts +31 -0
  34. package/dist/agents/runtime/skill/createSkillAgent.js +260 -0
  35. package/dist/agents/runtime/skill/loadAgentSkills.d.ts +16 -0
  36. package/dist/agents/runtime/skill/types.d.ts +28 -0
  37. package/dist/agents/runtime/skill/types.js +2 -0
  38. package/dist/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
  39. package/dist/agents/tools/filter/clearFilters/adapter.js +22 -0
  40. package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
  41. package/dist/agents/tools/filter/resetMap/adapter.js +22 -0
  42. package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
  43. package/dist/agents/tools/filter/setFeatureEffect/adapter.js +122 -0
  44. package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
  45. package/dist/agents/tools/help/listFields/adapter.js +30 -0
  46. package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
  47. package/dist/agents/tools/navigation/goToAddress/adapter.js +60 -0
  48. package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
  49. package/dist/agents/tools/navigation/goToBookmark/adapter.js +30 -0
  50. package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
  51. package/dist/agents/tools/navigation/goToFeatures/adapter.js +50 -0
  52. package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
  53. package/dist/agents/tools/navigation/goToFullExtent/adapter.js +27 -0
  54. package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
  55. package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +24 -0
  56. package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
  57. package/dist/agents/tools/navigation/goToLayer/adapter.js +26 -0
  58. package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
  59. package/dist/agents/tools/navigation/goToScale/adapter.js +21 -0
  60. package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
  61. package/dist/agents/tools/navigation/goToViewpoint/adapter.js +42 -0
  62. package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
  63. package/dist/agents/tools/navigation/goToZoom/adapter.js +21 -0
  64. package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
  65. package/dist/agents/tools/query/getAttribute/adapter.js +40 -0
  66. package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
  67. package/dist/agents/tools/query/getStatistics/adapter.js +158 -0
  68. package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
  69. package/dist/agents/tools/query/getTopFeatures/adapter.js +145 -0
  70. package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
  71. package/dist/agents/tools/query/queryFeatures/adapter.js +131 -0
  72. package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
  73. package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
  74. package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
  75. package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
  76. package/dist/agents/tools/shared/resolveToolArtifact.d.ts +22 -0
  77. package/dist/agents/tools/shared/resolveToolArtifact.js +20 -0
  78. package/dist/agents/tools/shared/types.d.ts +22 -0
  79. package/dist/agents/tools/shared/types.js +6 -0
  80. package/dist/cdn/24EIZVUM.js +2 -0
  81. package/dist/cdn/25MBI4PD.js +2 -0
  82. package/dist/cdn/275FFTBE.js +2 -0
  83. package/dist/cdn/27CK3JHY.js +2 -0
  84. package/dist/cdn/2F4TPWZQ.js +2 -0
  85. package/dist/cdn/2LVYAXHG.js +44 -0
  86. package/dist/cdn/2UJPYWWZ.js +3 -0
  87. package/dist/cdn/2WXXSZP5.js +2 -0
  88. package/dist/cdn/{Q7TL5Q5N.js → 3KNLFIM3.js} +2 -2
  89. package/dist/cdn/3PPXAIRE.js +14 -0
  90. package/dist/cdn/45BDE3MG.js +2 -0
  91. package/dist/cdn/477I66FH.js +56 -0
  92. package/dist/cdn/4CFCV47G.js +2 -0
  93. package/dist/cdn/4IWDBEMN.js +34 -0
  94. package/dist/cdn/4OI4QEV7.js +6 -0
  95. package/dist/cdn/{DXVU45KM.js → 4VBOTWC3.js} +2 -2
  96. package/dist/cdn/4YOG5F3W.js +2 -0
  97. package/dist/cdn/53KIFJFA.js +4 -0
  98. package/dist/cdn/5X23DDDZ.js +2 -0
  99. package/dist/cdn/65LCK3GG.js +3 -0
  100. package/dist/cdn/6KWGSXIN.js +2 -0
  101. package/dist/cdn/7DOYUO7L.js +71 -0
  102. package/dist/cdn/{WAIFKDR3.js → 7UBTNDV6.js} +2 -2
  103. package/dist/cdn/7Y43R7QJ.js +2 -0
  104. package/dist/cdn/A6LBMS7A.js +2 -0
  105. package/dist/cdn/AP3KPOHN.js +2 -0
  106. package/dist/cdn/AUCKEB52.js +2 -0
  107. package/dist/cdn/B3HXSEBN.js +2 -0
  108. package/dist/cdn/BBEGLIZC.js +2 -0
  109. package/dist/cdn/BJMGT6GV.js +19 -0
  110. package/dist/cdn/BTOBEN7Q.js +2 -0
  111. package/dist/cdn/BTTCBEPW.js +2 -0
  112. package/dist/cdn/BVUCNXC5.js +2 -0
  113. package/dist/cdn/CAOMMQSY.js +66 -0
  114. package/dist/cdn/CKUUYQLO.js +2 -0
  115. package/dist/cdn/{ZEYIBYSF.js → CSE6BHOJ.js} +2 -2
  116. package/dist/cdn/CX2HJ67C.js +2 -0
  117. package/dist/cdn/EGRRZTF6.js +2 -0
  118. package/dist/cdn/EK3PM4L5.js +2 -0
  119. package/dist/cdn/EXMEB4X2.js +2 -0
  120. package/dist/cdn/EYGZJKVD.js +2 -0
  121. package/dist/cdn/{24QNMEFG.js → FDRAKF5D.js} +2 -2
  122. package/dist/cdn/FHBRXZLV.js +2 -0
  123. package/dist/cdn/{5CV7R5IS.js → FK2CVSXW.js} +6 -6
  124. package/dist/cdn/FLUI6GCU.js +2 -0
  125. package/dist/cdn/{ZTBA5PM7.js → FPH52WOH.js} +2 -2
  126. package/dist/cdn/FRYS2PZJ.js +2 -0
  127. package/dist/cdn/FSLQCZRN.js +2 -0
  128. package/dist/cdn/{LQ6R5YRN.js → FTTLFIBV.js} +2 -2
  129. package/dist/cdn/FV6FHLYW.js +2 -0
  130. package/dist/cdn/G24MNC7D.js +6 -0
  131. package/dist/cdn/{F6QHMKF5.js → GW3IVAAZ.js} +2 -2
  132. package/dist/cdn/HI3XKFHD.js +2 -0
  133. package/dist/cdn/HKIA5PWU.js +2 -0
  134. package/dist/cdn/{6ZW7Z36F.js → HMMYCSOK.js} +4 -4
  135. package/dist/cdn/HNTSDY3J.js +2 -0
  136. package/dist/cdn/HV7MVIQV.js +2 -0
  137. package/dist/cdn/I3SUE2TR.js +2 -0
  138. package/dist/cdn/I72ST4JR.js +134 -0
  139. package/dist/cdn/{T537PKP4.js → IHUWQOMK.js} +2 -2
  140. package/dist/cdn/JMXXRRKQ.js +22 -0
  141. package/dist/cdn/JUNMTIB3.js +2 -0
  142. package/dist/cdn/{6YMR4QSD.js → JYNHWJUZ.js} +2 -2
  143. package/dist/cdn/KAX4A7SF.js +2 -0
  144. package/dist/cdn/KBSXHSBX.js +2 -0
  145. package/dist/cdn/KKCLHXHG.js +2 -0
  146. package/dist/cdn/L2HLFWCV.js +72 -0
  147. package/dist/cdn/{7RCQFLPP.js → L3BTURBA.js} +2 -2
  148. package/dist/cdn/LBTGOMCT.js +2 -0
  149. package/dist/cdn/LIRT72WY.js +2 -0
  150. package/dist/cdn/LL324IL6.js +2 -0
  151. package/dist/cdn/LLY5A2E2.js +2 -0
  152. package/dist/cdn/LXIKAXUT.js +2 -0
  153. package/dist/cdn/M2U456J5.js +181 -0
  154. package/dist/cdn/M3KKORBG.js +2 -0
  155. package/dist/cdn/M5B6X46F.js +2 -0
  156. package/dist/cdn/{X2ZDYHCG.js → MZUDIQQH.js} +11 -6
  157. package/dist/cdn/NBDOPGSN.js +2 -0
  158. package/dist/cdn/NGR5NVZE.js +2 -0
  159. package/dist/cdn/{5ZZGKP7N.js → NNPA3NLK.js} +2 -2
  160. package/dist/cdn/NV7CL4S3.js +2 -0
  161. package/dist/cdn/{5W7S2RS4.js → OALQBAZR.js} +2 -2
  162. package/dist/cdn/OF3TAARW.js +2 -0
  163. package/dist/cdn/{AZGGTNA3.js → OXC2WP7W.js} +2 -2
  164. package/dist/cdn/PJPP6LOS.js +3 -0
  165. package/dist/cdn/PUZ6RAFQ.js +2 -0
  166. package/dist/cdn/QAX6UF4L.js +99 -0
  167. package/dist/cdn/{NE7E52YR.js → QTEPFTAU.js} +10 -4
  168. package/dist/cdn/ROS22KOA.js +2 -0
  169. package/dist/cdn/RSM7MEVT.js +9 -0
  170. package/dist/cdn/SBNNJ5WA.js +2 -0
  171. package/dist/cdn/SDX46GZY.js +2 -0
  172. package/dist/cdn/SI22EJLC.js +2 -0
  173. package/dist/cdn/SJMAKF4P.js +2 -0
  174. package/dist/cdn/SNG3WODY.js +2 -0
  175. package/dist/cdn/STOGCXJH.js +2 -0
  176. package/dist/cdn/SUC2MIGE.js +2 -0
  177. package/dist/cdn/SXYKNDOF.js +2 -0
  178. package/dist/cdn/SZ2L5556.js +2 -0
  179. package/dist/cdn/T6W6F4TF.js +2 -0
  180. package/dist/cdn/TB2GJALS.js +2 -0
  181. package/dist/cdn/TFAJNKBC.js +2 -0
  182. package/dist/cdn/TLPZELG3.js +2 -0
  183. package/dist/cdn/TXZQZR3I.js +2 -0
  184. package/dist/cdn/UAZPINUQ.js +2 -0
  185. package/dist/cdn/UGIHS7OA.js +2 -0
  186. package/dist/cdn/{FX7UOGHP.js → V266DJ5V.js} +2 -2
  187. package/dist/cdn/V4PJMCJZ.js +2 -0
  188. package/dist/cdn/{P7DG5T3Z.js → V52GSTOC.js} +2 -2
  189. package/dist/cdn/VGLBH473.js +2 -0
  190. package/dist/cdn/VK6CCPTG.js +2 -0
  191. package/dist/cdn/{ZS2TZ6BF.js → VLPELJUS.js} +2 -2
  192. package/dist/cdn/VT5EWFH7.js +2 -0
  193. package/dist/cdn/{7CYGX4F4.js → VXLKTQ36.js} +2 -2
  194. package/dist/cdn/W54XYT2A.js +2 -0
  195. package/dist/cdn/X42ACC66.js +5 -0
  196. package/dist/cdn/XNUWVZN7.js +2 -0
  197. package/dist/cdn/XOTPSCNF.js +2 -0
  198. package/dist/cdn/XRVGYRXL.js +14 -0
  199. package/dist/cdn/XV7RMYLR.js +2 -0
  200. package/dist/cdn/XVJFPZTW.js +2 -0
  201. package/dist/cdn/XZF7Y6B2.js +2 -0
  202. package/dist/cdn/{UPEEHMSY.js → Y4TYL2AL.js} +2 -2
  203. package/dist/cdn/Y4ZOB6UH.js +2 -0
  204. package/dist/cdn/Y6CV2NZR.js +2 -0
  205. package/dist/cdn/YIXASZUW.js +2 -0
  206. package/dist/cdn/YOW3YKWR.js +11 -0
  207. package/dist/cdn/{23EQTPO3.js → ZA7ZU2F7.js} +2 -2
  208. package/dist/cdn/ZJWR4W2S.js +208 -0
  209. package/dist/cdn/ZWIKFBOU.js +2 -0
  210. package/dist/cdn/ZY3JQCZQ.js +179 -0
  211. package/dist/cdn/agent-utils/index.js +2 -2
  212. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +2 -2
  213. package/dist/cdn/agent-utils/middlewares/middleware.js +2 -2
  214. package/dist/cdn/agent-utils/middlewares/trace.js +2 -2
  215. package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
  216. package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
  217. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
  218. package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
  219. package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
  220. package/dist/cdn/index.js +2 -2
  221. package/dist/chunks/BaseWorkflow.js +1 -1
  222. package/dist/chunks/SKILL.js +5 -0
  223. package/dist/chunks/SKILL2.js +5 -0
  224. package/dist/chunks/SKILL3.js +22 -0
  225. package/dist/chunks/SKILL4.js +5 -0
  226. package/dist/chunks/adapter.js +1127 -2011
  227. package/dist/chunks/aiFactory.js +94 -0
  228. package/dist/chunks/arcgisKnowledgeGraph.js +97 -77
  229. package/dist/chunks/arcgisToolRegistry.js +88 -0
  230. package/dist/chunks/arcgis_knowledge_current_lc_context.js +20 -3
  231. package/dist/chunks/arcgis_knowledge_current_map_context.js +32 -3
  232. package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
  233. package/dist/chunks/arcgis_knowledge_lucene_generation_prompt.js +1 -1
  234. package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +117 -28
  235. package/dist/chunks/arcgis_knowledge_tool_prompt.js +1 -1
  236. package/dist/chunks/baseAgentState.js +58 -0
  237. package/dist/chunks/converterUtils.js +67 -42
  238. package/dist/chunks/dataExplorationAgent.js +19 -0
  239. package/dist/chunks/data_explore_filter_prompt.js +1 -1
  240. package/dist/chunks/data_explore_query_prompt.js +10 -5
  241. package/dist/chunks/embeddings.worker.js +1 -1
  242. package/dist/chunks/fetchAgentContext.js +13 -0
  243. package/dist/chunks/fetchService.js +10 -0
  244. package/dist/chunks/fieldStatistics.js +79 -0
  245. package/dist/chunks/field_descriptions_prompt.js +1 -1
  246. package/dist/chunks/formatFeatureAttributes.js +132 -0
  247. package/dist/chunks/generateLayerDescriptions.js +190 -311
  248. package/dist/chunks/graph.js +1 -1
  249. package/dist/chunks/helpAgent.js +34 -0
  250. package/dist/chunks/help_prompt.js +35 -18
  251. package/dist/chunks/index.js +1 -1
  252. package/dist/chunks/intent_prompt.js +3 -3
  253. package/dist/chunks/layerStylingGraph.js +102 -84
  254. package/dist/chunks/layer_descriptions_prompt.js +1 -1
  255. package/dist/chunks/layer_styling_prompt.js +1 -1
  256. package/dist/chunks/mergeWhereClauses.js +15 -0
  257. package/dist/chunks/navigationAgent.js +27 -0
  258. package/dist/chunks/navigation_intent_prompt.js +9 -3
  259. package/dist/chunks/navigation_tool_prompt.js +1 -1
  260. package/dist/chunks/orchestrator.js +446 -235
  261. package/dist/chunks/requireAgentServices.js +11 -0
  262. package/dist/chunks/resolvePointGeometryFilter.js +92 -0
  263. package/dist/chunks/runtime.js +1 -1
  264. package/dist/chunks/slottableRequestUtils.js +1 -1
  265. package/dist/chunks/state.js +22 -28
  266. package/dist/chunks/summarize_query_response_prompt.js +1 -1
  267. package/dist/chunks/useT9n.js +1 -1
  268. package/dist/chunks/utils.js +1 -1
  269. package/dist/chunks/utils2.js +12 -12
  270. package/dist/chunks/utils3.js +1 -1
  271. package/dist/components/arcgis-assistant/customElement.d.ts +102 -1
  272. package/dist/components/arcgis-assistant/customElement.js +332 -184
  273. package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
  274. package/dist/components/arcgis-assistant-agent/customElement.js +533 -11
  275. package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
  276. package/dist/components/arcgis-assistant-chat-entry/customElement.js +1 -1
  277. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +35 -9
  278. package/dist/components/arcgis-assistant-help-agent/customElement.js +32 -9
  279. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
  280. package/dist/components/arcgis-assistant-interrupt/customElement.js +12 -13
  281. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +13 -9
  282. package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +1 -1
  283. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +41 -17
  284. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +31 -8
  285. package/dist/components/arcgis-assistant-message/customElement.d.ts +3 -0
  286. package/dist/components/arcgis-assistant-message/customElement.js +10 -9
  287. package/dist/components/arcgis-assistant-message-block/customElement.js +2 -2
  288. package/dist/components/arcgis-assistant-message-feedback/customElement.js +1 -1
  289. package/dist/components/arcgis-assistant-message-footer/customElement.js +1 -1
  290. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +3 -0
  291. package/dist/components/arcgis-assistant-message-loading/customElement.js +12 -11
  292. package/dist/components/arcgis-assistant-message-log/customElement.js +1 -1
  293. package/dist/components/arcgis-assistant-message-read-aloud/customElement.js +1 -1
  294. package/dist/components/arcgis-assistant-message-text/customElement.d.ts +1 -0
  295. package/dist/components/arcgis-assistant-message-text/customElement.js +13 -13
  296. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +34 -10
  297. package/dist/components/arcgis-assistant-speech-input/customElement.js +35 -53
  298. package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +1 -1
  299. package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
  300. package/dist/components/arcgis-assistant-user-message/customElement.js +16 -11
  301. package/dist/docs/api.json +1 -1
  302. package/dist/docs/docs.json +1 -1
  303. package/dist/docs/vscode.html-custom-data.json +1 -1
  304. package/dist/docs/web-types.json +1 -1
  305. package/dist/index.js +1 -1
  306. package/dist/loader.js +7 -7
  307. package/dist/oauth-callback.html +1 -1
  308. package/dist/orchestrator/models/types.d.ts +1 -0
  309. package/dist/orchestrator/orchestrator/orchestratorEvents.d.ts +78 -0
  310. package/dist/orchestrator/providers/arcgis/aiFactory.d.ts +15 -0
  311. package/dist/orchestrator/types/types.d.ts +17 -0
  312. package/dist/types/lumina.d.ts +5 -4
  313. package/dist/types/preact.d.ts +5 -4
  314. package/dist/types/react.d.ts +5 -4
  315. package/dist/types/stencil.d.ts +7 -6
  316. package/dist/utils/index.d.ts +75 -39
  317. package/dist/utils/index.js +708 -84
  318. package/package.json +35 -12
  319. package/dist/cdn/34SG44C3.js +0 -72
  320. package/dist/cdn/3JGWGKT6.js +0 -2
  321. package/dist/cdn/3NBDVZ2I.js +0 -2
  322. package/dist/cdn/3VOQD2MR.js +0 -2
  323. package/dist/cdn/434TAA3J.js +0 -2
  324. package/dist/cdn/53NTYC4I.js +0 -2
  325. package/dist/cdn/5QAHYX7Y.js +0 -5
  326. package/dist/cdn/AXDZBBNL.js +0 -45
  327. package/dist/cdn/B7WJFBOZ.js +0 -2
  328. package/dist/cdn/BX7FSMUU.js +0 -56
  329. package/dist/cdn/CHPQM77M.js +0 -181
  330. package/dist/cdn/DHKUXLU3.js +0 -179
  331. package/dist/cdn/DQSEBKOX.js +0 -2
  332. package/dist/cdn/DZ2QWNUA.js +0 -3
  333. package/dist/cdn/EBISDZ5H.js +0 -2
  334. package/dist/cdn/ERL2CB2Y.js +0 -14
  335. package/dist/cdn/F2AHA4GB.js +0 -54
  336. package/dist/cdn/FUIGPHBH.js +0 -2
  337. package/dist/cdn/H2CHHGGH.js +0 -2
  338. package/dist/cdn/HWKDNS4K.js +0 -4
  339. package/dist/cdn/IMQ4TVHF.js +0 -16
  340. package/dist/cdn/IOD3GDA7.js +0 -2
  341. package/dist/cdn/IR7PTESF.js +0 -2
  342. package/dist/cdn/IRZDTYO2.js +0 -2
  343. package/dist/cdn/JIWK6QK6.js +0 -2
  344. package/dist/cdn/JLKGS6Y5.js +0 -36
  345. package/dist/cdn/K3JCH4XW.js +0 -2
  346. package/dist/cdn/KHXUWZHB.js +0 -2
  347. package/dist/cdn/KMQ3SP4I.js +0 -5
  348. package/dist/cdn/LIFK3QSD.js +0 -2
  349. package/dist/cdn/NXKKG5TK.js +0 -2
  350. package/dist/cdn/O3EN27N5.js +0 -2
  351. package/dist/cdn/O3RFFPU3.js +0 -6
  352. package/dist/cdn/PBO6FZN6.js +0 -2
  353. package/dist/cdn/Q3ZW4FYA.js +0 -3
  354. package/dist/cdn/Q6LRANX6.js +0 -2
  355. package/dist/cdn/QCSN44H4.js +0 -2
  356. package/dist/cdn/R56X6ZKR.js +0 -161
  357. package/dist/cdn/RUURNLTP.js +0 -2
  358. package/dist/cdn/T43LEBBE.js +0 -47
  359. package/dist/cdn/TR4GFL7X.js +0 -2
  360. package/dist/cdn/WNS5ZUF5.js +0 -2
  361. package/dist/cdn/X4XY5HIE.js +0 -2
  362. package/dist/cdn/XOH56EQ2.js +0 -2
  363. package/dist/cdn/XON27U6U.js +0 -2
  364. package/dist/cdn/YIMNOUTF.js +0 -2
  365. package/dist/cdn/YLN2BZ5J.js +0 -2
  366. package/dist/cdn/YUKR4AZW.js +0 -2
  367. package/dist/cdn/Z2G7MP5L.js +0 -22
  368. package/dist/chunks/dataExplorationGraph.js +0 -310
  369. package/dist/chunks/helpGraph.js +0 -126
  370. package/dist/chunks/navigationGraph.js +0 -270
  371. package/dist/chunks/toolCallResponse.js +0 -31
@@ -1,230 +1,115 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
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({
87
- agentExecutionContext: p({
88
- default: j,
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
2
+ import { Annotation as m } from "@langchain/langgraph/web";
3
+ import { b as j, r as T, m as P, c as q } from "./baseAgentState.js";
4
+ import p, { z as s } from "zod";
5
+ import { ChatPromptTemplate as E, 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 h, E as J } from "./aiFactory.js";
10
+ const ye = m.Root({
11
+ agentExecutionContext: m({
12
+ default: q,
89
13
  reducer: P
90
14
  }),
91
- currentIntent: p({
15
+ currentIntent: m({
92
16
  default: () => "none",
93
- reducer: h
17
+ reducer: T
94
18
  }),
95
- lastExecutedAgent: p({
19
+ routing: m({
20
+ default: () => ({ mode: "auto" }),
21
+ reducer: T
22
+ }),
23
+ lastExecutedAgent: m({
96
24
  default: () => "",
97
- reducer: h
25
+ reducer: T
98
26
  }),
99
- requiresFollowUp: p({
27
+ requiresFollowUp: m({
100
28
  default: () => !0,
101
- reducer: h
29
+ reducer: T
102
30
  }),
103
- stepCount: p({
31
+ stepCount: m({
104
32
  default: () => 0,
105
33
  reducer: (e, t) => t ?? e + 1
106
34
  }),
107
- finalOutputMessage: p({
35
+ finalOutputMessage: m({
108
36
  default: () => "",
109
- reducer: _
37
+ reducer: j
110
38
  })
111
- }), oe = (e) => {
39
+ }), W = (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
+ }, B = (e) => {
117
45
  const t = e?.configurable;
118
- return oe(t) ? t : void 0;
119
- }, ae = (e, t, s) => {
46
+ return W(t) ? t : void 0;
47
+ }, G = (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 G(/* @__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, H = 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
+ }, he = async (e, t) => {
74
+ const i = B(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), l = 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 E.fromTemplate(a).format(d), D = V({
100
+ model: await h({
216
101
  modelTier: "fast",
217
102
  config: t
218
103
  }),
219
104
  tools: [],
220
- systemPrompt: T,
221
- responseFormat: c,
105
+ systemPrompt: k,
106
+ responseFormat: l,
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 h({
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 H({
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 = l.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,171 @@ 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", y = 1536, Y = "openai", Z = J.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(y),
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(y, {
197
+ message: `Layer vector must be exactly ${y} 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(y, {
205
+ message: `Field vector must be exactly ${y} 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 E.fromMessages([i, ...t]);
230
+ }, se = async (e) => {
231
+ const { promptText: t, modelTier: i, messages: n, config: r } = e, o = M(t, n ?? []), a = await h({ 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 ?? {});
236
+ modelTier: i,
237
+ messages: n,
238
+ config: o
239
+ })).invoke(r ?? {}, o);
356
240
  if (typeof c == "string")
357
241
  return c;
358
242
  const l = c.content;
359
243
  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 ?? ""));
244
+ }, A = async (e) => {
245
+ const { promptText: t, modelTier: i = "default", messages: n, inputVariables: r, schema: o, config: a } = e, c = M(t, n ?? []), d = (await h({ modelTier: i, config: a })).withStructuredOutput(o);
246
+ return await c.pipe(d).invoke(r ?? {}, a);
247
+ }, Te = async (e) => {
248
+ const { promptText: t, modelTier: i = "default", messages: n, inputVariables: r, tools: o, config: a } = e, c = o.length > 0 ? ne(n ?? []) : n ?? [], l = M(t, c), d = await h({ modelTier: i, config: a });
249
+ return await l.pipe(d.bindTools(o)).invoke(r ?? {}, a);
250
+ }, ie = p.object({
251
+ name: p.string(),
252
+ description: p.string(),
253
+ valueType: p.string(),
254
+ alias: p.string()
255
+ }), oe = p.object({
256
+ fields: p.array(ie)
257
+ }), C = (e, t) => e.getFieldAlias(t) ?? void 0, b = (e, t) => C(e, t.name) ?? t.alias ?? "", re = (e, t) => {
258
+ const i = C(e, t.name);
259
+ return !!(i && i !== (t.alias ?? ""));
376
260
  };
377
- function R(e, t) {
378
- const s = /* @__PURE__ */ new Map();
261
+ function S(e, t) {
262
+ const i = /* @__PURE__ */ new Map();
379
263
  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 = {
264
+ const r = t.fields.find((l) => l.name === n.name), o = b(e, n), a = re(e, n), c = {
381
265
  name: n.name,
382
266
  type: n.type,
383
- alias: a ? o : i?.alias ?? o,
384
- description: i?.description ?? n.description ?? "",
385
- valueType: i?.valueType ?? n.valueType ?? "",
267
+ alias: a ? o : r?.alias ?? o,
268
+ description: r?.description ?? n.description ?? "",
269
+ valueType: r?.valueType ?? n.valueType ?? "",
386
270
  domain: e.getFieldDomain(n.name) ?? void 0
387
271
  };
388
- s.set(n.name, d);
272
+ i.set(n.name, c);
389
273
  }
390
- return s;
274
+ return i;
391
275
  }
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(", ");
276
+ const be = async (e) => {
277
+ const i = await v("field_descriptions_prompt"), n = e.fields.filter((a) => !(b(e, a) && a.description)).map((a) => {
278
+ const { name: c, type: l, description: d } = a, w = b(e, a);
279
+ return [`Name: ${c}`, `Type: ${l}`, `Alias: ${w}`, `Description: ${d ?? "N/A"}`].join(", ");
396
280
  }).join(`
397
281
  `);
398
282
  if (n.length === 0)
399
- return R(e, { fields: [] });
400
- const i = {
283
+ return S(e, { fields: [] });
284
+ const r = {
401
285
  existingItemTitle: e.portalItem?.title,
402
286
  existingItemDescription: e.portalItem?.description,
403
287
  existingLayerTitle: e.title,
404
288
  existingLayerDescription: e.portalItem?.description,
405
289
  fieldInformation: n
406
- }, o = await $({
407
- promptText: s,
408
- schema: Te,
409
- inputVariables: i
290
+ }, o = await A({
291
+ promptText: i,
292
+ schema: oe,
293
+ inputVariables: r
410
294
  });
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),
295
+ return S(e, o);
296
+ }, ae = p.object({
297
+ title: p.string(),
298
+ description: p.string(),
299
+ name: p.string().nullable()
300
+ }), ve = async (e, t) => {
301
+ const n = await v("layer_descriptions_prompt"), r = Array.from(t.values()), o = {
302
+ fieldInformation: JSON.stringify(r, null, 2),
419
303
  existingLayerTitle: e.title,
420
304
  existingLayerDescription: e.portalItem?.description,
421
305
  existingLayerSnippet: e.portalItem?.snippet,
422
306
  layerGeometryType: e.geometryType
423
307
  };
424
- return { ...await $({
308
+ return { ...await A({
425
309
  promptText: n,
426
- schema: Se,
310
+ schema: ae,
427
311
  inputVariables: o
428
312
  }), name: e.title ?? null };
429
313
  };
430
314
  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
315
+ ye as D,
316
+ we as W,
317
+ xe as a,
318
+ he as b,
319
+ be as c,
320
+ ve as d,
321
+ y as e,
322
+ te as f,
323
+ B as g,
324
+ Y as h,
325
+ Te as i,
326
+ A as j,
327
+ ee as l,
328
+ Z as m,
329
+ X as s
451
330
  };
@@ -1,4 +1,4 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
2
2
  import { StateGraph as G, END as p, START as k } from "@langchain/langgraph/web";
3
3
  function b(t, c, o, s = {}) {
4
4
  const { agent: h, entryNode: u, middlewares: l = [] } = s;