@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
package/dist/types/preact.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import type { ArcgisAssistantNavigationAgent } from "../components/arcgis-assist
|
|
|
9
9
|
import type { ArcgisAssistantChat } from "../components/arcgis-assistant-chat/customElement.js";
|
|
10
10
|
import type { ArcgisAssistantChatEntry } from "../components/arcgis-assistant-chat-entry/customElement.js";
|
|
11
11
|
import type { ArcgisAssistantInterrupt } from "../components/arcgis-assistant-interrupt/customElement.js";
|
|
12
|
+
import type { ArcgisAssistantMessage } from "../components/arcgis-assistant-message/customElement.js";
|
|
12
13
|
import type { ArcgisAssistantMessageBlock } from "../components/arcgis-assistant-message-block/customElement.js";
|
|
13
14
|
import type { ArcgisAssistantMessageFeedback } from "../components/arcgis-assistant-message-feedback/customElement.js";
|
|
14
15
|
import type { ArcgisAssistantMessageFooter } from "../components/arcgis-assistant-message-footer/customElement.js";
|
|
@@ -22,7 +23,7 @@ import type { ArcgisAssistantUserMessage } from "../components/arcgis-assistant-
|
|
|
22
23
|
import { HTMLAttributes } from "preact";
|
|
23
24
|
import type { EventHandler } from "@arcgis/lumina";
|
|
24
25
|
|
|
25
|
-
interface PreactArcgisAssistant extends Partial<Pick<ArcgisAssistant, "copyEnabled" | "description" | "entryMessage" | "feedbackEnabled" | "heading" | "keepSuggestedPrompts" | "logEnabled" | "messages" | "referenceElement" | "suggestedPrompts">>, HTMLAttributes<ArcgisAssistant> {
|
|
26
|
+
interface PreactArcgisAssistant extends Partial<Pick<ArcgisAssistant, "assistantAvatarEnabled" | "copyEnabled" | "description" | "entryMessage" | "feedbackEnabled" | "heading" | "keepSuggestedPrompts" | "logEnabled" | "messages" | "referenceElement" | "suggestedPrompts">>, HTMLAttributes<ArcgisAssistant> {
|
|
26
27
|
onarcgisCancel?: EventHandler<ArcgisAssistant["arcgisCancel"]>;
|
|
27
28
|
onarcgisError?: EventHandler<ArcgisAssistant["arcgisError"]>;
|
|
28
29
|
onarcgisFeedback?: EventHandler<ArcgisAssistant["arcgisFeedback"]>;
|
|
@@ -31,6 +32,7 @@ interface PreactArcgisAssistant extends Partial<Pick<ArcgisAssistant, "copyEnabl
|
|
|
31
32
|
onarcgisInterruptSubmit?: EventHandler<ArcgisAssistant["arcgisInterruptSubmit"]>;
|
|
32
33
|
onarcgisPromptSelect?: EventHandler<ArcgisAssistant["arcgisPromptSelect"]>;
|
|
33
34
|
onarcgisReady?: EventHandler<ArcgisAssistant["arcgisReady"]>;
|
|
35
|
+
onarcgisResponse?: EventHandler<ArcgisAssistant["arcgisResponse"]>;
|
|
34
36
|
onarcgisSlottableRequest?: EventHandler<ArcgisAssistant["arcgisSlottableRequest"]>;
|
|
35
37
|
onarcgisSubmit?: EventHandler<ArcgisAssistant["arcgisSubmit"]>;
|
|
36
38
|
}
|
|
@@ -53,10 +55,10 @@ interface PreactArcgisAssistantLayerStylingAgent extends Partial<Pick<ArcgisAssi
|
|
|
53
55
|
interface PreactArcgisAssistantNavigationAgent extends Partial<Pick<ArcgisAssistantNavigationAgent, "referenceElement">>, HTMLAttributes<ArcgisAssistantNavigationAgent> {
|
|
54
56
|
}
|
|
55
57
|
|
|
56
|
-
interface PreactArcgisAssistantChat extends Partial<Pick<ArcgisAssistantChat, "loading" | "messages">>, HTMLAttributes<ArcgisAssistantChat> {
|
|
58
|
+
interface PreactArcgisAssistantChat extends Partial<Pick<ArcgisAssistantChat, "interrupt" | "loading" | "messages">>, HTMLAttributes<ArcgisAssistantChat> {
|
|
57
59
|
}
|
|
58
60
|
|
|
59
|
-
interface PreactArcgisAssistantChatEntry extends Partial<Pick<ArcgisAssistantChatEntry, "awaitingResponse" | "entryPlaceholder" | "inputValue" | "keyboardShortcutsDisabled" | "messages" | "status" | "voiceInputEnabled">>, HTMLAttributes<ArcgisAssistantChatEntry> {
|
|
61
|
+
interface PreactArcgisAssistantChatEntry extends Partial<Pick<ArcgisAssistantChatEntry, "awaitingResponse" | "disabled" | "entryPlaceholder" | "inputValue" | "keyboardShortcutsDisabled" | "messages" | "status" | "voiceInputEnabled">>, HTMLAttributes<ArcgisAssistantChatEntry> {
|
|
60
62
|
onarcgisCancel?: EventHandler<ArcgisAssistantChatEntry["arcgisCancel"]>;
|
|
61
63
|
onarcgisSubmit?: EventHandler<ArcgisAssistantChatEntry["arcgisSubmit"]>;
|
|
62
64
|
}
|
|
@@ -66,6 +68,9 @@ interface PreactArcgisAssistantInterrupt extends Partial<Pick<ArcgisAssistantInt
|
|
|
66
68
|
onarcgisSubmit?: EventHandler<ArcgisAssistantInterrupt["arcgisSubmit"]>;
|
|
67
69
|
}
|
|
68
70
|
|
|
71
|
+
interface PreactArcgisAssistantMessage extends Partial<Pick<ArcgisAssistantMessage, "assistantAvatarEnabled" | "copyEnabled" | "feedbackEnabled" | "footerDisabled" | "logEnabled" | "message" | "readAloudEnabled">>, HTMLAttributes<ArcgisAssistantMessage> {
|
|
72
|
+
}
|
|
73
|
+
|
|
69
74
|
interface PreactArcgisAssistantMessageBlock extends Partial<Pick<ArcgisAssistantMessageBlock, "block">>, HTMLAttributes<ArcgisAssistantMessageBlock> {
|
|
70
75
|
}
|
|
71
76
|
|
|
@@ -76,7 +81,7 @@ interface PreactArcgisAssistantMessageFeedback extends Partial<Pick<ArcgisAssist
|
|
|
76
81
|
interface PreactArcgisAssistantMessageFooter extends Partial<Pick<ArcgisAssistantMessageFooter, "copyEnabled" | "feedbackEnabled" | "logEnabled" | "message" | "readAloudEnabled">>, HTMLAttributes<ArcgisAssistantMessageFooter> {
|
|
77
82
|
}
|
|
78
83
|
|
|
79
|
-
interface PreactArcgisAssistantMessageLoading extends Partial<Pick<ArcgisAssistantMessageLoading, "loading" | "loadingMessage">>, HTMLAttributes<ArcgisAssistantMessageLoading> {
|
|
84
|
+
interface PreactArcgisAssistantMessageLoading extends Partial<Pick<ArcgisAssistantMessageLoading, "assistantAvatarEnabled" | "interrupts" | "loading" | "loadingMessage">>, HTMLAttributes<ArcgisAssistantMessageLoading> {
|
|
80
85
|
}
|
|
81
86
|
|
|
82
87
|
interface PreactArcgisAssistantMessageLog extends Partial<Pick<ArcgisAssistantMessageLog, "log" | "logEnabled" | "showLog">>, HTMLAttributes<ArcgisAssistantMessageLog> {
|
|
@@ -118,6 +123,7 @@ declare module 'preact' {
|
|
|
118
123
|
"arcgis-assistant-chat": PreactArcgisAssistantChat;
|
|
119
124
|
"arcgis-assistant-chat-entry": PreactArcgisAssistantChatEntry;
|
|
120
125
|
"arcgis-assistant-interrupt": PreactArcgisAssistantInterrupt;
|
|
126
|
+
"arcgis-assistant-message": PreactArcgisAssistantMessage;
|
|
121
127
|
"arcgis-assistant-message-block": PreactArcgisAssistantMessageBlock;
|
|
122
128
|
"arcgis-assistant-message-feedback": PreactArcgisAssistantMessageFeedback;
|
|
123
129
|
"arcgis-assistant-message-footer": PreactArcgisAssistantMessageFooter;
|
|
@@ -142,6 +148,7 @@ declare module 'preact' {
|
|
|
142
148
|
"arcgis-assistant-chat": PreactArcgisAssistantChat;
|
|
143
149
|
"arcgis-assistant-chat-entry": PreactArcgisAssistantChatEntry;
|
|
144
150
|
"arcgis-assistant-interrupt": PreactArcgisAssistantInterrupt;
|
|
151
|
+
"arcgis-assistant-message": PreactArcgisAssistantMessage;
|
|
145
152
|
"arcgis-assistant-message-block": PreactArcgisAssistantMessageBlock;
|
|
146
153
|
"arcgis-assistant-message-feedback": PreactArcgisAssistantMessageFeedback;
|
|
147
154
|
"arcgis-assistant-message-footer": PreactArcgisAssistantMessageFooter;
|
package/dist/types/react.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import type { ArcgisAssistantNavigationAgent } from "../components/arcgis-assist
|
|
|
9
9
|
import type { ArcgisAssistantChat } from "../components/arcgis-assistant-chat/customElement.js";
|
|
10
10
|
import type { ArcgisAssistantChatEntry } from "../components/arcgis-assistant-chat-entry/customElement.js";
|
|
11
11
|
import type { ArcgisAssistantInterrupt } from "../components/arcgis-assistant-interrupt/customElement.js";
|
|
12
|
+
import type { ArcgisAssistantMessage } from "../components/arcgis-assistant-message/customElement.js";
|
|
12
13
|
import type { ArcgisAssistantMessageBlock } from "../components/arcgis-assistant-message-block/customElement.js";
|
|
13
14
|
import type { ArcgisAssistantMessageFeedback } from "../components/arcgis-assistant-message-feedback/customElement.js";
|
|
14
15
|
import type { ArcgisAssistantMessageFooter } from "../components/arcgis-assistant-message-footer/customElement.js";
|
|
@@ -22,7 +23,7 @@ import type { ArcgisAssistantUserMessage } from "../components/arcgis-assistant-
|
|
|
22
23
|
import type { HTMLProps } from 'react';
|
|
23
24
|
import type { EventHandler } from "@arcgis/lumina";
|
|
24
25
|
|
|
25
|
-
interface ReactArcgisAssistant extends Partial<Pick<ArcgisAssistant, "copyEnabled" | "description" | "entryMessage" | "feedbackEnabled" | "heading" | "keepSuggestedPrompts" | "logEnabled" | "messages" | "referenceElement" | "suggestedPrompts">>, HTMLProps<ArcgisAssistant> {
|
|
26
|
+
interface ReactArcgisAssistant extends Partial<Pick<ArcgisAssistant, "assistantAvatarEnabled" | "copyEnabled" | "description" | "entryMessage" | "feedbackEnabled" | "heading" | "keepSuggestedPrompts" | "logEnabled" | "messages" | "referenceElement" | "suggestedPrompts">>, HTMLProps<ArcgisAssistant> {
|
|
26
27
|
onarcgisCancel?: EventHandler<ArcgisAssistant["arcgisCancel"]>;
|
|
27
28
|
onarcgisError?: EventHandler<ArcgisAssistant["arcgisError"]>;
|
|
28
29
|
onarcgisFeedback?: EventHandler<ArcgisAssistant["arcgisFeedback"]>;
|
|
@@ -31,6 +32,7 @@ interface ReactArcgisAssistant extends Partial<Pick<ArcgisAssistant, "copyEnable
|
|
|
31
32
|
onarcgisInterruptSubmit?: EventHandler<ArcgisAssistant["arcgisInterruptSubmit"]>;
|
|
32
33
|
onarcgisPromptSelect?: EventHandler<ArcgisAssistant["arcgisPromptSelect"]>;
|
|
33
34
|
onarcgisReady?: EventHandler<ArcgisAssistant["arcgisReady"]>;
|
|
35
|
+
onarcgisResponse?: EventHandler<ArcgisAssistant["arcgisResponse"]>;
|
|
34
36
|
onarcgisSlottableRequest?: EventHandler<ArcgisAssistant["arcgisSlottableRequest"]>;
|
|
35
37
|
onarcgisSubmit?: EventHandler<ArcgisAssistant["arcgisSubmit"]>;
|
|
36
38
|
}
|
|
@@ -53,10 +55,10 @@ interface ReactArcgisAssistantLayerStylingAgent extends Partial<Pick<ArcgisAssis
|
|
|
53
55
|
interface ReactArcgisAssistantNavigationAgent extends Partial<Pick<ArcgisAssistantNavigationAgent, "referenceElement">>, HTMLProps<ArcgisAssistantNavigationAgent> {
|
|
54
56
|
}
|
|
55
57
|
|
|
56
|
-
interface ReactArcgisAssistantChat extends Partial<Pick<ArcgisAssistantChat, "loading" | "messages">>, HTMLProps<ArcgisAssistantChat> {
|
|
58
|
+
interface ReactArcgisAssistantChat extends Partial<Pick<ArcgisAssistantChat, "interrupt" | "loading" | "messages">>, HTMLProps<ArcgisAssistantChat> {
|
|
57
59
|
}
|
|
58
60
|
|
|
59
|
-
interface ReactArcgisAssistantChatEntry extends Partial<Pick<ArcgisAssistantChatEntry, "awaitingResponse" | "entryPlaceholder" | "inputValue" | "keyboardShortcutsDisabled" | "messages" | "status" | "voiceInputEnabled">>, HTMLProps<ArcgisAssistantChatEntry> {
|
|
61
|
+
interface ReactArcgisAssistantChatEntry extends Partial<Pick<ArcgisAssistantChatEntry, "awaitingResponse" | "disabled" | "entryPlaceholder" | "inputValue" | "keyboardShortcutsDisabled" | "messages" | "status" | "voiceInputEnabled">>, HTMLProps<ArcgisAssistantChatEntry> {
|
|
60
62
|
onarcgisCancel?: EventHandler<ArcgisAssistantChatEntry["arcgisCancel"]>;
|
|
61
63
|
onarcgisSubmit?: EventHandler<ArcgisAssistantChatEntry["arcgisSubmit"]>;
|
|
62
64
|
}
|
|
@@ -66,6 +68,9 @@ interface ReactArcgisAssistantInterrupt extends Partial<Pick<ArcgisAssistantInte
|
|
|
66
68
|
onarcgisSubmit?: EventHandler<ArcgisAssistantInterrupt["arcgisSubmit"]>;
|
|
67
69
|
}
|
|
68
70
|
|
|
71
|
+
interface ReactArcgisAssistantMessage extends Partial<Pick<ArcgisAssistantMessage, "assistantAvatarEnabled" | "copyEnabled" | "feedbackEnabled" | "footerDisabled" | "logEnabled" | "message" | "readAloudEnabled">>, HTMLProps<ArcgisAssistantMessage> {
|
|
72
|
+
}
|
|
73
|
+
|
|
69
74
|
interface ReactArcgisAssistantMessageBlock extends Partial<Pick<ArcgisAssistantMessageBlock, "block">>, HTMLProps<ArcgisAssistantMessageBlock> {
|
|
70
75
|
}
|
|
71
76
|
|
|
@@ -76,7 +81,7 @@ interface ReactArcgisAssistantMessageFeedback extends Partial<Pick<ArcgisAssista
|
|
|
76
81
|
interface ReactArcgisAssistantMessageFooter extends Partial<Pick<ArcgisAssistantMessageFooter, "copyEnabled" | "feedbackEnabled" | "logEnabled" | "message" | "readAloudEnabled">>, HTMLProps<ArcgisAssistantMessageFooter> {
|
|
77
82
|
}
|
|
78
83
|
|
|
79
|
-
interface ReactArcgisAssistantMessageLoading extends Partial<Pick<ArcgisAssistantMessageLoading, "loading" | "loadingMessage">>, HTMLProps<ArcgisAssistantMessageLoading> {
|
|
84
|
+
interface ReactArcgisAssistantMessageLoading extends Partial<Pick<ArcgisAssistantMessageLoading, "assistantAvatarEnabled" | "interrupts" | "loading" | "loadingMessage">>, HTMLProps<ArcgisAssistantMessageLoading> {
|
|
80
85
|
}
|
|
81
86
|
|
|
82
87
|
interface ReactArcgisAssistantMessageLog extends Partial<Pick<ArcgisAssistantMessageLog, "log" | "logEnabled" | "showLog">>, HTMLProps<ArcgisAssistantMessageLog> {
|
|
@@ -118,6 +123,7 @@ declare module "react" {
|
|
|
118
123
|
"arcgis-assistant-chat": ReactArcgisAssistantChat;
|
|
119
124
|
"arcgis-assistant-chat-entry": ReactArcgisAssistantChatEntry;
|
|
120
125
|
"arcgis-assistant-interrupt": ReactArcgisAssistantInterrupt;
|
|
126
|
+
"arcgis-assistant-message": ReactArcgisAssistantMessage;
|
|
121
127
|
"arcgis-assistant-message-block": ReactArcgisAssistantMessageBlock;
|
|
122
128
|
"arcgis-assistant-message-feedback": ReactArcgisAssistantMessageFeedback;
|
|
123
129
|
"arcgis-assistant-message-footer": ReactArcgisAssistantMessageFooter;
|
|
@@ -144,6 +150,7 @@ declare module "react/jsx-runtime" {
|
|
|
144
150
|
"arcgis-assistant-chat": ReactArcgisAssistantChat;
|
|
145
151
|
"arcgis-assistant-chat-entry": ReactArcgisAssistantChatEntry;
|
|
146
152
|
"arcgis-assistant-interrupt": ReactArcgisAssistantInterrupt;
|
|
153
|
+
"arcgis-assistant-message": ReactArcgisAssistantMessage;
|
|
147
154
|
"arcgis-assistant-message-block": ReactArcgisAssistantMessageBlock;
|
|
148
155
|
"arcgis-assistant-message-feedback": ReactArcgisAssistantMessageFeedback;
|
|
149
156
|
"arcgis-assistant-message-footer": ReactArcgisAssistantMessageFooter;
|
|
@@ -170,6 +177,7 @@ declare module "react/jsx-dev-runtime" {
|
|
|
170
177
|
"arcgis-assistant-chat": ReactArcgisAssistantChat;
|
|
171
178
|
"arcgis-assistant-chat-entry": ReactArcgisAssistantChatEntry;
|
|
172
179
|
"arcgis-assistant-interrupt": ReactArcgisAssistantInterrupt;
|
|
180
|
+
"arcgis-assistant-message": ReactArcgisAssistantMessage;
|
|
173
181
|
"arcgis-assistant-message-block": ReactArcgisAssistantMessageBlock;
|
|
174
182
|
"arcgis-assistant-message-feedback": ReactArcgisAssistantMessageFeedback;
|
|
175
183
|
"arcgis-assistant-message-footer": ReactArcgisAssistantMessageFooter;
|
package/dist/types/stencil.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import type { ArcgisAssistantNavigationAgent } from "../components/arcgis-assist
|
|
|
9
9
|
import type { ArcgisAssistantChat } from "../components/arcgis-assistant-chat/customElement.js";
|
|
10
10
|
import type { ArcgisAssistantChatEntry } from "../components/arcgis-assistant-chat-entry/customElement.js";
|
|
11
11
|
import type { ArcgisAssistantInterrupt } from "../components/arcgis-assistant-interrupt/customElement.js";
|
|
12
|
+
import type { ArcgisAssistantMessage } from "../components/arcgis-assistant-message/customElement.js";
|
|
12
13
|
import type { ArcgisAssistantMessageBlock } from "../components/arcgis-assistant-message-block/customElement.js";
|
|
13
14
|
import type { ArcgisAssistantMessageFeedback } from "../components/arcgis-assistant-message-feedback/customElement.js";
|
|
14
15
|
import type { ArcgisAssistantMessageFooter } from "../components/arcgis-assistant-message-footer/customElement.js";
|
|
@@ -22,7 +23,7 @@ import type { ArcgisAssistantUserMessage } from "../components/arcgis-assistant-
|
|
|
22
23
|
import { JSXBase as StencilJsx } from "@stencil/core/internal";
|
|
23
24
|
import type { EventHandler } from "@arcgis/lumina";
|
|
24
25
|
|
|
25
|
-
interface StencilArcgisAssistant extends Partial<Pick<ArcgisAssistant, "copyEnabled" | "description" | "entryMessage" | "feedbackEnabled" | "heading" | "keepSuggestedPrompts" | "logEnabled" | "messages" | "referenceElement" | "suggestedPrompts">>, StencilJsx.HTMLAttributes<ArcgisAssistant> {
|
|
26
|
+
interface StencilArcgisAssistant extends Partial<Pick<ArcgisAssistant, "assistantAvatarEnabled" | "copyEnabled" | "description" | "entryMessage" | "feedbackEnabled" | "heading" | "keepSuggestedPrompts" | "logEnabled" | "messages" | "referenceElement" | "suggestedPrompts">>, StencilJsx.HTMLAttributes<ArcgisAssistant> {
|
|
26
27
|
onArcgisCancel?: EventHandler<ArcgisAssistant["arcgisCancel"]>;
|
|
27
28
|
onArcgisError?: EventHandler<ArcgisAssistant["arcgisError"]>;
|
|
28
29
|
onArcgisFeedback?: EventHandler<ArcgisAssistant["arcgisFeedback"]>;
|
|
@@ -31,6 +32,7 @@ interface StencilArcgisAssistant extends Partial<Pick<ArcgisAssistant, "copyEnab
|
|
|
31
32
|
onArcgisInterruptSubmit?: EventHandler<ArcgisAssistant["arcgisInterruptSubmit"]>;
|
|
32
33
|
onArcgisPromptSelect?: EventHandler<ArcgisAssistant["arcgisPromptSelect"]>;
|
|
33
34
|
onArcgisReady?: EventHandler<ArcgisAssistant["arcgisReady"]>;
|
|
35
|
+
onArcgisResponse?: EventHandler<ArcgisAssistant["arcgisResponse"]>;
|
|
34
36
|
onArcgisSlottableRequest?: EventHandler<ArcgisAssistant["arcgisSlottableRequest"]>;
|
|
35
37
|
onArcgisSubmit?: EventHandler<ArcgisAssistant["arcgisSubmit"]>;
|
|
36
38
|
}
|
|
@@ -53,10 +55,10 @@ interface StencilArcgisAssistantLayerStylingAgent extends Partial<Pick<ArcgisAss
|
|
|
53
55
|
interface StencilArcgisAssistantNavigationAgent extends Partial<Pick<ArcgisAssistantNavigationAgent, "referenceElement">>, StencilJsx.HTMLAttributes<ArcgisAssistantNavigationAgent> {
|
|
54
56
|
}
|
|
55
57
|
|
|
56
|
-
interface StencilArcgisAssistantChat extends Partial<Pick<ArcgisAssistantChat, "loading" | "messages">>, StencilJsx.HTMLAttributes<ArcgisAssistantChat> {
|
|
58
|
+
interface StencilArcgisAssistantChat extends Partial<Pick<ArcgisAssistantChat, "interrupt" | "loading" | "messages">>, StencilJsx.HTMLAttributes<ArcgisAssistantChat> {
|
|
57
59
|
}
|
|
58
60
|
|
|
59
|
-
interface StencilArcgisAssistantChatEntry extends Partial<Pick<ArcgisAssistantChatEntry, "awaitingResponse" | "entryPlaceholder" | "inputValue" | "keyboardShortcutsDisabled" | "messages" | "status" | "voiceInputEnabled">>, StencilJsx.HTMLAttributes<ArcgisAssistantChatEntry> {
|
|
61
|
+
interface StencilArcgisAssistantChatEntry extends Partial<Pick<ArcgisAssistantChatEntry, "awaitingResponse" | "disabled" | "entryPlaceholder" | "inputValue" | "keyboardShortcutsDisabled" | "messages" | "status" | "voiceInputEnabled">>, StencilJsx.HTMLAttributes<ArcgisAssistantChatEntry> {
|
|
60
62
|
onArcgisCancel?: EventHandler<ArcgisAssistantChatEntry["arcgisCancel"]>;
|
|
61
63
|
onArcgisSubmit?: EventHandler<ArcgisAssistantChatEntry["arcgisSubmit"]>;
|
|
62
64
|
}
|
|
@@ -66,6 +68,9 @@ interface StencilArcgisAssistantInterrupt extends Partial<Pick<ArcgisAssistantIn
|
|
|
66
68
|
onArcgisSubmit?: EventHandler<ArcgisAssistantInterrupt["arcgisSubmit"]>;
|
|
67
69
|
}
|
|
68
70
|
|
|
71
|
+
interface StencilArcgisAssistantMessage extends Partial<Pick<ArcgisAssistantMessage, "assistantAvatarEnabled" | "copyEnabled" | "feedbackEnabled" | "footerDisabled" | "logEnabled" | "message" | "readAloudEnabled">>, StencilJsx.HTMLAttributes<ArcgisAssistantMessage> {
|
|
72
|
+
}
|
|
73
|
+
|
|
69
74
|
interface StencilArcgisAssistantMessageBlock extends Partial<Pick<ArcgisAssistantMessageBlock, "block">>, StencilJsx.HTMLAttributes<ArcgisAssistantMessageBlock> {
|
|
70
75
|
}
|
|
71
76
|
|
|
@@ -76,7 +81,7 @@ interface StencilArcgisAssistantMessageFeedback extends Partial<Pick<ArcgisAssis
|
|
|
76
81
|
interface StencilArcgisAssistantMessageFooter extends Partial<Pick<ArcgisAssistantMessageFooter, "copyEnabled" | "feedbackEnabled" | "logEnabled" | "message" | "readAloudEnabled">>, StencilJsx.HTMLAttributes<ArcgisAssistantMessageFooter> {
|
|
77
82
|
}
|
|
78
83
|
|
|
79
|
-
interface StencilArcgisAssistantMessageLoading extends Partial<Pick<ArcgisAssistantMessageLoading, "loading" | "loadingMessage">>, StencilJsx.HTMLAttributes<ArcgisAssistantMessageLoading> {
|
|
84
|
+
interface StencilArcgisAssistantMessageLoading extends Partial<Pick<ArcgisAssistantMessageLoading, "assistantAvatarEnabled" | "interrupts" | "loading" | "loadingMessage">>, StencilJsx.HTMLAttributes<ArcgisAssistantMessageLoading> {
|
|
80
85
|
}
|
|
81
86
|
|
|
82
87
|
interface StencilArcgisAssistantMessageLog extends Partial<Pick<ArcgisAssistantMessageLog, "log" | "logEnabled" | "showLog">>, StencilJsx.HTMLAttributes<ArcgisAssistantMessageLog> {
|
|
@@ -116,6 +121,7 @@ interface ExposedElements {
|
|
|
116
121
|
"arcgis-assistant-chat": StencilArcgisAssistantChat;
|
|
117
122
|
"arcgis-assistant-chat-entry": StencilArcgisAssistantChatEntry;
|
|
118
123
|
"arcgis-assistant-interrupt": StencilArcgisAssistantInterrupt;
|
|
124
|
+
"arcgis-assistant-message": StencilArcgisAssistantMessage;
|
|
119
125
|
"arcgis-assistant-message-block": StencilArcgisAssistantMessageBlock;
|
|
120
126
|
"arcgis-assistant-message-feedback": StencilArcgisAssistantMessageFeedback;
|
|
121
127
|
"arcgis-assistant-message-footer": StencilArcgisAssistantMessageFooter;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -7,9 +7,13 @@ import type { StructuredToolInterface } from "@langchain/core/tools";
|
|
|
7
7
|
import type { AnnotationRoot, BaseChannel, StateGraph } from "@langchain/langgraph/web";
|
|
8
8
|
import type { ChatOpenAI } from "@langchain/openai";
|
|
9
9
|
import type { ZodType } from "zod";
|
|
10
|
+
import type { AgentRegistration as AgentRegistration2 } from "../orchestrator/registry/agentRegistry.js";
|
|
10
11
|
|
|
11
|
-
export { type CustomConfigurableType } from "../orchestrator";
|
|
12
|
-
export { Orchestrator } from "../orchestrator";
|
|
12
|
+
export { type CustomConfigurableType } from "../orchestrator.js";
|
|
13
|
+
export { Orchestrator } from "../orchestrator.js";
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export type ChatModelTier = "advanced" | "default" | "fast";
|
|
13
17
|
|
|
14
18
|
/**
|
|
15
19
|
* Represents the chat message history between the user and the assistant, including all messages sent and received during the conversation.
|
|
@@ -146,6 +150,8 @@ export type ArcgisPromptOptions = {
|
|
|
146
150
|
* - `advanced` - An advanced model tier that may provide improved accuracy or capabilities compared to
|
|
147
151
|
* the default tier. However, it may also come with increased cost and slower performance. At
|
|
148
152
|
* JS SDK v5.0, this model tier corresponds to GPT-5.2 model.
|
|
153
|
+
* - `fast` - A lower cost model suitable for tasks like classification and summarization. This tier may have limitations in terms of response length and complexity.
|
|
154
|
+
* New at JS SDK v5.1, this model tier corresponds to GPT-5.4-nano model.
|
|
149
155
|
*
|
|
150
156
|
* The specific models available in each tier may evolve over time as new models are released and existing
|
|
151
157
|
* models are retired. The dates models are retired depends on the model provider and therefore may not
|
|
@@ -172,6 +178,8 @@ export type ArcgisPromptOptions = {
|
|
|
172
178
|
* and produce more accurate and relevant responses.
|
|
173
179
|
*/
|
|
174
180
|
messages?: ChatHistory;
|
|
181
|
+
/** Optional runnable configuration used to derive runtime values (for example, conversation id and abort signal). */
|
|
182
|
+
config?: RunnableConfig;
|
|
175
183
|
/**
|
|
176
184
|
* Input variables for the prompt. This can include any relevant variables related to the context
|
|
177
185
|
* provided to the agent. This may be necessary for determining tool parameters or for providing additional
|
|
@@ -319,7 +327,7 @@ export function cosineSimilarity(vectorA: number[], vectorB: number[]): number;
|
|
|
319
327
|
/**
|
|
320
328
|
* The suggestions emitted by the agent to the user interface.
|
|
321
329
|
*
|
|
322
|
-
* @
|
|
330
|
+
* @since 5.1
|
|
323
331
|
*/
|
|
324
332
|
export type UXSuggestion = {
|
|
325
333
|
/** The type of suggestion being made. */
|
|
@@ -331,32 +339,41 @@ export type UXSuggestion = {
|
|
|
331
339
|
/**
|
|
332
340
|
* Execution status returned by an agent run.
|
|
333
341
|
*
|
|
334
|
-
* @
|
|
342
|
+
* @since 5.1
|
|
335
343
|
*/
|
|
336
344
|
export type AgentStatus = "failed" | "success" | "unknown";
|
|
337
345
|
|
|
338
346
|
/**
|
|
339
347
|
* Summary of a previously executed agent step.
|
|
340
348
|
*
|
|
341
|
-
* @
|
|
349
|
+
* @since 5.1
|
|
342
350
|
*/
|
|
343
351
|
export interface PriorStep {
|
|
352
|
+
/** The agent that handled the step. */
|
|
344
353
|
agentId: string;
|
|
354
|
+
/** The task assigned to the agent for this step. */
|
|
345
355
|
assignedTask: string;
|
|
356
|
+
/** A brief summary of the step's execution. */
|
|
346
357
|
summary: string;
|
|
358
|
+
/** The execution status of the step. */
|
|
347
359
|
status: AgentStatus;
|
|
348
360
|
}
|
|
349
361
|
|
|
350
362
|
/**
|
|
351
363
|
* Runtime execution context available to agent graph nodes and tools.
|
|
352
364
|
*
|
|
353
|
-
* @
|
|
365
|
+
* @since 5.1
|
|
354
366
|
*/
|
|
355
367
|
export interface AgentExecutionContext<TState extends Record<string, unknown> = Record<string, unknown>> {
|
|
368
|
+
/** The user's original request. */
|
|
356
369
|
userRequest: string;
|
|
370
|
+
/** The task assigned to the agent. */
|
|
357
371
|
assignedTask: string;
|
|
372
|
+
/** The message history for the run */
|
|
358
373
|
messages: ChatHistory;
|
|
374
|
+
/** Previous steps */
|
|
359
375
|
priorSteps: PriorStep[];
|
|
376
|
+
/** Shared state available to the agent. */
|
|
360
377
|
sharedState: SharedState<TState>;
|
|
361
378
|
}
|
|
362
379
|
|
|
@@ -388,7 +405,7 @@ export type DataExplorationContext = {
|
|
|
388
405
|
export const HelpAgent: AgentRegistration;
|
|
389
406
|
|
|
390
407
|
/** @internal */
|
|
391
|
-
export const ArcgisKnowledgeAgent:
|
|
408
|
+
export const ArcgisKnowledgeAgent: AgentRegistration2;
|
|
392
409
|
|
|
393
410
|
/** @internal */
|
|
394
411
|
export type ArcgisKnowledgeContext = {
|
|
@@ -427,6 +444,9 @@ export const createWebmapEmbeddings: (mapView: MapView) => Promise<{
|
|
|
427
444
|
}>;
|
|
428
445
|
}>;
|
|
429
446
|
|
|
447
|
+
/** @internal */
|
|
448
|
+
export type GetContext<TContext extends Record<string, unknown>> = () => Promise<TContext> | TContext;
|
|
449
|
+
|
|
430
450
|
/** @internal */
|
|
431
451
|
export interface AgentWithContext<TContext extends Record<string, unknown> = Record<string, unknown>> {
|
|
432
452
|
agent: AgentRegistration;
|
|
@@ -438,34 +458,9 @@ export interface AgentWithContext<TContext extends Record<string, unknown> = Rec
|
|
|
438
458
|
}
|
|
439
459
|
|
|
440
460
|
/** @internal */
|
|
441
|
-
export
|
|
442
|
-
|
|
443
|
-
/** @internal */
|
|
444
|
-
export function createAgentRuntimeStateWithSharedState<TState extends Record<string, unknown> = Record<string, unknown>>(): StatefulAgentBaseState<TState>;
|
|
445
|
-
|
|
446
|
-
/**
|
|
447
|
-
* @param suggestion
|
|
448
|
-
* @param config
|
|
449
|
-
* @internal
|
|
450
|
-
*/
|
|
451
|
-
export function sendUXSuggestion(suggestion: UXSuggestion, config?: RunnableConfig): Promise<void>;
|
|
461
|
+
export type AgentExecutionContextWithSharedState<TState extends Record<string, unknown> = Record<string, unknown>> = AgentExecutionContext<TState>;
|
|
452
462
|
|
|
453
463
|
/** @internal */
|
|
454
|
-
export type SharedStatePatch<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
455
|
-
[K in keyof T]?: SharedStatePatchEntry<T[K]>;
|
|
456
|
-
};
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
* @param tier
|
|
460
|
-
* @param temperature
|
|
461
|
-
* @internal
|
|
462
|
-
*/
|
|
463
|
-
export function createChatModel(tier?: ChatModelTier, temperature?: number): Promise<ChatOpenAI>;
|
|
464
|
-
|
|
465
|
-
export type ChatModelTier = "advanced" | "default" | "fast";
|
|
466
|
-
|
|
467
|
-
export type GetContext<TContext extends Record<string, unknown>> = () => Promise<TContext> | TContext;
|
|
468
|
-
|
|
469
464
|
export type StatelessAgentBaseState<TState extends Record<string, unknown> = Record<string, unknown>> = {
|
|
470
465
|
agentExecutionContext: BaseChannel<AgentExecutionContextWithSharedState<TState>, unknown, unknown>;
|
|
471
466
|
outputMessage: BaseChannel<string, unknown, unknown>;
|
|
@@ -473,27 +468,76 @@ export type StatelessAgentBaseState<TState extends Record<string, unknown> = Rec
|
|
|
473
468
|
status: BaseChannel<AgentStatus | undefined, unknown, unknown>;
|
|
474
469
|
};
|
|
475
470
|
|
|
471
|
+
/** @internal */
|
|
476
472
|
export type StatefulAgentBaseState<TState extends Record<string, unknown> = Record<string, unknown>> = StatelessAgentBaseState<TState>
|
|
477
473
|
& {
|
|
478
474
|
sharedStatePatch: BaseChannel<SharedStatePatch<TState> | undefined, unknown, unknown>;
|
|
479
475
|
};
|
|
480
476
|
|
|
481
|
-
/**
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
477
|
+
/**
|
|
478
|
+
* Creates the standard runtime state for a custom agent graph.
|
|
479
|
+
* Includes common fields used by the assistant flow (request context, output message, summary, and status), so you only add your agent-specific state.
|
|
480
|
+
*
|
|
481
|
+
* @since 5.1
|
|
482
|
+
*/
|
|
483
|
+
export function createAgentRuntimeState<TState extends Record<string, unknown> = Record<string, unknown>>(): StatelessAgentBaseState<TState>;
|
|
485
484
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
485
|
+
/**
|
|
486
|
+
* Creates the standard runtime state for a custom agent graph, plus support for shared state updates.
|
|
487
|
+
* Use this when your agent needs to write values that other agents can read later in the same orchestration flow.
|
|
488
|
+
*
|
|
489
|
+
* @since 5.1
|
|
490
|
+
*/
|
|
491
|
+
export function createAgentRuntimeStateWithSharedState<TState extends Record<string, unknown> = Record<string, unknown>>(): StatefulAgentBaseState<TState>;
|
|
489
492
|
|
|
490
|
-
|
|
493
|
+
/**
|
|
494
|
+
* Sends an optional UX suggestion from an agent run to the host application.
|
|
495
|
+
* Use this for non-blocking hints (for example, recommended next actions or UI prompts) that the app may choose to display.
|
|
496
|
+
*
|
|
497
|
+
* @param suggestion
|
|
498
|
+
* @param config
|
|
499
|
+
* @since 5.1
|
|
500
|
+
*/
|
|
501
|
+
export function sendUXSuggestion(suggestion: UXSuggestion, config?: RunnableConfig): Promise<void>;
|
|
491
502
|
|
|
492
|
-
/**
|
|
503
|
+
/** @internal */
|
|
493
504
|
export type SharedStateEntry<T = unknown> = {
|
|
494
505
|
value: T;
|
|
495
506
|
meta: {
|
|
496
507
|
updatedByAgentId: string;
|
|
497
508
|
updatedAt: number;
|
|
498
509
|
};
|
|
499
|
-
};
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
/** @internal */
|
|
513
|
+
export type SharedStatePatchEntry<T = unknown> = {
|
|
514
|
+
value: T;
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Shared state that can be read and updated during agent execution.
|
|
519
|
+
*
|
|
520
|
+
* @since 5.1
|
|
521
|
+
*/
|
|
522
|
+
export type SharedState<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
523
|
+
[K in keyof T]?: SharedStateEntry<T[K]>;
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Partial shared state returned by an agent for merging into the current run state.
|
|
528
|
+
*
|
|
529
|
+
* @since 5.1
|
|
530
|
+
*/
|
|
531
|
+
export type SharedStatePatch<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
532
|
+
[K in keyof T]?: SharedStatePatchEntry<T[K]>;
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* @param parameter0
|
|
537
|
+
* @internal
|
|
538
|
+
*/
|
|
539
|
+
export function createChatModel(parameter0?: {
|
|
540
|
+
modelTier?: ChatModelTier;
|
|
541
|
+
temperature?: number;
|
|
542
|
+
config?: RunnableConfig;
|
|
543
|
+
}): Promise<ChatOpenAI>;
|
package/dist/utils/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { g as p } from "../chunks/orchestrator.js";
|
|
3
|
-
import { O as
|
|
4
|
-
import {
|
|
3
|
+
import { O as ue } from "../chunks/orchestrator.js";
|
|
4
|
+
import { s as h, a as A } from "../chunks/index.js";
|
|
5
|
+
import { g as S, a as v, W as w, f, l as y, d as $, m as b, b as E, s as L, i as P, e as M, h as T, j as R, k, c as x } from "../chunks/generateLayerDescriptions.js";
|
|
5
6
|
import D from "@arcgis/core/layers/FeatureLayer.js";
|
|
6
7
|
import * as W from "@arcgis/core/core/reactiveUtils.js";
|
|
7
8
|
import { N as F } from "../chunks/navigationGraph.js";
|
|
@@ -10,38 +11,38 @@ import { D as N } from "../chunks/dataExplorationGraph.js";
|
|
|
10
11
|
import { H as z } from "../chunks/helpGraph.js";
|
|
11
12
|
import { A as H } from "../chunks/arcgisKnowledgeGraph.js";
|
|
12
13
|
const I = async (e) => {
|
|
13
|
-
const t = e.allLayers.toArray(),
|
|
14
|
+
const t = e.allLayers.toArray(), s = [], o = /* @__PURE__ */ new Map();
|
|
14
15
|
for (const a of t)
|
|
15
16
|
if (a instanceof D) {
|
|
16
17
|
const m = (async () => {
|
|
17
|
-
const
|
|
18
|
-
|
|
18
|
+
const r = await S(a), n = await v(a, r);
|
|
19
|
+
o.set(a.id, { layerItem: n, fieldRegistry: r });
|
|
19
20
|
})();
|
|
20
|
-
|
|
21
|
+
s.push(m);
|
|
21
22
|
}
|
|
22
|
-
return await Promise.all(
|
|
23
|
+
return await Promise.all(s), o;
|
|
23
24
|
}, O = async (e) => {
|
|
24
25
|
await W.whenOnce(() => e.ready);
|
|
25
|
-
const t = await I(e.map), { layers:
|
|
26
|
-
schemaVersion:
|
|
26
|
+
const t = await I(e.map), { layers: s } = await U(t), o = {
|
|
27
|
+
schemaVersion: L,
|
|
27
28
|
modified: Date.now(),
|
|
28
29
|
embeddings: {
|
|
29
|
-
modelProvider:
|
|
30
|
-
model:
|
|
31
|
-
dimensions:
|
|
30
|
+
modelProvider: E,
|
|
31
|
+
model: b,
|
|
32
|
+
dimensions: $,
|
|
32
33
|
templates: {
|
|
33
34
|
layer: y,
|
|
34
35
|
field: f
|
|
35
36
|
}
|
|
36
37
|
},
|
|
37
|
-
layers:
|
|
38
|
-
}, a =
|
|
38
|
+
layers: s
|
|
39
|
+
}, a = w.safeParse(o);
|
|
39
40
|
if (!a.success)
|
|
40
41
|
throw console.error("Schema Mismatch:", a.error.format()), new Error("Webmap embedding generation failed validation.");
|
|
41
42
|
return a.data;
|
|
42
43
|
}, U = async (e) => {
|
|
43
|
-
const t = [],
|
|
44
|
-
for (const [
|
|
44
|
+
const t = [], s = [];
|
|
45
|
+
for (const [r, { fieldRegistry: n, layerItem: i }] of e.entries()) {
|
|
45
46
|
const l = g(y, {
|
|
46
47
|
name: i.name,
|
|
47
48
|
title: i.title,
|
|
@@ -49,14 +50,14 @@ const I = async (e) => {
|
|
|
49
50
|
});
|
|
50
51
|
t.push(l);
|
|
51
52
|
const d = {
|
|
52
|
-
id:
|
|
53
|
+
id: r,
|
|
53
54
|
name: i.name ?? "",
|
|
54
55
|
title: i.title,
|
|
55
56
|
description: i.description,
|
|
56
57
|
vector: [],
|
|
57
58
|
fields: []
|
|
58
59
|
};
|
|
59
|
-
for (const [, c] of
|
|
60
|
+
for (const [, c] of n.entries()) {
|
|
60
61
|
const u = g(f, {
|
|
61
62
|
name: c.name,
|
|
62
63
|
alias: c.alias,
|
|
@@ -69,43 +70,47 @@ const I = async (e) => {
|
|
|
69
70
|
vector: []
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
+
s.push(d);
|
|
73
74
|
}
|
|
74
|
-
const
|
|
75
|
+
const o = await p(t);
|
|
75
76
|
let a = 0;
|
|
76
|
-
return { layers:
|
|
77
|
-
|
|
78
|
-
}),
|
|
79
|
-
}, g = (e, t) => e.replace(/\{(\w+)\}/gu, (
|
|
77
|
+
return { layers: s.map((r) => (r.vector = o[a++], r.fields.forEach((n) => {
|
|
78
|
+
n.vector = o[a++];
|
|
79
|
+
}), r)) };
|
|
80
|
+
}, g = (e, t) => e.replace(/\{(\w+)\}/gu, (s, o) => t[o] ?? ""), V = (e, t) => {
|
|
80
81
|
if (e.length !== t.length)
|
|
81
82
|
throw new Error("Vectors must be the same length");
|
|
82
|
-
let
|
|
83
|
-
for (let
|
|
84
|
-
const i = e[
|
|
85
|
-
|
|
83
|
+
let s = 0, o = 0, a = 0;
|
|
84
|
+
for (let n = 0; n < e.length; ++n) {
|
|
85
|
+
const i = e[n], l = t[n];
|
|
86
|
+
s += i * l, o += i * i, a += l * l;
|
|
86
87
|
}
|
|
87
|
-
const m = Math.sqrt(
|
|
88
|
+
const m = Math.sqrt(o * a);
|
|
88
89
|
if (m === 0)
|
|
89
90
|
return 0;
|
|
90
|
-
const
|
|
91
|
-
return Math.max(-1, Math.min(1,
|
|
92
|
-
},
|
|
91
|
+
const r = s / m;
|
|
92
|
+
return Math.max(-1, Math.min(1, r));
|
|
93
|
+
}, Y = M, Z = P, ee = T, te = h, ae = p, se = V, oe = F, re = C, ne = N, ie = z, ce = H, me = O, le = () => R(), de = () => k(), ge = async (e, t) => await A(e, t), pe = async ({
|
|
94
|
+
modelTier: e = "default",
|
|
95
|
+
temperature: t = 0,
|
|
96
|
+
config: s
|
|
97
|
+
} = {}) => await x({ modelTier: e, temperature: t, config: s });
|
|
93
98
|
export {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
99
|
+
ce as ArcgisKnowledgeAgent,
|
|
100
|
+
ne as DataExplorationAgent,
|
|
101
|
+
ie as HelpAgent,
|
|
102
|
+
re as LayerStylingAgent,
|
|
103
|
+
oe as NavigationAgent,
|
|
104
|
+
ue as Orchestrator,
|
|
105
|
+
se as cosineSimilarity,
|
|
106
|
+
le as createAgentRuntimeState,
|
|
107
|
+
de as createAgentRuntimeStateWithSharedState,
|
|
108
|
+
pe as createChatModel,
|
|
109
|
+
me as createWebmapEmbeddings,
|
|
110
|
+
ae as getEmbeddings,
|
|
111
|
+
Z as invokeStructuredPrompt,
|
|
112
|
+
Y as invokeTextPrompt,
|
|
113
|
+
ee as invokeToolPrompt,
|
|
114
|
+
te as sendTraceMessage,
|
|
115
|
+
ge as sendUXSuggestion
|
|
111
116
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/ai-components",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.11",
|
|
4
4
|
"description": "ArcGIS AI Components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"exports": {
|
|
10
10
|
".": "./dist/index.js",
|
|
11
11
|
"./loader": "./dist/loader.js",
|
|
12
|
+
"./agent-utils/index.js": "./dist/agent-utils/index.js",
|
|
12
13
|
"./agent-utils/BaseAgent.js": "./dist/agent-utils/BaseAgent.js",
|
|
13
14
|
"./agent-utils/FunctionAgent.js": "./dist/agent-utils/FunctionAgent.js",
|
|
14
15
|
"./agent-utils/LLMAgent.js": "./dist/agent-utils/LLMAgent.js",
|
|
@@ -44,16 +45,16 @@
|
|
|
44
45
|
"@langchain/openai": "^1.4.3",
|
|
45
46
|
"langchain": "^1.3.1",
|
|
46
47
|
"lit": "^3.3.0",
|
|
47
|
-
"marked": "~18.0.
|
|
48
|
+
"marked": "~18.0.5",
|
|
48
49
|
"tslib": "^2.8.1",
|
|
49
50
|
"zod": "^4.3.6",
|
|
50
|
-
"@arcgis/lumina": "5.2.0-next.
|
|
51
|
-
"@arcgis/toolkit": "5.2.0-next.
|
|
51
|
+
"@arcgis/lumina": "5.2.0-next.11",
|
|
52
|
+
"@arcgis/toolkit": "5.2.0-next.11"
|
|
52
53
|
},
|
|
53
54
|
"peerDependencies": {
|
|
54
|
-
"@arcgis/core": "^5.
|
|
55
|
-
"@esri/calcite-components": "^5.1.
|
|
56
|
-
"@arcgis/map-components": "~5.2.0-next.
|
|
55
|
+
"@arcgis/core": "^5.2.0-next",
|
|
56
|
+
"@esri/calcite-components": "^5.1.1-next.3",
|
|
57
|
+
"@arcgis/map-components": "~5.2.0-next.11"
|
|
57
58
|
},
|
|
58
59
|
"css.customData": [
|
|
59
60
|
"dist/docs/vscode.css-custom-data.json"
|