@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
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import { ChatOpenAI as E, OpenAIEmbeddings as U } from "@langchain/openai";
|
|
3
|
+
import p from "@arcgis/core/portal/Portal.js";
|
|
4
|
+
import h from "@arcgis/core/request.js";
|
|
5
|
+
import b from "@arcgis/core/identity/IdentityManager.js";
|
|
6
|
+
import { generateGuid as I } from "@arcgis/toolkit/string";
|
|
7
|
+
import q from "@arcgis/core/config.js";
|
|
8
|
+
const y = {
|
|
9
|
+
advanced: "gpt-5.6-sol",
|
|
10
|
+
default: "gpt-5.6-terra",
|
|
11
|
+
fast: "gpt-5.6-luna"
|
|
12
|
+
}, w = {
|
|
13
|
+
default: "text-embedding-ada-002"
|
|
14
|
+
}, f = /* @__PURE__ */ new Map();
|
|
15
|
+
let i = null;
|
|
16
|
+
const R = () => {
|
|
17
|
+
const t = p.getDefault().helperServices;
|
|
18
|
+
if (!t?.aiModels?.url)
|
|
19
|
+
throw new Error("AI Models Service URL is not defined in the portal's helper services.");
|
|
20
|
+
return t.aiModels.url;
|
|
21
|
+
}, S = async (e) => {
|
|
22
|
+
const t = R();
|
|
23
|
+
f.size === 0 && (i || (i = (async () => {
|
|
24
|
+
try {
|
|
25
|
+
(await h(`${t}/models`)).data.models.forEach((s) => f.set(s.name, s));
|
|
26
|
+
} catch (r) {
|
|
27
|
+
throw i = null, r;
|
|
28
|
+
}
|
|
29
|
+
})()), await i);
|
|
30
|
+
const o = f.get(e);
|
|
31
|
+
if (!o)
|
|
32
|
+
throw new Error(`Model '${e}' is not available in the discovery service.`);
|
|
33
|
+
return o.endpoint;
|
|
34
|
+
}, C = async (e = "default") => await S(y[e]), A = async (e = "default") => await S(w[e]), k = (e) => typeof e == "string" && e.length > 0 ? e : void 0, D = () => I(), F = (e) => typeof e != "string" || e.trim().length === 0 ? "MapsSDK" : `MapsSDK - ${e.trim()}`, K = (e) => {
|
|
35
|
+
const t = e?.configurable;
|
|
36
|
+
return {
|
|
37
|
+
conversationId: k(t?.thread_id),
|
|
38
|
+
abortSignal: e?.signal,
|
|
39
|
+
requestId: D(),
|
|
40
|
+
requestSource: F(q.applicationName)
|
|
41
|
+
};
|
|
42
|
+
}, L = (e) => {
|
|
43
|
+
if (e == null || typeof e == "string" || e instanceof FormData || e instanceof HTMLFormElement)
|
|
44
|
+
return e;
|
|
45
|
+
if (e instanceof URLSearchParams)
|
|
46
|
+
return e.toString();
|
|
47
|
+
throw new TypeError(`Unsupported request body type: ${Object.prototype.toString.call(e)}`);
|
|
48
|
+
}, v = async ({ config: e }) => {
|
|
49
|
+
const t = p.getDefault(), o = await b.getCredential(`${t.url}/sharing`);
|
|
50
|
+
return async (r, n) => {
|
|
51
|
+
const { conversationId: s, abortSignal: c, requestId: g, requestSource: l } = K(e), a = new Headers(n?.headers);
|
|
52
|
+
for (const m of [...a.keys()]) {
|
|
53
|
+
const u = m.toLowerCase();
|
|
54
|
+
(u === "authorization" || u === "api-key" || u.startsWith("x-stainless-")) && a.delete(m);
|
|
55
|
+
}
|
|
56
|
+
const d = o?.token;
|
|
57
|
+
d && d.length > 0 && a.set("X-Esri-Authorization", `Bearer ${d}`), t.isPortal || (l && l.length > 0 && a.set("X-Esri-Request-Source", l), s && s.length > 0 && a.set("X-Esri-Conversation-Id", s), g.length > 0 && a.set("X-Esri-Request-Id", g));
|
|
58
|
+
const M = c && n?.signal ? AbortSignal.any([c, n.signal]) : n?.signal ?? c;
|
|
59
|
+
return (await h(r instanceof Request ? r.url : r.toString(), {
|
|
60
|
+
body: L(n?.body),
|
|
61
|
+
headers: Object.fromEntries(a),
|
|
62
|
+
responseType: "native",
|
|
63
|
+
signal: M
|
|
64
|
+
})).data;
|
|
65
|
+
};
|
|
66
|
+
}, B = async (e = {}) => {
|
|
67
|
+
const { modelTier: t = "default", config: o } = e, r = y[t], n = await C(t);
|
|
68
|
+
return new E({
|
|
69
|
+
modelName: r,
|
|
70
|
+
apiKey: "dummy-key",
|
|
71
|
+
configuration: {
|
|
72
|
+
baseURL: n,
|
|
73
|
+
fetch: await v({ config: o })
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}, j = async (e = {}) => {
|
|
77
|
+
const { tier: t = "default", config: o } = e, r = w[t], n = await A(t);
|
|
78
|
+
return new U({
|
|
79
|
+
modelName: r,
|
|
80
|
+
apiKey: "dummy-key",
|
|
81
|
+
configuration: {
|
|
82
|
+
baseURL: n,
|
|
83
|
+
fetch: await v({ config: o })
|
|
84
|
+
},
|
|
85
|
+
batchSize: 2048,
|
|
86
|
+
maxConcurrency: 10
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
export {
|
|
90
|
+
w as E,
|
|
91
|
+
j as a,
|
|
92
|
+
B as c,
|
|
93
|
+
A as g
|
|
94
|
+
};
|
|
@@ -1,54 +1,58 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import { StateGraph as
|
|
3
|
-
import { a as
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import { StateGraph as x, START as k, END as c, Command as b } from "@langchain/langgraph/web";
|
|
3
|
+
import { a as K, c as _, g as T, b as A, d as S, s as M, q as v, e as u, f as q, t as g, h as C, G as E, i as m } from "./adapter.js";
|
|
4
4
|
import "@arcgis/core/identity/IdentityManager.js";
|
|
5
5
|
import "@arcgis/core/portal/Portal.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import "@arcgis/core/request.js";
|
|
7
|
+
import "@arcgis/toolkit/string";
|
|
8
|
+
import { i as G, a as N } from "./generateLayerDescriptions.js";
|
|
9
|
+
import { AIMessage as y } from "@langchain/core/messages";
|
|
8
10
|
import "@langchain/core/callbacks/dispatch/web";
|
|
11
|
+
import "@langchain/core/callbacks/base";
|
|
9
12
|
import "@langchain/openai";
|
|
10
13
|
import "@arcgis/core/config.js";
|
|
11
14
|
import "@arcgis/core/core/reactiveUtils.js";
|
|
12
15
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
13
|
-
import "@
|
|
14
|
-
import {
|
|
15
|
-
import { s as p, a as D } from "./index.js";
|
|
16
|
+
import { ToolNode as R } from "@langchain/langgraph/prebuilt";
|
|
17
|
+
import { s as p, a as L } from "./index.js";
|
|
16
18
|
import "@langchain/core/prompts";
|
|
19
|
+
import { r as z } from "./requireAgentServices.js";
|
|
17
20
|
const w = [
|
|
18
|
-
b,
|
|
19
|
-
_,
|
|
20
21
|
K,
|
|
21
|
-
|
|
22
|
+
_,
|
|
22
23
|
T,
|
|
23
|
-
|
|
24
|
-
S
|
|
24
|
+
A,
|
|
25
|
+
S,
|
|
26
|
+
M,
|
|
27
|
+
v
|
|
25
28
|
];
|
|
26
|
-
async function
|
|
27
|
-
const
|
|
29
|
+
async function D(e, t) {
|
|
30
|
+
const o = await u("arcgis_knowledge_tool_prompt"), s = q(t), n = {
|
|
28
31
|
assignedTask: e.agentExecutionContext.assignedTask,
|
|
29
32
|
userRequest: e.agentExecutionContext.userRequest,
|
|
30
33
|
priorSteps: e.agentExecutionContext.priorSteps,
|
|
31
|
-
contextType:
|
|
32
|
-
},
|
|
33
|
-
promptText:
|
|
34
|
+
contextType: s
|
|
35
|
+
}, r = await G({
|
|
36
|
+
promptText: o,
|
|
34
37
|
messages: e.arcgisKnowledgeMessages,
|
|
35
38
|
inputVariables: n,
|
|
36
|
-
tools: w
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
tools: w,
|
|
40
|
+
config: t
|
|
41
|
+
}), l = (r.tool_calls?.length ?? 0) > 0, a = typeof r.text == "string" ? r.text.trim() : "", i = a.length > 0, d = r.content.toString();
|
|
42
|
+
return !l && (s === "map" || s === "knowledgeGraph") ? {
|
|
39
43
|
...e,
|
|
40
|
-
arcgisKnowledgeMessages: [...e.arcgisKnowledgeMessages,
|
|
41
|
-
outputMessage:
|
|
44
|
+
arcgisKnowledgeMessages: [...e.arcgisKnowledgeMessages, r],
|
|
45
|
+
outputMessage: s === "map" ? "No tools were found for the current view and prompt. Maps do not support changing nonspatial visibility, layout changes, or generation from queries." : "No tools were found for the current prompt and knowledge graph service. A knowledge graph service only supports search and query.",
|
|
42
46
|
status: "success"
|
|
43
47
|
} : {
|
|
44
48
|
...e,
|
|
45
|
-
arcgisKnowledgeMessages: [...e.arcgisKnowledgeMessages,
|
|
46
|
-
outputMessage: l ? d :
|
|
47
|
-
status: l ? e.status :
|
|
48
|
-
summary: d ?
|
|
49
|
+
arcgisKnowledgeMessages: [...e.arcgisKnowledgeMessages, r],
|
|
50
|
+
outputMessage: l ? d : a,
|
|
51
|
+
status: l ? e.status : i ? "success" : "failed",
|
|
52
|
+
summary: d ? g(d) : "ArcGIS Knowledge Agent tool executed."
|
|
49
53
|
};
|
|
50
54
|
}
|
|
51
|
-
const
|
|
55
|
+
const f = {
|
|
52
56
|
generateCypher: "generated-cypher-query",
|
|
53
57
|
queryGraphData: "graph-query-result",
|
|
54
58
|
searchGraphData: "graph-search-result",
|
|
@@ -58,110 +62,126 @@ const y = {
|
|
|
58
62
|
createLinkChart: "created-link-chart"
|
|
59
63
|
};
|
|
60
64
|
function F(e) {
|
|
61
|
-
return !!e && e.status === "success" && !!
|
|
65
|
+
return !!e && e.status === "success" && !!f[e.toolName];
|
|
62
66
|
}
|
|
63
67
|
function $(e) {
|
|
64
68
|
return {
|
|
65
|
-
type:
|
|
69
|
+
type: f[e.toolName],
|
|
66
70
|
data: e.details
|
|
67
71
|
};
|
|
68
72
|
}
|
|
69
|
-
async function I(e,
|
|
70
|
-
const
|
|
73
|
+
async function I(e, t) {
|
|
74
|
+
const o = new R(w, { handleToolErrors: !1 });
|
|
71
75
|
try {
|
|
72
|
-
const
|
|
76
|
+
const s = await o.invoke(
|
|
73
77
|
{
|
|
74
78
|
messages: e.arcgisKnowledgeMessages
|
|
75
79
|
},
|
|
76
|
-
|
|
80
|
+
t
|
|
77
81
|
), n = [];
|
|
78
|
-
for (const
|
|
79
|
-
let
|
|
80
|
-
if (typeof
|
|
81
|
-
throw new Error(`Unexpected tool message content type: ${typeof
|
|
82
|
+
for (const a of s.messages) {
|
|
83
|
+
let i;
|
|
84
|
+
if (typeof a.content != "string")
|
|
85
|
+
throw new Error(`Unexpected tool message content type: ${typeof a.content}. Expected string.`);
|
|
82
86
|
try {
|
|
83
|
-
|
|
87
|
+
i = JSON.parse(a.content);
|
|
84
88
|
} catch {
|
|
85
89
|
throw new Error(
|
|
86
|
-
`Failed to parse tool message content as JSON. Tool: ${
|
|
90
|
+
`Failed to parse tool message content as JSON. Tool: ${a.name ?? "unknown"}.
|
|
87
91
|
|
|
88
|
-
Original Content: ${
|
|
92
|
+
Original Content: ${a.content}`
|
|
89
93
|
);
|
|
90
94
|
}
|
|
91
|
-
if (!
|
|
95
|
+
if (!i || typeof i != "object" || !("toolName" in i))
|
|
92
96
|
throw new Error(
|
|
93
|
-
`Parsed tool message content does not have expected structure. Parsed content: ${JSON.stringify(
|
|
97
|
+
`Parsed tool message content does not have expected structure. Parsed content: ${JSON.stringify(i)}`
|
|
94
98
|
);
|
|
95
|
-
n.push(
|
|
99
|
+
n.push(i);
|
|
96
100
|
}
|
|
97
101
|
await p(
|
|
98
102
|
{
|
|
99
|
-
text: `Finished executing ArcGIS Knowledge Agent tools: ${
|
|
103
|
+
text: `Finished executing ArcGIS Knowledge Agent tools: ${s.messages.filter((a) => a.name).map((a) => a.name).join(", ")}`
|
|
100
104
|
},
|
|
101
|
-
|
|
105
|
+
t
|
|
102
106
|
);
|
|
103
|
-
const
|
|
104
|
-
return l && F(l) && await
|
|
107
|
+
const r = n.filter((a) => typeof a != "string").map((a) => `- Called Tool: ${a.toolName}, Status: ${a.status}`), l = n[0];
|
|
108
|
+
return l && F(l) && await L($(l), t), {
|
|
105
109
|
...e,
|
|
106
|
-
outputMessage:
|
|
110
|
+
outputMessage: r.join(`
|
|
107
111
|
`),
|
|
108
|
-
summary:
|
|
112
|
+
summary: r.length ? g(r.join(`
|
|
109
113
|
`)) : "ArcGIS Knowledge Agent did not execute any tools or return any results.",
|
|
110
|
-
arcgisKnowledgeMessages: [...e.arcgisKnowledgeMessages, ...
|
|
114
|
+
arcgisKnowledgeMessages: [...e.arcgisKnowledgeMessages, ...s.messages],
|
|
111
115
|
arcgisKnowledgeToolResult: n
|
|
112
116
|
};
|
|
113
|
-
} catch (
|
|
114
|
-
const n =
|
|
117
|
+
} catch (s) {
|
|
118
|
+
const n = s instanceof Error ? s.message : String(s);
|
|
115
119
|
return await p(
|
|
116
120
|
{ text: `ArcGIS Knowledge Agent tool execution failed unexpectedly: ${n}` },
|
|
117
|
-
|
|
121
|
+
t
|
|
118
122
|
), {
|
|
119
123
|
...e,
|
|
120
124
|
outputMessage: `ArcGIS Knowledge Agent tool execution failed unexpectedly: ${n}`,
|
|
121
125
|
status: "failed",
|
|
122
|
-
summary:
|
|
126
|
+
summary: g(`ArcGIS Knowledge Agent tool execution failed unexpectedly: ${n}`),
|
|
123
127
|
arcgisKnowledgeMessages: [...e.arcgisKnowledgeMessages]
|
|
124
128
|
};
|
|
125
129
|
}
|
|
126
130
|
}
|
|
127
|
-
const V = (e,
|
|
131
|
+
const V = (e, t) => (
|
|
128
132
|
//agent services (ex: embeddingsWorker) would go in the array below, if required.
|
|
129
|
-
|
|
133
|
+
z([], "ArcgisKnowledge Agent")(e, t)
|
|
130
134
|
);
|
|
131
|
-
async function
|
|
132
|
-
const
|
|
135
|
+
async function O(e, t) {
|
|
136
|
+
const s = (e.arcgisKnowledgeToolResult ?? []).map((d) => ({
|
|
133
137
|
...d,
|
|
134
138
|
details: void 0
|
|
135
139
|
// Remove details to avoid overwhelming the LLM with too much info
|
|
136
|
-
})), { knowledgeGraph: n } = await C(
|
|
140
|
+
})), { knowledgeGraph: n } = await C(t), r = E.getDataModelTypesSummary(n.dataModel), l = {
|
|
137
141
|
assignedTask: e.agentExecutionContext.assignedTask,
|
|
138
142
|
userRequest: e.agentExecutionContext.userRequest,
|
|
139
|
-
toolResult:
|
|
140
|
-
dataModelSummary:
|
|
141
|
-
},
|
|
143
|
+
toolResult: s,
|
|
144
|
+
dataModelSummary: r
|
|
145
|
+
}, a = await N({
|
|
142
146
|
promptText: await u("arcgis_knowledge_summarize_result_prompt"),
|
|
143
147
|
modelTier: "default",
|
|
144
|
-
inputVariables: l
|
|
145
|
-
|
|
148
|
+
inputVariables: l,
|
|
149
|
+
config: t
|
|
150
|
+
}), i = typeof a == "string" ? a : a.content;
|
|
151
|
+
return {
|
|
152
|
+
...e,
|
|
153
|
+
outputMessage: i,
|
|
154
|
+
status: "success",
|
|
155
|
+
summary: g(i),
|
|
156
|
+
arcgisKnowledgeMessages: [...e.arcgisKnowledgeMessages, new y(i)]
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
async function P(e) {
|
|
160
|
+
const t = e.arcgisKnowledgeToolResult?.[0], o = t?.status === "success" ? t.summary : "ArcGIS Knowledge Agent tool execution failed.";
|
|
146
161
|
return {
|
|
147
162
|
...e,
|
|
148
|
-
outputMessage:
|
|
163
|
+
outputMessage: o,
|
|
149
164
|
status: "success",
|
|
150
|
-
summary:
|
|
151
|
-
arcgisKnowledgeMessages: [...e.arcgisKnowledgeMessages, new
|
|
165
|
+
summary: g(o),
|
|
166
|
+
arcgisKnowledgeMessages: [...e.arcgisKnowledgeMessages, new y(o)]
|
|
152
167
|
};
|
|
153
168
|
}
|
|
154
|
-
function
|
|
155
|
-
return async (
|
|
156
|
-
goto:
|
|
169
|
+
function h(e) {
|
|
170
|
+
return async (t, o) => o?.signal?.aborted ? (await p({ text: "Knowledge Agent execution cancelled" }, o), new b({
|
|
171
|
+
goto: c,
|
|
157
172
|
update: {
|
|
158
173
|
outputMessage: "Knowledge Agent execution cancelled",
|
|
159
174
|
summary: "Knowledge Agent execution cancelled",
|
|
160
175
|
status: "failed"
|
|
161
176
|
}
|
|
162
|
-
})) : await e(
|
|
177
|
+
})) : await e(t, o);
|
|
163
178
|
}
|
|
164
|
-
const
|
|
179
|
+
const j = () => new x(m).addNode("requireArcgisKnowledgeServices", V).addNode("agent", h(D)).addNode("tools", h(I)).addNode("summarizationLLM", h(O)).addNode("finalizeToolSummary", h(P)).addEdge(k, "requireArcgisKnowledgeServices").addEdge("requireArcgisKnowledgeServices", "agent").addConditionalEdges("agent", (t) => (t.arcgisKnowledgeMessages[t.arcgisKnowledgeMessages.length - 1]?.tool_calls?.length ?? 0) > 0 ? "tools" : c).addConditionalEdges("tools", (t) => {
|
|
180
|
+
if (t.status === "failed")
|
|
181
|
+
return c;
|
|
182
|
+
const o = t.arcgisKnowledgeToolResult?.[0];
|
|
183
|
+
return o?.status === "success" && ["applyLayout", "changeNonspatialVisibility"].includes(o.toolName) ? "finalizeToolSummary" : "summarizationLLM";
|
|
184
|
+
}).addEdge("summarizationLLM", c).addEdge("finalizeToolSummary", c), J = String.raw`The purpose of this agent is to work with Knowledge Graph data, a graph database technology that represents and stores data as interconnected entities (nodes) and relationships (edges).
|
|
165
185
|
This agent has two categories of skills: those that work with an active link chart visualization of a subset of the data in the knowledge graph, and those that work with the knowledge graph data more generally against the entire dataset in the service and database.
|
|
166
186
|
For link charts, the agent enables users to interact with a link chart by adding new entities (also called nodes) or relationships (also called edges), removing existing entities or relationships,
|
|
167
187
|
expanding the graph from particular entities, finding relationships between specified entities on the link chart and adding them to the link chart, finding all relationships
|
|
@@ -199,13 +219,13 @@ _example: "Discover and add all the relationships originating at 'Entity E' to t
|
|
|
199
219
|
_example: "Show me all entities with a name similar to 'Smith' and add them to the link chart"_
|
|
200
220
|
_example: "Find reports in my graph that have a title similar to 'Quarterly Earnings'"_
|
|
201
221
|
_example: "Find John Smith and all people he has made phone calls to in the last year"_
|
|
202
|
-
_example: "What is the average age of all people who work for Esri?"_`,
|
|
222
|
+
_example: "What is the average age of all people who work for Esri?"_`, ce = {
|
|
203
223
|
id: "arcgisKnowledge",
|
|
204
224
|
name: "ArcgisKnowledge Agent",
|
|
205
|
-
description:
|
|
206
|
-
createGraph:
|
|
225
|
+
description: J,
|
|
226
|
+
createGraph: j,
|
|
207
227
|
workspace: m
|
|
208
228
|
};
|
|
209
229
|
export {
|
|
210
|
-
|
|
230
|
+
ce as A
|
|
211
231
|
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
const a = /* @__PURE__ */ new Map([
|
|
3
|
+
[
|
|
4
|
+
"clearFilters",
|
|
5
|
+
async () => (await import("../agents/tools/filter/clearFilters/adapter.js")).clearFiltersTool
|
|
6
|
+
],
|
|
7
|
+
[
|
|
8
|
+
"resetMap",
|
|
9
|
+
async () => (await import("../agents/tools/filter/resetMap/adapter.js")).resetMapTool
|
|
10
|
+
],
|
|
11
|
+
[
|
|
12
|
+
"setFeatureEffect",
|
|
13
|
+
async () => (await import("../agents/tools/filter/setFeatureEffect/adapter.js")).setFeatureEffectTool
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
"listLayerFields",
|
|
17
|
+
async () => (await import("../agents/tools/help/listFields/adapter.js")).listLayerFieldsTool
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
"goToAddress",
|
|
21
|
+
async () => (await import("../agents/tools/navigation/goToAddress/adapter.js")).goToAddressTool
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"goToBookmark",
|
|
25
|
+
async () => (await import("../agents/tools/navigation/goToBookmark/adapter.js")).goToBookmarkTool
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
"goToFeatures",
|
|
29
|
+
async () => (await import("../agents/tools/navigation/goToFeatures/adapter.js")).goToFeaturesTool
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
"goToFullExtent",
|
|
33
|
+
async () => (await import("../agents/tools/navigation/goToFullExtent/adapter.js")).goToFullExtentTool
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"goToHomeExtent",
|
|
37
|
+
async () => (await import("../agents/tools/navigation/goToHomeExtent/adapter.js")).goToHomeExtentTool
|
|
38
|
+
],
|
|
39
|
+
[
|
|
40
|
+
"goToLayer",
|
|
41
|
+
async () => (await import("../agents/tools/navigation/goToLayer/adapter.js")).goToLayerTool
|
|
42
|
+
],
|
|
43
|
+
[
|
|
44
|
+
"goToScale",
|
|
45
|
+
async () => (await import("../agents/tools/navigation/goToScale/adapter.js")).goToScaleTool
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"goToViewpoint",
|
|
49
|
+
async () => (await import("../agents/tools/navigation/goToViewpoint/adapter.js")).goToViewpointTool
|
|
50
|
+
],
|
|
51
|
+
[
|
|
52
|
+
"goToZoom",
|
|
53
|
+
async () => (await import("../agents/tools/navigation/goToZoom/adapter.js")).goToZoomTool
|
|
54
|
+
],
|
|
55
|
+
[
|
|
56
|
+
"findRelevantFields",
|
|
57
|
+
async () => (await import("../agents/tools/search/findRelevantFields/adapter.js")).findRelevantFieldsTool
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"findRelevantLayers",
|
|
61
|
+
async () => (await import("../agents/tools/search/findRelevantLayers/adapter.js")).findRelevantLayersTool
|
|
62
|
+
],
|
|
63
|
+
[
|
|
64
|
+
"getAttribute",
|
|
65
|
+
async () => (await import("../agents/tools/query/getAttribute/adapter.js")).getAttributeTool
|
|
66
|
+
],
|
|
67
|
+
[
|
|
68
|
+
"getStatistics",
|
|
69
|
+
async () => (await import("../agents/tools/query/getStatistics/adapter.js")).getStatisticsTool
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"getTopFeatures",
|
|
73
|
+
async () => (await import("../agents/tools/query/getTopFeatures/adapter.js")).getTopFeaturesTool
|
|
74
|
+
],
|
|
75
|
+
[
|
|
76
|
+
"queryFeatures",
|
|
77
|
+
async () => (await import("../agents/tools/query/queryFeatures/adapter.js")).queryFeaturesTool
|
|
78
|
+
]
|
|
79
|
+
]);
|
|
80
|
+
async function e(o) {
|
|
81
|
+
const t = a.get(o);
|
|
82
|
+
if (!t)
|
|
83
|
+
throw new Error(`"${o}" tool not found`);
|
|
84
|
+
return await t();
|
|
85
|
+
}
|
|
86
|
+
export {
|
|
87
|
+
e as r
|
|
88
|
+
};
|
|
@@ -1,7 +1,24 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
const e = `##
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
const e = `## Membership Bind Parameters
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
The current link chart contains a subset of entities and relationships from the database. Their membership is available to Cypher queries as lists of string identifiers through these bind parameters:
|
|
5
|
+
|
|
6
|
+
- $entityIds
|
|
7
|
+
- $relationshipIds
|
|
8
|
+
|
|
9
|
+
If, and ONLY if, the user is asking for data to be limited by the records already on 'the current link chart', 'my link chart', or similar, the generated Cypher should filter using these parameters.
|
|
10
|
+
|
|
11
|
+
### START EXAMPLES
|
|
12
|
+
|
|
13
|
+
User request: 'Add all records that are connected to people on this link chart to the link chart'
|
|
14
|
+
Context: 'Person' entity in data model.
|
|
15
|
+
Expected Result: MATCH (n:Person)-[r]->(m) WHERE id(n) IN $entityIds return r, m
|
|
16
|
+
|
|
17
|
+
User request: 'Add all the suppliers to the link chart'
|
|
18
|
+
Context: 'Supplier' entity in the data model.
|
|
19
|
+
Expected Result: MATCH (s:Supplier) RETURN s
|
|
20
|
+
|
|
21
|
+
### END EXAMPLES
|
|
5
22
|
`;
|
|
6
23
|
export {
|
|
7
24
|
e as default
|
|
@@ -1,7 +1,36 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
const e = `##
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
const e = `## Membership Bind Parameters
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
The current map contains a subset of entities and relationships from the database. Their membership is available to Cypher queries as lists of string identifiers through these bind parameters:
|
|
5
|
+
|
|
6
|
+
- $entityIds
|
|
7
|
+
- $relationshipIds
|
|
8
|
+
|
|
9
|
+
Included Types:
|
|
10
|
+
{nonDynamicTypes}
|
|
11
|
+
|
|
12
|
+
Filtering rules:
|
|
13
|
+
|
|
14
|
+
- Apply membership filtering only when BOTH are true:
|
|
15
|
+
- The user is asking for data to be limited by the records already on 'the current map', 'my map', 'the knowledge graph layer' or similar.
|
|
16
|
+
- The variable in the cypher query is a type in Included Types above.
|
|
17
|
+
- IMPORTANT: In all other cases, DO NOT apply membership filtering. DO NOT include membership filters for any type not listed in Included Types above.
|
|
18
|
+
|
|
19
|
+
### START EXAMPLES
|
|
20
|
+
|
|
21
|
+
User request: 'Add all records that are connected to people on this map to the map'
|
|
22
|
+
Context: 'Person' entity in data model and included in the bind parameter types above.
|
|
23
|
+
Expected Result: MATCH (n:Person)-[r]->(m) WHERE id(n) IN $entityIds return r, m
|
|
24
|
+
|
|
25
|
+
User request: 'Add all the suppliers to the map'
|
|
26
|
+
Context: 'Supplier' entity in the data model.
|
|
27
|
+
Expected Result: MATCH (s:Supplier) RETURN s
|
|
28
|
+
|
|
29
|
+
User request: 'Add all suppliers connected to plants on my map'
|
|
30
|
+
Context: 'Plant' entity in data model but not included in the bind parameter types above.
|
|
31
|
+
Expected Result: MATCH (p:Plant)-[r]->(s:Supplier) return r, s
|
|
32
|
+
|
|
33
|
+
### END EXAMPLES
|
|
5
34
|
`;
|
|
6
35
|
export {
|
|
7
36
|
e as default
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
const e = `# ArcGIS Knowledge Graph Cypher Rules
|
|
3
|
+
|
|
4
|
+
## GOAL
|
|
5
|
+
|
|
6
|
+
Generate a Cypher query that answers the user’s request and conforms to the data model.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 1. USER OVERRIDES (HIGHEST PRIORITY)
|
|
11
|
+
|
|
12
|
+
If the user specifies any of the following, ALWAYS follow their instructions over defaults:
|
|
13
|
+
|
|
14
|
+
- LIMIT (or no limit)
|
|
15
|
+
- Output columns / data model
|
|
16
|
+
- Inclusion/exclusion of globalid
|
|
17
|
+
- Ordering, grouping, filtering, projection
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 2. DATA MODEL CONFORMANCE (NON-NEGOTIABLE)
|
|
22
|
+
|
|
23
|
+
Use ONLY valid data model elements.
|
|
24
|
+
|
|
25
|
+
### Required
|
|
26
|
+
|
|
27
|
+
- Use only valid entity types, relationship types, and properties
|
|
28
|
+
- Ensure relationships connect valid entity types
|
|
29
|
+
- infer direction from user prompt. if not clear use the least restrictive valid form supported by the model.
|
|
30
|
+
|
|
31
|
+
### VALIDATION RULES (STRICT)
|
|
32
|
+
|
|
33
|
+
- Enforce exact schema match: all entities, relationships, and properties must exist exactly in the data model
|
|
34
|
+
- Validate relationship integrity: types, source→target pairing, and direction must match schema
|
|
35
|
+
- Enforce field correctness: properties and filters must exist on the referenced type and use valid data types
|
|
36
|
+
- Ensure alias consistency: each alias maps to one type only and cannot change meaning
|
|
37
|
+
- Apply strict failure: if any component is invalid, do NOT generate the query and do NOT infer or repair
|
|
38
|
+
|
|
39
|
+
## 4. PATH RESOLUTION
|
|
40
|
+
|
|
41
|
+
- First attempt a direct relationship
|
|
42
|
+
- If none exists → use a valid multi-hop path
|
|
43
|
+
- Each hop MUST be valid in the data model
|
|
44
|
+
- Max path length: 3 (unless user requests more)
|
|
45
|
+
|
|
46
|
+
### Path selection
|
|
47
|
+
|
|
48
|
+
- Prefer shortest valid path
|
|
49
|
+
- If multiple valid paths exist → choose best match to user intent
|
|
50
|
+
- If no valid path exists → do not speculate
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 5. PERFORMANCE
|
|
55
|
+
|
|
56
|
+
- Use the minimal number of entities and relationships
|
|
57
|
+
- Prefer shortest valid path
|
|
58
|
+
- Avoid unnecessary patterns or complexity
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 6. CYPHER RULES
|
|
63
|
+
|
|
64
|
+
- UNION queries must return identical columns
|
|
65
|
+
- Apply LIMIT only after UNION (not inside subqueries)
|
|
66
|
+
- Do NOT use: OVER, REDUCE()
|
|
67
|
+
- Do NOT use reserved keywords as variables (call, match, return, as etc.)
|
|
68
|
+
- Use only valid openCypher syntax
|
|
69
|
+
- After OPTIONAL MATCH, always add:
|
|
70
|
+
WITH ...
|
|
71
|
+
WHERE var IS NOT NULL
|
|
72
|
+
before using var in any MATCH or relationship pattern.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 7. SPATIAL RULES
|
|
77
|
+
|
|
78
|
+
- Prefer graph relationships over spatial functions
|
|
79
|
+
- Use spatial functions only when necessary
|
|
80
|
+
- Always ensure geometry is not null if using spatial functions
|
|
81
|
+
- for example: WHERE n.shape IS NOT NULL
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 9. DEFAULT OUTPUT (IF NOT SPECIFIED)
|
|
86
|
+
|
|
87
|
+
- Add LIMIT 50 unless results are clearly small
|
|
88
|
+
- Use descriptive aliases with AS
|
|
89
|
+
- ALWAYS Return full entities and relationships unless user requests specific properties
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 11. OUTPUT FORMAT
|
|
94
|
+
|
|
95
|
+
- Valid → return ONLY Cypher query
|
|
96
|
+
- No explanation
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
`;
|
|
100
|
+
export {
|
|
101
|
+
e as default
|
|
102
|
+
};
|
|
@@ -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 Agent - Lucene Generation for Graph Search
|
|
3
3
|
|
|
4
4
|
You are an assistant that generates a lucene query for graph query searching.
|