@arcgis/ai-components 5.1.0-next.6 → 5.1.0-next.61

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.
Files changed (103) hide show
  1. package/dist/cdn/24MYCR6F.js +3 -0
  2. package/dist/cdn/{ZYQ6U2YH.js → 344C2EEF.js} +29 -1
  3. package/dist/cdn/4ZJM5GT4.js +2 -0
  4. package/dist/cdn/AAEEDEN7.js +348 -0
  5. package/dist/cdn/B4DEC7PH.js +2 -0
  6. package/dist/cdn/{CN6VFVA2.js → BSIB6MUI.js} +1 -0
  7. package/dist/cdn/DLTK3ENO.js +2 -0
  8. package/dist/cdn/ETKNVWKV.js +2 -0
  9. package/dist/cdn/{UY4FI7AP.js → H3DVSYQV.js} +1 -1
  10. package/dist/cdn/IUMTWQJI.js +2 -0
  11. package/dist/cdn/JPYSTYTV.js +2 -0
  12. package/dist/cdn/KVH3PDVW.js +2 -0
  13. package/dist/cdn/NN7QKIMP.js +2 -0
  14. package/dist/cdn/NXIQDF7N.js +2 -0
  15. package/dist/cdn/O5QYUL5C.js +2 -0
  16. package/dist/cdn/RBFFW5ZM.js +109 -0
  17. package/dist/cdn/{62K6RJZZ.js → SA7B3M2J.js} +1 -1
  18. package/dist/cdn/TTLSUI5H.js +2 -0
  19. package/dist/cdn/UGJXHTYH.js +67 -0
  20. package/dist/cdn/UX7NRZPV.js +2 -0
  21. package/dist/cdn/{NKNUZCLA.js → W2A22QZU.js} +15 -0
  22. package/dist/cdn/WO6WO3SH.js +3 -0
  23. package/dist/cdn/WRENCTR3.js +4 -0
  24. package/dist/cdn/X34ZV777.js +225 -0
  25. package/dist/cdn/XI5SV3HJ.js +47 -0
  26. package/dist/cdn/{WBSNYWJJ.js → YGW7TUNX.js} +1 -1
  27. package/dist/cdn/ZLYDPB4L.js +2 -0
  28. package/dist/cdn/index.js +1 -1
  29. package/dist/cdn/main.css +1 -1
  30. package/dist/chunks/converterUtils.js +117 -0
  31. package/dist/chunks/utils.js +16 -14
  32. package/dist/chunks/utils2.js +8 -3
  33. package/dist/components/arcgis-assistant/customElement.d.ts +286 -23
  34. package/dist/components/arcgis-assistant/customElement.js +172 -142
  35. package/dist/components/arcgis-assistant/index.js +2 -1
  36. package/dist/components/arcgis-assistant/types.d.ts +97 -0
  37. package/dist/components/arcgis-assistant-agent/customElement.d.ts +22 -8
  38. package/dist/components/arcgis-assistant-agent/customElement.js +7 -7
  39. package/dist/components/arcgis-assistant-chat/customElement.d.ts +8 -6
  40. package/dist/components/arcgis-assistant-chat/customElement.js +14 -14
  41. package/dist/components/arcgis-assistant-chat-card/customElement.d.ts +12 -5
  42. package/dist/components/arcgis-assistant-chat-card/customElement.js +59 -25
  43. package/dist/components/arcgis-assistant-chat-card/index.js +2 -0
  44. package/dist/components/arcgis-assistant-chat-card-content/customElement.js +14 -12
  45. package/dist/components/arcgis-assistant-chat-card-content/index.js +1 -0
  46. package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +5 -2
  47. package/dist/components/arcgis-assistant-chat-entry/customElement.js +42 -20
  48. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.d.ts +73 -6
  49. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +5 -5
  50. package/dist/components/arcgis-assistant-help-agent/customElement.d.ts +73 -0
  51. package/dist/components/arcgis-assistant-help-agent/customElement.js +26 -0
  52. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +1 -1
  53. package/dist/components/arcgis-assistant-interrupt/customElement.js +8 -8
  54. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +6 -6
  55. package/dist/components/arcgis-assistant-navigation-agent/customElement.d.ts +53 -6
  56. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +5 -5
  57. package/dist/components/arcgis-assistant-shell/customElement.d.ts +3 -0
  58. package/dist/components/arcgis-assistant-shell/customElement.js +12 -11
  59. package/dist/docs/api.json +1 -1
  60. package/dist/docs/docs.json +1 -1
  61. package/dist/docs/vscode.html-custom-data.json +1 -1
  62. package/dist/docs/web-types.json +1 -1
  63. package/dist/index.d.ts +15 -7
  64. package/dist/loader.js +9 -10
  65. package/dist/types/lumina.d.ts +17 -13
  66. package/dist/types/preact.d.ts +18 -15
  67. package/dist/types/react.d.ts +19 -17
  68. package/dist/types/stencil.d.ts +17 -13
  69. package/dist/utils/index.d.ts +305 -0
  70. package/dist/utils/index.js +13 -0
  71. package/package.json +15 -8
  72. package/dist/cdn/26V7SXDR.js +0 -4
  73. package/dist/cdn/2PLHSU7P.js +0 -271
  74. package/dist/cdn/4Y73V2HU.js +0 -2
  75. package/dist/cdn/6T2EIYO4.js +0 -59
  76. package/dist/cdn/AIAY4NON.js +0 -245
  77. package/dist/cdn/GCFT45CD.js +0 -2
  78. package/dist/cdn/GN2HYJJX.js +0 -4
  79. package/dist/cdn/HN2HMAMX.js +0 -28
  80. package/dist/cdn/I22GHLAO.js +0 -2
  81. package/dist/cdn/IFSNQY7L.js +0 -2
  82. package/dist/cdn/IFWK7P7O.js +0 -2
  83. package/dist/cdn/J35M7O4J.js +0 -2
  84. package/dist/cdn/JABDBJPC.js +0 -2
  85. package/dist/cdn/KJZARHAM.js +0 -2
  86. package/dist/cdn/M672SFG6.js +0 -2
  87. package/dist/cdn/M7XUI5KY.js +0 -77
  88. package/dist/cdn/Q674OE2M.js +0 -2
  89. package/dist/cdn/SOWNHB7F.js +0 -30
  90. package/dist/cdn/VUHDKXFM.js +0 -2
  91. package/dist/cdn/X7WF7TCS.js +0 -2
  92. package/dist/cdn/XGVAPO3I.js +0 -2
  93. package/dist/cdn/XVUE27HC.js +0 -2
  94. package/dist/cdn/Y7UZYXEV.js +0 -2
  95. package/dist/cdn/ZF7JAW4Z.js +0 -2
  96. package/dist/components/arcgis-assistant-layer-filter-agent/customElement.d.ts +0 -8
  97. package/dist/components/arcgis-assistant-layer-filter-agent/customElement.js +0 -26
  98. package/dist/components/arcgis-assistant-layer-query-agent/customElement.d.ts +0 -8
  99. package/dist/components/arcgis-assistant-layer-query-agent/customElement.js +0 -26
  100. package/dist/components/arcgis-assistant-layer-query-agent/index.d.ts +0 -1
  101. package/dist/components/arcgis-assistant-layer-query-agent/index.js +0 -1
  102. /package/dist/components/{arcgis-assistant-layer-filter-agent → arcgis-assistant-help-agent}/index.d.ts +0 -0
  103. /package/dist/components/{arcgis-assistant-layer-filter-agent → arcgis-assistant-help-agent}/index.js +0 -0
@@ -0,0 +1,3 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import"./CFDTXKJ6.js";var o=`(function(){"use strict";const h=(a,r)=>{if(a.length!==r.length)throw new Error("Vectors must be the same length");let c=0,t=0,e=0;for(let n=0;n<a.length;++n){const s=a[n],l=r[n];c+=s*l,t+=s*s,e+=l*l}const i=Math.sqrt(t*e);if(i===0)return 0;const m=c/i;return Math.max(-1,Math.min(1,m))},f=(a,r,c=.6)=>{const t=[],e=[...a];for(;t.length<r&&e.length>0;){let i=-1,m=-1/0;for(let n=0;n<e.length;n++){const s=e[n].score,l=t.length===0?0:Math.max(...t.map(o=>h(e[n].vector,o.vector))),d=c*s-(1-c)*l;d>m&&(m=d,i=n)}t.push(e[i]),e.splice(i,1)}return t.map(({name:i,score:m})=>({name:i,score:m}))};let p=[];const u=new Map,v=12,y=10,M=a=>{p=a.layers.map(r=>({id:r.id,vector:r.vector}))},E=a=>{u.clear();for(const r of a.layers){const c=r.fields.map(t=>({name:t.name,vector:t.vector}));u.set(r.id,c)}};globalThis.addEventListener("message",a=>{(async()=>{const{type:r,webmapEmbeddings:c,layerIdForFieldsSearch:t=[],requestId:e,precomputedEmbedding:i,minScore:m=0,topResults:n=v}=a.data;switch(r){case"generateEmbeddings":{c&&(M(c),E(c)),globalThis.postMessage("completed");break}case"layerSearch":{if(p.length>0)try{const s=p.map(o=>({id:o.id,vector:o.vector,score:h(i,o.vector)})),d=f(s.map(o=>({name:o.id,vector:o.vector,score:o.score})),y).map(({name:o,score:b})=>({id:o,score:b}));globalThis.postMessage({requestId:e,results:d})}catch(s){globalThis.postMessage({requestId:e,results:[],error:s instanceof Error?s.message:"Calculation error"})}else globalThis.postMessage({requestId:e,results:[],error:"Layer embeddings not initialized"});break}case"fieldSearch":{if(t.length>0)try{const s=t.map(l=>{const d=u.get(l);if(!d)return{layerId:l,results:[]};const o=d.map(g=>({name:g.name,vector:g.vector,score:h(i,g.vector)})).filter(({score:g})=>g>=m),b=f(o,n);return{layerId:l,results:b}});globalThis.postMessage({requestId:e,results:s})}catch(s){globalThis.postMessage({requestId:e,results:[],error:s instanceof Error?s.message:"Field search calculation error"})}break}default:console.warn("Unknown message type:",r)}})()})})();
3
+ `,r=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",o],{type:"text/javascript;charset=utf-8"});function a(t){let e;try{if(e=r&&(self.URL||self.webkitURL).createObjectURL(r),!e)throw"";let s=new Worker(e,{name:t?.name});return s.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),s}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(o),{name:t?.name})}}export{a as default};
@@ -27,7 +27,35 @@ Validator: Before producing output, verify every field used exists in the listed
27
27
 
28
28
  ## Input
29
29
 
30
- Use the most recent relevant user question from the chat history. The question will **not** be restated again here. Start with a fresh WHERE clause for each question - do not inherit filters from previous questions unless user explicitly asks to combine them.
30
+ Use the most recent relevant user question from the chat history.
31
+
32
+ ### Fresh WHERE clause rule
33
+
34
+ Start with a fresh WHERE clause for each new question. Do not inherit filters from previous questions UNLESS the user explicitly references previous results (see "Referencing Previously Identified Features" below).
35
+
36
+ ### Rules for generating WHERE clause SQL expressions:
37
+
38
+ - Use only the field's **\`name\`** in the output expression.
39
+ - Use metadata (\`alias\`, \`description\`, \`statistics\`) only to help understand the user's meaning \u2014 not in the syntax.
40
+ - Use field \`type\` to choose appropriate operators:
41
+ - **String** \u2192 \`LIKE '%value%'\`, \`=\`, \`IN (...)\` (prefer \`LIKE\` over \`=\`)
42
+ - **Number/Date** \u2192 \`=\`, \`<\`, \`>\`, \`BETWEEN\`, etc.
43
+ - Use fields with the **highest \`relevanceScore\`**.
44
+ - DO NOT use subqueries or \`SELECT\` keyword.
45
+ - Combine conditions with \`AND\`, \`OR\`, or \`NOT\` as appropriate.
46
+ - **Coded-value domain fields** \u2192 Always use the numeric/string **code** in WHERE clauses, never the domain name. Domain values are listed under each field as \`code=name\` pairs
47
+ - **Range domain fields** \u2192 Use the listed min/max as valid bounds for comparisons.
48
+ - If no meaningful layer filter can be generated, do not call a tool.
49
+
50
+ ## Referencing Previously Identified Features
51
+
52
+ This is an exception to the "fresh WHERE clause" rule above.
53
+
54
+ When the user uses words like "these", "those", "them", "the same ones" referring to features from a previous turn:
55
+
56
+ - If the previous query used useCurrentExtent: true \u2192 use useCurrentExtent: true with where: "1=1"
57
+ - If the previous assistant response mentions specific objectIds or feature IDs \u2192 use {{objectIdField}} IN (id1, id2, ...) to scope to those features
58
+ - If neither is available, use the same WHERE clause and layer from the previous query turn to re-select the same features
31
59
 
32
60
  ### Mixed Questions
33
61
 
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{a as o,b as l}from"./UGJXHTYH.js";import{g as i,h as t,v as c,w as a,z as r}from"./WRENCTR3.js";import"./CFDTXKJ6.js";var d=i`.assistant-chat-card-content__skeleton-block{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm);width:100%}.assistant-chat-card-content__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-chat-card-content-shimmer 1.2s ease-in-out infinite;width:85%}.assistant-chat-card-content__skeleton-text:last-child{width:70%}@keyframes assistant-chat-card-content-shimmer{0%{background-position:-150% 0}to{background-position:150% 0}}@media(prefers-reduced-motion){.assistant-chat-card-content__skeleton-text{animation:none}}.assistant-chat-card-content__text-container{padding:0 var(--calcite-spacing-sm);display:flex;flex-direction:column;gap:var(--calcite-spacing-sm);color:var(--calcite-color-text-1)}.assistant-chat-card-content__text-container pre{background-color:var(--calcite-color-foreground-1);padding:var(--calcite-spacing-sm);border-radius:var(--calcite-border-radius);color:var(--calcite-color-text-1);direction:ltr;max-width:100%;overflow:auto}.assistant-chat-card-content__text-container pre code{display:block;white-space:pre;font-family:var(--calcite-code-family)}.assistant-chat-card-content__loading-container{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm)}.assistant-chat-card-content__loading{display:flex;align-items:center;gap:var(--calcite-spacing-sm)}.assistant-chat-card-content__text-loading{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}.assistant-chat-card-content__error-notice{padding:var(--calcite-spacing-sm)}`,n="assistant-chat-card-content",e={textLoading:`${n}__text-loading`,skeletonBlock:`${n}__skeleton-block`,skeletonText:`${n}__skeleton-text`},s=class extends c{constructor(){super(...arguments),this.loading=!1,this.type="text"}static{this.properties={loading:5,type:1,content:1,loadingMessage:1}}static{this.styles=d}_renderText(){return t`<div class="assistant-chat-card-content__text-container">${this.loading?t`<div class="assistant-chat-card-content__loading-container"><div class="assistant-chat-card-content__loading"><calcite-loader label=loading inline></calcite-loader><div class=${a(e.textLoading)}>${this.loadingMessage}</div></div><div class=${a(e.skeletonBlock)}><span class=${a(e.skeletonText)}></span><span class=${a(e.skeletonText)}></span></div></div>`:t`<div>${o(l(this.content))}</div>`}</div>`}_renderError(){return t`<calcite-notice class="assistant-chat-card-content__error-notice" open icon kind=warning width=auto><div slot=message>${this.content}</div></calcite-notice>`}render(){switch(this.type){case"text":return this._renderText();case"error":return this._renderError();default:return t`<p>Unsupported content type</p>`}}};r("arcgis-assistant-chat-card-content",s);export{s as ArcgisAssistantChatCardContent};