@arcgis/ai-components 5.2.0-next.9 → 5.2.0-next.91
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 +4 -2
- package/dist/agent-utils/WorkflowAgent.d.ts +2 -2
- package/dist/agent-utils/WorkflowAgent.js +14 -15
- package/dist/agent-utils/index.d.ts +177 -0
- package/dist/agent-utils/index.js +167 -0
- package/dist/agent-utils/middlewares/trace.d.ts +2 -0
- package/dist/agent-utils/middlewares/trace.js +25 -33
- package/dist/agent-utils/tools/FunctionTool.d.ts +2 -2
- package/dist/agent-utils/types.d.ts +37 -8
- package/dist/agent-utils/workflows/ConditionalWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/LoopWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/ParallelWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/RouterWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/SequentialWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/SwitchWorkflow.d.ts +2 -2
- package/dist/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
- package/dist/agentic-workflow/Edge.d.ts +16 -0
- package/dist/agentic-workflow/WebAgent.d.ts +39 -0
- package/dist/agentic-workflow/jsonTypes.d.ts +189 -0
- package/dist/agentic-workflow/nodes/AgentNode.d.ts +28 -0
- package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
- package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
- package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
- package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
- package/dist/agentic-workflow/types.d.ts +29 -0
- package/dist/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/clearFilters/adapter.js +22 -0
- package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/resetMap/adapter.js +22 -0
- package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/setFeatureEffect/adapter.js +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/2PTPBAIN.js +2 -0
- package/dist/cdn/34O57OGV.js +2 -0
- package/dist/cdn/{AMP6IALT.js → 3UEKINYC.js} +1 -1
- package/dist/cdn/434TAA3J.js +2 -0
- package/dist/cdn/4EBLRHYE.js +2 -0
- package/dist/cdn/4HDDRBIY.js +2 -0
- package/dist/cdn/4KOV2NEI.js +9 -0
- package/dist/cdn/4NJ2FF7H.js +2 -0
- package/dist/cdn/4OGR5QKS.js +2 -0
- package/dist/cdn/4WIDLQUH.js +2 -0
- package/dist/cdn/5FL5BTTX.js +66 -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/6VJXUIXY.js +3 -0
- package/dist/cdn/7BCQMK6D.js +2 -0
- package/dist/cdn/7DFXYMEA.js +2 -0
- package/dist/cdn/7M6VKBTK.js +6 -0
- package/dist/cdn/7SRLZQVC.js +5 -0
- package/dist/cdn/7V6OSTFC.js +2 -0
- package/dist/cdn/7VAQUCBU.js +9 -0
- package/dist/cdn/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/AZCIDPML.js +2 -0
- package/dist/cdn/{FL4W4VYN.js → BL273EGZ.js} +17 -1
- package/dist/cdn/C5ZL5Z52.js +18 -0
- package/dist/cdn/CCC6LBMY.js +2 -0
- package/dist/cdn/{5ZZGKP7N.js → CEKOEHB3.js} +1 -1
- package/dist/cdn/CJMUJXPL.js +2 -0
- package/dist/cdn/COL6QYGQ.js +2 -0
- package/dist/cdn/CP5BVGJU.js +2 -0
- package/dist/cdn/CZM4URK7.js +2 -0
- package/dist/cdn/DP6O6PMH.js +2 -0
- package/dist/cdn/{V2P4AIGG.js → EKB7CAMM.js} +1 -1
- package/dist/cdn/EWLXNGKH.js +208 -0
- package/dist/cdn/EYNEYD34.js +2 -0
- package/dist/cdn/FDDQ67BG.js +2 -0
- package/dist/cdn/FDOMMK2M.js +2 -0
- package/dist/cdn/FQH3HOFH.js +2 -0
- package/dist/cdn/{GGSZM7KV.js → FUZ77UGP.js} +6 -4
- package/dist/cdn/{ZLXN7NMF.js → FYZATVB3.js} +10 -8
- package/dist/cdn/GFEOVHJK.js +2 -0
- package/dist/cdn/HHFNQR6Z.js +2 -0
- package/dist/cdn/HIPQ3VRW.js +2 -0
- package/dist/cdn/HKSFWTWK.js +14 -0
- package/dist/cdn/HMUWQCXU.js +2 -0
- package/dist/cdn/IBZ2NEAO.js +2 -0
- package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
- 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/JJJZ7FOM.js +2 -0
- package/dist/cdn/JKIESH74.js +2 -0
- package/dist/cdn/JO5ETMPS.js +2 -0
- package/dist/cdn/K2R6XVK3.js +2 -0
- package/dist/cdn/KCU4FWF7.js +2 -0
- package/dist/cdn/KITIP6J2.js +2 -0
- package/dist/cdn/KWD2ECTM.js +2 -0
- package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
- package/dist/cdn/LLUGJKAQ.js +2 -0
- package/dist/cdn/LPR72QZF.js +36 -0
- package/dist/cdn/{DHOVCT6R.js → MKOQJXQQ.js} +1 -1
- package/dist/cdn/MWYBF3F3.js +66 -0
- package/dist/cdn/NEV6OZN3.js +71 -0
- package/dist/cdn/OAKRPM7D.js +2 -0
- package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
- package/dist/cdn/OL5656NI.js +2 -0
- package/dist/cdn/ONQ6JSBJ.js +2 -0
- package/dist/cdn/OWTGH34K.js +2 -0
- package/dist/cdn/OYSPNIJI.js +156 -0
- package/dist/cdn/PEYYWXFE.js +2 -0
- package/dist/cdn/PKUDO2RC.js +3 -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/QCFICJ7U.js +3 -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/RSNGZQCQ.js +2 -0
- package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
- package/dist/cdn/SHD6YFSR.js +2 -0
- package/dist/cdn/SUYWKYWI.js +22 -0
- package/dist/cdn/SZ2QSSB3.js +2 -0
- package/dist/cdn/T4RIGOXB.js +2 -0
- package/dist/cdn/{3PKJWIC3.js → TMZ6DF22.js} +1 -1
- package/dist/cdn/TPULIO6I.js +34 -0
- package/dist/cdn/U2D53TAX.js +14 -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/V6F3HEK7.js +2 -0
- package/dist/cdn/V6HOUZPZ.js +2 -0
- package/dist/cdn/VAXH6RUQ.js +134 -0
- package/dist/cdn/VLLZ2FFU.js +2 -0
- package/dist/cdn/VNJMTA6O.js +2 -0
- package/dist/cdn/VOKXKU7M.js +56 -0
- package/dist/cdn/VXFQANGJ.js +2 -0
- package/dist/cdn/W5JPJWMM.js +2 -0
- package/dist/cdn/WKTQVBFJ.js +2 -0
- package/dist/cdn/WNNMKCKS.js +2 -0
- package/dist/cdn/WP7ORLSB.js +6 -0
- package/dist/cdn/WR2SQX3J.js +2 -0
- package/dist/cdn/X3COUAXY.js +4 -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/YQSU6IUO.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/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
- package/dist/cdn/ZVGUAOXE.js +2 -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 +1299 -2113
- package/dist/chunks/arcgisKnowledgeGraph.js +128 -72
- package/dist/chunks/arcgis_knowledge_current_lc_context.js +19 -2
- package/dist/chunks/arcgis_knowledge_current_map_context.js +31 -2
- package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
- package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +116 -27
- package/dist/chunks/baseAgentState.js +56 -0
- package/dist/chunks/converterUtils.js +66 -41
- package/dist/chunks/dataExplorationGraph.js +133 -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 +35 -25
- package/dist/chunks/help_prompt.js +34 -17
- package/dist/chunks/index.js +11 -0
- package/dist/chunks/intent_prompt.js +16 -0
- package/dist/chunks/layerStylingGraph.js +37 -31
- package/dist/chunks/mergeWhereClauses.js +15 -0
- package/dist/chunks/navigationGraph.js +124 -103
- package/dist/chunks/navigation_intent_prompt.js +8 -2
- package/dist/chunks/orchestrator.js +298 -139
- package/dist/chunks/slottableRequestUtils.js +3 -7
- package/dist/chunks/state.js +21 -27
- package/dist/chunks/summarize_query_response_prompt.js +9 -7
- package/dist/chunks/toolCallResponse.js +14 -10
- package/dist/chunks/types.js +59 -0
- package/dist/chunks/utils2.js +11 -11
- package/dist/components/arcgis-assistant/customElement.d.ts +72 -0
- package/dist/components/arcgis-assistant/customElement.js +416 -172
- package/dist/components/arcgis-assistant/index.js +2 -3
- package/dist/components/arcgis-assistant/types.d.ts +14 -1
- package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +614 -10
- package/dist/components/arcgis-assistant-chat/customElement.d.ts +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 +20 -4
- package/dist/components/arcgis-assistant-help-agent/customElement.js +29 -7
- 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 +40 -16
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +30 -7
- 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 +18 -4
- package/dist/components/arcgis-assistant-speech-input/customElement.js +34 -52
- 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/orchestrator/orchestrator/orchestratorEvents.d.ts +78 -0
- package/dist/types/lumina.d.ts +10 -8
- package/dist/types/preact.d.ts +10 -8
- package/dist/types/react.d.ts +10 -8
- package/dist/types/stencil.d.ts +12 -10
- package/dist/utils/index.d.ts +8 -8
- 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/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/I7SRZPVS.js +0 -72
- package/dist/cdn/IG6YKZH3.js +0 -3
- package/dist/cdn/JVIKKZND.js +0 -3
- package/dist/cdn/KMQ3SP4I.js +0 -5
- package/dist/cdn/MH5RPXHM.js +0 -2
- 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/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/TR7RL3IK.js +0 -2
- package/dist/cdn/USMDJUFS.js +0 -2
- package/dist/cdn/Y333DGV6.js +0 -2
- package/dist/cdn/YIMNOUTF.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
|
-
/** @
|
|
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>;
|
|
@@ -141,7 +168,7 @@ export type AgentCreateGraph<TState extends AgentData> = () => TypedStateGraph<T
|
|
|
141
168
|
export type ZodObjectSchema<T extends object = AgentData> = Pick<z.ZodType<T>, "safeParse">
|
|
142
169
|
& z.ZodObject;
|
|
143
170
|
|
|
144
|
-
export type GraphNodes<S extends AgentData
|
|
171
|
+
export type GraphNodes<S extends AgentData, TUpdate = Partial<S>> = Record<string, (state: S, config?: AgentExecutionConfig) => Promise<S | TUpdate> | S | TUpdate>;
|
|
145
172
|
|
|
146
173
|
export type GraphEdge<S extends AgentData> = {
|
|
147
174
|
from: string;
|
|
@@ -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:
|
|
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,189 @@
|
|
|
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
|
+
readonly llm_model?: AgenticWorkflowLLMModelJson;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type AgenticWorkflowArcgisToolJson = AgenticWorkflowJsonObject
|
|
43
|
+
& {
|
|
44
|
+
readonly type: "arcgis_tool";
|
|
45
|
+
readonly name: string;
|
|
46
|
+
readonly require_approval: AgenticWorkflowApprovalRequirementJson;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export type AgenticWorkflowJsonObject = { readonly [key: string]: AgenticWorkflowJsonValue | undefined; };
|
|
50
|
+
|
|
51
|
+
export type AgenticWorkflowJsonValue = AgenticWorkflowJsonObject | AgenticWorkflowJsonPrimitive | AgenticWorkflowJsonValue[] | undefined;
|
|
52
|
+
|
|
53
|
+
export type AgenticWorkflowVariableJson = AgenticWorkflowJsonObject
|
|
54
|
+
& {
|
|
55
|
+
readonly data_type?: "array" | "boolean" | "number" | "object" | "string";
|
|
56
|
+
readonly description?: string;
|
|
57
|
+
readonly key: string;
|
|
58
|
+
readonly persisted: boolean;
|
|
59
|
+
readonly private: boolean;
|
|
60
|
+
readonly type: "value";
|
|
61
|
+
readonly value: AgenticWorkflowJsonValue;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type AgenticWorkflowGraphJson = AgenticWorkflowJsonObject
|
|
65
|
+
& {
|
|
66
|
+
readonly edges: AgenticWorkflowEdgeJson[];
|
|
67
|
+
readonly nodes: AgenticWorkflowNodeJson[];
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export type AgenticWorkflowNodeIdJson = `${string}_node_${number}`;
|
|
71
|
+
|
|
72
|
+
export type AgenticWorkflowSourceAnchorIdJson = `source_anchor_${string}`;
|
|
73
|
+
|
|
74
|
+
export type AgenticWorkflowNodeJson = AgenticWorkflowAgentNodeJson | AgenticWorkflowEndMessageNodeJson | AgenticWorkflowGuardrailsNodeJson | AgenticWorkflowHumanInTheLoopNodeJson | AgenticWorkflowLoopNodeJson | AgenticWorkflowStartNodeJson;
|
|
75
|
+
|
|
76
|
+
export type AgenticWorkflowLLMModelJson = {
|
|
77
|
+
readonly model_tier: "advanced" | "default" | "fast";
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type AgenticWorkflowGuardrailsNodeJson = AgenticWorkflowBaseNodeJson<"guardrails_node">
|
|
81
|
+
& {
|
|
82
|
+
readonly conditions: AgenticWorkflowConditionJson[];
|
|
83
|
+
readonly confidence_threshold: number;
|
|
84
|
+
readonly prompt?: AgenticWorkflowPromptJson;
|
|
85
|
+
readonly llm_model?: AgenticWorkflowLLMModelJson;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export type AgenticWorkflowHumanInTheLoopNodeJson = AgenticWorkflowBaseNodeJson<"hitl_node">
|
|
89
|
+
& {
|
|
90
|
+
readonly conditions?: AgenticWorkflowConditionJson[];
|
|
91
|
+
readonly enable_feedback: boolean;
|
|
92
|
+
readonly human_input_description: string;
|
|
93
|
+
readonly human_input_description_type?: "dynamic" | "fixed";
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export type AgenticWorkflowLoopNodeJson = AgenticWorkflowBaseNodeJson<"loop_node">
|
|
97
|
+
& {
|
|
98
|
+
readonly loop_back_node_id: AgenticWorkflowNodeIdJson;
|
|
99
|
+
readonly max_loop_count: number;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export type AgenticWorkflowConditionJson = AgenticWorkflowJsonObject
|
|
103
|
+
& {
|
|
104
|
+
readonly preset?: "process" | "reject";
|
|
105
|
+
readonly source_anchor_id: AgenticWorkflowSourceAnchorIdJson;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export type AgenticWorkflowPromptJson = AgenticWorkflowJsonObject
|
|
109
|
+
& {
|
|
110
|
+
readonly content?: string;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export type AgenticWorkflowStructuredJsonSchemaJson = AgenticWorkflowJsonObject
|
|
114
|
+
& {
|
|
115
|
+
readonly properties: Record<string, AgenticWorkflowStructuredJsonPropertyJson>;
|
|
116
|
+
readonly required?: string[];
|
|
117
|
+
readonly type: "object";
|
|
118
|
+
readonly additionalProperties: boolean;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export type AgenticWorkflowStructuredJsonPropertyJson = AgenticWorkflowJsonObject
|
|
122
|
+
& {
|
|
123
|
+
readonly description?: string;
|
|
124
|
+
readonly enum?: string[];
|
|
125
|
+
readonly items?: AgenticWorkflowStructuredJsonPropertyJson;
|
|
126
|
+
readonly properties?: Record<string, AgenticWorkflowStructuredJsonPropertyJson>;
|
|
127
|
+
readonly required?: string[];
|
|
128
|
+
readonly type: "array" | "boolean" | "number" | "object" | "string";
|
|
129
|
+
readonly additionalProperties?: boolean;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export type AgenticWorkflowToolJson = AgenticWorkflowArcgisToolJson | AgenticWorkflowMcpToolJson;
|
|
133
|
+
|
|
134
|
+
export type AgenticWorkflowMcpToolJson = AgenticWorkflowJsonObject
|
|
135
|
+
& {
|
|
136
|
+
readonly allowed_tools?: string[];
|
|
137
|
+
readonly args?: string[];
|
|
138
|
+
readonly auth?: AgenticWorkflowMcpToolAuthAPIKeyJson | AgenticWorkflowMcpToolAuthBearerJson | AgenticWorkflowMcpToolAuthOAuth2Json;
|
|
139
|
+
readonly command?: string;
|
|
140
|
+
readonly env?: Record<string, string>;
|
|
141
|
+
readonly label?: string;
|
|
142
|
+
readonly override_params?: AgenticWorkflowUpdateVariableJson[];
|
|
143
|
+
readonly require_approval: AgenticWorkflowApprovalRequirementJson;
|
|
144
|
+
readonly return_direct?: boolean;
|
|
145
|
+
readonly server_description?: string;
|
|
146
|
+
readonly server_label?: string;
|
|
147
|
+
readonly server_url?: string;
|
|
148
|
+
readonly type: "mcp";
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export type AgenticWorkflowApprovalRequirementJson = "always" | "never";
|
|
152
|
+
|
|
153
|
+
export type AgenticWorkflowUpdateVariableJson = AgenticWorkflowJsonObject
|
|
154
|
+
& {
|
|
155
|
+
readonly key: string;
|
|
156
|
+
readonly value: AgenticWorkflowExpressionValueJson;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export type AgenticWorkflowExpressionValueJson = AgenticWorkflowJsonObject
|
|
160
|
+
& {
|
|
161
|
+
readonly return_type?: "array" | "boolean" | "number" | "object" | "string" | "unknown";
|
|
162
|
+
readonly type: "constant" | "variable";
|
|
163
|
+
readonly value: boolean | number | string;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export type AgenticWorkflowMcpToolAuthBearerJson = {
|
|
167
|
+
mode: string;
|
|
168
|
+
header_name?: string;
|
|
169
|
+
scheme?: string;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export type AgenticWorkflowMcpToolAuthAPIKeyJson = {
|
|
173
|
+
mode: string;
|
|
174
|
+
header_name?: string;
|
|
175
|
+
prefix?: string;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export type AgenticWorkflowMcpToolAuthOAuth2Json = {
|
|
179
|
+
mode: string;
|
|
180
|
+
discovery?: string;
|
|
181
|
+
client_id?: string;
|
|
182
|
+
authorization_url?: string;
|
|
183
|
+
token_url?: string;
|
|
184
|
+
refresh_url?: string;
|
|
185
|
+
redirect_url?: string;
|
|
186
|
+
scope?: string;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export type AgenticWorkflowJsonPrimitive = boolean | number | string | null;
|
|
@@ -0,0 +1,28 @@
|
|
|
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 modelTier: "advanced" | "default" | "fast" | undefined;
|
|
13
|
+
accessor outputSchema: ZodObjectSchema<AgentData> | undefined;
|
|
14
|
+
accessor prompt: string | undefined;
|
|
15
|
+
accessor tools: ArcgisTool[] | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* The type of this node, which identifies it as an agent node within the workflow.
|
|
18
|
+
*
|
|
19
|
+
* @default "agent-node"
|
|
20
|
+
* @required
|
|
21
|
+
*/
|
|
22
|
+
accessor type: "agent-node";
|
|
23
|
+
/** @param context */
|
|
24
|
+
compile<TCustomState extends AgentData>(context: NodeCompilationContext): NodeCompilation<TCustomState>;
|
|
25
|
+
createRuntimeNode<TCustomState extends AgentData>(): RuntimeNode<TCustomState>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type AgentNodeConstructProperties = Pick<AgentNode, "id" | "label" | "modelTier" | "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
|
+
};
|