@arcgis/ai-components 5.0.0-next.140 → 5.0.0-next.142
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/README.md +2 -2
- package/dist/cdn/{2WYLKFGP.js → 24JCMWKT.js} +2 -2
- package/dist/cdn/{FDJXRQUK.js → 4JD67FWH.js} +2 -2
- package/dist/cdn/{7QHFU3KO.js → 5FL7YQKB.js} +2 -2
- package/dist/cdn/{H3KORP5U.js → 66XCWCWM.js} +1 -1
- package/dist/cdn/{YLSYEE4Q.js → 6TRADBDX.js} +2 -2
- package/dist/cdn/{RBSKMLWF.js → AX3ZST6A.js} +2 -2
- package/dist/cdn/{25PBMZHS.js → AZXT5TQZ.js} +2 -2
- package/dist/cdn/{TAK5SQLW.js → BFVF7YNW.js} +2 -2
- package/dist/cdn/{WJVFWLIR.js → C7MRAIMT.js} +2 -2
- package/dist/cdn/{N3QH6TX7.js → CGJ7JDHZ.js} +2 -2
- package/dist/cdn/{LGW5HXAG.js → CKRH3D7E.js} +1 -1
- package/dist/cdn/{6C35AMCX.js → CKTQQHF5.js} +2 -2
- package/dist/cdn/{WH2GVTFQ.js → CSL4ICDD.js} +49 -32
- package/dist/cdn/{LYVHBLUQ.js → D7FVP573.js} +2 -2
- package/dist/cdn/{AAVZOXSC.js → DZTBEPPB.js} +2 -2
- package/dist/cdn/{N5EBFHDA.js → FOJAQIAN.js} +2 -2
- package/dist/cdn/{WQAFSEHQ.js → GOYCKSEC.js} +2 -2
- package/dist/cdn/{IXX5ULW6.js → H6MZ7SFC.js} +2 -2
- package/dist/cdn/{2Q7VQTLU.js → I5QITQB4.js} +2 -2
- package/dist/cdn/{ASN7ZWEH.js → IGC2ZG54.js} +3 -3
- package/dist/cdn/{VWVB7I6H.js → IPW732KX.js} +2 -2
- package/dist/cdn/{UNM6E7R2.js → JXZMU4IY.js} +2 -2
- package/dist/cdn/LTKZHX3O.js +43 -0
- package/dist/cdn/{AXRNMFPI.js → NJFAKO5H.js} +1 -1
- package/dist/cdn/{MTNAHLA4.js → NVDFU7VX.js} +2 -2
- package/dist/cdn/{2GEDY3GN.js → O7NVXQYW.js} +4 -4
- package/dist/cdn/{2IHKAUDX.js → OJYNONWN.js} +2 -2
- package/dist/cdn/{KSVU7VLD.js → ORREZ5IF.js} +2 -2
- package/dist/cdn/{AUYVELDF.js → OTDBA4XE.js} +2 -2
- package/dist/cdn/OZOKZDFZ.js +4 -0
- package/dist/cdn/{KNSCW6SS.js → PJLEYE2O.js} +2 -2
- package/dist/cdn/{PC6FKJYU.js → QAZKKZAI.js} +2 -2
- package/dist/cdn/{O2ASMWKU.js → RMHWRG4L.js} +2 -2
- package/dist/cdn/{56XBBDA6.js → RZJUO3P6.js} +2 -2
- package/dist/cdn/{XGRSVMCO.js → SXJFFROL.js} +2 -2
- package/dist/cdn/{4CWTGTNY.js → T24T4RIA.js} +2 -2
- package/dist/cdn/{SNPQLJY2.js → TBYAVPLA.js} +1 -1
- package/dist/cdn/{FWPGJBO5.js → TXLUBMGN.js} +2 -2
- package/dist/cdn/{WPLOP4RM.js → U4QZ35DS.js} +2 -2
- package/dist/cdn/VJKYCWAW.js +32 -0
- package/dist/cdn/{QSJZ4GJQ.js → WRLXN2BN.js} +2 -2
- package/dist/cdn/index.js +2 -2
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/chunks/utils.js +1 -1
- package/dist/chunks/utils2.js +1 -1
- package/dist/components/arcgis-assistant/customElement.js +1 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-chat/customElement.js +1 -1
- package/dist/components/arcgis-assistant-chat-card/customElement.js +1 -1
- package/dist/components/arcgis-assistant-chat-card-content/customElement.js +1 -1
- package/dist/components/arcgis-assistant-chat-entry/customElement.js +1 -1
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-interrupt/customElement.js +1 -1
- package/dist/components/arcgis-assistant-layer-filter-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-layer-query-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-shell/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +1 -1
- package/dist/loader.js +1 -1
- package/package.json +7 -7
- package/dist/cdn/5ZLN2JFL.js +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as b}from"./
|
|
3
|
+
v5.0.0-next.142 */
|
|
4
|
+
import{a as b}from"./SXJFFROL.js";import c from"./O7NVXQYW.js";import{a as f}from"./NJFAKO5H.js";import"./66XCWCWM.js";import{g as y,h,n as g,o as u,p as v,t as _}from"./TBYAVPLA.js";import a from"./CKTQQHF5.js";import"./IGC2ZG54.js";import"./CKRH3D7E.js";export default $arcgis.t(([E,{whenOnce:k,watch:L,when:S},O,P,{property:c,subclass:C},,{s: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}
|
|
5
5
|
|
|
6
6
|
`;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,c)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as n}from"./
|
|
3
|
+
v5.0.0-next.142 */
|
|
4
|
+
import{a as n}from"./SXJFFROL.js";import"./66XCWCWM.js";import{g as a,h as e,k as s,p as l,t as c}from"./TBYAVPLA.js";import"./CKRH3D7E.js";var o=a``,i=class extends l{constructor(){super(...arguments),this.#t=[],this._messages=n({blocking:!0}),this.arcgisCancel=s(),this.arcgisSubmit=s()}static{this.properties={type:1,message:1,options:0}}static{this.styles=o}#t;_renderInterruptOptions(){switch(this.type){case"single-select":return e`<calcite-list selection-mode=single-persist .label=${this._messages.optionsLabel} @calciteListChange=${t=>this.#t=t.target.selectedItems[0]?.value}>${this.options?.map(t=>e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;case"multi-select":return e`<calcite-list selection-mode=multiple .label=${this._messages.optionsLabel} @calciteListChange=${t=>this.#t=t.target.selectedItems.map(r=>r.value)}>${this.options?.map(t=>e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;case"boolean-choice":return e`<calcite-list selection-mode=single-persist .label=${this._messages.optionsLabel} @calciteListChange=${t=>this.#t=t.target.selectedItems[0]?.value}>${this.options?.map(t=>e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;case"text-input":return e`<calcite-input .label=${this._messages.enterTextLabel} @calciteInputInput=${t=>this.#t=t.target.value}></calcite-input>`}}render(){return e`<calcite-panel .description=${this.message}>${this._renderInterruptOptions()}<calcite-button slot=footer-end appearance=outline @click=${()=>this.arcgisCancel.emit()}>${this._messages.cancelButtonLabel}</calcite-button><calcite-button slot=footer-end appearance=solid @click=${()=>this.arcgisSubmit.emit(this.#t)}>${this._messages.submitButtonLabel}</calcite-button></calcite-panel>`}};c("arcgis-assistant-interrupt",i);export{i as ArcgisAssistantInterrupt};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
2
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.
|
|
4
|
-
import{a as u}from"./
|
|
3
|
+
v5.0.0-next.142 */
|
|
4
|
+
import{a as u}from"./SXJFFROL.js";import"./66XCWCWM.js";import{g as i,h as s,k as a,n as r,o as n,p as c,r as o,t as l}from"./TBYAVPLA.js";import"./CKRH3D7E.js";export default $arcgis.t(([{watch:h}])=>{var d=i`.assistant-chat-entry__input-container{display:flex;flex-direction:column}.assistant-chat-entry__footer-start{display:flex;gap:var(--calcite-spacing-md);flex-wrap:wrap;align-items:center}.assistant-chat-entry__footer-end{display:flex;gap:var(--calcite-spacing-md);align-items:center}.assistant-chat-entry__status-indicator{width:9px;height:9px;border-radius:100%;background-color:var(--calcite-color-status-success)}.assistant-chat-entry__status-indicator[data-status=working]{background-color:var(--calcite-color-status-warning)}.assistant-chat-entry__status-indicator[data-status=error]{background-color:var(--calcite-color-status-danger)}.assistant-chat-entry__status-text{text-transform:capitalize}`,e=class extends c{constructor(){super(...arguments),this.#t=r(),this._messages=u({blocking:!0}),this.enterKeySubmits=!0,this.awaitingResponse=!1,this.inputValue="",this.arcgisCancel=a(),this.arcgisSubmit=a()}static{this.properties={enterKeySubmits:5,entryPlaceholder:1,awaitingResponse:5,inputValue:1,status:1}}static{this.styles=d}#t;loaded(){this.manager.onLifecycle(()=>[h(()=>this.inputValue,t=>{this.#t.value&&(this.#t.value.value=t)},{initial:!0})])}async _submitMessage(){if(this.awaitingResponse){this.arcgisCancel.emit();return}let t=this.#t.value?.value.trim();t&&(this.arcgisSubmit.emit(t),this.#t.value&&(this.#t.value.value="",await this.#t.value.setFocus()))}render(){return s`<div class="assistant-chat-entry__input-container"><calcite-text-area .value=${this.#t.value?.value} .placeholder=${this.entryPlaceholder??this._messages.entryPlaceholder} @keydown=${async t=>{t.key==="Enter"&&!t.shiftKey&&this.enterKeySubmits&&(t.preventDefault(),await this._submitMessage())}} ${n(this.#t)}><div slot=footer-start class="assistant-chat-entry__footer-start"><slot name=entry-actions-start></slot></div><div slot=footer-end class="assistant-chat-entry__footer-end">${this.status?s`<div id=tooltip-status class="assistant-chat-entry__status-indicator" data-status=${this.status??o}></div><calcite-tooltip reference-element=tooltip-status offset-distance=12><span class="assistant-chat-entry__status-text">${this.status}</span></calcite-tooltip>`:null}<calcite-button .iconStart=${this.awaitingResponse?"circle-stop":"send"} slot=footer-end round @click=${()=>void this._submitMessage()}>${this.awaitingResponse?this._messages.stopButtonLabel:this._messages.askButtonLabel}</calcite-button></div></calcite-text-area></div>`}};l("arcgis-assistant-chat-entry",e);return e},"core/reactiveUtils")
|