@arcgis/ai-components 5.2.0-next.1 → 5.2.0-next.11
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/LLMAgent.js +22 -22
- 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/{V2P4AIGG.js → 24QNMEFG.js} +1 -1
- package/dist/cdn/{NAUXSHIE.js → 34SG44C3.js} +2 -2
- package/dist/cdn/3JGWGKT6.js +2 -0
- package/dist/cdn/3NBDVZ2I.js +2 -0
- package/dist/cdn/3VOQD2MR.js +2 -0
- package/dist/cdn/434TAA3J.js +2 -0
- package/dist/cdn/53NTYC4I.js +2 -0
- package/dist/cdn/{4HU7735A.js → 5CV7R5IS.js} +6 -4
- package/dist/cdn/{AMP6IALT.js → 5W7S2RS4.js} +1 -1
- package/dist/cdn/{FL4W4VYN.js → 6ZW7Z36F.js} +16 -0
- package/dist/cdn/7CYGX4F4.js +2 -0
- package/dist/cdn/{DHOVCT6R.js → AZGGTNA3.js} +1 -1
- package/dist/cdn/B7WJFBOZ.js +2 -0
- 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/{P6OPJQMC.js → DZ2QWNUA.js} +1 -1
- package/dist/cdn/EBISDZ5H.js +2 -0
- package/dist/cdn/{MDVYQQUG.js → ERL2CB2Y.js} +5 -5
- package/dist/cdn/F6QHMKF5.js +2 -0
- package/dist/cdn/FUIGPHBH.js +2 -0
- package/dist/cdn/{AO7BQHKC.js → H2CHHGGH.js} +1 -1
- package/dist/cdn/{OH64RMOR.js → HWKDNS4K.js} +2 -2
- package/dist/cdn/IMQ4TVHF.js +16 -0
- package/dist/cdn/IOD3GDA7.js +2 -0
- package/dist/cdn/IR7PTESF.js +2 -0
- package/dist/cdn/IRZDTYO2.js +2 -0
- package/dist/cdn/JIWK6QK6.js +2 -0
- package/dist/cdn/{S6W6HV4T.js → JLKGS6Y5.js} +12 -12
- package/dist/cdn/K3JCH4XW.js +2 -0
- package/dist/cdn/KHXUWZHB.js +2 -0
- package/dist/cdn/LIFK3QSD.js +2 -0
- package/dist/cdn/NXKKG5TK.js +2 -0
- package/dist/cdn/{FX5JFRDL.js → O3EN27N5.js} +1 -1
- package/dist/cdn/O3RFFPU3.js +6 -0
- package/dist/cdn/P7DG5T3Z.js +9 -0
- package/dist/cdn/PBO6FZN6.js +2 -0
- package/dist/cdn/Q3ZW4FYA.js +3 -0
- package/dist/cdn/Q6LRANX6.js +2 -0
- package/dist/cdn/Q7TL5Q5N.js +2 -0
- package/dist/cdn/QCSN44H4.js +2 -0
- package/dist/cdn/R56X6ZKR.js +161 -0
- package/dist/cdn/{HB5A5R2E.js → RUURNLTP.js} +1 -1
- package/dist/cdn/T43LEBBE.js +47 -0
- package/dist/cdn/{ZLXN7NMF.js → T537PKP4.js} +9 -7
- package/dist/cdn/TR4GFL7X.js +2 -0
- package/dist/cdn/{3PKJWIC3.js → UPEEHMSY.js} +1 -1
- package/dist/cdn/WAIFKDR3.js +2 -0
- package/dist/cdn/WNS5ZUF5.js +2 -0
- package/dist/cdn/X4XY5HIE.js +2 -0
- package/dist/cdn/XOH56EQ2.js +2 -0
- package/dist/cdn/XON27U6U.js +2 -0
- package/dist/cdn/{H7422XUG.js → YLN2BZ5J.js} +1 -1
- package/dist/cdn/{2AXF774U.js → YUKR4AZW.js} +1 -1
- package/dist/cdn/{JY6LLOUJ.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/cdn/main.css +1 -1
- package/dist/chunks/adapter.js +1390 -1323
- package/dist/chunks/arcgisKnowledgeGraph.js +109 -72
- package/dist/chunks/dataExplorationGraph.js +108 -96
- package/dist/chunks/generateLayerDescriptions.js +206 -168
- package/dist/chunks/helpGraph.js +16 -13
- package/dist/chunks/index.js +11 -0
- package/dist/chunks/intent_prompt.js +16 -0
- package/dist/chunks/layerStylingGraph.js +23 -20
- package/dist/chunks/navigationGraph.js +34 -30
- package/dist/chunks/orchestrator.js +241 -201
- package/dist/chunks/slottableRequestUtils.js +3 -7
- package/dist/chunks/summarize_query_response_prompt.js +9 -7
- package/dist/chunks/toolCallResponse.js +5 -3
- package/dist/components/arcgis-assistant/customElement.d.ts +15 -0
- package/dist/components/arcgis-assistant/customElement.js +228 -127
- package/dist/components/arcgis-assistant/index.js +2 -3
- package/dist/components/arcgis-assistant/types.d.ts +14 -1
- package/dist/components/arcgis-assistant-chat/customElement.d.ts +8 -2
- package/dist/components/arcgis-assistant-chat/customElement.js +7 -7
- package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-chat-entry/customElement.js +25 -18
- 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-interrupt/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-interrupt/customElement.js +13 -9
- package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +20 -0
- package/dist/components/arcgis-assistant-interrupt-preview/index.js +2 -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-message/customElement.d.ts +23 -0
- package/dist/components/arcgis-assistant-message/customElement.js +28 -26
- package/dist/components/arcgis-assistant-message/index.d.ts +1 -0
- package/dist/components/arcgis-assistant-message/index.js +2 -0
- package/dist/components/arcgis-assistant-message-block/customElement.d.ts +1 -1
- package/dist/components/arcgis-assistant-message-block/customElement.js +18 -11
- package/dist/components/arcgis-assistant-message-block/index.js +1 -0
- package/dist/components/arcgis-assistant-message-feedback/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-footer/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +8 -1
- package/dist/components/arcgis-assistant-message-loading/customElement.js +8 -8
- package/dist/components/arcgis-assistant-message-loading/index.js +1 -0
- package/dist/components/arcgis-assistant-message-log/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-read-aloud/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-message-text/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +1 -0
- package/dist/components/arcgis-assistant-speech-input/customElement.d.ts +6 -1
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +8 -8
- package/dist/components/arcgis-assistant-user-message/customElement.d.ts +4 -1
- package/dist/components/arcgis-assistant-user-message/customElement.js +1 -1
- 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/index.d.ts +4 -0
- package/dist/loader.js +6 -5
- package/dist/orchestrator/registry/agentRegistry.d.ts +33 -0
- package/dist/types/lumina.d.ts +10 -4
- package/dist/types/preact.d.ts +11 -4
- package/dist/types/react.d.ts +12 -4
- package/dist/types/stencil.d.ts +10 -4
- package/dist/utils/index.d.ts +87 -43
- package/dist/utils/index.js +54 -49
- package/package.json +8 -7
- package/dist/cdn/462JBSEV.js +0 -422
- package/dist/cdn/7BCR6TUO.js +0 -2
- package/dist/cdn/7GH7VSB2.js +0 -2
- package/dist/cdn/7PLV4QH6.js +0 -2
- package/dist/cdn/DDLZOMUY.js +0 -2
- package/dist/cdn/FHVXO2WG.js +0 -166
- package/dist/cdn/GSEPHN3A.js +0 -106
- package/dist/cdn/MH5RPXHM.js +0 -2
- package/dist/cdn/NVI3I46B.js +0 -2
- package/dist/cdn/OAVEHGB6.js +0 -2
- package/dist/cdn/ON2V5XI2.js +0 -3
- package/dist/cdn/QR54T33D.js +0 -2
- package/dist/cdn/RVOAPUBN.js +0 -2
- package/dist/cdn/SXDLXCIM.js +0 -2
- package/dist/cdn/USMDJUFS.js +0 -2
- package/dist/cdn/V5YEZSRY.js +0 -16
- package/dist/cdn/Y333DGV6.js +0 -2
- package/dist/cdn/YY2SBO3V.js +0 -2
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import "../arcgis-assistant-interrupt/index.js";
|
|
2
1
|
import "@esri/calcite-components/components/calcite-notice";
|
|
3
2
|
import "@esri/calcite-components/components/calcite-link";
|
|
4
|
-
import "../arcgis-assistant-suggested-prompts/index.js";
|
|
5
3
|
import "@esri/calcite-components/components/calcite-panel";
|
|
6
4
|
import "../arcgis-assistant-chat/index.js";
|
|
7
5
|
import "../arcgis-assistant-message/index.js";
|
|
8
|
-
import "../arcgis-assistant-message-text/index.js";
|
|
9
6
|
import "../arcgis-assistant-message-block/index.js";
|
|
10
7
|
import "../arcgis-assistant-user-message/index.js";
|
|
11
8
|
import "../arcgis-assistant-message-loading/index.js";
|
|
9
|
+
import "../arcgis-assistant-interrupt/index.js";
|
|
10
|
+
import "../arcgis-assistant-suggested-prompts/index.js";
|
|
12
11
|
import "../arcgis-assistant-chat-entry/index.js";
|
|
13
12
|
import "@esri/calcite-components/components/calcite-button";
|
|
14
13
|
export * from "./customElement.js";
|
|
@@ -51,7 +51,7 @@ export interface AssistantMessage extends ChatMessageBase {
|
|
|
51
51
|
* UI elements separate from the plain text transcript and can be used to display actions, follow-up prompts,
|
|
52
52
|
* or app-registered custom content.
|
|
53
53
|
*/
|
|
54
|
-
blocks?: UXSuggestion[];
|
|
54
|
+
blocks?: (UXSuggestion & { isPending?: boolean; })[];
|
|
55
55
|
/**
|
|
56
56
|
* Log messages related to the assistant's processing of the user's request. This can include information about
|
|
57
57
|
* the agents or tools it invoked, the parameters generated by the LLM, and any relevant details about how it
|
|
@@ -71,6 +71,19 @@ export interface AssistantMessage extends ChatMessageBase {
|
|
|
71
71
|
* performance over time.
|
|
72
72
|
*/
|
|
73
73
|
feedback?: Feedback;
|
|
74
|
+
/**
|
|
75
|
+
* Indicates whether the message content is still being streamed from the assistant. This can be used to show loading
|
|
76
|
+
* indicators or placeholders in the UI until the full content is received.
|
|
77
|
+
*/
|
|
78
|
+
isStreaming?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* An array of interrupts emitted by the assistant during the processing of the user's request. Each interrupt includes
|
|
81
|
+
* details about the type of interrupt, the message to display to the user, and any options for user input.
|
|
82
|
+
*/
|
|
83
|
+
interrupts?: {
|
|
84
|
+
interrupt: Interrupt;
|
|
85
|
+
response?: string[] | boolean | string;
|
|
86
|
+
}[];
|
|
74
87
|
}
|
|
75
88
|
|
|
76
89
|
/**
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
2
|
import type Collection from "@arcgis/core/core/Collection.js";
|
|
3
3
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
4
|
-
import type { ChatMessage } from "../arcgis-assistant/types.js";
|
|
4
|
+
import type { ChatMessage, Interrupt } from "../arcgis-assistant/types.js";
|
|
5
5
|
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Wraps and renders the conversation area. Use it as the container for message list content.
|
|
8
|
+
* Offers chat-level layout structure for message starter, message list, and loading regions.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
7
12
|
export abstract class ArcgisAssistantChat extends LitElement {
|
|
13
|
+
accessor interrupt: Interrupt | null;
|
|
8
14
|
/** @default false */
|
|
9
15
|
accessor loading: boolean;
|
|
10
16
|
accessor messages: Collection<ChatMessage>;
|
|
@@ -4,17 +4,17 @@ import { css as e, html as t } from "lit";
|
|
|
4
4
|
import { LitElement as i } from "@arcgis/lumina";
|
|
5
5
|
import { createRef as a, ref as o } from "lit/directives/ref.js";
|
|
6
6
|
import l from "@arcgis/core/core/Collection.js";
|
|
7
|
-
import { watch as
|
|
8
|
-
const
|
|
7
|
+
import { watch as n } from "@arcgis/core/core/reactiveUtils.js";
|
|
8
|
+
const r = e`.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}`;
|
|
9
9
|
class c extends i {
|
|
10
10
|
constructor() {
|
|
11
|
-
super(...arguments), this.#s = a(), this.loading = !1, this.messages = new l([]);
|
|
11
|
+
super(...arguments), this.#s = a(), this.loading = !1, this.messages = new l([]), this.interrupt = null;
|
|
12
12
|
}
|
|
13
13
|
static {
|
|
14
|
-
this.properties = { loading: 5, messages: 0 };
|
|
14
|
+
this.properties = { loading: 5, messages: 0, interrupt: 0 };
|
|
15
15
|
}
|
|
16
16
|
static {
|
|
17
|
-
this.styles =
|
|
17
|
+
this.styles = r;
|
|
18
18
|
}
|
|
19
19
|
#s;
|
|
20
20
|
firstUpdated() {
|
|
@@ -23,9 +23,9 @@ class c extends i {
|
|
|
23
23
|
loaded() {
|
|
24
24
|
this.manager.onLifecycle(() => [
|
|
25
25
|
this.messages.on("change", () => {
|
|
26
|
-
this.
|
|
26
|
+
this._scrollToEnd();
|
|
27
27
|
}),
|
|
28
|
-
|
|
28
|
+
n(() => [this.loading, this.interrupt], () => {
|
|
29
29
|
this._scrollToEnd();
|
|
30
30
|
})
|
|
31
31
|
]);
|
|
@@ -5,7 +5,8 @@ import type { ChatMessage } from "../arcgis-assistant/types.js";
|
|
|
5
5
|
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Provides the input bar and submit or cancel behavior. Use it to collect prompts and emit submit events.
|
|
9
|
+
* Offers keyboard submit/history behavior, entry action slots, and optional voice-input integration.
|
|
9
10
|
*
|
|
10
11
|
* @slot [entry-actions-start] - Slot for adding actions to the start of the entry area.
|
|
11
12
|
* @slot [entry-actions-end] - Slot for adding actions to the end of the entry area.
|
|
@@ -15,6 +16,8 @@ export abstract class ArcgisAssistantChatEntry extends LitElement {
|
|
|
15
16
|
protected _messages: { entryPlaceholder: string; } & T9nMeta<{ entryPlaceholder: string; }>;
|
|
16
17
|
/** @default false */
|
|
17
18
|
accessor awaitingResponse: boolean;
|
|
19
|
+
/** @default false */
|
|
20
|
+
accessor disabled: boolean;
|
|
18
21
|
accessor entryPlaceholder: string | undefined;
|
|
19
22
|
/** @default "" */
|
|
20
23
|
accessor inputValue: string;
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { createRef as
|
|
6
|
-
import { u as
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { c as d } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as p, html as c } from "lit";
|
|
4
|
+
import { LitElement as f, createEvent as l, safeClassMap as g } from "@arcgis/lumina";
|
|
5
|
+
import { createRef as u, ref as h } from "lit/directives/ref.js";
|
|
6
|
+
import { u as m } from "../../chunks/useT9n.js";
|
|
7
|
+
import y from "@arcgis/core/core/Collection.js";
|
|
8
|
+
import { classes as v } from "@arcgis/toolkit/dom";
|
|
9
|
+
const b = p`:host{--calcite-text-area-border-color: var(--calcite-color-border-1);--calcite-text-area-divider-color: var(--calcite-color-border-1);--calcite-text-area-corner-radius: var(--calcite-border-radius)}.input-container{display:flex;flex-direction:column}.footer-start{display:flex;gap:var(--calcite-spacing-md);flex-wrap:wrap;align-items:center}.footer-end{display:flex;gap:var(--calcite-spacing-md);align-items:center}.status-indicator{width:9px;height:9px;border-radius:100%;background-color:var(--calcite-color-status-success)}.status-indicator[data-status=working]{background-color:var(--calcite-color-status-warning)}.status-indicator[data-status=error]{background-color:var(--calcite-color-status-danger)}.status-text{text-transform:capitalize}.focused{--calcite-text-area-shadow: var(--calcite-shadow-sm)}`;
|
|
10
|
+
class w extends f {
|
|
10
11
|
constructor() {
|
|
11
|
-
super(...arguments), this.#s =
|
|
12
|
+
super(...arguments), this.#s = u(), this.#i = u(), this.#t = -1, this.#e = "", this.#a = (t) => {
|
|
12
13
|
t.stopPropagation();
|
|
13
14
|
const s = t.detail;
|
|
14
15
|
this._setDraftValue(s.value), s.focusInput && this.#s.value && this.#s.value.setFocus();
|
|
15
16
|
}, this.#r = (t) => {
|
|
16
17
|
const s = t.target.value ?? "";
|
|
17
18
|
this.inputValue = s, this.#e = s;
|
|
18
|
-
}, this._messages =
|
|
19
|
+
}, this._messages = m({ blocking: !0 }), this._inFocus = !1, this.keyboardShortcutsDisabled = !1, this.awaitingResponse = !1, this.inputValue = "", this.voiceInputEnabled = !1, this.messages = new y([]), this.disabled = !1, this.arcgisCancel = l(), this.arcgisSubmit = l();
|
|
19
20
|
}
|
|
20
21
|
static {
|
|
21
|
-
this.properties = { _userMessages: 16, keyboardShortcutsDisabled: 5, entryPlaceholder: 1, awaitingResponse: 5, inputValue: 1, status: 1, voiceInputEnabled: 5, messages: 0 };
|
|
22
|
+
this.properties = { _inFocus: 16, _userMessages: 16, keyboardShortcutsDisabled: 5, entryPlaceholder: 1, awaitingResponse: 5, inputValue: 1, status: 1, voiceInputEnabled: 5, messages: 0, disabled: 5 };
|
|
22
23
|
}
|
|
23
24
|
static {
|
|
24
|
-
this.styles =
|
|
25
|
+
this.styles = b;
|
|
25
26
|
}
|
|
26
27
|
#s;
|
|
27
28
|
#i;
|
|
@@ -54,8 +55,8 @@ class v extends g {
|
|
|
54
55
|
const e = this._userMessages;
|
|
55
56
|
if (e.length === 0)
|
|
56
57
|
return;
|
|
57
|
-
const r = a.value ?? "",
|
|
58
|
-
if (!(i == null ||
|
|
58
|
+
const r = a.value ?? "", o = a.shadowRoot?.querySelector("textarea"), i = o?.selectionStart, n = o?.selectionEnd;
|
|
59
|
+
if (!(i == null || n == null) && !(i !== n || t === "up" && i !== 0 || t === "down" && i !== r.length)) {
|
|
59
60
|
if (t === "up") {
|
|
60
61
|
this.#t === -1 ? (this.#e = r, this.#t = e.length - 1) : this.#t = Math.max(0, this.#t - 1), this.inputValue = e[this.#t] ?? "", s.preventDefault();
|
|
61
62
|
return;
|
|
@@ -66,13 +67,19 @@ class v extends g {
|
|
|
66
67
|
_setDraftValue(t) {
|
|
67
68
|
this.inputValue = t, this.#t = -1, this.#e = t;
|
|
68
69
|
}
|
|
70
|
+
_onFocusIn() {
|
|
71
|
+
this._inFocus = !0;
|
|
72
|
+
}
|
|
73
|
+
_onFocusOut() {
|
|
74
|
+
this._inFocus = !1;
|
|
75
|
+
}
|
|
69
76
|
render() {
|
|
70
|
-
return
|
|
77
|
+
return c`<div class="input-container"><calcite-text-area class=${g(v({ focused: this._inFocus }))} .value=${this.inputValue} .placeholder=${this.entryPlaceholder ?? this._messages.entryPlaceholder} resize=vertical @calciteTextAreaInput=${this.#r} .disabled=${this.disabled} @keydown=${async (t) => {
|
|
71
78
|
t.altKey || t.ctrlKey || t.metaKey || t.shiftKey || this.keyboardShortcutsDisabled || (t.key === "Enter" ? (t.preventDefault(), await this.submitMessage()) : t.key === "ArrowUp" ? await this._navigateHistory("up", t) : t.key === "ArrowDown" && await this._navigateHistory("down", t));
|
|
72
|
-
}} ${h(this.#s)}><div slot=footer-start class="footer-start"><slot name=entry-actions-start></slot></div><div slot=footer-end class="footer-end">${this.voiceInputEnabled ?
|
|
79
|
+
}} @focusin=${this._onFocusIn} @focusout=${this._onFocusOut} ${h(this.#s)}><div slot=footer-start class="footer-start"><slot name=entry-actions-start></slot></div><div slot=footer-end class="footer-end">${this.voiceInputEnabled ? c`<arcgis-assistant-speech-input .awaitingResponse=${this.awaitingResponse} .inputValue=${this.inputValue} ${h(this.#i)}></arcgis-assistant-speech-input>` : null}<slot name=entry-actions-end></slot></div></calcite-text-area></div>`;
|
|
73
80
|
}
|
|
74
81
|
}
|
|
75
|
-
|
|
82
|
+
d("arcgis-assistant-chat-entry", w);
|
|
76
83
|
export {
|
|
77
|
-
|
|
84
|
+
w as ArcgisAssistantChatEntry
|
|
78
85
|
};
|
|
@@ -9,6 +9,7 @@ import "../../chunks/generateLayerDescriptions.js";
|
|
|
9
9
|
import "@langchain/core/messages";
|
|
10
10
|
import "@langchain/core/callbacks/dispatch/web";
|
|
11
11
|
import "@langchain/openai";
|
|
12
|
+
import "@arcgis/core/config.js";
|
|
12
13
|
import "@arcgis/core/core/reactiveUtils.js";
|
|
13
14
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
14
15
|
import "@arcgis/core/request.js";
|
|
@@ -9,6 +9,7 @@ import "../../chunks/generateLayerDescriptions.js";
|
|
|
9
9
|
import "@langchain/core/messages";
|
|
10
10
|
import "@langchain/core/callbacks/dispatch/web";
|
|
11
11
|
import "@langchain/openai";
|
|
12
|
+
import "@arcgis/core/config.js";
|
|
12
13
|
import "@arcgis/core/core/reactiveUtils.js";
|
|
13
14
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
14
15
|
import "@arcgis/core/request.js";
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
3
|
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
4
4
|
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Renders interrupt prompts for extra user input. Use it when an agent pauses for confirmation, choice, or text input.
|
|
7
|
+
* Offers interrupt-specific input modes and submit or cancel event handling.
|
|
8
|
+
*/
|
|
6
9
|
export abstract class ArcgisAssistantInterrupt extends LitElement {
|
|
7
10
|
/** @internal */
|
|
8
11
|
protected _messages: {
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { c as a } from "../../chunks/runtime.js";
|
|
3
|
-
import { html as e } from "lit";
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { u as
|
|
6
|
-
|
|
3
|
+
import { css as c, html as e } from "lit";
|
|
4
|
+
import { LitElement as l, createEvent as i } from "@arcgis/lumina";
|
|
5
|
+
import { u as r } from "../../chunks/useT9n.js";
|
|
6
|
+
const n = c`:host{width:100%;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)}`;
|
|
7
|
+
class o extends l {
|
|
7
8
|
constructor() {
|
|
8
|
-
super(...arguments), this.#t = [], this._messages =
|
|
9
|
+
super(...arguments), this.#t = [], this._messages = r({ blocking: !0 }), this.arcgisCancel = i(), this.arcgisSubmit = i();
|
|
9
10
|
}
|
|
10
11
|
static {
|
|
11
12
|
this.properties = { type: 1, message: 1, options: 0 };
|
|
12
13
|
}
|
|
14
|
+
static {
|
|
15
|
+
this.styles = n;
|
|
16
|
+
}
|
|
13
17
|
#t;
|
|
14
18
|
_renderInterruptOptions() {
|
|
15
19
|
switch (this.type) {
|
|
16
20
|
case "single-select":
|
|
17
21
|
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>`;
|
|
18
22
|
case "multi-select":
|
|
19
|
-
return e`<calcite-list selection-mode=multiple .label=${this._messages.optionsLabel} @calciteListChange=${(t) => this.#t = t.target.selectedItems.map((
|
|
23
|
+
return e`<calcite-list selection-mode=multiple .label=${this._messages.optionsLabel} @calciteListChange=${(t) => this.#t = t.target.selectedItems.map((s) => s.value)}>${this.options?.map((t) => e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;
|
|
20
24
|
case "boolean-choice":
|
|
21
25
|
return null;
|
|
22
26
|
case "text-input":
|
|
@@ -24,10 +28,10 @@ class n extends c {
|
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
30
|
render() {
|
|
27
|
-
return e`<calcite-panel .description=${this.message}>${this._renderInterruptOptions()}
|
|
31
|
+
return e`<calcite-panel .description=${this.message}><div class="interrupt-content">${this._renderInterruptOptions()}</div><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.type === "boolean-choice" ? !0 : this.#t)}>${this._messages.submitButtonLabel}</calcite-button></calcite-panel>`;
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
|
-
a("arcgis-assistant-interrupt",
|
|
34
|
+
a("arcgis-assistant-interrupt", o);
|
|
31
35
|
export {
|
|
32
|
-
|
|
36
|
+
o as ArcgisAssistantInterrupt
|
|
33
37
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import { c as r } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as l, html as t } from "lit";
|
|
4
|
+
import { LitElement as a } from "@arcgis/lumina";
|
|
5
|
+
const n = l`.interrupt-details ul{margin-block:var(--calcite-spacing-xxs) 0;padding-inline-start:var(--calcite-spacing-xxl)}.interrupt-details li{margin-block:0}.interrupts-container{display:flex;flex-direction:column;gap:var(--calcite-spacing-lg)}`;
|
|
6
|
+
class c extends a {
|
|
7
|
+
static {
|
|
8
|
+
this.properties = { interrupts: 0 };
|
|
9
|
+
}
|
|
10
|
+
static {
|
|
11
|
+
this.styles = n;
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return this.interrupts?.length ? t`<calcite-block collapsible expanded heading="Assistant Questions"><div class="interrupts-container">${this.interrupts?.map(({ interrupt: s, response: i }) => t`<div class="interrupt-details"><div>Q: ${s.message}</div><ul>${Array.isArray(i) ? i.length ? i.map((e) => t`<li>${e}</li>`) : t`<li>(Question skipped)</li>` : t`<li>${i != null ? String(i) : "(Question skipped)"}</li>`}</ul></div>`)}</div></calcite-block>` : null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
r("arcgis-assistant-interrupt-preview", c);
|
|
18
|
+
export {
|
|
19
|
+
c as ArcgisAssistantInterruptPreview
|
|
20
|
+
};
|
|
@@ -106,12 +106,12 @@ import type { ArcgisMap as ArcgisMap } from "@arcgis/map-components/components/a
|
|
|
106
106
|
*/
|
|
107
107
|
export abstract class ArcgisAssistantKnowledgeAgent extends LitElement {
|
|
108
108
|
/**
|
|
109
|
-
*
|
|
110
|
-
* a
|
|
109
|
+
* Optional context for the knowledge agent. If the agent does not have a view or kg service url provided via reference element or serviceUrl property
|
|
110
|
+
* a knowledge graph can be provided directly via context to enable Knowledge Service related capabilties.
|
|
111
111
|
*
|
|
112
112
|
* Depending on the context provided, different capabilities will be available.
|
|
113
113
|
*/
|
|
114
|
-
accessor context:
|
|
114
|
+
accessor context: ArcgisKnowledgeAssistantContext | undefined;
|
|
115
115
|
/**
|
|
116
116
|
* The reference element to the map that provides context for the navigation agent. Currently,
|
|
117
117
|
* this is only scoped to `arcgis-map` elements. This shows the navigation agent which map on which to
|
|
@@ -149,10 +149,10 @@ export abstract class ArcgisAssistantKnowledgeAgent extends LitElement {
|
|
|
149
149
|
* Context required by the Knowledge Link Chart agent.
|
|
150
150
|
* Supplied by the application via an agent `getContext()` provider.
|
|
151
151
|
*/
|
|
152
|
-
export type
|
|
153
|
-
knowledgeGraph: KnowledgeGraph;
|
|
154
|
-
view?: never;
|
|
155
|
-
} | {
|
|
152
|
+
export type ArcgisKnowledgeAssistantContext = {
|
|
156
153
|
view: LinkChartView | MapView;
|
|
157
154
|
knowledgeGraph?: never;
|
|
155
|
+
} | {
|
|
156
|
+
knowledgeGraph: KnowledgeGraph;
|
|
157
|
+
view?: never;
|
|
158
158
|
};
|
|
@@ -9,6 +9,7 @@ import "../../chunks/generateLayerDescriptions.js";
|
|
|
9
9
|
import "@langchain/core/messages";
|
|
10
10
|
import "@langchain/core/callbacks/dispatch/web";
|
|
11
11
|
import "@langchain/openai";
|
|
12
|
+
import "@arcgis/core/config.js";
|
|
12
13
|
import "@arcgis/core/core/reactiveUtils.js";
|
|
13
14
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
14
15
|
import "@arcgis/core/request.js";
|
|
@@ -9,6 +9,7 @@ import "../../chunks/generateLayerDescriptions.js";
|
|
|
9
9
|
import "@langchain/core/messages";
|
|
10
10
|
import "@langchain/core/callbacks/dispatch/web";
|
|
11
11
|
import "@langchain/openai";
|
|
12
|
+
import "@arcgis/core/config.js";
|
|
12
13
|
import "@arcgis/core/core/reactiveUtils.js";
|
|
13
14
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
14
15
|
import "@arcgis/core/request.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference path="../../index.d.ts" />
|
|
2
|
+
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
|
+
import type { AssistantMessage } from "../arcgis-assistant/types.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Renders a single assistant response message shell. Pass one assistant message object and let it host body and footer actions.
|
|
7
|
+
* Offers a reusable assistant-message layout with icon, content, and footer slot regions.
|
|
8
|
+
*/
|
|
9
|
+
export abstract class ArcgisAssistantMessage extends LitElement {
|
|
10
|
+
/** @default false */
|
|
11
|
+
accessor assistantAvatarEnabled: boolean;
|
|
12
|
+
/** @default false */
|
|
13
|
+
accessor copyEnabled: boolean;
|
|
14
|
+
/** @default false */
|
|
15
|
+
accessor feedbackEnabled: boolean;
|
|
16
|
+
/** @default false */
|
|
17
|
+
accessor footerDisabled: boolean;
|
|
18
|
+
/** @default false */
|
|
19
|
+
accessor logEnabled: boolean;
|
|
20
|
+
accessor message: AssistantMessage | undefined;
|
|
21
|
+
/** @default false */
|
|
22
|
+
accessor readAloudEnabled: boolean;
|
|
23
|
+
}
|
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { useSlottableRequest as
|
|
6
|
-
import { g as
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}), e;
|
|
2
|
+
import { c as o } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as l, html as e } from "lit";
|
|
4
|
+
import { LitElement as c, nothing as d } from "@arcgis/lumina";
|
|
5
|
+
import { useSlottableRequest as g } from "@arcgis/lumina/controllers";
|
|
6
|
+
import { g as r } from "../../chunks/slottableRequestUtils.js";
|
|
7
|
+
const m = 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}}`;
|
|
8
|
+
function b({ message: t }) {
|
|
9
|
+
const s = /* @__PURE__ */ new Map();
|
|
10
|
+
return t && t.blocks?.forEach((a, i) => {
|
|
11
|
+
if (!a.isPending) {
|
|
12
|
+
const n = r(t.id, i);
|
|
13
|
+
s.set(n, { data: { block: a, index: i, message: t }, name: "block", slotName: n });
|
|
14
|
+
}
|
|
15
|
+
}), s;
|
|
17
16
|
}
|
|
18
|
-
class
|
|
17
|
+
class p extends c {
|
|
19
18
|
constructor() {
|
|
20
|
-
super(...arguments), this.arcgisSlottableRequest =
|
|
19
|
+
super(...arguments), this.arcgisSlottableRequest = g(this, ["message"], b), this.feedbackEnabled = !1, this.logEnabled = !1, this.copyEnabled = !1, this.readAloudEnabled = !1, this.footerDisabled = !1, this.assistantAvatarEnabled = !1;
|
|
21
20
|
}
|
|
22
21
|
static {
|
|
23
|
-
this.properties = { feedbackEnabled: 5, logEnabled: 5, copyEnabled: 5, readAloudEnabled: 5, footerDisabled: 5, message: 0 };
|
|
22
|
+
this.properties = { _isStreaming: 16, feedbackEnabled: 5, logEnabled: 5, copyEnabled: 5, readAloudEnabled: 5, footerDisabled: 5, message: 0, assistantAvatarEnabled: 5 };
|
|
24
23
|
}
|
|
25
24
|
static {
|
|
26
|
-
this.styles =
|
|
25
|
+
this.styles = m;
|
|
26
|
+
}
|
|
27
|
+
get _isStreaming() {
|
|
28
|
+
return !!this.message?.isStreaming;
|
|
27
29
|
}
|
|
28
30
|
_renderContent() {
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
31
|
-
return
|
|
31
|
+
const s = this.message, a = s?.id;
|
|
32
|
+
if (a)
|
|
33
|
+
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(a, n) ?? d}></slot>`)}</div>` : null}</div>`;
|
|
32
34
|
}
|
|
33
35
|
_renderFooter() {
|
|
34
|
-
return
|
|
36
|
+
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>`;
|
|
35
37
|
}
|
|
36
38
|
render() {
|
|
37
|
-
return
|
|
39
|
+
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>`;
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
|
-
|
|
42
|
+
o("arcgis-assistant-message", p);
|
|
41
43
|
export {
|
|
42
|
-
|
|
44
|
+
p as ArcgisAssistantMessage
|
|
43
45
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./customElement.js";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "../arcgis-assistant-interrupt-preview/index.js";
|
|
1
2
|
import "../arcgis-assistant-message-footer/index.js";
|
|
2
3
|
import "@esri/calcite-components/components/calcite-icon";
|
|
4
|
+
import "@esri/calcite-components/components/calcite-loader";
|
|
3
5
|
export * from "./customElement.js";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
3
|
import type { UXSuggestion } from "../../utils/index.js";
|
|
4
4
|
|
|
5
|
-
/**
|
|
5
|
+
/** Renders one structured assistant block. Offers default block rendering for supported suggestion-style blocks. */
|
|
6
6
|
export abstract class ArcgisAssistantMessageBlock extends LitElement {
|
|
7
7
|
accessor block: UXSuggestion | undefined;
|
|
8
8
|
}
|
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as i, html as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
const
|
|
6
|
-
class
|
|
2
|
+
import { c as n } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as i, html as r } from "lit";
|
|
4
|
+
import { LitElement as o } from "@arcgis/lumina";
|
|
5
|
+
const p = i`:host{display:block}`;
|
|
6
|
+
class c extends o {
|
|
7
7
|
static {
|
|
8
8
|
this.properties = { block: 0 };
|
|
9
9
|
}
|
|
10
10
|
static {
|
|
11
|
-
this.styles =
|
|
11
|
+
this.styles = p;
|
|
12
12
|
}
|
|
13
13
|
_renderSuggestedPrompts(s) {
|
|
14
14
|
if (s.type !== "suggested-prompts")
|
|
15
15
|
return null;
|
|
16
|
-
const t = s.data?.prompts, e = Array.isArray(t) ? t.filter((
|
|
17
|
-
return e.length ?
|
|
16
|
+
const t = s.data?.prompts, e = Array.isArray(t) ? t.filter((a) => typeof a == "string") : [];
|
|
17
|
+
return e.length ? r`<arcgis-assistant-suggested-prompts .prompts=${e}></arcgis-assistant-suggested-prompts>` : null;
|
|
18
18
|
}
|
|
19
19
|
_renderBlock(s) {
|
|
20
|
-
|
|
20
|
+
switch (s.type) {
|
|
21
|
+
case "suggested-prompts":
|
|
22
|
+
return this._renderSuggestedPrompts(s);
|
|
23
|
+
case "text":
|
|
24
|
+
return r`<arcgis-assistant-message-text .content=${s.data?.content}></arcgis-assistant-message-text>`;
|
|
25
|
+
default:
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
21
28
|
}
|
|
22
29
|
render() {
|
|
23
30
|
return this.block ? this._renderBlock(this.block) : null;
|
|
24
31
|
}
|
|
25
32
|
}
|
|
26
|
-
|
|
33
|
+
n("arcgis-assistant-message-block", c);
|
|
27
34
|
export {
|
|
28
|
-
|
|
35
|
+
c as ArcgisAssistantMessageBlock
|
|
29
36
|
};
|
|
@@ -3,7 +3,10 @@ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
|
3
3
|
import type { AssistantMessage } from "../arcgis-assistant/types.js";
|
|
4
4
|
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
5
5
|
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Handles thumbs up or down feedback UI. Use it to capture helpful or not helpful signals per response.
|
|
8
|
+
* Offers feedback toggle behavior and emits feedback updates for the associated assistant message.
|
|
9
|
+
*/
|
|
7
10
|
export abstract class ArcgisAssistantMessageFeedback extends LitElement {
|
|
8
11
|
/** @internal */
|
|
9
12
|
protected _messages: {
|
|
@@ -3,7 +3,10 @@ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
|
3
3
|
import type { AssistantMessage } from "../arcgis-assistant/types.js";
|
|
4
4
|
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
5
5
|
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Renders the action row under an assistant message. Use it when you want feedback, log, copy, or read-aloud controls.
|
|
8
|
+
* Offers one footer surface that composes common assistant response actions.
|
|
9
|
+
*/
|
|
7
10
|
export abstract class ArcgisAssistantMessageFooter extends LitElement {
|
|
8
11
|
/** @internal */
|
|
9
12
|
protected _messages: {
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
2
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
|
+
import type { AssistantMessage } from "../arcgis-assistant/types.js";
|
|
3
4
|
|
|
4
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Shows in-progress assistant response UI. Use it to display thinking or loading state while work is running.
|
|
7
|
+
* Offers a default loading message shell with icon/content slot overrides.
|
|
8
|
+
*/
|
|
5
9
|
export abstract class ArcgisAssistantMessageLoading extends LitElement {
|
|
10
|
+
/** @default false */
|
|
11
|
+
accessor assistantAvatarEnabled: boolean;
|
|
12
|
+
accessor interrupts: AssistantMessage["interrupts"] | undefined;
|
|
6
13
|
/** @default false */
|
|
7
14
|
accessor loading: boolean;
|
|
8
15
|
/** @default "" */
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as e, html as
|
|
2
|
+
import { c as s } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as e, html as a } from "lit";
|
|
4
4
|
import { LitElement as i } from "@arcgis/lumina";
|
|
5
5
|
const t = e`: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}}`;
|
|
6
|
-
class
|
|
6
|
+
class n extends i {
|
|
7
7
|
constructor() {
|
|
8
|
-
super(...arguments), this.loading = !1, this.loadingMessage = "";
|
|
8
|
+
super(...arguments), this.loading = !1, this.loadingMessage = "", this.assistantAvatarEnabled = !1;
|
|
9
9
|
}
|
|
10
10
|
static {
|
|
11
|
-
this.properties = { loading: 5, loadingMessage: 1 };
|
|
11
|
+
this.properties = { loading: 5, loadingMessage: 1, assistantAvatarEnabled: 5, interrupts: 0 };
|
|
12
12
|
}
|
|
13
13
|
static {
|
|
14
14
|
this.styles = t;
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
|
-
return this.loading ?
|
|
17
|
+
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;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
s("arcgis-assistant-message-loading", n);
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
n as ArcgisAssistantMessageLoading
|
|
23
23
|
};
|