@arcgis/ai-components 6.0.0-next.0 → 6.0.0-next.1
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/LLMAgent.d.ts +9 -2
- package/dist/agent-utils/LLMAgent.js +45 -36
- package/dist/agent-utils/tools/FunctionTool.d.ts +12 -1
- package/dist/agent-utils/tools/FunctionTool.js +15 -14
- package/dist/agent-utils/tools/MCPToolProvider.d.ts +54 -0
- package/dist/agent-utils/tools/MCPToolProvider.js +120 -0
- package/dist/agent-utils/tools/ToolProvider.d.ts +13 -0
- package/dist/agent-utils/tools/WebMCPToolProvider.d.ts +37 -0
- package/dist/agent-utils/tools/WebMCPToolProvider.js +71 -0
- package/dist/agents/tools/query/getAttribute/adapter.js +28 -24
- package/dist/agents/tools/query/getStatistics/adapter.js +70 -66
- package/dist/agents/tools/query/getTopFeatures/adapter.js +74 -70
- package/dist/agents/tools/query/queryFeatures/adapter.js +40 -36
- package/dist/cdn/{3HV6OXCZ.js → 24TK55FP.js} +1 -1
- package/dist/cdn/{4OLV5LA7.js → 2DWN3SKH.js} +1 -1
- package/dist/cdn/2O52MJ3D.js +2 -0
- package/dist/cdn/2UDDCWNW.js +2 -0
- package/dist/cdn/5FDBJI24.js +5 -0
- package/dist/cdn/5LA77ZBW.js +2 -0
- package/dist/cdn/{SBIYXWXZ.js → 5REENYPV.js} +1 -1
- package/dist/cdn/{V6AQFRUC.js → 5TW2NFES.js} +1 -1
- package/dist/cdn/{RBRHDEOB.js → 66VWTARH.js} +1 -1
- package/dist/cdn/6E6T6U7W.js +2 -0
- package/dist/cdn/{KKXOSV62.js → 6PK2UPG3.js} +1 -1
- package/dist/cdn/{OFM2S6U7.js → 6WYVG3JI.js} +1 -1
- package/dist/cdn/7HVIVV3O.js +2 -0
- package/dist/cdn/{U53SVXZK.js → 7MCFHVEH.js} +1 -1
- package/dist/cdn/{XI4BPYGB.js → 7X22QXJP.js} +1 -1
- package/dist/cdn/{EU6YSCZL.js → 7ZTYHZIN.js} +1 -1
- package/dist/cdn/A22375P3.js +2 -0
- package/dist/cdn/{2XXM52PS.js → AMP43OT2.js} +1 -1
- package/dist/cdn/{TTPTZBCM.js → AMURN3LO.js} +1 -1
- package/dist/cdn/AO2G4EXA.js +2 -0
- package/dist/cdn/{6GQCLDLJ.js → AQF6BBWC.js} +1 -1
- package/dist/cdn/AWPLRVPS.js +2 -0
- package/dist/cdn/{W3ZLMBEE.js → BBB5EJUB.js} +1 -1
- package/dist/cdn/{Q6PCXSZT.js → BMPBJXD7.js} +1 -1
- package/dist/cdn/{ZBRZU4XB.js → C67KQCPS.js} +1 -1
- package/dist/cdn/C76HLPKU.js +2 -0
- package/dist/cdn/{FFWPUYGD.js → CDS2HGQY.js} +1 -1
- package/dist/cdn/CHHC6YNW.js +2 -0
- package/dist/cdn/DBRBT54R.js +2 -0
- package/dist/cdn/{NN6MELJ7.js → DGCWQYN3.js} +1 -1
- package/dist/cdn/{IEAHAC6B.js → DI3VGUJY.js} +1 -1
- package/dist/cdn/{B4C7NIB5.js → DJG6DBCU.js} +2 -2
- package/dist/cdn/DJKEGIQZ.js +2 -0
- package/dist/cdn/{T2FKFOHE.js → DZOQFEOB.js} +1 -1
- package/dist/cdn/{AMFZY5QK.js → EEHDAYOG.js} +1 -1
- package/dist/cdn/{YO3L3XIH.js → EG5BMYZO.js} +1 -1
- package/dist/cdn/EGSD465U.js +2 -0
- package/dist/cdn/{ZMMUAYDN.js → EXLDRGUC.js} +1 -1
- package/dist/cdn/{WVMQ3I6F.js → FBARYPZ7.js} +1 -1
- package/dist/cdn/{M7TMD2HP.js → FJV7CI7O.js} +1 -1
- package/dist/cdn/{TRZJYWEB.js → FSLPYC4Y.js} +2 -2
- package/dist/cdn/{W6TS2TIE.js → GBFRJF4F.js} +1 -1
- package/dist/cdn/{7DRHB24Z.js → GHFOAS7T.js} +1 -1
- package/dist/cdn/HC5DJL2U.js +3 -0
- package/dist/cdn/HLWG7OIR.js +2 -0
- package/dist/cdn/{V7ERVXIO.js → HSMAXOOA.js} +1 -1
- package/dist/cdn/HWIM4KWF.js +2 -0
- package/dist/cdn/{VVWKEN53.js → JEWJ4M25.js} +1 -1
- package/dist/cdn/{I5OBL24F.js → JFL5IWPK.js} +1 -1
- package/dist/cdn/JUPTVXLY.js +2 -0
- package/dist/cdn/{B2JRBDJZ.js → JZPPP4QY.js} +1 -1
- package/dist/cdn/KKWCHNYQ.js +2 -0
- package/dist/cdn/{I7PHDOEQ.js → KX6CZEVZ.js} +1 -1
- package/dist/cdn/{XJUYG2M3.js → KY7M4WHO.js} +1 -1
- package/dist/cdn/L5IPMRHC.js +2 -0
- package/dist/cdn/M2G44RTS.js +2 -0
- package/dist/cdn/{H7WJUUJT.js → M6JQGHCE.js} +1 -1
- package/dist/cdn/MB7SEHPZ.js +2 -0
- package/dist/cdn/MC2V5WT3.js +2 -0
- package/dist/cdn/{ZBBI5M2X.js → MD2FTKQT.js} +1 -1
- package/dist/cdn/{645SDZBB.js → MPQ2OZXN.js} +1 -1
- package/dist/cdn/MZFWD5CQ.js +2 -0
- package/dist/cdn/{7OQA4GCM.js → NHWT7CXX.js} +1 -1
- package/dist/cdn/NMFEXE4D.js +2 -0
- package/dist/cdn/{MQSOVP27.js → NPV4MEAZ.js} +1 -1
- package/dist/cdn/{ENVTUTY6.js → OGZFST2A.js} +1 -1
- package/dist/cdn/P4CHI7W3.js +9 -0
- package/dist/cdn/{TPMZRJEC.js → PCAMBPOA.js} +1 -1
- package/dist/cdn/{O62IJLTZ.js → PGH7POKS.js} +1 -1
- package/dist/cdn/{37EJSNE3.js → PGUEODFA.js} +1 -1
- package/dist/cdn/{QJOO6IIX.js → QEGO4B2W.js} +1 -1
- package/dist/cdn/{FXRZCD5Y.js → QT3B5K4R.js} +1 -1
- package/dist/cdn/{2FUTKTNO.js → RE7MJTEF.js} +1 -1
- package/dist/cdn/RF6HWZMB.js +2 -0
- package/dist/cdn/{DWMZ23QK.js → RFDMNYTA.js} +1 -1
- package/dist/cdn/{OJP56R5R.js → RFPTOFM4.js} +1 -1
- package/dist/cdn/RKURZ5T2.js +2 -0
- package/dist/cdn/SJ4UMNIS.js +2 -0
- package/dist/cdn/{U3ZTF2BC.js → SWXUQFB6.js} +1 -1
- package/dist/cdn/{KJZVYKWL.js → T3SCINN5.js} +1 -1
- package/dist/cdn/{W3OJTTVX.js → TENUVOFJ.js} +1 -1
- package/dist/cdn/{UPSFL6U3.js → TJBU5BQK.js} +1 -1
- package/dist/cdn/UOKYHQNO.js +2 -0
- package/dist/cdn/UQRBY7ID.js +11 -0
- package/dist/cdn/{ZS5P7NRI.js → USPB2QBX.js} +1 -1
- package/dist/cdn/{ZKDCEL6K.js → UYP5PH5E.js} +1 -1
- package/dist/cdn/V6EX4YCY.js +2 -0
- package/dist/cdn/VA4M72JC.js +2 -0
- package/dist/cdn/VQ67NANV.js +2 -0
- package/dist/cdn/{2ZH5JNHL.js → X5ET73QZ.js} +1 -1
- package/dist/cdn/{DXCDVRGL.js → XC3T3Z5R.js} +1 -1
- package/dist/cdn/{J37GSI7C.js → XCLICBG7.js} +1 -1
- package/dist/cdn/XEJFVUNQ.js +2 -0
- package/dist/cdn/{EXIA3APU.js → XWNZMKQF.js} +1 -1
- package/dist/cdn/{UYEF3IKE.js → YBWRFVA6.js} +1 -1
- package/dist/cdn/YI6NIHNI.js +14 -0
- package/dist/cdn/{MHUEU6MR.js → YJXRCO4T.js} +1 -1
- package/dist/cdn/{2GSHUAQ2.js → YPLPDUMB.js} +1 -1
- package/dist/cdn/{YOQCQAKT.js → ZKWXHSEQ.js} +1 -1
- package/dist/cdn/{HWNPZ4CF.js → ZSLHB6MF.js} +1 -1
- package/dist/cdn/agent-utils/BaseAgent.js +1 -1
- package/dist/cdn/agent-utils/FunctionAgent.js +1 -1
- package/dist/cdn/agent-utils/LLMAgent.js +1 -1
- package/dist/cdn/agent-utils/SkillAgent.js +1 -1
- package/dist/cdn/agent-utils/WorkflowAgent.js +1 -1
- package/dist/cdn/agent-utils/createSchema.js +1 -1
- package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +1 -1
- package/dist/cdn/agent-utils/middlewares/middleware.js +1 -1
- package/dist/cdn/agent-utils/middlewares/trace.js +1 -1
- package/dist/cdn/agent-utils/tools/FunctionTool.js +1 -1
- package/dist/cdn/agent-utils/tools/MCPToolProvider.js +15 -0
- package/dist/cdn/agent-utils/tools/WebMCPToolProvider.js +2 -0
- package/dist/cdn/agent-utils/workflows/ConditionalWorkflow.js +1 -1
- package/dist/cdn/agent-utils/workflows/LoopWorkflow.js +1 -1
- package/dist/cdn/agent-utils/workflows/ParallelWorkflow.js +1 -1
- package/dist/cdn/agent-utils/workflows/RouterWorkflow.js +1 -1
- package/dist/cdn/agent-utils/workflows/SequentialWorkflow.js +1 -1
- package/dist/cdn/agent-utils/workflows/SwitchWorkflow.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/orchestrator/embeddings/getEmbeddings.js +1 -1
- package/dist/cdn/orchestrator/models/chatModel.js +1 -1
- package/dist/cdn/orchestrator/models/prompts.js +1 -1
- package/dist/cdn/orchestrator/state/runtime.js +1 -1
- package/dist/chunks/converterUtils.js +65 -109
- package/dist/chunks/resolveFieldNames.js +9 -0
- package/dist/components/arcgis-assistant-message-log/customElement.js +4 -5
- package/dist/components/arcgis-assistant-message-log/index.js +5 -0
- package/dist/components/arcgis-assistant-message-text/customElement.js +10 -11
- package/dist/components/arcgis-assistant-message-text/index.js +5 -0
- package/dist/components/arcgis-assistant-user-message/customElement.js +7 -8
- package/dist/components/arcgis-assistant-user-message/index.js +5 -0
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/package.json +8 -5
- package/dist/cdn/25CQLMB4.js +0 -2
- package/dist/cdn/34HKOU3T.js +0 -2
- package/dist/cdn/3WS4DSWD.js +0 -2
- package/dist/cdn/43OJZMBB.js +0 -2
- package/dist/cdn/4BRIOLDJ.js +0 -2
- package/dist/cdn/4ZPGFIE2.js +0 -2
- package/dist/cdn/6JCDY4FL.js +0 -2
- package/dist/cdn/7GQCNR4P.js +0 -11
- package/dist/cdn/A3KIOUWB.js +0 -2
- package/dist/cdn/BKKLQUK2.js +0 -2
- package/dist/cdn/DQRKGYR3.js +0 -2
- package/dist/cdn/EOSKJPQV.js +0 -2
- package/dist/cdn/F7VQ3WH2.js +0 -2
- package/dist/cdn/FBIPIDP7.js +0 -2
- package/dist/cdn/GOET2CH4.js +0 -2
- package/dist/cdn/ISDNOFHU.js +0 -3
- package/dist/cdn/JZS6ZSWH.js +0 -2
- package/dist/cdn/KEBMHD4R.js +0 -9
- package/dist/cdn/KPHHXMRK.js +0 -2
- package/dist/cdn/LVSIZRTB.js +0 -2
- package/dist/cdn/QQPVN5MG.js +0 -2
- package/dist/cdn/REE4K4J7.js +0 -2
- package/dist/cdn/RFKOCMMT.js +0 -2
- package/dist/cdn/RKHDRUX5.js +0 -2
- package/dist/cdn/TGI7QCB2.js +0 -2
- package/dist/cdn/UALF45Q2.js +0 -2
- package/dist/cdn/WB5AFS42.js +0 -2
- package/dist/cdn/WC6SHIEX.js +0 -2
- package/dist/cdn/XPSPAZUD.js +0 -2
- package/dist/cdn/YAUQJ6NV.js +0 -2
- package/dist/cdn/YD3DLETZ.js +0 -2
- package/dist/cdn/YKKIJTJY.js +0 -2
- package/dist/cdn/ZCNCYKXW.js +0 -14
- package/dist/cdn/ZESTW6HJ.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{b as v,c as R,d as C,e as W,g as k}from"./GEFFWUB2.js";import{a as M,b as A}from"./AAUVOBPS.js";var x=["input","output","total","cacheRead","cacheWrite","reasoning"];function h(d,i=!1){let n={},c={input:0,output:0,total:0,cacheRead:0,cacheWrite:0,reasoning:0},u={input:!0,output:!0,total:!0,cacheRead:!0,cacheWrite:!0,reasoning:!0},e={input:0,cachedInput:0,cacheWrite:0,output:0,total:0},a=d.length>0;for(let r of d){for(let m of x){let p=r.metadata?.tokenUsage?.[m];p===void 0?u[m]=!1:c[m]+=p}let o=r.usage?.cost;o?(e.input+=o.input,e.cachedInput+=o.cachedInput,e.cacheWrite+=o.cacheWrite,e.output+=o.output,e.total+=o.total):a=!1}for(let r of x)u[r]&&(n[r]=c[r]);return{tokens:n,knownTokens:c,completeTokens:u,cost:a?{...e}:void 0,knownCost:e,completeCost:a,modelCalls:d.length,...i&&d[0]?.usage?.rates&&{rates:d[0].usage.rates},...n.input!==void 0&&(i||n.cacheRead!==void 0&&n.cacheWrite!==void 0)&&{uncached:n.input-(n.cacheRead??0)-(n.cacheWrite??0)}}}function b(d,i=M){let n=new Map;for(let e of d){let a=n.get(e.runId)??[];a.push(e),n.set(e.runId,a)}let c=[],u=[];for(let[e,a]of n){let r=v(a),o=R(a,r),m=new Set(a.filter(t=>t.phase==="started").map(t=>t.span.id)),p=[...r.values()].map(t=>{let s=A(t,i),l={...t,timingRecorded:m.has(t.id),...s&&{pricingTier:s.rates===(t.metadata?.model?i.models[t.metadata.model]?.longContext:void 0)?"long-context":"standard"}};return t.metadata?.tokenUsage&&(l.usage={...h([{...l,usage:s?{cost:s,rates:s.rates}:void 0}],!0),modelCalls:t.type==="model"?1:0}),l}),g=p.filter(t=>t.type==="model");u.push(...g);let f=new Map;for(let t of g){let s=t.metadata?.model,l=f.get(s)??[];l.push(t),f.set(s,l)}let I=Math.max(0,a.reduce((t,s)=>Math.max(t,s.timestamp),o.startedAt)-o.startedAt);c.push({id:e,number:c.length+1,prompt:W(r),status:o.status,startedAt:o.startedAt,endedAt:o.endedAt,durationMs:o.durationMs,spans:p,usage:h(g),models:[...f].map(([t,s])=>({model:t,usage:h(s)})),latency:{...C(o,a),timelineMs:I,steps:p.filter(k).sort((t,s)=>t.startedAt-s.startedAt).map(t=>({spanId:t.id,offsetMs:Math.max(0,t.startedAt-o.startedAt),durationMs:t.timingRecorded?t.durationMs:void 0,timingRecorded:t.timingRecorded}))}})}return{schemaVersion:1,pricing:i,runs:c,totals:{runCount:c.length,spanCount:c.reduce((e,a)=>e+a.spans.length,0),failedSpanCount:c.reduce((e,a)=>e+a.spans.filter(r=>r.status==="failed").length,0),usage:h(u)}}}export{b as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import o from"./BBB5EJUB.js";import{a as e,c as s}from"./GMZUN5SF.js";import"./KY7M4WHO.js";import l from"./UOKYHQNO.js";import k from"./YI6NIHNI.js";import j from"./L5IPMRHC.js";import i from"./UQRBY7ID.js";import h from"./FX4LV2S3.js";import"./34O57OGV.js";import"./XEJFVUNQ.js";import g from"./XC3T3Z5R.js";import"./KX6CZEVZ.js";import"./PGH7POKS.js";import f from"./NPV4MEAZ.js";import"./AQF6BBWC.js";import"./ZSLHB6MF.js";import"./TJBU5BQK.js";import d from"./C67KQCPS.js";import"./OVIQ5NSE.js";import"./QUZTFUWM.js";import"./OGZFST2A.js";import"./X5ET73QZ.js";import c from"./MPQ2OZXN.js";import b from"./JZPPP4QY.js";import{a as m}from"./ONQ6JSBJ.js";import"./2DWN3SKH.js";import"./FDOMMK2M.js";import"./DYSPEU7W.js";import"./66VWTARH.js";import"./24TK55FP.js";import"./FJV7CI7O.js";import"./WSIZ2OTL.js";import{C as a,x as r}from"./RE7MJTEF.js";import"./R74ZHFA6.js";import{a as n}from"./DJG6DBCU.js";import"./C76HLPKU.js";import"./RFPTOFM4.js";import"./CADNOKIK.js";import"./BMPBJXD7.js";import"./CDS2HGQY.js";import"./QEGO4B2W.js";import"./EEHDAYOG.js";import"./XWNZMKQF.js";import"./FSLPYC4Y.js";import"./AMP43OT2.js";import"./2UKFCF2J.js";import"./UZLQALHY.js";export default $arcgis.t(([])=>{var d=({config:o})=>{let{mapView:t}=m(o,["mapView"]),l=t.map,g=Number.isFinite(t.zoom)?t.zoom:void 0;return JSON.stringify({availableBookmarks:l.bookmarks?.map(({name:c})=>c).filter(Boolean)??[],currentZoom:g},null,2)},u=[async()=>(await import("./CFAC4FN3.js")).default],p=n({id:"navigation",name:"Navigation Agent",description:"Navigates the map for explicit zoom, center, address, bookmark, layer, feature, extent, scale, and viewpoint requests. Use for questions asking where a place is or to resolve an address or place as a reusable spatial anchor for a proximity request. Resolves only the location; it does not query, display, filter, or highlight feature data.",skillLoaders:u,modelTier:"default",systemPrompt:"You are an ArcGIS map navigation agent.",runtimeContextLoader:d});var i=class extends r{constructor(){super(...arguments),this.agent=p}static{this.properties={referenceElement:1}}#t;#i;getContext(){if(!this.#t)throw new Error("arcgis-assistant-navigation-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=e(this,"arcgis-assistant-navigation-agent"),this.#i=s(this)}disconnectedCallback(){this.#i?.unregister(this.agent.id),super.disconnectedCallback()}};a("arcgis-assistant-navigation-agent",i);return i},"intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",b,c,d,f,g,h,i,j,k,l,o)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as n}from"./ONQ6JSBJ.js";import{a as i}from"./
|
|
2
|
+
import{a as n}from"./ONQ6JSBJ.js";import{a as i}from"./RFPTOFM4.js";import{Ga as o}from"./FSLPYC4Y.js";async function a(e){let t=e.map.initialViewProperties?.viewpoint?.targetGeometry;if(t)await e.goTo(t);else throw new Error("Initial extent is undefined");return{text:"Successfully zoomed to home extent"}}async function m(e,t){let{mapView:r}=n(t,["mapView"]);return await a(r)}var s=i.object({}),f=o(m,{name:"goToHomeExtent",description:"Go to the initial web map view extent",schema:s});export{f as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import c from"./L5IPMRHC.js";import b from"./FX4LV2S3.js";import"./34O57OGV.js";import"./XEJFVUNQ.js";import a from"./JZPPP4QY.js";import"./ONQ6JSBJ.js";import"./RFPTOFM4.js";import"./FSLPYC4Y.js";import"./AMP43OT2.js";import"./2UKFCF2J.js";import"./UZLQALHY.js";export default $arcgis.t(([,,a])=>{return a},a,b,c)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import f from"./
|
|
2
|
+
import f from"./UOKYHQNO.js";import e from"./YI6NIHNI.js";import c from"./L5IPMRHC.js";import a from"./UQRBY7ID.js";import{b as me}from"./66VWTARH.js";import{a as d}from"./RFPTOFM4.js";import{a as b,b as T}from"./CADNOKIK.js";import{e as x,f as le}from"./CDS2HGQY.js";import{S as y,g as ne,j as P,k as L,la as se,y as ie,ya as k}from"./QEGO4B2W.js";import{Ga as g}from"./FSLPYC4Y.js";import{R,V as K,ga as I}from"./2UKFCF2J.js";export default $arcgis.t(([{createRenderer:je},{getSchemesByTag:Fe,getSchemes:Ge},{getBackgroundColorTheme:be},{createAgeRenderer:Qe,createContinuousRenderer:Ve},{getSchemesByTag:H},{createContinuousRenderer:Ke},{createRenderer:Be},{getSchemesByTag:Ue},{createRenderer:He},{getSchemesByTag:Je},{createRenderer:We},{getSchemesByTag:Xe},{createRenderer:Ze},{getSchemesByTag:Ye},{createAgeRenderer:et,createContinuousRenderer:tt},{createRenderer:rt},{getSchemesByTag:ot},$,nr,Ee,Me,{fetchKnowledgeGraph:ve,executeQueryStreaming:ir,executeSearchStreaming:sr},lr,Se,xe,{getBindParametersFromCypherQuery:cr},pe,ue,de,ce])=>{var E=(e,t)=>t??e;var Hr=y.Root({...le(),intent:y({reducer:E}),vectorSearchLayerResults:y({reducer:E,default:()=>[]}),vectorSearchFieldResults:y({reducer:E}),navigationInternalState:y({reducer:E,default:()=>({toolCallMessage:void 0})})});var ge=e=>Array.isArray(e)&&e.every(R),qe=e=>typeof e=="object"&&e!=null&&"messages"in e&&ge(e.messages),ze=e=>typeof e=="object"&&e!=null&&"lg_tool_call"in e,O=class extends se{tools;handleToolErrors=!0;trace=!1;constructor(e,t){let{name:r,tags:o,handleToolErrors:a}=t??{};super({name:r,tags:o,func:(n,s)=>this.run(n,s)}),this.tools=e,this.handleToolErrors=a??this.handleToolErrors}async runTool(e,t,r){let o=this.tools.find(a=>a.name===e.name);try{if(o===void 0)throw new Error(`Tool "${e.name}" not found.`);let a={...e,type:"tool_call"},n={...t,state:r,toolCallId:e.id??"",config:t,context:t.context,store:t.store??null,writer:t.writer??t.configurable?.writer??null},s=await o.invoke(a,n);return R(s)&&s.getType()==="tool"||L(s)?s:new K({status:"success",name:o.name,content:typeof s=="string"?s:JSON.stringify(s),tool_call_id:e.id})}catch(a){if(!this.handleToolErrors||ie(a))throw a;return new K({status:"error",content:`Error: ${a.message}
|
|
3
3
|
Please fix your mistakes.`,name:e.name,tool_call_id:e.id??""})}}async run(e,t){let r;if(ze(e)){let{lg_tool_call:n,...s}=e;r=[await this.runTool(n,t,s)]}else{let n;if(ge(e))n=e;else if(qe(e))n=e.messages;else throw new Error("ToolNode only accepts BaseMessage[] or { messages: BaseMessage[] } as input.");let s=new Set(n.filter(c=>c.getType()==="tool").map(c=>c.tool_call_id)),i;for(let c=n.length-1;c>=0;c-=1){let l=n[c];if(I(l)){i=l;break}}if(i==null||!I(i))throw new Error("ToolNode only accepts AIMessages as input.");r=await Promise.all(i.tool_calls?.filter(c=>c.id==null||!s.has(c.id)).map(c=>this.runTool(c,t,e))??[])}if(!r.some(L))return Array.isArray(e)?r:{messages:r};let o=[],a=null;for(let n of r)L(n)?n.graph===P.PARENT&&Array.isArray(n.goto)&&n.goto.every(s=>ne(s))?a?a.goto.push(...n.goto):a=new P({graph:P.PARENT,goto:n.goto}):o.push(n):o.push(Array.isArray(e)?[n]:{messages:[n]});return a&&o.push(a),o}};var Po=y.Root({llmInputMessages:y({reducer:(e,t)=>k([],t),default:()=>[]})});var Le=(e,t=300)=>{let r=e.replace(/\s+/gu," ").replace(/[*_`#>\-]/gu,"").trim();return r.length>t?`${r.slice(0,t)}...`:r};var ma=y.Root({...x(),vectorSearchLayerIds:y(),vectorSearchFieldResults:y(),layerFieldInfo:y(),queryResponse:y(),dataExplorationMessages:y({reducer:k,default:()=>[]})}),Oe=[ce,de,ue,pe];var ha=new O(Oe,{handleToolErrors:!1});var we=["mapView"];async function at(e){let{fields:t,layer:r,view:o,styleName:a,colorSchemeTags:n}=e,s;return n?s=Fe({basemapTheme:await be(o),geometryType:r.geometryType,includedTags:n,numColors:Math.min(t.length,8)})[0]:s=Ge({basemapTheme:await be(o),geometryType:r.geometryType,numColors:Math.min(t.length,8)}).primaryScheme,{layer:r,view:o,attributes:t.map(i=>({field:i,label:r.fields.find(c=>c.name===i)?.alias??""})).slice(0,8),outlineOptimizationEnabled:!0,sizeOptimizationEnabled:!0,includeSizeVariable:a.includes("Size"),pieChartScheme:s}}async function nt(e){return await je(e)}async function it({arcgisMap:e,arcgisMapView:t,layerId:r,fields:o,colorSchemes:a,includeSize:n}){let s=t,i=e?.allLayers.find(l=>l.id===r);if(!i)return`Could not find layer for id: ${r}`;let c={styleName:n?"chart-size":"chart",fields:o,layer:i,view:s,colorSchemeTags:a};try{let l=await at(c),u=await nt(l);return i.renderer=u.renderer,i.visible=!0,`Chart renderer applied to layer: ${i.title??i.id} using fields ${o.join(", ")}`}catch(l){return`Error applying chart renderer: ${l instanceof Error?l.message:String(l)}`}}function v(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("LayerStylingAgent context missing");let r=we.filter(o=>!(o in t));if(r.length)throw new Error(`LayerStylingAgent context missing: ${r.join(", ")}`);return t}async function st({layerId:e,fields:t,colorSchemes:r,includeSize:o},a){let{mapView:n}=v(a);return await T({type:"show-legend",data:{layerIds:[e]}},a),await it({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,includeSize:o})}var lt=d.object({layerId:d.string().describe("The id of the layer to apply the chart renderer to"),fields:d.array(d.string()).describe("The fields to use for the chart renderer (multiple numeric fields)"),colorSchemes:d.array(d.string()).optional().describe("Optional color scheme tags to use"),includeSize:d.boolean().optional().describe("Whether to vary the chart size (chart-size)")}),ja=g(st,{name:"chart",description:`Label: Charts
|
|
4
4
|
Description: Show the values of two or more categories as a proportion of the total using a pie chart.
|
|
5
5
|
Keywords: pie, chart, all categories, breakdown, proportion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{$ as je,Aa as Le,Ca as ve,Da as De,Ea as Nt,a as ft,b as R,ca as Pt,f as $,j as L,k as H,ta as oe,ua as at,wa as W,x as Ke,xa as Ot,y as pt}from"./
|
|
2
|
+
import{$ as je,Aa as Le,Ca as ve,Da as De,Ea as Nt,a as ft,b as R,ca as Pt,f as $,j as L,k as H,ta as oe,ua as at,wa as W,x as Ke,xa as Ot,y as pt}from"./QEGO4B2W.js";import{I as At,K as It,L as Rt,a as ot,v as Et,z as rt}from"./XWNZMKQF.js";import{$ as Oe,A as vt,C as Ct,Ca as st,D as te,E as _t,M as F,N as ue,P as xt,S as Pe,U as St,X as i,Z as tt,d as Mt,da as be,ea as Z,f as et,h as Tt,ha as me,ja as Ne,s as de,t as Re,w as Te,wa as nt,ya as kt}from"./FSLPYC4Y.js";import{N as U,i as bt}from"./AMP43OT2.js";import{$a as B,Ca as yt,J as Ze,V as M,Ya as qe,aa as wt,ab as ce,c as ht,cb as Ie,fa as T,ia as Xe,q as Ye,ra as q,u as gt,va as Qe,wa as z}from"./2UKFCF2J.js";function Ce(e){return"invoke"in e&&typeof e.invoke=="function"&&"_streamResponseChunks"in e}function fe(e){return typeof e=="object"&&e!=null&&"_queuedMethodOperations"in e&&"_getModelInstance"in e&&typeof e._getModelInstance=="function"}var _e=class extends Error{constructor(){super("The provided LLM already has bound tools. Please provide an LLM without bound tools to createAgent. The agent will bind the tools provided in the 'tools' parameter.")}},xe=class extends Error{toolNames;constructor(e){super(`The model has called multiple tools: ${e.join(", ")} to return a structured output. This is not supported. Please provide a single structured output.`),this.toolNames=e}},pe=class extends Error{toolName;errors;constructor(e,t){super(`Failed to parse structured output for tool '${e}':${t.map(o=>`
|
|
3
3
|
- ${o}`).join("")}.`),this.toolName=e,this.errors=t}},he=class extends Error{"~brand"="ToolInvocationError";toolCall;toolError;constructor(e,t){let o=e instanceof Error?e:new Error(String(e)),n=JSON.stringify(t.args);super(`Error invoking tool '${t.name}' with kwargs ${n} with error: ${o.stack}
|
|
4
4
|
Please fix the error and try again.`),this.toolCall=t,this.toolError=o}static isInstance(e){return e instanceof Error&&"~brand"in e&&e["~brand"]==="ToolInvocationError"}static[Symbol.hasInstance](e){return this.isInstance(e)}},ne=class jt extends Error{"~brand"="MiddlewareError";constructor(t,o){let n=t instanceof Error?t.message:String(t);super(n),this.name=t instanceof Error?t.name:`${o[0].toUpperCase()+o.slice(1)}Error`,t instanceof Error&&(this.cause=t)}static wrap(t,o){return Ke(t)?t:new jt(t,o)}static isInstance(t){return t instanceof Error&&"~brand"in t&&t["~brand"]==="MiddlewareError"}static[Symbol.hasInstance](t){return this.isInstance(t)}};var Lt=!0,Co=0,G=class it{schema;tool;options;constructor(t,o,n){this.schema=t,this.tool=o,this.options=n}get name(){return this.tool.function.name}static fromSchema(t,o){function n(a){return a??`extract-${++Co}`}if(de(t)||Te(t)){let a=Oe(t),l={type:"function",function:{name:n(a.title),strict:!1,description:a.description??"Tool for extracting structured output from the model's response.",parameters:a}};return new it(a,l,o)}let r;typeof t.name=="string"&&typeof t.parameters=="object"&&t.parameters!=null?r=t:r={name:n(t.title),description:t.description??"",parameters:t.schema||t};let s=Oe(t);return new it(s,{type:"function",function:r},o)}parse(t){let o=new tt(this.schema).validate(t);if(!o.valid)throw new pe(this.name,o.errors.map(n=>n.error));return t}},V=class Dt{_schemaType;schema;strict;constructor(t,o){if("schema"in t&&typeof t.schema=="object"&&t.schema!==null&&!("type"in t)){let n=t;this.schema=n.schema,this.strict=n.strict??Lt}else this.schema=t,this.strict=o??Lt}static fromSchema(t,o){let n=Oe(t);return new Dt(n,o)}parse(t){let o;if(typeof t.content=="string")o=t.content;else if(Array.isArray(t.content)){for(let n of t.content)if(typeof n=="object"&&n!==null&&"type"in n&&n.type==="text"&&"text"in n&&typeof n.text=="string"){o=n.text;break}}if(!(!o||o===""))try{let n=JSON.parse(o);return new tt(this.schema).validate(n).valid?n:void 0}catch{}}};function $t(e,t,o){if(!e)return[];if(typeof e=="object"&&e!==null&&"__responseFormatUndefined"in e)return[];if(Array.isArray(e)){if(e.every(r=>r instanceof G||r instanceof V))return e;if(e.every(r=>de(r)))return e.map(r=>G.fromSchema(r,t));if(e.every(r=>F(r)))return e.map(r=>G.fromSchema(r,t));if(e.every(r=>typeof r=="object"&&r!==null&&!F(r)&&!de(r)))return e.map(r=>G.fromSchema(r,t));throw new Error(`Invalid response format: list contains mixed types.
|
|
5
5
|
All items must be either InteropZodObject, Standard Schema, or plain JSON schema objects.`)}if(e instanceof G||e instanceof V)return[e];let n=_o(o);if(de(e))return n?[V.fromSchema(e)]:[G.fromSchema(e,t)];if(F(e))return n?[V.fromSchema(e)]:[G.fromSchema(e,t)];if(typeof e=="object"&&e!==null&&"properties"in e)return n?[V.fromSchema(e)]:[G.fromSchema(e,t)];throw new Error(`Invalid response format: ${String(e)}`)}function Bt(e){if(typeof e=="object"&&e!==null&&"schema"in e&&!Te(e)&&!de(e)&&!("type"in e)){let{schema:t,strict:o}=e;return V.fromSchema(t,o)}return V.fromSchema(e)}function _o(e){return!e||!Ce(e)||!("profile"in e)||typeof e.profile!="object"||!e.profile?!1:"structuredOutput"in e.profile&&e.profile.structuredOutput===!0}var $e=Symbol.for("AgentMiddleware");function E(e){return{[$e]:!0,name:e.name,stateSchema:e.stateSchema,contextSchema:e.contextSchema,wrapToolCall:e.wrapToolCall,wrapModelCall:e.wrapModelCall,beforeAgent:e.beforeAgent,beforeModel:e.beforeModel,afterModel:e.afterModel,afterAgent:e.afterAgent,tools:e.tools,streamTransformers:e.streamTransformers}}function xo(e,t){if(e.length<t.length||e.length>t.length+1)return!1;for(let o=0;o<t.length;o+=1)if(e[o]!==t[o])return!1;return!0}function So(e){let t;try{t=JSON.parse(e)}catch{return!1}return!Array.isArray(t)||t.length===0?!1:t.every(o=>{if(o==null||typeof o!="object")return!1;let n=o;return typeof n.id=="string"&&"value"in n})}function ko(e){if(e==null||typeof e!="object")return!1;let t=e;return t.type!=="constructor"||!Array.isArray(t.id)?!1:t.id[t.id.length-1]==="ToolMessage"}function Eo(e){return M.isInstance(e)?e.content:ko(e)?e.kwargs?.content:e}function ae(e){return()=>{let t=je.local(),o=new Map;function n(r,s,a){if(o.has(r))return;let l=typeof a=="string"?JSON.parse(a):a,u,m,c,h,d=new Promise((x,y)=>{u=x,m=y}),f=new Promise(x=>{c=x}),g=new Promise(x=>{h=x});o.set(r,{resolveOutput:u,rejectOutput:m,resolveStatus:c,resolveError:h}),t.push({name:s,callId:r,input:l,output:d,status:f,error:g})}return{__native:!0,init:()=>({toolCalls:t}),process(r){if(!xo(r.params.namespace,e))return!0;if(r.method==="messages"){let s=r.params.data;if(s.event==="content-block-finish"){let a=s.contentBlock??s.content_block;a?.type==="tool_call"&&n(String(a.id??""),String(a.name??""),a.args??a.input)}}if(r.method==="tools"){let s=r.params.data,a=s.tool_call_id;s.event==="tool-started"&&n(a,s.tool_name??"unknown",s.input);let l=a?o.get(a):void 0;if(l){if(s.event==="tool-finished")l.resolveOutput(Eo(s.output)),l.resolveStatus("finished"),l.resolveError(void 0),o.delete(a);else if(s.event==="tool-error"){let u=s.message??"unknown error";if(So(u))return!0;l.rejectOutput(new Error(u)),l.resolveStatus("error"),l.resolveError(u),o.delete(a)}}}return!0},finalize(){for(let r of o.values())r.resolveStatus("finished"),r.resolveError(void 0),r.resolveOutput(void 0);o.clear(),t.close()},fail(r){for(let s of o.values())s.resolveStatus("error"),s.resolveError(r instanceof Error?r.message:String(r)),s.rejectOutput(r);o.clear(),t.fail(r)}}}}function X(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Se(e){return e.join("\0")}function Ut(e,t){if(t.length>e.length)return!1;for(let o=0;o<t.length;o+=1)if(e[o]!==t[o])return!1;return!0}function ge(e=[]){return()=>{let t=je.local(),o=new Map,n=new Map,r=new Map,s=new Map,a=e.length;function l(d,f){let g=Se(d);if(o.has(g))return;let x=(X(f)&&X(f.metadata)?f.metadata:void 0)?.lc_agent_name;o.set(g,typeof x=="string"?x:void 0)}function u(d){if(!X(d))return;let f=d.id;if(typeof f!="string")return;let g=d.input,x;if(X(g)&&X(g.tool_call)){let y=g.tool_call.id;typeof y=="string"&&(x=y)}else if(Array.isArray(g)){for(let y of g)if(X(y)&&typeof y.id=="string"){x=y.id;break}}x!=null&&n.set(f,x)}function m(d){let f=r.get(Se(d));if(typeof f=="string"&&f.length>0)return{type:"toolCall",tool_call_id:f};let g=d[d.length-1],x=g.indexOf(":");if(x===-1)return;let y=g.slice(x+1);if(y.length===0)return;let w=n.get(y);if(!(typeof w!="string"||w.length===0))return{type:"toolCall",tool_call_id:w}}function c(d){if(d.length!==a+1||!Ut(d,e))return;let f=Se(d);if(s.has(f))return;let g=o.get(f);if(typeof g!="string"||g.length===0)return;let x=Pt(d),y=x.init(),w=ae(d)(),O=w.init(),A=ge(d)(),N=A.init(),Y,j,b=new Promise((J,le)=>{Y=J,j=le});s.set(f,{key:f,path:d,name:g,messages:x,toolCall:w,nested:A,resolveOutput:Y,rejectOutput:j,latestValues:void 0,done:!1}),t.push({name:g,cause:m(d),output:b,messages:y.messages,toolCalls:O.toolCalls,subagents:N.subagents})}function h(d,f){d.done||(d.done=!0,f.type==="resolve"?d.resolveOutput(d.latestValues):d.rejectOutput(f.error),d.messages.finalize?.(),d.toolCall.finalize?.(),d.nested.finalize?.())}return{__native:!0,init:()=>({subagents:t}),process(d){let f=d.params.namespace,g=d.params.data,x=d.method==="tasks"&&X(g)&&"result"in g;d.method==="tools"&&X(g)&&g.event==="tool-started"&&typeof g.tool_call_id=="string"&&g.tool_call_id.length>0&&r.set(Se(f),g.tool_call_id),d.method==="tasks"&&!x&&(l(f,g),u(g),c(f));for(let y of s.values())if(!y.done&&Ut(f,y.path)&&(y.messages.process(d),y.toolCall.process(d),y.nested.process(d),Se(f)===y.key)){if(d.method==="values"&&X(g))y.latestValues=g;else if(d.method==="lifecycle"&&X(g)){let w=g.event;w==="completed"||w==="interrupted"?h(y,{type:"resolve"}):w==="failed"&&h(y,{type:"reject",error:new Error(`Subagent ${y.name} failed`)})}}return!0},finalize(){for(let d of s.values())h(d,{type:"resolve"});t.close()},fail(d){for(let f of s.values())h(f,{type:"reject",error:d});t.fail(d)}}}}var lt=Symbol.for("langgraph-zod");lt in globalThis||(globalThis[lt]=new WeakSet);function zt(e){let t=globalThis[lt];t.has(e)||(Object.defineProperty(e,"langgraph",{get(){let o=this;return{metadata(n){return De(o,{jsonSchemaExtra:n})},reducer(n,r){return De(o,{default:Pe(o),reducer:{schema:r,fn:n}})}}}}),t.add(e))}try{zt(i.ZodType.prototype),zt(U.ZodType.prototype)}catch(e){throw new Error("Failed to extend Zod with LangGraph-related methods. This is most likely a bug, consider opening an issue and/or using `withLangGraph` to augment your Zod schema.",{cause:e})}var Ft=class extends bt{constructor(e){super(),this.parent=e,this._map=this.parent._map}add(e,...t){let o=t[0];if(o&&!o?.default){let n=Pe(e);n!=null&&(o.default=n)}return super.add(e,...t)}},Ao=new Ft(ve);function Wt(e=!0,t,o=[]){let n={jumpTo:new at},r={},s={},a=l=>{if(W.isInstance(l)){for(let[m,c]of Object.entries(l.fields))if(!(m in n)){if(n[m]=c,m.startsWith("_"))continue;oe.isInstance(c)?(r[m]=c.inputSchema||c.valueSchema,s[m]=c.valueSchema):(r[m]=c,s[m]=c)}return}let u=ue(l);for(let[m,c]of Object.entries(u)){let h=m.startsWith("_");if(!(m in n)){if(Re(c)){let d=ve.get(c);if(d?.reducer){d.reducer.schema?(n[m]=new oe(c,{inputSchema:d.reducer.schema,reducer:d.reducer.fn}),h||(r[m]=d.reducer.schema,s[m]=c)):(n[m]=new oe(c,{reducer:d.reducer.fn}),h||(r[m]=c,s[m]=c));continue}}n[m]=c,h||(r[m]=c,s[m]=c)}}};t&&(W.isInstance(t)||F(t))&&a(t);for(let l of o)l.stateSchema&&(W.isInstance(l.stateSchema)||F(l.stateSchema))&&a(l.stateSchema);return e&&(s.structuredResponse=new at),{state:new W({messages:Le,...n}),input:new W({messages:Le,...r}),output:new W({messages:Le,...s})}}var ct=/<name>(.*?)<\/name>/s,dt=/<content>(.*?)<\/content>/s;function Io(e,t){if(W.isInstance(e)){let o={};for(let n of Object.keys(e.fields))n in t&&(o[n]=t[n]);return o}if(Te(e))return te(e,t);throw new Error(`Invalid state schema type: ${typeof e}`)}function Gt(e){if(!T.isInstance(e)||Xe.isInstance(e)||!e.name)return e;let{name:t}=e;if(typeof e.content=="string")return new T({...e.lc_kwargs,content:`<name>${t}</name><content>${e.content}</content>`,name:void 0});let o=[],n=0;for(let r of e.content)typeof r=="string"?(n+=1,o.push(`<name>${t}</name><content>${r}</content>`)):typeof r=="object"&&"type"in r&&r.type==="text"?(n+=1,o.push({...r,text:`<name>${t}</name><content>${r.text}</content>`})):o.push(r);return n||o.unshift({type:"text",text:`<name>${t}</name><content></content>`}),new T({...e.lc_kwargs,content:o,name:void 0})}function Jt(e){if(!T.isInstance(e)||!e.content)return e;let t=[],o;if(Array.isArray(e.content))t=e.content.filter(n=>{if(n.type==="text"&&typeof n.text=="string"){let r=n.text.match(ct),s=n.text.match(dt);return r&&(!s||s[1]==="")?(o=r[1],!1):!0}return!0}).map(n=>{if(n.type==="text"&&typeof n.text=="string"){let r=n.text.match(ct),s=n.text.match(dt);return!r||!s?n:(o=r[1],{...n,text:s[1]})}return n});else{let n=e.content,r=n.match(ct),s=n.match(dt);if(!r||!s)return e;o=r[1],t=s[1]}return new T({...Object.keys(e.lc_kwargs??{}).length>0?e.lc_kwargs:e,content:t,name:o})}function ie(e){return be.isRunnable(e)}function Ht(e){return Ce(e)?"bindTools"in e&&typeof e.bindTools=="function":!1}var ut=(e,t,o={})=>{if(Ht(e))return e.bindTools(t,o);if(Z.isRunnableBinding(e)&&Ht(e.bound)){let n=e.bound.bindTools(t,o);return Z.isRunnableBinding(n)?new Z({bound:n.bound,config:{...e.config,...n.config},kwargs:{...e.kwargs,...n.kwargs},configFactories:n.configFactories??e.configFactories}):new Z({bound:n,config:e.config,kwargs:e.kwargs,configFactories:e.configFactories})}return null};function Be(e){if(typeof e=="function")return;let t=e;if(me.isRunnableSequence(t)&&(t=t.steps.find(o=>Z.isRunnableBinding(o))||t),!fe(t)){if(Z.isRunnableBinding(t)){let o=t.kwargs!=null&&typeof t.kwargs=="object"&&"tools"in t.kwargs&&Array.isArray(t.kwargs.tools)&&t.kwargs.tools.length>0,n=t.config!=null&&typeof t.config=="object"&&"tools"in t.config&&Array.isArray(t.config.tools)&&t.config.tools.length>0;if(o||n)throw new _e}if("tools"in t&&t.tools!==void 0&&Array.isArray(t.tools)&&t.tools.length>0)throw new _e}}function we(e){return!!(T.isInstance(e)&&e.tool_calls&&e.tool_calls.length>0)}function Vt(e){if(e==null)return new z("");if(z.isInstance(e))return e;if(typeof e=="string")return new z({content:[{type:"text",text:e}]});throw new Error(`Invalid systemPrompt type: expected string or SystemMessage, got ${typeof e}`)}async function Kt(e,t,o={}){let n=ut(e,t,o);if(n)return n;if(fe(e)){let r=ut(await e._getModelInstance(),t,o);if(r)return r}if(me.isRunnableSequence(e)){let r=e.steps.findIndex(s=>Z.isRunnableBinding(s)||Ce(s)||fe(s));if(r>=0){let s=ut(e.steps[r],t,o);if(s){let a=e.steps.slice();return a.splice(r,1,s),me.from(a)}}}throw new Error(`llm ${e} must define bindTools method.`)}function Ro(e){if(e.length===0)return;if(e.length===1)return e[0];function t(n,r){return async(s,a)=>n(s,async u=>r(u,a))}let o=e[e.length-1];for(let n=e.length-2;n>=0;n--)o=t(e[n],o);return o}function Yt(e){let t=e.filter(o=>o.wrapToolCall);if(t.length!==0)return Ro(t.map(o=>{let n=o.wrapToolCall;return async(s,a)=>{let l=s.state,u=new Set,m=async c=>{let h={...l,...c.state};try{return await a({...c,state:h})}catch(d){throw u.add(d),d}};try{let c=await n({...s,state:{messages:l.messages,...o.stateSchema?Io(o.stateSchema,{...l}):{}}},m);if(!M.isInstance(c)&&!H(c))throw new Error(`Invalid response from "wrapToolCall" in middleware "${o.name}": expected ToolMessage or Command, got ${typeof c}`);return c}catch(c){throw u.has(c)?c:ne.wrap(c,o.name)}}}))}var Po=["tags","metadata","runName","maxConcurrency","recursionLimit","configurable"];function Zt(e){let t={};for(let o of Po){let n=e[o];n!==void 0&&(t[o]=n)}return t}async function Xt(e,t){let o={};for(let n of e){if(!n.stateSchema)continue;let r;if(W.isInstance(n.stateSchema)){let l={};for(let[u,m]of Object.entries(n.stateSchema.fields))oe.isInstance(m)?l[u]=m.inputSchema||m.valueSchema:l[u]=m;r=U.object(l)}else if(F(n.stateSchema))r=n.stateSchema;else continue;let s=await vt(St(r,l=>l.startsWith("_")),t);if(s.success){Object.assign(o,s.data);continue}let a=s.error.issues.filter(l=>l.code==="invalid_type").map(l=>` - ${l.path.join(".")}: Required`).join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as c}from"./ONQ6JSBJ.js";import{a as e}from"./
|
|
2
|
+
import{a as c}from"./ONQ6JSBJ.js";import{a as e}from"./RFPTOFM4.js";import{Ga as n}from"./FSLPYC4Y.js";export default $arcgis.t(([m])=>{async function r(t,a,o){let i={target:new m({longitude:t.longitude,latitude:t.latitude,spatialReference:{wkid:4326}})};return o?.zoom!==void 0&&(i.zoom=o.zoom),o?.scale!==void 0&&(i.scale=o.scale),await a.goTo(i),{text:`Successfully navigated to: ${[`(${t.latitude}\xB0, ${t.longitude}\xB0)`,o?.zoom!==void 0?`zoom ${o.zoom}`:"",o?.scale!==void 0?`scale 1:${o.scale}`:""].filter(Boolean).join(", ")}`}}async function s({center:t,zoom:a,scale:o},i){let{mapView:l}=c(i,["mapView"]);return await r(t,l,{zoom:a,scale:o})}var d=e.object({center:e.object({longitude:e.number().describe("The longitude (x-coordinate) of the point to navigate to."),latitude:e.number().describe("The latitude (y-coordinate) of the point to navigate to.")}),zoom:e.number().optional().describe("The zoom level. Higher values = more zoomed in."),scale:e.number().optional().describe("The map scale. Alternative to zoom. Smaller numbers = more zoomed in.")}),g=n(s,{name:"goToViewpoint",description:"Go to the specified viewpoint. This can contain a combination of scale, center, zoom, etc.",schema:d});return g},"geometry/Point")
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
var a=new Map([["clearFilters",async()=>(await import("./DBRBT54R.js")).clearFiltersTool],["resetMap",async()=>(await import("./EGSD465U.js")).resetMapTool],["setFeatureEffect",async()=>(await import("./M2G44RTS.js").then(m=>m.default.then(e=>({setFeatureEffectTool:e})))).setFeatureEffectTool],["listLayerFields",async()=>(await import("./USPB2QBX.js")).listLayerFieldsTool],["goToAddress",async()=>(await import("./SJ4UMNIS.js").then(m=>m.default.then(e=>({goToAddressTool:e})))).goToAddressTool],["goToBookmark",async()=>(await import("./NMFEXE4D.js")).goToBookmarkTool],["goToFeatures",async()=>(await import("./HLWG7OIR.js")).goToFeaturesTool],["goToFullExtent",async()=>(await import("./DJKEGIQZ.js").then(m=>m.default.then(e=>({goToFullExtentTool:e})))).goToFullExtentTool],["goToHomeExtent",async()=>(await import("./KKWCHNYQ.js")).goToHomeExtentTool],["goToLayer",async()=>(await import("./MC2V5WT3.js")).goToLayerTool],["goToScale",async()=>(await import("./V6EX4YCY.js")).goToScaleTool],["goToViewpoint",async()=>(await import("./MB7SEHPZ.js").then(m=>m.default.then(e=>({goToViewpointTool:e})))).goToViewpointTool],["goToZoom",async()=>(await import("./VA4M72JC.js")).goToZoomTool],["findRelevantFields",async()=>(await import("./SWXUQFB6.js").then(m=>m.default.then(e=>({findRelevantFieldsTool:e})))).findRelevantFieldsTool],["findRelevantLayers",async()=>(await import("./JFL5IWPK.js")).findRelevantLayersTool],["listSharedResources",async()=>(await import("./GBFRJF4F.js")).listSharedResourcesTool],["getAttribute",async()=>(await import("./RF6HWZMB.js").then(m=>m.default.then(e=>({getAttributeTool:e})))).getAttributeTool],["getStatistics",async()=>(await import("./VQ67NANV.js").then(m=>m.default.then(e=>({getStatisticsTool:e})))).getStatisticsTool],["getTopFeatures",async()=>(await import("./AWPLRVPS.js").then(m=>m.default.then(e=>({getTopFeaturesTool:e})))).getTopFeaturesTool],["queryFeatures",async()=>(await import("./MZFWD5CQ.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
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{S as r}from"./
|
|
2
|
+
import{S as r}from"./QEGO4B2W.js";var a=(e,t)=>t,d=(e,t)=>({...e,...t}),o=(e="",t)=>{let s=typeof t=="string"?t.trim():"";if(!s)return e;let u=e.trim();if(!u)return s;if(u===s)return e;let n=u.split(`
|
|
3
3
|
|
|
4
4
|
`);return n[n.length-1]?.trim()===s?e:`${e}
|
|
5
5
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import b from"./LCI5MEDN.js";import a from"./GVFJHADC.js";import{b as i}from"./FJV7CI7O.js";import{b as t}from"./WSIZ2OTL.js";import"./R74ZHFA6.js";import"./XWNZMKQF.js";import"./FSLPYC4Y.js";import"./AMP43OT2.js";import"./2UKFCF2J.js";import"./UZLQALHY.js";export default $arcgis.t(([r,{b:a}])=>{var p=async(o={})=>{let{tier:e="default",config:m}=o,n=t[e],c=await a(e);return new i({modelName:n,apiKey:"dummy-key",configuration:{baseURL:c,fetch:await r({config:m})},batchSize:2048,maxConcurrency:10})};return p},a,b)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{N as n}from"./AMP43OT2.js";function c(e){let r=new Set(e.required??[]),o=Object.fromEntries(Object.entries(e.properties).map(([t,i])=>{let a=s(i);return[t,r.has(t)?a:a.optional()]}));for(let t of r)Object.hasOwn(o,t)||(o[t]=n.unknown().refine(i=>i!==void 0));return n.object(o)}function s(e){let r;switch(e.type){case"array":r=n.array(e.items?s(e.items):n.unknown());break;case"boolean":r=n.boolean();break;case"number":r=n.number();break;case"object":r=c({properties:e.properties??{},required:e.required});break;case"string":if(e.enum!==void 0){if(e.enum.length===0)throw new Error("String schema field enum must include at least one value.");r=n.enum(e.enum)}else r=n.string();break}return e.description!==void 0?r.describe(e.description):r}export{c as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{b as p}from"./
|
|
2
|
+
import{b as p}from"./BMPBJXD7.js";function f(r,e,o){return{name:r,handler:async(a,t)=>{let n=async l=>{let u=await e.beforeAgent?.(l),w=u?{...l,state:{...l.state,...u}}:l,i=await t(w),d=await e.afterAgent?.({...w,result:i});return d?{...i,...d}:i};return e.wrapAgent?await e.wrapAgent(a,n):await n(a)},hooks:e,outputKey:o?.outputKey}}function M(r,e,o){return{name:r,handler:async(a,t)=>e.wrapToolCall?await e.wrapToolCall(a,t):await t(a),outputKey:o?.outputKey}}function y(r){return r.map(e=>s(e.name,e.hooks??{})).filter(e=>!!e)}function s(r,e){let{afterModel:o,beforeModel:a,wrapModelCall:t,wrapToolCall:n}=e;if(!(!o&&!a&&!t&&!n))return p({afterModel:o,beforeModel:a,name:r,wrapModelCall:t,wrapToolCall:n})}export{f as a,M as b,y as c};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as P}from"./
|
|
2
|
+
import{a as P}from"./C76HLPKU.js";import{a as f}from"./RFPTOFM4.js";import{a as u}from"./CADNOKIK.js";import{a as $,b as w,c as T}from"./BMPBJXD7.js";import{e as E}from"./CDS2HGQY.js";import{Ea as C,S as M,a as v,b,y as S}from"./QEGO4B2W.js";import{Ga as x}from"./FSLPYC4Y.js";import{N as d}from"./AMP43OT2.js";import{V as A}from"./2UKFCF2J.js";var m=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),K=["point","polyline","polygon","extent","custom"],Q=e=>typeof e=="string"&&K.some(a=>a===e),V=(e,a)=>{if(!(!m(e)||!("value"in e))){if(m(e.sharedStatePatch)){let o={...a.sharedStatePatch};for(let[t,r]of Object.entries(e.sharedStatePatch))m(r)&&"value"in r&&(o[t]={value:r.value});a.sharedStatePatch=o}if(Array.isArray(e.sharedResourceAdditions))for(let o of e.sharedResourceAdditions)m(o)&&Q(o.kind)&&typeof o.description=="string"&&"payload"in o&&a.sharedResourceAdditions.push({kind:o.kind,description:o.description,payload:o.payload})}},W=()=>{let e={sharedResourceAdditions:[]};return{middleware:w({name:"ToolArtifactMiddleware",afterAgent:a=>{if(delete e.sharedStatePatch,e.sharedResourceAdditions.length=0,!m(a))return;let o=a.messages;if(Array.isArray(o)){for(let t of o)if(A.isInstance(t)&&t.status!=="error"){let r=t.artifact;V(r,e)}}}}),collectedEffects:e}},X=async e=>{let{getLocaleFromConfig:a,getStrings:o}=await import("./RKURZ5T2.js"),t=await o({path:"./assets/agents/t9n",locale:a(e)});return w({name:"TraceMiddleware",wrapModelCall:async(r,s)=>{await u({text:t.determiningNextSteps},e);try{return await s(r)}catch(n){throw await u({text:t.failedCallingModel},e),n}},wrapToolCall:async(r,s)=>{await u({text:t.callingTool.replace("{toolName}",r.toolCall.name).replace("{toolArgs}",JSON.stringify(r.toolCall.args))},e);try{return await s(r)}catch(n){throw await u({text:t.failedExecutingTool.replace("{toolName}",r.toolCall.name)},e),n}}})},Y=(e,a)=>{let o=e.get(a);if(!o)throw new Error(`Skill not found: ${a}`);return o.instructions},Z=e=>{if(e.size===0)throw new Error("At least one skill is required.");let a=[...e.keys()];return x(({name:o})=>Y(e,o),{name:"load_skill",description:"Load the detailed instructions for an available skill.",schema:f.object({name:f.enum(a)})})},ee=e=>{let a=/^---\r?\nname: (?<name>[^\r\n]+)\r?\ndescription: (?<description>[^\r\n]+)\r?\n(?:allowed-tools: (?<allowedTools>[^\r\n]+)\r?\n)?---\r?\n(?<instructions>[\s\S]+)$/u.exec(e)?.groups;if(!a?.name||!/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(a.name)||a.name.length>64||!a.description||a.description.length>1024||!a.instructions)throw new Error("Invalid skill Markdown.");return{allowedTools:a.allowedTools?.split(/\s+/u)??[],name:a.name,description:a.description,instructions:a.instructions.trim()}},te=async e=>{let a=await Promise.all(e.map(async t=>ee(await t()))),o=new Map;for(let t of a){if(o.has(t.name))throw new Error(`Skill name must be unique: ${t.name}`);o.set(t.name,t)}return o},R="load_skill",q=e=>typeof e=="object"&&e!==null&&"name"in e&&typeof e.name=="string"?e.name:void 0,ae=(e,a)=>{let o=a;return w({name:"ActiveSkillMiddleware",wrapModelCall:async(t,r)=>{let s=new Set([R,...o?.allowedTools??[]]);return await r({...t,tools:t.tools.filter(n=>{let l=q(n);return l!==void 0&&s.has(l)})})},wrapToolCall:async(t,r)=>{let s=await r(t);if(t.toolCall.name===R){let n=q(t.toolCall.args),l=n?e.get(n):void 0;l&&(o=l)}return s}})},oe=async(e,a={})=>{let o=new Set([...e.values()].flatMap(t=>t.allowedTools));return await Promise.all([...o].map(async t=>{let r=a[t],s=r?await r():await P(t);if(s.name!==t)throw new Error(`Skill tool "${t}" resolved to "${s.name}".`);return s}))},re=async(e,a={})=>{let o=await te(e),t=[...o.values()];if(t.length===0)throw new Error("createSkillRuntime requires at least one skill.");let r=await oe(o,a),s=t.length===1?t[0]:void 0;return{activeSkillMiddleware:ae(o,s),skillsPrompt:s?`Active skill:
|
|
3
3
|
${s.name}
|
|
4
4
|
|
|
5
5
|
${s.instructions}`:`Available skills:
|
|
6
6
|
${t.map(n=>`- ${n.name}: ${n.description}`).join(`
|
|
7
7
|
`)}
|
|
8
8
|
|
|
9
|
-
Call load_skill before using a skill and follow its instructions. Only load_skill and the active skill's tools are available. Switch skills when another skill is needed to complete the task.`,tools:s?r:[Z(o),...r]}},N=M.Root({...E()}),se=d.object({agentExecutionContext:d.custom()}),j=d.object({outcome:d.enum(["completed","blocked"]).describe('Return "completed" when the assigned task is done, including valid empty results. Return "blocked" when required information, context, or state is unavailable and the task cannot proceed.'),outputMessage:d.string().trim().min(1).describe("A clear, concise user-facing response describing the result or blocker. Use Markdown when it improves readability."),summary:d.string().describe("A concise orchestration summary. For a blocker, identify the missing prerequisite and capability needed.")}),we=({id:e,name:a,description:o,systemPrompt:t,skillLoaders:r,toolLoaders:s,modelTier:n="default",runtimeContextLoader:l,instructions:L})=>{let F=async(h,c)=>{let{getLocaleFromConfig:O,getStrings:z}=await import("./
|
|
9
|
+
Call load_skill before using a skill and follow its instructions. Only load_skill and the active skill's tools are available. Switch skills when another skill is needed to complete the task.`,tools:s?r:[Z(o),...r]}},N=M.Root({...E()}),se=d.object({agentExecutionContext:d.custom()}),j=d.object({outcome:d.enum(["completed","blocked"]).describe('Return "completed" when the assigned task is done, including valid empty results. Return "blocked" when required information, context, or state is unavailable and the task cannot proceed.'),outputMessage:d.string().trim().min(1).describe("A clear, concise user-facing response describing the result or blocker. Use Markdown when it improves readability."),summary:d.string().describe("A concise orchestration summary. For a blocker, identify the missing prerequisite and capability needed.")}),we=({id:e,name:a,description:o,systemPrompt:t,skillLoaders:r,toolLoaders:s,modelTier:n="default",runtimeContextLoader:l,instructions:L})=>{let F=async(h,c)=>{let{getLocaleFromConfig:O,getStrings:z}=await import("./RKURZ5T2.js"),y=await z({path:"./assets/agents/t9n",locale:O(c)});await u({text:y.runningAgent.replace("{agentName}",a)},c);try{let{activeSkillMiddleware:i,skillsPrompt:g,tools:_}=await re(r,s),{collectedEffects:G,middleware:I}=W(),{assignedTask:J,priorSteps:D,userRequest:U}=h.agentExecutionContext,k=await l?.({config:c}),{createChatModel:B}=await import("./orchestrator/models/chatModel.js"),H=await T({model:await B({modelTier:n,config:c}),tools:_,stateSchema:se,responseFormat:$(j),middleware:[i,I,await X(c)],systemPrompt:`${t}
|
|
10
10
|
|
|
11
11
|
Primary task assigned by the orchestrator: ${J}
|
|
12
12
|
Prior agent steps to reuse when relevant: ${JSON.stringify(D)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
var a=async t=>{try{let{createEmbeddingModel:e}=await import("./
|
|
2
|
+
var a=async t=>{try{let{createEmbeddingModel:e}=await import("./CHHC6YNW.js").then(m=>m.default.then(e=>({createEmbeddingModel:e})));return await(await e()).embedDocuments(t)}catch(e){throw console.error("Failed to generate embeddings:",e),e}};export{a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{da as F,ea as be,ra as Pe,sa as ve,ta as Te}from"./
|
|
2
|
+
import{da as F,ea as be,ra as Pe,sa as ve,ta as Te}from"./FSLPYC4Y.js";import{Ba as H,J as G,R as ge,a as he,fa as de,ja as X,ra as ye,s as W,wa as we}from"./2UKFCF2J.js";var w=class extends F{lc_serializable=!0;lc_namespace=["langchain_core","prompts",this._getPromptType()];get lc_attributes(){return{partialVariables:void 0}}inputVariables;outputParser;partialVariables;metadata;tags;constructor(s){super(s);let{inputVariables:e}=s;if(e.includes("stop"))throw new Error("Cannot have an input variable named 'stop', as it is used internally, please rename.");Object.assign(this,s)}async mergePartialAndUserVariables(s){let e=this.partialVariables??{},t={};for(let[r,a]of Object.entries(e))typeof a=="string"?t[r]=a:t[r]=await a();return{...t,...s}}async invoke(s,e){let t={...this.metadata,...e?.metadata},r=[...this.tags??[],...e?.tags??[]];return this._callWithConfig(a=>this.formatPromptValue(a),s,{...e,tags:r,metadata:t,runType:"prompt"})}};var v=class extends w{async formatPromptValue(s){return new Pe(await this.format(s))}};var Oe=Object.prototype.toString,C=Array.isArray||function(e){return Oe.call(e)==="[object Array]"};function Z(s){return typeof s=="function"}function ke(s){return C(s)?"array":typeof s}function Y(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function xe(s,e){return s!=null&&typeof s=="object"&&e in s}function Be(s,e){return s!=null&&typeof s!="object"&&s.hasOwnProperty&&s.hasOwnProperty(e)}var Ue=RegExp.prototype.test;function Ne(s,e){return Ue.call(s,e)}var De=/\S/;function $e(s){return!Ne(De,s)}var ze={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function We(s){return String(s).replace(/[&<>"'`=\/]/g,function(t){return ze[t]})}var Ge=/\s*/,He=/\s+/,_e=/\s*=/,qe=/\s*\}/,Le=/#|\^|\/|>|\{|&|=|!/;function Je(s,e){if(!s)return[];var t=!1,r=[],a=[],i=[],n=!1,o=!1,l="",p=0;function f(){if(n&&!o)for(;i.length;)delete a[i.pop()];else i=[];n=!1,o=!1}var b,_,ue;function fe(P){if(typeof P=="string"&&(P=P.split(He,2)),!C(P)||P.length!==2)throw new Error("Invalid tags: "+P);b=new RegExp(Y(P[0])+"\\s*"),_=new RegExp("\\s*"+Y(P[1])),ue=new RegExp("\\s*"+Y("}"+P[1]))}fe(e||d.tags);for(var m=new k(s),x,h,g,R,z,V;!m.eos();){if(x=m.pos,g=m.scanUntil(b),g)for(var Q=0,Re=g.length;Q<Re;++Q)R=g.charAt(Q),$e(R)?(i.push(a.length),l+=R):(o=!0,t=!0,l+=" "),a.push(["text",R,x,x+1]),x+=1,R===`
|
|
3
3
|
`&&(f(),l="",p=0,t=!1);if(!m.scan(b))break;if(n=!0,h=m.scan(Le)||"name",m.scan(Ge),h==="="?(g=m.scanUntil(_e),m.scan(_e),m.scanUntil(_)):h==="{"?(g=m.scanUntil(ue),m.scan(qe),m.scanUntil(_),h="&"):g=m.scanUntil(_),!m.scan(_))throw new Error("Unclosed tag at "+m.pos);if(h==">"?z=[h,g,x,m.pos,l,p,t]:z=[h,g,x,m.pos],p++,a.push(z),h==="#"||h==="^")r.push(z);else if(h==="/"){if(V=r.pop(),!V)throw new Error('Unopened section "'+g+'" at '+x);if(V[1]!==g)throw new Error('Unclosed section "'+V[1]+'" at '+x)}else h==="name"||h==="{"||h==="&"?o=!0:h==="="&&fe(g)}if(f(),V=r.pop(),V)throw new Error('Unclosed section "'+V[1]+'" at '+m.pos);return Qe(Ke(a))}function Ke(s){for(var e=[],t,r,a=0,i=s.length;a<i;++a)t=s[a],t&&(t[0]==="text"&&r&&r[0]==="text"?(r[1]+=t[1],r[3]=t[3]):(e.push(t),r=t));return e}function Qe(s){for(var e=[],t=e,r=[],a,i,n=0,o=s.length;n<o;++n)switch(a=s[n],a[0]){case"#":case"^":t.push(a),r.push(a),t=a[4]=[];break;case"/":i=r.pop(),i[5]=a[2],t=r.length>0?r[r.length-1][4]:e;break;default:t.push(a)}return e}function k(s){this.string=s,this.tail=s,this.pos=0}k.prototype.eos=function(){return this.tail===""};k.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var r=t[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r};k.prototype.scanUntil=function(e){var t=this.tail.search(e),r;switch(t){case-1:r=this.tail,this.tail="";break;case 0:r="";break;default:r=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=r.length,r};function E(s,e){this.view=s,this.cache={".":this.view},this.parent=e}E.prototype.push=function(e){return new E(e,this)};E.prototype.lookup=function(e){var t=this.cache,r;if(t.hasOwnProperty(e))r=t[e];else{for(var a=this,i,n,o,l=!1;a;){if(e.indexOf(".")>0)for(i=a.view,n=e.split("."),o=0;i!=null&&o<n.length;)o===n.length-1&&(l=xe(i,n[o])||Be(i,n[o])),i=i[n[o++]];else i=a.view[e],l=xe(a.view,e);if(l){r=i;break}a=a.parent}t[e]=r}return Z(r)&&(r=r.call(this.view)),r};function u(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}u.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};u.prototype.parse=function(e,t){var r=this.templateCache,a=e+":"+(t||d.tags).join(":"),i=typeof r<"u",n=i?r.get(a):void 0;return n==null&&(n=Je(e,t),i&&r.set(a,n)),n};u.prototype.render=function(e,t,r,a){var i=this.getConfigTags(a),n=this.parse(e,i),o=t instanceof E?t:new E(t,void 0);return this.renderTokens(n,o,r,e,a)};u.prototype.renderTokens=function(e,t,r,a,i){for(var n="",o,l,p,f=0,b=e.length;f<b;++f)p=void 0,o=e[f],l=o[0],l==="#"?p=this.renderSection(o,t,r,a,i):l==="^"?p=this.renderInverted(o,t,r,a,i):l===">"?p=this.renderPartial(o,t,r,i):l==="&"?p=this.unescapedValue(o,t):l==="name"?p=this.escapedValue(o,t,i):l==="text"&&(p=this.rawValue(o)),p!==void 0&&(n+=p);return n};u.prototype.renderSection=function(e,t,r,a,i){var n=this,o="",l=t.lookup(e[1]);function p(_){return n.render(_,t,r,i)}if(l){if(C(l))for(var f=0,b=l.length;f<b;++f)o+=this.renderTokens(e[4],t.push(l[f]),r,a,i);else if(typeof l=="object"||typeof l=="string"||typeof l=="number")o+=this.renderTokens(e[4],t.push(l),r,a,i);else if(Z(l)){if(typeof a!="string")throw new Error("Cannot use higher-order sections without the original template");l=l.call(t.view,a.slice(e[3],e[5]),p),l!=null&&(o+=l)}else o+=this.renderTokens(e[4],t,r,a,i);return o}};u.prototype.renderInverted=function(e,t,r,a,i){var n=t.lookup(e[1]);if(!n||C(n)&&n.length===0)return this.renderTokens(e[4],t,r,a,i)};u.prototype.indentPartial=function(e,t,r){for(var a=t.replace(/[^ \t]/g,""),i=e.split(`
|
|
4
4
|
`),n=0;n<i.length;n++)i[n].length&&(n>0||!r)&&(i[n]=a+i[n]);return i.join(`
|
|
5
5
|
`)};u.prototype.renderPartial=function(e,t,r,a){if(r){var i=this.getConfigTags(a),n=Z(r)?r(e[1]):r[e[1]];if(n!=null){var o=e[6],l=e[5],p=e[4],f=n;l==0&&p&&(f=this.indentPartial(n,p,o));var b=this.parse(f,i);return this.renderTokens(b,t,r,f,a)}}};u.prototype.unescapedValue=function(e,t){var r=t.lookup(e[1]);if(r!=null)return r};u.prototype.escapedValue=function(e,t,r){var a=this.getConfigEscape(r)||d.escape,i=t.lookup(e[1]);if(i!=null)return typeof i=="number"&&a===d.escape?String(i):a(i)};u.prototype.rawValue=function(e){return e[1]};u.prototype.getConfigTags=function(e){return C(e)?e:e&&typeof e=="object"?e.tags:void 0};u.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!C(e))return e.escape};var d={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(s){O.templateCache=s},get templateCache(){return O.templateCache}},O=new u;d.clearCache=function(){return O.clearCache()};d.parse=function(e,t){return O.parse(e,t)};d.render=function(e,t,r,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+ke(e)+'" was given as the first argument for mustache#render(template, view, partials)');return O.render(e,t,r,a)};d.escape=We;d.Scanner=k;d.Context=E;d.Writer=u;var ee=d;var Xe={escape:s=>s},M=s=>{let e=s.split(""),t=[],r=(i,n)=>{for(let o=n;o<e.length;o+=1)if(i.includes(e[o]))return o;return-1},a=0;for(;a<e.length;)if(e[a]==="{"&&a+1<e.length&&e[a+1]==="{")t.push({type:"literal",text:"{"}),a+=2;else if(e[a]==="}"&&a+1<e.length&&e[a+1]==="}")t.push({type:"literal",text:"}"}),a+=2;else if(e[a]==="{"){let i=r("}",a);if(i<0)throw new Error("Unclosed '{' in template.");t.push({type:"variable",name:e.slice(a+1,i).join("")}),a=i+1}else{if(e[a]==="}")throw new Error("Single '}' in template.");{let i=r("{}",a),n=(i<0?e.slice(a):e.slice(a,i)).join("");t.push({type:"literal",text:n}),a=i<0?e.length:i}}return t},Ve=(s,e=[])=>{let t=[];for(let r of s)if(r[0]==="name"){let a=r[1].includes(".")?r[1].split(".")[0]:r[1];t.push({type:"variable",name:a})}else if(["#","&","^",">"].includes(r[0])){if(t.push({type:"variable",name:r[1]}),r[0]==="#"&&r.length>4&&Array.isArray(r[4])){let a=[...e,r[1]],i=Ve(r[4],a);t.push(...i)}}else t.push({type:"literal",text:r[1]});return t},I=s=>{let e=ee.parse(s);return Ve(e)},te=(s,e)=>M(s).reduce((t,r)=>{if(r.type==="variable"){if(r.name in e)return t+(typeof e[r.name]=="string"?e[r.name]:JSON.stringify(e[r.name]));throw new Error(`(f-string) Missing value for input ${r.name}`)}return t+r.text},""),re=(s,e)=>ee.render(s,e,void 0,Xe),B={"f-string":te,mustache:re},ae={"f-string":M,mustache:I},c=(s,e,t)=>{try{return B[e](s,t)}catch(r){throw W(r,"INVALID_PROMPT_INPUT")}},S=(s,e)=>ae[e](s),T=(s,e,t)=>{if(!(e in B)){let r=Object.keys(B);throw new Error(`Invalid template format. Got \`${e}\`;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{f as z,g as I}from"./GEFFWUB2.js";import{
|
|
2
|
+
import{f as z,g as I}from"./GEFFWUB2.js";import{A as R,C as S,g as $,h as r,j as x,s as M,t as k,u as A,x as L,z as b}from"./RE7MJTEF.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";var D=M(class extends k{constructor(){super(...arguments),this.key=x}render(c,e){return this.key=c,e}update(c,[e,t]){return e!==this.key&&(A(c),this.key=e),t}});var j=$`:host{display:block;min-width:0}.details{padding:var(--calcite-spacing-md)}.details>*+*{margin-block-start:var(--calcite-spacing-lg)}h3{margin:0 0 var(--calcite-spacing-sm);font-size:var(--calcite-font-size-relative-base);font-weight:var(--calcite-font-weight-semibold)}.metadata calcite-table-header,.detail-value{overflow-wrap:anywhere}calcite-table{font-variant-numeric:tabular-nums}.waterfall{font-size:var(--calcite-font-size-relative-xs);font-variant-numeric:tabular-nums}.waterfall-row{padding-block:var(--calcite-spacing-xxs)}.ticks{display:flex;align-items:center;justify-content:space-between;gap:var(--calcite-spacing-xs)}.waterfall-steps{margin:0;padding:0;list-style:none}.track{position:relative;height:24px;overflow:hidden}.bar{position:absolute;inset-block:0;min-width:2px;background-color:var(--calcite-color-brand);opacity:.3}.bar-label,.unrecorded{display:block;padding-inline:var(--calcite-spacing-xxs);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;line-height:24px}.bar-label{position:absolute;inset-block:0;left:min(var(--step-offset),max(0px,calc(100% - 16rem)));right:0}.empty{display:grid;min-height:5rem;place-items:center;color:var(--calcite-color-text-3);font-size:var(--calcite-font-size-relative-sm)}`;function C(c,e){let t=new Map;for(let i of e)if(i.parentId){let d=t.get(i.parentId)??[];d.push(i),t.set(i.parentId,d)}let s=new Set([c.id]),l=[c.id],o=[];for(;l.length;)for(let i of t.get(l.pop())??[])s.has(i.id)||(s.add(i.id),l.push(i.id),I(i)&&o.push(i));return o.sort((i,d)=>i.startedAt-d.startedAt)}var f=class extends L{static{this.properties={run:0,span:0}}static{this.styles=j}render(){let e=this.span,t=e?void 0:this.run,s=e??t;if(!s)return null;let l=a=>a===void 0?"Unavailable":z({...s,durationMs:a}),o=this.run?.spans??[],i=!e||e.timingRecorded,d=e?C(e,o):[],v=i?t?t.latency.steps:d.map(a=>({spanId:a.id,offsetMs:Math.max(0,a.startedAt-s.startedAt),durationMs:a.timingRecorded?a.durationMs:void 0,timingRecorded:a.timingRecorded})):[],m=i?t?t.latency.timelineMs:e?.durationMs??Math.max(0,...o.map(a=>(a.endedAt??a.startedAt)-s.startedAt)):0,u=Math.max(1,m),N=t?[{label:"Run elapsed",value:l(t.latency.elapsedMs)},{label:"Recorded interrupt wait",value:l(t.latency.interruptWaitMs)},{label:"Elapsed excluding interrupts",value:l(t.latency.elapsedExcludingInterruptsMs)}]:[{label:"Status",value:s.status},{label:"Started",value:e?.timingRecorded?new Date(s.startedAt).toLocaleString():"Not recorded"},{label:"Ended",value:s.endedAt!==void 0?new Date(s.endedAt).toLocaleString():"Not recorded"},{label:"Duration",value:e?.timingRecorded?l(s.durationMs):"Not recorded"}];return r`<div class="details"><section aria-label="Latency details"><h3>Latency</h3><calcite-table class="metadata" caption="Latency metadata" aria-label="Latency metadata" scale=s layout=fixed interaction-mode=static bordered><calcite-table-row slot=table-header><calcite-table-header heading=Field></calcite-table-header><calcite-table-header heading=Value col-span=2></calcite-table-header></calcite-table-row>${N.map(a=>r`<calcite-table-row><calcite-table-header .heading=${a.label}></calcite-table-header><calcite-table-cell col-span=2><span class="detail-value">${a.value}</span></calcite-table-cell></calcite-table-row>`)}</calcite-table></section>${t||d.length?r`<section class="waterfall" aria-label="Latency waterfall"><h3>Step timing</h3>${i?r`<div class="waterfall-row" aria-hidden=true><div class="ticks"><span>0 ms</span><span>${l(m/2)}</span><span>${l(m)}</span></div></div>${v.length?r`<ol class="waterfall-steps">${v.map(a=>{let n=o.find(V=>V.id===a.spanId),h=a.timingRecorded,p=a.offsetMs,g=a.durationMs??Math.max(0,m-p),y=h?l(g):"Not recorded",w=`${n.label} (${y}${n.status==="completed"?"":`, ${n.status}`})`,E=`${n.label} | ${n.type}${n.metadata?.model?` | ${n.metadata.model}`:""} | ${n.status} | ${y}${h?` | Start: ${l(p)}`:""}`;return D(n.id,r`<li class="waterfall-row" aria-label=${E??R}><div class="track" style=${b({"--step-offset":`${p/u*100}%`})}>${h?r`<span class="bar" aria-hidden=true style=${b({left:`${p/u*100}%`,width:`${Math.min(g,Math.max(0,u-p))/u*100}%`})}></span><span class="bar-label">${w}</span>`:r`<span class="unrecorded">${w}</span>`}</div></li>`)})}</ol>`:r`<div class="empty">No steps recorded.</div>`}`:r`<div class="empty">Timing not recorded.</div>`}</section>`:null}</div>`}};S("arcgis-assistant-observation-latency",f);export{f as ArcgisAssistantObservationLatency};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{C as r,g as t,h as e,v as i,w as a,x as n}from"./RE7MJTEF.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";export default $arcgis.t(([l,{when:o,watch:c}])=>{var h=t`.messages-container{display:flex;flex:1;flex-direction:column;line-height:var(--calcite-font-line-height-relative-snug)}.messages-list{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;gap:var(--calcite-spacing-xxl);flex:1 1 auto;min-height:0;justify-content:flex-end;overflow:auto}.end-ref{margin-top:var(--calcite-spacing-lg)}`,s=class extends n{constructor(){super(...arguments),this.#t=i(),this.#s=!1,this.loading=!1,this.messages=new l([]),this.interrupt=null}static{this.properties={loading:5,messages:0,interrupt:0}}static{this.styles=h}#t;#s;firstUpdated(){this.#e()}loaded(){this.manager.onLifecycle(()=>[this.messages.on("change",()=>{this.#e()}),o(()=>!this.loading,()=>{this.#s=!1}),c(()=>[this.loading,this.interrupt],()=>this.#e())])}#e(){requestAnimationFrame(()=>{this.#s||this.#t.value?.scrollIntoView({behavior:"smooth",block:"end"})})}#i(){this.#s=!0}render(){return e`<div class="messages-container" @wheel=${this.#i}><div class="messages-list"><slot name=message-starter></slot><slot name=messages></slot><slot name=message-loading></slot></div><div class="end-ref" ${a(this.#t)}></div></div>`}};r("arcgis-assistant-chat",s);return s},"core/Collection","core/reactiveUtils")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{c as a}from"./
|
|
2
|
+
import{c as a}from"./A22375P3.js";import{D as s}from"./RE7MJTEF.js";var r=/^\.\/assets\/[^/]+\/t9n$/u,h=e=>{let t=e?.configurable;if(t&&typeof t=="object"&&"locale"in t){let o=t.locale;if(typeof o=="string")return o}return"en"};async function d(e){if(!r.test(e.path))throw new Error(`Invalid localization asset path: ${e.path}`);return await a(e.locale,s(e.path),"messages.")}export{h as a,d as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{B as fi,G as Ma,I as qc,L as Hc,d as zc,k as Lc,n as pi,o as Na,p as Tn,r as ja,s as Uc,t as Bc,x as Fc,z as Kc}from"./
|
|
2
|
+
import{B as fi,G as Ma,I as qc,L as Hc,d as zc,k as Lc,n as pi,o as Na,p as Tn,r as ja,s as Uc,t as Bc,x as Fc,z as Kc}from"./XWNZMKQF.js";import{$ as En,Ca as di,E as Mc,W as F,ja as Dc,o as ss,s as $a,t as Nc,u as jc,w as is,xa as li}from"./FSLPYC4Y.js";import{N as E,d as Tc,j as Cc,n as $c,p as Wc}from"./AMP43OT2.js";import{Aa as Ec,D as Ea,E as Ta,F as ai,V as ui,W as Pc,fa as dt,ga as Sc,ia as Rn,ja as ci,ka as vc,oa as kc,p as Oc,q as Ne,sa as Rc,t as Rr,w as xc,x as ii,xa as Ca}from"./2UKFCF2J.js";import{a as um,b as cm,c as lm}from"./UZLQALHY.js";var Wl=um((G,Si)=>{"use strict";if(typeof Si<"u"&&Si!==globalThis.module&&typeof G<"u"&&Si.exports===G){Object.defineProperty(G,"__esModule",{value:!0}),G.findX509Credential=G.rememberX509Credential=G.findX509OAuthError=G.rememberX509OAuthError=G.isApprovedX509Client=G.markApprovedX509Client=G.isRetryableX509IssuerError=G.markRetryableX509IssuerError=G.isTransientX509ConnectionError=G.markTransientX509ConnectionError=G.rememberRegisteredX509Transport=G.findRegisteredX509Transport=void 0;let t=new WeakMap,e=new WeakSet,r=new WeakSet,n=new WeakSet,o=new WeakMap,s=new WeakMap;G.findRegisteredX509Transport=WeakMap.prototype.get.bind(t),G.rememberRegisteredX509Transport=WeakMap.prototype.set.bind(t),G.markTransientX509ConnectionError=WeakSet.prototype.add.bind(e),G.isTransientX509ConnectionError=WeakSet.prototype.has.bind(e),G.markRetryableX509IssuerError=WeakSet.prototype.add.bind(r),G.isRetryableX509IssuerError=WeakSet.prototype.has.bind(r),G.markApprovedX509Client=WeakSet.prototype.add.bind(n),G.isApprovedX509Client=WeakSet.prototype.has.bind(n),G.rememberX509OAuthError=WeakMap.prototype.set.bind(o),G.findX509OAuthError=WeakMap.prototype.get.bind(o),G.rememberX509Credential=WeakMap.prototype.set.bind(s),G.findX509Credential=WeakMap.prototype.get.bind(s)}});function Xc(t,e){let r;return di(t)?r=qc(t):r=t,e?.strict!==void 0&&(r.function.strict=e.strict),r}function pm(t){return t.anyOf!==void 0&&Array.isArray(t.anyOf)}function Zc(t){let e=["namespace functions {",""];for(let r of t)r.description&&e.push(`// ${r.description}`),Object.keys(r.parameters.properties??{}).length>0?(e.push(`type ${r.name} = (_: {`),e.push(Jc(r.parameters,0)),e.push("}) => any;")):e.push(`type ${r.name} = () => any;`),e.push("");return e.push("} // namespace functions"),e.join(`
|
|
3
3
|
`)}function Jc(t,e){let r=[];for(let[n,o]of Object.entries(t.properties??{}))o.description&&e<2&&r.push(`// ${o.description}`),t.required?.includes(n)?r.push(`${n}: ${mi(o,e)},`):r.push(`${n}?: ${mi(o,e)},`);return r.map(n=>" ".repeat(e)+n).join(`
|
|
4
4
|
`)}function mi(t,e){if(pm(t))return t.anyOf.map(r=>mi(r,e)).join(" | ");switch(t.type){case"string":return t.enum?t.enum.map(r=>`"${r}"`).join(" | "):"string";case"number":return t.enum?t.enum.map(r=>`${r}`).join(" | "):"number";case"integer":return t.enum?t.enum.map(r=>`${r}`).join(" | "):"number";case"boolean":return"boolean";case"null":return"null";case"object":return["{",Jc(t,e+2),"}"].join(`
|
|
5
5
|
`);case"array":return t.items?`${mi(t.items,e)}[]`:"any[]";default:return""}}function hi(t){if(t)return t==="any"||t==="required"?"required":t==="auto"?"auto":t==="none"?"none":typeof t=="string"?{type:"function",function:{name:t}}:t}function Cn(t){return"type"in t&&t.type!=="function"}function Vc(t){return typeof t=="object"&&t!==null&&"extras"in t&&typeof t.extras=="object"&&t.extras!==null&&"providerToolDefinition"in t.extras&&typeof t.extras.providerToolDefinition=="object"&&t.extras.providerToolDefinition!==null}function Gc(t){return t!=null&&typeof t=="object"&&"type"in t&&t.type!=="function"}function Er(t){return typeof t=="object"&&t!==null&&"metadata"in t&&typeof t.metadata=="object"&&t.metadata!==null&&"customTool"in t.metadata&&typeof t.metadata.customTool=="object"&&t.metadata.customTool!==null}function _i(t){return"type"in t&&t.type==="custom"&&"custom"in t&&typeof t.custom=="object"&&t.custom!==null}function Yc(t){if(t.type==="custom_tool_call")return{...t,type:"tool_call",call_id:t.id,id:t.call_id,name:t.name,isCustomTool:!0,args:{input:t.input}}}function Qc(t){if(t.type==="computer_call")return{...t,type:"tool_call",call_id:t.id,id:t.call_id,name:"computer_use",isComputerTool:!0,args:{action:t.action}}}function el(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="tool_call"&&"isComputerTool"in t&&t.isComputerTool===!0}function tl(t,e){return typeof t!="object"||t===null||!("type"in t)||t.type!=="tool_call"?!1:!!("isCustomTool"in t&&t.isCustomTool===!0||e&&"id"in t&&typeof t.id=="string"&&t.id in e)}function rl(t){let e=()=>{if(t.custom.format){if(t.custom.format.type==="grammar")return{type:"grammar",definition:t.custom.format.grammar.definition,syntax:t.custom.format.grammar.syntax};if(t.custom.format.type==="text")return{type:"text"}}};return{type:"custom",name:t.custom.name,description:t.custom.description,format:e()}}function nl(t){let e=()=>{if(t.format){if(t.format.type==="grammar")return{type:"grammar",grammar:{definition:t.format.definition,syntax:t.format.syntax}};if(t.format.type==="text")return{type:"text"}}};return{type:"custom",custom:{name:t.name,description:t.description,format:e()}}}var et=t=>t();function Ot(t){return t?!!(/^o\d/.test(t??"")||t.startsWith("gpt-5")&&!t.startsWith("gpt-5-chat")):!1}function fm(t){return t.role!=="system"&&t.role!=="developer"&&t.role!=="assistant"&&t.role!=="user"&&t.role!=="function"&&t.role!=="tool"&&console.warn(`Unknown message role: ${t.role}`),t.role}function yi(t){return t.metadata?.filename??t.metadata?.name??t.metadata?.title}var dm="LC_AUTOGENERATED";function Tr(t){let e=t.metadata?.filename??t.metadata?.name??t.metadata?.title;return e||(console.warn("OpenAI may require a filename for file uploads. Specify a filename in the content block metadata, e.g.: { type: 'file', mimeType: '...', data: '...', metadata: { filename: 'my-file.pdf' } }. Using placeholder filename 'LC_AUTOGENERATED'."),dm)}function xt(t){let e=t._getType();switch(e){case"system":return"system";case"ai":return"assistant";case"human":return"user";case"function":return"function";case"tool":return"tool";case"generic":if(!ci.isInstance(t))throw new Error("Invalid generic chat message");return fm(t);default:throw new Error(`Unknown message type: ${e}`)}}function ol(t){return!!(t.includes("gpt-5.2-pro")||t.includes("gpt-5.4-pro")||t.includes("gpt-5.5-pro")||t.includes("codex"))}function as(t,e){return t.lc_error_code=e,t.message=`${t.message}
|