@arcgis/ai-components 5.2.0-next.110 → 5.2.0-next.112
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/dist/agent-utils/BaseAgent.js +1 -1
- package/dist/agent-utils/FunctionAgent.js +1 -1
- package/dist/agent-utils/LLMAgent.d.ts +4 -5
- package/dist/agent-utils/LLMAgent.js +59 -59
- package/dist/agent-utils/WorkflowAgent.js +1 -1
- package/dist/agent-utils/index.js +1 -1
- package/dist/agent-utils/middlewares/humanInTheLoop.js +1 -1
- package/dist/agent-utils/middlewares/middleware.js +1 -1
- package/dist/agent-utils/middlewares/trace.js +6 -6
- package/dist/agent-utils/middlewares/types.js +1 -1
- package/dist/agent-utils/tools/FunctionTool.js +1 -1
- 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/jsonTypes.d.ts +48 -8
- package/dist/agentic-workflow/nodes/HumanInTheLoopNode.d.ts +37 -0
- package/dist/agentic-workflow/types.d.ts +1 -1
- package/dist/agents/runtime/skill/createSkillAgent.d.ts +0 -1
- package/dist/agents/runtime/skill/createSkillAgent.js +50 -50
- package/dist/agents/runtime/skill/types.d.ts +2 -10
- package/dist/agents/runtime/skill/types.js +1 -1
- package/dist/agents/tools/filter/clearFilters/adapter.js +1 -1
- package/dist/agents/tools/filter/resetMap/adapter.js +1 -1
- package/dist/agents/tools/filter/setFeatureEffect/adapter.js +1 -1
- package/dist/agents/tools/help/listFields/adapter.js +1 -1
- package/dist/agents/tools/navigation/goToAddress/adapter.js +1 -1
- package/dist/agents/tools/navigation/goToBookmark/adapter.js +1 -1
- package/dist/agents/tools/navigation/goToFeatures/adapter.js +1 -1
- package/dist/agents/tools/navigation/goToFullExtent/adapter.js +1 -1
- package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +1 -1
- package/dist/agents/tools/navigation/goToLayer/adapter.js +1 -1
- package/dist/agents/tools/navigation/goToScale/adapter.js +1 -1
- package/dist/agents/tools/navigation/goToViewpoint/adapter.js +1 -1
- package/dist/agents/tools/navigation/goToZoom/adapter.js +1 -1
- package/dist/agents/tools/query/getAttribute/adapter.js +1 -1
- package/dist/agents/tools/query/getStatistics/adapter.js +1 -1
- package/dist/agents/tools/query/getTopFeatures/adapter.js +1 -1
- package/dist/agents/tools/query/queryFeatures/adapter.js +1 -1
- package/dist/agents/tools/search/findRelevantFields/adapter.js +1 -1
- package/dist/agents/tools/search/findRelevantLayers/adapter.js +1 -1
- package/dist/agents/tools/shared/resolveToolArtifact.js +1 -1
- package/dist/agents/tools/shared/types.js +1 -1
- package/dist/cdn/2BNQ6A6J.js +2 -0
- package/dist/cdn/{FV6FHLYW.js → 2MWUBKWI.js} +2 -2
- package/dist/cdn/{GW3IVAAZ.js → 2O4DON37.js} +2 -2
- package/dist/cdn/33PB7ALY.js +2 -0
- package/dist/cdn/{FK2CVSXW.js → 33SFAZQG.js} +4 -4
- package/dist/cdn/{LLY5A2E2.js → 34O57OGV.js} +1 -1
- package/dist/cdn/{OALQBAZR.js → 3UEKINYC.js} +2 -2
- package/dist/cdn/434TAA3J.js +2 -0
- package/dist/cdn/4AQBRGO2.js +3 -0
- package/dist/cdn/{ZWIKFBOU.js → 4IU63OWQ.js} +2 -2
- package/dist/cdn/{XRVGYRXL.js → 5A355PGH.js} +2 -2
- package/dist/cdn/5BBXNT75.js +66 -0
- package/dist/cdn/{TB2GJALS.js → 5HBAJ57P.js} +2 -2
- package/dist/cdn/{7Y43R7QJ.js → 5MK44FNO.js} +2 -2
- package/dist/cdn/{LXIKAXUT.js → 5Q2XRQS6.js} +2 -2
- package/dist/cdn/{UAZPINUQ.js → 6ECRQVHY.js} +2 -2
- package/dist/cdn/{BBEGLIZC.js → 6OOZSZRJ.js} +2 -2
- package/dist/cdn/6OUIUXAJ.js +2 -0
- package/dist/cdn/{Y4TYL2AL.js → 6P44KOKX.js} +2 -2
- package/dist/cdn/{LBTGOMCT.js → 73TMZQI5.js} +2 -2
- package/dist/cdn/{BJMGT6GV.js → 74CVYM72.js} +2 -2
- package/dist/cdn/{PJPP6LOS.js → 7EHOFQ2P.js} +2 -2
- package/dist/cdn/{24EIZVUM.js → 7KSFIRXB.js} +2 -2
- package/dist/cdn/{STOGCXJH.js → AHCXG7XF.js} +2 -2
- package/dist/cdn/{VLPELJUS.js → AOVJ34QE.js} +2 -2
- package/dist/cdn/{3KNLFIM3.js → APFZY4PI.js} +2 -2
- package/dist/cdn/{KBSXHSBX.js → AVRS6UCQ.js} +2 -2
- package/dist/cdn/{YOW3YKWR.js → AVZ5Y6BK.js} +2 -2
- package/dist/cdn/{477I66FH.js → AXTQU5YL.js} +11 -11
- package/dist/cdn/BBPD2AS7.js +2 -0
- package/dist/cdn/{HV7MVIQV.js → BFZ5S7NF.js} +2 -2
- package/dist/cdn/{HMMYCSOK.js → BL273EGZ.js} +2 -2
- package/dist/cdn/C7JPWFZE.js +2 -0
- package/dist/cdn/{KKCLHXHG.js → CCC6LBMY.js} +1 -1
- package/dist/cdn/{NNPA3NLK.js → CEKOEHB3.js} +2 -2
- package/dist/cdn/{W54XYT2A.js → CFAC4FN3.js} +2 -2
- package/dist/cdn/{53KIFJFA.js → COH3QXWG.js} +2 -2
- package/dist/cdn/{CX2HJ67C.js → DB2TFPIO.js} +2 -2
- package/dist/cdn/{EYGZJKVD.js → DE26DAW5.js} +2 -2
- package/dist/cdn/DG27JEYG.js +50 -0
- package/dist/cdn/DKA6PSYN.js +2 -0
- package/dist/cdn/DWH23NJN.js +2 -0
- package/dist/cdn/EDXTPEEU.js +2 -0
- package/dist/cdn/{6KWGSXIN.js → ENM3L4AC.js} +2 -2
- package/dist/cdn/{XV7RMYLR.js → EVMIYZWD.js} +2 -2
- package/dist/cdn/{FHBRXZLV.js → EYOWRGDP.js} +2 -2
- package/dist/cdn/{45BDE3MG.js → EYY367WR.js} +2 -2
- package/dist/cdn/{2UJPYWWZ.js → F3CSORDI.js} +2 -2
- package/dist/cdn/{27CK3JHY.js → F5NIRETW.js} +2 -2
- package/dist/cdn/{TFAJNKBC.js → FCI6M62J.js} +2 -2
- package/dist/cdn/{V4PJMCJZ.js → FDOMMK2M.js} +1 -1
- package/dist/cdn/{4OI4QEV7.js → FS7GXTTQ.js} +2 -2
- package/dist/cdn/{IHUWQOMK.js → FYZATVB3.js} +2 -2
- package/dist/cdn/{3PPXAIRE.js → H6P3WP5D.js} +2 -2
- package/dist/cdn/HHP5YLUI.js +2 -0
- package/dist/cdn/HIAQARIQ.js +2 -0
- package/dist/cdn/HMIDFTEI.js +2 -0
- package/dist/cdn/{4CFCV47G.js → HMNBUGH2.js} +2 -2
- package/dist/cdn/HR6GWPKX.js +2 -0
- package/dist/cdn/{V266DJ5V.js → ICBIUFK7.js} +2 -2
- package/dist/cdn/{BTOBEN7Q.js → IH26MIYY.js} +2 -2
- package/dist/cdn/{QAX6UF4L.js → IHP25JWI.js} +2 -2
- package/dist/cdn/{M2U456J5.js → IYLFJCJ2.js} +4 -4
- package/dist/cdn/{JMXXRRKQ.js → J6A4AS7E.js} +2 -2
- package/dist/cdn/{QTEPFTAU.js → JEBRN3EU.js} +2 -2
- package/dist/cdn/{G24MNC7D.js → JICNSK6Y.js} +2 -2
- package/dist/cdn/JQYLMTDP.js +2 -0
- package/dist/cdn/{275FFTBE.js → K5JVB6FU.js} +2 -2
- package/dist/cdn/K7XWGSLN.js +2 -0
- package/dist/cdn/{M3KKORBG.js → K7YQIJFT.js} +2 -2
- package/dist/cdn/KH4V4I3W.js +2 -0
- package/dist/cdn/KMLJS2VW.js +2 -0
- package/dist/cdn/{HNTSDY3J.js → LAVFUDUG.js} +2 -2
- package/dist/cdn/{LL324IL6.js → LFQLCCJJ.js} +2 -2
- package/dist/cdn/{L3BTURBA.js → LK7ZIQW6.js} +2 -2
- package/dist/cdn/{ZJWR4W2S.js → LOQ2PKV5.js} +58 -58
- package/dist/cdn/{X42ACC66.js → LXPGQNXQ.js} +2 -2
- package/dist/cdn/{TXZQZR3I.js → MJSIYEWN.js} +2 -2
- package/dist/cdn/{CSE6BHOJ.js → MWYBF3F3.js} +2 -2
- package/dist/cdn/{FDRAKF5D.js → MXTXJKFE.js} +2 -2
- package/dist/cdn/{7DOYUO7L.js → NEV6OZN3.js} +2 -2
- package/dist/cdn/{NBDOPGSN.js → O4NVW75A.js} +2 -2
- package/dist/cdn/{ZA7ZU2F7.js → OKVLGJAG.js} +2 -2
- package/dist/cdn/{SUC2MIGE.js → OMF6ITSG.js} +2 -2
- package/dist/cdn/{A6LBMS7A.js → ONQ6JSBJ.js} +1 -1
- package/dist/cdn/{CKUUYQLO.js → OZAZ277H.js} +2 -2
- package/dist/cdn/{XNUWVZN7.js → P4XZMBU5.js} +2 -2
- package/dist/cdn/{L2HLFWCV.js → POL6HKCG.js} +3 -3
- package/dist/cdn/{AP3KPOHN.js → POZYDAU2.js} +2 -2
- package/dist/cdn/{FTTLFIBV.js → PQ2DPOFM.js} +2 -2
- package/dist/cdn/{ZY3JQCZQ.js → QNXI3WOF.js} +36 -36
- package/dist/cdn/{4VBOTWC3.js → QRMRID2M.js} +2 -2
- package/dist/cdn/{TLPZELG3.js → R74ZHFA6.js} +1 -1
- package/dist/cdn/{OF3TAARW.js → RHYNE5OE.js} +1 -1
- package/dist/cdn/{4YOG5F3W.js → RLEHNAIA.js} +1 -1
- package/dist/cdn/RXF2NUOL.js +2 -0
- package/dist/cdn/{MZUDIQQH.js → SDWWUWAF.js} +2 -2
- package/dist/cdn/SHI76XUV.js +2 -0
- package/dist/cdn/SITY6L4S.js +2 -0
- package/dist/cdn/{RSM7MEVT.js → SLR75R32.js} +2 -2
- package/dist/cdn/STHBRTTD.js +2 -0
- package/dist/cdn/{7UBTNDV6.js → SXM4NUT5.js} +2 -2
- package/dist/cdn/{XVJFPZTW.js → SZRJTQ54.js} +2 -2
- package/dist/cdn/TO2NY7EA.js +2 -0
- package/dist/cdn/{4IWDBEMN.js → TPULIO6I.js} +2 -2
- package/dist/cdn/TVEEQSMF.js +2 -0
- package/dist/cdn/TWU3QXAS.js +2 -0
- package/dist/cdn/{EGRRZTF6.js → TYATJUNF.js} +2 -2
- package/dist/cdn/UCTC4JN4.js +3 -0
- package/dist/cdn/{HI3XKFHD.js → UDRKUVZP.js} +2 -2
- package/dist/cdn/{JYNHWJUZ.js → UHEYPSOR.js} +2 -2
- package/dist/cdn/{VGLBH473.js → UHICISBZ.js} +2 -2
- package/dist/cdn/UO5PBOQR.js +2 -0
- package/dist/cdn/{BVUCNXC5.js → UZLQALHY.js} +1 -1
- package/dist/cdn/{SNG3WODY.js → V6HOUZPZ.js} +2 -2
- package/dist/cdn/{V52GSTOC.js → V7Y22FRP.js} +2 -2
- package/dist/cdn/{I72ST4JR.js → VAXH6RUQ.js} +2 -2
- package/dist/cdn/{NV7CL4S3.js → VNLSYVPE.js} +2 -2
- package/dist/cdn/VR3CF3ZY.js +2 -0
- package/dist/cdn/{VK6CCPTG.js → VWP2B4LB.js} +2 -2
- package/dist/cdn/VXFQANGJ.js +2 -0
- package/dist/cdn/WKZHFSH3.js +2 -0
- package/dist/cdn/{OXC2WP7W.js → WSWB3B7B.js} +2 -2
- package/dist/cdn/{EK3PM4L5.js → WVP73XWD.js} +2 -2
- package/dist/cdn/{SJMAKF4P.js → WXQ26G5Q.js} +2 -2
- package/dist/cdn/{2F4TPWZQ.js → XQ3NBBQ3.js} +1 -1
- package/dist/cdn/{JUNMTIB3.js → XV3DHHYJ.js} +2 -2
- package/dist/cdn/{VXLKTQ36.js → YHWYTHID.js} +2 -2
- package/dist/cdn/{XOTPSCNF.js → YIZ7PR2G.js} +2 -2
- package/dist/cdn/{T6W6F4TF.js → Z5XQLSYH.js} +2 -2
- package/dist/cdn/{Y6CV2NZR.js → ZFOG3KXV.js} +2 -2
- package/dist/cdn/{FPH52WOH.js → ZU2FHVNK.js} +2 -2
- package/dist/cdn/agent-utils/index.js +2 -2
- package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +2 -3
- 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/index.js +2 -2
- package/dist/chunks/BaseWorkflow.js +1 -1
- package/dist/chunks/SKILL.js +1 -1
- package/dist/chunks/SKILL2.js +1 -1
- package/dist/chunks/SKILL3.js +1 -1
- package/dist/chunks/SKILL4.js +1 -1
- package/dist/chunks/adapter.js +1 -1
- package/dist/chunks/aiFactory.js +56 -50
- package/dist/chunks/arcgisKnowledgeGraph.js +2 -2
- package/dist/chunks/arcgisToolRegistry.js +1 -1
- package/dist/chunks/arcgis_knowledge_current_lc_context.js +1 -1
- package/dist/chunks/arcgis_knowledge_current_map_context.js +1 -1
- package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +1 -1
- package/dist/chunks/arcgis_knowledge_lucene_generation_prompt.js +1 -1
- package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +1 -1
- package/dist/chunks/arcgis_knowledge_tool_prompt.js +1 -1
- package/dist/chunks/baseAgentState.js +1 -1
- package/dist/chunks/converterUtils.js +1 -1
- package/dist/chunks/dataExplorationAgent.js +1 -1
- package/dist/chunks/data_explore_filter_prompt.js +1 -1
- package/dist/chunks/data_explore_query_prompt.js +1 -1
- package/dist/chunks/embeddings.worker.js +1 -1
- package/dist/chunks/fetchAgentContext.js +1 -1
- package/dist/chunks/fetchService.js +1 -1
- package/dist/chunks/fieldStatistics.js +1 -1
- package/dist/chunks/field_descriptions_prompt.js +1 -1
- package/dist/chunks/formatFeatureAttributes.js +1 -1
- package/dist/chunks/generateLayerDescriptions.js +60 -63
- package/dist/chunks/graph.js +1 -1
- package/dist/chunks/helpAgent.js +1 -1
- package/dist/chunks/help_prompt.js +1 -1
- package/dist/chunks/index.js +1 -1
- package/dist/chunks/intent_prompt.js +1 -1
- package/dist/chunks/layerStylingGraph.js +1 -1
- package/dist/chunks/layer_descriptions_prompt.js +1 -1
- package/dist/chunks/layer_styling_prompt.js +1 -1
- package/dist/chunks/mergeWhereClauses.js +1 -1
- package/dist/chunks/navigationAgent.js +1 -1
- package/dist/chunks/navigation_intent_prompt.js +1 -1
- package/dist/chunks/navigation_tool_prompt.js +1 -1
- package/dist/chunks/orchestrator.js +1 -1
- package/dist/chunks/requireAgentServices.js +1 -1
- package/dist/chunks/resolvePointGeometryFilter.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/slottableRequestUtils.js +1 -1
- package/dist/chunks/state.js +26 -26
- 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 +1 -1
- package/dist/chunks/utils3.js +1 -1
- package/dist/components/arcgis-assistant/customElement.d.ts +6 -0
- package/dist/components/arcgis-assistant/customElement.js +126 -114
- package/dist/components/arcgis-assistant-agent/customElement.js +362 -220
- package/dist/components/arcgis-assistant-chat/customElement.js +1 -1
- package/dist/components/arcgis-assistant-chat-entry/customElement.js +1 -1
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-help-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-interrupt/customElement.js +1 -1
- package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +1 -1
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-message/customElement.js +1 -1
- package/dist/components/arcgis-assistant-message-block/customElement.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-speech-input/customElement.js +1 -1
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +1 -1
- package/dist/components/arcgis-assistant-user-message/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +1 -1
- package/dist/loader.js +1 -1
- package/dist/utils/index.js +3 -3
- package/package.json +11 -11
- package/dist/cdn/25MBI4PD.js +0 -2
- package/dist/cdn/2LVYAXHG.js +0 -44
- package/dist/cdn/2WXXSZP5.js +0 -2
- package/dist/cdn/5X23DDDZ.js +0 -2
- package/dist/cdn/65LCK3GG.js +0 -3
- package/dist/cdn/AUCKEB52.js +0 -2
- package/dist/cdn/B3HXSEBN.js +0 -2
- package/dist/cdn/BTTCBEPW.js +0 -2
- package/dist/cdn/CAOMMQSY.js +0 -66
- package/dist/cdn/EXMEB4X2.js +0 -2
- package/dist/cdn/FLUI6GCU.js +0 -2
- package/dist/cdn/FRYS2PZJ.js +0 -2
- package/dist/cdn/FSLQCZRN.js +0 -2
- package/dist/cdn/HKIA5PWU.js +0 -2
- package/dist/cdn/I3SUE2TR.js +0 -2
- package/dist/cdn/KAX4A7SF.js +0 -2
- package/dist/cdn/LIRT72WY.js +0 -2
- package/dist/cdn/M5B6X46F.js +0 -2
- package/dist/cdn/NGR5NVZE.js +0 -2
- package/dist/cdn/PUZ6RAFQ.js +0 -2
- package/dist/cdn/ROS22KOA.js +0 -2
- package/dist/cdn/SBNNJ5WA.js +0 -2
- package/dist/cdn/SDX46GZY.js +0 -2
- package/dist/cdn/SI22EJLC.js +0 -2
- package/dist/cdn/SXYKNDOF.js +0 -2
- package/dist/cdn/SZ2L5556.js +0 -2
- package/dist/cdn/UGIHS7OA.js +0 -2
- package/dist/cdn/VT5EWFH7.js +0 -2
- package/dist/cdn/XZF7Y6B2.js +0 -2
- package/dist/cdn/Y4ZOB6UH.js +0 -2
- package/dist/cdn/YIXASZUW.js +0 -2
package/dist/chunks/SKILL.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
const e = '---\nname: query\ndescription: Answers questions about feature-layer data, including counts, matching records, field values, aggregates, rankings, and spatially constrained results. Use when the user asks to inspect or summarize map data.\nallowed-tools: findRelevantLayers findRelevantFields getAttribute getStatistics getTopFeatures queryFeatures\n---\n\n# Query\n\n- When the task refers to an address, place, or location resolved by an earlier agent, call `listSharedResources` with `point` as the requested kind. If a resource description clearly matches the location, pass its exact ID as `geometryFilter.sharedResourceId` and use `where: "1=1"` unless the user requests an additional attribute filter. If no resource clearly matches a referential location such as "this location," state that the spatial anchor is unavailable and do not guess coordinates.\n- Start with `findRelevantLayers` unless a previous tool result from this run explicitly identifies the relevant layer ID. Use the assigned task as the semantic query.\n- If no relevant layers are returned, explain that no matching map layer was found and stop. Never invent a layer ID.\n- Before querying, call `findRelevantFields` with only relevant layer IDs. Use only the exact field names and categorical values returned by `findRelevantFields`.\n- Set `includeSummaryStatistics` to true when the requested answer directly depends on whole-layer numeric summary statistics such as average, minimum, maximum, sum, variance, standard deviation, null count, or range. Otherwise leave it false and use `getStatistics` later if analysis requires statistics under an attribute or spatial constraint.\n- Use statistics returned by `findRelevantFields` when they directly answer an unfiltered whole-layer question. Use `getStatistics` when a where clause or spatial constraint must be applied.\n- Use `queryFeatures` to count, find, or list matching features. It is the default query tool.\n- Use `getTopFeatures` for highest, lowest, first, last, or top-N records ranked by an existing field.\n- Use `getAttribute` only when retrieving a particular attribute from a specifically identified feature.\n- Use real field names rather than aliases in SQL-92 where clauses. Use `1=1` when no attribute filter is requested.\n- Set `useCurrentExtent` only when the user explicitly refers to the current view or visible map area.\n- If the request asks to visually show, display, highlight, map, filter, reveal, emphasize, hide, include, or exclude matching features, preserve the information needed for a visual operation in the working context: layer ID, where clause, geometry filter, `useCurrentExtent`, object IDs when available, and count. Preserve the exact values returned or used by tools so another skill can reuse them without repeating discovery.\n- Base the final answer only on returned tool data. State failures or empty results directly and do not fabricate values.\n';
|
|
3
3
|
export {
|
|
4
4
|
e as default
|
package/dist/chunks/SKILL2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
const e = '---\nname: filter\ndescription: Changes feature emphasis on the map by including, excluding, highlighting, dimming, or clearing filtered features. Use when the user asks to visually filter feature-layer data.\nallowed-tools: findRelevantLayers findRelevantFields setFeatureEffect resetMap clearFilters\n---\n\n# Filter\n\n- Use `clearFilters` when the user asks only to remove feature filters or effects. Use `resetMap` only when the user asks to reset the broader map state.\n- Reuse a preceding query result from this run whenever it contains the layer ID and filtering criteria needed for the visual operation. Do not repeat layer or field discovery in that case.\n- A preceding query result may provide the layer ID, where clause, geometry filter, `useCurrentExtent`, object IDs, and count. Preserve and reuse those values rather than reconstructing them.\n- If no usable preceding query geometry exists and the task refers to an address, place, or location resolved by an earlier agent, call `listSharedResources` with `point` as the requested kind. If a resource description clearly matches the location, pass its exact ID as `geometryFilter.sharedResourceId` and use `where: "1=1"` unless the user requests an additional attribute filter. If no resource clearly matches a referential location such as "this location," state that the spatial anchor is unavailable and do not guess coordinates.\n- If no usable preceding query result exists, start with `findRelevantLayers`. Use the assigned task as the semantic query. If no relevant layers are returned, explain that no matching map layer was found and stop. Never invent a layer ID.\n- When discovery is required, call `findRelevantFields` with only relevant layer IDs before constructing a filter. Use only the exact field names and categorical values returned by `findRelevantFields`.\n- Leave `includeSummaryStatistics` false unless the filter criteria explicitly depend on a requested numeric summary.\n- Use real field names rather than aliases in SQL-92 where clauses. Use `1=1` when no attribute filter is requested.\n- For highlight, show, include, exclude, or other visual-filter requests with feature criteria, call `setFeatureEffect` using the same layer ID, where clause, geometry filter, and `useCurrentExtent` value determined by the preceding query or discovery steps.\n- If a preceding query returned object IDs for ranked, top-N, or otherwise selected records, pass those object IDs to `setFeatureEffect` instead of rebuilding the selection using only a where clause.\n- Prefer the default feature effects unless the user explicitly requests a particular visual treatment.\n- Set `useCurrentExtent` only when the user explicitly refers to the current view or visible map area.\n- When available, use the preceding query result for feature counts or attribute details in the final response.\n- Report the `setFeatureEffect` outcome faithfully. Do not claim that a map effect was applied when the tool failed or no matching layer or field was found.\n';
|
|
3
3
|
export {
|
|
4
4
|
e as default
|
package/dist/chunks/SKILL3.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
const e = `---
|
|
3
3
|
name: help
|
|
4
4
|
description: Answers questions about the current map, its layers and fields, available assistant capabilities, unsupported map actions, and unrelated requests that need a map-focused redirect.
|
package/dist/chunks/SKILL4.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
const e = "---\nname: navigation\ndescription: Navigates the map to addresses, bookmarks, layers, matching features, extents, scales, zoom levels, and viewpoints using live map context and semantic layer and field search.\nallowed-tools: findRelevantLayers findRelevantFields goToAddress goToBookmark goToFeatures goToFullExtent goToHomeExtent goToLayer goToScale goToViewpoint goToZoom\n---\n\n# Navigation\n\n- Complete exactly one map-changing navigation action for the assigned task. Semantic search calls do not count as navigation actions.\n- Use the runtime context as the authoritative source for the current zoom level and exact available bookmark names.\n- Prefer an available bookmark over a feature or address when it clearly matches the requested place. Prefer a matching map feature over geocoding when the request identifies a layer or feature. Otherwise use `goToAddress` for an address or place name.\n- Use `goToZoom`, `goToScale`, or `goToViewpoint` directly for explicit numeric requests. For a relative zoom request, calculate one level above or below the current zoom from the runtime context and keep it within the tool's supported range.\n- Use `goToHomeExtent` to reset the map and `goToFullExtent` for the full-world extent. These actions do not require semantic search.\n- Before `goToLayer`, call `findRelevantLayers` with a concise query describing the requested layer. Use only a returned `layerId`. If there is no clear match, do not invent an ID or navigate.\n- Before `goToFeatures`, call `findRelevantLayers`, then call `findRelevantFields` with the relevant returned layer IDs and a query describing the requested condition. Use only the exact layer IDs returned by `findRelevantLayers`. Use only the exact field names and categorical values returned by `findRelevantFields`.\n- Build `goToFeatures` filters with valid ArcGIS SQL-92. Use field names rather than aliases, use coded-value domain codes when supplied, quote string values, and use `1=1` when all features in the selected layer are requested.\n- Do not call `findRelevantFields` for layer-only navigation or direct address, bookmark, extent, scale, viewpoint, or zoom navigation.\n- If required map context or semantic search results are missing or ambiguous, explain what is missing instead of guessing.\n- Report the navigation tool result faithfully. Never claim the map moved when the tool failed.\n";
|
|
3
3
|
export {
|
|
4
4
|
e as default
|
package/dist/chunks/adapter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import H from "@arcgis/core/identity/IdentityManager.js";
|
|
3
3
|
import P from "@arcgis/core/portal/Portal.js";
|
|
4
4
|
import J from "@arcgis/core/request.js";
|
package/dist/chunks/aiFactory.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import { ChatOpenAI as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { generateGuid as
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import { ChatOpenAI as b, OpenAIEmbeddings as U } from "@langchain/openai";
|
|
3
|
+
import h from "@arcgis/core/portal/Portal.js";
|
|
4
|
+
import y from "@arcgis/core/request.js";
|
|
5
|
+
import I from "@arcgis/core/identity/IdentityManager.js";
|
|
6
|
+
import { generateGuid as R } from "@arcgis/toolkit/string";
|
|
7
7
|
import q from "@arcgis/core/config.js";
|
|
8
|
-
const
|
|
8
|
+
const w = {
|
|
9
9
|
advanced: "gpt-5.6-sol",
|
|
10
10
|
default: "gpt-5.6-terra",
|
|
11
11
|
fast: "gpt-5.6-luna"
|
|
12
|
-
},
|
|
12
|
+
}, S = {
|
|
13
13
|
default: "text-embedding-ada-002"
|
|
14
|
-
},
|
|
14
|
+
}, g = /* @__PURE__ */ new Map();
|
|
15
15
|
let i = null;
|
|
16
|
-
const
|
|
17
|
-
const t =
|
|
16
|
+
const C = () => {
|
|
17
|
+
const t = h.getDefault().helperServices;
|
|
18
18
|
if (!t?.aiModels?.url)
|
|
19
19
|
throw new Error("AI Models Service URL is not defined in the portal's helper services.");
|
|
20
20
|
return t.aiModels.url;
|
|
21
|
-
},
|
|
22
|
-
const t =
|
|
23
|
-
|
|
21
|
+
}, v = async (e) => {
|
|
22
|
+
const t = C();
|
|
23
|
+
g.size === 0 && (i || (i = (async () => {
|
|
24
24
|
try {
|
|
25
|
-
(await
|
|
26
|
-
} catch (
|
|
27
|
-
throw i = null,
|
|
25
|
+
(await y(`${t}/models`)).data.models.forEach((a) => g.set(a.name, a));
|
|
26
|
+
} catch (n) {
|
|
27
|
+
throw i = null, n;
|
|
28
28
|
}
|
|
29
29
|
})()), await i);
|
|
30
|
-
const
|
|
31
|
-
if (!
|
|
30
|
+
const r = g.get(e);
|
|
31
|
+
if (!r)
|
|
32
32
|
throw new Error(`Model '${e}' is not available in the discovery service.`);
|
|
33
|
-
return
|
|
34
|
-
},
|
|
33
|
+
return r.endpoint;
|
|
34
|
+
}, A = async (e = "default") => await v(w[e]), k = async (e = "default") => await v(S[e]), z = (e) => typeof e == "string" && e.length > 0 ? e : void 0, D = () => R(), F = (e) => typeof e != "string" || e.trim().length === 0 ? "MapsSDK" : `MapsSDK - ${e.trim()}`, K = (e) => {
|
|
35
35
|
const t = e?.configurable;
|
|
36
36
|
return {
|
|
37
|
-
conversationId:
|
|
37
|
+
conversationId: z(t?.thread_id),
|
|
38
38
|
abortSignal: e?.signal,
|
|
39
39
|
requestId: D(),
|
|
40
40
|
requestSource: F(q.applicationName)
|
|
@@ -45,50 +45,56 @@ const R = () => {
|
|
|
45
45
|
if (e instanceof URLSearchParams)
|
|
46
46
|
return e.toString();
|
|
47
47
|
throw new TypeError(`Unsupported request body type: ${Object.prototype.toString.call(e)}`);
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
}, E = async ({
|
|
49
|
+
config: e,
|
|
50
|
+
withCredentials: t
|
|
51
|
+
}) => {
|
|
52
|
+
const r = h.getDefault(), n = await I.getCredential(`${r.url}/sharing`);
|
|
53
|
+
return async (o, a) => {
|
|
54
|
+
const { conversationId: c, abortSignal: l, requestId: p, requestSource: d } = K(e), s = new Headers(a?.headers);
|
|
55
|
+
for (const m of [...s.keys()]) {
|
|
56
|
+
const f = m.toLowerCase();
|
|
57
|
+
(f === "authorization" || f === "api-key" || f.startsWith("x-stainless-")) && s.delete(m);
|
|
55
58
|
}
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
const M =
|
|
59
|
-
return (await
|
|
60
|
-
body: L(
|
|
61
|
-
headers: Object.fromEntries(
|
|
59
|
+
const u = n?.token;
|
|
60
|
+
u && u.length > 0 && s.set("X-Esri-Authorization", `Bearer ${u}`), r.isPortal || (d && d.length > 0 && s.set("X-Esri-Request-Source", d), c && c.length > 0 && s.set("X-Esri-Conversation-Id", c), p.length > 0 && s.set("X-Esri-Request-Id", p));
|
|
61
|
+
const M = l && a?.signal ? AbortSignal.any([l, a.signal]) : a?.signal ?? l;
|
|
62
|
+
return (await y(o instanceof Request ? o.url : o.toString(), {
|
|
63
|
+
body: L(a?.body),
|
|
64
|
+
headers: Object.fromEntries(s),
|
|
62
65
|
responseType: "native",
|
|
66
|
+
withCredentials: t,
|
|
63
67
|
signal: M
|
|
64
68
|
})).data;
|
|
65
69
|
};
|
|
66
|
-
},
|
|
67
|
-
const { modelTier: t = "default", config:
|
|
68
|
-
return new
|
|
69
|
-
modelName:
|
|
70
|
+
}, j = async (e = {}) => {
|
|
71
|
+
const { modelTier: t = "default", config: r } = e, n = w[t], o = await A(t);
|
|
72
|
+
return new b({
|
|
73
|
+
modelName: n,
|
|
70
74
|
apiKey: "dummy-key",
|
|
75
|
+
useResponsesApi: !0,
|
|
76
|
+
zdrEnabled: !0,
|
|
71
77
|
configuration: {
|
|
72
|
-
baseURL:
|
|
73
|
-
fetch: await
|
|
78
|
+
baseURL: o,
|
|
79
|
+
fetch: await E({ config: r, withCredentials: !0 })
|
|
74
80
|
}
|
|
75
81
|
});
|
|
76
|
-
},
|
|
77
|
-
const { tier: t = "default", config:
|
|
82
|
+
}, H = async (e = {}) => {
|
|
83
|
+
const { tier: t = "default", config: r } = e, n = S[t], o = await k(t);
|
|
78
84
|
return new U({
|
|
79
|
-
modelName:
|
|
85
|
+
modelName: n,
|
|
80
86
|
apiKey: "dummy-key",
|
|
81
87
|
configuration: {
|
|
82
|
-
baseURL:
|
|
83
|
-
fetch: await
|
|
88
|
+
baseURL: o,
|
|
89
|
+
fetch: await E({ config: r })
|
|
84
90
|
},
|
|
85
91
|
batchSize: 2048,
|
|
86
92
|
maxConcurrency: 10
|
|
87
93
|
});
|
|
88
94
|
};
|
|
89
95
|
export {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
S as E,
|
|
97
|
+
H as a,
|
|
98
|
+
j as c,
|
|
99
|
+
k as g
|
|
94
100
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { StateGraph as x, START as k, END as c, Command as b } from "@langchain/langgraph/web";
|
|
3
3
|
import { a as K, c as _, g as T, b as A, d as S, s as M, q as v, e as u, f as q, t as g, h as C, G as E, i as m } from "./adapter.js";
|
|
4
4
|
import "@arcgis/core/identity/IdentityManager.js";
|
|
@@ -38,7 +38,7 @@ async function D(e, t) {
|
|
|
38
38
|
inputVariables: n,
|
|
39
39
|
tools: w,
|
|
40
40
|
config: t
|
|
41
|
-
}), l = (r.tool_calls?.length ?? 0) > 0, a = typeof r.text == "string" ? r.text.trim() : "", i = a.length > 0, d = r.
|
|
41
|
+
}), l = (r.tool_calls?.length ?? 0) > 0, a = typeof r.text == "string" ? r.text.trim() : "", i = a.length > 0, d = r.text;
|
|
42
42
|
return !l && (s === "map" || s === "knowledgeGraph") ? {
|
|
43
43
|
...e,
|
|
44
44
|
arcgisKnowledgeMessages: [...e.arcgisKnowledgeMessages, r],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
const e = `## Membership Bind Parameters
|
|
3
3
|
|
|
4
4
|
The current link chart contains a subset of entities and relationships from the database. Their membership is available to Cypher queries as lists of string identifiers through these bind parameters:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
const e = `## Membership Bind Parameters
|
|
3
3
|
|
|
4
4
|
The current map contains a subset of entities and relationships from the database. Their membership is available to Cypher queries as lists of string identifiers through these bind parameters:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
const e = `## ArcgisKnowledge Agent - Lucene Generation for Graph Search
|
|
3
3
|
|
|
4
4
|
You are an assistant that generates a lucene query for graph query searching.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
const n = `# ArcGIS Knowledge Agent — Action Summary
|
|
3
3
|
|
|
4
4
|
You are a Knowledge Graph assistant that has executed tool calls to answer a user request.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
const e = `# ArcgisKnowledge Tool Instructions
|
|
3
3
|
|
|
4
4
|
You are an assistant that helps users answer questions and perform operations on their knowledge graph, map or link chart. You have been assigned the task below, which must be achieved by calling a single tool.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { createSkillAgent as e } from "../agents/runtime/skill/createSkillAgent.js";
|
|
3
3
|
const t = [
|
|
4
4
|
async () => (await import("./SKILL.js")).default,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
const e = `# ArcGIS Online Map Viewer — Layer Filter Tool Calling Assistant
|
|
3
3
|
|
|
4
4
|
You are an assistant that helps manage layer filters and visual effects for **ArcGIS Online Map Viewer** by selecting and calling the appropriate tool.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
const e = `# ArcGIS JavaScript SDK FeatureLayerView Query Assistant
|
|
3
3
|
|
|
4
4
|
You are a GIS assistant that generates query parameters for the ArcGIS JavaScript SDK FeatureLayerView \`queryFeatures()\` method.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
const o = `(function(){"use strict";const h=(a,r)=>{if(a.length!==r.length)throw new Error("Vectors must be the same length");let c=0,t=0,e=0;for(let n=0;n<a.length;++n){const s=a[n],l=r[n];c+=s*l,t+=s*s,e+=l*l}const i=Math.sqrt(t*e);if(i===0)return 0;const m=c/i;return Math.max(-1,Math.min(1,m))},f=(a,r,c=.6)=>{const t=[],e=[...a];for(;t.length<r&&e.length>0;){let i=-1,m=-1/0;for(let n=0;n<e.length;n++){const s=e[n].score,l=t.length===0?0:Math.max(...t.map(o=>h(e[n].vector,o.vector))),d=c*s-(1-c)*l;d>m&&(m=d,i=n)}t.push(e[i]),e.splice(i,1)}return t.map(({name:i,score:m})=>({name:i,score:m}))};let p=[];const u=new Map,v=12,y=10,M=a=>{p=a.layers.map(r=>({id:r.id,vector:r.vector}))},E=a=>{u.clear();for(const r of a.layers){const c=r.fields.map(t=>({name:t.name,vector:t.vector}));u.set(r.id,c)}};globalThis.addEventListener("message",a=>{(async()=>{const{type:r,webmapEmbeddings:c,layerIdForFieldsSearch:t=[],requestId:e,precomputedEmbedding:i,minScore:m=0,topResults:n=v}=a.data;switch(r){case"generateEmbeddings":{c&&(M(c),E(c)),globalThis.postMessage("completed");break}case"layerSearch":{if(p.length>0)try{const s=p.map(o=>({id:o.id,vector:o.vector,score:h(i,o.vector)})),d=f(s.map(o=>({name:o.id,vector:o.vector,score:o.score})),y).map(({name:o,score:b})=>({id:o,score:b}));globalThis.postMessage({requestId:e,results:d})}catch(s){globalThis.postMessage({requestId:e,results:[],error:s instanceof Error?s.message:"Calculation error"})}else globalThis.postMessage({requestId:e,results:[],error:"Layer embeddings not initialized"});break}case"fieldSearch":{if(t.length>0)try{const s=t.map(l=>{const d=u.get(l);if(!d)return{layerId:l,results:[]};const o=d.map(g=>({name:g.name,vector:g.vector,score:h(i,g.vector)})).filter(({score:g})=>g>=m),b=f(o,n);return{layerId:l,results:b}});globalThis.postMessage({requestId:e,results:s})}catch(s){globalThis.postMessage({requestId:e,results:[],error:s instanceof Error?s.message:"Field search calculation error"})}break}default:console.warn("Unknown message type:",r)}})()})})();
|
|
3
3
|
`, s = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", o], { type: "text/javascript;charset=utf-8" });
|
|
4
4
|
function a(r) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import v from "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
|
|
3
3
|
import L from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
|
|
4
4
|
const $ = 10, b = ["string", "small-integer", "integer"], w = async (u, e, { includeSummaryStatistics: d = !0, includeUniqueValues: y = !0 } = {}) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { formatDateOnly as F, convertDateFormatToIntlOptions as m, formatTimeOnly as T, formatDate as p } from "@arcgis/core/intl.js";
|
|
3
3
|
const w = /* @__PURE__ */ new Set([
|
|
4
4
|
"date",
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import { Annotation as
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import { Annotation as p } from "@langchain/langgraph/web";
|
|
3
3
|
import { b as j, r as T, m as P, c as q } from "./baseAgentState.js";
|
|
4
|
-
import
|
|
5
|
-
import { ChatPromptTemplate as
|
|
4
|
+
import l, { z as s } from "zod";
|
|
5
|
+
import { ChatPromptTemplate as S, SystemMessagePromptTemplate as N } from "@langchain/core/prompts";
|
|
6
6
|
import { s as g } from "./index.js";
|
|
7
7
|
import { AIMessage as O, isAIMessage as $, isToolMessage as U } from "@langchain/core/messages";
|
|
8
8
|
import { createAgent as V, summarizationMiddleware as L, modelCallLimitMiddleware as z } from "langchain";
|
|
9
|
-
import { c as
|
|
10
|
-
const
|
|
11
|
-
agentExecutionContext:
|
|
9
|
+
import { c as y, E as W } from "./aiFactory.js";
|
|
10
|
+
const he = p.Root({
|
|
11
|
+
agentExecutionContext: p({
|
|
12
12
|
default: q,
|
|
13
13
|
reducer: P
|
|
14
14
|
}),
|
|
15
|
-
currentIntent:
|
|
15
|
+
currentIntent: p({
|
|
16
16
|
default: () => "none",
|
|
17
17
|
reducer: T
|
|
18
18
|
}),
|
|
19
|
-
routing:
|
|
19
|
+
routing: p({
|
|
20
20
|
default: () => ({ mode: "auto" }),
|
|
21
21
|
reducer: T
|
|
22
22
|
}),
|
|
23
|
-
lastExecutedAgent:
|
|
23
|
+
lastExecutedAgent: p({
|
|
24
24
|
default: () => "",
|
|
25
25
|
reducer: T
|
|
26
26
|
}),
|
|
27
|
-
requiresFollowUp:
|
|
27
|
+
requiresFollowUp: p({
|
|
28
28
|
default: () => !0,
|
|
29
29
|
reducer: T
|
|
30
30
|
}),
|
|
31
|
-
stepCount:
|
|
31
|
+
stepCount: p({
|
|
32
32
|
default: () => 0,
|
|
33
33
|
reducer: (e, t) => t ?? e + 1
|
|
34
34
|
}),
|
|
35
|
-
finalOutputMessage:
|
|
35
|
+
finalOutputMessage: p({
|
|
36
36
|
default: () => "",
|
|
37
37
|
reducer: j
|
|
38
38
|
})
|
|
39
|
-
}),
|
|
39
|
+
}), B = (e) => {
|
|
40
40
|
if (!e || typeof e != "object" || !("services" in e))
|
|
41
41
|
return !1;
|
|
42
42
|
const t = e.services;
|
|
43
43
|
return !!t && typeof t == "object" && "agentRegistry" in t;
|
|
44
|
-
},
|
|
44
|
+
}, G = (e) => {
|
|
45
45
|
const t = e?.configurable;
|
|
46
|
-
return
|
|
47
|
-
},
|
|
46
|
+
return B(t) ? t : void 0;
|
|
47
|
+
}, H = (e, t, i) => {
|
|
48
48
|
const n = e[t];
|
|
49
49
|
return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((r, o) => {
|
|
50
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." : ""))));
|
|
51
51
|
});
|
|
52
|
-
}, v = async (e) => (await
|
|
52
|
+
}, v = async (e) => (await H(/* @__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, J = async (e) => {
|
|
53
53
|
const { agent: t, messages: i, config: n } = e;
|
|
54
54
|
return { structuredResponse: (await t.invoke(
|
|
55
55
|
{
|
|
@@ -70,8 +70,8 @@ const I = (e) => JSON.stringify(e, null, 2), Q = (e) => {
|
|
|
70
70
|
assignedTask: s.string().nullable(),
|
|
71
71
|
requiresFollowUp: s.boolean()
|
|
72
72
|
});
|
|
73
|
-
},
|
|
74
|
-
const i =
|
|
73
|
+
}, ye = async (e, t) => {
|
|
74
|
+
const i = G(t);
|
|
75
75
|
if (t?.signal?.aborted)
|
|
76
76
|
return await g({ text: "Run cancelled; skipping intent routing" }, t), {
|
|
77
77
|
...e,
|
|
@@ -92,24 +92,24 @@ const I = (e) => JSON.stringify(e, null, 2), Q = (e) => {
|
|
|
92
92
|
currentIntent: "none",
|
|
93
93
|
finalOutputMessage: "No agents registered; skipping intent detection."
|
|
94
94
|
};
|
|
95
|
-
const a = await v("intent_prompt"), c = I(o),
|
|
95
|
+
const a = await v("intent_prompt"), c = I(o), m = Q(o), d = {
|
|
96
96
|
registeredAgents: c,
|
|
97
97
|
priorSteps: I(e.agentExecutionContext.priorSteps),
|
|
98
98
|
userRequest: e.agentExecutionContext.userRequest
|
|
99
|
-
}, k = await
|
|
100
|
-
model: await
|
|
99
|
+
}, k = await S.fromTemplate(a).format(d), D = V({
|
|
100
|
+
model: await y({
|
|
101
101
|
modelTier: "fast",
|
|
102
102
|
config: t
|
|
103
103
|
}),
|
|
104
104
|
tools: [],
|
|
105
105
|
systemPrompt: k,
|
|
106
|
-
responseFormat:
|
|
106
|
+
responseFormat: m,
|
|
107
107
|
middleware: [
|
|
108
108
|
// Preserve recent conversation context while summarizing older messages
|
|
109
109
|
// to control token usage without losing important intent signals.
|
|
110
110
|
// The trigger and keep parameters can be tuned based on token limits and behavior.
|
|
111
111
|
L({
|
|
112
|
-
model: await
|
|
112
|
+
model: await y({
|
|
113
113
|
modelTier: "fast",
|
|
114
114
|
config: t
|
|
115
115
|
}),
|
|
@@ -120,11 +120,11 @@ const I = (e) => JSON.stringify(e, null, 2), Q = (e) => {
|
|
|
120
120
|
// 1 usual LLM call and 1 optional summarization call.
|
|
121
121
|
z({ runLimit: 2 })
|
|
122
122
|
]
|
|
123
|
-
}), { structuredResponse: R } = await
|
|
123
|
+
}), { structuredResponse: R } = await J({
|
|
124
124
|
agent: D,
|
|
125
125
|
messages: e.agentExecutionContext.messages,
|
|
126
126
|
config: t
|
|
127
|
-
}), f =
|
|
127
|
+
}), f = m.parse(
|
|
128
128
|
R ?? { intent: null, assignedTask: null, requiresFollowUp: !1 }
|
|
129
129
|
), x = f.intent ?? "none", F = {
|
|
130
130
|
...e,
|
|
@@ -171,7 +171,7 @@ Requires Follow-Up: ${f.requiresFollowUp}`
|
|
|
171
171
|
} catch (n) {
|
|
172
172
|
throw await g({ text: "Error during intent detection" }, t), new Error(`Error during intent detection: ${n instanceof Error ? n.message : String(n)}`);
|
|
173
173
|
}
|
|
174
|
-
}, X = "0.1",
|
|
174
|
+
}, X = "0.1", h = 1536, Y = "openai", Z = W.default, ee = `Name: {name}
|
|
175
175
|
Title: {title}
|
|
176
176
|
Description: {description}`, te = `Name: {name}
|
|
177
177
|
Alias: {alias}
|
|
@@ -181,7 +181,7 @@ Description: {description}`, we = s.object({
|
|
|
181
181
|
embeddings: s.object({
|
|
182
182
|
modelProvider: s.literal(Y),
|
|
183
183
|
model: s.literal(Z),
|
|
184
|
-
dimensions: s.literal(
|
|
184
|
+
dimensions: s.literal(h),
|
|
185
185
|
templates: s.object({
|
|
186
186
|
layer: s.string().default(ee),
|
|
187
187
|
field: s.string().default(te)
|
|
@@ -193,16 +193,16 @@ Description: {description}`, we = s.object({
|
|
|
193
193
|
name: s.string().min(1),
|
|
194
194
|
title: s.string().catch(""),
|
|
195
195
|
description: s.string().catch(""),
|
|
196
|
-
vector: s.array(s.number()).length(
|
|
197
|
-
message: `Layer vector must be exactly ${
|
|
196
|
+
vector: s.array(s.number()).length(h, {
|
|
197
|
+
message: `Layer vector must be exactly ${h} dimensions`
|
|
198
198
|
}),
|
|
199
199
|
fields: s.array(
|
|
200
200
|
s.object({
|
|
201
201
|
name: s.string().min(1),
|
|
202
202
|
alias: s.string().catch(""),
|
|
203
203
|
description: s.string().catch(""),
|
|
204
|
-
vector: s.array(s.number()).length(
|
|
205
|
-
message: `Field vector must be exactly ${
|
|
204
|
+
vector: s.array(s.number()).length(h, {
|
|
205
|
+
message: `Field vector must be exactly ${h} dimensions`
|
|
206
206
|
})
|
|
207
207
|
})
|
|
208
208
|
)
|
|
@@ -226,9 +226,9 @@ Description: {description}`, we = s.object({
|
|
|
226
226
|
});
|
|
227
227
|
}, M = (e, t) => {
|
|
228
228
|
const i = N.fromTemplate(e);
|
|
229
|
-
return
|
|
229
|
+
return S.fromMessages([i, ...t]);
|
|
230
230
|
}, se = async (e) => {
|
|
231
|
-
const { promptText: t, modelTier: i, messages: n, config: r } = e, o = M(t, n ?? []), a = await
|
|
231
|
+
const { promptText: t, modelTier: i, messages: n, config: r } = e, o = M(t, n ?? []), a = await y({ modelTier: i, config: r });
|
|
232
232
|
return o.pipe(a);
|
|
233
233
|
}, xe = async (e) => {
|
|
234
234
|
const { promptText: t, modelTier: i = "default", messages: n, inputVariables: r, config: o } = e, c = await (await se({
|
|
@@ -237,31 +237,28 @@ Description: {description}`, we = s.object({
|
|
|
237
237
|
messages: n,
|
|
238
238
|
config: o
|
|
239
239
|
})).invoke(r ?? {}, o);
|
|
240
|
-
|
|
241
|
-
return c;
|
|
242
|
-
const l = c.content;
|
|
243
|
-
return typeof l == "string" ? l : JSON.stringify(l);
|
|
240
|
+
return typeof c == "string" ? c : c.text;
|
|
244
241
|
}, 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
|
|
242
|
+
const { promptText: t, modelTier: i = "default", messages: n, inputVariables: r, schema: o, config: a } = e, c = M(t, n ?? []), d = (await y({ modelTier: i, config: a })).withStructuredOutput(o);
|
|
246
243
|
return await c.pipe(d).invoke(r ?? {}, a);
|
|
247
244
|
}, 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 ?? [],
|
|
249
|
-
return await
|
|
250
|
-
}, ie =
|
|
251
|
-
name:
|
|
252
|
-
description:
|
|
253
|
-
valueType:
|
|
254
|
-
alias:
|
|
255
|
-
}), oe =
|
|
256
|
-
fields:
|
|
245
|
+
const { promptText: t, modelTier: i = "default", messages: n, inputVariables: r, tools: o, config: a } = e, c = o.length > 0 ? ne(n ?? []) : n ?? [], m = M(t, c), d = await y({ modelTier: i, config: a });
|
|
246
|
+
return await m.pipe(d.bindTools(o)).invoke(r ?? {}, a);
|
|
247
|
+
}, ie = l.object({
|
|
248
|
+
name: l.string(),
|
|
249
|
+
description: l.string(),
|
|
250
|
+
valueType: l.string(),
|
|
251
|
+
alias: l.string()
|
|
252
|
+
}), oe = l.object({
|
|
253
|
+
fields: l.array(ie)
|
|
257
254
|
}), C = (e, t) => e.getFieldAlias(t) ?? void 0, b = (e, t) => C(e, t.name) ?? t.alias ?? "", re = (e, t) => {
|
|
258
255
|
const i = C(e, t.name);
|
|
259
256
|
return !!(i && i !== (t.alias ?? ""));
|
|
260
257
|
};
|
|
261
|
-
function
|
|
258
|
+
function E(e, t) {
|
|
262
259
|
const i = /* @__PURE__ */ new Map();
|
|
263
260
|
for (const n of e.fields) {
|
|
264
|
-
const r = t.fields.find((
|
|
261
|
+
const r = t.fields.find((m) => m.name === n.name), o = b(e, n), a = re(e, n), c = {
|
|
265
262
|
name: n.name,
|
|
266
263
|
type: n.type,
|
|
267
264
|
alias: a ? o : r?.alias ?? o,
|
|
@@ -275,12 +272,12 @@ function S(e, t) {
|
|
|
275
272
|
}
|
|
276
273
|
const be = async (e) => {
|
|
277
274
|
const i = await v("field_descriptions_prompt"), n = e.fields.filter((a) => !(b(e, a) && a.description)).map((a) => {
|
|
278
|
-
const { name: c, type:
|
|
279
|
-
return [`Name: ${c}`, `Type: ${
|
|
275
|
+
const { name: c, type: m, description: d } = a, w = b(e, a);
|
|
276
|
+
return [`Name: ${c}`, `Type: ${m}`, `Alias: ${w}`, `Description: ${d ?? "N/A"}`].join(", ");
|
|
280
277
|
}).join(`
|
|
281
278
|
`);
|
|
282
279
|
if (n.length === 0)
|
|
283
|
-
return
|
|
280
|
+
return E(e, { fields: [] });
|
|
284
281
|
const r = {
|
|
285
282
|
existingItemTitle: e.portalItem?.title,
|
|
286
283
|
existingItemDescription: e.portalItem?.description,
|
|
@@ -292,11 +289,11 @@ const be = async (e) => {
|
|
|
292
289
|
schema: oe,
|
|
293
290
|
inputVariables: r
|
|
294
291
|
});
|
|
295
|
-
return
|
|
296
|
-
}, ae =
|
|
297
|
-
title:
|
|
298
|
-
description:
|
|
299
|
-
name:
|
|
292
|
+
return E(e, o);
|
|
293
|
+
}, ae = l.object({
|
|
294
|
+
title: l.string(),
|
|
295
|
+
description: l.string(),
|
|
296
|
+
name: l.string().nullable()
|
|
300
297
|
}), ve = async (e, t) => {
|
|
301
298
|
const n = await v("layer_descriptions_prompt"), r = Array.from(t.values()), o = {
|
|
302
299
|
fieldInformation: JSON.stringify(r, null, 2),
|
|
@@ -312,15 +309,15 @@ const be = async (e) => {
|
|
|
312
309
|
}), name: e.title ?? null };
|
|
313
310
|
};
|
|
314
311
|
export {
|
|
315
|
-
|
|
312
|
+
he as D,
|
|
316
313
|
we as W,
|
|
317
314
|
xe as a,
|
|
318
|
-
|
|
315
|
+
ye as b,
|
|
319
316
|
be as c,
|
|
320
317
|
ve as d,
|
|
321
|
-
|
|
318
|
+
h as e,
|
|
322
319
|
te as f,
|
|
323
|
-
|
|
320
|
+
G as g,
|
|
324
321
|
Y as h,
|
|
325
322
|
Te as i,
|
|
326
323
|
A as j,
|