@arcgis/ai-components 5.2.0-next.4 → 5.2.0-next.41

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.
Files changed (218) hide show
  1. package/dist/agent-utils/FunctionAgent.d.ts +2 -2
  2. package/dist/agent-utils/LLMAgent.d.ts +2 -2
  3. package/dist/agent-utils/LLMAgent.js +23 -22
  4. package/dist/agent-utils/WorkflowAgent.d.ts +2 -2
  5. package/dist/agent-utils/index.d.ts +177 -0
  6. package/dist/agent-utils/index.js +167 -0
  7. package/dist/agent-utils/middlewares/trace.d.ts +2 -0
  8. package/dist/agent-utils/middlewares/trace.js +25 -33
  9. package/dist/agent-utils/tools/FunctionTool.d.ts +2 -2
  10. package/dist/agent-utils/types.d.ts +36 -7
  11. package/dist/agent-utils/workflows/ConditionalWorkflow.d.ts +2 -2
  12. package/dist/agent-utils/workflows/LoopWorkflow.d.ts +2 -2
  13. package/dist/agent-utils/workflows/ParallelWorkflow.d.ts +2 -2
  14. package/dist/agent-utils/workflows/RouterWorkflow.d.ts +2 -2
  15. package/dist/agent-utils/workflows/SequentialWorkflow.d.ts +2 -2
  16. package/dist/agent-utils/workflows/SwitchWorkflow.d.ts +2 -2
  17. package/dist/cdn/3DJDRAGV.js +2 -0
  18. package/dist/cdn/{AMP6IALT.js → 3UEKINYC.js} +1 -1
  19. package/dist/cdn/434TAA3J.js +2 -0
  20. package/dist/cdn/4CEMUECT.js +2 -0
  21. package/dist/cdn/4G5XCUE5.js +2 -0
  22. package/dist/cdn/57OMVTIU.js +2 -0
  23. package/dist/cdn/5I35MJXT.js +48 -0
  24. package/dist/cdn/6G5DYYYU.js +2 -0
  25. package/dist/cdn/6O6KMX3M.js +2 -0
  26. package/dist/cdn/6U7TEAAJ.js +2 -0
  27. package/dist/cdn/7FY4G4K2.js +2 -0
  28. package/dist/cdn/7YIRK2E3.js +2 -0
  29. package/dist/cdn/A4JLOAOH.js +2 -0
  30. package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
  31. package/dist/cdn/APFZY4PI.js +2 -0
  32. package/dist/cdn/B7YAMTIH.js +3 -0
  33. package/dist/cdn/BE7ZN5FZ.js +2 -0
  34. package/dist/cdn/{FL4W4VYN.js → BL273EGZ.js} +17 -1
  35. package/dist/cdn/BMGQJYTE.js +2 -0
  36. package/dist/cdn/{5ZZGKP7N.js → CEKOEHB3.js} +1 -1
  37. package/dist/cdn/CMG2NY3K.js +2 -0
  38. package/dist/cdn/DMLRWHBA.js +2 -0
  39. package/dist/cdn/EQLRFZVU.js +18 -0
  40. package/dist/cdn/EW6AYEUX.js +36 -0
  41. package/dist/cdn/F5SUU35Z.js +2 -0
  42. package/dist/cdn/FYW633VX.js +2 -0
  43. package/dist/cdn/{ZLXN7NMF.js → FYZATVB3.js} +10 -8
  44. package/dist/cdn/{H7422XUG.js → GYVSHAUI.js} +1 -1
  45. package/dist/cdn/HBLRVXEB.js +2 -0
  46. package/dist/cdn/HJG7QM2R.js +9 -0
  47. package/dist/cdn/HQXPPYMD.js +2 -0
  48. package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
  49. package/dist/cdn/ICYUPLZM.js +56 -0
  50. package/dist/cdn/IEHPNCTL.js +2 -0
  51. package/dist/cdn/IHP25JWI.js +99 -0
  52. package/dist/cdn/J6A4AS7E.js +22 -0
  53. package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
  54. package/dist/cdn/JEL5M7FA.js +2 -0
  55. package/dist/cdn/{4HU7735A.js → JSIGEUX7.js} +6 -4
  56. package/dist/cdn/JSJ4RMOE.js +2 -0
  57. package/dist/cdn/JVYPIWEU.js +2 -0
  58. package/dist/cdn/LHLO6PTD.js +2 -0
  59. package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
  60. package/dist/cdn/LUY6V4TP.js +181 -0
  61. package/dist/cdn/M2DEBF5S.js +2 -0
  62. package/dist/cdn/M3MRIGDZ.js +2 -0
  63. package/dist/cdn/MIPOMGT5.js +3 -0
  64. package/dist/cdn/MS5EA2KY.js +2 -0
  65. package/dist/cdn/MWYBF3F3.js +66 -0
  66. package/dist/cdn/NAKAZDJ7.js +4 -0
  67. package/dist/cdn/NEV6OZN3.js +71 -0
  68. package/dist/cdn/O5TONDCH.js +2 -0
  69. package/dist/cdn/OGMMYFHR.js +2 -0
  70. package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
  71. package/dist/cdn/OYNIFMCJ.js +2 -0
  72. package/dist/cdn/PBTINZTK.js +65 -0
  73. package/dist/cdn/PNFBQ6JV.js +180 -0
  74. package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
  75. package/dist/cdn/PVE7Q43N.js +2 -0
  76. package/dist/cdn/R74ZHFA6.js +2 -0
  77. package/dist/cdn/RLEHNAIA.js +2 -0
  78. package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
  79. package/dist/cdn/SJR4IR57.js +2 -0
  80. package/dist/cdn/SPVOBZAL.js +2 -0
  81. package/dist/cdn/SUA3YJTU.js +22 -0
  82. package/dist/cdn/TFT6HK3O.js +208 -0
  83. package/dist/cdn/THR22OXW.js +2 -0
  84. package/dist/cdn/TPULIO6I.js +34 -0
  85. package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
  86. package/dist/cdn/UK7PR2FE.js +2 -0
  87. package/dist/cdn/UZLQALHY.js +2 -0
  88. package/dist/cdn/V6HOUZPZ.js +2 -0
  89. package/dist/cdn/VAXH6RUQ.js +134 -0
  90. package/dist/cdn/VPFIUEKT.js +14 -0
  91. package/dist/cdn/VXFQANGJ.js +2 -0
  92. package/dist/cdn/WSGWTIAV.js +9 -0
  93. package/dist/cdn/XCRR2EEG.js +6 -0
  94. package/dist/cdn/YHQJ66WJ.js +2 -0
  95. package/dist/cdn/YYSMCB4A.js +2 -0
  96. package/dist/cdn/Z6I6JACX.js +3 -0
  97. package/dist/cdn/ZB57WYHC.js +2 -0
  98. package/dist/cdn/ZS6SXJP2.js +2 -0
  99. package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
  100. package/dist/cdn/agent-utils/index.js +2 -0
  101. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +3 -0
  102. package/dist/cdn/agent-utils/middlewares/middleware.js +2 -0
  103. package/dist/cdn/agent-utils/middlewares/trace.js +2 -0
  104. package/dist/cdn/index.js +1 -1
  105. package/dist/cdn/main.css +1 -1
  106. package/dist/chunks/adapter.js +1794 -1597
  107. package/dist/chunks/arcgisKnowledgeGraph.js +126 -71
  108. package/dist/chunks/arcgis_knowledge_current_lc_context.js +19 -2
  109. package/dist/chunks/arcgis_knowledge_current_map_context.js +31 -2
  110. package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
  111. package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +116 -27
  112. package/dist/chunks/converterUtils.js +39 -32
  113. package/dist/chunks/dataExplorationGraph.js +139 -113
  114. package/dist/chunks/data_explore_query_prompt.js +9 -4
  115. package/dist/chunks/generateLayerDescriptions.js +231 -191
  116. package/dist/chunks/helpGraph.js +17 -13
  117. package/dist/chunks/help_prompt.js +34 -17
  118. package/dist/chunks/index.js +11 -0
  119. package/dist/chunks/intent_prompt.js +16 -0
  120. package/dist/chunks/layerStylingGraph.js +24 -20
  121. package/dist/chunks/navigationGraph.js +33 -28
  122. package/dist/chunks/navigation_intent_prompt.js +8 -2
  123. package/dist/chunks/orchestrator.js +267 -226
  124. package/dist/chunks/slottableRequestUtils.js +3 -7
  125. package/dist/chunks/state.js +1 -1
  126. package/dist/chunks/summarize_query_response_prompt.js +9 -7
  127. package/dist/chunks/toolCallResponse.js +12 -9
  128. package/dist/chunks/utils2.js +8 -8
  129. package/dist/components/arcgis-assistant/customElement.d.ts +27 -0
  130. package/dist/components/arcgis-assistant/customElement.js +385 -152
  131. package/dist/components/arcgis-assistant/index.js +2 -3
  132. package/dist/components/arcgis-assistant/types.d.ts +14 -1
  133. package/dist/components/arcgis-assistant-agent/customElement.js +5 -1
  134. package/dist/components/arcgis-assistant-chat/customElement.d.ts +8 -2
  135. package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
  136. package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +4 -1
  137. package/dist/components/arcgis-assistant-chat-entry/customElement.js +25 -18
  138. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +11 -5
  139. package/dist/components/arcgis-assistant-help-agent/customElement.js +8 -2
  140. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -1
  141. package/dist/components/arcgis-assistant-interrupt/customElement.js +12 -8
  142. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +20 -0
  143. package/dist/components/arcgis-assistant-interrupt-preview/index.js +2 -0
  144. package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +7 -7
  145. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +17 -11
  146. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +10 -4
  147. package/dist/components/arcgis-assistant-message/customElement.d.ts +23 -0
  148. package/dist/components/arcgis-assistant-message/customElement.js +28 -26
  149. package/dist/components/arcgis-assistant-message/index.d.ts +1 -0
  150. package/dist/components/arcgis-assistant-message/index.js +2 -0
  151. package/dist/components/arcgis-assistant-message-block/customElement.d.ts +1 -1
  152. package/dist/components/arcgis-assistant-message-block/customElement.js +18 -11
  153. package/dist/components/arcgis-assistant-message-block/index.js +1 -0
  154. package/dist/components/arcgis-assistant-message-feedback/customElement.d.ts +4 -1
  155. package/dist/components/arcgis-assistant-message-footer/customElement.d.ts +4 -1
  156. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +8 -1
  157. package/dist/components/arcgis-assistant-message-loading/customElement.js +8 -8
  158. package/dist/components/arcgis-assistant-message-loading/index.js +1 -0
  159. package/dist/components/arcgis-assistant-message-log/customElement.d.ts +4 -1
  160. package/dist/components/arcgis-assistant-message-read-aloud/customElement.d.ts +4 -1
  161. package/dist/components/arcgis-assistant-message-text/customElement.d.ts +5 -1
  162. package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
  163. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +11 -5
  164. package/dist/components/arcgis-assistant-speech-input/customElement.d.ts +6 -1
  165. package/dist/components/arcgis-assistant-suggested-prompts/customElement.d.ts +4 -1
  166. package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +8 -8
  167. package/dist/components/arcgis-assistant-user-message/customElement.d.ts +4 -1
  168. package/dist/components/arcgis-assistant-user-message/customElement.js +10 -8
  169. package/dist/docs/api.json +1 -1
  170. package/dist/docs/docs.json +1 -1
  171. package/dist/docs/vscode.html-custom-data.json +1 -1
  172. package/dist/docs/web-types.json +1 -1
  173. package/dist/index.d.ts +4 -0
  174. package/dist/loader.js +7 -6
  175. package/dist/oauth-callback.html +1 -1
  176. package/dist/types/lumina.d.ts +11 -5
  177. package/dist/types/preact.d.ts +12 -5
  178. package/dist/types/react.d.ts +13 -5
  179. package/dist/types/stencil.d.ts +11 -5
  180. package/dist/utils/index.d.ts +85 -42
  181. package/dist/utils/index.js +54 -49
  182. package/package.json +13 -12
  183. package/dist/cdn/2AXF774U.js +0 -2
  184. package/dist/cdn/3PKJWIC3.js +0 -2
  185. package/dist/cdn/462JBSEV.js +0 -422
  186. package/dist/cdn/5QAHYX7Y.js +0 -5
  187. package/dist/cdn/7BCR6TUO.js +0 -2
  188. package/dist/cdn/7GH7VSB2.js +0 -2
  189. package/dist/cdn/7PLV4QH6.js +0 -2
  190. package/dist/cdn/AO7BQHKC.js +0 -2
  191. package/dist/cdn/AXDZBBNL.js +0 -45
  192. package/dist/cdn/DDLZOMUY.js +0 -2
  193. package/dist/cdn/DHOVCT6R.js +0 -2
  194. package/dist/cdn/F2AHA4GB.js +0 -54
  195. package/dist/cdn/FHVXO2WG.js +0 -166
  196. package/dist/cdn/FX5JFRDL.js +0 -2
  197. package/dist/cdn/GSEPHN3A.js +0 -106
  198. package/dist/cdn/HB5A5R2E.js +0 -2
  199. package/dist/cdn/JY6LLOUJ.js +0 -22
  200. package/dist/cdn/KMQ3SP4I.js +0 -5
  201. package/dist/cdn/MDVYQQUG.js +0 -14
  202. package/dist/cdn/MH5RPXHM.js +0 -2
  203. package/dist/cdn/NAUXSHIE.js +0 -72
  204. package/dist/cdn/NVI3I46B.js +0 -2
  205. package/dist/cdn/OAVEHGB6.js +0 -2
  206. package/dist/cdn/OH64RMOR.js +0 -4
  207. package/dist/cdn/ON2V5XI2.js +0 -3
  208. package/dist/cdn/P6OPJQMC.js +0 -3
  209. package/dist/cdn/QR54T33D.js +0 -2
  210. package/dist/cdn/RVOAPUBN.js +0 -2
  211. package/dist/cdn/S6W6HV4T.js +0 -36
  212. package/dist/cdn/SXDLXCIM.js +0 -2
  213. package/dist/cdn/USMDJUFS.js +0 -2
  214. package/dist/cdn/V2P4AIGG.js +0 -2
  215. package/dist/cdn/V5YEZSRY.js +0 -16
  216. package/dist/cdn/Y333DGV6.js +0 -2
  217. package/dist/cdn/YIMNOUTF.js +0 -2
  218. package/dist/cdn/YY2SBO3V.js +0 -2
@@ -3,13 +3,43 @@ import type { BaseChannel, BinaryOperatorAggregate } from "@langchain/langgraph/
3
3
  import type { AnnotationRoot, StateDefinitionInit, StateGraph } from "@langchain/langgraph/web";
4
4
  import type { AgentExecutionContext, AgentRegistration, AgentStatus } from "../utils/index.js";
5
5
 
6
- /** @internal */
7
6
  export type AgentData = Record<string, unknown>;
8
7
 
9
- /** @internal */
10
8
  export type EmptyAgentData = Record<never, never>;
11
9
 
12
- /** @privateRemark All ADK agents are orchestrator-driven, so these channels exist for every agent graph. */
10
+ /** @internal */
11
+ export type ZodModule = {
12
+ z: typeof z;
13
+ };
14
+
15
+ export type SchemaPrimitiveFieldType = "boolean" | "number" | "string";
16
+
17
+ export type SchemaArrayItemDefinition = SchemaFieldDefinition | SchemaPrimitiveFieldType;
18
+
19
+ export type SchemaFieldDefinition = ({
20
+ type: "array";
21
+ itemType: SchemaArrayItemDefinition;
22
+ } | { type: "boolean" | "number"; } | {
23
+ type: "object";
24
+ fields: SchemaDefinition;
25
+ } | {
26
+ type: "string";
27
+ enum?: readonly string[];
28
+ }) & {
29
+ description?: string;
30
+ required?: boolean;
31
+ };
32
+
33
+ export type SchemaDefinition = Record<string, SchemaFieldDefinition>;
34
+
35
+ export type SchemaDefinitionData<TDefinition extends SchemaDefinition> = {
36
+ [K in keyof TDefinition as TDefinition[K] extends { required: true; } ? K : never]: SchemaFieldData<TDefinition[K]>;
37
+ } &
38
+ {
39
+ [K in keyof TDefinition as TDefinition[K] extends { required: true; } ? never : K]?: SchemaFieldData<TDefinition[K]>;
40
+ };
41
+
42
+ /** @privateRemark All agents are orchestrator-driven, so these channels exist for every agent graph. */
13
43
  export type AgentRuntimeState = {
14
44
  agentExecutionContext: AgentExecutionContext;
15
45
  /** The outputMessage is a string representing the output of an agent execution. */
@@ -101,7 +131,6 @@ export type AgentNodeUpdate<TInput extends AgentData, TOutput extends AgentData>
101
131
  * AgentStateAnnotation defines the shape of the agent state used in LangGraph nodes, including both the built-in runtime channels
102
132
  * and any custom fields defined by the agent.
103
133
  *
104
- * @internal
105
134
  * @since 5.1
106
135
  */
107
136
  export type AgentStateAnnotation<TState extends AgentData> = AnnotationRoot<{
@@ -123,7 +152,6 @@ export type RunnableUpdate<TState extends AgentData> = Partial<TState> extends o
123
152
  /**
124
153
  * Internal type representing the compiled graph used for agent execution.
125
154
  *
126
- * @internal
127
155
  * @since 5.1
128
156
  */
129
157
  export type TypedStateGraph<TState extends AgentData> = StateGraph<StateDefinitionInit, AgentGraphState<TState>, RunnableUpdate<AgentGraphState<TState>>, string>;
@@ -132,7 +160,6 @@ export type TypedStateGraph<TState extends AgentData> = StateGraph<StateDefiniti
132
160
  * The shape of the `createGraph` function used by agents to generate their internal graph representation.
133
161
  * This function is responsible for defining the nodes and edges of the graph, as well as any associated state and middleware.
134
162
  *
135
- * @internal
136
163
  * @since 5.1
137
164
  */
138
165
  export type AgentCreateGraph<TState extends AgentData> = () => TypedStateGraph<TState>;
@@ -149,4 +176,6 @@ export type GraphEdge<S extends AgentData> = {
149
176
  } | {
150
177
  from: string;
151
178
  to: string;
152
- };
179
+ };
180
+
181
+ export type SchemaFieldData<TField extends SchemaFieldDefinition> = TField extends { type: "string"; } ? TField["enum"] extends readonly (infer TValue extends string)[] ? TValue : string : TField extends { type: "array"; } ? (TField["itemType"] extends "string" ? string : TField["itemType"] extends "number" ? number : TField["itemType"] extends "boolean" ? boolean : TField["itemType"] extends SchemaFieldDefinition ? SchemaFieldData<TField["itemType"]> : never)[] : TField extends { type: "object"; } ? SchemaDefinitionData<TField["fields"]> : TField extends { type: "number"; } ? number : boolean;
@@ -26,7 +26,7 @@ export type ConditionDecider<TState extends AgentData = AgentData> = (state: Age
26
26
  * @since 5.1
27
27
  */
28
28
  export class ConditionalWorkflow<TState extends AgentData = AgentData> extends BaseWorkflow<TState> {
29
- constructor(properties: ConstructProperties<TState>);
29
+ constructor(properties: ConditionalWorkflowConstructProperties<TState>);
30
30
  /**
31
31
  * Must contain exactly two agents: `[trueAgent, falseAgent]`. The first agent is executed when
32
32
  * the condition is true, the second when the condition is false.
@@ -69,4 +69,4 @@ export class ConditionalWorkflow<TState extends AgentData = AgentData> extends B
69
69
  protected validateAgents(agents: BaseAgentLike<TState>[]): void;
70
70
  }
71
71
 
72
- export type ConstructProperties<TState extends AgentData> = Pick<ConditionalWorkflow<TState>, "agents" | "condition">;
72
+ export type ConditionalWorkflowConstructProperties<TState extends AgentData> = Pick<ConditionalWorkflow<TState>, "agents" | "condition">;
@@ -26,7 +26,7 @@ export type LoopDecider<TState extends AgentData = AgentData> = (state: AgentGra
26
26
  * @since 5.1
27
27
  */
28
28
  export class LoopWorkflow<TState extends AgentData = AgentData> extends BaseWorkflow<TState> {
29
- constructor(properties: ConstructProperties<TState>);
29
+ constructor(properties: LoopWorkflowConstructProperties<TState>);
30
30
  /**
31
31
  * Function that decides whether the loop should continue.
32
32
  *
@@ -55,4 +55,4 @@ export class LoopWorkflow<TState extends AgentData = AgentData> extends BaseWork
55
55
  protected isTerminalAgent(): boolean;
56
56
  }
57
57
 
58
- export type ConstructProperties<TState extends AgentData> = Pick<LoopWorkflow<TState>, "decideContinue" | "workflow">;
58
+ export type LoopWorkflowConstructProperties<TState extends AgentData> = Pick<LoopWorkflow<TState>, "decideContinue" | "workflow">;
@@ -20,7 +20,7 @@ import type { BaseWorkflow, WorkflowGenerateResult } from "./BaseWorkflow.js";
20
20
  * @since 5.1
21
21
  */
22
22
  export class ParallelWorkflow<TState extends AgentData = AgentData> extends BaseWorkflow<TState> {
23
- constructor(properties: ConstructProperties<TState>);
23
+ constructor(properties: ParallelWorkflowConstructProperties<TState>);
24
24
  /**
25
25
  * Agents to run in parallel from the same input snapshot.
26
26
  *
@@ -65,4 +65,4 @@ export class ParallelWorkflow<TState extends AgentData = AgentData> extends Base
65
65
  protected isTerminalAgent(_agents: BaseAgentLike<TState>[], _index: number): boolean;
66
66
  }
67
67
 
68
- export type ConstructProperties<TState extends AgentData> = Pick<ParallelWorkflow<TState>, "agents">;
68
+ export type ParallelWorkflowConstructProperties<TState extends AgentData> = Pick<ParallelWorkflow<TState>, "agents">;
@@ -16,7 +16,7 @@ import type { BaseWorkflow } from "./BaseWorkflow.js";
16
16
  * @since 5.1
17
17
  */
18
18
  export class RouterWorkflow<TState extends AgentData = AgentData> extends BaseWorkflow<TState> {
19
- constructor(properties: ConstructProperties<TState>);
19
+ constructor(properties: RouterWorkflowConstructProperties<TState>);
20
20
  /**
21
21
  * Mapping of route keys to destination agents.
22
22
  *
@@ -60,4 +60,4 @@ export class RouterWorkflow<TState extends AgentData = AgentData> extends BaseWo
60
60
  protected validateAgents(agents: BaseAgentLike<TState>[]): void;
61
61
  }
62
62
 
63
- export type ConstructProperties<TState extends AgentData> = Pick<RouterWorkflow<TState>, "agentsMap" | "routerAgent" | "routerOutputKey">;
63
+ export type RouterWorkflowConstructProperties<TState extends AgentData> = Pick<RouterWorkflow<TState>, "agentsMap" | "routerAgent" | "routerOutputKey">;
@@ -17,7 +17,7 @@ import type { AgentData, AgentGraphState, BaseAgentLike, GraphEdge } from "../ty
17
17
  * @since 5.1
18
18
  */
19
19
  export class SequentialWorkflow<TState extends AgentData = AgentData> extends BaseWorkflow<TState> {
20
- constructor(properties: ConstructProperties<TState>);
20
+ constructor(properties: SequentialWorkflowConstructProperties<TState>);
21
21
  /**
22
22
  * A list of agents to execute in the specified order.
23
23
  *
@@ -53,4 +53,4 @@ export class SequentialWorkflow<TState extends AgentData = AgentData> extends Ba
53
53
  protected validateAgents(agents: BaseAgentLike<TState>[]): void;
54
54
  }
55
55
 
56
- export type ConstructProperties<TState extends AgentData> = Pick<SequentialWorkflow<TState>, "agents">;
56
+ export type SequentialWorkflowConstructProperties<TState extends AgentData> = Pick<SequentialWorkflow<TState>, "agents">;
@@ -26,7 +26,7 @@ export type SwitchDecider<TState extends AgentData = AgentData> = (state: AgentG
26
26
  * @since 5.1
27
27
  */
28
28
  export class SwitchWorkflow<TState extends AgentData = AgentData> extends BaseWorkflow<TState> {
29
- constructor(properties: ConstructProperties<TState>);
29
+ constructor(properties: SwitchWorkflowConstructProperties<TState>);
30
30
  /**
31
31
  * Mapping of keys to destination agents.
32
32
  *
@@ -70,5 +70,5 @@ export class SwitchWorkflow<TState extends AgentData = AgentData> extends BaseWo
70
70
  protected validateAgents(agents: BaseAgentLike<TState>[]): void;
71
71
  }
72
72
 
73
- export type ConstructProperties<TState extends AgentData> = Partial<Pick<SwitchWorkflow<TState>, "defaultAgent">>
73
+ export type SwitchWorkflowConstructProperties<TState extends AgentData> = Partial<Pick<SwitchWorkflow<TState>, "defaultAgent">>
74
74
  & Pick<SwitchWorkflow<TState>, "agentsMap" | "resolver">;
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import a from"./ZS6SXJP2.js";import{c as l}from"./57OMVTIU.js";import"./TFT6HK3O.js";import"./LUY6V4TP.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([{property:g,subclass:u},{d:w}])=>{var f=Object.defineProperty,m=Object.getOwnPropertyDescriptor,c=(o,r,n,s)=>{for(var e=s>1?void 0:s?m(r,n):r,a=o.length-1,t;a>=0;a--)(t=o[a])&&(e=(s?t(r,n,e):t(e))||e);return s&&e&&f(r,n,e),e},p=class extends w{constructor(o){super(o)}getAgents(){return this.workflow.getAgents()}generate(){let o=this.workflow.generate(),r=o.workspace,n=o.createGraph().compile(),{decideContinue:s}=this,e={[i]:async(t,d)=>await n.invoke(t,d)},a=[{from:i,decide:async(t,d)=>await Promise.resolve(s(t,d))?i:void 0}];return{workspace:r,createGraph:()=>l(e,a,r,{entryNode:i})}}buildEdges(){throw new Error("LoopWorkflow overrides generate(); buildEdges should not be called.")}getEntryNode(){return i}isTerminalAgent(){return!0}};c([g()],p.prototype,"workflow",2);c([g()],p.prototype,"decideContinue",2);p=c([u("LoopWorkflow")],p);var i="__loop_body";return p},"core/accessorSupport/decorators",a)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{b as r}from"./OAVEHGB6.js";function s(e,n){return n?typeof n=="string"?l(e,n)??null:n:r(e,"arcgis-map")??null}function c(e,n){return n?typeof n=="string"?l(e,n)??null:n:r(e,"arcgis-link-chart")??r(e,"arcgis-map")??null}function l(e,n){let i=n.includes("#")||n.includes(".")||n.includes("["),t=e.getRootNode();return(i?void 0:t.querySelector(`#${n}`))??t.querySelector(n)??void 0}export{s as a,c as b};
2
+ import{c as r}from"./RLEHNAIA.js";function s(e,n){return n?typeof n=="string"?l(e,n)??null:n:r(e,"arcgis-map")??null}function c(e,n){return n?typeof n=="string"?l(e,n)??null:n:r(e,"arcgis-link-chart")??r(e,"arcgis-map")??null}function l(e,n){let i=n.includes("#")||n.includes(".")||n.includes("["),t=e.getRootNode();return(i?void 0:t.querySelector(`#${n}`))??t.querySelector(n)??void 0}export{s as a,c as b};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ function o(e,n){return`block-${e}-${n}`}export{o as a};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import b from"./ZS6SXJP2.js";import a from"./HBLRVXEB.js";import{c as m}from"./57OMVTIU.js";import"./TFT6HK3O.js";import"./LUY6V4TP.js";import"./MWYBF3F3.js";import"./UZLQALHY.js";export default $arcgis.t(([{property:n,subclass:l},{watch:w},c])=>{var d=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=(e,r,s,o)=>{for(var t=o>1?void 0:o?f(r,s):r,i=e.length-1,a;i>=0;i--)(a=e[i])&&(t=(o?a(r,s,t):a(t))||t);return o&&t&&d(r,s,t),t},h=class extends c{constructor(e){super(e)}initialize(){this.addHandles(w(()=>[this.name,this.description,this.inputSchema,this.outputSchema,this.workflow],()=>this.generate(),{initial:!0,sync:!0}))}getSchemas(){return[this.inputSchema,...this.workflow.getAgents().flatMap(e=>e.getSchemas()),this.outputSchema].filter(Boolean)}generate(){let{workspace:e,createGraph:r}=this.workflow.generate();if(this._set("workspace",e),!this.middlewares?.length)this._set("createGraph",r);else{let s=this.id,o={[s]:async(i,a)=>await r().compile().invoke(i,a)},t=[{from:s,decide:()=>{}}];this._set("createGraph",()=>m(o,t,e,{agent:this,entryNode:s,middlewares:this.middlewares}))}}};p([n()],h.prototype,"workflow",2);p([n()],h.prototype,"inputSchema",2);p([n()],h.prototype,"outputSchema",2);h=p([l("WorkflowAgent")],h);return h},"core/accessorSupport/decorators","core/reactiveUtils",a,b)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as l}from"./GYVSHAUI.js";import"./F5SUU35Z.js";import"./RLEHNAIA.js";import{g as a,h as e,k as o,t as i,u as n,v as r,z as c}from"./NAKAZDJ7.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";export default $arcgis.t(([{watch:d}])=>{var g=a`.container{display:flex;align-items:center;width:100%;justify-content:space-between;gap:var(--calcite-spacing-xs)}.start,.end{display:flex;align-items:center;gap:var(--calcite-spacing-xs)}`,t=class extends r{constructor(){super(...arguments),this._messages=l({blocking:!0}),this._endRef=i(),this._showLog=!1,this.feedbackEnabled=!1,this.logEnabled=!1,this.copyEnabled=!1,this.readAloudEnabled=!1}static{this.properties={_showLog:16,feedbackEnabled:5,logEnabled:5,copyEnabled:5,readAloudEnabled:5,message:0}}static{this.styles=g}loaded(){this.manager.onLifecycle(()=>[d(()=>this._showLog,()=>this._scrollToEnd())])}_scrollToEnd(){requestAnimationFrame(()=>{this._endRef.value?.scrollIntoView({behavior:"smooth",block:"end"})})}_renderCopyButton(){return!this.message?.error&&this.copyEnabled?e`<calcite-action id=action-copy icon=copy-to-clipboard scale=s @click=${async()=>{try{let s=this.message?.content?.trim();s&&await navigator.clipboard.writeText(s)}catch(s){o("warn","assistant-message-footer","Failed to copy text to clipboard",{once:!0,detail:{error:s}})}}} text></calcite-action><calcite-tooltip reference-element=action-copy overlay-positioning=fixed placement=bottom><span>${this._messages.copyButtonLabel}</span></calcite-tooltip>`:null}_renderLogButton(){return this.message?.log?.length&&this.logEnabled?e`<calcite-action id=action-log icon=access-string-results scale=s @click=${()=>this._showLog=!this._showLog} .text=${this._messages.logButtonLabel} .active=${this._showLog}></calcite-action><calcite-tooltip reference-element=action-log overlay-positioning=fixed placement=bottom><span>${this._messages.logButtonLabel}</span></calcite-tooltip>`:null}_renderReadAloudButton(){return e`<arcgis-assistant-message-read-aloud .message=${this.message} .readAloudEnabled=${this.readAloudEnabled}></arcgis-assistant-message-read-aloud>`}_renderLog(){return e`<arcgis-assistant-message-log .log=${this.message?.log} .showLog=${this._showLog} .logEnabled=${this.logEnabled}></arcgis-assistant-message-log>`}_renderFeedback(){return e`<arcgis-assistant-message-feedback .message=${this.message} .feedbackEnabled=${this.feedbackEnabled}></arcgis-assistant-message-feedback>`}render(){return e`${this._renderLog()}<div class="container"><div class="start">${this._renderCopyButton()}${this._renderLogButton()}${this._renderReadAloudButton()}<slot name=footer-actions-start></slot></div><div class="end"><slot name=footer-actions-end></slot>${this._renderFeedback()}</div></div><div ${n(this._endRef)}></div>`}};c("arcgis-assistant-message-footer",t);return t},"core/reactiveUtils")
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{Va as k,a as E,b as y,ha as h}from"./TFT6HK3O.js";var j=new Set(["agentExecutionContext","outputMessage","summary","status"]);function x(){return{assignedTask:"",messages:[],priorSteps:[],sharedState:{},userRequest:""}}function O(r){let o=[...new Set([...r].filter(n=>j.has(n)))];if(o.length!==0)throw new Error(`custom state cannot define reserved runtime fields: ${o.join(", ")}.`)}function S(r){let o=Object.entries(r);return Object.fromEntries(o.map(([n,t])=>[n,h({reducer:(i,g)=>g,default:()=>t})]))}function $(r={}){O(Object.keys(r));let o=S(r);return h.Root({...o,agentExecutionContext:h({reducer:(n,t)=>({...n,...t}),default:x}),outputMessage:h({reducer:(n="",t)=>typeof t=="string"&&t.trim()?t:n,default:()=>""}),summary:h({reducer:(n="",t)=>typeof t=="string"?t:n,default:()=>""}),status:h({reducer:(n,t)=>t??n,default:()=>{}})})}function M(r){let o=new Set;for(let t of r)for(let i of Object.keys(t.shape??{}))o.add(i);let n=Object.fromEntries([...o].map(t=>[t,void 0]));return $(n)}function T(r,o,n,t={}){let{agent:i,entryNode:g,middlewares:c=[]}=t,a=new k(n);if(Object.keys(r).length===0)throw new Error("Graph requires at least one node.");if(o.length===0)throw new Error("Graph requires at least one edge.");if(c.length>0&&!i)throw new Error("Graph middleware requires agent metadata.");let s=new Set(Object.keys(r)),l=new Map,w=new Map;for(let e of s)l.set(e,0),w.set(e,0);for(let e of o)"to"in e?(s.has(e.from)&&w.set(e.from,(w.get(e.from)??0)+1),s.has(e.to)&&l.set(e.to,(l.get(e.to)??0)+1)):s.has(e.from)&&w.set(e.from,(w.get(e.from)??0)+1);for(let[e,f]of Object.entries(r)){let u=N(i,e,c,async(d,p)=>await Promise.resolve(f(d,p))),m=async(d,p)=>await u(d,p);a=a.addNode(e,m)}for(let e of o)if("to"in e){let f=e.from,u=e.to;if(!s.has(f))throw new Error(`Graph edge references unknown from-node: ${f}`);if(!s.has(u))throw new Error(`Graph edge references unknown to-node: ${u}`);a.addEdge(f,u)}else{let f=e.from;if(!s.has(f))throw new Error(`Graph conditional edge references unknown from-node: ${f}`);a.addConditionalEdges(f,async(u,m)=>{let d=await e.decide(u,m);if(!d)return y;if(!s.has(d))throw new Error(`Graph conditional edge returned unknown node: ${d}`);return d})}let G=q(s,l,g);a.addEdge(E,G);let b=[...s].filter(e=>(w.get(e)??0)===0);for(let e of b)a.addEdge(e,y);return a}function N(r,o,n,t){return!n.length||!r?t:async(i,g)=>await n.reduceRight((c,a)=>async s=>await a.handler(s,c),async c=>{let a=await t(c.state,c.config);return{...c.state,...a}})({agent:r,config:g,nodeName:o,state:i})}function q(r,o,n){if(n){if(!r.has(n))throw new Error(`Graph entry node references unknown node: ${n}`);return n}let t=[...r].filter(i=>(o.get(i)??0)===0);if(t.length!==1)throw new Error(`Graph could not infer a single entry node (found ${t.length}). Provide an explicit entryNode or ensure exactly one node has no incoming edges.`);return t[0]}export{$ as a,M as b,T as c};