@arcgis/ai-components 5.2.0-next.8 → 5.2.0-next.84
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 +3 -2
- package/dist/agent-utils/WorkflowAgent.d.ts +2 -2
- 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 +183 -0
- package/dist/agentic-workflow/nodes/AgentNode.d.ts +27 -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 +109 -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 +52 -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 +154 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.js +141 -0
- package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/queryFeatures/adapter.js +127 -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/2EY3BQQX.js +2 -0
- package/dist/cdn/34O57OGV.js +2 -0
- package/dist/cdn/3POGAH2X.js +2 -0
- package/dist/cdn/3SEKXQVK.js +9 -0
- package/dist/cdn/{AMP6IALT.js → 3UEKINYC.js} +1 -1
- package/dist/cdn/434TAA3J.js +2 -0
- package/dist/cdn/4HDDRBIY.js +2 -0
- package/dist/cdn/4NJ2FF7H.js +2 -0
- package/dist/cdn/4OGR5QKS.js +2 -0
- package/dist/cdn/4QGVOLW6.js +22 -0
- package/dist/cdn/4WIDLQUH.js +2 -0
- package/dist/cdn/5WYRJMBW.js +2 -0
- package/dist/cdn/5X7EG7D2.js +2 -0
- package/dist/cdn/5ZFUGNRN.js +2 -0
- package/dist/cdn/6HF36IKA.js +2 -0
- package/dist/cdn/6KFMRBAA.js +2 -0
- package/dist/cdn/6NHYXISD.js +2 -0
- package/dist/cdn/6U4GTCLJ.js +66 -0
- package/dist/cdn/7BCQMK6D.js +2 -0
- package/dist/cdn/7FY7WAA5.js +2 -0
- package/dist/cdn/7GMCLVSZ.js +2 -0
- package/dist/cdn/7M6VKBTK.js +6 -0
- package/dist/cdn/{GGSZM7KV.js → 7Q5EESAR.js} +6 -4
- package/dist/cdn/7SRLZQVC.js +5 -0
- package/dist/cdn/7TXR75RG.js +2 -0
- package/dist/cdn/7V6OSTFC.js +2 -0
- package/dist/cdn/7VAQUCBU.js +9 -0
- package/dist/cdn/7ZFAFKJT.js +2 -0
- package/dist/cdn/ACJTJLZN.js +2 -0
- package/dist/cdn/AI6DYOKR.js +181 -0
- package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
- package/dist/cdn/APFZY4PI.js +2 -0
- package/dist/cdn/AT4XVTJR.js +44 -0
- package/dist/cdn/AZ5G7YZH.js +3 -0
- package/dist/cdn/{FL4W4VYN.js → BL273EGZ.js} +17 -1
- package/dist/cdn/BM3WFHJG.js +2 -0
- package/dist/cdn/{DHOVCT6R.js → BPCBE7J6.js} +1 -1
- 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/CP5BVGJU.js +2 -0
- package/dist/cdn/CZM4URK7.js +2 -0
- package/dist/cdn/DPALM2OW.js +2 -0
- package/dist/cdn/E7JZ7GUW.js +18 -0
- package/dist/cdn/EMLOVMD4.js +2 -0
- package/dist/cdn/EWLXNGKH.js +208 -0
- package/dist/cdn/F2J6BMMX.js +36 -0
- package/dist/cdn/FAR3DFFK.js +2 -0
- package/dist/cdn/FDOMMK2M.js +2 -0
- package/dist/cdn/{ZLXN7NMF.js → FYZATVB3.js} +10 -8
- package/dist/cdn/GFEOVHJK.js +2 -0
- package/dist/cdn/HDM2D2GD.js +2 -0
- package/dist/cdn/HHFNQR6Z.js +2 -0
- package/dist/cdn/HMUWQCXU.js +2 -0
- package/dist/cdn/I3ONG4AX.js +2 -0
- package/dist/cdn/IBZ2NEAO.js +2 -0
- package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
- package/dist/cdn/IFJM5XEQ.js +2 -0
- package/dist/cdn/IHP25JWI.js +99 -0
- package/dist/cdn/J6A4AS7E.js +22 -0
- package/dist/cdn/J6SZIQJA.js +2 -0
- package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
- package/dist/cdn/JKIESH74.js +2 -0
- package/dist/cdn/JO5ETMPS.js +2 -0
- package/dist/cdn/JWIE3YK3.js +2 -0
- package/dist/cdn/K2R6XVK3.js +2 -0
- package/dist/cdn/KITIP6J2.js +2 -0
- package/dist/cdn/KPO4XX6J.js +2 -0
- package/dist/cdn/KWD2ECTM.js +2 -0
- package/dist/cdn/L7XTRDFM.js +3 -0
- package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
- package/dist/cdn/LLUGJKAQ.js +2 -0
- package/dist/cdn/LMPNXXTQ.js +2 -0
- package/dist/cdn/LYKCYBGB.js +2 -0
- package/dist/cdn/{3PKJWIC3.js → M2L5R4LA.js} +1 -1
- package/dist/cdn/{V2P4AIGG.js → M4URMXDS.js} +1 -1
- package/dist/cdn/MDAKBX7N.js +2 -0
- package/dist/cdn/MWYBF3F3.js +66 -0
- package/dist/cdn/NEV6OZN3.js +71 -0
- package/dist/cdn/NQDOAPE3.js +2 -0
- package/dist/cdn/OAKRPM7D.js +2 -0
- package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
- package/dist/cdn/ONMNQBPO.js +2 -0
- package/dist/cdn/ONQ6JSBJ.js +2 -0
- package/dist/cdn/OWTGH34K.js +2 -0
- package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
- package/dist/cdn/PSYRZMX2.js +2 -0
- package/dist/cdn/PUHRBGKB.js +2 -0
- package/dist/cdn/Q57QWN5W.js +2 -0
- package/dist/cdn/QNNGPA3Q.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/RV55GABG.js +2 -0
- package/dist/cdn/RWWOOC7S.js +2 -0
- package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
- package/dist/cdn/T4RIGOXB.js +2 -0
- package/dist/cdn/TACBKKBI.js +2 -0
- package/dist/cdn/TMJMDCSA.js +4 -0
- package/dist/cdn/TPULIO6I.js +34 -0
- package/dist/cdn/U2D53TAX.js +14 -0
- package/dist/cdn/UEEH5ZQK.js +156 -0
- package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
- package/dist/cdn/UHZG7SKO.js +2 -0
- package/dist/cdn/UZLQALHY.js +2 -0
- package/dist/cdn/V52XWEGV.js +11 -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/VNJMTA6O.js +2 -0
- package/dist/cdn/VOKXKU7M.js +56 -0
- package/dist/cdn/VXFQANGJ.js +2 -0
- package/dist/cdn/WKTQVBFJ.js +2 -0
- package/dist/cdn/WLH47YFC.js +14 -0
- package/dist/cdn/WP7ORLSB.js +6 -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/Z5W4V7RC.js +2 -0
- package/dist/cdn/ZLWWWTH4.js +2 -0
- package/dist/cdn/ZOEMBHRF.js +2 -0
- package/dist/cdn/ZQMBJ6MI.js +2 -0
- package/dist/cdn/ZRESBCJL.js +2 -0
- package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
- package/dist/cdn/ZUNLFO6M.js +3 -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/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/chunks/adapter.js +1294 -2112
- package/dist/chunks/arcgisKnowledgeGraph.js +127 -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 +56 -0
- package/dist/chunks/converterUtils.js +66 -41
- package/dist/chunks/dataExplorationGraph.js +132 -177
- 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 +259 -282
- package/dist/chunks/helpGraph.js +34 -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 +36 -31
- package/dist/chunks/mergeWhereClauses.js +15 -0
- package/dist/chunks/navigationGraph.js +123 -103
- package/dist/chunks/navigation_intent_prompt.js +8 -2
- package/dist/chunks/orchestrator.js +205 -175
- 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 +13 -10
- package/dist/chunks/types.js +59 -0
- package/dist/chunks/utils2.js +11 -11
- package/dist/components/arcgis-assistant/customElement.d.ts +56 -0
- package/dist/components/arcgis-assistant/customElement.js +387 -155
- 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 +608 -10
- package/dist/components/arcgis-assistant-chat/customElement.d.ts +2 -1
- package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
- package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +2 -0
- package/dist/components/arcgis-assistant-chat-entry/customElement.js +25 -18
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +19 -3
- package/dist/components/arcgis-assistant-help-agent/customElement.js +28 -6
- package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
- 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 +39 -16
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +29 -6
- package/dist/components/arcgis-assistant-message/customElement.d.ts +5 -0
- package/dist/components/arcgis-assistant-message/customElement.js +29 -26
- package/dist/components/arcgis-assistant-message/index.js +2 -0
- 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-loading/customElement.d.ts +7 -0
- 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-text/customElement.d.ts +1 -0
- package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +17 -3
- package/dist/components/arcgis-assistant-speech-input/customElement.js +29 -46
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +8 -8
- package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
- 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/loader.js +9 -8
- package/dist/oauth-callback.html +1 -1
- package/dist/types/lumina.d.ts +9 -8
- package/dist/types/preact.d.ts +9 -8
- package/dist/types/react.d.ts +9 -8
- package/dist/types/stencil.d.ts +11 -10
- package/dist/utils/index.d.ts +10 -10
- package/dist/utils/index.js +56 -55
- package/package.json +32 -12
- package/dist/cdn/2AXF774U.js +0 -2
- package/dist/cdn/462JBSEV.js +0 -422
- package/dist/cdn/53ZCUPKK.js +0 -22
- package/dist/cdn/5QAHYX7Y.js +0 -5
- package/dist/cdn/5XRDJL7R.js +0 -14
- 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/EECZLT6C.js +0 -166
- package/dist/cdn/ETRWZ3MS.js +0 -108
- package/dist/cdn/F2AHA4GB.js +0 -54
- package/dist/cdn/FX5JFRDL.js +0 -2
- package/dist/cdn/H7422XUG.js +0 -2
- package/dist/cdn/HB5A5R2E.js +0 -2
- package/dist/cdn/I6HNBTWY.js +0 -2
- package/dist/cdn/IG6YKZH3.js +0 -3
- package/dist/cdn/KMQ3SP4I.js +0 -5
- 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/P26NON3Z.js +0 -16
- package/dist/cdn/P6OPJQMC.js +0 -3
- package/dist/cdn/QR54T33D.js +0 -2
- package/dist/cdn/RVOAPUBN.js +0 -2
- package/dist/cdn/S3VPZFWQ.js +0 -36
- package/dist/cdn/SXDLXCIM.js +0 -2
- package/dist/cdn/USMDJUFS.js +0 -2
- package/dist/cdn/Y333DGV6.js +0 -2
- package/dist/cdn/YIMNOUTF.js +0 -2
|
@@ -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:
|
|
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
|
|
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:
|
|
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
|
|
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:
|
|
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
|
|
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:
|
|
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
|
|
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:
|
|
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
|
|
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:
|
|
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
|
|
73
|
+
export type SwitchWorkflowConstructProperties<TState extends AgentData> = Partial<Pick<SwitchWorkflow<TState>, "defaultAgent">>
|
|
74
74
|
& Pick<SwitchWorkflow<TState>, "agentsMap" | "resolver">;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AgentCreateGraph, AgentCustomState, AgentData, AgentStateAnnotation, ZodObjectSchema } from "../agent-utils/types.js";
|
|
2
|
+
import type { AgenticWorkflowJson } from "./jsonTypes.js";
|
|
3
|
+
import type { GraphNodeResultsState } from "./types.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Loads and compiles an ArcGIS Agentic Workflow definition into an executable graph.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export class AgenticWorkflowRuntime<TInput extends AgentData = AgentData, TOutput extends AgentData = AgentData> {
|
|
11
|
+
/** @param sourceJSON */
|
|
12
|
+
static fromJSON<TInput extends AgentData = AgentData, TOutput extends AgentData = AgentData>(sourceJSON: AgenticWorkflowJson): AgenticWorkflowRuntime<TInput, TOutput>;
|
|
13
|
+
generate(): AgenticWorkflowGenerateResult<TInput, TOutput>;
|
|
14
|
+
getSchemas(): ZodObjectSchema<object>[];
|
|
15
|
+
load(): Promise<this>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type AgenticWorkflowGenerateResult<TInput extends AgentData, TOutput extends AgentData> = {
|
|
19
|
+
createGraph: AgentCreateGraph<AgenticWorkflowState<TInput, TOutput>>;
|
|
20
|
+
workspace: AgentStateAnnotation<AgenticWorkflowState<TInput, TOutput>>;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type AgenticWorkflowState<TInput extends AgentData, TOutput extends AgentData> = GraphNodeResultsState
|
|
24
|
+
& Omit<AgentCustomState<TInput, TOutput>, "nodes">;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type Accessor from "@arcgis/core/core/Accessor.js";
|
|
2
|
+
import type { AgenticWorkflowEdgeJson } from "./jsonTypes.js";
|
|
3
|
+
|
|
4
|
+
/** @internal */
|
|
5
|
+
export class Edge extends Accessor {
|
|
6
|
+
/** @param json */
|
|
7
|
+
static fromJSON(json: AgenticWorkflowEdgeJson): Edge;
|
|
8
|
+
constructor(properties?: EdgeConstructProperties);
|
|
9
|
+
accessor id: string;
|
|
10
|
+
accessor sourceAnchorId: string;
|
|
11
|
+
accessor sourceNodeId: string;
|
|
12
|
+
accessor targetAnchorId: string | undefined;
|
|
13
|
+
accessor targetNodeId: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type EdgeConstructProperties = Pick<Edge, "id" | "sourceAnchorId" | "sourceNodeId" | "targetAnchorId" | "targetNodeId">;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type PortalItem from "@arcgis/core/portal/PortalItem.js";
|
|
2
|
+
import type { BaseAgent } from "../agent-utils/BaseAgent.js";
|
|
3
|
+
import type { AgentData, ZodObjectSchema } from "../agent-utils/types.js";
|
|
4
|
+
import type { AgenticWorkflowJson } from "./jsonTypes.js";
|
|
5
|
+
import type { AgenticWorkflowState } from "./AgenticWorkflowRuntime.js";
|
|
6
|
+
|
|
7
|
+
/** @internal */
|
|
8
|
+
export class WebAgent<TInput extends AgentData = AgentData, TOutput extends AgentData = AgentData> extends BaseAgent<WebAgentState<TInput, TOutput>> {
|
|
9
|
+
constructor(properties?: WebAgentConstructProperties<TInput, TOutput>);
|
|
10
|
+
/**
|
|
11
|
+
* The portal item associated with this web agent
|
|
12
|
+
*
|
|
13
|
+
* @required
|
|
14
|
+
*/
|
|
15
|
+
accessor portalItem: PortalItem | undefined;
|
|
16
|
+
accessor sourceJSON: AgenticWorkflowJson | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Rebuilds internal workspace and createGraph wiring. This is automatically called during initialization and whenever
|
|
19
|
+
* the name or description properties change, but can also be called manually if needed to refresh the agent's graph definition.
|
|
20
|
+
*
|
|
21
|
+
* The agent implementation is responsible for defining the createGraph function and workspace structure in this method, which are then used during execution.
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
generate(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Returns all schemas required by this agent implementation.
|
|
28
|
+
*
|
|
29
|
+
* @returns An array of Zod object schemas that define the structure of the agent's expected input and output data.
|
|
30
|
+
* These schemas are used for validation and type inference during graph execution.
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
getSchemas(): ZodObjectSchema<object>[];
|
|
34
|
+
load(): Promise<this>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type WebAgentState<TInput extends AgentData, TOutput extends AgentData> = AgenticWorkflowState<TInput, TOutput>;
|
|
38
|
+
|
|
39
|
+
export type WebAgentConstructProperties<TInput extends AgentData, TOutput extends AgentData> = Partial<Pick<WebAgent<TInput, TOutput>, "portalItem" | "sourceJSON">>;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
export type AgenticWorkflowJson = AgenticWorkflowJsonObject
|
|
2
|
+
& {
|
|
3
|
+
readonly description?: string;
|
|
4
|
+
readonly graph: AgenticWorkflowGraphJson;
|
|
5
|
+
readonly variables: AgenticWorkflowVariableJson[];
|
|
6
|
+
readonly version: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type AgenticWorkflowEdgeJson = AgenticWorkflowJsonObject
|
|
10
|
+
& {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly source_anchor_id: AgenticWorkflowSourceAnchorIdJson;
|
|
13
|
+
readonly source_node_id: AgenticWorkflowNodeIdJson;
|
|
14
|
+
readonly target_anchor_id?: AgenticWorkflowNodeIdJson;
|
|
15
|
+
readonly target_node_id: AgenticWorkflowNodeIdJson;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type AgenticWorkflowNodeTypeJson = "agent_node" | "end_message_node" | "guardrails_node" | "hitl_node" | "loop_node" | "start_node";
|
|
19
|
+
|
|
20
|
+
export type AgenticWorkflowBaseNodeJson<TType extends AgenticWorkflowNodeTypeJson> = AgenticWorkflowJsonObject
|
|
21
|
+
& {
|
|
22
|
+
readonly id: AgenticWorkflowNodeIdJson;
|
|
23
|
+
readonly label: string;
|
|
24
|
+
readonly type: TType;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type AgenticWorkflowStartNodeJson = AgenticWorkflowBaseNodeJson<"start_node">;
|
|
28
|
+
|
|
29
|
+
export type AgenticWorkflowEndMessageNodeJson = AgenticWorkflowBaseNodeJson<"end_message_node">
|
|
30
|
+
& {
|
|
31
|
+
readonly message: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type AgenticWorkflowAgentNodeJson = AgenticWorkflowBaseNodeJson<"agent_node">
|
|
35
|
+
& {
|
|
36
|
+
readonly prompt?: AgenticWorkflowPromptJson;
|
|
37
|
+
readonly structured_output?: AgenticWorkflowStructuredJsonSchemaJson;
|
|
38
|
+
readonly tools?: AgenticWorkflowToolJson[];
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type AgenticWorkflowArcgisToolJson = AgenticWorkflowJsonObject
|
|
42
|
+
& {
|
|
43
|
+
readonly type: "arcgis_tool";
|
|
44
|
+
readonly name: string;
|
|
45
|
+
readonly require_approval: AgenticWorkflowApprovalRequirementJson;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type AgenticWorkflowJsonObject = { readonly [key: string]: AgenticWorkflowJsonValue | undefined; };
|
|
49
|
+
|
|
50
|
+
export type AgenticWorkflowJsonValue = AgenticWorkflowJsonObject | AgenticWorkflowJsonPrimitive | AgenticWorkflowJsonValue[] | undefined;
|
|
51
|
+
|
|
52
|
+
export type AgenticWorkflowVariableJson = AgenticWorkflowJsonObject
|
|
53
|
+
& {
|
|
54
|
+
readonly data_type?: "array" | "boolean" | "number" | "object" | "string";
|
|
55
|
+
readonly description?: string;
|
|
56
|
+
readonly key: string;
|
|
57
|
+
readonly persisted: boolean;
|
|
58
|
+
readonly private: boolean;
|
|
59
|
+
readonly type: "value";
|
|
60
|
+
readonly value: AgenticWorkflowJsonValue;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type AgenticWorkflowGraphJson = AgenticWorkflowJsonObject
|
|
64
|
+
& {
|
|
65
|
+
readonly edges: AgenticWorkflowEdgeJson[];
|
|
66
|
+
readonly nodes: AgenticWorkflowNodeJson[];
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export type AgenticWorkflowNodeIdJson = `${string}_node_${number}`;
|
|
70
|
+
|
|
71
|
+
export type AgenticWorkflowSourceAnchorIdJson = `source_anchor_${string}`;
|
|
72
|
+
|
|
73
|
+
export type AgenticWorkflowNodeJson = AgenticWorkflowAgentNodeJson | AgenticWorkflowEndMessageNodeJson | AgenticWorkflowGuardrailsNodeJson | AgenticWorkflowHumanInTheLoopNodeJson | AgenticWorkflowLoopNodeJson | AgenticWorkflowStartNodeJson;
|
|
74
|
+
|
|
75
|
+
export type AgenticWorkflowGuardrailsNodeJson = AgenticWorkflowBaseNodeJson<"guardrails_node">
|
|
76
|
+
& {
|
|
77
|
+
readonly conditions: AgenticWorkflowConditionJson[];
|
|
78
|
+
readonly confidence_threshold: number;
|
|
79
|
+
readonly prompt?: AgenticWorkflowPromptJson;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export type AgenticWorkflowHumanInTheLoopNodeJson = AgenticWorkflowBaseNodeJson<"hitl_node">
|
|
83
|
+
& {
|
|
84
|
+
readonly conditions?: AgenticWorkflowConditionJson[];
|
|
85
|
+
readonly enable_feedback: boolean;
|
|
86
|
+
readonly human_input_description: string;
|
|
87
|
+
readonly human_input_description_type?: "dynamic" | "fixed";
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type AgenticWorkflowLoopNodeJson = AgenticWorkflowBaseNodeJson<"loop_node">
|
|
91
|
+
& {
|
|
92
|
+
readonly loop_back_node_id: AgenticWorkflowNodeIdJson;
|
|
93
|
+
readonly max_loop_count: number;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export type AgenticWorkflowConditionJson = AgenticWorkflowJsonObject
|
|
97
|
+
& {
|
|
98
|
+
readonly preset?: "process" | "reject";
|
|
99
|
+
readonly source_anchor_id: AgenticWorkflowSourceAnchorIdJson;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export type AgenticWorkflowPromptJson = AgenticWorkflowJsonObject
|
|
103
|
+
& {
|
|
104
|
+
readonly content?: string;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export type AgenticWorkflowStructuredJsonSchemaJson = AgenticWorkflowJsonObject
|
|
108
|
+
& {
|
|
109
|
+
readonly properties: Record<string, AgenticWorkflowStructuredJsonPropertyJson>;
|
|
110
|
+
readonly required?: string[];
|
|
111
|
+
readonly type: "object";
|
|
112
|
+
readonly additionalProperties: boolean;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export type AgenticWorkflowStructuredJsonPropertyJson = AgenticWorkflowJsonObject
|
|
116
|
+
& {
|
|
117
|
+
readonly description?: string;
|
|
118
|
+
readonly enum?: string[];
|
|
119
|
+
readonly items?: AgenticWorkflowStructuredJsonPropertyJson;
|
|
120
|
+
readonly properties?: Record<string, AgenticWorkflowStructuredJsonPropertyJson>;
|
|
121
|
+
readonly required?: string[];
|
|
122
|
+
readonly type: "array" | "boolean" | "number" | "object" | "string";
|
|
123
|
+
readonly additionalProperties?: boolean;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export type AgenticWorkflowToolJson = AgenticWorkflowArcgisToolJson | AgenticWorkflowMcpToolJson;
|
|
127
|
+
|
|
128
|
+
export type AgenticWorkflowMcpToolJson = AgenticWorkflowJsonObject
|
|
129
|
+
& {
|
|
130
|
+
readonly allowed_tools?: string[];
|
|
131
|
+
readonly args?: string[];
|
|
132
|
+
readonly auth?: AgenticWorkflowMcpToolAuthAPIKeyJson | AgenticWorkflowMcpToolAuthBearerJson | AgenticWorkflowMcpToolAuthOAuth2Json;
|
|
133
|
+
readonly command?: string;
|
|
134
|
+
readonly env?: Record<string, string>;
|
|
135
|
+
readonly label?: string;
|
|
136
|
+
readonly override_params?: AgenticWorkflowUpdateVariableJson[];
|
|
137
|
+
readonly require_approval: AgenticWorkflowApprovalRequirementJson;
|
|
138
|
+
readonly return_direct?: boolean;
|
|
139
|
+
readonly server_description?: string;
|
|
140
|
+
readonly server_label?: string;
|
|
141
|
+
readonly server_url?: string;
|
|
142
|
+
readonly type: "mcp";
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export type AgenticWorkflowApprovalRequirementJson = "always" | "never";
|
|
146
|
+
|
|
147
|
+
export type AgenticWorkflowUpdateVariableJson = AgenticWorkflowJsonObject
|
|
148
|
+
& {
|
|
149
|
+
readonly key: string;
|
|
150
|
+
readonly value: AgenticWorkflowExpressionValueJson;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export type AgenticWorkflowExpressionValueJson = AgenticWorkflowJsonObject
|
|
154
|
+
& {
|
|
155
|
+
readonly return_type?: "array" | "boolean" | "number" | "object" | "string" | "unknown";
|
|
156
|
+
readonly type: "constant" | "variable";
|
|
157
|
+
readonly value: boolean | number | string;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export type AgenticWorkflowMcpToolAuthBearerJson = {
|
|
161
|
+
mode: string;
|
|
162
|
+
header_name?: string;
|
|
163
|
+
scheme?: string;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export type AgenticWorkflowMcpToolAuthAPIKeyJson = {
|
|
167
|
+
mode: string;
|
|
168
|
+
header_name?: string;
|
|
169
|
+
prefix?: string;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export type AgenticWorkflowMcpToolAuthOAuth2Json = {
|
|
173
|
+
mode: string;
|
|
174
|
+
discovery?: string;
|
|
175
|
+
client_id?: string;
|
|
176
|
+
authorization_url?: string;
|
|
177
|
+
token_url?: string;
|
|
178
|
+
refresh_url?: string;
|
|
179
|
+
redirect_url?: string;
|
|
180
|
+
scope?: string;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export type AgenticWorkflowJsonPrimitive = boolean | number | string | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BaseNode } from "./BaseNode.js";
|
|
2
|
+
import type { AgenticWorkflowAgentNodeJson } from "../jsonTypes.js";
|
|
3
|
+
import type { AgentData, ZodObjectSchema } from "../../agent-utils/types.js";
|
|
4
|
+
import type { RuntimeNode, NodeCompilation, NodeCompilationContext } from "../types.js";
|
|
5
|
+
import type { ArcgisTool } from "./tools/ArcgisTool.js";
|
|
6
|
+
|
|
7
|
+
/** @internal */
|
|
8
|
+
export class AgentNode extends BaseNode {
|
|
9
|
+
/** @param json */
|
|
10
|
+
static fromJSON(json: AgenticWorkflowAgentNodeJson): AgentNode;
|
|
11
|
+
constructor(properties?: AgentNodeConstructProperties);
|
|
12
|
+
accessor outputSchema: ZodObjectSchema<AgentData> | undefined;
|
|
13
|
+
accessor prompt: string | undefined;
|
|
14
|
+
accessor tools: ArcgisTool[] | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* The type of this node, which identifies it as an agent node within the workflow.
|
|
17
|
+
*
|
|
18
|
+
* @default "agent-node"
|
|
19
|
+
* @required
|
|
20
|
+
*/
|
|
21
|
+
accessor type: "agent-node";
|
|
22
|
+
/** @param context */
|
|
23
|
+
compile<TCustomState extends AgentData>(context: NodeCompilationContext): NodeCompilation<TCustomState>;
|
|
24
|
+
createRuntimeNode<TCustomState extends AgentData>(): RuntimeNode<TCustomState>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type AgentNodeConstructProperties = Pick<AgentNode, "id" | "label" | "prompt" | "type">;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type Accessor from "@arcgis/core/core/Accessor.js";
|
|
2
|
+
import type { AgenticWorkflowBaseNodeJson, AgenticWorkflowNodeTypeJson } from "../jsonTypes.js";
|
|
3
|
+
import type { AgentData } from "../../agent-utils/types.js";
|
|
4
|
+
import type { NodeCompilation, NodeCompilationContext, RuntimeNode } from "../types.js";
|
|
5
|
+
|
|
6
|
+
/** @internal */
|
|
7
|
+
export abstract class BaseNode extends Accessor {
|
|
8
|
+
/** @param _json */
|
|
9
|
+
static fromJSON(_json: AgenticWorkflowBaseNodeJson<AgenticWorkflowNodeTypeJson>): BaseNode;
|
|
10
|
+
constructor(properties?: BaseNodeConstructProperties);
|
|
11
|
+
/**
|
|
12
|
+
* The unique identifier for this node.
|
|
13
|
+
*
|
|
14
|
+
* @required
|
|
15
|
+
*/
|
|
16
|
+
accessor id: string;
|
|
17
|
+
/**
|
|
18
|
+
* The label for this node, which is used for display purposes.
|
|
19
|
+
*
|
|
20
|
+
* @required
|
|
21
|
+
*/
|
|
22
|
+
accessor label: string;
|
|
23
|
+
/**
|
|
24
|
+
* The type of this node, which can be used to categorize or differentiate nodes within the agent's workflow.
|
|
25
|
+
*
|
|
26
|
+
* @required
|
|
27
|
+
*/
|
|
28
|
+
accessor type: string;
|
|
29
|
+
/** @param context */
|
|
30
|
+
compile<TCustomState extends AgentData>(context: NodeCompilationContext): NodeCompilation<TCustomState>;
|
|
31
|
+
abstract createRuntimeNode<TCustomState extends AgentData>(): RuntimeNode<TCustomState>;
|
|
32
|
+
load(): Promise<this>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type BaseNodeConstructProperties = Pick<BaseNode, "id" | "label" | "type">;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { BaseNode } from "./BaseNode.js";
|
|
2
|
+
import type { AgenticWorkflowEndMessageNodeJson } from "../jsonTypes.js";
|
|
3
|
+
import type { AgentData } from "../../agent-utils/types.js";
|
|
4
|
+
import type { NodeCompilation, NodeCompilationContext, RuntimeNode } from "../types.js";
|
|
5
|
+
|
|
6
|
+
/** @internal */
|
|
7
|
+
export class EndMessageNode extends BaseNode {
|
|
8
|
+
/** @param json */
|
|
9
|
+
static fromJSON(json: AgenticWorkflowEndMessageNodeJson): EndMessageNode;
|
|
10
|
+
constructor(properties?: EndMessageNodeConstructProperties);
|
|
11
|
+
/** The message associated with this end message node, which is displayed when the node is reached in the workflow. */
|
|
12
|
+
accessor message: string;
|
|
13
|
+
/**
|
|
14
|
+
* The type of this node, which identifies it as an end message node within the workflow.
|
|
15
|
+
*
|
|
16
|
+
* @default "end-message-node"
|
|
17
|
+
* @required
|
|
18
|
+
*/
|
|
19
|
+
accessor type: "end-message-node";
|
|
20
|
+
/** @param _context */
|
|
21
|
+
compile<TCustomState extends AgentData>(_context: NodeCompilationContext): NodeCompilation<TCustomState>;
|
|
22
|
+
createRuntimeNode<TCustomState extends AgentData>(): RuntimeNode<TCustomState>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type EndMessageNodeConstructProperties = Pick<EndMessageNode, "id" | "label" | "type">;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BaseNode } from "./BaseNode.js";
|
|
2
|
+
import type { AgenticWorkflowStartNodeJson } from "../jsonTypes.js";
|
|
3
|
+
import type { RuntimeNode } from "../types.js";
|
|
4
|
+
import type { AgentData } from "../../agent-utils/types.js";
|
|
5
|
+
|
|
6
|
+
/** @internal */
|
|
7
|
+
export class StartNode extends BaseNode {
|
|
8
|
+
/** @param json */
|
|
9
|
+
static fromJSON(json: AgenticWorkflowStartNodeJson): StartNode;
|
|
10
|
+
constructor(properties?: StartNodeConstructProperties);
|
|
11
|
+
/**
|
|
12
|
+
* The type of this node, which can be used to categorize or differentiate nodes within the agent's workflow.
|
|
13
|
+
*
|
|
14
|
+
* @default "start-node"
|
|
15
|
+
* @required
|
|
16
|
+
*/
|
|
17
|
+
accessor type: "start-node";
|
|
18
|
+
createRuntimeNode<TCustomState extends AgentData>(): RuntimeNode<TCustomState>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type StartNodeConstructProperties = Pick<StartNode, "id" | "label" | "type">;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type Accessor from "@arcgis/core/core/Accessor.js";
|
|
2
|
+
import type { AgenticWorkflowArcgisToolJson } from "../../jsonTypes.js";
|
|
3
|
+
import type { StructuredToolInterface } from "@langchain/core/tools";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Portal configuration for ArcGIS tools.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export class ArcgisTool extends Accessor {
|
|
11
|
+
/** @param json */
|
|
12
|
+
static fromJSON(json: AgenticWorkflowArcgisToolJson): ArcgisTool;
|
|
13
|
+
constructor(properties?: ArcgisToolConstructProperties);
|
|
14
|
+
accessor name: string | undefined;
|
|
15
|
+
accessor requireApproval: "always" | "never" | undefined;
|
|
16
|
+
/** @default "arcgis-tool" */
|
|
17
|
+
accessor type: "arcgis-tool";
|
|
18
|
+
createRuntimeTools(): Promise<StructuredToolInterface[]>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type ArcgisToolConstructProperties = Pick<ArcgisTool, "name" | "requireApproval">;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AgentData, AgentGraphState, AgentRuntimeState, GraphEdge, GraphNodes, ZodObjectSchema } from "../agent-utils/types.js";
|
|
2
|
+
import type { Edge } from "./Edge.js";
|
|
3
|
+
|
|
4
|
+
export type GraphNodeResultsState = {
|
|
5
|
+
nodes: GraphNodeResults;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type RuntimeNode<TCustomState extends AgentData> = GraphNodes<AgentGraphState<GraphNodeResultsState & Omit<TCustomState, "nodes">>, AgentNodeGraphUpdate>[string];
|
|
9
|
+
|
|
10
|
+
export type NodeCompilationContext = {
|
|
11
|
+
outgoingEdges: Edge[];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type NodeCompilation<TCustomState extends AgentData> = {
|
|
15
|
+
runtimeNode?: RuntimeNode<TCustomState>;
|
|
16
|
+
edges: GraphEdge<WebAgentRuntimeState<TCustomState>>[];
|
|
17
|
+
schemas?: ZodObjectSchema<object>[];
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type GraphNodeResults = Record<string, GraphNodeResult>;
|
|
21
|
+
|
|
22
|
+
export type AgentNodeGraphUpdate = Partial<AgentRuntimeState & GraphNodeResultsState>
|
|
23
|
+
& Record<string, unknown>;
|
|
24
|
+
|
|
25
|
+
export type WebAgentRuntimeState<TCustomState extends AgentData> = AgentGraphState<GraphNodeResultsState & Omit<TCustomState, "nodes">>;
|
|
26
|
+
|
|
27
|
+
export type GraphNodeResult<TOutput extends AgentData = AgentData> = {
|
|
28
|
+
output: Omit<TOutput, keyof AgentRuntimeState | "output"> | string;
|
|
29
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import { tool as l } from "@langchain/core/tools";
|
|
3
|
+
import o from "zod";
|
|
4
|
+
import { f } from "../../../../chunks/fetchAgentContext.js";
|
|
5
|
+
const i = (a) => {
|
|
6
|
+
const r = a.map?.allLayers.filter((t) => t.type === "feature");
|
|
7
|
+
let e = 0;
|
|
8
|
+
return r?.forEach((t) => {
|
|
9
|
+
const s = t;
|
|
10
|
+
s.featureEffect && (s.featureEffect = null, e++);
|
|
11
|
+
}), e > 0 ? `Cleared filters from ${e} layer(s). View unchanged.` : "No active filters to clear. View unchanged.";
|
|
12
|
+
}, n = async (a, r) => {
|
|
13
|
+
const { mapView: e } = f(r, ["mapView"]);
|
|
14
|
+
return i(e);
|
|
15
|
+
}, p = l(n, {
|
|
16
|
+
name: "clearFilters",
|
|
17
|
+
description: "Clears all feature effects/filters from the map but does NOT change the current view. Use when user says 'clear filters', 'reset filters', 'remove filters', 'show all features', or wants to remove emphasis without navigating anywhere.",
|
|
18
|
+
schema: o.object({})
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
p as clearFiltersTool
|
|
22
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import { tool as n } from "@langchain/core/tools";
|
|
3
|
+
import i from "zod";
|
|
4
|
+
import { f as l } from "../../../../chunks/fetchAgentContext.js";
|
|
5
|
+
const f = async (e) => {
|
|
6
|
+
e.map?.allLayers.filter((t) => t.type === "feature")?.forEach((t) => {
|
|
7
|
+
const s = t;
|
|
8
|
+
s.featureEffect && (s.featureEffect = null);
|
|
9
|
+
});
|
|
10
|
+
const o = e.map.initialViewProperties?.viewpoint?.targetGeometry;
|
|
11
|
+
return o ? (await e.goTo(o), "Cleared all filters and returned to home extent.") : "Cleared all filters. Could not determine home extent.";
|
|
12
|
+
}, p = async (e, r) => {
|
|
13
|
+
const { mapView: a } = l(r, ["mapView"]);
|
|
14
|
+
return await f(a);
|
|
15
|
+
}, h = n(p, {
|
|
16
|
+
name: "resetMap",
|
|
17
|
+
description: "Clears all feature effects/filters from the map AND zooms to the home extent (initial map view). Use when user says 'reset map', 'reset the map', 'start over', or wants to both clear filters and return to the initial view.",
|
|
18
|
+
schema: i.object({})
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
h as resetMapTool
|
|
22
|
+
};
|