@arcgis/ai-components 5.2.0-next.106 → 5.2.0-next.108
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.js +1 -1
- 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 +1 -1
- 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/agents/runtime/skill/createSkillAgent.d.ts +1 -1
- package/dist/agents/runtime/skill/createSkillAgent.js +42 -44
- package/dist/agents/runtime/skill/types.d.ts +1 -1
- 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/25MBI4PD.js +2 -0
- package/dist/cdn/{3XDT7MWI.js → 275FFTBE.js} +2 -2
- package/dist/cdn/{XQ3NBBQ3.js → 2F4TPWZQ.js} +1 -1
- package/dist/cdn/{KJLLN4P4.js → 2LVYAXHG.js} +3 -3
- package/dist/cdn/{5MK44FNO.js → 2NRCE53B.js} +2 -2
- package/dist/cdn/{XKH37FLY.js → 2WXXSZP5.js} +2 -2
- package/dist/cdn/{APFZY4PI.js → 3KNLFIM3.js} +2 -2
- package/dist/cdn/{VMZZR7MY.js → 3PPXAIRE.js} +2 -2
- package/dist/cdn/{JMNHFKGL.js → 45BDE3MG.js} +2 -2
- package/dist/cdn/{S4LELUBK.js → 477I66FH.js} +2 -2
- package/dist/cdn/4CFCV47G.js +2 -0
- package/dist/cdn/{TPULIO6I.js → 4IWDBEMN.js} +2 -2
- package/dist/cdn/{HHBNLCJP.js → 4OI4QEV7.js} +2 -2
- package/dist/cdn/{2W7LK4HA.js → 4UAREC76.js} +2 -2
- package/dist/cdn/{TEI6WXW7.js → 4VBOTWC3.js} +2 -2
- package/dist/cdn/{RLEHNAIA.js → 4YOG5F3W.js} +1 -1
- package/dist/cdn/5X23DDDZ.js +2 -0
- package/dist/cdn/65ZACLYB.js +2 -0
- package/dist/cdn/{D5EKX26R.js → 6KWGSXIN.js} +2 -2
- package/dist/cdn/{O4NVW75A.js → 6MRTZ4OM.js} +2 -2
- package/dist/cdn/{6YZGKVYB.js → 77NAJM5H.js} +2 -2
- package/dist/cdn/{NEV6OZN3.js → 7DOYUO7L.js} +2 -2
- package/dist/cdn/{EYOWRGDP.js → 7JJX6VGI.js} +2 -2
- package/dist/cdn/{ONQ6JSBJ.js → A6LBMS7A.js} +1 -1
- package/dist/cdn/{EOD5PNOL.js → AP3KPOHN.js} +2 -2
- package/dist/cdn/AUCKEB52.js +2 -0
- package/dist/cdn/B3HXSEBN.js +2 -0
- package/dist/cdn/{6ECRQVHY.js → BAKJLCYO.js} +2 -2
- package/dist/cdn/{74CVYM72.js → BJMGT6GV.js} +2 -2
- package/dist/cdn/{5LMYUEK7.js → BTOBEN7Q.js} +2 -2
- package/dist/cdn/BTTCBEPW.js +2 -0
- package/dist/cdn/{UZLQALHY.js → BVUCNXC5.js} +1 -1
- package/dist/cdn/{RFVZ7KCG.js → CAOMMQSY.js} +1 -1
- package/dist/cdn/{P4GFYBBO.js → CBYBFBD3.js} +2 -2
- package/dist/cdn/{725MBCQF.js → CKUUYQLO.js} +2 -2
- package/dist/cdn/{MWYBF3F3.js → CSE6BHOJ.js} +2 -2
- package/dist/cdn/{XTCLJEID.js → CX2HJ67C.js} +2 -2
- package/dist/cdn/EELMDCPV.js +2 -0
- package/dist/cdn/{6RAWG2KQ.js → EGRRZTF6.js} +2 -2
- package/dist/cdn/EHYDAEGL.js +2 -0
- package/dist/cdn/{TBYDZN4H.js → EK3PM4L5.js} +2 -2
- package/dist/cdn/{PYGX4HN7.js → ENAEE4UU.js} +2 -2
- package/dist/cdn/EXMEB4X2.js +2 -0
- package/dist/cdn/{AGQ5ADFU.js → EYGZJKVD.js} +2 -2
- package/dist/cdn/{BTTBKTFM.js → FK2CVSXW.js} +2 -2
- package/dist/cdn/FLUI6GCU.js +2 -0
- package/dist/cdn/{ZU2FHVNK.js → FPH52WOH.js} +2 -2
- package/dist/cdn/FRYS2PZJ.js +2 -0
- package/dist/cdn/FSLQCZRN.js +2 -0
- package/dist/cdn/{PQ2DPOFM.js → FTTLFIBV.js} +2 -2
- package/dist/cdn/{2AMUOR7X.js → FV6FHLYW.js} +2 -2
- package/dist/cdn/{TFRWUAB6.js → G24MNC7D.js} +2 -2
- package/dist/cdn/{6OOZSZRJ.js → GN56DOYL.js} +2 -2
- package/dist/cdn/{ROQGPAR5.js → HIJGY4GU.js} +2 -2
- package/dist/cdn/{BL273EGZ.js → HMMYCSOK.js} +2 -2
- package/dist/cdn/{ES6D4UD6.js → HNTSDY3J.js} +2 -2
- package/dist/cdn/HQOK6DDH.js +2 -0
- package/dist/cdn/{HB72YIII.js → HV7MVIQV.js} +2 -2
- package/dist/cdn/I3SUE2TR.js +2 -0
- package/dist/cdn/{VAXH6RUQ.js → I72ST4JR.js} +2 -2
- package/dist/cdn/{FYZATVB3.js → IHUWQOMK.js} +2 -2
- package/dist/cdn/{J6A4AS7E.js → JMXXRRKQ.js} +2 -2
- package/dist/cdn/{5HBAJ57P.js → JPXEMNPR.js} +2 -2
- package/dist/cdn/{UHEYPSOR.js → JYNHWJUZ.js} +2 -2
- package/dist/cdn/KAX4A7SF.js +2 -0
- package/dist/cdn/{BQYF37UD.js → KBSXHSBX.js} +2 -2
- package/dist/cdn/{CCC6LBMY.js → KKCLHXHG.js} +1 -1
- package/dist/cdn/{7UF3WRLO.js → L2HLFWCV.js} +2 -2
- package/dist/cdn/{LK7ZIQW6.js → L3BTURBA.js} +2 -2
- package/dist/cdn/{IRSJXHRN.js → LBTGOMCT.js} +2 -2
- package/dist/cdn/{34O57OGV.js → LLY5A2E2.js} +1 -1
- package/dist/cdn/{OOGADOKQ.js → LXIKAXUT.js} +2 -2
- package/dist/cdn/{S627D4K7.js → M2U456J5.js} +2 -2
- package/dist/cdn/{UAG6GDUG.js → M3KKORBG.js} +2 -2
- package/dist/cdn/M5B6X46F.js +2 -0
- package/dist/cdn/{SDWWUWAF.js → MZUDIQQH.js} +2 -2
- package/dist/cdn/{CEKOEHB3.js → NNPA3NLK.js} +2 -2
- package/dist/cdn/{MXTXJKFE.js → NPWLYHMU.js} +2 -2
- package/dist/cdn/NV7CL4S3.js +2 -0
- package/dist/cdn/{3UEKINYC.js → OALQBAZR.js} +2 -2
- package/dist/cdn/{RHYNE5OE.js → OF3TAARW.js} +1 -1
- package/dist/cdn/{F5NIRETW.js → P53TDER7.js} +2 -2
- package/dist/cdn/{SXM4NUT5.js → PJLGCS33.js} +2 -2
- package/dist/cdn/{EJJFG5DE.js → PJPP6LOS.js} +2 -2
- package/dist/cdn/PUZ6RAFQ.js +2 -0
- package/dist/cdn/{IHP25JWI.js → QAX6UF4L.js} +2 -2
- package/dist/cdn/{JEBRN3EU.js → QTEPFTAU.js} +2 -2
- package/dist/cdn/ROS22KOA.js +2 -0
- package/dist/cdn/RPOFBIE7.js +2 -0
- package/dist/cdn/{COH3QXWG.js → S5GFNIHC.js} +3 -3
- package/dist/cdn/{A7BKHIMA.js → SBNNJ5WA.js} +2 -2
- package/dist/cdn/SI22EJLC.js +2 -0
- package/dist/cdn/{7QIX4PZR.js → SJMAKF4P.js} +2 -2
- package/dist/cdn/{6P44KOKX.js → SKCUGZ7G.js} +2 -2
- package/dist/cdn/{V6HOUZPZ.js → SNG3WODY.js} +2 -2
- package/dist/cdn/{JWZD3D5E.js → STOGCXJH.js} +2 -2
- package/dist/cdn/{OMF6ITSG.js → SUC2MIGE.js} +2 -2
- package/dist/cdn/SXYKNDOF.js +2 -0
- package/dist/cdn/SZ2L5556.js +2 -0
- package/dist/cdn/{4ALF2CJY.js → T6W6F4TF.js} +2 -2
- package/dist/cdn/{RN6WMVZX.js → TFAJNKBC.js} +2 -2
- package/dist/cdn/{R74ZHFA6.js → TLPZELG3.js} +1 -1
- package/dist/cdn/{2O4DON37.js → TNLFUXIB.js} +2 -2
- package/dist/cdn/{RLB6TK6B.js → TXZQZR3I.js} +2 -2
- package/dist/cdn/UGIHS7OA.js +2 -0
- package/dist/cdn/{UDRKUVZP.js → UX457AQR.js} +2 -2
- package/dist/cdn/{ICBIUFK7.js → V266DJ5V.js} +2 -2
- package/dist/cdn/{FDOMMK2M.js → V4PJMCJZ.js} +1 -1
- package/dist/cdn/{3VCPN2KW.js → V52GSTOC.js} +2 -2
- package/dist/cdn/{UHICISBZ.js → VGLBH473.js} +2 -2
- package/dist/cdn/{WSWB3B7B.js → VHNTHPH7.js} +2 -2
- package/dist/cdn/{OZ2CM3J2.js → VK6CCPTG.js} +2 -2
- package/dist/cdn/{AOVJ34QE.js → VLPELJUS.js} +2 -2
- package/dist/cdn/VT5EWFH7.js +2 -0
- package/dist/cdn/{Y7LGFSHO.js → VXLKTQ36.js} +2 -2
- package/dist/cdn/{CFAC4FN3.js → W54XYT2A.js} +2 -2
- package/dist/cdn/{RZIXMISL.js → X42ACC66.js} +2 -2
- package/dist/cdn/{7EOS4SGJ.js → XNUWVZN7.js} +2 -2
- package/dist/cdn/{2OUIRKTV.js → XOTPSCNF.js} +2 -2
- package/dist/cdn/{ZZZB3GES.js → XRVGYRXL.js} +2 -2
- package/dist/cdn/{JKKU4K4C.js → XV7RMYLR.js} +2 -2
- package/dist/cdn/{3SD47V7G.js → XVJFPZTW.js} +2 -2
- package/dist/cdn/XZF7Y6B2.js +2 -0
- package/dist/cdn/Y4ZOB6UH.js +2 -0
- package/dist/cdn/{ZFOG3KXV.js → Y6CV2NZR.js} +2 -2
- package/dist/cdn/YMJKT5OK.js +2 -0
- package/dist/cdn/{6GODC6RU.js → YOW3YKWR.js} +2 -2
- package/dist/cdn/{OKVLGJAG.js → ZA7ZU2F7.js} +2 -2
- package/dist/cdn/{OL7QBAGS.js → ZJWR4W2S.js} +2 -2
- package/dist/cdn/ZWIKFBOU.js +2 -0
- package/dist/cdn/{MXAZE2VM.js → ZY3JQCZQ.js} +36 -36
- 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/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 +1 -1
- package/dist/chunks/arcgisKnowledgeGraph.js +1 -1
- package/dist/chunks/arcgisToolRegistry.js +88 -0
- 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 +3 -14
- 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 +1 -1
- package/dist/chunks/graph.js +1 -1
- package/dist/chunks/helpAgent.js +11 -14
- 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 +7 -20
- 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 +2 -2
- package/dist/chunks/slottableRequestUtils.js +1 -1
- package/dist/chunks/state.js +1 -1
- 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.js +1 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +130 -212
- 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 +1 -1
- package/package.json +5 -5
- package/dist/cdn/23C34FEU.js +0 -2
- package/dist/cdn/2OHRNRNT.js +0 -2
- package/dist/cdn/2S6L3P4Q.js +0 -2
- package/dist/cdn/3IOP64NG.js +0 -2
- package/dist/cdn/3OH35VXS.js +0 -2
- package/dist/cdn/434TAA3J.js +0 -2
- package/dist/cdn/AFSBL4ZP.js +0 -2
- package/dist/cdn/BVSK2GWP.js +0 -2
- package/dist/cdn/EGN5BCHV.js +0 -2
- package/dist/cdn/HLN5675C.js +0 -2
- package/dist/cdn/IFFOSSNB.js +0 -2
- package/dist/cdn/IO7DYFL2.js +0 -2
- package/dist/cdn/JD2TB7H4.js +0 -2
- package/dist/cdn/KZ73TZOB.js +0 -2
- package/dist/cdn/LEO3USHH.js +0 -2
- package/dist/cdn/LNIMGXB4.js +0 -2
- package/dist/cdn/MG2W2ZF3.js +0 -2
- package/dist/cdn/MSXMHRI7.js +0 -2
- package/dist/cdn/PK5KI2XF.js +0 -2
- package/dist/cdn/PWFUEBTT.js +0 -2
- package/dist/cdn/RSJSRETN.js +0 -2
- package/dist/cdn/RSR66KB4.js +0 -2
- package/dist/cdn/SL4Y7IRG.js +0 -2
- package/dist/cdn/STUBN3L5.js +0 -2
- package/dist/cdn/T2OYKP3V.js +0 -2
- package/dist/cdn/U3ETGDT7.js +0 -2
- package/dist/cdn/VXFQANGJ.js +0 -2
- package/dist/cdn/WW4BEFDF.js +0 -2
- package/dist/cdn/XGCQS3N4.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{g as i,h as s,v as n,z as o}from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import{g as i,h as s,v as n,z as o}from"./S5GFNIHC.js";import"./TLPZELG3.js";import"./BVUCNXC5.js";var c=i`:host{display:block}`,e=class extends n{static{this.properties={block:0}}static{this.styles=c}_renderSuggestedPrompts(t){if(t.type!=="suggested-prompts")return null;let r=t.data?.prompts,a=Array.isArray(r)?r.filter(p=>typeof p=="string"):[];return a.length?s`<arcgis-assistant-suggested-prompts .prompts=${a}></arcgis-assistant-suggested-prompts>`:null}_renderBlock(t){switch(t.type){case"suggested-prompts":return this._renderSuggestedPrompts(t);case"text":return s`<arcgis-assistant-message-text .content=${t.data?.content} .parts=${t.data?.parts}></arcgis-assistant-message-text>`;default:return null}}render(){return this.block?this._renderBlock(this.block):null}};o("arcgis-assistant-message-block",e);export{e as ArcgisAssistantMessageBlock};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import"./BVUCNXC5.js";var e=`# Navigation Tool Instructions
|
|
3
3
|
|
|
4
4
|
CRITICAL: You are FORBIDDEN from making multiple tool calls. You MUST make exactly ONE tool call.
|
|
5
5
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{a}from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import{a}from"./A6LBMS7A.js";import{Dc as n}from"./M2U456J5.js";import{Dd as e}from"./CSE6BHOJ.js";export default $arcgis.t(([m])=>{async function r(t){let o=new m({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:{wkid:4326}}).expand(.7);return await t.goTo(o),{text:"Successfully zoomed to world extent"}}async function s(t,o){let{mapView:i}=a(o,["mapView"]);return await r(i)}var c=e.object({}),u=n(s,{name:"goToFullExtent",description:"Zooms the map to the full world extent using Esri's Geocoding Service.",schema:c});return u},"geometry/Extent")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
export default $arcgis.t(([{formatDateOnly:h,convertDateFormatToIntlOptions:m,formatTimeOnly:N,formatDate:c}])=>{var T=new Set(["date","esrifieldtypedate","date-only","dateonly","esrifieldtypedateonly","time-only","timeonly","esrifieldtypetimeonly","timestamp-offset","timestampoffset","esrifieldtypetimestampoffset"]),y=e=>{if(!e)return!1;let t=e.toLowerCase();return T.has(t)},f=e=>{if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"&&Number.isFinite(e)){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}return null},S=e=>!e||e==="system"?Intl.DateTimeFormat().resolvedOptions().timeZone:e==="unknown"?"UTC":e,w=e=>{if(typeof e=="string"&&e)return e;let t=f(e);return t?t.toISOString().slice(0,10):null},j=()=>{let e=new Date().getTimezoneOffset(),t=e<=0?"+":"-",n=Math.floor(Math.abs(e)/60).toString().padStart(2,"0"),r=(Math.abs(e)%60).toString().padStart(2,"0"),i=`${t}${n}:${r}`;return{userTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,userTimezoneOffset:i}},I=(e,t,n)=>{let r=t?.toLowerCase();if(r&&!y(r))return e;if(r==="date-only"){let o=w(e);return o?h(o,m("short-date")):e}if(r==="time-only"){if(typeof e=="string"&&e)return N(e,m("long-time"));let o=f(e);return o?c(o,{...m("long-time"),timeZone:"UTC"}):e}let i=f(e);return i?c(i,{...m("short-date-short-time"),timeZone:S(n)}):e},g=(e,t,n)=>{if(e&&typeof e!="function"){let r="getField"in n&&n.getField?.(e),i=r&&"getFieldDomain"in n&&n.getFieldDomain?n.getFieldDomain(r.name):null;if(i?.type==="coded-value"){let o=i.codedValues.find(s=>s.code===t);return o?o.name:null}}return null},O=e=>!e||e==="system"?Intl.DateTimeFormat().resolvedOptions().timeZone:e==="unknown"?"UTC":e,v=e=>{if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"&&Number.isFinite(e)){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}if(typeof e=="string"&&e){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}return null},x=(e,t)=>{if(typeof e!="number")return e;let n={};t.minimumFractionDigits!==void 0&&(n.minimumFractionDigits=t.minimumFractionDigits),t.maximumFractionDigits!==void 0&&(n.maximumFractionDigits=t.maximumFractionDigits),t.useGrouping==="always"?n.useGrouping=!0:t.useGrouping==="never"&&(n.useGrouping=!1);try{return new Intl.NumberFormat(void 0,n).format(e)}catch{return e}},C=(e,t,n)=>{let r=v(e);if(!r)return e;let i={};t.dateStyle?i.dateStyle=t.dateStyle:(t.year&&(i.year=t.year),t.month&&(i.month=t.month)),t.timeStyle&&(i.timeStyle=t.timeStyle),t.timeStyle&&t.hour12==="always"?i.hour12=!0:t.timeStyle&&t.hour12==="never"&&(i.hour12=!1),i.timeZone=O(n);try{return new Intl.DateTimeFormat(void 0,i).format(r)}catch{return e}},p=(e,t)=>e.getFieldAlias?.(t)??e.fieldsIndex?.get(t)?.alias??e.fieldsIndex?.get(t)?.name??t,F=(e,t,n,r,i)=>{if(n==null)return n;let o=e.getFieldConfiguration?.(t)?.fieldFormat;return o?.type==="number"?x(n,o):o?.type==="date-time"?!r||y(r)?C(n,o,i):n:I(n,r,i)},G=(e,t,n,r)=>{let i=e.fieldsIndex?.get(t),o=g(t,n,e)??n;return F(e,t,o,i?.type,r)},$=(e,t)=>p(e,t),k=(e,t,n)=>{let r=e.objectIdField,i=t.features.map(s=>s.attributes[r]),o=t.features.map(s=>{let d=s.attributes,u={};return e.fields.forEach(a=>{if(!Object.hasOwn(d,a.name))return;let l=d[a.name];if(a.name===r){u[a.name]=l;return}let D=g(a.name,l,e)??l,b=p(e,a.name);u[b]=F(e,a.name,D,a.type,n)}),u});return{objectIds:i,attributes:o}};return{a:j,b:G,c:$,d:k}},"intl")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import x from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import x from"./ZWIKFBOU.js";import w from"./NV7CL4S3.js";import t from"./FK2CVSXW.js";import s from"./XRVGYRXL.js";import{a as $}from"./2F4TPWZQ.js";import r from"./4CFCV47G.js";import q from"./ZY3JQCZQ.js";import"./M5B6X46F.js";import p from"./VK6CCPTG.js";import{a as ne}from"./LXIKAXUT.js";import o from"./OF3TAARW.js";import n from"./M3KKORBG.js";import m from"./3PPXAIRE.js";import l from"./XVJFPZTW.js";import k from"./YOW3YKWR.js";import i from"./KKCLHXHG.js";import"./LLY5A2E2.js";import{a as K}from"./X42ACC66.js";import{a as u}from"./V4PJMCJZ.js";import h from"./EK3PM4L5.js";import{a as Y}from"./T6W6F4TF.js";import{a as ee}from"./CKUUYQLO.js";import g from"./KBSXHSBX.js";import{a as ae}from"./275FFTBE.js";import{a as se}from"./TFAJNKBC.js";import{a as oe}from"./HV7MVIQV.js";import f from"./PJPP6LOS.js";import e from"./2LVYAXHG.js";import{e as G,f as D}from"./4OI4QEV7.js";import"./SJMAKF4P.js";import"./TXZQZR3I.js";import c from"./STOGCXJH.js";import a from"./VGLBH473.js";import{a as b}from"./A6LBMS7A.js";import"./TLPZELG3.js";import{a as d,b as H}from"./V52GSTOC.js";import"./477I66FH.js";import{Ya as T,r as v,s as y}from"./ZJWR4W2S.js";import{ta as j}from"./M2U456J5.js";import{a as M}from"./5X23DDDZ.js";import"./CSE6BHOJ.js";import"./BVUCNXC5.js";export default $arcgis.t(([be,Se,,,,,,,{b:O,g:P,h:Z,i:W,j:B,k:R,l:C,m:J,n:_,o:q,p:S,q:Q,r:U},{a:F,b:Te},te,X,{a:N},,,,,ie,re,{b:k,c:L,d:x,e:w,f:A,g:le,h:I,i:ce,v:z},pe,{a:E,b:ue},me,ge,de])=>{var ke=async e=>{let t=e.allLayers.toArray(),a=[],r=new Map;for(let s of t)if(s instanceof be){let o=(async()=>{let i=await Q(s),n=await U(s,i);r.set(s.id,{layerItem:n,fieldRegistry:i})})();a.push(o)}return await Promise.all(a),r},$e=async e=>{await Se.whenOnce(()=>e.ready);let t=await ke(e.map),{layers:a}=await Me(t),r={schemaVersion:P,modified:Date.now(),embeddings:{modelProvider:W,model:B,dimensions:Z,templates:{layer:R,field:C}},layers:a},s=J.safeParse(r);if(!s.success)throw console.error("Schema Mismatch:",s.error.format()),new Error("Webmap embedding generation failed validation.");return s.data},Me=async e=>{let t=[],a=[];for(let[o,{fieldRegistry:i,layerItem:n}]of e.entries()){let l=he(R,{name:n.name,title:n.title,description:n.description});t.push(l);let c={id:o,name:n.name??"",title:n.title,description:n.description,vector:[],fields:[]};for(let[,m]of i.entries()){let g=he(C,{name:m.name,alias:m.alias,description:m.description});t.push(g),c.fields.push({name:m.name,alias:m.alias,description:m.description,vector:[]})}a.push(c)}let r=await F(t),s=0;return{layers:a.map(o=>(o.vector=r[s++],o.fields.forEach(i=>{i.vector=r[s++]}),o))}},he=(e,t)=>e.replace(/\{(\w+)\}/gu,(a,r)=>t[r]??""),Re=(e,t)=>{if(e.length!==t.length)throw new Error("Vectors must be the same length");let a=0,r=0,s=0;for(let n=0;n<e.length;++n){let l=e[n],c=t[n];a+=l*c,r+=l*l,s+=c*c}let o=Math.sqrt(r*s);if(o===0)return 0;let i=a/o;return Math.max(-1,Math.min(1,i))},V=[X,Y,ee,te,ae,se,oe,re,ne];async function Ce(e,t){let a=await x("navigation_tool_prompt"),{mapView:r}=b(t,["mapView"]),s=r.map.bookmarks?.map(f=>f.name).filter(Boolean)??[],o=e.vectorSearchLayerResults?.length>0?e.vectorSearchLayerResults.map((f,ve)=>`${ve+1}. layerId=${f.id} | title=${f.title??""} | name=${f.name??""} | score=${f.score.toFixed(2)}`).join(`
|
|
3
3
|
`):"",i=e.vectorSearchFieldResults?.length>0?JSON.stringify(e.vectorSearchFieldResults,null,2):"",n=e.intent==="goToBookmark"&&s.length?`Available bookmarks:
|
|
4
4
|
${s.map(f=>`- ${f}`).join(`
|
|
5
5
|
`)}`:"",l=(e.intent==="goToLayer"||e.intent==="goToFeatures")&&e.vectorSearchLayerResults?.length?`Candidate layers:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import"./BVUCNXC5.js";var e=`This Feature Layer is part of a Feature Service. The Feature Layer contains various fields, each with its own name, type, and description.
|
|
3
3
|
The Feature Layer is a collection of geographic features that represent real-world entities. Each feature in the layer has attributes that provide additional information about the feature. The layer may include point, line, or polygon geometries, depending on the type of data it represents.
|
|
4
4
|
The geometry type for this layer is {layerGeometryType}.
|
|
5
5
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{a as r}from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import{a as r}from"./V4PJMCJZ.js";import{Dc as o}from"./M2U456J5.js";import{a as s}from"./5X23DDDZ.js";import"./CSE6BHOJ.js";import"./BVUCNXC5.js";var m=.7;async function h(a){let{query:e,layerSearch:t,layersAndFieldsRegistry:c,embeddingCache:l,minScore:d=m}=a;return(await t.searchLayers({text:e,minScore:d,embeddingCache:l})).map(({id:i,score:y})=>{let n=c.get(i)?.layerItem;return{layerId:i,score:y,name:n?.name??void 0,title:n?.title,description:n?.description}})}var f=s.object({query:s.string().describe("A concise semantic description of the layers relevant to the user's task.")});async function u({query:a},e){let t=await h({query:a,layerSearch:r(e,"layerSearch"),layersAndFieldsRegistry:r(e,"layersAndFieldsRegistry"),embeddingCache:r(e,"embeddingCache")});return JSON.stringify({layers:t},null,2)}var S=o(u,{name:"findRelevantLayers",description:"Finds map layers relevant to a task and returns their layer IDs, similarity scores, names, titles, and descriptions. Call this before finding fields or querying data when layer IDs are not already known.",schema:f});export{S as findRelevantLayersTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
var n=(r,e,a)=>{if(!(a?r.hasAllFeaturesInView:r.hasAllFeatures))return!1;let l=new Set((r.availableFields??[]).map(t=>t.toLowerCase()));return l.has("*")?!0:e.every(t=>l.has(t.toLowerCase()))};function s(r,e){let a=r??"";return e!=null&&e&&(a=a?`(${a}) AND (${e})`:e),a||null}export{n as a,s as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{a as m}from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import{a as m}from"./A6LBMS7A.js";import{Dc as i}from"./M2U456J5.js";import{a as t}from"./5X23DDDZ.js";async function r(o,e){return await e.goTo({zoom:o}),{text:`Successfully zoomed to: ${o}`}}async function a({zoom:o},e){let{mapView:n}=m(e,["mapView"]);return await r(o,n)}var c=t.object({zoom:t.number().min(1).max(20).describe("The zoom level of the view to go to.")}),p=i(a,{name:"goToZoom",description:'Go to the specified zoom level. If input is generic (e.g. "zoom in", then only zoom to the next appropriate level - increase level for zooming in and decrease for zooming out.).',schema:c});export{p as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{$ as Na,Dd as $a,d as dt,e as Ca,j as Gn,k as Oa,m as xc,n as Ec,o as Ra,u as $e,w as Sc,x as Tc}from"./MWYBF3F3.js";import{a as Qt,b as Ip,c as Hn}from"./UZLQALHY.js";var ld=Qt((JE,Os)=>{"use strict";var $m=Object.prototype.hasOwnProperty,ke="~";function mn(){}Object.create&&(mn.prototype=Object.create(null),new mn().__proto__||(ke=!1));function Pm(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function cd(e,t,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var a=new Pm(r,n||e,i),s=ke?ke+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],a]:e._events[s].push(a):(e._events[s]=a,e._eventsCount++),e}function bi(e,t){--e._eventsCount===0?e._events=new mn:delete e._events[t]}function xe(){this._events=new mn,this._eventsCount=0}xe.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)$m.call(r,n)&&t.push(ke?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};xe.prototype.listeners=function(t){var r=ke?ke+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,s=new Array(a);i<a;i++)s[i]=n[i].fn;return s};xe.prototype.listenerCount=function(t){var r=ke?ke+t:t,n=this._events[r];return n?n.fn?1:n.length:0};xe.prototype.emit=function(t,r,n,i,a,s){var o=ke?ke+t:t;if(!this._events[o])return!1;var c=this._events[o],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,r),!0;case 3:return c.fn.call(c.context,r,n),!0;case 4:return c.fn.call(c.context,r,n,i),!0;case 5:return c.fn.call(c.context,r,n,i,a),!0;case 6:return c.fn.call(c.context,r,n,i,a,s),!0}for(d=1,u=new Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(t,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,r);break;case 3:c[d].fn.call(c[d].context,r,n);break;case 4:c[d].fn.call(c[d].context,r,n,i);break;default:if(!u)for(p=1,u=new Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0};xe.prototype.on=function(t,r,n){return cd(this,t,r,n,!1)};xe.prototype.once=function(t,r,n){return cd(this,t,r,n,!0)};xe.prototype.removeListener=function(t,r,n,i){var a=ke?ke+t:t;if(!this._events[a])return this;if(!r)return bi(this,a),this;var s=this._events[a];if(s.fn)s.fn===r&&(!i||s.once)&&(!n||s.context===n)&&bi(this,a);else{for(var o=0,c=[],l=s.length;o<l;o++)(s[o].fn!==r||i&&!s[o].once||n&&s[o].context!==n)&&c.push(s[o]);c.length?this._events[a]=c.length===1?c[0]:c:bi(this,a)}return this};xe.prototype.removeAllListeners=function(t){var r;return t?(r=ke?ke+t:t,this._events[r]&&bi(this,r)):(this._events=new mn,this._eventsCount=0),this};xe.prototype.off=xe.prototype.removeListener;xe.prototype.addListener=xe.prototype.on;xe.prefixed=ke;xe.EventEmitter=xe;typeof Os<"u"&&(Os.exports=xe)});var dd=Qt((KE,ud)=>{"use strict";ud.exports=(e,t)=>(t=t||(()=>{}),e.then(r=>new Promise(n=>{n(t())}).then(()=>r),r=>new Promise(n=>{n(t())}).then(()=>{throw r})))});var pd=Qt((YE,xi)=>{"use strict";var Mm=dd(),vi=class extends Error{constructor(t){super(t),this.name="TimeoutError"}},fd=(e,t,r)=>new Promise((n,i)=>{if(typeof t!="number"||t<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(t===1/0){n(e);return}let a=setTimeout(()=>{if(typeof r=="function"){try{n(r())}catch(c){i(c)}return}let s=typeof r=="string"?r:`Promise timed out after ${t} milliseconds`,o=r instanceof Error?r:new vi(s);typeof e.cancel=="function"&&e.cancel(),i(o)},t);Mm(e.then(n,i),()=>{clearTimeout(a)})});xi.exports=fd;xi.exports.default=fd;xi.exports.TimeoutError=vi});var hd=Qt(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});function jm(e,t,r){let n=0,i=e.length;for(;i>0;){let a=i/2|0,s=n+a;r(e[s],t)<=0?(n=++s,i-=a+1):i=a}return n}Rs.default=jm});var md=Qt($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});var Lm=hd(),Ns=class{constructor(){this._queue=[]}enqueue(t,r){r=Object.assign({priority:0},r);let n={priority:r.priority,run:t};if(this.size&&this._queue[this.size-1].priority>=r.priority){this._queue.push(n);return}let i=Lm.default(this._queue,n,(a,s)=>s.priority-a.priority);this._queue.splice(i,0,n)}dequeue(){let t=this._queue.shift();return t?.run}filter(t){return this._queue.filter(r=>r.priority===t.priority).map(r=>r.run)}get size(){return this._queue.length}};$s.default=Ns});var Si=Qt(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});var Dm=ld(),gd=pd(),Um=md(),Ei=()=>{},zm=new gd.TimeoutError,Ps=class extends Dm{constructor(t){var r,n,i,a;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=Ei,this._resolveIdle=Ei,t=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:Um.default},t),!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(n=(r=t.intervalCap)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(a=(i=t.interval)===null||i===void 0?void 0:i.toString())!==null&&a!==void 0?a:""}\` (${typeof t.interval})`);this._carryoverConcurrencyCount=t.carryoverConcurrencyCount,this._isIntervalIgnored=t.intervalCap===1/0||t.interval===0,this._intervalCap=t.intervalCap,this._interval=t.interval,this._queue=new t.queueClass,this._queueClass=t.queueClass,this.concurrency=t.concurrency,this._timeout=t.timeout,this._throwOnTimeout=t.throwOnTimeout===!0,this._isPaused=t.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=Ei,this._pendingCount===0&&(this._resolveIdle(),this._resolveIdle=Ei,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){let t=Date.now();if(this._intervalId===void 0){let r=this._intervalEnd-t;if(r<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else return this._timeoutId===void 0&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},r)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){let t=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){let r=this._queue.dequeue();return r?(this.emit("active"),r(),t&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this._concurrency=t,this._processQueue()}async add(t,r={}){return new Promise((n,i)=>{let a=async()=>{this._pendingCount++,this._intervalCount++;try{let s=this._timeout===void 0&&r.timeout===void 0?t():gd.default(Promise.resolve(t()),r.timeout===void 0?this._timeout:r.timeout,()=>{(r.throwOnTimeout===void 0?this._throwOnTimeout:r.throwOnTimeout)&&i(zm)});n(await s)}catch(s){i(s)}this._next()};this._queue.enqueue(a,r),this._tryToStartAnother(),this.emit("add")})}async addAll(t,r){return Promise.all(t.map(async n=>this.add(n,r)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(t=>{let r=this._resolveEmpty;this._resolveEmpty=()=>{r(),t()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(t=>{let r=this._resolveIdle;this._resolveIdle=()=>{r(),t()}})}get size(){return this._queue.size}sizeBy(t){return this._queue.filter(t).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(t){this._timeout=t}};Ms.default=Ps});var _p=Qt(ga=>{"use strict";ga.byteLength=xw;ga.toByteArray=Sw;ga.fromByteArray=Iw;var St=[],Qe=[],vw=typeof Uint8Array<"u"?Uint8Array:Array,cc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Rr=0,mp=cc.length;Rr<mp;++Rr)St[Rr]=cc[Rr],Qe[cc.charCodeAt(Rr)]=Rr;var Rr,mp;Qe[45]=62;Qe[95]=63;function gp(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function xw(e){var t=gp(e),r=t[0],n=t[1];return(r+n)*3/4-n}function Ew(e,t,r){return(t+r)*3/4-r}function Sw(e){var t,r=gp(e),n=r[0],i=r[1],a=new vw(Ew(e,n,i)),s=0,o=i>0?n-4:n,c;for(c=0;c<o;c+=4)t=Qe[e.charCodeAt(c)]<<18|Qe[e.charCodeAt(c+1)]<<12|Qe[e.charCodeAt(c+2)]<<6|Qe[e.charCodeAt(c+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=t&255;return i===2&&(t=Qe[e.charCodeAt(c)]<<2|Qe[e.charCodeAt(c+1)]>>4,a[s++]=t&255),i===1&&(t=Qe[e.charCodeAt(c)]<<10|Qe[e.charCodeAt(c+1)]<<4|Qe[e.charCodeAt(c+2)]>>2,a[s++]=t>>8&255,a[s++]=t&255),a}function Tw(e){return St[e>>18&63]+St[e>>12&63]+St[e>>6&63]+St[e&63]}function Aw(e,t,r){for(var n,i=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(Tw(n));return i.join("")}function Iw(e){for(var t,r=e.length,n=r%3,i=[],a=16383,s=0,o=r-n;s<o;s+=a)i.push(Aw(e,s,s+a>o?o:s+a));return n===1?(t=e[r-1],i.push(St[t>>2]+St[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(St[t>>10]+St[t>>4&63]+St[t<<2&63]+"=")),i.join("")}});var Ac=Object.defineProperty,L=(e,t)=>{let r={};for(var n in e)Ac(r,n,{get:e[n],enumerable:!0});return t||Ac(r,Symbol.toStringTag,{value:"Module"}),r};var kp=/([A-Z]+)([A-Z][a-z0-9]+)/g,Cp=/([a-z0-9])([A-Z])/g,Ic=/[-_\s]+/g;function Op(e){return e.replace(kp,"$1_$2").replace(Cp,"$1_$2").replace(Ic,"_").toLowerCase()}function Rp(e){let t=e.trim();return/[-_\s]/.test(t)?t.replace(Ic,"_").toLowerCase().replace(/_+([a-z0-9])/g,(r,n)=>n.toUpperCase()):t}function kc(e,t){return t?.[e]||Op(e)}function Zw(e,t){return t?.[e]||Rp(e)}function Cc(e,t,r){let n={};for(let i in e)Object.hasOwn(e,i)&&(n[t(i,r)]=e[i]);return n}var Rc="__lc_escaped__";function Np(e){return"lc"in e||Object.keys(e).length===1&&"__lc_escaped__"in e}function $p(e){return{[Rc]:e}}function Pp(e){return Object.keys(e).length===1&&"__lc_escaped__"in e}function Mp(e){return e!==null&&typeof e=="object"&&"lc_serializable"in e&&typeof e.toJSON=="function"}function jp(e){let t;return e!==null&&typeof e=="object"?"lc_id"in e&&Array.isArray(e.lc_id)?t=e.lc_id:t=[e.constructor?.name??"Object"]:t=[typeof e],{lc:1,type:"not_implemented",id:t}}function Vn(e,t=new WeakSet){if(e!==null&&typeof e=="object"&&!Array.isArray(e)){if(t.has(e))return jp(e);if(Mp(e))return e;t.add(e);let r=e;if(Np(r))return t.delete(e),$p(r);let n={};for(let[i,a]of Object.entries(r))n[i]=Vn(a,t);return t.delete(e),n}return Array.isArray(e)?e.map(r=>Vn(r,t)):e}function Oc(e){if(e!==null&&typeof e=="object"&&!Array.isArray(e)){let t=e;if(Pp(t))return t[Rc];let r={};for(let[n,i]of Object.entries(t))r[n]=Oc(i);return r}return Array.isArray(e)?e.map(t=>Oc(t)):e}var Xw=L({Serializable:()=>ft,get_lc_unique_name:()=>Zn});function Nc(e){return Array.isArray(e)?[...e]:{...e}}function Lp(e,t){let r=Nc(e);for(let[n,i]of Object.entries(t)){let[a,...s]=n.split(".").reverse(),o=r;for(let c of s.reverse()){if(o[c]===void 0)break;o[c]=Nc(o[c]),o=o[c]}o[a]!==void 0&&(o[a]={lc:1,type:"secret",id:[i]})}return r}function Zn(e){let t=Object.getPrototypeOf(e);return typeof e.lc_name=="function"&&(typeof t.lc_name!="function"||e.lc_name()!==t.lc_name())?e.lc_name():e.name}var ft=class $c{lc_serializable=!1;lc_kwargs;static lc_name(){return this.name}get lc_id(){return[...this.lc_namespace,Zn(this.constructor)]}get lc_secrets(){}get lc_attributes(){}get lc_aliases(){}get lc_serializable_keys(){}constructor(t,...r){this.lc_serializable_keys!==void 0?this.lc_kwargs=Object.fromEntries(Object.entries(t||{}).filter(([n])=>this.lc_serializable_keys?.includes(n))):this.lc_kwargs=t??{}}toJSON(){if(!this.lc_serializable)return this.toJSONNotImplemented();if(this.lc_kwargs instanceof $c||typeof this.lc_kwargs!="object"||Array.isArray(this.lc_kwargs))return this.toJSONNotImplemented();let t={},r={},n=Object.keys(this.lc_kwargs).reduce((o,c)=>(o[c]=c in this?this[c]:this.lc_kwargs[c],o),{});for(let o=Object.getPrototypeOf(this);o;o=Object.getPrototypeOf(o))Object.assign(t,Reflect.get(o,"lc_aliases",this)),Object.assign(r,Reflect.get(o,"lc_secrets",this)),Object.assign(n,Reflect.get(o,"lc_attributes",this));Object.keys(r).forEach(o=>{let c=this,l=n,[u,...d]=o.split(".").reverse();for(let f of d.reverse()){if(!(f in c)||c[f]===void 0)return;(!(f in l)||l[f]===void 0)&&(typeof c[f]=="object"&&c[f]!=null?l[f]={}:Array.isArray(c[f])&&(l[f]=[])),c=c[f],l=l[f]}u in c&&c[u]!==void 0&&(l[u]=l[u]||c[u])});let i={},a=new WeakSet;a.add(this);for(let[o,c]of Object.entries(n))i[o]=Vn(c,a);let s=Cc(Object.keys(r).length?Lp(i,r):i,kc,t);return{lc:1,type:"constructor",id:this.lc_id,kwargs:s}}toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:this.lc_id}}};function Nt(e){return typeof e=="object"&&e!==null&&"type"in e&&typeof e.type=="string"&&"source_type"in e&&(e.source_type==="url"||e.source_type==="base64"||e.source_type==="text"||e.source_type==="id")}function Pc(e){return Nt(e)&&e.source_type==="url"&&"url"in e&&typeof e.url=="string"}function Mc(e){return Nt(e)&&e.source_type==="base64"&&"data"in e&&typeof e.data=="string"}function eb(e){return Nt(e)&&e.source_type==="text"&&"text"in e&&typeof e.text=="string"}function jc(e){return Nt(e)&&e.source_type==="id"&&"id"in e&&typeof e.id=="string"}function tb(e){if(Nt(e)){if(e.source_type==="url")return{type:"image_url",image_url:{url:e.url}};if(e.source_type==="base64"){if(!e.mime_type)throw new Error("mime_type key is required for base64 data.");return{type:"image_url",image_url:{url:`data:${e.mime_type};base64,${e.data}`}}}}throw new Error("Unsupported source type. Only 'url' and 'base64' are supported.")}function rb(e){let t=e.split(";")[0].split("/");if(t.length!==2)throw new Error(`Invalid mime type: "${e}" - does not match type/subtype format.`);let r=t[0].trim(),n=t[1].trim();if(r===""||n==="")throw new Error(`Invalid mime type: "${e}" - type or subtype is empty.`);let i={};for(let a of e.split(";").slice(1)){let s=a.split("=");if(s.length!==2)throw new Error(`Invalid parameter syntax in mime type: "${e}".`);let o=s[0].trim(),c=s[1].trim();if(o==="")throw new Error(`Invalid parameter syntax in mime type: "${e}".`);i[o]=c}return{type:r,subtype:n,parameters:i}}function Pa({dataUrl:e,asTypedArray:t=!1}){let r=e.match(/^data:(\w+\/\w+);base64,([A-Za-z0-9+/]+=*)$/),n;if(r){n=r[1].toLowerCase();let i=t?Uint8Array.from(atob(r[2]),a=>a.charCodeAt(0)):r[2];return{mime_type:n,data:i}}}function nb(e,t){if(e.type==="text"){if(!t.fromStandardTextBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardTextBlock\` method.`);return t.fromStandardTextBlock(e)}if(e.type==="image"){if(!t.fromStandardImageBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardImageBlock\` method.`);return t.fromStandardImageBlock(e)}if(e.type==="audio"){if(!t.fromStandardAudioBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardAudioBlock\` method.`);return t.fromStandardAudioBlock(e)}if(e.type==="file"){if(!t.fromStandardFileBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardFileBlock\` method.`);return t.fromStandardFileBlock(e)}throw new Error(`Unable to convert content block type '${e.type}' to provider-specific format: not recognized.`)}function S(e,t){return $(e)&&e.type===t}function $(e){return typeof e=="object"&&e!==null}function de(e){return Array.isArray(e)}function g(e){return typeof e=="string"}function De(e){return typeof e=="number"}function qn(e){return e instanceof Uint8Array}function Ma(e){try{return JSON.parse(e)}catch{return}}var Ue=e=>e();function Dp(e){if(e.type==="char_location"&&g(e.document_title)&&De(e.start_char_index)&&De(e.end_char_index)&&g(e.cited_text)){let{document_title:t,start_char_index:r,end_char_index:n,cited_text:i,...a}=e;return{...a,type:"citation",source:"char",title:t??void 0,startIndex:r,endIndex:n,citedText:i}}if(e.type==="page_location"&&g(e.document_title)&&De(e.start_page_number)&&De(e.end_page_number)&&g(e.cited_text)){let{document_title:t,start_page_number:r,end_page_number:n,cited_text:i,...a}=e;return{...a,type:"citation",source:"page",title:t??void 0,startIndex:r,endIndex:n,citedText:i}}if(e.type==="content_block_location"&&g(e.document_title)&&De(e.start_block_index)&&De(e.end_block_index)&&g(e.cited_text)){let{document_title:t,start_block_index:r,end_block_index:n,cited_text:i,...a}=e;return{...a,type:"citation",source:"block",title:t??void 0,startIndex:r,endIndex:n,citedText:i}}if(e.type==="web_search_result_location"&&g(e.url)&&g(e.title)&&g(e.encrypted_index)&&g(e.cited_text)){let{url:t,title:r,encrypted_index:n,cited_text:i,...a}=e;return{...a,type:"citation",source:"url",url:t,title:r,startIndex:Number(n),endIndex:Number(n),citedText:i}}if(e.type==="search_result_location"&&g(e.source)&&g(e.title)&&De(e.start_block_index)&&De(e.end_block_index)&&g(e.cited_text)){let{source:t,title:r,start_block_index:n,end_block_index:i,cited_text:a,...s}=e;return{...s,type:"citation",source:"search",url:t,title:r??void 0,startIndex:n,endIndex:i,citedText:a}}}function Dc(e){if(S(e,"document")&&$(e.source)&&"type"in e.source){if(e.source.type==="base64"&&g(e.source.media_type)&&g(e.source.data))return{type:"file",mimeType:e.source.media_type,data:e.source.data};if(e.source.type==="url"&&g(e.source.url))return{type:"file",url:e.source.url};if(e.source.type==="file"&&g(e.source.file_id))return{type:"file",fileId:e.source.file_id};if(e.source.type==="text"&&g(e.source.data))return{type:"file",mimeType:String(e.source.media_type??"text/plain"),data:e.source.data}}else if(S(e,"image")&&$(e.source)&&"type"in e.source){if(e.source.type==="base64"&&g(e.source.media_type)&&g(e.source.data))return{type:"image",mimeType:e.source.media_type,data:e.source.data};if(e.source.type==="url"&&g(e.source.url))return{type:"image",url:e.source.url};if(e.source.type==="file"&&g(e.source.file_id))return{type:"image",fileId:e.source.file_id}}}function Uc(e){function*t(){for(let r of e){let n=Dc(r);n?yield n:yield r}}return Array.from(t())}function Lc(e){function*t(){let r=typeof e.content=="string"?[{type:"text",text:e.content}]:e.content;for(let n of r){if(S(n,"text")&&g(n.text)){let{text:i,citations:a,...s}=n;if(de(a)&&a.length){let o=a.reduce((c,l)=>{let u=Dp(l);return u?[...c,u]:c},[]);yield{...s,type:"text",text:i,annotations:o};continue}else{yield{...s,type:"text",text:i};continue}}else if(S(n,"thinking")&&g(n.thinking)){let{thinking:i,signature:a,...s}=n;yield{...s,type:"reasoning",reasoning:i,signature:a};continue}else if(S(n,"redacted_thinking")){yield{type:"non_standard",value:n};continue}else if(S(n,"tool_use")&&g(n.name)&&g(n.id)){yield{type:"tool_call",id:n.id,name:n.name,args:n.input};continue}else if(S(n,"input_json_delta")){if(Up(e)&&e.tool_call_chunks?.length){let i=e.tool_call_chunks[0];yield{type:"tool_call_chunk",id:i.id,name:i.name,args:i.args,index:i.index};continue}}else if(S(n,"server_tool_use")&&g(n.name)&&g(n.id)){let{name:i,id:a}=n;if(i==="web_search"){yield{id:a,type:"server_tool_call",name:"web_search",args:{query:Ue(()=>{if(typeof n.input=="string")return n.input;if($(n.input)&&g(n.input.query))return n.input.query;if(g(n.partial_json)){let s=Ma(n.partial_json);if(s?.query)return s.query}return""})}};continue}else if(n.name==="code_execution"){yield{id:a,type:"server_tool_call",name:"code_execution",args:{code:Ue(()=>{if(typeof n.input=="string")return n.input;if($(n.input)&&g(n.input.code))return n.input.code;if(g(n.partial_json)){let s=Ma(n.partial_json);if(s?.code)return s.code}return""})}};continue}}else if(S(n,"web_search_tool_result")&&g(n.tool_use_id)&&de(n.content)){let{content:i,tool_use_id:a}=n;yield{type:"server_tool_call_result",name:"web_search",toolCallId:a,status:"success",output:{urls:i.reduce((s,o)=>S(o,"web_search_result")?[...s,o.url]:s,[])}};continue}else if(S(n,"code_execution_tool_result")&&g(n.tool_use_id)&&$(n.content)){yield{type:"server_tool_call_result",name:"code_execution",toolCallId:n.tool_use_id,status:"success",output:n.content};continue}else if(S(n,"mcp_tool_use")){yield{id:n.id,type:"server_tool_call",name:"mcp_tool_use",args:n.input};continue}else if(S(n,"mcp_tool_result")&&g(n.tool_use_id)&&$(n.content)){yield{type:"server_tool_call_result",name:"mcp_tool_use",toolCallId:n.tool_use_id,status:"success",output:n.content};continue}else if(S(n,"container_upload")){yield{type:"server_tool_call",name:"container_upload",args:n.input};continue}else if(S(n,"search_result")){yield{id:n.id,type:"non_standard",value:n};continue}else if(S(n,"tool_result")){yield{id:n.id,type:"non_standard",value:n};continue}else{let i=Dc(n);if(i){yield i;continue}}yield{type:"non_standard",value:n}}}return Array.from(t())}var zc={translateContent:Lc,translateContentChunk:Lc};function Up(e){return typeof e?._getType=="function"&&typeof e.concat=="function"&&e._getType()==="ai"}function zp(e){return Pc(e)?{type:e.type,mimeType:e.mime_type,url:e.url,metadata:e.metadata}:Mc(e)?{type:e.type,mimeType:e.mime_type??"application/octet-stream",data:e.data,metadata:e.metadata}:jc(e)?{type:e.type,mimeType:e.mime_type,fileId:e.id,metadata:e.metadata}:e}function Bc(e){return e.map(zp)}function Fc(e){return!!(S(e,"image_url")&&$(e.image_url)||S(e,"input_audio")&&$(e.input_audio)||S(e,"file")&&$(e.file))}function Hc(e){if(S(e,"image_url")&&$(e.image_url)&&g(e.image_url.url)){let t=Pa({dataUrl:e.image_url.url});return t?{type:"image",mimeType:t.mime_type,data:t.data}:{type:"image",url:e.image_url.url}}else{if(S(e,"input_audio")&&$(e.input_audio)&&g(e.input_audio.data)&&g(e.input_audio.format))return{type:"audio",data:e.input_audio.data,mimeType:`audio/${e.input_audio.format}`};if(S(e,"file")&&$(e.file)&&g(e.file.data)){let t=Pa({dataUrl:e.file.data});if(t)return{type:"file",data:t.data,mimeType:t.mime_type};if(g(e.file.file_id))return{type:"file",fileId:e.file.file_id}}}return e}function Bp(e){let t=[];typeof e.content=="string"?e.content.length>0&&t.push({type:"text",text:e.content}):t.push(...Wn(e.content));for(let r of e.tool_calls??[])t.push({type:"tool_call",id:r.id,name:r.name,args:r.args});return t}function Fp(e){let t=[];typeof e.content=="string"?e.content.length>0&&t.push({type:"text",text:e.content}):t.push(...Wn(e.content));for(let r of e.tool_calls??[])t.push({type:"tool_call",id:r.id,name:r.name,args:r.args});return t}function Wn(e){let t=[];for(let r of e)Fc(r)?t.push(Hc(r)):t.push(r);return t}function Hp(e){if(e.type==="url_citation"){let{url:t,title:r,start_index:n,end_index:i}=e;return{type:"citation",url:t,title:r,startIndex:n,endIndex:i}}if(e.type==="file_citation"){let{file_id:t,filename:r,index:n}=e;return{type:"citation",title:r,startIndex:n,endIndex:n,fileId:t}}return e}function Gc(e){function*t(){$(e.additional_kwargs?.reasoning)&&de(e.additional_kwargs.reasoning.summary)&&(yield{type:"reasoning",reasoning:e.additional_kwargs.reasoning.summary.reduce((n,i)=>$(i)&&g(i.text)?`${n}${i.text}`:n,"")});let r=typeof e.content=="string"?[{type:"text",text:e.content}]:e.content;for(let n of r)if(S(n,"text")){let{text:i,annotations:a,phase:s,extras:o,...c}=n,l=$(o)?{...o}:{};g(s)&&(l.phase=s);let u=Object.keys(l).length>0?{extras:l}:{};Array.isArray(a)?yield{...c,...u,type:"text",text:String(i),annotations:a.map(Hp)}:yield{...c,...u,type:"text",text:String(i)}}for(let n of e.tool_calls??[])yield{type:"tool_call",id:n.id,name:n.name,args:n.args};if($(e.additional_kwargs)&&de(e.additional_kwargs.tool_outputs))for(let n of e.additional_kwargs.tool_outputs){if(S(n,"web_search_call")){let i={};if($(n.action)&&g(n.action.query)&&(i.query=n.action.query),yield{id:n.id,type:"server_tool_call",name:"web_search",args:i},n.status==="completed"||n.status==="failed"){let a={};$(n.action)&&(a.action=n.action),yield{type:"server_tool_call_result",toolCallId:g(n.id)?n.id:"",status:n.status==="completed"?"success":"error",output:a}}continue}else if(S(n,"file_search_call")){yield{id:n.id,type:"server_tool_call",name:"file_search",args:{queries:de(n.queries)?n.queries:[]}},(n.status==="completed"||n.status==="failed")&&(yield{type:"server_tool_call_result",toolCallId:g(n.id)?n.id:"",status:n.status==="completed"?"success":"error",output:de(n.results)?{results:n.results}:{}});continue}else if(S(n,"computer_call")){yield{type:"non_standard",value:n};continue}else if(S(n,"code_interpreter_call")){if(g(n.code)&&(yield{id:n.id,type:"server_tool_call",name:"code_interpreter",args:{code:n.code}}),de(n.outputs)){let i=Ue(()=>{if(n.status!=="in_progress"){if(n.status==="completed")return 0;if(n.status==="incomplete")return 127;if(n.status!=="interpreting"&&n.status==="failed")return 1}});for(let a of n.outputs)if(S(a,"logs")){yield{type:"server_tool_call_result",toolCallId:n.id??"",status:"success",output:{type:"code_interpreter_output",returnCode:i??0,stderr:[0,void 0].includes(i)?void 0:String(a.logs),stdout:[0,void 0].includes(i)?String(a.logs):void 0}};continue}}continue}else if(S(n,"mcp_call")){yield{id:n.id,type:"server_tool_call",name:"mcp_call",args:n.input};continue}else if(S(n,"mcp_list_tools")){yield{id:n.id,type:"server_tool_call",name:"mcp_list_tools",args:n.input};continue}else if(S(n,"mcp_approval_request")){yield{type:"non_standard",value:n};continue}else if(S(n,"tool_search_call")){let i={};$(n.arguments)&&Object.assign(i,n.arguments);let a={};g(n.execution)&&(a.execution=n.execution),g(n.status)&&(a.status=n.status),g(n.call_id)&&(a.call_id=n.call_id),yield{id:g(n.id)?n.id:"",type:"server_tool_call",name:"tool_search",args:i,...Object.keys(a).length>0?{extras:a}:{}};continue}else if(S(n,"tool_search_output")){let i={name:"tool_search"};g(n.execution)&&(i.execution=n.execution),yield{type:"server_tool_call_result",toolCallId:g(n.id)?n.id:"",status:n.status==="completed"?"success":n.status==="failed"?"error":"success",output:{tools:de(n.tools)?n.tools:[]},extras:i};continue}else if(S(n,"image_generation_call")){g(n.result)&&(yield{type:"image",mimeType:"image/png",data:n.result,id:g(n.id)?n.id:void 0,metadata:{status:g(n.status)?n.status:void 0}}),yield{type:"non_standard",value:n};continue}$(n)&&(yield{type:"non_standard",value:n})}}return Array.from(t())}function Gp(e){function*t(){yield*Gc(e);for(let r of e.tool_call_chunks??[])yield{type:"tool_call_chunk",id:r.id,name:r.name,args:r.args}}return Array.from(t())}var Vc={translateContent:e=>typeof e.content=="string"?Bp(e):Gc(e),translateContentChunk:e=>typeof e.content=="string"?Fp(e):Gp(e)};function Zc(e){return typeof e=="object"&&e!==null&&"type"in e&&"content"in e&&(typeof e.content=="string"||Array.isArray(e.content))}function qc(e,t="pretty"){return t==="pretty"?Vp(e):JSON.stringify(e)}function Vp(e){let t=[],r=` ${e.type.charAt(0).toUpperCase()+e.type.slice(1)} Message `,n=Math.floor((80-r.length)/2),i="=".repeat(n),a=r.length%2===0?i:`${i}=`;if(t.push(`${i}${r}${a}`),e.type==="ai"){let s=e;if(s.tool_calls&&s.tool_calls.length>0){t.push("Tool Calls:");for(let o of s.tool_calls){t.push(` ${o.name} (${o.id})`),t.push(` Call ID: ${o.id}`),t.push(" Args:");for(let[c,l]of Object.entries(o.args))t.push(` ${c}: ${typeof l=="object"?JSON.stringify(l):l}`)}}}if(e.type==="tool"){let s=e;s.name&&t.push(`Name: ${s.name}`)}return typeof e.content=="string"&&e.content.trim()&&(t.length>1&&t.push(""),t.push(e.content)),t.join(`
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import{$ as Na,Dd as $a,d as dt,e as Ca,j as Gn,k as Oa,m as xc,n as Ec,o as Ra,u as $e,w as Sc,x as Tc}from"./CSE6BHOJ.js";import{a as Qt,b as Ip,c as Hn}from"./BVUCNXC5.js";var ld=Qt((JE,Os)=>{"use strict";var $m=Object.prototype.hasOwnProperty,ke="~";function mn(){}Object.create&&(mn.prototype=Object.create(null),new mn().__proto__||(ke=!1));function Pm(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function cd(e,t,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var a=new Pm(r,n||e,i),s=ke?ke+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],a]:e._events[s].push(a):(e._events[s]=a,e._eventsCount++),e}function bi(e,t){--e._eventsCount===0?e._events=new mn:delete e._events[t]}function xe(){this._events=new mn,this._eventsCount=0}xe.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)$m.call(r,n)&&t.push(ke?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};xe.prototype.listeners=function(t){var r=ke?ke+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,s=new Array(a);i<a;i++)s[i]=n[i].fn;return s};xe.prototype.listenerCount=function(t){var r=ke?ke+t:t,n=this._events[r];return n?n.fn?1:n.length:0};xe.prototype.emit=function(t,r,n,i,a,s){var o=ke?ke+t:t;if(!this._events[o])return!1;var c=this._events[o],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,r),!0;case 3:return c.fn.call(c.context,r,n),!0;case 4:return c.fn.call(c.context,r,n,i),!0;case 5:return c.fn.call(c.context,r,n,i,a),!0;case 6:return c.fn.call(c.context,r,n,i,a,s),!0}for(d=1,u=new Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(t,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,r);break;case 3:c[d].fn.call(c[d].context,r,n);break;case 4:c[d].fn.call(c[d].context,r,n,i);break;default:if(!u)for(p=1,u=new Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0};xe.prototype.on=function(t,r,n){return cd(this,t,r,n,!1)};xe.prototype.once=function(t,r,n){return cd(this,t,r,n,!0)};xe.prototype.removeListener=function(t,r,n,i){var a=ke?ke+t:t;if(!this._events[a])return this;if(!r)return bi(this,a),this;var s=this._events[a];if(s.fn)s.fn===r&&(!i||s.once)&&(!n||s.context===n)&&bi(this,a);else{for(var o=0,c=[],l=s.length;o<l;o++)(s[o].fn!==r||i&&!s[o].once||n&&s[o].context!==n)&&c.push(s[o]);c.length?this._events[a]=c.length===1?c[0]:c:bi(this,a)}return this};xe.prototype.removeAllListeners=function(t){var r;return t?(r=ke?ke+t:t,this._events[r]&&bi(this,r)):(this._events=new mn,this._eventsCount=0),this};xe.prototype.off=xe.prototype.removeListener;xe.prototype.addListener=xe.prototype.on;xe.prefixed=ke;xe.EventEmitter=xe;typeof Os<"u"&&(Os.exports=xe)});var dd=Qt((KE,ud)=>{"use strict";ud.exports=(e,t)=>(t=t||(()=>{}),e.then(r=>new Promise(n=>{n(t())}).then(()=>r),r=>new Promise(n=>{n(t())}).then(()=>{throw r})))});var pd=Qt((YE,xi)=>{"use strict";var Mm=dd(),vi=class extends Error{constructor(t){super(t),this.name="TimeoutError"}},fd=(e,t,r)=>new Promise((n,i)=>{if(typeof t!="number"||t<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(t===1/0){n(e);return}let a=setTimeout(()=>{if(typeof r=="function"){try{n(r())}catch(c){i(c)}return}let s=typeof r=="string"?r:`Promise timed out after ${t} milliseconds`,o=r instanceof Error?r:new vi(s);typeof e.cancel=="function"&&e.cancel(),i(o)},t);Mm(e.then(n,i),()=>{clearTimeout(a)})});xi.exports=fd;xi.exports.default=fd;xi.exports.TimeoutError=vi});var hd=Qt(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});function jm(e,t,r){let n=0,i=e.length;for(;i>0;){let a=i/2|0,s=n+a;r(e[s],t)<=0?(n=++s,i-=a+1):i=a}return n}Rs.default=jm});var md=Qt($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});var Lm=hd(),Ns=class{constructor(){this._queue=[]}enqueue(t,r){r=Object.assign({priority:0},r);let n={priority:r.priority,run:t};if(this.size&&this._queue[this.size-1].priority>=r.priority){this._queue.push(n);return}let i=Lm.default(this._queue,n,(a,s)=>s.priority-a.priority);this._queue.splice(i,0,n)}dequeue(){let t=this._queue.shift();return t?.run}filter(t){return this._queue.filter(r=>r.priority===t.priority).map(r=>r.run)}get size(){return this._queue.length}};$s.default=Ns});var Si=Qt(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});var Dm=ld(),gd=pd(),Um=md(),Ei=()=>{},zm=new gd.TimeoutError,Ps=class extends Dm{constructor(t){var r,n,i,a;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=Ei,this._resolveIdle=Ei,t=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:Um.default},t),!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(n=(r=t.intervalCap)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(a=(i=t.interval)===null||i===void 0?void 0:i.toString())!==null&&a!==void 0?a:""}\` (${typeof t.interval})`);this._carryoverConcurrencyCount=t.carryoverConcurrencyCount,this._isIntervalIgnored=t.intervalCap===1/0||t.interval===0,this._intervalCap=t.intervalCap,this._interval=t.interval,this._queue=new t.queueClass,this._queueClass=t.queueClass,this.concurrency=t.concurrency,this._timeout=t.timeout,this._throwOnTimeout=t.throwOnTimeout===!0,this._isPaused=t.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=Ei,this._pendingCount===0&&(this._resolveIdle(),this._resolveIdle=Ei,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){let t=Date.now();if(this._intervalId===void 0){let r=this._intervalEnd-t;if(r<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else return this._timeoutId===void 0&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},r)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){let t=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){let r=this._queue.dequeue();return r?(this.emit("active"),r(),t&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this._concurrency=t,this._processQueue()}async add(t,r={}){return new Promise((n,i)=>{let a=async()=>{this._pendingCount++,this._intervalCount++;try{let s=this._timeout===void 0&&r.timeout===void 0?t():gd.default(Promise.resolve(t()),r.timeout===void 0?this._timeout:r.timeout,()=>{(r.throwOnTimeout===void 0?this._throwOnTimeout:r.throwOnTimeout)&&i(zm)});n(await s)}catch(s){i(s)}this._next()};this._queue.enqueue(a,r),this._tryToStartAnother(),this.emit("add")})}async addAll(t,r){return Promise.all(t.map(async n=>this.add(n,r)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(t=>{let r=this._resolveEmpty;this._resolveEmpty=()=>{r(),t()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(t=>{let r=this._resolveIdle;this._resolveIdle=()=>{r(),t()}})}get size(){return this._queue.size}sizeBy(t){return this._queue.filter(t).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(t){this._timeout=t}};Ms.default=Ps});var _p=Qt(ga=>{"use strict";ga.byteLength=xw;ga.toByteArray=Sw;ga.fromByteArray=Iw;var St=[],Qe=[],vw=typeof Uint8Array<"u"?Uint8Array:Array,cc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Rr=0,mp=cc.length;Rr<mp;++Rr)St[Rr]=cc[Rr],Qe[cc.charCodeAt(Rr)]=Rr;var Rr,mp;Qe[45]=62;Qe[95]=63;function gp(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function xw(e){var t=gp(e),r=t[0],n=t[1];return(r+n)*3/4-n}function Ew(e,t,r){return(t+r)*3/4-r}function Sw(e){var t,r=gp(e),n=r[0],i=r[1],a=new vw(Ew(e,n,i)),s=0,o=i>0?n-4:n,c;for(c=0;c<o;c+=4)t=Qe[e.charCodeAt(c)]<<18|Qe[e.charCodeAt(c+1)]<<12|Qe[e.charCodeAt(c+2)]<<6|Qe[e.charCodeAt(c+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=t&255;return i===2&&(t=Qe[e.charCodeAt(c)]<<2|Qe[e.charCodeAt(c+1)]>>4,a[s++]=t&255),i===1&&(t=Qe[e.charCodeAt(c)]<<10|Qe[e.charCodeAt(c+1)]<<4|Qe[e.charCodeAt(c+2)]>>2,a[s++]=t>>8&255,a[s++]=t&255),a}function Tw(e){return St[e>>18&63]+St[e>>12&63]+St[e>>6&63]+St[e&63]}function Aw(e,t,r){for(var n,i=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(Tw(n));return i.join("")}function Iw(e){for(var t,r=e.length,n=r%3,i=[],a=16383,s=0,o=r-n;s<o;s+=a)i.push(Aw(e,s,s+a>o?o:s+a));return n===1?(t=e[r-1],i.push(St[t>>2]+St[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(St[t>>10]+St[t>>4&63]+St[t<<2&63]+"=")),i.join("")}});var Ac=Object.defineProperty,L=(e,t)=>{let r={};for(var n in e)Ac(r,n,{get:e[n],enumerable:!0});return t||Ac(r,Symbol.toStringTag,{value:"Module"}),r};var kp=/([A-Z]+)([A-Z][a-z0-9]+)/g,Cp=/([a-z0-9])([A-Z])/g,Ic=/[-_\s]+/g;function Op(e){return e.replace(kp,"$1_$2").replace(Cp,"$1_$2").replace(Ic,"_").toLowerCase()}function Rp(e){let t=e.trim();return/[-_\s]/.test(t)?t.replace(Ic,"_").toLowerCase().replace(/_+([a-z0-9])/g,(r,n)=>n.toUpperCase()):t}function kc(e,t){return t?.[e]||Op(e)}function Zw(e,t){return t?.[e]||Rp(e)}function Cc(e,t,r){let n={};for(let i in e)Object.hasOwn(e,i)&&(n[t(i,r)]=e[i]);return n}var Rc="__lc_escaped__";function Np(e){return"lc"in e||Object.keys(e).length===1&&"__lc_escaped__"in e}function $p(e){return{[Rc]:e}}function Pp(e){return Object.keys(e).length===1&&"__lc_escaped__"in e}function Mp(e){return e!==null&&typeof e=="object"&&"lc_serializable"in e&&typeof e.toJSON=="function"}function jp(e){let t;return e!==null&&typeof e=="object"?"lc_id"in e&&Array.isArray(e.lc_id)?t=e.lc_id:t=[e.constructor?.name??"Object"]:t=[typeof e],{lc:1,type:"not_implemented",id:t}}function Vn(e,t=new WeakSet){if(e!==null&&typeof e=="object"&&!Array.isArray(e)){if(t.has(e))return jp(e);if(Mp(e))return e;t.add(e);let r=e;if(Np(r))return t.delete(e),$p(r);let n={};for(let[i,a]of Object.entries(r))n[i]=Vn(a,t);return t.delete(e),n}return Array.isArray(e)?e.map(r=>Vn(r,t)):e}function Oc(e){if(e!==null&&typeof e=="object"&&!Array.isArray(e)){let t=e;if(Pp(t))return t[Rc];let r={};for(let[n,i]of Object.entries(t))r[n]=Oc(i);return r}return Array.isArray(e)?e.map(t=>Oc(t)):e}var Xw=L({Serializable:()=>ft,get_lc_unique_name:()=>Zn});function Nc(e){return Array.isArray(e)?[...e]:{...e}}function Lp(e,t){let r=Nc(e);for(let[n,i]of Object.entries(t)){let[a,...s]=n.split(".").reverse(),o=r;for(let c of s.reverse()){if(o[c]===void 0)break;o[c]=Nc(o[c]),o=o[c]}o[a]!==void 0&&(o[a]={lc:1,type:"secret",id:[i]})}return r}function Zn(e){let t=Object.getPrototypeOf(e);return typeof e.lc_name=="function"&&(typeof t.lc_name!="function"||e.lc_name()!==t.lc_name())?e.lc_name():e.name}var ft=class $c{lc_serializable=!1;lc_kwargs;static lc_name(){return this.name}get lc_id(){return[...this.lc_namespace,Zn(this.constructor)]}get lc_secrets(){}get lc_attributes(){}get lc_aliases(){}get lc_serializable_keys(){}constructor(t,...r){this.lc_serializable_keys!==void 0?this.lc_kwargs=Object.fromEntries(Object.entries(t||{}).filter(([n])=>this.lc_serializable_keys?.includes(n))):this.lc_kwargs=t??{}}toJSON(){if(!this.lc_serializable)return this.toJSONNotImplemented();if(this.lc_kwargs instanceof $c||typeof this.lc_kwargs!="object"||Array.isArray(this.lc_kwargs))return this.toJSONNotImplemented();let t={},r={},n=Object.keys(this.lc_kwargs).reduce((o,c)=>(o[c]=c in this?this[c]:this.lc_kwargs[c],o),{});for(let o=Object.getPrototypeOf(this);o;o=Object.getPrototypeOf(o))Object.assign(t,Reflect.get(o,"lc_aliases",this)),Object.assign(r,Reflect.get(o,"lc_secrets",this)),Object.assign(n,Reflect.get(o,"lc_attributes",this));Object.keys(r).forEach(o=>{let c=this,l=n,[u,...d]=o.split(".").reverse();for(let f of d.reverse()){if(!(f in c)||c[f]===void 0)return;(!(f in l)||l[f]===void 0)&&(typeof c[f]=="object"&&c[f]!=null?l[f]={}:Array.isArray(c[f])&&(l[f]=[])),c=c[f],l=l[f]}u in c&&c[u]!==void 0&&(l[u]=l[u]||c[u])});let i={},a=new WeakSet;a.add(this);for(let[o,c]of Object.entries(n))i[o]=Vn(c,a);let s=Cc(Object.keys(r).length?Lp(i,r):i,kc,t);return{lc:1,type:"constructor",id:this.lc_id,kwargs:s}}toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:this.lc_id}}};function Nt(e){return typeof e=="object"&&e!==null&&"type"in e&&typeof e.type=="string"&&"source_type"in e&&(e.source_type==="url"||e.source_type==="base64"||e.source_type==="text"||e.source_type==="id")}function Pc(e){return Nt(e)&&e.source_type==="url"&&"url"in e&&typeof e.url=="string"}function Mc(e){return Nt(e)&&e.source_type==="base64"&&"data"in e&&typeof e.data=="string"}function eb(e){return Nt(e)&&e.source_type==="text"&&"text"in e&&typeof e.text=="string"}function jc(e){return Nt(e)&&e.source_type==="id"&&"id"in e&&typeof e.id=="string"}function tb(e){if(Nt(e)){if(e.source_type==="url")return{type:"image_url",image_url:{url:e.url}};if(e.source_type==="base64"){if(!e.mime_type)throw new Error("mime_type key is required for base64 data.");return{type:"image_url",image_url:{url:`data:${e.mime_type};base64,${e.data}`}}}}throw new Error("Unsupported source type. Only 'url' and 'base64' are supported.")}function rb(e){let t=e.split(";")[0].split("/");if(t.length!==2)throw new Error(`Invalid mime type: "${e}" - does not match type/subtype format.`);let r=t[0].trim(),n=t[1].trim();if(r===""||n==="")throw new Error(`Invalid mime type: "${e}" - type or subtype is empty.`);let i={};for(let a of e.split(";").slice(1)){let s=a.split("=");if(s.length!==2)throw new Error(`Invalid parameter syntax in mime type: "${e}".`);let o=s[0].trim(),c=s[1].trim();if(o==="")throw new Error(`Invalid parameter syntax in mime type: "${e}".`);i[o]=c}return{type:r,subtype:n,parameters:i}}function Pa({dataUrl:e,asTypedArray:t=!1}){let r=e.match(/^data:(\w+\/\w+);base64,([A-Za-z0-9+/]+=*)$/),n;if(r){n=r[1].toLowerCase();let i=t?Uint8Array.from(atob(r[2]),a=>a.charCodeAt(0)):r[2];return{mime_type:n,data:i}}}function nb(e,t){if(e.type==="text"){if(!t.fromStandardTextBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardTextBlock\` method.`);return t.fromStandardTextBlock(e)}if(e.type==="image"){if(!t.fromStandardImageBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardImageBlock\` method.`);return t.fromStandardImageBlock(e)}if(e.type==="audio"){if(!t.fromStandardAudioBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardAudioBlock\` method.`);return t.fromStandardAudioBlock(e)}if(e.type==="file"){if(!t.fromStandardFileBlock)throw new Error(`Converter for ${t.providerName} does not implement \`fromStandardFileBlock\` method.`);return t.fromStandardFileBlock(e)}throw new Error(`Unable to convert content block type '${e.type}' to provider-specific format: not recognized.`)}function S(e,t){return $(e)&&e.type===t}function $(e){return typeof e=="object"&&e!==null}function de(e){return Array.isArray(e)}function g(e){return typeof e=="string"}function De(e){return typeof e=="number"}function qn(e){return e instanceof Uint8Array}function Ma(e){try{return JSON.parse(e)}catch{return}}var Ue=e=>e();function Dp(e){if(e.type==="char_location"&&g(e.document_title)&&De(e.start_char_index)&&De(e.end_char_index)&&g(e.cited_text)){let{document_title:t,start_char_index:r,end_char_index:n,cited_text:i,...a}=e;return{...a,type:"citation",source:"char",title:t??void 0,startIndex:r,endIndex:n,citedText:i}}if(e.type==="page_location"&&g(e.document_title)&&De(e.start_page_number)&&De(e.end_page_number)&&g(e.cited_text)){let{document_title:t,start_page_number:r,end_page_number:n,cited_text:i,...a}=e;return{...a,type:"citation",source:"page",title:t??void 0,startIndex:r,endIndex:n,citedText:i}}if(e.type==="content_block_location"&&g(e.document_title)&&De(e.start_block_index)&&De(e.end_block_index)&&g(e.cited_text)){let{document_title:t,start_block_index:r,end_block_index:n,cited_text:i,...a}=e;return{...a,type:"citation",source:"block",title:t??void 0,startIndex:r,endIndex:n,citedText:i}}if(e.type==="web_search_result_location"&&g(e.url)&&g(e.title)&&g(e.encrypted_index)&&g(e.cited_text)){let{url:t,title:r,encrypted_index:n,cited_text:i,...a}=e;return{...a,type:"citation",source:"url",url:t,title:r,startIndex:Number(n),endIndex:Number(n),citedText:i}}if(e.type==="search_result_location"&&g(e.source)&&g(e.title)&&De(e.start_block_index)&&De(e.end_block_index)&&g(e.cited_text)){let{source:t,title:r,start_block_index:n,end_block_index:i,cited_text:a,...s}=e;return{...s,type:"citation",source:"search",url:t,title:r??void 0,startIndex:n,endIndex:i,citedText:a}}}function Dc(e){if(S(e,"document")&&$(e.source)&&"type"in e.source){if(e.source.type==="base64"&&g(e.source.media_type)&&g(e.source.data))return{type:"file",mimeType:e.source.media_type,data:e.source.data};if(e.source.type==="url"&&g(e.source.url))return{type:"file",url:e.source.url};if(e.source.type==="file"&&g(e.source.file_id))return{type:"file",fileId:e.source.file_id};if(e.source.type==="text"&&g(e.source.data))return{type:"file",mimeType:String(e.source.media_type??"text/plain"),data:e.source.data}}else if(S(e,"image")&&$(e.source)&&"type"in e.source){if(e.source.type==="base64"&&g(e.source.media_type)&&g(e.source.data))return{type:"image",mimeType:e.source.media_type,data:e.source.data};if(e.source.type==="url"&&g(e.source.url))return{type:"image",url:e.source.url};if(e.source.type==="file"&&g(e.source.file_id))return{type:"image",fileId:e.source.file_id}}}function Uc(e){function*t(){for(let r of e){let n=Dc(r);n?yield n:yield r}}return Array.from(t())}function Lc(e){function*t(){let r=typeof e.content=="string"?[{type:"text",text:e.content}]:e.content;for(let n of r){if(S(n,"text")&&g(n.text)){let{text:i,citations:a,...s}=n;if(de(a)&&a.length){let o=a.reduce((c,l)=>{let u=Dp(l);return u?[...c,u]:c},[]);yield{...s,type:"text",text:i,annotations:o};continue}else{yield{...s,type:"text",text:i};continue}}else if(S(n,"thinking")&&g(n.thinking)){let{thinking:i,signature:a,...s}=n;yield{...s,type:"reasoning",reasoning:i,signature:a};continue}else if(S(n,"redacted_thinking")){yield{type:"non_standard",value:n};continue}else if(S(n,"tool_use")&&g(n.name)&&g(n.id)){yield{type:"tool_call",id:n.id,name:n.name,args:n.input};continue}else if(S(n,"input_json_delta")){if(Up(e)&&e.tool_call_chunks?.length){let i=e.tool_call_chunks[0];yield{type:"tool_call_chunk",id:i.id,name:i.name,args:i.args,index:i.index};continue}}else if(S(n,"server_tool_use")&&g(n.name)&&g(n.id)){let{name:i,id:a}=n;if(i==="web_search"){yield{id:a,type:"server_tool_call",name:"web_search",args:{query:Ue(()=>{if(typeof n.input=="string")return n.input;if($(n.input)&&g(n.input.query))return n.input.query;if(g(n.partial_json)){let s=Ma(n.partial_json);if(s?.query)return s.query}return""})}};continue}else if(n.name==="code_execution"){yield{id:a,type:"server_tool_call",name:"code_execution",args:{code:Ue(()=>{if(typeof n.input=="string")return n.input;if($(n.input)&&g(n.input.code))return n.input.code;if(g(n.partial_json)){let s=Ma(n.partial_json);if(s?.code)return s.code}return""})}};continue}}else if(S(n,"web_search_tool_result")&&g(n.tool_use_id)&&de(n.content)){let{content:i,tool_use_id:a}=n;yield{type:"server_tool_call_result",name:"web_search",toolCallId:a,status:"success",output:{urls:i.reduce((s,o)=>S(o,"web_search_result")?[...s,o.url]:s,[])}};continue}else if(S(n,"code_execution_tool_result")&&g(n.tool_use_id)&&$(n.content)){yield{type:"server_tool_call_result",name:"code_execution",toolCallId:n.tool_use_id,status:"success",output:n.content};continue}else if(S(n,"mcp_tool_use")){yield{id:n.id,type:"server_tool_call",name:"mcp_tool_use",args:n.input};continue}else if(S(n,"mcp_tool_result")&&g(n.tool_use_id)&&$(n.content)){yield{type:"server_tool_call_result",name:"mcp_tool_use",toolCallId:n.tool_use_id,status:"success",output:n.content};continue}else if(S(n,"container_upload")){yield{type:"server_tool_call",name:"container_upload",args:n.input};continue}else if(S(n,"search_result")){yield{id:n.id,type:"non_standard",value:n};continue}else if(S(n,"tool_result")){yield{id:n.id,type:"non_standard",value:n};continue}else{let i=Dc(n);if(i){yield i;continue}}yield{type:"non_standard",value:n}}}return Array.from(t())}var zc={translateContent:Lc,translateContentChunk:Lc};function Up(e){return typeof e?._getType=="function"&&typeof e.concat=="function"&&e._getType()==="ai"}function zp(e){return Pc(e)?{type:e.type,mimeType:e.mime_type,url:e.url,metadata:e.metadata}:Mc(e)?{type:e.type,mimeType:e.mime_type??"application/octet-stream",data:e.data,metadata:e.metadata}:jc(e)?{type:e.type,mimeType:e.mime_type,fileId:e.id,metadata:e.metadata}:e}function Bc(e){return e.map(zp)}function Fc(e){return!!(S(e,"image_url")&&$(e.image_url)||S(e,"input_audio")&&$(e.input_audio)||S(e,"file")&&$(e.file))}function Hc(e){if(S(e,"image_url")&&$(e.image_url)&&g(e.image_url.url)){let t=Pa({dataUrl:e.image_url.url});return t?{type:"image",mimeType:t.mime_type,data:t.data}:{type:"image",url:e.image_url.url}}else{if(S(e,"input_audio")&&$(e.input_audio)&&g(e.input_audio.data)&&g(e.input_audio.format))return{type:"audio",data:e.input_audio.data,mimeType:`audio/${e.input_audio.format}`};if(S(e,"file")&&$(e.file)&&g(e.file.data)){let t=Pa({dataUrl:e.file.data});if(t)return{type:"file",data:t.data,mimeType:t.mime_type};if(g(e.file.file_id))return{type:"file",fileId:e.file.file_id}}}return e}function Bp(e){let t=[];typeof e.content=="string"?e.content.length>0&&t.push({type:"text",text:e.content}):t.push(...Wn(e.content));for(let r of e.tool_calls??[])t.push({type:"tool_call",id:r.id,name:r.name,args:r.args});return t}function Fp(e){let t=[];typeof e.content=="string"?e.content.length>0&&t.push({type:"text",text:e.content}):t.push(...Wn(e.content));for(let r of e.tool_calls??[])t.push({type:"tool_call",id:r.id,name:r.name,args:r.args});return t}function Wn(e){let t=[];for(let r of e)Fc(r)?t.push(Hc(r)):t.push(r);return t}function Hp(e){if(e.type==="url_citation"){let{url:t,title:r,start_index:n,end_index:i}=e;return{type:"citation",url:t,title:r,startIndex:n,endIndex:i}}if(e.type==="file_citation"){let{file_id:t,filename:r,index:n}=e;return{type:"citation",title:r,startIndex:n,endIndex:n,fileId:t}}return e}function Gc(e){function*t(){$(e.additional_kwargs?.reasoning)&&de(e.additional_kwargs.reasoning.summary)&&(yield{type:"reasoning",reasoning:e.additional_kwargs.reasoning.summary.reduce((n,i)=>$(i)&&g(i.text)?`${n}${i.text}`:n,"")});let r=typeof e.content=="string"?[{type:"text",text:e.content}]:e.content;for(let n of r)if(S(n,"text")){let{text:i,annotations:a,phase:s,extras:o,...c}=n,l=$(o)?{...o}:{};g(s)&&(l.phase=s);let u=Object.keys(l).length>0?{extras:l}:{};Array.isArray(a)?yield{...c,...u,type:"text",text:String(i),annotations:a.map(Hp)}:yield{...c,...u,type:"text",text:String(i)}}for(let n of e.tool_calls??[])yield{type:"tool_call",id:n.id,name:n.name,args:n.args};if($(e.additional_kwargs)&&de(e.additional_kwargs.tool_outputs))for(let n of e.additional_kwargs.tool_outputs){if(S(n,"web_search_call")){let i={};if($(n.action)&&g(n.action.query)&&(i.query=n.action.query),yield{id:n.id,type:"server_tool_call",name:"web_search",args:i},n.status==="completed"||n.status==="failed"){let a={};$(n.action)&&(a.action=n.action),yield{type:"server_tool_call_result",toolCallId:g(n.id)?n.id:"",status:n.status==="completed"?"success":"error",output:a}}continue}else if(S(n,"file_search_call")){yield{id:n.id,type:"server_tool_call",name:"file_search",args:{queries:de(n.queries)?n.queries:[]}},(n.status==="completed"||n.status==="failed")&&(yield{type:"server_tool_call_result",toolCallId:g(n.id)?n.id:"",status:n.status==="completed"?"success":"error",output:de(n.results)?{results:n.results}:{}});continue}else if(S(n,"computer_call")){yield{type:"non_standard",value:n};continue}else if(S(n,"code_interpreter_call")){if(g(n.code)&&(yield{id:n.id,type:"server_tool_call",name:"code_interpreter",args:{code:n.code}}),de(n.outputs)){let i=Ue(()=>{if(n.status!=="in_progress"){if(n.status==="completed")return 0;if(n.status==="incomplete")return 127;if(n.status!=="interpreting"&&n.status==="failed")return 1}});for(let a of n.outputs)if(S(a,"logs")){yield{type:"server_tool_call_result",toolCallId:n.id??"",status:"success",output:{type:"code_interpreter_output",returnCode:i??0,stderr:[0,void 0].includes(i)?void 0:String(a.logs),stdout:[0,void 0].includes(i)?String(a.logs):void 0}};continue}}continue}else if(S(n,"mcp_call")){yield{id:n.id,type:"server_tool_call",name:"mcp_call",args:n.input};continue}else if(S(n,"mcp_list_tools")){yield{id:n.id,type:"server_tool_call",name:"mcp_list_tools",args:n.input};continue}else if(S(n,"mcp_approval_request")){yield{type:"non_standard",value:n};continue}else if(S(n,"tool_search_call")){let i={};$(n.arguments)&&Object.assign(i,n.arguments);let a={};g(n.execution)&&(a.execution=n.execution),g(n.status)&&(a.status=n.status),g(n.call_id)&&(a.call_id=n.call_id),yield{id:g(n.id)?n.id:"",type:"server_tool_call",name:"tool_search",args:i,...Object.keys(a).length>0?{extras:a}:{}};continue}else if(S(n,"tool_search_output")){let i={name:"tool_search"};g(n.execution)&&(i.execution=n.execution),yield{type:"server_tool_call_result",toolCallId:g(n.id)?n.id:"",status:n.status==="completed"?"success":n.status==="failed"?"error":"success",output:{tools:de(n.tools)?n.tools:[]},extras:i};continue}else if(S(n,"image_generation_call")){g(n.result)&&(yield{type:"image",mimeType:"image/png",data:n.result,id:g(n.id)?n.id:void 0,metadata:{status:g(n.status)?n.status:void 0}}),yield{type:"non_standard",value:n};continue}$(n)&&(yield{type:"non_standard",value:n})}}return Array.from(t())}function Gp(e){function*t(){yield*Gc(e);for(let r of e.tool_call_chunks??[])yield{type:"tool_call_chunk",id:r.id,name:r.name,args:r.args}}return Array.from(t())}var Vc={translateContent:e=>typeof e.content=="string"?Bp(e):Gc(e),translateContentChunk:e=>typeof e.content=="string"?Fp(e):Gp(e)};function Zc(e){return typeof e=="object"&&e!==null&&"type"in e&&"content"in e&&(typeof e.content=="string"||Array.isArray(e.content))}function qc(e,t="pretty"){return t==="pretty"?Vp(e):JSON.stringify(e)}function Vp(e){let t=[],r=` ${e.type.charAt(0).toUpperCase()+e.type.slice(1)} Message `,n=Math.floor((80-r.length)/2),i="=".repeat(n),a=r.length%2===0?i:`${i}=`;if(t.push(`${i}${r}${a}`),e.type==="ai"){let s=e;if(s.tool_calls&&s.tool_calls.length>0){t.push("Tool Calls:");for(let o of s.tool_calls){t.push(` ${o.name} (${o.id})`),t.push(` Call ID: ${o.id}`),t.push(" Args:");for(let[c,l]of Object.entries(o.args))t.push(` ${c}: ${typeof l=="object"?JSON.stringify(l):l}`)}}}if(e.type==="tool"){let s=e;s.name&&t.push(`Name: ${s.name}`)}return typeof e.content=="string"&&e.content.trim()&&(t.length>1&&t.push(""),t.push(e.content)),t.join(`
|
|
3
3
|
`)}var ja=Symbol.for("langchain.message");function Wc(e){return Array.isArray(e)?e:typeof e=="string"?e===""?[]:[{type:"text",text:e}]:e==null?[]:[e]}function Pe(e,t){if(typeof e=="string")return e===""?t:typeof t=="string"?e+t:Array.isArray(t)&&t.length===0?e:Array.isArray(t)&&t.some(r=>Nt(r))?[{type:"text",source_type:"text",text:e},...t]:[{type:"text",text:e},...t];if(Array.isArray(t)){let r=Wc(e);return Nr(r,t)??[...r,...t]}else return t===""?e:Array.isArray(e)&&e.some(r=>Nt(r))?[...e,{type:"file",source_type:"text",text:t}]:[...Wc(e),{type:"text",text:t}]}function Xc(e,t){return e==="error"||t==="error"?"error":"success"}function Zp(e,t){function r(n,i){if(typeof n!="object"||n===null||n===void 0)return n;if(i>=t)return Array.isArray(n)?"[Array]":"[Object]";if(Array.isArray(n))return n.map(s=>r(s,i+1));let a={};for(let s of Object.keys(n))a[s]=r(n[s],i+1);return a}return JSON.stringify(r(e,0),null,2)}var Ie=class extends ft{lc_namespace=["langchain_core","messages"];lc_serializable=!0;get lc_aliases(){return{additional_kwargs:"additional_kwargs",response_metadata:"response_metadata"}}[ja]=!0;id;name;content;additional_kwargs;response_metadata;_getType(){return this.type}getType(){return this._getType()}constructor(e){let t=typeof e=="string"||Array.isArray(e)?{content:e}:e;t.additional_kwargs||(t.additional_kwargs={}),t.response_metadata||(t.response_metadata={}),super(t),this.name=t.name,t.content===void 0&&t.contentBlocks!==void 0?(this.content=t.contentBlocks,this.response_metadata={output_version:"v1",...t.response_metadata}):t.content!==void 0?(this.content=t.content??[],this.response_metadata=t.response_metadata):(this.content=[],this.response_metadata=t.response_metadata),this.additional_kwargs=t.additional_kwargs,this.id=t.id}get text(){return typeof this.content=="string"?this.content:Array.isArray(this.content)?this.content.map(e=>typeof e=="string"?e:e.type==="text"?e.text:"").join(""):""}get contentBlocks(){let e=typeof this.content=="string"?[{type:"text",text:this.content}]:this.content;return[Bc,Wn,Uc].reduce((t,r)=>r(t),e)}toDict(){return{type:this.getType(),data:this.toJSON().kwargs}}static lc_name(){return"BaseMessage"}get _printableFields(){return{id:this.id,content:this.content,name:this.name,additional_kwargs:this.additional_kwargs,response_metadata:this.response_metadata}}static isInstance(e){return typeof e=="object"&&e!==null&&ja in e&&e[ja]===!0&&Zc(e)}static[Symbol.hasInstance](e){return this.isInstance(e)}_updateId(e){this.id=e,this.lc_kwargs.id=e}get[Symbol.toStringTag](){return this.constructor.lc_name()}[Symbol.for("nodejs.util.inspect.custom")](e){if(e===null)return this;let t=Zp(this._printableFields,Math.max(4,e));return`${this.constructor.lc_name()} ${t}`}toFormattedString(e="pretty"){return qc(this,e)}};function Eb(e){return Array.isArray(e)&&e.every(t=>typeof t.index=="number")}var qp=["index","created","timestamp"];function ce(e,t,r){let n=r?.ignoreKeys??qp;if(e==null&&t==null)return;if(e==null||t==null)return e??t;let i={...e};for(let[a,s]of Object.entries(t))if(i[a]==null)i[a]=s;else{if(s==null)continue;if(typeof i[a]!=typeof s||Array.isArray(i[a])!==Array.isArray(s))throw new Error(`field[${a}] already exists in the message chunk, but with a different type.`);if(typeof i[a]=="string"){if(a==="type")continue;if(["id","name","output_version","model_provider"].includes(a))s&&(i[a]=s);else{if(n.includes(a))continue;i[a]+=s}}else if(typeof i[a]=="number"){if(n.includes(a))continue;i[a]=i[a]+s}else if(typeof i[a]=="object"&&!Array.isArray(i[a]))i[a]=ce(i[a],s,r);else if(Array.isArray(i[a]))i[a]=Nr(i[a],s,r);else{if(i[a]===s)continue;console.warn(`field[${a}] already exists in this message chunk and value has unsupported type.`)}}return i}function Wp(e){return typeof e=="number"||typeof e=="string"}function Jc(e){return typeof e!="object"||e===null||!("index"in e)?!1:Wp(e.index)}function Kc(e){if(typeof e!="object"||e===null||!("id"in e))return!1;let t=e.id;return t!=null&&t!==""}function Yc(e){return e.endsWith("_delta")?e.slice(0,-6):e}function Jp(e,t){return typeof e!="object"||e===null||typeof t!="object"||t===null||!("type"in e)||!("type"in t)?!1:typeof e.type=="string"&&typeof t.type=="string"&&Yc(e.type)!==Yc(t.type)}function Kp(e,t){let r=Jc(t),n=Kc(t);return!r&&!n?-1:e.findIndex(i=>{let a=Jc(i),s=Kc(i);return r&&a?i.index!==t.index||Jp(i,t)?!1:s&&n?i.id===t.id:!0:!r&&!a&&n&&s?i.id===t.id:!1})}function Nr(e,t,r){if(!(e==null&&t==null)){if(e==null||t==null)return e||t;{let n=[...e];for(let i of t){let a=Kp(n,i);if(a!==-1)n[a]=ce(n[a],i,r);else{if(typeof i=="object"&&i!==null&&"text"in i&&i.text==="")continue;n.push(i)}}return n}}}function Qc(e,t,r){if(!(e==null&&t==null)){if(e==null||t==null)return e??t;if(typeof e!=typeof t)throw new Error(`Cannot merge objects of different types.
|
|
4
4
|
Left ${typeof e}
|
|
5
5
|
Right ${typeof t}`);if(typeof e=="string"&&typeof t=="string")return e+t;if(Array.isArray(e)&&Array.isArray(t))return Nr(e,t,r);if(typeof e=="object"&&typeof t=="object")return ce(e,t,r);if(e===t)return e;throw new Error(`Can not merge objects of different types.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import a from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import a from"./KKCLHXHG.js";import{a as m}from"./A6LBMS7A.js";import{Dc as f}from"./M2U456J5.js";import{a as o}from"./5X23DDDZ.js";export default $arcgis.t(([{b:c,c:h}])=>{var g=(a,e,i)=>{let t=a.createQuery();return t.outFields=[e],t.where=i||"1=1",t.num=1,t},w=async(a,e,i,t)=>{let r=t.map?.allLayers.find(y=>y.id===a),n=g(r,e,i.where),s=(await r.queryFeatures(n)).features[0],d=s?s.attributes[e]:null,u=c(r,e,d,t.timeZone),l=h(r,e);return{tool:"getAttribute",layerName:r.title??a,summary:`${l} = ${u}`,details:{fieldName:e,fieldAlias:l!==e?l:void 0,value:u,where:i.where}}};async function b({layerId:a,fieldName:e,query:i},t){let{mapView:r}=m(t,["mapView"]),n=await w(a,e,i,r);return JSON.stringify(n,null,2)}var p=o.object({layerId:o.string().describe("The layerId of the layer containing the field from which to get a value."),fieldName:o.string().describe("The name of the field/attribute from which to get a field value."),query:o.object({where:o.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value.")})}),q=f(b,{name:"getAttribute",description:"Returns an attribute value for a given feature.",schema:p});return q},a)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
var a=new Map([["clearFilters",async()=>(await import("./SZ2L5556.js")).clearFiltersTool],["resetMap",async()=>(await import("./VT5EWFH7.js")).resetMapTool],["setFeatureEffect",async()=>(await import("./EXMEB4X2.js").then(m=>m.default.then(e=>({setFeatureEffectTool:e})))).setFeatureEffectTool],["listLayerFields",async()=>(await import("./BTTCBEPW.js")).listLayerFieldsTool],["goToAddress",async()=>(await import("./I3SUE2TR.js").then(m=>m.default.then(e=>({goToAddressTool:e})))).goToAddressTool],["goToBookmark",async()=>(await import("./UGIHS7OA.js")).goToBookmarkTool],["goToFeatures",async()=>(await import("./25MBI4PD.js")).goToFeaturesTool],["goToFullExtent",async()=>(await import("./FLUI6GCU.js").then(m=>m.default.then(e=>({goToFullExtentTool:e})))).goToFullExtentTool],["goToHomeExtent",async()=>(await import("./SXYKNDOF.js")).goToHomeExtentTool],["goToLayer",async()=>(await import("./KAX4A7SF.js")).goToLayerTool],["goToScale",async()=>(await import("./FRYS2PZJ.js")).goToScaleTool],["goToViewpoint",async()=>(await import("./Y4ZOB6UH.js").then(m=>m.default.then(e=>({goToViewpointTool:e})))).goToViewpointTool],["goToZoom",async()=>(await import("./SI22EJLC.js")).goToZoomTool],["findRelevantFields",async()=>(await import("./CX2HJ67C.js").then(m=>m.default.then(e=>({findRelevantFieldsTool:e})))).findRelevantFieldsTool],["findRelevantLayers",async()=>(await import("./LBTGOMCT.js")).findRelevantLayersTool],["getAttribute",async()=>(await import("./XZF7Y6B2.js").then(m=>m.default.then(e=>({getAttributeTool:e})))).getAttributeTool],["getStatistics",async()=>(await import("./AUCKEB52.js").then(m=>m.default.then(e=>({getStatisticsTool:e})))).getStatisticsTool],["getTopFeatures",async()=>(await import("./PUZ6RAFQ.js").then(m=>m.default.then(e=>({getTopFeaturesTool:e})))).getTopFeaturesTool],["queryFeatures",async()=>(await import("./FSLQCZRN.js").then(m=>m.default.then(e=>({queryFeaturesTool:e})))).queryFeaturesTool]]);async function e(o){let t=a.get(o);if(!t)throw new Error(`"${o}" tool not found`);return await t()}export{e as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import"./BVUCNXC5.js";var 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.
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import"./BVUCNXC5.js";var 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.
|
|
5
5
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{b as o}from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import{b as o}from"./GN56DOYL.js";import"./4YOG5F3W.js";import{g as a,h as e,n as i,v as c,z as n}from"./S5GFNIHC.js";import"./TLPZELG3.js";import"./BVUCNXC5.js";var r=a`.actions{display:flex;flex-direction:row;gap:var(--calcite-spacing-xs)}`,t=class extends c{constructor(){super(...arguments),this._messages=o({blocking:!0}),this.feedbackEnabled=!1,this.arcgisFeedback=i()}static{this.properties={feedbackEnabled:5,message:0}}static{this.styles=r}_handleFeedback(s){this.message&&(this.message.feedback=this.message.feedback?.positive===s?void 0:{positive:s},this.arcgisFeedback.emit(this.message),this.requestUpdate())}_getFeedback(){return this.message?.feedback?.positive}_renderThumbsUpButton(){return e`<calcite-action id=action-thumbs-up icon=thumbs-up scale=s .active=${this._getFeedback()===!0} @click=${()=>this._handleFeedback(!0)} text></calcite-action><calcite-tooltip reference-element=action-thumbs-up overlay-positioning=fixed placement=bottom><span>${this._messages.thumbsUpLabel}</span></calcite-tooltip>`}_renderThumbsDownButton(){return e`<calcite-action id=action-thumbs-down icon=thumbs-down scale=s .active=${this._getFeedback()===!1} @click=${()=>this._handleFeedback(!1)} text></calcite-action><calcite-tooltip reference-element=action-thumbs-down overlay-positioning=fixed placement=bottom><span>${this._messages.thumbsDownLabel}</span></calcite-tooltip>`}render(){return this.feedbackEnabled&&!this.message?.error?e`<div class="actions">${this._renderThumbsUpButton()}${this._renderThumbsDownButton()}</div>`:null}};n("arcgis-assistant-message-feedback",t);export{t as ArcgisAssistantMessageFeedback};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import a from"./ZY3JQCZQ.js";export default $arcgis.t(([{a:i}])=>{var d=(s,e)=>{let n=Array.from(s?.values()??[]).map(({fieldRegistry:r,layerItem:t})=>{let a=Array.from(r.values(),({name:o})=>o);return{title:t.title,description:t.description,fields:a.slice(0,10),additionalFieldCount:Math.max(a.length-10,0)}}),l=(e?.list()??[]).map(({agent:{description:r,id:t,name:a}})=>({id:t,name:a,description:r}));return JSON.stringify({layers:n,agents:l},null,2)},p=({config:s})=>{let e=s?.configurable?.services;return d(e?.layersAndFieldsRegistry,e?.agentRegistry)},c=[async()=>(await import("./BJMGT6GV.js")).default],m=i({id:"help",name:"Help Agent",description:"Answers questions about the current map, its layers and fields, and available assistant capabilities. Use for general help, unsupported map actions, and unrelated requests that should be redirected to map-related questions.",skillLoaders:c,modelTier:"default",systemPrompt:"You are an ArcGIS map help agent.",runtimeContextLoader:p,fallbackMessage:"Help request completed.",failureMessage:"I couldn't complete the help request."});return m},a)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{c as r}from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import{c as r}from"./4YOG5F3W.js";function s(e,n){return n?typeof n=="string"?l(e,n)??null:n:r(e,"arcgis-map")??null}function c(e,n){return n?typeof n=="string"?l(e,n)??null:n:r(e,"arcgis-link-chart")??r(e,"arcgis-map")??null}function l(e,n){let i=n.includes("#")||n.includes(".")||n.includes("["),t=e.getRootNode();return(i?void 0:t.querySelector(`#${n}`))??t.querySelector(n)??void 0}export{s as a,c as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
2
|
export default $arcgis.t(([F,$])=>{var w=10,N=["string","small-integer","integer"],b=async(l,e,{includeSummaryStatistics:d=!0,includeUniqueValues:f=!0}={})=>{let u=null,i=null;try{if(e.type!=="geometry"&&e.type!=="oid"&&e.type!=="global-id"){d&&(u=await F({layer:l,field:e.name}));let s=e.domain?.type==="coded-value"?e.domain:null;f&&(N.includes(e.type)||s)&&(i=(await $({layer:l,field:e.name})).uniqueValueInfos.sort((n,y)=>y.count-n.count).slice(0,w),s&&(i=i.map(n=>({...n,value:s.getName(n.value)??n.value}))))}}catch(s){console.error(`Error fetching statistics for field ${e.name}:`,s)}return{summaryStatistics:u,uniqueValues:i}};function x(l,e){return["string","small-integer","integer"].includes(l)||e==="coded-value"}async function j(l,e,d,f=!0){let u=[],i=[],s=[];for(let n of l){let y=function(a){let t=e.get(a)?.layerItem;return t?[t.name&&`Name: ${t.name}`,t.title&&`Title: ${t.title}`,t.description&&`Description: ${t.description}`].filter(Boolean).join(" | "):a},{layerId:r,results:I}=n,V=d.map?.allLayers.find(a=>a.id===r),p=e.get(r)?.fieldRegistry;if(!p)continue;let c=u.find(a=>a.layerId===r);c||(c={layerId:r,layerSummary:y(r),fieldInfos:[]},u.push(c));for(let a of I){let t=p.get(a.name);if(!t)continue;let o=t.statistics,g=f&&!o?.summaryStatistics,S=x(t.type,t.domain?.type)&&!o?.uniqueValues,h=g||S;if(s.push({layerId:r,fieldName:t.name,didFetchStatistics:h}),h){let v=b(V,t,{includeSummaryStatistics:g,includeUniqueValues:S}).then(q=>{let m={summaryStatistics:o?.summaryStatistics??null,uniqueValues:o?.uniqueValues??null};g&&(m.summaryStatistics=q.summaryStatistics),S&&(m.uniqueValues=q.uniqueValues),p.set(t.name,{...t,statistics:m}),t.statistics=m});i.push(v)}c.fieldInfos.push(t)}}return await Promise.all(i),{layerFieldInfo:u,didFetchStatistics:i.length>0,fieldStatisticsFetchStatus:s}}return j},"smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{b as r}from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import{b as r}from"./GN56DOYL.js";import"./4YOG5F3W.js";import{g as a,h as e,n as s,v as c,z as l}from"./S5GFNIHC.js";import"./TLPZELG3.js";import"./BVUCNXC5.js";var o=a`:host{padding:var(--calcite-spacing-md);background:var(--calcite-panel-background-color, var(--calcite-color-background))}calcite-panel{border-radius:var(--calcite-dialog-corner-radius, var(--calcite-corner-radius-sm));border:0 solid var(--calcite-color-brand);border-block-start-width:4px;box-shadow:var(--calcite-shadow-md);width:100%;--calcite-panel-border-color: none}.interrupt-content{padding:0 var(--calcite-spacing-md);background:var(--calcite-color-foreground-1)}`,i=class extends c{constructor(){super(...arguments),this._messages=r({blocking:!0}),this._selectedOptions=[],this.arcgisCancel=s(),this.arcgisSubmit=s()}static{this.properties={_selectedOptions:16,type:1,message:1,options:0}}static{this.styles=o}_renderInterruptOptions(){switch(this.type){case"single-select":return e`<calcite-list selection-mode=single-persist .label=${this._messages.optionsLabel} @calciteListChange=${t=>this._selectedOptions=t.target.selectedItems[0]?.value}>${this.options?.map(t=>e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;case"multi-select":return e`<calcite-list selection-mode=multiple .label=${this._messages.optionsLabel} @calciteListChange=${t=>this._selectedOptions=t.target.selectedItems.map(n=>n.value)}>${this.options?.map(t=>e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;case"boolean-choice":return null;case"text-input":return e`<calcite-input .label=${this._messages.enterTextLabel} @calciteInputInput=${t=>this._selectedOptions=t.target.value}></calcite-input>`}}render(){return e`<calcite-panel .description=${this.message}><div class="interrupt-content">${this._renderInterruptOptions()}</div>${this.type==="boolean-choice"?e`<calcite-button slot=footer-end appearance=outline @click=${()=>this.arcgisSubmit.emit(!1)}>${this._messages.declineButtonLabel}</calcite-button><calcite-button slot=footer-end appearance=solid @click=${()=>this.arcgisSubmit.emit(!0)}>${this._messages.approveButtonLabel}</calcite-button>`:e`<calcite-button slot=footer-end appearance=outline @click=${()=>this.arcgisCancel.emit()}>${this._messages.cancelButtonLabel}</calcite-button><calcite-button slot=footer-end appearance=solid .disabled=${!this._selectedOptions.length} @click=${()=>this.arcgisSubmit.emit(this._selectedOptions)}>${this._messages.submitButtonLabel}</calcite-button>`}</calcite-panel>`}};l("arcgis-assistant-interrupt",i);export{i as ArcgisAssistantInterrupt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import{b as c}from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import{b as c}from"./GN56DOYL.js";import"./4YOG5F3W.js";import{g as i,h as s,n as r,v as a,z as p}from"./S5GFNIHC.js";import"./TLPZELG3.js";import"./BVUCNXC5.js";var l=i`:host{display:block;max-width:100%}.group{max-width:100%}.prompt{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal;cursor:pointer;font-weight:var(--calcite-font-weight-regular)}calcite-chip{max-width:100%}`,e=class extends a{constructor(){super(...arguments),this._messages=c({blocking:!0}),this.prompts=[],this.arcgisPromptSelect=r()}static{this.properties={label:1,prompts:0}}static{this.styles=l}_emitPromptSelect(t){this.arcgisPromptSelect.emit({prompt:t})}render(){return this.prompts.length?s`<calcite-chip-group class="group" .label=${this.label??this._messages.suggestedPromptsLabel}>${this.prompts.map(t=>s`<calcite-chip .value=${t} .label=${t} appearance=outline-fill kind=brand @calciteChipSelect=${()=>this._emitPromptSelect(t)}><div class="prompt">${t}</div></calcite-chip>`)}</calcite-chip-group>`:null}};p("arcgis-assistant-suggested-prompts",e);export{e as ArcgisAssistantSuggestedPrompts};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import a from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import a from"./2LVYAXHG.js";import{b as E}from"./TLPZELG3.js";import{a as p}from"./V52GSTOC.js";import{P as M,Ya as D,ea as _,r as k,s as $}from"./ZJWR4W2S.js";import{Ia as S,ca as I,ta as b}from"./M2U456J5.js";export default $arcgis.t(([N,P,T,G,z,{a:C,c:A,d:W,e:R,f:L,m:q}])=>{var B=async e=>{let t=await Q(),n=await C("default"),s=P.getDefault(),r=(await N.getCredential(`${s.url}/sharing`)).token,a={type:"generateEmbeddings",webmapEmbeddings:e,auth:{apiUrl:n,token:r}};return t.postMessage(a),await new Promise((i,o)=>{let d=u=>{u.data==="completed"&&(t.removeEventListener("message",d),i())},c=u=>{t.removeEventListener("message",d),o(u instanceof Error?u:new Error("Embeddings worker error"))};t.addEventListener("message",d),t.addEventListener("error",c,{once:!0})}),t},Q=async()=>{{let e=(await import("./ZA7ZU2F7.js")).default;return new e}},J=e=>{e.currentIntent="none"},K=async(e,t)=>{let n=R(t);if(e.agentExecutionContext.userRequest){let r=new I(e.agentExecutionContext.userRequest.trim());e.agentExecutionContext.messages=[...e.agentExecutionContext.messages,r],J(e)}let s=n?.services.agentRegistry.list().map(r=>r.agent.id)??[];return await p({text:`Available agents: ${[...s].join(", ")}`},t),await p({text:"Analyzing user input"},t),e},V=async(e,t)=>(await p({text:"Exiting..."},t),e),F=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),X=(e,t)=>{if(!F(e)){e!==void 0&&console.warn(`Agent "${t}" returned invalid sharedStatePatch. Ignoring it.`);return}let n={};for(let[s,r]of Object.entries(e)){if(!F(r)||!("value"in r)){console.warn(`Agent "${t}" returned invalid sharedStatePatch entry for key "${s}". Ignoring that entry.`);continue}n[s]={value:r.value}}return n},Y=e=>{let{previousSharedState:t,patch:n,agentId:s}=e;if(!n)return t;let r=Date.now(),a={...t};for(let[i,o]of Object.entries(n))o?.value!==void 0&&(a[i]={value:o.value,meta:{updatedByAgentId:s,updatedAt:r}});return a},Z=256,ee=new Set(["point","polyline","polygon","extent","custom"]),te=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),re=(e,t)=>{if(e===void 0)return;if(!Array.isArray(e)){console.warn(`Agent "${t}" returned invalid sharedResourceAdditions. Ignoring it.`);return}let n=[];for(let[s,r]of e.entries()){if(!te(r)||typeof r.kind!="string"||!ee.has(r.kind)||typeof r.description!="string"||!r.description.trim()||!("payload"in r)||r.payload===void 0){console.warn(`Agent "${t}" returned invalid sharedResourceAdditions entry at index ${s}. Ignoring that entry.`);continue}let a;try{a=structuredClone(r.payload)}catch{console.warn(`Agent "${t}" returned invalid sharedResourceAdditions entry at index ${s}. Ignoring that entry.`);continue}n.push({kind:r.kind,description:r.description.trim().slice(0,Z),payload:a})}return n.length?n:void 0},ne=e=>{let{previousSharedResources:t,additions:n,agentId:s}=e;if(!n?.length)return t;let r=Date.now(),a=n.map(i=>({...i,id:E(),meta:{createdByAgentId:s,createdAt:r}}));return[...t,...a].slice(-50)},H=e=>typeof e!="string"?void 0:e.trim()||void 0,se=e=>{switch(e){case"failed":return"Agent failed without a summary.";case"unknown":return"Agent returned with unknown status.";case"success":return"Agent completed without a summary.";default:return"Agent completed without a summary."}},ae=(e,t)=>{let n=H(t?.outputMessage),s=H(t?.summary),r=t?.status,a=r==="success"||r==="failed"?r:"unknown";a==="unknown"&&console.warn(`Agent "${e}" returned missing/invalid status. Defaulting to "unknown".`);let i=X(t?.sharedStatePatch,e),o=re(t?.sharedResourceAdditions,e);return{outputMessage:n,summary:s??n??se(a),status:a,sharedStatePatch:i,sharedResourceAdditions:o}},j=4e3,ie=async(e,t)=>{let n=R(t);if(t?.signal?.aborted)return await p({text:"Run cancelled; skipping agent execution"},t),{...e,currentIntent:"none",requiresFollowUp:!1};let{agentRegistry:s}=n?.services??{},r=s?.get(e.currentIntent);if(!r)return console.warn(`No agent found for intent: ${e.currentIntent}`),e;await p({text:`Executing registered agent: ${r.agent.name}`},t);let a={...t??{},metadata:{...t?.metadata,agentId:r.agent.id},configurable:{...n??{},agentId:r.agent.id,context:r.getContext?await r.getContext():void 0}},i;try{let c=await r.agent.createGraph().compile().invoke({agentExecutionContext:{...e.agentExecutionContext,messages:[...e.agentExecutionContext.messages],priorSteps:structuredClone(e.agentExecutionContext.priorSteps??[]),sharedState:structuredClone(e.agentExecutionContext.sharedState??{}),sharedResources:structuredClone(e.agentExecutionContext.sharedResources??[])}},a);i=ae(r.agent.name,c),await p({text:`Finished executing registered agent: ${r.agent.name}`},t)}catch(c){if(M(c)||t?.signal?.aborted||c instanceof Error&&c.name==="AbortError")throw c;let u=c instanceof Error?c.message:String(c);console.error(`Agent "${r.agent.name}" failed:`,c),await p({text:`Registered agent failed: ${r.agent.name}. ${u}`},t),i={status:"failed",outputMessage:`Agent execution failed: ${u}`,summary:`Agent execution failed: ${u}`}}let o=i.outputMessage,d=[...e.agentExecutionContext.messages];if(o){let c=o.length>j?`${o.slice(0,j-14)}
|
|
3
3
|
[truncated]`:o;d.push(new b(c))}return{...e,stepCount:e.stepCount+1,lastExecutedAgent:r.agent.id,requiresFollowUp:i.status==="failed"?!0:e.requiresFollowUp,finalOutputMessage:o??"",agentExecutionContext:{...e.agentExecutionContext,messages:d,priorSteps:[...e.agentExecutionContext.priorSteps??[],{agentId:r.agent.id,assignedTask:e.agentExecutionContext.assignedTask,summary:i?.summary||"No summary provided.",status:i?.status||"unknown"}],sharedState:Y({previousSharedState:e.agentExecutionContext.sharedState,patch:i.sharedStatePatch,agentId:r.agent.id}),sharedResources:ne({previousSharedResources:e.agentExecutionContext.sharedResources,additions:i.sharedResourceAdditions,agentId:r.agent.id})}}},oe=async(e,t)=>{if(e.routing.mode!=="direct")throw new Error("Direct agent assignment requires direct routing.");return await p({text:`Doing a direct route to agent: ${e.routing.agentId}`},t),{...e,currentIntent:e.routing.agentId,requiresFollowUp:!1,agentExecutionContext:{...e.agentExecutionContext,assignedTask:e.agentExecutionContext.userRequest}}},de=3,ce=e=>e.routing.mode==="direct"?"assignDirectAgent":"intentLLM",ue=e=>e.routing.mode==="direct"||e.stepCount>=de||!e.requiresFollowUp?"exit":"intentLLM",ge=()=>new D(W).addNode("ingestInput",K).addNode("assignDirectAgent",oe).addNode("intentLLM",L).addNode("executeRegisteredAgent",ie).addNode("exit",V).addEdge(k,"ingestInput").addConditionalEdges("ingestInput",ce).addEdge("assignDirectAgent","executeRegisteredAgent").addConditionalEdges("intentLLM",e=>e.currentIntent==="none"||e.currentIntent===e.lastExecutedAgent?"exit":"executeRegisteredAgent").addConditionalEdges("executeRegisteredAgent",ue).addEdge("exit",$),le=(e,t)=>{let n=e.output?.usage_metadata??t.usage_metadata,s=e.output?.llmOutput?.tokenUsage,r=n?.input_tokens??s?.promptTokens,a=n?.output_tokens??s?.completionTokens,i=n?.total_tokens??s?.totalTokens;if(r===void 0||a===void 0||i===void 0)return;let o=n?.input_token_details?.cache_read,d=n?.output_token_details?.reasoning;return{input:r,output:a,total:i,...o!==void 0&&{cacheRead:o},...d!==void 0&&{reasoning:d}}},he=(e,t,n,s)=>{switch(e){case"chat_model":case"llm":return"model";case"tool":case"retriever":return e;case"chain":return!s||t==="LangGraph"?"workflow":n===t?"node":"chain";default:return}},pe=e=>{if(e instanceof Error)return{message:e.message,name:e.name};let t=e,n=typeof t?.message=="string"?t.message:String(e??"Unknown runtime error"),s=typeof t?.name=="string"?t.name:void 0;return{message:n,...s&&{name:s}}},me=({event:e,runId:t,parentSpanId:n,timestamp:s})=>{let r=/^on_(.+)_(start|end|error)$/u.exec(e.event);if(!r)return;let[,a,i]=r,o=e.metadata??{},d=o.langgraph_node,c=he(a,e.name,d,n);if(!c)return;let u=o.agentId,m=o.model??o.ls_model_name,l=e.data,g=i==="end"&&c==="model"?le(l,o):void 0,y=e.tags?.includes("langsmith:hidden")||d==="__start__",h={...m&&{model:m},...g&&{tokenUsage:g},...y&&{internal:!0}},w={id:e.run_id,...n&&{parentId:n},label:e.name,type:c,...Object.keys(h).length&&{metadata:h}},v={runId:t,timestamp:s,type:"runtime",...u&&{agentId:u}};switch(i){case"start":return{...v,phase:"started",span:{...w,...l?.input!==void 0&&{input:l.input}}};case"end":return{...v,phase:"completed",span:{...w,...l?.output!==void 0&&{output:l.output}}};case"error":return{...v,phase:"failed",span:{...w,error:pe(l?.error)}};default:return}},f=class{constructor(){this.agentRegistry=new Map}register(t){let{agent:n}=t;if(this.agentRegistry.has(n.id))throw new Error(`Duplicate agent id: ${n.id}`);this.agentRegistry.set(n.id,t)}get(t){return this.agentRegistry.get(t)}list(){return[...this.agentRegistry.values()]}},x=class{constructor(t,n){this.graph=t,this.config={...n}}async waitForUser(){return await new Promise((t,n)=>{this.resolveWait=t,this.rejectWait=n})}handle(t,n){try{let s={agentId:t.agentId,id:t.id,payload:n},r=this.graph.streamEvents(null,{...this.config,configurable:{...this.config.configurable,hitlResponse:s},subgraphs:!0,version:"v2"});this.resolveWait?.(r)}catch(s){this.rejectWait?.(s)}finally{this.resolveWait=void 0,this.rejectWait=void 0}}cancel(){this.rejectWait&&(this.rejectWait(new Error("Request cancelled by user.")),this.resolveWait=void 0,this.rejectWait=void 0)}},ye=async e=>{try{return await(await A()).embedDocuments(e)}catch(t){throw console.error("Failed to generate embeddings:",t),t}},U=async(e,t)=>{let n=t.get(e);if(n)return n;let s=await ye([e]);return t.set(e,s[0]),s[0]};async function we(e,t,n,s){let r=`req-${Date.now()}`,a={type:"layerSearch",precomputedEmbedding:s?await U(e,s):void 0,requestId:r,minScore:n};return await new Promise(i=>{let o=d=>{d.data.requestId===r&&i(d.data.results)};t.addEventListener("message",o,{once:!0}),t.postMessage(a)})}function fe(e){let{worker:t}=e;return{async searchLayers({text:n,minScore:s,embeddingCache:r}){return await we(n,t,s,r)}}}var ve=async({combinedQuery:e,layerIds:t,embeddingsWorker:n,minScore:s,topResults:r,embeddingCache:a})=>{let i=`req-${Date.now()}`,o=a?await U(e,a):void 0,d={type:"fieldSearch",layerIdForFieldsSearch:t,precomputedEmbedding:o,requestId:i,minScore:s,topResults:r};return await new Promise(c=>{let u=m=>{if(m.data.requestId!==i)return;let l=m.data.results.map(({layerId:g,results:y})=>({layerId:g,results:y}));c(l)};n.addEventListener("message",u,{once:!0}),n.postMessage(d)})};function Ee(e){let{worker:t}=e;return{async searchFields({text:n,layerIds:s,minScore:r,topResults:a,embeddingCache:i}){return await ve({combinedQuery:n,layerIds:s,embeddingsWorker:t,minScore:r,topResults:a,embeddingCache:i})}}}var Re=e=>{let t=q.safeParse(e);if(!t.success)throw new Error("Embeddings response validation failed. Regenerate embeddings.");return t.data},xe=(e,t)=>{let n=new Map,s=new Map;if(t.allLayers.forEach(r=>{r instanceof G&&s.set(r.id,r)}),e.length!==s.size)throw new Error("Layer count mismatch during registry restoration. Regenerate embeddings.");for(let r of e){let a=s.get(r.id);if(!a)throw new Error(`Layer with ID ${r.id} not found in the original map during registry restoration. Regenerate embeddings.`);if(r.fields.length!==a.fields.length)throw new Error(`Field count mismatch for layer ID ${r.id} during registry restoration. Regenerate embeddings.`);let i={name:r.name,title:r.title,description:r.description},o=new Map;for(let d of r.fields){let c=a.fieldsIndex.get(d.name);if(!c)throw new Error(`Field with name ${d.name} not found in the original layer ${r.id} during registry restoration. Regenerate embeddings.`);o.set(d.name,{name:d.name,alias:a.getFieldAlias(d.name)??d.alias,description:d.description,type:c.type||"unknown",valueType:c.valueType||"unknown",domain:a.getFieldDomain(d.name)??void 0})}n.set(r.id,{layerItem:i,fieldRegistry:o})}return n},Ie=async e=>{try{return(await z(e,{responseType:"json"})).data}catch(t){throw new Error(`Failed to fetch data from ${e}: ${String(t)}`)}},be=async e=>{let t=e.map;if(!t?.portalItem)throw new Error("WebMap portal item is missing.");let{resources:n}=await t.portalItem.fetchResources(),s=n.find(a=>a.resource.path==="embeddings-v01.json");if(!s?.resource.url)throw new Error("Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.");let r=await Ie(s.resource.url);return Re(r)},O=class e{constructor(){this.orchestratorReady=!1,this.chatHistory=[],this.priorSteps=[],this.sharedState={},this.sharedResources=[],this.agentRegistry=new f,this.activeRunId="",this.cancelledRunIds=new Set,this.parentRunIds=new Map,this.activeRuntimeSpans=new Map,this.runtimeEventsEnabled=!1,this.streamEpoch=0}static async init(t){let n=new e;n.runtimeEventsEnabled=t.runtimeEventsEnabled??!1;try{if(t.view?.map){await T.whenOnce(()=>t.view.ready);let s=await be(t.view),r=xe(s.layers,t.view.map);n.layersAndFieldsRegistry=r,n.embeddingsWorker=await B(s)}return t.agents?.forEach(s=>{n.agentRegistry.register(s)}),n.orchestratorReady=!0,n}catch(s){throw console.error("Orchestrator initialization failed:",s),s}}async*ask(t,n={}){if(!this.orchestratorReady)throw new Error("Orchestrator is not ready yet.");if(!this.agentRegistry.list().length)throw new Error("Orchestrator has no registered agents.");let s=this.createRequestAgentRegistry(n);if(!s.list().length)throw new Error("Orchestrator has no agents selected for this request.");if(++this.streamEpoch,!t.trim())return;let r=E();this.parentRunIds.clear(),this.activeRuntimeSpans.clear(),this.activeRunId=r,this.activeAbortController=new AbortController,this.graph||(this.graph=ge().compile({checkpointer:new _}));let a=this.embeddingsWorker?fe({worker:this.embeddingsWorker}):void 0,i=this.embeddingsWorker?Ee({worker:this.embeddingsWorker}):void 0,o=new Map,d=n.routing==="direct"?{mode:"direct",agentId:n.agentId}:{mode:"auto"},c={thread_id:r,hitlResponse:null,services:{layerSearch:a,fieldSearch:i,layersAndFieldsRegistry:this.layersAndFieldsRegistry,agentRegistry:s,embeddingCache:o}},u={version:"v2",streamMode:"custom",signal:this.activeAbortController.signal,...this.runtimeEventsEnabled&&{callbacks:[this.createHierarchyCallback()]},configurable:c,subgraphs:!0},m=this.graph?.streamEvents({routing:d,agentExecutionContext:{userRequest:t,messages:this.chatHistory,priorSteps:this.priorSteps,sharedState:this.sharedState,sharedResources:this.sharedResources}},u),l=++this.streamEpoch;if(yield*this.pipeStream(m,l,r),this.isRunCancelled(r)){yield*this.createCancellationEvents(r);return}for(;;){if(this.isRunCancelled(r)){yield*this.createCancellationEvents(r);return}let y=(await this.graph.getState(u,{subgraphs:!0})).tasks.find(h=>h.interrupts.length>0)?.interrupts[0]?.value;if(!y)break;this.currentInterrupt=y,this.interruptHandler=new x(this.graph,u),yield*this.closeActiveRuntimeSpans(r,"interrupted"),yield{runId:r,timestamp:Date.now(),type:"interrupt",interrupt:y};try{let h=await this.interruptHandler.waitForUser(),w=++this.streamEpoch;yield*this.pipeStream(h,w,r)}catch(h){if(this.isRunCancelled(r)){yield*this.createCancellationEvents(r);return}if(h){yield{runId:r,timestamp:Date.now(),type:"error",error:{message:h?.message}};return}}}if(this.isRunCancelled(r)){yield*this.createCancellationEvents(r);return}let g=(await this.graph.getState(u,{subgraphs:!0})).values;if(this.isRunCancelled(r)){yield*this.createCancellationEvents(r);return}this.chatHistory=g.agentExecutionContext.messages.length?g.agentExecutionContext.messages:this.chatHistory,this.priorSteps=g.agentExecutionContext.priorSteps?.slice(-5)??[],this.sharedState=g.agentExecutionContext.sharedState??{},this.sharedResources=g.agentExecutionContext.sharedResources??[],yield{runId:r,timestamp:Date.now(),type:"completed",result:{content:g.finalOutputMessage}}}newConversation(){this.chatHistory=[],this.priorSteps=[],this.sharedState={},this.sharedResources=[]}resumeInterrupt(t){if(!this.currentInterrupt||!this.interruptHandler)throw new Error("No pending interrupt to resume.");this.interruptHandler.handle(this.currentInterrupt,t)}cancelInterrupt(){this.interruptHandler&&this.interruptHandler.cancel()}cancel(){this.activeRunId&&(this.cancelledRunIds.add(this.activeRunId),this.activeAbortController?.abort(),++this.streamEpoch,this.interruptHandler?.cancel())}async*pipeStream(t,n,s){try{for await(let r of t){if(this.isRunCancelled(s)||n!==this.streamEpoch)break;if(this.runtimeEventsEnabled){let a=me({event:r,runId:s,parentSpanId:this.parentRunIds.get(r.run_id),timestamp:Date.now()});a&&(a.phase==="started"?this.activeRuntimeSpans.set(a.span.id,a):this.activeRuntimeSpans.delete(a.span.id),yield a)}r.event==="on_custom_event"&&r.name==="trace_message"?yield{runId:s,timestamp:Date.now(),type:"trace",data:r.data}:r.name==="graph_ux_suggestion"&&(yield{runId:s,timestamp:Date.now(),type:"ux-suggestion",suggestion:r.data})}}catch(r){if(!this.isRunCancelled(s))throw r}}*createCancellationEvents(t){yield*this.closeActiveRuntimeSpans(t,"cancelled"),yield{runId:t,timestamp:Date.now(),type:"cancelled",reason:"user"}}*closeActiveRuntimeSpans(t,n){let s=Date.now(),r=[...this.activeRuntimeSpans.values()].reverse();this.activeRuntimeSpans.clear();for(let a of r){let{input:i,...o}=a.span;yield{type:"runtime",phase:n,runId:t,timestamp:s,...a.agentId&&{agentId:a.agentId},span:o}}}createHierarchyCallback(){let t=(n,s)=>{s&&this.parentRunIds.set(n,s)};return S.fromMethods({handleLLMStart:(n,s,r,a)=>t(r,a),handleChatModelStart:(n,s,r,a)=>t(r,a),handleChainStart:(n,s,r,a)=>t(r,a),handleToolStart:(n,s,r,a)=>t(r,a),handleRetrieverStart:(n,s,r,a)=>t(r,a)})}isRunCancelled(t){return this.cancelledRunIds.has(t)}createRequestAgentRegistry(t){let n=t.routing==="direct"?[t.agentId]:t.agentIds,s=n?n.map(a=>{let i=this.agentRegistry.get(a);if(!i)throw new Error(`Agent is not registered: ${a}`);return i}):this.agentRegistry.list(),r=new f;return s.forEach(a=>r.register(a)),r}dispose(){this.sharedResources=[],this.embeddingsWorker&&(this.embeddingsWorker.terminate(),this.embeddingsWorker=void 0),this.orchestratorReady=!1}};return{a:ye,b:O}},"identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request",a)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import c from"./XVJFPZTW.js";import b from"./KKCLHXHG.js";import"./LLY5A2E2.js";import a from"./VGLBH473.js";import"./A6LBMS7A.js";import"./M2U456J5.js";import"./5X23DDDZ.js";import"./CSE6BHOJ.js";import"./BVUCNXC5.js";export default $arcgis.t(([,,a])=>{return a},a,b,c)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import"./BVUCNXC5.js";var e=`# ArcGIS Knowledge Graph Cypher Rules
|
|
3
3
|
|
|
4
4
|
## GOAL
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/
|
|
2
|
-
import"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import"./BVUCNXC5.js";var e=`## Navigation Agent - Tool Intent Classifier
|
|
3
3
|
|
|
4
4
|
You are an assistant that classifies the assigned task intent for navigation agent.
|
|
5
5
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import c from"./SBNNJ5WA.js";import"./XNUWVZN7.js";import b from"./EGRRZTF6.js";import"./2WXXSZP5.js";import a from"./2LVYAXHG.js";import"./4OI4QEV7.js";import"./TLPZELG3.js";import"./V52GSTOC.js";import"./4VBOTWC3.js";import"./477I66FH.js";import"./ZJWR4W2S.js";import"./M2U456J5.js";import"./5X23DDDZ.js";import"./CSE6BHOJ.js";import"./BVUCNXC5.js";export default $arcgis.t(([,,a])=>{return a},a,b,c)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/1.0/LICENSE.txt */
|
|
2
|
+
import n from"./NV7CL4S3.js";import m from"./ZY3JQCZQ.js";import{a as o,c as p}from"./SNG3WODY.js";import"./M5B6X46F.js";import l from"./VK6CCPTG.js";import"./LXIKAXUT.js";import k from"./M3KKORBG.js";import j from"./3PPXAIRE.js";import h from"./XVJFPZTW.js";import g from"./YOW3YKWR.js";import f from"./KKCLHXHG.js";import"./LLY5A2E2.js";import"./X42ACC66.js";import"./V4PJMCJZ.js";import e from"./EK3PM4L5.js";import"./T6W6F4TF.js";import"./CKUUYQLO.js";import d from"./KBSXHSBX.js";import"./275FFTBE.js";import"./TFAJNKBC.js";import"./HV7MVIQV.js";import"./OALQBAZR.js";import"./4YOG5F3W.js";import c from"./2LVYAXHG.js";import"./4OI4QEV7.js";import"./SJMAKF4P.js";import"./TXZQZR3I.js";import b from"./STOGCXJH.js";import a from"./VGLBH473.js";import"./A6LBMS7A.js";import{v as i,z as r}from"./S5GFNIHC.js";import"./TLPZELG3.js";import"./V52GSTOC.js";import"./477I66FH.js";import"./ZJWR4W2S.js";import"./M2U456J5.js";import"./5X23DDDZ.js";import"./CSE6BHOJ.js";import"./BVUCNXC5.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,,,,,,m])=>{var t=class extends i{constructor(){super(...arguments),this.agent=m}static{this.properties={referenceElement:1}}#t;#i;getContext(){if(!this.#t)throw new Error("arcgis-assistant-help-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=o(this,"arcgis-assistant-help-agent"),this.#i=p(this)}disconnectedCallback(){this.#i?.unregister(this.agent.id),super.disconnectedCallback()}};r("arcgis-assistant-help-agent",t);return t},"identity/IdentityManager","portal/Portal","request","config","core/reactiveUtils","layers/FeatureLayer","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",a,b,c,d,e,f,g,h,j,k,l,m,n)
|