@arcgis/ai-components 5.2.0-next.11 → 5.2.0-next.111
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/LLMAgent.d.ts +9 -7
- package/dist/agent-utils/LLMAgent.js +63 -60
- package/dist/agent-utils/WorkflowAgent.js +14 -15
- package/dist/agent-utils/index.d.ts +78 -0
- package/dist/agent-utils/index.js +116 -97
- package/dist/agent-utils/middlewares/trace.d.ts +2 -0
- package/dist/agent-utils/middlewares/trace.js +5 -5
- package/dist/agent-utils/types.d.ts +13 -13
- 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 +229 -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/HumanInTheLoopNode.d.ts +37 -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 +30 -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 +20 -0
- package/dist/{cdn/WNS5ZUF5.js → agents/runtime/skill/types.js} +1 -1
- 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/2BNQ6A6J.js +2 -0
- package/dist/cdn/2MWUBKWI.js +2 -0
- package/dist/cdn/{F6QHMKF5.js → 2O4DON37.js} +1 -1
- package/dist/cdn/2W7LK4HA.js +2 -0
- package/dist/cdn/33PB7ALY.js +2 -0
- package/dist/cdn/{5CV7R5IS.js → 33SFAZQG.js} +5 -5
- package/dist/cdn/34O57OGV.js +2 -0
- package/dist/cdn/{5W7S2RS4.js → 3UEKINYC.js} +1 -1
- package/dist/cdn/4IU63OWQ.js +2 -0
- package/dist/cdn/5A355PGH.js +14 -0
- package/dist/cdn/5HBAJ57P.js +2 -0
- package/dist/cdn/5MK44FNO.js +2 -0
- package/dist/cdn/5Q2XRQS6.js +2 -0
- package/dist/cdn/6ECRQVHY.js +2 -0
- package/dist/cdn/6OOZSZRJ.js +2 -0
- package/dist/cdn/6OUIUXAJ.js +2 -0
- package/dist/cdn/{UPEEHMSY.js → 6P44KOKX.js} +1 -1
- package/dist/cdn/73TMZQI5.js +2 -0
- package/dist/cdn/74CVYM72.js +19 -0
- package/dist/cdn/7EHOFQ2P.js +3 -0
- package/dist/cdn/7KSFIRXB.js +2 -0
- package/dist/cdn/AHCXG7XF.js +2 -0
- package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
- package/dist/cdn/{Q7TL5Q5N.js → APFZY4PI.js} +1 -1
- package/dist/cdn/AVRS6UCQ.js +2 -0
- package/dist/cdn/AVZ5Y6BK.js +11 -0
- package/dist/cdn/AXTQU5YL.js +56 -0
- package/dist/cdn/BBPD2AS7.js +2 -0
- package/dist/cdn/BFZ5S7NF.js +2 -0
- package/dist/cdn/{6ZW7Z36F.js → BL273EGZ.js} +3 -3
- package/dist/cdn/C7JPWFZE.js +2 -0
- package/dist/cdn/CCC6LBMY.js +2 -0
- package/dist/cdn/{5ZZGKP7N.js → CEKOEHB3.js} +1 -1
- package/dist/cdn/CFAC4FN3.js +2 -0
- package/dist/cdn/COH3QXWG.js +4 -0
- package/dist/cdn/DB2TFPIO.js +2 -0
- package/dist/cdn/DE26DAW5.js +2 -0
- package/dist/cdn/DG27JEYG.js +50 -0
- package/dist/cdn/DKA6PSYN.js +2 -0
- package/dist/cdn/DQ2Z65UO.js +3 -0
- package/dist/cdn/DWH23NJN.js +2 -0
- package/dist/cdn/EDXTPEEU.js +2 -0
- package/dist/cdn/ENM3L4AC.js +2 -0
- package/dist/cdn/EVMIYZWD.js +2 -0
- package/dist/cdn/EYOWRGDP.js +2 -0
- package/dist/cdn/EYY367WR.js +2 -0
- package/dist/cdn/F5NIRETW.js +2 -0
- package/dist/cdn/FCI6M62J.js +2 -0
- package/dist/cdn/FDOMMK2M.js +2 -0
- package/dist/cdn/FS7GXTTQ.js +6 -0
- package/dist/cdn/{T537PKP4.js → FYZATVB3.js} +1 -1
- package/dist/cdn/H6P3WP5D.js +14 -0
- package/dist/cdn/HHP5YLUI.js +2 -0
- package/dist/cdn/HIAQARIQ.js +2 -0
- package/dist/cdn/HMIDFTEI.js +2 -0
- package/dist/cdn/HMNBUGH2.js +2 -0
- package/dist/cdn/HR6GWPKX.js +2 -0
- package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
- package/dist/cdn/IH26MIYY.js +2 -0
- package/dist/cdn/IHP25JWI.js +99 -0
- package/dist/cdn/IYLFJCJ2.js +181 -0
- package/dist/cdn/J6A4AS7E.js +22 -0
- package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
- package/dist/cdn/JICNSK6Y.js +6 -0
- package/dist/cdn/JQYLMTDP.js +2 -0
- package/dist/cdn/K5JVB6FU.js +2 -0
- package/dist/cdn/K7XWGSLN.js +2 -0
- package/dist/cdn/K7YQIJFT.js +2 -0
- package/dist/cdn/KH4V4I3W.js +2 -0
- package/dist/cdn/KMLJS2VW.js +2 -0
- package/dist/cdn/LAVFUDUG.js +2 -0
- package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
- package/dist/cdn/LOQ2PKV5.js +208 -0
- package/dist/cdn/LXPGQNXQ.js +5 -0
- package/dist/cdn/MJSIYEWN.js +2 -0
- package/dist/cdn/{ZEYIBYSF.js → MWYBF3F3.js} +1 -1
- package/dist/cdn/{24QNMEFG.js → MXTXJKFE.js} +1 -1
- package/dist/cdn/NEV6OZN3.js +71 -0
- package/dist/cdn/O4NVW75A.js +2 -0
- package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
- package/dist/cdn/OMF6ITSG.js +2 -0
- package/dist/cdn/ONQ6JSBJ.js +2 -0
- package/dist/cdn/OZAZ277H.js +2 -0
- package/dist/cdn/P4GFYBBO.js +3 -0
- package/dist/cdn/P4XZMBU5.js +2 -0
- package/dist/cdn/POL6HKCG.js +72 -0
- package/dist/cdn/POZYDAU2.js +2 -0
- package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
- package/dist/cdn/PYGX4HN7.js +2 -0
- package/dist/cdn/QNXI3WOF.js +179 -0
- package/dist/cdn/{DXVU45KM.js → QRMRID2M.js} +1 -1
- package/dist/cdn/R74ZHFA6.js +2 -0
- package/dist/cdn/RFVZ7KCG.js +66 -0
- package/dist/cdn/RHYNE5OE.js +2 -0
- package/dist/cdn/RLEHNAIA.js +2 -0
- package/dist/cdn/ROQGPAR5.js +9 -0
- package/dist/cdn/RXF2NUOL.js +2 -0
- package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
- package/dist/cdn/SHI76XUV.js +2 -0
- package/dist/cdn/SITY6L4S.js +2 -0
- package/dist/cdn/STHBRTTD.js +2 -0
- package/dist/cdn/{WAIFKDR3.js → SXM4NUT5.js} +1 -1
- package/dist/cdn/SZRJTQ54.js +2 -0
- package/dist/cdn/TO2NY7EA.js +2 -0
- package/dist/cdn/TPULIO6I.js +34 -0
- package/dist/cdn/TVEEQSMF.js +2 -0
- package/dist/cdn/TWU3QXAS.js +2 -0
- package/dist/cdn/TYATJUNF.js +2 -0
- package/dist/cdn/UCTC4JN4.js +3 -0
- package/dist/cdn/UDRKUVZP.js +2 -0
- package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
- package/dist/cdn/UHICISBZ.js +2 -0
- package/dist/cdn/UO5PBOQR.js +2 -0
- package/dist/cdn/UZLQALHY.js +2 -0
- package/dist/cdn/V6HOUZPZ.js +2 -0
- package/dist/cdn/{P7DG5T3Z.js → V7Y22FRP.js} +1 -1
- package/dist/cdn/VAXH6RUQ.js +134 -0
- package/dist/cdn/VNLSYVPE.js +2 -0
- package/dist/cdn/VR3CF3ZY.js +2 -0
- package/dist/cdn/VWP2B4LB.js +2 -0
- package/dist/cdn/VXFQANGJ.js +2 -0
- package/dist/cdn/WKZHFSH3.js +2 -0
- package/dist/cdn/{AZGGTNA3.js → WSWB3B7B.js} +1 -1
- package/dist/cdn/WVP73XWD.js +2 -0
- package/dist/cdn/WXQ26G5Q.js +2 -0
- package/dist/cdn/XQ3NBBQ3.js +2 -0
- package/dist/cdn/{7CYGX4F4.js → YHWYTHID.js} +1 -1
- package/dist/cdn/YIZ7PR2G.js +2 -0
- package/dist/cdn/Z5XQLSYH.js +2 -0
- package/dist/cdn/ZFOG3KXV.js +2 -0
- package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
- package/dist/cdn/agent-utils/index.js +1 -1
- package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +1 -2
- package/dist/cdn/agent-utils/middlewares/middleware.js +1 -1
- package/dist/cdn/agent-utils/middlewares/trace.js +1 -1
- 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 +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 +1126 -2010
- package/dist/chunks/aiFactory.js +100 -0
- package/dist/chunks/arcgisKnowledgeGraph.js +96 -76
- package/dist/chunks/arcgisToolRegistry.js +88 -0
- package/dist/chunks/arcgis_knowledge_current_lc_context.js +19 -2
- package/dist/chunks/arcgis_knowledge_current_map_context.js +31 -2
- package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
- package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +116 -27
- package/dist/chunks/baseAgentState.js +58 -0
- package/dist/chunks/converterUtils.js +66 -41
- package/dist/chunks/dataExplorationAgent.js +19 -0
- package/dist/chunks/data_explore_query_prompt.js +9 -4
- package/dist/chunks/fetchAgentContext.js +13 -0
- package/dist/chunks/fetchService.js +10 -0
- package/dist/chunks/fieldStatistics.js +79 -0
- package/dist/chunks/formatFeatureAttributes.js +132 -0
- package/dist/chunks/generateLayerDescriptions.js +183 -307
- package/dist/chunks/helpAgent.js +34 -0
- package/dist/chunks/help_prompt.js +34 -17
- package/dist/chunks/intent_prompt.js +2 -2
- package/dist/chunks/layerStylingGraph.js +101 -83
- package/dist/chunks/mergeWhereClauses.js +15 -0
- package/dist/chunks/navigationAgent.js +27 -0
- package/dist/chunks/navigation_intent_prompt.js +8 -2
- package/dist/chunks/orchestrator.js +445 -234
- package/dist/chunks/requireAgentServices.js +11 -0
- package/dist/chunks/resolvePointGeometryFilter.js +92 -0
- package/dist/chunks/state.js +39 -45
- package/dist/chunks/utils2.js +11 -11
- package/dist/components/arcgis-assistant/customElement.d.ts +102 -1
- package/dist/components/arcgis-assistant/customElement.js +331 -183
- package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +674 -10
- package/dist/components/arcgis-assistant-chat/customElement.js +22 -17
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +34 -8
- package/dist/components/arcgis-assistant-help-agent/customElement.js +31 -8
- package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
- package/dist/components/arcgis-assistant-interrupt/customElement.js +11 -12
- package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +12 -8
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +1 -1
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +40 -16
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +30 -7
- package/dist/components/arcgis-assistant-message/customElement.d.ts +3 -0
- package/dist/components/arcgis-assistant-message/customElement.js +9 -8
- package/dist/components/arcgis-assistant-message-block/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 +11 -10
- package/dist/components/arcgis-assistant-message-text/customElement.d.ts +1 -0
- package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +33 -9
- package/dist/components/arcgis-assistant-speech-input/customElement.js +34 -52
- package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
- package/dist/components/arcgis-assistant-user-message/customElement.js +15 -10
- 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/loader.js +6 -6
- 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 +707 -83
- 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/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/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,7 +1,28 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const
|
|
2
|
+
const n = `## Who you are
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
You are a map assistant embedded inside a GIS application. You have no knowledge of history, science, people, events, cooking, or anything outside of this map and its data. You only know what is described in the Map Context below.
|
|
5
|
+
|
|
6
|
+
If asked anything outside of that context, you simply don't have that information — respond naturally and redirect to something you _can_ help with, using specific layer and field names from the map context.
|
|
7
|
+
|
|
8
|
+
Example of how to handle unknown topics:
|
|
9
|
+
"I don't have information on that — I only know about this map. You could ask me to list all layers in the map, or capabilities of this assistant."
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Your capabilities
|
|
14
|
+
|
|
15
|
+
You can help users with:
|
|
16
|
+
|
|
17
|
+
- Listing the layers in this map
|
|
18
|
+
- Listing the fields in a specific layer (use the tool)
|
|
19
|
+
- Suggesting specific queries using actual layer and field names
|
|
20
|
+
- Summarizing what this map contains and what users can do with it
|
|
21
|
+
- Letting users know when a map-related action isn't supported (e.g. charts, tables), and that it may be added in the future
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Input
|
|
5
26
|
|
|
6
27
|
Assigned task:
|
|
7
28
|
{assignedTask}
|
|
@@ -12,11 +33,13 @@ Latest user request:
|
|
|
12
33
|
Prior steps:
|
|
13
34
|
{priorSteps}
|
|
14
35
|
|
|
15
|
-
Use the assigned task as the primary instruction
|
|
16
|
-
Use the latest user request as supporting context
|
|
17
|
-
Use prior steps only
|
|
36
|
+
Use the assigned task as the primary instruction. The question will **not** be restated again here.
|
|
37
|
+
Use the latest user request as supporting context.
|
|
38
|
+
Use prior steps only to explain a previous result, failure, or likely next action.
|
|
39
|
+
|
|
40
|
+
---
|
|
18
41
|
|
|
19
|
-
|
|
42
|
+
## Map Context
|
|
20
43
|
|
|
21
44
|
{layerSummary}
|
|
22
45
|
|
|
@@ -24,15 +47,6 @@ Use prior steps only when needed to explain a previous result, failure, or likel
|
|
|
24
47
|
|
|
25
48
|
{agents}
|
|
26
49
|
|
|
27
|
-
### Rules
|
|
28
|
-
|
|
29
|
-
- "What layers are in this map?" → List the layer names
|
|
30
|
-
- "What fields are in this layer?" → Call the tool to list the field names for that layer
|
|
31
|
-
- "What can you do?" / "What can I ask?" → Suggest specific queries using EXACT layer and field names from the context above
|
|
32
|
-
- "Tell me about this map" → Summarize layers and capabilities
|
|
33
|
-
- "Create a chart of all wells ans their depth" → If a question is map related but not supported by available capabilities, say so. Add that support for this might be added in the future.
|
|
34
|
-
- Questions completely unrelated to maps/GIS → Politely explain you only help with the map |
|
|
35
|
-
|
|
36
50
|
### Response Guidelines
|
|
37
51
|
|
|
38
52
|
When suggesting what users can ask, be SPECIFIC using actual layer names:
|
|
@@ -46,12 +60,15 @@ For "what can I ask" responses, provide 3-5 specific example queries using field
|
|
|
46
60
|
For off-topic questions:
|
|
47
61
|
"I can only help with this map. Try asking me to filter [LayerName] by [FieldName], or zoom to a location."
|
|
48
62
|
|
|
49
|
-
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Format
|
|
50
66
|
|
|
51
67
|
- Keep responses concise
|
|
52
68
|
- Use bullet points for lists
|
|
53
69
|
- Use new lines (\\n) and appropriate formatting in your response
|
|
70
|
+
- Use actual layer and field names from the map context in any suggestions
|
|
54
71
|
`;
|
|
55
72
|
export {
|
|
56
|
-
|
|
73
|
+
n as default
|
|
57
74
|
};
|
|
@@ -99,7 +99,7 @@ Do not reinterpret the request into a different form.
|
|
|
99
99
|
|
|
100
100
|
## Follow-up Reference Resolution
|
|
101
101
|
|
|
102
|
-
If the latest user request refers to prior results or prior context using a referential phrase such as "these", "those", "them", "that set",
|
|
102
|
+
If the latest user request refers to prior results or prior context using a referential phrase such as "these", "those", "them", "that set", "the previous results", "this", "it", "that one", "this parcel", "this location", or "that feature", then the request depends on earlier context.
|
|
103
103
|
|
|
104
104
|
This also applies to equivalent referential wording in other languages.
|
|
105
105
|
|
|
@@ -107,7 +107,7 @@ Resolve the reference using the most recent relevant chat history or successful
|
|
|
107
107
|
|
|
108
108
|
In this case, the \`assignedTask\` should be standalone and should preserve the referenced prior constraints while adding only the new constraint or question from the latest user request.
|
|
109
109
|
|
|
110
|
-
Do not leave ambiguous references like "these", "those", or "
|
|
110
|
+
Do not leave ambiguous references like "these", "those", "them", "this", or "it" in \`assignedTask\` when they can be resolved from context.
|
|
111
111
|
|
|
112
112
|
---
|
|
113
113
|
|
|
@@ -1,30 +1,47 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { NodeInterrupt as
|
|
2
|
+
import { NodeInterrupt as w, StateGraph as L, START as E, END as m } from "@langchain/langgraph/web";
|
|
3
3
|
import "@arcgis/core/identity/IdentityManager.js";
|
|
4
4
|
import "@arcgis/core/portal/Portal.js";
|
|
5
|
-
import
|
|
5
|
+
import "@arcgis/core/request.js";
|
|
6
|
+
import "@arcgis/toolkit/string";
|
|
7
|
+
import { i as v } from "./generateLayerDescriptions.js";
|
|
6
8
|
import "@langchain/core/messages";
|
|
7
|
-
import { s
|
|
9
|
+
import { s } from "./index.js";
|
|
10
|
+
import "@langchain/core/callbacks/base";
|
|
8
11
|
import "@langchain/openai";
|
|
9
12
|
import "@arcgis/core/config.js";
|
|
10
13
|
import "@arcgis/core/core/reactiveUtils.js";
|
|
11
14
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
12
|
-
import "@arcgis/core/request.js";
|
|
13
15
|
import "@langchain/core/prompts";
|
|
14
|
-
import { f as g
|
|
15
|
-
import {
|
|
16
|
-
import { ToolNode as
|
|
17
|
-
|
|
16
|
+
import { f as g } from "./fetchService.js";
|
|
17
|
+
import { j as I, k as T, l as R, m as F, n as $, o as C, p as A, r as N, u as q, v as M, w as _, e as b, L as S } from "./adapter.js";
|
|
18
|
+
import { ToolNode as k } from "@langchain/langgraph/prebuilt";
|
|
19
|
+
import { r as j } from "./requireAgentServices.js";
|
|
20
|
+
const P = async (r, e) => {
|
|
21
|
+
const t = r.tool_calls ?? [];
|
|
22
|
+
if (t.length === 0) {
|
|
23
|
+
await s({ text: `LLM did not request any tool calls: ${String(r?.content)}` }, e);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
await Promise.all(
|
|
27
|
+
t.map(
|
|
28
|
+
async (a) => await s(
|
|
29
|
+
{ text: `LLM invoked ${a.name} tool with arguments: ${JSON.stringify(a.args, null, 2)}` },
|
|
30
|
+
e
|
|
31
|
+
)
|
|
32
|
+
)
|
|
33
|
+
);
|
|
34
|
+
}, h = 0.7, V = 10, z = async (r, e) => {
|
|
18
35
|
try {
|
|
19
|
-
await
|
|
20
|
-
const
|
|
21
|
-
text:
|
|
22
|
-
layerIds:
|
|
36
|
+
await s({ text: "Similarity search to find fields" }, e);
|
|
37
|
+
const t = g(e, "fieldSearch"), a = g(e, "layersAndFieldsRegistry"), o = g(e, "embeddingCache"), n = await t.searchFields({
|
|
38
|
+
text: r.agentExecutionContext.assignedTask,
|
|
39
|
+
layerIds: r.vectorSearchLayerIds,
|
|
23
40
|
minScore: h,
|
|
24
|
-
topResults:
|
|
41
|
+
topResults: V,
|
|
25
42
|
embeddingCache: o
|
|
26
43
|
}), c = n.map(({ layerId: d, results: p }) => {
|
|
27
|
-
const y = p.map((
|
|
44
|
+
const y = p.map((i) => ` - ${i.name} (${i.score.toFixed(2)})`).join(`
|
|
28
45
|
`);
|
|
29
46
|
return `${a.get(d)?.layerItem.name ?? d}:
|
|
30
47
|
${y}`;
|
|
@@ -32,128 +49,128 @@ ${y}`;
|
|
|
32
49
|
`);
|
|
33
50
|
let l;
|
|
34
51
|
return n.length > 0 ? l = `Vector search completed. Matching layers and fields with scores:
|
|
35
|
-
${c}` : l = `No vector search results found for score over ${h}.`, await
|
|
36
|
-
...
|
|
52
|
+
${c}` : l = `No vector search results found for score over ${h}.`, await s({ text: l }, e), {
|
|
53
|
+
...r,
|
|
37
54
|
vectorSearchFieldResults: n
|
|
38
55
|
};
|
|
39
|
-
} catch (
|
|
40
|
-
throw await
|
|
41
|
-
{ text: `Error during vector search: ${
|
|
56
|
+
} catch (t) {
|
|
57
|
+
throw await s(
|
|
58
|
+
{ text: `Error during vector search: ${t instanceof Error ? t.message : String(t)}` },
|
|
42
59
|
e
|
|
43
|
-
), new Error(`Vector search failed: ${
|
|
60
|
+
), new Error(`Vector search failed: ${t instanceof Error ? t.message : String(t)}`);
|
|
44
61
|
}
|
|
45
|
-
},
|
|
62
|
+
}, D = 0.7, H = async (r, e) => {
|
|
46
63
|
try {
|
|
47
|
-
await
|
|
48
|
-
{ text: `Similarity search to find layers: ${
|
|
64
|
+
await s(
|
|
65
|
+
{ text: `Similarity search to find layers: ${r.agentExecutionContext.assignedTask}` },
|
|
49
66
|
e
|
|
50
67
|
);
|
|
51
|
-
const
|
|
52
|
-
text:
|
|
53
|
-
minScore:
|
|
68
|
+
const t = g(e, "layerSearch"), a = g(e, "layersAndFieldsRegistry"), o = await t.searchLayers({
|
|
69
|
+
text: r.agentExecutionContext.assignedTask,
|
|
70
|
+
minScore: D
|
|
54
71
|
}), n = o.map((d) => d.id), c = o.map(({ id: d, score: p }) => `${a.get(d)?.layerItem.name ?? d} (${p.toFixed(2)})`).join(`
|
|
55
72
|
`);
|
|
56
73
|
let l;
|
|
57
74
|
return n.length > 0 ? l = `Vector search completed. Matching layers with scores:
|
|
58
|
-
${c}` : l = "Vector search completed. No matching layers found.", await
|
|
59
|
-
...
|
|
75
|
+
${c}` : l = "Vector search completed. No matching layers found.", await s({ text: l }, e), {
|
|
76
|
+
...r,
|
|
60
77
|
vectorSearchLayerIds: n
|
|
61
78
|
};
|
|
62
|
-
} catch (
|
|
63
|
-
throw await
|
|
64
|
-
{ text: `Error during vector search: ${
|
|
79
|
+
} catch (t) {
|
|
80
|
+
throw await s(
|
|
81
|
+
{ text: `Error during vector search: ${t instanceof Error ? t.message : String(t)}` },
|
|
65
82
|
e
|
|
66
|
-
), new Error(`Vector search failed: ${
|
|
83
|
+
), new Error(`Vector search failed: ${t instanceof Error ? t.message : String(t)}`);
|
|
67
84
|
}
|
|
68
85
|
}, f = [
|
|
69
|
-
|
|
86
|
+
I,
|
|
70
87
|
T,
|
|
71
88
|
R,
|
|
72
89
|
F,
|
|
90
|
+
$,
|
|
73
91
|
C,
|
|
74
92
|
A,
|
|
75
|
-
$,
|
|
76
93
|
N,
|
|
77
|
-
b,
|
|
78
94
|
q,
|
|
79
|
-
M
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
95
|
+
M,
|
|
96
|
+
_
|
|
97
|
+
], x = (r, e = 3) => {
|
|
98
|
+
const t = r.map((o, n) => o.type === "human" ? n : -1).filter((o) => o !== -1);
|
|
99
|
+
if (t.length === 0)
|
|
83
100
|
return [];
|
|
84
|
-
const a =
|
|
85
|
-
return
|
|
86
|
-
}, G = async (
|
|
87
|
-
await
|
|
88
|
-
const
|
|
101
|
+
const a = t.length > e ? t[t.length - e] : t[0];
|
|
102
|
+
return r.slice(a);
|
|
103
|
+
}, G = async (r, e) => {
|
|
104
|
+
await s({ text: "Requesting LLM for layer query results" }, e);
|
|
105
|
+
const t = await b("navigation_intent_prompt");
|
|
89
106
|
if (!e?.configurable)
|
|
90
107
|
throw new Error("config.configurable is required for layer query tools");
|
|
91
108
|
const a = {
|
|
92
|
-
layerFieldInfo:
|
|
93
|
-
}, o = await
|
|
94
|
-
promptText:
|
|
109
|
+
layerFieldInfo: r.layerFieldInfo
|
|
110
|
+
}, o = await v({
|
|
111
|
+
promptText: t,
|
|
95
112
|
modelTier: "advanced",
|
|
96
113
|
config: e,
|
|
97
|
-
messages: x(
|
|
114
|
+
messages: x(r.agentExecutionContext.messages),
|
|
98
115
|
inputVariables: a,
|
|
99
116
|
tools: f
|
|
100
117
|
});
|
|
101
|
-
return await
|
|
102
|
-
...
|
|
118
|
+
return await P(o, e), {
|
|
119
|
+
...r,
|
|
103
120
|
agentExecutionContext: {
|
|
104
|
-
...
|
|
105
|
-
messages: [...
|
|
121
|
+
...r.agentExecutionContext,
|
|
122
|
+
messages: [...r.agentExecutionContext.messages, o]
|
|
106
123
|
}
|
|
107
124
|
};
|
|
108
125
|
};
|
|
109
|
-
async function
|
|
110
|
-
const a = await new
|
|
126
|
+
async function O(r, e) {
|
|
127
|
+
const a = await new k(f, { handleToolErrors: !1 }).invoke(
|
|
111
128
|
{
|
|
112
|
-
messages: x(
|
|
129
|
+
messages: x(r.agentExecutionContext.messages)
|
|
113
130
|
},
|
|
114
131
|
e
|
|
115
132
|
), o = a.messages.map((c) => c.text).join(`
|
|
116
133
|
`);
|
|
117
|
-
await
|
|
134
|
+
await s({ text: `Finished executing layer filter tool: ${o}` }, e);
|
|
118
135
|
const n = a.messages.map((c) => c.text).join(`
|
|
119
136
|
`);
|
|
120
|
-
return { ...
|
|
137
|
+
return { ...r, outputMessage: n };
|
|
121
138
|
}
|
|
122
|
-
const U = async (
|
|
139
|
+
const U = async (r, e) => (await s({ text: "Exiting Layer Styling agent" }, e), r), B = async (r, e) => {
|
|
123
140
|
try {
|
|
124
|
-
await
|
|
125
|
-
const
|
|
126
|
-
for (const a of
|
|
141
|
+
await s({ text: "Populating layer and field info" }, e);
|
|
142
|
+
const t = [];
|
|
143
|
+
for (const a of r.vectorSearchFieldResults) {
|
|
127
144
|
let o = function(y) {
|
|
128
|
-
const
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
145
|
+
const i = l.get(y)?.layerItem;
|
|
146
|
+
return i ? [
|
|
147
|
+
i.name && `Name: ${i.name}`,
|
|
148
|
+
i.title && `Title: ${i.title}`,
|
|
149
|
+
i.description && `Description: ${i.description}`
|
|
133
150
|
].filter(Boolean).join(" | ") : y;
|
|
134
151
|
};
|
|
135
152
|
const { layerId: n, results: c } = a, l = g(e, "layersAndFieldsRegistry"), d = l.get(n)?.fieldRegistry;
|
|
136
153
|
if (!d)
|
|
137
154
|
continue;
|
|
138
|
-
let p =
|
|
155
|
+
let p = t.find((y) => y.layerId === n);
|
|
139
156
|
p || (p = {
|
|
140
157
|
layerId: n,
|
|
141
158
|
layerSummary: o(n),
|
|
142
159
|
fieldInfos: []
|
|
143
|
-
},
|
|
160
|
+
}, t.push(p));
|
|
144
161
|
for (const y of c) {
|
|
145
|
-
const
|
|
146
|
-
|
|
162
|
+
const i = d.get(y.name);
|
|
163
|
+
i && p.fieldInfos.push(i);
|
|
147
164
|
}
|
|
148
165
|
}
|
|
149
|
-
return await
|
|
150
|
-
} catch (
|
|
151
|
-
throw await
|
|
166
|
+
return await s({ text: "Populated layerFieldInfo" }, e), { ...r, layerFieldInfo: t };
|
|
167
|
+
} catch (t) {
|
|
168
|
+
throw await s({ text: "Error populating layerFieldInfo" }, e), new Error(`Error populating layerFieldInfo: ${t instanceof Error ? t.message : String(t)}`);
|
|
152
169
|
}
|
|
153
|
-
},
|
|
154
|
-
const
|
|
155
|
-
if (
|
|
156
|
-
return { ...
|
|
170
|
+
}, J = (r, e) => {
|
|
171
|
+
const t = r.vectorSearchLayerIds ?? [];
|
|
172
|
+
if (t.length <= 1)
|
|
173
|
+
return { ...r, selectedLayerId: r.vectorSearchLayerIds[0] };
|
|
157
174
|
const { hitlResponse: a } = e.configurable;
|
|
158
175
|
if (a?.agentId !== u.id || a.id !== "reviewLayerSelection") {
|
|
159
176
|
const n = {
|
|
@@ -161,16 +178,16 @@ const U = async (t, e) => (await i({ text: "Exiting Layer Styling agent" }, e),
|
|
|
161
178
|
id: "reviewLayerSelection",
|
|
162
179
|
kind: "singleSelection",
|
|
163
180
|
message: "Choose a layer to apply the styles.",
|
|
164
|
-
metadata: [...
|
|
181
|
+
metadata: [...t]
|
|
165
182
|
};
|
|
166
|
-
throw new
|
|
183
|
+
throw new w(n);
|
|
167
184
|
}
|
|
168
185
|
let o = null;
|
|
169
186
|
return Array.isArray(a.payload) && a.payload.length > 0 && (o = a.payload[0]), {
|
|
170
|
-
...
|
|
171
|
-
selectedLayerId: o ??
|
|
187
|
+
...r,
|
|
188
|
+
selectedLayerId: o ?? r.vectorSearchLayerIds[0]
|
|
172
189
|
};
|
|
173
|
-
},
|
|
190
|
+
}, K = (r, e) => j(["layerSearch", "fieldSearch", "layersAndFieldsRegistry"], "Layer Styling Agent")(r, e), Q = () => new L(S).addNode("requireLayerStylingServices", K).addNode("vectorSearchLayers", H).addNode("layerSelectionHITL", J).addNode("vectorSearchFields", z).addNode("populateLayerFieldInfo", B).addNode("agent", G).addNode("tools", O).addNode("earlyExit", U).addEdge(E, "requireLayerStylingServices").addEdge("requireLayerStylingServices", "vectorSearchLayers").addConditionalEdges(
|
|
174
191
|
"layerSelectionHITL",
|
|
175
192
|
(e) => e.vectorSearchLayerIds.length ? "vectorSearchFields" : "earlyExit"
|
|
176
193
|
).addConditionalEdges(
|
|
@@ -188,5 +205,6 @@ const U = async (t, e) => (await i({ text: "Exiting Layer Styling agent" }, e),
|
|
|
188
205
|
workspace: S
|
|
189
206
|
};
|
|
190
207
|
export {
|
|
191
|
-
u as L
|
|
208
|
+
u as L,
|
|
209
|
+
P as h
|
|
192
210
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
const r = (e, s, a) => {
|
|
3
|
+
if (!(a ? e.hasAllFeaturesInView : e.hasAllFeatures))
|
|
4
|
+
return !1;
|
|
5
|
+
const n = new Set((e.availableFields ?? []).map((t) => t.toLowerCase()));
|
|
6
|
+
return n.has("*") ? !0 : s.every((t) => n.has(t.toLowerCase()));
|
|
7
|
+
};
|
|
8
|
+
function u(e, s) {
|
|
9
|
+
let a = e ?? "";
|
|
10
|
+
return s != null && s && (a = a ? `(${a}) AND (${s})` : s), a || null;
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
r as c,
|
|
14
|
+
u as m
|
|
15
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import { createSkillAgent as r } from "../agents/runtime/skill/createSkillAgent.js";
|
|
3
|
+
import { f as n } from "./fetchAgentContext.js";
|
|
4
|
+
const s = ({ config: a }) => {
|
|
5
|
+
const { mapView: e } = n(a, ["mapView"]), t = e.map, o = Number.isFinite(e.zoom) ? e.zoom : void 0;
|
|
6
|
+
return JSON.stringify(
|
|
7
|
+
{
|
|
8
|
+
availableBookmarks: t.bookmarks?.map(({ name: i }) => i).filter(Boolean) ?? [],
|
|
9
|
+
currentZoom: o
|
|
10
|
+
},
|
|
11
|
+
null,
|
|
12
|
+
2
|
|
13
|
+
);
|
|
14
|
+
}, l = [async () => (await import("./SKILL4.js")).default], p = r({
|
|
15
|
+
id: "navigation",
|
|
16
|
+
name: "Navigation Agent",
|
|
17
|
+
description: "Navigates the map for explicit zoom, center, address, bookmark, layer, feature, extent, scale, and viewpoint requests. Use for questions asking where a place is or to resolve an address or place as a reusable spatial anchor for a proximity request. Resolves only the location; it does not query, display, filter, or highlight feature data.",
|
|
18
|
+
skillLoaders: l,
|
|
19
|
+
modelTier: "default",
|
|
20
|
+
systemPrompt: "You are an ArcGIS map navigation agent.",
|
|
21
|
+
runtimeContextLoader: s,
|
|
22
|
+
fallbackMessage: "Navigation request completed.",
|
|
23
|
+
failureMessage: "I couldn't complete the navigation request."
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
p as N
|
|
27
|
+
};
|
|
@@ -36,8 +36,14 @@ This is the order of preference in case of overlap:
|
|
|
36
36
|
|
|
37
37
|
For example, "Where is Yosemite National Park". This is an address, but:
|
|
38
38
|
A map that contains a bookmark with Yosemite National Park should prefer the bookmark.
|
|
39
|
-
|
|
40
|
-
If these do not exist, geocode and go to that address.
|
|
39
|
+
If bookmark does not exist, a map that has the National Parks layer, for example, should prefer the feature.
|
|
40
|
+
If both of these do not exist, geocode and go to that address.
|
|
41
|
+
|
|
42
|
+
Additional mapping guidance:
|
|
43
|
+
|
|
44
|
+
- "zoom/go to [layer]" with no filter → prefer \`goToLayer\`.
|
|
45
|
+
- "zoom/go to [features] where/with ..." (has a condition/filter) → prefer \`goToFeatures\`.
|
|
46
|
+
- Explicit numeric zoom/scale/viewpoint requests → prefer the matching zoom/scale/viewpoint tool.
|
|
41
47
|
|
|
42
48
|
Return the name of the tool as a string.
|
|
43
49
|
`;
|