@arcgis/ai-components 5.0.0-next.169 → 5.0.0-next.170

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.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import b from"./EALE2OXB.js";import a from"./UIYGE5P5.js";import{a as r,b as i}from"./GIZ3VXFU.js";import"./JA77AZOL.js";import"./2LSVWAZO.js";import{v as s,z as e}from"./XJBDOKVO.js";import"./2GMCG6SX.js";export default $arcgis.t(([,{f:a}])=>{var t=class extends s{constructor(){super(...arguments),this.agent=a}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"),i(this)}};e("arcgis-assistant-help-agent",t);return t},a,b)
2
+ import b from"./KZKPP5XL.js";import a from"./UIYGE5P5.js";import{a as r,b as i}from"./GIZ3VXFU.js";import"./JA77AZOL.js";import"./2LSVWAZO.js";import{v as s,z as e}from"./XJBDOKVO.js";import"./2GMCG6SX.js";export default $arcgis.t(([,{f:a}])=>{var t=class extends s{constructor(){super(...arguments),this.agent=a}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"),i(this)}};e("arcgis-assistant-help-agent",t);return t},a,b)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import c from"./EALE2OXB.js";import b from"./UIYGE5P5.js";import{a as i,b as e}from"./GIZ3VXFU.js";import"./JA77AZOL.js";import"./2LSVWAZO.js";import{v as s,z as a}from"./XJBDOKVO.js";import"./2GMCG6SX.js";export default $arcgis.t(([,{a:r}])=>{var t=class extends s{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)}};a("arcgis-assistant-navigation-agent",t);return t},b,c)
2
+ import c from"./KZKPP5XL.js";import b from"./UIYGE5P5.js";import{a as i,b as e}from"./GIZ3VXFU.js";import"./JA77AZOL.js";import"./2LSVWAZO.js";import{v as s,z as a}from"./XJBDOKVO.js";import"./2GMCG6SX.js";export default $arcgis.t(([,{a:r}])=>{var t=class extends s{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)}};a("arcgis-assistant-navigation-agent",t);return t},b,c)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import c from"./EALE2OXB.js";import b from"./UIYGE5P5.js";import{a as s,b as a}from"./GIZ3VXFU.js";import"./JA77AZOL.js";import"./2LSVWAZO.js";import{v as e,z as r}from"./XJBDOKVO.js";import"./2GMCG6SX.js";export default $arcgis.t(([,{d:i}])=>{var t=class extends e{constructor(){super(...arguments),this.agent=i}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-layer-query-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=s(this,"arcgis-assistant-layer-query-agent"),a(this)}};r("arcgis-assistant-layer-query-agent",t);return t},b,c)
2
+ import c from"./KZKPP5XL.js";import b from"./UIYGE5P5.js";import{a as s,b as a}from"./GIZ3VXFU.js";import"./JA77AZOL.js";import"./2LSVWAZO.js";import{v as e,z as r}from"./XJBDOKVO.js";import"./2GMCG6SX.js";export default $arcgis.t(([,{d:i}])=>{var t=class extends e{constructor(){super(...arguments),this.agent=i}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-layer-query-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=s(this,"arcgis-assistant-layer-query-agent"),a(this)}};r("arcgis-assistant-layer-query-agent",t);return t},b,c)
@@ -34,5 +34,14 @@ In all cases:
34
34
  - Focus on **notable attribute values**, **commonalities or differences**, and **interesting trends**.
35
35
  - If the feature list is empty or not meaningful, state that clearly.
36
36
 
37
- **Keep your response concise and relevant to the user\u2019s question.**
37
+ ### STRICT OUTPUT RULES
38
+
39
+ - Do NOT ask follow-up questions.
40
+ - Do NOT offer additional actions or suggestions.
41
+ - Do NOT explain what you can do next.
42
+ - Do NOT add conversational phrases.
43
+ - Do NOT add any text beyond the requested summary or numeric answer.
44
+ - End the response immediately after the summary.
45
+ - Do NOT include introductory phrases (e.g., "Found", "Here are", "The results show").
46
+ - Do NOT restate the user\u2019s question.
38
47
  `;export{e as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import b from"./EALE2OXB.js";import a from"./UIYGE5P5.js";import{a as s,b as i}from"./GIZ3VXFU.js";import"./JA77AZOL.js";import"./2LSVWAZO.js";import{v as r,z as e}from"./XJBDOKVO.js";import"./2GMCG6SX.js";export default $arcgis.t(([,{c:a}])=>{var t=class extends r{constructor(){super(...arguments),this.agent=a}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-layer-filter-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=s(this,"arcgis-assistant-layer-filter-agent"),i(this)}};e("arcgis-assistant-layer-filter-agent",t);return t},a,b)
2
+ import b from"./KZKPP5XL.js";import a from"./UIYGE5P5.js";import{a as s,b as i}from"./GIZ3VXFU.js";import"./JA77AZOL.js";import"./2LSVWAZO.js";import{v as r,z as e}from"./XJBDOKVO.js";import"./2GMCG6SX.js";export default $arcgis.t(([,{c:a}])=>{var t=class extends r{constructor(){super(...arguments),this.agent=a}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-layer-filter-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=s(this,"arcgis-assistant-layer-filter-agent"),i(this)}};e("arcgis-assistant-layer-filter-agent",t);return t},a,b)
@@ -4,7 +4,7 @@ import a from"./UIYGE5P5.js";export default $arcgis.t(([gt,me,Pe,pt,{addressToLo
4
4
 
5
5
  `);return o[o.length-1]?.trim()===t?e:`${e}
6
6
 
7
- ${t}`},default:()=>""}),intent:p({reducer:(e,r)=>r}),vectorSearchLayerResults:p({reducer:(e,r)=>r,default:()=>[]}),vectorSearchFieldResults:p({reducer:(e,r)=>r})});async function jt(e,r){let t=V.getDefault().helperServices.geocode.find(q=>q.name==="ArcGIS World Geocoding Service");if(!t)throw new Error("ArcGIS World Geocoding Service not found in helperServices.");let a=t.url,o=`${se.assetsPath?.endsWith("/")?se.assetsPath:`${se.assetsPath}/`}esri/images/search/search-symbol-32.png`;console.log(`[goToAddress] Geocoding: ${e} using ${a}`);let i=(await yt(a,{address:{SingleLine:e},outFields:["Match_addr"]}))?.[0];if(!i?.extent)throw new Error(`Could not find location for: ${e}`);let{xmin:s,ymin:l,xmax:c,ymax:d,spatialReference:u}=i.extent,m=new Pe({xmin:s,ymin:l,xmax:c,ymax:d,spatialReference:u}),f=(s+c)/2,g=(l+d)/2,b=new me({x:f,y:g,spatialReference:u}),v=new pt({url:o,width:24,height:24}),S=new gt({geometry:b,symbol:v});return r.graphics.removeAll(),r.graphics.add(S),await r.goTo(m),`Successfully zoomed to: ${e}. Location coordinates: x=${f}, y=${g}, wkid=${u.wkid}`}var Vt=["mapView"];function I(e){let r=e?.configurable?.context;if(!r||typeof r!="object")throw new Error("NavigationAgent context missing");let t=Vt.filter(a=>!(a in r));if(t.length)throw new Error(`NavigationAgent context missing: ${t.join(", ")}`);return r}async function Ot({address:e},r){let{mapView:t}=I(r);return await jt(e,t)}var Dt=n.object({address:n.string().describe("The full address or place name to locate.")}),Pt=y(Ot,{name:"goToAddress",description:"Geocodes an address using Esri's World Geocoding Service and zooms the map to that location.",schema:Dt});async function Gt(e,r){let t=r.map.bookmarks;if(!t||t.length===0)throw new Error("No bookmarks found in the map.");let a=t.find(i=>i.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 r.goTo(o),`Navigated to bookmark: ${e}`}async function Bt({bookmarkName:e},r){let{mapView:t}=I(r);return await Promise.resolve(Gt(e,t))}var Qt=R.object({bookmarkName:R.string().describe("The name of the bookmark to navigate to.")}),Wt=y(Bt,{name:"goToBookmark",description:"Go to the extent of the bookmark with the given name.",schema:Qt});async function Ut(e,r,t){let a=t.map?.allLayers.find(i=>i.id===e);if(!a)return`Error: Layer with id ${e} not found`;let o=a.createQuery();o.where=r??"1=1";try{let{extent:i,count:s}=await a.queryExtent(o);if(s===0)return`No features found in ${a.title} matching: ${r}`;if(i)await t.goTo(i);else return`Error: Unable to determine extent for ${a.title}`;return`Successfully zoomed to ${s} feature(s) in ${a.title}`}catch(i){return console.error("Error in goToFeatures:",i),`Error: ${i instanceof Error?i.message:"Unknown error"}`}}async function Kt({layerId:e,where:r},t){let{mapView:a}=I(t);return await Ut(e,r,a)}var Ht=R.object({layerId:R.string().describe("The layerId of the layer to zoom to."),where:R.string().describe("The sql-92 where clause used to query features to zoom to")}),Jt=y(Kt,{name:"goToFeatures",description:"Go to the features that match the given filter related to the given layerId.",schema:Ht});async function Zt(e){let r=new Pe({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:{wkid:4326}}).expand(.7);return await e.goTo(r),"Successfully zoomed to world extent"}async function Xt(e,r){let{mapView:t}=I(r);return await Zt(t)}var Yt=R.object({}),er=y(Xt,{name:"goToFullExtent",description:"Zooms the map to the full world extent using Esri's Geocoding Service.",schema:Yt});async function tr(e){let r=e.map.initialViewProperties?.viewpoint?.targetGeometry;if(r)await e.goTo(r);else throw new Error("Initial extent is undefined");return"Successfully zoomed to home extent"}async function rr(e,r){let{mapView:t}=I(r);return await tr(t)}var ar=n.object({}),or=y(rr,{name:"goToHomeExtent",description:"Go to the initial web map view extent",schema:ar});async function ir(e,r){await r.when();let t=r.map?.allLayers.find(o=>o.id===e);if(!t)return console.warn(`[goToLayer] No matching FeatureLayer found for: ${e}`),`Could not find layer for: ${e}`;console.log(`[goToLayer] Zooming to layer: ${t.title}`);let a;return(t.type==="link-chart"||t.type==="knowledge-graph-sublayer")&&r.map?.activeLinkChartLayer?a=r.map.diagramNodesExtent:a=t.fullExtent,a?(await r.goTo(a),t.visible=!0,`Successfully zoomed to: ${t.title??""}`):"Layer has no defined extent. Cannot zoom to layer."}async function nr({layerId:e},r){let{mapView:t}=I(r);return await ir(e,t)}var sr=R.object({layerId:R.string().describe("The id of the layer to navigate to")}),lr=y(nr,{name:"goToLayer",description:"Zooms the map view to the full extent of the top matching layer.",schema:sr});async function cr(e,r){return await r.goTo({scale:e}),`Successfully zoomed to: ${e}`}async function dr({scale:e},r){let{mapView:t}=I(r);return await cr(e,t)}var ur=n.object({scale:n.number().describe("The map scale of the view to go to.")}),hr=y(dr,{name:"goToScale",description:"Go to the specified view scale.",schema:ur});async function mr(e,r,t){let a={target:new me({longitude:e.longitude,latitude:e.latitude,spatialReference:{wkid:4326}})};return t?.zoom!==void 0&&(a.zoom=t.zoom),t?.scale!==void 0&&(a.scale=t.scale),await r.goTo(a),`Successfully navigated to: ${[`(${e.latitude}\xB0, ${e.longitude}\xB0)`,t?.zoom!==void 0?`zoom ${t.zoom}`:"",t?.scale!==void 0?`scale 1:${t.scale}`:""].filter(Boolean).join(", ")}`}async function fr({center:e,zoom:r,scale:t},a){let{mapView:o}=I(a);return await mr(e,o,{zoom:r,scale:t})}var gr=n.object({center:n.object({longitude:n.number().describe("The longitude (x-coordinate) of the point to navigate to."),latitude:n.number().describe("The latitude (y-coordinate) of the point to navigate to.")}),zoom:n.number().optional().describe("The zoom level. Higher values = more zoomed in."),scale:n.number().optional().describe("The map scale. Alternative to zoom. Smaller numbers = more zoomed in.")}),pr=y(fr,{name:"goToViewpoint",description:"Go to the specified viewpoint. This can contain a combination of scale, center, zoom, etc.",schema:gr});async function yr(e,r){return await r.goTo({zoom:e}),`Successfully zoomed to: ${e}`}async function wr({zoom:e},r){let{mapView:t}=I(r);return await yr(e,t)}var br=n.object({zoom:n.number().min(1).max(20).describe("The zoom level of the view to go to.")}),vr=y(wr,{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:br}),we=[Pt,Wt,Jt,er,or,lr,hr,pr,vr],Me=Object.assign({"../agents/arcgisKnowledge/prompts/arcgis_knowledge_current_lc_context.md":()=>import("./QZJ4SRT5.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_intent_prompt.md":()=>import("./BN4IYD74.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_tool_prompt.md":()=>import("./M32BWJ4D.js").then(e=>e.default),"../agents/dataExploration/prompts/data_explore_filter_prompt.md":()=>import("./K3PQOSGC.js").then(e=>e.default),"../agents/dataExploration/prompts/data_explore_query_prompt.md":()=>import("./AIF7B65D.js").then(e=>e.default),"../agents/dataExploration/prompts/summarize_query_response_prompt.md":()=>import("./ZEDYQGDL.js").then(e=>e.default),"../agents/help/prompts/help_prompt.md":()=>import("./XOLWLHTD.js").then(e=>e.default),"../agents/layerFilter/prompts/layer_filter_prompt.md":()=>import("./Y4325EIX.js").then(e=>e.default),"../agents/layerQuery/prompts/data_query_prompt.md":()=>import("./3YA7AYJB.js").then(e=>e.default),"../agents/layerQuery/prompts/summarize_query_response_prompt.md":()=>import("./JVPRUGML.js").then(e=>e.default),"../agents/layerStyling/prompts/layer_styling_prompt.md":()=>import("./TBTPT64L.js").then(e=>e.default),"../agents/navigation/prompts/navigation_intent_prompt.md":()=>import("./QYS2QVQH.js").then(e=>e.default),"../agents/navigation/prompts/navigation_tool_prompt.md":()=>import("./IMPD5HA4.js").then(e=>e.default)});async function $(e){let r=Object.entries(Me).find(([t])=>t.endsWith(`/${e}.md`));if(console.log(`entry for prompt "${e}":`,r),!r)throw new Error(`Prompt not found: ${e}
7
+ ${t}`},default:()=>""}),intent:p({reducer:(e,r)=>r}),vectorSearchLayerResults:p({reducer:(e,r)=>r,default:()=>[]}),vectorSearchFieldResults:p({reducer:(e,r)=>r})});async function jt(e,r){let t=V.getDefault().helperServices.geocode.find(q=>q.name==="ArcGIS World Geocoding Service");if(!t)throw new Error("ArcGIS World Geocoding Service not found in helperServices.");let a=t.url,o=`${se.assetsPath?.endsWith("/")?se.assetsPath:`${se.assetsPath}/`}esri/images/search/search-symbol-32.png`;console.log(`[goToAddress] Geocoding: ${e} using ${a}`);let i=(await yt(a,{address:{SingleLine:e},outFields:["Match_addr"]}))?.[0];if(!i?.extent)throw new Error(`Could not find location for: ${e}`);let{xmin:s,ymin:l,xmax:c,ymax:d,spatialReference:u}=i.extent,m=new Pe({xmin:s,ymin:l,xmax:c,ymax:d,spatialReference:u}),f=(s+c)/2,g=(l+d)/2,b=new me({x:f,y:g,spatialReference:u}),v=new pt({url:o,width:24,height:24}),S=new gt({geometry:b,symbol:v});return r.graphics.removeAll(),r.graphics.add(S),await r.goTo(m),`Successfully zoomed to: ${e}. Location coordinates: x=${f}, y=${g}, wkid=${u.wkid}`}var Vt=["mapView"];function I(e){let r=e?.configurable?.context;if(!r||typeof r!="object")throw new Error("NavigationAgent context missing");let t=Vt.filter(a=>!(a in r));if(t.length)throw new Error(`NavigationAgent context missing: ${t.join(", ")}`);return r}async function Ot({address:e},r){let{mapView:t}=I(r);return await jt(e,t)}var Dt=n.object({address:n.string().describe("The full address or place name to locate.")}),Pt=y(Ot,{name:"goToAddress",description:"Geocodes an address using Esri's World Geocoding Service and zooms the map to that location.",schema:Dt});async function Gt(e,r){let t=r.map.bookmarks;if(!t||t.length===0)throw new Error("No bookmarks found in the map.");let a=t.find(i=>i.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 r.goTo(o),`Navigated to bookmark: ${e}`}async function Bt({bookmarkName:e},r){let{mapView:t}=I(r);return await Promise.resolve(Gt(e,t))}var Qt=R.object({bookmarkName:R.string().describe("The name of the bookmark to navigate to.")}),Wt=y(Bt,{name:"goToBookmark",description:"Go to the extent of the bookmark with the given name.",schema:Qt});async function Ut(e,r,t){let a=t.map?.allLayers.find(i=>i.id===e);if(!a)return`Error: Layer with id ${e} not found`;let o=a.createQuery();o.where=r??"1=1";try{let{extent:i,count:s}=await a.queryExtent(o);if(s===0)return`No features found in ${a.title} matching: ${r}`;if(i)await t.goTo(i);else return`Error: Unable to determine extent for ${a.title}`;return`Successfully zoomed to ${s} feature(s) in ${a.title}`}catch(i){return console.error("Error in goToFeatures:",i),`Error: ${i instanceof Error?i.message:"Unknown error"}`}}async function Kt({layerId:e,where:r},t){let{mapView:a}=I(t);return await Ut(e,r,a)}var Ht=R.object({layerId:R.string().describe("The layerId of the layer to zoom to."),where:R.string().describe("The sql-92 where clause used to query features to zoom to")}),Jt=y(Kt,{name:"goToFeatures",description:"Go to the features that match the given filter related to the given layerId.",schema:Ht});async function Zt(e){let r=new Pe({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:{wkid:4326}}).expand(.7);return await e.goTo(r),"Successfully zoomed to world extent"}async function Xt(e,r){let{mapView:t}=I(r);return await Zt(t)}var Yt=R.object({}),er=y(Xt,{name:"goToFullExtent",description:"Zooms the map to the full world extent using Esri's Geocoding Service.",schema:Yt});async function tr(e){let r=e.map.initialViewProperties?.viewpoint?.targetGeometry;if(r)await e.goTo(r);else throw new Error("Initial extent is undefined");return"Successfully zoomed to home extent"}async function rr(e,r){let{mapView:t}=I(r);return await tr(t)}var ar=n.object({}),or=y(rr,{name:"goToHomeExtent",description:"Go to the initial web map view extent",schema:ar});async function ir(e,r){await r.when();let t=r.map?.allLayers.find(o=>o.id===e);if(!t)return console.warn(`[goToLayer] No matching FeatureLayer found for: ${e}`),`Could not find layer for: ${e}`;console.log(`[goToLayer] Zooming to layer: ${t.title}`);let a;return(t.type==="link-chart"||t.type==="knowledge-graph-sublayer")&&r.map?.activeLinkChartLayer?a=r.map.diagramNodesExtent:a=t.fullExtent,a?(await r.goTo(a),t.visible=!0,`Successfully zoomed to: ${t.title??""}`):"Layer has no defined extent. Cannot zoom to layer."}async function nr({layerId:e},r){let{mapView:t}=I(r);return await ir(e,t)}var sr=R.object({layerId:R.string().describe("The id of the layer to navigate to")}),lr=y(nr,{name:"goToLayer",description:"Zooms the map view to the full extent of the top matching layer.",schema:sr});async function cr(e,r){return await r.goTo({scale:e}),`Successfully zoomed to: ${e}`}async function dr({scale:e},r){let{mapView:t}=I(r);return await cr(e,t)}var ur=n.object({scale:n.number().describe("The map scale of the view to go to.")}),hr=y(dr,{name:"goToScale",description:"Go to the specified view scale.",schema:ur});async function mr(e,r,t){let a={target:new me({longitude:e.longitude,latitude:e.latitude,spatialReference:{wkid:4326}})};return t?.zoom!==void 0&&(a.zoom=t.zoom),t?.scale!==void 0&&(a.scale=t.scale),await r.goTo(a),`Successfully navigated to: ${[`(${e.latitude}\xB0, ${e.longitude}\xB0)`,t?.zoom!==void 0?`zoom ${t.zoom}`:"",t?.scale!==void 0?`scale 1:${t.scale}`:""].filter(Boolean).join(", ")}`}async function fr({center:e,zoom:r,scale:t},a){let{mapView:o}=I(a);return await mr(e,o,{zoom:r,scale:t})}var gr=n.object({center:n.object({longitude:n.number().describe("The longitude (x-coordinate) of the point to navigate to."),latitude:n.number().describe("The latitude (y-coordinate) of the point to navigate to.")}),zoom:n.number().optional().describe("The zoom level. Higher values = more zoomed in."),scale:n.number().optional().describe("The map scale. Alternative to zoom. Smaller numbers = more zoomed in.")}),pr=y(fr,{name:"goToViewpoint",description:"Go to the specified viewpoint. This can contain a combination of scale, center, zoom, etc.",schema:gr});async function yr(e,r){return await r.goTo({zoom:e}),`Successfully zoomed to: ${e}`}async function wr({zoom:e},r){let{mapView:t}=I(r);return await yr(e,t)}var br=n.object({zoom:n.number().min(1).max(20).describe("The zoom level of the view to go to.")}),vr=y(wr,{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:br}),we=[Pt,Wt,Jt,er,or,lr,hr,pr,vr],Me=Object.assign({"../agents/arcgisKnowledge/prompts/arcgis_knowledge_current_lc_context.md":()=>import("./QZJ4SRT5.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_intent_prompt.md":()=>import("./BN4IYD74.js").then(e=>e.default),"../agents/arcgisKnowledge/prompts/arcgis_knowledge_tool_prompt.md":()=>import("./M32BWJ4D.js").then(e=>e.default),"../agents/dataExploration/prompts/data_explore_filter_prompt.md":()=>import("./K3PQOSGC.js").then(e=>e.default),"../agents/dataExploration/prompts/data_explore_query_prompt.md":()=>import("./AIF7B65D.js").then(e=>e.default),"../agents/dataExploration/prompts/summarize_query_response_prompt.md":()=>import("./I2OEGQRT.js").then(e=>e.default),"../agents/help/prompts/help_prompt.md":()=>import("./XOLWLHTD.js").then(e=>e.default),"../agents/layerFilter/prompts/layer_filter_prompt.md":()=>import("./Y4325EIX.js").then(e=>e.default),"../agents/layerQuery/prompts/data_query_prompt.md":()=>import("./3YA7AYJB.js").then(e=>e.default),"../agents/layerQuery/prompts/summarize_query_response_prompt.md":()=>import("./JVPRUGML.js").then(e=>e.default),"../agents/layerStyling/prompts/layer_styling_prompt.md":()=>import("./TBTPT64L.js").then(e=>e.default),"../agents/navigation/prompts/navigation_intent_prompt.md":()=>import("./QYS2QVQH.js").then(e=>e.default),"../agents/navigation/prompts/navigation_tool_prompt.md":()=>import("./IMPD5HA4.js").then(e=>e.default)});async function $(e){let r=Object.entries(Me).find(([t])=>t.endsWith(`/${e}.md`));if(console.log(`entry for prompt "${e}":`,r),!r)throw new Error(`Prompt not found: ${e}
8
8
  Available prompts:
9
9
  ${Object.keys(Me).join(`
10
10
  `)}`);return await r[1]()}var Sr=(e,r=3)=>e.filter(t=>t instanceof ie).slice(-r),T=(e,r=3)=>{let t=e.map((o,i)=>o instanceof ie?i:-1).filter(o=>o!==-1);if(t.length===0)return[];let a=t.length>r?t[t.length-r]:t[0];return e.slice(a)},N=(e,r=" ")=>Sr(e).map(t=>t.content).join(r).trim();async function Tr(e,r){let t=await $("navigation_tool_prompt"),{mapView:a}=I(r),o=a.map,i=e.vectorSearchLayerResults?.length>0?e.vectorSearchLayerResults.map((b,v)=>`${v+1}. layerId=${b.id} | title=${b.title??""} | name=${b.name??""} | score=${b.score.toFixed(2)}`).join(`
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import b from"./EALE2OXB.js";import a from"./UIYGE5P5.js";import{a as e,b as i}from"./GIZ3VXFU.js";import"./JA77AZOL.js";import"./2LSVWAZO.js";import{v as s,z as r}from"./XJBDOKVO.js";import"./2GMCG6SX.js";export default $arcgis.t(([,{e:a}])=>{var t=class extends s{constructor(){super(...arguments),this.agent=a}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"),i(this)}};r("arcgis-assistant-layer-styling-agent",t);return t},a,b)
2
+ import b from"./KZKPP5XL.js";import a from"./UIYGE5P5.js";import{a as e,b as i}from"./GIZ3VXFU.js";import"./JA77AZOL.js";import"./2LSVWAZO.js";import{v as s,z as r}from"./XJBDOKVO.js";import"./2GMCG6SX.js";export default $arcgis.t(([,{e:a}])=>{var t=class extends s{constructor(){super(...arguments),this.agent=a}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"),i(this)}};r("arcgis-assistant-layer-styling-agent",t);return t},a,b)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import c from"./EALE2OXB.js";import b from"./UIYGE5P5.js";import{a as r,b as e}from"./GIZ3VXFU.js";import"./JA77AZOL.js";import"./2LSVWAZO.js";import{v as a,z as s}from"./XJBDOKVO.js";import"./2GMCG6SX.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)
2
+ import c from"./KZKPP5XL.js";import b from"./UIYGE5P5.js";import{a as r,b as e}from"./GIZ3VXFU.js";import"./JA77AZOL.js";import"./2LSVWAZO.js";import{v as a,z as s}from"./XJBDOKVO.js";import"./2GMCG6SX.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)
package/dist/cdn/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{p as e,y as s}from"./XJBDOKVO.js";import"./2GMCG6SX.js";var t=e(s,{"arcgis-assistant":[()=>import("./737VBOU4.js"),"_messages:,copyEnabled,description,entryMessage,feedbackEnabled,heading,logEnabled,messages:,orchestrator:,referenceElement,suggestedPrompts:;submitMessage;register"],"arcgis-assistant-agent":[()=>import("./7GTFRRWF.js"),"agent:,context:;;getContext"],"arcgis-assistant-data-exploration-agent":[()=>import("./BUTVXSRB.js"),"referenceElement;;getContext"],"arcgis-assistant-help-agent":[()=>import("./RVSQQE3L.js"),"referenceElement;;getContext"],"arcgis-assistant-layer-filter-agent":[()=>import("./3U4J3C3S.js"),"referenceElement;;getContext"],"arcgis-assistant-layer-query-agent":[()=>import("./G6CGX52N.js"),"referenceElement;;getContext"],"arcgis-assistant-layer-styling-agent":[()=>import("./TIOPC5KX.js"),"referenceElement;;getContext"],"arcgis-assistant-navigation-agent":[()=>import("./ALUTZ2EH.js"),"referenceElement;;getContext"],"arcgis-assistant-chat":[()=>import("./PFUFVETM.js"),"copyEnabled,feedbackEnabled,loading,loadingMessage,logEnabled,messages:,user"],"arcgis-assistant-chat-card":[()=>import("./GCANEOSY.js"),"_messages:,content,copyEnabled,error,feedbackEnabled,loading,loadingMessage,log:,logEnabled,message:,messageRole,user"],"arcgis-assistant-chat-card-content":[()=>import("./3LO22NV5.js"),"content,loading,loadingMessage,type"],"arcgis-assistant-chat-entry":[()=>import("./4GEEK3VW.js"),"_messages:,awaitingResponse,entryPlaceholder,inputValue,keyboardShortcutsDisabled,messages:,status"],"arcgis-assistant-interrupt":[()=>import("./7KB4R4Z2.js"),"_messages:,message,options:,type"],"arcgis-assistant-shell":[()=>import("./FEJ3AX3C.js"),"_messages:,awaitingResponse,description,entryMessage,entryMessageClosed,heading,inputValue,loading,messages:,status,suggestedPrompts:"]});t({resourcesUrl:import.meta.url});var a=new CSSStyleSheet;a.replaceSync("@layer{:not([hydrated]):is(arcgis-assistant,arcgis-assistant-agent,arcgis-assistant-data-exploration-agent,arcgis-assistant-help-agent,arcgis-assistant-layer-filter-agent,arcgis-assistant-layer-query-agent,arcgis-assistant-layer-styling-agent,arcgis-assistant-navigation-agent,arcgis-assistant-chat,arcgis-assistant-chat-card,arcgis-assistant-chat-card-content,arcgis-assistant-chat-entry,arcgis-assistant-interrupt,arcgis-assistant-shell){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,a];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r,p,j,i=(a.importMap??={}).imports??={})=>{"utils".split(",").map(e=>i[p+e+j]=i[p+e]=import.meta.resolve("./"+e+j));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,s,"@arcgis/ai-components/",".js")
2
+ import{p as e,y as s}from"./XJBDOKVO.js";import"./2GMCG6SX.js";var t=e(s,{"arcgis-assistant":[()=>import("./737VBOU4.js"),"_messages:,copyEnabled,description,entryMessage,feedbackEnabled,heading,logEnabled,messages:,orchestrator:,referenceElement,suggestedPrompts:;submitMessage;register"],"arcgis-assistant-agent":[()=>import("./7GTFRRWF.js"),"agent:,context:;;getContext"],"arcgis-assistant-data-exploration-agent":[()=>import("./Z6FQLWRW.js"),"referenceElement;;getContext"],"arcgis-assistant-help-agent":[()=>import("./DTH3WAXU.js"),"referenceElement;;getContext"],"arcgis-assistant-layer-filter-agent":[()=>import("./K5GX4YHH.js"),"referenceElement;;getContext"],"arcgis-assistant-layer-query-agent":[()=>import("./GPB7TPMS.js"),"referenceElement;;getContext"],"arcgis-assistant-layer-styling-agent":[()=>import("./YTRQFY3B.js"),"referenceElement;;getContext"],"arcgis-assistant-navigation-agent":[()=>import("./FEXOABGA.js"),"referenceElement;;getContext"],"arcgis-assistant-chat":[()=>import("./PFUFVETM.js"),"copyEnabled,feedbackEnabled,loading,loadingMessage,logEnabled,messages:,user"],"arcgis-assistant-chat-card":[()=>import("./GCANEOSY.js"),"_messages:,content,copyEnabled,error,feedbackEnabled,loading,loadingMessage,log:,logEnabled,message:,messageRole,user"],"arcgis-assistant-chat-card-content":[()=>import("./3LO22NV5.js"),"content,loading,loadingMessage,type"],"arcgis-assistant-chat-entry":[()=>import("./4GEEK3VW.js"),"_messages:,awaitingResponse,entryPlaceholder,inputValue,keyboardShortcutsDisabled,messages:,status"],"arcgis-assistant-interrupt":[()=>import("./7KB4R4Z2.js"),"_messages:,message,options:,type"],"arcgis-assistant-shell":[()=>import("./FEJ3AX3C.js"),"_messages:,awaitingResponse,description,entryMessage,entryMessageClosed,heading,inputValue,loading,messages:,status,suggestedPrompts:"]});t({resourcesUrl:import.meta.url});var a=new CSSStyleSheet;a.replaceSync("@layer{:not([hydrated]):is(arcgis-assistant,arcgis-assistant-agent,arcgis-assistant-data-exploration-agent,arcgis-assistant-help-agent,arcgis-assistant-layer-filter-agent,arcgis-assistant-layer-query-agent,arcgis-assistant-layer-styling-agent,arcgis-assistant-navigation-agent,arcgis-assistant-chat,arcgis-assistant-chat-card,arcgis-assistant-chat-card-content,arcgis-assistant-chat-entry,arcgis-assistant-interrupt,arcgis-assistant-shell){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,a];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r,p,j,i=(a.importMap??={}).imports??={})=>{"utils".split(",").map(e=>i[p+e+j]=i[p+e]=import.meta.resolve("./"+e+j));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,s,"@arcgis/ai-components/",".js")
@@ -1,7 +1,7 @@
1
1
  /// <reference path="../../index.d.ts" />
2
2
  import type Collection from "@arcgis/core/core/Collection.js";
3
3
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
4
- import type { ChatMessage, Feedback, Interrupt } from "./types.js";
4
+ import type { AssistantMessage, ChatMessage, Interrupt } from "./types.js";
5
5
  import type { T9nMeta } from "@arcgis/lumina/controllers";
6
6
  import type { ArcgisMap as ArcgisMap } from "@arcgis/map-components/components/arcgis-map";
7
7
 
@@ -122,7 +122,7 @@ export abstract class ArcgisAssistant extends LitElement {
122
122
  * const assistant = document.querySelector("arcgis-assistant");
123
123
  * assistant.feedbackEnabled = true;
124
124
  * assistant.addEventListener("arcgisFeedback", (event) => {
125
- * const feedback = event.detail; // { positive: true } or { positive: false }
125
+ * const feedback = event.detail;
126
126
  * // Capture additional feedback from the user and log it to a database or service for later analysis
127
127
  * });
128
128
  * ```
@@ -255,20 +255,20 @@ export abstract class ArcgisAssistant extends LitElement {
255
255
  readonly arcgisError: import("@arcgis/lumina").TargetedEvent<this, Error>;
256
256
  /**
257
257
  * Emitted when the user clicks the thumbs up or thumbs down feedback action that is displayed when [feedbackEnabled](https://developers.arcgis.com/javascript/latest/references/ai-components/components/arcgis-assistant/#feedbackEnabled) is `true`.
258
- * The event detail includes a Feedback object indicating whether the feedback is positive or negative. This allows the application to capture user
259
- * feedback on the assistant's responses and respond to it in custom ways, such as by providing additional information, adjusting the assistant's behavior,
260
- * logging the feedback for analysis, or triggering other actions in the app.
258
+ * The event detail includes an AssistantMessage object that includes a feedback property with an object indicating whether the feedback is positive or negative.
259
+ * This allows the application to capture user feedback on the assistant's responses and respond to it in custom ways, such as by providing additional
260
+ * information, adjusting the assistant's behavior, logging the feedback for analysis, or triggering other actions in the app.
261
261
  *
262
262
  * @example
263
263
  * ```js
264
264
  * const assistant = document.querySelector("arcgis-assistant");
265
265
  * assistant.addEventListener("arcgisFeedback", (event) => {
266
- * const feedback = event.detail; // { positive: true } or { positive: false }
266
+ * const feedback = event.detail;
267
267
  * // Handle the feedback, such as by providing additional information, adjusting the assistant's behavior, or logging it for analysis
268
268
  * });
269
269
  * ```
270
270
  */
271
- readonly arcgisFeedback: import("@arcgis/lumina").TargetedEvent<this, Feedback>;
271
+ readonly arcgisFeedback: import("@arcgis/lumina").TargetedEvent<this, AssistantMessage>;
272
272
  /**
273
273
  * Emitted when an agent triggers an interrupt. An interrupt is a human-in-the-loop mechanism that provides a UI component prompting
274
274
  * the user for additional information.
@@ -71,12 +71,6 @@ export interface AssistantMessage extends ChatMessageBase {
71
71
  */
72
72
  export type ChatMessage = AssistantMessage | UserMessage;
73
73
 
74
- /** Feedback provided by the user for a specific message. */
75
- export interface Feedback {
76
- /** Indicates whether the feedback is positive or negative. */
77
- positive: boolean;
78
- }
79
-
80
74
  /** The base interface for chat messages exchanged between the user and the assistant. */
81
75
  export interface ChatMessageBase {
82
76
  /**
@@ -94,4 +88,10 @@ export interface UserMessage extends ChatMessageBase {
94
88
  * This content is sent to the assistant and its agents for processing and generating responses.
95
89
  */
96
90
  content: string;
91
+ }
92
+
93
+ /** Feedback provided by the user for a specific message. */
94
+ export interface Feedback {
95
+ /** Indicates whether the feedback is positive or negative. */
96
+ positive: boolean;
97
97
  }
@@ -9,7 +9,7 @@ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
9
9
  *
10
10
  * Building custom agents can only be done using modern JavaScript/TypeScript tooling and cannot be done directly in HTML using
11
11
  * CDN imports. Therefore, you must use a package manager like npm or yarn to install the required dependencies. Please refer to the
12
- * [Custom Agents guide](https://developers.arcgis.com/javascript/latest/ai-agents/ai-custom-agents/) for more instructions on how to create a custom agent.
12
+ * [Custom Agents guide](https://developers.arcgis.com/javascript/latest/agentic-apps/ai-custom-agents/) for more instructions on how to create a custom agent.
13
13
  *
14
14
  * Use the [utils](https://developers.arcgis.com/javascript/latest/references/ai-components/utils/index/) module for helper functions and types related to building custom agents, including the `AgentRegistration`
15
15
  * type and functions for making LLM calls, managing agent state, and setting up human-in-the-loop workflows.
@@ -45,7 +45,7 @@ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
45
45
  * @beta
46
46
  * @see [arcgis-assistant](https://developers.arcgis.com/javascript/latest/references/ai-components/components/arcgis-assistant/)
47
47
  * @see [LangGraph documentation](https://docs.langchain.com/oss/javascript/langgraph/overview)
48
- * @see [Custom Agents guide](https://developers.arcgis.com/javascript/latest/ai-agents/ai-custom-agents/)
48
+ * @see [Custom Agents guide](https://developers.arcgis.com/javascript/latest/agentic-apps/ai-custom-agents/)
49
49
  */
50
50
  export abstract class ArcgisAssistantAgent<TContext = Record<string, unknown>> extends LitElement {
51
51
  /**
@@ -56,7 +56,7 @@ export abstract class ArcgisAssistantAgent<TContext = Record<string, unknown>> e
56
56
  * This is an agent defined in the client and can be invoked by the assistant from the browser to perform specific tasks
57
57
  * using functions defined in the client.
58
58
  *
59
- * See the [Custom Agents guide](https://developers.arcgis.com/javascript/latest/ai-agents/ai-custom-agents/) for more instructions.
59
+ * See the [Custom Agents guide](https://developers.arcgis.com/javascript/latest/agentic-apps/ai-custom-agents/) for more instructions.
60
60
  *
61
61
  * @required
62
62
  * @see [LangGraph documentation](https://docs.langchain.com/oss/javascript/langgraph/overview)