@arcgis/ai-components 5.2.0-next.77 → 5.2.0-next.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/agentic-workflow/jsonTypes.d.ts +2 -12
  2. package/dist/agentic-workflow/nodes/AgentNode.d.ts +2 -3
  3. package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
  4. package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
  5. package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
  6. package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
  7. package/dist/cdn/3LILAJUD.js +2 -0
  8. package/dist/cdn/{GPZJANRQ.js → 4AGGYAWS.js} +1 -1
  9. package/dist/cdn/4F7Y4RNW.js +2 -0
  10. package/dist/cdn/{H6IJRTHM.js → 6ADMWEVE.js} +1 -1
  11. package/dist/cdn/{B6CJG5UH.js → 6U4GTCLJ.js} +14 -14
  12. package/dist/cdn/7BCQMK6D.js +2 -0
  13. package/dist/cdn/7QOC7FQE.js +2 -0
  14. package/dist/cdn/ADJ63EDN.js +3 -0
  15. package/dist/cdn/ATFNWFKG.js +2 -0
  16. package/dist/cdn/CZLLPKMS.js +2 -0
  17. package/dist/cdn/{JSMNXHYG.js → EAOKCWED.js} +6 -6
  18. package/dist/cdn/EBNVLMUU.js +2 -0
  19. package/dist/cdn/G5XE5D36.js +2 -0
  20. package/dist/cdn/{U3XIDLHO.js → HPU6K67Y.js} +1 -1
  21. package/dist/cdn/IBZ2NEAO.js +2 -0
  22. package/dist/cdn/{TYZ3FRGW.js → J4R7KYJ3.js} +6 -6
  23. package/dist/cdn/{GZGDLURS.js → KP2FWABJ.js} +1 -1
  24. package/dist/cdn/LM2IGECE.js +2 -0
  25. package/dist/cdn/LXQFE5PJ.js +2 -0
  26. package/dist/cdn/{GOKLRL6M.js → MAPKEX67.js} +1 -1
  27. package/dist/cdn/{EZYONVBU.js → MYH43WYG.js} +1 -1
  28. package/dist/cdn/NLEBWLVV.js +2 -0
  29. package/dist/cdn/{UB6PAQZ7.js → NPBXE4EQ.js} +1 -1
  30. package/dist/cdn/{FZ4CURWW.js → NZJ6LLYY.js} +1 -1
  31. package/dist/cdn/ORRMONGJ.js +2 -0
  32. package/dist/cdn/QUMNJVKX.js +2 -0
  33. package/dist/cdn/RHYNE5OE.js +2 -0
  34. package/dist/cdn/W7OT3KRG.js +18 -0
  35. package/dist/cdn/XCNN7BQ3.js +2 -0
  36. package/dist/cdn/{DUSILSNJ.js → XHGVCL22.js} +3 -3
  37. package/dist/cdn/XLHTQ7CF.js +2 -0
  38. package/dist/cdn/ZWBFTKHF.js +2 -0
  39. package/dist/cdn/agent-utils/index.js +1 -1
  40. package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
  41. package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
  42. package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
  43. package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
  44. package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
  45. package/dist/cdn/index.js +1 -1
  46. package/dist/chunks/adapter.js +64 -67
  47. package/dist/chunks/converterUtils.js +66 -48
  48. package/dist/chunks/dataExplorationGraph.js +121 -195
  49. package/dist/chunks/fieldStatistics.js +79 -0
  50. package/dist/chunks/layerStylingGraph.js +9 -9
  51. package/dist/components/arcgis-assistant/customElement.d.ts +30 -1
  52. package/dist/components/arcgis-assistant/customElement.js +133 -135
  53. package/dist/components/arcgis-assistant-agent/customElement.js +152 -184
  54. package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
  55. package/dist/components/arcgis-assistant-interrupt/customElement.js +10 -11
  56. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +12 -8
  57. package/dist/components/arcgis-assistant-message/customElement.d.ts +3 -0
  58. package/dist/components/arcgis-assistant-message/customElement.js +9 -8
  59. package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +3 -0
  60. package/dist/components/arcgis-assistant-message-loading/customElement.js +11 -10
  61. package/dist/components/arcgis-assistant-message-text/customElement.js +4 -4
  62. package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
  63. package/dist/components/arcgis-assistant-user-message/customElement.js +13 -10
  64. package/dist/docs/api.json +1 -1
  65. package/dist/docs/docs.json +1 -1
  66. package/dist/docs/vscode.html-custom-data.json +1 -1
  67. package/dist/docs/web-types.json +1 -1
  68. package/dist/loader.js +4 -4
  69. package/dist/types/lumina.d.ts +2 -2
  70. package/dist/types/preact.d.ts +2 -2
  71. package/dist/types/react.d.ts +2 -2
  72. package/dist/types/stencil.d.ts +2 -2
  73. package/package.json +8 -6
  74. package/dist/agentic-workflow/nodes/support/Prompt.d.ts +0 -20
  75. package/dist/cdn/2GH3K5JP.js +0 -2
  76. package/dist/cdn/2SQKAJ73.js +0 -2
  77. package/dist/cdn/2Y4DTOGT.js +0 -2
  78. package/dist/cdn/3S5G5SIX.js +0 -2
  79. package/dist/cdn/5TI2F5XX.js +0 -2
  80. package/dist/cdn/BWLXDT75.js +0 -2
  81. package/dist/cdn/DCSZPL7R.js +0 -2
  82. package/dist/cdn/DOXBIASP.js +0 -18
  83. package/dist/cdn/FSGIG7UN.js +0 -2
  84. package/dist/cdn/GLBE7OW2.js +0 -2
  85. package/dist/cdn/KKLAQF3Z.js +0 -2
  86. package/dist/cdn/KLYNL2ZT.js +0 -2
  87. package/dist/cdn/LZP3OBKS.js +0 -3
  88. package/dist/cdn/OKMZQXBQ.js +0 -2
  89. package/dist/cdn/RCFAXADI.js +0 -2
  90. package/dist/cdn/T4ECSHM7.js +0 -2
  91. package/dist/cdn/WSHWQDO2.js +0 -2
  92. package/dist/cdn/XRE5USHA.js +0 -2
@@ -0,0 +1,79 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import v from "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
3
+ import L from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
4
+ const $ = 10, b = ["string", "small-integer", "integer"], w = async (u, e, { includeSummaryStatistics: d = !0, includeUniqueValues: y = !0 } = {}) => {
5
+ let r = null, s = null;
6
+ try {
7
+ if (e.type !== "geometry" && e.type !== "oid" && e.type !== "global-id") {
8
+ d && (r = await v({ layer: u, field: e.name }));
9
+ const i = e.domain?.type === "coded-value" ? e.domain : null;
10
+ y && (b.includes(e.type) || i) && (s = (await L({ layer: u, field: e.name })).uniqueValueInfos.sort((n, f) => f.count - n.count).slice(0, $), i && (s = s.map((n) => ({
11
+ ...n,
12
+ value: i.getName(n.value) ?? n.value
13
+ }))));
14
+ }
15
+ } catch (i) {
16
+ console.error(`Error fetching statistics for field ${e.name}:`, i);
17
+ }
18
+ return {
19
+ summaryStatistics: r,
20
+ uniqueValues: s
21
+ };
22
+ };
23
+ function N(u, e) {
24
+ return ["string", "small-integer", "integer"].includes(u) || e === "coded-value";
25
+ }
26
+ async function x(u, e, d, y = !0) {
27
+ const r = [], s = [], i = [];
28
+ for (const n of u) {
29
+ let f = function(a) {
30
+ const t = e.get(a)?.layerItem;
31
+ return t ? [
32
+ t.name && `Name: ${t.name}`,
33
+ t.title && `Title: ${t.title}`,
34
+ t.description && `Description: ${t.description}`
35
+ ].filter(Boolean).join(" | ") : a;
36
+ };
37
+ const { layerId: c, results: q } = n, I = d.map?.allLayers.find((a) => a.id === c), S = e.get(c)?.fieldRegistry;
38
+ if (!S)
39
+ continue;
40
+ let l = r.find((a) => a.layerId === c);
41
+ l || (l = {
42
+ layerId: c,
43
+ layerSummary: f(c),
44
+ fieldInfos: []
45
+ }, r.push(l));
46
+ for (const a of q) {
47
+ const t = S.get(a.name);
48
+ if (!t)
49
+ continue;
50
+ const o = t.statistics, p = y && !o?.summaryStatistics, g = N(t.type, t.domain?.type) && !o?.uniqueValues, h = p || g;
51
+ if (i.push({
52
+ layerId: c,
53
+ fieldName: t.name,
54
+ didFetchStatistics: h
55
+ }), h) {
56
+ const F = w(I, t, {
57
+ includeSummaryStatistics: p,
58
+ includeUniqueValues: g
59
+ }).then((V) => {
60
+ const m = {
61
+ summaryStatistics: o?.summaryStatistics ?? null,
62
+ uniqueValues: o?.uniqueValues ?? null
63
+ };
64
+ p && (m.summaryStatistics = V.summaryStatistics), g && (m.uniqueValues = V.uniqueValues), S.set(t.name, { ...t, statistics: m }), t.statistics = m;
65
+ });
66
+ s.push(F);
67
+ }
68
+ l.fieldInfos.push(t);
69
+ }
70
+ }
71
+ return await Promise.all(s), {
72
+ layerFieldInfo: r,
73
+ didFetchStatistics: s.length > 0,
74
+ fieldStatisticsFetchStatus: i
75
+ };
76
+ }
77
+ export {
78
+ x as b
79
+ };
@@ -13,17 +13,17 @@ import "@arcgis/core/core/reactiveUtils.js";
13
13
  import "@arcgis/core/layers/FeatureLayer.js";
14
14
  import "@langchain/core/prompts";
15
15
  import { f as g } from "./fetchService.js";
16
- import { j as I, k as T, l as R, m as F, n as C, o as $, p as A, u as N, v as b, w as q, x as _, g as M, r as k, L as S } from "./adapter.js";
17
- import { h as j } from "./toolCallResponse.js";
18
- import { ToolNode as V } from "@langchain/langgraph/prebuilt";
19
- const h = 0.7, P = 10, z = async (t, e) => {
16
+ import { m as I, n as T, o as R, p as F, u as C, v as A, w as $, x as N, y as b, z as q, A as _, g as M, r as k, L as S } from "./adapter.js";
17
+ import { h as V } from "./toolCallResponse.js";
18
+ import { ToolNode as j } from "@langchain/langgraph/prebuilt";
19
+ const h = 0.7, z = 10, P = async (t, e) => {
20
20
  try {
21
21
  await i({ text: "Similarity search to find fields" }, e);
22
22
  const r = g(e, "fieldSearch"), a = g(e, "layersAndFieldsRegistry"), o = g(e, "embeddingCache"), n = await r.searchFields({
23
23
  text: t.agentExecutionContext.assignedTask,
24
24
  layerIds: t.vectorSearchLayerIds,
25
25
  minScore: h,
26
- topResults: P,
26
+ topResults: z,
27
27
  embeddingCache: o
28
28
  }), c = n.map(({ layerId: d, results: p }) => {
29
29
  const y = p.map((s) => ` - ${s.name} (${s.score.toFixed(2)})`).join(`
@@ -73,8 +73,8 @@ ${c}` : l = "Vector search completed. No matching layers found.", await i({ text
73
73
  R,
74
74
  F,
75
75
  C,
76
- $,
77
76
  A,
77
+ $,
78
78
  N,
79
79
  b,
80
80
  q,
@@ -100,7 +100,7 @@ ${c}` : l = "Vector search completed. No matching layers found.", await i({ text
100
100
  inputVariables: a,
101
101
  tools: f
102
102
  });
103
- return await j(o, e), {
103
+ return await V(o, e), {
104
104
  ...t,
105
105
  agentExecutionContext: {
106
106
  ...t.agentExecutionContext,
@@ -109,7 +109,7 @@ ${c}` : l = "Vector search completed. No matching layers found.", await i({ text
109
109
  };
110
110
  };
111
111
  async function U(t, e) {
112
- const a = await new V(f, { handleToolErrors: !1 }).invoke(
112
+ const a = await new j(f, { handleToolErrors: !1 }).invoke(
113
113
  {
114
114
  messages: x(t.agentExecutionContext.messages)
115
115
  },
@@ -172,7 +172,7 @@ const B = async (t, e) => (await i({ text: "Exiting Layer Styling agent" }, e),
172
172
  ...t,
173
173
  selectedLayerId: o ?? t.vectorSearchLayerIds[0]
174
174
  };
175
- }, K = (t, e) => k(["layerSearch", "fieldSearch", "layersAndFieldsRegistry"], "Layer Styling Agent")(t, e), Q = () => new L(S).addNode("requireLayerStylingServices", K).addNode("vectorSearchLayers", H).addNode("layerSelectionHITL", J).addNode("vectorSearchFields", z).addNode("populateLayerFieldInfo", O).addNode("agent", G).addNode("tools", U).addNode("earlyExit", B).addEdge(E, "requireLayerStylingServices").addEdge("requireLayerStylingServices", "vectorSearchLayers").addConditionalEdges(
175
+ }, K = (t, e) => k(["layerSearch", "fieldSearch", "layersAndFieldsRegistry"], "Layer Styling Agent")(t, e), Q = () => new L(S).addNode("requireLayerStylingServices", K).addNode("vectorSearchLayers", H).addNode("layerSelectionHITL", J).addNode("vectorSearchFields", P).addNode("populateLayerFieldInfo", O).addNode("agent", G).addNode("tools", U).addNode("earlyExit", B).addEdge(E, "requireLayerStylingServices").addEdge("requireLayerStylingServices", "vectorSearchLayers").addConditionalEdges(
176
176
  "layerSelectionHITL",
177
177
  (e) => e.vectorSearchLayerIds.length ? "vectorSearchFields" : "earlyExit"
178
178
  ).addConditionalEdges(
@@ -89,13 +89,35 @@ export abstract class ArcgisAssistant extends LitElement {
89
89
  assistantLabel: string;
90
90
  stopButtonLabel: string;
91
91
  askButtonLabel: string;
92
+ stoppedByUserLabel: string;
93
+ noAgentsFoundMessage: string;
94
+ orchestratorInitializationErrorMessage: string;
95
+ signInErrorMessage: string;
96
+ signInRequiredMessage: string;
97
+ signInLabel: string;
98
+ signInToArcGISOnlineLabel: string;
99
+ noPortalInformationMessage: string;
100
+ readMoreLabel: string;
101
+ learnAboutWebMapEmbeddingsLabel: string;
102
+ waitingForUserInputMessage: string;
92
103
  } & T9nMeta<{
93
104
  assistantLabel: string;
94
105
  stopButtonLabel: string;
95
106
  askButtonLabel: string;
107
+ stoppedByUserLabel: string;
108
+ noAgentsFoundMessage: string;
109
+ orchestratorInitializationErrorMessage: string;
110
+ signInErrorMessage: string;
111
+ signInRequiredMessage: string;
112
+ signInLabel: string;
113
+ signInToArcGISOnlineLabel: string;
114
+ noPortalInformationMessage: string;
115
+ readMoreLabel: string;
116
+ learnAboutWebMapEmbeddingsLabel: string;
117
+ waitingForUserInputMessage: string;
96
118
  }>;
97
119
  /**
98
- * When `true`, disables the assistant avatar in the chat interface.
120
+ * When `true`, displays the assistant avatar in the chat interface.
99
121
  *
100
122
  * @default false
101
123
  * @since 5.1
@@ -310,6 +332,13 @@ export abstract class ArcgisAssistant extends LitElement {
310
332
  * ```
311
333
  */
312
334
  accessor suggestedPrompts: string[];
335
+ /**
336
+ * When `true`, displays the user avatar in the chat interface.
337
+ *
338
+ * @default false
339
+ * @since 5.2
340
+ */
341
+ accessor userAvatarEnabled: boolean;
313
342
  /**
314
343
  * Cancels the active interrupt, if one is pending.
315
344
  *