@arcgis/ai-components 5.2.0-next.10 → 5.2.0-next.12
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/FunctionAgent.d.ts +2 -2
- package/dist/agent-utils/LLMAgent.d.ts +2 -2
- package/dist/agent-utils/WorkflowAgent.d.ts +2 -2
- package/dist/agent-utils/index.d.ts +99 -0
- package/dist/agent-utils/index.js +148 -0
- package/dist/agent-utils/middlewares/trace.js +25 -33
- package/dist/agent-utils/tools/FunctionTool.d.ts +2 -2
- package/dist/agent-utils/types.d.ts +30 -1
- package/dist/agent-utils/workflows/ConditionalWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/LoopWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/ParallelWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/RouterWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/SequentialWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/SwitchWorkflow.d.ts +2 -2
- package/dist/cdn/{VMXLYWUK.js → 24QNMEFG.js} +1 -1
- package/dist/cdn/{D2N2NSRQ.js → 34SG44C3.js} +1 -1
- package/dist/cdn/3JGWGKT6.js +2 -0
- package/dist/cdn/{CCY4TSBO.js → 3NBDVZ2I.js} +1 -1
- package/dist/cdn/3VOQD2MR.js +2 -0
- package/dist/cdn/{BIV2IPHH.js → 53NTYC4I.js} +1 -1
- package/dist/cdn/{MODWHY3R.js → 5CV7R5IS.js} +6 -4
- package/dist/cdn/{FL4W4VYN.js → 6ZW7Z36F.js} +16 -0
- package/dist/cdn/7CYGX4F4.js +2 -0
- package/dist/cdn/{2SJAOYZT.js → AZGGTNA3.js} +1 -1
- package/dist/cdn/{EGHBXLNG.js → B7WJFBOZ.js} +1 -1
- package/dist/cdn/BX7FSMUU.js +56 -0
- package/dist/cdn/CHPQM77M.js +181 -0
- package/dist/cdn/DHKUXLU3.js +179 -0
- package/dist/cdn/DQSEBKOX.js +2 -0
- package/dist/cdn/DXVU45KM.js +2 -0
- package/dist/cdn/{XER22VYQ.js → DZ2QWNUA.js} +1 -1
- package/dist/cdn/EBISDZ5H.js +2 -0
- package/dist/cdn/{VNQN5ZQO.js → ERL2CB2Y.js} +5 -5
- package/dist/cdn/{SWOXSJ62.js → F6QHMKF5.js} +1 -1
- package/dist/cdn/FUIGPHBH.js +2 -0
- package/dist/cdn/{CTSALWEP.js → H2CHHGGH.js} +1 -1
- package/dist/cdn/{6AWNQHCO.js → HWKDNS4K.js} +1 -1
- package/dist/cdn/IMQ4TVHF.js +16 -0
- package/dist/cdn/IOD3GDA7.js +2 -0
- package/dist/cdn/IR7PTESF.js +2 -0
- package/dist/cdn/{EEUCKMU7.js → IRZDTYO2.js} +1 -1
- package/dist/cdn/JIWK6QK6.js +2 -0
- package/dist/cdn/{EWI4V3GQ.js → JLKGS6Y5.js} +11 -11
- package/dist/cdn/K3JCH4XW.js +2 -0
- package/dist/cdn/{WIDTPVSU.js → KHXUWZHB.js} +1 -1
- package/dist/cdn/LIFK3QSD.js +2 -0
- package/dist/cdn/{JOFUPKIB.js → O3EN27N5.js} +1 -1
- package/dist/cdn/O3RFFPU3.js +6 -0
- package/dist/cdn/P7DG5T3Z.js +9 -0
- package/dist/cdn/{OIVRK7HT.js → PBO6FZN6.js} +1 -1
- package/dist/cdn/Q3ZW4FYA.js +3 -0
- package/dist/cdn/Q6LRANX6.js +2 -0
- package/dist/cdn/Q7TL5Q5N.js +2 -0
- package/dist/cdn/{KUEOKIQR.js → QCSN44H4.js} +1 -1
- package/dist/cdn/R56X6ZKR.js +161 -0
- package/dist/cdn/T43LEBBE.js +47 -0
- package/dist/cdn/TR4GFL7X.js +2 -0
- package/dist/cdn/{D3TNNRP4.js → UPEEHMSY.js} +1 -1
- package/dist/cdn/{GTLS44GI.js → WAIFKDR3.js} +1 -1
- package/dist/cdn/WNS5ZUF5.js +2 -0
- package/dist/cdn/X4XY5HIE.js +2 -0
- package/dist/cdn/XOH56EQ2.js +2 -0
- package/dist/cdn/{64PJB5NU.js → XON27U6U.js} +1 -1
- package/dist/cdn/{DOV5ZJ7M.js → YLN2BZ5J.js} +1 -1
- package/dist/cdn/{OBUZ7HBN.js → YUKR4AZW.js} +1 -1
- package/dist/cdn/{TSZPHE7L.js → Z2G7MP5L.js} +3 -3
- package/dist/cdn/ZEYIBYSF.js +66 -0
- package/dist/cdn/agent-utils/index.js +2 -0
- package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +3 -0
- package/dist/cdn/agent-utils/middlewares/middleware.js +2 -0
- package/dist/cdn/agent-utils/middlewares/trace.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/adapter.js +1379 -1307
- package/dist/chunks/arcgisKnowledgeGraph.js +109 -72
- package/dist/chunks/dataExplorationGraph.js +8 -3
- package/dist/chunks/generateLayerDescriptions.js +228 -217
- package/dist/chunks/helpGraph.js +14 -11
- package/dist/chunks/index.js +11 -0
- package/dist/chunks/intent_prompt.js +16 -0
- package/dist/chunks/layerStylingGraph.js +25 -22
- package/dist/chunks/navigationGraph.js +7 -3
- package/dist/chunks/orchestrator.js +9 -8
- package/dist/chunks/toolCallResponse.js +5 -3
- package/dist/components/arcgis-assistant/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.d.ts +7 -7
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +1 -0
- 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/web-types.json +1 -1
- package/dist/orchestrator/registry/agentRegistry.d.ts +33 -0
- package/dist/utils/index.d.ts +5 -4
- package/dist/utils/index.js +48 -47
- package/package.json +5 -4
- package/dist/cdn/462JBSEV.js +0 -422
- package/dist/cdn/ETRWZ3MS.js +0 -108
- package/dist/cdn/I6HNBTWY.js +0 -2
- package/dist/cdn/JBHNHHWO.js +0 -3
- package/dist/cdn/LKRAPK4A.js +0 -165
- package/dist/cdn/RVOAPUBN.js +0 -2
- package/dist/cdn/VAZNJSKA.js +0 -16
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as c}from"./FUIGPHBH.js";export default $arcgis.t(([l,{property:i,subclass:y},{watch:d}])=>{var w=Object.defineProperty,g=Object.getOwnPropertyDescriptor,t=(s,a,p,o)=>{for(var r=o>1?void 0:o?g(a,p):a,h=s.length-1,n;h>=0;h--)(n=s[h])&&(r=(o?n(a,p,r):n(r))||r);return o&&r&&w(a,p,r),r},m=()=>{throw new Error("createGraph method not implemented.")},e=class extends l{constructor(){super(...arguments),this.description="",this.middlewares=[],this.createGraph=m,this.workspace=c()}initialize(){this.addHandles([d(()=>[this.name,this.description],()=>this.generate(),{initial:!0,sync:!0}),d(()=>this.createGraph,()=>this._compiledGraph=void 0)])}get id(){return this.name.replace(/\s+/gu,"-").toLowerCase()}get registration(){return{id:this.id,name:this.name,description:this.description,createGraph:this.createGraph,workspace:this.workspace}}async run(s={},a){return this.createGraph===m&&this.generate(),this._compiledGraph=this._compiledGraph??this.createGraph().compile(),await this._compiledGraph.invoke(s,a)}};t([i({readOnly:!0})],e.prototype,"id",1);t([i()],e.prototype,"name",2);t([i()],e.prototype,"description",2);t([i()],e.prototype,"middlewares",2);t([i({readOnly:!0})],e.prototype,"createGraph",2);t([i({readOnly:!0})],e.prototype,"workspace",2);t([i({readOnly:!0})],e.prototype,"registration",1);e=t([y("BaseAgent")],e);return e},"core/Accessor","core/accessorSupport/decorators","core/reactiveUtils")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as l}from"./
|
|
2
|
+
import{a as l}from"./YLN2BZ5J.js";import"./QCSN44H4.js";import"./NXKKG5TK.js";import{g as a,h as e,k as o,t as i,u as n,v as r,z as c}from"./HWKDNS4K.js";import"./YIMNOUTF.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")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as c}from"./
|
|
2
|
+
import{a as c}from"./YLN2BZ5J.js";import"./QCSN44H4.js";import"./NXKKG5TK.js";import{g as i,h as s,n as r,v as a,z as p}from"./HWKDNS4K.js";import"./YIMNOUTF.js";var l=i`:host{display:block;max-width:100%}.group{max-width:100%}.prompt{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal;cursor:pointer;font-weight:var(--calcite-font-weight-regular)}calcite-chip{max-width:100%}`,e=class extends a{constructor(){super(...arguments),this._messages=c({blocking:!0}),this.prompts=[],this.arcgisPromptSelect=r()}static{this.properties={label:1,prompts:0}}static{this.styles=l}_emitPromptSelect(t){this.arcgisPromptSelect.emit({prompt:t})}render(){return this.prompts.length?s`<calcite-chip-group class="group" .label=${this.label??this._messages.suggestedPromptsLabel}>${this.prompts.map(t=>s`<calcite-chip .value=${t} .label=${t} appearance=outline-fill kind=brand @calciteChipSelect=${()=>this._emitPromptSelect(t)}><div class="prompt">${t}</div></calcite-chip>`)}</calcite-chip-group>`:null}};p("arcgis-assistant-suggested-prompts",e);export{e as ArcgisAssistantSuggestedPrompts};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import a from"./3VOQD2MR.js";import{c as l}from"./FUIGPHBH.js";import"./DHKUXLU3.js";import"./CHPQM77M.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([{property:g,subclass:u},{d:w}])=>{var f=Object.defineProperty,m=Object.getOwnPropertyDescriptor,c=(o,r,n,s)=>{for(var e=s>1?void 0:s?m(r,n):r,a=o.length-1,t;a>=0;a--)(t=o[a])&&(e=(s?t(r,n,e):t(e))||e);return s&&e&&f(r,n,e),e},p=class extends w{constructor(o){super(o)}getAgents(){return this.workflow.getAgents()}generate(){let o=this.workflow.generate(),r=o.workspace,n=o.createGraph().compile(),{decideContinue:s}=this,e={[i]:async(t,d)=>await n.invoke(t,d)},a=[{from:i,decide:async(t,d)=>await Promise.resolve(s(t,d))?i:void 0}];return{workspace:r,createGraph:()=>l(e,a,r,{entryNode:i})}}buildEdges(){throw new Error("LoopWorkflow overrides generate(); buildEdges should not be called.")}getEntryNode(){return i}isTerminalAgent(){return!0}};c([g()],p.prototype,"workflow",2);c([g()],p.prototype,"decideContinue",2);p=c([u("LoopWorkflow")],p);var i="__loop_body";return p},"core/accessorSupport/decorators",a)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{Z as c}from"./CHPQM77M.js";function f(e,s,t){return{...e,status:s,summary:t}}function g(e){let s=Object.entries(e).filter(([t,n])=>t!=="agentExecutionContext"&&t!=="outputMessage"&&t!=="summary"&&t!=="status"&&n!==void 0);if(s.length!==0)try{return JSON.stringify(Object.fromEntries(s),null,2)}catch{return}}function m(e,s,t=[]){let n=s.safeParse(e);if(n.success){let u={...n.data},r=g(u),a=r??"LLMAgent produced structured output.",o=r??u.outputMessage,i={...u,...o?{outputMessage:o}:{},agentExecutionContext:{messages:[...t,new c(typeof o=="string"&&o.trim()?o:a)]}};return f(i,"success",a)}else throw new Error(`LLMAgent output schema validation failed: ${n.error.message}`)}function l(e,s){let t={outputMessage:e.outputMessage};if(s){let n=s.shape,u=e;for(let r of Object.keys(n??{}))r in e&&(t[r]=u[r])}return t}export{f as a,m as b,l as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as r}from"./434TAA3J.js";import{a as m}from"./
|
|
2
|
+
import{a as r}from"./434TAA3J.js";import{a as m}from"./QCSN44H4.js";import"./NXKKG5TK.js";import{g as l,h as e,v as c,x as d,z as g}from"./HWKDNS4K.js";import"./YIMNOUTF.js";var b=l`:host{display:block;container-type:inline-size}.container{display:flex;flex-direction:column;align-items:flex-start;gap:var(--calcite-spacing-sm);width:100%;text-align:left}.icon{padding:var(--calcite-spacing-sm);border-radius:var(--calcite-spacing-xl);background:var(--calcite-color-brand);color:var(--calcite-color-foreground-1)}.content-container{display:flex;flex:1;flex-direction:column;width:100%;gap:var(--calcite-spacing-md)}.content,.blocks{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm)}.block-pending{display:flex;justify-content:center;align-items:center;padding:var(--calcite-spacing-sm);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 2s ease-in-out infinite;border-radius:var(--calcite-border-radius);min-height:100px}.message-error{font-style:italic}@container (min-width: 480px){.container{max-width:80%}}@keyframes assistant-message-loading-shimmer{0%{background-position:-150% 0}to{background-position:150% 0}}@media(prefers-reduced-motion){.block-pending{animation:none}}`;function p({message:a}){let s=new Map;return a&&a.blocks?.forEach((t,i)=>{if(!t.isPending){let n=r(a.id,i);s.set(n,{data:{block:t,index:i,message:a},name:"block",slotName:n})}}),s}var o=class extends c{constructor(){super(...arguments),this.arcgisSlottableRequest=m(this,["message"],p),this.feedbackEnabled=!1,this.logEnabled=!1,this.copyEnabled=!1,this.readAloudEnabled=!1,this.footerDisabled=!1,this.assistantAvatarEnabled=!1}static{this.properties={_isStreaming:16,feedbackEnabled:5,logEnabled:5,copyEnabled:5,readAloudEnabled:5,footerDisabled:5,message:0,assistantAvatarEnabled:5}}static{this.styles=b}get _isStreaming(){return!!this.message?.isStreaming}_renderContent(){let s=this.message,t=s?.id;if(t)return e`<div class="content"><arcgis-assistant-interrupt-preview .interrupts=${this.message?.interrupts}></arcgis-assistant-interrupt-preview>${s.blocks?.length?e`<div class="blocks">${s.blocks.map((i,n)=>i.isPending&&i.type!=="text"?e`<div class="block-pending"></div>`:e`<slot name=${r(t,n)??d}></slot>`)}</div>`:null}</div>`}_renderFooter(){return e`<arcgis-assistant-message-footer .message=${this.message} .feedbackEnabled=${this.feedbackEnabled} .logEnabled=${this.logEnabled} .copyEnabled=${this.copyEnabled} .readAloudEnabled=${this.readAloudEnabled}></arcgis-assistant-message-footer>`}render(){return e`<div class="container">${this.assistantAvatarEnabled?e`<slot name=icon><calcite-icon icon=effects class="icon" scale=s></calcite-icon></slot>`:null}<div class="content-container"><slot name=content>${this._renderContent()}</slot>${this.message?.error?e`<div class="message-error">${this.message.error}</div>`:null}${this._isStreaming?e`<div class="streaming-indicator"><calcite-loader label=loading inline></calcite-loader></div>`:null}${!this.footerDisabled&&!this._isStreaming?e`<slot name=footer>${this._renderFooter()}</slot>`:null}</div></div>`}};g("arcgis-assistant-message",o);export{o as ArcgisAssistantMessage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{b as r}from"./
|
|
2
|
+
import{b as r}from"./QCSN44H4.js";import{A as o}from"./HWKDNS4K.js";var s=r(o);export{s as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{g as i,h as a,v as e,z as t}from"./
|
|
2
|
+
import{g as i,h as a,v as e,z as t}from"./HWKDNS4K.js";import"./YIMNOUTF.js";var n=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 e{constructor(){super(...arguments),this.loading=!1,this.loadingMessage="",this.assistantAvatarEnabled=!1}static{this.properties={loading:5,loadingMessage:1,assistantAvatarEnabled:5,interrupts:0}}static{this.styles=n}render(){return this.loading?a`<arcgis-assistant-message 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=loading 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}};t("arcgis-assistant-message-loading",s);export{s as ArcgisAssistantMessageLoading};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import b from"./
|
|
2
|
+
import b from"./R56X6ZKR.js";import a from"./T43LEBBE.js";import{a as y,c as E}from"./RUURNLTP.js";import"./5W7S2RS4.js";import"./NXKKG5TK.js";import{v as u,z as d}from"./HWKDNS4K.js";import{a as p}from"./P7DG5T3Z.js";import"./BX7FSMUU.js";import{a as h,b as l,ta as f}from"./DHKUXLU3.js";import"./CHPQM77M.js";import"./WNS5ZUF5.js";import"./ZEYIBYSF.js";import"./YIMNOUTF.js";export default $arcgis.t(([,,,,,,,,,,,,,,,,,{l:x},{I:c,J:H,a:S,m:_,n:w,o:m,p:v}])=>{var C=[H],b=e=>{if(!e||e.size===0)return"No layers available in this map.";let t=Array.from(e.values()).map(({layerItem:o,fieldRegistry:a},s)=>{let r=Array.from(a.values()).map(n=>n.name).slice(0,10).join(", "),i=a.size>10?` (and ${a.size-10} more)`:"";return`${s+1}. "${o.title}". Description: ${o.description}
|
|
3
3
|
Fields: ${r}${i}`}).join(`
|
|
4
4
|
|
|
5
5
|
`);return`This map contains ${e.size} layer(s):
|
|
6
6
|
|
|
7
7
|
${t}`},k=e=>{let t=e?.list()??[];return t.length?t.map(o=>`- ${o.agent.name}: ${o.agent.description}`).join(`
|
|
8
|
-
`):"No agents currently available."};async function I(e,t){let o=await _("help_prompt"),a=m(t,"layersAndFieldsRegistry"),s=m(t,"agentRegistry");try{let r=await x({promptText:o,modelTier:"fast",tools:C,inputVariables:{layerSummary:b(a),agents:k(s),assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps}}),i=(r.tool_calls?.length??0)>0,n=typeof r.text=="string"?r.text.trim():"";return{...e,helpInternalState:{...e.helpInternalState,toolCallMessage:i?r:void 0},outputMessage:i?e.outputMessage:n,summary:i?"Prepared help tool call from assigned task.":"Provided map-related help based on the assigned task.",status:i?e.status:"success"}}catch(r){let i=r instanceof Error?r.message:String(r);return{...e,outputMessage:`Error invoking help agent: ${i}`,summary:"Help agent execution failed.",status:"failed"}}}var M=(e,t)=>v(["agentRegistry"],"Help Agent")(e,t);async function T(e,t){let o=new S(C,{handleToolErrors:!1});try{let a=e.helpInternalState.toolCallMessage;if(!a)throw new Error("helpToolCalling: missing helpInternalState.toolCallMessage");let s=(await o.invoke({messages:[a]},t)).messages.map(r=>r.text).join(`
|
|
8
|
+
`):"No agents currently available."};async function I(e,t){let o=await _("help_prompt"),a=m(t,"layersAndFieldsRegistry"),s=m(t,"agentRegistry");try{let r=await x({promptText:o,modelTier:"fast",config:t,tools:C,inputVariables:{layerSummary:b(a),agents:k(s),assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps}}),i=(r.tool_calls?.length??0)>0,n=typeof r.text=="string"?r.text.trim():"";return{...e,helpInternalState:{...e.helpInternalState,toolCallMessage:i?r:void 0},outputMessage:i?e.outputMessage:n,summary:i?"Prepared help tool call from assigned task.":"Provided map-related help based on the assigned task.",status:i?e.status:"success"}}catch(r){let i=r instanceof Error?r.message:String(r);return{...e,outputMessage:`Error invoking help agent: ${i}`,summary:"Help agent execution failed.",status:"failed"}}}var M=(e,t)=>v(["agentRegistry"],"Help Agent")(e,t);async function T(e,t){let o=new S(C,{handleToolErrors:!1});try{let a=e.helpInternalState.toolCallMessage;if(!a)throw new Error("helpToolCalling: missing helpInternalState.toolCallMessage");let s=(await o.invoke({messages:[a]},t)).messages.map(r=>r.text).join(`
|
|
9
9
|
`);return await p({text:`Finished executing help tool: ${s}`},t),{...e,outputMessage:s,status:"success",summary:s?w(s):"Help executed.",helpInternalState:{...e.helpInternalState,toolCallMessage:void 0}}}catch(a){let s=a instanceof Error?a.message:String(a);return await p({text:`Help tool execution failed: ${s}`},t),{...e,outputMessage:`Help tool execution failed: ${s}`,status:"failed",summary:`Help tool execution failed: ${s}`,helpInternalState:{...e.helpInternalState,toolCallMessage:void 0}}}}var q=()=>new f(c).addNode("requireHelpServices",M).addNode("agent",I).addNode("tools",T).addEdge(h,"requireHelpServices").addEdge("requireHelpServices","agent").addConditionalEdges("agent",e=>e.helpInternalState.toolCallMessage?"tools":l).addEdge("tools",l),A=String.raw`- **help** — Enables users to ask questions about the map, layers, fields, and it's capabilities.
|
|
10
10
|
|
|
11
11
|
_Example: “Tell me about this map”_
|
|
@@ -19,4 +19,4 @@ ${t}`},k=e=>{let t=e?.list()??[];return t.length?t.map(o=>`- ${o.agent.name}: ${
|
|
|
19
19
|
|
|
20
20
|
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 accordingly.
|
|
21
21
|
_Example: "Create a chart"_
|
|
22
|
-
_Example: "Create a table"_`,$={id:"help",name:"Help Agent",description:A,createGraph:q,workspace:c};var g=class extends u{constructor(){super(...arguments),this.agent=$}static{this.properties={referenceElement:1}}#e;getContext(){if(!this.#e)throw new Error("arcgis-assistant-help-agent requires a mapView");return{mapView:this.#e}}load(){this.#e=y(this,"arcgis-assistant-help-agent"),E(this)}};d("arcgis-assistant-help-agent",g);return g},"identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","identity/IdentityManager","portal/Portal","core/reactiveUtils","layers/FeatureLayer","request","views/LinkChartView","rest/knowledgeGraphService",a,b)
|
|
22
|
+
_Example: "Create a table"_`,$={id:"help",name:"Help Agent",description:A,createGraph:q,workspace:c};var g=class extends u{constructor(){super(...arguments),this.agent=$}static{this.properties={referenceElement:1}}#e;getContext(){if(!this.#e)throw new Error("arcgis-assistant-help-agent requires a mapView");return{mapView:this.#e}}load(){this.#e=y(this,"arcgis-assistant-help-agent"),E(this)}};d("arcgis-assistant-help-agent",g);return g},"identity/IdentityManager","portal/Portal","config","core/reactiveUtils","layers/FeatureLayer","request","intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","identity/IdentityManager","portal/Portal","config","core/reactiveUtils","layers/FeatureLayer","request","views/LinkChartView","rest/knowledgeGraphService",a,b)
|