@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.
- package/LICENSE.md +4 -2
- package/README.md +2 -2
- package/dist/agent-utils/BaseAgent.js +1 -1
- package/dist/agent-utils/FunctionAgent.js +1 -1
- package/dist/agent-utils/LLMAgent.d.ts +5 -2
- package/dist/agent-utils/LLMAgent.js +7 -4
- package/dist/agent-utils/WorkflowAgent.js +15 -16
- package/dist/agent-utils/index.d.ts +78 -0
- package/dist/agent-utils/index.js +117 -98
- package/dist/agent-utils/middlewares/humanInTheLoop.js +1 -1
- package/dist/agent-utils/middlewares/middleware.js +1 -1
- package/dist/agent-utils/middlewares/trace.d.ts +2 -0
- package/dist/agent-utils/middlewares/trace.js +1 -1
- package/dist/agent-utils/middlewares/types.js +1 -1
- package/dist/agent-utils/tools/FunctionTool.js +1 -1
- package/dist/agent-utils/types.d.ts +13 -13
- package/dist/agent-utils/workflows/ConditionalWorkflow.js +1 -1
- package/dist/agent-utils/workflows/LoopWorkflow.js +1 -1
- package/dist/agent-utils/workflows/ParallelWorkflow.js +1 -1
- package/dist/agent-utils/workflows/RouterWorkflow.js +1 -1
- package/dist/agent-utils/workflows/SequentialWorkflow.js +1 -1
- package/dist/agent-utils/workflows/SwitchWorkflow.js +1 -1
- package/dist/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
- package/dist/agentic-workflow/Edge.d.ts +16 -0
- package/dist/agentic-workflow/WebAgent.d.ts +39 -0
- package/dist/agentic-workflow/jsonTypes.d.ts +189 -0
- package/dist/agentic-workflow/nodes/AgentNode.d.ts +28 -0
- package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
- package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
- package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
- package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
- package/dist/agentic-workflow/types.d.ts +29 -0
- package/dist/agents/runtime/skill/createSkillAgent.d.ts +31 -0
- package/dist/agents/runtime/skill/createSkillAgent.js +260 -0
- package/dist/agents/runtime/skill/loadAgentSkills.d.ts +16 -0
- package/dist/agents/runtime/skill/types.d.ts +28 -0
- package/dist/agents/runtime/skill/types.js +2 -0
- package/dist/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/clearFilters/adapter.js +22 -0
- package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/resetMap/adapter.js +22 -0
- package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/setFeatureEffect/adapter.js +122 -0
- package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
- package/dist/agents/tools/help/listFields/adapter.js +30 -0
- package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
- package/dist/agents/tools/navigation/goToAddress/adapter.js +60 -0
- package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToBookmark/adapter.js +30 -0
- package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToFeatures/adapter.js +50 -0
- package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToFullExtent/adapter.js +27 -0
- package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +24 -0
- package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToLayer/adapter.js +26 -0
- package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToScale/adapter.js +21 -0
- package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToViewpoint/adapter.js +42 -0
- package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToZoom/adapter.js +21 -0
- package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getAttribute/adapter.js +40 -0
- package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getStatistics/adapter.js +158 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.js +145 -0
- package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/queryFeatures/adapter.js +131 -0
- package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
- package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
- package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
- package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
- package/dist/agents/tools/shared/resolveToolArtifact.d.ts +22 -0
- package/dist/agents/tools/shared/resolveToolArtifact.js +20 -0
- package/dist/agents/tools/shared/types.d.ts +22 -0
- package/dist/agents/tools/shared/types.js +6 -0
- package/dist/cdn/24EIZVUM.js +2 -0
- package/dist/cdn/25MBI4PD.js +2 -0
- package/dist/cdn/275FFTBE.js +2 -0
- package/dist/cdn/27CK3JHY.js +2 -0
- package/dist/cdn/2F4TPWZQ.js +2 -0
- package/dist/cdn/2LVYAXHG.js +44 -0
- package/dist/cdn/2UJPYWWZ.js +3 -0
- package/dist/cdn/2WXXSZP5.js +2 -0
- package/dist/cdn/{Q7TL5Q5N.js → 3KNLFIM3.js} +2 -2
- package/dist/cdn/3PPXAIRE.js +14 -0
- package/dist/cdn/45BDE3MG.js +2 -0
- package/dist/cdn/477I66FH.js +56 -0
- package/dist/cdn/4CFCV47G.js +2 -0
- package/dist/cdn/4IWDBEMN.js +34 -0
- package/dist/cdn/4OI4QEV7.js +6 -0
- package/dist/cdn/{DXVU45KM.js → 4VBOTWC3.js} +2 -2
- package/dist/cdn/4YOG5F3W.js +2 -0
- package/dist/cdn/53KIFJFA.js +4 -0
- package/dist/cdn/5X23DDDZ.js +2 -0
- package/dist/cdn/65LCK3GG.js +3 -0
- package/dist/cdn/6KWGSXIN.js +2 -0
- package/dist/cdn/7DOYUO7L.js +71 -0
- package/dist/cdn/{WAIFKDR3.js → 7UBTNDV6.js} +2 -2
- package/dist/cdn/7Y43R7QJ.js +2 -0
- package/dist/cdn/A6LBMS7A.js +2 -0
- package/dist/cdn/AP3KPOHN.js +2 -0
- package/dist/cdn/AUCKEB52.js +2 -0
- package/dist/cdn/B3HXSEBN.js +2 -0
- package/dist/cdn/BBEGLIZC.js +2 -0
- package/dist/cdn/BJMGT6GV.js +19 -0
- package/dist/cdn/BTOBEN7Q.js +2 -0
- package/dist/cdn/BTTCBEPW.js +2 -0
- package/dist/cdn/BVUCNXC5.js +2 -0
- package/dist/cdn/CAOMMQSY.js +66 -0
- package/dist/cdn/CKUUYQLO.js +2 -0
- package/dist/cdn/{ZEYIBYSF.js → CSE6BHOJ.js} +2 -2
- package/dist/cdn/CX2HJ67C.js +2 -0
- package/dist/cdn/EGRRZTF6.js +2 -0
- package/dist/cdn/EK3PM4L5.js +2 -0
- package/dist/cdn/EXMEB4X2.js +2 -0
- package/dist/cdn/EYGZJKVD.js +2 -0
- package/dist/cdn/{24QNMEFG.js → FDRAKF5D.js} +2 -2
- package/dist/cdn/FHBRXZLV.js +2 -0
- package/dist/cdn/{5CV7R5IS.js → FK2CVSXW.js} +6 -6
- package/dist/cdn/FLUI6GCU.js +2 -0
- package/dist/cdn/{ZTBA5PM7.js → FPH52WOH.js} +2 -2
- package/dist/cdn/FRYS2PZJ.js +2 -0
- package/dist/cdn/FSLQCZRN.js +2 -0
- package/dist/cdn/{LQ6R5YRN.js → FTTLFIBV.js} +2 -2
- package/dist/cdn/FV6FHLYW.js +2 -0
- package/dist/cdn/G24MNC7D.js +6 -0
- package/dist/cdn/{F6QHMKF5.js → GW3IVAAZ.js} +2 -2
- package/dist/cdn/HI3XKFHD.js +2 -0
- package/dist/cdn/HKIA5PWU.js +2 -0
- package/dist/cdn/{6ZW7Z36F.js → HMMYCSOK.js} +4 -4
- package/dist/cdn/HNTSDY3J.js +2 -0
- package/dist/cdn/HV7MVIQV.js +2 -0
- package/dist/cdn/I3SUE2TR.js +2 -0
- package/dist/cdn/I72ST4JR.js +134 -0
- package/dist/cdn/{T537PKP4.js → IHUWQOMK.js} +2 -2
- package/dist/cdn/JMXXRRKQ.js +22 -0
- package/dist/cdn/JUNMTIB3.js +2 -0
- package/dist/cdn/{6YMR4QSD.js → JYNHWJUZ.js} +2 -2
- package/dist/cdn/KAX4A7SF.js +2 -0
- package/dist/cdn/KBSXHSBX.js +2 -0
- package/dist/cdn/KKCLHXHG.js +2 -0
- package/dist/cdn/L2HLFWCV.js +72 -0
- package/dist/cdn/{7RCQFLPP.js → L3BTURBA.js} +2 -2
- package/dist/cdn/LBTGOMCT.js +2 -0
- package/dist/cdn/LIRT72WY.js +2 -0
- package/dist/cdn/LL324IL6.js +2 -0
- package/dist/cdn/LLY5A2E2.js +2 -0
- package/dist/cdn/LXIKAXUT.js +2 -0
- package/dist/cdn/M2U456J5.js +181 -0
- package/dist/cdn/M3KKORBG.js +2 -0
- package/dist/cdn/M5B6X46F.js +2 -0
- package/dist/cdn/{X2ZDYHCG.js → MZUDIQQH.js} +11 -6
- package/dist/cdn/NBDOPGSN.js +2 -0
- package/dist/cdn/NGR5NVZE.js +2 -0
- package/dist/cdn/{5ZZGKP7N.js → NNPA3NLK.js} +2 -2
- package/dist/cdn/NV7CL4S3.js +2 -0
- package/dist/cdn/{5W7S2RS4.js → OALQBAZR.js} +2 -2
- package/dist/cdn/OF3TAARW.js +2 -0
- package/dist/cdn/{AZGGTNA3.js → OXC2WP7W.js} +2 -2
- package/dist/cdn/PJPP6LOS.js +3 -0
- package/dist/cdn/PUZ6RAFQ.js +2 -0
- package/dist/cdn/QAX6UF4L.js +99 -0
- package/dist/cdn/{NE7E52YR.js → QTEPFTAU.js} +10 -4
- package/dist/cdn/ROS22KOA.js +2 -0
- package/dist/cdn/RSM7MEVT.js +9 -0
- package/dist/cdn/SBNNJ5WA.js +2 -0
- package/dist/cdn/SDX46GZY.js +2 -0
- package/dist/cdn/SI22EJLC.js +2 -0
- package/dist/cdn/SJMAKF4P.js +2 -0
- package/dist/cdn/SNG3WODY.js +2 -0
- package/dist/cdn/STOGCXJH.js +2 -0
- package/dist/cdn/SUC2MIGE.js +2 -0
- package/dist/cdn/SXYKNDOF.js +2 -0
- package/dist/cdn/SZ2L5556.js +2 -0
- package/dist/cdn/T6W6F4TF.js +2 -0
- package/dist/cdn/TB2GJALS.js +2 -0
- package/dist/cdn/TFAJNKBC.js +2 -0
- package/dist/cdn/TLPZELG3.js +2 -0
- package/dist/cdn/TXZQZR3I.js +2 -0
- package/dist/cdn/UAZPINUQ.js +2 -0
- package/dist/cdn/UGIHS7OA.js +2 -0
- package/dist/cdn/{FX7UOGHP.js → V266DJ5V.js} +2 -2
- package/dist/cdn/V4PJMCJZ.js +2 -0
- package/dist/cdn/{P7DG5T3Z.js → V52GSTOC.js} +2 -2
- package/dist/cdn/VGLBH473.js +2 -0
- package/dist/cdn/VK6CCPTG.js +2 -0
- package/dist/cdn/{ZS2TZ6BF.js → VLPELJUS.js} +2 -2
- package/dist/cdn/VT5EWFH7.js +2 -0
- package/dist/cdn/{7CYGX4F4.js → VXLKTQ36.js} +2 -2
- package/dist/cdn/W54XYT2A.js +2 -0
- package/dist/cdn/X42ACC66.js +5 -0
- package/dist/cdn/XNUWVZN7.js +2 -0
- package/dist/cdn/XOTPSCNF.js +2 -0
- package/dist/cdn/XRVGYRXL.js +14 -0
- package/dist/cdn/XV7RMYLR.js +2 -0
- package/dist/cdn/XVJFPZTW.js +2 -0
- package/dist/cdn/XZF7Y6B2.js +2 -0
- package/dist/cdn/{UPEEHMSY.js → Y4TYL2AL.js} +2 -2
- package/dist/cdn/Y4ZOB6UH.js +2 -0
- package/dist/cdn/Y6CV2NZR.js +2 -0
- package/dist/cdn/YIXASZUW.js +2 -0
- package/dist/cdn/YOW3YKWR.js +11 -0
- package/dist/cdn/{23EQTPO3.js → ZA7ZU2F7.js} +2 -2
- package/dist/cdn/ZJWR4W2S.js +208 -0
- package/dist/cdn/ZWIKFBOU.js +2 -0
- package/dist/cdn/ZY3JQCZQ.js +179 -0
- package/dist/cdn/agent-utils/index.js +2 -2
- package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +2 -2
- package/dist/cdn/agent-utils/middlewares/middleware.js +2 -2
- package/dist/cdn/agent-utils/middlewares/trace.js +2 -2
- package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +2 -2
- package/dist/chunks/BaseWorkflow.js +1 -1
- package/dist/chunks/SKILL.js +5 -0
- package/dist/chunks/SKILL2.js +5 -0
- package/dist/chunks/SKILL3.js +22 -0
- package/dist/chunks/SKILL4.js +5 -0
- package/dist/chunks/adapter.js +1127 -2011
- package/dist/chunks/aiFactory.js +94 -0
- package/dist/chunks/arcgisKnowledgeGraph.js +97 -77
- package/dist/chunks/arcgisToolRegistry.js +88 -0
- package/dist/chunks/arcgis_knowledge_current_lc_context.js +20 -3
- package/dist/chunks/arcgis_knowledge_current_map_context.js +32 -3
- package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
- package/dist/chunks/arcgis_knowledge_lucene_generation_prompt.js +1 -1
- package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +117 -28
- package/dist/chunks/arcgis_knowledge_tool_prompt.js +1 -1
- package/dist/chunks/baseAgentState.js +58 -0
- package/dist/chunks/converterUtils.js +67 -42
- package/dist/chunks/dataExplorationAgent.js +19 -0
- package/dist/chunks/data_explore_filter_prompt.js +1 -1
- package/dist/chunks/data_explore_query_prompt.js +10 -5
- package/dist/chunks/embeddings.worker.js +1 -1
- package/dist/chunks/fetchAgentContext.js +13 -0
- package/dist/chunks/fetchService.js +10 -0
- package/dist/chunks/fieldStatistics.js +79 -0
- package/dist/chunks/field_descriptions_prompt.js +1 -1
- package/dist/chunks/formatFeatureAttributes.js +132 -0
- package/dist/chunks/generateLayerDescriptions.js +190 -311
- package/dist/chunks/graph.js +1 -1
- package/dist/chunks/helpAgent.js +34 -0
- package/dist/chunks/help_prompt.js +35 -18
- package/dist/chunks/index.js +1 -1
- package/dist/chunks/intent_prompt.js +3 -3
- package/dist/chunks/layerStylingGraph.js +102 -84
- package/dist/chunks/layer_descriptions_prompt.js +1 -1
- package/dist/chunks/layer_styling_prompt.js +1 -1
- package/dist/chunks/mergeWhereClauses.js +15 -0
- package/dist/chunks/navigationAgent.js +27 -0
- package/dist/chunks/navigation_intent_prompt.js +9 -3
- package/dist/chunks/navigation_tool_prompt.js +1 -1
- package/dist/chunks/orchestrator.js +446 -235
- package/dist/chunks/requireAgentServices.js +11 -0
- package/dist/chunks/resolvePointGeometryFilter.js +92 -0
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/slottableRequestUtils.js +1 -1
- package/dist/chunks/state.js +22 -28
- package/dist/chunks/summarize_query_response_prompt.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/chunks/utils.js +1 -1
- package/dist/chunks/utils2.js +12 -12
- package/dist/chunks/utils3.js +1 -1
- package/dist/components/arcgis-assistant/customElement.d.ts +102 -1
- package/dist/components/arcgis-assistant/customElement.js +332 -184
- package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +533 -11
- package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
- package/dist/components/arcgis-assistant-chat-entry/customElement.js +1 -1
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +35 -9
- package/dist/components/arcgis-assistant-help-agent/customElement.js +32 -9
- package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
- package/dist/components/arcgis-assistant-interrupt/customElement.js +12 -13
- package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +13 -9
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +1 -1
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +41 -17
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +31 -8
- package/dist/components/arcgis-assistant-message/customElement.d.ts +3 -0
- package/dist/components/arcgis-assistant-message/customElement.js +10 -9
- package/dist/components/arcgis-assistant-message-block/customElement.js +2 -2
- package/dist/components/arcgis-assistant-message-feedback/customElement.js +1 -1
- package/dist/components/arcgis-assistant-message-footer/customElement.js +1 -1
- package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +3 -0
- package/dist/components/arcgis-assistant-message-loading/customElement.js +12 -11
- package/dist/components/arcgis-assistant-message-log/customElement.js +1 -1
- package/dist/components/arcgis-assistant-message-read-aloud/customElement.js +1 -1
- package/dist/components/arcgis-assistant-message-text/customElement.d.ts +1 -0
- package/dist/components/arcgis-assistant-message-text/customElement.js +13 -13
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +34 -10
- package/dist/components/arcgis-assistant-speech-input/customElement.js +35 -53
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +1 -1
- package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
- package/dist/components/arcgis-assistant-user-message/customElement.js +16 -11
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +1 -1
- package/dist/loader.js +7 -7
- package/dist/oauth-callback.html +1 -1
- package/dist/orchestrator/models/types.d.ts +1 -0
- package/dist/orchestrator/orchestrator/orchestratorEvents.d.ts +78 -0
- package/dist/orchestrator/providers/arcgis/aiFactory.d.ts +15 -0
- package/dist/orchestrator/types/types.d.ts +17 -0
- package/dist/types/lumina.d.ts +5 -4
- package/dist/types/preact.d.ts +5 -4
- package/dist/types/react.d.ts +5 -4
- package/dist/types/stencil.d.ts +7 -6
- package/dist/utils/index.d.ts +75 -39
- package/dist/utils/index.js +708 -84
- package/package.json +35 -12
- package/dist/cdn/34SG44C3.js +0 -72
- package/dist/cdn/3JGWGKT6.js +0 -2
- package/dist/cdn/3NBDVZ2I.js +0 -2
- package/dist/cdn/3VOQD2MR.js +0 -2
- package/dist/cdn/434TAA3J.js +0 -2
- package/dist/cdn/53NTYC4I.js +0 -2
- package/dist/cdn/5QAHYX7Y.js +0 -5
- package/dist/cdn/AXDZBBNL.js +0 -45
- package/dist/cdn/B7WJFBOZ.js +0 -2
- package/dist/cdn/BX7FSMUU.js +0 -56
- package/dist/cdn/CHPQM77M.js +0 -181
- package/dist/cdn/DHKUXLU3.js +0 -179
- package/dist/cdn/DQSEBKOX.js +0 -2
- package/dist/cdn/DZ2QWNUA.js +0 -3
- package/dist/cdn/EBISDZ5H.js +0 -2
- package/dist/cdn/ERL2CB2Y.js +0 -14
- package/dist/cdn/F2AHA4GB.js +0 -54
- package/dist/cdn/FUIGPHBH.js +0 -2
- package/dist/cdn/H2CHHGGH.js +0 -2
- package/dist/cdn/HWKDNS4K.js +0 -4
- package/dist/cdn/IMQ4TVHF.js +0 -16
- package/dist/cdn/IOD3GDA7.js +0 -2
- package/dist/cdn/IR7PTESF.js +0 -2
- package/dist/cdn/IRZDTYO2.js +0 -2
- package/dist/cdn/JIWK6QK6.js +0 -2
- package/dist/cdn/JLKGS6Y5.js +0 -36
- package/dist/cdn/K3JCH4XW.js +0 -2
- package/dist/cdn/KHXUWZHB.js +0 -2
- package/dist/cdn/KMQ3SP4I.js +0 -5
- package/dist/cdn/LIFK3QSD.js +0 -2
- package/dist/cdn/NXKKG5TK.js +0 -2
- package/dist/cdn/O3EN27N5.js +0 -2
- package/dist/cdn/O3RFFPU3.js +0 -6
- package/dist/cdn/PBO6FZN6.js +0 -2
- package/dist/cdn/Q3ZW4FYA.js +0 -3
- package/dist/cdn/Q6LRANX6.js +0 -2
- package/dist/cdn/QCSN44H4.js +0 -2
- package/dist/cdn/R56X6ZKR.js +0 -161
- package/dist/cdn/RUURNLTP.js +0 -2
- package/dist/cdn/T43LEBBE.js +0 -47
- package/dist/cdn/TR4GFL7X.js +0 -2
- package/dist/cdn/WNS5ZUF5.js +0 -2
- package/dist/cdn/X4XY5HIE.js +0 -2
- package/dist/cdn/XOH56EQ2.js +0 -2
- package/dist/cdn/XON27U6U.js +0 -2
- package/dist/cdn/YIMNOUTF.js +0 -2
- package/dist/cdn/YLN2BZ5J.js +0 -2
- package/dist/cdn/YUKR4AZW.js +0 -2
- package/dist/cdn/Z2G7MP5L.js +0 -22
- package/dist/chunks/dataExplorationGraph.js +0 -310
- package/dist/chunks/helpGraph.js +0 -126
- package/dist/chunks/navigationGraph.js +0 -270
- package/dist/chunks/toolCallResponse.js +0 -31
package/dist/cdn/TR4GFL7X.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as c}from"./FUIGPHBH.js";export default $arcgis.t(([l,{property:i,subclass:y},{watch:d}])=>{var w=Object.defineProperty,g=Object.getOwnPropertyDescriptor,t=(s,a,p,o)=>{for(var r=o>1?void 0:o?g(a,p):a,h=s.length-1,n;h>=0;h--)(n=s[h])&&(r=(o?n(a,p,r):n(r))||r);return o&&r&&w(a,p,r),r},m=()=>{throw new Error("createGraph method not implemented.")},e=class extends l{constructor(){super(...arguments),this.description="",this.middlewares=[],this.createGraph=m,this.workspace=c()}initialize(){this.addHandles([d(()=>[this.name,this.description],()=>this.generate(),{initial:!0,sync:!0}),d(()=>this.createGraph,()=>this._compiledGraph=void 0)])}get id(){return this.name.replace(/\s+/gu,"-").toLowerCase()}get registration(){return{id:this.id,name:this.name,description:this.description,createGraph:this.createGraph,workspace:this.workspace}}async run(s={},a){return this.createGraph===m&&this.generate(),this._compiledGraph=this._compiledGraph??this.createGraph().compile(),await this._compiledGraph.invoke(s,a)}};t([i({readOnly:!0})],e.prototype,"id",1);t([i()],e.prototype,"name",2);t([i()],e.prototype,"description",2);t([i()],e.prototype,"middlewares",2);t([i({readOnly:!0})],e.prototype,"createGraph",2);t([i({readOnly:!0})],e.prototype,"workspace",2);t([i({readOnly:!0})],e.prototype,"registration",1);e=t([y("BaseAgent")],e);return e},"core/Accessor","core/accessorSupport/decorators","core/reactiveUtils")
|
package/dist/cdn/WNS5ZUF5.js
DELETED
package/dist/cdn/X4XY5HIE.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import a from"./3VOQD2MR.js";import{c as l}from"./FUIGPHBH.js";import"./DHKUXLU3.js";import"./CHPQM77M.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([{property:g,subclass:u},{d:w}])=>{var f=Object.defineProperty,m=Object.getOwnPropertyDescriptor,c=(o,r,n,s)=>{for(var e=s>1?void 0:s?m(r,n):r,a=o.length-1,t;a>=0;a--)(t=o[a])&&(e=(s?t(r,n,e):t(e))||e);return s&&e&&f(r,n,e),e},p=class extends w{constructor(o){super(o)}getAgents(){return this.workflow.getAgents()}generate(){let o=this.workflow.generate(),r=o.workspace,n=o.createGraph().compile(),{decideContinue:s}=this,e={[i]:async(t,d)=>await n.invoke(t,d)},a=[{from:i,decide:async(t,d)=>await Promise.resolve(s(t,d))?i:void 0}];return{workspace:r,createGraph:()=>l(e,a,r,{entryNode:i})}}buildEdges(){throw new Error("LoopWorkflow overrides generate(); buildEdges should not be called.")}getEntryNode(){return i}isTerminalAgent(){return!0}};c([g()],p.prototype,"workflow",2);c([g()],p.prototype,"decideContinue",2);p=c([u("LoopWorkflow")],p);var i="__loop_body";return p},"core/accessorSupport/decorators",a)
|
package/dist/cdn/XOH56EQ2.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{Z as c}from"./CHPQM77M.js";function f(e,s,t){return{...e,status:s,summary:t}}function g(e){let s=Object.entries(e).filter(([t,n])=>t!=="agentExecutionContext"&&t!=="outputMessage"&&t!=="summary"&&t!=="status"&&n!==void 0);if(s.length!==0)try{return JSON.stringify(Object.fromEntries(s),null,2)}catch{return}}function m(e,s,t=[]){let n=s.safeParse(e);if(n.success){let u={...n.data},r=g(u),a=r??"LLMAgent produced structured output.",o=r??u.outputMessage,i={...u,...o?{outputMessage:o}:{},agentExecutionContext:{messages:[...t,new c(typeof o=="string"&&o.trim()?o:a)]}};return f(i,"success",a)}else throw new Error(`LLMAgent output schema validation failed: ${n.error.message}`)}function l(e,s){let t={outputMessage:e.outputMessage};if(s){let n=s.shape,u=e;for(let r of Object.keys(n??{}))r in e&&(t[r]=u[r])}return t}export{f as a,m as b,l as c};
|
package/dist/cdn/XON27U6U.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as r}from"./434TAA3J.js";import{a as m}from"./QCSN44H4.js";import"./NXKKG5TK.js";import{g as l,h as e,v as c,x as d,z as g}from"./HWKDNS4K.js";import"./YIMNOUTF.js";var b=l`:host{display:block;container-type:inline-size}.container{display:flex;flex-direction:column;align-items:flex-start;gap:var(--calcite-spacing-sm);width:100%;text-align:left}.icon{padding:var(--calcite-spacing-sm);border-radius:var(--calcite-spacing-xl);background:var(--calcite-color-brand);color:var(--calcite-color-foreground-1)}.content-container{display:flex;flex:1;flex-direction:column;width:100%;gap:var(--calcite-spacing-md)}.content,.blocks{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm)}.block-pending{display:flex;justify-content:center;align-items:center;padding:var(--calcite-spacing-sm);background:linear-gradient(90deg,color-mix(in srgb,var(--calcite-color-foreground-2) 65%,transparent),color-mix(in srgb,var(--calcite-color-foreground-3) 85%,transparent),color-mix(in srgb,var(--calcite-color-foreground-2) 65%,transparent));background-size:200% 100%;animation:assistant-message-loading-shimmer 2s ease-in-out infinite;border-radius:var(--calcite-border-radius);min-height:100px}.message-error{font-style:italic}@container (min-width: 480px){.container{max-width:80%}}@keyframes assistant-message-loading-shimmer{0%{background-position:-150% 0}to{background-position:150% 0}}@media(prefers-reduced-motion){.block-pending{animation:none}}`;function p({message:a}){let s=new Map;return a&&a.blocks?.forEach((t,i)=>{if(!t.isPending){let n=r(a.id,i);s.set(n,{data:{block:t,index:i,message:a},name:"block",slotName:n})}}),s}var o=class extends c{constructor(){super(...arguments),this.arcgisSlottableRequest=m(this,["message"],p),this.feedbackEnabled=!1,this.logEnabled=!1,this.copyEnabled=!1,this.readAloudEnabled=!1,this.footerDisabled=!1,this.assistantAvatarEnabled=!1}static{this.properties={_isStreaming:16,feedbackEnabled:5,logEnabled:5,copyEnabled:5,readAloudEnabled:5,footerDisabled:5,message:0,assistantAvatarEnabled:5}}static{this.styles=b}get _isStreaming(){return!!this.message?.isStreaming}_renderContent(){let s=this.message,t=s?.id;if(t)return e`<div class="content"><arcgis-assistant-interrupt-preview .interrupts=${this.message?.interrupts}></arcgis-assistant-interrupt-preview>${s.blocks?.length?e`<div class="blocks">${s.blocks.map((i,n)=>i.isPending&&i.type!=="text"?e`<div class="block-pending"></div>`:e`<slot name=${r(t,n)??d}></slot>`)}</div>`:null}</div>`}_renderFooter(){return e`<arcgis-assistant-message-footer .message=${this.message} .feedbackEnabled=${this.feedbackEnabled} .logEnabled=${this.logEnabled} .copyEnabled=${this.copyEnabled} .readAloudEnabled=${this.readAloudEnabled}></arcgis-assistant-message-footer>`}render(){return e`<div class="container">${this.assistantAvatarEnabled?e`<slot name=icon><calcite-icon icon=effects class="icon" scale=s></calcite-icon></slot>`:null}<div class="content-container"><slot name=content>${this._renderContent()}</slot>${this.message?.error?e`<div class="message-error">${this.message.error}</div>`:null}${this._isStreaming?e`<div class="streaming-indicator"><calcite-loader label=loading inline></calcite-loader></div>`:null}${!this.footerDisabled&&!this._isStreaming?e`<slot name=footer>${this._renderFooter()}</slot>`:null}</div></div>`}};g("arcgis-assistant-message",o);export{o as ArcgisAssistantMessage};
|
package/dist/cdn/YIMNOUTF.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports),n=(b,a)=>{for(var c in a)e(b,c,{get:a[c],enumerable:!0})},l=(b,a,c,f)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of i(a))!k.call(b,d)&&d!==c&&e(b,d,{get:()=>a[d],enumerable:!(f=h(a,d))||f.enumerable});return b};var o=(b,a,c)=>(c=b!=null?g(j(b)):{},l(a||!b||!b.__esModule?e(c,"default",{value:b,enumerable:!0}):c,b));export{m as a,n as b,o as c};
|
package/dist/cdn/YLN2BZ5J.js
DELETED
package/dist/cdn/YUKR4AZW.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{g as i,h as a,v as e,z as t}from"./HWKDNS4K.js";import"./YIMNOUTF.js";var n=i`:host{display:contents}.icon{padding:var(--calcite-spacing-sm);border-radius:var(--calcite-spacing-xl);background:var(--calcite-color-brand);color:var(--calcite-color-foreground-1)}.loading-container{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm);padding:0 var(--calcite-spacing-sm)}.loading{display:flex;align-items:center;gap:var(--calcite-spacing-sm)}.text{font-style:italic;word-wrap:break-word;word-break:break-all;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;line-clamp:1;-webkit-box-orient:vertical}.skeleton-block{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm);width:100%}.skeleton-text{display:block;height:.95em;border-radius:var(--calcite-border-radius);background:linear-gradient(90deg,color-mix(in srgb,var(--calcite-color-foreground-2) 65%,transparent),color-mix(in srgb,var(--calcite-color-foreground-3) 85%,transparent),color-mix(in srgb,var(--calcite-color-foreground-2) 65%,transparent));background-size:200% 100%;animation:assistant-message-loading-shimmer 1.2s ease-in-out infinite;width:85%}.skeleton-text:last-child{width:70%}@keyframes assistant-message-loading-shimmer{0%{background-position:-150% 0}to{background-position:150% 0}}@media(prefers-reduced-motion){.skeleton-text{animation:none}}`,s=class extends e{constructor(){super(...arguments),this.loading=!1,this.loadingMessage="",this.assistantAvatarEnabled=!1}static{this.properties={loading:5,loadingMessage:1,assistantAvatarEnabled:5,interrupts:0}}static{this.styles=n}render(){return this.loading?a`<arcgis-assistant-message footer-disabled>${this.assistantAvatarEnabled?a`<slot name=icon slot=icon><calcite-icon class="icon" icon=effects scale=s></calcite-icon></slot>`:null}<slot name=content slot=content><arcgis-assistant-interrupt-preview .interrupts=${this.interrupts}></arcgis-assistant-interrupt-preview><div class="loading-container"><div class="loading"><calcite-loader label=loading inline></calcite-loader><div class="text">${this.loadingMessage}</div></div><div class="skeleton-block"><span class="skeleton-text"></span><span class="skeleton-text"></span></div></div></slot></arcgis-assistant-message>`:null}};t("arcgis-assistant-message-loading",s);export{s as ArcgisAssistantMessageLoading};
|
package/dist/cdn/Z2G7MP5L.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import b from"./R56X6ZKR.js";import a from"./T43LEBBE.js";import{a as y,c as E}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as u,z as d}from"./HWKDNS4K.js";import{a as p}from"./P7DG5T3Z.js";import"./BX7FSMUU.js";import{a as h,b as l,ta as f}from"./DHKUXLU3.js";import"./CHPQM77M.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,{l:x},{I:c,J:H,a:S,m:_,n:w,o:m,p:v}])=>{var C=[H],b=e=>{if(!e||e.size===0)return"No layers available in this map.";let t=Array.from(e.values()).map(({layerItem:o,fieldRegistry:a},s)=>{let r=Array.from(a.values()).map(n=>n.name).slice(0,10).join(", "),i=a.size>10?` (and ${a.size-10} more)`:"";return`${s+1}. "${o.title}". Description: ${o.description}
|
|
3
|
-
Fields: ${r}${i}`}).join(`
|
|
4
|
-
|
|
5
|
-
`);return`This map contains ${e.size} layer(s):
|
|
6
|
-
|
|
7
|
-
${t}`},k=e=>{let t=e?.list()??[];return t.length?t.map(o=>`- ${o.agent.name}: ${o.agent.description}`).join(`
|
|
8
|
-
`):"No agents currently available."};async function I(e,t){let o=await _("help_prompt"),a=m(t,"layersAndFieldsRegistry"),s=m(t,"agentRegistry");try{let r=await x({promptText:o,modelTier:"fast",config:t,tools:C,inputVariables:{layerSummary:b(a),agents:k(s),assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps}}),i=(r.tool_calls?.length??0)>0,n=typeof r.text=="string"?r.text.trim():"";return{...e,helpInternalState:{...e.helpInternalState,toolCallMessage:i?r:void 0},outputMessage:i?e.outputMessage:n,summary:i?"Prepared help tool call from assigned task.":"Provided map-related help based on the assigned task.",status:i?e.status:"success"}}catch(r){let i=r instanceof Error?r.message:String(r);return{...e,outputMessage:`Error invoking help agent: ${i}`,summary:"Help agent execution failed.",status:"failed"}}}var M=(e,t)=>v(["agentRegistry"],"Help Agent")(e,t);async function T(e,t){let o=new S(C,{handleToolErrors:!1});try{let a=e.helpInternalState.toolCallMessage;if(!a)throw new Error("helpToolCalling: missing helpInternalState.toolCallMessage");let s=(await o.invoke({messages:[a]},t)).messages.map(r=>r.text).join(`
|
|
9
|
-
`);return await p({text:`Finished executing help tool: ${s}`},t),{...e,outputMessage:s,status:"success",summary:s?w(s):"Help executed.",helpInternalState:{...e.helpInternalState,toolCallMessage:void 0}}}catch(a){let s=a instanceof Error?a.message:String(a);return await p({text:`Help tool execution failed: ${s}`},t),{...e,outputMessage:`Help tool execution failed: ${s}`,status:"failed",summary:`Help tool execution failed: ${s}`,helpInternalState:{...e.helpInternalState,toolCallMessage:void 0}}}}var q=()=>new f(c).addNode("requireHelpServices",M).addNode("agent",I).addNode("tools",T).addEdge(h,"requireHelpServices").addEdge("requireHelpServices","agent").addConditionalEdges("agent",e=>e.helpInternalState.toolCallMessage?"tools":l).addEdge("tools",l),A=String.raw`- **help** — Enables users to ask questions about the map, layers, fields, and it's capabilities.
|
|
10
|
-
|
|
11
|
-
_Example: “Tell me about this map”_
|
|
12
|
-
_Example: “List all layers in this map”_
|
|
13
|
-
_Example: “List fields in protected areas layer”_
|
|
14
|
-
_Example: “What agents are available to me?”_
|
|
15
|
-
_Example: “What can you do?”_
|
|
16
|
-
_Example: “What can I ask”_
|
|
17
|
-
|
|
18
|
-
Even if the user asks unrelated queries like "What are the vowels in English alphabet" or "How to cook", call this agent.
|
|
19
|
-
|
|
20
|
-
IF the user asks map related queries, but those that are not performed by any of the agents, call this agent so we can respond accordingly.
|
|
21
|
-
_Example: "Create a chart"_
|
|
22
|
-
_Example: "Create a table"_`,$={id:"help",name:"Help Agent",description:A,createGraph:q,workspace:c};var g=class extends u{constructor(){super(...arguments),this.agent=$}static{this.properties={referenceElement:1}}#e;getContext(){if(!this.#e)throw new Error("arcgis-assistant-help-agent requires a mapView");return{mapView:this.#e}}load(){this.#e=y(this,"arcgis-assistant-help-agent"),E(this)}};d("arcgis-assistant-help-agent",g);return g},"identity/IdentityManager","portal/Portal","config","core/reactiveUtils","layers/FeatureLayer","request","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","identity/IdentityManager","portal/Portal","config","core/reactiveUtils","layers/FeatureLayer","request","views/LinkChartView","rest/knowledgeGraphService",a,b)
|
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { StateGraph as I, START as k, END as v } from "@langchain/langgraph/web";
|
|
3
|
-
import { g as T, O as R, P as C, t as N, Q as V, f as h, R as D, r as z, S as b, T as P } from "./adapter.js";
|
|
4
|
-
import "@arcgis/core/identity/IdentityManager.js";
|
|
5
|
-
import "@arcgis/core/portal/Portal.js";
|
|
6
|
-
import { h as _, e as Q } from "./generateLayerDescriptions.js";
|
|
7
|
-
import { AIMessage as j } from "@langchain/core/messages";
|
|
8
|
-
import { s as n } from "./index.js";
|
|
9
|
-
import "@langchain/openai";
|
|
10
|
-
import "@arcgis/core/config.js";
|
|
11
|
-
import "@arcgis/core/core/reactiveUtils.js";
|
|
12
|
-
import "@arcgis/core/layers/FeatureLayer.js";
|
|
13
|
-
import "@arcgis/core/request.js";
|
|
14
|
-
import "@langchain/core/prompts";
|
|
15
|
-
import { h as $ } from "./toolCallResponse.js";
|
|
16
|
-
import { ToolNode as O } from "@langchain/langgraph/prebuilt";
|
|
17
|
-
import G from "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
|
|
18
|
-
import U from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
|
|
19
|
-
const W = async (t, e) => (await n({ text: "Exiting Data Exploration agent" }, e), t), B = async (t, e) => {
|
|
20
|
-
await n({ text: "Requesting LLM for layer filter results" }, e);
|
|
21
|
-
const d = await T("data_explore_filter_prompt");
|
|
22
|
-
if (!e?.configurable)
|
|
23
|
-
throw new Error("config.configurable is required for layer filter tools");
|
|
24
|
-
const { userTimezone: l, userTimezoneOffset: s } = R(), o = {
|
|
25
|
-
layerFieldInfo: t.layerFieldInfo,
|
|
26
|
-
userTimezone: l,
|
|
27
|
-
userTimezoneOffset: s,
|
|
28
|
-
queryResponse: t.queryResponse,
|
|
29
|
-
assignedTask: t.agentExecutionContext.assignedTask,
|
|
30
|
-
userRequest: t.agentExecutionContext.userRequest,
|
|
31
|
-
priorSteps: t.agentExecutionContext.priorSteps
|
|
32
|
-
}, r = await _({
|
|
33
|
-
promptText: d,
|
|
34
|
-
modelTier: "advanced",
|
|
35
|
-
config: e,
|
|
36
|
-
messages: t.dataExplorationMessages,
|
|
37
|
-
inputVariables: o,
|
|
38
|
-
tools: C
|
|
39
|
-
}), i = [...t.dataExplorationMessages, r];
|
|
40
|
-
if (!((r.tool_calls?.length ?? 0) > 0))
|
|
41
|
-
return await n({ text: "LLM determined no filter changes needed" }, e), {
|
|
42
|
-
...t,
|
|
43
|
-
dataExplorationMessages: i
|
|
44
|
-
// Don't overwrite outputMessage if query already set it
|
|
45
|
-
};
|
|
46
|
-
const m = i, p = r.content.toString();
|
|
47
|
-
return await $(r, e), { ...t, dataExplorationMessages: m, outputMessage: p };
|
|
48
|
-
}, H = async (t, e) => {
|
|
49
|
-
await n({ text: "Requesting LLM for layer query results" }, e);
|
|
50
|
-
const d = await T("data_explore_query_prompt");
|
|
51
|
-
if (!e?.configurable)
|
|
52
|
-
throw new Error("config.configurable is required for layer query tools");
|
|
53
|
-
const { userTimezone: l, userTimezoneOffset: s } = R(), r = t.agentExecutionContext.sharedState.lastNavigatedFeatures, i = r && typeof r == "object" && "value" in r ? r.value : r;
|
|
54
|
-
let c = "none";
|
|
55
|
-
if (i != null)
|
|
56
|
-
try {
|
|
57
|
-
c = JSON.stringify(i);
|
|
58
|
-
} catch {
|
|
59
|
-
c = "none";
|
|
60
|
-
}
|
|
61
|
-
const m = {
|
|
62
|
-
layerFieldInfo: t.layerFieldInfo,
|
|
63
|
-
userTimezone: l,
|
|
64
|
-
userTimezoneOffset: s,
|
|
65
|
-
assignedTask: t.agentExecutionContext.assignedTask,
|
|
66
|
-
userRequest: t.agentExecutionContext.userRequest,
|
|
67
|
-
priorSteps: t.agentExecutionContext.priorSteps,
|
|
68
|
-
lastNavigatedFeatures: c
|
|
69
|
-
}, p = await _({
|
|
70
|
-
promptText: d,
|
|
71
|
-
modelTier: "advanced",
|
|
72
|
-
config: e,
|
|
73
|
-
messages: t.dataExplorationMessages,
|
|
74
|
-
inputVariables: m,
|
|
75
|
-
tools: V
|
|
76
|
-
}), f = (p.tool_calls?.length ?? 0) > 0, g = p.content.toString();
|
|
77
|
-
return await $(p, e), {
|
|
78
|
-
...t,
|
|
79
|
-
dataExplorationMessages: [...t.dataExplorationMessages, p],
|
|
80
|
-
// Only emit output here when no tools are being called.
|
|
81
|
-
// For tool-calling flows, downstream summarizer nodes provide the final user-facing message.
|
|
82
|
-
...f ? {} : { outputMessage: g },
|
|
83
|
-
status: "success",
|
|
84
|
-
summary: g && !f ? N(g) : "Query planning completed."
|
|
85
|
-
};
|
|
86
|
-
}, J = async (t, e) => {
|
|
87
|
-
try {
|
|
88
|
-
await n({ text: "Requesting LLM for summary on query results" }, e);
|
|
89
|
-
const d = await T("summarize_query_response_prompt"), l = {
|
|
90
|
-
queryResponse: t.queryResponse,
|
|
91
|
-
assignedTask: t.agentExecutionContext.assignedTask,
|
|
92
|
-
userRequest: t.agentExecutionContext.userRequest,
|
|
93
|
-
priorSteps: t.agentExecutionContext.priorSteps
|
|
94
|
-
}, s = await Q({
|
|
95
|
-
promptText: d,
|
|
96
|
-
modelTier: "fast",
|
|
97
|
-
config: e,
|
|
98
|
-
messages: t.dataExplorationMessages,
|
|
99
|
-
inputVariables: l
|
|
100
|
-
}), o = typeof s == "string" ? s : s.content, r = new j(o);
|
|
101
|
-
await n({ text: `Received response from LLM: ${o}` }, e);
|
|
102
|
-
const i = o;
|
|
103
|
-
return {
|
|
104
|
-
...t,
|
|
105
|
-
outputMessage: i,
|
|
106
|
-
status: "success",
|
|
107
|
-
summary: i ? N(i) : "Summary generated.",
|
|
108
|
-
dataExplorationMessages: [...t.dataExplorationMessages, r]
|
|
109
|
-
};
|
|
110
|
-
} catch (a) {
|
|
111
|
-
throw await n({ text: "Error during filter LLM request" }, e), new Error(`Error during filter LLM request: ${a instanceof Error ? a.message : String(a)}`);
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
async function K(t, e) {
|
|
115
|
-
if ((t.queryResponse ?? []).some((s) => {
|
|
116
|
-
const o = s.details;
|
|
117
|
-
return typeof o == "object" && o !== null && "error" in o;
|
|
118
|
-
}))
|
|
119
|
-
return await n({ text: "Skipping layer filter tool because query response contains an error." }, e), { ...t };
|
|
120
|
-
const l = await new O(C, { handleToolErrors: !1 }).invoke(
|
|
121
|
-
{
|
|
122
|
-
messages: t.dataExplorationMessages
|
|
123
|
-
},
|
|
124
|
-
e
|
|
125
|
-
);
|
|
126
|
-
return await n(
|
|
127
|
-
{ text: `Finished executing layer filter tool: ${l.messages.map((s) => s.content).join(", ")}` },
|
|
128
|
-
e
|
|
129
|
-
), { ...t };
|
|
130
|
-
}
|
|
131
|
-
const X = 10, Y = ["string", "small-integer", "integer"], Z = async (t, e, { includeSummaryStatistics: a = !0, includeUniqueValues: d = !0 } = {}) => {
|
|
132
|
-
let l = null, s = null;
|
|
133
|
-
try {
|
|
134
|
-
if (e.type !== "geometry" && e.type !== "oid" && e.type !== "global-id") {
|
|
135
|
-
a && (l = await G({ layer: t, field: e.name }));
|
|
136
|
-
const o = e.domain?.type === "coded-value" ? e.domain : null;
|
|
137
|
-
d && (Y.includes(e.type) || o) && (s = (await U({ layer: t, field: e.name })).uniqueValueInfos.sort((r, i) => i.count - r.count).slice(0, X), o && (s = s.map((r) => ({
|
|
138
|
-
...r,
|
|
139
|
-
value: o.getName(r.value) ?? r.value
|
|
140
|
-
}))));
|
|
141
|
-
}
|
|
142
|
-
} catch (o) {
|
|
143
|
-
console.error(`Error fetching statistics for field ${e.name}:`, o);
|
|
144
|
-
}
|
|
145
|
-
return {
|
|
146
|
-
summaryStatistics: l,
|
|
147
|
-
uniqueValues: s
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
function ee(t, e) {
|
|
151
|
-
return ["string", "small-integer", "integer"].includes(t) || e === "coded-value";
|
|
152
|
-
}
|
|
153
|
-
async function te(t, e, a, d = !0) {
|
|
154
|
-
const l = [], s = [], o = [];
|
|
155
|
-
for (const r of t) {
|
|
156
|
-
let i = function(y) {
|
|
157
|
-
const u = e.get(y)?.layerItem;
|
|
158
|
-
return u ? [
|
|
159
|
-
u.name && `Name: ${u.name}`,
|
|
160
|
-
u.title && `Title: ${u.title}`,
|
|
161
|
-
u.description && `Description: ${u.description}`
|
|
162
|
-
].filter(Boolean).join(" | ") : y;
|
|
163
|
-
};
|
|
164
|
-
const { layerId: c, results: m } = r, p = a.map?.allLayers.find((y) => y.id === c), f = e.get(c)?.fieldRegistry;
|
|
165
|
-
if (!f)
|
|
166
|
-
continue;
|
|
167
|
-
let g = l.find((y) => y.layerId === c);
|
|
168
|
-
g || (g = {
|
|
169
|
-
layerId: c,
|
|
170
|
-
layerSummary: i(c),
|
|
171
|
-
fieldInfos: []
|
|
172
|
-
}, l.push(g));
|
|
173
|
-
for (const y of m) {
|
|
174
|
-
const u = f.get(y.name);
|
|
175
|
-
if (!u)
|
|
176
|
-
continue;
|
|
177
|
-
const x = u.statistics, E = d && !x?.summaryStatistics, w = ee(u.type, u.domain?.type) && !x?.uniqueValues, q = E || w;
|
|
178
|
-
if (o.push({
|
|
179
|
-
layerId: c,
|
|
180
|
-
fieldName: u.name,
|
|
181
|
-
didFetchStatistics: q
|
|
182
|
-
}), q) {
|
|
183
|
-
const A = Z(p, u, {
|
|
184
|
-
includeSummaryStatistics: E,
|
|
185
|
-
includeUniqueValues: w
|
|
186
|
-
}).then((F) => {
|
|
187
|
-
const S = {
|
|
188
|
-
summaryStatistics: x?.summaryStatistics ?? null,
|
|
189
|
-
uniqueValues: x?.uniqueValues ?? null
|
|
190
|
-
};
|
|
191
|
-
E && (S.summaryStatistics = F.summaryStatistics), w && (S.uniqueValues = F.uniqueValues), f.set(u.name, { ...u, statistics: S }), u.statistics = S;
|
|
192
|
-
});
|
|
193
|
-
s.push(A);
|
|
194
|
-
}
|
|
195
|
-
g.fieldInfos.push(u);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
return await Promise.all(s), {
|
|
199
|
-
layerFieldInfo: l,
|
|
200
|
-
didFetchStatistics: s.length > 0,
|
|
201
|
-
fieldStatisticsFetchStatus: o
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
const M = /\b(average|avg|mean|median|max(?:imum)?|min(?:imum)?|sum|total|count|std(?:dev|\s*deviation)|variance|null\s*count|missing\s*values?|range)\b/iu;
|
|
205
|
-
function ae(t, e) {
|
|
206
|
-
return M.test(t) || M.test(e);
|
|
207
|
-
}
|
|
208
|
-
const se = async (t, e) => {
|
|
209
|
-
try {
|
|
210
|
-
await n({ text: "Preparing field information for vector search results" }, e);
|
|
211
|
-
const a = h(e, "layersAndFieldsRegistry"), { mapView: d } = D(e), { assignedTask: l, userRequest: s } = t.agentExecutionContext, o = ae(l, s), { layerFieldInfo: r, didFetchStatistics: i, fieldStatisticsFetchStatus: c } = await te(
|
|
212
|
-
t.vectorSearchFieldResults,
|
|
213
|
-
a,
|
|
214
|
-
d,
|
|
215
|
-
o
|
|
216
|
-
);
|
|
217
|
-
i ? await n({ text: "Statistics fetched" }, e) : await n({ text: "Statistics skipped" }, e);
|
|
218
|
-
for (const m of c)
|
|
219
|
-
await n(
|
|
220
|
-
{
|
|
221
|
-
text: ` - ${m.fieldName} - stats ${m.didFetchStatistics ? "fetched" : "skipped"}`
|
|
222
|
-
},
|
|
223
|
-
e
|
|
224
|
-
);
|
|
225
|
-
return await n({ text: "Field information prepared" }, e), { ...t, layerFieldInfo: r };
|
|
226
|
-
} catch (a) {
|
|
227
|
-
throw await n({ text: "Error during fetching statistics" }, e), new Error(`Error during fetching statistics: ${a instanceof Error ? a.message : String(a)}`);
|
|
228
|
-
}
|
|
229
|
-
}, L = 0.7, re = 10, oe = async (t, e) => {
|
|
230
|
-
try {
|
|
231
|
-
await n({ text: "Similarity search to find fields" }, e);
|
|
232
|
-
const a = h(e, "fieldSearch"), d = h(e, "layersAndFieldsRegistry"), l = h(e, "embeddingCache"), s = await a.searchFields({
|
|
233
|
-
text: t.agentExecutionContext.assignedTask,
|
|
234
|
-
layerIds: t.vectorSearchLayerIds,
|
|
235
|
-
minScore: L,
|
|
236
|
-
topResults: re,
|
|
237
|
-
embeddingCache: l
|
|
238
|
-
}), o = s.map(({ layerId: i, results: c }) => {
|
|
239
|
-
const m = c.map((p) => ` - ${p.name} (${p.score.toFixed(2)})`).join(`
|
|
240
|
-
`);
|
|
241
|
-
return `${d.get(i)?.layerItem.name ?? i}:
|
|
242
|
-
${m}`;
|
|
243
|
-
}).join(`
|
|
244
|
-
`);
|
|
245
|
-
let r;
|
|
246
|
-
return s.length > 0 ? r = `Vector search completed. Matching layers and fields with scores:
|
|
247
|
-
${o}` : r = `No vector search results found for score over ${L}.`, await n({ text: r }, e), {
|
|
248
|
-
...t,
|
|
249
|
-
vectorSearchFieldResults: s
|
|
250
|
-
};
|
|
251
|
-
} catch (a) {
|
|
252
|
-
throw await n(
|
|
253
|
-
{ text: `Error during vector search: ${a instanceof Error ? a.message : String(a)}` },
|
|
254
|
-
e
|
|
255
|
-
), new Error(`Vector search failed: ${a instanceof Error ? a.message : String(a)}`);
|
|
256
|
-
}
|
|
257
|
-
}, ie = 0.7, ne = async (t, e) => {
|
|
258
|
-
try {
|
|
259
|
-
await n(
|
|
260
|
-
{ text: `Similarity search to find layers: ${t.agentExecutionContext.assignedTask}` },
|
|
261
|
-
e
|
|
262
|
-
);
|
|
263
|
-
const a = h(e, "layerSearch"), d = h(e, "layersAndFieldsRegistry"), l = h(e, "embeddingCache"), s = await a.searchLayers({
|
|
264
|
-
text: t.agentExecutionContext.assignedTask,
|
|
265
|
-
minScore: ie,
|
|
266
|
-
embeddingCache: l
|
|
267
|
-
}), o = s.map((c) => c.id), r = s.map(({ id: c, score: m }) => `${d.get(c)?.layerItem.name ?? c} (${m.toFixed(2)})`).join(`
|
|
268
|
-
`);
|
|
269
|
-
let i;
|
|
270
|
-
return o.length > 0 ? i = `Vector search completed. Matching layers with scores:
|
|
271
|
-
${r}` : i = "Vector search completed. No matching layers found.", await n({ text: i }, e), {
|
|
272
|
-
...t,
|
|
273
|
-
vectorSearchLayerIds: o
|
|
274
|
-
};
|
|
275
|
-
} catch (a) {
|
|
276
|
-
throw await n(
|
|
277
|
-
{ text: `Error during vector search: ${a instanceof Error ? a.message : String(a)}` },
|
|
278
|
-
e
|
|
279
|
-
), new Error(`Vector search failed: ${a instanceof Error ? a.message : String(a)}`);
|
|
280
|
-
}
|
|
281
|
-
}, le = (t, e) => z(["layerSearch", "fieldSearch", "layersAndFieldsRegistry"], "Data Exploration Agent")(
|
|
282
|
-
t,
|
|
283
|
-
e
|
|
284
|
-
), ce = () => new I(b).addNode("requireDataExplorationServices", le).addNode("vectorSearchLayers", ne).addNode("vectorSearchFields", oe).addNode("fieldStatistics", se).addNode("queryAgent", H).addNode("queryTools", P).addNode("summarizeQueryResponseLLM", J).addNode("filterAgent", B).addNode("filterTools", K).addNode("earlyExit", W).addEdge(k, "requireDataExplorationServices").addEdge("requireDataExplorationServices", "vectorSearchLayers").addConditionalEdges(
|
|
285
|
-
"vectorSearchLayers",
|
|
286
|
-
(e) => e.vectorSearchLayerIds.length ? "vectorSearchFields" : "earlyExit"
|
|
287
|
-
).addConditionalEdges(
|
|
288
|
-
"vectorSearchFields",
|
|
289
|
-
(e) => e.vectorSearchFieldResults.length ? "fieldStatistics" : "earlyExit"
|
|
290
|
-
).addEdge("fieldStatistics", "queryAgent").addConditionalEdges("queryAgent", (e) => (e.dataExplorationMessages[e.dataExplorationMessages.length - 1]?.tool_calls?.length ?? 0) > 0 ? "queryTools" : "filterAgent").addConditionalEdges(
|
|
291
|
-
"queryTools",
|
|
292
|
-
(e) => e.queryResponse.length ? "summarizeQueryResponseLLM" : "filterAgent"
|
|
293
|
-
).addEdge("summarizeQueryResponseLLM", "filterAgent").addConditionalEdges("filterAgent", (e) => (e.dataExplorationMessages[e.dataExplorationMessages.length - 1]?.tool_calls?.length ?? 0) > 0 ? "filterTools" : v).addEdge("filterTools", v).addEdge("earlyExit", v), de = String.raw`- **data exploration** — User is asking about the feature layer’s data (e.g. counts, summaries, statistics, field values), either for all features, a subset based on a condition, or for a subset based on the current view. And/Or user wants to include or exclude features based on field values, or visually style features differently (e.g., highlight or deemphasize them).
|
|
294
|
-
The Data Exploration Agent will automatically zoom to the affected features for action taken by this agent. In this case, no need to call navigation tool separately.
|
|
295
|
-
_Example: “Only show stations where Brand is Shell”_
|
|
296
|
-
_Example: “Make Shell stations stand out on the map”_
|
|
297
|
-
_Example: “Gray out all stations that aren’t Shell”_
|
|
298
|
-
This also includes questions that ask which feature meets a given condition or where a particular feature in the data is located (e.g., “Where is the spring with the highest elevation?”). However, this agent does not handle addresses.
|
|
299
|
-
_Example: “How many features are there?”_
|
|
300
|
-
_Example: “What’s the average population?”_
|
|
301
|
-
_Example: “Which values are in the status field?”_`, Re = {
|
|
302
|
-
id: "dataExploration",
|
|
303
|
-
name: "Data Exploration Agent",
|
|
304
|
-
description: de,
|
|
305
|
-
createGraph: ce,
|
|
306
|
-
workspace: b
|
|
307
|
-
};
|
|
308
|
-
export {
|
|
309
|
-
Re as D
|
|
310
|
-
};
|
package/dist/chunks/helpGraph.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { StateGraph as d, START as g, END as i } from "@langchain/langgraph/web";
|
|
3
|
-
import { l as h, g as f, f as p, r as x, t as y, H as c } from "./adapter.js";
|
|
4
|
-
import "@arcgis/core/identity/IdentityManager.js";
|
|
5
|
-
import "@arcgis/core/portal/Portal.js";
|
|
6
|
-
import { h as S } from "./generateLayerDescriptions.js";
|
|
7
|
-
import "@langchain/core/messages";
|
|
8
|
-
import "@langchain/core/callbacks/dispatch/web";
|
|
9
|
-
import "@langchain/openai";
|
|
10
|
-
import "@arcgis/core/config.js";
|
|
11
|
-
import "@arcgis/core/core/reactiveUtils.js";
|
|
12
|
-
import "@arcgis/core/layers/FeatureLayer.js";
|
|
13
|
-
import "@arcgis/core/request.js";
|
|
14
|
-
import { ToolNode as E } from "@langchain/langgraph/prebuilt";
|
|
15
|
-
import { s as m } from "./index.js";
|
|
16
|
-
import "@langchain/core/prompts";
|
|
17
|
-
const u = [h], v = (e) => {
|
|
18
|
-
if (!e || e.size === 0)
|
|
19
|
-
return "No layers available in this map.";
|
|
20
|
-
const t = Array.from(e.values()).map(({ layerItem: r, fieldRegistry: s }, l) => {
|
|
21
|
-
const a = Array.from(s.values()).map((n) => n.name).slice(0, 10).join(", "), o = s.size > 10 ? ` (and ${s.size - 10} more)` : "";
|
|
22
|
-
return `${l + 1}. "${r.title}". Description: ${r.description}
|
|
23
|
-
Fields: ${a}${o}`;
|
|
24
|
-
}).join(`
|
|
25
|
-
|
|
26
|
-
`);
|
|
27
|
-
return `This map contains ${e.size} layer(s):
|
|
28
|
-
|
|
29
|
-
${t}`;
|
|
30
|
-
}, T = (e) => {
|
|
31
|
-
const t = e?.list() ?? [];
|
|
32
|
-
return t.length ? t.map((r) => `- ${r.agent.name}: ${r.agent.description}`).join(`
|
|
33
|
-
`) : "No agents currently available.";
|
|
34
|
-
};
|
|
35
|
-
async function _(e, t) {
|
|
36
|
-
const r = await f("help_prompt"), s = p(t, "layersAndFieldsRegistry"), l = p(t, "agentRegistry");
|
|
37
|
-
try {
|
|
38
|
-
const a = await S({
|
|
39
|
-
promptText: r,
|
|
40
|
-
modelTier: "fast",
|
|
41
|
-
config: t,
|
|
42
|
-
tools: u,
|
|
43
|
-
inputVariables: {
|
|
44
|
-
layerSummary: v(s),
|
|
45
|
-
agents: T(l),
|
|
46
|
-
assignedTask: e.agentExecutionContext.assignedTask,
|
|
47
|
-
userRequest: e.agentExecutionContext.userRequest,
|
|
48
|
-
priorSteps: e.agentExecutionContext.priorSteps
|
|
49
|
-
}
|
|
50
|
-
}), o = (a.tool_calls?.length ?? 0) > 0, n = typeof a.text == "string" ? a.text.trim() : "";
|
|
51
|
-
return {
|
|
52
|
-
...e,
|
|
53
|
-
helpInternalState: {
|
|
54
|
-
...e.helpInternalState,
|
|
55
|
-
toolCallMessage: o ? a : void 0
|
|
56
|
-
},
|
|
57
|
-
outputMessage: o ? e.outputMessage : n,
|
|
58
|
-
summary: o ? "Prepared help tool call from assigned task." : "Provided map-related help based on the assigned task.",
|
|
59
|
-
status: o ? e.status : "success"
|
|
60
|
-
};
|
|
61
|
-
} catch (a) {
|
|
62
|
-
const o = a instanceof Error ? a.message : String(a);
|
|
63
|
-
return {
|
|
64
|
-
...e,
|
|
65
|
-
outputMessage: `Error invoking help agent: ${o}`,
|
|
66
|
-
summary: "Help agent execution failed.",
|
|
67
|
-
status: "failed"
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
const C = (e, t) => x(["agentRegistry"], "Help Agent")(e, t);
|
|
72
|
-
async function H(e, t) {
|
|
73
|
-
const r = new E(u, { handleToolErrors: !1 });
|
|
74
|
-
try {
|
|
75
|
-
const s = e.helpInternalState.toolCallMessage;
|
|
76
|
-
if (!s)
|
|
77
|
-
throw new Error("helpToolCalling: missing helpInternalState.toolCallMessage");
|
|
78
|
-
const a = (await r.invoke({ messages: [s] }, t)).messages.map((o) => o.text).join(`
|
|
79
|
-
`);
|
|
80
|
-
return await m({ text: `Finished executing help tool: ${a}` }, t), {
|
|
81
|
-
...e,
|
|
82
|
-
outputMessage: a,
|
|
83
|
-
status: "success",
|
|
84
|
-
summary: a ? y(a) : "Help executed.",
|
|
85
|
-
helpInternalState: {
|
|
86
|
-
...e.helpInternalState,
|
|
87
|
-
toolCallMessage: void 0
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
} catch (s) {
|
|
91
|
-
const l = s instanceof Error ? s.message : String(s);
|
|
92
|
-
return await m({ text: `Help tool execution failed: ${l}` }, t), {
|
|
93
|
-
...e,
|
|
94
|
-
outputMessage: `Help tool execution failed: ${l}`,
|
|
95
|
-
status: "failed",
|
|
96
|
-
summary: `Help tool execution failed: ${l}`,
|
|
97
|
-
helpInternalState: {
|
|
98
|
-
...e.helpInternalState,
|
|
99
|
-
toolCallMessage: void 0
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
const b = () => new d(c).addNode("requireHelpServices", C).addNode("agent", _).addNode("tools", H).addEdge(g, "requireHelpServices").addEdge("requireHelpServices", "agent").addConditionalEdges("agent", (t) => t.helpInternalState.toolCallMessage ? "tools" : i).addEdge("tools", i), M = String.raw`- **help** — Enables users to ask questions about the map, layers, fields, and it's capabilities.
|
|
105
|
-
|
|
106
|
-
_Example: “Tell me about this map”_
|
|
107
|
-
_Example: “List all layers in this map”_
|
|
108
|
-
_Example: “List fields in protected areas layer”_
|
|
109
|
-
_Example: “What agents are available to me?”_
|
|
110
|
-
_Example: “What can you do?”_
|
|
111
|
-
_Example: “What can I ask”_
|
|
112
|
-
|
|
113
|
-
Even if the user asks unrelated queries like "What are the vowels in English alphabet" or "How to cook", call this agent.
|
|
114
|
-
|
|
115
|
-
IF the user asks map related queries, but those that are not performed by any of the agents, call this agent so we can respond accordingly.
|
|
116
|
-
_Example: "Create a chart"_
|
|
117
|
-
_Example: "Create a table"_`, G = {
|
|
118
|
-
id: "help",
|
|
119
|
-
name: "Help Agent",
|
|
120
|
-
description: M,
|
|
121
|
-
createGraph: b,
|
|
122
|
-
workspace: c
|
|
123
|
-
};
|
|
124
|
-
export {
|
|
125
|
-
G as H
|
|
126
|
-
};
|