@arcgis/ai-components 5.2.0-next.71 → 5.2.0-next.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +4 -2
- package/dist/agent-utils/LLMAgent.d.ts +5 -2
- package/dist/agent-utils/LLMAgent.js +1 -1
- package/dist/agent-utils/types.d.ts +1 -1
- package/dist/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
- package/dist/agentic-workflow/Edge.d.ts +16 -0
- package/dist/agentic-workflow/WebAgent.d.ts +39 -0
- package/dist/agentic-workflow/jsonTypes.d.ts +193 -0
- package/dist/agentic-workflow/nodes/AgentNode.d.ts +28 -0
- package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
- package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
- package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
- package/dist/agentic-workflow/nodes/support/Prompt.d.ts +20 -0
- package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
- package/dist/agentic-workflow/types.d.ts +29 -0
- package/dist/cdn/2EJROB32.js +2 -0
- package/dist/cdn/34O57OGV.js +2 -0
- package/dist/cdn/3LXXSMA5.js +2 -0
- package/dist/cdn/3MJQA533.js +2 -0
- package/dist/cdn/3U476GCP.js +5 -0
- package/dist/cdn/3XXZUQMQ.js +2 -0
- package/dist/cdn/4YDXYW4J.js +2 -0
- package/dist/cdn/4ZUUS4DH.js +2 -0
- package/dist/cdn/527C4GD2.js +36 -0
- package/dist/cdn/5RZGG4F2.js +2 -0
- package/dist/cdn/5SF6DEMO.js +2 -0
- package/dist/cdn/5Y6TQAJN.js +2 -0
- package/dist/cdn/65IWA2PM.js +2 -0
- package/dist/cdn/{MW5S2XCB.js → 67YCNNCN.js} +2 -2
- package/dist/cdn/6FKLWNGA.js +2 -0
- package/dist/cdn/6QJFOL6M.js +2 -0
- package/dist/cdn/6RDKDLSX.js +2 -0
- package/dist/cdn/6SGNSDLY.js +2 -0
- package/dist/cdn/7747YL7V.js +2 -0
- package/dist/cdn/7TO56JHS.js +2 -0
- package/dist/cdn/ABXLPDEK.js +2 -0
- package/dist/cdn/BBJDW6GC.js +2 -0
- package/dist/cdn/{PUFTYLJ2.js → C4FKFOU4.js} +4 -4
- package/dist/cdn/CCC6LBMY.js +2 -0
- package/dist/cdn/CGVVL52C.js +2 -0
- package/dist/cdn/DBHLKLKM.js +2 -0
- package/dist/cdn/DKLK4EUE.js +2 -0
- package/dist/cdn/E25RINU2.js +2 -0
- package/dist/cdn/E62P76TP.js +2 -0
- package/dist/cdn/E7JLG2A2.js +2 -0
- package/dist/cdn/{TFT6HK3O.js → E7KEOJZG.js} +1 -1
- package/dist/cdn/FDOMMK2M.js +2 -0
- package/dist/cdn/FSMHR7GK.js +2 -0
- package/dist/cdn/GG3AESSV.js +2 -0
- package/dist/cdn/H6JSNAT4.js +2 -0
- package/dist/cdn/HNMFFLSY.js +2 -0
- package/dist/cdn/HO2YDJI2.js +6 -0
- package/dist/cdn/{KQHLOYKL.js → I4L45WQS.js} +1 -1
- package/dist/cdn/ITBQGOMF.js +11 -0
- package/dist/cdn/JH6EAWB2.js +2 -0
- package/dist/cdn/JON2JHS2.js +2 -0
- package/dist/cdn/JWPB3XZM.js +2 -0
- package/dist/cdn/JXB4TNSG.js +2 -0
- package/dist/cdn/JYVBCHR6.js +6 -0
- package/dist/cdn/KRN6AFNB.js +18 -0
- package/dist/cdn/KZACIY2W.js +2 -0
- package/dist/cdn/MKJS7QYQ.js +2 -0
- package/dist/cdn/N735LT4S.js +2 -0
- package/dist/cdn/NP7DG7LQ.js +2 -0
- package/dist/cdn/NTZAOJH5.js +2 -0
- package/dist/cdn/{CXW5URTF.js → OHMNQ3RU.js} +5 -5
- package/dist/cdn/ONQ6JSBJ.js +2 -0
- package/dist/cdn/PAUIFUMO.js +2 -0
- package/dist/cdn/QNNGPA3Q.js +2 -0
- package/dist/cdn/RATZTLNX.js +2 -0
- package/dist/cdn/RU5DVLYG.js +156 -0
- package/dist/cdn/{YHQJ66WJ.js → S3XUYAUX.js} +1 -1
- package/dist/cdn/S6ZAQRC6.js +2 -0
- package/dist/cdn/SABZC4D4.js +2 -0
- package/dist/cdn/TYL5G7KR.js +2 -0
- package/dist/cdn/{XETNZW4D.js → UAZLKUFN.js} +1 -1
- package/dist/cdn/UZL6UVE4.js +2 -0
- package/dist/cdn/VBZ5XGAM.js +2 -0
- package/dist/cdn/VXBUMZYR.js +2 -0
- package/dist/cdn/W5FLNFSN.js +2 -0
- package/dist/cdn/W5J4Q3RO.js +14 -0
- package/dist/cdn/WQKNV6KK.js +2 -0
- package/dist/cdn/{ICYUPLZM.js → WZFC5HUX.js} +1 -1
- package/dist/cdn/XGBEHER5.js +2 -0
- package/dist/cdn/XPTCV6YV.js +2 -0
- package/dist/cdn/Y5UFOH54.js +2 -0
- package/dist/cdn/YGCTAIBS.js +2 -0
- package/dist/cdn/{SXHH575T.js → ZJEWP2ND.js} +20 -24
- 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/chunks/adapter.js +939 -1950
- package/dist/chunks/adapter10.js +21 -0
- package/dist/chunks/adapter11.js +30 -0
- package/dist/chunks/adapter12.js +22 -0
- package/dist/chunks/adapter13.js +22 -0
- package/dist/chunks/adapter14.js +109 -0
- package/dist/chunks/adapter15.js +40 -0
- package/dist/chunks/adapter16.js +154 -0
- package/dist/chunks/adapter17.js +141 -0
- package/dist/chunks/adapter18.js +127 -0
- package/dist/chunks/adapter2.js +52 -0
- package/dist/chunks/adapter3.js +30 -0
- package/dist/chunks/adapter4.js +50 -0
- package/dist/chunks/adapter5.js +27 -0
- package/dist/chunks/adapter6.js +24 -0
- package/dist/chunks/adapter7.js +26 -0
- package/dist/chunks/adapter8.js +21 -0
- package/dist/chunks/adapter9.js +42 -0
- package/dist/chunks/arcgisKnowledgeGraph.js +5 -5
- package/dist/chunks/baseAgentState.js +56 -0
- package/dist/chunks/dataExplorationGraph.js +34 -31
- package/dist/chunks/fetchAgentContext.js +13 -0
- package/dist/chunks/fetchService.js +10 -0
- package/dist/chunks/formatFeatureAttributes.js +132 -0
- package/dist/chunks/generateLayerDescriptions.js +189 -235
- package/dist/chunks/helpGraph.js +11 -9
- package/dist/chunks/layerStylingGraph.js +22 -21
- package/dist/chunks/mergeWhereClauses.js +15 -0
- package/dist/chunks/navigationGraph.js +81 -70
- package/dist/chunks/orchestrator.js +1 -1
- package/dist/chunks/state.js +20 -26
- package/dist/chunks/types.js +59 -0
- package/dist/chunks/utils2.js +3 -3
- package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +636 -10
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +15 -5
- package/dist/components/arcgis-assistant-help-agent/customElement.js +21 -5
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +39 -22
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +22 -5
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +13 -5
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +1 -1
- package/dist/types/lumina.d.ts +1 -1
- package/dist/types/preact.d.ts +1 -1
- package/dist/types/react.d.ts +1 -1
- package/dist/types/stencil.d.ts +1 -1
- package/dist/utils/index.js +26 -25
- package/package.json +4 -4
- package/dist/cdn/3DJDRAGV.js +0 -2
- package/dist/cdn/4CEMUECT.js +0 -2
- package/dist/cdn/4PCAK3ET.js +0 -2
- package/dist/cdn/57OMVTIU.js +0 -2
- package/dist/cdn/6U7TEAAJ.js +0 -2
- package/dist/cdn/BE7ZN5FZ.js +0 -2
- package/dist/cdn/BNSJO6X2.js +0 -2
- package/dist/cdn/CMDRED5H.js +0 -2
- package/dist/cdn/DTIVDIDY.js +0 -2
- package/dist/cdn/E5ZKBC24.js +0 -36
- package/dist/cdn/GP6NDTUE.js +0 -18
- package/dist/cdn/HBLRVXEB.js +0 -2
- package/dist/cdn/HQXPPYMD.js +0 -2
- package/dist/cdn/IEHPNCTL.js +0 -2
- package/dist/cdn/LHLO6PTD.js +0 -2
- package/dist/cdn/OWXCOUIQ.js +0 -2
- package/dist/cdn/PVE7Q43N.js +0 -2
- package/dist/cdn/ST5FQYT7.js +0 -180
- package/dist/cdn/WUNCZOGU.js +0 -2
- package/dist/cdn/WVPU4QOO.js +0 -2
- package/dist/cdn/WXWO5D3W.js +0 -2
- package/dist/cdn/XCRR2EEG.js +0 -6
- package/dist/cdn/ZS6SXJP2.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{d as b}from"./HO2YDJI2.js";import{Wa as G,a as E,b as y,ia as h}from"./E7KEOJZG.js";var x=new Set(["agentExecutionContext","outputMessage","summary","status"]);function O(r){let o=[...new Set([...r].filter(n=>x.has(n)))];if(o.length!==0)throw new Error(`custom state cannot define reserved runtime fields: ${o.join(", ")}.`)}function $(r){let o=Object.entries(r);return Object.fromEntries(o.map(([n,t])=>[n,h({reducer:(i,g)=>g,default:()=>t})]))}function S(r={}){O(Object.keys(r));let o=$(r);return h.Root({...o,agentExecutionContext:h({reducer:(n,t)=>({...n,...t}),default:b}),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 C(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 S(n)}function P(r,o,n,t={}){let{agent:i,entryNode:g,middlewares:c=[]}=t,s=new G(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 a=new Set(Object.keys(r)),m=new Map,w=new Map;for(let e of a)m.set(e,0),w.set(e,0);for(let e of o)"to"in e?(a.has(e.from)&&w.set(e.from,(w.get(e.from)??0)+1),a.has(e.to)&&m.set(e.to,(m.get(e.to)??0)+1)):a.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))),l=async(d,p)=>await u(d,p);s=s.addNode(e,l)}for(let e of o)if("to"in e){let f=e.from,u=e.to;if(!a.has(f))throw new Error(`Graph edge references unknown from-node: ${f}`);if(!a.has(u))throw new Error(`Graph edge references unknown to-node: ${u}`);s.addEdge(f,u)}else{let f=e.from;if(!a.has(f))throw new Error(`Graph conditional edge references unknown from-node: ${f}`);s.addConditionalEdges(f,async(u,l)=>{let d=await e.decide(u,l);if(!d)return y;if(!a.has(d))throw new Error(`Graph conditional edge returned unknown node: ${d}`);return d})}let k=v(a,m,g);s.addEdge(E,k);let j=[...a].filter(e=>(w.get(e)??0)===0);for(let e of j)s.addEdge(e,y);return s}function N(r,o,n,t){return!n.length||!r?t:async(i,g)=>await n.reduceRight((c,s)=>async a=>await s.handler(a,c),async c=>{let s=await t(c.state,c.config);return{...c.state,...s}})({agent:r,config:g,nodeName:o,state:i})}function v(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{O as a,$ as b,S as c,C as d,P as e};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import b from"./W5FLNFSN.js";import a from"./CCC6LBMY.js";import"./ONQ6JSBJ.js";import"./LUY6V4TP.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,a])=>{return a},a,b)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import a from"./CCC6LBMY.js";import{a as m}from"./ONQ6JSBJ.js";import{Bc as f}from"./LUY6V4TP.js";import{a as o}from"./VXFQANGJ.js";export default $arcgis.t(([{b:c,c:h}])=>{var g=(a,e,i)=>{let t=a.createQuery();return t.outFields=[e],t.where=i||"1=1",t.num=1,t},w=async(a,e,i,t)=>{let r=t.map?.allLayers.find(y=>y.id===a),n=g(r,e,i.where),s=(await r.queryFeatures(n)).features[0],d=s?s.attributes[e]:null,u=c(r,e,d,t.timeZone),l=h(r,e);return{tool:"getAttribute",layerName:r.title??a,summary:`${l} = ${u}`,details:{fieldName:e,fieldAlias:l!==e?l:void 0,value:u,where:i.where}}};async function b({layerId:a,fieldName:e,query:i},t){let{mapView:r}=m(t,["mapView"]),n=await w(a,e,i,r);return JSON.stringify(n,null,2)}var p=o.object({layerId:o.string().describe("The layerId of the layer containing the field from which to get a value."),fieldName:o.string().describe("The name of the field/attribute from which to get a field value."),query:o.object({where:o.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value.")})}),q=f(b,{name:"getAttribute",description:"Returns an attribute value for a given feature.",schema:p});return q},a)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as q,b as T}from"./34O57OGV.js";import{a as N}from"./FDOMMK2M.js";import a from"./QNNGPA3Q.js";import{a as S}from"./ONQ6JSBJ.js";import{Bc as I}from"./LUY6V4TP.js";import{a as e}from"./VXFQANGJ.js";export default $arcgis.t(([V,j,A,{a:F,b:b,c:L,d:v}])=>{var W=async p=>{let{targetLayer:r,fieldName:n,statisticType:l,mapView:a,layersAndFieldsRegistry:h,geometryFilter:t}=p,s=a.map?.allLayers.find(i=>i.id===r.layerId);if(!s)throw new Error(`Layer '${r.layerId}' not found.`);let O=await a.whenLayerView(s),o=h.get(r.layerId)?.fieldRegistry.get(n),E=o?.alias;if(!o)throw new Error(`Field '${n}' not found.`);let w,u;if(t){let i=await L(t,a);if("error"in i)throw new Error(i.error);if(!i.geometry)throw b(t)?new Error(`No features found matching: ${t.where}`):new Error("Failed to create geometry");if(b(t)){let g=a.map?.allLayers.find(f=>f.id===t.layerId);w={geometryLayerName:g?.title??g?.id,geometryLayerId:t.layerId,geometryWhere:t.where,distance:t.distance,units:t.units,applied:!0}}else F(t)&&(w={point:t.point,distance:t.distance,units:t.units,applied:!0});u=new A({geometry:i.geometry,distance:t.distance,units:t.units,spatialRelationship:"intersects"})}let y=q(O,[n],!1),c=null,m=null,x=10;if(o.type!=="geometry"&&o.type!=="oid"&&o.type!=="global-id")try{let i={layer:s,useFeaturesInView:y,view:y?a:void 0,field:n,sqlWhere:T(s.definitionExpression,r.where),...u&&{filter:u},outStatisticTypes:{include:[l]}};c=await V(i);let g=["string","small-integer","integer"],f=o.domain?.type==="coded-value"?o.domain:null;(g.includes(o.type)||f)&&(m=(await j({layer:s,useFeaturesInView:y,view:y?a:void 0,field:n,sqlWhere:T(s.definitionExpression,r.where),...u&&{filter:u}})).uniqueValueInfos.sort((d,R)=>R.count-d.count).slice(0,x)),m&&o.domain?.type==="coded-value"&&(m=m.map(d=>({...d,value:f?f.getName(d.value)??d.value:d.value})))}catch(i){console.error("Statistics error:",i)}return{tool:"getStatistics",layerName:s.title??r.layerId,summary:`${l} = ${typeof c?.[l]=="number"?c[l]:"N/A"}`,details:{fieldName:n,fieldAlias:E,statisticType:l,statistic:c?.[l]??null,summaryStatistics:c,uniqueValues:m,where:r.where,spatialFilterInfo:w}}};async function D({targetLayer:p,fieldName:r,statisticType:n,geometryFilter:l},a){let h=N(a,"layersAndFieldsRegistry"),{mapView:t}=S(a,["mapView"]),s=await W({targetLayer:p,fieldName:r,statisticType:n,mapView:t,layersAndFieldsRegistry:h,geometryFilter:l});return JSON.stringify(s,null,2)}var U=e.object({layerId:e.string().describe("The layerId of the layer containing the geometry by which to filter."),where:e.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:e.number().optional().describe("The buffer distance around the geometry."),units:v.optional().describe("The units for the distance buffer.")}),C=e.object({point:e.object({x:e.number().describe("X coordinate (longitude) from navigation result"),y:e.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:e.object({wkid:e.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")}).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")}).describe("Point coordinates from a previous navigation/geocoding result"),distance:e.number().optional().describe("Optional buffer distance around the point."),units:v.optional().describe("The units for the distance buffer.")}),$=e.object({targetLayer:e.object({layerId:e.string().describe("The layerId of the layer containing the field from which to get a value."),where:e.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value.")}),geometryFilter:e.union([U,C]).optional().describe("Geometry filter for spatial queries. Use 'point' option with x/y coordinates from navigation results to find features at that location (point-in-polygon). Use 'layerId/where' option to filter by features from another layer."),fieldName:e.string().describe("The name of the field for which to get statistics. STRICTLY DO NOT use OBJECTID. Use any other field"),statisticType:e.enum(["avg","max","median","min","stddev","sum","variance","nullcount","count"]).describe("The statistic type to calculate.")}),K=I(D,{name:"getStatistics",description:`Computes a single aggregate statistic (max, min, avg, sum, median, stddev, variance) for a numeric field across matching features. Also returns frequency analysis for categorical fields.
|
|
3
|
+
|
|
4
|
+
USE THIS TOOL FOR:
|
|
5
|
+
- "What is the average/maximum/minimum/total [field]?" \u2014 aggregate computations
|
|
6
|
+
- "Most common/frequent value of [field]?" \u2014 frequency analysis
|
|
7
|
+
- Questions requiring a mathematical aggregation across many features
|
|
8
|
+
|
|
9
|
+
DO NOT USE FOR:
|
|
10
|
+
- "How many features match X?" \u2014 use queryFeatures instead (it returns totalCount)
|
|
11
|
+
- "Show / list / find features" \u2014 use queryFeatures instead
|
|
12
|
+
- Simple counts of features matching a condition \u2014 use queryFeatures instead
|
|
13
|
+
|
|
14
|
+
Only call this tool when the answer requires computing an aggregate (avg, max, min, sum, median, stddev) over a field's values, not just counting or listing features.`,schema:$});return K},"smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","layers/support/FeatureFilter",a)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import a from"./5SF6DEMO.js";import"./UZL6UVE4.js";import"./HO2YDJI2.js";import"./E7KEOJZG.js";import"./LUY6V4TP.js";import"./MWYBF3F3.js";import"./UZLQALHY.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,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{J as qe,
|
|
2
|
+
import{J as qe,La as te,Ma as nt,Oa as W,Pa as Et,S as xt,Sa as Ie,U as tt,Ua as ge,Va as Oe,Wa as At,_ as St,a as ut,b as A,f as $,j as L,k as H,ra as Ae,ua as kt,x as mt,y as ft}from"./E7KEOJZG.js";import{$a as gt,$b as he,Ab as bt,I as Ge,Ib as F,Jb as le,Lb as vt,Ob as Se,Qb as Ct,Tb as a,U as T,Ua as Ke,Vb as Qe,Xa as z,Xb as ke,Ya as ie,Z as pt,_a as Ye,ac as K,bb as Xe,c as Je,ca as M,db as wt,dc as ce,fa as Ve,fc as Ee,oa as Q,ob as pe,pb as _e,sa as Ze,sb as xe,sc as et,ta as U,uc as _t,wb as Mt,yb as Tt,yc as ot,za as ht,zb as ee}from"./LUY6V4TP.js";import{Dd as B,s as yt}from"./MWYBF3F3.js";var rt=Symbol.for("AgentMiddleware");function O(e){return{[rt]:!0,name:e.name,stateSchema:e.stateSchema,contextSchema:e.contextSchema,wrapToolCall:e.wrapToolCall,wrapModelCall:e.wrapModelCall,beforeAgent:e.beforeAgent,beforeModel:e.beforeModel,afterModel:e.afterModel,afterAgent:e.afterAgent,tools:e.tools,streamTransformers:e.streamTransformers}}var Re=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.")}},Pe=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}},we=class extends Error{toolName;errors;constructor(e,t){super(`Failed to parse structured output for tool '${e}':${t.map(o=>`
|
|
3
3
|
- ${o}`).join("")}.`),this.toolName=e,this.errors=t}},je=class extends Error{toolCall;toolError;constructor(e,t){let o=e instanceof Error?e:new Error(String(e)),n=JSON.stringify(t.args);super(`Error invoking tool '${t.name}' with kwargs ${n} with error: ${o.stack}
|
|
4
4
|
Please fix the error and try again.`),this.toolCall=t,this.toolError=o}},ye=class It extends Error{static"~brand"="MiddlewareError";constructor(t,o){let n=t instanceof Error?t.message:String(t);super(n),this.name=t instanceof Error?t.name:`${o[0].toUpperCase()+o.slice(1)}Error`,t instanceof Error&&(this.cause=t)}static wrap(t,o){return mt(t)?t:new It(t,o)}static isInstance(t){return t instanceof Error&&"~brand"in t&&t["~brand"]==="MiddlewareError"}};function Me(e){return"invoke"in e&&typeof e.invoke=="function"&&"_streamResponseChunks"in e}function de(e){return typeof e=="object"&&e!=null&&"_queuedMethodOperations"in e&&"_getModelInstance"in e&&typeof e._getModelInstance=="function"}var Ot=!0,ho=0,G=class st{constructor(t,o,n){this.schema=t,this.tool=o,this.options=n}get name(){return this.tool.function.name}static fromSchema(t,o){function n(s){return s??`extract-${++ho}`}if(pe(t)||xe(t)){let s=ke(t);return new st(s,{type:"function",function:{name:n(s.title),strict:!1,description:s.description??"Tool for extracting structured output from the model's response.",parameters:s}},o)}let r;return typeof t.name=="string"&&typeof t.parameters=="object"&&t.parameters!=null?r=t:r={name:n(t.title),description:t.description??"",parameters:t.schema||t},new st(ke(t),{type:"function",function:r},o)}parse(t){let o=new Qe(this.schema).validate(t);if(!o.valid)throw new we(this.name,o.errors.map(n=>n.error));return t}},oe=class Rt{_schemaType;schema;strict;constructor(t,o){if("schema"in t&&typeof t.schema=="object"&&t.schema!==null&&!("type"in t)){let n=t;this.schema=n.schema,this.strict=n.strict??Ot}else this.schema=t,this.strict=o??Ot}static fromSchema(t,o){return new Rt(ke(t),o)}parse(t){let o;if(typeof t.content=="string")o=t.content;else if(Array.isArray(t.content)){for(let n of t.content)if(typeof n=="object"&&n!==null&&"type"in n&&n.type==="text"&&"text"in n&&typeof n.text=="string"){o=n.text;break}}if(!(!o||o===""))try{let n=JSON.parse(o);return new Qe(this.schema).validate(n).valid?n:void 0}catch{}}};function Pt(e,t,o){if(!e)return[];if(typeof e=="object"&&e!==null&&"__responseFormatUndefined"in e)return[];if(Array.isArray(e)){if(e.every(r=>r instanceof G||r instanceof oe))return e;if(e.every(r=>pe(r)))return e.map(r=>G.fromSchema(r,t));if(e.every(r=>F(r)))return e.map(r=>G.fromSchema(r,t));if(e.every(r=>typeof r=="object"&&r!==null&&!F(r)&&!pe(r)))return e.map(r=>G.fromSchema(r,t));throw new Error(`Invalid response format: list contains mixed types.
|
|
5
5
|
All items must be either InteropZodObject, Standard Schema, or plain JSON schema objects.`)}if(e instanceof G||e instanceof oe)return[e];let n=go(o);if(pe(e))return n?[oe.fromSchema(e)]:[G.fromSchema(e,t)];if(F(e))return n?[oe.fromSchema(e)]:[G.fromSchema(e,t)];if(typeof e=="object"&&e!==null&&"properties"in e)return n?[oe.fromSchema(e)]:[G.fromSchema(e,t)];throw new Error(`Invalid response format: ${String(e)}`)}function go(e){return!e||!Me(e)||!("profile"in e)||typeof e.profile!="object"||!e.profile?!1:"structuredOutput"in e.profile&&e.profile.structuredOutput===!0}function wo(e,t){if(e.length<t.length||e.length>t.length+1)return!1;for(let o=0;o<t.length;o+=1)if(e[o]!==t[o])return!1;return!0}function yo(e){let t;try{t=JSON.parse(e)}catch{return!1}return!Array.isArray(t)||t.length===0?!1:t.every(o=>{if(o==null||typeof o!="object")return!1;let n=o;return typeof n.id=="string"&&"value"in n})}function Mo(e){if(e==null||typeof e!="object")return!1;let t=e;return t.type!=="constructor"||!Array.isArray(t.id)?!1:t.id[t.id.length-1]==="ToolMessage"}function To(e){return T.isInstance(e)?e.content:Mo(e)?e.kwargs?.content:e}function Te(e){return()=>{let t=Ae.local(),o=new Map;function n(r,s,i){if(o.has(r))return;let l=typeof i=="string"?JSON.parse(i):i,m,c,u,g,d=new Promise((x,y)=>{m=x,c=y}),f=new Promise(x=>{u=x}),h=new Promise(x=>{g=x});o.set(r,{resolveOutput:m,rejectOutput:c,resolveStatus:u,resolveError:g}),t.push({name:s,callId:r,input:l,output:d,status:f,error:h})}return{__native:!0,init:()=>({toolCalls:t}),process(r){if(!wo(r.params.namespace,e))return!0;if(r.method==="messages"){let s=r.params.data;if(s.event==="content-block-finish"){let i=s.contentBlock??s.content_block;i?.type==="tool_call"&&n(String(i.id??""),String(i.name??""),i.args??i.input)}}if(r.method==="tools"){let s=r.params.data,i=s.tool_call_id;s.event==="tool-started"&&n(i,s.tool_name??"unknown",s.input);let l=i?o.get(i):void 0;if(l){if(s.event==="tool-finished")l.resolveOutput(To(s.output)),l.resolveStatus("finished"),l.resolveError(void 0),o.delete(i);else if(s.event==="tool-error"){let m=s.message??"unknown error";if(yo(m))return!0;l.rejectOutput(new Error(m)),l.resolveStatus("error"),l.resolveError(m),o.delete(i)}}}return!0},finalize(){for(let r of o.values())r.resolveStatus("finished"),r.resolveError(void 0),r.resolveOutput(void 0);o.clear(),t.close()},fail(r){for(let s of o.values())s.resolveStatus("error"),s.resolveError(r instanceof Error?r.message:String(r)),s.rejectOutput(r);o.clear(),t.fail(r)}}}}function Y(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function be(e){return e.join("\0")}function jt(e,t){if(t.length>e.length)return!1;for(let o=0;o<t.length;o+=1)if(e[o]!==t[o])return!1;return!0}function Ne(e=[]){return()=>{let t=Ae.local(),o=new Map,n=new Map,r=new Map,s=new Map,i=e.length;function l(d,f){let h=be(d);if(o.has(h))return;let x=(Y(f)&&Y(f.metadata)?f.metadata:void 0)?.lc_agent_name;o.set(h,typeof x=="string"?x:void 0)}function m(d){if(!Y(d))return;let f=d.id;if(typeof f!="string")return;let h=d.input,x;if(Y(h)&&Y(h.tool_call)){let y=h.tool_call.id;typeof y=="string"&&(x=y)}else if(Array.isArray(h)){for(let y of h)if(Y(y)&&typeof y.id=="string"){x=y.id;break}}x!=null&&n.set(f,x)}function c(d){let f=r.get(be(d));if(typeof f=="string"&&f.length>0)return{type:"toolCall",tool_call_id:f};let h=d[d.length-1],x=h.indexOf(":");if(x===-1)return;let y=h.slice(x+1);if(y.length===0)return;let w=n.get(y);if(!(typeof w!="string"||w.length===0))return{type:"toolCall",tool_call_id:w}}function u(d){if(d.length!==i+1||!jt(d,e))return;let f=be(d);if(s.has(f))return;let h=o.get(f);if(typeof h!="string"||h.length===0)return;let x=kt(d),y=x.init(),w=Te(d)(),P=w.init(),I=Ne(d)(),j=I.init(),Z,N,b=new Promise((J,ae)=>{Z=J,N=ae});s.set(f,{key:f,path:d,name:h,messages:x,toolCall:w,nested:I,resolveOutput:Z,rejectOutput:N,latestValues:void 0,done:!1}),t.push({name:h,cause:c(d),output:b,messages:y.messages,toolCalls:P.toolCalls,subagents:j.subagents})}function g(d,f){d.done||(d.done=!0,f.type==="resolve"?d.resolveOutput(d.latestValues):d.rejectOutput(f.error),d.messages.finalize?.(),d.toolCall.finalize?.(),d.nested.finalize?.())}return{__native:!0,init:()=>({subagents:t}),process(d){let f=d.params.namespace,h=d.params.data,x=d.method==="tasks"&&Y(h)&&"result"in h;d.method==="tools"&&Y(h)&&h.event==="tool-started"&&typeof h.tool_call_id=="string"&&h.tool_call_id.length>0&&r.set(be(f),h.tool_call_id),d.method==="tasks"&&!x&&(l(f,h),m(h),u(f));for(let y of s.values())if(!y.done&&jt(f,y.path)&&(y.messages.process(d),y.toolCall.process(d),y.nested.process(d),be(f)===y.key)){if(d.method==="values"&&Y(h))y.latestValues=h;else if(d.method==="lifecycle"&&Y(h)){let w=h.event;w==="completed"||w==="interrupted"?g(y,{type:"resolve"}):w==="failed"&&g(y,{type:"reject",error:new Error(`Subagent ${y.name} failed`)})}}return!0},finalize(){for(let d of s.values())g(d,{type:"resolve"});t.close()},fail(d){for(let f of s.values())g(f,{type:"reject",error:d});t.fail(d)}}}}var at=Symbol.for("langgraph-zod");at in globalThis||(globalThis[at]=new WeakSet);function Nt(e){let t=globalThis[at];t.has(e)||(Object.defineProperty(e,"langgraph",{get(){let o=this;return{metadata(n){return Oe(o,{jsonSchemaExtra:n})},reducer(n,r){return Oe(o,{default:Se(o),reducer:{schema:r,fn:n}})}}}}),t.add(e))}try{Nt(a.ZodType.prototype),Nt(B.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 Lt=class extends yt{constructor(e){super(),this.parent=e,this._map=this.parent._map}add(e,...t){let o=t[0];if(o&&!o?.default){let n=Se(e);n!=null&&(o.default=n)}return super.add(e,...t)}},bo=new Lt(ge);function Dt(e=!0,t,o=[]){let n={jumpTo:new nt},r={},s={},i=l=>{if(W.isInstance(l)){for(let[c,u]of Object.entries(l.fields))if(!(c in n)){if(n[c]=u,c.startsWith("_"))continue;te.isInstance(u)?(r[c]=u.inputSchema||u.valueSchema,s[c]=u.valueSchema):(r[c]=u,s[c]=u)}return}let m=le(l);for(let[c,u]of Object.entries(m)){let g=c.startsWith("_");if(!(c in n)){if(_e(u)){let d=ge.get(u);if(d?.reducer){d.reducer.schema?(n[c]=new te(u,{inputSchema:d.reducer.schema,reducer:d.reducer.fn}),g||(r[c]=d.reducer.schema,s[c]=u)):(n[c]=new te(u,{reducer:d.reducer.fn}),g||(r[c]=u,s[c]=u));continue}}n[c]=u,g||(r[c]=u,s[c]=u)}}};t&&(W.isInstance(t)||F(t))&&i(t);for(let l of o)l.stateSchema&&(W.isInstance(l.stateSchema)||F(l.stateSchema))&&i(l.stateSchema);return e&&(s.structuredResponse=new nt),{state:new W({messages:Ie,...n}),input:new W({messages:Ie,...r}),output:new W({messages:Ie,...s})}}var it=/<name>(.*?)<\/name>/s,lt=/<content>(.*?)<\/content>/s;function vo(e,t){if(W.isInstance(e)){let o={};for(let n of Object.keys(e.fields))n in t&&(o[n]=t[n]);return o}if(xe(e))return ee(e,t);throw new Error(`Invalid state schema type: ${typeof e}`)}function Bt(e){if(!M.isInstance(e)||Ve.isInstance(e)||!e.name)return e;let{name:t}=e;if(typeof e.content=="string")return new M({...e.lc_kwargs,content:`<name>${t}</name><content>${e.content}</content>`,name:void 0});let o=[],n=0;for(let r of e.content)typeof r=="string"?(n+=1,o.push(`<name>${t}</name><content>${r}</content>`)):typeof r=="object"&&"type"in r&&r.type==="text"?(n+=1,o.push({...r,text:`<name>${t}</name><content>${r.text}</content>`})):o.push(r);return n||o.unshift({type:"text",text:`<name>${t}</name><content></content>`}),new M({...e.lc_kwargs,content:o,name:void 0})}function Ut(e){if(!M.isInstance(e)||!e.content)return e;let t=[],o;if(Array.isArray(e.content))t=e.content.filter(n=>{if(n.type==="text"&&typeof n.text=="string"){let r=n.text.match(it),s=n.text.match(lt);return r&&(!s||s[1]==="")?(o=r[1],!1):!0}return!0}).map(n=>{if(n.type==="text"&&typeof n.text=="string"){let r=n.text.match(it),s=n.text.match(lt);return!r||!s?n:(o=r[1],{...n,text:s[1]})}return n});else{let n=e.content,r=n.match(it),s=n.match(lt);if(!r||!s)return e;o=r[1],t=s[1]}return new M({...Object.keys(e.lc_kwargs??{}).length>0?e.lc_kwargs:e,content:t,name:o})}function se(e){return he.isRunnable(e)}function $t(e){return Me(e)?"bindTools"in e&&typeof e.bindTools=="function":!1}var ct=(e,t,o={})=>{if($t(e))return e.bindTools(t,o);if(K.isRunnableBinding(e)&&$t(e.bound)){let n=e.bound.bindTools(t,o);return K.isRunnableBinding(n)?new K({bound:n.bound,config:{...e.config,...n.config},kwargs:{...e.kwargs,...n.kwargs},configFactories:n.configFactories??e.configFactories}):new K({bound:n,config:e.config,kwargs:e.kwargs,configFactories:e.configFactories})}return null};function Le(e){if(typeof e=="function")return;let t=e;if(ce.isRunnableSequence(t)&&(t=t.steps.find(o=>K.isRunnableBinding(o))||t),!de(t)){if(K.isRunnableBinding(t)){let o=t.kwargs!=null&&typeof t.kwargs=="object"&&"tools"in t.kwargs&&Array.isArray(t.kwargs.tools)&&t.kwargs.tools.length>0,n=t.config!=null&&typeof t.config=="object"&&"tools"in t.config&&Array.isArray(t.config.tools)&&t.config.tools.length>0;if(o||n)throw new Re}if("tools"in t&&t.tools!==void 0&&Array.isArray(t.tools)&&t.tools.length>0)throw new Re}}function ue(e){return!!(M.isInstance(e)&&e.tool_calls&&e.tool_calls.length>0)}function zt(e){if(e==null)return new U("");if(U.isInstance(e))return e;if(typeof e=="string")return new U({content:[{type:"text",text:e}]});throw new Error(`Invalid systemPrompt type: expected string or SystemMessage, got ${typeof e}`)}async function Ft(e,t,o={}){let n=ct(e,t,o);if(n)return n;if(de(e)){let r=ct(await e._getModelInstance(),t,o);if(r)return r}if(ce.isRunnableSequence(e)){let r=e.steps.findIndex(s=>K.isRunnableBinding(s)||Me(s)||de(s));if(r>=0){let s=ct(e.steps[r],t,o);if(s){let i=e.steps.slice();return i.splice(r,1,s),ce.from(i)}}}throw new Error(`llm ${e} must define bindTools method.`)}function Co(e){if(e.length===0)return;if(e.length===1)return e[0];function t(n,r){return async(s,i)=>n(s,async m=>r(m,i))}let o=e[e.length-1];for(let n=e.length-2;n>=0;n--)o=t(e[n],o);return o}function Wt(e){let t=e.filter(o=>o.wrapToolCall);if(t.length!==0)return Co(t.map(o=>{let n=o.wrapToolCall;return async(s,i)=>{let l=s.state,m=async c=>{let u={...l,...c.state};return i({...c,state:u})};try{let c=await n({...s,state:{messages:l.messages,...o.stateSchema?vo(o.stateSchema,{...l}):{}}},m);if(!T.isInstance(c)&&!H(c))throw new Error(`Invalid response from "wrapToolCall" in middleware "${o.name}": expected ToolMessage or Command, got ${typeof c}`);return c}catch(c){throw ye.wrap(c,o.name)}}}))}var _o=["tags","metadata","runName","maxConcurrency","recursionLimit","configurable"];function Ht(e){let t={};for(let o of _o){let n=e[o];n!==void 0&&(t[o]=n)}return t}async function Jt(e,t){let o={};for(let n of e){if(!n.stateSchema)continue;let r;if(W.isInstance(n.stateSchema)){let l={};for(let[m,c]of Object.entries(n.stateSchema.fields))te.isInstance(c)?l[m]=c.inputSchema||c.valueSchema:l[m]=c;r=B.object(l)}else if(F(n.stateSchema))r=n.stateSchema;else continue;let s=await Mt(Ct(r,l=>l.startsWith("_")),t);if(s.success){Object.assign(o,s.data);continue}let i=s.error.issues.filter(l=>l.code==="invalid_type").map(l=>` - ${l.path.join(".")}: Required`).join(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as i}from"./ONQ6JSBJ.js";import{Bc as n}from"./LUY6V4TP.js";import{Dd as r}from"./MWYBF3F3.js";async function s(a,t){await t.when();let e=t.map?.allLayers.find(l=>l.id===a);if(!e)return console.warn(`[goToLayer] No matching FeatureLayer found for: ${a}`),{text:`Could not find layer for: ${a}`};let o;return(e.type==="link-chart"||e.type==="knowledge-graph-sublayer")&&t.map?.activeLinkChartLayer?o=t.map.diagramNodesExtent:o=e.fullExtent,o?(await t.goTo(o),e.visible=!0,{text:`Successfully zoomed to: ${e.title??""}`}):{text:"Layer has no defined extent. Cannot zoom to layer."}}async function m({layerId:a},t){let{mapView:e}=i(t,["mapView"]);return await s(a,e)}var c=r.object({layerId:r.string().describe("The id of the layer to navigate to")}),p=n(m,{name:"goToLayer",description:"Zooms the map view to the full extent of the top matching layer.",schema:c});export{p as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import a from"./5SF6DEMO.js";import"./UZL6UVE4.js";import"./HO2YDJI2.js";import"./E7KEOJZG.js";import"./LUY6V4TP.js";import"./MWYBF3F3.js";import"./UZLQALHY.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)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import a from"./5SF6DEMO.js";import"./UZL6UVE4.js";import"./HO2YDJI2.js";import"./E7KEOJZG.js";import"./LUY6V4TP.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([{property:d,subclass:f},{a:u,c:i,d:c}])=>{var m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,p=(e,o,r,t)=>{for(var s=t>1?void 0:t?g(o,r):o,a=e.length-1,n;a>=0;a--)(n=e[a])&&(s=(t?n(o,r,s):n(s))||s);return t&&s&&m(o,r,s),s},l=class extends c{constructor(e){super(e)}getAgents(){return this.agents}getEntryNode(e){return e[0]?i(e[0],0):void 0}isTerminalAgent(e,o){return o===e.length-1}validateAgents(e){super.validateAgents(e);let o=new Map;for(let[r,t]of e.entries()){let s=e[r-1];if(t.outputSchema)for(let a of u(t.outputSchema)){let n=o.get(a)??[];n.push(`${t.name} [${r}]`),o.set(a,n)}if(!(r===0||!t.inputSchema||s?.outputSchema))throw new Error(`Workflow agent "${t.name}" declares an input schema, so upstream agent "${s.name}" must declare an output schema.`)}for(let[r,t]of o.entries())t.length>1&&console.warn(`Workflow output field "${r}" is declared by multiple steps (${t.join(", ")}). Later steps will overwrite earlier values in shared state.`)}buildEdges(e){return e.length===1?[{from:i(e[0],0),decide:()=>{}}]:e.slice(0,-1).map((o,r)=>({from:i(o,r),decide:t=>t.status==="failed"?void 0:i(e[r+1],r+1)}))}};p([d()],l.prototype,"agents",2);l=p([f("SequentialWorkflow")],l);return l},"core/accessorSupport/decorators",a)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import a from"./QNNGPA3Q.js";import{a as h}from"./ONQ6JSBJ.js";import{Bc as p}from"./LUY6V4TP.js";import{a as e}from"./VXFQANGJ.js";export default $arcgis.t(([y,g,{c:b,d:u}])=>{var w=async(t,o,f,n,r,c)=>{let a=t.map?.allLayers.find(s=>s.id===o);if(!a)return{success:!1,error:`Layer '${o}' not found.`};let i=a.createQuery();i.where=f??"1=1",n&&(i.geometry=n,i.spatialRelationship="intersects",r&&(i.distance=r),c&&(i.units=c));try{let{extent:s,count:l}=await a.queryExtent(i);return!s||l===0?{success:!1,error:`No features found for filter (where: ${i.where}${n?", spatial filter used":""})`}:(await t.goTo(s),{success:!0})}catch(s){return{success:!1,error:s instanceof Error?s.message:String(s)}}},I=async(t,o,f,n,r,c)=>{let a=o.map?.allLayers.find(d=>d.id===t.layerId);if(!a)return`Could not find target layer with ID: ${t.layerId}`;let i;if(r){let d=await b(r,o);if("error"in d)return d.error;i=d.geometry}if(a.featureEffect=null,a.featureEffect=new y({filter:new g({...t.objectIds?.length?{objectIds:t.objectIds}:{where:t.where},geometry:i,spatialRelationship:"intersects",distance:r?.distance,units:r?.units}),includedEffect:f,excludedEffect:n}),a.visible=!0,c)return`Applied feature effects to "${a.title??t.layerId}" within current map extent.`;let s=t.objectIds?.length?`${a.objectIdField} IN (${t.objectIds.join(",")})`:t.where,l=await w(o,t.layerId,s,i,r?.distance,r?.units),m=a.title??t.layerId;return l.success?`Applied feature effects to target layer "${a.title??t.layerId}"${r&&"layerId"in r?` using geometry from layer "${r.layerId}"`:""}.`:`Applied filter to "${m}" but no features matched. ${l.error}`},x=async({targetLayer:t,geometryFilter:o,useCurrentExtent:f,includedEffect:n="drop-shadow(2px, 2px, 2px, gray)",excludedEffect:r="grayscale(100%) opacity(60%) blur(2px)"},c)=>{let{mapView:a}=h(c,["mapView"]);return await I(t,a,n,r,o,f)},v=e.object({layerId:e.string().describe("The layerId of the layer containing the geometry by which to filter."),where:e.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:e.number().optional().describe("The buffer distance around the geometry."),units:u.optional().describe("The units for the distance buffer.")}),j=e.object({point:e.object({x:e.number().describe("X coordinate (longitude) from navigation result"),y:e.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:e.object({wkid:e.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")}).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")}).describe("Point coordinates from a previous navigation/geocoding result"),distance:e.number().optional().describe("Optional buffer distance around the point."),units:u.optional().describe("The units for the distance buffer.")}),E=e.object({targetLayer:e.object({layerId:e.string().describe("The layerId of the layer on which to set a feature effect."),where:e.string().describe("The SQL-92 where clause representing the features to emphasize."),objectIds:e.array(e.number()).optional().describe("Array of objectIds from a previous query result. Use this instead of a where clause when the query returned objectIds (e.g. top N results). If provided, takes precedence over where clause.")}),geometryFilter:e.union([v,j]).optional().describe("Optional geometry-based filtering parameters for spatial queries."),useCurrentExtent:e.boolean().optional().describe("Set to true when the previous query used the current map extent as a spatial filter. This ensures the feature effect applies only to features visible in the current view. Default is false."),includedEffect:e.string().default("drop-shadow(2px, 2px, 2px, gray)").describe("The effect applied to features that meet the filter requirements. Valid effects include: bloom, blur, brightness, contrast, drop-shadow, grayscale, hue-rotate, invert, opacity, saturate, and sepia. Prefer default unless specified."),excludedEffect:e.string().default("grayscale(100%) opacity(60%) blur(2px)").describe("The effect applied to features that do not meet the filter requirements. Valid effects include: bloom, blur, brightness, contrast, drop-shadow, grayscale, hue-rotate, invert, opacity, saturate, and sepia. Prefer default unless specified.")}),F=p(x,{name:"setFeatureEffect",description:"Sets a feature effect on a given layer with given filter parameters and feature effects to emphasize certain features that meet a filter requirement. If no feature effect information is provided, then use the default effect provided.",schema:E});return F},"layers/support/FeatureEffect","layers/support/FeatureFilter",a)
|