@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
package/LICENSE.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# Licensing
|
|
2
2
|
|
|
3
|
-
COPYRIGHT
|
|
3
|
+
COPYRIGHT Esri
|
|
4
4
|
|
|
5
5
|
All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
|
|
6
6
|
|
|
7
|
-
This material is licensed for use under the
|
|
7
|
+
This material is licensed for use under the Esri Master License Agreement (MLA), and is bound by the terms of that agreement.
|
|
8
8
|
You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
|
|
9
9
|
|
|
10
|
+
See use restrictions at https://www.esri.com/content/dam/esrisites/en-us/media/legal/ma-full/ma-full.pdf.
|
|
11
|
+
|
|
10
12
|
For additional information, contact:
|
|
11
13
|
Environmental Systems Research Institute, Inc.
|
|
12
14
|
Attn: Contracts and Legal Services Department
|
package/README.md
CHANGED
|
@@ -6,5 +6,5 @@ The ArcGIS Maps SDK for JavaScript provides a suite of ready-to-use UI component
|
|
|
6
6
|
|
|
7
7
|
## License
|
|
8
8
|
|
|
9
|
-
This package is licensed under the terms described in the `LICENSE.md` file, located in the root of the package, and at https://js.arcgis.com/5.
|
|
10
|
-
For third party notices, see https://js.arcgis.com/5.
|
|
9
|
+
This package is licensed under the terms described in the `LICENSE.md` file, located in the root of the package, and at https://js.arcgis.com/5.2/LICENSE.txt.
|
|
10
|
+
For third party notices, see https://js.arcgis.com/5.2/third-party-notices.txt.
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import type { StructuredToolInterface } from "@langchain/core/tools";
|
|
1
2
|
import type { BaseAgent } from "./BaseAgent.js";
|
|
2
3
|
import type { FunctionToolLike } from "./tools/FunctionTool.js";
|
|
3
4
|
import type { AgentCustomState, AgentData, ZodObjectSchema } from "./types.js";
|
|
4
5
|
|
|
6
|
+
export type LLMAgentTool = FunctionToolLike | StructuredToolInterface;
|
|
7
|
+
|
|
5
8
|
/**
|
|
6
9
|
* LLMAgent uses a language model to generate its output based on a provided prompt template and optional tools.
|
|
7
10
|
* It supports structured input and output through Zod schemas, allowing for validation and type safety. The agent's logic is defined by the prompt and the tools it has access to, making it a flexible option for a wide range of use cases.
|
|
@@ -11,9 +14,8 @@ import type { AgentCustomState, AgentData, ZodObjectSchema } from "./types.js";
|
|
|
11
14
|
export class LLMAgent<TInput extends AgentData = AgentData, TOutput extends AgentData = AgentData> extends BaseAgent<AgentCustomState<TInput, TOutput>> {
|
|
12
15
|
constructor(properties?: LLMAgentConstructProperties<TInput, TOutput>);
|
|
13
16
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* state for prompt formatting.
|
|
17
|
+
* Defines the structured input fields available in the agent's graph state.
|
|
18
|
+
* Prompt variables are resolved directly from graph state and do not need to be declared in this schema.
|
|
17
19
|
*/
|
|
18
20
|
accessor inputSchema: ZodObjectSchema<TInput> | undefined;
|
|
19
21
|
/**
|
|
@@ -30,17 +32,17 @@ export class LLMAgent<TInput extends AgentData = AgentData, TOutput extends Agen
|
|
|
30
32
|
accessor outputSchema: ZodObjectSchema<TOutput> | undefined;
|
|
31
33
|
/**
|
|
32
34
|
* Defines the prompt template the agent will use to generate its output.
|
|
33
|
-
* This prompt can include variables that are populated from the agent's state at runtime
|
|
35
|
+
* This prompt can include variables that are populated directly from the agent's state at runtime,
|
|
34
36
|
* allowing for dynamic and context-aware responses from the language model.
|
|
35
37
|
*
|
|
36
|
-
* In this example below, {location} and {weather} would be variables extracted from the agent's state
|
|
38
|
+
* In this example below, {location} and {weather} would be variables extracted from the agent's state.
|
|
37
39
|
*
|
|
38
40
|
* @example "Generate a weather report for {location} based on the current {weather} conditions."
|
|
39
41
|
* @required
|
|
40
42
|
*/
|
|
41
43
|
accessor prompt: string;
|
|
42
|
-
/** The tools property is an optional array of
|
|
43
|
-
accessor tools:
|
|
44
|
+
/** The tools property is an optional array of tools that the agent can use during execution. */
|
|
45
|
+
accessor tools: LLMAgentTool[] | undefined;
|
|
44
46
|
/**
|
|
45
47
|
* Rebuilds internal workspace and createGraph wiring. This is automatically called during initialization and whenever
|
|
46
48
|
* the name or description properties change, but can also be called manually if needed to refresh the agent's graph definition.
|
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import "@arcgis/core/identity/IdentityManager.js";
|
|
3
3
|
import "@arcgis/core/portal/Portal.js";
|
|
4
|
+
import "@arcgis/core/request.js";
|
|
4
5
|
import { isGraphInterrupt as f } from "@langchain/langgraph/web";
|
|
5
|
-
import
|
|
6
|
+
import "@arcgis/toolkit/string";
|
|
7
|
+
import "../chunks/generateLayerDescriptions.js";
|
|
6
8
|
import "@langchain/core/messages";
|
|
7
9
|
import "@langchain/core/callbacks/dispatch/web";
|
|
10
|
+
import "@langchain/core/callbacks/base";
|
|
11
|
+
import { c } from "../chunks/aiFactory.js";
|
|
8
12
|
import { watch as w } from "@arcgis/core/core/reactiveUtils.js";
|
|
9
13
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
10
|
-
import "@
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { BaseAgent as v } from "./BaseAgent.js";
|
|
14
|
+
import { ChatPromptTemplate as u } from "@langchain/core/prompts";
|
|
15
|
+
import { property as n, subclass as v } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
16
|
+
import { createAgent as h, providerStrategy as _ } from "langchain";
|
|
17
|
+
import { BaseAgent as S } from "./BaseAgent.js";
|
|
15
18
|
import { convertToLangChainMiddlewares as l } from "./middlewares/middleware.js";
|
|
16
|
-
import { c as
|
|
17
|
-
import { c as
|
|
18
|
-
import { c as d, h as
|
|
19
|
-
var
|
|
20
|
-
for (var o =
|
|
21
|
-
(
|
|
22
|
-
return
|
|
19
|
+
import { c as T } from "../chunks/graph.js";
|
|
20
|
+
import { c as y } from "../chunks/state.js";
|
|
21
|
+
import { c as d, h as x } from "../chunks/utils.js";
|
|
22
|
+
var M = Object.defineProperty, P = Object.getOwnPropertyDescriptor, m = (t, e, r, s) => {
|
|
23
|
+
for (var o = s > 1 ? void 0 : s ? P(e, r) : e, p = t.length - 1, a; p >= 0; p--)
|
|
24
|
+
(a = t[p]) && (o = (s ? a(e, r, o) : a(o)) || o);
|
|
25
|
+
return s && o && M(e, r, o), o;
|
|
23
26
|
};
|
|
24
|
-
let
|
|
27
|
+
let i = class extends S {
|
|
25
28
|
//#region Lifecycle
|
|
26
29
|
constructor(t) {
|
|
27
30
|
super(t), this.modelTier = "default";
|
|
@@ -51,13 +54,16 @@ let a = class extends v {
|
|
|
51
54
|
return [this.inputSchema, this.outputSchema].filter(Boolean);
|
|
52
55
|
}
|
|
53
56
|
generate() {
|
|
54
|
-
const t =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
const t = this.prompt ? u.fromTemplate(this.prompt).inputVariables : [], e = y(
|
|
58
|
+
this.getSchemas(),
|
|
59
|
+
t
|
|
60
|
+
);
|
|
61
|
+
this._set("workspace", e);
|
|
62
|
+
const r = this.id, s = { [r]: this._invoke.bind(this) }, o = [{ from: r, decide: () => {
|
|
57
63
|
} }];
|
|
58
64
|
this._set(
|
|
59
65
|
"createGraph",
|
|
60
|
-
() =>
|
|
66
|
+
() => T(s, o, e, {
|
|
61
67
|
agent: this,
|
|
62
68
|
entryNode: r,
|
|
63
69
|
middlewares: this.middlewares
|
|
@@ -66,74 +72,71 @@ let a = class extends v {
|
|
|
66
72
|
}
|
|
67
73
|
//#endregion
|
|
68
74
|
//#region Private Methods
|
|
69
|
-
async _invoke(t,
|
|
75
|
+
async _invoke(t, e) {
|
|
70
76
|
try {
|
|
71
|
-
return this.outputSchema ? await this._invokeStructured(t,
|
|
72
|
-
} catch (
|
|
73
|
-
if (f(
|
|
74
|
-
throw
|
|
75
|
-
const
|
|
76
|
-
return d({ outputMessage:
|
|
77
|
+
return this.outputSchema ? await this._invokeStructured(t, e) : await this._invokeUnstructured(t, e);
|
|
78
|
+
} catch (r) {
|
|
79
|
+
if (f(r))
|
|
80
|
+
throw r;
|
|
81
|
+
const s = r instanceof Error ? r.message : String(r);
|
|
82
|
+
return d({ outputMessage: s }, "failed", s);
|
|
77
83
|
}
|
|
78
84
|
}
|
|
79
|
-
async _invokeStructured(t,
|
|
85
|
+
async _invokeStructured(t, e) {
|
|
80
86
|
if (!this.outputSchema)
|
|
81
87
|
throw new Error("Output schema is required for structured invocation.");
|
|
82
|
-
const
|
|
83
|
-
model: await
|
|
88
|
+
const s = await h({
|
|
89
|
+
model: await c({ modelTier: this.modelTier }),
|
|
84
90
|
systemPrompt: await this._getPromptWithInputVariables(t),
|
|
85
91
|
tools: this._getTools(),
|
|
86
92
|
checkpointer: !0,
|
|
87
93
|
middleware: l(this.middlewares),
|
|
88
|
-
responseFormat: this.outputSchema
|
|
89
|
-
}).invoke({ messages: t.agentExecutionContext.messages },
|
|
90
|
-
if (!("structuredResponse" in
|
|
94
|
+
responseFormat: _(this.outputSchema)
|
|
95
|
+
}).invoke({ messages: t.agentExecutionContext.messages }, e);
|
|
96
|
+
if (!("structuredResponse" in s) || s.structuredResponse === void 0)
|
|
91
97
|
throw new Error("LLMAgent did not receive structured output from createAgent.");
|
|
92
|
-
return
|
|
98
|
+
return x(s.structuredResponse, this.outputSchema, s.messages);
|
|
93
99
|
}
|
|
94
|
-
async _invokeUnstructured(t,
|
|
100
|
+
async _invokeUnstructured(t, e) {
|
|
95
101
|
const o = (await h({
|
|
96
|
-
model: await
|
|
102
|
+
model: await c({ modelTier: this.modelTier }),
|
|
97
103
|
systemPrompt: await this._getPromptWithInputVariables(t),
|
|
98
104
|
tools: this._getTools(),
|
|
99
105
|
checkpointer: !0,
|
|
100
106
|
middleware: l(this.middlewares)
|
|
101
|
-
}).invoke({ messages: t.agentExecutionContext.messages },
|
|
107
|
+
}).invoke({ messages: t.agentExecutionContext.messages }, e)).messages, a = o.at(-1)?.text ?? "", g = a.trim() || "LLMAgent completed.";
|
|
102
108
|
return d(
|
|
103
|
-
{ agentExecutionContext: { ...t.agentExecutionContext, messages: o }, outputMessage:
|
|
109
|
+
{ agentExecutionContext: { ...t.agentExecutionContext, messages: o }, outputMessage: a },
|
|
104
110
|
"success",
|
|
105
111
|
g
|
|
106
112
|
);
|
|
107
113
|
}
|
|
108
114
|
async _getPromptWithInputVariables(t) {
|
|
109
|
-
|
|
110
|
-
for (const { outputKey: e } of this.middlewares)
|
|
111
|
-
e && (r[String(e)] = t[e]);
|
|
112
|
-
return await S.fromTemplate(this.prompt).format(r);
|
|
115
|
+
return await u.fromTemplate(this.prompt).format(t);
|
|
113
116
|
}
|
|
114
117
|
_getTools() {
|
|
115
|
-
return this.tools?.map((t) => t.getTool()) ?? [];
|
|
118
|
+
return this.tools?.map((t) => "getTool" in t ? t.getTool() : t) ?? [];
|
|
116
119
|
}
|
|
117
120
|
//#endregion
|
|
118
121
|
};
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
],
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
],
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
],
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
],
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
],
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
],
|
|
122
|
+
m([
|
|
123
|
+
n()
|
|
124
|
+
], i.prototype, "prompt", 2);
|
|
125
|
+
m([
|
|
126
|
+
n()
|
|
127
|
+
], i.prototype, "tools", 2);
|
|
128
|
+
m([
|
|
129
|
+
n()
|
|
130
|
+
], i.prototype, "inputSchema", 2);
|
|
131
|
+
m([
|
|
132
|
+
n()
|
|
133
|
+
], i.prototype, "outputSchema", 2);
|
|
134
|
+
m([
|
|
135
|
+
n()
|
|
136
|
+
], i.prototype, "modelTier", 2);
|
|
137
|
+
i = m([
|
|
138
|
+
v("LLMAgent")
|
|
139
|
+
], i);
|
|
137
140
|
export {
|
|
138
|
-
|
|
141
|
+
i as LLMAgent
|
|
139
142
|
};
|
|
@@ -3,13 +3,12 @@ import { property as h, subclass as c } from "@arcgis/core/core/accessorSupport/
|
|
|
3
3
|
import { watch as l } from "@arcgis/core/core/reactiveUtils.js";
|
|
4
4
|
import { BaseAgent as m } from "./BaseAgent.js";
|
|
5
5
|
import { c as u } from "../chunks/graph.js";
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
(a = e[i]) && (t = (o ? a(r, s, t) : a(t)) || t);
|
|
6
|
+
var f = Object.defineProperty, w = Object.getOwnPropertyDescriptor, p = (e, r, s, o) => {
|
|
7
|
+
for (var t = o > 1 ? void 0 : o ? w(r, s) : r, a = e.length - 1, i; a >= 0; a--)
|
|
8
|
+
(i = e[a]) && (t = (o ? i(r, s, t) : i(t)) || t);
|
|
10
9
|
return o && t && f(r, s, t), t;
|
|
11
10
|
};
|
|
12
|
-
let
|
|
11
|
+
let n = class extends m {
|
|
13
12
|
//#region Lifecycle
|
|
14
13
|
constructor(e) {
|
|
15
14
|
super(e);
|
|
@@ -38,7 +37,7 @@ let p = class extends m {
|
|
|
38
37
|
this._set("createGraph", r);
|
|
39
38
|
else {
|
|
40
39
|
const s = this.id, o = {
|
|
41
|
-
[s]: async (
|
|
40
|
+
[s]: async (a, i) => await r().compile().invoke(a, i)
|
|
42
41
|
}, t = [{ from: s, decide: () => {
|
|
43
42
|
} }];
|
|
44
43
|
this._set(
|
|
@@ -53,18 +52,18 @@ let p = class extends m {
|
|
|
53
52
|
}
|
|
54
53
|
//#endregion
|
|
55
54
|
};
|
|
56
|
-
|
|
55
|
+
p([
|
|
57
56
|
h()
|
|
58
|
-
],
|
|
59
|
-
|
|
57
|
+
], n.prototype, "workflow", 2);
|
|
58
|
+
p([
|
|
60
59
|
h()
|
|
61
|
-
],
|
|
62
|
-
|
|
60
|
+
], n.prototype, "inputSchema", 2);
|
|
61
|
+
p([
|
|
63
62
|
h()
|
|
64
|
-
],
|
|
65
|
-
|
|
63
|
+
], n.prototype, "outputSchema", 2);
|
|
64
|
+
n = p([
|
|
66
65
|
c("WorkflowAgent")
|
|
67
|
-
],
|
|
66
|
+
], n);
|
|
68
67
|
export {
|
|
69
|
-
|
|
68
|
+
n as WorkflowAgent
|
|
70
69
|
};
|
|
@@ -9,15 +9,93 @@ import type { ParallelWorkflow, ParallelWorkflowConstructProperties } from "./wo
|
|
|
9
9
|
import type { RouterWorkflow, RouterWorkflowConstructProperties } from "./workflows/RouterWorkflow.js";
|
|
10
10
|
import type { SequentialWorkflow, SequentialWorkflowConstructProperties } from "./workflows/SequentialWorkflow.js";
|
|
11
11
|
import type { SwitchWorkflow, SwitchWorkflowConstructProperties } from "./workflows/SwitchWorkflow.js";
|
|
12
|
+
import type { RunnableConfig } from "@langchain/core/runnables";
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Creates a Zod schema from a plain object schema definition.
|
|
15
16
|
*
|
|
17
|
+
* Supports all schema field variants:
|
|
18
|
+
* - `string` (with optional `enum`)
|
|
19
|
+
* - `number`
|
|
20
|
+
* - `boolean`
|
|
21
|
+
* - `array` with primitive or nested item definitions
|
|
22
|
+
* - `object` with nested `fields`
|
|
23
|
+
*
|
|
16
24
|
* @param definition
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const primitiveSchema = await createSchema({
|
|
28
|
+
* name: { type: "string", description: "Search location name", required: true },
|
|
29
|
+
* radius: { type: "number", description: "Search radius in miles" },
|
|
30
|
+
* active: { type: "boolean", description: "Whether the search is enabled" },
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const nestedObjectSchema = await createSchema({
|
|
36
|
+
* query: { type: "string", description: "User search text", required: true },
|
|
37
|
+
* options: {
|
|
38
|
+
* type: "object",
|
|
39
|
+
* description: "Search options",
|
|
40
|
+
* required: true,
|
|
41
|
+
* fields: {
|
|
42
|
+
* center: {
|
|
43
|
+
* type: "object",
|
|
44
|
+
* description: "Map center point",
|
|
45
|
+
* fields: {
|
|
46
|
+
* latitude: { type: "number", description: "Center latitude", required: true },
|
|
47
|
+
* longitude: { type: "number", description: "Center longitude", required: true },
|
|
48
|
+
* },
|
|
49
|
+
* },
|
|
50
|
+
* categories: { type: "array", description: "Selected categories", itemType: "string" },
|
|
51
|
+
* },
|
|
52
|
+
* },
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const arrayOfObjectsSchema = await createSchema({
|
|
58
|
+
* constraints: {
|
|
59
|
+
* type: "array",
|
|
60
|
+
* description: "Constraint rules",
|
|
61
|
+
* itemType: {
|
|
62
|
+
* type: "object",
|
|
63
|
+
* description: "Single constraint rule",
|
|
64
|
+
* fields: {
|
|
65
|
+
* key: { type: "string", description: "Constraint key", required: true },
|
|
66
|
+
* enabled: { type: "boolean", description: "Whether this rule is active" },
|
|
67
|
+
* values: { type: "array", description: "Rule values", itemType: "string" },
|
|
68
|
+
* },
|
|
69
|
+
* },
|
|
70
|
+
* },
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
17
73
|
* @since 5.1
|
|
18
74
|
*/
|
|
19
75
|
export function createSchema<const TDefinition extends SchemaDefinition>(definition: TDefinition): Promise<ZodObjectSchema<SchemaDefinitionData<TDefinition>>>;
|
|
20
76
|
|
|
77
|
+
/**
|
|
78
|
+
* The suggestions emitted by the agent to the user interface.
|
|
79
|
+
*
|
|
80
|
+
* @since 5.1
|
|
81
|
+
*/
|
|
82
|
+
export type UXSuggestion = {
|
|
83
|
+
/** The type of suggestion being made. */
|
|
84
|
+
type: string;
|
|
85
|
+
/** Optional additional data associated with the suggestion. */
|
|
86
|
+
data?: Record<string, unknown>;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Sends an optional UX suggestion from an agent run to the host application.
|
|
91
|
+
* Use this for non-blocking hints (for example, recommended next actions or UI prompts) that the app may choose to display.
|
|
92
|
+
*
|
|
93
|
+
* @param suggestion
|
|
94
|
+
* @param config
|
|
95
|
+
* @since 5.1
|
|
96
|
+
*/
|
|
97
|
+
export function sendUXSuggestion(suggestion: UXSuggestion, config?: RunnableConfig): Promise<void>;
|
|
98
|
+
|
|
21
99
|
/**
|
|
22
100
|
* Creates a FunctionAgent instance from the existing agent implementation.
|
|
23
101
|
*
|