@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,48 +1,137 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
const
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
const n = `# ArcGIS Knowledge Agent — Action Summary
|
|
3
3
|
|
|
4
|
-
You are a
|
|
4
|
+
You are a Knowledge Graph assistant that has executed tool calls to answer a user request.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
## Context
|
|
7
7
|
|
|
8
|
+
**Data model**
|
|
8
9
|
{dataModelSummary}
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Assigned task:
|
|
11
|
+
**Assigned task**
|
|
13
12
|
{assignedTask}
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
**User request**
|
|
16
15
|
{userRequest}
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
**Tool result**
|
|
20
18
|
{toolResult}
|
|
21
19
|
|
|
22
|
-
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Goal
|
|
23
|
+
|
|
24
|
+
Generate a concise, complete Markdown response using the tool results.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Priority Rules (Strict Order)
|
|
29
|
+
|
|
30
|
+
### 1. User Formatting Override (Highest Priority)
|
|
31
|
+
|
|
32
|
+
- If the user specifies a format (table, list, bullets, etc.):
|
|
33
|
+
- Use that format exactly
|
|
34
|
+
- Ignore ALL default formatting rules below
|
|
35
|
+
- Do NOT add summaries or extra sections unless requested
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
### 2. Default Output (When no override)
|
|
40
|
+
|
|
41
|
+
Produce:
|
|
42
|
+
|
|
43
|
+
- **Summary**: 1–2 sentences (no header, no bullets)
|
|
44
|
+
- **Results**: Minimal, well-formatted data
|
|
45
|
+
- **Note (optional)**:
|
|
46
|
+
- 1–2 italicized sentences describing tool limitations
|
|
47
|
+
|
|
48
|
+
#### Limits
|
|
49
|
+
|
|
50
|
+
- maxPreviewItems: 5
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
### 3. Output Constraints (Non-Negotiable)
|
|
55
|
+
|
|
56
|
+
- Output **valid Markdown only** (no JSON)
|
|
57
|
+
- Do NOT hallucinate data (entities, fields, counts, relationships)
|
|
58
|
+
- Do NOT include:
|
|
59
|
+
- reasoning
|
|
60
|
+
- classification labels
|
|
61
|
+
- follow-up questions
|
|
62
|
+
- next steps
|
|
63
|
+
- intro phrases (“Here are…”)
|
|
64
|
+
- restating the question
|
|
65
|
+
- End immediately after the response
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### 4. Data Handling Rules
|
|
70
|
+
|
|
71
|
+
- If results are empty → clearly state no results returned
|
|
72
|
+
- If insufficient data → state limitation, do NOT speculate
|
|
73
|
+
- Do NOT output:
|
|
74
|
+
- raw nested objects
|
|
75
|
+
- large arrays
|
|
76
|
+
- geometry
|
|
77
|
+
- Summarize complex structures
|
|
78
|
+
- Truncate long values with \`…\`
|
|
79
|
+
- Show entities/relationships only once
|
|
80
|
+
- Use:
|
|
81
|
+
- “entity” (not node)
|
|
82
|
+
- “relationship” (not edge)
|
|
83
|
+
- Hide \`globalid\` and \`objectid\` unless explicitly requested
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
### 5. Formatting Rules (Default Mode Only)
|
|
88
|
+
|
|
89
|
+
- No headers; use _italic labels_ if needed
|
|
90
|
+
- Use:
|
|
91
|
+
- bullets → single item summaries
|
|
92
|
+
- tables → multiple results (limit to 5 rows)
|
|
93
|
+
- Reduce columns to key fields only
|
|
94
|
+
- Format:
|
|
95
|
+
- dates → “day month year”
|
|
96
|
+
- time separate from date
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
### 6. Result-Type Formatting
|
|
101
|
+
|
|
102
|
+
**SEARCH_HITS**
|
|
103
|
+
|
|
104
|
+
- Highlight top match (bullets)
|
|
105
|
+
- Table for remaining results
|
|
106
|
+
|
|
107
|
+
**ENTITIES**
|
|
108
|
+
|
|
109
|
+
- Group by type (if multiple)
|
|
110
|
+
- Show key properties only
|
|
111
|
+
|
|
112
|
+
**RELATIONSHIPS**
|
|
113
|
+
|
|
114
|
+
- Format: \`(entity) —[relationship]→ (entity)\`
|
|
115
|
+
|
|
116
|
+
**PATHS**
|
|
117
|
+
|
|
118
|
+
- Summary + 1-3 examples
|
|
119
|
+
|
|
120
|
+
---
|
|
23
121
|
|
|
24
|
-
|
|
122
|
+
## Internal Processing (Do NOT output)
|
|
25
123
|
|
|
26
|
-
|
|
124
|
+
Classify results into:
|
|
27
125
|
|
|
28
|
-
|
|
126
|
+
- SEARCH_HITS, ENTITIES, RELATIONSHIPS, PATHS
|
|
29
127
|
|
|
30
|
-
|
|
31
|
-
- _Optional_ - Code block containing tool settings / query or search used etc for tool calls with multiple or complex settings
|
|
32
|
-
- _Optional_ - Markdown table of query or search results preview if these tools were used, and this is appropriate to answer the user's question. Ensure long property values are truncated to short lengths (20 chars) in the table if not directly relevant to the user's query. Do not re-order data in the table. If a query or search of graph data was done, this should be displayed.
|
|
33
|
-
- _Important_ If the summary or markdown table was generated based on data where only a limited preview of the full results of e.g. a search/query was available, indicate this at the end of the summary in a separate paragraph in italics, along the lines of 'NOTE: This summary was generated from a limited preview of the search / query results, and may not be accurate.'
|
|
128
|
+
## Failure Handling
|
|
34
129
|
|
|
35
|
-
|
|
130
|
+
- If data is insufficient → clearly state limitation
|
|
131
|
+
- Never infer or fabricate missing information
|
|
36
132
|
|
|
37
|
-
|
|
38
|
-
- Do NOT offer additional actions or suggestions.
|
|
39
|
-
- Do NOT explain what you can do next.
|
|
40
|
-
- End the response immediately after the summary.
|
|
41
|
-
- Do NOT include introductory phrases (e.g., "Found", "Here are", "The results show").
|
|
42
|
-
- Do NOT restate the assigned task or user’s question.
|
|
43
|
-
- Use Markdown formatting for the response, formatting in a way that makes the summary easy to read.
|
|
44
|
-
- When presenting tabular data, output a valid Markdown table.
|
|
133
|
+
---
|
|
45
134
|
`;
|
|
46
135
|
export {
|
|
47
|
-
|
|
136
|
+
n as default
|
|
48
137
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
const e = `# ArcgisKnowledge Tool Instructions
|
|
3
3
|
|
|
4
4
|
You are an assistant that helps users answer questions and perform operations on their knowledge graph, map or link chart. You have been assigned the task below, which must be achieved by calling a single tool.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import { Annotation as r } from "@langchain/langgraph/web";
|
|
3
|
+
const a = (e, t) => t, c = (e, t) => ({
|
|
4
|
+
...e,
|
|
5
|
+
...t
|
|
6
|
+
}), o = (e = "", t) => {
|
|
7
|
+
const s = typeof t == "string" ? t.trim() : "";
|
|
8
|
+
if (!s)
|
|
9
|
+
return e;
|
|
10
|
+
const n = e.trim();
|
|
11
|
+
if (!n)
|
|
12
|
+
return s;
|
|
13
|
+
if (n === s)
|
|
14
|
+
return e;
|
|
15
|
+
const u = n.split(`
|
|
16
|
+
|
|
17
|
+
`);
|
|
18
|
+
return u[u.length - 1]?.trim() === s ? e : `${e}
|
|
19
|
+
|
|
20
|
+
${s}`;
|
|
21
|
+
}, d = () => ({
|
|
22
|
+
userRequest: "",
|
|
23
|
+
assignedTask: "",
|
|
24
|
+
messages: [],
|
|
25
|
+
priorSteps: [],
|
|
26
|
+
sharedState: {},
|
|
27
|
+
sharedResources: []
|
|
28
|
+
}), i = () => ({
|
|
29
|
+
agentExecutionContext: r({
|
|
30
|
+
reducer: c,
|
|
31
|
+
default: d
|
|
32
|
+
}),
|
|
33
|
+
outputMessage: r({
|
|
34
|
+
reducer: o,
|
|
35
|
+
default: () => ""
|
|
36
|
+
}),
|
|
37
|
+
summary: r({
|
|
38
|
+
reducer: a,
|
|
39
|
+
default: () => ""
|
|
40
|
+
}),
|
|
41
|
+
status: r({
|
|
42
|
+
reducer: a
|
|
43
|
+
}),
|
|
44
|
+
sharedStatePatch: r({
|
|
45
|
+
reducer: a
|
|
46
|
+
}),
|
|
47
|
+
sharedResourceAdditions: r({
|
|
48
|
+
reducer: a
|
|
49
|
+
})
|
|
50
|
+
}), g = () => i();
|
|
51
|
+
export {
|
|
52
|
+
i as a,
|
|
53
|
+
o as b,
|
|
54
|
+
d as c,
|
|
55
|
+
g as d,
|
|
56
|
+
c as m,
|
|
57
|
+
a as r
|
|
58
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import w from "@esri/arcgis-html-sanitizer";
|
|
3
3
|
import { marked as S } from "marked";
|
|
4
4
|
S.use({
|
|
5
5
|
gfm: !0,
|
|
6
6
|
breaks: !0,
|
|
7
7
|
async: !1
|
|
8
8
|
});
|
|
9
|
-
const C = new
|
|
9
|
+
const C = new w(
|
|
10
10
|
{
|
|
11
11
|
whiteList: {
|
|
12
12
|
// LLMs sometimes return lists like "- 2) Foo". `marked` parses that into a nested ordered list
|
|
@@ -17,6 +17,7 @@ const C = new g(
|
|
|
17
17
|
"calcite-table-row": ["slot", "class"],
|
|
18
18
|
"calcite-table-header": ["heading", "alignment", "description", "class"],
|
|
19
19
|
"calcite-table-cell": ["alignment", "colspan", "rowspan", "class"],
|
|
20
|
+
"calcite-link": ["href", "target", "rel", "title"],
|
|
20
21
|
// Allow markdown code blocks to render as <pre><code>…</code></pre>.
|
|
21
22
|
pre: ["class"],
|
|
22
23
|
code: ["class"]
|
|
@@ -27,44 +28,67 @@ const C = new g(
|
|
|
27
28
|
function T(e) {
|
|
28
29
|
return C.sanitize(e);
|
|
29
30
|
}
|
|
31
|
+
function k(e) {
|
|
32
|
+
if (!e || typeof DOMParser > "u")
|
|
33
|
+
return e;
|
|
34
|
+
try {
|
|
35
|
+
const t = new DOMParser().parseFromString(e, "text/html");
|
|
36
|
+
return t.querySelectorAll("a").forEach((r) => {
|
|
37
|
+
const n = t.createElement("calcite-link");
|
|
38
|
+
for (const l of ["href", "target", "rel", "title"]) {
|
|
39
|
+
const a = r.getAttribute(l);
|
|
40
|
+
a !== null && n.setAttribute(l, a);
|
|
41
|
+
}
|
|
42
|
+
n.append(...r.childNodes), r.replaceWith(n);
|
|
43
|
+
}), t.body.innerHTML;
|
|
44
|
+
} catch {
|
|
45
|
+
return e;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
30
48
|
function A(e, t) {
|
|
31
|
-
const r = e.indexOf("{", t),
|
|
32
|
-
return r === -1 ?
|
|
49
|
+
const r = e.indexOf("{", t), n = e.indexOf("[", t);
|
|
50
|
+
return r === -1 ? n : n === -1 ? r : Math.min(r, n);
|
|
33
51
|
}
|
|
34
52
|
function x(e) {
|
|
35
53
|
if (e.trimStart().startsWith("```"))
|
|
36
54
|
return null;
|
|
37
55
|
for (let r = A(e, 0); r !== -1; r = A(e, r + 1)) {
|
|
38
|
-
let
|
|
39
|
-
for (let
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
56
|
+
let n = 0, l = 0;
|
|
57
|
+
for (let a = r; a < e.length; a++) {
|
|
58
|
+
const c = e[a];
|
|
59
|
+
if (c === "{" ? n++ : c === "}" ? n-- : c === "[" ? l++ : c === "]" && l--, n < 0 || l < 0)
|
|
42
60
|
break;
|
|
43
|
-
if (
|
|
44
|
-
return e.slice(r,
|
|
61
|
+
if (n === 0 && l === 0 && a > r)
|
|
62
|
+
return e.slice(r, a + 1);
|
|
45
63
|
}
|
|
46
64
|
}
|
|
47
65
|
return null;
|
|
48
66
|
}
|
|
49
|
-
function
|
|
67
|
+
function z(e) {
|
|
50
68
|
if (!e)
|
|
51
69
|
return "";
|
|
52
70
|
let t = e;
|
|
53
71
|
const r = x(e);
|
|
54
72
|
if (r)
|
|
55
73
|
try {
|
|
56
|
-
const l = JSON.parse(r),
|
|
74
|
+
const l = JSON.parse(r), c = `
|
|
57
75
|
|
|
58
76
|
\`\`\`json
|
|
59
77
|
${JSON.stringify(l, null, 2)}
|
|
60
78
|
\`\`\`
|
|
61
79
|
|
|
62
80
|
`;
|
|
63
|
-
t = e.replace(r,
|
|
81
|
+
t = e.replace(r, c);
|
|
64
82
|
} catch {
|
|
65
83
|
}
|
|
66
|
-
const
|
|
67
|
-
return
|
|
84
|
+
const n = q(t);
|
|
85
|
+
return M(n);
|
|
86
|
+
}
|
|
87
|
+
function M(e) {
|
|
88
|
+
if (!e)
|
|
89
|
+
return "";
|
|
90
|
+
const t = E(e), r = k(t);
|
|
91
|
+
return T(r);
|
|
68
92
|
}
|
|
69
93
|
function q(e) {
|
|
70
94
|
return e ? S.parse(e, { async: !1 }) : "";
|
|
@@ -74,44 +98,45 @@ function E(e) {
|
|
|
74
98
|
return e;
|
|
75
99
|
try {
|
|
76
100
|
const t = new DOMParser().parseFromString(e, "text/html");
|
|
77
|
-
return Array.from(t.querySelectorAll("table")).forEach((
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
for (const
|
|
101
|
+
return Array.from(t.querySelectorAll("table")).forEach((n, l) => {
|
|
102
|
+
const a = t.createElement("calcite-table");
|
|
103
|
+
a.setAttribute("caption", `Table ${l + 1}`), a.setAttribute("striped", "true");
|
|
104
|
+
const c = n.querySelector("thead");
|
|
105
|
+
if (c) {
|
|
106
|
+
const f = Array.from(c.querySelectorAll("tr"));
|
|
107
|
+
for (const u of f) {
|
|
84
108
|
const o = t.createElement("calcite-table-row");
|
|
85
109
|
o.setAttribute("slot", "table-header");
|
|
86
|
-
const
|
|
87
|
-
for (const
|
|
88
|
-
const
|
|
89
|
-
|
|
110
|
+
const d = Array.from(u.querySelectorAll("th, td"));
|
|
111
|
+
for (const h of d) {
|
|
112
|
+
const i = (h.textContent ?? "").trim(), s = t.createElement("calcite-table-header");
|
|
113
|
+
s.setAttribute("heading", i), o.appendChild(s);
|
|
90
114
|
}
|
|
91
|
-
|
|
115
|
+
a.appendChild(o);
|
|
92
116
|
}
|
|
93
117
|
}
|
|
94
|
-
const
|
|
95
|
-
(
|
|
96
|
-
const o = t.createElement("calcite-table-row"),
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
for (const
|
|
100
|
-
if (
|
|
101
|
-
const
|
|
102
|
-
y.setAttribute("heading",
|
|
118
|
+
const b = n.querySelector("tbody");
|
|
119
|
+
(b ? Array.from(b.querySelectorAll("tr")) : Array.from(n.querySelectorAll("tr")).filter((f) => !c?.contains(f))).forEach((f, u) => {
|
|
120
|
+
const o = t.createElement("calcite-table-row"), d = !c && u === 0 && f.querySelectorAll("th").length > 0;
|
|
121
|
+
d && o.setAttribute("slot", "table-header");
|
|
122
|
+
const h = Array.from(f.querySelectorAll("th, td"));
|
|
123
|
+
for (const i of h) {
|
|
124
|
+
if (d && i.localName === "th") {
|
|
125
|
+
const g = (i.textContent ?? "").trim(), y = t.createElement("calcite-table-header");
|
|
126
|
+
y.setAttribute("heading", g), o.appendChild(y);
|
|
103
127
|
return;
|
|
104
128
|
}
|
|
105
|
-
const
|
|
106
|
-
p &&
|
|
129
|
+
const s = t.createElement("calcite-table-cell"), p = i.getAttribute("colspan"), m = i.getAttribute("rowspan");
|
|
130
|
+
p && s.setAttribute("colspan", p), m && s.setAttribute("rowspan", m), s.innerHTML = i.innerHTML, o.appendChild(s);
|
|
107
131
|
}
|
|
108
|
-
|
|
109
|
-
}),
|
|
132
|
+
a.appendChild(o);
|
|
133
|
+
}), n.replaceWith(a);
|
|
110
134
|
}), t.body.innerHTML;
|
|
111
135
|
} catch {
|
|
112
136
|
return e;
|
|
113
137
|
}
|
|
114
138
|
}
|
|
115
139
|
export {
|
|
116
|
-
|
|
140
|
+
M as a,
|
|
141
|
+
z as p
|
|
117
142
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import { createSkillAgent as e } from "../agents/runtime/skill/createSkillAgent.js";
|
|
3
|
+
const t = [
|
|
4
|
+
async () => (await import("./SKILL.js")).default,
|
|
5
|
+
async () => (await import("./SKILL2.js")).default
|
|
6
|
+
], r = e({
|
|
7
|
+
id: "dataExploration",
|
|
8
|
+
name: "Data Exploration Agent",
|
|
9
|
+
description: "Explores feature-layer data and applies data-driven map filters using on-demand query and filter skills.",
|
|
10
|
+
skillLoaders: t,
|
|
11
|
+
modelTier: "default",
|
|
12
|
+
systemPrompt: "You are an ArcGIS data exploration agent.",
|
|
13
|
+
instructions: "A request can require both query and filter skills. Treat show, display, highlight, map, filter, reveal, emphasize, include, or exclude as visual map intent when the request targets matching features. For visual map intent, do not stop after query. First use query to identify/count the matching features, then load the filter skill and call setFeatureEffect with the same layer, where clause, geometry filter, extent setting, or object IDs. Use only tool results to describe data or map changes.",
|
|
14
|
+
fallbackMessage: "Data exploration request completed.",
|
|
15
|
+
failureMessage: "I couldn't complete the data exploration request."
|
|
16
|
+
});
|
|
17
|
+
export {
|
|
18
|
+
r as D
|
|
19
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
const e = `# ArcGIS Online Map Viewer — Layer Filter Tool Calling Assistant
|
|
3
3
|
|
|
4
4
|
You are an assistant that helps manage layer filters and visual effects for **ArcGIS Online Map Viewer** by selecting and calling the appropriate tool.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
const e = `# ArcGIS JavaScript SDK FeatureLayerView Query Assistant
|
|
3
3
|
|
|
4
4
|
You are a GIS assistant that generates query parameters for the ArcGIS JavaScript SDK FeatureLayerView \`queryFeatures()\` method.
|
|
@@ -39,10 +39,13 @@ Prior steps:
|
|
|
39
39
|
Last navigated features from shared state (if available):
|
|
40
40
|
{lastNavigatedFeatures}
|
|
41
41
|
|
|
42
|
+
Last resolved location from shared state (if available):
|
|
43
|
+
{lastResolvedLocation}
|
|
44
|
+
|
|
42
45
|
Use the assigned task as the primary instruction for the current query.
|
|
43
46
|
Use the latest user request as supporting context when needed.
|
|
44
47
|
Use prior steps only when the assigned task or user request clearly depends on earlier results.
|
|
45
|
-
Use
|
|
48
|
+
Use shared-state context (\`lastResolvedLocation\`, \`lastNavigatedFeatures\`) for referential follow-ups when relevant.
|
|
46
49
|
Use chat history only when necessary to understand conversational references, and do not override the assigned task.
|
|
47
50
|
|
|
48
51
|
### Anchor selection rule (strict, single source of truth)
|
|
@@ -50,8 +53,9 @@ Use chat history only when necessary to understand conversational references, an
|
|
|
50
53
|
When the request is referential (for example: "this", "it", "that", "those", "them", "of those", "the same one(s)"), choose exactly one anchor using this priority order:
|
|
51
54
|
|
|
52
55
|
1. Explicit entity named in the current request (if present)
|
|
53
|
-
2. \`
|
|
54
|
-
3.
|
|
56
|
+
2. \`lastResolvedLocation\` (if present and the request refers to a place/location)
|
|
57
|
+
3. \`lastNavigatedFeatures\` (if present)
|
|
58
|
+
4. The immediately previous successful relevant step from \`priorSteps\`
|
|
55
59
|
|
|
56
60
|
After selecting the anchor, keep that anchor for this query and do not switch to an older entity.
|
|
57
61
|
If \`lastNavigatedFeatures\` is used as the anchor, reuse its \`layerId\` and \`where\` for query scope unless the current request explicitly overrides it.
|
|
@@ -78,7 +82,8 @@ Start with a fresh WHERE clause for each new question. Do not inherit filters fr
|
|
|
78
82
|
|
|
79
83
|
This is an exception to the "fresh WHERE clause" rule above.
|
|
80
84
|
|
|
81
|
-
- If the anchored context
|
|
85
|
+
- If the anchored context is \`lastResolvedLocation\` with a point, prefer \`geometryFilter.point\` and use \`where: "1=1"\` unless the user asked for additional attribute filters.
|
|
86
|
+
- Only use \`useCurrentExtent: true\` when the user explicitly asks about the current view/map extent (for example: "in my view", "on my map", "visible now").
|
|
82
87
|
- If the anchored context includes specific feature IDs/objectIds, scope to those IDs.
|
|
83
88
|
- Otherwise, use the anchored \`layerId\` + \`where\` combination.
|
|
84
89
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
const o = `(function(){"use strict";const h=(a,r)=>{if(a.length!==r.length)throw new Error("Vectors must be the same length");let c=0,t=0,e=0;for(let n=0;n<a.length;++n){const s=a[n],l=r[n];c+=s*l,t+=s*s,e+=l*l}const i=Math.sqrt(t*e);if(i===0)return 0;const m=c/i;return Math.max(-1,Math.min(1,m))},f=(a,r,c=.6)=>{const t=[],e=[...a];for(;t.length<r&&e.length>0;){let i=-1,m=-1/0;for(let n=0;n<e.length;n++){const s=e[n].score,l=t.length===0?0:Math.max(...t.map(o=>h(e[n].vector,o.vector))),d=c*s-(1-c)*l;d>m&&(m=d,i=n)}t.push(e[i]),e.splice(i,1)}return t.map(({name:i,score:m})=>({name:i,score:m}))};let p=[];const u=new Map,v=12,y=10,M=a=>{p=a.layers.map(r=>({id:r.id,vector:r.vector}))},E=a=>{u.clear();for(const r of a.layers){const c=r.fields.map(t=>({name:t.name,vector:t.vector}));u.set(r.id,c)}};globalThis.addEventListener("message",a=>{(async()=>{const{type:r,webmapEmbeddings:c,layerIdForFieldsSearch:t=[],requestId:e,precomputedEmbedding:i,minScore:m=0,topResults:n=v}=a.data;switch(r){case"generateEmbeddings":{c&&(M(c),E(c)),globalThis.postMessage("completed");break}case"layerSearch":{if(p.length>0)try{const s=p.map(o=>({id:o.id,vector:o.vector,score:h(i,o.vector)})),d=f(s.map(o=>({name:o.id,vector:o.vector,score:o.score})),y).map(({name:o,score:b})=>({id:o,score:b}));globalThis.postMessage({requestId:e,results:d})}catch(s){globalThis.postMessage({requestId:e,results:[],error:s instanceof Error?s.message:"Calculation error"})}else globalThis.postMessage({requestId:e,results:[],error:"Layer embeddings not initialized"});break}case"fieldSearch":{if(t.length>0)try{const s=t.map(l=>{const d=u.get(l);if(!d)return{layerId:l,results:[]};const o=d.map(g=>({name:g.name,vector:g.vector,score:h(i,g.vector)})).filter(({score:g})=>g>=m),b=f(o,n);return{layerId:l,results:b}});globalThis.postMessage({requestId:e,results:s})}catch(s){globalThis.postMessage({requestId:e,results:[],error:s instanceof Error?s.message:"Field search calculation error"})}break}default:console.warn("Unknown message type:",r)}})()})})();
|
|
3
3
|
`, s = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", o], { type: "text/javascript;charset=utf-8" });
|
|
4
4
|
function a(r) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
function c(e, o) {
|
|
3
|
+
const t = e?.configurable?.context;
|
|
4
|
+
if (!t || typeof t != "object")
|
|
5
|
+
throw new Error("Agent context missing");
|
|
6
|
+
const n = o.filter((i) => !(i in t));
|
|
7
|
+
if (n.length)
|
|
8
|
+
throw new Error(`Agent context missing: ${n.join(", ")}`);
|
|
9
|
+
return t;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
c as f
|
|
13
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import v from "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
|
|
3
|
+
import L from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
|
|
4
|
+
const $ = 10, b = ["string", "small-integer", "integer"], w = async (u, e, { includeSummaryStatistics: d = !0, includeUniqueValues: y = !0 } = {}) => {
|
|
5
|
+
let r = null, s = null;
|
|
6
|
+
try {
|
|
7
|
+
if (e.type !== "geometry" && e.type !== "oid" && e.type !== "global-id") {
|
|
8
|
+
d && (r = await v({ layer: u, field: e.name }));
|
|
9
|
+
const i = e.domain?.type === "coded-value" ? e.domain : null;
|
|
10
|
+
y && (b.includes(e.type) || i) && (s = (await L({ layer: u, field: e.name })).uniqueValueInfos.sort((n, f) => f.count - n.count).slice(0, $), i && (s = s.map((n) => ({
|
|
11
|
+
...n,
|
|
12
|
+
value: i.getName(n.value) ?? n.value
|
|
13
|
+
}))));
|
|
14
|
+
}
|
|
15
|
+
} catch (i) {
|
|
16
|
+
console.error(`Error fetching statistics for field ${e.name}:`, i);
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
summaryStatistics: r,
|
|
20
|
+
uniqueValues: s
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
function N(u, e) {
|
|
24
|
+
return ["string", "small-integer", "integer"].includes(u) || e === "coded-value";
|
|
25
|
+
}
|
|
26
|
+
async function x(u, e, d, y = !0) {
|
|
27
|
+
const r = [], s = [], i = [];
|
|
28
|
+
for (const n of u) {
|
|
29
|
+
let f = function(a) {
|
|
30
|
+
const t = e.get(a)?.layerItem;
|
|
31
|
+
return t ? [
|
|
32
|
+
t.name && `Name: ${t.name}`,
|
|
33
|
+
t.title && `Title: ${t.title}`,
|
|
34
|
+
t.description && `Description: ${t.description}`
|
|
35
|
+
].filter(Boolean).join(" | ") : a;
|
|
36
|
+
};
|
|
37
|
+
const { layerId: c, results: q } = n, I = d.map?.allLayers.find((a) => a.id === c), S = e.get(c)?.fieldRegistry;
|
|
38
|
+
if (!S)
|
|
39
|
+
continue;
|
|
40
|
+
let l = r.find((a) => a.layerId === c);
|
|
41
|
+
l || (l = {
|
|
42
|
+
layerId: c,
|
|
43
|
+
layerSummary: f(c),
|
|
44
|
+
fieldInfos: []
|
|
45
|
+
}, r.push(l));
|
|
46
|
+
for (const a of q) {
|
|
47
|
+
const t = S.get(a.name);
|
|
48
|
+
if (!t)
|
|
49
|
+
continue;
|
|
50
|
+
const o = t.statistics, p = y && !o?.summaryStatistics, g = N(t.type, t.domain?.type) && !o?.uniqueValues, h = p || g;
|
|
51
|
+
if (i.push({
|
|
52
|
+
layerId: c,
|
|
53
|
+
fieldName: t.name,
|
|
54
|
+
didFetchStatistics: h
|
|
55
|
+
}), h) {
|
|
56
|
+
const F = w(I, t, {
|
|
57
|
+
includeSummaryStatistics: p,
|
|
58
|
+
includeUniqueValues: g
|
|
59
|
+
}).then((V) => {
|
|
60
|
+
const m = {
|
|
61
|
+
summaryStatistics: o?.summaryStatistics ?? null,
|
|
62
|
+
uniqueValues: o?.uniqueValues ?? null
|
|
63
|
+
};
|
|
64
|
+
p && (m.summaryStatistics = V.summaryStatistics), g && (m.uniqueValues = V.uniqueValues), S.set(t.name, { ...t, statistics: m }), t.statistics = m;
|
|
65
|
+
});
|
|
66
|
+
s.push(F);
|
|
67
|
+
}
|
|
68
|
+
l.fieldInfos.push(t);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return await Promise.all(s), {
|
|
72
|
+
layerFieldInfo: r,
|
|
73
|
+
didFetchStatistics: s.length > 0,
|
|
74
|
+
fieldStatisticsFetchStatus: i
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
x as b
|
|
79
|
+
};
|