@arcgis/ai-components 5.2.0-next.72 → 5.2.0-next.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-utils/LLMAgent.d.ts +5 -2
- package/dist/agent-utils/LLMAgent.js +1 -1
- package/dist/agentic-workflow/jsonTypes.d.ts +8 -1
- package/dist/agentic-workflow/nodes/AgentNode.d.ts +2 -0
- package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
- package/dist/cdn/253R5CBD.js +2 -0
- package/dist/cdn/2VBPA27M.js +18 -0
- package/dist/cdn/{DWYODVWW.js → 323DHVYA.js} +5 -5
- package/dist/cdn/34O57OGV.js +2 -0
- package/dist/cdn/{FSMHR7GK.js → 4HDDRBIY.js} +1 -1
- package/dist/cdn/4MFEKBKL.js +11 -0
- package/dist/cdn/{Y5UFOH54.js → 4NJ2FF7H.js} +1 -1
- package/dist/cdn/4YXYLX4H.js +2 -0
- package/dist/cdn/5DVRVY4L.js +2 -0
- package/dist/cdn/5PJXNTLZ.js +2 -0
- package/dist/cdn/5R6QUF5B.js +2 -0
- package/dist/cdn/5RVELJU4.js +36 -0
- package/dist/cdn/5WLNL4HZ.js +2 -0
- package/dist/cdn/66SKMECC.js +2 -0
- package/dist/cdn/6CLF7KIK.js +2 -0
- package/dist/cdn/{S6ZAQRC6.js → 6KFMRBAA.js} +1 -1
- package/dist/cdn/77QFSIWW.js +5 -0
- package/dist/cdn/7E2QMWK6.js +2 -0
- package/dist/cdn/{HO2YDJI2.js → 7M6VKBTK.js} +1 -1
- package/dist/cdn/{HJG7QM2R.js → 7VAQUCBU.js} +1 -1
- package/dist/cdn/ACJTJLZN.js +2 -0
- package/dist/cdn/AI6DYOKR.js +181 -0
- package/dist/cdn/AT4XVTJR.js +44 -0
- package/dist/cdn/BS2PFNU4.js +2 -0
- package/dist/cdn/CCC6LBMY.js +2 -0
- package/dist/cdn/CGXQAB3A.js +2 -0
- package/dist/cdn/{M3MRIGDZ.js → CP5BVGJU.js} +1 -1
- package/dist/cdn/CWD37QFT.js +2 -0
- package/dist/cdn/DY36ATOA.js +2 -0
- package/dist/cdn/DYASSC7Z.js +2 -0
- package/dist/cdn/EAEQONP7.js +2 -0
- package/dist/cdn/EMLOVMD4.js +2 -0
- package/dist/cdn/EWLXNGKH.js +208 -0
- package/dist/cdn/FAR3DFFK.js +2 -0
- package/dist/cdn/FDOMMK2M.js +2 -0
- package/dist/cdn/GRHIFCQX.js +2 -0
- package/dist/cdn/{S3XUYAUX.js → HHFNQR6Z.js} +1 -1
- package/dist/cdn/{WQKNV6KK.js → HMUWQCXU.js} +1 -1
- package/dist/cdn/HZ5ARNAM.js +2 -0
- package/dist/cdn/I6PD2HSL.js +2 -0
- package/dist/cdn/IDUC4CPV.js +2 -0
- package/dist/cdn/IRNSIUBT.js +2 -0
- package/dist/cdn/{OYNIFMCJ.js → J6SZIQJA.js} +1 -1
- package/dist/cdn/K335IAIE.js +2 -0
- package/dist/cdn/K33MZ726.js +2 -0
- package/dist/cdn/KA3FF3ZO.js +2 -0
- package/dist/cdn/{DBHLKLKM.js → KPO4XX6J.js} +1 -1
- package/dist/cdn/{I4L45WQS.js → L7XTRDFM.js} +1 -1
- package/dist/cdn/LCFIADOZ.js +2 -0
- package/dist/cdn/MDM2K3U7.js +2 -0
- package/dist/cdn/MM33KJPF.js +2 -0
- package/dist/cdn/NIY32GK2.js +2 -0
- package/dist/cdn/{3ZPPYCNL.js → ONMNQBPO.js} +1 -1
- package/dist/cdn/ONQ6JSBJ.js +2 -0
- package/dist/cdn/{6QJFOL6M.js → OWTGH34K.js} +1 -1
- package/dist/cdn/{XPTCV6YV.js → PSYRZMX2.js} +1 -1
- package/dist/cdn/Q4IQUEZN.js +14 -0
- package/dist/cdn/QNNGPA3Q.js +2 -0
- package/dist/cdn/QRHZXLZN.js +2 -0
- package/dist/cdn/QVOMX3R6.js +2 -0
- package/dist/cdn/QZ3NQTNQ.js +2 -0
- package/dist/cdn/RADWN4ZP.js +2 -0
- package/dist/cdn/RU2T7GUX.js +2 -0
- package/dist/cdn/S6OYR4VI.js +156 -0
- package/dist/cdn/T2GJLEYV.js +2 -0
- package/dist/cdn/TKYI5QRL.js +2 -0
- package/dist/cdn/{5SFZS2RD.js → TQXLSW4A.js} +2 -2
- package/dist/cdn/{NJJYZP3R.js → U6FBRUM4.js} +1 -1
- package/dist/cdn/UIXX3XEN.js +2 -0
- package/dist/cdn/UPWAOZXQ.js +2 -0
- package/dist/cdn/{5SF6DEMO.js → VNJMTA6O.js} +1 -1
- package/dist/cdn/VOKXKU7M.js +56 -0
- package/dist/cdn/{33BF35AO.js → VYTYVWR6.js} +4 -4
- package/dist/cdn/WMZ24LWS.js +2 -0
- package/dist/cdn/{JYVBCHR6.js → WP7ORLSB.js} +1 -1
- package/dist/cdn/WS3T73IY.js +2 -0
- package/dist/cdn/{UZL6UVE4.js → ZLWWWTH4.js} +1 -1
- package/dist/cdn/{PAUIFUMO.js → ZQMBJ6MI.js} +1 -1
- package/dist/cdn/agent-utils/index.js +1 -1
- package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +1 -1
- package/dist/cdn/agent-utils/middlewares/middleware.js +1 -1
- package/dist/cdn/agent-utils/middlewares/trace.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/adapter.js +938 -1938
- package/dist/chunks/adapter10.js +21 -0
- package/dist/chunks/adapter11.js +30 -0
- package/dist/chunks/adapter12.js +22 -0
- package/dist/chunks/adapter13.js +22 -0
- package/dist/chunks/adapter14.js +109 -0
- package/dist/chunks/adapter15.js +40 -0
- package/dist/chunks/adapter16.js +154 -0
- package/dist/chunks/adapter17.js +141 -0
- package/dist/chunks/adapter18.js +127 -0
- package/dist/chunks/adapter2.js +52 -0
- package/dist/chunks/adapter3.js +30 -0
- package/dist/chunks/adapter4.js +50 -0
- package/dist/chunks/adapter5.js +27 -0
- package/dist/chunks/adapter6.js +24 -0
- package/dist/chunks/adapter7.js +26 -0
- package/dist/chunks/adapter8.js +21 -0
- package/dist/chunks/adapter9.js +42 -0
- package/dist/chunks/arcgisKnowledgeGraph.js +5 -5
- package/dist/chunks/dataExplorationGraph.js +30 -27
- package/dist/chunks/fetchAgentContext.js +13 -0
- package/dist/chunks/fetchService.js +10 -0
- package/dist/chunks/formatFeatureAttributes.js +132 -0
- package/dist/chunks/generateLayerDescriptions.js +145 -148
- package/dist/chunks/helpGraph.js +11 -9
- package/dist/chunks/layerStylingGraph.js +22 -21
- package/dist/chunks/mergeWhereClauses.js +15 -0
- package/dist/chunks/navigationGraph.js +68 -57
- package/dist/chunks/types.js +59 -0
- package/dist/components/arcgis-assistant-agent/customElement.js +404 -279
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +15 -5
- package/dist/components/arcgis-assistant-help-agent/customElement.js +21 -5
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +39 -22
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +22 -5
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +13 -5
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/types/stencil.d.ts +2 -2
- package/dist/utils/index.d.ts +4 -5
- package/dist/utils/index.js +19 -20
- package/package.json +8 -8
- package/dist/cdn/55M2HE4U.js +0 -2
- package/dist/cdn/5RZGG4F2.js +0 -2
- package/dist/cdn/BAB3MK4Y.js +0 -2
- package/dist/cdn/BMBV6Y2A.js +0 -2
- package/dist/cdn/D3RKQSWS.js +0 -2
- package/dist/cdn/E7KEOJZG.js +0 -208
- package/dist/cdn/IGQFAL3H.js +0 -2
- package/dist/cdn/LUY6V4TP.js +0 -181
- package/dist/cdn/NSXX2KYS.js +0 -2
- package/dist/cdn/OFRFP4BX.js +0 -2
- package/dist/cdn/OUFGJV3R.js +0 -2
- package/dist/cdn/RWM5T4XB.js +0 -180
- package/dist/cdn/SRFLL6ET.js +0 -2
- package/dist/cdn/WDOM6Z5O.js +0 -18
- package/dist/cdn/WZFC5HUX.js +0 -56
- package/dist/cdn/Z4XUJQ2I.js +0 -36
- package/dist/cdn/ZJEWP2ND.js +0 -44
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { LitElement as
|
|
4
|
-
import { b as G, i as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { property as
|
|
8
|
-
import { BaseAgent as
|
|
9
|
-
import
|
|
2
|
+
import { c as W } from "../../chunks/runtime.js";
|
|
3
|
+
import { LitElement as L } from "@arcgis/lumina";
|
|
4
|
+
import { b as G, i as z } from "../../chunks/utils2.js";
|
|
5
|
+
import J from "@arcgis/core/portal/PortalItem.js";
|
|
6
|
+
import j from "@arcgis/core/portal/Portal.js";
|
|
7
|
+
import { property as n, subclass as l } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
8
|
+
import { BaseAgent as B } from "../../agent-utils/BaseAgent.js";
|
|
9
|
+
import v from "@arcgis/core/core/Error.js";
|
|
10
10
|
import { z as c } from "zod";
|
|
11
|
-
import { c as
|
|
12
|
-
import
|
|
13
|
-
import { LLMAgent as
|
|
14
|
-
import { PromptTemplate as
|
|
15
|
-
import { Annotation as
|
|
16
|
-
import { b as
|
|
11
|
+
import { c as Z } from "../../chunks/graph.js";
|
|
12
|
+
import O from "@arcgis/core/core/Accessor.js";
|
|
13
|
+
import { LLMAgent as H } from "../../agent-utils/LLMAgent.js";
|
|
14
|
+
import { PromptTemplate as U } from "@langchain/core/prompts";
|
|
15
|
+
import { Annotation as C } from "@langchain/langgraph";
|
|
16
|
+
import { b as V, d as K } from "../../chunks/state.js";
|
|
17
17
|
import "@arcgis/core/identity/IdentityManager.js";
|
|
18
18
|
import "@arcgis/core/request.js";
|
|
19
19
|
import "@langchain/langgraph/web";
|
|
@@ -25,200 +25,315 @@ import "@langchain/openai";
|
|
|
25
25
|
import "@arcgis/core/config.js";
|
|
26
26
|
import "@arcgis/core/core/reactiveUtils.js";
|
|
27
27
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
28
|
-
import { a as
|
|
29
|
-
var
|
|
30
|
-
for (var
|
|
31
|
-
(
|
|
32
|
-
return
|
|
28
|
+
import { a as Q } from "../../chunks/baseAgentState.js";
|
|
29
|
+
var X = Object.defineProperty, Y = Object.getOwnPropertyDescriptor, _ = (t, e, r, s) => {
|
|
30
|
+
for (var o = s > 1 ? void 0 : s ? Y(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
31
|
+
(i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
|
|
32
|
+
return s && o && X(e, r, o), o;
|
|
33
33
|
};
|
|
34
|
-
let p = class extends
|
|
34
|
+
let p = class extends O {
|
|
35
35
|
//#region Lifecycle
|
|
36
|
-
constructor(
|
|
37
|
-
super(
|
|
36
|
+
constructor(t) {
|
|
37
|
+
super(t);
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region Public Methods
|
|
41
|
-
static fromJSON(
|
|
41
|
+
static fromJSON(t) {
|
|
42
42
|
return new p({
|
|
43
|
-
id:
|
|
44
|
-
sourceAnchorId:
|
|
45
|
-
sourceNodeId:
|
|
46
|
-
targetAnchorId:
|
|
47
|
-
targetNodeId:
|
|
43
|
+
id: t.id,
|
|
44
|
+
sourceAnchorId: t.source_anchor_id,
|
|
45
|
+
sourceNodeId: t.source_node_id,
|
|
46
|
+
targetAnchorId: t.target_anchor_id,
|
|
47
|
+
targetNodeId: t.target_node_id
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
//#endregion
|
|
51
51
|
};
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
_([
|
|
53
|
+
n()
|
|
54
54
|
], p.prototype, "id", 2);
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
_([
|
|
56
|
+
n()
|
|
57
57
|
], p.prototype, "sourceAnchorId", 2);
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
_([
|
|
59
|
+
n()
|
|
60
60
|
], p.prototype, "sourceNodeId", 2);
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
_([
|
|
62
|
+
n()
|
|
63
63
|
], p.prototype, "targetAnchorId", 2);
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
_([
|
|
65
|
+
n()
|
|
66
66
|
], p.prototype, "targetNodeId", 2);
|
|
67
|
-
p =
|
|
68
|
-
|
|
67
|
+
p = _([
|
|
68
|
+
l("Edge")
|
|
69
69
|
], p);
|
|
70
|
-
var
|
|
71
|
-
for (var
|
|
72
|
-
(
|
|
73
|
-
return
|
|
70
|
+
var k = Object.defineProperty, tt = Object.getOwnPropertyDescriptor, N = (t, e, r, s) => {
|
|
71
|
+
for (var o = s > 1 ? void 0 : s ? tt(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
72
|
+
(i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
|
|
73
|
+
return s && o && k(e, r, o), o;
|
|
74
74
|
};
|
|
75
|
-
let
|
|
75
|
+
let m = class extends O {
|
|
76
76
|
//#region Lifecycle
|
|
77
|
-
constructor(
|
|
78
|
-
super(
|
|
77
|
+
constructor(t) {
|
|
78
|
+
super(t);
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
81
81
|
//#region Public Methods
|
|
82
82
|
async load() {
|
|
83
83
|
return await Promise.resolve(this);
|
|
84
84
|
}
|
|
85
|
-
compile(
|
|
85
|
+
compile(t) {
|
|
86
86
|
return {
|
|
87
87
|
runtimeNode: this.createRuntimeNode(),
|
|
88
|
-
edges:
|
|
88
|
+
edges: t.outgoingEdges.map((e) => ({
|
|
89
89
|
from: this.id,
|
|
90
|
-
to:
|
|
90
|
+
to: e.targetNodeId
|
|
91
91
|
}))
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
static fromJSON(
|
|
94
|
+
static fromJSON(t) {
|
|
95
95
|
throw new Error("BaseNode is abstract and cannot be instantiated directly.");
|
|
96
96
|
}
|
|
97
97
|
//#endregion
|
|
98
98
|
//#region Private Methods
|
|
99
99
|
//#endregion
|
|
100
100
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
],
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
],
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
],
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
],
|
|
113
|
-
var
|
|
114
|
-
for (var
|
|
115
|
-
(
|
|
116
|
-
return
|
|
101
|
+
N([
|
|
102
|
+
n()
|
|
103
|
+
], m.prototype, "id", 2);
|
|
104
|
+
N([
|
|
105
|
+
n()
|
|
106
|
+
], m.prototype, "label", 2);
|
|
107
|
+
N([
|
|
108
|
+
n()
|
|
109
|
+
], m.prototype, "type", 2);
|
|
110
|
+
m = N([
|
|
111
|
+
l("BaseNode")
|
|
112
|
+
], m);
|
|
113
|
+
var et = Object.defineProperty, ot = Object.getOwnPropertyDescriptor, T = (t, e, r, s) => {
|
|
114
|
+
for (var o = s > 1 ? void 0 : s ? ot(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
115
|
+
(i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
|
|
116
|
+
return s && o && et(e, r, o), o;
|
|
117
117
|
};
|
|
118
|
-
let
|
|
118
|
+
let u = class extends O {
|
|
119
119
|
//#region Lifecycle
|
|
120
|
-
constructor(
|
|
121
|
-
super(
|
|
120
|
+
constructor(t) {
|
|
121
|
+
super(t), this.messages = [];
|
|
122
122
|
}
|
|
123
123
|
//#endregion
|
|
124
124
|
//#region Public Methods
|
|
125
|
-
static fromJSON(
|
|
126
|
-
const
|
|
127
|
-
return new
|
|
125
|
+
static fromJSON(t) {
|
|
126
|
+
const e = u._normalizeMessages(t.messages);
|
|
127
|
+
return new u({ id: t.id, messages: e });
|
|
128
128
|
}
|
|
129
129
|
//#endregion
|
|
130
130
|
//#region Private Methods
|
|
131
|
-
static _normalizeMessages(
|
|
132
|
-
return Array.isArray(
|
|
133
|
-
(
|
|
134
|
-
).map((
|
|
135
|
-
content:
|
|
136
|
-
role:
|
|
131
|
+
static _normalizeMessages(t) {
|
|
132
|
+
return Array.isArray(t) ? t.filter(
|
|
133
|
+
(e) => typeof e.content == "string"
|
|
134
|
+
).map((e) => ({
|
|
135
|
+
content: e.content,
|
|
136
|
+
role: e.role ?? "system"
|
|
137
137
|
})) : [];
|
|
138
138
|
}
|
|
139
139
|
//#endregion
|
|
140
140
|
};
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
],
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
],
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
],
|
|
150
|
-
function I(
|
|
151
|
-
const
|
|
152
|
-
Object.entries(
|
|
153
|
-
const
|
|
154
|
-
return [
|
|
141
|
+
T([
|
|
142
|
+
n()
|
|
143
|
+
], u.prototype, "id", 2);
|
|
144
|
+
T([
|
|
145
|
+
n()
|
|
146
|
+
], u.prototype, "messages", 2);
|
|
147
|
+
u = T([
|
|
148
|
+
l("Prompt")
|
|
149
|
+
], u);
|
|
150
|
+
function I(t) {
|
|
151
|
+
const e = new Set(t.required), r = Object.fromEntries(
|
|
152
|
+
Object.entries(t.properties).map(([s, o]) => {
|
|
153
|
+
const a = D(o);
|
|
154
|
+
return [s, e.has(s) ? a : a.optional()];
|
|
155
155
|
})
|
|
156
156
|
);
|
|
157
|
-
return c.object(
|
|
157
|
+
return c.object(r);
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
let
|
|
161
|
-
switch (
|
|
159
|
+
function D(t) {
|
|
160
|
+
let e;
|
|
161
|
+
switch (t.type) {
|
|
162
162
|
case "array":
|
|
163
|
-
|
|
163
|
+
e = c.array(t.items ? D(t.items) : c.unknown());
|
|
164
164
|
break;
|
|
165
165
|
case "boolean":
|
|
166
|
-
|
|
166
|
+
e = c.boolean();
|
|
167
167
|
break;
|
|
168
168
|
case "number":
|
|
169
|
-
|
|
169
|
+
e = c.number();
|
|
170
170
|
break;
|
|
171
171
|
case "object":
|
|
172
|
-
|
|
173
|
-
properties:
|
|
174
|
-
required:
|
|
172
|
+
e = I({
|
|
173
|
+
properties: t.properties ?? {},
|
|
174
|
+
required: t.required
|
|
175
175
|
});
|
|
176
176
|
break;
|
|
177
177
|
case "string":
|
|
178
|
-
|
|
178
|
+
e = t.enum?.length ? c.enum(t.enum) : c.string();
|
|
179
179
|
break;
|
|
180
180
|
}
|
|
181
|
-
return
|
|
181
|
+
return t.description ? e.describe(t.description) : e;
|
|
182
182
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
183
|
+
const rt = /* @__PURE__ */ new Map([
|
|
184
|
+
[
|
|
185
|
+
"clear_filters",
|
|
186
|
+
async () => (await import("../../chunks/adapter12.js")).clearFiltersTool
|
|
187
|
+
],
|
|
188
|
+
[
|
|
189
|
+
"reset_map",
|
|
190
|
+
async () => (await import("../../chunks/adapter13.js")).resetMapTool
|
|
191
|
+
],
|
|
192
|
+
[
|
|
193
|
+
"set_feature_effect",
|
|
194
|
+
async () => (await import("../../chunks/adapter14.js")).setFeatureEffectTool
|
|
195
|
+
],
|
|
196
|
+
[
|
|
197
|
+
"list_layer_fields",
|
|
198
|
+
async () => (await import("../../chunks/adapter11.js")).listLayerFieldsTool
|
|
199
|
+
],
|
|
200
|
+
[
|
|
201
|
+
"go_to_address",
|
|
202
|
+
async () => (await import("../../chunks/adapter2.js")).goToAddressTool
|
|
203
|
+
],
|
|
204
|
+
[
|
|
205
|
+
"go_to_bookmark",
|
|
206
|
+
async () => (await import("../../chunks/adapter3.js")).goToBookmarkTool
|
|
207
|
+
],
|
|
208
|
+
[
|
|
209
|
+
"go_to_features",
|
|
210
|
+
async () => (await import("../../chunks/adapter4.js")).goToFeaturesTool
|
|
211
|
+
],
|
|
212
|
+
[
|
|
213
|
+
"go_to_full_extent",
|
|
214
|
+
async () => (await import("../../chunks/adapter5.js")).goToFullExtentTool
|
|
215
|
+
],
|
|
216
|
+
[
|
|
217
|
+
"go_to_home_extent",
|
|
218
|
+
async () => (await import("../../chunks/adapter6.js")).goToHomeExtentTool
|
|
219
|
+
],
|
|
220
|
+
[
|
|
221
|
+
"go_to_layer",
|
|
222
|
+
async () => (await import("../../chunks/adapter7.js")).goToLayerTool
|
|
223
|
+
],
|
|
224
|
+
[
|
|
225
|
+
"go_to_scale",
|
|
226
|
+
async () => (await import("../../chunks/adapter8.js")).goToScaleTool
|
|
227
|
+
],
|
|
228
|
+
[
|
|
229
|
+
"go_to_viewpoint",
|
|
230
|
+
async () => (await import("../../chunks/adapter9.js")).goToViewpointTool
|
|
231
|
+
],
|
|
232
|
+
[
|
|
233
|
+
"go_to_zoom",
|
|
234
|
+
async () => (await import("../../chunks/adapter10.js")).goToZoomTool
|
|
235
|
+
],
|
|
236
|
+
[
|
|
237
|
+
"get_attribute",
|
|
238
|
+
async () => (await import("../../chunks/adapter15.js")).getAttributeTool
|
|
239
|
+
],
|
|
240
|
+
[
|
|
241
|
+
"get_statistics",
|
|
242
|
+
async () => (await import("../../chunks/adapter16.js")).getStatisticsTool
|
|
243
|
+
],
|
|
244
|
+
[
|
|
245
|
+
"get_top_features",
|
|
246
|
+
async () => (await import("../../chunks/adapter17.js")).getTopFeaturesTool
|
|
247
|
+
],
|
|
248
|
+
[
|
|
249
|
+
"query_features",
|
|
250
|
+
async () => (await import("../../chunks/adapter18.js")).queryFeaturesTool
|
|
251
|
+
]
|
|
252
|
+
]);
|
|
253
|
+
async function st(t) {
|
|
254
|
+
const e = rt.get(t);
|
|
255
|
+
if (!e)
|
|
256
|
+
throw new Error(`ArcGIS tool is not supported in the browser runtime: ${t}`);
|
|
257
|
+
return await e();
|
|
258
|
+
}
|
|
259
|
+
var at = Object.defineProperty, it = Object.getOwnPropertyDescriptor, S = (t, e, r, s) => {
|
|
260
|
+
for (var o = s > 1 ? void 0 : s ? it(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
261
|
+
(i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
|
|
262
|
+
return s && o && at(e, r, o), o;
|
|
263
|
+
};
|
|
264
|
+
let h = class extends O {
|
|
191
265
|
//#region Lifecycle
|
|
192
|
-
constructor(
|
|
193
|
-
super(
|
|
266
|
+
constructor(t) {
|
|
267
|
+
super(t), this.type = "arcgis-tool";
|
|
268
|
+
}
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region Public Methods
|
|
271
|
+
async createRuntimeTools() {
|
|
272
|
+
if (!this.name)
|
|
273
|
+
throw new Error("ArcgisTool name is required");
|
|
274
|
+
return [await st(this.name)];
|
|
275
|
+
}
|
|
276
|
+
static fromJSON(t) {
|
|
277
|
+
return new h({
|
|
278
|
+
name: t.name,
|
|
279
|
+
requireApproval: t.require_approval
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
//#endregion
|
|
283
|
+
};
|
|
284
|
+
S([
|
|
285
|
+
n()
|
|
286
|
+
], h.prototype, "name", 2);
|
|
287
|
+
S([
|
|
288
|
+
n()
|
|
289
|
+
], h.prototype, "requireApproval", 2);
|
|
290
|
+
S([
|
|
291
|
+
n()
|
|
292
|
+
], h.prototype, "type", 2);
|
|
293
|
+
h = S([
|
|
294
|
+
l("ArcgisTool")
|
|
295
|
+
], h);
|
|
296
|
+
var nt = Object.defineProperty, ct = Object.getOwnPropertyDescriptor, R = (t) => {
|
|
297
|
+
throw TypeError(t);
|
|
298
|
+
}, y = (t, e, r, s) => {
|
|
299
|
+
for (var o = s > 1 ? void 0 : s ? ct(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
300
|
+
(i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
|
|
301
|
+
return s && o && nt(e, r, o), o;
|
|
302
|
+
}, pt = (t, e, r) => e.has(t) || R("Cannot " + r), mt = (t, e, r) => e.has(t) ? R("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), ut = (t, e, r) => (pt(t, e, "access private method"), r), P, F;
|
|
303
|
+
let d = class extends m {
|
|
304
|
+
//#region Lifecycle
|
|
305
|
+
constructor(t) {
|
|
306
|
+
super(t), mt(this, P), this.type = "agent-node";
|
|
194
307
|
}
|
|
195
308
|
//#endregion
|
|
196
309
|
//#region Public Methods
|
|
197
310
|
createRuntimeNode() {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
311
|
+
let t;
|
|
312
|
+
return async (e, r) => {
|
|
313
|
+
t ??= ut(this, P, F).call(this);
|
|
314
|
+
const o = await (await t).run(e, r), a = this.outputSchema?.safeParse(o);
|
|
315
|
+
if (a && !a.success)
|
|
316
|
+
throw a.error;
|
|
317
|
+
const i = a?.data, A = i ?? o.outputMessage;
|
|
203
318
|
return {
|
|
204
319
|
agentExecutionContext: o.agentExecutionContext,
|
|
205
|
-
...
|
|
320
|
+
...i ? {} : { outputMessage: o.outputMessage },
|
|
206
321
|
status: o.status,
|
|
207
322
|
summary: o.summary,
|
|
208
323
|
nodes: {
|
|
209
|
-
[this.id]: { output:
|
|
324
|
+
[this.id]: { output: A }
|
|
210
325
|
}
|
|
211
326
|
};
|
|
212
327
|
};
|
|
213
328
|
}
|
|
214
|
-
compile(
|
|
215
|
-
const
|
|
329
|
+
compile(t) {
|
|
330
|
+
const e = t.outgoingEdges[0]?.targetNodeId;
|
|
216
331
|
return {
|
|
217
332
|
runtimeNode: this.createRuntimeNode(),
|
|
218
333
|
edges: [
|
|
219
334
|
{
|
|
220
335
|
from: this.id,
|
|
221
|
-
decide: (
|
|
336
|
+
decide: (r) => r.status === "failed" ? void 0 : e
|
|
222
337
|
}
|
|
223
338
|
],
|
|
224
339
|
schemas: [
|
|
@@ -228,112 +343,122 @@ let u = class extends d {
|
|
|
228
343
|
]
|
|
229
344
|
};
|
|
230
345
|
}
|
|
231
|
-
static fromJSON(
|
|
232
|
-
const
|
|
233
|
-
id:
|
|
234
|
-
label:
|
|
346
|
+
static fromJSON(t) {
|
|
347
|
+
const e = new d({
|
|
348
|
+
id: t.id,
|
|
349
|
+
label: t.label,
|
|
235
350
|
type: "agent-node"
|
|
236
351
|
});
|
|
237
|
-
return
|
|
238
|
-
id: `prompt_${
|
|
352
|
+
return t.prompt && (typeof t.prompt == "string" ? e.prompt = u.fromJSON({
|
|
353
|
+
id: `prompt_${t.id}`,
|
|
239
354
|
type: "plain_text",
|
|
240
|
-
messages: [{ content:
|
|
241
|
-
}) :
|
|
355
|
+
messages: [{ content: t.prompt, role: "system" }]
|
|
356
|
+
}) : e.prompt = u.fromJSON(t.prompt)), t.structured_output && (e.outputSchema = I(t.structured_output)), e.tools = t.tools?.filter((r) => r.type === "arcgis_tool").map((r) => h.fromJSON(r)), e;
|
|
242
357
|
}
|
|
243
358
|
//#endregion
|
|
244
359
|
};
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
const
|
|
248
|
-
if (!
|
|
360
|
+
P = /* @__PURE__ */ new WeakSet();
|
|
361
|
+
F = async function() {
|
|
362
|
+
const t = this.prompt?.messages?.[0].content;
|
|
363
|
+
if (!t?.trim())
|
|
249
364
|
throw new Error(`WebAgent agent node "${this.id}" requires a prompt.`);
|
|
250
|
-
|
|
365
|
+
const e = [];
|
|
366
|
+
if (this.tools)
|
|
367
|
+
for (const r of this.tools) {
|
|
368
|
+
const s = await r.createRuntimeTools();
|
|
369
|
+
e.push(...s);
|
|
370
|
+
}
|
|
371
|
+
return new H({
|
|
251
372
|
name: this.id,
|
|
252
373
|
// TODO: change to label
|
|
253
374
|
outputSchema: this.outputSchema,
|
|
254
|
-
prompt:
|
|
375
|
+
prompt: t,
|
|
376
|
+
tools: e
|
|
255
377
|
});
|
|
256
378
|
};
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
],
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
],
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
],
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
],
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
379
|
+
y([
|
|
380
|
+
n()
|
|
381
|
+
], d.prototype, "type", 2);
|
|
382
|
+
y([
|
|
383
|
+
n()
|
|
384
|
+
], d.prototype, "prompt", 2);
|
|
385
|
+
y([
|
|
386
|
+
n()
|
|
387
|
+
], d.prototype, "outputSchema", 2);
|
|
388
|
+
y([
|
|
389
|
+
n()
|
|
390
|
+
], d.prototype, "tools", 2);
|
|
391
|
+
d = y([
|
|
392
|
+
l("AgentNode")
|
|
393
|
+
], d);
|
|
394
|
+
var dt = Object.defineProperty, lt = Object.getOwnPropertyDescriptor, E = (t, e, r, s) => {
|
|
395
|
+
for (var o = s > 1 ? void 0 : s ? lt(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
396
|
+
(i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
|
|
397
|
+
return s && o && dt(e, r, o), o;
|
|
273
398
|
};
|
|
274
|
-
let
|
|
399
|
+
let g = class extends m {
|
|
275
400
|
//#region Lifecycle
|
|
276
|
-
constructor(
|
|
277
|
-
super(
|
|
401
|
+
constructor(t) {
|
|
402
|
+
super(t), this.type = "end-message-node";
|
|
278
403
|
}
|
|
279
404
|
//#endregion
|
|
280
405
|
//#region Public Methods
|
|
281
406
|
createRuntimeNode() {
|
|
282
|
-
return async (
|
|
283
|
-
const
|
|
407
|
+
return async (t) => {
|
|
408
|
+
const e = await U.fromTemplate(this.message, { templateFormat: "mustache" }).format(t);
|
|
284
409
|
return {
|
|
285
|
-
outputMessage:
|
|
410
|
+
outputMessage: e,
|
|
286
411
|
status: "success",
|
|
287
|
-
summary:
|
|
412
|
+
summary: e
|
|
288
413
|
};
|
|
289
414
|
};
|
|
290
415
|
}
|
|
291
|
-
compile(
|
|
416
|
+
compile(t) {
|
|
292
417
|
return {
|
|
293
418
|
runtimeNode: this.createRuntimeNode(),
|
|
294
419
|
edges: []
|
|
295
420
|
};
|
|
296
421
|
}
|
|
297
|
-
static fromJSON(
|
|
298
|
-
const
|
|
299
|
-
id:
|
|
300
|
-
label:
|
|
422
|
+
static fromJSON(t) {
|
|
423
|
+
const e = new g({
|
|
424
|
+
id: t.id,
|
|
425
|
+
label: t.label,
|
|
301
426
|
type: "end-message-node"
|
|
302
427
|
});
|
|
303
|
-
return
|
|
428
|
+
return e.message = t.message, e;
|
|
304
429
|
}
|
|
305
430
|
//#endregion
|
|
306
431
|
//#region Private Methods
|
|
307
432
|
//#endregion
|
|
308
433
|
};
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
],
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
],
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
],
|
|
318
|
-
var
|
|
319
|
-
for (var
|
|
320
|
-
(
|
|
321
|
-
return
|
|
434
|
+
E([
|
|
435
|
+
n()
|
|
436
|
+
], g.prototype, "type", 2);
|
|
437
|
+
E([
|
|
438
|
+
n()
|
|
439
|
+
], g.prototype, "message", 2);
|
|
440
|
+
g = E([
|
|
441
|
+
l("EndMessageNode")
|
|
442
|
+
], g);
|
|
443
|
+
var ht = Object.defineProperty, gt = Object.getOwnPropertyDescriptor, q = (t, e, r, s) => {
|
|
444
|
+
for (var o = s > 1 ? void 0 : s ? gt(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
445
|
+
(i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
|
|
446
|
+
return s && o && ht(e, r, o), o;
|
|
322
447
|
};
|
|
323
|
-
let
|
|
448
|
+
let w = class extends m {
|
|
324
449
|
//#region Lifecycle
|
|
325
|
-
constructor(
|
|
326
|
-
super(
|
|
450
|
+
constructor(t) {
|
|
451
|
+
super(t), this.type = "start-node";
|
|
327
452
|
}
|
|
328
453
|
//#endregion
|
|
329
454
|
//#region Public Methods
|
|
330
455
|
createRuntimeNode() {
|
|
331
|
-
return (
|
|
456
|
+
return (t) => ({ question: t.agentExecutionContext.userRequest });
|
|
332
457
|
}
|
|
333
|
-
static fromJSON(
|
|
334
|
-
return new
|
|
335
|
-
id:
|
|
336
|
-
label:
|
|
458
|
+
static fromJSON(t) {
|
|
459
|
+
return new w({
|
|
460
|
+
id: t.id,
|
|
461
|
+
label: t.label,
|
|
337
462
|
type: "start-node"
|
|
338
463
|
});
|
|
339
464
|
}
|
|
@@ -341,89 +466,89 @@ let _ = class extends d {
|
|
|
341
466
|
//#region Private Methods
|
|
342
467
|
//#endregion
|
|
343
468
|
};
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
],
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
],
|
|
350
|
-
function
|
|
351
|
-
switch (
|
|
469
|
+
q([
|
|
470
|
+
n()
|
|
471
|
+
], w.prototype, "type", 2);
|
|
472
|
+
w = q([
|
|
473
|
+
l("StartNode")
|
|
474
|
+
], w);
|
|
475
|
+
function ft(t) {
|
|
476
|
+
switch (t.type) {
|
|
352
477
|
case "agent_node":
|
|
353
|
-
return
|
|
478
|
+
return d.fromJSON(t);
|
|
354
479
|
case "end_message_node":
|
|
355
|
-
return
|
|
480
|
+
return g.fromJSON(t);
|
|
356
481
|
case "start_node":
|
|
357
|
-
return
|
|
482
|
+
return w.fromJSON(t);
|
|
358
483
|
default:
|
|
359
|
-
throw new Error(`WebAgent node "${
|
|
484
|
+
throw new Error(`WebAgent node "${t.id}" uses unsupported type "${t.type}".`);
|
|
360
485
|
}
|
|
361
486
|
}
|
|
362
|
-
function
|
|
363
|
-
const
|
|
364
|
-
if (
|
|
487
|
+
function _t(t = {}) {
|
|
488
|
+
const e = Object.keys(t);
|
|
489
|
+
if (V(e), e.includes("nodes"))
|
|
365
490
|
throw new Error("node state cannot define reserved field: nodes.");
|
|
366
|
-
const
|
|
367
|
-
return
|
|
368
|
-
...
|
|
369
|
-
nodes:
|
|
370
|
-
reducer: (
|
|
491
|
+
const r = K(t);
|
|
492
|
+
return C.Root({
|
|
493
|
+
...r,
|
|
494
|
+
nodes: C({
|
|
495
|
+
reducer: (s, o) => ({ ...s, ...o }),
|
|
371
496
|
default: () => ({})
|
|
372
497
|
}),
|
|
373
|
-
...
|
|
498
|
+
...Q()
|
|
374
499
|
});
|
|
375
500
|
}
|
|
376
|
-
function M(
|
|
377
|
-
const
|
|
378
|
-
for (const
|
|
379
|
-
for (const
|
|
380
|
-
|
|
381
|
-
const
|
|
382
|
-
return
|
|
501
|
+
function M(t) {
|
|
502
|
+
const e = /* @__PURE__ */ new Set();
|
|
503
|
+
for (const s of t)
|
|
504
|
+
for (const o of Object.keys(s.shape ?? {}))
|
|
505
|
+
o !== "nodes" && e.add(o);
|
|
506
|
+
const r = Object.fromEntries([...e].map((s) => [s, void 0]));
|
|
507
|
+
return _t(r);
|
|
383
508
|
}
|
|
384
|
-
class
|
|
509
|
+
class x {
|
|
385
510
|
//#endregion Private Properties
|
|
386
511
|
//#region Lifecycle
|
|
387
|
-
constructor(
|
|
388
|
-
this.sourceJSON =
|
|
512
|
+
constructor(e, r, s) {
|
|
513
|
+
this.sourceJSON = e, this.edges = r, this.nodes = s, this._loaded = !1;
|
|
389
514
|
}
|
|
390
515
|
//#endregion Lifecycle
|
|
391
516
|
//#region Public Methods
|
|
392
|
-
static fromJSON(
|
|
393
|
-
return new
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
517
|
+
static fromJSON(e) {
|
|
518
|
+
return new x(
|
|
519
|
+
e,
|
|
520
|
+
e.graph.edges.map((r) => p.fromJSON(r)),
|
|
521
|
+
e.graph.nodes.map((r) => ft(r))
|
|
397
522
|
);
|
|
398
523
|
}
|
|
399
524
|
async load() {
|
|
400
|
-
return this._loadPromise ??= Promise.all(this.nodes.map(async (
|
|
525
|
+
return this._loadPromise ??= Promise.all(this.nodes.map(async (e) => await e.load())).then(() => {
|
|
401
526
|
this._loaded = !0;
|
|
402
527
|
}), await this._loadPromise, this;
|
|
403
528
|
}
|
|
404
529
|
getSchemas() {
|
|
405
|
-
const
|
|
406
|
-
this._getNodeCompilations().flatMap((
|
|
407
|
-
const
|
|
408
|
-
return
|
|
530
|
+
const e = Object.fromEntries(
|
|
531
|
+
this._getNodeCompilations().flatMap((s, o) => {
|
|
532
|
+
const a = this.nodes[o];
|
|
533
|
+
return s.schemas?.map((i) => [a.id, i]) ?? [];
|
|
409
534
|
})
|
|
410
535
|
);
|
|
411
536
|
return [c.object({
|
|
412
537
|
loopCounts: c.record(c.string(), c.number()).optional(),
|
|
413
|
-
nodes: c.object(
|
|
538
|
+
nodes: c.object(e).partial().optional(),
|
|
414
539
|
question: c.string().optional()
|
|
415
540
|
})];
|
|
416
541
|
}
|
|
417
542
|
generate() {
|
|
418
543
|
this._assertLoaded(), this._nodeCompilations = void 0;
|
|
419
|
-
const
|
|
420
|
-
for (const [
|
|
421
|
-
const
|
|
422
|
-
|
|
544
|
+
const e = this._getNodeCompilations(), r = M(this.getSchemas()), s = this.nodes.find((i) => i.type === "start-node")?.id, o = {}, a = [];
|
|
545
|
+
for (const [i, A] of this.nodes.entries()) {
|
|
546
|
+
const b = e[i];
|
|
547
|
+
b && (b.runtimeNode && (o[A.id] = b.runtimeNode), a.push(...b.edges));
|
|
423
548
|
}
|
|
424
549
|
return {
|
|
425
|
-
createGraph: () =>
|
|
426
|
-
workspace:
|
|
550
|
+
createGraph: () => Z(o, a, r, { entryNode: s }),
|
|
551
|
+
workspace: r
|
|
427
552
|
};
|
|
428
553
|
}
|
|
429
554
|
//#endregion Public Methods
|
|
@@ -434,25 +559,25 @@ class A {
|
|
|
434
559
|
}
|
|
435
560
|
_getNodeCompilations() {
|
|
436
561
|
return this._assertLoaded(), this._nodeCompilations ??= this.nodes.map(
|
|
437
|
-
(
|
|
438
|
-
outgoingEdges: this.edges.filter((
|
|
562
|
+
(e) => e.compile({
|
|
563
|
+
outgoingEdges: this.edges.filter((r) => r.sourceNodeId === e.id)
|
|
439
564
|
})
|
|
440
565
|
);
|
|
441
566
|
}
|
|
442
567
|
//#endregion Private Methods
|
|
443
568
|
}
|
|
444
|
-
var
|
|
445
|
-
for (var
|
|
446
|
-
(
|
|
447
|
-
return
|
|
569
|
+
var wt = Object.defineProperty, yt = Object.getOwnPropertyDescriptor, $ = (t, e, r, s) => {
|
|
570
|
+
for (var o = s > 1 ? void 0 : s ? yt(e, r) : e, a = t.length - 1, i; a >= 0; a--)
|
|
571
|
+
(i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
|
|
572
|
+
return s && o && wt(e, r, o), o;
|
|
448
573
|
};
|
|
449
|
-
const
|
|
574
|
+
const bt = () => {
|
|
450
575
|
throw new Error("WebAgent must be loaded before it can run.");
|
|
451
576
|
};
|
|
452
|
-
let
|
|
577
|
+
let f = class extends B {
|
|
453
578
|
//#region Lifecycle
|
|
454
|
-
constructor(
|
|
455
|
-
super(
|
|
579
|
+
constructor(t) {
|
|
580
|
+
super(t);
|
|
456
581
|
}
|
|
457
582
|
//#endregion
|
|
458
583
|
//#region Public Methods
|
|
@@ -460,65 +585,65 @@ let g = class extends j {
|
|
|
460
585
|
if (this.portalItem) {
|
|
461
586
|
try {
|
|
462
587
|
await this.portalItem.load();
|
|
463
|
-
} catch (
|
|
464
|
-
throw new
|
|
588
|
+
} catch (r) {
|
|
589
|
+
throw new v("web-agent:load-portal-item", "Failed to load portal item", { error: r });
|
|
465
590
|
}
|
|
466
|
-
const
|
|
467
|
-
if (this.sourceJSON =
|
|
468
|
-
throw new
|
|
591
|
+
const e = await this.portalItem.fetchData();
|
|
592
|
+
if (this.sourceJSON = e, !this.portalItem.title)
|
|
593
|
+
throw new v("web-agent:missing-title", "The portal item is missing a title");
|
|
469
594
|
}
|
|
470
595
|
if (!this.sourceJSON)
|
|
471
|
-
throw new
|
|
596
|
+
throw new v("web-agent:missing-source-json", "The source JSON is missing");
|
|
472
597
|
if (!this.sourceJSON.description)
|
|
473
|
-
throw new
|
|
474
|
-
const
|
|
475
|
-
return await
|
|
598
|
+
throw new v("web-agent:missing-description", "The source JSON is missing a description");
|
|
599
|
+
const t = x.fromJSON(this.sourceJSON);
|
|
600
|
+
return await t.load(), this._runtime = t, this.description = this.sourceJSON.description, this.name = this.portalItem?.title ?? `web-agent-${Date.now()}`, this.generate(), this;
|
|
476
601
|
}
|
|
477
602
|
getSchemas() {
|
|
478
603
|
return this._runtime?.getSchemas() ?? [];
|
|
479
604
|
}
|
|
480
605
|
generate() {
|
|
481
606
|
if (!this._runtime) {
|
|
482
|
-
this._set("workspace", M([])), this._set("createGraph",
|
|
607
|
+
this._set("workspace", M([])), this._set("createGraph", bt);
|
|
483
608
|
return;
|
|
484
609
|
}
|
|
485
|
-
const { createGraph:
|
|
486
|
-
this._set("workspace",
|
|
610
|
+
const { createGraph: t, workspace: e } = this._runtime.generate();
|
|
611
|
+
this._set("workspace", e), this._set("createGraph", t);
|
|
487
612
|
}
|
|
488
613
|
//#endregion
|
|
489
614
|
};
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
],
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
],
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
],
|
|
499
|
-
class
|
|
615
|
+
$([
|
|
616
|
+
n({ type: J })
|
|
617
|
+
], f.prototype, "portalItem", 2);
|
|
618
|
+
$([
|
|
619
|
+
n()
|
|
620
|
+
], f.prototype, "sourceJSON", 2);
|
|
621
|
+
f = $([
|
|
622
|
+
l("WebAgent")
|
|
623
|
+
], f);
|
|
624
|
+
class vt extends L {
|
|
500
625
|
static {
|
|
501
626
|
this.properties = { agent: 0, context: 0, itemId: 1, workflow: 0 };
|
|
502
627
|
}
|
|
503
|
-
#
|
|
628
|
+
#t;
|
|
504
629
|
async getContext() {
|
|
505
630
|
return G(this.context) ? await this.context() : this.context;
|
|
506
631
|
}
|
|
507
632
|
async load() {
|
|
508
|
-
let
|
|
633
|
+
let e;
|
|
509
634
|
if (this.itemId) {
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
} else this.workflow && (
|
|
513
|
-
if (
|
|
635
|
+
const r = j.getDefault();
|
|
636
|
+
e = new f({ portalItem: new J({ id: this.itemId, portal: r }) });
|
|
637
|
+
} else this.workflow && (e = new f({ sourceJSON: this.workflow }));
|
|
638
|
+
if (e && (await e.load(), this.agent = e.registration), !this.agent)
|
|
514
639
|
throw new Error("Failed to initialize the assistant agent because the agent registration is missing.");
|
|
515
|
-
this.#
|
|
640
|
+
this.#t = z(this);
|
|
516
641
|
}
|
|
517
642
|
disconnectedCallback() {
|
|
518
|
-
this.#
|
|
643
|
+
this.#t?.unregister(this.agent.id), super.disconnectedCallback();
|
|
519
644
|
}
|
|
520
645
|
}
|
|
521
|
-
|
|
646
|
+
W("arcgis-assistant-agent", vt);
|
|
522
647
|
export {
|
|
523
|
-
|
|
648
|
+
vt as ArcgisAssistantAgent
|
|
524
649
|
};
|