@arcgis/ai-components 5.2.0-next.11 → 5.2.0-next.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +4 -2
- package/README.md +2 -2
- package/dist/agent-utils/BaseAgent.js +1 -1
- package/dist/agent-utils/FunctionAgent.js +1 -1
- package/dist/agent-utils/LLMAgent.d.ts +5 -2
- package/dist/agent-utils/LLMAgent.js +7 -4
- package/dist/agent-utils/WorkflowAgent.js +15 -16
- package/dist/agent-utils/index.d.ts +78 -0
- package/dist/agent-utils/index.js +117 -98
- package/dist/agent-utils/middlewares/humanInTheLoop.js +1 -1
- package/dist/agent-utils/middlewares/middleware.js +1 -1
- package/dist/agent-utils/middlewares/trace.d.ts +2 -0
- package/dist/agent-utils/middlewares/trace.js +1 -1
- package/dist/agent-utils/middlewares/types.js +1 -1
- package/dist/agent-utils/tools/FunctionTool.js +1 -1
- package/dist/agent-utils/types.d.ts +13 -13
- package/dist/agent-utils/workflows/ConditionalWorkflow.js +1 -1
- package/dist/agent-utils/workflows/LoopWorkflow.js +1 -1
- package/dist/agent-utils/workflows/ParallelWorkflow.js +1 -1
- package/dist/agent-utils/workflows/RouterWorkflow.js +1 -1
- package/dist/agent-utils/workflows/SequentialWorkflow.js +1 -1
- package/dist/agent-utils/workflows/SwitchWorkflow.js +1 -1
- package/dist/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
- package/dist/agentic-workflow/Edge.d.ts +16 -0
- package/dist/agentic-workflow/WebAgent.d.ts +39 -0
- package/dist/agentic-workflow/jsonTypes.d.ts +189 -0
- package/dist/agentic-workflow/nodes/AgentNode.d.ts +28 -0
- package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
- package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
- package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
- package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
- package/dist/agentic-workflow/types.d.ts +29 -0
- package/dist/agents/runtime/skill/createSkillAgent.d.ts +31 -0
- package/dist/agents/runtime/skill/createSkillAgent.js +260 -0
- package/dist/agents/runtime/skill/loadAgentSkills.d.ts +16 -0
- package/dist/agents/runtime/skill/types.d.ts +28 -0
- package/dist/agents/runtime/skill/types.js +2 -0
- package/dist/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/clearFilters/adapter.js +22 -0
- package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/resetMap/adapter.js +22 -0
- package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/setFeatureEffect/adapter.js +122 -0
- package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
- package/dist/agents/tools/help/listFields/adapter.js +30 -0
- package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
- package/dist/agents/tools/navigation/goToAddress/adapter.js +60 -0
- package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToBookmark/adapter.js +30 -0
- package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToFeatures/adapter.js +50 -0
- package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToFullExtent/adapter.js +27 -0
- package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +24 -0
- package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToLayer/adapter.js +26 -0
- package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToScale/adapter.js +21 -0
- package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToViewpoint/adapter.js +42 -0
- package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToZoom/adapter.js +21 -0
- package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getAttribute/adapter.js +40 -0
- package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getStatistics/adapter.js +158 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.js +145 -0
- package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/queryFeatures/adapter.js +131 -0
- package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
- package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
- package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
- package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
- package/dist/agents/tools/shared/resolveToolArtifact.d.ts +22 -0
- package/dist/agents/tools/shared/resolveToolArtifact.js +20 -0
- package/dist/agents/tools/shared/types.d.ts +22 -0
- package/dist/agents/tools/shared/types.js +6 -0
- package/dist/cdn/24EIZVUM.js +2 -0
- package/dist/cdn/25MBI4PD.js +2 -0
- package/dist/cdn/275FFTBE.js +2 -0
- package/dist/cdn/27CK3JHY.js +2 -0
- package/dist/cdn/2F4TPWZQ.js +2 -0
- package/dist/cdn/2LVYAXHG.js +44 -0
- package/dist/cdn/2UJPYWWZ.js +3 -0
- package/dist/cdn/2WXXSZP5.js +2 -0
- package/dist/cdn/{Q7TL5Q5N.js → 3KNLFIM3.js} +2 -2
- package/dist/cdn/3PPXAIRE.js +14 -0
- package/dist/cdn/45BDE3MG.js +2 -0
- package/dist/cdn/477I66FH.js +56 -0
- package/dist/cdn/4CFCV47G.js +2 -0
- package/dist/cdn/4IWDBEMN.js +34 -0
- package/dist/cdn/4OI4QEV7.js +6 -0
- package/dist/cdn/{DXVU45KM.js → 4VBOTWC3.js} +2 -2
- package/dist/cdn/4YOG5F3W.js +2 -0
- package/dist/cdn/53KIFJFA.js +4 -0
- package/dist/cdn/5X23DDDZ.js +2 -0
- package/dist/cdn/65LCK3GG.js +3 -0
- package/dist/cdn/6KWGSXIN.js +2 -0
- package/dist/cdn/7DOYUO7L.js +71 -0
- package/dist/cdn/{WAIFKDR3.js → 7UBTNDV6.js} +2 -2
- package/dist/cdn/7Y43R7QJ.js +2 -0
- package/dist/cdn/A6LBMS7A.js +2 -0
- package/dist/cdn/AP3KPOHN.js +2 -0
- package/dist/cdn/AUCKEB52.js +2 -0
- package/dist/cdn/B3HXSEBN.js +2 -0
- package/dist/cdn/BBEGLIZC.js +2 -0
- package/dist/cdn/BJMGT6GV.js +19 -0
- package/dist/cdn/BTOBEN7Q.js +2 -0
- package/dist/cdn/BTTCBEPW.js +2 -0
- package/dist/cdn/BVUCNXC5.js +2 -0
- package/dist/cdn/CAOMMQSY.js +66 -0
- package/dist/cdn/CKUUYQLO.js +2 -0
- package/dist/cdn/{ZEYIBYSF.js → CSE6BHOJ.js} +2 -2
- package/dist/cdn/CX2HJ67C.js +2 -0
- package/dist/cdn/EGRRZTF6.js +2 -0
- package/dist/cdn/EK3PM4L5.js +2 -0
- package/dist/cdn/EXMEB4X2.js +2 -0
- package/dist/cdn/EYGZJKVD.js +2 -0
- package/dist/cdn/{24QNMEFG.js → FDRAKF5D.js} +2 -2
- package/dist/cdn/FHBRXZLV.js +2 -0
- package/dist/cdn/{5CV7R5IS.js → FK2CVSXW.js} +6 -6
- package/dist/cdn/FLUI6GCU.js +2 -0
- package/dist/cdn/{ZTBA5PM7.js → FPH52WOH.js} +2 -2
- package/dist/cdn/FRYS2PZJ.js +2 -0
- package/dist/cdn/FSLQCZRN.js +2 -0
- package/dist/cdn/{LQ6R5YRN.js → FTTLFIBV.js} +2 -2
- package/dist/cdn/FV6FHLYW.js +2 -0
- package/dist/cdn/G24MNC7D.js +6 -0
- package/dist/cdn/{F6QHMKF5.js → GW3IVAAZ.js} +2 -2
- package/dist/cdn/HI3XKFHD.js +2 -0
- package/dist/cdn/HKIA5PWU.js +2 -0
- package/dist/cdn/{6ZW7Z36F.js → HMMYCSOK.js} +4 -4
- package/dist/cdn/HNTSDY3J.js +2 -0
- package/dist/cdn/HV7MVIQV.js +2 -0
- package/dist/cdn/I3SUE2TR.js +2 -0
- package/dist/cdn/I72ST4JR.js +134 -0
- package/dist/cdn/{T537PKP4.js → IHUWQOMK.js} +2 -2
- package/dist/cdn/JMXXRRKQ.js +22 -0
- package/dist/cdn/JUNMTIB3.js +2 -0
- package/dist/cdn/{6YMR4QSD.js → JYNHWJUZ.js} +2 -2
- package/dist/cdn/KAX4A7SF.js +2 -0
- package/dist/cdn/KBSXHSBX.js +2 -0
- package/dist/cdn/KKCLHXHG.js +2 -0
- package/dist/cdn/L2HLFWCV.js +72 -0
- package/dist/cdn/{7RCQFLPP.js → L3BTURBA.js} +2 -2
- package/dist/cdn/LBTGOMCT.js +2 -0
- package/dist/cdn/LIRT72WY.js +2 -0
- package/dist/cdn/LL324IL6.js +2 -0
- package/dist/cdn/LLY5A2E2.js +2 -0
- package/dist/cdn/LXIKAXUT.js +2 -0
- package/dist/cdn/M2U456J5.js +181 -0
- package/dist/cdn/M3KKORBG.js +2 -0
- package/dist/cdn/M5B6X46F.js +2 -0
- package/dist/cdn/{X2ZDYHCG.js → MZUDIQQH.js} +11 -6
- package/dist/cdn/NBDOPGSN.js +2 -0
- package/dist/cdn/NGR5NVZE.js +2 -0
- package/dist/cdn/{5ZZGKP7N.js → NNPA3NLK.js} +2 -2
- package/dist/cdn/NV7CL4S3.js +2 -0
- package/dist/cdn/{5W7S2RS4.js → OALQBAZR.js} +2 -2
- package/dist/cdn/OF3TAARW.js +2 -0
- package/dist/cdn/{AZGGTNA3.js → OXC2WP7W.js} +2 -2
- package/dist/cdn/PJPP6LOS.js +3 -0
- package/dist/cdn/PUZ6RAFQ.js +2 -0
- package/dist/cdn/QAX6UF4L.js +99 -0
- package/dist/cdn/{NE7E52YR.js → QTEPFTAU.js} +10 -4
- package/dist/cdn/ROS22KOA.js +2 -0
- package/dist/cdn/RSM7MEVT.js +9 -0
- package/dist/cdn/SBNNJ5WA.js +2 -0
- package/dist/cdn/SDX46GZY.js +2 -0
- package/dist/cdn/SI22EJLC.js +2 -0
- package/dist/cdn/SJMAKF4P.js +2 -0
- package/dist/cdn/SNG3WODY.js +2 -0
- package/dist/cdn/STOGCXJH.js +2 -0
- package/dist/cdn/SUC2MIGE.js +2 -0
- package/dist/cdn/SXYKNDOF.js +2 -0
- package/dist/cdn/SZ2L5556.js +2 -0
- package/dist/cdn/T6W6F4TF.js +2 -0
- package/dist/cdn/TB2GJALS.js +2 -0
- package/dist/cdn/TFAJNKBC.js +2 -0
- package/dist/cdn/TLPZELG3.js +2 -0
- package/dist/cdn/TXZQZR3I.js +2 -0
- package/dist/cdn/UAZPINUQ.js +2 -0
- package/dist/cdn/UGIHS7OA.js +2 -0
- package/dist/cdn/{FX7UOGHP.js → V266DJ5V.js} +2 -2
- package/dist/cdn/V4PJMCJZ.js +2 -0
- package/dist/cdn/{P7DG5T3Z.js → V52GSTOC.js} +2 -2
- package/dist/cdn/VGLBH473.js +2 -0
- package/dist/cdn/VK6CCPTG.js +2 -0
- package/dist/cdn/{ZS2TZ6BF.js → VLPELJUS.js} +2 -2
- package/dist/cdn/VT5EWFH7.js +2 -0
- package/dist/cdn/{7CYGX4F4.js → VXLKTQ36.js} +2 -2
- package/dist/cdn/W54XYT2A.js +2 -0
- package/dist/cdn/X42ACC66.js +5 -0
- package/dist/cdn/XNUWVZN7.js +2 -0
- package/dist/cdn/XOTPSCNF.js +2 -0
- package/dist/cdn/XRVGYRXL.js +14 -0
- package/dist/cdn/XV7RMYLR.js +2 -0
- package/dist/cdn/XVJFPZTW.js +2 -0
- package/dist/cdn/XZF7Y6B2.js +2 -0
- package/dist/cdn/{UPEEHMSY.js → Y4TYL2AL.js} +2 -2
- package/dist/cdn/Y4ZOB6UH.js +2 -0
- package/dist/cdn/Y6CV2NZR.js +2 -0
- package/dist/cdn/YIXASZUW.js +2 -0
- package/dist/cdn/YOW3YKWR.js +11 -0
- package/dist/cdn/{23EQTPO3.js → ZA7ZU2F7.js} +2 -2
- package/dist/cdn/ZJWR4W2S.js +208 -0
- package/dist/cdn/ZWIKFBOU.js +2 -0
- package/dist/cdn/ZY3JQCZQ.js +179 -0
- package/dist/cdn/agent-utils/index.js +2 -2
- package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +2 -2
- package/dist/cdn/agent-utils/middlewares/middleware.js +2 -2
- package/dist/cdn/agent-utils/middlewares/trace.js +2 -2
- package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +2 -2
- package/dist/chunks/BaseWorkflow.js +1 -1
- package/dist/chunks/SKILL.js +5 -0
- package/dist/chunks/SKILL2.js +5 -0
- package/dist/chunks/SKILL3.js +22 -0
- package/dist/chunks/SKILL4.js +5 -0
- package/dist/chunks/adapter.js +1127 -2011
- package/dist/chunks/aiFactory.js +94 -0
- package/dist/chunks/arcgisKnowledgeGraph.js +97 -77
- package/dist/chunks/arcgisToolRegistry.js +88 -0
- package/dist/chunks/arcgis_knowledge_current_lc_context.js +20 -3
- package/dist/chunks/arcgis_knowledge_current_map_context.js +32 -3
- package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
- package/dist/chunks/arcgis_knowledge_lucene_generation_prompt.js +1 -1
- package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +117 -28
- package/dist/chunks/arcgis_knowledge_tool_prompt.js +1 -1
- package/dist/chunks/baseAgentState.js +58 -0
- package/dist/chunks/converterUtils.js +67 -42
- package/dist/chunks/dataExplorationAgent.js +19 -0
- package/dist/chunks/data_explore_filter_prompt.js +1 -1
- package/dist/chunks/data_explore_query_prompt.js +10 -5
- package/dist/chunks/embeddings.worker.js +1 -1
- package/dist/chunks/fetchAgentContext.js +13 -0
- package/dist/chunks/fetchService.js +10 -0
- package/dist/chunks/fieldStatistics.js +79 -0
- package/dist/chunks/field_descriptions_prompt.js +1 -1
- package/dist/chunks/formatFeatureAttributes.js +132 -0
- package/dist/chunks/generateLayerDescriptions.js +190 -311
- package/dist/chunks/graph.js +1 -1
- package/dist/chunks/helpAgent.js +34 -0
- package/dist/chunks/help_prompt.js +35 -18
- package/dist/chunks/index.js +1 -1
- package/dist/chunks/intent_prompt.js +3 -3
- package/dist/chunks/layerStylingGraph.js +102 -84
- package/dist/chunks/layer_descriptions_prompt.js +1 -1
- package/dist/chunks/layer_styling_prompt.js +1 -1
- package/dist/chunks/mergeWhereClauses.js +15 -0
- package/dist/chunks/navigationAgent.js +27 -0
- package/dist/chunks/navigation_intent_prompt.js +9 -3
- package/dist/chunks/navigation_tool_prompt.js +1 -1
- package/dist/chunks/orchestrator.js +446 -235
- package/dist/chunks/requireAgentServices.js +11 -0
- package/dist/chunks/resolvePointGeometryFilter.js +92 -0
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/slottableRequestUtils.js +1 -1
- package/dist/chunks/state.js +22 -28
- package/dist/chunks/summarize_query_response_prompt.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/chunks/utils.js +1 -1
- package/dist/chunks/utils2.js +12 -12
- package/dist/chunks/utils3.js +1 -1
- package/dist/components/arcgis-assistant/customElement.d.ts +102 -1
- package/dist/components/arcgis-assistant/customElement.js +332 -184
- package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +533 -11
- package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
- package/dist/components/arcgis-assistant-chat-entry/customElement.js +1 -1
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +35 -9
- package/dist/components/arcgis-assistant-help-agent/customElement.js +32 -9
- package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
- package/dist/components/arcgis-assistant-interrupt/customElement.js +12 -13
- package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +13 -9
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +1 -1
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +41 -17
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +31 -8
- package/dist/components/arcgis-assistant-message/customElement.d.ts +3 -0
- package/dist/components/arcgis-assistant-message/customElement.js +10 -9
- package/dist/components/arcgis-assistant-message-block/customElement.js +2 -2
- package/dist/components/arcgis-assistant-message-feedback/customElement.js +1 -1
- package/dist/components/arcgis-assistant-message-footer/customElement.js +1 -1
- package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +3 -0
- package/dist/components/arcgis-assistant-message-loading/customElement.js +12 -11
- package/dist/components/arcgis-assistant-message-log/customElement.js +1 -1
- package/dist/components/arcgis-assistant-message-read-aloud/customElement.js +1 -1
- package/dist/components/arcgis-assistant-message-text/customElement.d.ts +1 -0
- package/dist/components/arcgis-assistant-message-text/customElement.js +13 -13
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +34 -10
- package/dist/components/arcgis-assistant-speech-input/customElement.js +35 -53
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +1 -1
- package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
- package/dist/components/arcgis-assistant-user-message/customElement.js +16 -11
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +1 -1
- package/dist/loader.js +7 -7
- package/dist/oauth-callback.html +1 -1
- package/dist/orchestrator/models/types.d.ts +1 -0
- package/dist/orchestrator/orchestrator/orchestratorEvents.d.ts +78 -0
- package/dist/orchestrator/providers/arcgis/aiFactory.d.ts +15 -0
- package/dist/orchestrator/types/types.d.ts +17 -0
- package/dist/types/lumina.d.ts +5 -4
- package/dist/types/preact.d.ts +5 -4
- package/dist/types/react.d.ts +5 -4
- package/dist/types/stencil.d.ts +7 -6
- package/dist/utils/index.d.ts +75 -39
- package/dist/utils/index.js +708 -84
- package/package.json +35 -12
- package/dist/cdn/34SG44C3.js +0 -72
- package/dist/cdn/3JGWGKT6.js +0 -2
- package/dist/cdn/3NBDVZ2I.js +0 -2
- package/dist/cdn/3VOQD2MR.js +0 -2
- package/dist/cdn/434TAA3J.js +0 -2
- package/dist/cdn/53NTYC4I.js +0 -2
- package/dist/cdn/5QAHYX7Y.js +0 -5
- package/dist/cdn/AXDZBBNL.js +0 -45
- package/dist/cdn/B7WJFBOZ.js +0 -2
- package/dist/cdn/BX7FSMUU.js +0 -56
- package/dist/cdn/CHPQM77M.js +0 -181
- package/dist/cdn/DHKUXLU3.js +0 -179
- package/dist/cdn/DQSEBKOX.js +0 -2
- package/dist/cdn/DZ2QWNUA.js +0 -3
- package/dist/cdn/EBISDZ5H.js +0 -2
- package/dist/cdn/ERL2CB2Y.js +0 -14
- package/dist/cdn/F2AHA4GB.js +0 -54
- package/dist/cdn/FUIGPHBH.js +0 -2
- package/dist/cdn/H2CHHGGH.js +0 -2
- package/dist/cdn/HWKDNS4K.js +0 -4
- package/dist/cdn/IMQ4TVHF.js +0 -16
- package/dist/cdn/IOD3GDA7.js +0 -2
- package/dist/cdn/IR7PTESF.js +0 -2
- package/dist/cdn/IRZDTYO2.js +0 -2
- package/dist/cdn/JIWK6QK6.js +0 -2
- package/dist/cdn/JLKGS6Y5.js +0 -36
- package/dist/cdn/K3JCH4XW.js +0 -2
- package/dist/cdn/KHXUWZHB.js +0 -2
- package/dist/cdn/KMQ3SP4I.js +0 -5
- package/dist/cdn/LIFK3QSD.js +0 -2
- package/dist/cdn/NXKKG5TK.js +0 -2
- package/dist/cdn/O3EN27N5.js +0 -2
- package/dist/cdn/O3RFFPU3.js +0 -6
- package/dist/cdn/PBO6FZN6.js +0 -2
- package/dist/cdn/Q3ZW4FYA.js +0 -3
- package/dist/cdn/Q6LRANX6.js +0 -2
- package/dist/cdn/QCSN44H4.js +0 -2
- package/dist/cdn/R56X6ZKR.js +0 -161
- package/dist/cdn/RUURNLTP.js +0 -2
- package/dist/cdn/T43LEBBE.js +0 -47
- package/dist/cdn/TR4GFL7X.js +0 -2
- package/dist/cdn/WNS5ZUF5.js +0 -2
- package/dist/cdn/X4XY5HIE.js +0 -2
- package/dist/cdn/XOH56EQ2.js +0 -2
- package/dist/cdn/XON27U6U.js +0 -2
- package/dist/cdn/YIMNOUTF.js +0 -2
- package/dist/cdn/YLN2BZ5J.js +0 -2
- package/dist/cdn/YUKR4AZW.js +0 -2
- package/dist/cdn/Z2G7MP5L.js +0 -22
- package/dist/chunks/dataExplorationGraph.js +0 -310
- package/dist/chunks/helpGraph.js +0 -126
- package/dist/chunks/navigationGraph.js +0 -270
- package/dist/chunks/toolCallResponse.js +0 -31
|
@@ -1,230 +1,115 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import { Annotation as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
advanced: "gpt-5.2",
|
|
14
|
-
default: "gpt-5-mini",
|
|
15
|
-
fast: "gpt-5.4-nano"
|
|
16
|
-
}, k = {
|
|
17
|
-
default: "text-embedding-ada-002"
|
|
18
|
-
}, M = /* @__PURE__ */ new Map();
|
|
19
|
-
let x = null;
|
|
20
|
-
const te = () => {
|
|
21
|
-
const t = F.getDefault().helperServices;
|
|
22
|
-
if (!t?.aiModels?.url)
|
|
23
|
-
throw new Error("AI Models Service URL is not defined in the portal's helper services.");
|
|
24
|
-
return t.aiModels.url;
|
|
25
|
-
}, U = async (e) => {
|
|
26
|
-
const t = te();
|
|
27
|
-
M.size === 0 && (x || (x = (async () => {
|
|
28
|
-
try {
|
|
29
|
-
const n = await fetch(`${t}/models`);
|
|
30
|
-
if (!n.ok)
|
|
31
|
-
throw new Error("Failed to fetch AI service discovery data.");
|
|
32
|
-
(await n.json()).models.forEach((o) => M.set(o.name, o));
|
|
33
|
-
} catch (n) {
|
|
34
|
-
throw x = null, n;
|
|
35
|
-
}
|
|
36
|
-
})()), await x);
|
|
37
|
-
const s = M.get(e);
|
|
38
|
-
if (!s)
|
|
39
|
-
throw new Error(`Model '${e}' is not available in the discovery service.`);
|
|
40
|
-
return s.endpoint;
|
|
41
|
-
}, ne = async (e = "default") => await U(q[e]), se = async (e = "default") => await U(k[e]), h = (e, t) => t, P = (e, t) => ({
|
|
42
|
-
...e,
|
|
43
|
-
...t
|
|
44
|
-
}), _ = (e = "", t) => {
|
|
45
|
-
const s = typeof t == "string" ? t.trim() : "";
|
|
46
|
-
if (!s)
|
|
47
|
-
return e;
|
|
48
|
-
const n = e.trim();
|
|
49
|
-
if (!n)
|
|
50
|
-
return s;
|
|
51
|
-
if (n === s)
|
|
52
|
-
return e;
|
|
53
|
-
const i = n.split(`
|
|
54
|
-
|
|
55
|
-
`);
|
|
56
|
-
return i[i.length - 1]?.trim() === s ? e : `${e}
|
|
57
|
-
|
|
58
|
-
${s}`;
|
|
59
|
-
}, j = () => ({
|
|
60
|
-
userRequest: "",
|
|
61
|
-
assignedTask: "",
|
|
62
|
-
messages: [],
|
|
63
|
-
priorSteps: [],
|
|
64
|
-
sharedState: {}
|
|
65
|
-
}), ie = () => ({
|
|
66
|
-
agentExecutionContext: p({
|
|
67
|
-
reducer: P,
|
|
68
|
-
default: j
|
|
69
|
-
}),
|
|
70
|
-
outputMessage: p({
|
|
71
|
-
reducer: _,
|
|
72
|
-
default: () => ""
|
|
73
|
-
}),
|
|
74
|
-
summary: p({
|
|
75
|
-
reducer: h,
|
|
76
|
-
default: () => ""
|
|
77
|
-
}),
|
|
78
|
-
status: p({
|
|
79
|
-
reducer: h
|
|
80
|
-
})
|
|
81
|
-
}), Pe = () => ({
|
|
82
|
-
...ie(),
|
|
83
|
-
sharedStatePatch: p({
|
|
84
|
-
reducer: h
|
|
85
|
-
})
|
|
86
|
-
}), _e = p.Root({
|
|
87
|
-
agentExecutionContext: p({
|
|
88
|
-
default: j,
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import { Annotation as m } from "@langchain/langgraph/web";
|
|
3
|
+
import { b as j, r as T, m as P, c as q } from "./baseAgentState.js";
|
|
4
|
+
import p, { z as s } from "zod";
|
|
5
|
+
import { ChatPromptTemplate as E, SystemMessagePromptTemplate as N } from "@langchain/core/prompts";
|
|
6
|
+
import { s as g } from "./index.js";
|
|
7
|
+
import { AIMessage as O, isAIMessage as $, isToolMessage as U } from "@langchain/core/messages";
|
|
8
|
+
import { createAgent as V, summarizationMiddleware as L, modelCallLimitMiddleware as z } from "langchain";
|
|
9
|
+
import { c as h, E as J } from "./aiFactory.js";
|
|
10
|
+
const ye = m.Root({
|
|
11
|
+
agentExecutionContext: m({
|
|
12
|
+
default: q,
|
|
89
13
|
reducer: P
|
|
90
14
|
}),
|
|
91
|
-
currentIntent:
|
|
15
|
+
currentIntent: m({
|
|
92
16
|
default: () => "none",
|
|
93
|
-
reducer:
|
|
17
|
+
reducer: T
|
|
94
18
|
}),
|
|
95
|
-
|
|
19
|
+
routing: m({
|
|
20
|
+
default: () => ({ mode: "auto" }),
|
|
21
|
+
reducer: T
|
|
22
|
+
}),
|
|
23
|
+
lastExecutedAgent: m({
|
|
96
24
|
default: () => "",
|
|
97
|
-
reducer:
|
|
25
|
+
reducer: T
|
|
98
26
|
}),
|
|
99
|
-
requiresFollowUp:
|
|
27
|
+
requiresFollowUp: m({
|
|
100
28
|
default: () => !0,
|
|
101
|
-
reducer:
|
|
29
|
+
reducer: T
|
|
102
30
|
}),
|
|
103
|
-
stepCount:
|
|
31
|
+
stepCount: m({
|
|
104
32
|
default: () => 0,
|
|
105
33
|
reducer: (e, t) => t ?? e + 1
|
|
106
34
|
}),
|
|
107
|
-
finalOutputMessage:
|
|
35
|
+
finalOutputMessage: m({
|
|
108
36
|
default: () => "",
|
|
109
|
-
reducer:
|
|
37
|
+
reducer: j
|
|
110
38
|
})
|
|
111
|
-
}),
|
|
39
|
+
}), W = (e) => {
|
|
112
40
|
if (!e || typeof e != "object" || !("services" in e))
|
|
113
41
|
return !1;
|
|
114
42
|
const t = e.services;
|
|
115
43
|
return !!t && typeof t == "object" && "agentRegistry" in t;
|
|
116
|
-
},
|
|
44
|
+
}, B = (e) => {
|
|
117
45
|
const t = e?.configurable;
|
|
118
|
-
return
|
|
119
|
-
},
|
|
46
|
+
return W(t) ? t : void 0;
|
|
47
|
+
}, G = (e, t, i) => {
|
|
120
48
|
const n = e[t];
|
|
121
|
-
return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((
|
|
122
|
-
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(o.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + t + (t.split("/").length !==
|
|
49
|
+
return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((r, o) => {
|
|
50
|
+
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(o.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + t + (t.split("/").length !== i ? ". Note that variables only represent file names one level deep." : ""))));
|
|
123
51
|
});
|
|
124
|
-
},
|
|
125
|
-
const { agent: t, messages:
|
|
52
|
+
}, v = async (e) => (await G(/* @__PURE__ */ Object.assign({ "./field_descriptions_prompt.md": () => import("./field_descriptions_prompt.js"), "./intent_prompt.md": () => import("./intent_prompt.js"), "./layer_descriptions_prompt.md": () => import("./layer_descriptions_prompt.js") }), `./${e}.md`, 2)).default, H = async (e) => {
|
|
53
|
+
const { agent: t, messages: i, config: n } = e;
|
|
126
54
|
return { structuredResponse: (await t.invoke(
|
|
127
55
|
{
|
|
128
|
-
messages:
|
|
56
|
+
messages: i
|
|
129
57
|
},
|
|
130
58
|
n
|
|
131
59
|
)).structuredResponse };
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
abortSignal: de(t?.abortSignal),
|
|
137
|
-
requestId: ee.applicationName
|
|
138
|
-
};
|
|
139
|
-
}, N = async ({ config: e }) => {
|
|
140
|
-
const t = F.getDefault(), n = (await Z.getCredential(`${t.url}/sharing`))?.token;
|
|
141
|
-
return async (i, o) => {
|
|
142
|
-
const { conversationId: a, abortSignal: d, requestId: c } = pe(e), l = new Headers(o?.headers);
|
|
143
|
-
l.delete("Authorization"), l.delete("api-key"), n && n.length > 0 && (l.set("X-Esri-Authorization", `Bearer ${n}`), l.set("X-Esri-Request-Source", "MapsSDK")), a && a.length > 0 && l.set("X-Esri-Conversation-Id", a), c && c.length > 0 && l.set("X-Esri-Request-Id", c);
|
|
144
|
-
const u = d && o?.signal ? AbortSignal.any([d, o.signal]) : o?.signal ?? d;
|
|
145
|
-
return await fetch(i, {
|
|
146
|
-
...o,
|
|
147
|
-
headers: l,
|
|
148
|
-
signal: u
|
|
149
|
-
});
|
|
150
|
-
};
|
|
151
|
-
}, b = async (e = {}) => {
|
|
152
|
-
const { modelTier: t = "default", temperature: s = 0, config: n } = e, i = q[t], o = await ne(t);
|
|
153
|
-
return new Q({
|
|
154
|
-
modelName: i,
|
|
155
|
-
apiKey: "dummy-key",
|
|
156
|
-
// 5-mini does not support temperature parameter
|
|
157
|
-
...t !== "default" && { temperature: s },
|
|
158
|
-
configuration: {
|
|
159
|
-
baseURL: o,
|
|
160
|
-
fetch: await N({ config: n })
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
}, je = async (e = {}) => {
|
|
164
|
-
const { tier: t = "default", config: s } = e, n = k[t], i = await se(t);
|
|
165
|
-
return new Y({
|
|
166
|
-
modelName: n,
|
|
167
|
-
apiKey: "dummy-key",
|
|
168
|
-
configuration: {
|
|
169
|
-
baseURL: i,
|
|
170
|
-
fetch: await N({ config: s })
|
|
171
|
-
},
|
|
172
|
-
batchSize: 2048,
|
|
173
|
-
maxConcurrency: 10
|
|
174
|
-
});
|
|
175
|
-
}, me = r.object({
|
|
176
|
-
id: r.string().min(1),
|
|
177
|
-
name: r.string().min(1),
|
|
178
|
-
description: r.string().min(1)
|
|
60
|
+
}, K = s.object({
|
|
61
|
+
id: s.string().min(1),
|
|
62
|
+
name: s.string().min(1),
|
|
63
|
+
description: s.string().min(1)
|
|
179
64
|
});
|
|
180
|
-
|
|
181
|
-
const
|
|
182
|
-
const t = e.map((n) => n.id),
|
|
183
|
-
return
|
|
184
|
-
intent:
|
|
185
|
-
assignedTask:
|
|
186
|
-
requiresFollowUp:
|
|
65
|
+
s.array(K);
|
|
66
|
+
const I = (e) => JSON.stringify(e, null, 2), Q = (e) => {
|
|
67
|
+
const t = e.map((n) => n.id), i = s.enum(t);
|
|
68
|
+
return s.object({
|
|
69
|
+
intent: i.nullable(),
|
|
70
|
+
assignedTask: s.string().nullable(),
|
|
71
|
+
requiresFollowUp: s.boolean()
|
|
187
72
|
});
|
|
188
|
-
},
|
|
189
|
-
const
|
|
190
|
-
if (
|
|
191
|
-
return await
|
|
73
|
+
}, he = async (e, t) => {
|
|
74
|
+
const i = B(t);
|
|
75
|
+
if (t?.signal?.aborted)
|
|
76
|
+
return await g({ text: "Run cancelled; skipping intent routing" }, t), {
|
|
192
77
|
...e,
|
|
193
78
|
currentIntent: "none",
|
|
194
79
|
finalOutputMessage: "Operation cancelled.",
|
|
195
80
|
requiresFollowUp: !1
|
|
196
81
|
};
|
|
197
82
|
try {
|
|
198
|
-
await
|
|
199
|
-
const
|
|
200
|
-
id:
|
|
201
|
-
name:
|
|
202
|
-
description:
|
|
83
|
+
await g({ text: "Asking LLM to route to an agent" }, t);
|
|
84
|
+
const r = i.services.agentRegistry?.list() ?? [], o = r.map(({ agent: u }) => ({
|
|
85
|
+
id: u.id,
|
|
86
|
+
name: u.name,
|
|
87
|
+
description: u.description
|
|
203
88
|
}));
|
|
204
89
|
if (!o.length)
|
|
205
|
-
return await
|
|
90
|
+
return await g({ text: "No agents registered; skipping intent detection" }, t), {
|
|
206
91
|
...e,
|
|
207
92
|
currentIntent: "none",
|
|
208
93
|
finalOutputMessage: "No agents registered; skipping intent detection."
|
|
209
94
|
};
|
|
210
|
-
const a = await
|
|
211
|
-
registeredAgents:
|
|
212
|
-
priorSteps:
|
|
95
|
+
const a = await v("intent_prompt"), c = I(o), l = Q(o), d = {
|
|
96
|
+
registeredAgents: c,
|
|
97
|
+
priorSteps: I(e.agentExecutionContext.priorSteps),
|
|
213
98
|
userRequest: e.agentExecutionContext.userRequest
|
|
214
|
-
},
|
|
215
|
-
model: await
|
|
99
|
+
}, k = await E.fromTemplate(a).format(d), D = V({
|
|
100
|
+
model: await h({
|
|
216
101
|
modelTier: "fast",
|
|
217
102
|
config: t
|
|
218
103
|
}),
|
|
219
104
|
tools: [],
|
|
220
|
-
systemPrompt:
|
|
221
|
-
responseFormat:
|
|
105
|
+
systemPrompt: k,
|
|
106
|
+
responseFormat: l,
|
|
222
107
|
middleware: [
|
|
223
108
|
// Preserve recent conversation context while summarizing older messages
|
|
224
109
|
// to control token usage without losing important intent signals.
|
|
225
110
|
// The trigger and keep parameters can be tuned based on token limits and behavior.
|
|
226
|
-
|
|
227
|
-
model: await
|
|
111
|
+
L({
|
|
112
|
+
model: await h({
|
|
228
113
|
modelTier: "fast",
|
|
229
114
|
config: t
|
|
230
115
|
}),
|
|
@@ -233,36 +118,36 @@ const C = (e) => JSON.stringify(e, null, 2), ue = (e) => {
|
|
|
233
118
|
}),
|
|
234
119
|
// Enforce no loop/retry.
|
|
235
120
|
// 1 usual LLM call and 1 optional summarization call.
|
|
236
|
-
|
|
121
|
+
z({ runLimit: 2 })
|
|
237
122
|
]
|
|
238
|
-
}), { structuredResponse:
|
|
239
|
-
agent:
|
|
123
|
+
}), { structuredResponse: R } = await H({
|
|
124
|
+
agent: D,
|
|
240
125
|
messages: e.agentExecutionContext.messages,
|
|
241
126
|
config: t
|
|
242
|
-
}),
|
|
243
|
-
|
|
244
|
-
),
|
|
127
|
+
}), f = l.parse(
|
|
128
|
+
R ?? { intent: null, assignedTask: null, requiresFollowUp: !1 }
|
|
129
|
+
), x = f.intent ?? "none", F = {
|
|
245
130
|
...e,
|
|
246
|
-
currentIntent:
|
|
247
|
-
requiresFollowUp:
|
|
131
|
+
currentIntent: x,
|
|
132
|
+
requiresFollowUp: f.requiresFollowUp,
|
|
248
133
|
agentExecutionContext: {
|
|
249
134
|
...e.agentExecutionContext,
|
|
250
|
-
assignedTask:
|
|
135
|
+
assignedTask: f.assignedTask ?? ""
|
|
251
136
|
}
|
|
252
137
|
};
|
|
253
|
-
if (
|
|
254
|
-
const
|
|
138
|
+
if (x === "none") {
|
|
139
|
+
const u = `I could not find an agent that can handle that request. I have access to the following agents: ${r.map(({ agent: _ }) => _.name).join(", ")}.
|
|
255
140
|
|
|
256
141
|
Please ask a question that can be answered by one of these agents.`;
|
|
257
|
-
return await
|
|
142
|
+
return await g({ text: "LLM did not identify a clear intent." }, t), {
|
|
258
143
|
...e,
|
|
259
|
-
currentIntent:
|
|
144
|
+
currentIntent: x,
|
|
260
145
|
requiresFollowUp: !1,
|
|
261
|
-
finalOutputMessage:
|
|
146
|
+
finalOutputMessage: u,
|
|
262
147
|
agentExecutionContext: {
|
|
263
148
|
...e.agentExecutionContext,
|
|
264
149
|
assignedTask: "",
|
|
265
|
-
messages: [...e.agentExecutionContext.messages, new
|
|
150
|
+
messages: [...e.agentExecutionContext.messages, new O(u)],
|
|
266
151
|
priorSteps: [
|
|
267
152
|
...e.agentExecutionContext.priorSteps ?? [],
|
|
268
153
|
{
|
|
@@ -275,177 +160,171 @@ Please ask a question that can be answered by one of these agents.`;
|
|
|
275
160
|
}
|
|
276
161
|
};
|
|
277
162
|
}
|
|
278
|
-
return await
|
|
163
|
+
return await g(
|
|
279
164
|
{
|
|
280
|
-
text: `Agent picked: ${
|
|
281
|
-
Task Assigned: ${
|
|
282
|
-
Requires Follow-Up: ${
|
|
165
|
+
text: `Agent picked: ${x}
|
|
166
|
+
Task Assigned: ${f.assignedTask ?? ""}
|
|
167
|
+
Requires Follow-Up: ${f.requiresFollowUp}`
|
|
283
168
|
},
|
|
284
169
|
t
|
|
285
|
-
),
|
|
170
|
+
), F;
|
|
286
171
|
} catch (n) {
|
|
287
|
-
throw await
|
|
172
|
+
throw await g({ text: "Error during intent detection" }, t), new Error(`Error during intent detection: ${n instanceof Error ? n.message : String(n)}`);
|
|
288
173
|
}
|
|
289
|
-
},
|
|
174
|
+
}, X = "0.1", y = 1536, Y = "openai", Z = J.default, ee = `Name: {name}
|
|
290
175
|
Title: {title}
|
|
291
|
-
Description: {description}`,
|
|
176
|
+
Description: {description}`, te = `Name: {name}
|
|
292
177
|
Alias: {alias}
|
|
293
|
-
Description: {description}`,
|
|
294
|
-
schemaVersion:
|
|
295
|
-
modified:
|
|
296
|
-
embeddings:
|
|
297
|
-
modelProvider:
|
|
298
|
-
model:
|
|
299
|
-
dimensions:
|
|
300
|
-
templates:
|
|
301
|
-
layer:
|
|
302
|
-
field:
|
|
178
|
+
Description: {description}`, we = s.object({
|
|
179
|
+
schemaVersion: s.literal(X),
|
|
180
|
+
modified: s.number().int().nonnegative(),
|
|
181
|
+
embeddings: s.object({
|
|
182
|
+
modelProvider: s.literal(Y),
|
|
183
|
+
model: s.literal(Z),
|
|
184
|
+
dimensions: s.literal(y),
|
|
185
|
+
templates: s.object({
|
|
186
|
+
layer: s.string().default(ee),
|
|
187
|
+
field: s.string().default(te)
|
|
303
188
|
})
|
|
304
189
|
}),
|
|
305
|
-
layers:
|
|
306
|
-
|
|
307
|
-
id:
|
|
308
|
-
name:
|
|
309
|
-
title:
|
|
310
|
-
description:
|
|
311
|
-
vector:
|
|
312
|
-
message: `Layer vector must be exactly ${
|
|
190
|
+
layers: s.array(
|
|
191
|
+
s.object({
|
|
192
|
+
id: s.string().min(1),
|
|
193
|
+
name: s.string().min(1),
|
|
194
|
+
title: s.string().catch(""),
|
|
195
|
+
description: s.string().catch(""),
|
|
196
|
+
vector: s.array(s.number()).length(y, {
|
|
197
|
+
message: `Layer vector must be exactly ${y} dimensions`
|
|
313
198
|
}),
|
|
314
|
-
fields:
|
|
315
|
-
|
|
316
|
-
name:
|
|
317
|
-
alias:
|
|
318
|
-
description:
|
|
319
|
-
vector:
|
|
320
|
-
message: `Field vector must be exactly ${
|
|
199
|
+
fields: s.array(
|
|
200
|
+
s.object({
|
|
201
|
+
name: s.string().min(1),
|
|
202
|
+
alias: s.string().catch(""),
|
|
203
|
+
description: s.string().catch(""),
|
|
204
|
+
vector: s.array(s.number()).length(y, {
|
|
205
|
+
message: `Field vector must be exactly ${y} dimensions`
|
|
321
206
|
})
|
|
322
207
|
})
|
|
323
208
|
)
|
|
324
209
|
})
|
|
325
210
|
).default([])
|
|
326
|
-
}),
|
|
211
|
+
}), ne = (e) => {
|
|
327
212
|
const t = /* @__PURE__ */ new Set();
|
|
328
213
|
for (const n of e)
|
|
329
|
-
if (
|
|
330
|
-
const
|
|
331
|
-
|
|
214
|
+
if ($(n)) {
|
|
215
|
+
const r = n;
|
|
216
|
+
r.tool_calls && r.tool_calls.length > 0 && r.tool_calls.forEach((o) => {
|
|
332
217
|
o.id && t.add(o.id);
|
|
333
218
|
});
|
|
334
219
|
}
|
|
335
220
|
return e.filter((n) => {
|
|
336
|
-
if (
|
|
337
|
-
const
|
|
338
|
-
return t.has(
|
|
221
|
+
if (U(n)) {
|
|
222
|
+
const r = n;
|
|
223
|
+
return t.has(r.tool_call_id);
|
|
339
224
|
}
|
|
340
225
|
return !0;
|
|
341
226
|
});
|
|
342
|
-
},
|
|
343
|
-
const
|
|
344
|
-
return
|
|
345
|
-
},
|
|
346
|
-
const { promptText: t, modelTier:
|
|
347
|
-
return
|
|
348
|
-
},
|
|
349
|
-
const { promptText: t, modelTier:
|
|
227
|
+
}, M = (e, t) => {
|
|
228
|
+
const i = N.fromTemplate(e);
|
|
229
|
+
return E.fromMessages([i, ...t]);
|
|
230
|
+
}, se = async (e) => {
|
|
231
|
+
const { promptText: t, modelTier: i, messages: n, config: r } = e, o = M(t, n ?? []), a = await h({ modelTier: i, config: r });
|
|
232
|
+
return o.pipe(a);
|
|
233
|
+
}, xe = async (e) => {
|
|
234
|
+
const { promptText: t, modelTier: i = "default", messages: n, inputVariables: r, config: o } = e, c = await (await se({
|
|
350
235
|
promptText: t,
|
|
351
|
-
modelTier:
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
})).invoke(o ?? {});
|
|
236
|
+
modelTier: i,
|
|
237
|
+
messages: n,
|
|
238
|
+
config: o
|
|
239
|
+
})).invoke(r ?? {}, o);
|
|
356
240
|
if (typeof c == "string")
|
|
357
241
|
return c;
|
|
358
242
|
const l = c.content;
|
|
359
243
|
return typeof l == "string" ? l : JSON.stringify(l);
|
|
360
|
-
},
|
|
361
|
-
const { promptText: t, modelTier:
|
|
362
|
-
return await c.pipe(
|
|
363
|
-
},
|
|
364
|
-
const { promptText: t, modelTier:
|
|
365
|
-
return await l.pipe(
|
|
366
|
-
},
|
|
367
|
-
name:
|
|
368
|
-
description:
|
|
369
|
-
valueType:
|
|
370
|
-
alias:
|
|
371
|
-
}),
|
|
372
|
-
fields:
|
|
373
|
-
}),
|
|
374
|
-
const
|
|
375
|
-
return !!(
|
|
244
|
+
}, A = async (e) => {
|
|
245
|
+
const { promptText: t, modelTier: i = "default", messages: n, inputVariables: r, schema: o, config: a } = e, c = M(t, n ?? []), d = (await h({ modelTier: i, config: a })).withStructuredOutput(o);
|
|
246
|
+
return await c.pipe(d).invoke(r ?? {}, a);
|
|
247
|
+
}, Te = async (e) => {
|
|
248
|
+
const { promptText: t, modelTier: i = "default", messages: n, inputVariables: r, tools: o, config: a } = e, c = o.length > 0 ? ne(n ?? []) : n ?? [], l = M(t, c), d = await h({ modelTier: i, config: a });
|
|
249
|
+
return await l.pipe(d.bindTools(o)).invoke(r ?? {}, a);
|
|
250
|
+
}, ie = p.object({
|
|
251
|
+
name: p.string(),
|
|
252
|
+
description: p.string(),
|
|
253
|
+
valueType: p.string(),
|
|
254
|
+
alias: p.string()
|
|
255
|
+
}), oe = p.object({
|
|
256
|
+
fields: p.array(ie)
|
|
257
|
+
}), C = (e, t) => e.getFieldAlias(t) ?? void 0, b = (e, t) => C(e, t.name) ?? t.alias ?? "", re = (e, t) => {
|
|
258
|
+
const i = C(e, t.name);
|
|
259
|
+
return !!(i && i !== (t.alias ?? ""));
|
|
376
260
|
};
|
|
377
|
-
function
|
|
378
|
-
const
|
|
261
|
+
function S(e, t) {
|
|
262
|
+
const i = /* @__PURE__ */ new Map();
|
|
379
263
|
for (const n of e.fields) {
|
|
380
|
-
const
|
|
264
|
+
const r = t.fields.find((l) => l.name === n.name), o = b(e, n), a = re(e, n), c = {
|
|
381
265
|
name: n.name,
|
|
382
266
|
type: n.type,
|
|
383
|
-
alias: a ? o :
|
|
384
|
-
description:
|
|
385
|
-
valueType:
|
|
267
|
+
alias: a ? o : r?.alias ?? o,
|
|
268
|
+
description: r?.description ?? n.description ?? "",
|
|
269
|
+
valueType: r?.valueType ?? n.valueType ?? "",
|
|
386
270
|
domain: e.getFieldDomain(n.name) ?? void 0
|
|
387
271
|
};
|
|
388
|
-
|
|
272
|
+
i.set(n.name, c);
|
|
389
273
|
}
|
|
390
|
-
return
|
|
274
|
+
return i;
|
|
391
275
|
}
|
|
392
|
-
const
|
|
393
|
-
const
|
|
394
|
-
const { name:
|
|
395
|
-
return [`Name: ${
|
|
276
|
+
const be = async (e) => {
|
|
277
|
+
const i = await v("field_descriptions_prompt"), n = e.fields.filter((a) => !(b(e, a) && a.description)).map((a) => {
|
|
278
|
+
const { name: c, type: l, description: d } = a, w = b(e, a);
|
|
279
|
+
return [`Name: ${c}`, `Type: ${l}`, `Alias: ${w}`, `Description: ${d ?? "N/A"}`].join(", ");
|
|
396
280
|
}).join(`
|
|
397
281
|
`);
|
|
398
282
|
if (n.length === 0)
|
|
399
|
-
return
|
|
400
|
-
const
|
|
283
|
+
return S(e, { fields: [] });
|
|
284
|
+
const r = {
|
|
401
285
|
existingItemTitle: e.portalItem?.title,
|
|
402
286
|
existingItemDescription: e.portalItem?.description,
|
|
403
287
|
existingLayerTitle: e.title,
|
|
404
288
|
existingLayerDescription: e.portalItem?.description,
|
|
405
289
|
fieldInformation: n
|
|
406
|
-
}, o = await
|
|
407
|
-
promptText:
|
|
408
|
-
schema:
|
|
409
|
-
inputVariables:
|
|
290
|
+
}, o = await A({
|
|
291
|
+
promptText: i,
|
|
292
|
+
schema: oe,
|
|
293
|
+
inputVariables: r
|
|
410
294
|
});
|
|
411
|
-
return
|
|
412
|
-
},
|
|
413
|
-
title:
|
|
414
|
-
description:
|
|
415
|
-
name:
|
|
416
|
-
}),
|
|
417
|
-
const n = await
|
|
418
|
-
fieldInformation: JSON.stringify(
|
|
295
|
+
return S(e, o);
|
|
296
|
+
}, ae = p.object({
|
|
297
|
+
title: p.string(),
|
|
298
|
+
description: p.string(),
|
|
299
|
+
name: p.string().nullable()
|
|
300
|
+
}), ve = async (e, t) => {
|
|
301
|
+
const n = await v("layer_descriptions_prompt"), r = Array.from(t.values()), o = {
|
|
302
|
+
fieldInformation: JSON.stringify(r, null, 2),
|
|
419
303
|
existingLayerTitle: e.title,
|
|
420
304
|
existingLayerDescription: e.portalItem?.description,
|
|
421
305
|
existingLayerSnippet: e.portalItem?.snippet,
|
|
422
306
|
layerGeometryType: e.geometryType
|
|
423
307
|
};
|
|
424
|
-
return { ...await
|
|
308
|
+
return { ...await A({
|
|
425
309
|
promptText: n,
|
|
426
|
-
schema:
|
|
310
|
+
schema: ae,
|
|
427
311
|
inputVariables: o
|
|
428
312
|
}), name: e.title ?? null };
|
|
429
313
|
};
|
|
430
314
|
export {
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
se as n,
|
|
447
|
-
re as o,
|
|
448
|
-
Ne as p,
|
|
449
|
-
je as q,
|
|
450
|
-
ge as s
|
|
315
|
+
ye as D,
|
|
316
|
+
we as W,
|
|
317
|
+
xe as a,
|
|
318
|
+
he as b,
|
|
319
|
+
be as c,
|
|
320
|
+
ve as d,
|
|
321
|
+
y as e,
|
|
322
|
+
te as f,
|
|
323
|
+
B as g,
|
|
324
|
+
Y as h,
|
|
325
|
+
Te as i,
|
|
326
|
+
A as j,
|
|
327
|
+
ee as l,
|
|
328
|
+
Z as m,
|
|
329
|
+
X as s
|
|
451
330
|
};
|
package/dist/chunks/graph.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
import { StateGraph as G, END as p, START as k } from "@langchain/langgraph/web";
|
|
3
3
|
function b(t, c, o, s = {}) {
|
|
4
4
|
const { agent: h, entryNode: u, middlewares: l = [] } = s;
|