@arcgis/ai-components 5.1.0-next.91 → 5.1.0-next.92
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/{K35QKERW.js → 7EXACS27.js} +9 -1
- package/dist/cdn/{JQPPOWRC.js → 7GNRYA6B.js} +23 -21
- package/dist/cdn/{DNU63EO4.js → AI3YU24J.js} +1 -1
- package/dist/cdn/{C7UON5BH.js → CROPD47G.js} +1 -1
- package/dist/cdn/{NEMR2XXW.js → FVSGA6BB.js} +1 -1
- package/dist/cdn/{3Q3UHO72.js → GXUZWFDB.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 +6 -7
|
@@ -44,7 +44,13 @@ Only describe what _was_ found \u2014 not what was _used to search_.
|
|
|
44
44
|
|
|
45
45
|
7. Do not give suggestions like exporting the results as the tools are not capable to do that.
|
|
46
46
|
|
|
47
|
-
8.
|
|
47
|
+
8. Format all responses using **Markdown** suitable for chat display.
|
|
48
|
+
|
|
49
|
+
- Use bullet points for lists and use new lines (\\n) and appropriate formatting in your response.
|
|
50
|
+
- Use Markdown emphasis (for example, **bold**) only when it improves clarity; keep formatting minimal and readable.
|
|
51
|
+
- If results are best presented in rows/columns (for example, multiple features sharing the same fields), format them as a **Markdown table**.
|
|
52
|
+
- The table must be valid Markdown with a header row and separator row (e.g., \`| Column |\` and \`| --- |\`).
|
|
53
|
+
- Do not use plain aligned text, CSV-like output, or code fences for tabular data.
|
|
48
54
|
|
|
49
55
|
9. Do NOT say things like "I can't change the map", "I can't highlight features", or suggest WHERE clauses for the user to run manually. A separate system handles map visualization automatically after this step. Your job is ONLY to summarize the data returned by the query.
|
|
50
56
|
|
|
@@ -63,4 +69,6 @@ In all cases:
|
|
|
63
69
|
- End the response immediately after the summary.
|
|
64
70
|
- Do NOT include introductory phrases (e.g., "Found", "Here are", "The results show").
|
|
65
71
|
- Do NOT restate the assigned task or user\u2019s question.
|
|
72
|
+
- Use Markdown formatting for the response.
|
|
73
|
+
- When presenting tabular data, output a valid Markdown table.
|
|
66
74
|
`;export{e as default};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import a from"./4OX7HUMM.js";import{Bb as P,Fb as q,L as
|
|
2
|
+
import a from"./4OX7HUMM.js";import{Bb as P,Fb as q,L as O,M as le,Q as ce,R as V,Za as F,_a as y,a as C,b as I,g as Te,j as Z,k as J,kb as f,q as Ee,qb as ke,u as Ie}from"./YW52XJMM.js";export default $arcgis.t(([mt,ht,{addressToLocations:pt},j,ue,gt,Ve,ft,Pe,Ge,{formatDateOnly:yt,convertDateFormatToIntlOptions:Y,formatTimeOnly:wt,formatDate:Me},Be,Ke,bt,vt,{createRenderer:St},{getSchemesByTag:xt,getSchemes:Tt},{getBackgroundColorTheme:Ce},{createAgeRenderer:Et,createContinuousRenderer:It},{getSchemesByTag:we},{createContinuousRenderer:kt},{createRenderer:$t},{getSchemesByTag:_t},{createRenderer:Nt},{getSchemesByTag:Ft},{createRenderer:Mt},{getSchemesByTag:Ct},{createRenderer:qt},{getSchemesByTag:At},{createAgeRenderer:Rt,createContinuousRenderer:Lt},{createRenderer:zt},{getSchemesByTag:jt},,{fetchKnowledgeGraph:Dt,executeQueryStreaming:Ot},be,qe,Ae,,Vt,{a:l,b:g,c:k,e:$e,f:_e,g:D}])=>{var Fe=e=>Array.isArray(e)&&e.every(O),lt=e=>typeof e=="object"&&e!=null&&"messages"in e&&Fe(e.messages),ct=e=>typeof e=="object"&&e!=null&&"lg_tool_call"in e,A=class extends ke{tools;handleToolErrors=!0;trace=!1;constructor(e,t){let{name:r,tags:a,handleToolErrors:o}=t??{};super({name:r,tags:a,func:(n,s)=>this.run(n,s)}),this.tools=e,this.handleToolErrors=o??this.handleToolErrors}async runTool(e,t){let r=this.tools.find(a=>a.name===e.name);try{if(r===void 0)throw new Error(`Tool "${e.name}" not found.`);let a=await r.invoke({...e,type:"tool_call"},t);return O(a)&&a.getType()==="tool"||J(a)?a:new le({status:"success",name:r.name,content:typeof a=="string"?a:JSON.stringify(a),tool_call_id:e.id})}catch(a){if(!this.handleToolErrors||Ie(a))throw a;return new le({status:"error",content:`Error: ${a.message}
|
|
3
3
|
Please fix your mistakes.`,name:e.name,tool_call_id:e.id??""})}}async run(e,t){let r;if(ct(e))r=[await this.runTool(e.lg_tool_call,t)];else{let n;if(Fe(e))n=e;else if(lt(e))n=e.messages;else throw new Error("ToolNode only accepts BaseMessage[] or { messages: BaseMessage[] } as input.");let s=new Set(n.filter(d=>d.getType()==="tool").map(d=>d.tool_call_id)),i;for(let d=n.length-1;d>=0;d-=1){let c=n[d];if(V(c)){i=c;break}}if(i==null||!V(i))throw new Error("ToolNode only accepts AIMessages as input.");r=await Promise.all(i.tool_calls?.filter(d=>d.id==null||!s.has(d.id)).map(d=>this.runTool(d,t))??[])}if(!r.some(J))return Array.isArray(e)?r:{messages:r};let a=[],o=null;for(let n of r)J(n)?n.graph===Z.PARENT&&Array.isArray(n.goto)&&n.goto.every(s=>Te(s))?o?o.goto.push(...n.goto):o=new Z({graph:Z.PARENT,goto:n.goto}):a.push(n):a.push(Array.isArray(e)?[n]:{messages:[n]});return o&&a.push(o),a}};var Bi=f.Root({llmInputMessages:f({reducer:(e,t)=>P([],t),default:()=>[]})});var K=(e,t)=>({...e,...t}),Q=(e="",t)=>{let r=typeof t=="string"?t.trim():"";if(!r)return e;let a=e.trim();if(!a)return r;if(a===r)return e;let o=a.split(`
|
|
4
4
|
|
|
5
5
|
`);return o[o.length-1]?.trim()===r?e:`${e}
|
|
6
6
|
|
|
7
|
-
${r}`},E=(e,t)=>t??e,Qe=f.Root({agentExecutionContext:f({reducer:K,default:()=>({userRequest:"",assignedTask:"",messages:[],priorSteps:[],sharedState:{}})}),outputMessage:f({reducer:Q,default:()=>""}),summary:f({reducer:E,default:()=>""}),status:f({reducer:E}),sharedStatePatch:f({reducer:E}),intent:f({reducer:E}),vectorSearchLayerResults:f({reducer:E,default:()=>[]}),vectorSearchFieldResults:f({reducer:E}),navigationInternalState:f({reducer:E,default:()=>({toolCallMessage:void 0})})});async function Pt(e,t){let r=j.getDefault().helperServices,a=r.geocode.find(c=>c.name==="ArcGIS World Geocoding Service")??r.geocode[0];if(!a)throw new Error("No geocoding service found in helperServices.");let o=a.url,n=`${ue.assetsPath?.endsWith("/")?ue.assetsPath:`${ue.assetsPath}/`}esri/images/search/search-symbol-32.png`,s=(await pt(o,{address:{SingleLine:e},outFields:["Match_addr"]}))?.[0];if(!s?.extent||!s.location)throw new Error(`Could not find location for: ${e}`);let i=new ht({url:n,width:24,height:24}),d=new mt({geometry:s.location,symbol:i});return t.graphics.removeAll(),t.graphics.add(d),await t.goTo(s.extent),{text:`Successfully zoomed to ${e}.`,sharedStatePatch:{lastResolvedLocation:{value:{location:s.location,address:s.address,extent:s.extent}}}}}var Gt=["mapView"];function $(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("NavigationAgent context missing");let r=Gt.filter(a=>!(a in t));if(r.length)throw new Error(`NavigationAgent context missing: ${r.join(", ")}`);return t}async function Bt({address:e},t){let{mapView:r}=$(t);return await Pt(e,r)}var Kt=l.object({address:l.string().describe("The full address or place name to locate.")}),Qt=y(Bt,{name:"goToAddress",description:"Geocodes an address using Esri's World Geocoding Service and zooms the map to that location.",schema:Kt});async function Ut(e,t){let r=t.map.bookmarks;if(!r||r.length===0)throw new Error("No bookmarks found in the map.");let a=r.find(n=>n.name===e);if(!a)throw new Error(`Bookmark with name "${e}" not found.`);let o=a.viewpoint;if(!o)throw new Error(`Bookmark with name "${e}" does not have a valid viewpoint.`);return await t.goTo(o),{text:`Navigated to bookmark: ${e}`}}async function Wt({bookmarkName:e},t){let{mapView:r}=$(t);return await Promise.resolve(Ut(e,r))}var Ht=F.object({bookmarkName:F.string().describe("The name of the bookmark to navigate to.")}),Zt=y(Wt,{name:"goToBookmark",description:"Go to the extent of the bookmark with the given name.",schema:Ht});async function Jt(e,t,r){let a=r.map?.allLayers.find(n=>n.id===e);if(!a)return{text:`Error: Layer with id ${e} not found`};let o=a.createQuery();o.where=t??"1=1";try{let{extent:n,count:s}=await a.queryExtent(o);if(s===0)return{text:`No features found in ${a.title} matching: ${t}`};if(n)await r.goTo(n);else return{text:`Error: Unable to determine extent for ${a.title}`};return{text:`Successfully zoomed to ${s} feature(s) in ${a.title}`}}catch(n){return console.error("Error in goToFeatures:",n),{text:`Error: ${n instanceof Error?n.message:"Unknown error"}`}}}async function Yt({layerId:e,where:t},r){let{mapView:a}=$(r);return await Jt(e,t,a)}var Xt=F.object({layerId:F.string().describe("The layerId of the layer to zoom to."),where:F.string().describe("The sql-92 where clause used to query features to zoom to")}),er=y(Yt,{name:"goToFeatures",description:"Go to the features that match the given filter related to the given layerId.",schema:Xt});async function tr(e){let t=new gt({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 rr(e,t){let{mapView:r}=$(t);return await tr(r)}var ar=F.object({}),or=y(rr,{name:"goToFullExtent",description:"Zooms the map to the full world extent using Esri's Geocoding Service.",schema:ar});async function nr(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 ir(e,t){let{mapView:r}=$(t);return await nr(r)}var sr=l.object({}),lr=y(ir,{name:"goToHomeExtent",description:"Go to the initial web map view extent",schema:sr});async function cr(e,t){await t.when();let r=t.map?.allLayers.find(o=>o.id===e);if(!r)return console.warn(`[goToLayer] No matching FeatureLayer found for: ${e}`),{text:`Could not find layer for: ${e}`};let a;return(r.type==="link-chart"||r.type==="knowledge-graph-sublayer")&&t.map?.activeLinkChartLayer?a=t.map.diagramNodesExtent:a=r.fullExtent,a?(await t.goTo(a),r.visible=!0,{text:`Successfully zoomed to: ${r.title??""}`}):{text:"Layer has no defined extent. Cannot zoom to layer."}}async function dr({layerId:e},t){let{mapView:r}=$(t);return await cr(e,r)}var ur=F.object({layerId:F.string().describe("The id of the layer to navigate to")}),mr=y(dr,{name:"goToLayer",description:"Zooms the map view to the full extent of the top matching layer.",schema:ur});async function hr(e,t){return await t.goTo({scale:e}),{text:`Successfully zoomed to: ${e}`}}async function pr({scale:e},t){let{mapView:r}=$(t);return await hr(e,r)}var gr=l.object({scale:l.number().describe("The map scale of the view to go to.")}),fr=y(pr,{name:"goToScale",description:"Go to the specified view scale.",schema:gr});async function yr(e,t,r){let a={target:new Ve({longitude:e.longitude,latitude:e.latitude,spatialReference:{wkid:4326}})};return r?.zoom!==void 0&&(a.zoom=r.zoom),r?.scale!==void 0&&(a.scale=r.scale),await t.goTo(a),{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 wr({center:e,zoom:t,scale:r},a){let{mapView:o}=$(a);return await yr(e,o,{zoom:t,scale:r})}var br=l.object({center:l.object({longitude:l.number().describe("The longitude (x-coordinate) of the point to navigate to."),latitude:l.number().describe("The latitude (y-coordinate) of the point to navigate to.")}),zoom:l.number().optional().describe("The zoom level. Higher values = more zoomed in."),scale:l.number().optional().describe("The map scale. Alternative to zoom. Smaller numbers = more zoomed in.")}),vr=y(wr,{name:"goToViewpoint",description:"Go to the specified viewpoint. This can contain a combination of scale, center, zoom, etc.",schema:br});async function Sr(e,t){return await t.goTo({zoom:e}),{text:`Successfully zoomed to: ${e}`}}async function xr({zoom:e},t){let{mapView:r}=$(t);return await Sr(e,r)}var Tr=l.object({zoom:l.number().min(1).max(20).describe("The zoom level of the view to go to.")}),Er=y(xr,{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:Tr}),ve=[Qt,Zt,er,or,lr,mr,fr,vr,Er],Re=Object.assign({"../agents/arcgisKnowledge/prompts/arcgis_knowledge_current_lc_context.md":()=>import("./LSGRWCAO.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_intent_prompt.md":()=>import("./KKHKKCYH.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_tool_prompt.md":()=>import("./KQ6LEQHH.js").then(e=>e.default),"../agents/dataExploration/prompts/data_explore_filter_prompt.md":()=>import("./MZJGADGH.js").then(e=>e.default),"../agents/dataExploration/prompts/data_explore_query_prompt.md":()=>import("./5PT7ZFXF.js").then(e=>e.default),"../agents/dataExploration/prompts/summarize_query_response_prompt.md":()=>import("./
|
|
7
|
+
${r}`},E=(e,t)=>t??e,Qe=f.Root({agentExecutionContext:f({reducer:K,default:()=>({userRequest:"",assignedTask:"",messages:[],priorSteps:[],sharedState:{}})}),outputMessage:f({reducer:Q,default:()=>""}),summary:f({reducer:E,default:()=>""}),status:f({reducer:E}),sharedStatePatch:f({reducer:E}),intent:f({reducer:E}),vectorSearchLayerResults:f({reducer:E,default:()=>[]}),vectorSearchFieldResults:f({reducer:E}),navigationInternalState:f({reducer:E,default:()=>({toolCallMessage:void 0})})});async function Pt(e,t){let r=j.getDefault().helperServices,a=r.geocode.find(c=>c.name==="ArcGIS World Geocoding Service")??r.geocode[0];if(!a)throw new Error("No geocoding service found in helperServices.");let o=a.url,n=`${ue.assetsPath?.endsWith("/")?ue.assetsPath:`${ue.assetsPath}/`}esri/images/search/search-symbol-32.png`,s=(await pt(o,{address:{SingleLine:e},outFields:["Match_addr"]}))?.[0];if(!s?.extent||!s.location)throw new Error(`Could not find location for: ${e}`);let i=new ht({url:n,width:24,height:24}),d=new mt({geometry:s.location,symbol:i});return t.graphics.removeAll(),t.graphics.add(d),await t.goTo(s.extent),{text:`Successfully zoomed to ${e}.`,sharedStatePatch:{lastResolvedLocation:{value:{location:s.location,address:s.address,extent:s.extent}}}}}var Gt=["mapView"];function $(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("NavigationAgent context missing");let r=Gt.filter(a=>!(a in t));if(r.length)throw new Error(`NavigationAgent context missing: ${r.join(", ")}`);return t}async function Bt({address:e},t){let{mapView:r}=$(t);return await Pt(e,r)}var Kt=l.object({address:l.string().describe("The full address or place name to locate.")}),Qt=y(Bt,{name:"goToAddress",description:"Geocodes an address using Esri's World Geocoding Service and zooms the map to that location.",schema:Kt});async function Ut(e,t){let r=t.map.bookmarks;if(!r||r.length===0)throw new Error("No bookmarks found in the map.");let a=r.find(n=>n.name===e);if(!a)throw new Error(`Bookmark with name "${e}" not found.`);let o=a.viewpoint;if(!o)throw new Error(`Bookmark with name "${e}" does not have a valid viewpoint.`);return await t.goTo(o),{text:`Navigated to bookmark: ${e}`}}async function Wt({bookmarkName:e},t){let{mapView:r}=$(t);return await Promise.resolve(Ut(e,r))}var Ht=F.object({bookmarkName:F.string().describe("The name of the bookmark to navigate to.")}),Zt=y(Wt,{name:"goToBookmark",description:"Go to the extent of the bookmark with the given name.",schema:Ht});async function Jt(e,t,r){let a=r.map?.allLayers.find(n=>n.id===e);if(!a)return{text:`Error: Layer with id ${e} not found`};let o=a.createQuery();o.where=t??"1=1";try{let{extent:n,count:s}=await a.queryExtent(o);if(s===0)return{text:`No features found in ${a.title} matching: ${t}`};if(n)await r.goTo(n);else return{text:`Error: Unable to determine extent for ${a.title}`};return{text:`Successfully zoomed to ${s} feature(s) in ${a.title}`}}catch(n){return console.error("Error in goToFeatures:",n),{text:`Error: ${n instanceof Error?n.message:"Unknown error"}`}}}async function Yt({layerId:e,where:t},r){let{mapView:a}=$(r);return await Jt(e,t,a)}var Xt=F.object({layerId:F.string().describe("The layerId of the layer to zoom to."),where:F.string().describe("The sql-92 where clause used to query features to zoom to")}),er=y(Yt,{name:"goToFeatures",description:"Go to the features that match the given filter related to the given layerId.",schema:Xt});async function tr(e){let t=new gt({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 rr(e,t){let{mapView:r}=$(t);return await tr(r)}var ar=F.object({}),or=y(rr,{name:"goToFullExtent",description:"Zooms the map to the full world extent using Esri's Geocoding Service.",schema:ar});async function nr(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 ir(e,t){let{mapView:r}=$(t);return await nr(r)}var sr=l.object({}),lr=y(ir,{name:"goToHomeExtent",description:"Go to the initial web map view extent",schema:sr});async function cr(e,t){await t.when();let r=t.map?.allLayers.find(o=>o.id===e);if(!r)return console.warn(`[goToLayer] No matching FeatureLayer found for: ${e}`),{text:`Could not find layer for: ${e}`};let a;return(r.type==="link-chart"||r.type==="knowledge-graph-sublayer")&&t.map?.activeLinkChartLayer?a=t.map.diagramNodesExtent:a=r.fullExtent,a?(await t.goTo(a),r.visible=!0,{text:`Successfully zoomed to: ${r.title??""}`}):{text:"Layer has no defined extent. Cannot zoom to layer."}}async function dr({layerId:e},t){let{mapView:r}=$(t);return await cr(e,r)}var ur=F.object({layerId:F.string().describe("The id of the layer to navigate to")}),mr=y(dr,{name:"goToLayer",description:"Zooms the map view to the full extent of the top matching layer.",schema:ur});async function hr(e,t){return await t.goTo({scale:e}),{text:`Successfully zoomed to: ${e}`}}async function pr({scale:e},t){let{mapView:r}=$(t);return await hr(e,r)}var gr=l.object({scale:l.number().describe("The map scale of the view to go to.")}),fr=y(pr,{name:"goToScale",description:"Go to the specified view scale.",schema:gr});async function yr(e,t,r){let a={target:new Ve({longitude:e.longitude,latitude:e.latitude,spatialReference:{wkid:4326}})};return r?.zoom!==void 0&&(a.zoom=r.zoom),r?.scale!==void 0&&(a.scale=r.scale),await t.goTo(a),{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 wr({center:e,zoom:t,scale:r},a){let{mapView:o}=$(a);return await yr(e,o,{zoom:t,scale:r})}var br=l.object({center:l.object({longitude:l.number().describe("The longitude (x-coordinate) of the point to navigate to."),latitude:l.number().describe("The latitude (y-coordinate) of the point to navigate to.")}),zoom:l.number().optional().describe("The zoom level. Higher values = more zoomed in."),scale:l.number().optional().describe("The map scale. Alternative to zoom. Smaller numbers = more zoomed in.")}),vr=y(wr,{name:"goToViewpoint",description:"Go to the specified viewpoint. This can contain a combination of scale, center, zoom, etc.",schema:br});async function Sr(e,t){return await t.goTo({zoom:e}),{text:`Successfully zoomed to: ${e}`}}async function xr({zoom:e},t){let{mapView:r}=$(t);return await Sr(e,r)}var Tr=l.object({zoom:l.number().min(1).max(20).describe("The zoom level of the view to go to.")}),Er=y(xr,{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:Tr}),ve=[Qt,Zt,er,or,lr,mr,fr,vr,Er],Re=Object.assign({"../agents/arcgisKnowledge/prompts/arcgis_knowledge_current_lc_context.md":()=>import("./LSGRWCAO.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_intent_prompt.md":()=>import("./KKHKKCYH.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_tool_prompt.md":()=>import("./KQ6LEQHH.js").then(e=>e.default),"../agents/dataExploration/prompts/data_explore_filter_prompt.md":()=>import("./MZJGADGH.js").then(e=>e.default),"../agents/dataExploration/prompts/data_explore_query_prompt.md":()=>import("./5PT7ZFXF.js").then(e=>e.default),"../agents/dataExploration/prompts/summarize_query_response_prompt.md":()=>import("./7EXACS27.js").then(e=>e.default),"../agents/help/prompts/help_prompt.md":()=>import("./ESTSYVJP.js").then(e=>e.default),"../agents/layerStyling/prompts/layer_styling_prompt.md":()=>import("./CFT5BBC6.js").then(e=>e.default),"../agents/navigation/prompts/navigation_intent_prompt.md":()=>import("./SFREIREB.js").then(e=>e.default),"../agents/navigation/prompts/navigation_tool_prompt.md":()=>import("./DMLSCJAM.js").then(e=>e.default)});async function R(e){let t=Object.entries(Re).find(([r])=>r.endsWith(`/${e}.md`));if(!t)throw new Error(`Prompt not found: ${e}
|
|
8
8
|
Available prompts:
|
|
9
9
|
${Object.keys(Re).join(`
|
|
10
|
-
`)}`);return await t[1]()}async function Ir(e,t){let r=await R("navigation_tool_prompt"),{mapView:a}=$(t),o=a.map,n=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(`
|
|
11
|
-
`):"",s=e.vectorSearchFieldResults?.length>0?JSON.stringify(e.vectorSearchFieldResults,null,2):"",i=e.intent==="goToBookmark"&&o.
|
|
12
|
-
${
|
|
10
|
+
`)}`);return await t[1]()}async function Ir(e,t){let r=await R("navigation_tool_prompt"),{mapView:a}=$(t),o=a.map.bookmarks?.map(p=>p.name).filter(Boolean)??[],n=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(`
|
|
11
|
+
`):"",s=e.vectorSearchFieldResults?.length>0?JSON.stringify(e.vectorSearchFieldResults,null,2):"",i=e.intent==="goToBookmark"&&o.length?`Available bookmarks:
|
|
12
|
+
${o.map(p=>`- ${p}`).join(`
|
|
13
|
+
`)}`:"",d=(e.intent==="goToLayer"||e.intent==="goToFeatures")&&e.vectorSearchLayerResults?.length?`Candidate layers:
|
|
13
14
|
${n}`:"",c=e.intent==="goToFeatures"&&e.vectorSearchFieldResults?.length?`Candidate fields:
|
|
14
|
-
${s}`:"",u={intent:e.intent,bookmarksSection:i,layersSection:d,fieldsSection:c,currentZoom:a.zoom,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},m=await
|
|
15
|
-
`),d.sharedStatePatch&&(s={...s,...d.sharedStatePatch})}return await g({text:`Finished executing navigation tool: ${n}`},t),{...e,outputMessage:n,sharedStatePatch:s,status:"success",summary:n?U(n):"Navigation executed.",navigationInternalState:{...e.navigationInternalState,toolCallMessage:void 0}}}catch(a){let o=a instanceof Error?a.message:String(a);return await g({text:`Navigation tool execution failed: ${o}`},t),{...e,outputMessage:`Navigation tool execution failed: ${o}`,status:"failed",summary:`Navigation tool execution failed: ${o}`,navigationInternalState:{...e.navigationInternalState,toolCallMessage:void 0}}}}async function _r(e,t){let r=await R("navigation_intent_prompt"),{mapView:a}=$(t),o=ve.map(m=>({name:m.name,description:m.description,schema:m.schema})),n=a.map,s=n.
|
|
16
|
-
${
|
|
15
|
+
${s}`:"",u={intent:e.intent,bookmarksSection:i,layersSection:d,fieldsSection:c,currentZoom:a.zoom,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},m=await D({promptText:r,modelTier:"fast",inputVariables:u,tools:ve}),h=(m.tool_calls?.length??0)>0,S=typeof m.text=="string"?m.text.trim():"",b=S.length>0;return{...e,navigationInternalState:{...e.navigationInternalState,toolCallMessage:h?m:void 0},outputMessage:h?e.outputMessage:S,status:h?e.status:b?"success":"failed"}}var U=(e,t=300)=>{let r=e.replace(/\s+/gu," ").replace(/[*_`#>\-]/gu,"").trim();return r.length>t?`${r.slice(0,t)}...`:r},kr=e=>{let t=typeof e=="string"?e:String(e);try{let r=JSON.parse(t);if(r&&typeof r=="object"&&typeof r.text=="string")return r}catch{console.warn("Failed to parse tool response as JSON:",t)}return{text:t}};async function $r(e,t){let r=new A(ve);try{let a=e.navigationInternalState.toolCallMessage;if(!a)throw new Error("navigationToolCalling: missing navigationInternalState.toolCallMessage");let{messages:o}=await r.invoke({messages:[a]},t),n="",s;for(let i of o){let d=kr(i.content);d.text&&(n+=`${d.text}
|
|
16
|
+
`),d.sharedStatePatch&&(s={...s,...d.sharedStatePatch})}return await g({text:`Finished executing navigation tool: ${n}`},t),{...e,outputMessage:n,sharedStatePatch:s,status:"success",summary:n?U(n):"Navigation executed.",navigationInternalState:{...e.navigationInternalState,toolCallMessage:void 0}}}catch(a){let o=a instanceof Error?a.message:String(a);return await g({text:`Navigation tool execution failed: ${o}`},t),{...e,outputMessage:`Navigation tool execution failed: ${o}`,status:"failed",summary:`Navigation tool execution failed: ${o}`,navigationInternalState:{...e.navigationInternalState,toolCallMessage:void 0}}}}async function _r(e,t){let r=await R("navigation_intent_prompt"),{mapView:a}=$(t),o=ve.map(m=>({name:m.name,description:m.description,schema:m.schema})),n=a.map.bookmarks?.map(m=>m.name).filter(Boolean)??[],s=n.length?`Available bookmarks:
|
|
17
|
+
${n.map(m=>`- ${m}`).join(`
|
|
18
|
+
`)}`:"",i={tools:o.map(({name:m,description:h,schema:S})=>`${m}: ${h}, ${JSON.stringify(S)}`).join(`
|
|
17
19
|
`),bookmarks:s,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},d=l.object({intent:l.string()}),c=await _e({promptText:r,inputVariables:i,schema:d,modelTier:"fast"}),u=typeof c.intent=="string"?c.intent.trim().replace(/^"|"$/gu,""):"";return{...e,intent:u||""}}var x=(e,t)=>{let r=e?.configurable?.services?.[t];if(r==null)throw new Error(`${t} missing in config.configurable.services`);return r},Nr=.7,Fr=async(e,t)=>{try{await g({text:`Similarity search to find layers: ${e.agentExecutionContext.assignedTask}`},t);let r=x(t,"layerSearch"),a=x(t,"layersAndFieldsRegistry"),o=x(t,"embeddingCache"),n=(await r.searchLayers({text:e.agentExecutionContext.assignedTask,minScore:Nr,embeddingCache:o})).map(({id:i,score:d})=>{let c=a.get(i)?.layerItem;return{id:i,title:c?.title,name:c?.name??void 0,score:d}}),s;return n.length>0?s=`Vector search completed. Matching layers:
|
|
18
20
|
${n.map(i=>`- layerId=${i.id} | title=${i.title??""} | name=${i.name??""} | score=${i.score.toFixed(2)}`).join(`
|
|
19
21
|
`)}`:s="Vector search completed. No matching layers found.",await g({text:s},t),{...e,vectorSearchLayerResults:n}}catch(r){throw await g({text:`Error during vector search layers: ${r instanceof Error?r.message:String(r)}`},t),r}},Le=.7,Mr=10,Cr=async(e,t)=>{try{await g({text:`Similarity search to find fields: ${e.agentExecutionContext.assignedTask}`},t);let r=x(t,"fieldSearch"),a=x(t,"layersAndFieldsRegistry"),o=x(t,"embeddingCache"),n=e.vectorSearchLayerResults?.map(d=>d.id)??[];if(n.length===0)return await g({text:"No candidate layers for field search"},t),e;let s=(await r.searchFields({text:e.agentExecutionContext.assignedTask,layerIds:n,minScore:Le,topResults:Mr,embeddingCache:o})).map(({layerId:d,results:c})=>{let u=a.get(d)?.fieldRegistry;return{layerId:d,layerName:a.get(d)?.layerItem.name,results:c.map(m=>{let h=u?.get(m.name);return{name:m.name,score:m.score,type:h?.type,alias:h?.alias,description:h?.description,statistics:h?.statistics}})}}),i;return s.length>0?i=`Vector search completed. Matching layers and fields:
|
|
@@ -39,7 +41,7 @@ ${d.results.map(c=>` - ${c.name} (${c.score.toFixed(2)})`).join(`
|
|
|
39
41
|
_Example: “Center the map on San Francisco at scale 50000”_
|
|
40
42
|
_Example: “Zoom to the features in the schools layer where city = 'Austin'”_
|
|
41
43
|
_Example: “Go to the Downtown bookmark”_
|
|
42
|
-
_Example: “Where is Mount Rainier?”_`,Ws={id:"navigation",name:"Navigation Agent",description:Rr,createGraph:Ar,workspace:Qe},Ue=f.Root({agentExecutionContext:f({reducer:K,default:()=>({userRequest:"",assignedTask:"",messages:[],priorSteps:[],sharedState:{}})}),outputMessage:f({reducer:Q,default:()=>""}),summary:f({reducer:E,default:()=>""}),status:f({reducer:E}),vectorSearchLayerIds:f(),vectorSearchFieldResults:f(),layerFieldInfo:f(),queryResponse:f(),dataExplorationMessages:f({reducer:P,default:()=>[]})}),Lr=async(e,t)=>(await g({text:"Exiting Data Exploration agent"},t),e),Se=async(e,t)=>{let r=e.tool_calls??[];if(r.length===0){await g({text:`LLM did not request any tool calls: ${String(e?.content)}`},t);return}await Promise.all(r.map(async a=>await g({text:`LLM invoked ${a.name} tool with arguments: ${JSON.stringify(a.args,null,2)}`},t)))},zr=["mapView"];function L(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("DataExplorationAgent context missing");let r=zr.filter(a=>!(a in t));if(r.length)throw new Error(`DataExplorationAgent context missing: ${r.join(", ")}`);return t}var jr=e=>{let t=e.map?.allLayers.filter(a=>a.type==="feature"),r=0;return t?.forEach(a=>{let o=a;o.featureEffect&&(o.featureEffect=null,r++)}),r>0?`Cleared filters from ${r} layer(s). View unchanged.`:"No active filters to clear. View unchanged."},Or=async(e,t)=>{let{mapView:r}=L(t);return jr(r)},Dr=y(Or,{name:"clearFilters",description:"Clears all feature effects/filters from the map but does NOT change the current view. Use when user says 'clear filters', 'reset filters', 'remove filters', 'show all features', or wants to remove emphasis without navigating anywhere.",schema:l.object({})}),Vr=async e=>{e.map?.allLayers.filter(r=>r.type==="feature")?.forEach(r=>{let a=r;a.featureEffect&&(a.featureEffect=null)});let t=e.map.initialViewProperties?.viewpoint?.targetGeometry;return t?(await e.goTo(t),"Cleared all filters and returned to home extent."):"Cleared all filters. Could not determine home extent."},Pr=async(e,t)=>{let{mapView:r}=L(t);return await Vr(r)},Gr=y(Pr,{name:"resetMap",description:"Clears all feature effects/filters from the map AND zooms to the home extent (initial map view). Use when user says 'reset map', 'reset the map', 'start over', or wants to both clear filters and return to the initial view.",schema:l.object({})});function te(e){return"point"in e&&e.point!==void 0}function G(e){return"layerId"in e&&e.layerId!==void 0}var oe=async(e,t)=>{if(te(e)){let{point:r}=e;return{geometry:new Ve({x:r.x,y:r.y,spatialReference:r.spatialReference?{wkid:r.spatialReference.wkid}:t.spatialReference})}}if(G(e)){let r=t.map?.allLayers.find(o=>o.id===e.layerId);if(!r)return{error:`Could not find geometry layer with ID: ${e.layerId}`};let a=r.title??r.id;try{let o=await r.queryFeatures({where:e.where,returnGeometry:!0,outSpatialReference:t.spatialReference});if(!o.features.length)return{error:`No features found in geometry layer "${a}" with the specified where clause: ${e.where}`};let n;if(o.features.length===1){let s=o.features[0].geometry;if(!s)return{error:"The geometry of the first feature is undefined or null."};n=s}else{let s=o.features.map(d=>d.geometry),i=Ge.executeMany(s);if(!i)return{error:"Failed to create a combined geometry."};n=i}return n.spatialReference||(n.spatialReference=t.spatialReference),{geometry:n}}catch(o){return{error:`Failed to query geometry: ${String(o)}`}}}return{error:"Invalid geometry configuration provided"}},Br=async(e,t,r,a,o,n)=>{let s=e.map?.allLayers.find(d=>d.id===t);if(!s)return{success:!1,error:`Layer '${t}' not found.`};let i=s.createQuery();i.where=r??"1=1",a&&(i.geometry=a,i.spatialRelationship="intersects",o&&(i.distance=o),n&&(i.units=n));try{let{extent:d,count:c}=await s.queryExtent(i);return!d||c===0?{success:!1,error:`No features found for filter (where: ${i.where}${a?", spatial filter used":""})`}:(await e.goTo(d),{success:!0})}catch(d){return{success:!1,error:d instanceof Error?d.message:String(d)}}},Kr=async(e,t,r,a,o,n)=>{let s=t.map?.allLayers.find(m=>m.id===e.layerId);if(!s)return`Could not find target layer with ID: ${e.layerId}`;let i;if(o){let m=await oe(o,t);if("error"in m)return m.error;i=m.geometry}if(s.featureEffect=null,s.featureEffect=new ft({filter:new Pe({...e.objectIds?.length?{objectIds:e.objectIds}:{where:e.where},geometry:i,spatialRelationship:"intersects",distance:o?.distance,units:o?.units}),includedEffect:r,excludedEffect:a}),s.visible=!0,n)return`Applied feature effects to "${s.title??e.layerId}" within current map extent.`;let d=e.objectIds?.length?`${s.objectIdField} IN (${e.objectIds.join(",")})`:e.where,c=await Br(t,e.layerId,d,i,o?.distance,o?.units),u=s.title??e.layerId;return c.success?`Applied feature effects to target layer "${s.title??e.layerId}"${o&&"layerId"in o?` using geometry from layer "${o.layerId}"`:""}.`:`Applied filter to "${u}" but no features matched. ${c.error}`},Qr=["feet","kilometers","meters","miles","nautical-miles","us-nautical-miles"],z=l.enum(Qr),Ur=async({targetLayer:e,geometryFilter:t,useCurrentExtent:r,includedEffect:a="drop-shadow(2px, 2px, 2px, gray)",excludedEffect:o="grayscale(100%) opacity(60%) blur(2px)"},n)=>{let{mapView:s}=L(n);return await Kr(e,s,a,o,t,r)},Wr=l.object({layerId:l.string().describe("The layerId of the layer containing the geometry by which to filter."),where:l.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:l.number().optional().describe("The buffer distance around the geometry."),units:z.optional().describe("The units for the distance buffer.")}),Hr=l.object({point:l.object({x:l.number().describe("X coordinate (longitude) from navigation result"),y:l.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:l.object({wkid:l.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:l.number().optional().describe("Optional buffer distance around the point."),units:z.optional().describe("The units for the distance buffer.")}),Zr=l.object({targetLayer:l.object({layerId:l.string().describe("The layerId of the layer on which to set a feature effect."),where:l.string().describe("The SQL-92 where clause representing the features to emphasize."),objectIds:l.array(l.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:l.union([Wr,Hr]).optional().describe("Optional geometry-based filtering parameters for spatial queries."),useCurrentExtent:l.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:l.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:l.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.")}),Jr=y(Ur,{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:Zr}),pe=e=>{if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"&&Number.isFinite(e)){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}return null},Yr=e=>!e||e==="system"?Intl.DateTimeFormat().resolvedOptions().timeZone:e==="unknown"?"UTC":e,Xr=e=>{if(typeof e=="string"&&e)return e;let t=pe(e);return t?t.toISOString().slice(0,10):null},We=()=>{let e=new Date().getTimezoneOffset(),t=e<=0?"+":"-",r=Math.floor(Math.abs(e)/60).toString().padStart(2,"0"),a=(Math.abs(e)%60).toString().padStart(2,"0"),o=`${t}${r}:${a}`;return{userTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,userTimezoneOffset:o}},ea=(e,t,r)=>{let a=t?.toLowerCase();if(a==="date-only"){let n=Xr(e);return n?yt(n,Y("short-date")):e}if(a==="time-only"){if(typeof e=="string"&&e)return wt(e,Y("long-time"));let n=pe(e);return n?Me(n,{...Y("long-time"),timeZone:"UTC"}):e}let o=pe(e);return o?Me(o,{...Y("short-date-short-time"),timeZone:Yr(r)}):e},He=(e,t,r)=>{if(e&&typeof e!="function"){let a="getField"in r&&r.getField?.(e),o=a&&"getFieldDomain"in r&&r.getFieldDomain?r.getFieldDomain(a.name):null;if(o?.type==="coded-value"){let n=o.codedValues.find(s=>s.code===t);return n?n.name:null}}return null},ta=e=>!e||e==="system"?Intl.DateTimeFormat().resolvedOptions().timeZone:e==="unknown"?"UTC":e,ra=e=>{if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"&&Number.isFinite(e)){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}if(typeof e=="string"&&e){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}return null},aa=(e,t)=>{if(typeof e!="number")return e;let r={};t.minimumFractionDigits!==void 0&&(r.minimumFractionDigits=t.minimumFractionDigits),t.maximumFractionDigits!==void 0&&(r.maximumFractionDigits=t.maximumFractionDigits),t.useGrouping==="always"?r.useGrouping=!0:t.useGrouping==="never"&&(r.useGrouping=!1);try{return new Intl.NumberFormat(void 0,r).format(e)}catch{return e}},oa=(e,t,r)=>{let a=ra(e);if(!a)return e;let o={};t.dateStyle?o.dateStyle=t.dateStyle:(t.year&&(o.year=t.year),t.month&&(o.month=t.month)),t.timeStyle&&(o.timeStyle=t.timeStyle),t.timeStyle&&t.hour12==="always"?o.hour12=!0:t.timeStyle&&t.hour12==="never"&&(o.hour12=!1),o.timeZone=ta(r);try{return new Intl.DateTimeFormat(void 0,o).format(a)}catch{return e}},Ze=(e,t)=>e.getFieldAlias?.(t)??e.fieldsIndex?.get(t)?.alias??e.fieldsIndex?.get(t)?.name??t,Je=(e,t,r,a,o)=>{if(r==null)return r;let n=e.getFieldConfiguration?.(t)?.fieldFormat;return n?.type==="number"?aa(r,n):n?.type==="date-time"?oa(r,n,o):ea(r,a,o)},na=(e,t,r,a)=>{let o=e.fieldsIndex?.get(t),n=He(t,r,e)??r;return Je(e,t,n,o?.type,a)},ia=(e,t)=>Ze(e,t),Ye=(e,t,r)=>{let a=e.objectIdField,o=t.features.map(s=>s.attributes[a]),n=t.features.map(s=>{let i=s.attributes,d={};return e.fields.forEach(c=>{if(!Object.hasOwn(i,c.name))return;let u=i[c.name];if(c.name===a){d[c.name]=u;return}let m=He(c.name,u,e)??u,h=Ze(e,c.name);d[h]=Je(e,c.name,m,c.type,r)}),d});return{objectIds:o,attributes:n}},sa=(e,t,r)=>{let a=e.createQuery();return a.outFields=[t],a.where=r||"1=1",a.num=1,a},la=async(e,t,r,a)=>{let o=a.map?.allLayers.find(u=>u.id===e),n=sa(o,t,r.where),s=(await o.queryFeatures(n)).features[0],i=s?s.attributes[t]:null,d=na(o,t,i,a.timeZone),c=ia(o,t);return{tool:"getAttribute",layerName:o.title??e,summary:`${c} = ${d}`,details:{fieldName:t,fieldAlias:c!==t?c:void 0,value:d,where:r.where}}};async function ca({layerId:e,fieldName:t,query:r},a){let{mapView:o}=L(a),n=await la(e,t,r,o);return JSON.stringify(n,null,2)}var da=l.object({layerId:l.string().describe("The layerId of the layer containing the field from which to get a value."),fieldName:l.string().describe("The name of the field/attribute from which to get a field value."),query:l.object({where:l.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value.")})}),ua=y(ca,{name:"getAttribute",description:"Returns an attribute value for a given feature.",schema:da}),xe=(e,t,r)=>r?e.hasAllFeaturesInView&&e.availableFields===t:e.hasAllFeatures&&e.availableFields===t;function re(e,t){let r=e??"";return t!=null&&t&&(r=r?`(${r}) AND (${t})`:t),r||null}var ma=async e=>{let{targetLayer:t,fieldName:r,statisticType:a,mapView:o,layersAndFieldsRegistry:n,geometryFilter:s}=e,i=o.map?.allLayers.find(v=>v.id===t.layerId);if(!i)throw new Error(`Layer '${t.layerId}' not found.`);let d=await o.whenLayerView(i),c=n.get(t.layerId)?.fieldRegistry.get(r),u=c?.alias;if(!c)throw new Error(`Field '${r}' not found.`);let m,h;if(s){let v=await oe(s,o);if("error"in v)throw new Error(v.error);if(!v.geometry)throw G(s)?new Error(`No features found matching: ${s.where}`):new Error("Failed to create geometry");if(G(s)){let T=o.map?.allLayers.find(N=>N.id===s.layerId);m={geometryLayerName:T?.title??T?.id,geometryLayerId:s.layerId,geometryWhere:s.where,distance:s.distance,units:s.units,applied:!0}}else te(s)&&(m={point:s.point,distance:s.distance,units:s.units,applied:!0});h=new Pe({geometry:v.geometry,distance:s.distance,units:s.units,spatialRelationship:"intersects"})}let S=xe(d,[r],!1),b=null,p=null,w=10;if(c.type!=="geometry"&&c.type!=="oid"&&c.type!=="global-id")try{let v={layer:i,useFeaturesInView:S,view:S?o:void 0,field:r,sqlWhere:re(i.definitionExpression,t.where),...h&&{filter:h},outStatisticTypes:{include:[a]}};b=await Be(v);let T=["string","small-integer","integer"],N=c.domain?.type==="coded-value"?c.domain:null;(T.includes(c.type)||N)&&(p=(await Ke({layer:i,useFeaturesInView:S,view:S?o:void 0,field:r,sqlWhere:re(i.definitionExpression,t.where),...h&&{filter:h}})).uniqueValueInfos.sort((M,W)=>W.count-M.count).slice(0,w)),p&&c.domain?.type==="coded-value"&&(p=p.map(M=>({...M,value:N?N.getName(M.value)??M.value:M.value})))}catch(v){console.error("Statistics error:",v)}return{tool:"getStatistics",layerName:i.title??t.layerId,summary:`${a} = ${typeof b?.[a]=="number"?b[a]:"N/A"}`,details:{fieldName:r,fieldAlias:u,statisticType:a,statistic:b?.[a]??null,summaryStatistics:b,uniqueValues:p,where:t.where,spatialFilterInfo:m}}};async function ha({targetLayer:e,fieldName:t,statisticType:r,geometryFilter:a},o){let n=x(o,"layersAndFieldsRegistry"),{mapView:s}=L(o),i=await ma({targetLayer:e,fieldName:t,statisticType:r,mapView:s,layersAndFieldsRegistry:n,geometryFilter:a});return JSON.stringify(i,null,2)}var pa=l.object({layerId:l.string().describe("The layerId of the layer containing the geometry by which to filter."),where:l.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:l.number().optional().describe("The buffer distance around the geometry."),units:z.optional().describe("The units for the distance buffer.")}),ga=l.object({point:l.object({x:l.number().describe("X coordinate (longitude) from navigation result"),y:l.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:l.object({wkid:l.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:l.number().optional().describe("Optional buffer distance around the point."),units:z.optional().describe("The units for the distance buffer.")}),fa=l.object({targetLayer:l.object({layerId:l.string().describe("The layerId of the layer containing the field from which to get a value."),where:l.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value.")}),geometryFilter:l.union([pa,ga]).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:l.string().describe("The name of the field for which to get statistics. STRICTLY DO NOT use OBJECTID. Use any other field"),statisticType:l.enum(["avg","max","median","min","stddev","sum","variance","nullcount","count"]).describe("The statistic type to calculate.")}),ya=y(ha,{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.
|
|
44
|
+
_Example: “Where is Mount Rainier?”_`,Ws={id:"navigation",name:"Navigation Agent",description:Rr,createGraph:Ar,workspace:Qe},Ue=f.Root({agentExecutionContext:f({reducer:K,default:()=>({userRequest:"",assignedTask:"",messages:[],priorSteps:[],sharedState:{}})}),outputMessage:f({reducer:Q,default:()=>""}),summary:f({reducer:E,default:()=>""}),status:f({reducer:E}),vectorSearchLayerIds:f(),vectorSearchFieldResults:f(),layerFieldInfo:f(),queryResponse:f(),dataExplorationMessages:f({reducer:P,default:()=>[]})}),Lr=async(e,t)=>(await g({text:"Exiting Data Exploration agent"},t),e),Se=async(e,t)=>{let r=e.tool_calls??[];if(r.length===0){await g({text:`LLM did not request any tool calls: ${String(e?.content)}`},t);return}await Promise.all(r.map(async a=>await g({text:`LLM invoked ${a.name} tool with arguments: ${JSON.stringify(a.args,null,2)}`},t)))},zr=["mapView"];function L(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("DataExplorationAgent context missing");let r=zr.filter(a=>!(a in t));if(r.length)throw new Error(`DataExplorationAgent context missing: ${r.join(", ")}`);return t}var jr=e=>{let t=e.map?.allLayers.filter(a=>a.type==="feature"),r=0;return t?.forEach(a=>{let o=a;o.featureEffect&&(o.featureEffect=null,r++)}),r>0?`Cleared filters from ${r} layer(s). View unchanged.`:"No active filters to clear. View unchanged."},Dr=async(e,t)=>{let{mapView:r}=L(t);return jr(r)},Or=y(Dr,{name:"clearFilters",description:"Clears all feature effects/filters from the map but does NOT change the current view. Use when user says 'clear filters', 'reset filters', 'remove filters', 'show all features', or wants to remove emphasis without navigating anywhere.",schema:l.object({})}),Vr=async e=>{e.map?.allLayers.filter(r=>r.type==="feature")?.forEach(r=>{let a=r;a.featureEffect&&(a.featureEffect=null)});let t=e.map.initialViewProperties?.viewpoint?.targetGeometry;return t?(await e.goTo(t),"Cleared all filters and returned to home extent."):"Cleared all filters. Could not determine home extent."},Pr=async(e,t)=>{let{mapView:r}=L(t);return await Vr(r)},Gr=y(Pr,{name:"resetMap",description:"Clears all feature effects/filters from the map AND zooms to the home extent (initial map view). Use when user says 'reset map', 'reset the map', 'start over', or wants to both clear filters and return to the initial view.",schema:l.object({})});function te(e){return"point"in e&&e.point!==void 0}function G(e){return"layerId"in e&&e.layerId!==void 0}var oe=async(e,t)=>{if(te(e)){let{point:r}=e;return{geometry:new Ve({x:r.x,y:r.y,spatialReference:r.spatialReference?{wkid:r.spatialReference.wkid}:t.spatialReference})}}if(G(e)){let r=t.map?.allLayers.find(o=>o.id===e.layerId);if(!r)return{error:`Could not find geometry layer with ID: ${e.layerId}`};let a=r.title??r.id;try{let o=await r.queryFeatures({where:e.where,returnGeometry:!0,outSpatialReference:t.spatialReference});if(!o.features.length)return{error:`No features found in geometry layer "${a}" with the specified where clause: ${e.where}`};let n;if(o.features.length===1){let s=o.features[0].geometry;if(!s)return{error:"The geometry of the first feature is undefined or null."};n=s}else{let s=o.features.map(d=>d.geometry),i=Ge.executeMany(s);if(!i)return{error:"Failed to create a combined geometry."};n=i}return n.spatialReference||(n.spatialReference=t.spatialReference),{geometry:n}}catch(o){return{error:`Failed to query geometry: ${String(o)}`}}}return{error:"Invalid geometry configuration provided"}},Br=async(e,t,r,a,o,n)=>{let s=e.map?.allLayers.find(d=>d.id===t);if(!s)return{success:!1,error:`Layer '${t}' not found.`};let i=s.createQuery();i.where=r??"1=1",a&&(i.geometry=a,i.spatialRelationship="intersects",o&&(i.distance=o),n&&(i.units=n));try{let{extent:d,count:c}=await s.queryExtent(i);return!d||c===0?{success:!1,error:`No features found for filter (where: ${i.where}${a?", spatial filter used":""})`}:(await e.goTo(d),{success:!0})}catch(d){return{success:!1,error:d instanceof Error?d.message:String(d)}}},Kr=async(e,t,r,a,o,n)=>{let s=t.map?.allLayers.find(m=>m.id===e.layerId);if(!s)return`Could not find target layer with ID: ${e.layerId}`;let i;if(o){let m=await oe(o,t);if("error"in m)return m.error;i=m.geometry}if(s.featureEffect=null,s.featureEffect=new ft({filter:new Pe({...e.objectIds?.length?{objectIds:e.objectIds}:{where:e.where},geometry:i,spatialRelationship:"intersects",distance:o?.distance,units:o?.units}),includedEffect:r,excludedEffect:a}),s.visible=!0,n)return`Applied feature effects to "${s.title??e.layerId}" within current map extent.`;let d=e.objectIds?.length?`${s.objectIdField} IN (${e.objectIds.join(",")})`:e.where,c=await Br(t,e.layerId,d,i,o?.distance,o?.units),u=s.title??e.layerId;return c.success?`Applied feature effects to target layer "${s.title??e.layerId}"${o&&"layerId"in o?` using geometry from layer "${o.layerId}"`:""}.`:`Applied filter to "${u}" but no features matched. ${c.error}`},Qr=["feet","kilometers","meters","miles","nautical-miles","us-nautical-miles"],z=l.enum(Qr),Ur=async({targetLayer:e,geometryFilter:t,useCurrentExtent:r,includedEffect:a="drop-shadow(2px, 2px, 2px, gray)",excludedEffect:o="grayscale(100%) opacity(60%) blur(2px)"},n)=>{let{mapView:s}=L(n);return await Kr(e,s,a,o,t,r)},Wr=l.object({layerId:l.string().describe("The layerId of the layer containing the geometry by which to filter."),where:l.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:l.number().optional().describe("The buffer distance around the geometry."),units:z.optional().describe("The units for the distance buffer.")}),Hr=l.object({point:l.object({x:l.number().describe("X coordinate (longitude) from navigation result"),y:l.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:l.object({wkid:l.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:l.number().optional().describe("Optional buffer distance around the point."),units:z.optional().describe("The units for the distance buffer.")}),Zr=l.object({targetLayer:l.object({layerId:l.string().describe("The layerId of the layer on which to set a feature effect."),where:l.string().describe("The SQL-92 where clause representing the features to emphasize."),objectIds:l.array(l.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:l.union([Wr,Hr]).optional().describe("Optional geometry-based filtering parameters for spatial queries."),useCurrentExtent:l.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:l.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:l.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.")}),Jr=y(Ur,{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:Zr}),pe=e=>{if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"&&Number.isFinite(e)){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}return null},Yr=e=>!e||e==="system"?Intl.DateTimeFormat().resolvedOptions().timeZone:e==="unknown"?"UTC":e,Xr=e=>{if(typeof e=="string"&&e)return e;let t=pe(e);return t?t.toISOString().slice(0,10):null},We=()=>{let e=new Date().getTimezoneOffset(),t=e<=0?"+":"-",r=Math.floor(Math.abs(e)/60).toString().padStart(2,"0"),a=(Math.abs(e)%60).toString().padStart(2,"0"),o=`${t}${r}:${a}`;return{userTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,userTimezoneOffset:o}},ea=(e,t,r)=>{let a=t?.toLowerCase();if(a==="date-only"){let n=Xr(e);return n?yt(n,Y("short-date")):e}if(a==="time-only"){if(typeof e=="string"&&e)return wt(e,Y("long-time"));let n=pe(e);return n?Me(n,{...Y("long-time"),timeZone:"UTC"}):e}let o=pe(e);return o?Me(o,{...Y("short-date-short-time"),timeZone:Yr(r)}):e},He=(e,t,r)=>{if(e&&typeof e!="function"){let a="getField"in r&&r.getField?.(e),o=a&&"getFieldDomain"in r&&r.getFieldDomain?r.getFieldDomain(a.name):null;if(o?.type==="coded-value"){let n=o.codedValues.find(s=>s.code===t);return n?n.name:null}}return null},ta=e=>!e||e==="system"?Intl.DateTimeFormat().resolvedOptions().timeZone:e==="unknown"?"UTC":e,ra=e=>{if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"&&Number.isFinite(e)){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}if(typeof e=="string"&&e){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}return null},aa=(e,t)=>{if(typeof e!="number")return e;let r={};t.minimumFractionDigits!==void 0&&(r.minimumFractionDigits=t.minimumFractionDigits),t.maximumFractionDigits!==void 0&&(r.maximumFractionDigits=t.maximumFractionDigits),t.useGrouping==="always"?r.useGrouping=!0:t.useGrouping==="never"&&(r.useGrouping=!1);try{return new Intl.NumberFormat(void 0,r).format(e)}catch{return e}},oa=(e,t,r)=>{let a=ra(e);if(!a)return e;let o={};t.dateStyle?o.dateStyle=t.dateStyle:(t.year&&(o.year=t.year),t.month&&(o.month=t.month)),t.timeStyle&&(o.timeStyle=t.timeStyle),t.timeStyle&&t.hour12==="always"?o.hour12=!0:t.timeStyle&&t.hour12==="never"&&(o.hour12=!1),o.timeZone=ta(r);try{return new Intl.DateTimeFormat(void 0,o).format(a)}catch{return e}},Ze=(e,t)=>e.getFieldAlias?.(t)??e.fieldsIndex?.get(t)?.alias??e.fieldsIndex?.get(t)?.name??t,Je=(e,t,r,a,o)=>{if(r==null)return r;let n=e.getFieldConfiguration?.(t)?.fieldFormat;return n?.type==="number"?aa(r,n):n?.type==="date-time"?oa(r,n,o):ea(r,a,o)},na=(e,t,r,a)=>{let o=e.fieldsIndex?.get(t),n=He(t,r,e)??r;return Je(e,t,n,o?.type,a)},ia=(e,t)=>Ze(e,t),Ye=(e,t,r)=>{let a=e.objectIdField,o=t.features.map(s=>s.attributes[a]),n=t.features.map(s=>{let i=s.attributes,d={};return e.fields.forEach(c=>{if(!Object.hasOwn(i,c.name))return;let u=i[c.name];if(c.name===a){d[c.name]=u;return}let m=He(c.name,u,e)??u,h=Ze(e,c.name);d[h]=Je(e,c.name,m,c.type,r)}),d});return{objectIds:o,attributes:n}},sa=(e,t,r)=>{let a=e.createQuery();return a.outFields=[t],a.where=r||"1=1",a.num=1,a},la=async(e,t,r,a)=>{let o=a.map?.allLayers.find(u=>u.id===e),n=sa(o,t,r.where),s=(await o.queryFeatures(n)).features[0],i=s?s.attributes[t]:null,d=na(o,t,i,a.timeZone),c=ia(o,t);return{tool:"getAttribute",layerName:o.title??e,summary:`${c} = ${d}`,details:{fieldName:t,fieldAlias:c!==t?c:void 0,value:d,where:r.where}}};async function ca({layerId:e,fieldName:t,query:r},a){let{mapView:o}=L(a),n=await la(e,t,r,o);return JSON.stringify(n,null,2)}var da=l.object({layerId:l.string().describe("The layerId of the layer containing the field from which to get a value."),fieldName:l.string().describe("The name of the field/attribute from which to get a field value."),query:l.object({where:l.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value.")})}),ua=y(ca,{name:"getAttribute",description:"Returns an attribute value for a given feature.",schema:da}),xe=(e,t,r)=>r?e.hasAllFeaturesInView&&e.availableFields===t:e.hasAllFeatures&&e.availableFields===t;function re(e,t){let r=e??"";return t!=null&&t&&(r=r?`(${r}) AND (${t})`:t),r||null}var ma=async e=>{let{targetLayer:t,fieldName:r,statisticType:a,mapView:o,layersAndFieldsRegistry:n,geometryFilter:s}=e,i=o.map?.allLayers.find(v=>v.id===t.layerId);if(!i)throw new Error(`Layer '${t.layerId}' not found.`);let d=await o.whenLayerView(i),c=n.get(t.layerId)?.fieldRegistry.get(r),u=c?.alias;if(!c)throw new Error(`Field '${r}' not found.`);let m,h;if(s){let v=await oe(s,o);if("error"in v)throw new Error(v.error);if(!v.geometry)throw G(s)?new Error(`No features found matching: ${s.where}`):new Error("Failed to create geometry");if(G(s)){let T=o.map?.allLayers.find(N=>N.id===s.layerId);m={geometryLayerName:T?.title??T?.id,geometryLayerId:s.layerId,geometryWhere:s.where,distance:s.distance,units:s.units,applied:!0}}else te(s)&&(m={point:s.point,distance:s.distance,units:s.units,applied:!0});h=new Pe({geometry:v.geometry,distance:s.distance,units:s.units,spatialRelationship:"intersects"})}let S=xe(d,[r],!1),b=null,p=null,w=10;if(c.type!=="geometry"&&c.type!=="oid"&&c.type!=="global-id")try{let v={layer:i,useFeaturesInView:S,view:S?o:void 0,field:r,sqlWhere:re(i.definitionExpression,t.where),...h&&{filter:h},outStatisticTypes:{include:[a]}};b=await Be(v);let T=["string","small-integer","integer"],N=c.domain?.type==="coded-value"?c.domain:null;(T.includes(c.type)||N)&&(p=(await Ke({layer:i,useFeaturesInView:S,view:S?o:void 0,field:r,sqlWhere:re(i.definitionExpression,t.where),...h&&{filter:h}})).uniqueValueInfos.sort((M,W)=>W.count-M.count).slice(0,w)),p&&c.domain?.type==="coded-value"&&(p=p.map(M=>({...M,value:N?N.getName(M.value)??M.value:M.value})))}catch(v){console.error("Statistics error:",v)}return{tool:"getStatistics",layerName:i.title??t.layerId,summary:`${a} = ${typeof b?.[a]=="number"?b[a]:"N/A"}`,details:{fieldName:r,fieldAlias:u,statisticType:a,statistic:b?.[a]??null,summaryStatistics:b,uniqueValues:p,where:t.where,spatialFilterInfo:m}}};async function ha({targetLayer:e,fieldName:t,statisticType:r,geometryFilter:a},o){let n=x(o,"layersAndFieldsRegistry"),{mapView:s}=L(o),i=await ma({targetLayer:e,fieldName:t,statisticType:r,mapView:s,layersAndFieldsRegistry:n,geometryFilter:a});return JSON.stringify(i,null,2)}var pa=l.object({layerId:l.string().describe("The layerId of the layer containing the geometry by which to filter."),where:l.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:l.number().optional().describe("The buffer distance around the geometry."),units:z.optional().describe("The units for the distance buffer.")}),ga=l.object({point:l.object({x:l.number().describe("X coordinate (longitude) from navigation result"),y:l.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:l.object({wkid:l.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:l.number().optional().describe("Optional buffer distance around the point."),units:z.optional().describe("The units for the distance buffer.")}),fa=l.object({targetLayer:l.object({layerId:l.string().describe("The layerId of the layer containing the field from which to get a value."),where:l.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value.")}),geometryFilter:l.union([pa,ga]).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:l.string().describe("The name of the field for which to get statistics. STRICTLY DO NOT use OBJECTID. Use any other field"),statisticType:l.enum(["avg","max","median","min","stddev","sum","variance","nullcount","count"]).describe("The statistic type to calculate.")}),ya=y(ha,{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.
|
|
43
45
|
|
|
44
46
|
USE THIS TOOL FOR:
|
|
45
47
|
- "What is the average/maximum/minimum/total [field]?" \u2014 aggregate computations
|
|
@@ -60,9 +62,9 @@ USE THIS TOOL FOR:
|
|
|
60
62
|
- Spatial queries \u2014 finding features near/within/intersecting other features
|
|
61
63
|
- Any question where the user wants to SEE or COUNT matching features
|
|
62
64
|
|
|
63
|
-
This is the DEFAULT tool for most queries. When in doubt, use this tool.`,schema:_a}),Xe=[ua,ya,Ta,Na],et=[Jr,Gr,
|
|
65
|
+
This is the DEFAULT tool for most queries. When in doubt, use this tool.`,schema:_a}),Xe=[ua,ya,Ta,Na],et=[Jr,Gr,Or],Fa=async(e,t)=>{await g({text:"Requesting LLM for layer filter results"},t);let r=await R("data_explore_filter_prompt");if(!t?.configurable)throw new Error("config.configurable is required for layer filter tools");let{userTimezone:a,userTimezoneOffset:o}=We(),n={layerFieldInfo:e.layerFieldInfo,userTimezone:a,userTimezoneOffset:o,queryResponse:e.queryResponse,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},s=await D({promptText:r,modelTier:"advanced",messages:e.dataExplorationMessages,inputVariables:n,tools:et}),i=[...e.dataExplorationMessages,s];if(!((s.tool_calls?.length??0)>0))return await g({text:"LLM determined no filter changes needed"},t),{...e,dataExplorationMessages:i};let d=[...i,s],c=s.content.toString();return await Se(s,t),{...e,dataExplorationMessages:d,outputMessage:c}},Ma=async(e,t)=>{await g({text:"Requesting LLM for layer query results"},t);let r=await R("data_explore_query_prompt");if(!t?.configurable)throw new Error("config.configurable is required for layer query tools");let{userTimezone:a,userTimezoneOffset:o}=We(),n={layerFieldInfo:e.layerFieldInfo,userTimezone:a,userTimezoneOffset:o,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},s=await D({promptText:r,modelTier:"advanced",messages:e.dataExplorationMessages,inputVariables:n,tools:Xe}),i=s.content.toString();return await Se(s,t),{...e,dataExplorationMessages:[...e.dataExplorationMessages,s],outputMessage:i,status:"success",summary:i?U(i):"Query executed."}},Ca=async(e,t)=>{try{await g({text:"Requesting LLM for summary on query results"},t);let r=await R("summarize_query_response_prompt"),a={queryResponse:e.queryResponse,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},o=await $e({promptText:r,modelTier:"fast",messages:e.dataExplorationMessages,inputVariables:a}),n=typeof o=="string"?o:o.content,s=new ce(n);await g({text:`Received response from LLM: ${n}`},t);let i=n;return{...e,outputMessage:i,status:"success",summary:i?U(i):"Summary generated.",dataExplorationMessages:[...e.dataExplorationMessages,s]}}catch(r){throw await g({text:"Error during filter LLM request"},t),new Error(`Error during filter LLM request: ${r instanceof Error?r.message:String(r)}`)}};async function qa(e,t){let r=await new A(et).invoke({messages:e.dataExplorationMessages},t);return await g({text:`Finished executing layer filter tool: ${r.messages.map(a=>a.content).join(", ")}`},t),{...e}}var Aa=new A(Xe);async function Ra(e,t){let{messages:r}=await Aa.invoke({messages:e.dataExplorationMessages},t),a=[],o=[];for(let n of r){let s=n.content,i;typeof s!="string"&&(i={tool:n.name??"unknown",layerName:"unknown",summary:"Query failed",details:{error:"Skipping non-string tool output:",raw:s}});try{typeof s=="string"?i=JSON.parse(s):i={tool:n.name??"unknown",layerName:"unknown",summary:"Query failed",details:{error:"Invalid tool output type",raw:s}}}catch{i={tool:n.name??"unknown",layerName:"unknown",summary:"Query failed",details:{error:s}}}a.push(i),i.details&&typeof i.details=="object"&&"error"in i.details?o.push(`- ${i.tool}: Error - ${String(i.details.error)}`):o.push(`- ${i.layerName}: ${i.summary}`)}return await g({text:`Finished executing layer query tool: ${o.join(", ")}`},t),{...e,dataExplorationMessages:[...e.dataExplorationMessages,...r],queryResponse:a,status:"success",outputMessage:o.join(`
|
|
64
66
|
`),summary:o.length>0?U(o.join(`
|
|
65
|
-
`)):"Query executed."}}var La=10,za=["string","small-integer","integer"],ja=async(e,t,{includeSummaryStatistics:r=!0,includeUniqueValues:a=!0}={})=>{let o=null,n=null;try{if(t.type!=="geometry"&&t.type!=="oid"&&t.type!=="global-id"){r&&(o=await Be({layer:e,field:t.name}));let s=t.domain?.type==="coded-value"?t.domain:null;a&&(za.includes(t.type)||s)&&(n=(await Ke({layer:e,field:t.name})).uniqueValueInfos.sort((i,d)=>d.count-i.count).slice(0,La),s&&(n=n.map(i=>({...i,value:s.getName(i.value)??i.value}))))}}catch(s){console.error(`Error fetching statistics for field ${t.name}:`,s)}return{summaryStatistics:o,uniqueValues:n}};function
|
|
67
|
+
`)):"Query executed."}}var La=10,za=["string","small-integer","integer"],ja=async(e,t,{includeSummaryStatistics:r=!0,includeUniqueValues:a=!0}={})=>{let o=null,n=null;try{if(t.type!=="geometry"&&t.type!=="oid"&&t.type!=="global-id"){r&&(o=await Be({layer:e,field:t.name}));let s=t.domain?.type==="coded-value"?t.domain:null;a&&(za.includes(t.type)||s)&&(n=(await Ke({layer:e,field:t.name})).uniqueValueInfos.sort((i,d)=>d.count-i.count).slice(0,La),s&&(n=n.map(i=>({...i,value:s.getName(i.value)??i.value}))))}}catch(s){console.error(`Error fetching statistics for field ${t.name}:`,s)}return{summaryStatistics:o,uniqueValues:n}};function Da(e,t){return["string","small-integer","integer"].includes(e)||t==="coded-value"}async function Oa(e,t,r,a=!0){let o=[],n=[],s=[];for(let i of e){let d=function(b){let p=t.get(b)?.layerItem;return p?[p.name&&`Name: ${p.name}`,p.title&&`Title: ${p.title}`,p.description&&`Description: ${p.description}`].filter(Boolean).join(" | "):b},{layerId:c,results:u}=i,m=r.map?.allLayers.find(b=>b.id===c),h=t.get(c)?.fieldRegistry;if(!h)continue;let S=o.find(b=>b.layerId===c);S||(S={layerId:c,layerSummary:d(c),fieldInfos:[]},o.push(S));for(let b of u){let p=h.get(b.name);if(!p)continue;let w=p.statistics,v=a&&!w?.summaryStatistics,T=Da(p.type,p.domain?.type)&&!w?.uniqueValues,N=v||T;if(s.push({layerId:c,fieldName:p.name,didFetchStatistics:N}),N){let M=ja(m,p,{includeSummaryStatistics:v,includeUniqueValues:T}).then(W=>{let H={summaryStatistics:w?.summaryStatistics??null,uniqueValues:w?.uniqueValues??null};v&&(H.summaryStatistics=W.summaryStatistics),T&&(H.uniqueValues=W.uniqueValues),h.set(p.name,{...p,statistics:H}),p.statistics=H});n.push(M)}S.fieldInfos.push(p)}}return await Promise.all(n),{layerFieldInfo:o,didFetchStatistics:n.length>0,fieldStatisticsFetchStatus:s}}var ze=/\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 Va(e,t){return ze.test(e)||ze.test(t)}var Pa=async(e,t)=>{try{await g({text:"Preparing field information for vector search results"},t);let r=x(t,"layersAndFieldsRegistry"),{mapView:a}=L(t),{assignedTask:o,userRequest:n}=e.agentExecutionContext,s=Va(o,n),{layerFieldInfo:i,didFetchStatistics:d,fieldStatisticsFetchStatus:c}=await Oa(e.vectorSearchFieldResults,r,a,s);d?await g({text:"Statistics fetched"},t):await g({text:"Statistics skipped"},t);for(let u of c)await g({text:` - ${u.fieldName} - stats ${u.didFetchStatistics?"fetched":"skipped"}`},t);return await g({text:"Field information prepared"},t),{...e,layerFieldInfo:i}}catch(r){throw await g({text:"Error during fetching statistics"},t),new Error(`Error during fetching statistics: ${r instanceof Error?r.message:String(r)}`)}},je=.7,Ga=10,Ba=async(e,t)=>{try{await g({text:"Similarity search to find fields"},t);let r=x(t,"fieldSearch"),a=x(t,"layersAndFieldsRegistry"),o=x(t,"embeddingCache"),n=await r.searchFields({text:e.agentExecutionContext.assignedTask,layerIds:e.vectorSearchLayerIds,minScore:je,topResults:Ga,embeddingCache:o}),s=n.map(({layerId:d,results:c})=>{let u=c.map(m=>` - ${m.name} (${m.score.toFixed(2)})`).join(`
|
|
66
68
|
`);return`${a.get(d)?.layerItem.name??d}:
|
|
67
69
|
${u}`}).join(`
|
|
68
70
|
`),i;return n.length>0?i=`Vector search completed. Matching layers and fields with scores:
|
|
@@ -76,11 +78,11 @@ ${i}`:d="Vector search completed. No matching layers found.",await g({text:d},t)
|
|
|
76
78
|
This also includes questions that ask which feature meets a given condition or where a particular feature in the data is located (e.g., “Where is the spring with the highest elevation?”). However, this agent does not handle addresses.
|
|
77
79
|
_Example: “How many features are there?”_
|
|
78
80
|
_Example: “What’s the average population?”_
|
|
79
|
-
_Example: “Which values are in the status field?”_`,Hs={id:"dataExploration",name:"Data Exploration Agent",description:Ha,createGraph:Wa,workspace:Ue},
|
|
81
|
+
_Example: “Which values are in the status field?”_`,Hs={id:"dataExploration",name:"Data Exploration Agent",description:Ha,createGraph:Wa,workspace:Ue},De=.7,Za=10,Ja=async(e,t)=>{try{await g({text:"Similarity search to find fields"},t);let r=x(t,"fieldSearch"),a=x(t,"layersAndFieldsRegistry"),o=x(t,"embeddingCache"),n=await r.searchFields({text:e.agentExecutionContext.assignedTask,layerIds:e.vectorSearchLayerIds,minScore:De,topResults:Za,embeddingCache:o}),s=n.map(({layerId:d,results:c})=>{let u=c.map(m=>` - ${m.name} (${m.score.toFixed(2)})`).join(`
|
|
80
82
|
`);return`${a.get(d)?.layerItem.name??d}:
|
|
81
83
|
${u}`}).join(`
|
|
82
84
|
`),i;return n.length>0?i=`Vector search completed. Matching layers and fields with scores:
|
|
83
|
-
${s}`:i=`No vector search results found for score over ${
|
|
85
|
+
${s}`:i=`No vector search results found for score over ${De}.`,await g({text:i},t),{...e,vectorSearchFieldResults:n}}catch(r){throw await g({text:`Error during vector search: ${r instanceof Error?r.message:String(r)}`},t),new Error(`Vector search failed: ${r instanceof Error?r.message:String(r)}`)}},Ya=.7,Xa=async(e,t)=>{try{await g({text:`Similarity search to find layers: ${e.agentExecutionContext.assignedTask}`},t);let r=x(t,"layerSearch"),a=x(t,"layersAndFieldsRegistry"),o=await r.searchLayers({text:e.agentExecutionContext.assignedTask,minScore:Ya}),n=o.map(d=>d.id),s=o.map(({id:d,score:c})=>`${a.get(d)?.layerItem.name??d} (${c.toFixed(2)})`).join(`
|
|
84
86
|
`),i;return n.length>0?i=`Vector search completed. Matching layers with scores:
|
|
85
87
|
${s}`:i="Vector search completed. No matching layers found.",await g({text:i},t),{...e,vectorSearchLayerIds:n}}catch(r){throw await g({text:`Error during vector search: ${r instanceof Error?r.message:String(r)}`},t),new Error(`Vector search failed: ${r instanceof Error?r.message:String(r)}`)}};async function eo(e){let{fields:t,layer:r,view:a,styleName:o,colorSchemeTags:n}=e,s;return n?s=xt({basemapTheme:await Ce(a),geometryType:r.geometryType,includedTags:n,numColors:Math.min(t.length,8)})[0]:s=Tt({basemapTheme:await Ce(a),geometryType:r.geometryType,numColors:Math.min(t.length,8)}).primaryScheme,{layer:r,view:a,attributes:t.map(i=>({field:i,label:r.fields.find(d=>d.name===i)?.alias??""})).slice(0,8),outlineOptimizationEnabled:!0,sizeOptimizationEnabled:!0,includeSizeVariable:o.includes("Size"),pieChartScheme:s}}async function to(e){return await St(e)}async function ro({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o,includeSize:n}){let s=t,i=e?.allLayers.find(c=>c.id===r);if(!i)return`Could not find layer for id: ${r}`;let d={styleName:n?"chart-size":"chart",fields:a,layer:i,view:s,colorSchemeTags:o};try{let c=await eo(d),u=await to(c);return i.renderer=u.renderer,i.visible=!0,`Chart renderer applied to layer: ${i.title??i.id} using fields ${a.join(", ")}`}catch(c){return`Error applying chart renderer: ${c instanceof Error?c.message:String(c)}`}}var ao=["mapView"];function _(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("LayerStylingAgent context missing");let r=ao.filter(a=>!(a in t));if(r.length)throw new Error(`LayerStylingAgent context missing: ${r.join(", ")}`);return t}async function oo({layerId:e,fields:t,colorSchemes:r,includeSize:a},o){let{mapView:n}=_(o);return await k({type:"show-legend",data:{layerIds:[e]}},o),await ro({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,includeSize:a})}var no=l.object({layerId:l.string().describe("The id of the layer to apply the chart renderer to"),fields:l.array(l.string()).describe("The fields to use for the chart renderer (multiple numeric fields)"),colorSchemes:l.array(l.string()).optional().describe("Optional color scheme tags to use"),includeSize:l.boolean().optional().describe("Whether to vary the chart size (chart-size)")}),io=y(oo,{name:"chart",description:`Label: Charts
|
|
86
88
|
Description: Show the values of two or more categories as a proportion of the total using a pie chart.
|
|
@@ -119,7 +121,7 @@ ${s}`:i="Vector search completed. No matching layers found.",await g({text:i},t)
|
|
|
119
121
|
Description: Show areas of high density with colors that appear to glow hotter. This is only valid for point layers.
|
|
120
122
|
Keywords: density, heatmap, hot spots, pattern, cluster
|
|
121
123
|
Example: Create a heatmap
|
|
122
|
-
Fields: This typically requires zero or one field of type number.`,schema:Lo});function jo(e){let{fields:t,layer:r,view:a,styleName:o,colorSchemeTags:n}=e,s;return n&&(s=Ct({geometryType:r.geometryType,includedTags:n,numColors:Math.min(t.length,10)})[0]),{layer:r,view:a,fields:t.map(i=>({name:i})).slice(0,9),outlineOptimizationEnabled:!0,sizeOptimizationEnabled:!0,includeSizeVariable:o.includes("Size"),predominanceScheme:s}}async function
|
|
124
|
+
Fields: This typically requires zero or one field of type number.`,schema:Lo});function jo(e){let{fields:t,layer:r,view:a,styleName:o,colorSchemeTags:n}=e,s;return n&&(s=Ct({geometryType:r.geometryType,includedTags:n,numColors:Math.min(t.length,10)})[0]),{layer:r,view:a,fields:t.map(i=>({name:i})).slice(0,9),outlineOptimizationEnabled:!0,sizeOptimizationEnabled:!0,includeSizeVariable:o.includes("Size"),predominanceScheme:s}}async function Do(e){return await Mt(e)}async function Oo({arcgisMap:e,arcgisMapView:t,layerId:r,fields:a,colorSchemes:o,includeSize:n}){let s=t,i=e?.allLayers.find(c=>c.id===r);if(!i)return`Could not find layer for id: ${r}`;let d={styleName:n?"predominance-size":"predominance",fields:a,layer:i,view:s,colorSchemeTags:o};try{let c=jo(d),u=await Do(c);return i.renderer=u.renderer,i.visible=!0,`Predominance renderer applied to layer: ${i.title??i.id} using fields ${a.join(", ")}`}catch(c){return`Error applying predominance renderer: ${c instanceof Error?c.message:String(c)}`}}async function Vo({layerId:e,fields:t,colorSchemes:r,includeSize:a},o){let{mapView:n}=_(o);return await k({type:"show-legend",data:{layerIds:[e]}},o),await Oo({arcgisMap:n.map,arcgisMapView:n,layerId:e,fields:t,colorSchemes:r,includeSize:a})}var Po=l.object({layerId:l.string().describe("The id of the layer to apply the predominance renderer to"),fields:l.array(l.string()).describe("The fields to use for the predominance renderer (competing categories)"),colorSchemes:l.array(l.string()).optional().describe("Optional color scheme tags to use"),includeSize:l.boolean().optional().describe("Whether to include size visualization (predominance-size)")}),Go=y(Vo,{name:"predominance",description:`Label: Predominant category
|
|
123
125
|
Description: Compare attributes that share a common subject and unit of measurement to see which has the highest value.
|
|
124
126
|
Keywords: predominant, winner, won, competing, most, most common, most frequent, dominant, prevalent, top
|
|
125
127
|
Example: Using fields for Corn Acres, Wheat Acres, and Cotton Acres, show the predominant crop harvested in each area.
|
|
@@ -151,13 +153,13 @@ Fields: This typically requires zero or one field of type number.`,schema:Lo});f
|
|
|
151
153
|
Description: Represent features as categories with different symbol colors or shapes. Examples include type of tree, road class, or province name.
|
|
152
154
|
Keywords: categorical, category, type, unique, discrete, point of interest, region, group
|
|
153
155
|
Example: Color each feature based on the region it belongs to
|
|
154
|
-
Fields: This style requires a single field which may be a string, number, or date type. It is usually a string.`,schema:hn}),tt=[io,ho,bo,Io,Mo,zo,Go,Ho,tn,ln,pn],rt=(e,t=3)=>{let r=e.map((o,n)=>o.type==="human"?n:-1).filter(o=>o!==-1);if(r.length===0)return[];let a=r.length>t?r[r.length-t]:r[0];return e.slice(a)},gn=async(e,t)=>{await g({text:"Requesting LLM for layer query results"},t);let r=await R("navigation_intent_prompt");if(!t?.configurable)throw new Error("config.configurable is required for layer query tools");let a={layerFieldInfo:e.layerFieldInfo},o=await
|
|
156
|
+
Fields: This style requires a single field which may be a string, number, or date type. It is usually a string.`,schema:hn}),tt=[io,ho,bo,Io,Mo,zo,Go,Ho,tn,ln,pn],rt=(e,t=3)=>{let r=e.map((o,n)=>o.type==="human"?n:-1).filter(o=>o!==-1);if(r.length===0)return[];let a=r.length>t?r[r.length-t]:r[0];return e.slice(a)},gn=async(e,t)=>{await g({text:"Requesting LLM for layer query results"},t);let r=await R("navigation_intent_prompt");if(!t?.configurable)throw new Error("config.configurable is required for layer query tools");let a={layerFieldInfo:e.layerFieldInfo},o=await D({promptText:r,modelTier:"advanced",messages:rt(e.agentExecutionContext.messages),inputVariables:a,tools:tt});return await Se(o,t),{...e,agentExecutionContext:{...e.agentExecutionContext,messages:[...e.agentExecutionContext.messages,o]}}};async function fn(e,t){let r=await new A(tt).invoke({messages:rt(e.agentExecutionContext.messages)},t),a=r.messages.map(n=>n.text).join(`
|
|
155
157
|
`);await g({text:`Finished executing layer filter tool: ${a}`},t);let o=r.messages.map(n=>n.text).join(`
|
|
156
|
-
`);return{...e,outputMessage:o}}var at=f.Root({agentExecutionContext:f({reducer:K,default:()=>({userRequest:"",assignedTask:"",messages:[],priorSteps:[],sharedState:{}})}),outputMessage:f({reducer:Q,default:()=>""}),vectorSearchLayerIds:f(),vectorSearchFieldResults:f(),layerFieldInfo:f(),selectedLayerId:f()}),yn=async(e,t)=>(await g({text:"Exiting Layer Styling agent"},t),e),wn=async(e,t)=>{try{await g({text:"Populating layer and field info"},t);let r=[];for(let a of e.vectorSearchFieldResults){let o=function(u){let m=i.get(u)?.layerItem;return m?[m.name&&`Name: ${m.name}`,m.title&&`Title: ${m.title}`,m.description&&`Description: ${m.description}`].filter(Boolean).join(" | "):u},{layerId:n,results:s}=a,i=x(t,"layersAndFieldsRegistry"),d=i.get(n)?.fieldRegistry;if(!d)continue;let c=r.find(u=>u.layerId===n);c||(c={layerId:n,layerSummary:o(n),fieldInfos:[]},r.push(c));for(let u of s){let m=d.get(u.name);m&&c.fieldInfos.push(m)}}return await g({text:"Populated layerFieldInfo"},t),{...e,layerFieldInfo:r}}catch(r){throw await g({text:"Error populating layerFieldInfo"},t),new Error(`Error populating layerFieldInfo: ${r instanceof Error?r.message:String(r)}`)}},bn=(e,t)=>{let r=e.vectorSearchLayerIds??[];if(r.length<=1)return{...e,selectedLayerId:e.vectorSearchLayerIds[0]};let{hitlResponse:a}=t.configurable;if(!a||a.agentId!==
|
|
158
|
+
`);return{...e,outputMessage:o}}var at=f.Root({agentExecutionContext:f({reducer:K,default:()=>({userRequest:"",assignedTask:"",messages:[],priorSteps:[],sharedState:{}})}),outputMessage:f({reducer:Q,default:()=>""}),vectorSearchLayerIds:f(),vectorSearchFieldResults:f(),layerFieldInfo:f(),selectedLayerId:f()}),yn=async(e,t)=>(await g({text:"Exiting Layer Styling agent"},t),e),wn=async(e,t)=>{try{await g({text:"Populating layer and field info"},t);let r=[];for(let a of e.vectorSearchFieldResults){let o=function(u){let m=i.get(u)?.layerItem;return m?[m.name&&`Name: ${m.name}`,m.title&&`Title: ${m.title}`,m.description&&`Description: ${m.description}`].filter(Boolean).join(" | "):u},{layerId:n,results:s}=a,i=x(t,"layersAndFieldsRegistry"),d=i.get(n)?.fieldRegistry;if(!d)continue;let c=r.find(u=>u.layerId===n);c||(c={layerId:n,layerSummary:o(n),fieldInfos:[]},r.push(c));for(let u of s){let m=d.get(u.name);m&&c.fieldInfos.push(m)}}return await g({text:"Populated layerFieldInfo"},t),{...e,layerFieldInfo:r}}catch(r){throw await g({text:"Error populating layerFieldInfo"},t),new Error(`Error populating layerFieldInfo: ${r instanceof Error?r.message:String(r)}`)}},bn=(e,t)=>{let r=e.vectorSearchLayerIds??[];if(r.length<=1)return{...e,selectedLayerId:e.vectorSearchLayerIds[0]};let{hitlResponse:a}=t.configurable;if(!a||a.agentId!==Oe.id||a.id!=="reviewLayerSelection"){let n={agentId:Oe.id,id:"reviewLayerSelection",kind:"singleSelection",message:"Choose a layer to apply the styles.",metadata:[...r]};throw new Ee(n)}let o=null;return Array.isArray(a.payload)&&a.payload.length>0&&(o=a.payload[0]),{...e,selectedLayerId:o??e.vectorSearchLayerIds[0]}},vn=(e,t)=>ae(["layerSearch","fieldSearch","layersAndFieldsRegistry"],"Layer Styling Agent")(e,t),Sn=()=>new q(at).addNode("requireLayerStylingServices",vn).addNode("vectorSearchLayers",Xa).addNode("layerSelectionHITL",bn).addNode("vectorSearchFields",Ja).addNode("populateLayerFieldInfo",wn).addNode("agent",gn).addNode("tools",fn).addNode("earlyExit",yn).addEdge(C,"requireLayerStylingServices").addEdge("requireLayerStylingServices","vectorSearchLayers").addConditionalEdges("layerSelectionHITL",e=>e.vectorSearchLayerIds.length?"vectorSearchFields":"earlyExit").addConditionalEdges("vectorSearchFields",e=>e.vectorSearchFieldResults.length?"populateLayerFieldInfo":"earlyExit").addEdge("populateLayerFieldInfo","agent").addEdge("agent","tools").addEdge("tools",I).addEdge("earlyExit",I),xn=String.raw`- **layerStyling** — User wants to change how features are drawn or styled on the map based on their data, such as applying color, size, transparency, symbols, or charts according to field values.
|
|
157
159
|
_Example: “Color points by sales amount”_
|
|
158
160
|
_Example: “Show population density with a color gradient”_
|
|
159
161
|
_Example: “Create a relationship map between height and depth”_
|
|
160
|
-
_Example: “Vary circle sizes according to population”_`,
|
|
162
|
+
_Example: “Vary circle sizes according to population”_`,Oe={id:"layerStyling",name:"Layer Styling Agent",description:xn,createGraph:Sn,workspace:at},ot=f.Root({agentExecutionContext:f({reducer:K,default:()=>({userRequest:"",assignedTask:"",messages:[],priorSteps:[],sharedState:{}})}),outputMessage:f({reducer:Q,default:()=>""}),summary:f({reducer:E,default:()=>""}),status:f({reducer:E}),helpInternalState:f({reducer:E,default:()=>({toolCallMessage:void 0})})}),Tn=(e,t)=>{let r=Array.from(e.values()).find(({layerItem:n})=>n.title?.toLowerCase().includes(t.toLowerCase()));if(!r){let n=Array.from(e.values()).map(s=>s.layerItem.title).join(", ");return`Could not find a layer matching "${t}". Available layers: ${n}`}let a=Array.from(r.fieldRegistry.values()),o=a.map(n=>`- **${n.alias||n.name}** (\`${n.name}\`, ${n.type})${n.description?`: ${n.description}`:""}`).join(`
|
|
161
163
|
`);return`**${r.layerItem.title}** has ${a.length} field(s):
|
|
162
164
|
|
|
163
165
|
${o}`},En=async({layerTitle:e},t)=>{let r=x(t,"layersAndFieldsRegistry");return Tn(r,e)},In=y(En,{name:"listLayerFields",description:"Lists all fields for a given layer by title. Use ONLY when the user explicitly asks to see fields, columns, or attributes of a specific named layer. Do NOT call this tool for general help questions, capability overviews, or layer listing.",schema:l.object({layerTitle:l.string().describe("The title or partial title of the layer to list fields for.")})}),nt=[In],kn=e=>{if(!e||e.size===0)return"No layers available in this map.";let t=Array.from(e.values()).map(({layerItem:r,fieldRegistry:a},o)=>{let n=Array.from(a.values()).map(i=>i.name).slice(0,10).join(", "),s=a.size>10?` (and ${a.size-10} more)`:"";return`${o+1}. "${r.title}". Description: ${r.description}
|
|
@@ -166,7 +168,7 @@ ${o}`},En=async({layerTitle:e},t)=>{let r=x(t,"layersAndFieldsRegistry");return
|
|
|
166
168
|
`);return`This map contains ${e.size} layer(s):
|
|
167
169
|
|
|
168
170
|
${t}`},$n=e=>{let t=e?.list()??[];return t.length?t.map(r=>`- ${r.agent.name}: ${r.agent.description}`).join(`
|
|
169
|
-
`):"No agents currently available."};async function _n(e,t){let r=await R("help_prompt"),a=x(t,"layersAndFieldsRegistry"),o=x(t,"agentRegistry");try{let n=await
|
|
171
|
+
`):"No agents currently available."};async function _n(e,t){let r=await R("help_prompt"),a=x(t,"layersAndFieldsRegistry"),o=x(t,"agentRegistry");try{let n=await D({promptText:r,modelTier:"fast",tools:nt,inputVariables:{layerSummary:kn(a),agents:$n(o),assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps}}),s=(n.tool_calls?.length??0)>0,i=typeof n.text=="string"?n.text.trim():"";return{...e,helpInternalState:{...e.helpInternalState,toolCallMessage:s?n:void 0},outputMessage:s?e.outputMessage:i,summary:s?"Prepared help tool call from assigned task.":"Provided map-related help based on the assigned task.",status:s?e.status:"success"}}catch(n){let s=n instanceof Error?n.message:String(n);return{...e,outputMessage:`Error invoking help agent: ${s}`,summary:"Help agent execution failed.",status:"failed"}}}var Nn=(e,t)=>ae(["agentRegistry"],"Help Agent")(e,t);async function Fn(e,t){let r=new A(nt);try{let a=e.helpInternalState.toolCallMessage;if(!a)throw new Error("helpToolCalling: missing helpInternalState.toolCallMessage");let o=(await r.invoke({messages:[a]},t)).messages.map(n=>n.text).join(`
|
|
170
172
|
`);return await g({text:`Finished executing help tool: ${o}`},t),{...e,outputMessage:o,status:"success",summary:o?U(o):"Help executed.",helpInternalState:{...e.helpInternalState,toolCallMessage:void 0}}}catch(a){let o=a instanceof Error?a.message:String(a);return await g({text:`Help tool execution failed: ${o}`},t),{...e,outputMessage:`Help tool execution failed: ${o}`,status:"failed",summary:`Help tool execution failed: ${o}`,helpInternalState:{...e.helpInternalState,toolCallMessage:void 0}}}}var Mn=()=>new q(ot).addNode("requireHelpServices",Nn).addNode("agent",_n).addNode("tools",Fn).addEdge(C,"requireHelpServices").addEdge("requireHelpServices","agent").addConditionalEdges("agent",e=>e.helpInternalState.toolCallMessage?"tools":I).addEdge("tools",I),Cn=String.raw`- **help** — Enables users to ask questions about the map, layers, fields, and it's capabilities.
|
|
171
173
|
|
|
172
174
|
_Example: “Tell me about this map”_
|
|
@@ -180,10 +182,10 @@ ${t}`},$n=e=>{let t=e?.list()??[];return t.length?t.map(r=>`- ${r.agent.name}: $
|
|
|
180
182
|
|
|
181
183
|
IF the user asks map related queries, but those that are not performed by any of the agents, call this agent so we can respond accordingly.
|
|
182
184
|
_Example: "Create a chart"_
|
|
183
|
-
_Example: "Create a table"_`,Zs={id:"help",name:"Help Agent",description:Cn,createGraph:Mn,workspace:ot},Js=f.Root({agentExecutionContext:f({reducer:K,default:()=>({userRequest:"",assignedTask:"",messages:[],priorSteps:[],sharedState:{}})}),outputMessage:f({reducer:Q,default:()=>""}),summary:f({reducer:E,default:()=>""}),status:f({reducer:E,default:()=>"success"}),intent:f({reducer:(e,t)=>t}),arcgisKnowledgeMessages:f({reducer:P,default:()=>[]})}),X={conversationId:""},qn=["linkChartView"],he=["knowledgeGraph","linkChartView"];function ne(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("ArcgisKnowledgeAgent context missing");let r=qn.filter(a=>!(a in t));if(r.length)throw new Error(`Link Chart context missing: ${r.join(", ")}`);return t}async function ie(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("ArcgisKnowledgeAgent context missing");let r=he.find(a=>a in t);if(!r||he.every(a=>a in t))throw new Error(`Knowledge Graph context should be exactly one of ${he.join(", ")}`);if(r==="knowledgeGraph")return t;{let a=t.linkChartView.map.knowledgeGraph.url;if(!a)throw new Error("Knowledge graph url missing from link chart.");return{knowledgeGraph:await
|
|
185
|
+
_Example: "Create a table"_`,Zs={id:"help",name:"Help Agent",description:Cn,createGraph:Mn,workspace:ot},Js=f.Root({agentExecutionContext:f({reducer:K,default:()=>({userRequest:"",assignedTask:"",messages:[],priorSteps:[],sharedState:{}})}),outputMessage:f({reducer:Q,default:()=>""}),summary:f({reducer:E,default:()=>""}),status:f({reducer:E,default:()=>"success"}),intent:f({reducer:(e,t)=>t}),arcgisKnowledgeMessages:f({reducer:P,default:()=>[]})}),X={conversationId:""},qn=["linkChartView"],he=["knowledgeGraph","linkChartView"];function ne(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("ArcgisKnowledgeAgent context missing");let r=qn.filter(a=>!(a in t));if(r.length)throw new Error(`Link Chart context missing: ${r.join(", ")}`);return t}async function ie(e){let t=e?.configurable?.context;if(!t||typeof t!="object")throw new Error("ArcgisKnowledgeAgent context missing");let r=he.find(a=>a in t);if(!r||he.every(a=>a in t))throw new Error(`Knowledge Graph context should be exactly one of ${he.join(", ")}`);if(r==="knowledgeGraph")return t;{let a=t.linkChartView.map.knowledgeGraph.url;if(!a)throw new Error("Knowledge graph url missing from link chart.");return{knowledgeGraph:await Dt(a)}}}var ge=class{constructor(t){this.dataModel=t,this.kind="GraphQueryGenerationRequest",this.explainQuery=!0,this.schemaInformation=fe.fromDataModel(t)}},fe=class e{constructor(){this.schemaType="ArcgisGraphSchema",this.entityTypes=[],this.relationshipTypes=[],this.identifierInfo={mappingInfo:{identifierMapsTo:"UniformPropertyIdentifier",identifierPropertyName:"globalid"}}}static fromDataModel(t){let r=new e;for(let a of t.entityTypes)r.entityTypes.push(B.fromEntityType(a));for(let a of t.relationshipTypes)r.relationshipTypes.push(ye.fromRelationshipType(a));return r.identifierInfo={mappingInfo:{identifierMapsTo:An(t.identifierInfo.identifierMappingInfo.identifierInfoType),identifierPropertyName:t.identifierInfo.identifierMappingInfo.uniformPropertyIdentifier.identifierPropertyName}},r.spatialReference=JSON.parse(JSON.stringify(t.spatialReference)),r}},B=class e{constructor(){this.name="",this.properties=[]}static fromEntityType(t){let r=new e;r.name=t.name,r.alias=t.alias?t.alias:void 0,r.role=Rn(t.role);for(let a of t.properties){let o={name:a.name,alias:a.alias?a.alias:void 0,fieldType:a.fieldType,role:Ln(a.role),geometryDef:a.fieldType==="esriFieldTypeGeometry"?{geometryType:a.geometryType??"esriGeometryAny",hasM:a.hasM?a.hasM:void 0,hasZ:a.hasZ?a.hasZ:void 0}:void 0};r.properties.push(o)}return r}},ye=class extends B{constructor(){super(...arguments),this.observedEndPoints=[]}static fromRelationshipType(t){let r=B.fromEntityType(t);r.observedEndPoints=[];for(let a of t.endPoints)r.observedEndPoints.push({originEntityType:a.originEntityType,destinationEntityType:a.destinationEntityType});return r}},An=e=>{switch(e){case"esriIdentifierInfoTypeUNSPECIFIED":return"UNSPECIFIED";case"esriIdentifierInfoTypeDatabaseNative":return"DatabaseNative";case"esriIdentifierInfoTypeUniformProperty":return"UniformPropertyIdentifier";default:return e}},Rn=e=>{switch(e){case"Regular":return"esriGraphNamedObjectRegular";case"Provenance":return"esriGraphNamedObjectProvenance";case"Document":return"esriGraphNamedObjectDocument";default:return e}};function Ln(e){switch(e){case"esriGraphPropertyRegular":return"Regular";case"esriGraphPropertyDocumentName":return"Document_Name";case"esriGraphPropertyDocumentTitle":return"Document_Title";case"esriGraphPropertyDocumentUrl":return"Document_Url";case"esriGraphPropertyDocumentText":return"Document_Text";case"esriGraphPropertyDocumentKeywords":return"Document_Keywords";case"esriGraphPropertyDocumentContentType":return"Document_ContentType";case"esriGraphPropertyDocumentMetadata":return"Document_Metadata";case"esriGraphPropertyDocumentFileExtension":return"Document_FileExtension";case"esriGraphPropertyProvenanceInstanceId":return"Provenance_InstanceId";case"esriGraphPropertyProvenanceSourceType":return"Provenance_SourceType";case"esriGraphPropertyProvenanceSourceName":return"Provenance_SourceName";case"esriGraphPropertyProvenanceSource":return"Provenance_Source";case"esriGraphPropertyProvenanceComment":return"Provenance_Comment";case"esriGraphPropertyProvenanceTypeName":return"Provenance_TypeName";case"esriGraphPropertyProvenancePropertyName":return"Provenance_PropertyName";default:return"Regular"}}async function zn(e,t,r,a){let{graphQuery:o,explanation:n}=await se(e,t,r,a);return`Generated Graph Query:
|
|
184
186
|
${o}
|
|
185
187
|
|
|
186
|
-
Explanation: ${n}`}async function se(e,t,r,a){let o={message:e,context:new ge(t)};X.conversationId&&(o.conversationId=X.conversationId),await g({text:"Attempting to generate a cypher query from your prompt..."},a);let n=await qe(`${r}/chat`,{method:"post",body:JSON.stringify(o),headers:{"Content-Type":"application/json",token:Ae.findCredential(j.getDefault().url)?.token??""}});if(n.httpStatus!==200)throw new Error(`Graph query service returned an error: ${n.httpStatus}`,{cause:n.data});X.conversationId||(X.conversationId=n.data.conversationId);let s=!1,i=Date.now(),d=n.data.sequenceNumber,c="",u="",m=1;for(;!s;){await new Promise(S=>setTimeout(S,1e3)),await g({text:`Periodically requesting status of job from ArcGIS AI Services${"...".substring(0,m)}`},a),m=m%3+1;let h=await qe(`${r}/chat`,{method:"post",body:JSON.stringify({conversationId:n.data.conversationId,inquiryId:n.data.inquiryId,ackSequenceNumber:d}),headers:{"Content-Type":"application/json",token:Ae.findCredential(j.getDefault().url)?.token??""}});if(h.httpStatus!==200)throw new Error(`Graph query service polling returned an error: ${h.httpStatus}`,{cause:h.data});if(h.data.context)c=h.data.context.graphQuery,u=h.data.message||"";else if(!h.data.hasMore)s=!0;else if(Date.now()-i>6e4)throw new Error("Graph query service polling timed out after 1 minute.");d=h.data.sequenceNumber}return{graphQuery:c,explanation:u}}function jn(e){return typeof e!="object"||e===null?String(e):"details"in e&&typeof e.details=="object"&&e.details!==null&&"errorMessage"in e.details&&typeof e.details.errorMessage=="string"?e.details.errorMessage:"message"in e&&typeof e.message=="string"?e.message:String(e)}var it=async({kg:e,queryParams:t,targetStructure:r,targetStructureReducer:a,requestOptions:o,queryRowLimit:n,queryTimeoutMs:s})=>{let i=null,d=r,c=new AbortController,u=o?.signal,m=()=>{c.abort(u?.reason)};u&&(u.aborted?c.abort(u.reason):u.addEventListener("abort",m,{once:!0}));try{let h=await
|
|
188
|
+
Explanation: ${n}`}async function se(e,t,r,a){let o={message:e,context:new ge(t)};X.conversationId&&(o.conversationId=X.conversationId),await g({text:"Attempting to generate a cypher query from your prompt..."},a);let n=await qe(`${r}/chat`,{method:"post",body:JSON.stringify(o),headers:{"Content-Type":"application/json",token:Ae.findCredential(j.getDefault().url)?.token??""}});if(n.httpStatus!==200)throw new Error(`Graph query service returned an error: ${n.httpStatus}`,{cause:n.data});X.conversationId||(X.conversationId=n.data.conversationId);let s=!1,i=Date.now(),d=n.data.sequenceNumber,c="",u="",m=1;for(;!s;){await new Promise(S=>setTimeout(S,1e3)),await g({text:`Periodically requesting status of job from ArcGIS AI Services${"...".substring(0,m)}`},a),m=m%3+1;let h=await qe(`${r}/chat`,{method:"post",body:JSON.stringify({conversationId:n.data.conversationId,inquiryId:n.data.inquiryId,ackSequenceNumber:d}),headers:{"Content-Type":"application/json",token:Ae.findCredential(j.getDefault().url)?.token??""}});if(h.httpStatus!==200)throw new Error(`Graph query service polling returned an error: ${h.httpStatus}`,{cause:h.data});if(h.data.context)c=h.data.context.graphQuery,u=h.data.message||"";else if(!h.data.hasMore)s=!0;else if(Date.now()-i>6e4)throw new Error("Graph query service polling timed out after 1 minute.");d=h.data.sequenceNumber}return{graphQuery:c,explanation:u}}function jn(e){return typeof e!="object"||e===null?String(e):"details"in e&&typeof e.details=="object"&&e.details!==null&&"errorMessage"in e.details&&typeof e.details.errorMessage=="string"?e.details.errorMessage:"message"in e&&typeof e.message=="string"?e.message:String(e)}var it=async({kg:e,queryParams:t,targetStructure:r,targetStructureReducer:a,requestOptions:o,queryRowLimit:n,queryTimeoutMs:s})=>{let i=null,d=r,c=new AbortController,u=o?.signal,m=()=>{c.abort(u?.reason)};u&&(u.aborted?c.abort(u.reason):u.addEventListener("abort",m,{once:!0}));try{let h=await Ot(e,t,o);i=h.resultHeader;let S=h.resultRowsStream.getReader(),b=0,p=Date.now(),w=!1;for(;;){let{done:v,value:T}=await S.read();if(v)break;if(!w&&s&&Date.now()-p>s)return c.abort(),{type:"timeout"};for(let N of T){if(b++,n&&b>n)return c.abort(),{type:"success",rowLimitReached:!0,resultHeader:i,processedResult:d};d=a(d,N)}}}catch(h){return c.signal.aborted?{type:"aborted"}:{type:"error",errorMessage:jn(h),error:h}}finally{u?.removeEventListener("abort",m)}return{type:"success",rowLimitReached:!1,resultHeader:i,processedResult:d}};function ee(e,t){if(!(!e||typeof e!="object")){if(On(e))for(let r of e.path)ee(r,t);else if(Dn(e))t.set(`${e.typeName}__${e.id}`,{id:e.id,typeName:e.typeName});else if(Array.isArray(e))for(let r of e)ee(r,t);else if(Vn(e))for(let r of Object.values(e.properties??{}))ee(r,t)}}function Dn(e){return!e||typeof e!="object"||Array.isArray(e)?!1:"id"in e&&"typeName"in e}function On(e){return!e||typeof e!="object"||Array.isArray(e)?!1:e&&"path"in e&&Array.isArray(e.path)}function Vn(e){return!e||typeof e!="object"||Array.isArray(e)||"id"in e?!1:"properties"in e&&typeof e.properties=="object"}function Pn(e,t){let r=[];for(let a of[...t.dataModel.entityTypes,...t.dataModel.relationshipTypes]){let o=e.getMemberIdsByType(a.name);for(let n of o)r.push({id:n,typeName:a.name})}return r}async function Gn(e,t,r,a,o){let{graphQuery:n,explanation:s}=await se(e,t.dataModel,r,o);await g({text:`Attempting to execute query: ${n.substring(0,500)}${n.length>500?"...":""}`},o);let i=await it({kg:t,queryParams:new be({openCypherQuery:n}),targetStructure:new Map,targetStructureReducer:(d,c)=>{for(let u of c)ee(u,d);return d},requestOptions:{signal:o?.signal,timeout:o?.timeout}});if(i.type==="success"){let d=i.processedResult,c=Array.from(d.values());return await g({text:`Query Results parsed into ${c.length} unique relationships and entities. Atempting to add to link chart...`},o),await a.map.addRecords(c),a.goTo(a.map.diagramNodesExtent),`Link Chart updated successfully. Cypher Query used:
|
|
187
189
|
${n}
|
|
188
190
|
|
|
189
191
|
Explanation: ${s}`}else throw new Error(`Failed to execute query. Reason: ${i.type==="aborted"?"Query was aborted.":i.type==="timeout"?"Query timed out.":`Error message: ${i.errorMessage}`}`)}async function Bn({prompt:e},t){let{knowledgeGraph:r}=await ie(t),{linkChartView:a}=ne(t),o=j.getDefault().helperServices,n=await R("arcgis_knowledge_current_lc_context"),s=Pn(a.map,r),i=`${e}
|
|
@@ -241,4 +243,4 @@ _example: "Expand the link chart from 'Entity D' to show its direct connections"
|
|
|
241
243
|
_example: "Find all the cars and then add everything up to two hops away from them on the link chart"_
|
|
242
244
|
_example: "Connect Emma and Rob on the link chart if there is a relationship between them"
|
|
243
245
|
_example: "Discover and add all the relationships originating at 'Entity E' to the link chart"_
|
|
244
|
-
_example: "What is the average age of all people who work for Esri?"`;return{a:Ws,b:Hs,c:
|
|
246
|
+
_example: "What is the average age of all people who work for Esri?"`;return{a:Ws,b:Hs,c:Oe,d:Zs}},"Graphic","symbols/PictureMarkerSymbol","rest/locator","portal/Portal","config","geometry/Extent","geometry/Point","layers/support/FeatureEffect","layers/support/FeatureFilter","geometry/operators/unionOperator","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/support/TopFeaturesQuery","rest/support/TopFilter","smartMapping/renderers/pieChart","smartMapping/symbology/pieChart","views/support/colorUtils","smartMapping/renderers/color","smartMapping/symbology/color","smartMapping/renderers/univariateColorSize","smartMapping/renderers/dotDensity","smartMapping/symbology/dotDensity","smartMapping/renderers/heatmap","smartMapping/symbology/heatmap","smartMapping/renderers/predominance","smartMapping/symbology/predominance","smartMapping/renderers/relationship","smartMapping/symbology/relationship","smartMapping/renderers/size","smartMapping/renderers/type","smartMapping/symbology/type","views/LinkChartView","rest/knowledgeGraphService","rest/knowledgeGraph/GraphQueryStreaming","request","identity/IdentityManager","rest/knowledgeGraph/KnowledgeGraph","WebLinkChart",a)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import c from"./
|
|
2
|
+
import c from"./7GNRYA6B.js";import b from"./4OX7HUMM.js";import"./YW52XJMM.js";import{a as e,c as a}from"./B4DEC7PH.js";import"./KVH3PDVW.js";import"./YGW7TUNX.js";import{v as s,y as r}from"./AKEZZ3RP.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{c:i}])=>{var t=class extends s{constructor(){super(...arguments),this.agent=i}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-layer-styling-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=e(this,"arcgis-assistant-layer-styling-agent"),a(this)}};r("arcgis-assistant-layer-styling-agent",t);return t},b,c)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import c from"./
|
|
2
|
+
import c from"./7GNRYA6B.js";import b from"./4OX7HUMM.js";import"./YW52XJMM.js";import{a as r,c as a}from"./B4DEC7PH.js";import"./KVH3PDVW.js";import"./YGW7TUNX.js";import{v as s,y as e}from"./AKEZZ3RP.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{d:i}])=>{var t=class extends s{constructor(){super(...arguments),this.agent=i}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-help-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=r(this,"arcgis-assistant-help-agent"),a(this)}};e("arcgis-assistant-help-agent",t);return t},b,c)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import c from"./
|
|
2
|
+
import c from"./7GNRYA6B.js";import b from"./4OX7HUMM.js";import"./YW52XJMM.js";import{a as r,c as e}from"./B4DEC7PH.js";import"./KVH3PDVW.js";import"./YGW7TUNX.js";import{v as a,y as s}from"./AKEZZ3RP.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{b:i}])=>{var t=class extends a{constructor(){super(...arguments),this.agent=i}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-data-exploration-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=r(this,"arcgis-assistant-data-exploration-agent"),e(this)}};s("arcgis-assistant-data-exploration-agent",t);return t},b,c)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import c from"./
|
|
2
|
+
import c from"./7GNRYA6B.js";import b from"./4OX7HUMM.js";import"./YW52XJMM.js";import{a as i,c as e}from"./B4DEC7PH.js";import"./KVH3PDVW.js";import"./YGW7TUNX.js";import{v as a,y as s}from"./AKEZZ3RP.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{a:r}])=>{var t=class extends a{constructor(){super(...arguments),this.agent=r}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-navigation-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=i(this,"arcgis-assistant-navigation-agent"),e(this)}};s("arcgis-assistant-navigation-agent",t);return t},b,c)
|
package/dist/cdn/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{p as s,x as e}from"./AKEZZ3RP.js";import"./CFDTXKJ6.js";var a=s(e,{"arcgis-assistant":[()=>import("./WYNUNAGE.js"),"_messages:,awaitingResponse:,awaitingResponseStep:,copyEnabled,description,entryMessage,feedbackEnabled,heading,interrupt:,keepSuggestedPrompts,logEnabled,messages:,orchestrator:,readAloudEnabled,referenceElement,suggestedPrompts:,voiceInputEnabled;clearChatHistory,submitMessage;cancelInterrupt,register,submitInterrupt"],"arcgis-assistant-agent":[()=>import("./FZWNOKWO.js"),"agent:,context:;getContext"],"arcgis-assistant-data-exploration-agent":[()=>import("./
|
|
2
|
+
import{p as s,x as e}from"./AKEZZ3RP.js";import"./CFDTXKJ6.js";var a=s(e,{"arcgis-assistant":[()=>import("./WYNUNAGE.js"),"_messages:,awaitingResponse:,awaitingResponseStep:,copyEnabled,description,entryMessage,feedbackEnabled,heading,interrupt:,keepSuggestedPrompts,logEnabled,messages:,orchestrator:,readAloudEnabled,referenceElement,suggestedPrompts:,voiceInputEnabled;clearChatHistory,submitMessage;cancelInterrupt,register,submitInterrupt"],"arcgis-assistant-agent":[()=>import("./FZWNOKWO.js"),"agent:,context:;getContext"],"arcgis-assistant-data-exploration-agent":[()=>import("./FVSGA6BB.js"),"referenceElement;;getContext"],"arcgis-assistant-help-agent":[()=>import("./CROPD47G.js"),"referenceElement;;getContext"],"arcgis-assistant-layer-styling-agent":[()=>import("./AI3YU24J.js"),"referenceElement;;getContext"],"arcgis-assistant-navigation-agent":[()=>import("./GXUZWFDB.js"),"referenceElement;;getContext"],"arcgis-assistant-chat":[()=>import("./XUCS7JNA.js"),"loading,messages:"],"arcgis-assistant-chat-entry":[()=>import("./VDGRXEK7.js"),"_messages:,awaitingResponse,entryPlaceholder,inputValue,keyboardShortcutsDisabled,messages:,status,voiceInputEnabled;submitMessage"],"arcgis-assistant-interrupt":[()=>import("./KCSGJGUQ.js"),"_messages:,message,options:,type"],"arcgis-assistant-message":[()=>import("./TD74ZINA.js"),"copyEnabled,feedbackEnabled,footerDisabled,logEnabled,message:,readAloudEnabled"],"arcgis-assistant-message-block":[()=>import("./4MLHX7X5.js"),"block:"],"arcgis-assistant-message-feedback":[()=>import("./O3Y4IPK5.js"),"_messages:,feedbackEnabled,message:"],"arcgis-assistant-message-footer":[()=>import("./4IESERNN.js"),"_messages:,copyEnabled,feedbackEnabled,logEnabled,message:,readAloudEnabled"],"arcgis-assistant-message-loading":[()=>import("./FFQBDX6W.js"),"loading,loadingMessage"],"arcgis-assistant-message-log":[()=>import("./SNXQTZ5B.js"),"log:,logEnabled,showLog"],"arcgis-assistant-message-read-aloud":[()=>import("./JEO7CHZM.js"),"_messages:,message:,readAloudEnabled"],"arcgis-assistant-message-text":[()=>import("./6LFDWHQ4.js"),"content"],"arcgis-assistant-speech-input":[()=>import("./NY6TBJUU.js"),"awaitingResponse,inputValue,language,mode;;clearDraftSession"],"arcgis-assistant-suggested-prompts":[()=>import("./E2MBKDZ2.js"),"_messages:,label,prompts:"],"arcgis-assistant-user-message":[()=>import("./QUVGX4PA.js"),"content,message:,user"]});a({resourcesUrl:import.meta.url});var t=new CSSStyleSheet;t.replaceSync("@layer{:not([hydrated]):is(arcgis-assistant,arcgis-assistant-agent,arcgis-assistant-data-exploration-agent,arcgis-assistant-help-agent,arcgis-assistant-layer-styling-agent,arcgis-assistant-navigation-agent,arcgis-assistant-chat,arcgis-assistant-chat-entry,arcgis-assistant-interrupt,arcgis-assistant-message-block,arcgis-assistant-message-feedback,arcgis-assistant-message-footer,arcgis-assistant-message-loading,arcgis-assistant-message-log,arcgis-assistant-message-read-aloud,arcgis-assistant-message-text,arcgis-assistant-speech-input,arcgis-assistant-suggested-prompts,arcgis-assistant-user-message){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,t];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,e)
|