@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
|
@@ -1,56 +1,171 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
4
|
-
import
|
|
5
|
-
import { whenOnce as
|
|
6
|
-
import
|
|
7
|
-
import { LitElement as
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import { c as x } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as L, html as g } from "lit";
|
|
4
|
+
import T from "@arcgis/core/core/Collection.js";
|
|
5
|
+
import { whenOnce as R, watch as D, when as M } from "@arcgis/core/core/reactiveUtils.js";
|
|
6
|
+
import O from "@arcgis/core/portal/Portal.js";
|
|
7
|
+
import { LitElement as U, createEvent as d, nothing as _ } from "@arcgis/lumina";
|
|
8
|
+
import * as B from "@arcgis/toolkit/log";
|
|
9
|
+
import { rethrowError as z } from "@arcgis/toolkit/log";
|
|
10
|
+
import { createRef as w, ref as k } from "lit/directives/ref.js";
|
|
11
|
+
import { u as q } from "../../chunks/useT9n.js";
|
|
12
|
+
import { O as N } from "../../chunks/orchestrator.js";
|
|
12
13
|
import "@langchain/core/callbacks/dispatch/web";
|
|
13
14
|
import "@langchain/core/prompts";
|
|
14
15
|
import "@langchain/openai";
|
|
15
|
-
import
|
|
16
|
+
import "@arcgis/core/request.js";
|
|
17
|
+
import V from "@arcgis/core/identity/IdentityManager.js";
|
|
18
|
+
import "@arcgis/toolkit/string";
|
|
16
19
|
import "@arcgis/core/config.js";
|
|
17
20
|
import "@langchain/core/messages";
|
|
18
21
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
19
22
|
import "../../chunks/generateLayerDescriptions.js";
|
|
20
23
|
import "@langchain/langgraph/web";
|
|
21
|
-
import
|
|
22
|
-
import { property as b, subclass as
|
|
23
|
-
import {
|
|
24
|
-
import { g as
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return i && r && H(t, e, r), r;
|
|
30
|
-
};
|
|
31
|
-
const q = async (c) => await new Promise((t) => setTimeout(t, c));
|
|
32
|
-
async function* F(c, {
|
|
33
|
-
chunkSize: t = 5,
|
|
34
|
-
// chars per "token"
|
|
35
|
-
delay: e = 20
|
|
36
|
-
// ms between chunks
|
|
37
|
-
} = {}) {
|
|
38
|
-
let i = 0;
|
|
39
|
-
for (; i < c.length; )
|
|
40
|
-
yield c.slice(i, i + t), i += t, await q(e);
|
|
24
|
+
import F from "@arcgis/core/core/Accessor.js";
|
|
25
|
+
import { property as b, subclass as j } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
26
|
+
import { marked as $ } from "marked";
|
|
27
|
+
import { g as H } from "../../chunks/utils3.js";
|
|
28
|
+
import { g as I } from "../../chunks/slottableRequestUtils.js";
|
|
29
|
+
const W = L`:host{display:block;width:var(--arcgis-internal-panel-width, 100%);height:var(--arcgis-internal-expand-max-height, 100%);--calcite-panel-content-bottom-space: 0}.footer-container{display:flex;flex-direction:column;flex:1 1 0;gap:var(--calcite-spacing-md)}.content-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0;position:relative;overflow:auto}.suggested-prompts-container{display:flex;justify-content:center;width:100%;background:var(--calcite-panel-background-color, var(--calcite-color-background))}.suggested-prompts{display:block;padding:var(--calcite-spacing-md);max-width:100%;box-sizing:border-box}.error-notice{padding:var(--calcite-spacing-sm)}.interrupt-waiting-message{font-style:italic;color:var(--calcite-color-text-2)}`;
|
|
30
|
+
function E(o) {
|
|
31
|
+
return o.trim() ? $.lexer(o).filter((t) => t.type !== "space").map((t) => $.parser([t])) : [];
|
|
41
32
|
}
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
class A {
|
|
34
|
+
constructor() {
|
|
35
|
+
this._stableParts = [], this._stableText = "", this._rawText = "";
|
|
36
|
+
}
|
|
37
|
+
// full streamed markdown so far
|
|
38
|
+
// Add one chunk and return all current segments.
|
|
39
|
+
push(t) {
|
|
40
|
+
return this._rawText += t, this._advanceStableBoundary(), this.getParts();
|
|
41
|
+
}
|
|
42
|
+
// Parse the remaining live tail. Call once at stream end.
|
|
43
|
+
finalize() {
|
|
44
|
+
const t = this._rawText.slice(this._stableText.length);
|
|
45
|
+
return t.trim() && (this._stableParts.push(...E(t)), this._stableText = this._rawText), this._stableParts;
|
|
46
|
+
}
|
|
47
|
+
// Get full output: stable segments + current live tail.
|
|
48
|
+
getParts() {
|
|
49
|
+
const t = this._trimIncompleteTail(this._rawText.slice(this._stableText.length)), e = t.trim() ? E(t) : [];
|
|
50
|
+
return [...this._stableParts, ...e];
|
|
51
|
+
}
|
|
52
|
+
reset() {
|
|
53
|
+
this._stableParts = [], this._stableText = "", this._rawText = "";
|
|
54
|
+
}
|
|
55
|
+
// Move parse-safe content from live tail into stable content.
|
|
56
|
+
_advanceStableBoundary() {
|
|
57
|
+
const t = this._rawText.slice(this._stableText.length), e = this._lastSafeBoundary(t);
|
|
58
|
+
if (e <= 0)
|
|
59
|
+
return;
|
|
60
|
+
const i = t.slice(0, e);
|
|
61
|
+
this._stableParts.push(...E(i)), this._stableText += i;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Find the last blank-line boundary that is outside code fences.
|
|
65
|
+
* Returns 0 if no safe boundary is available yet.
|
|
66
|
+
*/
|
|
67
|
+
_lastSafeBoundary(t) {
|
|
68
|
+
const e = t.split(`
|
|
69
|
+
`);
|
|
70
|
+
let i = !1, r = 0, s = 0;
|
|
71
|
+
for (const l of e)
|
|
72
|
+
/^\s*(```|~~~)/u.test(l) && (i = !i), s += l.length + 1, l.trim() === "" && !i && (r = s);
|
|
73
|
+
return r < t.length ? r : 0;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Remove incomplete syntax at the end so we do not render partial markup.
|
|
77
|
+
* Handles:
|
|
78
|
+
* - open HTML tags without closing '>'
|
|
79
|
+
* - HTML elements missing closing tags
|
|
80
|
+
* - markdown links missing closing ')'
|
|
81
|
+
*/
|
|
82
|
+
_trimIncompleteTail(t) {
|
|
83
|
+
const e = t.lastIndexOf("<");
|
|
84
|
+
if (e !== -1 && !t.includes(">", e))
|
|
85
|
+
return t.slice(0, e);
|
|
86
|
+
const i = this._earliestUnclosedTag(t);
|
|
87
|
+
if (i !== -1)
|
|
88
|
+
return t.slice(0, i);
|
|
89
|
+
const r = t.lastIndexOf("[");
|
|
90
|
+
if (r !== -1) {
|
|
91
|
+
const s = t.slice(r);
|
|
92
|
+
if (!/\[[^\]]*\]\([^)]*\)/u.test(s))
|
|
93
|
+
return t.slice(0, r);
|
|
94
|
+
}
|
|
95
|
+
return t;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Return the index of the earliest unclosed opening tag, or -1.
|
|
99
|
+
* Ignores void elements (img, br, input, etc.) and self-closing tags.
|
|
100
|
+
*/
|
|
101
|
+
_earliestUnclosedTag(t) {
|
|
102
|
+
const e = /* @__PURE__ */ new Set([
|
|
103
|
+
"br",
|
|
104
|
+
"img",
|
|
105
|
+
"hr",
|
|
106
|
+
"input",
|
|
107
|
+
"meta",
|
|
108
|
+
"link",
|
|
109
|
+
"area",
|
|
110
|
+
"base",
|
|
111
|
+
"col",
|
|
112
|
+
"embed",
|
|
113
|
+
"source",
|
|
114
|
+
"track",
|
|
115
|
+
"wbr"
|
|
116
|
+
]), i = /<(\/?)([a-zA-Z][\w-]*)\b[^>]*?(\/?)>/gu, r = [];
|
|
117
|
+
for (let s = i.exec(t); s; s = i.exec(t)) {
|
|
118
|
+
const [, l, a, n] = s, c = a.toLowerCase();
|
|
119
|
+
if (!(e.has(c) || n === "/"))
|
|
120
|
+
if (l === "/") {
|
|
121
|
+
for (let h = r.length - 1; h >= 0; h--)
|
|
122
|
+
if (r[h].name === c) {
|
|
123
|
+
r.splice(h);
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
} else
|
|
127
|
+
r.push({ name: c, index: s.index });
|
|
128
|
+
}
|
|
129
|
+
return r.length ? r[0].index : -1;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
function G(o) {
|
|
133
|
+
const t = new A();
|
|
134
|
+
return t.push(o), t.finalize();
|
|
135
|
+
}
|
|
136
|
+
const Z = async (o) => await new Promise((t) => setTimeout(t, o));
|
|
137
|
+
async function* J(o, { chunkSize: t = 15, delay: e = 50 } = {}) {
|
|
138
|
+
const i = new A();
|
|
139
|
+
for (let r = 0; r < o.length; r += t)
|
|
140
|
+
yield i.push(o.slice(r, r + t)), await Z(e);
|
|
141
|
+
yield i.finalize();
|
|
142
|
+
}
|
|
143
|
+
var K = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, m = (o, t, e, i) => {
|
|
144
|
+
for (var r = i > 1 ? void 0 : i ? Q(t, e) : t, s = o.length - 1, l; s >= 0; s--)
|
|
145
|
+
(l = o[s]) && (r = (i ? l(t, e, r) : l(r)) || r);
|
|
146
|
+
return i && r && K(t, e, r), r;
|
|
147
|
+
};
|
|
148
|
+
const S = (o) => !o || typeof o != "object" ? !1 : o.name === "AbortError";
|
|
149
|
+
async function* C(o, t, e, i, r = !1) {
|
|
150
|
+
if (r) {
|
|
44
151
|
if (i?.aborted) {
|
|
45
152
|
yield { type: "cancelled", log: e, runId: t };
|
|
46
153
|
return;
|
|
47
154
|
}
|
|
48
|
-
yield { type: "block-data", blockType: "text", data: {
|
|
155
|
+
yield { type: "block-data", blockType: "text", data: { parts: G(o) }, runId: t };
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
for await (const s of J(o)) {
|
|
159
|
+
if (i?.aborted) {
|
|
160
|
+
yield { type: "cancelled", log: e, runId: t };
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
yield { type: "block-data", blockType: "text", data: { parts: s }, runId: t };
|
|
49
164
|
}
|
|
50
165
|
}
|
|
51
|
-
let
|
|
52
|
-
constructor(
|
|
53
|
-
super(
|
|
166
|
+
let p = class extends F {
|
|
167
|
+
constructor(o) {
|
|
168
|
+
super(o), this.view = null, this.streamingDisabled = !1, this.runtimeEventsEnabled = !1, this.loading = !1, this.processing = !1, this.processingStep = "";
|
|
54
169
|
}
|
|
55
170
|
async load() {
|
|
56
171
|
this._set("loading", !0);
|
|
@@ -64,14 +179,15 @@ let d = class extends N {
|
|
|
64
179
|
this.orchestrator?.dispose(), super.destroy();
|
|
65
180
|
}
|
|
66
181
|
async _initialize() {
|
|
67
|
-
this.removeHandles(), await Promise.all([this.portal.load(), this.view?.when()]), this.view && await
|
|
182
|
+
this.removeHandles(), await Promise.all([this.portal.load(), this.view?.when()]), this.view && await R(() => !this.view.updating), this._set(
|
|
68
183
|
"orchestrator",
|
|
69
|
-
await
|
|
184
|
+
await N.init({
|
|
70
185
|
agents: [...this.agents],
|
|
186
|
+
runtimeEventsEnabled: this.runtimeEventsEnabled,
|
|
71
187
|
view: this.view ?? void 0
|
|
72
188
|
})
|
|
73
189
|
), this.addHandles([
|
|
74
|
-
|
|
190
|
+
D(
|
|
75
191
|
() => [this.view, this.agents],
|
|
76
192
|
() => {
|
|
77
193
|
this._initialize();
|
|
@@ -82,85 +198,95 @@ let d = class extends N {
|
|
|
82
198
|
clearChatHistory() {
|
|
83
199
|
this.orchestrator?.newConversation();
|
|
84
200
|
}
|
|
85
|
-
async *ask(
|
|
201
|
+
async *ask(o, t, e) {
|
|
86
202
|
if (!this.orchestrator)
|
|
87
203
|
throw new Error("Orchestrator not initialized yet.");
|
|
88
204
|
this._set("processing", !0), this._set("processingStep", "");
|
|
89
|
-
const
|
|
90
|
-
let
|
|
205
|
+
const i = [];
|
|
206
|
+
let r, s = "pending";
|
|
91
207
|
try {
|
|
92
|
-
const
|
|
93
|
-
for await (const
|
|
94
|
-
|
|
95
|
-
|
|
208
|
+
const l = this.orchestrator.ask(o, t);
|
|
209
|
+
for await (const a of l)
|
|
210
|
+
switch (s = a.runId, a.type) {
|
|
211
|
+
case "runtime": {
|
|
212
|
+
yield { type: "runtime", event: a, runId: s };
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
96
215
|
case "trace": {
|
|
97
|
-
this._set("processingStep",
|
|
216
|
+
this._set("processingStep", a.data.text), i.push(a.data.text);
|
|
98
217
|
break;
|
|
99
218
|
}
|
|
100
219
|
case "completed": {
|
|
101
220
|
this._set("processing", !1), this._set("processingStep", "");
|
|
102
|
-
const
|
|
103
|
-
if (!
|
|
104
|
-
yield { type: "completed", error: "No response received.", log:
|
|
221
|
+
const n = a.result, c = !!n.content.length, h = !!r?.length;
|
|
222
|
+
if (!c && !h) {
|
|
223
|
+
yield { type: "completed", error: "No response received.", log: i, runId: s };
|
|
105
224
|
return;
|
|
106
225
|
}
|
|
107
|
-
const
|
|
108
|
-
if (yield { type: "block-start", blockType: "text", runId: s }, yield*
|
|
109
|
-
for (const
|
|
110
|
-
if (
|
|
111
|
-
yield { type: "cancelled", log:
|
|
226
|
+
const u = n.content;
|
|
227
|
+
if (yield { type: "block-start", blockType: "text", runId: s }, yield* C(u, s, i, e, this.streamingDisabled), yield { type: "block-end", blockType: "text", runId: s }, h)
|
|
228
|
+
for (const y of r) {
|
|
229
|
+
if (e?.aborted) {
|
|
230
|
+
yield { type: "cancelled", log: i, runId: s };
|
|
112
231
|
return;
|
|
113
232
|
}
|
|
114
|
-
const { type:
|
|
115
|
-
if (yield { type: "block-start", blockType:
|
|
116
|
-
const
|
|
117
|
-
yield*
|
|
233
|
+
const { type: f, data: v } = y;
|
|
234
|
+
if (yield { type: "block-start", blockType: f, runId: s }, f === "text") {
|
|
235
|
+
const P = typeof v?.content == "string" ? v.content : "";
|
|
236
|
+
yield* C(P, s, i, e, this.streamingDisabled);
|
|
118
237
|
} else
|
|
119
|
-
yield { type: "block-data", blockType:
|
|
120
|
-
yield { type: "block-end", blockType:
|
|
238
|
+
yield { type: "block-data", blockType: f, data: v, runId: s };
|
|
239
|
+
yield { type: "block-end", blockType: f, runId: s };
|
|
121
240
|
}
|
|
122
|
-
yield { type: "completed", response:
|
|
241
|
+
yield { type: "completed", response: u, blocks: r, log: i, runId: s };
|
|
123
242
|
return;
|
|
124
243
|
}
|
|
125
244
|
case "ux-suggestion": {
|
|
126
|
-
const
|
|
127
|
-
|
|
245
|
+
const n = a.suggestion;
|
|
246
|
+
r = r ? [...r, n] : [n];
|
|
128
247
|
break;
|
|
129
248
|
}
|
|
130
249
|
case "interrupt": {
|
|
131
|
-
const { kind:
|
|
132
|
-
switch (
|
|
250
|
+
const { kind: n, message: c, metadata: h } = a.interrupt, u = Array.isArray(h) ? h.filter((f) => typeof f == "string") : [], y = (() => {
|
|
251
|
+
switch (n) {
|
|
133
252
|
case "booleanChoice":
|
|
134
|
-
return { type: "boolean-choice", message:
|
|
253
|
+
return { type: "boolean-choice", message: c, options: u };
|
|
135
254
|
case "singleSelection":
|
|
136
|
-
return { type: "single-select", message:
|
|
255
|
+
return { type: "single-select", message: c, options: u };
|
|
137
256
|
case "multipleSelection":
|
|
138
|
-
return { type: "multi-select", message:
|
|
257
|
+
return { type: "multi-select", message: c, options: u };
|
|
139
258
|
case "textInput":
|
|
140
|
-
return { type: "text-input", message:
|
|
259
|
+
return { type: "text-input", message: c };
|
|
141
260
|
default:
|
|
142
|
-
return { type:
|
|
261
|
+
return { type: n, message: c, options: u };
|
|
143
262
|
}
|
|
144
263
|
})();
|
|
145
|
-
this._set("processingStep", "Waiting for user input..."), yield { type: "interrupt", payload:
|
|
264
|
+
this._set("processingStep", "Waiting for user input..."), yield { type: "interrupt", payload: y, runId: s };
|
|
146
265
|
break;
|
|
147
266
|
}
|
|
148
267
|
case "cancelled": {
|
|
149
|
-
yield { type: "cancelled", log:
|
|
268
|
+
yield { type: "cancelled", log: i, runId: s };
|
|
150
269
|
return;
|
|
151
270
|
}
|
|
152
271
|
case "error": {
|
|
153
|
-
|
|
272
|
+
if (e?.aborted || S(a.error)) {
|
|
273
|
+
yield { type: "cancelled", log: i, runId: s };
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
yield { type: "completed", error: a.error.message, log: i, runId: s };
|
|
154
277
|
return;
|
|
155
278
|
}
|
|
156
279
|
default: {
|
|
157
|
-
console.warn("Unknown event type:",
|
|
280
|
+
console.warn("Unknown event type:", a);
|
|
158
281
|
break;
|
|
159
282
|
}
|
|
160
283
|
}
|
|
284
|
+
} catch (l) {
|
|
285
|
+
if (e?.aborted || S(l)) {
|
|
286
|
+
yield { type: "cancelled", log: i, runId: s };
|
|
287
|
+
return;
|
|
161
288
|
}
|
|
162
|
-
|
|
163
|
-
console.warn("Error during message processing:", r), yield { type: "completed", error: "An error occurred during message processing.", log: e, runId: "error" };
|
|
289
|
+
console.warn("Error during message processing:", l), yield { type: "completed", error: "An error occurred during message processing.", log: i, runId: "error" };
|
|
164
290
|
return;
|
|
165
291
|
} finally {
|
|
166
292
|
this._set("processing", !1);
|
|
@@ -172,34 +298,40 @@ let d = class extends N {
|
|
|
172
298
|
};
|
|
173
299
|
m([
|
|
174
300
|
b({ readOnly: !0 })
|
|
175
|
-
],
|
|
301
|
+
], p.prototype, "orchestrator", 2);
|
|
302
|
+
m([
|
|
303
|
+
b()
|
|
304
|
+
], p.prototype, "agents", 2);
|
|
305
|
+
m([
|
|
306
|
+
b()
|
|
307
|
+
], p.prototype, "portal", 2);
|
|
176
308
|
m([
|
|
177
309
|
b()
|
|
178
|
-
],
|
|
310
|
+
], p.prototype, "view", 2);
|
|
179
311
|
m([
|
|
180
312
|
b()
|
|
181
|
-
],
|
|
313
|
+
], p.prototype, "streamingDisabled", 2);
|
|
182
314
|
m([
|
|
183
315
|
b()
|
|
184
|
-
],
|
|
316
|
+
], p.prototype, "runtimeEventsEnabled", 2);
|
|
185
317
|
m([
|
|
186
318
|
b({ readOnly: !0 })
|
|
187
|
-
],
|
|
319
|
+
], p.prototype, "loading", 2);
|
|
188
320
|
m([
|
|
189
321
|
b({ readOnly: !0 })
|
|
190
|
-
],
|
|
322
|
+
], p.prototype, "processing", 2);
|
|
191
323
|
m([
|
|
192
324
|
b({ readOnly: !0 })
|
|
193
|
-
],
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
],
|
|
197
|
-
const
|
|
198
|
-
class
|
|
325
|
+
], p.prototype, "processingStep", 2);
|
|
326
|
+
p = m([
|
|
327
|
+
j("OrchestratorController")
|
|
328
|
+
], p);
|
|
329
|
+
const X = "Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.", Y = "Embeddings not found for this web map.", tt = "https://developers.arcgis.com/javascript/latest/agentic-apps/ai-webmap-setup/#embeddings";
|
|
330
|
+
class et extends U {
|
|
199
331
|
constructor() {
|
|
200
|
-
super(...arguments), this._messages =
|
|
332
|
+
super(...arguments), this._messages = q({ blocking: !0 }), this.#t = w(), this.#o = w(), this.#s = w(), this.#e = null, this.#r = /* @__PURE__ */ new Map(), this.#i = O.getDefault(), this.#a = (t) => {
|
|
201
333
|
t.stopPropagation(), this.cancelInterrupt();
|
|
202
|
-
}, this.#
|
|
334
|
+
}, this.#n = (t) => {
|
|
203
335
|
t.stopPropagation();
|
|
204
336
|
const e = t.detail;
|
|
205
337
|
this.submitInterrupt(e);
|
|
@@ -217,46 +349,35 @@ class Y extends R {
|
|
|
217
349
|
t.stopPropagation();
|
|
218
350
|
const e = t.detail;
|
|
219
351
|
this.arcgisFeedback.emit(e);
|
|
220
|
-
}, this.#
|
|
352
|
+
}, this.#g = (t) => {
|
|
221
353
|
t.stopPropagation();
|
|
222
354
|
const e = t.detail;
|
|
223
355
|
this._inputValue = e.prompt, this.arcgisPromptSelect.emit(e);
|
|
224
|
-
}, this.#
|
|
356
|
+
}, this.#u = (t) => {
|
|
225
357
|
this.arcgisSlottableRequest.emit(t.detail);
|
|
226
|
-
}, this._orchestratorController = null, this._interrupt = null, this._interruptDetails = [], this._error = null, this._inputValue = "", this._isAnswering = !1, this._canceling = !1, this.messages = new
|
|
358
|
+
}, this._orchestratorController = null, this._interrupt = null, this._interruptDetails = [], this._error = null, this._inputValue = "", this._isAnswering = !1, this._canceling = !1, this.messages = new T([]), this.referenceElement = null, this.suggestedPrompts = [], this.feedbackEnabled = !1, this.keepSuggestedPrompts = !1, this.streamingDisabled = !1, this.runtimeEventsEnabled = !1, this.logEnabled = !1, this.copyEnabled = !1, this.voiceInputEnabled = !1, this.readAloudEnabled = !1, this.assistantAvatarEnabled = !1, this.userAvatarEnabled = !1, this.arcgisCancel = d(), this.arcgisError = d(), this.arcgisFeedback = d(), this.arcgisInterrupt = d(), this.arcgisInterruptCancel = d(), this.arcgisInterruptSubmit = d(), this.arcgisPromptSelect = d(), this.arcgisReady = d(), this.arcgisResponse = d(), this.arcgisRuntime = d({ bubbles: !1, composed: !1 }), this.arcgisSlottableRequest = d({ bubbles: !1, composed: !1 }), this.arcgisSubmit = d();
|
|
227
359
|
}
|
|
228
360
|
static {
|
|
229
|
-
this.properties = { _orchestratorController: 16, _interrupt: 16, _interruptDetails: 16, _error: 16, _inputValue: 16, _isAnswering: 16, _canceling: 16, _user: 16, awaitingResponse: 32, awaitingResponseStep: 32, interrupt: 32, messages: 0, orchestrator: 32, entryMessage: 1, heading: 1, description: 1, referenceElement: 1, suggestedPrompts: 0, feedbackEnabled: 5, keepSuggestedPrompts: 5, logEnabled: 5, copyEnabled: 5, voiceInputEnabled: 5, readAloudEnabled: 5, assistantAvatarEnabled: 5 };
|
|
361
|
+
this.properties = { _orchestratorController: 16, _interrupt: 16, _interruptDetails: 16, _error: 16, _inputValue: 16, _isAnswering: 16, _signedInUserId: 16, _canceling: 16, _isSignedIn: 16, _user: 16, awaitingResponse: 32, awaitingResponseStep: 32, interrupt: 32, messages: 0, orchestrator: 32, entryMessage: 1, heading: 1, description: 1, referenceElement: 1, alwaysUseAgentId: 1, allowedAgentIds: 0, suggestedPrompts: 0, feedbackEnabled: 5, keepSuggestedPrompts: 5, streamingDisabled: 5, runtimeEventsEnabled: 5, logEnabled: 5, copyEnabled: 5, voiceInputEnabled: 5, readAloudEnabled: 5, assistantAvatarEnabled: 5, userAvatarEnabled: 5 };
|
|
230
362
|
}
|
|
231
363
|
static {
|
|
232
|
-
this.styles =
|
|
364
|
+
this.styles = W;
|
|
233
365
|
}
|
|
234
366
|
#t;
|
|
235
|
-
#
|
|
367
|
+
#o;
|
|
236
368
|
#s;
|
|
237
369
|
#e;
|
|
238
|
-
#o;
|
|
239
|
-
#i;
|
|
240
370
|
#r;
|
|
371
|
+
#i;
|
|
241
372
|
#a;
|
|
373
|
+
#n;
|
|
242
374
|
#l;
|
|
243
375
|
#c;
|
|
244
376
|
#h;
|
|
245
|
-
#p;
|
|
246
377
|
#g;
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
await t?.componentOnReady();
|
|
251
|
-
const e = [...this.#o.values()];
|
|
252
|
-
return e.length ? (this._orchestratorController = new d({
|
|
253
|
-
agents: e,
|
|
254
|
-
portal: this.#i,
|
|
255
|
-
view: t?.view
|
|
256
|
-
}), await this._orchestratorController.load(), !0) : (this._error = "No agents found.", !1);
|
|
257
|
-
} catch (t) {
|
|
258
|
-
return this._error = t?.message ?? "Error initializing orchestrator.", O(this)(t), !1;
|
|
259
|
-
}
|
|
378
|
+
#u;
|
|
379
|
+
get _isSignedIn() {
|
|
380
|
+
return !!this.#i?.user || !!this._signedInUserId;
|
|
260
381
|
}
|
|
261
382
|
get _user() {
|
|
262
383
|
return this.#i?.user?.fullName || this.#i?.user?.username;
|
|
@@ -273,14 +394,17 @@ class Y extends R {
|
|
|
273
394
|
get orchestrator() {
|
|
274
395
|
return this._orchestratorController?.orchestrator;
|
|
275
396
|
}
|
|
276
|
-
async clearChatHistory() {
|
|
277
|
-
this._reset(), this._orchestratorController?.clearChatHistory();
|
|
278
|
-
}
|
|
279
397
|
cancelInterrupt() {
|
|
280
398
|
this.arcgisInterruptCancel.emit(), this.orchestrator?.cancelInterrupt(), this._interrupt = null;
|
|
281
399
|
}
|
|
400
|
+
async clearChatHistory() {
|
|
401
|
+
this._reset(), this._orchestratorController?.clearChatHistory();
|
|
402
|
+
}
|
|
282
403
|
register(t) {
|
|
283
|
-
this.#
|
|
404
|
+
this.#r.set(t.agent.id, t), this._orchestratorController && this.#d();
|
|
405
|
+
}
|
|
406
|
+
submitInterrupt(t) {
|
|
407
|
+
this.arcgisInterruptSubmit.emit(t), this._interrupt && (this._interruptDetails = [...this._interruptDetails, { interrupt: this._interrupt, response: t }]), this.orchestrator?.resumeInterrupt(t), this._interrupt = null;
|
|
284
408
|
}
|
|
285
409
|
async submitMessage(t) {
|
|
286
410
|
const e = t.trim();
|
|
@@ -291,140 +415,164 @@ class Y extends R {
|
|
|
291
415
|
content: e
|
|
292
416
|
}), !this._orchestratorController))
|
|
293
417
|
return;
|
|
294
|
-
this.#e = new AbortController();
|
|
295
|
-
const i = this._orchestratorController.ask(e, this.#e?.signal);
|
|
296
|
-
for await (const
|
|
297
|
-
const
|
|
298
|
-
switch (
|
|
418
|
+
this.#e = new AbortController(), this._orchestratorController.streamingDisabled = this.streamingDisabled;
|
|
419
|
+
const i = this.alwaysUseAgentId ? { routing: "direct", agentId: this.alwaysUseAgentId } : { routing: "auto", agentIds: this.allowedAgentIds }, r = this._orchestratorController.ask(e, i, this.#e?.signal);
|
|
420
|
+
for await (const s of r) {
|
|
421
|
+
const l = s.runId, a = this.messages.at(-1);
|
|
422
|
+
switch (s.type) {
|
|
423
|
+
case "runtime":
|
|
424
|
+
this.arcgisRuntime.emit(s.event);
|
|
425
|
+
break;
|
|
299
426
|
case "block-start": {
|
|
300
427
|
this._isAnswering = !0;
|
|
301
|
-
const
|
|
302
|
-
if (
|
|
303
|
-
const
|
|
304
|
-
this.messages.splice(-1, 1, { ...
|
|
428
|
+
const n = { type: s.blockType, isPending: !0 };
|
|
429
|
+
if (a?.role === "assistant" && a.id === l) {
|
|
430
|
+
const c = [...a.blocks ?? [], n];
|
|
431
|
+
this.messages.splice(-1, 1, { ...a, blocks: c });
|
|
305
432
|
} else
|
|
306
433
|
this.messages.push({
|
|
307
434
|
role: "assistant",
|
|
308
|
-
blocks: [
|
|
309
|
-
id:
|
|
435
|
+
blocks: [n],
|
|
436
|
+
id: l,
|
|
310
437
|
isStreaming: !0,
|
|
311
438
|
interrupts: this._interruptDetails
|
|
312
439
|
}), this._interruptDetails = [];
|
|
313
440
|
break;
|
|
314
441
|
}
|
|
315
442
|
case "block-data": {
|
|
316
|
-
if (
|
|
443
|
+
if (a?.role !== "assistant" || a?.id !== l)
|
|
317
444
|
break;
|
|
318
|
-
const
|
|
319
|
-
if (
|
|
445
|
+
const n = [...a.blocks ?? []], c = n[n.length - 1], { blockType: h, data: u } = s;
|
|
446
|
+
if (c?.type !== h || !c.isPending)
|
|
320
447
|
break;
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
448
|
+
h === "text" ? n[n.length - 1] = {
|
|
449
|
+
...c,
|
|
450
|
+
data: {
|
|
451
|
+
...c.data,
|
|
452
|
+
parts: u?.parts
|
|
453
|
+
}
|
|
454
|
+
} : n[n.length - 1] = { ...c, data: { ...c.data, ...u ?? {} } }, this.messages.splice(-1, 1, { ...a, blocks: n });
|
|
327
455
|
break;
|
|
328
456
|
}
|
|
329
457
|
case "block-end": {
|
|
330
|
-
if (
|
|
458
|
+
if (a?.role !== "assistant" || a?.id !== l)
|
|
331
459
|
break;
|
|
332
|
-
const
|
|
333
|
-
if (
|
|
460
|
+
const n = [...a.blocks ?? []], c = n[n.length - 1];
|
|
461
|
+
if (c?.type !== s.blockType || !c.isPending)
|
|
334
462
|
break;
|
|
335
|
-
const h =
|
|
336
|
-
|
|
463
|
+
const h = c;
|
|
464
|
+
n[n.length - 1] = { ...h, data: { ...h.data }, isPending: !1 }, this.messages.splice(-1, 1, { ...a, blocks: n });
|
|
337
465
|
break;
|
|
338
466
|
}
|
|
339
467
|
case "completed":
|
|
340
|
-
|
|
468
|
+
s.error ? (this.messages.push({
|
|
341
469
|
role: "assistant",
|
|
342
|
-
log:
|
|
343
|
-
error:
|
|
344
|
-
id:
|
|
470
|
+
log: s.log,
|
|
471
|
+
error: s.error,
|
|
472
|
+
id: l,
|
|
345
473
|
interrupts: this._interruptDetails
|
|
346
|
-
}), this._interruptDetails = []) :
|
|
347
|
-
...
|
|
348
|
-
content:
|
|
349
|
-
blocks:
|
|
474
|
+
}), this._interruptDetails = []) : a?.role === "assistant" && a.id === l && this.messages.splice(-1, 1, {
|
|
475
|
+
...a,
|
|
476
|
+
content: s.response,
|
|
477
|
+
blocks: a.blocks?.map((n) => ({ ...n, data: { ...n.data }, isPending: !1 })) ?? [],
|
|
350
478
|
isStreaming: !1,
|
|
351
|
-
log:
|
|
479
|
+
log: s.log
|
|
352
480
|
}), this._isAnswering = !1, this.#e = null, this._canceling = !1;
|
|
353
481
|
break;
|
|
354
482
|
case "interrupt":
|
|
355
|
-
this._interrupt = { ...
|
|
483
|
+
this._interrupt = { ...s.payload, id: l }, this.arcgisInterrupt.emit(this._interrupt);
|
|
356
484
|
break;
|
|
357
485
|
case "cancelled":
|
|
358
|
-
|
|
359
|
-
...
|
|
360
|
-
blocks:
|
|
486
|
+
a?.role === "assistant" && a.id === l ? this.messages.splice(-1, 1, {
|
|
487
|
+
...a,
|
|
488
|
+
blocks: a.blocks?.filter((n) => n.type === "text" || !n.isPending) ?? [],
|
|
361
489
|
isStreaming: !1,
|
|
362
|
-
log:
|
|
363
|
-
error:
|
|
364
|
-
// TODO: use strings from t9n
|
|
490
|
+
log: s.log,
|
|
491
|
+
error: `(${this._messages.stoppedByUserLabel})`
|
|
365
492
|
}) : (this.messages.push({
|
|
366
493
|
role: "assistant",
|
|
367
|
-
log:
|
|
368
|
-
error:
|
|
369
|
-
|
|
370
|
-
id: n,
|
|
494
|
+
log: s.log,
|
|
495
|
+
error: `(${this._messages.stoppedByUserLabel})`,
|
|
496
|
+
id: l,
|
|
371
497
|
interrupts: this._interruptDetails
|
|
372
498
|
}), this._interruptDetails = []), this._isAnswering = !1, this.#e = null, this._canceling = !1;
|
|
373
499
|
break;
|
|
374
500
|
}
|
|
375
501
|
}
|
|
376
502
|
}
|
|
377
|
-
|
|
378
|
-
this.
|
|
503
|
+
unregister(t) {
|
|
504
|
+
this.#r.delete(t), this._orchestratorController && this.#d();
|
|
379
505
|
}
|
|
380
506
|
load() {
|
|
381
507
|
this.manager.onLifecycle(this._reset.bind(this));
|
|
382
508
|
}
|
|
383
509
|
loaded() {
|
|
384
510
|
this.manager.onLifecycle(() => {
|
|
385
|
-
this.#t.value?.addEventListener("arcgisPromptSelect", this.#
|
|
386
|
-
const t =
|
|
511
|
+
this.#t.value?.addEventListener("arcgisPromptSelect", this.#g), this.#t.value?.addEventListener("arcgisSubmit", this.#l), this.#t.value?.addEventListener("arcgisCancel", this.#c), this.#t.value?.addEventListener("arcgisFeedback", this.#h);
|
|
512
|
+
const t = M(() => !!this._interrupt && !!this.#s.value, () => {
|
|
387
513
|
const i = this.#s.value;
|
|
388
|
-
i.removeEventListener("arcgisSubmit", this.#
|
|
514
|
+
i.removeEventListener("arcgisSubmit", this.#n), i.removeEventListener("arcgisCancel", this.#a), i.addEventListener("arcgisSubmit", this.#n, { once: !0 }), i.addEventListener("arcgisCancel", this.#a, { once: !0 });
|
|
389
515
|
}), e = this.messages.on("after-add", (i) => {
|
|
390
516
|
const r = i.item;
|
|
391
517
|
r.role === "assistant" && (r.error || r.content) && this.arcgisResponse.emit(r);
|
|
392
518
|
});
|
|
393
519
|
return queueMicrotask(() => {
|
|
394
|
-
this.#
|
|
395
|
-
i ? this.arcgisReady.emit() : this._error && this.arcgisError.emit(new Error(this._error));
|
|
396
|
-
});
|
|
520
|
+
this.#p();
|
|
397
521
|
}), () => {
|
|
398
|
-
t.remove(), e.remove(), this.#t.value?.removeEventListener("arcgisPromptSelect", this.#
|
|
522
|
+
t.remove(), e.remove(), this.#t.value?.removeEventListener("arcgisPromptSelect", this.#g), this.#s.value?.removeEventListener("arcgisSubmit", this.#n), this.#s.value?.removeEventListener("arcgisCancel", this.#a), this.#t.value?.removeEventListener("arcgisSubmit", this.#l), this.#t.value?.removeEventListener("arcgisCancel", this.#c), this.#t.value?.removeEventListener("arcgisFeedback", this.#h), this._orchestratorController?.destroy(), this._orchestratorController = null;
|
|
399
523
|
};
|
|
400
524
|
});
|
|
401
525
|
}
|
|
526
|
+
willUpdate(t) {
|
|
527
|
+
this.hasUpdated && t.has("runtimeEventsEnabled") && this._orchestratorController && (this._orchestratorController.destroy(), this._orchestratorController = null, this.#p());
|
|
528
|
+
}
|
|
529
|
+
async #d() {
|
|
530
|
+
try {
|
|
531
|
+
this._error = null;
|
|
532
|
+
const t = H(this.el, this.referenceElement);
|
|
533
|
+
await t?.componentOnReady();
|
|
534
|
+
const e = [...this.#r.values()];
|
|
535
|
+
return e.length ? (this._orchestratorController?.destroy(), this._orchestratorController = new p({
|
|
536
|
+
agents: e,
|
|
537
|
+
portal: this.#i,
|
|
538
|
+
runtimeEventsEnabled: this.runtimeEventsEnabled,
|
|
539
|
+
streamingDisabled: this.streamingDisabled,
|
|
540
|
+
view: t?.view
|
|
541
|
+
}), await this._orchestratorController.load(), this.requestUpdate(), !0) : (this._error = this._messages.noAgentsFoundMessage, !1);
|
|
542
|
+
} catch (t) {
|
|
543
|
+
return this._error = t?.message ?? this._messages.orchestratorInitializationErrorMessage, z(this)(t), !1;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
async #p() {
|
|
547
|
+
await this.#d() ? this.arcgisReady.emit() : this._error && this.arcgisError.emit(new Error(this._error));
|
|
548
|
+
}
|
|
402
549
|
_reset() {
|
|
403
|
-
this._orchestratorController?.cancel(), this.#e?.abort(), this._interrupt = null, this.messages.removeAll(), this._error = null, this._inputValue = "";
|
|
550
|
+
this._orchestratorController?.cancel(), this.#e?.abort(), this._interrupt = null, this.messages.removeAll(), this._error = null, this._inputValue = "", this._signedInUserId = void 0;
|
|
404
551
|
}
|
|
405
552
|
_renderEntryMessage() {
|
|
406
|
-
return
|
|
553
|
+
return this._isSignedIn ? this._error ? this._renderErrorNotice() : this.entryMessage ? this.messages.length > 0 ? null : g`<calcite-notice open kind=brand closable icon width=full><div slot=message>${this.entryMessage}</div></calcite-notice>` : g`<slot name=entry-message></slot>` : this._renderSignInNotice();
|
|
407
554
|
}
|
|
408
555
|
_renderSignInNotice() {
|
|
409
556
|
const t = this.#i;
|
|
410
|
-
return
|
|
557
|
+
return g`<calcite-notice slot=entry-message open kind=brand icon width=full><div slot=message>${this._messages.signInRequiredMessage}</div>${t ? g`<calcite-link slot=link @click=${async () => {
|
|
411
558
|
try {
|
|
412
|
-
await
|
|
559
|
+
const e = await V.getCredential(`${t.url}/sharing`);
|
|
560
|
+
this._signedInUserId = e.userId, this._error = null, this.requestUpdate(), await this.#p();
|
|
413
561
|
} catch (e) {
|
|
414
|
-
|
|
562
|
+
this._error = e?.message ?? this._messages.signInErrorMessage, this.arcgisError.emit(new Error(this._error)), B.log("error", this, "Error signing in:", { detail: { error: e } });
|
|
415
563
|
}
|
|
416
|
-
}} target=_blank title
|
|
564
|
+
}} target=_blank title=${this._messages.signInToArcGISOnlineLabel ?? _}>${this._messages.signInLabel}</calcite-link>` : g`<div slot=link>${this._messages.noPortalInformationMessage}</div>`}</calcite-notice>`;
|
|
417
565
|
}
|
|
418
566
|
_renderErrorNotice() {
|
|
419
|
-
return this._error ?
|
|
567
|
+
return this._error ? g`<calcite-notice slot=entry-message open kind=brand icon width=full>${this._error === X ? g`<div slot=message>${Y}</div><calcite-link slot=link .href=${tt} target=_blank title=${this._messages.learnAboutWebMapEmbeddingsLabel ?? _}>${this._messages.readMoreLabel}</calcite-link>` : g`<div slot=message>${this._error}</div>`}</calcite-notice>` : null;
|
|
420
568
|
}
|
|
421
569
|
render() {
|
|
422
|
-
return
|
|
423
|
-
this.#
|
|
570
|
+
return g`<calcite-panel .loading=${!this._orchestratorController && !this._error || this._orchestratorController?.loading} .heading=${this.heading ?? this._messages.assistantLabel} .description=${this.description} ${k(this.#t)}><slot name=header-actions-start slot=header-actions-start></slot><slot name=header-actions-end slot=header-actions-end></slot><div class="content-container"><arcgis-assistant-chat .loading=${this.awaitingResponse} .messages=${this.messages} .interrupt=${this._interrupt}><slot name=message-starter slot=message-starter></slot><slot name=messages slot=messages>${this.messages.map((t) => t.role === "assistant" ? g`<arcgis-assistant-message .message=${t} .feedbackEnabled=${this.feedbackEnabled} .logEnabled=${this.logEnabled} .copyEnabled=${this.copyEnabled} .readAloudEnabled=${this.readAloudEnabled} @arcgisSlottableRequest=${this.#u} .assistantAvatarEnabled=${this.assistantAvatarEnabled}>${t.blocks?.map((e, i) => g`<slot name=${I(t.id, i) ?? _} slot=${I(t.id, i) ?? _}><arcgis-assistant-message-block .block=${e}></arcgis-assistant-message-block></slot>`)}</arcgis-assistant-message>` : g`<arcgis-assistant-user-message .message=${t} .user=${this._user} .userAvatarEnabled=${this.userAvatarEnabled}></arcgis-assistant-user-message>`)}</slot>${this._interrupt ? g`<div slot=message-loading><div class="interrupt-waiting-message">${this._messages.waitingForUserInputMessage}</div></div>` : g`<slot name=message-loading slot=message-loading><arcgis-assistant-message-loading .loading=${this.awaitingResponse} .loadingMessage=${this.awaitingResponseStep} .assistantAvatarEnabled=${this.assistantAvatarEnabled} .interrupts=${this._interruptDetails}></arcgis-assistant-message-loading></slot>`}</arcgis-assistant-chat></div>${this._interrupt ? g`<slot name=interrupt><arcgis-assistant-interrupt slot=content-bottom .type=${this._interrupt.type} .message=${this._interrupt.message} .options=${this._interrupt.options} ${k(this.#s)}></arcgis-assistant-interrupt></slot>` : this.suggestedPrompts?.length ? g`<div class="suggested-prompts-container" slot=content-bottom><arcgis-assistant-suggested-prompts class="suggested-prompts" .prompts=${this.suggestedPrompts}></arcgis-assistant-suggested-prompts></div>` : null}<div class="footer-container" slot=footer>${this._renderEntryMessage()}<slot name=chat-entry><arcgis-assistant-chat-entry .awaitingResponse=${this.awaitingResponse || this._isAnswering} .inputValue=${this._inputValue} .messages=${this.messages} .voiceInputEnabled=${this.voiceInputEnabled} .disabled=${this._canceling || !this._isSignedIn || !!this._interrupt || !!this._error} ${k(this.#o)}><slot name=entry-actions-start slot=entry-actions-start></slot><slot name=entry-actions-end slot=entry-actions-end><calcite-button .iconStart=${this.awaitingResponse || this._isAnswering ? "circle-stop" : "send"} @click=${() => {
|
|
571
|
+
this.#o.value?.submitMessage();
|
|
424
572
|
}} round>${this.awaitingResponse || this._isAnswering ? this._messages.stopButtonLabel : this._messages.askButtonLabel}</calcite-button></slot></arcgis-assistant-chat-entry></slot><slot name=footer-content></slot></div></calcite-panel>`;
|
|
425
573
|
}
|
|
426
574
|
}
|
|
427
|
-
|
|
575
|
+
x("arcgis-assistant", et);
|
|
428
576
|
export {
|
|
429
|
-
|
|
577
|
+
et as ArcgisAssistant
|
|
430
578
|
};
|