@arcgis/ai-components 5.2.0-next.90 → 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.
@@ -27,25 +27,25 @@ import "@arcgis/core/config.js";
27
27
  import "@arcgis/core/core/reactiveUtils.js";
28
28
  import "@arcgis/core/layers/FeatureLayer.js";
29
29
  import { a as V } from "../../chunks/baseAgentState.js";
30
- var K = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, f = (t, e, r, s) => {
31
- for (var o = s > 1 ? void 0 : s ? Q(e, r) : e, a = t.length - 1, i; a >= 0; a--)
32
- (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
33
- return s && o && K(e, r, o), o;
30
+ var K = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, f = (e, t, r, s) => {
31
+ for (var o = s > 1 ? void 0 : s ? Q(t, r) : t, a = e.length - 1, i; a >= 0; a--)
32
+ (i = e[a]) && (o = (s ? i(t, r, o) : i(o)) || o);
33
+ return s && o && K(t, r, o), o;
34
34
  };
35
35
  let p = class extends T {
36
36
  //#region Lifecycle
37
- constructor(t) {
38
- super(t);
37
+ constructor(e) {
38
+ super(e);
39
39
  }
40
40
  //#endregion
41
41
  //#region Public Methods
42
- static fromJSON(t) {
42
+ static fromJSON(e) {
43
43
  return new p({
44
- id: t.id,
45
- sourceAnchorId: t.source_anchor_id,
46
- sourceNodeId: t.source_node_id,
47
- targetAnchorId: t.target_anchor_id,
48
- targetNodeId: t.target_node_id
44
+ id: e.id,
45
+ sourceAnchorId: e.source_anchor_id,
46
+ sourceNodeId: e.source_node_id,
47
+ targetAnchorId: e.target_anchor_id,
48
+ targetNodeId: e.target_node_id
49
49
  });
50
50
  }
51
51
  //#endregion
@@ -68,31 +68,31 @@ f([
68
68
  p = f([
69
69
  l("Edge")
70
70
  ], p);
71
- var X = Object.defineProperty, Y = Object.getOwnPropertyDescriptor, v = (t, e, r, s) => {
72
- for (var o = s > 1 ? void 0 : s ? Y(e, r) : e, a = t.length - 1, i; a >= 0; a--)
73
- (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
74
- return s && o && X(e, r, o), o;
71
+ var X = Object.defineProperty, Y = Object.getOwnPropertyDescriptor, v = (e, t, r, s) => {
72
+ for (var o = s > 1 ? void 0 : s ? Y(t, r) : t, a = e.length - 1, i; a >= 0; a--)
73
+ (i = e[a]) && (o = (s ? i(t, r, o) : i(o)) || o);
74
+ return s && o && X(t, r, o), o;
75
75
  };
76
- let m = class extends T {
76
+ let u = class extends T {
77
77
  //#region Lifecycle
78
- constructor(t) {
79
- super(t);
78
+ constructor(e) {
79
+ super(e);
80
80
  }
81
81
  //#endregion
82
82
  //#region Public Methods
83
83
  async load() {
84
84
  return await Promise.resolve(this);
85
85
  }
86
- compile(t) {
86
+ compile(e) {
87
87
  return {
88
88
  runtimeNode: this.createRuntimeNode(),
89
- edges: t.outgoingEdges.map((e) => ({
89
+ edges: e.outgoingEdges.map((t) => ({
90
90
  from: this.id,
91
- to: e.targetNodeId
91
+ to: t.targetNodeId
92
92
  }))
93
93
  };
94
94
  }
95
- static fromJSON(t) {
95
+ static fromJSON(e) {
96
96
  throw new Error("BaseNode is abstract and cannot be instantiated directly.");
97
97
  }
98
98
  //#endregion
@@ -101,48 +101,48 @@ let m = class extends T {
101
101
  };
102
102
  v([
103
103
  n()
104
- ], m.prototype, "id", 2);
104
+ ], u.prototype, "id", 2);
105
105
  v([
106
106
  n()
107
- ], m.prototype, "label", 2);
107
+ ], u.prototype, "label", 2);
108
108
  v([
109
109
  n()
110
- ], m.prototype, "type", 2);
111
- m = v([
110
+ ], u.prototype, "type", 2);
111
+ u = v([
112
112
  l("BaseNode")
113
- ], m);
114
- function I(t) {
115
- const e = new Set(t.required), r = Object.fromEntries(
116
- Object.entries(t.properties).map(([s, o]) => {
113
+ ], u);
114
+ function I(e) {
115
+ const t = new Set(e.required), r = Object.fromEntries(
116
+ Object.entries(e.properties).map(([s, o]) => {
117
117
  const a = $(o);
118
- return [s, e.has(s) ? a : a.optional()];
118
+ return [s, t.has(s) ? a : a.optional()];
119
119
  })
120
120
  );
121
121
  return c.object(r);
122
122
  }
123
- function $(t) {
124
- let e;
125
- switch (t.type) {
123
+ function $(e) {
124
+ let t;
125
+ switch (e.type) {
126
126
  case "array":
127
- e = c.array(t.items ? $(t.items) : c.unknown());
127
+ t = c.array(e.items ? $(e.items) : c.unknown());
128
128
  break;
129
129
  case "boolean":
130
- e = c.boolean();
130
+ t = c.boolean();
131
131
  break;
132
132
  case "number":
133
- e = c.number();
133
+ t = c.number();
134
134
  break;
135
135
  case "object":
136
- e = I({
137
- properties: t.properties ?? {},
138
- required: t.required
136
+ t = I({
137
+ properties: e.properties ?? {},
138
+ required: e.required
139
139
  });
140
140
  break;
141
141
  case "string":
142
- e = t.enum?.length ? c.enum(t.enum) : c.string();
142
+ t = e.enum?.length ? c.enum(e.enum) : c.string();
143
143
  break;
144
144
  }
145
- return t.description ? e.describe(t.description) : e;
145
+ return e.description ? t.describe(e.description) : t;
146
146
  }
147
147
  const k = /* @__PURE__ */ new Map([
148
148
  [
@@ -222,33 +222,33 @@ const k = /* @__PURE__ */ new Map([
222
222
  async () => (await import("../../agents/tools/query/queryFeatures/adapter.js")).queryFeaturesTool
223
223
  ]
224
224
  ]);
225
- async function tt(t) {
226
- const e = k.get(t);
227
- if (!e)
228
- throw new Error(`ArcGIS tool is not supported in the browser runtime: ${t}`);
229
- return await e();
225
+ async function ee(e) {
226
+ const t = k.get(e);
227
+ if (!t)
228
+ throw new Error(`ArcGIS tool is not supported in the browser runtime: ${e}`);
229
+ return await t();
230
230
  }
231
- var et = Object.defineProperty, ot = Object.getOwnPropertyDescriptor, N = (t, e, r, s) => {
232
- for (var o = s > 1 ? void 0 : s ? ot(e, r) : e, a = t.length - 1, i; a >= 0; a--)
233
- (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
234
- return s && o && et(e, r, o), o;
231
+ var te = Object.defineProperty, oe = Object.getOwnPropertyDescriptor, N = (e, t, r, s) => {
232
+ for (var o = s > 1 ? void 0 : s ? oe(t, r) : t, a = e.length - 1, i; a >= 0; a--)
233
+ (i = e[a]) && (o = (s ? i(t, r, o) : i(o)) || o);
234
+ return s && o && te(t, r, o), o;
235
235
  };
236
236
  let d = class extends T {
237
237
  //#region Lifecycle
238
- constructor(t) {
239
- super(t), this.type = "arcgis-tool";
238
+ constructor(e) {
239
+ super(e), this.type = "arcgis-tool";
240
240
  }
241
241
  //#endregion
242
242
  //#region Public Methods
243
243
  async createRuntimeTools() {
244
244
  if (!this.name)
245
245
  throw new Error("ArcgisTool name is required");
246
- return [await tt(this.name)];
246
+ return [await ee(this.name)];
247
247
  }
248
- static fromJSON(t) {
248
+ static fromJSON(e) {
249
249
  return new d({
250
- name: t.name,
251
- requireApproval: t.require_approval
250
+ name: e.name,
251
+ requireApproval: e.require_approval
252
252
  });
253
253
  }
254
254
  //#endregion
@@ -265,25 +265,25 @@ N([
265
265
  d = N([
266
266
  l("ArcgisTool")
267
267
  ], d);
268
- var rt = Object.defineProperty, st = Object.getOwnPropertyDescriptor, J = (t) => {
269
- throw TypeError(t);
270
- }, w = (t, e, r, s) => {
271
- for (var o = s > 1 ? void 0 : s ? st(e, r) : e, a = t.length - 1, i; a >= 0; a--)
272
- (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
273
- return s && o && rt(e, r, o), o;
274
- }, at = (t, e, r) => e.has(t) || J("Cannot " + r), it = (t, e, r) => e.has(t) ? J("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), nt = (t, e, r) => (at(t, e, "access private method"), r), S, R;
275
- let u = class extends m {
268
+ var re = Object.defineProperty, se = Object.getOwnPropertyDescriptor, J = (e) => {
269
+ throw TypeError(e);
270
+ }, _ = (e, t, r, s) => {
271
+ for (var o = s > 1 ? void 0 : s ? se(t, r) : t, a = e.length - 1, i; a >= 0; a--)
272
+ (i = e[a]) && (o = (s ? i(t, r, o) : i(o)) || o);
273
+ return s && o && re(t, r, o), o;
274
+ }, ae = (e, t, r) => t.has(e) || J("Cannot " + r), ie = (e, t, r) => t.has(e) ? J("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), ne = (e, t, r) => (ae(e, t, "access private method"), r), S, R;
275
+ let m = class extends u {
276
276
  //#region Lifecycle
277
- constructor(t) {
278
- super(t), it(this, S), this.type = "agent-node";
277
+ constructor(e) {
278
+ super(e), ie(this, S), this.type = "agent-node";
279
279
  }
280
280
  //#endregion
281
281
  //#region Public Methods
282
282
  createRuntimeNode() {
283
- let t;
284
- return async (e, r) => {
285
- t ??= nt(this, S, R).call(this);
286
- const o = await (await t).run(e, r), a = this.outputSchema?.safeParse(o);
283
+ let e;
284
+ return async (t, r) => {
285
+ e ??= ne(this, S, R).call(this);
286
+ const o = await (await e).run(t, r), a = this.outputSchema?.safeParse(o);
287
287
  if (a && !a.success)
288
288
  throw a.error;
289
289
  const i = a?.data, O = i ?? o.outputMessage;
@@ -298,14 +298,14 @@ let u = class extends m {
298
298
  };
299
299
  };
300
300
  }
301
- compile(t) {
302
- const e = t.outgoingEdges[0]?.targetNodeId;
301
+ compile(e) {
302
+ const t = e.outgoingEdges[0]?.targetNodeId;
303
303
  return {
304
304
  runtimeNode: this.createRuntimeNode(),
305
305
  edges: [
306
306
  {
307
307
  from: this.id,
308
- decide: (r) => r.status === "failed" ? void 0 : e
308
+ decide: (r) => r.status === "failed" ? void 0 : t
309
309
  }
310
310
  ],
311
311
  schemas: [
@@ -315,86 +315,91 @@ let u = class extends m {
315
315
  ]
316
316
  };
317
317
  }
318
- static fromJSON(t) {
319
- const e = new u({
320
- id: t.id,
321
- label: t.label,
322
- prompt: t.prompt?.content,
323
- type: "agent-node"
318
+ static fromJSON(e) {
319
+ const t = new m({
320
+ id: e.id,
321
+ label: e.label,
322
+ prompt: e.prompt?.content,
323
+ type: "agent-node",
324
+ modelTier: e.llm_model?.model_tier
324
325
  });
325
- return t.structured_output && (e.outputSchema = I(t.structured_output)), e.tools = t.tools?.filter((r) => r.type === "arcgis_tool").map((r) => d.fromJSON(r)), e;
326
+ return e.structured_output && (t.outputSchema = I(e.structured_output)), t.tools = e.tools?.filter((r) => r.type === "arcgis_tool").map((r) => d.fromJSON(r)), t;
326
327
  }
327
328
  //#endregion
328
329
  };
329
330
  S = /* @__PURE__ */ new WeakSet();
330
331
  R = async function() {
331
- const t = this.prompt;
332
- if (!t?.trim())
332
+ const e = this.prompt;
333
+ if (!e?.trim())
333
334
  throw new Error(`WebAgent agent node "${this.id}" requires a prompt.`);
334
- const e = [];
335
+ const t = [];
335
336
  if (this.tools)
336
337
  for (const r of this.tools) {
337
338
  const s = await r.createRuntimeTools();
338
- e.push(...s);
339
+ t.push(...s);
339
340
  }
340
341
  return new z({
341
342
  name: this.id,
342
343
  // TODO: change to label
343
344
  outputSchema: this.outputSchema,
344
- prompt: t,
345
- tools: e
345
+ modelTier: this.modelTier,
346
+ prompt: e,
347
+ tools: t
346
348
  });
347
349
  };
348
- w([
350
+ _([
349
351
  n()
350
- ], u.prototype, "type", 2);
351
- w([
352
+ ], m.prototype, "type", 2);
353
+ _([
352
354
  n()
353
- ], u.prototype, "prompt", 2);
354
- w([
355
+ ], m.prototype, "prompt", 2);
356
+ _([
355
357
  n()
356
- ], u.prototype, "outputSchema", 2);
357
- w([
358
+ ], m.prototype, "outputSchema", 2);
359
+ _([
358
360
  n()
359
- ], u.prototype, "tools", 2);
360
- u = w([
361
+ ], m.prototype, "tools", 2);
362
+ _([
363
+ n()
364
+ ], m.prototype, "modelTier", 2);
365
+ m = _([
361
366
  l("AgentNode")
362
- ], u);
363
- var ct = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, A = (t, e, r, s) => {
364
- for (var o = s > 1 ? void 0 : s ? pt(e, r) : e, a = t.length - 1, i; a >= 0; a--)
365
- (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
366
- return s && o && ct(e, r, o), o;
367
+ ], m);
368
+ var ce = Object.defineProperty, pe = Object.getOwnPropertyDescriptor, A = (e, t, r, s) => {
369
+ for (var o = s > 1 ? void 0 : s ? pe(t, r) : t, a = e.length - 1, i; a >= 0; a--)
370
+ (i = e[a]) && (o = (s ? i(t, r, o) : i(o)) || o);
371
+ return s && o && ce(t, r, o), o;
367
372
  };
368
- let h = class extends m {
373
+ let h = class extends u {
369
374
  //#region Lifecycle
370
- constructor(t) {
371
- super(t), this.type = "end-message-node";
375
+ constructor(e) {
376
+ super(e), this.type = "end-message-node";
372
377
  }
373
378
  //#endregion
374
379
  //#region Public Methods
375
380
  createRuntimeNode() {
376
- return async (t) => {
377
- const e = await Z.fromTemplate(this.message, { templateFormat: "mustache" }).format(t);
381
+ return async (e) => {
382
+ const t = await Z.fromTemplate(this.message, { templateFormat: "mustache" }).format(e);
378
383
  return {
379
- outputMessage: e,
384
+ outputMessage: t,
380
385
  status: "success",
381
- summary: e
386
+ summary: t
382
387
  };
383
388
  };
384
389
  }
385
- compile(t) {
390
+ compile(e) {
386
391
  return {
387
392
  runtimeNode: this.createRuntimeNode(),
388
393
  edges: []
389
394
  };
390
395
  }
391
- static fromJSON(t) {
392
- const e = new h({
393
- id: t.id,
394
- label: t.label,
396
+ static fromJSON(e) {
397
+ const t = new h({
398
+ id: e.id,
399
+ label: e.label,
395
400
  type: "end-message-node"
396
401
  });
397
- return e.message = t.message, e;
402
+ return t.message = e.message, t;
398
403
  }
399
404
  //#endregion
400
405
  //#region Private Methods
@@ -409,25 +414,25 @@ A([
409
414
  h = A([
410
415
  l("EndMessageNode")
411
416
  ], h);
412
- var mt = Object.defineProperty, ut = Object.getOwnPropertyDescriptor, D = (t, e, r, s) => {
413
- for (var o = s > 1 ? void 0 : s ? ut(e, r) : e, a = t.length - 1, i; a >= 0; a--)
414
- (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
415
- return s && o && mt(e, r, o), o;
417
+ var me = Object.defineProperty, ue = Object.getOwnPropertyDescriptor, D = (e, t, r, s) => {
418
+ for (var o = s > 1 ? void 0 : s ? ue(t, r) : t, a = e.length - 1, i; a >= 0; a--)
419
+ (i = e[a]) && (o = (s ? i(t, r, o) : i(o)) || o);
420
+ return s && o && me(t, r, o), o;
416
421
  };
417
- let _ = class extends m {
422
+ let w = class extends u {
418
423
  //#region Lifecycle
419
- constructor(t) {
420
- super(t), this.type = "start-node";
424
+ constructor(e) {
425
+ super(e), this.type = "start-node";
421
426
  }
422
427
  //#endregion
423
428
  //#region Public Methods
424
429
  createRuntimeNode() {
425
- return (t) => ({ question: t.agentExecutionContext.userRequest });
430
+ return (e) => ({ question: e.agentExecutionContext.userRequest });
426
431
  }
427
- static fromJSON(t) {
428
- return new _({
429
- id: t.id,
430
- label: t.label,
432
+ static fromJSON(e) {
433
+ return new w({
434
+ id: e.id,
435
+ label: e.label,
431
436
  type: "start-node"
432
437
  });
433
438
  }
@@ -437,27 +442,27 @@ let _ = class extends m {
437
442
  };
438
443
  D([
439
444
  n()
440
- ], _.prototype, "type", 2);
441
- _ = D([
445
+ ], w.prototype, "type", 2);
446
+ w = D([
442
447
  l("StartNode")
443
- ], _);
444
- function dt(t) {
445
- switch (t.type) {
448
+ ], w);
449
+ function de(e) {
450
+ switch (e.type) {
446
451
  case "agent_node":
447
- return u.fromJSON(t);
452
+ return m.fromJSON(e);
448
453
  case "end_message_node":
449
- return h.fromJSON(t);
454
+ return h.fromJSON(e);
450
455
  case "start_node":
451
- return _.fromJSON(t);
456
+ return w.fromJSON(e);
452
457
  default:
453
- throw new Error(`WebAgent node "${t.id}" uses unsupported type "${t.type}".`);
458
+ throw new Error(`WebAgent node "${e.id}" uses unsupported type "${e.type}".`);
454
459
  }
455
460
  }
456
- function lt(t = {}) {
457
- const e = Object.keys(t);
458
- if (H(e), e.includes("nodes"))
461
+ function le(e = {}) {
462
+ const t = Object.keys(e);
463
+ if (H(t), t.includes("nodes"))
459
464
  throw new Error("node state cannot define reserved field: nodes.");
460
- const r = U(t);
465
+ const r = U(e);
461
466
  return x.Root({
462
467
  ...r,
463
468
  nodes: x({
@@ -467,36 +472,36 @@ function lt(t = {}) {
467
472
  ...V()
468
473
  });
469
474
  }
470
- function F(t) {
471
- const e = /* @__PURE__ */ new Set();
472
- for (const s of t)
475
+ function F(e) {
476
+ const t = /* @__PURE__ */ new Set();
477
+ for (const s of e)
473
478
  for (const o of Object.keys(s.shape ?? {}))
474
- o !== "nodes" && e.add(o);
475
- const r = Object.fromEntries([...e].map((s) => [s, void 0]));
476
- return lt(r);
479
+ o !== "nodes" && t.add(o);
480
+ const r = Object.fromEntries([...t].map((s) => [s, void 0]));
481
+ return le(r);
477
482
  }
478
483
  class P {
479
484
  //#endregion Private Properties
480
485
  //#region Lifecycle
481
- constructor(e, r, s) {
482
- this.sourceJSON = e, this.edges = r, this.nodes = s, this._loaded = !1;
486
+ constructor(t, r, s) {
487
+ this.sourceJSON = t, this.edges = r, this.nodes = s, this._loaded = !1;
483
488
  }
484
489
  //#endregion Lifecycle
485
490
  //#region Public Methods
486
- static fromJSON(e) {
491
+ static fromJSON(t) {
487
492
  return new P(
488
- e,
489
- e.graph.edges.map((r) => p.fromJSON(r)),
490
- e.graph.nodes.map((r) => dt(r))
493
+ t,
494
+ t.graph.edges.map((r) => p.fromJSON(r)),
495
+ t.graph.nodes.map((r) => de(r))
491
496
  );
492
497
  }
493
498
  async load() {
494
- return this._loadPromise ??= Promise.all(this.nodes.map(async (e) => await e.load())).then(() => {
499
+ return this._loadPromise ??= Promise.all(this.nodes.map(async (t) => await t.load())).then(() => {
495
500
  this._loaded = !0;
496
501
  }), await this._loadPromise, this;
497
502
  }
498
503
  getSchemas() {
499
- const e = Object.fromEntries(
504
+ const t = Object.fromEntries(
500
505
  this._getNodeCompilations().flatMap((s, o) => {
501
506
  const a = this.nodes[o];
502
507
  return s.schemas?.map((i) => [a.id, i]) ?? [];
@@ -504,15 +509,15 @@ class P {
504
509
  );
505
510
  return [c.object({
506
511
  loopCounts: c.record(c.string(), c.number()).optional(),
507
- nodes: c.object(e).partial().optional(),
512
+ nodes: c.object(t).partial().optional(),
508
513
  question: c.string().optional()
509
514
  })];
510
515
  }
511
516
  generate() {
512
517
  this._assertLoaded(), this._nodeCompilations = void 0;
513
- const e = this._getNodeCompilations(), r = F(this.getSchemas()), s = this.nodes.find((i) => i.type === "start-node")?.id, o = {}, a = [];
518
+ const t = this._getNodeCompilations(), r = F(this.getSchemas()), s = this.nodes.find((i) => i.type === "start-node")?.id, o = {}, a = [];
514
519
  for (const [i, O] of this.nodes.entries()) {
515
- const y = e[i];
520
+ const y = t[i];
516
521
  y && (y.runtimeNode && (o[O.id] = y.runtimeNode), a.push(...y.edges));
517
522
  }
518
523
  return {
@@ -528,25 +533,25 @@ class P {
528
533
  }
529
534
  _getNodeCompilations() {
530
535
  return this._assertLoaded(), this._nodeCompilations ??= this.nodes.map(
531
- (e) => e.compile({
532
- outgoingEdges: this.edges.filter((r) => r.sourceNodeId === e.id)
536
+ (t) => t.compile({
537
+ outgoingEdges: this.edges.filter((r) => r.sourceNodeId === t.id)
533
538
  })
534
539
  );
535
540
  }
536
541
  //#endregion Private Methods
537
542
  }
538
- var ht = Object.defineProperty, gt = Object.getOwnPropertyDescriptor, E = (t, e, r, s) => {
539
- for (var o = s > 1 ? void 0 : s ? gt(e, r) : e, a = t.length - 1, i; a >= 0; a--)
540
- (i = t[a]) && (o = (s ? i(e, r, o) : i(o)) || o);
541
- return s && o && ht(e, r, o), o;
543
+ var he = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, E = (e, t, r, s) => {
544
+ for (var o = s > 1 ? void 0 : s ? ge(t, r) : t, a = e.length - 1, i; a >= 0; a--)
545
+ (i = e[a]) && (o = (s ? i(t, r, o) : i(o)) || o);
546
+ return s && o && he(t, r, o), o;
542
547
  };
543
- const ft = () => {
548
+ const fe = () => {
544
549
  throw new Error("WebAgent must be loaded before it can run.");
545
550
  };
546
551
  let g = class extends G {
547
552
  //#region Lifecycle
548
- constructor(t) {
549
- super(t);
553
+ constructor(e) {
554
+ super(e);
550
555
  }
551
556
  //#endregion
552
557
  //#region Public Methods
@@ -557,27 +562,27 @@ let g = class extends G {
557
562
  } catch (r) {
558
563
  throw new b("web-agent:load-portal-item", "Failed to load portal item", { error: r });
559
564
  }
560
- const e = await this.portalItem.fetchData();
561
- if (this.sourceJSON = e, !this.portalItem.title)
565
+ const t = await this.portalItem.fetchData();
566
+ if (this.sourceJSON = t, !this.portalItem.title)
562
567
  throw new b("web-agent:missing-title", "The portal item is missing a title");
563
568
  }
564
569
  if (!this.sourceJSON)
565
570
  throw new b("web-agent:missing-source-json", "The source JSON is missing");
566
571
  if (!this.sourceJSON.description)
567
572
  throw new b("web-agent:missing-description", "The source JSON is missing a description");
568
- const t = P.fromJSON(this.sourceJSON);
569
- return await t.load(), this._runtime = t, this.description = this.sourceJSON.description, this.name = this.portalItem?.title ?? `web-agent-${Date.now()}`, this.generate(), this;
573
+ const e = P.fromJSON(this.sourceJSON);
574
+ return await e.load(), this._runtime = e, this.description = this.sourceJSON.description, this.name = this.portalItem?.title ?? `web-agent-${Date.now()}`, this.generate(), this;
570
575
  }
571
576
  getSchemas() {
572
577
  return this._runtime?.getSchemas() ?? [];
573
578
  }
574
579
  generate() {
575
580
  if (!this._runtime) {
576
- this._set("workspace", F([])), this._set("createGraph", ft);
581
+ this._set("workspace", F([])), this._set("createGraph", fe);
577
582
  return;
578
583
  }
579
- const { createGraph: t, workspace: e } = this._runtime.generate();
580
- this._set("workspace", e), this._set("createGraph", t);
584
+ const { createGraph: e, workspace: t } = this._runtime.generate();
585
+ this._set("workspace", t), this._set("createGraph", e);
581
586
  }
582
587
  //#endregion
583
588
  };
@@ -590,29 +595,29 @@ E([
590
595
  g = E([
591
596
  l("WebAgent")
592
597
  ], g);
593
- class _t extends M {
598
+ class _e extends M {
594
599
  static {
595
600
  this.properties = { agent: 0, context: 0, itemId: 1, workflow: 0 };
596
601
  }
597
- #t;
602
+ #e;
598
603
  async getContext() {
599
604
  return W(this.context) ? await this.context() : this.context;
600
605
  }
601
606
  async load() {
602
- let e;
607
+ let t;
603
608
  if (this.itemId) {
604
609
  const r = j.getDefault();
605
- e = new g({ portalItem: new C({ id: this.itemId, portal: r }) });
606
- } else this.workflow && (e = new g({ sourceJSON: this.workflow }));
607
- if (e && (await e.load(), this.agent = e.registration), !this.agent)
610
+ t = new g({ portalItem: new C({ id: this.itemId, portal: r }) });
611
+ } else this.workflow && (t = new g({ sourceJSON: this.workflow }));
612
+ if (t && (await t.load(), this.agent = t.registration), !this.agent)
608
613
  throw new Error("Failed to initialize the assistant agent because the agent registration is missing.");
609
- this.#t = L(this);
614
+ this.#e = L(this);
610
615
  }
611
616
  disconnectedCallback() {
612
- this.#t?.unregister(this.agent.id), super.disconnectedCallback();
617
+ this.#e?.unregister(this.agent.id), super.disconnectedCallback();
613
618
  }
614
619
  }
615
- q("arcgis-assistant-agent", _t);
620
+ q("arcgis-assistant-agent", _e);
616
621
  export {
617
- _t as ArcgisAssistantAgent
622
+ _e as ArcgisAssistantAgent
618
623
  };