@arcgis/ai-components 5.2.0-next.1 → 5.2.0-next.100
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/LICENSE.md +4 -2
- package/README.md +2 -2
- package/dist/agent-utils/FunctionAgent.d.ts +2 -2
- package/dist/agent-utils/LLMAgent.d.ts +7 -4
- package/dist/agent-utils/LLMAgent.js +26 -24
- package/dist/agent-utils/WorkflowAgent.d.ts +2 -2
- package/dist/agent-utils/WorkflowAgent.js +14 -15
- package/dist/agent-utils/index.d.ts +177 -0
- package/dist/agent-utils/index.js +167 -0
- package/dist/agent-utils/middlewares/trace.d.ts +2 -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 +37 -8
- 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/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
- package/dist/agentic-workflow/Edge.d.ts +16 -0
- package/dist/agentic-workflow/WebAgent.d.ts +39 -0
- package/dist/agentic-workflow/jsonTypes.d.ts +189 -0
- package/dist/agentic-workflow/nodes/AgentNode.d.ts +28 -0
- package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
- package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
- package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
- package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
- package/dist/agentic-workflow/types.d.ts +29 -0
- package/dist/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/clearFilters/adapter.js +22 -0
- package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/resetMap/adapter.js +22 -0
- package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/setFeatureEffect/adapter.js +121 -0
- package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
- package/dist/agents/tools/help/listFields/adapter.js +30 -0
- package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
- package/dist/agents/tools/navigation/goToAddress/adapter.js +60 -0
- package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToBookmark/adapter.js +30 -0
- package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToFeatures/adapter.js +50 -0
- package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToFullExtent/adapter.js +27 -0
- package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +24 -0
- package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToLayer/adapter.js +26 -0
- package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToScale/adapter.js +21 -0
- package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToViewpoint/adapter.js +42 -0
- package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToZoom/adapter.js +21 -0
- package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getAttribute/adapter.js +40 -0
- package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getStatistics/adapter.js +157 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.js +144 -0
- package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/queryFeatures/adapter.js +130 -0
- package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
- package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
- package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
- package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
- package/dist/cdn/22KHSDJI.js +2 -0
- package/dist/cdn/2EY3BQQX.js +2 -0
- package/dist/cdn/2O4DON37.js +2 -0
- package/dist/cdn/34O57OGV.js +2 -0
- package/dist/cdn/{AMP6IALT.js → 3UEKINYC.js} +1 -1
- package/dist/cdn/434TAA3J.js +2 -0
- package/dist/cdn/4OGR5QKS.js +2 -0
- package/dist/cdn/5FL5BTTX.js +66 -0
- package/dist/cdn/5HBAJ57P.js +2 -0
- package/dist/cdn/5K5ZY267.js +2 -0
- package/dist/cdn/5MK44FNO.js +2 -0
- package/dist/cdn/5WYRJMBW.js +2 -0
- package/dist/cdn/5X7EG7D2.js +2 -0
- package/dist/cdn/5XZLS7UO.js +2 -0
- package/dist/cdn/5ZFUGNRN.js +2 -0
- package/dist/cdn/655YIKL3.js +11 -0
- package/dist/cdn/6ECRQVHY.js +2 -0
- package/dist/cdn/6OOZSZRJ.js +2 -0
- package/dist/cdn/{3PKJWIC3.js → 6P44KOKX.js} +1 -1
- package/dist/cdn/6YYPVU7H.js +3 -0
- package/dist/cdn/7BCQMK6D.js +2 -0
- package/dist/cdn/7SRLZQVC.js +5 -0
- package/dist/cdn/7V6OSTFC.js +2 -0
- package/dist/cdn/7VAQUCBU.js +9 -0
- package/dist/cdn/7VUSIGEM.js +2 -0
- package/dist/cdn/ACJTJLZN.js +2 -0
- package/dist/cdn/AI6DYOKR.js +181 -0
- package/dist/cdn/AKD5UOVX.js +2 -0
- package/dist/cdn/ANRQWYU2.js +2 -0
- package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
- package/dist/cdn/APFZY4PI.js +2 -0
- package/dist/cdn/B2JDVLA6.js +2 -0
- package/dist/cdn/BE7BRJZD.js +2 -0
- package/dist/cdn/{FL4W4VYN.js → BL273EGZ.js} +17 -1
- package/dist/cdn/C4FEETBZ.js +2 -0
- package/dist/cdn/C4JT4S5E.js +2 -0
- package/dist/cdn/CCC6LBMY.js +2 -0
- package/dist/cdn/{5ZZGKP7N.js → CEKOEHB3.js} +1 -1
- package/dist/cdn/CJMUJXPL.js +2 -0
- package/dist/cdn/COH3QXWG.js +4 -0
- package/dist/cdn/CP5BVGJU.js +2 -0
- package/dist/cdn/D5UFYQHN.js +44 -0
- package/dist/cdn/EWLXNGKH.js +208 -0
- package/dist/cdn/EYOWRGDP.js +2 -0
- package/dist/cdn/F5NIRETW.js +2 -0
- package/dist/cdn/FDOMMK2M.js +2 -0
- package/dist/cdn/FG647IP6.js +2 -0
- package/dist/cdn/FJO4KNOZ.js +2 -0
- package/dist/cdn/FUF3NAU7.js +2 -0
- package/dist/cdn/FXP5UIQU.js +156 -0
- package/dist/cdn/{ZLXN7NMF.js → FYZATVB3.js} +10 -8
- package/dist/cdn/G2EGT3CF.js +6 -0
- package/dist/cdn/G3SF6U2U.js +2 -0
- package/dist/cdn/G7OMHU2B.js +2 -0
- package/dist/cdn/HAEFC2SJ.js +2 -0
- package/dist/cdn/HDACNIZF.js +2 -0
- package/dist/cdn/HHFNQR6Z.js +2 -0
- package/dist/cdn/HHUQXL3R.js +2 -0
- package/dist/cdn/IBZ2NEAO.js +2 -0
- package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
- package/dist/cdn/ICQCK5D3.js +2 -0
- package/dist/cdn/IHP25JWI.js +99 -0
- package/dist/cdn/IJVMUS2L.js +14 -0
- package/dist/cdn/J6A4AS7E.js +22 -0
- package/dist/cdn/J6SZIQJA.js +2 -0
- package/dist/cdn/JCOA24UH.js +3 -0
- package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
- package/dist/cdn/JO5ETMPS.js +2 -0
- package/dist/cdn/K2R6XVK3.js +2 -0
- package/dist/cdn/KITIP6J2.js +2 -0
- package/dist/cdn/KWD2ECTM.js +2 -0
- package/dist/cdn/{4HU7735A.js → LAYVGCPL.js} +6 -4
- package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
- package/dist/cdn/LLUGJKAQ.js +2 -0
- package/dist/cdn/MWYBF3F3.js +66 -0
- package/dist/cdn/{V2P4AIGG.js → MXTXJKFE.js} +1 -1
- package/dist/cdn/MY47B3CE.js +3 -0
- package/dist/cdn/NEV6OZN3.js +71 -0
- package/dist/cdn/NNXISHCA.js +14 -0
- package/dist/cdn/NZSOJ726.js +2 -0
- package/dist/cdn/O4NVW75A.js +2 -0
- package/dist/cdn/OE3GW5LE.js +2 -0
- package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
- package/dist/cdn/ONQ6JSBJ.js +2 -0
- package/dist/cdn/OX64WOEL.js +22 -0
- package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
- package/dist/cdn/PUHRBGKB.js +2 -0
- package/dist/cdn/Q57QWN5W.js +2 -0
- package/dist/cdn/QUKNPVAF.js +2 -0
- package/dist/cdn/R2PQVY4O.js +2 -0
- package/dist/cdn/R74ZHFA6.js +2 -0
- package/dist/cdn/RBE55SWR.js +2 -0
- package/dist/cdn/RHYNE5OE.js +2 -0
- package/dist/cdn/RLEHNAIA.js +2 -0
- package/dist/cdn/RVSTAUQS.js +2 -0
- package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
- package/dist/cdn/SXM4NUT5.js +2 -0
- package/dist/cdn/SZ2QSSB3.js +2 -0
- package/dist/cdn/T4RIGOXB.js +2 -0
- package/dist/cdn/TCH5I5LS.js +2 -0
- package/dist/cdn/TEPP7YPR.js +2 -0
- package/dist/cdn/TMVF2W5N.js +36 -0
- package/dist/cdn/TPULIO6I.js +34 -0
- package/dist/cdn/UDRKUVZP.js +2 -0
- package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
- package/dist/cdn/UHNVDALX.js +18 -0
- package/dist/cdn/UZLQALHY.js +2 -0
- package/dist/cdn/V6HOUZPZ.js +2 -0
- package/dist/cdn/VAXH6RUQ.js +134 -0
- package/dist/cdn/VLLZ2FFU.js +2 -0
- package/dist/cdn/VOKXKU7M.js +56 -0
- package/dist/cdn/VXFQANGJ.js +2 -0
- package/dist/cdn/WGO5SER7.js +6 -0
- package/dist/cdn/WJXXOKGA.js +9 -0
- package/dist/cdn/WKTQVBFJ.js +2 -0
- package/dist/cdn/{DHOVCT6R.js → WSWB3B7B.js} +1 -1
- package/dist/cdn/XX6GHMNR.js +2 -0
- package/dist/cdn/Y7XD7ZRD.js +2 -0
- package/dist/cdn/YEZ3AMNX.js +2 -0
- package/dist/cdn/YLVJA4ZE.js +2 -0
- package/dist/cdn/Z5HWPSZN.js +2 -0
- package/dist/cdn/Z5W4V7RC.js +2 -0
- package/dist/cdn/ZDV4K4WG.js +2 -0
- package/dist/cdn/ZOEMBHRF.js +2 -0
- package/dist/cdn/ZRVZMPFN.js +2 -0
- package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
- 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/assets/assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/adapter.js +1299 -2113
- package/dist/chunks/arcgisKnowledgeGraph.js +128 -72
- package/dist/chunks/arcgis_knowledge_current_lc_context.js +19 -2
- package/dist/chunks/arcgis_knowledge_current_map_context.js +31 -2
- package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
- package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +116 -27
- package/dist/chunks/baseAgentState.js +58 -0
- package/dist/chunks/converterUtils.js +66 -41
- package/dist/chunks/dataExplorationGraph.js +135 -179
- package/dist/chunks/data_explore_query_prompt.js +9 -4
- package/dist/chunks/fetchAgentContext.js +13 -0
- package/dist/chunks/fetchService.js +10 -0
- package/dist/chunks/fieldStatistics.js +79 -0
- package/dist/chunks/formatFeatureAttributes.js +132 -0
- package/dist/chunks/generateLayerDescriptions.js +250 -246
- package/dist/chunks/helpGraph.js +35 -25
- package/dist/chunks/help_prompt.js +34 -17
- package/dist/chunks/index.js +11 -0
- package/dist/chunks/intent_prompt.js +16 -0
- package/dist/chunks/layerStylingGraph.js +37 -31
- package/dist/chunks/mergeWhereClauses.js +15 -0
- package/dist/chunks/navigationGraph.js +135 -111
- package/dist/chunks/navigation_intent_prompt.js +8 -2
- package/dist/chunks/orchestrator.js +530 -280
- package/dist/chunks/resolvePointGeometryFilter.js +92 -0
- package/dist/chunks/slottableRequestUtils.js +3 -7
- package/dist/chunks/state.js +21 -27
- package/dist/chunks/summarize_query_response_prompt.js +9 -7
- package/dist/chunks/toolCallResponse.js +14 -10
- package/dist/chunks/utils2.js +11 -11
- package/dist/components/arcgis-assistant/customElement.d.ts +96 -0
- package/dist/components/arcgis-assistant/customElement.js +398 -149
- package/dist/components/arcgis-assistant/index.js +2 -3
- package/dist/components/arcgis-assistant/types.d.ts +14 -1
- package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +614 -10
- package/dist/components/arcgis-assistant-chat/customElement.d.ts +8 -2
- package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
- 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 +20 -4
- package/dist/components/arcgis-assistant-help-agent/customElement.js +29 -7
- package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +8 -1
- package/dist/components/arcgis-assistant-interrupt/customElement.js +17 -14
- package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +24 -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 +40 -16
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +30 -7
- package/dist/components/arcgis-assistant-message/customElement.d.ts +26 -0
- package/dist/components/arcgis-assistant-message/customElement.js +29 -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 +11 -1
- package/dist/components/arcgis-assistant-message-loading/customElement.js +8 -7
- 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 +5 -1
- package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +18 -4
- package/dist/components/arcgis-assistant-speech-input/customElement.d.ts +6 -1
- package/dist/components/arcgis-assistant-speech-input/customElement.js +34 -52
- 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 +6 -1
- package/dist/components/arcgis-assistant-user-message/customElement.js +15 -10
- 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 +9 -8
- package/dist/oauth-callback.html +1 -1
- package/dist/orchestrator/orchestrator/orchestratorEvents.d.ts +78 -0
- package/dist/types/lumina.d.ts +14 -7
- package/dist/types/preact.d.ts +15 -7
- package/dist/types/react.d.ts +16 -7
- package/dist/types/stencil.d.ts +16 -9
- package/dist/utils/index.d.ts +135 -65
- package/dist/utils/index.js +55 -50
- package/package.json +32 -12
- package/dist/cdn/2AXF774U.js +0 -2
- package/dist/cdn/462JBSEV.js +0 -422
- package/dist/cdn/5QAHYX7Y.js +0 -5
- package/dist/cdn/7BCR6TUO.js +0 -2
- package/dist/cdn/7GH7VSB2.js +0 -2
- package/dist/cdn/7PLV4QH6.js +0 -2
- package/dist/cdn/AO7BQHKC.js +0 -2
- package/dist/cdn/AXDZBBNL.js +0 -45
- package/dist/cdn/DDLZOMUY.js +0 -2
- package/dist/cdn/F2AHA4GB.js +0 -54
- package/dist/cdn/FHVXO2WG.js +0 -166
- package/dist/cdn/FX5JFRDL.js +0 -2
- package/dist/cdn/GSEPHN3A.js +0 -106
- package/dist/cdn/H7422XUG.js +0 -2
- package/dist/cdn/HB5A5R2E.js +0 -2
- package/dist/cdn/JY6LLOUJ.js +0 -22
- package/dist/cdn/KMQ3SP4I.js +0 -5
- package/dist/cdn/MDVYQQUG.js +0 -14
- package/dist/cdn/MH5RPXHM.js +0 -2
- package/dist/cdn/NAUXSHIE.js +0 -72
- package/dist/cdn/NVI3I46B.js +0 -2
- package/dist/cdn/OAVEHGB6.js +0 -2
- package/dist/cdn/OH64RMOR.js +0 -4
- package/dist/cdn/ON2V5XI2.js +0 -3
- package/dist/cdn/P6OPJQMC.js +0 -3
- package/dist/cdn/QR54T33D.js +0 -2
- package/dist/cdn/RVOAPUBN.js +0 -2
- package/dist/cdn/S6W6HV4T.js +0 -36
- 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/YIMNOUTF.js +0 -2
- package/dist/cdn/YY2SBO3V.js +0 -2
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Renders a single assistant response message shell. Pass one assistant message object and let it host body and footer actions.
|
|
8
|
+
* Offers a reusable assistant-message layout with icon, content, and footer slot regions.
|
|
9
|
+
*/
|
|
10
|
+
export abstract class ArcgisAssistantMessage extends LitElement {
|
|
11
|
+
/** @internal */
|
|
12
|
+
protected _messages: { loadingLabel: string; } & T9nMeta<{ loadingLabel: string; }>;
|
|
13
|
+
/** @default false */
|
|
14
|
+
accessor assistantAvatarEnabled: boolean;
|
|
15
|
+
/** @default false */
|
|
16
|
+
accessor copyEnabled: boolean;
|
|
17
|
+
/** @default false */
|
|
18
|
+
accessor feedbackEnabled: boolean;
|
|
19
|
+
/** @default false */
|
|
20
|
+
accessor footerDisabled: boolean;
|
|
21
|
+
/** @default false */
|
|
22
|
+
accessor logEnabled: boolean;
|
|
23
|
+
accessor message: AssistantMessage | undefined;
|
|
24
|
+
/** @default false */
|
|
25
|
+
accessor readAloudEnabled: boolean;
|
|
26
|
+
}
|
|
@@ -1,43 +1,46 @@
|
|
|
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 {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}),
|
|
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 { u as g } from "../../chunks/useT9n.js";
|
|
6
|
+
import { useSlottableRequest as m } from "@arcgis/lumina/controllers";
|
|
7
|
+
import { g as r } from "../../chunks/slottableRequestUtils.js";
|
|
8
|
+
const p = 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%;min-width:0;gap:var(--calcite-spacing-md)}.content{display:flex;flex-direction:column;min-width:0;gap:var(--calcite-spacing-sm)}.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}}`;
|
|
9
|
+
function b({ message: t }) {
|
|
10
|
+
const s = /* @__PURE__ */ new Map();
|
|
11
|
+
return t && t.blocks?.forEach((a, i) => {
|
|
12
|
+
if (!a.isPending) {
|
|
13
|
+
const n = r(t.id, i);
|
|
14
|
+
s.set(n, { data: { block: a, index: i, message: t }, name: "block", slotName: n });
|
|
15
|
+
}
|
|
16
|
+
}), s;
|
|
17
17
|
}
|
|
18
|
-
class
|
|
18
|
+
class u extends c {
|
|
19
19
|
constructor() {
|
|
20
|
-
super(...arguments), this.arcgisSlottableRequest =
|
|
20
|
+
super(...arguments), this._messages = g({ blocking: !0 }), this.arcgisSlottableRequest = m(this, ["message"], b), this.feedbackEnabled = !1, this.logEnabled = !1, this.copyEnabled = !1, this.readAloudEnabled = !1, this.footerDisabled = !1, this.assistantAvatarEnabled = !1;
|
|
21
21
|
}
|
|
22
22
|
static {
|
|
23
|
-
this.properties = { feedbackEnabled: 5, logEnabled: 5, copyEnabled: 5, readAloudEnabled: 5, footerDisabled: 5, message: 0 };
|
|
23
|
+
this.properties = { _isStreaming: 16, feedbackEnabled: 5, logEnabled: 5, copyEnabled: 5, readAloudEnabled: 5, footerDisabled: 5, message: 0, assistantAvatarEnabled: 5 };
|
|
24
24
|
}
|
|
25
25
|
static {
|
|
26
|
-
this.styles =
|
|
26
|
+
this.styles = p;
|
|
27
|
+
}
|
|
28
|
+
get _isStreaming() {
|
|
29
|
+
return !!this.message?.isStreaming;
|
|
27
30
|
}
|
|
28
31
|
_renderContent() {
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
31
|
-
return
|
|
32
|
+
const s = this.message, a = s?.id;
|
|
33
|
+
if (a)
|
|
34
|
+
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
35
|
}
|
|
33
36
|
_renderFooter() {
|
|
34
|
-
return
|
|
37
|
+
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
38
|
}
|
|
36
39
|
render() {
|
|
37
|
-
return
|
|
40
|
+
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=${this._messages.loadingLabel} inline></calcite-loader></div>` : null}${!this.footerDisabled && !this._isStreaming ? e`<slot name=footer>${this._renderFooter()}</slot>` : null}</div></div>`;
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
|
-
|
|
43
|
+
o("arcgis-assistant-message", u);
|
|
41
44
|
export {
|
|
42
|
-
|
|
45
|
+
u as ArcgisAssistantMessage
|
|
43
46
|
};
|
|
@@ -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} .parts=${s.data?.parts}></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,18 @@
|
|
|
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";
|
|
4
|
+
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
3
5
|
|
|
4
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Shows in-progress assistant response UI. Use it to display thinking or loading state while work is running.
|
|
8
|
+
* Offers a default loading message shell with icon/content slot overrides.
|
|
9
|
+
*/
|
|
5
10
|
export abstract class ArcgisAssistantMessageLoading extends LitElement {
|
|
11
|
+
/** @internal */
|
|
12
|
+
protected _messages: { loadingLabel: string; } & T9nMeta<{ loadingLabel: string; }>;
|
|
13
|
+
/** @default false */
|
|
14
|
+
accessor assistantAvatarEnabled: boolean;
|
|
15
|
+
accessor interrupts: AssistantMessage["interrupts"] | undefined;
|
|
6
16
|
/** @default false */
|
|
7
17
|
accessor loading: boolean;
|
|
8
18
|
/** @default "" */
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { c as a } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as e, html as s } from "lit";
|
|
4
|
-
import { LitElement as
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { LitElement as t } from "@arcgis/lumina";
|
|
5
|
+
import { u as i } from "../../chunks/useT9n.js";
|
|
6
|
+
const n = 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}}`;
|
|
7
|
+
class o extends t {
|
|
7
8
|
constructor() {
|
|
8
|
-
super(...arguments), this.loading = !1, this.loadingMessage = "";
|
|
9
|
+
super(...arguments), this._messages = i({ blocking: !0 }), this.loading = !1, this.loadingMessage = "", this.assistantAvatarEnabled = !1;
|
|
9
10
|
}
|
|
10
11
|
static {
|
|
11
|
-
this.properties = { loading: 5, loadingMessage: 1 };
|
|
12
|
+
this.properties = { loading: 5, loadingMessage: 1, assistantAvatarEnabled: 5, interrupts: 0 };
|
|
12
13
|
}
|
|
13
14
|
static {
|
|
14
|
-
this.styles =
|
|
15
|
+
this.styles = n;
|
|
15
16
|
}
|
|
16
17
|
render() {
|
|
17
|
-
return this.loading ? s`<arcgis-assistant-message footer-disabled
|
|
18
|
+
return this.loading ? s`<arcgis-assistant-message .assistantAvatarEnabled=${this.assistantAvatarEnabled} footer-disabled>${this.assistantAvatarEnabled ? s`<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=${this._messages.loadingLabel} 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
19
|
}
|
|
19
20
|
}
|
|
20
21
|
a("arcgis-assistant-message-loading", o);
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
2
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Renders expandable execution log details. Use it when exposing agent or tool trace output.
|
|
6
|
+
* Offers collapsible log entry rendering for debugging and troubleshooting.
|
|
7
|
+
*/
|
|
5
8
|
export abstract class ArcgisAssistantMessageLog extends LitElement {
|
|
6
9
|
accessor log: string[] | undefined;
|
|
7
10
|
/** @default false */
|
|
@@ -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
|
+
* Adds text-to-speech playback controls. Use it to read assistant responses aloud.
|
|
8
|
+
* Offers read-aloud start/stop behavior with supported-state handling.
|
|
9
|
+
*/
|
|
7
10
|
export abstract class ArcgisAssistantMessageReadAloud extends LitElement {
|
|
8
11
|
/** @internal */
|
|
9
12
|
protected _messages: {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
2
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Renders assistant message text content. Use it when the block is plain text output.
|
|
6
|
+
* Offers sanitized rich-text rendering for assistant-generated message content.
|
|
7
|
+
*/
|
|
5
8
|
export abstract class ArcgisAssistantMessageText extends LitElement {
|
|
6
9
|
accessor content: string | undefined;
|
|
10
|
+
accessor parts: string[] | undefined;
|
|
7
11
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
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 { unsafeHTML as
|
|
6
|
-
import { p as
|
|
7
|
-
const
|
|
8
|
-
class
|
|
2
|
+
import { c as r } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as i, html as t } from "lit";
|
|
4
|
+
import { LitElement as c } from "@arcgis/lumina";
|
|
5
|
+
import { unsafeHTML as a } from "lit/directives/unsafe-html.js";
|
|
6
|
+
import { a as n, p as o } from "../../chunks/converterUtils.js";
|
|
7
|
+
const s = i`.container{color:var(--calcite-color-text-1);min-width:0}.content{min-width:0;overflow-wrap:anywhere}.content>*{margin:0}.content>*+*{margin-block-start:var(--calcite-spacing-sm)}.content :is(ol,ul){padding-inline-start:var(--calcite-spacing-lg)}.content>calcite-table{display:block;max-width:100%}.content pre{background-color:var(--calcite-color-foreground-1);padding:var(--calcite-spacing-sm);border-radius:var(--calcite-border-radius);color:var(--calcite-color-text-1);direction:ltr;max-width:100%;overflow:auto}.content pre code{display:block;white-space:pre;font-family:var(--calcite-code-family)}.part{animation:part-reveal calc(3 * var(--calcite-animation-timing)) ease-out}@keyframes part-reveal{0%{opacity:0;transform:translateY(var(--calcite-size-fixed-xxs))}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.part{animation:none}}`;
|
|
8
|
+
class l extends c {
|
|
9
9
|
static {
|
|
10
|
-
this.properties = { content: 1 };
|
|
10
|
+
this.properties = { content: 1, parts: 0 };
|
|
11
11
|
}
|
|
12
12
|
static {
|
|
13
|
-
this.styles =
|
|
13
|
+
this.styles = s;
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
|
-
return
|
|
16
|
+
return t`<div class="container"><div class="content">${this.parts?.map((e) => t`<span class="part">${a(n(e))}</span>`) ?? a(o(this.content))}</div></div>`;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
r("arcgis-assistant-message-text", l);
|
|
20
20
|
export {
|
|
21
|
-
|
|
21
|
+
l as ArcgisAssistantMessageText
|
|
22
22
|
};
|
|
@@ -6,21 +6,31 @@ import "@langchain/langgraph/web";
|
|
|
6
6
|
import "../../chunks/adapter.js";
|
|
7
7
|
import "@arcgis/core/identity/IdentityManager.js";
|
|
8
8
|
import "@arcgis/core/portal/Portal.js";
|
|
9
|
+
import "@arcgis/core/request.js";
|
|
10
|
+
import "@arcgis/toolkit/string";
|
|
9
11
|
import "../../chunks/generateLayerDescriptions.js";
|
|
10
12
|
import "@langchain/core/messages";
|
|
11
13
|
import "@langchain/core/callbacks/dispatch/web";
|
|
14
|
+
import "@langchain/core/callbacks/base";
|
|
12
15
|
import "@langchain/openai";
|
|
16
|
+
import "@arcgis/core/config.js";
|
|
13
17
|
import "@arcgis/core/core/reactiveUtils.js";
|
|
14
18
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
15
|
-
import "@arcgis/core/request.js";
|
|
16
19
|
import "@langchain/core/prompts";
|
|
20
|
+
import "../../agents/tools/filter/clearFilters/adapter.js";
|
|
21
|
+
import "../../agents/tools/filter/resetMap/adapter.js";
|
|
22
|
+
import "../../agents/tools/filter/setFeatureEffect/adapter.js";
|
|
23
|
+
import "../../agents/tools/query/getAttribute/adapter.js";
|
|
24
|
+
import "../../agents/tools/query/getStatistics/adapter.js";
|
|
25
|
+
import "../../agents/tools/query/getTopFeatures/adapter.js";
|
|
26
|
+
import "../../agents/tools/query/queryFeatures/adapter.js";
|
|
17
27
|
import "@arcgis/core/intl.js";
|
|
18
28
|
import "@langchain/langgraph/prebuilt";
|
|
19
29
|
import "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
|
|
20
30
|
import "@arcgis/core/smartMapping/statistics/uniqueValues.js";
|
|
21
|
-
import "
|
|
31
|
+
import "../../agents/tools/help/listFields/adapter.js";
|
|
22
32
|
import "@arcgis/core/rest/knowledgeGraphService.js";
|
|
23
|
-
import { r as o,
|
|
33
|
+
import { r as o, i as s } from "../../chunks/utils2.js";
|
|
24
34
|
class a extends i {
|
|
25
35
|
constructor() {
|
|
26
36
|
super(...arguments), this.agent = r;
|
|
@@ -29,13 +39,17 @@ class a extends i {
|
|
|
29
39
|
this.properties = { referenceElement: 1 };
|
|
30
40
|
}
|
|
31
41
|
#t;
|
|
42
|
+
#i;
|
|
32
43
|
getContext() {
|
|
33
44
|
if (!this.#t)
|
|
34
45
|
throw new Error("arcgis-assistant-navigation-agent requires a mapView");
|
|
35
46
|
return { mapView: this.#t };
|
|
36
47
|
}
|
|
37
48
|
load() {
|
|
38
|
-
this.#t = o(this, "arcgis-assistant-navigation-agent"), s(this);
|
|
49
|
+
this.#t = o(this, "arcgis-assistant-navigation-agent"), this.#i = s(this);
|
|
50
|
+
}
|
|
51
|
+
disconnectedCallback() {
|
|
52
|
+
this.#i?.unregister(this.agent.id), super.disconnectedCallback();
|
|
39
53
|
}
|
|
40
54
|
}
|
|
41
55
|
t("arcgis-assistant-navigation-agent", a);
|
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
3
|
import type { VoiceInputDraftChangeDetail, VoiceInputErrorCode, VoiceInputMode, VoiceInputTranscriptDetail, VoiceInputTranscriptionStreamChunkDetail } from "./support/types.js";
|
|
4
4
|
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Captures voice input and drafts transcript text. Use it to support microphone-based prompt entry.
|
|
7
|
+
* Offers voice session lifecycle management and transcription event streams.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
6
11
|
export abstract class ArcgisAssistantSpeechInput extends LitElement {
|
|
7
12
|
/** @default false */
|
|
8
13
|
accessor awaitingResponse: boolean;
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
4
|
-
import {
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import I from "@arcgis/core/core/Accessor.js";
|
|
2
|
+
import { c as C } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as S, html as R } from "lit";
|
|
4
|
+
import { watch as p } from "@arcgis/core/core/reactiveUtils.js";
|
|
5
|
+
import { LitElement as y, createEvent as d, nothing as v } from "@arcgis/lumina";
|
|
7
6
|
import { property as l, subclass as f } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
8
|
-
|
|
7
|
+
import w from "@arcgis/core/core/Accessor.js";
|
|
8
|
+
const I = S`.button{--calcite-button-background-color: var(--calcite-color-transparent);--calcite-button-border-color: transparent;--calcite-button-icon-color: var(--calcite-color-text-3);--calcite-button-text-color: var(--calcite-color-text-3);flex:0 0 auto;position:relative}.button[data-state=disabled]{--calcite-button-icon-color: var(--calcite-color-text-3);opacity:var(--calcite-opacity-disabled)}.button[data-state=listening]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 14%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-brand) 24%, transparent);--calcite-button-icon-color: var(--calcite-color-brand);--calcite-button-text-color: var(--calcite-color-brand);box-shadow:var(--calcite-shadow-sm)}.button[data-state=listening]:hover{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand-hover, var(--calcite-color-brand)) 18%, var(--calcite-color-foreground-1) )}.button[data-state=listening]:active{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 24%, var(--calcite-color-foreground-1) )}.button[data-state=processing]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 10%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-brand) 20%, transparent);--calcite-button-icon-color: var(--calcite-color-brand);--calcite-button-text-color: var(--calcite-color-brand)}.button[data-state=error]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-status-danger) 12%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-status-danger) 24%, transparent);--calcite-button-icon-color: var(--calcite-color-status-danger);--calcite-button-text-color: var(--calcite-color-status-danger)}.button[data-state=listening]:after{content:"";position:absolute;inset:-4px;border:1px solid color-mix(in srgb,var(--calcite-color-brand) 40%,transparent);border-radius:inherit;opacity:0;pointer-events:none;transform:scale(.92);animation:assistant-speech-input-recording-pulse 1.8s ease-out infinite}@keyframes assistant-speech-input-recording-pulse{0%{opacity:.65;transform:scale(.92)}70%{opacity:0;transform:scale(1.16)}to{opacity:0;transform:scale(1.16)}}@media(prefers-reduced-motion){.button[data-state=listening]:after{animation:none}}`, T = [
|
|
9
|
+
"audio/webm;codecs=opus",
|
|
10
|
+
"audio/webm",
|
|
11
|
+
"audio/mp4",
|
|
12
|
+
"audio/ogg;codecs=opus",
|
|
13
|
+
"audio/ogg"
|
|
14
|
+
];
|
|
15
|
+
function h(t) {
|
|
16
|
+
return t.replace(/\s+/gu, " ").trim();
|
|
17
|
+
}
|
|
9
18
|
var k = Object.defineProperty, x = Object.getOwnPropertyDescriptor, u = (t, e, s, i) => {
|
|
10
19
|
for (var r = i > 1 ? void 0 : i ? x(e, s) : e, n = t.length - 1, o; n >= 0; n--)
|
|
11
20
|
(o = t[n]) && (r = (i ? o(e, s, r) : o(r)) || r);
|
|
12
21
|
return i && r && k(e, s, r), r;
|
|
13
22
|
};
|
|
14
|
-
let a = class extends
|
|
23
|
+
let a = class extends w {
|
|
15
24
|
constructor(t) {
|
|
16
25
|
super(t), this.state = "idle", this.liveTranscript = "", this.transcript = "", this.errorCode = void 0;
|
|
17
26
|
}
|
|
@@ -37,37 +46,17 @@ u([
|
|
|
37
46
|
a = u([
|
|
38
47
|
f("SpeechController")
|
|
39
48
|
], a);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"audio/webm",
|
|
43
|
-
"audio/mp4",
|
|
44
|
-
"audio/ogg;codecs=opus",
|
|
45
|
-
"audio/ogg"
|
|
46
|
-
];
|
|
47
|
-
function h(t) {
|
|
48
|
-
return t.replace(/\s+/gu, " ").trim();
|
|
49
|
-
}
|
|
50
|
-
var O = Object.defineProperty, M = Object.getOwnPropertyDescriptor, g = (t, e, s, i) => {
|
|
51
|
-
for (var r = i > 1 ? void 0 : i ? M(e, s) : e, n = t.length - 1, o; n >= 0; n--)
|
|
49
|
+
var V = Object.defineProperty, O = Object.getOwnPropertyDescriptor, g = (t, e, s, i) => {
|
|
50
|
+
for (var r = i > 1 ? void 0 : i ? O(e, s) : e, n = t.length - 1, o; n >= 0; n--)
|
|
52
51
|
(o = t[n]) && (r = (i ? o(e, s, r) : o(r)) || r);
|
|
53
|
-
return i && r &&
|
|
52
|
+
return i && r && V(e, s, r), r;
|
|
54
53
|
};
|
|
55
54
|
let c = class extends a {
|
|
56
55
|
constructor(t) {
|
|
57
56
|
super(t), this._activeSessionId = null, this._mediaRecorder = null, this._mediaRecorderChunkIndex = 0, this._mediaRecorderStopReason = null, this._mediaStream = null, this._pendingChunkOperations = /* @__PURE__ */ new Set(), this._recordedChunks = [], this.handleRecording = null, this.chunkTimeSlice = 3e3;
|
|
58
57
|
}
|
|
59
58
|
get _mimeType() {
|
|
60
|
-
return typeof window > "u" || typeof window.MediaRecorder?.isTypeSupported != "function" ? "" :
|
|
61
|
-
}
|
|
62
|
-
initialize() {
|
|
63
|
-
c.isSupported() && this.addHandles(
|
|
64
|
-
C(
|
|
65
|
-
() => !!this.errorCode,
|
|
66
|
-
() => {
|
|
67
|
-
this._set("state", "error");
|
|
68
|
-
}
|
|
69
|
-
)
|
|
70
|
-
);
|
|
59
|
+
return typeof window > "u" || typeof window.MediaRecorder?.isTypeSupported != "function" ? "" : T.find((t) => window.MediaRecorder.isTypeSupported(t)) ?? "";
|
|
71
60
|
}
|
|
72
61
|
destroy() {
|
|
73
62
|
this._mediaRecorder && (this._mediaRecorder.onstart = null, this._mediaRecorder.ondataavailable = null, this._mediaRecorder.onerror = null, this._mediaRecorder.onstop = null), this.cancel(), this._mediaRecorder = null;
|
|
@@ -119,7 +108,7 @@ let c = class extends a {
|
|
|
119
108
|
} catch {
|
|
120
109
|
}
|
|
121
110
|
}
|
|
122
|
-
this._activeSessionId = null, this._mediaRecorder = null, this._mediaRecorderChunkIndex = 0, this._mediaRecorderStopReason = null, this._pendingChunkOperations.clear(), this._recordedChunks = [], this._releaseMediaStream(), this._set("liveTranscript", ""), this._set("transcript", ""), this._set("errorCode", t);
|
|
111
|
+
this._activeSessionId = null, this._mediaRecorder = null, this._mediaRecorderChunkIndex = 0, this._mediaRecorderStopReason = null, this._pendingChunkOperations.clear(), this._recordedChunks = [], this._releaseMediaStream(), this._set("liveTranscript", ""), this._set("transcript", ""), this._set("state", "error"), this._set("errorCode", t);
|
|
123
112
|
}
|
|
124
113
|
_onError() {
|
|
125
114
|
this._failSession("recording-failed");
|
|
@@ -146,7 +135,7 @@ let c = class extends a {
|
|
|
146
135
|
if (await this._awaitPendingChunkOperations(), e !== this._activeSessionId)
|
|
147
136
|
return;
|
|
148
137
|
if (!(i ? new Blob(r, { type: i }) : new Blob(r)).size) {
|
|
149
|
-
this._activeSessionId === e && (this._activeSessionId = null), this._mediaRecorderStopReason = null, this._recordedChunks = [], this._set("errorCode", "recording-failed");
|
|
138
|
+
this._activeSessionId === e && (this._activeSessionId = null), this._mediaRecorderStopReason = null, this._recordedChunks = [], this._set("state", "error"), this._set("errorCode", "recording-failed");
|
|
150
139
|
return;
|
|
151
140
|
}
|
|
152
141
|
this._set("state", "processing"), this._set("transcript", h(`${this.transcript} ${this.liveTranscript}`)), this._set("liveTranscript", ""), this._activeSessionId === e && (this._activeSessionId = null), this._set("state", "idle"), this._set("errorCode", void 0), this._mediaRecorderStopReason = null, this._recordedChunks = [];
|
|
@@ -165,7 +154,7 @@ let c = class extends a {
|
|
|
165
154
|
const s = this._mimeType, i = s ? new window.MediaRecorder(e, { mimeType: s }) : new window.MediaRecorder(e);
|
|
166
155
|
this._mediaStream = e, this._mediaRecorder = i, this._mediaRecorderChunkIndex = 0, this._mediaRecorderStopReason = null, this._recordedChunks = [], i.ondataavailable = this._onDataAvailable.bind(this), i.onerror = this._onError.bind(this), i.onstart = this._onStart.bind(this), i.onstop = this._onStop.bind(this), this._mediaRecorder.start(this.chunkTimeSlice);
|
|
167
156
|
}).catch((e) => {
|
|
168
|
-
t === this._activeSessionId && (this._activeSessionId = null, this._mediaRecorder = null, this._mediaRecorderChunkIndex = 0, this._mediaRecorderStopReason = null, this._pendingChunkOperations.clear(), this._recordedChunks = [], this._releaseMediaStream(), e instanceof DOMException && e.name === "NotAllowedError" ? this._set("errorCode", "not-allowed") : this._set("errorCode", "recording-failed"));
|
|
157
|
+
t === this._activeSessionId && (this._activeSessionId = null, this._mediaRecorder = null, this._mediaRecorderChunkIndex = 0, this._mediaRecorderStopReason = null, this._pendingChunkOperations.clear(), this._recordedChunks = [], this._releaseMediaStream(), e instanceof DOMException && e.name === "NotAllowedError" ? (this._set("state", "error"), this._set("errorCode", "not-allowed")) : (this._set("state", "error"), this._set("errorCode", "recording-failed")));
|
|
169
158
|
});
|
|
170
159
|
}
|
|
171
160
|
stop() {
|
|
@@ -208,8 +197,8 @@ g([
|
|
|
208
197
|
c = g([
|
|
209
198
|
f("MediaRecorderController")
|
|
210
199
|
], c);
|
|
211
|
-
var
|
|
212
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
200
|
+
var M = Object.getOwnPropertyDescriptor, D = (t, e, s, i) => {
|
|
201
|
+
for (var r = i > 1 ? void 0 : i ? M(e, s) : e, n = t.length - 1, o; n >= 0; n--)
|
|
213
202
|
(o = t[n]) && (r = o(r) || r);
|
|
214
203
|
return r;
|
|
215
204
|
};
|
|
@@ -228,14 +217,7 @@ let _ = class extends a {
|
|
|
228
217
|
if (!t)
|
|
229
218
|
return;
|
|
230
219
|
const e = new t();
|
|
231
|
-
e.continuous = !0, e.interimResults = !0, this.language && (e.lang = this.language), e.onstart = this._onStart.bind(this), e.onresult = this._onResult.bind(this), e.onerror = this._onError.bind(this), e.onend = this._onEnd.bind(this), e.onspeechend = this._onSpeechEnd.bind(this), this._recognition = e
|
|
232
|
-
C(
|
|
233
|
-
() => !!this.errorCode,
|
|
234
|
-
() => {
|
|
235
|
-
this._set("state", "error");
|
|
236
|
-
}
|
|
237
|
-
)
|
|
238
|
-
);
|
|
220
|
+
e.continuous = !0, e.interimResults = !0, this.language && (e.lang = this.language), e.onstart = this._onStart.bind(this), e.onresult = this._onResult.bind(this), e.onerror = this._onError.bind(this), e.onend = this._onEnd.bind(this), e.onspeechend = this._onSpeechEnd.bind(this), this._recognition = e;
|
|
239
221
|
}
|
|
240
222
|
destroy() {
|
|
241
223
|
this._recognition && (this._recognition.onstart = null, this._recognition.onresult = null, this._recognition.onerror = null, this._recognition.onend = null, this._recognition.onspeechend = null, this.cancel(), this._recognition = null);
|
|
@@ -268,7 +250,7 @@ let _ = class extends a {
|
|
|
268
250
|
default:
|
|
269
251
|
e = "unhandled";
|
|
270
252
|
}
|
|
271
|
-
this._set("errorCode", e);
|
|
253
|
+
this._set("state", "error"), this._set("errorCode", e);
|
|
272
254
|
}
|
|
273
255
|
// Natural end can arrive before the last interim segment becomes final, so preserve that trailing text.
|
|
274
256
|
_onEnd() {
|
|
@@ -294,7 +276,7 @@ let _ = class extends a {
|
|
|
294
276
|
try {
|
|
295
277
|
this._recognition.start();
|
|
296
278
|
} catch {
|
|
297
|
-
this._set("errorCode", "unhandled");
|
|
279
|
+
this._set("state", "error"), this._set("errorCode", "unhandled");
|
|
298
280
|
}
|
|
299
281
|
}
|
|
300
282
|
stop() {
|
|
@@ -319,7 +301,7 @@ let _ = class extends a {
|
|
|
319
301
|
return !!b();
|
|
320
302
|
}
|
|
321
303
|
};
|
|
322
|
-
_ =
|
|
304
|
+
_ = D([
|
|
323
305
|
f("WebSpeechController")
|
|
324
306
|
], _);
|
|
325
307
|
function m(t) {
|
|
@@ -329,7 +311,7 @@ function m(t) {
|
|
|
329
311
|
const i = e.trim();
|
|
330
312
|
return i ? `${i} ${s}` : s;
|
|
331
313
|
}
|
|
332
|
-
class
|
|
314
|
+
class $ extends y {
|
|
333
315
|
constructor() {
|
|
334
316
|
super(...arguments), this.#e = null, this._resolvedMode = "disabled", this.awaitingResponse = !1, this.inputValue = "", this.mode = "web-speech", this.arcgisVoiceInputDraftChange = d(), this.arcgisVoiceInputError = d(), this.arcgisVoiceInputInterimTranscription = d(), this.arcgisVoiceInputStart = d(), this.arcgisVoiceInputStop = d(), this.arcgisVoiceInputTranscription = d(), this.arcgisVoiceInputTranscriptionStreamChunk = d();
|
|
335
317
|
}
|
|
@@ -337,7 +319,7 @@ class E extends w {
|
|
|
337
319
|
this.properties = { _resolvedMode: 16, _state: 16, _errorCode: 16, _liveTranscript: 16, _transcript: 16, _isButtonDisabled: 16, _buttonLabel: 16, awaitingResponse: 5, inputValue: 1, language: 1, mode: 1 };
|
|
338
320
|
}
|
|
339
321
|
static {
|
|
340
|
-
this.styles =
|
|
322
|
+
this.styles = I;
|
|
341
323
|
}
|
|
342
324
|
#e;
|
|
343
325
|
get _state() {
|
|
@@ -477,12 +459,12 @@ class E extends w {
|
|
|
477
459
|
this._speechController && this._resolvedMode !== "disabled" && this._speechController.cancel(), this.clearDraftSession();
|
|
478
460
|
}
|
|
479
461
|
render() {
|
|
480
|
-
return
|
|
462
|
+
return R`<calcite-button appearance=transparent class="button" data-mode=${this._resolvedMode ?? v} data-state=${(this._resolvedMode === "disabled" ? "disabled" : this._state) ?? v} .disabled=${this._isButtonDisabled} icon-start=microphone kind=neutral .label=${this._buttonLabel} .loading=${this._state === "processing"} round scale=m @click=${() => {
|
|
481
463
|
this._handleToggle();
|
|
482
464
|
}}></calcite-button>`;
|
|
483
465
|
}
|
|
484
466
|
}
|
|
485
|
-
|
|
467
|
+
C("arcgis-assistant-speech-input", $);
|
|
486
468
|
export {
|
|
487
|
-
|
|
469
|
+
$ as ArcgisAssistantSpeechInput
|
|
488
470
|
};
|