@arcgis/ai-components 5.1.0-next.1 → 5.1.0-next.10

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 (82) hide show
  1. package/dist/cdn/23GCULB3.js +2 -0
  2. package/dist/cdn/2ONRE3WR.js +254 -0
  3. package/dist/cdn/46Q4W2ZL.js +2 -0
  4. package/dist/cdn/{4Y73V2HU.js → AGZUEMOX.js} +1 -1
  5. package/dist/cdn/{CN6VFVA2.js → BSIB6MUI.js} +1 -0
  6. package/dist/cdn/{UY4FI7AP.js → D6OOXTNF.js} +1 -1
  7. package/dist/cdn/ERJNZQMY.js +3 -0
  8. package/dist/cdn/H7JJSHT3.js +2 -0
  9. package/dist/cdn/IUB4PSH4.js +2 -0
  10. package/dist/cdn/J6OV6O5C.js +2 -0
  11. package/dist/cdn/JJPTDO6D.js +2 -0
  12. package/dist/cdn/JVR66VPL.js +3 -0
  13. package/dist/cdn/MYKSIL6I.js +2 -0
  14. package/dist/cdn/NVDWHOOS.js +2 -0
  15. package/dist/cdn/{M7XUI5KY.js → OBS3OCJ2.js} +3 -3
  16. package/dist/cdn/OJUEJ4RT.js +2 -0
  17. package/dist/cdn/PQHYDFCL.js +2 -0
  18. package/dist/cdn/RIURC4BZ.js +2 -0
  19. package/dist/cdn/{JOZLOFW3.js → TEDYCCIK.js} +104 -105
  20. package/dist/cdn/{26V7SXDR.js → VG7GKLZR.js} +1 -1
  21. package/dist/cdn/VMDUJD33.js +2 -0
  22. package/dist/cdn/{NKNUZCLA.js → W2A22QZU.js} +15 -0
  23. package/dist/cdn/WAO4LVNK.js +67 -0
  24. package/dist/cdn/WFEBJPQ4.js +2 -0
  25. package/dist/cdn/ZGRFMSA2.js +2 -0
  26. package/dist/cdn/index.js +1 -1
  27. package/dist/cdn/main.css +1 -1
  28. package/dist/chunks/converterUtils.js +117 -0
  29. package/dist/chunks/utils.js +12 -14
  30. package/dist/chunks/utils2.js +3 -2
  31. package/dist/components/arcgis-assistant/customElement.d.ts +29 -11
  32. package/dist/components/arcgis-assistant/customElement.js +143 -126
  33. package/dist/components/arcgis-assistant/types.d.ts +29 -0
  34. package/dist/components/arcgis-assistant-chat/customElement.d.ts +8 -6
  35. package/dist/components/arcgis-assistant-chat/customElement.js +12 -12
  36. package/dist/components/arcgis-assistant-chat-card/customElement.d.ts +12 -5
  37. package/dist/components/arcgis-assistant-chat-card/customElement.js +59 -25
  38. package/dist/components/arcgis-assistant-chat-card/index.js +2 -0
  39. package/dist/components/arcgis-assistant-chat-card-content/customElement.js +14 -12
  40. package/dist/components/arcgis-assistant-chat-card-content/index.js +1 -0
  41. package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +5 -2
  42. package/dist/components/arcgis-assistant-chat-entry/customElement.js +42 -20
  43. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +5 -5
  44. package/dist/components/arcgis-assistant-help-agent/customElement.d.ts +33 -0
  45. package/dist/components/arcgis-assistant-help-agent/customElement.js +26 -0
  46. package/dist/components/arcgis-assistant-help-agent/index.d.ts +1 -0
  47. package/dist/components/arcgis-assistant-help-agent/index.js +1 -0
  48. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +1 -1
  49. package/dist/components/arcgis-assistant-interrupt/customElement.js +8 -8
  50. package/dist/components/arcgis-assistant-layer-filter-agent/customElement.js +2 -2
  51. package/dist/components/arcgis-assistant-layer-query-agent/customElement.js +11 -11
  52. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +6 -6
  53. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +5 -5
  54. package/dist/components/arcgis-assistant-shell/customElement.d.ts +3 -0
  55. package/dist/components/arcgis-assistant-shell/customElement.js +12 -11
  56. package/dist/docs/api.json +1 -1
  57. package/dist/docs/docs.json +1 -1
  58. package/dist/docs/vscode.html-custom-data.json +1 -1
  59. package/dist/docs/web-types.json +1 -1
  60. package/dist/index.d.ts +16 -0
  61. package/dist/loader.js +8 -7
  62. package/dist/types/lumina.d.ts +19 -5
  63. package/dist/types/preact.d.ts +20 -5
  64. package/dist/types/react.d.ts +21 -5
  65. package/dist/types/stencil.d.ts +19 -5
  66. package/package.json +8 -6
  67. package/dist/cdn/AF7UTDDE.js +0 -4
  68. package/dist/cdn/AQZDEJJZ.js +0 -2
  69. package/dist/cdn/FVVYK5KV.js +0 -2
  70. package/dist/cdn/GCFT45CD.js +0 -2
  71. package/dist/cdn/GLPXJC3A.js +0 -2
  72. package/dist/cdn/I22GHLAO.js +0 -2
  73. package/dist/cdn/IFWK7P7O.js +0 -2
  74. package/dist/cdn/KJZARHAM.js +0 -2
  75. package/dist/cdn/KSJNIOUZ.js +0 -2
  76. package/dist/cdn/M672SFG6.js +0 -2
  77. package/dist/cdn/Q674OE2M.js +0 -2
  78. package/dist/cdn/SLRL7NB7.js +0 -239
  79. package/dist/cdn/VUHDKXFM.js +0 -2
  80. package/dist/cdn/XVUE27HC.js +0 -2
  81. package/dist/cdn/ZIHS43OH.js +0 -2
  82. package/dist/cdn/ZV2N427X.js +0 -2
@@ -1,4 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as b}from"./UY4FI7AP.js";import a from"./JOZLOFW3.js";import{a as f}from"./I22GHLAO.js";import"./WBSNYWJJ.js";import{g as y,h,n as g,o as u,p as v,t as _}from"./26V7SXDR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([E,{whenOnce:k,watch:L,when:S},O,P,{property:c,subclass:C},{y:w}])=>{var H=y`:host{height:100%}`,M=Object.defineProperty,x=Object.getOwnPropertyDescriptor,n=(l,t,e,r)=>{for(var s=r>1?void 0:r?x(t,e):t,a=l.length-1,o;a>=0;a--)(o=l[a])&&(s=(r?o(t,e,s):o(s))||s);return r&&s&&M(t,e,s),s},i=class extends P{constructor(l){super(l),this.view=null,this.loading=!1,this.processing=!1,this.processingStep=""}async load(){this._set("loading",!0);try{await this._initialize()}finally{this._set("loading",!1)}}destroy(){this.orchestrator?.dispose(),super.destroy()}async _initialize(){this.removeHandles(),await Promise.all([this.portal.load(),this.view?.when()]),this.view&&await k(()=>!this.view.updating),this._set("orchestrator",await w.init({agents:[...this.agents],portal:this.portal,view:this.view??void 0})),this.addHandles([L(()=>[this.view,this.agents],()=>void this._initialize())])}async*ask(l,t){if(!this.orchestrator)throw new Error("Orchestrator not initialized yet.");this._set("processing",!0),this._set("processingStep","");let e="";try{let r=this.orchestrator.ask(l);for await(let s of r){if(t?.aborted){yield{type:"cancelled"};break}switch(s.type){case"trace":{this._set("processingStep",s.data.text),e+=`${s.data.text}
3
-
4
- `;break}case"completed":{if(!s.result.content.length){yield{type:"completed",error:"Could not process the request.",log:e};return}let a=s.result.content;this._set("processingStep",""),yield{type:"completed",response:a,log:e};return}case"interrupt":{console.log("Orchestrator interrupt:",s);let{kind:a,message:o,metadata:m}=s.interrupt,p=Array.isArray(m)?[...m]:[],$=(()=>{switch(a){case"booleanChoice":return{type:"boolean-choice",message:o,options:p};case"singleSelection":return{type:"single-select",message:o,options:p};case"multipleSelection":return{type:"multi-select",message:o,options:p};case"textInput":return{type:"text-input",message:o};default:return{type:a,message:o,options:p}}})();this._set("processingStep","Waiting for user input..."),yield{type:"interrupt",payload:$};break}case"cancelled":{yield{type:"cancelled"};return}default:{console.warn("Unknown event type:",s);break}}}}catch(r){console.warn("Error during message processing:",r),yield{type:"completed",error:"An error occurred during message processing.",log:e};return}finally{this._set("processing",!1)}}};n([c({readOnly:!0})],i.prototype,"orchestrator",2);n([c()],i.prototype,"agents",2);n([c()],i.prototype,"portal",2);n([c()],i.prototype,"view",2);n([c({readOnly:!0})],i.prototype,"loading",2);n([c({readOnly:!0})],i.prototype,"processing",2);n([c({readOnly:!0})],i.prototype,"processingStep",2);i=n([C("OrchestratorController")],i);var d=class extends v{constructor(){super(...arguments),this._messages=b({blocking:!0}),this.#e=g(),this.#s=g(),this.#t=null,this.#r=null,this.#a=new Map,this.#i=t=>{t.stopPropagation(),this.orchestrator?.cancelInterrupt(),this._interrupt=null},this.#o=t=>{t.stopPropagation();let e=t.detail;this.orchestrator?.resumeInterrupt(e),this._interrupt=null},this.#n=t=>{t.stopPropagation(),this.suggestedPrompts=[];let e=t.detail;this.#h(e)},this.#l=t=>{if(t.stopPropagation(),this._interrupt){this.orchestrator?.cancelInterrupt(),this._interrupt=null;return}this.#r?.abort()},this._interrupt=null,this._chatHistory=new E([]),this._error=null,this.referenceElement=null,this.portal=new O,this.suggestedPrompts=[]}static{this.properties={_interrupt:16,_chatHistory:16,_error:16,orchestrator:32,entryMessage:1,heading:1,description:1,referenceElement:1,portal:0,suggestedPrompts:0}}static{this.styles=H}#e;#s;#t;#r;#a;#i;#o;#n;#l;get orchestrator(){return this.#t?.orchestrator}register(t){this.#a.set(t.agent.id,t)}load(){this.manager.onLifecycle(()=>()=>{this.#r?.abort(),this._interrupt=null,this._chatHistory.removeAll(),this._error=null})}loaded(){this.manager.onLifecycle(()=>{this.#e.value?.addEventListener("arcgisSubmit",this.#n),this.#e.value?.addEventListener("arcgisCancel",this.#l);let t=S(()=>!!this._interrupt&&!!this.#s.value,()=>{let e=this.#s.value;e.removeEventListener("arcgisSubmit",this.#o),e.removeEventListener("arcgisCancel",this.#i),e.addEventListener("arcgisSubmit",this.#o,{once:!0}),e.addEventListener("arcgisCancel",this.#i,{once:!0})});return queueMicrotask(()=>void this.#c()),()=>{t.remove(),this.#s.value?.removeEventListener("arcgisSubmit",this.#o),this.#s.value?.removeEventListener("arcgisCancel",this.#i),this.#e.value?.removeEventListener("arcgisSubmit",this.#n),this.#e.value?.removeEventListener("arcgisCancel",this.#l),this.#t?.destroy(),this.#t=null}})}async#c(){try{let t=f(this.referenceElement);await t?.componentOnReady();let e=[...this.#a.values()];this.#t=new i({agents:e,portal:this.portal,view:t?.view}),await this.#t.load()}catch(t){console.warn(t),this._error="Error initializing orchestrator."}}async#h(t){let e=t.trim();if(!e||(this._chatHistory.push({type:"prompt",content:e}),!this.#t))return;this.#r=new AbortController;let r=this.#t.ask(e,this.#r.signal);for await(let s of r)switch(s.type){case"completed":this._chatHistory.push({type:"response",content:s.response,log:s.log,error:s.error});break;case"interrupt":this._interrupt=s.payload;break;case"cancelled":this._chatHistory.push({type:"response",error:"Request cancelled."});break}}render(){return h`<arcgis-assistant-shell .loading=${this.#t?.loading} .heading=${this.heading??this._messages.assistantLabel} .description=${this.description} .entryMessage=${this.entryMessage} .entryMessageClosed=${this._chatHistory.length>0} .awaitingResponse=${this.#t?.processing} .suggestedPrompts=${this.suggestedPrompts} .status=${this.#t?.processing?"working":this._error?"error":"ready"} ${u(this.#e)}>${this._error?h`<calcite-notice slot=entry-message open kind=danger icon width=full><div slot=message>${this._error}</div></calcite-notice>`:null}${this._interrupt?h`<arcgis-assistant-interrupt slot=entry-message .type=${this._interrupt.type} .message=${this._interrupt.message} .options=${this._interrupt.options} ${u(this.#s)}></arcgis-assistant-interrupt>`:null}<arcgis-assistant-chat .loading=${this.#t?.processing} .loadingMessage=${this.#t?.processingStep||""} .messages=${this._chatHistory} .user=${this.portal?.user?.fullName||this.portal?.user?.username}><slot></slot></arcgis-assistant-chat><slot name=header-actions-end slot=header-actions-end></slot>${this.entryMessage?null:h`<slot name=entry-message slot=entry-message></slot>`}<slot name=entry-actions-start slot=entry-actions-start></slot><slot name=footer-content slot=footer-content></slot></arcgis-assistant-shell>`}};_("arcgis-assistant",d);return d},"core/Collection","core/reactiveUtils","portal/Portal","core/Accessor","core/accessorSupport/decorators",a)