@arcgis/ai-components 5.2.0-next.120 → 5.2.0-next.121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-utils/LLMAgent.js +2 -0
- package/dist/agents/runtime/skill/createSkillAgent.js +115 -131
- package/dist/cdn/2DYOTV7W.js +4 -0
- package/dist/cdn/2WT4JANT.js +2 -0
- package/dist/cdn/{2NODROJN.js → 3F5EZZSG.js} +20 -24
- package/dist/cdn/4V3Q7XGS.js +2 -0
- package/dist/cdn/5GALSAQF.js +3 -0
- package/dist/cdn/72KYGCIU.js +2 -0
- package/dist/cdn/75OPJOCY.js +2 -0
- package/dist/cdn/7D6POJJA.js +2 -0
- package/dist/cdn/{SLR75R32.js → 7HVK7G55.js} +1 -1
- package/dist/cdn/7L6LPWRH.js +2 -0
- package/dist/cdn/7TAIUEMW.js +2 -0
- package/dist/cdn/{C2W6MBDB.js → D3E5NSY3.js} +1 -1
- package/dist/cdn/ESPC6NTI.js +68 -0
- package/dist/cdn/{HTB76P2C.js → EWO73MJA.js} +1 -1
- package/dist/cdn/{EIZR3Q5O.js → FGQLS3UX.js} +1 -1
- package/dist/cdn/FOZAOJCM.js +2 -0
- package/dist/cdn/GZDI2LAT.js +2 -0
- package/dist/cdn/H4ERKWFA.js +2 -0
- package/dist/cdn/{7W7KWR5O.js → H5AVPDSE.js} +4 -4
- package/dist/cdn/{2I2FHPHR.js → HDAMDEYL.js} +6 -6
- package/dist/cdn/JE55XX2C.js +2 -0
- package/dist/cdn/K36XPG2M.js +2 -0
- package/dist/cdn/KDE5MMMR.js +2 -0
- package/dist/cdn/{ZGZX7GR5.js → KONQTXBJ.js} +1 -1
- package/dist/cdn/{J4YHT55S.js → MCZJD3A4.js} +1 -1
- package/dist/cdn/MNZAQM3Q.js +3 -0
- package/dist/cdn/NHZRDYLP.js +2 -0
- package/dist/cdn/NYFV4A6L.js +3 -0
- package/dist/cdn/OGYNTGNM.js +2 -0
- package/dist/cdn/PGIXKPTW.js +2 -0
- package/dist/cdn/PTEKX5TX.js +2 -0
- package/dist/cdn/PUHPFUCU.js +2 -0
- package/dist/cdn/{GKWMAWFZ.js → QDOKDRBB.js} +1 -1
- package/dist/cdn/TGZBLBEJ.js +2 -0
- package/dist/cdn/{K7BUBCK7.js → UBKYXKMW.js} +1 -1
- package/dist/cdn/UXECAKJ7.js +2 -0
- package/dist/cdn/WXOKGQ4D.js +2 -0
- package/dist/cdn/Y364LLPN.js +2 -0
- package/dist/cdn/YBSY32EU.js +2 -0
- package/dist/cdn/{CF2V3NER.js → ZLLVPKDN.js} +35 -35
- package/dist/cdn/agent-utils/index.js +1 -1
- package/dist/cdn/assets/agents/t9n/messages.ar.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.bg.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.ca.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.cs.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.da.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.de.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.el.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.es.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.et.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.fi.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.fr.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.he.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.hr.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.hu.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.id.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.it.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.ja.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.ko.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.lt.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.lv.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.nl.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.no.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.pl.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.pt-BR.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.pt-PT.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.ro.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.ru.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.sk.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.sl.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.sr.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.sv.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.th.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.tr.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.uk.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.vi.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.zh-CN.json +1 -0
- package/dist/cdn/assets/agents/t9n/messages.zh-TW.json +1 -0
- package/dist/cdn/assets/orchestrator/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/adapter.js +54 -52
- package/dist/chunks/aiFactory.js +59 -41
- package/dist/chunks/arcgisKnowledgeGraph.js +4 -2
- package/dist/chunks/dataExplorationAgent.js +1 -1
- package/dist/chunks/generateLayerDescriptions.js +160 -156
- package/dist/chunks/layerStylingGraph.js +2 -0
- package/dist/chunks/orchestrator.js +325 -295
- package/dist/components/arcgis-assistant/customElement.d.ts +1 -1
- package/dist/components/arcgis-assistant/customElement.js +113 -112
- package/dist/components/arcgis-assistant-agent/customElement.js +1 -0
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +1 -0
- package/dist/components/arcgis-assistant-help-agent/customElement.js +1 -0
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +5 -4
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +1 -0
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +1 -0
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/utils/index.js +38 -36
- package/package.json +7 -7
- package/dist/cdn/5BBXNT75.js +0 -66
- package/dist/cdn/5HBAJ57P.js +0 -2
- package/dist/cdn/5MK44FNO.js +0 -2
- package/dist/cdn/6ECRQVHY.js +0 -2
- package/dist/cdn/AUDVUNF3.js +0 -2
- package/dist/cdn/BJUX4AYP.js +0 -2
- package/dist/cdn/COH3QXWG.js +0 -4
- package/dist/cdn/CPQGLQGY.js +0 -2
- package/dist/cdn/CT2ZOYNX.js +0 -2
- package/dist/cdn/DNV3L5M6.js +0 -2
- package/dist/cdn/EDVH3G5A.js +0 -2
- package/dist/cdn/HWGAJ4WN.js +0 -2
- package/dist/cdn/IHRX74QJ.js +0 -2
- package/dist/cdn/LRH2ZPVW.js +0 -2
- package/dist/cdn/OTOQL3QM.js +0 -3
- package/dist/cdn/R74ZHFA6.js +0 -2
- package/dist/cdn/RGVC76RW.js +0 -2
- package/dist/cdn/RIN3RP7D.js +0 -3
- package/dist/cdn/SWVRA77H.js +0 -2
- package/dist/cdn/TLQ75QXG.js +0 -2
- package/dist/cdn/TPF5Z277.js +0 -3
- package/dist/cdn/UIIVUHXL.js +0 -2
- package/dist/cdn/UWZQWGZP.js +0 -2
- package/dist/cdn/UXYYH6XF.js +0 -2
- package/dist/cdn/XUYARLRP.js +0 -2
- package/dist/cdn/XV3DHHYJ.js +0 -2
- package/dist/cdn/Y2BCEVV6.js +0 -2
- package/dist/cdn/YJ4MZOVC.js +0 -2
- package/dist/cdn/YXIPCGGP.js +0 -2
- package/dist/cdn/YYFKFPSN.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import x from"./
|
|
2
|
+
import x from"./PTEKX5TX.js";import w from"./D3E5NSY3.js";import t from"./H5AVPDSE.js";import s from"./EWO73MJA.js";import{a as $}from"./XQ3NBBQ3.js";import r from"./QDOKDRBB.js";import q from"./ZLLVPKDN.js";import"./4PKMJMND.js";import p from"./VWP2B4LB.js";import{a as ne}from"./5Q2XRQS6.js";import o from"./RHYNE5OE.js";import n from"./K7YQIJFT.js";import m from"./UT6JA4TK.js";import l from"./CA3RNGPN.js";import k from"./ES54NWOB.js";import i from"./CCC6LBMY.js";import"./34O57OGV.js";import{a as X}from"./LXPGQNXQ.js";import{a as u}from"./FDOMMK2M.js";import h from"./WVP73XWD.js";import{a as Y}from"./Z5XQLSYH.js";import{a as ee}from"./OZAZ277H.js";import g from"./AVRS6UCQ.js";import{a as ae}from"./K5JVB6FU.js";import{a as se}from"./FCI6M62J.js";import{a as oe}from"./BFZ5S7NF.js";import f from"./MNZAQM3Q.js";import e from"./3F5EZZSG.js";import{e as D,f as H}from"./QZL4SAYR.js";import"./H4ERKWFA.js";import"./WXQ26G5Q.js";import"./MJSIYEWN.js";import c from"./JNOH4PD5.js";import a from"./KA3S22NQ.js";import{a as b}from"./ONQ6JSBJ.js";import"./2DYOTV7W.js";import{a as d,b as G}from"./V7Y22FRP.js";import"./AXTQU5YL.js";import{Ya as T,r as v,s as y}from"./LOQ2PKV5.js";import{ta as j}from"./IYLFJCJ2.js";import{a as M}from"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([be,Se,,,,,,,{d:O,i:P,j:Z,k:W,l:B,m:R,n:C,o:J,p:_,q:q,r:S,s:Q,t:U},{a:F,b:Te},te,K,{a:N},,,,,ie,re,{b:k,c:L,d:x,e:w,f:A,g:le,h:I,i:ce,v:z},pe,{a:E,b:ue},me,ge,de])=>{var ke=async e=>{let t=e.allLayers.toArray(),a=[],r=new Map;for(let s of t)if(s instanceof be){let o=(async()=>{let i=await Q(s),n=await U(s,i);r.set(s.id,{layerItem:n,fieldRegistry:i})})();a.push(o)}return await Promise.all(a),r},$e=async e=>{await Se.whenOnce(()=>e.ready);let t=await ke(e.map),{layers:a}=await Me(t),r={schemaVersion:P,modified:Date.now(),embeddings:{modelProvider:W,model:B,dimensions:Z,templates:{layer:R,field:C}},layers:a},s=J.safeParse(r);if(!s.success)throw console.error("Schema Mismatch:",s.error.format()),new Error("Webmap embedding generation failed validation.");return s.data},Me=async e=>{let t=[],a=[];for(let[o,{fieldRegistry:i,layerItem:n}]of e.entries()){let l=he(R,{name:n.name,title:n.title,description:n.description});t.push(l);let c={id:o,name:n.name??"",title:n.title,description:n.description,vector:[],fields:[]};for(let[,m]of i.entries()){let g=he(C,{name:m.name,alias:m.alias,description:m.description});t.push(g),c.fields.push({name:m.name,alias:m.alias,description:m.description,vector:[]})}a.push(c)}let r=await F(t),s=0;return{layers:a.map(o=>(o.vector=r[s++],o.fields.forEach(i=>{i.vector=r[s++]}),o))}},he=(e,t)=>e.replace(/\{(\w+)\}/gu,(a,r)=>t[r]??""),Re=(e,t)=>{if(e.length!==t.length)throw new Error("Vectors must be the same length");let a=0,r=0,s=0;for(let n=0;n<e.length;++n){let l=e[n],c=t[n];a+=l*c,r+=l*l,s+=c*c}let o=Math.sqrt(r*s);if(o===0)return 0;let i=a/o;return Math.max(-1,Math.min(1,i))},V=[K,Y,ee,te,ae,se,oe,re,ne];async function Ce(e,t){let a=await x("navigation_tool_prompt"),{mapView:r}=b(t,["mapView"]),s=r.map.bookmarks?.map(f=>f.name).filter(Boolean)??[],o=e.vectorSearchLayerResults?.length>0?e.vectorSearchLayerResults.map((f,ve)=>`${ve+1}. layerId=${f.id} | title=${f.title??""} | name=${f.name??""} | score=${f.score.toFixed(2)}`).join(`
|
|
3
3
|
`):"",i=e.vectorSearchFieldResults?.length>0?JSON.stringify(e.vectorSearchFieldResults,null,2):"",n=e.intent==="goToBookmark"&&s.length?`Available bookmarks:
|
|
4
4
|
${s.map(f=>`- ${f}`).join(`
|
|
5
5
|
`)}`:"",l=(e.intent==="goToLayer"||e.intent==="goToFeatures")&&e.vectorSearchLayerResults?.length?`Candidate layers:
|
|
@@ -33,13 +33,13 @@ ${l.results.map(c=>` - ${c.name} (${c.score.toFixed(2)})`).join(`
|
|
|
33
33
|
_Example: “Center the map on San Francisco at scale 50000”_
|
|
34
34
|
_Example: “Zoom to the features in the schools layer where city = 'Austin'”_
|
|
35
35
|
_Example: “Go to the Downtown bookmark”_
|
|
36
|
-
_Example: “Where is Mount Rainier?”_`,Oe={id:"
|
|
36
|
+
_Example: “Where is Mount Rainier?”_`,Oe={id:"navigation-graph",name:"Navigation Graph Agent",description:je,createGraph:Ve,workspace:L},De=async(e,t)=>(await d({text:"Exiting Data Exploration agent"},t),e),He=async(e,t)=>{await d({text:"Requesting LLM for layer filter results"},t);let a=await x("data_explore_filter_prompt");if(!t?.configurable)throw new Error("config.configurable is required for layer filter tools");let{userTimezone:r,userTimezoneOffset:s}=N(),o={layerFieldInfo:e.layerFieldInfo,userTimezone:r,userTimezoneOffset:s,queryResponse:e.queryResponse,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},i=await S({promptText:a,modelTier:"default",config:t,messages:e.dataExplorationMessages,inputVariables:o,tools:I}),n=[...e.dataExplorationMessages,i];if(!((i.tool_calls?.length??0)>0))return await d({text:"LLM determined no filter changes needed"},t),{...e,dataExplorationMessages:n};let l=n,c=i.text;return await E(i,t),{...e,dataExplorationMessages:l,outputMessage:c}},Ge=async(e,t)=>{await d({text:"Requesting LLM for layer query results"},t);let a=await x("data_explore_query_prompt");if(!t?.configurable)throw new Error("config.configurable is required for layer query tools");let{userTimezone:r,userTimezoneOffset:s}=N(),o=e.agentExecutionContext.sharedState,i=o.lastNavigatedFeatures?.value,n=o.lastResolvedLocation?.value,l="none";if(i!=null)try{l=JSON.stringify(i)}catch{l="none"}let c="none";if(n!=null)try{c=JSON.stringify({address:n.address,location:n.location})}catch{c="none"}let m={layerFieldInfo:e.layerFieldInfo,userTimezone:r,userTimezoneOffset:s,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps,lastNavigatedFeatures:l,lastResolvedLocation:c},g=await S({promptText:a,modelTier:"default",config:t,messages:e.dataExplorationMessages,inputVariables:m,tools:le}),p=(g.tool_calls?.length??0)>0,h=g.text;return await E(g,t),{...e,dataExplorationMessages:[...e.dataExplorationMessages,g],...p?{}:{outputMessage:h},status:"success",summary:h&&!p?w(h):"Query planning completed."}},Pe=async(e,t)=>{try{await d({text:"Requesting LLM for summary on query results"},t);let a=await x("summarize_query_response_prompt"),r={queryResponse:e.queryResponse,assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps},s=await _({promptText:a,modelTier:"fast",config:t,messages:e.dataExplorationMessages,inputVariables:r}),o=typeof s=="string"?s:s.content,i=new j(o);await d({text:`Received response from LLM: ${o}`},t);let n=o;return{...e,outputMessage:n,status:"success",summary:n?w(n):"Summary generated.",dataExplorationMessages:[...e.dataExplorationMessages,i]}}catch(a){throw await d({text:"Error during filter LLM request"},t),new Error(`Error during filter LLM request: ${a instanceof Error?a.message:String(a)}`)}};async function Ze(e,t){if((e.queryResponse??[]).some(r=>{let s=r.details;return typeof s=="object"&&s!==null&&"error"in s}))return await d({text:"Skipping layer filter tool because query response contains an error."},t),{...e};let a=await new k(I,{handleToolErrors:!1}).invoke({messages:e.dataExplorationMessages},t);return await d({text:`Finished executing layer filter tool: ${a.messages.map(r=>r.content).join(", ")}`},t),{...e}}var ye=/\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 We(e,t){return ye.test(e)||ye.test(t)}var Be=async(e,t)=>{try{await d({text:"Preparing field information for vector search results"},t);let a=u(t,"layersAndFieldsRegistry"),{mapView:r}=b(t,["mapView"]),{assignedTask:s,userRequest:o}=e.agentExecutionContext,i=We(s,o),{layerFieldInfo:n,didFetchStatistics:l,fieldStatisticsFetchStatus:c}=await ie(e.vectorSearchFieldResults,a,r,i);l?await d({text:"Statistics fetched"},t):await d({text:"Statistics skipped"},t);for(let m of c)await d({text:` - ${m.fieldName} - stats ${m.didFetchStatistics?"fetched":"skipped"}`},t);return await d({text:"Field information prepared"},t),{...e,layerFieldInfo:n}}catch(a){throw await d({text:"Error during fetching statistics"},t),new Error(`Error during fetching statistics: ${a instanceof Error?a.message:String(a)}`)}},xe=.7,Je=10,Qe=async(e,t)=>{try{await d({text:"Similarity search to find fields"},t);let a=u(t,"fieldSearch"),r=u(t,"layersAndFieldsRegistry"),s=u(t,"embeddingCache"),o=await a.searchFields({text:e.agentExecutionContext.assignedTask,layerIds:e.vectorSearchLayerIds,minScore:xe,topResults:Je,embeddingCache:s}),i=o.map(({layerId:l,results:c})=>{let m=c.map(g=>` - ${g.name} (${g.score.toFixed(2)})`).join(`
|
|
37
37
|
`);return`${r.get(l)?.layerItem.name??l}:
|
|
38
38
|
${m}`}).join(`
|
|
39
39
|
`),n;return o.length>0?n=`Vector search completed. Matching layers and fields with scores:
|
|
40
|
-
${i}`:n=`No vector search results found for score over ${xe}.`,await d({text:n},t),{...e,vectorSearchFieldResults:o}}catch(a){throw await d({text:`Error during vector search: ${a instanceof Error?a.message:String(a)}`},t),new Error(`Vector search failed: ${a instanceof Error?a.message:String(a)}`)}},Ue=.7,
|
|
40
|
+
${i}`:n=`No vector search results found for score over ${xe}.`,await d({text:n},t),{...e,vectorSearchFieldResults:o}}catch(a){throw await d({text:`Error during vector search: ${a instanceof Error?a.message:String(a)}`},t),new Error(`Vector search failed: ${a instanceof Error?a.message:String(a)}`)}},Ue=.7,Xe=async(e,t)=>{try{await d({text:`Similarity search to find layers: ${e.agentExecutionContext.assignedTask}`},t);let a=u(t,"layerSearch"),r=u(t,"layersAndFieldsRegistry"),s=u(t,"embeddingCache"),o=await a.searchLayers({text:e.agentExecutionContext.assignedTask,minScore:Ue,embeddingCache:s}),i=o.map(c=>c.id),n=o.map(({id:c,score:m})=>`${r.get(c)?.layerItem.name??c} (${m.toFixed(2)})`).join(`
|
|
41
41
|
`),l;return i.length>0?l=`Vector search completed. Matching layers with scores:
|
|
42
|
-
${n}`:l="Vector search completed. No matching layers found.",await d({text:l},t),{...e,vectorSearchLayerIds:i}}catch(a){throw await d({text:`Error during vector search: ${a instanceof Error?a.message:String(a)}`},t),new Error(`Vector search failed: ${a instanceof Error?a.message:String(a)}`)}},
|
|
42
|
+
${n}`:l="Vector search completed. No matching layers found.",await d({text:l},t),{...e,vectorSearchLayerIds:i}}catch(a){throw await d({text:`Error during vector search: ${a instanceof Error?a.message:String(a)}`},t),new Error(`Vector search failed: ${a instanceof Error?a.message:String(a)}`)}},Ke=(e,t)=>$(["layerSearch","fieldSearch","layersAndFieldsRegistry"],"Data Exploration Agent")(e,t),Ye=()=>new T(A).addNode("requireDataExplorationServices",Ke).addNode("vectorSearchLayers",Xe).addNode("vectorSearchFields",Qe).addNode("fieldStatistics",Be).addNode("queryAgent",Ge).addNode("queryTools",ce).addNode("summarizeQueryResponseLLM",Pe).addNode("filterAgent",He).addNode("filterTools",Ze).addNode("earlyExit",De).addEdge(v,"requireDataExplorationServices").addEdge("requireDataExplorationServices","vectorSearchLayers").addConditionalEdges("vectorSearchLayers",e=>e.vectorSearchLayerIds.length?"vectorSearchFields":"earlyExit").addConditionalEdges("vectorSearchFields",e=>e.vectorSearchFieldResults.length?"fieldStatistics":"earlyExit").addEdge("fieldStatistics","queryAgent").addConditionalEdges("queryAgent",e=>(e.dataExplorationMessages[e.dataExplorationMessages.length-1]?.tool_calls?.length??0)>0?"queryTools":"filterAgent").addConditionalEdges("queryTools",e=>e.queryResponse.length?"summarizeQueryResponseLLM":"filterAgent").addEdge("summarizeQueryResponseLLM","filterAgent").addConditionalEdges("filterAgent",e=>(e.dataExplorationMessages[e.dataExplorationMessages.length-1]?.tool_calls?.length??0)>0?"filterTools":y).addEdge("filterTools",y).addEdge("earlyExit",y),et=String.raw`- **data exploration** — User is asking about the feature layer’s data (e.g. counts, summaries, statistics, field values), either for all features, a subset based on a condition, or for a subset based on the current view. And/Or user wants to include or exclude features based on field values, or visually style features differently (e.g., highlight or deemphasize them).
|
|
43
43
|
The Data Exploration Agent will automatically zoom to the affected features for action taken by this agent. In this case, no need to call navigation tool separately.
|
|
44
44
|
_Example: “Only show stations where Brand is Shell”_
|
|
45
45
|
_Example: “Make Shell stations stand out on the map”_
|
|
@@ -49,7 +49,7 @@ ${n}`:l="Vector search completed. No matching layers found.",await d({text:l},t)
|
|
|
49
49
|
_Example: “What’s the average population?”_
|
|
50
50
|
_Example: “Which values are in the status field?”_
|
|
51
51
|
|
|
52
|
-
This agent does NOT handle help/metadata requests such as listing available layers, listing field names/columns/attributes for a layer, or capability guidance.`,tt={id:"
|
|
52
|
+
This agent does NOT handle help/metadata requests such as listing available layers, listing field names/columns/attributes for a layer, or capability guidance.`,tt={id:"data-exploration-graph",name:"Data Exploration Graph Agent",description:et,createGraph:Ye,workspace:A},we=[X],at=e=>{if(!e||e.size===0)return"No layers available in this map.";let t=Array.from(e.values()).map(({layerItem:a,fieldRegistry:r},s)=>{let o=Array.from(r.values()).map(n=>n.name).slice(0,10).join(", "),i=r.size>10?` (and ${r.size-10} more)`:"";return`${s+1}. "${a.title}". Description: ${a.description}
|
|
53
53
|
Fields: ${o}${i}`}).join(`
|
|
54
54
|
|
|
55
55
|
`);return`This map contains ${e.size} layer(s):
|
|
@@ -69,4 +69,4 @@ ${t}`},st=e=>{let t=e?.list()??[];return t.length?t.map(a=>`- ${a.agent.name}: $
|
|
|
69
69
|
|
|
70
70
|
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 that the requested action is not supported.
|
|
71
71
|
_Example: "Create a chart"_
|
|
72
|
-
_Example: "Create a table"_`,ct={id:"
|
|
72
|
+
_Example: "Create a table"_`,ct={id:"help-graph",name:"Help Graph Agent",description:lt,createGraph:it,workspace:z},Xt=_,Kt=q,Yt=S,ea=d,ta=F,aa=Re,sa=pe,oa=Oe,ra=ue,na=de,ia=tt,la=ge,ca=ct,da=me,ga=$e,ma=()=>D(),ua=()=>H(),pa=async(e,t)=>await G(e,t),ha=async({modelTier:e="default",config:t}={})=>await O({modelTier:e,config:t});return{ArcgisKnowledgeAgent:da,DataExplorationAgent:na,DataExplorationGraphAgent:ia,HelpAgent:la,HelpGraphAgent:ca,LayerStylingAgent:ra,NavigationAgent:sa,NavigationGraphAgent:oa,Orchestrator:Te,cosineSimilarity:aa,createAgentRuntimeState:ma,createAgentRuntimeStateWithSharedState:ua,createChatModel:ha,createWebmapEmbeddings:ga,getEmbeddings:ta,invokeStructuredPrompt:Kt,invokeTextPrompt:Xt,invokeToolPrompt:Yt,sendTraceMessage:ea,sendUXSuggestion:pa}},"layers/FeatureLayer","core/reactiveUtils","identity/IdentityManager","portal/Portal","request","config",a,c,e,f,g,h,i,k,l,m,n,o,p,q,r,s,t,w,x)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{b as l}from"./FGQLS3UX.js";import"./QUZTFUWM.js";import"./H4ERKWFA.js";import{A as c,g as a,h as e,k as o,u as i,v as n,w as r}from"./2DYOTV7W.js";import"./UZLQALHY.js";export default $arcgis.t(([{watch:d}])=>{var g=a`.container{display:flex;align-items:center;width:100%;justify-content:space-between;gap:var(--calcite-spacing-xs)}.start,.end{display:flex;align-items:center;gap:var(--calcite-spacing-xs)}`,t=class extends r{constructor(){super(...arguments),this._messages=l({blocking:!0}),this._endRef=i(),this._showLog=!1,this.feedbackEnabled=!1,this.logEnabled=!1,this.copyEnabled=!1,this.readAloudEnabled=!1}static{this.properties={_showLog:16,feedbackEnabled:5,logEnabled:5,copyEnabled:5,readAloudEnabled:5,message:0}}static{this.styles=g}loaded(){this.manager.onLifecycle(()=>[d(()=>this._showLog,()=>this._scrollToEnd())])}_scrollToEnd(){requestAnimationFrame(()=>{this._endRef.value?.scrollIntoView({behavior:"smooth",block:"end"})})}_renderCopyButton(){return!this.message?.error&&this.copyEnabled?e`<calcite-action id=action-copy icon=copy-to-clipboard scale=s @click=${async()=>{try{let s=this.message?.content?.trim();s&&await navigator.clipboard.writeText(s)}catch(s){o("warn","assistant-message-footer","Failed to copy text to clipboard",{once:!0,detail:{error:s}})}}} text></calcite-action><calcite-tooltip reference-element=action-copy overlay-positioning=fixed placement=bottom><span>${this._messages.copyButtonLabel}</span></calcite-tooltip>`:null}_renderLogButton(){return this.message?.log?.length&&this.logEnabled?e`<calcite-action id=action-log icon=access-string-results scale=s @click=${()=>this._showLog=!this._showLog} .text=${this._messages.logButtonLabel} .active=${this._showLog}></calcite-action><calcite-tooltip reference-element=action-log overlay-positioning=fixed placement=bottom><span>${this._messages.logButtonLabel}</span></calcite-tooltip>`:null}_renderReadAloudButton(){return e`<arcgis-assistant-message-read-aloud .message=${this.message} .readAloudEnabled=${this.readAloudEnabled}></arcgis-assistant-message-read-aloud>`}_renderLog(){return e`<arcgis-assistant-message-log .log=${this.message?.log} .showLog=${this._showLog} .logEnabled=${this.logEnabled}></arcgis-assistant-message-log>`}_renderFeedback(){return e`<arcgis-assistant-message-feedback .message=${this.message} .feedbackEnabled=${this.feedbackEnabled}></arcgis-assistant-message-feedback>`}render(){return e`${this._renderLog()}<div class="container"><div class="start">${this._renderCopyButton()}${this._renderLogButton()}${this._renderReadAloudButton()}<slot name=footer-actions-start></slot></div><div class="end"><slot name=footer-actions-end></slot>${this._renderFeedback()}</div></div><div ${n(this._endRef)}></div>`}};c("arcgis-assistant-message-footer",t);return t},"core/reactiveUtils")
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{b as L,c as M}from"./UBKYXKMW.js";import{a as V}from"./4PKMJMND.js";import"./MCZJD3A4.js";import"./QUZTFUWM.js";import d from"./KONQTXBJ.js";import"./P4XZMBU5.js";import b from"./ZCFYGCCV.js";import{a as F,b as G,e as z}from"./ZA2WIUWH.js";import a from"./3F5EZZSG.js";import{e as $}from"./QZL4SAYR.js";import"./H4ERKWFA.js";import{A as q,w as D}from"./2DYOTV7W.js";import{c as U}from"./UCTC4JN4.js";import"./V7Y22FRP.js";import"./QRMRID2M.js";import"./AXTQU5YL.js";import{J as W,_ as E,ka as J}from"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import{Dd as c}from"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([Q,ie,{property:a,subclass:h},v,C,,,,,,,H,B])=>{var ae=Object.defineProperty,ce=Object.getOwnPropertyDescriptor,y=(e,t,o,s)=>{for(var r=s>1?void 0:s?ce(t,o):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(r=(s?i(t,o,r):i(r))||r);return s&&r&&ae(t,o,r),r},p=class extends C{constructor(e){super(e)}static fromJSON(e){return new p({id:e.id,sourceAnchorId:e.source_anchor_id,sourceNodeId:e.source_node_id,targetAnchorId:e.target_anchor_id,targetNodeId:e.target_node_id})}};y([a()],p.prototype,"id",2);y([a()],p.prototype,"sourceAnchorId",2);y([a()],p.prototype,"sourceNodeId",2);y([a()],p.prototype,"targetAnchorId",2);y([a()],p.prototype,"targetNodeId",2);p=y([h("Edge")],p);var pe=Object.defineProperty,de=Object.getOwnPropertyDescriptor,I=(e,t,o,s)=>{for(var r=s>1?void 0:s?de(t,o):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(r=(s?i(t,o,r):i(r))||r);return s&&r&&pe(t,o,r),r},d=class extends C{constructor(e){super(e)}async load(){return await Promise.resolve(this)}compile(e){return{runtimeNode:this.createRuntimeNode(),edges:e.outgoingEdges.map(t=>({from:this.id,to:t.targetNodeId}))}}static fromJSON(e){throw new Error("BaseNode is abstract and cannot be instantiated directly.")}};I([a()],d.prototype,"id",2);I([a()],d.prototype,"label",2);I([a()],d.prototype,"type",2);d=I([h("BaseNode")],d);function X(e){let t=new Set(e.required),o=Object.fromEntries(Object.entries(e.properties).map(([s,r])=>{let n=Y(r);return[s,t.has(s)?n:n.optional()]}));return c.object(o)}function Y(e){let t;switch(e.type){case"array":t=c.array(e.items?Y(e.items):c.unknown());break;case"boolean":t=c.boolean();break;case"number":t=c.number();break;case"object":t=X({properties:e.properties??{},required:e.required});break;case"string":t=e.enum?.length?c.enum(e.enum):c.string();break}return e.description?t.describe(e.description):t}var ue=Object.defineProperty,me=Object.getOwnPropertyDescriptor,j=(e,t,o,s)=>{for(var r=s>1?void 0:s?me(t,o):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(r=(s?i(t,o,r):i(r))||r);return s&&r&&ue(t,o,r),r},he=e=>e.replace(/_([a-z])/gu,(t,o)=>o.toUpperCase()),l=class extends C{constructor(e){super(e),this.type="arcgis-tool"}async createRuntimeTools(){if(!this.name)throw new Error("ArcgisTool name is required");return[await V(he(this.name))]}static fromJSON(e){return new l({name:e.name,requireApproval:e.require_approval})}};j([a()],l.prototype,"name",2);j([a()],l.prototype,"requireApproval",2);j([a()],l.prototype,"type",2);l=j([h("ArcgisTool")],l);var le=Object.defineProperty,ge=Object.getOwnPropertyDescriptor,Z=e=>{throw TypeError(e)},w=(e,t,o,s)=>{for(var r=s>1?void 0:s?ge(t,o):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(r=(s?i(t,o,r):i(r))||r);return s&&r&&le(t,o,r),r},fe=(e,t,o)=>t.has(e)||Z("Cannot "+o),ye=(e,t,o)=>t.has(e)?Z("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,o),we=(e,t,o)=>(fe(e,t,"access private method"),o),k,ee,u=class extends d{constructor(e){super(e),ye(this,k),this.type="agent-node"}createRuntimeNode(){let e;return async(t,o)=>{e??=we(this,k,ee).call(this);let s=await(await e).run(t,o),r=this.outputSchema?.safeParse(s);if(r&&!r.success)throw r.error;let n=r?.data,i=n??s.outputMessage;return{agentExecutionContext:s.agentExecutionContext,...n?{}:{outputMessage:s.outputMessage},status:s.status,summary:s.summary,nodes:{[this.id]:{output:i}}}}}compile(e){let t=e.outgoingEdges[0]?.targetNodeId;return{runtimeNode:this.createRuntimeNode(),edges:[{from:this.id,decide:o=>o.status==="failed"?void 0:t}],schemas:[c.object({output:this.outputSchema??c.string()})]}}static fromJSON(e){let t=new u({id:e.id,label:e.label,prompt:e.prompt?.content,type:"agent-node",modelTier:e.llm_model?.model_tier});return e.structured_output&&(t.outputSchema=X(e.structured_output)),t.tools=e.tools?.filter(o=>o.type==="arcgis_tool").map(o=>l.fromJSON(o)),t}};k=new WeakSet;ee=async function(){let e=this.prompt;if(!e?.trim())throw new Error(`WebAgent agent node "${this.id}" requires a prompt.`);let t=[];if(this.tools)for(let o of this.tools){let s=await o.createRuntimeTools();t.push(...s)}return new B({name:this.id,outputSchema:this.outputSchema,modelTier:this.modelTier,prompt:e,tools:t})};w([a()],u.prototype,"type",2);w([a()],u.prototype,"prompt",2);w([a()],u.prototype,"outputSchema",2);w([a()],u.prototype,"tools",2);w([a()],u.prototype,"modelTier",2);u=w([h("AgentNode")],u);var be=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,T=(e,t,o,s)=>{for(var r=s>1?void 0:s?Ne(t,o):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(r=(s?i(t,o,r):i(r))||r);return s&&r&&be(t,o,r),r},g=class extends d{constructor(e){super(e),this.type="end-message-node"}createRuntimeNode(){return async e=>{let t=await E.fromTemplate(this.message,{templateFormat:"mustache"}).format(e);return{outputMessage:t,status:"success",summary:t}}}compile(e){return{runtimeNode:this.createRuntimeNode(),edges:[]}}static fromJSON(e){let t=new g({id:e.id,label:e.label,type:"end-message-node"});return t.message=e.message,t}};T([a()],g.prototype,"type",2);T([a()],g.prototype,"message",2);g=T([h("EndMessageNode")],g);var Oe=Object.defineProperty,Se=Object.getOwnPropertyDescriptor,te=e=>{throw TypeError(e)},O=(e,t,o,s)=>{for(var r=s>1?void 0:s?Se(t,o):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(r=(s?i(t,o,r):i(r))||r);return s&&r&&Oe(t,o,r),r},ve=(e,t,o)=>t.has(e)||te("Cannot "+o),_e=(e,t,o)=>t.has(e)?te("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,o),K=(e,t,o)=>(ve(e,t,"access private method"),o),_,oe,re,m=class extends d{constructor(e){super(e),_e(this,_),this.type="human-in-the-loop-node",this.conditions=[]}createRuntimeNode(){return async(e,t)=>{let o=Ie(t,this.id),s=`${o}:${this.id}`,r=U(t);if(r===void 0||!Ae(r,this.response?.type))throw new W({agentId:o,id:s,kind:je(this.response?.type),message:await K(this,_,oe).call(this,e),metadata:K(this,_,re).call(this,e)});return{nodes:{[this.id]:{output:r}}}}}compile(e){return{runtimeNode:this.createRuntimeNode(),edges:[{from:this.id,decide:t=>{if(!this.conditions.length)return e.outgoingEdges[0]?.targetNodeId;let o=t.nodes?.[this.id]?.output,s=Ee(o),r=this.conditions.find(n=>n.outcome===s);if(r)return e.outgoingEdges.find(n=>n.sourceAnchorId===r.sourceAnchorId)?.targetNodeId}}]}}static fromJSON(e){let t=new m({id:e.id,label:e.label,type:"human-in-the-loop-node"});return t.message=e.message,t.response=e.response,t.conditions=e.conditions.map(({outcome:o,source_anchor_id:s})=>({outcome:o,sourceAnchorId:s})),t}};_=new WeakSet;oe=async function(e){if(this.message?.source==="generated")throw new Error(`Human-in-the-loop node "${this.id}" does not support generated messages yet.`);let t=this.message?.content;if(!t)throw new Error(`Human-in-the-loop node "${this.id}" requires a message content.`);return await E.fromTemplate(t,{templateFormat:"mustache"}).format(e)};re=function(e){let t=this.response;if(!t||t.type==="confirmation"||t.type==="textInput")return;let o=t.choices;return o?.source==="fixed"?o.items?.map(s=>s.value??s.label??""):o?.source==="reference"?Je(e,o.reference)?.map(String):void 0};O([a()],m.prototype,"type",2);O([a()],m.prototype,"message",2);O([a()],m.prototype,"response",2);O([a()],m.prototype,"conditions",2);m=O([h("HumanInTheLoopNode")],m);function Ie(e,t){let o=e?.configurable?.agentId;return typeof o=="string"&&o?o:t}function je(e){switch(e){case"singleSelect":return"singleSelection";case"multipleSelect":return"multipleSelection";case"textInput":return"textInput";default:return"booleanChoice"}}function Ae(e,t){switch(t){case"confirmation":return typeof e=="boolean";case"singleSelect":return typeof e=="string"||Array.isArray(e)&&e.length===1&&typeof e[0]=="string";case"multipleSelect":return Array.isArray(e)&&e.every(o=>typeof o=="string");case"textInput":return typeof e=="string";default:return!0}}function Ee(e){return e===!1?"dismissed":"confirmed"}function Je(e,t){if(!t)return;let o=t.split(".").reduce((s,r)=>{if(s&&typeof s=="object"&&r in s)return s[r]},e);return Array.isArray(o)?o:typeof o=="string"?[o]:void 0}var ke=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,se=(e,t,o,s)=>{for(var r=s>1?void 0:s?xe(t,o):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(r=(s?i(t,o,r):i(r))||r);return s&&r&&ke(t,o,r),r},N=class extends d{constructor(e){super(e),this.type="start-node"}createRuntimeNode(){return e=>({question:e.agentExecutionContext.userRequest})}static fromJSON(e){return new N({id:e.id,label:e.label,type:"start-node"})}};se([a()],N.prototype,"type",2);N=se([h("StartNode")],N);function Pe(e){switch(e.type){case"agent_node":return u.fromJSON(e);case"end_message_node":return g.fromJSON(e);case"human_input_node":return m.fromJSON(e);case"start_node":return N.fromJSON(e);default:throw new Error(`WebAgent node "${e.id}" uses unsupported type "${e.type}".`)}}function Ce(e={}){let t=Object.keys(e);if(F(t),t.includes("nodes"))throw new Error("node state cannot define reserved field: nodes.");let o=G(e);return J.Root({...o,nodes:J({reducer:(s,r)=>({...s,...r}),default:()=>({})}),...$()})}function ne(e,t={}){let o=new Set;for(let r of e)for(let n of Object.keys(r.shape??{}))n!=="nodes"&&o.add(n);let s=Object.fromEntries([...o].map(r=>[r,t[r]]));for(let[r,n]of Object.entries(t))s[r]=n;return Ce(s)}var x=class e{constructor(t,o,s){this.sourceJSON=t,this.edges=o,this.nodes=s,this._loaded=!1}static fromJSON(t){return new e(t,t.graph.edges.map(o=>p.fromJSON(o)),t.graph.nodes.map(o=>Pe(o)))}async load(){return this._loadPromise??=Promise.all(this.nodes.map(async t=>await t.load())).then(()=>{this._loaded=!0}),await this._loadPromise,this}getSchemas(){let t=Object.fromEntries(this._getNodeCompilations().flatMap((o,s)=>{let r=this.nodes[s];return o.schemas?.map(n=>[r.id,n])??[]}));return[c.object({loopCounts:c.record(c.string(),c.number()).optional(),nodes:c.object(t).partial().optional(),question:c.string().optional(),variables:this._getVariablesSchema()})]}generate(){this._assertLoaded(),this._nodeCompilations=void 0;let t=this._getNodeCompilations(),o=Object.fromEntries(this.sourceJSON.variables.map(({key:b,value:A})=>[b,A])),s=ne(this.getSchemas(),{variables:o}),r=this.nodes.find(b=>b.type==="start-node")?.id,n={},i=[];for(let[b,A]of this.nodes.entries()){let S=t[b];S&&(S.runtimeNode&&(n[A.id]=S.runtimeNode),i.push(...S.edges))}return{createGraph:()=>z(n,i,s,{entryNode:r}),workspace:s}}_assertLoaded(){if(!this._loaded)throw new Error("AgenticWorkflowRuntime must be loaded before it can generate a graph.")}_getNodeCompilations(){return this._assertLoaded(),this._nodeCompilations??=this.nodes.map(t=>t.compile({outgoingEdges:this.edges.filter(o=>o.sourceNodeId===t.id)}))}_getVariablesSchema(){return c.object(Object.fromEntries(this.sourceJSON.variables.map(({key:t})=>[t,c.unknown()])))}},Te=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,R=(e,t,o,s)=>{for(var r=s>1?void 0:s?Re(t,o):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(r=(s?i(t,o,r):i(r))||r);return s&&r&&Te(t,o,r),r},De=()=>{throw new Error("WebAgent must be loaded before it can run.")},f=class extends H{constructor(e){super(e)}async load(){if(this.portalItem){try{await this.portalItem.load()}catch(o){throw new v("web-agent:load-portal-item","Failed to load portal item",{error:o})}let t=await this.portalItem.fetchData();if(this.sourceJSON=t,!this.portalItem.title)throw new v("web-agent:missing-title","The portal item is missing a title")}if(!this.sourceJSON)throw new v("web-agent:missing-source-json","The source JSON is missing");if(!this.sourceJSON.description)throw new v("web-agent:missing-description","The source JSON is missing a description");let e=x.fromJSON(this.sourceJSON);return await e.load(),this._runtime=e,this.description=this.sourceJSON.description,this.name=this.portalItem?.title??`web-agent-${Date.now()}`,this.generate(),this}getSchemas(){return this._runtime?.getSchemas()??[]}generate(){if(!this._runtime){this._set("workspace",ne([])),this._set("createGraph",De);return}let{createGraph:e,workspace:t}=this._runtime.generate();this._set("workspace",t),this._set("createGraph",e)}};R([a({type:Q})],f.prototype,"portalItem",2);R([a()],f.prototype,"sourceJSON",2);f=R([h("WebAgent")],f);var P=class extends D{static{this.properties={agent:0,context:0,itemId:1,workflow:0}}#e;async getContext(){return L(this.context)?await this.context():this.context}async load(){let t;if(this.itemId){let o=ie.getDefault();t=new f({portalItem:new Q({id:this.itemId,portal:o})})}else this.workflow&&(t=new f({sourceJSON:this.workflow}));if(t&&(await t.load(),this.agent=t.registration),!this.agent)throw new Error("Failed to initialize the assistant agent because the agent registration is missing.");this.#e=M(this)}disconnectedCallback(){this.#e?.unregister(this.agent.id),super.disconnectedCallback()}};q("arcgis-assistant-agent",P);return P},"portal/PortalItem","portal/Portal","core/accessorSupport/decorators","core/Error","core/Accessor","identity/IdentityManager","request","config","core/reactiveUtils","layers/FeatureLayer",a,b,d)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import c from"./KONQTXBJ.js";import"./P4XZMBU5.js";import b from"./ZCFYGCCV.js";import"./ZA2WIUWH.js";import a from"./3F5EZZSG.js";import"./QZL4SAYR.js";import"./H4ERKWFA.js";import"./2DYOTV7W.js";import"./V7Y22FRP.js";import"./QRMRID2M.js";import"./AXTQU5YL.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,,a])=>{return a},a,b,c)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as l,b as S}from"./P4XZMBU5.js";import b from"./ZCFYGCCV.js";import{d as y,e as v}from"./ZA2WIUWH.js";import a from"./
|
|
2
|
+
import{a as l,b as S}from"./P4XZMBU5.js";import b from"./ZCFYGCCV.js";import{d as y,e as v}from"./ZA2WIUWH.js";import a from"./3F5EZZSG.js";import{c as d}from"./QRMRID2M.js";import{a as w,c as h}from"./AXTQU5YL.js";import{P as f,aa as u}from"./LOQ2PKV5.js";import{O as g}from"./IYLFJCJ2.js";export default $arcgis.t(([,,,{watch:A},,{property:m,subclass:k},{d:c},T])=>{var x=Object.defineProperty,b=Object.getOwnPropertyDescriptor,n=(e,r,t,o)=>{for(var s=o>1?void 0:o?b(r,t):r,i=e.length-1,p;i>=0;i--)(p=e[i])&&(s=(o?p(r,t,s):p(s))||s);return o&&s&&x(r,t,s),s},a=class extends T{constructor(e){super(e),this.modelTier="default"}initialize(){this.addHandles(A(()=>[this.description,this.inputSchema,this.modelTier,this.name,this.outputSchema,this.prompt,this.tools],()=>{this.generate()},{initial:!0,sync:!0}))}getSchemas(){return[this.inputSchema,this.outputSchema].filter(Boolean)}generate(){let e=this.prompt?u.fromTemplate(this.prompt).inputVariables:[],r=y(this.getSchemas(),e);this._set("workspace",r);let t=this.id,o={[t]:this._invoke.bind(this)},s=[{from:t,decide:()=>{}}];this._set("createGraph",()=>v(o,s,r,{agent:this,entryNode:t,middlewares:this.middlewares}))}async _invoke(e,r){try{return this.outputSchema?await this._invokeStructured(e,r):await this._invokeUnstructured(e,r)}catch(t){if(f(t))throw t;let o=t instanceof Error?t.message:String(t);return l({outputMessage:o},"failed",o)}}async _invokeStructured(e,r){if(!this.outputSchema)throw new Error("Output schema is required for structured invocation.");let t=await h({model:await c({modelTier:this.modelTier}),systemPrompt:await this._getPromptWithInputVariables(e),tools:this._getTools(),checkpointer:!0,middleware:d(this.middlewares),responseFormat:w(this.outputSchema)}).invoke({messages:e.agentExecutionContext.messages},r);if(!("structuredResponse"in t)||t.structuredResponse===void 0)throw new Error("LLMAgent did not receive structured output from createAgent.");return{...S(t.structuredResponse,this.outputSchema,t.messages),sharedResourceAdditions:_(t.messages)}}async _invokeUnstructured(e,r){let t=(await h({model:await c({modelTier:this.modelTier}),systemPrompt:await this._getPromptWithInputVariables(e),tools:this._getTools(),checkpointer:!0,middleware:d(this.middlewares)}).invoke({messages:e.agentExecutionContext.messages},r)).messages,o=t.at(-1)?.text??"",s=o.trim()||"LLMAgent completed.";return l({agentExecutionContext:{...e.agentExecutionContext,messages:t},outputMessage:o,sharedResourceAdditions:_(t)},"success",s)}async _getPromptWithInputVariables(e){return await u.fromTemplate(this.prompt).format(e)}_getTools(){return this.tools?.map(e=>"getTool"in e?e.getTool():e)??[]}};n([m()],a.prototype,"prompt",2);n([m()],a.prototype,"tools",2);n([m()],a.prototype,"inputSchema",2);n([m()],a.prototype,"outputSchema",2);n([m()],a.prototype,"modelTier",2);a=n([k("LLMAgent")],a);function _(e){let r=[];for(let t of e)if(g.isInstance(t)&&t.status!=="error"){let o=t.artifact;if(typeof o=="object"&&o!==null&&"sharedResourceAdditions"in o){let s=o.sharedResourceAdditions;if(Array.isArray(s))for(let i of s)r.push({kind:i.kind,description:i.description,payload:i.payload})}}return r}return a},"identity/IdentityManager","portal/Portal","request","core/reactiveUtils","layers/FeatureLayer","core/accessorSupport/decorators",a,b)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{a as r}from"./H4ERKWFA.js";function s(e,n){return n?typeof n=="string"?l(e,n)??null:n:r(e,"arcgis-map")??null}function c(e,n){return n?typeof n=="string"?l(e,n)??null:n:r(e,"arcgis-link-chart")??r(e,"arcgis-map")??null}function l(e,n){let i=n.includes("#")||n.includes(".")||n.includes("["),t=e.getRootNode();return(i?void 0:t.querySelector(`#${n}`))??t.querySelector(n)??void 0}export{s as a,c as b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import a from"./3F5EZZSG.js";import{p as x}from"./2DYOTV7W.js";import{a as m}from"./V7Y22FRP.js";import{P as F,Ya as q,ea as $,r as M,s as D}from"./LOQ2PKV5.js";import{Ia as A,ca as S,ta as C}from"./IYLFJCJ2.js";export default $arcgis.t(([G,z,U,B,Q,{a:k,b:f,c:v,e:_,f:W,g:I,h:L,o:H}])=>{var J=async t=>{let e=await K(),r=await k("default"),a=z.getDefault(),n=(await G.getCredential(`${a.url}/sharing`)).token,s={type:"generateEmbeddings",webmapEmbeddings:t,auth:{apiUrl:r,token:n}};return e.postMessage(s),await new Promise((d,i)=>{let o=c=>{c.data==="completed"&&(e.removeEventListener("message",o),d())},u=c=>{e.removeEventListener("message",o),i(c instanceof Error?c:new Error("Embeddings worker error"))};e.addEventListener("message",o),e.addEventListener("error",u,{once:!0})}),e},K=async()=>{{let t=(await import("./OKVLGJAG.js")).default;return new t}},V=t=>{t.currentIntent="none"},X=async(t,e)=>{let r=I(e),a=await v({path:"./assets/orchestrator/t9n",locale:f(e)});if(t.agentExecutionContext.userRequest){let s=new S(t.agentExecutionContext.userRequest.trim());t.agentExecutionContext.messages=[...t.agentExecutionContext.messages,s],V(t)}let n=r?.services.agentRegistry.list().map(s=>s.agent.id)??[];return await m({text:a.availableAgents.replace("{agentIds}",[...n].join(", "))},e),await m({text:a.analyzingUserInput},e),t},Y=async(t,e)=>{let r=await v({path:"./assets/orchestrator/t9n",locale:f(e)});return await m({text:r.exiting},e),t},j=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),Z=(t,e)=>{if(!j(t)){t!==void 0&&console.warn(`Agent "${e}" returned invalid sharedStatePatch. Ignoring it.`);return}let r={};for(let[a,n]of Object.entries(t)){if(!j(n)||!("value"in n)){console.warn(`Agent "${e}" returned invalid sharedStatePatch entry for key "${a}". Ignoring that entry.`);continue}r[a]={value:n.value}}return r},ee=t=>{let{previousSharedState:e,patch:r,agentId:a}=t;if(!r)return e;let n=Date.now(),s={...e};for(let[d,i]of Object.entries(r))i?.value!==void 0&&(s[d]={value:i.value,meta:{updatedByAgentId:a,updatedAt:n}});return s},te=256,ne=new Set(["point","polyline","polygon","extent","custom"]),re=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),ae=(t,e)=>{if(t===void 0)return;if(!Array.isArray(t)){console.warn(`Agent "${e}" returned invalid sharedResourceAdditions. Ignoring it.`);return}let r=[];for(let[a,n]of t.entries()){if(!re(n)||typeof n.kind!="string"||!ne.has(n.kind)||typeof n.description!="string"||!n.description.trim()||!("payload"in n)||n.payload===void 0){console.warn(`Agent "${e}" returned invalid sharedResourceAdditions entry at index ${a}. Ignoring that entry.`);continue}let s;try{s=structuredClone(n.payload)}catch{console.warn(`Agent "${e}" returned invalid sharedResourceAdditions entry at index ${a}. Ignoring that entry.`);continue}r.push({kind:n.kind,description:n.description.trim().slice(0,te),payload:s})}return r.length?r:void 0},se=t=>{let{previousSharedResources:e,additions:r,agentId:a}=t;if(!r?.length)return e;let n=Date.now(),s=r.map(d=>({...d,id:x(),meta:{createdByAgentId:a,createdAt:n}}));return[...e,...s].slice(-50)},P=t=>typeof t!="string"?void 0:t.trim()||void 0,ie=t=>{switch(t){case"failed":return"Agent failed without a summary.";case"unknown":return"Agent returned with unknown status.";case"success":return"Agent completed without a summary.";default:return"Agent completed without a summary."}},oe=(t,e)=>{let r=P(e?.outputMessage),a=P(e?.summary),n=e?.status,s=n==="success"||n==="failed"?n:"unknown";s==="unknown"&&console.warn(`Agent "${t}" returned missing/invalid status. Defaulting to "unknown".`);let d=Z(e?.sharedStatePatch,t),i=ae(e?.sharedResourceAdditions,t);return{outputMessage:r,summary:a??r??ie(s),status:s,sharedStatePatch:d,sharedResourceAdditions:i}},T=4e3,de=async(t,e)=>{let r=I(e),a=await v({path:"./assets/orchestrator/t9n",locale:f(e)});if(e?.signal?.aborted)return await m({text:a.runCancelledAgentExecution},e),{...t,currentIntent:"none",requiresFollowUp:!1};let{agentRegistry:n}=r?.services??{},s=n?.get(t.currentIntent);if(!s)return console.warn(a.noAgentFoundForIntent.replace("{intent}",t.currentIntent)),t;await m({text:a.executingRegisteredAgent.replace("{agentName}",s.agent.name)},e);let d={...e??{},metadata:{...e?.metadata,agentId:s.agent.id},configurable:{...r??{},agentId:s.agent.id,context:s.getContext?await s.getContext():void 0}},i;try{let c=await s.agent.createGraph().compile().invoke({agentExecutionContext:{...t.agentExecutionContext,messages:[...t.agentExecutionContext.messages],priorSteps:structuredClone(t.agentExecutionContext.priorSteps??[]),sharedState:structuredClone(t.agentExecutionContext.sharedState??{}),sharedResources:structuredClone(t.agentExecutionContext.sharedResources??[])}},d);i=oe(s.agent.name,c),await m({text:a.finishedExecutingRegisteredAgent.replace("{agentName}",s.agent.name)},e)}catch(c){if(F(c)||e?.signal?.aborted||c instanceof Error&&c.name==="AbortError")throw c;let g=c instanceof Error?c.message:String(c);console.error(`Agent "${s.agent.name}" failed:`,c),await m({text:a.registeredAgentFailed.replace("{agentName}",s.agent.name).replace("{error}",g)},e),i={status:"failed",outputMessage:a.agentExecutionFailed.replace("{error}",g),summary:a.agentExecutionFailed.replace("{error}",g)}}let o=i.outputMessage,u=[...t.agentExecutionContext.messages];if(o){let c=o.length>T?`${o.slice(0,T-14)}
|
|
3
|
+
[truncated]`:o;u.push(new C(c))}return{...t,stepCount:t.stepCount+1,lastExecutedAgent:s.agent.id,requiresFollowUp:i.status==="failed"?!0:t.requiresFollowUp,finalOutputMessage:o??"",agentExecutionContext:{...t.agentExecutionContext,messages:u,priorSteps:[...t.agentExecutionContext.priorSteps??[],{agentId:s.agent.id,assignedTask:t.agentExecutionContext.assignedTask,summary:i?.summary||a.noSummaryProvided,status:i?.status||"unknown"}],sharedState:ee({previousSharedState:t.agentExecutionContext.sharedState,patch:i.sharedStatePatch,agentId:s.agent.id}),sharedResources:se({previousSharedResources:t.agentExecutionContext.sharedResources,additions:i.sharedResourceAdditions,agentId:s.agent.id})}}},ce=async(t,e)=>{let r=await v({path:"./assets/orchestrator/t9n",locale:f(e)});if(t.routing.mode!=="direct")throw new Error(r.directAgentAssignmentRequiresDirectRouting);return await m({text:r.directRouteToAgent.replace("{agentId}",t.routing.agentId)},e),{...t,currentIntent:t.routing.agentId,requiresFollowUp:!1,agentExecutionContext:{...t.agentExecutionContext,assignedTask:t.agentExecutionContext.userRequest}}},ue=3,ge=t=>t.routing.mode==="direct"?"assignDirectAgent":"intentLLM",le=t=>t.routing.mode==="direct"||t.stepCount>=ue||!t.requiresFollowUp?"exit":"intentLLM",he=()=>new q(W).addNode("ingestInput",X).addNode("assignDirectAgent",ce).addNode("intentLLM",L).addNode("executeRegisteredAgent",de).addNode("exit",Y).addEdge(M,"ingestInput").addConditionalEdges("ingestInput",ge).addEdge("assignDirectAgent","executeRegisteredAgent").addConditionalEdges("intentLLM",t=>t.currentIntent==="none"||t.currentIntent===t.lastExecutedAgent?"exit":"executeRegisteredAgent").addConditionalEdges("executeRegisteredAgent",le).addEdge("exit",D),pe=(t,e)=>{let r=t.output?.usage_metadata??e.usage_metadata,a=t.output?.llmOutput?.tokenUsage,n=r?.input_tokens??a?.promptTokens,s=r?.output_tokens??a?.completionTokens,d=r?.total_tokens??a?.totalTokens;if(n===void 0||s===void 0||d===void 0)return;let i=r?.input_token_details?.cache_read,o=r?.output_token_details?.reasoning;return{input:n,output:s,total:d,...i!==void 0&&{cacheRead:i},...o!==void 0&&{reasoning:o}}},me=(t,e,r,a)=>{switch(t){case"chat_model":case"llm":return"model";case"tool":case"retriever":return t;case"chain":return!a||e==="LangGraph"?"workflow":r===e?"node":"chain";default:return}},ye=t=>{if(t instanceof Error)return{message:t.message,name:t.name};let e=t,r=typeof e?.message=="string"?e.message:String(t??"Unknown runtime error"),a=typeof e?.name=="string"?e.name:void 0;return{message:r,...a&&{name:a}}},we=({event:t,runId:e,parentSpanId:r,timestamp:a})=>{let n=/^on_(.+)_(start|end|error)$/u.exec(t.event);if(!n)return;let[,s,d]=n,i=t.metadata??{},o=i.langgraph_node,u=me(s,t.name,o,r);if(!u)return;let c=i.agentId,g=i.model??i.ls_model_name,h=t.data,l=d==="end"&&u==="model"?pe(h,i):void 0,y=t.tags?.includes("langsmith:hidden")||o==="__start__",p={...g&&{model:g},...l&&{tokenUsage:l},...y&&{internal:!0}},w={id:t.run_id,...r&&{parentId:r},label:t.name,type:u,...Object.keys(p).length&&{metadata:p}},R={runId:e,timestamp:a,type:"runtime",...c&&{agentId:c}};switch(d){case"start":return{...R,phase:"started",span:{...w,...h?.input!==void 0&&{input:h.input}}};case"end":return{...R,phase:"completed",span:{...w,...h?.output!==void 0&&{output:h.output}}};case"error":return{...R,phase:"failed",span:{...w,error:ye(h?.error)}};default:return}},E=class{constructor(){this.agentRegistry=new Map}register(e){let{agent:r}=e;if(this.agentRegistry.has(r.id))throw new Error(`Duplicate agent id: ${r.id}`);this.agentRegistry.set(r.id,e)}get(e){return this.agentRegistry.get(e)}list(){return[...this.agentRegistry.values()]}},b=class{constructor(e,r){this.graph=e,this.config={...r}}async waitForUser(){return await new Promise((e,r)=>{this.resolveWait=e,this.rejectWait=r})}handle(e,r){try{let a={agentId:e.agentId,id:e.id,payload:r},n=this.graph.streamEvents(null,{...this.config,configurable:{...this.config.configurable,hitlResponse:a},subgraphs:!0,version:"v2"});this.resolveWait?.(n)}catch(a){this.rejectWait?.(a)}finally{this.resolveWait=void 0,this.rejectWait=void 0}}cancel(){this.rejectWait&&(this.rejectWait(new Error("Request cancelled by user.")),this.resolveWait=void 0,this.rejectWait=void 0)}},fe=async t=>{try{return await(await _()).embedDocuments(t)}catch(e){throw console.error("Failed to generate embeddings:",e),e}},N=async(t,e)=>{let r=e.get(t);if(r)return r;let a=await fe([t]);return e.set(t,a[0]),a[0]};async function ve(t,e,r,a){let n=`req-${Date.now()}`,s={type:"layerSearch",precomputedEmbedding:a?await N(t,a):void 0,requestId:n,minScore:r};return await new Promise(d=>{let i=o=>{o.data.requestId===n&&d(o.data.results)};e.addEventListener("message",i,{once:!0}),e.postMessage(s)})}function Ee(t){let{worker:e}=t;return{async searchLayers({text:r,minScore:a,embeddingCache:n}){return await ve(r,e,a,n)}}}var Re=async({combinedQuery:t,layerIds:e,embeddingsWorker:r,minScore:a,topResults:n,embeddingCache:s})=>{let d=`req-${Date.now()}`,i=s?await N(t,s):void 0,o={type:"fieldSearch",layerIdForFieldsSearch:e,precomputedEmbedding:i,requestId:d,minScore:a,topResults:n};return await new Promise(u=>{let c=g=>{if(g.data.requestId!==d)return;let h=g.data.results.map(({layerId:l,results:y})=>({layerId:l,results:y}));u(h)};r.addEventListener("message",c,{once:!0}),r.postMessage(o)})};function xe(t){let{worker:e}=t;return{async searchFields({text:r,layerIds:a,minScore:n,topResults:s,embeddingCache:d}){return await Re({combinedQuery:r,layerIds:a,embeddingsWorker:e,minScore:n,topResults:s,embeddingCache:d})}}}var Ie=t=>{let e=H.safeParse(t);if(!e.success)throw new Error("Embeddings response validation failed. Regenerate embeddings.");return e.data},be=(t,e)=>{let r=new Map,a=new Map;if(e.allLayers.forEach(n=>{n instanceof B&&a.set(n.id,n)}),t.length!==a.size)throw new Error("Layer count mismatch during registry restoration. Regenerate embeddings.");for(let n of t){let s=a.get(n.id);if(!s)throw new Error(`Layer with ID ${n.id} not found in the original map during registry restoration. Regenerate embeddings.`);if(n.fields.length!==s.fields.length)throw new Error(`Field count mismatch for layer ID ${n.id} during registry restoration. Regenerate embeddings.`);let d={name:n.name,title:n.title,description:n.description},i=new Map;for(let o of n.fields){let u=s.fieldsIndex.get(o.name);if(!u)throw new Error(`Field with name ${o.name} not found in the original layer ${n.id} during registry restoration. Regenerate embeddings.`);i.set(o.name,{name:o.name,alias:s.getFieldAlias(o.name)??o.alias,description:o.description,type:u.type||"unknown",valueType:u.valueType||"unknown",domain:s.getFieldDomain(o.name)??void 0})}r.set(n.id,{layerItem:d,fieldRegistry:i})}return r},Se=async t=>{try{return(await Q(t,{responseType:"json"})).data}catch(e){throw new Error(`Failed to fetch data from ${t}: ${String(e)}`)}},Ce=async t=>{let e=t.map;if(!e?.portalItem)throw new Error("WebMap portal item is missing.");let{resources:r}=await e.portalItem.fetchResources(),a=r.find(s=>s.resource.path==="embeddings-v01.json");if(!a?.resource.url)throw new Error("Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.");let n=await Se(a.resource.url);return Ie(n)},O=class t{constructor(){this.orchestratorReady=!1,this.chatHistory=[],this.priorSteps=[],this.sharedState={},this.sharedResources=[],this.agentRegistry=new E,this.activeRunId="",this.cancelledRunIds=new Set,this.parentRunIds=new Map,this.activeRuntimeSpans=new Map,this.runtimeEventsEnabled=!1,this.streamEpoch=0}static async init(e){let r=new t;r.runtimeEventsEnabled=e.runtimeEventsEnabled??!1;try{if(e.view?.map){await U.whenOnce(()=>e.view.ready);let a=await Ce(e.view),n=be(a.layers,e.view.map);r.layersAndFieldsRegistry=n,r.embeddingsWorker=await J(a)}return e.agents?.forEach(a=>{r.agentRegistry.register(a)}),r.orchestratorReady=!0,r}catch(a){throw console.error("Orchestrator initialization failed:",a),a}}async*ask(e,r={}){if(!this.orchestratorReady)throw new Error("Orchestrator is not ready yet.");if(!this.agentRegistry.list().length)throw new Error("Orchestrator has no registered agents.");let a=this.createRequestAgentRegistry(r);if(!a.list().length)throw new Error("Orchestrator has no agents selected for this request.");if(++this.streamEpoch,!e.trim()&&!r.inputParts?.length)return;if(!e.trim()&&r.routing!=="direct")throw new Error("Requests containing only structured input require direct agent routing.");let n=x();this.parentRunIds.clear(),this.activeRuntimeSpans.clear(),this.activeRunId=n,this.activeAbortController=new AbortController,this.graph||(this.graph=he().compile({checkpointer:new $}));let s=this.embeddingsWorker?Ee({worker:this.embeddingsWorker}):void 0,d=this.embeddingsWorker?xe({worker:this.embeddingsWorker}):void 0,i=new Map,o=r.routing==="direct"?{mode:"direct",agentId:r.agentId}:{mode:"auto"},u={thread_id:n,locale:r.locale??"en",hitlResponse:null,services:{layerSearch:s,fieldSearch:d,layersAndFieldsRegistry:this.layersAndFieldsRegistry,agentRegistry:a,embeddingCache:i}},c={version:"v2",streamMode:"custom",signal:this.activeAbortController.signal,...this.runtimeEventsEnabled&&{callbacks:[this.createHierarchyCallback()]},configurable:u,subgraphs:!0},g=this.graph?.streamEvents({routing:o,agentExecutionContext:{userRequest:e,inputParts:[...r.inputParts??[]],messages:this.chatHistory,priorSteps:this.priorSteps,sharedState:this.sharedState,sharedResources:this.sharedResources}},c),h=++this.streamEpoch;if(yield*this.pipeStream(g,h,n),this.isRunCancelled(n)){yield*this.createCancellationEvents(n);return}for(;;){if(this.isRunCancelled(n)){yield*this.createCancellationEvents(n);return}let y=(await this.graph.getState(c,{subgraphs:!0})).tasks.find(p=>p.interrupts.length>0)?.interrupts[0]?.value;if(!y)break;this.currentInterrupt=y,this.interruptHandler=new b(this.graph,c),yield*this.closeActiveRuntimeSpans(n,"interrupted"),yield{runId:n,timestamp:Date.now(),type:"interrupt",interrupt:y};try{let p=await this.interruptHandler.waitForUser(),w=++this.streamEpoch;yield*this.pipeStream(p,w,n)}catch(p){if(this.isRunCancelled(n)){yield*this.createCancellationEvents(n);return}if(p){yield{runId:n,timestamp:Date.now(),type:"error",error:{message:p?.message}};return}}}if(this.isRunCancelled(n)){yield*this.createCancellationEvents(n);return}let l=(await this.graph.getState(c,{subgraphs:!0})).values;if(this.isRunCancelled(n)){yield*this.createCancellationEvents(n);return}this.chatHistory=l.agentExecutionContext.messages.length?l.agentExecutionContext.messages:this.chatHistory,this.priorSteps=l.agentExecutionContext.priorSteps?.slice(-5)??[],this.sharedState=l.agentExecutionContext.sharedState??{},this.sharedResources=l.agentExecutionContext.sharedResources??[],yield{runId:n,timestamp:Date.now(),type:"completed",result:{content:l.finalOutputMessage}}}newConversation(){this.chatHistory=[],this.priorSteps=[],this.sharedState={},this.sharedResources=[]}resumeInterrupt(e){if(!this.currentInterrupt||!this.interruptHandler)throw new Error("No pending interrupt to resume.");this.interruptHandler.handle(this.currentInterrupt,e)}cancelInterrupt(){this.interruptHandler&&this.interruptHandler.cancel()}cancel(){this.activeRunId&&(this.cancelledRunIds.add(this.activeRunId),this.activeAbortController?.abort(),++this.streamEpoch,this.interruptHandler?.cancel())}async*pipeStream(e,r,a){try{for await(let n of e){if(this.isRunCancelled(a)||r!==this.streamEpoch)break;if(this.runtimeEventsEnabled){let s=we({event:n,runId:a,parentSpanId:this.parentRunIds.get(n.run_id),timestamp:Date.now()});s&&(s.phase==="started"?this.activeRuntimeSpans.set(s.span.id,s):this.activeRuntimeSpans.delete(s.span.id),yield s)}n.event==="on_custom_event"&&n.name==="trace_message"?yield{runId:a,timestamp:Date.now(),type:"trace",data:n.data}:n.name==="graph_ux_suggestion"&&(yield{runId:a,timestamp:Date.now(),type:"ux-suggestion",suggestion:n.data})}}catch(n){if(!this.isRunCancelled(a))throw n}}*createCancellationEvents(e){yield*this.closeActiveRuntimeSpans(e,"cancelled"),yield{runId:e,timestamp:Date.now(),type:"cancelled",reason:"user"}}*closeActiveRuntimeSpans(e,r){let a=Date.now(),n=[...this.activeRuntimeSpans.values()].reverse();this.activeRuntimeSpans.clear();for(let s of n){let{input:d,...i}=s.span;yield{type:"runtime",phase:r,runId:e,timestamp:a,...s.agentId&&{agentId:s.agentId},span:i}}}createHierarchyCallback(){let e=(r,a)=>{a&&this.parentRunIds.set(r,a)};return A.fromMethods({handleLLMStart:(r,a,n,s)=>e(n,s),handleChatModelStart:(r,a,n,s)=>e(n,s),handleChainStart:(r,a,n,s)=>e(n,s),handleToolStart:(r,a,n,s)=>e(n,s),handleRetrieverStart:(r,a,n,s)=>e(n,s)})}isRunCancelled(e){return this.cancelledRunIds.has(e)}createRequestAgentRegistry(e){let r=e.routing==="direct"?[e.agentId]:e.agentIds,a=r?r.map(s=>{let d=this.agentRegistry.get(s);if(!d)throw new Error(`Agent is not registered: ${s}`);return d}):this.agentRegistry.list(),n=new E;return a.forEach(s=>n.register(s)),n}dispose(){this.sharedResources=[],this.embeddingsWorker&&(this.embeddingsWorker.terminate(),this.embeddingsWorker=void 0),this.orchestratorReady=!1}};return{a:fe,b:O}},"identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request",a)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import n from"./PTEKX5TX.js";import m from"./ZLLVPKDN.js";import{a as o,c as p}from"./UBKYXKMW.js";import"./4PKMJMND.js";import l from"./VWP2B4LB.js";import"./5Q2XRQS6.js";import k from"./K7YQIJFT.js";import j from"./UT6JA4TK.js";import h from"./CA3RNGPN.js";import g from"./ES54NWOB.js";import f from"./CCC6LBMY.js";import"./34O57OGV.js";import"./LXPGQNXQ.js";import"./FDOMMK2M.js";import e from"./WVP73XWD.js";import"./Z5XQLSYH.js";import"./OZAZ277H.js";import d from"./AVRS6UCQ.js";import"./K5JVB6FU.js";import"./FCI6M62J.js";import"./BFZ5S7NF.js";import"./MCZJD3A4.js";import"./QUZTFUWM.js";import c from"./3F5EZZSG.js";import"./QZL4SAYR.js";import"./H4ERKWFA.js";import"./WXQ26G5Q.js";import"./MJSIYEWN.js";import b from"./JNOH4PD5.js";import a from"./KA3S22NQ.js";import"./ONQ6JSBJ.js";import{A as r,w as i}from"./2DYOTV7W.js";import"./V7Y22FRP.js";import"./AXTQU5YL.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,,,,,,m])=>{var t=class extends i{constructor(){super(...arguments),this.agent=m}static{this.properties={referenceElement:1}}#t;#i;getContext(){if(!this.#t)throw new Error("arcgis-assistant-data-exploration-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=o(this,"arcgis-assistant-data-exploration-agent"),this.#i=p(this)}disconnectedCallback(){this.#i?.unregister(this.agent.id),super.disconnectedCallback()}};r("arcgis-assistant-data-exploration-agent",t);return t},"identity/IdentityManager","portal/Portal","request","config","core/reactiveUtils","layers/FeatureLayer","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",a,b,c,d,e,f,g,h,j,k,l,m,n)
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as e,b as n}from"./7HVK7G55.js";import"./ESPC6NTI.js";import{A as c,g as o,h as r,w as s}from"./2DYOTV7W.js";import"./UZLQALHY.js";var l=o`.container{border-radius:var(--calcite-border-radius);margin-bottom:var(--calcite-spacing-md)}.block{margin:0;background-color:var(--calcite-color-foreground-1);width:100%;max-height:300px;overflow:auto}.entry{margin-left:var(--calcite-spacing-sm);padding:var(--calcite-spacing-xxs) var(--calcite-spacing-lg);border-left:1px solid var(--calcite-color-border-1)}`,i=class extends s{constructor(){super(...arguments),this.logEnabled=!1,this.showLog=!1}static{this.properties={logEnabled:5,showLog:5,log:[1,{type:Array}]}}static{this.styles=l}render(){return this.log?.length&&this.showLog&&this.logEnabled?r`<div class="container"><div class="block"><calcite-accordion appearance=transparent icon-position=start icon-type=chevron scale=s>${this.log.map(a=>{let t=a.includes(`
|
|
3
|
+
`)||a.length>70;return r`<calcite-accordion-item .heading=${t?`${a.substring(0,70)}...`:a} .expanded=${t}><div class="entry">${t?e(n(a)):null}</div></calcite-accordion-item>`})}</calcite-accordion></div></div>`:null}};c("arcgis-assistant-message-log",i);export{i as ArcgisAssistantMessageLog};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{b as n}from"./FGQLS3UX.js";import"./QUZTFUWM.js";import"./H4ERKWFA.js";import{A as e,g as i,h as a,w as t}from"./2DYOTV7W.js";import"./UZLQALHY.js";var r=i`:host{display:contents}.icon{padding:var(--calcite-spacing-sm);border-radius:var(--calcite-spacing-xl);background:var(--calcite-color-brand);color:var(--calcite-color-foreground-1)}.loading-container{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm);padding:0 var(--calcite-spacing-sm)}.loading{display:flex;align-items:center;gap:var(--calcite-spacing-sm)}.text{font-style:italic;word-wrap:break-word;word-break:break-all;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;line-clamp:1;-webkit-box-orient:vertical}.skeleton-block{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm);width:100%}.skeleton-text{display:block;height:.95em;border-radius:var(--calcite-border-radius);background:linear-gradient(90deg,color-mix(in srgb,var(--calcite-color-foreground-2) 65%,transparent),color-mix(in srgb,var(--calcite-color-foreground-3) 85%,transparent),color-mix(in srgb,var(--calcite-color-foreground-2) 65%,transparent));background-size:200% 100%;animation:assistant-message-loading-shimmer 1.2s ease-in-out infinite;width:85%}.skeleton-text:last-child{width:70%}@keyframes assistant-message-loading-shimmer{0%{background-position:-150% 0}to{background-position:150% 0}}@media(prefers-reduced-motion){.skeleton-text{animation:none}}`,s=class extends t{constructor(){super(...arguments),this._messages=n({blocking:!0}),this.loading=!1,this.loadingMessage="",this.assistantAvatarEnabled=!1}static{this.properties={loading:5,loadingMessage:1,assistantAvatarEnabled:5,interrupts:0}}static{this.styles=r}render(){return this.loading?a`<arcgis-assistant-message .assistantAvatarEnabled=${this.assistantAvatarEnabled} footer-disabled>${this.assistantAvatarEnabled?a`<slot name=icon slot=icon><calcite-icon class="icon" icon=effects scale=s></calcite-icon></slot>`:null}<slot name=content slot=content><arcgis-assistant-interrupt-preview .interrupts=${this.interrupts}></arcgis-assistant-interrupt-preview><div class="loading-container"><div class="loading"><calcite-loader .label=${this._messages.loadingLabel} inline></calcite-loader><div class="text">${this.loadingMessage}</div></div><div class="skeleton-block"><span class="skeleton-text"></span><span class="skeleton-text"></span></div></div></slot></arcgis-assistant-message>`:null}};e("arcgis-assistant-message-loading",s);export{s as ArcgisAssistantMessageLoading};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import p from"./EWO73MJA.js";import"./XQ3NBBQ3.js";import n from"./ZLLVPKDN.js";import{a as o,c as m}from"./UBKYXKMW.js";import"./4PKMJMND.js";import l from"./VWP2B4LB.js";import"./5Q2XRQS6.js";import k from"./K7YQIJFT.js";import j from"./UT6JA4TK.js";import h from"./CA3RNGPN.js";import g from"./ES54NWOB.js";import f from"./CCC6LBMY.js";import"./34O57OGV.js";import"./LXPGQNXQ.js";import"./FDOMMK2M.js";import e from"./WVP73XWD.js";import"./Z5XQLSYH.js";import"./OZAZ277H.js";import d from"./AVRS6UCQ.js";import"./K5JVB6FU.js";import"./FCI6M62J.js";import"./BFZ5S7NF.js";import"./MCZJD3A4.js";import"./QUZTFUWM.js";import c from"./3F5EZZSG.js";import"./QZL4SAYR.js";import"./H4ERKWFA.js";import"./WXQ26G5Q.js";import"./MJSIYEWN.js";import b from"./JNOH4PD5.js";import a from"./KA3S22NQ.js";import"./ONQ6JSBJ.js";import{A as r,w as i}from"./2DYOTV7W.js";import"./V7Y22FRP.js";import"./AXTQU5YL.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,,,,,,{b:p}])=>{var t=class extends i{constructor(){super(...arguments),this.agent=p}static{this.properties={referenceElement:1}}#t;#i;getContext(){if(!this.#t)throw new Error("arcgis-assistant-layer-styling-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=o(this,"arcgis-assistant-layer-styling-agent"),this.#i=m(this)}disconnectedCallback(){this.#i?.unregister(this.agent.id),super.disconnectedCallback()}};r("arcgis-assistant-layer-styling-agent",t);return t},"identity/IdentityManager","portal/Portal","request","config","core/reactiveUtils","layers/FeatureLayer","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",a,b,c,d,e,f,g,h,j,k,l,n,p)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import a from"./ZLLVPKDN.js";export default $arcgis.t(([{a:e}])=>{var t=[async()=>(await import("./EJ7QJLUE.js")).default,async()=>(await import("./IMRIVNHX.js")).default],s=e({id:"data-exploration",name:"Data Exploration Agent",description:"Explores feature-layer data and applies data-driven map filters using on-demand query and filter skills.",skillLoaders:t,modelTier:"default",systemPrompt:"You are an ArcGIS data exploration agent.",instructions:"Answer only questions about the current map's layers, features, fields, spatial relationships, or supported map actions, using returned tool results. Do not answer unrelated general-knowledge, advice, opinion, political, health, security, or other non-map requests, even when the user asks for this agent. For an unsupported request, respond only: 'I can help with questions about the data and features in this map.' Report directly relevant findings, requested calculations, and limitations that affect the answer. Do not provide unsolicited advice about dataset design, publishing, classification, grouping, future analysis, or alternative questions. Ask a clarifying question only when a map-related request cannot be answered reliably as written. A request can require both query and filter skills. Treat show, display, highlight, map, filter, reveal, emphasize, include, or exclude as visual map intent when the request targets matching features. For visual map intent, do not stop after query. First use query to identify/count the matching features, then load the filter skill and call setFeatureEffect with the same layer, where clause, geometry filter, extent setting, or object IDs. Use only tool results to describe data or map changes."});return s},a)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{A as r,g as t,h as e,u as i,v as a,w as n}from"./2DYOTV7W.js";import"./UZLQALHY.js";export default $arcgis.t(([l,{when:o,watch:c}])=>{var h=t`.messages-container{display:flex;flex:1;flex-direction:column;line-height:var(--calcite-font-line-height-relative-snug)}.messages-list{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;gap:var(--calcite-spacing-xxl);flex:1 1 auto;min-height:0;justify-content:flex-end;overflow:auto}.end-ref{margin-top:var(--calcite-spacing-lg)}`,s=class extends n{constructor(){super(...arguments),this.#t=i(),this.#s=!1,this.loading=!1,this.messages=new l([]),this.interrupt=null}static{this.properties={loading:5,messages:0,interrupt:0}}static{this.styles=h}#t;#s;firstUpdated(){this.#e()}loaded(){this.manager.onLifecycle(()=>[this.messages.on("change",()=>{this.#e()}),o(()=>!this.loading,()=>{this.#s=!1}),c(()=>[this.loading,this.interrupt],()=>this.#e())])}#e(){requestAnimationFrame(()=>{this.#s||this.#t.value?.scrollIntoView({behavior:"smooth",block:"end"})})}#i(){this.#s=!0}render(){return e`<div class="messages-container" @wheel=${this.#i}><div class="messages-list"><slot name=message-starter></slot><slot name=messages></slot><slot name=message-loading></slot></div><div class="end-ref" ${a(this.#t)}></div></div>`}};r("arcgis-assistant-chat",s);return s},"core/Collection","core/reactiveUtils")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import b from"./
|
|
2
|
+
import b from"./ZLLVPKDN.js";import{a}from"./ONQ6JSBJ.js";export default $arcgis.t(([{a:o}])=>{var n=({config:t})=>{let{mapView:e}=a(t,["mapView"]),r=e.map,i=Number.isFinite(e.zoom)?e.zoom:void 0;return JSON.stringify({availableBookmarks:r.bookmarks?.map(({name:s})=>s).filter(Boolean)??[],currentZoom:i},null,2)},l=[async()=>(await import("./CFAC4FN3.js")).default],c=o({id:"navigation",name:"Navigation Agent",description:"Navigates the map for explicit zoom, center, address, bookmark, layer, feature, extent, scale, and viewpoint requests. Use for questions asking where a place is or to resolve an address or place as a reusable spatial anchor for a proximity request. Resolves only the location; it does not query, display, filter, or highlight feature data.",skillLoaders:l,modelTier:"default",systemPrompt:"You are an ArcGIS map navigation agent.",runtimeContextLoader:n});return c},b)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{A as o,g as i,h as s,w as n}from"./2DYOTV7W.js";import"./UZLQALHY.js";var c=i`:host{display:block}`,e=class extends n{static{this.properties={block:0}}static{this.styles=c}_renderSuggestedPrompts(t){if(t.type!=="suggested-prompts")return null;let r=t.data?.prompts,a=Array.isArray(r)?r.filter(p=>typeof p=="string"):[];return a.length?s`<arcgis-assistant-suggested-prompts .prompts=${a}></arcgis-assistant-suggested-prompts>`:null}_renderBlock(t){switch(t.type){case"suggested-prompts":return this._renderSuggestedPrompts(t);case"text":return s`<arcgis-assistant-message-text .content=${t.data?.content} .parts=${t.data?.parts}></arcgis-assistant-message-text>`;default:return null}}render(){return this.block?this._renderBlock(this.block):null}};o("arcgis-assistant-message-block",e);export{e as ArcgisAssistantMessageBlock};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as s,b as i}from"./
|
|
2
|
+
import{a as s,b as i}from"./MCZJD3A4.js";import{a as r}from"./H4ERKWFA.js";function c(e,n){let t=s(e.el,e.referenceElement);if(t)return t;let o=r(e.el,"arcgis-assistant"),a=s(e.el,o?.referenceElement);if(a)return a;throw new Error(`${n}: Reference element not found`)}function g(e,n){let t=c(e,n).view;if(!t)throw new Error(`${n}: Reference element does not have a view`);return t}function m(e){return typeof e=="function"}function w(e){let n=r(e.el,"arcgis-assistant");if(n===void 0)throw new Error("arcgis-assistant-agent must be used within an arcgis-assistant element");return n.register({agent:e.agent,getContext:async()=>await e.getContext?.()??e.context??{}}),n}function f(e){let n=i(e.el,e.referenceElement);if(n)return n;let t=r(e.el,"arcgis-assistant");return s(e.el,t?.referenceElement)||null}function E(e){let n=f(e);return n?n.view:null}export{g as a,m as b,w as c,E as d};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{b as d}from"./FGQLS3UX.js";import"./QUZTFUWM.js";import"./H4ERKWFA.js";import{A as p,g as n,h as e,n as l,u as r,v as i,w as h,x as u}from"./2DYOTV7W.js";import"./UZLQALHY.js";var _=n`:host{padding:var(--calcite-spacing-md);background:var(--calcite-panel-background-color, var(--calcite-color-background))}calcite-panel{border-radius:var(--calcite-dialog-corner-radius, var(--calcite-corner-radius-sm));border:0 solid var(--calcite-color-brand);border-block-start-width:4px;box-shadow:var(--calcite-shadow-md);width:100%;--calcite-panel-border-color: none}.interrupt-content{padding:0 var(--calcite-spacing-md);background:var(--calcite-color-foreground-1)}.other-input calcite-input[disabled]{pointer-events:none}.last-option{--calcite-list-border-color: transparent}`,o=class extends h{constructor(){super(...arguments),this.#e=r(),this.#t=r(),this._messages=d({blocking:!0}),this._selectedOptions=[],this._otherValue="",this._otherSelected=!1,this.arcgisCancel=l(),this.arcgisSubmit=l()}static{this.properties={_selectedOptions:16,_otherValue:16,_otherSelected:16,type:1,message:1,options:[1,{type:Array}]}}static{this.styles=_}#e;#t;_isSubmitDisabled(){return this._otherSelected?!this._otherValue.trim():!this._selectedOptions.length}_getSubmitValue(){return typeof this._selectedOptions=="string"?this._otherSelected?this._otherValue.trim():this._selectedOptions:this._selectedOptions.concat(this._otherSelected?this._otherValue.trim():[])}_getSkipValue(){return this.type==="multi-select"?[]:""}_selectOtherOption(){this._otherSelected||(this._otherSelected=!0,this.type!=="multi-select"&&(this._selectedOptions=""),this._focusOtherInput())}_handleSingleSelectChange(t){let s=this._otherSelected;this._otherSelected=t.target.selectedItems[0]===this.#t.value,this._selectedOptions=this._otherSelected?"":t.target.selectedItems[0]?.value,this._otherSelected&&!s&&this._focusOtherInput()}_handleMultiSelectChange(t){let s=this._otherSelected,a=this.#t.value;this._otherSelected=a?t.target.selectedItems.includes(a):!1,this._selectedOptions=t.target.selectedItems.filter(c=>c!==a).map(c=>c.value),this._otherSelected&&!s&&this._focusOtherInput()}async _focusOtherInput(){await this.updateComplete,await this.#e.value?.setFocus()}_renderOptions(){return this.options?.map((t,s)=>e`<calcite-list-item class=${u({"last-option":s===this.options.length-1})} .label=${t} .value=${t}></calcite-list-item>`)}_renderOtherInput(){return e`<div slot=content class="other-input" @click=${t=>{t.stopPropagation(),this._selectOtherOption()}}><calcite-input .label=${this._messages.otherLabel} .placeholder=${this._messages.otherLabel} .disabled=${!this._otherSelected} @calciteInputInput=${t=>this._otherValue=t.target.value} ${i(this.#e)}></calcite-input></div>`}_renderInterruptOptions(){switch(this.type){case"single-select":return e`<calcite-list selection-mode=single-persist .label=${this._messages.optionsLabel} @calciteListChange=${t=>this._handleSingleSelectChange(t)}>${this._renderOptions()}<calcite-list-item .selected=${this._otherSelected} ${i(this.#t)}>${this._renderOtherInput()}</calcite-list-item></calcite-list>`;case"multi-select":return e`<calcite-list selection-mode=multiple .label=${this._messages.optionsLabel} @calciteListChange=${t=>this._handleMultiSelectChange(t)}>${this._renderOptions()}<calcite-list-item .selected=${this._otherSelected} ${i(this.#t)}>${this._renderOtherInput()}</calcite-list-item></calcite-list>`;case"boolean-choice":return null;case"text-input":return e`<calcite-input .label=${this._messages.enterTextLabel} @calciteInputInput=${t=>this._selectedOptions=t.target.value}></calcite-input>`}}render(){return e`<calcite-panel .description=${this.message}><div class="interrupt-content">${this._renderInterruptOptions()}</div>${this.type==="boolean-choice"?e`<calcite-button slot=footer-end appearance=outline @click=${()=>this.arcgisSubmit.emit(!1)}>${this._messages.declineButtonLabel}</calcite-button><calcite-button slot=footer-end appearance=solid @click=${()=>this.arcgisSubmit.emit(!0)}>${this._messages.approveButtonLabel}</calcite-button>`:e`<calcite-button slot=footer-end appearance=outline @click=${()=>this.arcgisSubmit.emit(this._getSkipValue())}>${this._messages.skipButtonLabel}</calcite-button><calcite-button slot=footer-end appearance=solid .disabled=${this._isSubmitDisabled()} @click=${()=>this.arcgisSubmit.emit(this._getSubmitValue())}>${this._messages.submitButtonLabel}</calcite-button>`}</calcite-panel>`}};p("arcgis-assistant-interrupt",o);export{o as ArcgisAssistantInterrupt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{b as o}from"./FGQLS3UX.js";import"./QUZTFUWM.js";import"./H4ERKWFA.js";import{A as n,g as a,h as e,n as i,w as c}from"./2DYOTV7W.js";import"./UZLQALHY.js";var r=a`.actions{display:flex;flex-direction:row;gap:var(--calcite-spacing-xs)}`,t=class extends c{constructor(){super(...arguments),this._messages=o({blocking:!0}),this.feedbackEnabled=!1,this.arcgisFeedback=i()}static{this.properties={feedbackEnabled:5,message:0}}static{this.styles=r}_handleFeedback(s){this.message&&(this.message.feedback=this.message.feedback?.positive===s?void 0:{positive:s},this.arcgisFeedback.emit(this.message),this.requestUpdate())}_getFeedback(){return this.message?.feedback?.positive}_renderThumbsUpButton(){return e`<calcite-action id=action-thumbs-up icon=thumbs-up scale=s .active=${this._getFeedback()===!0} @click=${()=>this._handleFeedback(!0)} text></calcite-action><calcite-tooltip reference-element=action-thumbs-up overlay-positioning=fixed placement=bottom><span>${this._messages.thumbsUpLabel}</span></calcite-tooltip>`}_renderThumbsDownButton(){return e`<calcite-action id=action-thumbs-down icon=thumbs-down scale=s .active=${this._getFeedback()===!1} @click=${()=>this._handleFeedback(!1)} text></calcite-action><calcite-tooltip reference-element=action-thumbs-down overlay-positioning=fixed placement=bottom><span>${this._messages.thumbsDownLabel}</span></calcite-tooltip>`}render(){return this.feedbackEnabled&&!this.message?.error?e`<div class="actions">${this._renderThumbsUpButton()}${this._renderThumbsDownButton()}</div>`:null}};n("arcgis-assistant-message-feedback",t);export{t as ArcgisAssistantMessageFeedback};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{b as g}from"./FGQLS3UX.js";import"./QUZTFUWM.js";import"./H4ERKWFA.js";import{A as h,h as u,w as c}from"./2DYOTV7W.js";import"./UZLQALHY.js";export default $arcgis.t(([{watch:_},y,{property:m,subclass:f}])=>{var A=Object.defineProperty,S=Object.getOwnPropertyDescriptor,p=(e,s,i,a)=>{for(var r=a>1?void 0:a?S(s,i):s,t=e.length-1,n;t>=0;t--)(n=e[t])&&(r=(a?n(s,i,r):n(r))||r);return a&&r&&A(s,i,r),r};function l(){return typeof window>"u"?null:window}var o=class extends y{constructor(){super(...arguments),this._utterance=null,this.state="idle",this.supported=o.isSupported()}destroy(){this.stop(),super.destroy()}start(e){let s=e.trim(),i=l(),a=i?.SpeechSynthesisUtterance,r=i?.speechSynthesis;if(this._set("supported",o.isSupported(i)),!s||!a||!r)return;this.stop();let t=new a(s);t.rate=.9,t.pitch=1.1,t.volume=1,t.onend=()=>{this._utterance===t&&this._reset()},t.onerror=()=>{this._utterance===t&&this._reset()};try{r.speak(t),this._utterance=t,this._set("state","playing")}catch{t.onend=null,t.onerror=null,this._reset()}}stop(){let e=l(),s=e?.speechSynthesis;if(this._set("supported",o.isSupported(e)),s)try{(s.speaking||s.pending)&&s.cancel()}catch{}this._reset()}toggle(e){if(this.state==="playing"){this.stop();return}this.start(e)}static isSupported(e=l()){return!!e?.speechSynthesis&&typeof e.SpeechSynthesisUtterance=="function"}_reset(){this._utterance&&(this._utterance.onend=null,this._utterance.onerror=null),this._utterance=null,this._set("state","idle")}};p([m({readOnly:!0})],o.prototype,"state",2);p([m({readOnly:!0})],o.prototype,"supported",2);o=p([f("ReadAloudController")],o);var d=class extends c{constructor(){super(...arguments),this._messages=g({blocking:!0}),this._readAloudController=new o,this.readAloudEnabled=!1}static{this.properties={readAloudEnabled:5,message:0}}loaded(){this.manager.onLifecycle(()=>[_(()=>this._readAloudController.state,()=>this.requestUpdate(),{initial:!0}),{remove:()=>{this._readAloudController.stop()}}])}_toggleReadAloud(){this._readAloudController.toggle(this.message?.content??"")}render(){return this.readAloudEnabled&&!this.message?.error&&this.message?.content?.trim()&&this._readAloudController.supported?u`<calcite-action id=action-read-aloud .icon=${this._readAloudController.state==="playing"?"sound-off":"sound"} scale=s .active=${this._readAloudController.state==="playing"} @click=${()=>this._toggleReadAloud()} text></calcite-action><calcite-tooltip reference-element=action-read-aloud overlay-positioning=fixed placement=bottom><span>${this._readAloudController.state==="playing"?this._messages.stopReadingButtonLabel:this._messages.readAloudButtonLabel}</span></calcite-tooltip>`:null}};h("arcgis-assistant-message-read-aloud",d);return d},"core/reactiveUtils","core/Accessor","core/accessorSupport/decorators")
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import p from"./QDOKDRBB.js";import n from"./ZLLVPKDN.js";import{a as o,c as m}from"./UBKYXKMW.js";import"./4PKMJMND.js";import l from"./VWP2B4LB.js";import"./5Q2XRQS6.js";import k from"./K7YQIJFT.js";import j from"./UT6JA4TK.js";import h from"./CA3RNGPN.js";import g from"./ES54NWOB.js";import f from"./CCC6LBMY.js";import"./34O57OGV.js";import"./LXPGQNXQ.js";import"./FDOMMK2M.js";import e from"./WVP73XWD.js";import"./Z5XQLSYH.js";import"./OZAZ277H.js";import d from"./AVRS6UCQ.js";import"./K5JVB6FU.js";import"./FCI6M62J.js";import"./BFZ5S7NF.js";import"./MCZJD3A4.js";import"./QUZTFUWM.js";import c from"./3F5EZZSG.js";import"./QZL4SAYR.js";import"./H4ERKWFA.js";import"./WXQ26G5Q.js";import"./MJSIYEWN.js";import b from"./JNOH4PD5.js";import a from"./KA3S22NQ.js";import"./ONQ6JSBJ.js";import{A as r,w as i}from"./2DYOTV7W.js";import"./V7Y22FRP.js";import"./AXTQU5YL.js";import"./LOQ2PKV5.js";import"./IYLFJCJ2.js";import"./VXFQANGJ.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,,,,,,p])=>{var t=class extends i{constructor(){super(...arguments),this.agent=p}static{this.properties={referenceElement:1}}#t;#i;getContext(){if(!this.#t)throw new Error("arcgis-assistant-navigation-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=o(this,"arcgis-assistant-navigation-agent"),this.#i=m(this)}disconnectedCallback(){this.#i?.unregister(this.agent.id),super.disconnectedCallback()}};r("arcgis-assistant-navigation-agent",t);return t},"identity/IdentityManager","portal/Portal","request","config","core/reactiveUtils","layers/FeatureLayer","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",a,b,c,d,e,f,g,h,j,k,l,n,p)
|