@arcgis/ai-components 5.2.0-next.16 → 5.2.0-next.17
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/cdn/{FUIGPHBH.js → 3S7PBYVD.js} +1 -1
- package/dist/cdn/{P7DG5T3Z.js → 4RZPOYZ7.js} +1 -1
- package/dist/cdn/{7PANDHIL.js → 5VXRVWAX.js} +1 -1
- package/dist/cdn/{22IT5TDB.js → 6EVF6NFG.js} +1 -1
- package/dist/cdn/{BX7FSMUU.js → 6LZ6GOHF.js} +1 -1
- package/dist/cdn/{GBYLKQIL.js → C4KITTT5.js} +1 -1
- package/dist/cdn/{DHKUXLU3.js → CJIV4KJZ.js} +1 -1
- package/dist/cdn/{JIWK6QK6.js → DECSD3LN.js} +1 -1
- package/dist/cdn/{Q6LRANX6.js → FZIT3DLD.js} +1 -1
- package/dist/cdn/{4UDYY3HL.js → HOCTVCHH.js} +1 -1
- package/dist/cdn/{7CYGX4F4.js → JEIMRNYM.js} +1 -1
- package/dist/cdn/{I2Y67HBL.js → KIQUEMI4.js} +1 -1
- package/dist/cdn/{K3JCH4XW.js → LBSOW7OW.js} +1 -1
- package/dist/cdn/{XOH56EQ2.js → LODKJRS4.js} +1 -1
- package/dist/cdn/{3JGWGKT6.js → LQSZTK26.js} +1 -1
- package/dist/cdn/{S75VFYR4.js → NRMBMWI5.js} +1 -1
- package/dist/cdn/{L4XF4H6V.js → NTGC53UD.js} +1 -1
- package/dist/cdn/{O3RFFPU3.js → OLJC5BM3.js} +1 -1
- package/dist/cdn/{QYR3NSF2.js → QZVAGRWA.js} +1 -1
- package/dist/cdn/{3VOQD2MR.js → RHF452M7.js} +1 -1
- package/dist/cdn/{XU6NCSE2.js → TR3OKQPQ.js} +1 -1
- package/dist/cdn/{IR7PTESF.js → VKR2CBLM.js} +1 -1
- package/dist/cdn/{IOD3GDA7.js → VKU4WAQV.js} +1 -1
- package/dist/cdn/{TR4GFL7X.js → VV57ZUOI.js} +1 -1
- package/dist/cdn/{X4XY5HIE.js → W5DLXSAP.js} +1 -1
- package/dist/cdn/{JG2BIENI.js → WIJRNMBG.js} +1 -1
- package/dist/cdn/{DQSEBKOX.js → X4UZCTIG.js} +1 -1
- package/dist/cdn/{DXVU45KM.js → XVQJBUMY.js} +1 -1
- package/dist/cdn/agent-utils/index.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/index.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/package.json +4 -4
- /package/dist/cdn/{CHPQM77M.js → IKEF7ZHH.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{_ as h,a as E,b as y,ta as k}from"./
|
|
2
|
+
import{_ as h,a as E,b as y,ta as k}from"./CJIV4KJZ.js";var j=new Set(["agentExecutionContext","outputMessage","summary","status"]);function x(){return{assignedTask:"",messages:[],priorSteps:[],sharedState:{},userRequest:""}}function O(r){let o=[...new Set([...r].filter(n=>j.has(n)))];if(o.length!==0)throw new Error(`ADK custom state cannot define reserved runtime fields: ${o.join(", ")}.`)}function S(r){let o=Object.entries(r);return Object.fromEntries(o.map(([n,t])=>[n,h({reducer:(i,g)=>g,default:()=>t})]))}function $(r={}){O(Object.keys(r));let o=S(r);return h.Root({...o,agentExecutionContext:h({reducer:(n,t)=>({...n,...t}),default:x}),outputMessage:h({reducer:(n="",t)=>typeof t=="string"&&t.trim()?t:n,default:()=>""}),summary:h({reducer:(n="",t)=>typeof t=="string"?t:n,default:()=>""}),status:h({reducer:(n,t)=>t??n,default:()=>{}})})}function M(r){let o=new Set;for(let t of r)for(let i of Object.keys(t.shape??{}))o.add(i);let n=Object.fromEntries([...o].map(t=>[t,void 0]));return $(n)}function C(r,o,n,t={}){let{agent:i,entryNode:g,middlewares:c=[]}=t,a=new k(n);if(Object.keys(r).length===0)throw new Error("Graph requires at least one node.");if(o.length===0)throw new Error("Graph requires at least one edge.");if(c.length>0&&!i)throw new Error("Graph middleware requires agent metadata.");let s=new Set(Object.keys(r)),l=new Map,w=new Map;for(let e of s)l.set(e,0),w.set(e,0);for(let e of o)"to"in e?(s.has(e.from)&&w.set(e.from,(w.get(e.from)??0)+1),s.has(e.to)&&l.set(e.to,(l.get(e.to)??0)+1)):s.has(e.from)&&w.set(e.from,(w.get(e.from)??0)+1);for(let[e,f]of Object.entries(r)){let u=N(i,e,c,async(d,p)=>await Promise.resolve(f(d,p))),m=async(d,p)=>await u(d,p);a=a.addNode(e,m)}for(let e of o)if("to"in e){let f=e.from,u=e.to;if(!s.has(f))throw new Error(`Graph edge references unknown from-node: ${f}`);if(!s.has(u))throw new Error(`Graph edge references unknown to-node: ${u}`);a.addEdge(f,u)}else{let f=e.from;if(!s.has(f))throw new Error(`Graph conditional edge references unknown from-node: ${f}`);a.addConditionalEdges(f,async(u,m)=>{let d=await e.decide(u,m);if(!d)return y;if(!s.has(d))throw new Error(`Graph conditional edge returned unknown node: ${d}`);return d})}let G=q(s,l,g);a.addEdge(E,G);let b=[...s].filter(e=>(w.get(e)??0)===0);for(let e of b)a.addEdge(e,y);return a}function N(r,o,n,t){return!n.length||!r?t:async(i,g)=>await n.reduceRight((c,a)=>async s=>await a.handler(s,c),async c=>{let a=await t(c.state,c.config);return{...c.state,...a}})({agent:r,config:g,nodeName:o,state:i})}function q(r,o,n){if(n){if(!r.has(n))throw new Error(`Graph entry node references unknown node: ${n}`);return n}let t=[...r].filter(i=>(o.get(i)??0)===0);if(t.length!==1)throw new Error(`Graph could not infer a single entry node (found ${t.length}). Provide an explicit entryNode or ensure exactly one node has no incoming edges.`);return t[0]}export{$ as a,M as b,C as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{Ra as i}from"./
|
|
2
|
+
import{Ra as i}from"./IKEF7ZHH.js";async function n(a,t,e){if(e===void 0)throw new Error(["Unable to dispatch a custom event without a parent run id.",'"dispatchCustomEvent" can only be called from within an existing run (e.g.,',"inside a tool or a RunnableLambda).",`
|
|
3
3
|
|
|
4
4
|
If you continue to see this error, please import from "@langchain/core/callbacks/dispatch/web"`,"and explicitly pass in a config parameter.",`
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import d from"./
|
|
2
|
+
import d from"./HOCTVCHH.js";import c from"./QZVAGRWA.js";import a from"./NRMBMWI5.js";import{a as D,c as O}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as b,z as N}from"./MAV3DW27.js";import"./ADYIXCSG.js";import{a as n}from"./4RZPOYZ7.js";import"./6LZ6GOHF.js";import{a as A,b as S,ta as k}from"./CJIV4KJZ.js";import{Z as V}from"./IKEF7ZHH.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,K,X,,,{j:z,l:T},{C:M,D:G,E:L,F:P,G:F,H:U,a:j,m:w,n:R,o:h,p:Q},C])=>{var Y=async(e,t)=>(await n({text:"Exiting Data Exploration agent"},t),e),Z=async(e,t)=>{await n({text:"Requesting LLM for layer filter results"},t);let a=await w("data_explore_filter_prompt");if(!t?.configurable)throw new Error("config.configurable is required for layer filter tools");let{userTimezone:d,userTimezoneOffset:o}=L(),s={layerFieldInfo:e.layerFieldInfo,userTimezone:d,userTimezoneOffset:o,queryResponse:e.queryResponse,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},i=await T({promptText:a,modelTier:"advanced",config:t,messages:e.dataExplorationMessages,inputVariables:s,tools:F}),r=[...e.dataExplorationMessages,i];if(!((i.tool_calls?.length??0)>0))return await n({text:"LLM determined no filter changes needed"},t),{...e,dataExplorationMessages:r};let c=r,l=i.content.toString();return await C(i,t),{...e,dataExplorationMessages:c,outputMessage:l}},ee=async(e,t)=>{await n({text:"Requesting LLM for layer query results"},t);let a=await w("data_explore_query_prompt");if(!t?.configurable)throw new Error("config.configurable is required for layer query tools");let{userTimezone:d,userTimezoneOffset:o}=L(),s=e.agentExecutionContext.sharedState,i=s.lastNavigatedFeatures?.value,r=s.lastResolvedLocation?.value,c="none";if(i!=null)try{c=JSON.stringify(i)}catch{c="none"}let l="none";if(r!=null)try{l=JSON.stringify({address:r.address,location:r.location})}catch{l="none"}let m={layerFieldInfo:e.layerFieldInfo,userTimezone:d,userTimezoneOffset:o,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps,lastNavigatedFeatures:c,lastResolvedLocation:l},g=await T({promptText:a,modelTier:"advanced",config:t,messages:e.dataExplorationMessages,inputVariables:m,tools:P}),y=(g.tool_calls?.length??0)>0,p=g.content.toString();return await C(g,t),{...e,dataExplorationMessages:[...e.dataExplorationMessages,g],...y?{}:{outputMessage:p},status:"success",summary:p&&!y?R(p):"Query planning completed."}},te=async(e,t)=>{try{await n({text:"Requesting LLM for summary on query results"},t);let a=await w("summarize_query_response_prompt"),d={queryResponse:e.queryResponse,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},o=await z({promptText:a,modelTier:"fast",config:t,messages:e.dataExplorationMessages,inputVariables:d}),s=typeof o=="string"?o:o.content,i=new V(s);await n({text:`Received response from LLM: ${s}`},t);let r=s;return{...e,outputMessage:r,status:"success",summary:r?R(r):"Summary generated.",dataExplorationMessages:[...e.dataExplorationMessages,i]}}catch(a){throw await n({text:"Error during filter LLM request"},t),new Error(`Error during filter LLM request: ${a instanceof Error?a.message:String(a)}`)}};async function ae(e,t){if((e.queryResponse??[]).some(d=>{let o=d.details;return typeof o=="object"&&o!==null&&"error"in o}))return await n({text:"Skipping layer filter tool because query response contains an error."},t),{...e};let a=await new j(F,{handleToolErrors:!1}).invoke({messages:e.dataExplorationMessages},t);return await n({text:`Finished executing layer filter tool: ${a.messages.map(d=>d.content).join(", ")}`},t),{...e}}var se=10,re=["string","small-integer","integer"],ie=async(e,t,{includeSummaryStatistics:a=!0,includeUniqueValues:d=!0}={})=>{let o=null,s=null;try{if(t.type!=="geometry"&&t.type!=="oid"&&t.type!=="global-id"){a&&(o=await K({layer:e,field:t.name}));let i=t.domain?.type==="coded-value"?t.domain:null;d&&(re.includes(t.type)||i)&&(s=(await X({layer:e,field:t.name})).uniqueValueInfos.sort((r,c)=>c.count-r.count).slice(0,se),i&&(s=s.map(r=>({...r,value:i.getName(r.value)??r.value}))))}}catch(i){console.error(`Error fetching statistics for field ${t.name}:`,i)}return{summaryStatistics:o,uniqueValues:s}};function oe(e,t){return["string","small-integer","integer"].includes(e)||t==="coded-value"}async function ne(e,t,a,d=!0){let o=[],s=[],i=[];for(let r of e){let c=function(f){let u=t.get(f)?.layerItem;return u?[u.name&&`Name: ${u.name}`,u.title&&`Title: ${u.title}`,u.description&&`Description: ${u.description}`].filter(Boolean).join(" | "):f},{layerId:l,results:m}=r,g=a.map?.allLayers.find(f=>f.id===l),y=t.get(l)?.fieldRegistry;if(!y)continue;let p=o.find(f=>f.layerId===l);p||(p={layerId:l,layerSummary:c(l),fieldInfos:[]},o.push(p));for(let f of m){let u=y.get(f.name);if(!u)continue;let x=u.statistics,v=d&&!x?.summaryStatistics,q=oe(u.type,u.domain?.type)&&!x?.uniqueValues,I=v||q;if(i.push({layerId:l,fieldName:u.name,didFetchStatistics:I}),I){let J=ie(g,u,{includeSummaryStatistics:v,includeUniqueValues:q}).then($=>{let E={summaryStatistics:x?.summaryStatistics??null,uniqueValues:x?.uniqueValues??null};v&&(E.summaryStatistics=$.summaryStatistics),q&&(E.uniqueValues=$.uniqueValues),y.set(u.name,{...u,statistics:E}),u.statistics=E});s.push(J)}p.fieldInfos.push(u)}}return await Promise.all(s),{layerFieldInfo:o,didFetchStatistics:s.length>0,fieldStatisticsFetchStatus:i}}var W=/\b(average|avg|mean|median|max(?:imum)?|min(?:imum)?|sum|total|count|std(?:dev|\s*deviation)|variance|null\s*count|missing\s*values?|range)\b/iu;function le(e,t){return W.test(e)||W.test(t)}var de=async(e,t)=>{try{await n({text:"Preparing field information for vector search results"},t);let a=h(t,"layersAndFieldsRegistry"),{mapView:d}=G(t),{assignedTask:o,userRequest:s}=e.agentExecutionContext,i=le(o,s),{layerFieldInfo:r,didFetchStatistics:c,fieldStatisticsFetchStatus:l}=await ne(e.vectorSearchFieldResults,a,d,i);c?await n({text:"Statistics fetched"},t):await n({text:"Statistics skipped"},t);for(let m of l)await n({text:` - ${m.fieldName} - stats ${m.didFetchStatistics?"fetched":"skipped"}`},t);return await n({text:"Field information prepared"},t),{...e,layerFieldInfo:r}}catch(a){throw await n({text:"Error during fetching statistics"},t),new Error(`Error during fetching statistics: ${a instanceof Error?a.message:String(a)}`)}},B=.7,ce=10,ue=async(e,t)=>{try{await n({text:"Similarity search to find fields"},t);let a=h(t,"fieldSearch"),d=h(t,"layersAndFieldsRegistry"),o=h(t,"embeddingCache"),s=await a.searchFields({text:e.agentExecutionContext.assignedTask,layerIds:e.vectorSearchLayerIds,minScore:B,topResults:ce,embeddingCache:o}),i=s.map(({layerId:c,results:l})=>{let m=l.map(g=>` - ${g.name} (${g.score.toFixed(2)})`).join(`
|
|
3
3
|
`);return`${d.get(c)?.layerItem.name??c}:
|
|
4
4
|
${m}`}).join(`
|
|
5
5
|
`),r;return s.length>0?r=`Vector search completed. Matching layers and fields with scores:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"./
|
|
2
|
+
import e from"./QZVAGRWA.js";import a from"./NRMBMWI5.js";import{c as K,d as E}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as y,z as f}from"./MAV3DW27.js";import"./ADYIXCSG.js";import{a as c,b}from"./4RZPOYZ7.js";import"./6LZ6GOHF.js";import{a as x,b as d,j as k,ta as _}from"./CJIV4KJZ.js";import{Z as v}from"./IKEF7ZHH.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,{fetchKnowledgeGraph:B},{j:A,l:q},{K:u,L:C,M:G,N:T,O:N,P:R,Q:L,R:$,S:z,T:F,U:D,a:S,m:g,n:h,p:M}])=>{var I=[R,L,F,$,N,D,z];async function O(e,a){let r=await g("arcgis_knowledge_tool_prompt"),o=C(a),s={assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps,contextType:o},n=await q({promptText:r,messages:e.arcgisKnowledgeMessages,inputVariables:s,tools:I}),i=(n.tool_calls?.length??0)>0,t=typeof n.text=="string"?n.text.trim():"",l=t.length>0,p=n.content.toString();return!i&&(o==="map"||o==="knowledgeGraph")?{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,n],outputMessage:o==="map"?"No tools were found for the current view and prompt. Maps do not support changing nonspatial visibility, layout changes, or generation from queries.":"No tools were found for the current prompt and knowledge graph service. A knowledge graph service only supports search and query.",status:"success"}:{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,n],outputMessage:i?p:t,status:i?e.status:l?"success":"failed",summary:p?h(p):"ArcGIS Knowledge Agent tool executed."}}var U={generateCypher:"generated-cypher-query",queryGraphData:"graph-query-result",searchGraphData:"graph-search-result",addRecords:"added-records",applyLayout:"applied-layout",changeNonspatialVisibility:"changed-nonspatial-visibility",createLinkChart:"created-link-chart"};function V(e){return!!e&&e.status==="success"&&!!U[e.toolName]}function J(e){return{type:U[e.toolName],data:e.details}}async function P(e,a){let r=new S(I,{handleToolErrors:!1});try{let o=await r.invoke({messages:e.arcgisKnowledgeMessages},a),s=[];for(let t of o.messages){let l;if(typeof t.content!="string")throw new Error(`Unexpected tool message content type: ${typeof t.content}. Expected string.`);try{l=JSON.parse(t.content)}catch{throw new Error(`Failed to parse tool message content as JSON. Tool: ${t.name??"unknown"}.
|
|
3
3
|
|
|
4
4
|
Original Content: ${t.content}`)}if(!l||typeof l!="object"||!("toolName"in l))throw new Error(`Parsed tool message content does not have expected structure. Parsed content: ${JSON.stringify(l)}`);s.push(l)}await c({text:`Finished executing ArcGIS Knowledge Agent tools: ${o.messages.filter(t=>t.name).map(t=>t.name).join(", ")}`},a);let n=s.filter(t=>typeof t!="string").map(t=>`- Called Tool: ${t.toolName}, Status: ${t.status}`),i=s[0];return i&&V(i)&&await b(J(i),a),{...e,outputMessage:n.join(`
|
|
5
5
|
`),summary:n.length?h(n.join(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{D as Je,M as Ve,Q as Tt,a as rt,b as S,f as $,j,k as F,la as ee,ma as Ze,na as W,oa as bt,qa as ve,ra as fe,sa as Ce,t as st,ta as _t,u as at}from"./
|
|
2
|
+
import{D as Je,M as Ve,Q as Tt,a as rt,b as S,f as $,j,k as F,la as ee,ma as Ze,na as W,oa as bt,qa as ve,ra as fe,sa as Ce,t as st,ta as _t,u as at}from"./CJIV4KJZ.js";import{Ba as ze,D as $e,Db as q,Eb as Te,Gb as gt,Jb as be,Lb as wt,Ob as a,P as M,Pa as We,Qb as He,Sa as H,Sb as _e,Ta as de,U as it,Va as ct,Wa as dt,Wb as me,Xb as Z,Ya as Fe,Z as w,_a as ut,_b as ae,aa as Ue,ac as xe,ja as K,jb as ue,kb as ye,na as Be,nb as Me,nc as Ge,oa as B,pc as yt,rb as ft,tb as pt,tc as Mt,ua as lt,ub as Q,vb as ht}from"./IKEF7ZHH.js";import{Dd as z,s as mt}from"./ZEYIBYSF.js";var Ye=Symbol.for("AgentMiddleware");function A(e){return{[Ye]:!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}}var Se=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.")}},ke=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}},Ke=class extends Error{toolName;errors;constructor(e,t){super(`Failed to parse structured output for tool '${e}':${t.map(n=>`
|
|
3
3
|
- ${n}`).join("")}.`),this.toolName=e,this.errors=t}},Ee=class extends Error{toolCall;toolError;constructor(e,t){let n=e instanceof Error?e:new Error(String(e)),o=JSON.stringify(t.args);super(`Error invoking tool '${t.name}' with kwargs ${o} with error: ${n.stack}
|
|
4
4
|
Please fix the error and try again.`),this.toolCall=t,this.toolError=n}},pe=class xt extends Error{static"~brand"="MiddlewareError";constructor(t,n){let o=t instanceof Error?t.message:String(t);super(o),this.name=t instanceof Error?t.name:`${n[0].toUpperCase()+n.slice(1)}Error`,t instanceof Error&&(this.cause=t)}static wrap(t,n){return st(t)?t:new xt(t,n)}static isInstance(t){return t instanceof Error&&"~brand"in t&&t["~brand"]==="MiddlewareError"}};function he(e){return"invoke"in e&&typeof e.invoke=="function"&&"_streamResponseChunks"in e}function ie(e){return typeof e=="object"&&e!=null&&"_queuedMethodOperations"in e&&"_getModelInstance"in e&&typeof e._getModelInstance=="function"}var vt=!0,ao=0,J=class qe{constructor(t,n,o){this.schema=t,this.tool=n,this.options=o}get name(){return this.tool.function.name}static fromSchema(t,n){function o(s){return s??`extract-${++ao}`}if(ue(t)||Me(t)){let s=_e(t);return new qe(s,{type:"function",function:{name:o(s.title),strict:!1,description:s.description??"Tool for extracting structured output from the model's response.",parameters:s}},n)}let r;return typeof t.name=="string"&&typeof t.parameters=="object"&&t.parameters!=null?r=t:r={name:o(t.title),description:t.description??"",parameters:t.schema||t},new qe(_e(t),{type:"function",function:r},n)}parse(t){let n=new He(this.schema).validate(t);if(!n.valid)throw new Ke(this.name,n.errors.map(o=>o.error));return t}},te=class Ct{_schemaType;schema;strict;constructor(t,n){if("schema"in t&&typeof t.schema=="object"&&t.schema!==null&&!("type"in t)){let o=t;this.schema=o.schema,this.strict=o.strict??vt}else this.schema=t,this.strict=n??vt}static fromSchema(t,n){return new Ct(_e(t),n)}parse(t){let n;if(typeof t.content=="string")n=t.content;else if(Array.isArray(t.content)){for(let o of t.content)if(typeof o=="object"&&o!==null&&"type"in o&&o.type==="text"&&"text"in o&&typeof o.text=="string"){n=o.text;break}}if(!(!n||n===""))try{let o=JSON.parse(n);return new He(this.schema).validate(o).valid?o:void 0}catch{}}};function St(e,t,n){if(!e)return[];if(typeof e=="object"&&e!==null&&"__responseFormatUndefined"in e)return[];if(Array.isArray(e)){if(e.every(r=>r instanceof J||r instanceof te))return e;if(e.every(r=>ue(r)))return e.map(r=>J.fromSchema(r,t));if(e.every(r=>q(r)))return e.map(r=>J.fromSchema(r,t));if(e.every(r=>typeof r=="object"&&r!==null&&!q(r)&&!ue(r)))return e.map(r=>J.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 J||e instanceof te)return[e];let o=io(n);if(ue(e))return o?[te.fromSchema(e)]:[J.fromSchema(e,t)];if(q(e))return o?[te.fromSchema(e)]:[J.fromSchema(e,t)];if(typeof e=="object"&&e!==null&&"properties"in e)return o?[te.fromSchema(e)]:[J.fromSchema(e,t)];throw new Error(`Invalid response format: ${String(e)}`)}function io(e){return!e||!he(e)||!("profile"in e)||typeof e.profile!="object"||!e.profile?!1:"structuredOutput"in e.profile&&e.profile.structuredOutput===!0}var Xe=Symbol.for("langgraph-zod");Xe in globalThis||(globalThis[Xe]=new WeakSet);function kt(e){let t=globalThis[Xe];t.has(e)||(Object.defineProperty(e,"langgraph",{get(){let n=this;return{metadata(o){return Ce(n,{jsonSchemaExtra:o})},reducer(o,r){return Ce(n,{default:be(n),reducer:{schema:r,fn:o}})}}}}),t.add(e))}try{kt(a.ZodType.prototype),kt(z.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 Et=class extends mt{constructor(e){super(),this.parent=e,this._map=this.parent._map}add(e,...t){let n=t[0];if(n&&!n?.default){let o=be(e);o!=null&&(n.default=o)}return super.add(e,...t)}},lo=new Et(fe);function It(e=!0,t,n=[]){let o={jumpTo:new Ze},r={},s={},i=l=>{if(W.isInstance(l)){for(let[c,d]of Object.entries(l.fields))if(!(c in o)){if(o[c]=d,c.startsWith("_"))continue;ee.isInstance(d)?(r[c]=d.inputSchema||d.valueSchema,s[c]=d.valueSchema):(r[c]=d,s[c]=d)}return}let u=Te(l);for(let[c,d]of Object.entries(u)){let g=c.startsWith("_");if(!(c in o)){if(ye(d)){let p=fe.get(d);if(p?.reducer){p.reducer.schema?(o[c]=new ee(d,{inputSchema:p.reducer.schema,reducer:p.reducer.fn}),g||(r[c]=p.reducer.schema,s[c]=d)):(o[c]=new ee(d,{reducer:p.reducer.fn}),g||(r[c]=d,s[c]=d));continue}}o[c]=d,g||(r[c]=d,s[c]=d)}}};t&&(W.isInstance(t)||q(t))&&i(t);for(let l of n)l.stateSchema&&(W.isInstance(l.stateSchema)||q(l.stateSchema))&&i(l.stateSchema);return e&&(s.structuredResponse=new Ze),{state:new W({messages:ve,...o}),input:new W({messages:ve,...r}),output:new W({messages:ve,...s})}}var Qe=/<name>(.*?)<\/name>/s,et=/<content>(.*?)<\/content>/s;function co(e,t){if(W.isInstance(e)){let n={};for(let o of Object.keys(e.fields))o in t&&(n[o]=t[o]);return n}if(Me(e))return Q(e,t);throw new Error(`Invalid state schema type: ${typeof e}`)}function Rt(e){if(!w.isInstance(e)||Ue.isInstance(e)||!e.name)return e;let{name:t}=e;if(typeof e.content=="string")return new w({...e.lc_kwargs,content:`<name>${t}</name><content>${e.content}</content>`,name:void 0});let n=[],o=0;for(let r of e.content)typeof r=="string"?(o+=1,n.push(`<name>${t}</name><content>${r}</content>`)):typeof r=="object"&&"type"in r&&r.type==="text"?(o+=1,n.push({...r,text:`<name>${t}</name><content>${r.text}</content>`})):n.push(r);return o||n.unshift({type:"text",text:`<name>${t}</name><content></content>`}),new w({...e.lc_kwargs,content:n,name:void 0})}function Ot(e){if(!w.isInstance(e)||!e.content)return e;let t=[],n;if(Array.isArray(e.content))t=e.content.filter(o=>{if(o.type==="text"&&typeof o.text=="string"){let r=o.text.match(Qe),s=o.text.match(et);return r&&(!s||s[1]==="")?(n=r[1],!1):!0}return!0}).map(o=>{if(o.type==="text"&&typeof o.text=="string"){let r=o.text.match(Qe),s=o.text.match(et);return!r||!s?o:(n=r[1],{...o,text:s[1]})}return o});else{let o=e.content,r=o.match(Qe),s=o.match(et);if(!r||!s)return e;n=r[1],t=s[1]}return new w({...Object.keys(e.lc_kwargs??{}).length>0?e.lc_kwargs:e,content:t,name:n})}function re(e){return me.isRunnable(e)}function At(e){return he(e)?"bindTools"in e&&typeof e.bindTools=="function":!1}var tt=(e,t,n={})=>{if(At(e))return e.bindTools(t,n);if(Z.isRunnableBinding(e)&&At(e.bound)){let o=e.bound.bindTools(t,n);return Z.isRunnableBinding(o)?new Z({bound:o.bound,config:{...e.config,...o.config},kwargs:{...e.kwargs,...o.kwargs},configFactories:o.configFactories??e.configFactories}):new Z({bound:o,config:e.config,kwargs:e.kwargs,configFactories:e.configFactories})}return null};function Ie(e){if(typeof e=="function")return;let t=e;if(ae.isRunnableSequence(t)&&(t=t.steps.find(n=>Z.isRunnableBinding(n))||t),!ie(t)){if(Z.isRunnableBinding(t)){let n=t.kwargs!=null&&typeof t.kwargs=="object"&&"tools"in t.kwargs&&Array.isArray(t.kwargs.tools)&&t.kwargs.tools.length>0,o=t.config!=null&&typeof t.config=="object"&&"tools"in t.config&&Array.isArray(t.config.tools)&&t.config.tools.length>0;if(n||o)throw new Se}if("tools"in t&&t.tools!==void 0&&Array.isArray(t.tools)&&t.tools.length>0)throw new Se}}function le(e){return!!(w.isInstance(e)&&e.tool_calls&&e.tool_calls.length>0)}function Nt(e){if(e==null)return new B("");if(B.isInstance(e))return e;if(typeof e=="string")return new B({content:[{type:"text",text:e}]});throw new Error(`Invalid systemPrompt type: expected string or SystemMessage, got ${typeof e}`)}async function jt(e,t,n={}){let o=tt(e,t,n);if(o)return o;if(ie(e)){let r=tt(await e._getModelInstance(),t,n);if(r)return r}if(ae.isRunnableSequence(e)){let r=e.steps.findIndex(s=>Z.isRunnableBinding(s)||he(s)||ie(s));if(r>=0){let s=tt(e.steps[r],t,n);if(s){let i=e.steps.slice();return i.splice(r,1,s),ae.from(i)}}}throw new Error(`llm ${e} must define bindTools method.`)}function uo(e){if(e.length===0)return;if(e.length===1)return e[0];function t(o,r){return async(s,i)=>o(s,async u=>r(u,i))}let n=e[e.length-1];for(let o=e.length-2;o>=0;o--)n=t(e[o],n);return n}function Pt(e){let t=e.filter(n=>n.wrapToolCall);if(t.length!==0)return uo(t.map(n=>{let o=n.wrapToolCall;return async(s,i)=>{let l=s.state,u=async c=>{let d={...l,...c.state};return i({...c,state:d})};try{let c=await o({...s,state:{messages:l.messages,...n.stateSchema?co(n.stateSchema,{...l}):{}}},u);if(!M.isInstance(c)&&!F(c))throw new Error(`Invalid response from "wrapToolCall" in middleware "${n.name}": expected ToolMessage or Command, got ${typeof c}`);return c}catch(c){throw pe.wrap(c,n.name)}}}))}async function Lt(e,t){let n={};for(let o of e){if(!o.stateSchema)continue;let r=o.stateSchema;if(W.isInstance(o.stateSchema)){let l={};for(let[u,c]of Object.entries(o.stateSchema.fields))ee.isInstance(c)?l[u]=c.inputSchema||c.valueSchema:l[u]=c;r=z.object(l)}let s=await ft(wt(r,l=>l.startsWith("_")),t);if(s.success){Object.assign(n,s.data);continue}let i=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 u,b as S,c as v}from"./
|
|
2
|
+
import{a as u,b as S,c as v}from"./LODKJRS4.js";import b from"./VV57ZUOI.js";import{b as f,c as y}from"./3S7PBYVD.js";import a from"./NRMBMWI5.js";import"./ADYIXCSG.js";import"./4RZPOYZ7.js";import{c as d}from"./XVQJBUMY.js";import{b as c}from"./6LZ6GOHF.js";import{O as g,u as l}from"./CJIV4KJZ.js";import"./IKEF7ZHH.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,{watch:T},,,{property:m,subclass:_},{f:h},w])=>{var k=Object.defineProperty,x=Object.getOwnPropertyDescriptor,a=(e,s,t,r)=>{for(var o=r>1?void 0:r?x(s,t):s,n=e.length-1,p;n>=0;n--)(p=e[n])&&(o=(r?p(s,t,o):p(o))||o);return r&&o&&k(s,t,o),o},i=class extends w{constructor(e){super(e),this.modelTier="default"}initialize(){this.addHandles(T(()=>[this.description,this.inputSchema,this.modelTier,this.name,this.outputSchema,this.prompt,this.tools],()=>{this.generate()},{initial:!0,sync:!0}))}getSchemas(){return[this.inputSchema,this.outputSchema].filter(Boolean)}generate(){let e=f(this.getSchemas());this._set("workspace",e);let s=this.id,t={[s]:this._invoke.bind(this)},r=[{from:s,decide:()=>{}}];this._set("createGraph",()=>y(t,r,e,{agent:this,entryNode:s,middlewares:this.middlewares}))}async _invoke(e,s){try{return this.outputSchema?await this._invokeStructured(e,s):await this._invokeUnstructured(e,s)}catch(t){if(l(t))throw t;let r=t instanceof Error?t.message:String(t);return u({outputMessage:r},"failed",r)}}async _invokeStructured(e,s){if(!this.outputSchema)throw new Error("Output schema is required for structured invocation.");let t=await c({model:await h({modelTier:this.modelTier}),systemPrompt:await this._getPromptWithInputVariables(e),tools:this._getTools(),checkpointer:!0,middleware:d(this.middlewares),responseFormat:this.outputSchema}).invoke({messages:e.agentExecutionContext.messages},s);if(!("structuredResponse"in t)||t.structuredResponse===void 0)throw new Error("LLMAgent did not receive structured output from createAgent.");return S(t.structuredResponse,this.outputSchema,t.messages)}async _invokeUnstructured(e,s){let t=(await c({model:await h({modelTier:this.modelTier}),systemPrompt:await this._getPromptWithInputVariables(e),tools:this._getTools(),checkpointer:!0,middleware:d(this.middlewares)}).invoke({messages:e.agentExecutionContext.messages},s)).messages,r=t.at(-1)?.content??"",o=typeof r=="string"?r:JSON.stringify(r),n=o.trim()||"LLMAgent completed.";return u({agentExecutionContext:{...e.agentExecutionContext,messages:t},outputMessage:o},"success",n)}async _getPromptWithInputVariables(e){let s=v(e,this.inputSchema);for(let{outputKey:t}of this.middlewares)t&&(s[String(t)]=e[t]);return await g.fromTemplate(this.prompt).format(s)}_getTools(){return this.tools?.map(e=>e.getTool())??[]}};a([m()],i.prototype,"prompt",2);a([m()],i.prototype,"tools",2);a([m()],i.prototype,"inputSchema",2);a([m()],i.prototype,"outputSchema",2);a([m()],i.prototype,"modelTier",2);i=a([_("LLMAgent")],i);return i},"identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","core/accessorSupport/decorators",a,b)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{$ as Xr,$a as Fc,$b as Qn,A as zo,Aa as Cc,Ab as Zc,B as Jo,Bb as Qc,C as qo,Ca as vi,Cb as el,D as Fe,Da as Ec,Db as me,E as Yo,Ea as Kn,Eb as nn,F as Xo,Fa as Wn,Fb as Xn,G as Zo,Ga as kc,Gb as Sr,H as Qo,Ha as xc,Hb as tl,I as ec,Ia as _r,Ib as rl,J as tc,Ja as Tc,Jb as Zn,K as rc,Ka as Ic,Kb as nl,L as z,La as Ac,Lb as sl,M as ct,Ma as Oc,Mb as il,N as nc,Na as Nc,O as sc,Oa as Ze,Ob as Nt,P as Tt,Pa as ee,Pb as al,Q as Yr,Qa as Pc,R as ic,Ra as yr,Rb as ol,S as Hn,Sa as ke,Sb as ie,T as ac,Ta as ut,Tb as cl,Ua as re,Ub as Si,V as zt,Va as Mc,Vb as ll,W as Jt,Wa as Rc,Wb as D,X as oc,Xa as Lc,Xb as Pt,Y as cc,Ya as rn,Yb as ul,Z as $,Za as pt,Zb as pl,_ as gr,_b as je,a as No,aa as Ee,ab as At,ac as _e,b as Po,ba as It,bb as Dc,bc as hl,c as Mo,ca as Zr,cb as jc,cc as fl,d as Ro,da as lc,db as br,dc as ae,e as I,ea as uc,eb as zn,ec as es,f as Lo,fa as Qr,fb as Xt,fc as ml,g as Fo,ga as en,gb as Vc,gc as dl,h as Le,ha as pc,hb as Bc,hc as gl,i as Do,ia as hc,ib as Uc,ic as _l,ja as he,jb as wr,jc as yl,k as Bn,ka as tn,kb as $c,kc as bl,l as jo,la as fc,lb as Jn,lc as wl,m as Vo,ma as mc,mb as Gc,mc as vl,n as Bo,na as lt,nb as Ot,o as dr,oa as De,ob as Hc,p as wi,pa as qt,pb as Kc,pc as ts,qa as dc,qb as Wc,qc as Sl,r as Uo,ra as gc,rb as qn,rc as Cl,s as Un,sa as _c,sb as Yn,sc as El,t as $n,ta as fe,tb as zc,tc as Ci,u as $o,ua as yc,ub as vr,uc as kl,v as Go,va as bc,vb as Zt,vc as xl,w as Gn,wa as wc,wb as Jc,x as Ho,xa as vc,xb as qc,y as Ko,ya as Yt,yb as Yc,z as Wo,za as Sc,zb as Xc}from"./
|
|
2
|
+
import{$ as Xr,$a as Fc,$b as Qn,A as zo,Aa as Cc,Ab as Zc,B as Jo,Bb as Qc,C as qo,Ca as vi,Cb as el,D as Fe,Da as Ec,Db as me,E as Yo,Ea as Kn,Eb as nn,F as Xo,Fa as Wn,Fb as Xn,G as Zo,Ga as kc,Gb as Sr,H as Qo,Ha as xc,Hb as tl,I as ec,Ia as _r,Ib as rl,J as tc,Ja as Tc,Jb as Zn,K as rc,Ka as Ic,Kb as nl,L as z,La as Ac,Lb as sl,M as ct,Ma as Oc,Mb as il,N as nc,Na as Nc,O as sc,Oa as Ze,Ob as Nt,P as Tt,Pa as ee,Pb as al,Q as Yr,Qa as Pc,R as ic,Ra as yr,Rb as ol,S as Hn,Sa as ke,Sb as ie,T as ac,Ta as ut,Tb as cl,Ua as re,Ub as Si,V as zt,Va as Mc,Vb as ll,W as Jt,Wa as Rc,Wb as D,X as oc,Xa as Lc,Xb as Pt,Y as cc,Ya as rn,Yb as ul,Z as $,Za as pt,Zb as pl,_ as gr,_b as je,a as No,aa as Ee,ab as At,ac as _e,b as Po,ba as It,bb as Dc,bc as hl,c as Mo,ca as Zr,cb as jc,cc as fl,d as Ro,da as lc,db as br,dc as ae,e as I,ea as uc,eb as zn,ec as es,f as Lo,fa as Qr,fb as Xt,fc as ml,g as Fo,ga as en,gb as Vc,gc as dl,h as Le,ha as pc,hb as Bc,hc as gl,i as Do,ia as hc,ib as Uc,ic as _l,ja as he,jb as wr,jc as yl,k as Bn,ka as tn,kb as $c,kc as bl,l as jo,la as fc,lb as Jn,lc as wl,m as Vo,ma as mc,mb as Gc,mc as vl,n as Bo,na as lt,nb as Ot,o as dr,oa as De,ob as Hc,p as wi,pa as qt,pb as Kc,pc as ts,qa as dc,qb as Wc,qc as Sl,r as Uo,ra as gc,rb as qn,rc as Cl,s as Un,sa as _c,sb as Yn,sc as El,t as $n,ta as fe,tb as zc,tc as Ci,u as $o,ua as yc,ub as vr,uc as kl,v as Go,va as bc,vb as Zt,vc as xl,w as Gn,wa as wc,wb as Jc,x as Ho,xa as vc,xb as qc,y as Ko,ya as Yt,yb as Yc,z as Wo,za as Sc,zb as Xc}from"./IKEF7ZHH.js";import{Dd as Mt}from"./ZEYIBYSF.js";var H="__start__",W="__end__",Qe="__input__";var Er="__error__",rs="__pregel_ns_writes",Ae="__pregel_send",kr="__pregel_call",Ve="__pregel_read",Be="__pregel_checkpointer",xr="__pregel_resuming",an="__pregel_task_id",on="__pregel_stream",vf="__pregel_resume_value",Tr="__pregel_resume_map",be="__pregel_scratchpad",er="__pregel_previous",Sf="__pregel_durability",ns="checkpoint_id",Oe="checkpoint_ns",Tl="__pregel_node_finished",Ne="checkpoint_map",Il="__pregel_abort_signals",K="__interrupt__",xe="__resume__",cn="__no_writes__",Rt="__return__",tr="__previous__",X="langsmith:hidden";var ki="__self__",et="__pregel_tasks",Pe="__pregel_push",ss="__pregel_pull",Te="00000000-0000-0000-0000-000000000000",Al=[X,Qe,K,xe,Er,cn,Ae,Ve,Be,Sf,on,xr,an,kr,vf,be,er,Ne,Oe,ns],Ei=Symbol.for("langgraph.command"),Ol=class{[Ei];constructor(e){this[Ei]=e}};function is(e){let t=e;return t!=null&&typeof t.node=="string"&&t.args!==void 0}var Qt=class{lg_name="Send";node;args;constructor(e,t){this.node=e,this.args=sn(t)}toJSON(){return{lg_name:this.lg_name,node:this.node,args:this.args}}};function Z(e){return e instanceof Qt}var Cr="__overwrite__",Cf=class{lg_name="Overwrite";[Cr];constructor(e){this[Cr]=e}get value(){return this[Cr]}toJSON(){return{[Cr]:this[Cr]}}static isInstance(e){return!e||typeof e!="object"?!1:"__overwrite__"in e||"lg_name"in e&&e.lg_name==="Overwrite"}};function as(e){return typeof e=="object"&&e!==null&&"__overwrite__"in e?[!0,e[Cr]]:[!1,void 0]}function Nl(e){return as(e)[0]}function ln(e){return!e||typeof e!="object"||!("__interrupt__"in e)?!1:Array.isArray(e[K])}var ye=class extends Ol{lg_name="Command";lc_direct_tool_output=!0;graph;update;resume;goto=[];static PARENT="__parent__";constructor(e){super(e),this.resume=e.resume,this.graph=e.graph,this.update=e.update,e.goto&&(this.goto=Array.isArray(e.goto)?sn(e.goto):[sn(e.goto)])}_updateAsTuples(){return this.update&&typeof this.update=="object"&&!Array.isArray(this.update)?Object.entries(this.update):Array.isArray(this.update)&&this.update.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]=="string")?this.update:[["__root__",this.update]]}toJSON(){let e;return typeof this.goto=="string"?e=this.goto:Z(this.goto)?e=this.goto.toJSON():e=this.goto?.map(t=>typeof t=="string"?t:t.toJSON()),{lg_name:this.lg_name,update:this.update,resume:this.resume,goto:e}}};function Q(e){return typeof e!="object"||e==null?!1:"lg_name"in e&&e.lg_name==="Command"}function sn(e,t=new Map){if(e!=null&&typeof e=="object"){if(t.has(e))return t.get(e);let r;if(Array.isArray(e))r=[],t.set(e,r),e.forEach((n,s)=>{r[s]=sn(n,t)});else if(Q(e)&&!(e instanceof ye))r=new ye(e),t.set(e,r);else if(is(e)&&!(e instanceof Qt))r=new Qt(e.node,e.args),t.set(e,r);else if(Q(e)||Z(e))r=e,t.set(e,r);else if("lc_serializable"in e&&e.lc_serializable)r=e,t.set(e,r);else{r={},t.set(e,r);for(let[n,s]of Object.entries(e))r[n]=sn(s,t)}return r}return e}var Ue=class extends Error{lc_error_code;constructor(e,t){let r=e??"";t?.lc_error_code&&(r=`${r}
|
|
3
3
|
|
|
4
4
|
Troubleshooting URL: https://docs.langchain.com/oss/javascript/langgraph/${t.lc_error_code}/
|
|
5
5
|
`),super(r),this.lc_error_code=t?.lc_error_code}},xi=class extends Ue{get is_bubble_up(){return!0}},Ti=class extends Ue{constructor(e,t){super(e,t),this.name="GraphRecursionError"}static get unminifiable_name(){return"GraphRecursionError"}},rr=class extends Ue{constructor(e,t){super(e,t),this.name="GraphValueError"}static get unminifiable_name(){return"GraphValueError"}},ht=class extends xi{interrupts;constructor(e,t){super(JSON.stringify(e,null,2),t),this.name="GraphInterrupt",this.interrupts=e??[]}static get unminifiable_name(){return"GraphInterrupt"}},os=class extends ht{constructor(e,t){super([{value:e}],t),this.name="NodeInterrupt"}static get unminifiable_name(){return"NodeInterrupt"}},cs=class extends xi{command;constructor(e){super(),this.name="ParentCommand",this.command=e}static get unminifiable_name(){return"ParentCommand"}};function Ii(e){return e!==void 0&&e.name===cs.unminifiable_name}function nr(e){return e!==void 0&&e.is_bubble_up===!0}function ft(e){return e!==void 0&&[ht.unminifiable_name,os.unminifiable_name].includes(e.name)}var ls=class extends Ue{constructor(e,t){super(e,t),this.name="EmptyInputError"}static get unminifiable_name(){return"EmptyInputError"}},B=class extends Ue{constructor(e,t){super(e,t),this.name="EmptyChannelError"}static get unminifiable_name(){return"EmptyChannelError"}},L=class extends Ue{constructor(e,t){super(e,t),this.name="InvalidUpdateError"}static get unminifiable_name(){return"InvalidUpdateError"}},Ef=class extends Ue{constructor(e,t){super(e,t),this.name="MultipleSubgraphError"}static get unminifiable_name(){return"MultipleSubgraphError"}},Ai=class extends Ue{constructor(e,t){super(e,t),this.name="UnreachableNodeError"}static get unminifiable_name(){return"UnreachableNodeError"}},kf=class extends Ue{constructor(e,t){super(e,t),this.name="RemoteException"}static get unminifiable_name(){return"RemoteException"}},un=class extends Ue{constructor(e,t){super(e,t),this.name="StateGraphInputError",this.message="Invalid StateGraph input. Make sure to pass a valid StateDefinition, Annotation.Root, or Zod schema."}static get unminifiable_name(){return"StateGraphInputError"}},xf=()=>(globalThis[Symbol.for("LG_CHECKPOINT_SEEN_NS_SET")]===void 0&&(globalThis[Symbol.for("LG_CHECKPOINT_SEEN_NS_SET")]=new Set),globalThis[Symbol.for("LG_CHECKPOINT_SEEN_NS_SET")]);var Pl=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function Tf(e){return typeof e=="string"&&Pl.test(e)}var Ir=Tf;function If(e){if(!Ir(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}var us=If;var ne=[];for(ps=0;ps<256;++ps)ne.push((ps+256).toString(16).slice(1));var ps;function tt(e,t=0){return(ne[e[t+0]]+ne[e[t+1]]+ne[e[t+2]]+ne[e[t+3]]+"-"+ne[e[t+4]]+ne[e[t+5]]+"-"+ne[e[t+6]]+ne[e[t+7]]+"-"+ne[e[t+8]]+ne[e[t+9]]+"-"+ne[e[t+10]]+ne[e[t+11]]+ne[e[t+12]]+ne[e[t+13]]+ne[e[t+14]]+ne[e[t+15]]).toLowerCase()}var hs,Af=new Uint8Array(16);function pn(){if(!hs&&(hs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!hs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return hs(Af)}var Oi,fs,Ni=0,Pi=0;function Of(e,t,r){var n=t&&r||0,s=t||new Array(16);e=e||{};var i=e.node,a=e.clockseq;if(e._v6||(i||(i=Oi),a==null&&(a=fs)),i==null||a==null){var o=e.random||(e.rng||pn)();i==null&&(i=[o[0],o[1],o[2],o[3],o[4],o[5]],!Oi&&!e._v6&&(i[0]|=1,Oi=i)),a==null&&(a=(o[6]<<8|o[7])&16383,fs===void 0&&!e._v6&&(fs=a))}var c=e.msecs!==void 0?e.msecs:Date.now(),l=e.nsecs!==void 0?e.nsecs:Pi+1,u=c-Ni+(l-Pi)/1e4;if(u<0&&e.clockseq===void 0&&(a=a+1&16383),(u<0||c>Ni)&&e.nsecs===void 0&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Ni=c,Pi=l,fs=a,c+=122192928e5;var h=((c&268435455)*1e4+l)%4294967296;s[n++]=h>>>24&255,s[n++]=h>>>16&255,s[n++]=h>>>8&255,s[n++]=h&255;var f=c/4294967296*1e4&268435455;s[n++]=f>>>8&255,s[n++]=f&255,s[n++]=f>>>24&15|16,s[n++]=f>>>16&255,s[n++]=a>>>8|128,s[n++]=a&255;for(var d=0;d<6;++d)s[n+d]=i[d];return t||tt(s)}var Ml=Of;function Mi(e){var t=typeof e=="string"?us(e):e,r=Nf(t);return typeof e=="string"?tt(r):r}function Nf(e,t=!1){return Uint8Array.of((e[6]&15)<<4|e[7]>>4&15,(e[7]&15)<<4|(e[4]&240)>>4,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,(e[1]&15)<<4|(e[2]&240)>>4,96|e[2]&15,e[3],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function Pf(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}var Mf="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Rf="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function Ri(e,t,r){function n(s,i,a,o){var c;if(typeof s=="string"&&(s=Pf(s)),typeof i=="string"&&(i=us(i)),((c=i)===null||c===void 0?void 0:c.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var l=new Uint8Array(16+s.length);if(l.set(i),l.set(s,i.length),l=r(l),l[6]=l[6]&15|t,l[8]=l[8]&63|128,a){o=o||0;for(var u=0;u<16;++u)a[o+u]=l[u];return a}return tt(l)}try{n.name=e}catch{}return n.DNS=Mf,n.URL=Rf,n}var Lf=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Li={randomUUID:Lf};function Ff(e,t,r){if(Li.randomUUID&&!t&&!e)return Li.randomUUID();e=e||{};var n=e.random||(e.rng||pn)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(var s=0;s<16;++s)t[r+s]=n[s];return t}return tt(n)}var ms=Ff;function Df(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:return t^r^n;case 2:return t&r^t&n^r&n;case 3:return t^r^n}}function Fi(e,t){return e<<t|e>>>32-t}function jf(e){var t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){var n=unescape(encodeURIComponent(e));e=[];for(var s=0;s<n.length;++s)e.push(n.charCodeAt(s))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var i=e.length/4+2,a=Math.ceil(i/16),o=new Array(a),c=0;c<a;++c){for(var l=new Uint32Array(16),u=0;u<16;++u)l[u]=e[c*64+u*4]<<24|e[c*64+u*4+1]<<16|e[c*64+u*4+2]<<8|e[c*64+u*4+3];o[c]=l}o[a-1][14]=(e.length-1)*8/Math.pow(2,32),o[a-1][14]=Math.floor(o[a-1][14]),o[a-1][15]=(e.length-1)*8&4294967295;for(var h=0;h<a;++h){for(var f=new Uint32Array(80),d=0;d<16;++d)f[d]=o[h][d];for(var _=16;_<80;++_)f[_]=Fi(f[_-3]^f[_-8]^f[_-14]^f[_-16],1);for(var b=r[0],w=r[1],S=r[2],C=r[3],x=r[4],A=0;A<80;++A){var N=Math.floor(A/20),P=Fi(b,5)+Df(N,w,S,C)+x+t[N]+f[A]>>>0;x=C,C=S,S=Fi(w,30)>>>0,w=b,b=P}r[0]=r[0]+b>>>0,r[1]=r[1]+w>>>0,r[2]=r[2]+S>>>0,r[3]=r[3]+C>>>0,r[4]=r[4]+x>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var Rl=jf;var Vf=Ri("v5",80,Rl),Di=Vf;function Ll(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Fl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ll(Object(r),!0).forEach(function(n){Bf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ll(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bf(e,t,r){return(t=Uf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Uf(e){var t=$f(e,"string");return typeof t=="symbol"?t:t+""}function $f(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ds(e={},t,r=0){var n=Ml(Fl(Fl({},e),{},{_v6:!0}),new Uint8Array(16));if(n=Mi(n),t){for(var s=0;s<16;s++)t[r+s]=n[s];return t}return tt(n)}function hn(e){return ds({clockseq:e})}function mt(e,t){let r=t.replace(/-/g,"").match(/.{2}/g).map(n=>parseInt(n,16));return Di(e,new Uint8Array(r))}var fn="__pregel_tasks",ji="__error__",sr="__scheduled__",Vi="__interrupt__",Bi="__resume__";var Dl="[...]",Gf="[Circular]",gs=[],Ar=[];function Hf(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function jl(e,t,r,n){typeof n>"u"&&(n=Hf()),$i(e,"",0,[],void 0,0,n);var s;try{Ar.length===0?s=JSON.stringify(e,t,r):s=JSON.stringify(e,Kf(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;gs.length!==0;){var i=gs.pop();i.length===4?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return s}function Ui(e,t,r,n){var s=Object.getOwnPropertyDescriptor(n,r);s.get!==void 0?s.configurable?(Object.defineProperty(n,r,{value:e}),gs.push([n,r,t,s])):Ar.push([t,r,e]):(n[r]=e,gs.push([n,r,t]))}function $i(e,t,r,n,s,i,a){i+=1;var o;if(typeof e=="object"&&e!==null){for(o=0;o<n.length;o++)if(n[o]===e){Ui(Gf,e,t,s);return}if(typeof a.depthLimit<"u"&&i>a.depthLimit){Ui(Dl,e,t,s);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){Ui(Dl,e,t,s);return}if(n.push(e),Array.isArray(e))for(o=0;o<e.length;o++)$i(e[o],o,o,n,e,i,a);else{var c=Object.keys(e);for(o=0;o<c.length;o++){var l=c[o];$i(e[l],l,o,n,e,i,a)}}n.pop()}}function Kf(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(Ar.length>0)for(var n=0;n<Ar.length;n++){var s=Ar[n];if(s[1]===t&&s[0]===r){r=s[2],Ar.splice(n,1);break}}return e.call(this,t,r)}}var Vl=[];var Bl=I({});var Ul=I({});var _s=(e,t)=>{let r=[...new Set(t?.map(s=>{if(typeof s=="string")return s;let i=new s({});if(!("getType"in i)||typeof i.getType!="function")throw new Error("Invalid type provided.");return i.getType()}))],n=e.getType();return r.some(s=>s===n)};function Wl(e,t){return Array.isArray(e)?$l(e,t):_e.from(r=>$l(r,e))}function $l(e,t={}){let{includeNames:r,excludeNames:n,includeTypes:s,excludeTypes:i,includeIds:a,excludeIds:o}=t,c=[];for(let l of e)if(!(n&&l.name&&n.includes(l.name))){{if(i&&_s(l,i))continue;if(o&&l.id&&o.includes(l.id))continue}s||a||r?(r&&l.name&&r.some(u=>u===l.name)||s&&_s(l,s)||a&&l.id&&a.some(u=>u===l.id))&&c.push(l):c.push(l)}return c}function zl(e){return Array.isArray(e)?Gl(e):_e.from(Gl)}function Gl(e){if(!e.length)return[];let t=[];for(let r of e){let n=r,s=t.pop();if(!s)t.push(n);else if(n.getType()==="tool"||n.getType()!==s.getType())t.push(s,n);else{let i=Yt(s),a=Yt(n),o=i.concat(a);typeof i.content=="string"&&typeof a.content=="string"&&(o.content=`${i.content}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import a from"./
|
|
2
|
+
import a from"./RHF452M7.js";import"./3S7PBYVD.js";import"./CJIV4KJZ.js";import"./IKEF7ZHH.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([{property:l,subclass:w},{c:p,d:d}])=>{var y=Object.defineProperty,m=Object.getOwnPropertyDescriptor,f=e=>{throw TypeError(e)},h=(e,t,o,n)=>{for(var r=n>1?void 0:n?m(t,o):t,s=e.length-1,g;s>=0;s--)(g=e[s])&&(r=(n?g(t,o,r):g(r))||r);return n&&r&&y(t,o,r),r},k=(e,t,o)=>t.has(e)||f("Cannot "+o),b=(e,t,o)=>t.has(e)?f("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,o),c=(e,t,o)=>(k(e,t,"access private method"),o),a,i,u=class extends d{constructor(e){super(e),b(this,a)}getAgents(){return c(this,a,i).call(this),[this.routerAgent,...Object.values(this.agentsMap)]}buildEdges(e){c(this,a,i).call(this);let t=p(this.routerAgent,0),o=new Map;for(let[n,[r]]of Object.entries(this.agentsMap).entries())o.set(r,p(e[n+1],n+1));return[{from:t,decide:n=>{let r=n[this.routerOutputKey];if(typeof r!="string"||!r)throw new Error("RouterWorkflow decideRoute could not determine next agent from state.");let s=o.get(r);if(!s)throw new Error(`RouterWorkflow decideRoute returned unknown agent: ${r}. Expected one of: ${Object.keys(this.agentsMap).join(", ")||"(none)"}.`);return s}}]}getEntryNode(){return c(this,a,i).call(this),p(this.routerAgent,0)}isTerminalAgent(e,t){return t>0}validateAgents(e){c(this,a,i).call(this),super.validateAgents(e)}};a=new WeakSet;i=function(){if(!Object.keys(this.agentsMap).length)throw new Error("RouterWorkflow requires a non-empty agentsMap.")};h([l()],u.prototype,"agentsMap",2);h([l()],u.prototype,"routerAgent",2);h([l()],u.prototype,"routerOutputKey",2);u=h([w("RouterWorkflow")],u);return u},"core/accessorSupport/decorators",a)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import b from"./
|
|
2
|
+
import b from"./RHF452M7.js";import a from"./VV57ZUOI.js";import{c as m}from"./3S7PBYVD.js";import"./CJIV4KJZ.js";import"./IKEF7ZHH.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([{property:n,subclass:l},{watch:w},c])=>{var d=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=(e,r,s,o)=>{for(var t=o>1?void 0:o?f(r,s):r,i=e.length-1,a;i>=0;i--)(a=e[i])&&(t=(o?a(r,s,t):a(t))||t);return o&&t&&d(r,s,t),t},h=class extends c{constructor(e){super(e)}initialize(){this.addHandles(w(()=>[this.name,this.description,this.inputSchema,this.outputSchema,this.workflow],()=>this.generate(),{initial:!0,sync:!0}))}getSchemas(){return[this.inputSchema,...this.workflow.getAgents().flatMap(e=>e.getSchemas()),this.outputSchema].filter(Boolean)}generate(){let{workspace:e,createGraph:r}=this.workflow.generate();if(this._set("workspace",e),!this.middlewares?.length)this._set("createGraph",r);else{let s=this.id,o={[s]:async(i,a)=>await r().compile().invoke(i,a)},t=[{from:s,decide:()=>{}}];this._set("createGraph",()=>m(o,t,e,{agent:this,entryNode:s,middlewares:this.middlewares}))}}};p([n()],h.prototype,"workflow",2);p([n()],h.prototype,"inputSchema",2);p([n()],h.prototype,"outputSchema",2);h=p([l("WorkflowAgent")],h);return h},"core/accessorSupport/decorators","core/reactiveUtils",a,b)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as t}from"./
|
|
2
|
+
import{a as t}from"./4RZPOYZ7.js";export default $arcgis.t(([])=>{var d=async(o,i)=>{let r=o.tool_calls??[];if(r.length===0){await t({text:`LLM did not request any tool calls: ${String(o?.content)}`},i);return}await Promise.all(r.map(async a=>await t({text:`LLM invoked ${a.name} tool with arguments: ${JSON.stringify(a.args,null,2)}`},i)))};return d},"identity/IdentityManager","portal/Portal","config","core/reactiveUtils","layers/FeatureLayer","request")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{wc as u}from"./
|
|
2
|
+
import{wc as u}from"./IKEF7ZHH.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([d,{property:a,subclass:h}])=>{var l=Object.defineProperty,m=Object.getOwnPropertyDescriptor,s=(e,t,n,r)=>{for(var o=r>1?void 0:r?m(t,n):t,c=e.length-1,p;c>=0;c--)(p=e[c])&&(o=(r?p(t,n,o):p(o))||o);return r&&o&&l(t,n,o),o},i=class extends d{constructor(e){super(e),this.resultMode="continue",this.middlewares=[]}getTool(){return u(this._executeWithMiddlewares.bind(this),{name:this.name,description:this.description,returnDirect:this.resultMode==="terminal",schema:this.inputSchema})}async _executeWithMiddlewares(e,t){let n=async r=>{let o=await this.execute(r.input,r.config);return this._validateOutput(o)};return await this.middlewares.reduceRight((r,o)=>async c=>await o.handler(c,r),n)({config:t,input:e,tool:this,toolCallId:f(t)})}_validateOutput(e){if(!this.outputSchema)return e;let t=this.outputSchema.safeParse(e);if(!t.success)throw new Error(`FunctionTool output schema validation failed: ${t.error.message}`);return t.data}};s([a()],i.prototype,"name",2);s([a()],i.prototype,"description",2);s([a()],i.prototype,"resultMode",2);s([a()],i.prototype,"inputSchema",2);s([a()],i.prototype,"outputSchema",2);s([a()],i.prototype,"middlewares",2);s([a()],i.prototype,"execute",2);i=s([h("FunctionTool")],i);function f(e){let t=e?.toolCall;return typeof t?.id=="string"?t.id:void 0}return i},"core/Accessor","core/accessorSupport/decorators")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import c from"./
|
|
2
|
+
import c from"./HOCTVCHH.js";import b from"./QZVAGRWA.js";import a from"./NRMBMWI5.js";import{a as v,c as F}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as x,z as S}from"./MAV3DW27.js";import"./ADYIXCSG.js";import{a as n}from"./4RZPOYZ7.js";import"./6LZ6GOHF.js";import{a as w,b as h,q as E,ta as I}from"./CJIV4KJZ.js";import"./IKEF7ZHH.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,{l:L},{A:z,B:u,a:$,m:C,o:m,p:N,q:A,r:R,s:T,t:b,u:_,v:V,w:q,x:j,y:k,z:M},D])=>{var B=.7,P=10,J=async(t,r)=>{try{await n({text:"Similarity search to find fields"},r);let e=m(r,"fieldSearch"),i=m(r,"layersAndFieldsRegistry"),o=m(r,"embeddingCache"),a=await e.searchFields({text:t.agentExecutionContext.assignedTask,layerIds:t.vectorSearchLayerIds,minScore:B,topResults:P,embeddingCache:o}),p=a.map(({layerId:c,results:d})=>{let g=d.map(s=>` - ${s.name} (${s.score.toFixed(2)})`).join(`
|
|
3
3
|
`);return`${i.get(c)?.layerItem.name??c}:
|
|
4
4
|
${g}`}).join(`
|
|
5
5
|
`),l;return a.length>0?l=`Vector search completed. Matching layers and fields with scores:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import a from"./
|
|
2
|
+
import a from"./RHF452M7.js";import"./3S7PBYVD.js";import"./CJIV4KJZ.js";import"./IKEF7ZHH.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([{property:g,subclass:p},{c:d,d:u}])=>{var f=Object.defineProperty,w=Object.getOwnPropertyDescriptor,c=(e,r,n,o)=>{for(var t=o>1?void 0:o?w(r,n):r,i=e.length-1,a;i>=0;i--)(a=e[i])&&(t=(o?a(r,n,t):a(t))||t);return o&&t&&f(r,n,t),t},s=class extends u{constructor(e){super(e)}getAgents(){return this.agents}buildNodes(e){let r=super.buildNodes(e);return r[l]=()=>({}),r}buildEdges(e){let r=this.condition;if(!r)throw new Error("ConditionalWorkflow requires a condition.");let n=d(e[0],0),o=d(e[1],1);return[{from:l,decide:async(t,i)=>await Promise.resolve(r(t,i))?n:o}]}getEntryNode(){return l}isTerminalAgent(){return!0}validateAgents(e){if(super.validateAgents(e),e.length!==2)throw new Error(`ConditionalWorkflow requires exactly 2 agents; received ${e.length}.`)}};c([g()],s.prototype,"condition",2);c([g()],s.prototype,"agents",2);s=c([p("ConditionalWorkflow")],s);var l="__conditional_decide";return s},"core/accessorSupport/decorators",a)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{Z as c}from"./
|
|
2
|
+
import{Z as c}from"./IKEF7ZHH.js";function f(e,s,t){return{...e,status:s,summary:t}}function g(e){let s=Object.entries(e).filter(([t,n])=>t!=="agentExecutionContext"&&t!=="outputMessage"&&t!=="summary"&&t!=="status"&&n!==void 0);if(s.length!==0)try{return JSON.stringify(Object.fromEntries(s),null,2)}catch{return}}function m(e,s,t=[]){let n=s.safeParse(e);if(n.success){let u={...n.data},r=g(u),a=r??"LLMAgent produced structured output.",o=r??u.outputMessage,i={...u,...o?{outputMessage:o}:{},agentExecutionContext:{messages:[...t,new c(typeof o=="string"&&o.trim()?o:a)]}};return f(i,"success",a)}else throw new Error(`LLMAgent output schema validation failed: ${n.error.message}`)}function l(e,s){let t={outputMessage:e.outputMessage};if(s){let n=s.shape,u=e;for(let r of Object.keys(n??{}))r in e&&(t[r]=u[r])}return t}export{f as a,m as b,l as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import a from"./
|
|
2
|
+
import a from"./RHF452M7.js";import"./3S7PBYVD.js";import"./CJIV4KJZ.js";import"./IKEF7ZHH.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([{property:g,subclass:y},{c:p,d:w}])=>{var b=Object.defineProperty,k=Object.getOwnPropertyDescriptor,v=e=>{throw TypeError(e)},h=(e,t,r,s)=>{for(var n=s>1?void 0:s?k(t,r):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(n=(s?a(t,r,n):a(n))||n);return s&&n&&b(t,r,n),n},A=(e,t,r)=>t.has(e)||v("Cannot "+r),M=(e,t,r)=>t.has(e)?v("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),m=(e,t,r)=>(A(e,t,"access private method"),r),c,u,i=class extends w{constructor(e){super(e),M(this,c)}getAgents(){let e=Object.values(this.agentsMap);return this.defaultAgent?e.concat(this.defaultAgent):e}buildNodes(e){let t=super.buildNodes(e);return t[d]=()=>({}),t}buildEdges(e){m(this,c,u).call(this);let t=this.resolver,r=new Map;for(let[o,[a]]of Object.entries(this.agentsMap).entries())r.set(a,p(e[o],o));let{defaultAgent:s}=this,n=s?p(s,e.length-1):void 0;return[{from:d,decide:async(o,a)=>{let l=await Promise.resolve(t(o,a));if(!l)return;let f=r.get(l);if(f)return f;if(s)return n;throw new Error(`SwitchWorkflow resolver returned unknown case: ${l}. Expected one of: ${Object.keys(this.agentsMap).join(", ")||"(none)"}.`)}}]}getEntryNode(){return d}isTerminalAgent(){return!0}validateAgents(e){m(this,c,u).call(this),super.validateAgents(e)}};c=new WeakSet;u=function(){if(!Object.keys(this.agentsMap).length)throw new Error("SwitchWorkflow requires a non-empty agentsMap.")};h([g()],i.prototype,"agentsMap",2);h([g()],i.prototype,"resolver",2);h([g()],i.prototype,"defaultAgent",2);i=h([y("SwitchWorkflow")],i);var d="__switch_decide";return i},"core/accessorSupport/decorators",a)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{b as Mo}from"./ADYIXCSG.js";import{a as et}from"./
|
|
2
|
+
import{b as Mo}from"./ADYIXCSG.js";import{a as et}from"./4RZPOYZ7.js";import{b as ni,c as oi,d as ii}from"./6LZ6GOHF.js";import{E as Go,F as Xo,G as Es,H as Yo,I as Mt,J as Tn,K as Qo,L as ei,M as ti,N as ri,O as Cn,P as Rn,Q as si,_ as ee}from"./CJIV4KJZ.js";import{Nb as C,P as ks,Q as Lo,S as Uo,Sb as Nt,Z as ae,_ as Ts,aa as $t,ac as Jo,ba as Cs,ca as Do,fb as Jr,ga as Fo,j as zo,jb as kn,k as ie,ka as Ko,kb as Ho,lb as Zo,nb as Gr,oc as Rs,pa as vn,q as jo,r as Ps,sa as Bo,tc as Ss,vb as Vo,x as On,y as Pn,z as vs}from"./IKEF7ZHH.js";import{a as oe}from"./WNS5ZUF5.js";import{$ as Wo,Dd as I,j as qo}from"./ZEYIBYSF.js";export default $arcgis.t(([Pu,lp,cp])=>{function Xr(t,e){return t.lc_error_code=e,t.message=`${t.message}
|
|
3
3
|
|
|
4
4
|
Troubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${e}/
|
|
5
5
|
`,t}function O(t,e,r,s,n){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r}function m(t,e,r,s){if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?s:r==="a"?s.call(t):s?s.value:e.get(t)}var En=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return En=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,s=>(+s^r()&15>>+s/4).toString(16))};function Yr(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var Qr=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)};var w=class extends Error{},M=class t extends w{constructor(e,r,s,n){super(`${t.makeMessage(e,r,s)}`),this.status=e,this.headers=n,this.requestID=n?.get("x-request-id"),this.error=r;let o=r;this.code=o?.code,this.param=o?.param,this.type=o?.type}static makeMessage(e,r,s){let n=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):s;return e&&n?`${e} ${n}`:e?`${e} status code (no body)`:n||"(no status code or body)"}static generate(e,r,s,n){if(!e||!n)return new je({message:s,cause:Qr(r)});let o=r?.error;return e===400?new zt(e,o,s,n):e===401?new jt(e,o,s,n):e===403?new Lt(e,o,s,n):e===404?new Ut(e,o,s,n):e===409?new Dt(e,o,s,n):e===422?new Ft(e,o,s,n):e===429?new Kt(e,o,s,n):e>=500?new Bt(e,o,s,n):new t(e,o,s,n)}},z=class extends M{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},je=class extends M{constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},he=class extends je{constructor({message:e}={}){super({message:e??"Request timed out."})}},zt=class extends M{},jt=class extends M{},Lt=class extends M{},Ut=class extends M{},Dt=class extends M{},Ft=class extends M{},Kt=class extends M{},Bt=class extends M{},qt=class extends w{constructor(){super("Could not parse response content as the length limit was reached")}},Wt=class extends w{constructor(){super("Could not parse response content as the request was rejected by the content filter")}},_e=class extends Error{constructor(e){super(e)}},tt=class extends M{constructor(e,r,s){let n="OAuth2 authentication error",o;if(r&&typeof r=="object"){let i=r;o=i.error;let a=i.error_description;a&&typeof a=="string"?n=a:o&&(n=o)}super(e,r,n,s),this.error_code=o}},es=class extends w{constructor(e,r,s){super(e),this.provider=r,this.cause=s}};var Nu=/^[a-z][a-z0-9+.-]*:/i,ai=t=>Nu.test(t),J=t=>(J=Array.isArray,J(t)),Sn=J;function $s(t){return typeof t!="object"?{}:t??{}}function $n(t){if(!t)return!0;for(let e in t)return!1;return!0}function ui(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ts(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)}var li=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new w(`${t} must be an integer`);if(e<0)throw new w(`${t} must be a positive integer`);return e};var ci=t=>{try{return JSON.parse(t)}catch{return}};var ge=t=>new Promise(e=>setTimeout(e,t));var Le="6.37.0";var di=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function Mu(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}var zu=()=>{let t=Mu();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Le,"X-Stainless-OS":mi(Deno.build.os),"X-Stainless-Arch":pi(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Le,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Le,"X-Stainless-OS":mi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":pi(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=ju();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Le,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Le,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function ju(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let s=r.exec(navigator.userAgent);if(s){let n=s[1]||0,o=s[2]||0,i=s[3]||0;return{browser:e,version:`${n}.${o}.${i}`}}}return null}var pi=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",mi=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),fi,hi=()=>fi??(fi=zu());function Ns(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function Nn(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function Ms(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return Nn({start(){},async pull(r){let{done:s,value:n}=await e.next();s?r.close():r.enqueue(n)},async cancel(){await e.return?.()}})}function Mn(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function zn(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}var gi=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)});var jn="RFC3986",Ln=t=>String(t),Un={RFC1738:t=>String(t).replace(/%20/g,"+"),RFC3986:Ln},yi="RFC1738";var zs=(t,e)=>(zs=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),zs(t,e)),ye=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})();var Dn=1024,Ai=(t,e,r,s,n)=>{if(t.length===0)return t;let o=t;if(typeof t=="symbol"?o=Symbol.prototype.toString.call(t):typeof t!="string"&&(o=String(t)),r==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(a){return"%26%23"+parseInt(a.slice(2),16)+"%3B"});let i="";for(let a=0;a<o.length;a+=Dn){let l=o.length>=Dn?o.slice(a,a+Dn):o,u=[];for(let f=0;f<l.length;++f){let d=l.charCodeAt(f);if(d===45||d===46||d===95||d===126||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||n===yi&&(d===40||d===41)){u[u.length]=l.charAt(f);continue}if(d<128){u[u.length]=ye[d];continue}if(d<2048){u[u.length]=ye[192|d>>6]+ye[128|d&63];continue}if(d<55296||d>=57344){u[u.length]=ye[224|d>>12]+ye[128|d>>6&63]+ye[128|d&63];continue}f+=1,d=65536+((d&1023)<<10|l.charCodeAt(f)&1023),u[u.length]=ye[240|d>>18]+ye[128|d>>12&63]+ye[128|d>>6&63]+ye[128|d&63]}i+=u.join("")}return i};function Ii(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function Fn(t,e){if(J(t)){let r=[];for(let s=0;s<t.length;s+=1)r.push(e(t[s]));return r}return e(t)}var xi={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},wi=function(t,e){Array.prototype.push.apply(t,J(e)?e:[e])},bi,K={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Ai,encodeValuesOnly:!1,format:jn,formatter:Ln,indices:!1,serializeDate(t){return(bi??(bi=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};function Uu(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}var Kn={};function Oi(t,e,r,s,n,o,i,a,l,u,f,d,y,_,g,x,$,h){let A=t,T=h,S=0,q=!1;for(;(T=T.get(Kn))!==void 0&&!q;){let U=T.get(t);if(S+=1,typeof U<"u"){if(U===S)throw new RangeError("Cyclic object value");q=!0}typeof T.get(Kn)>"u"&&(S=0)}if(typeof u=="function"?A=u(e,A):A instanceof Date?A=y?.(A):r==="comma"&&J(A)&&(A=Fn(A,function(U){return U instanceof Date?y?.(U):U})),A===null){if(o)return l&&!x?l(e,K.encoder,$,"key",_):e;A=""}if(Uu(A)||Ii(A)){if(l){let U=x?e:l(e,K.encoder,$,"key",_);return[g?.(U)+"="+g?.(l(A,K.encoder,$,"value",_))]}return[g?.(e)+"="+g?.(String(A))]}let j=[];if(typeof A>"u")return j;let Z;if(r==="comma"&&J(A))x&&l&&(A=Fn(A,l)),Z=[{value:A.length>0?A.join(",")||null:void 0}];else if(J(u))Z=u;else{let U=Object.keys(A);Z=f?U.sort(f):U}let N=a?String(e).replace(/\./g,"%2E"):String(e),W=s&&J(A)&&A.length===1?N+"[]":N;if(n&&J(A)&&A.length===0)return W+"[]";for(let U=0;U<Z.length;++U){let F=Z[U],$o=typeof F=="object"&&typeof F.value<"u"?F.value:A[F];if(i&&$o===null)continue;let wn=d&&a?F.replace(/\./g,"%2E"):F,Su=J(A)?typeof r=="function"?r(W,wn):W:W+(d?"."+wn:"["+wn+"]");h.set(t,S);let No=new WeakMap;No.set(Kn,h),wi(j,Oi($o,Su,r,s,n,o,i,a,r==="comma"&&x&&J(A)?null:l,u,f,d,y,_,g,x,$,No))}return j}function Du(t=K){if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");let e=t.charset||K.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let r=jn;if(typeof t.format<"u"){if(!zs(Un,t.format))throw new TypeError("Unknown format option provided.");r=t.format}let s=Un[r],n=K.filter;(typeof t.filter=="function"||J(t.filter))&&(n=t.filter);let o;if(t.arrayFormat&&t.arrayFormat in xi?o=t.arrayFormat:"indices"in t?o=t.indices?"indices":"repeat":o=K.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");let i=typeof t.allowDots>"u"?t.encodeDotInKeys?!0:K.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:K.addQueryPrefix,allowDots:i,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:K.allowEmptyArrays,arrayFormat:o,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:K.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?K.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:K.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:K.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:K.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:K.encodeValuesOnly,filter:n,format:r,formatter:s,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:K.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:K.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:K.strictNullHandling}}function Pi(t,e={}){let r=t,s=Du(e),n,o;typeof s.filter=="function"?(o=s.filter,r=o("",r)):J(s.filter)&&(o=s.filter,n=o);let i=[];if(typeof r!="object"||r===null)return"";let a=xi[s.arrayFormat],l=a==="comma"&&s.commaRoundTrip;n||(n=Object.keys(r)),s.sort&&n.sort(s.sort);let u=new WeakMap;for(let y=0;y<n.length;++y){let _=n[y];s.skipNulls&&r[_]===null||wi(i,Oi(r[_],_,a,l,s.allowEmptyArrays,s.strictNullHandling,s.skipNulls,s.encodeDotInKeys,s.encode?s.encoder:null,s.filter,s.sort,s.allowDots,s.serializeDate,s.format,s.formatter,s.encodeValuesOnly,s.charset,u))}let f=i.join(s.delimiter),d=s.addQueryPrefix===!0?"?":"";return s.charsetSentinel&&(s.charset==="iso-8859-1"?d+="utf8=%26%2310003%3B&":d+="utf8=%E2%9C%93&"),f.length>0?d+f:""}function vi(t){return Pi(t,{arrayFormat:"brackets"})}function Ci(t){let e=0;for(let n of t)e+=n.length;let r=new Uint8Array(e),s=0;for(let n of t)r.set(n,s),s+=n.length;return r}var ki;function Ht(t){let e;return(ki??(e=new globalThis.TextEncoder,ki=e.encode.bind(e)))(t)}var Ti;function Bn(t){let e;return(Ti??(e=new globalThis.TextDecoder,Ti=e.decode.bind(e)))(t)}var te,re,rt=class{constructor(){te.set(this,void 0),re.set(this,void 0),O(this,te,new Uint8Array,"f"),O(this,re,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?Ht(e):e;O(this,te,Ci([m(this,te,"f"),r]),"f");let s=[],n;for(;(n=Ku(m(this,te,"f"),m(this,re,"f")))!=null;){if(n.carriage&&m(this,re,"f")==null){O(this,re,n.index,"f");continue}if(m(this,re,"f")!=null&&(n.index!==m(this,re,"f")+1||n.carriage)){s.push(Bn(m(this,te,"f").subarray(0,m(this,re,"f")-1))),O(this,te,m(this,te,"f").subarray(m(this,re,"f")),"f"),O(this,re,null,"f");continue}let o=m(this,re,"f")!==null?n.preceding-1:n.preceding,i=Bn(m(this,te,"f").subarray(0,o));s.push(i),O(this,te,m(this,te,"f").subarray(n.index),"f"),O(this,re,null,"f")}return s}flush(){return m(this,te,"f").length?this.decode(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import c from"./
|
|
2
|
+
import c from"./QZVAGRWA.js";import a from"./NRMBMWI5.js";import{a as L,c as R}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as E,z as $}from"./MAV3DW27.js";import"./ADYIXCSG.js";import{a as d}from"./4RZPOYZ7.js";import"./6LZ6GOHF.js";import{a as N,b as T,ta as b}from"./CJIV4KJZ.js";import"./IKEF7ZHH.js";import{a as f}from"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,{k:C,l:F},{a:_,b:v,c:x,d:I,e:A,f:M,g:Z,h:q,i:j,j:V,k:O,l:z,m:S,n:G,o:h,p:B}])=>{var w=[I,A,M,Z,q,j,V,O,z];async function H(e,t){let a=await S("navigation_tool_prompt"),{mapView:n}=x(t),l=n.map.bookmarks?.map(p=>p.name).filter(Boolean)??[],s=e.vectorSearchLayerResults?.length>0?e.vectorSearchLayerResults.map((p,W)=>`${W+1}. layerId=${p.id} | title=${p.title??""} | name=${p.name??""} | score=${p.score.toFixed(2)}`).join(`
|
|
3
3
|
`):"",c=e.vectorSearchFieldResults?.length>0?JSON.stringify(e.vectorSearchFieldResults,null,2):"",r=e.intent==="goToBookmark"&&l.length?`Available bookmarks:
|
|
4
4
|
${l.map(p=>`- ${p}`).join(`
|
|
5
5
|
`)}`:"",o=(e.intent==="goToLayer"||e.intent==="goToFeatures")&&e.vectorSearchLayerResults?.length?`Candidate layers:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import a from"./
|
|
2
|
+
import a from"./RHF452M7.js";import{a as C,c as N}from"./3S7PBYVD.js";import"./CJIV4KJZ.js";import"./IKEF7ZHH.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([{property:B,subclass:D},{a:h,b:S,c:p,d:A}])=>{var G=Object.defineProperty,z=Object.getOwnPropertyDescriptor,P=(t,e,s,n)=>{for(var r=n>1?void 0:n?z(e,s):e,o=t.length-1,a;o>=0;o--)(a=t[o])&&(r=(n?a(e,s,r):a(r))||r);return n&&r&&G(e,s,r),r},x=class extends A{constructor(t){super(t)}getAgents(){return this.agents}generate(){let t=this.getAgents();this.validateAgents(t);for(let o of t)o.generate();let e=S(t.flatMap(o=>o.getSchemas()));for(let[o]of t.entries())e[_(o)]=void 0;let s=C(e),n=this.buildNodes(t),r=this.buildEdges(t);return{workspace:s,createGraph:()=>N(n,r,s,{entryNode:this.getEntryNode(t)})}}getEntryNode(t){return y}isTerminalAgent(t,e){return!1}buildNodes(t){let e={};for(let[s,n]of t.entries()){let r=_(s),o=p(n,s);e[o]=async(a,u)=>{let l=await n.run(F(a,n),u),i={},m=i;return m[r]=l,i}}return e[y]=()=>({}),e[k]=s=>R(s,t),e}buildEdges(t){return[...t.map((e,s)=>({from:y,to:p(e,s)})),...t.map((e,s)=>({from:p(e,s),to:k}))]}};P([B()],x.prototype,"agents",2);x=P([D("ParallelWorkflow")],x);var y="__parallel_fanOut",k="__parallel_join";function _(t){return`__parallel_update_${t}`}function W(t,e){return Object.fromEntries(e.filter(s=>Object.hasOwn(t,s)).map(s=>[s,t[s]]))}function F(t,e){let s=e.inputSchema;return s?{...W(t,h(s)),agentExecutionContext:t.agentExecutionContext,outputMessage:t.outputMessage,status:void 0,summary:""}:{...t,status:void 0,summary:""}}function I(t,e){return t.outputSchema?W(e,h(t.outputSchema)):{}}function K(t,e){let s=t.agentExecutionContext?.messages??[],n=e.agentExecutionContext?.messages??[];return n.length>s.length?n.slice(s.length):void 0}function R(t,e){let s=[],n=[],r=[],o={},a={},u=new Set;for(let[m,J]of e.entries()){let E=_(m),d=t[E];if(a[E]=void 0,!d||typeof d!="object")continue;let c=d,b=c.outputMessage,O=K(t,c),v=c.summary,$=I(J,c),w=b.trim();typeof b=="string"&&w&&s.push(w);let j=v.trim();typeof v=="string"&&j&&n.push(j),Array.isArray(O)&&r.push(...O),c.status&&u.add(c.status);for(let[f,g]of Object.entries($))if(!(g===void 0||f.startsWith("__parallel_update_"))&&!M(t[f],g)){if(!Object.hasOwn(o,f)){o[f]=g;continue}if(!M(o[f],g))throw new Error(`ParallelWorkflow detected conflicting updates for state key "${f}".`)}}let l={...a,...o},i=l;return r.length>0&&(i.agentExecutionContext={...t.agentExecutionContext,messages:[...t.agentExecutionContext.messages,...r]}),s.length&&(i.outputMessage=s.join(`
|
|
3
3
|
|
|
4
4
|
`)),n.length&&(i.summary=n.join(`
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import a from"./
|
|
2
|
+
import a from"./NRMBMWI5.js";import{a as T,b as S}from"./4RZPOYZ7.js";import{_ as w,ea as Ee,g as Se,j as Q,k as B,pa as L,u as xe}from"./CJIV4KJZ.js";import{L as z,P as oe,_ as j,wc as f}from"./IKEF7ZHH.js";import{a as s}from"./WNS5ZUF5.js";import{Dd as I}from"./ZEYIBYSF.js";export default $arcgis.t(([Ae,M,ie,Le,,Ce,ot,{addressToLocations:at},nt,it,De,{createRenderer:st},{getSchemesByTag:lt,getSchemes:ct},{getBackgroundColorTheme:Re},{createAgeRenderer:ut,createContinuousRenderer:dt},{getSchemesByTag:we},{createContinuousRenderer:pt},{createRenderer:mt},{getSchemesByTag:ht},{createRenderer:ft},{getSchemesByTag:yt},{createRenderer:gt},{getSchemesByTag:wt},{createRenderer:bt},{getSchemesByTag:vt},{createAgeRenderer:Tt,createContinuousRenderer:St},{createRenderer:xt},{getSchemesByTag:Et},It,Oe,Pe,{formatDateOnly:Nt,convertDateFormatToIntlOptions:K,formatTimeOnly:$t,formatDate:qe},kt,Ft,Mt,At,Ct,Ge,,{fetchKnowledgeGraph:_e,executeQueryStreaming:Rt,executeSearchStreaming:qt},_t,{b:D,c:Ie,k:Ne}])=>{var Me=e=>Array.isArray(e)&&e.every(z),Xe=e=>typeof e=="object"&&e!=null&&"messages"in e&&Me(e.messages),et=e=>typeof e=="object"&&e!=null&&"lg_tool_call"in e,U=class extends Ee{tools;handleToolErrors=!0;trace=!1;constructor(e,t){let{name:r,tags:o,handleToolErrors:a}=t??{};super({name:r,tags:o,func:(n,l)=>this.run(n,l)}),this.tools=e,this.handleToolErrors=a??this.handleToolErrors}async runTool(e,t){let r=this.tools.find(o=>o.name===e.name);try{if(r===void 0)throw new Error(`Tool "${e.name}" not found.`);let o=await r.invoke({...e,type:"tool_call"},t);return z(o)&&o.getType()==="tool"||B(o)?o:new oe({status:"success",name:r.name,content:typeof o=="string"?o:JSON.stringify(o),tool_call_id:e.id})}catch(o){if(!this.handleToolErrors||xe(o))throw o;return new oe({status:"error",content:`Error: ${o.message}
|
|
3
3
|
Please fix your mistakes.`,name:e.name,tool_call_id:e.id??""})}}async run(e,t){let r;if(et(e))r=[await this.runTool(e.lg_tool_call,t)];else{let n;if(Me(e))n=e;else if(Xe(e))n=e.messages;else throw new Error("ToolNode only accepts BaseMessage[] or { messages: BaseMessage[] } as input.");let l=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 u=n[c];if(j(u)){i=u;break}}if(i==null||!j(i))throw new Error("ToolNode only accepts AIMessages as input.");r=await Promise.all(i.tool_calls?.filter(c=>c.id==null||!l.has(c.id)).map(c=>this.runTool(c,t))??[])}if(!r.some(B))return Array.isArray(e)?r:{messages:r};let o=[],a=null;for(let n of r)B(n)?n.graph===Q.PARENT&&Array.isArray(n.goto)&&n.goto.every(l=>Se(l))?a?a.goto.push(...n.goto):a=new Q({graph:Q.PARENT,goto:n.goto}):o.push(n):o.push(Array.isArray(e)?[n]:{messages:[n]});return a&&o.push(a),o}};var An=w.Root({llmInputMessages:w({reducer:(e,t)=>L([],t),default:()=>[]})});var O=(e,t)=>t??e,Oi=w.Root({...Ie(),intent:w({reducer:O}),vectorSearchLayerResults:w({reducer:O,default:()=>[]}),vectorSearchFieldResults:w({reducer:O}),navigationInternalState:w({reducer:O,default:()=>({toolCallMessage:void 0})})});async function zt(e,t){let r=M.getDefault().helperServices,o=r.geocode.find(d=>d.name==="ArcGIS World Geocoding Service")??r.geocode[0];if(!o)throw new Error("No geocoding service found in helperServices.");let a=o.url,n=`${ie.assetsPath?.endsWith("/")?ie.assetsPath:`${ie.assetsPath}/`}esri/images/search/search-symbol-32.png`,l=(await at(a,{address:{SingleLine:e},outFields:["Match_addr"]}))?.[0];if(!l?.extent||!l.location)throw new Error(`Could not find location for: ${e}`);let i=new nt({url:n,width:24,height:24}),c=new ot({geometry:l.location,symbol:i});t.graphics.removeAll(),t.graphics.add(c),await t.goTo(l.extent);let u={address:l.address??"",location:l.location?l.location.toJSON():null,extent:l.extent?l.extent.toJSON():null};return{text:`Successfully zoomed to ${e}.`,sharedStatePatch:{lastResolvedLocation:{value:u}}}}var jt=["mapView"];function N(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("NavigationAgent context missing");let r=jt.filter(o=>!(o in t));if(r.length)throw new Error(`NavigationAgent context missing: ${r.join(", ")}`);return t}async function Lt({address:e},t){let{mapView:r}=N(t);return await zt(e,r)}var Dt=s.object({address:s.string().describe("The full address or place name to locate.")}),Pi=f(Lt,{name:"goToAddress",description:"Geocodes an address using Esri's World Geocoding Service and zooms the map to that location.",schema:Dt});async function Ot(e,t){let r=t.map.bookmarks;if(!r||r.length===0)throw new Error("No bookmarks found in the map.");let o=r.find(n=>n.name===e);if(!o)throw new Error(`Bookmark with name "${e}" not found.`);let a=o.viewpoint;if(!a)throw new Error(`Bookmark with name "${e}" does not have a valid viewpoint.`);return await t.goTo(a),{text:`Navigated to bookmark: ${e}`}}async function Pt({bookmarkName:e},t){let{mapView:r}=N(t);return await Promise.resolve(Ot(e,r))}var Gt=I.object({bookmarkName:I.string().describe("The name of the bookmark to navigate to.")}),Gi=f(Pt,{name:"goToBookmark",description:"Go to the extent of the bookmark with the given name.",schema:Gt});async function Vt(e,t,r){let o=r.map?.allLayers.find(l=>l.id===e);if(!o)return{text:`Error: Layer with id ${e} not found`};let a=t?.trim()?t:"1=1",n=o.createQuery();n.where=a;try{let{extent:l,count:i}=await o.queryExtent(n);if(i===0)return{text:`No features found in ${o.title} matching: ${a}`,where:a};if(l)await r.goTo(l);else return{text:`Error: Unable to determine extent for ${o.title}`,where:a};let c={layerId:e,layerTitle:o.title??e,where:a,count:i};return{text:`Successfully zoomed to ${i} feature(s) in ${o.title} matching: ${a}`,where:a,sharedStatePatch:{lastNavigatedFeatures:{value:c}}}}catch(l){return console.error("Error in goToFeatures:",l),{text:`Error: ${l instanceof Error?l.message:"Unknown error"}`,where:a}}}async function Qt({layerId:e,where:t},r){let{mapView:o}=N(r);return await Vt(e,t,o)}var Bt=I.object({layerId:I.string().describe("The layerId of the layer to zoom to."),where:I.string().describe("The sql-92 where clause used to query features to zoom to")}),Vi=f(Qt,{name:"goToFeatures",description:"Go to the features that match the given filter related to the given layerId.",schema:Bt});async function Ut(e){let t=new it({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:{wkid:4326}}).expand(.7);return await e.goTo(t),{text:"Successfully zoomed to world extent"}}async function Kt(e,t){let{mapView:r}=N(t);return await Ut(r)}var Wt=I.object({}),Qi=f(Kt,{name:"goToFullExtent",description:"Zooms the map to the full world extent using Esri's Geocoding Service.",schema:Wt});async function Ht(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 Jt(e,t){let{mapView:r}=N(t);return await Ht(r)}var Zt=s.object({}),Bi=f(Jt,{name:"goToHomeExtent",description:"Go to the initial web map view extent",schema:Zt});async function Yt(e,t){await t.when();let r=t.map?.allLayers.find(a=>a.id===e);if(!r)return console.warn(`[goToLayer] No matching FeatureLayer found for: ${e}`),{text:`Could not find layer for: ${e}`};let o;return(r.type==="link-chart"||r.type==="knowledge-graph-sublayer")&&t.map?.activeLinkChartLayer?o=t.map.diagramNodesExtent:o=r.fullExtent,o?(await t.goTo(o),r.visible=!0,{text:`Successfully zoomed to: ${r.title??""}`}):{text:"Layer has no defined extent. Cannot zoom to layer."}}async function Xt({layerId:e},t){let{mapView:r}=N(t);return await Yt(e,r)}var er=I.object({layerId:I.string().describe("The id of the layer to navigate to")}),Ui=f(Xt,{name:"goToLayer",description:"Zooms the map view to the full extent of the top matching layer.",schema:er});async function tr(e,t){return await t.goTo({scale:e}),{text:`Successfully zoomed to: ${e}`}}async function rr({scale:e},t){let{mapView:r}=N(t);return await tr(e,r)}var or=s.object({scale:s.number().describe("The map scale of the view to go to.")}),Ki=f(rr,{name:"goToScale",description:"Go to the specified view scale.",schema:or});async function ar(e,t,r){let o={target:new De({longitude:e.longitude,latitude:e.latitude,spatialReference:{wkid:4326}})};return r?.zoom!==void 0&&(o.zoom=r.zoom),r?.scale!==void 0&&(o.scale=r.scale),await t.goTo(o),{text:`Successfully navigated to: ${[`(${e.latitude}\xB0, ${e.longitude}\xB0)`,r?.zoom!==void 0?`zoom ${r.zoom}`:"",r?.scale!==void 0?`scale 1:${r.scale}`:""].filter(Boolean).join(", ")}`}}async function nr({center:e,zoom:t,scale:r},o){let{mapView:a}=N(o);return await ar(e,a,{zoom:t,scale:r})}var ir=s.object({center:s.object({longitude:s.number().describe("The longitude (x-coordinate) of the point to navigate to."),latitude:s.number().describe("The latitude (y-coordinate) of the point to navigate to.")}),zoom:s.number().optional().describe("The zoom level. Higher values = more zoomed in."),scale:s.number().optional().describe("The map scale. Alternative to zoom. Smaller numbers = more zoomed in.")}),Wi=f(nr,{name:"goToViewpoint",description:"Go to the specified viewpoint. This can contain a combination of scale, center, zoom, etc.",schema:ir});async function sr(e,t){return await t.goTo({zoom:e}),{text:`Successfully zoomed to: ${e}`}}async function lr({zoom:e},t){let{mapView:r}=N(t);return await sr(e,r)}var cr=s.object({zoom:s.number().min(1).max(20).describe("The zoom level of the view to go to.")}),Hi=f(lr,{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:cr}),ze=Object.assign({"../agents/arcgisKnowledge/prompts/arcgis_knowledge_current_lc_context.md":()=>import("./KMQ3SP4I.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_current_map_context.md":()=>import("./5QAHYX7Y.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_lucene_generation_prompt.md":()=>import("./5ZZGKP7N.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_summarize_result_prompt.md":()=>import("./AXDZBBNL.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_tool_prompt.md":()=>import("./ZS2TZ6BF.js").then(e=>e.default),"../agents/dataExploration/prompts/data_explore_filter_prompt.md":()=>import("./LQ6R5YRN.js").then(e=>e.default),"../agents/dataExploration/prompts/data_explore_query_prompt.md":()=>import("./TNMXWUXU.js").then(e=>e.default),"../agents/dataExploration/prompts/summarize_query_response_prompt.md":()=>import("./T537PKP4.js").then(e=>e.default),"../agents/help/prompts/help_prompt.md":()=>import("./F2AHA4GB.js").then(e=>e.default),"../agents/layerStyling/prompts/layer_styling_prompt.md":()=>import("./FX7UOGHP.js").then(e=>e.default),"../agents/navigation/prompts/navigation_intent_prompt.md":()=>import("./NE7E52YR.js").then(e=>e.default),"../agents/navigation/prompts/navigation_tool_prompt.md":()=>import("./6YMR4QSD.js").then(e=>e.default)});async function le(e){let t=Object.entries(ze).find(([r])=>r.endsWith(`/${e}.md`));if(!t)throw new Error(`Prompt not found: ${e}
|
|
4
4
|
Available prompts:
|
|
5
5
|
${Object.keys(ze).join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as i,c}from"./
|
|
2
|
+
import{a as i,c}from"./3S7PBYVD.js";export default $arcgis.t(([m,{subclass:p}])=>{function a(t){return t?Object.keys(t.shape??{}):[]}function d(t){let e={};for(let n of t)for(let s of a(n))e[s]=void 0;return e}function g(t,e){return Object.fromEntries(e.filter(n=>Object.hasOwn(t,n)).map(n=>[n,t[n]]))}function l(t,e){return`${t.id}_${e}`}function h(t,e){let n=e.inputSchema;return n?{...g(t,a(n)),agentExecutionContext:t.agentExecutionContext,outputMessage:t.outputMessage,status:void 0,summary:""}:{...t,status:void 0,summary:""}}function x(t,e){return t.outputSchema?g(e,a(t.outputSchema)):{}}function y(t){let e={outputMessage:t.outputMessage,status:t.status,summary:t.summary};return t.agentExecutionContext&&(e.agentExecutionContext=t.agentExecutionContext),e}function v(t,e){return async(n,s)=>{let o=await t.run(h(n,t),s),r=x(t,o);return e||o.status==="failed"?{...r,...y(o)}:{...r,outputMessage:o.outputMessage}}}var w=Object.getOwnPropertyDescriptor,E=(t,e,n,s)=>{for(var o=s>1?void 0:s?w(e,n):e,r=t.length-1,u;r>=0;r--)(u=t[r])&&(o=u(o)||o);return o},f=class extends m{generate(){let t=this.getAgents();this.validateAgents(t);for(let r of t)r.generate();let e=d(t.flatMap(r=>r.getSchemas())),n=i(e),s=this.buildNodes(t),o=this.buildEdges(t);return{workspace:n,createGraph:()=>c(s,o,n,{entryNode:this.getEntryNode(t)})}}buildNodes(t){let e={};for(let[n,s]of t.entries())e[l(s,n)]=v(s,this.isTerminalAgent(t,n));return e}validateAgents(t){if(!t.length)throw new Error("Workflow requires at least one agent.")}};f=E([p("BaseWorkflow")],f);return{a:a,b:d,c:l,d:f}},"core/Accessor","core/accessorSupport/decorators")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import b from"./
|
|
2
|
+
import b from"./QZVAGRWA.js";import a from"./NRMBMWI5.js";import{a as y,c as E}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as u,z as d}from"./MAV3DW27.js";import"./ADYIXCSG.js";import{a as p}from"./4RZPOYZ7.js";import"./6LZ6GOHF.js";import{a as h,b as l,ta as f}from"./CJIV4KJZ.js";import"./IKEF7ZHH.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,{l:x},{I:c,J:H,a:S,m:_,n:w,o:m,p:v}])=>{var C=[H],b=e=>{if(!e||e.size===0)return"No layers available in this map.";let t=Array.from(e.values()).map(({layerItem:o,fieldRegistry:a},s)=>{let r=Array.from(a.values()).map(n=>n.name).slice(0,10).join(", "),i=a.size>10?` (and ${a.size-10} more)`:"";return`${s+1}. "${o.title}". Description: ${o.description}
|
|
3
3
|
Fields: ${r}${i}`}).join(`
|
|
4
4
|
|
|
5
5
|
`);return`This map contains ${e.size} layer(s):
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as u,b as g,c as S}from"./
|
|
2
|
+
import{a as u,b as g,c as S}from"./LODKJRS4.js";import a from"./VV57ZUOI.js";import{b as m,c as f}from"./3S7PBYVD.js";import{u as p}from"./CJIV4KJZ.js";import"./IKEF7ZHH.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([{property:h,subclass:l},{watch:w},d])=>{var v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,o=(t,e,s,r)=>{for(var i=r>1?void 0:r?y(e,s):e,a=t.length-1,c;a>=0;a--)(c=t[a])&&(i=(r?c(e,s,i):c(i))||i);return r&&i&&v(e,s,i),i},n=class extends d{constructor(t){super(t)}initialize(){this.addHandles(w(()=>[this.name,this.description,this.inputSchema,this.outputSchema,this.execute],()=>{this.generate()},{initial:!0,sync:!0}))}getSchemas(){return[this.inputSchema,this.outputSchema].filter(Boolean)}generate(){let t=m(this.getSchemas());this._set("workspace",t);let e=`${this.id}-execute`,s={[e]:this._invokeExecuteNode.bind(this)},r=[{from:e,decide:()=>{}}];this._set("createGraph",()=>f(s,r,t,{agent:this,entryNode:e,middlewares:this.middlewares}))}async _invokeExecuteNode(t,e){try{return this.outputSchema?await this._invokeStructured(t,e):await this._invokeUnstructured(t,e)}catch(s){if(p(s))throw s;let r=s instanceof Error?s.message:String(s);return u({outputMessage:r},"failed",r)}}async _invokeStructured(t,e){if(!this.outputSchema)throw new Error("Output schema is required for structured invocation.");let s=this._validateInputState(t),r=await this.execute(s,e);if(typeof r=="string")throw new Error("Expected execute function to return an object matching the output schema, but received a string.");return g(r,this.outputSchema,t.agentExecutionContext.messages)}async _invokeUnstructured(t,e){let s=this._validateInputState(t),r=await this.execute(s,e),i=typeof r=="string"?r:JSON.stringify(r),a=i.trim()||"FunctionAgent completed.";return u({outputMessage:i},"success",a)}_validateInputState(t){if(!this.inputSchema)return t;let e=this.inputSchema.safeParse(S(t,this.inputSchema));if(!e.success)throw new Error(`FunctionAgent input schema validation failed: ${e.error.message}`);return{...t,...e.data}}};o([h()],n.prototype,"inputSchema",2);o([h()],n.prototype,"outputSchema",2);o([h()],n.prototype,"execute",2);n=o([l("FunctionAgent")],n);return n},"core/accessorSupport/decorators","core/reactiveUtils",a)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{$ as M,A as z,Aa as ia,B as A,Ba as ja,C as B,Ca as ka,Da as la,R as C,S as D,T as E,U as F,V as G,W as H,X as I,Y as J,Z as K,_ as L,a,aa as N,b,ba as O,c,ca as P,d,da as Q,e,f,fa as R,ga as S,h as g,ha as T,i as h,ia as U,j as i,ja as V,k as j,ka as W,l as k,la as X,m as l,ma as Y,n as m,na as Z,o as n,oa as _,p as o,pa as $,q as p,qa as aa,r as q,s as r,t as s,ta as ba,u as t,ua as ca,v as u,va as da,w as v,wa as ea,x as w,xa as fa,y as x,ya as ga,z as y,za as ha}from"./
|
|
2
|
+
import{$ as M,A as z,Aa as ia,B as A,Ba as ja,C as B,Ca as ka,Da as la,R as C,S as D,T as E,U as F,V as G,W as H,X as I,Y as J,Z as K,_ as L,a,aa as N,b,ba as O,c,ca as P,d,da as Q,e,f,fa as R,ga as S,h as g,ha as T,i as h,ia as U,j as i,ja as V,k as j,ka as W,l as k,la as X,m as l,ma as Y,n as m,na as Z,o as n,oa as _,p as o,pa as $,q as p,qa as aa,r as q,s as r,t as s,ta as ba,u as t,ua as ca,v as u,va as da,w as v,wa as ea,x as w,xa as fa,y as x,ya as ga,z as y,za as ha}from"./CJIV4KJZ.js";import"./IKEF7ZHH.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export{L as Annotation,H as AsyncBatchedStore,J as BaseChannel,E as BaseCheckpointSaver,k as BaseLangGraphError,G as BaseStore,K as BinaryOperatorAggregate,d as COMMAND_SYMBOL,i as Command,e as CommandInstance,ca as CompiledStateGraph,b as END,v as EmptyChannelError,u as EmptyInputError,R as Graph,l as GraphBubbleUp,o as GraphInterrupt,m as GraphRecursionError,n as GraphValueError,c as INTERRUPT,I as InMemoryStore,w as InvalidUpdateError,F as MemorySaver,da as MessageGraph,ia as MessagesAnnotation,aa as MessagesValue,ja as MessagesZodMeta,ka as MessagesZodState,x as MultipleSubgraphsError,p as NodeInterrupt,g as Overwrite,q as ParentCommand,_ as REMOVE_ALL_MESSAGES,X as ReducedValue,z as RemoteException,a as START,f as Send,ba as StateGraph,A as StateGraphInputError,Z as StateSchema,y as UnreachableNodeError,Y as UntrackedValue,W as UntrackedValueChannel,$ as addMessages,D as copyCheckpoint,C as emptyCheckpoint,ga as entrypoint,O as getConfig,P as getCurrentTaskInput,U as getJsonSchemaFromSchema,ha as getPreviousState,V as getSchemaDefaultGetter,M as getStore,B as getSubgraphsSeenSet,N as getWriter,Q as interrupt,j as isCommand,s as isGraphBubbleUp,t as isGraphInterrupt,h as isInterrupted,r as isParentCommand,T as isSerializableSchema,S as isStandardSchema,$ as messagesStateReducer,ea as pushMessage,fa as task,la as writer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as c}from"./
|
|
2
|
+
import{a as c}from"./3S7PBYVD.js";export default $arcgis.t(([l,{property:i,subclass:y},{watch:d}])=>{var w=Object.defineProperty,g=Object.getOwnPropertyDescriptor,t=(s,a,p,o)=>{for(var r=o>1?void 0:o?g(a,p):a,h=s.length-1,n;h>=0;h--)(n=s[h])&&(r=(o?n(a,p,r):n(r))||r);return o&&r&&w(a,p,r),r},m=()=>{throw new Error("createGraph method not implemented.")},e=class extends l{constructor(){super(...arguments),this.description="",this.middlewares=[],this.createGraph=m,this.workspace=c()}initialize(){this.addHandles([d(()=>[this.name,this.description],()=>this.generate(),{initial:!0,sync:!0}),d(()=>this.createGraph,()=>this._compiledGraph=void 0)])}get id(){return this.name.replace(/\s+/gu,"-").toLowerCase()}get registration(){return{id:this.id,name:this.name,description:this.description,createGraph:this.createGraph,workspace:this.workspace}}async run(s={},a){return this.createGraph===m&&this.generate(),this._compiledGraph=this._compiledGraph??this.createGraph().compile(),await this._compiledGraph.invoke(s,a)}};t([i({readOnly:!0})],e.prototype,"id",1);t([i()],e.prototype,"name",2);t([i()],e.prototype,"description",2);t([i()],e.prototype,"middlewares",2);t([i({readOnly:!0})],e.prototype,"createGraph",2);t([i({readOnly:!0})],e.prototype,"workspace",2);t([i({readOnly:!0})],e.prototype,"registration",1);e=t([y("BaseAgent")],e);return e},"core/Accessor","core/accessorSupport/decorators","core/reactiveUtils")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import a from"./
|
|
2
|
+
import a from"./RHF452M7.js";import{c as l}from"./3S7PBYVD.js";import"./CJIV4KJZ.js";import"./IKEF7ZHH.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([{property:g,subclass:u},{d:w}])=>{var f=Object.defineProperty,m=Object.getOwnPropertyDescriptor,c=(o,r,n,s)=>{for(var e=s>1?void 0:s?m(r,n):r,a=o.length-1,t;a>=0;a--)(t=o[a])&&(e=(s?t(r,n,e):t(e))||e);return s&&e&&f(r,n,e),e},p=class extends w{constructor(o){super(o)}getAgents(){return this.workflow.getAgents()}generate(){let o=this.workflow.generate(),r=o.workspace,n=o.createGraph().compile(),{decideContinue:s}=this,e={[i]:async(t,d)=>await n.invoke(t,d)},a=[{from:i,decide:async(t,d)=>await Promise.resolve(s(t,d))?i:void 0}];return{workspace:r,createGraph:()=>l(e,a,r,{entryNode:i})}}buildEdges(){throw new Error("LoopWorkflow overrides generate(); buildEdges should not be called.")}getEntryNode(){return i}isTerminalAgent(){return!0}};c([g()],p.prototype,"workflow",2);c([g()],p.prototype,"decideContinue",2);p=c([u("LoopWorkflow")],p);var i="__loop_body";return p},"core/accessorSupport/decorators",a)
|