@arcgis/ai-components 5.2.0-next.70 → 5.2.0-next.72

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 (98) hide show
  1. package/LICENSE.md +4 -2
  2. package/dist/agent-utils/types.d.ts +1 -1
  3. package/dist/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
  4. package/dist/agentic-workflow/Edge.d.ts +16 -0
  5. package/dist/agentic-workflow/WebAgent.d.ts +39 -0
  6. package/dist/agentic-workflow/jsonTypes.d.ts +186 -0
  7. package/dist/agentic-workflow/nodes/AgentNode.d.ts +26 -0
  8. package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
  9. package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
  10. package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
  11. package/dist/agentic-workflow/nodes/support/Prompt.d.ts +20 -0
  12. package/dist/agentic-workflow/types.d.ts +29 -0
  13. package/dist/cdn/{PUFTYLJ2.js → 33BF35AO.js} +1 -1
  14. package/dist/cdn/55M2HE4U.js +2 -0
  15. package/dist/cdn/5RZGG4F2.js +2 -0
  16. package/dist/cdn/5SF6DEMO.js +2 -0
  17. package/dist/cdn/{MW5S2XCB.js → 5SFZS2RD.js} +1 -1
  18. package/dist/cdn/6QJFOL6M.js +2 -0
  19. package/dist/cdn/BAB3MK4Y.js +2 -0
  20. package/dist/cdn/BMBV6Y2A.js +2 -0
  21. package/dist/cdn/D3RKQSWS.js +2 -0
  22. package/dist/cdn/DBHLKLKM.js +2 -0
  23. package/dist/cdn/{CXW5URTF.js → DWYODVWW.js} +1 -1
  24. package/dist/cdn/{TFT6HK3O.js → E7KEOJZG.js} +1 -1
  25. package/dist/cdn/FSMHR7GK.js +2 -0
  26. package/dist/cdn/HO2YDJI2.js +6 -0
  27. package/dist/cdn/{KQHLOYKL.js → I4L45WQS.js} +1 -1
  28. package/dist/cdn/IGQFAL3H.js +2 -0
  29. package/dist/cdn/JYVBCHR6.js +6 -0
  30. package/dist/cdn/{XETNZW4D.js → NJJYZP3R.js} +1 -1
  31. package/dist/cdn/NSXX2KYS.js +2 -0
  32. package/dist/cdn/OFRFP4BX.js +2 -0
  33. package/dist/cdn/OUFGJV3R.js +2 -0
  34. package/dist/cdn/PAUIFUMO.js +2 -0
  35. package/dist/cdn/RWM5T4XB.js +180 -0
  36. package/dist/cdn/{YHQJ66WJ.js → S3XUYAUX.js} +1 -1
  37. package/dist/cdn/S6ZAQRC6.js +2 -0
  38. package/dist/cdn/SRFLL6ET.js +2 -0
  39. package/dist/cdn/UZL6UVE4.js +2 -0
  40. package/dist/cdn/{GP6NDTUE.js → WDOM6Z5O.js} +2 -2
  41. package/dist/cdn/WQKNV6KK.js +2 -0
  42. package/dist/cdn/{ICYUPLZM.js → WZFC5HUX.js} +1 -1
  43. package/dist/cdn/XPTCV6YV.js +2 -0
  44. package/dist/cdn/Y5UFOH54.js +2 -0
  45. package/dist/cdn/{E5ZKBC24.js → Z4XUJQ2I.js} +2 -2
  46. package/dist/cdn/{SXHH575T.js → ZJEWP2ND.js} +20 -24
  47. package/dist/cdn/agent-utils/index.js +1 -1
  48. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +1 -1
  49. package/dist/cdn/agent-utils/middlewares/middleware.js +1 -1
  50. package/dist/cdn/agent-utils/middlewares/trace.js +1 -1
  51. package/dist/cdn/index.js +1 -1
  52. package/dist/chunks/adapter.js +668 -679
  53. package/dist/chunks/baseAgentState.js +56 -0
  54. package/dist/chunks/dataExplorationGraph.js +13 -13
  55. package/dist/chunks/generateLayerDescriptions.js +189 -235
  56. package/dist/chunks/navigationGraph.js +28 -28
  57. package/dist/chunks/orchestrator.js +1 -1
  58. package/dist/chunks/state.js +20 -26
  59. package/dist/chunks/utils2.js +3 -3
  60. package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
  61. package/dist/components/arcgis-assistant-agent/customElement.js +513 -12
  62. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +1 -1
  63. package/dist/components/arcgis-assistant-help-agent/customElement.js +1 -1
  64. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +1 -1
  65. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +1 -1
  66. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +1 -1
  67. package/dist/docs/api.json +1 -1
  68. package/dist/docs/docs.json +1 -1
  69. package/dist/docs/vscode.html-custom-data.json +1 -1
  70. package/dist/docs/web-types.json +1 -1
  71. package/dist/loader.js +1 -1
  72. package/dist/types/lumina.d.ts +1 -1
  73. package/dist/types/preact.d.ts +1 -1
  74. package/dist/types/react.d.ts +1 -1
  75. package/dist/types/stencil.d.ts +1 -1
  76. package/dist/utils/index.js +26 -25
  77. package/package.json +4 -4
  78. package/dist/cdn/3DJDRAGV.js +0 -2
  79. package/dist/cdn/4CEMUECT.js +0 -2
  80. package/dist/cdn/4PCAK3ET.js +0 -2
  81. package/dist/cdn/57OMVTIU.js +0 -2
  82. package/dist/cdn/6U7TEAAJ.js +0 -2
  83. package/dist/cdn/BE7ZN5FZ.js +0 -2
  84. package/dist/cdn/BNSJO6X2.js +0 -2
  85. package/dist/cdn/CMDRED5H.js +0 -2
  86. package/dist/cdn/DTIVDIDY.js +0 -2
  87. package/dist/cdn/HBLRVXEB.js +0 -2
  88. package/dist/cdn/HQXPPYMD.js +0 -2
  89. package/dist/cdn/IEHPNCTL.js +0 -2
  90. package/dist/cdn/LHLO6PTD.js +0 -2
  91. package/dist/cdn/OWXCOUIQ.js +0 -2
  92. package/dist/cdn/PVE7Q43N.js +0 -2
  93. package/dist/cdn/ST5FQYT7.js +0 -180
  94. package/dist/cdn/WUNCZOGU.js +0 -2
  95. package/dist/cdn/WVPU4QOO.js +0 -2
  96. package/dist/cdn/WXWO5D3W.js +0 -2
  97. package/dist/cdn/XCRR2EEG.js +0 -6
  98. package/dist/cdn/ZS6SXJP2.js +0 -2
@@ -0,0 +1,56 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import { Annotation as s } from "@langchain/langgraph/web";
3
+ const n = (e, t) => t, c = (e, t) => ({
4
+ ...e,
5
+ ...t
6
+ }), o = (e = "", t) => {
7
+ const r = typeof t == "string" ? t.trim() : "";
8
+ if (!r)
9
+ return e;
10
+ const a = e.trim();
11
+ if (!a)
12
+ return r;
13
+ if (a === r)
14
+ return e;
15
+ const u = a.split(`
16
+
17
+ `);
18
+ return u[u.length - 1]?.trim() === r ? e : `${e}
19
+
20
+ ${r}`;
21
+ }, i = () => ({
22
+ userRequest: "",
23
+ assignedTask: "",
24
+ messages: [],
25
+ priorSteps: [],
26
+ sharedState: {}
27
+ }), d = () => ({
28
+ agentExecutionContext: s({
29
+ reducer: c,
30
+ default: i
31
+ }),
32
+ outputMessage: s({
33
+ reducer: o,
34
+ default: () => ""
35
+ }),
36
+ summary: s({
37
+ reducer: n,
38
+ default: () => ""
39
+ }),
40
+ status: s({
41
+ reducer: n
42
+ })
43
+ }), g = () => ({
44
+ ...d(),
45
+ sharedStatePatch: s({
46
+ reducer: n
47
+ })
48
+ });
49
+ export {
50
+ d as a,
51
+ g as b,
52
+ i as c,
53
+ o as d,
54
+ c as m,
55
+ n as r
56
+ };
@@ -1,11 +1,11 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { StateGraph as I, START as k, END as v } from "@langchain/langgraph/web";
3
- import { g as T, O as R, P as C, t as N, Q as V, f, R as D, r as z, S as b, T as P } from "./adapter.js";
2
+ import { StateGraph as I, START as V, END as v } from "@langchain/langgraph/web";
3
+ import { g as T, O as R, P as C, t as N, Q as k, f, y as D, r as z, R as b, S as P } from "./adapter.js";
4
4
  import "@arcgis/core/identity/IdentityManager.js";
5
5
  import "@arcgis/core/portal/Portal.js";
6
6
  import "@arcgis/core/request.js";
7
7
  import "@arcgis/toolkit/string";
8
- import { h as _, e as Q } from "./generateLayerDescriptions.js";
8
+ import { h as A, e as Q } from "./generateLayerDescriptions.js";
9
9
  import { AIMessage as O } from "@langchain/core/messages";
10
10
  import { s as n } from "./index.js";
11
11
  import "@langchain/openai";
@@ -13,7 +13,7 @@ import "@arcgis/core/config.js";
13
13
  import "@arcgis/core/core/reactiveUtils.js";
14
14
  import "@arcgis/core/layers/FeatureLayer.js";
15
15
  import "@langchain/core/prompts";
16
- import { h as $ } from "./toolCallResponse.js";
16
+ import { h as _ } from "./toolCallResponse.js";
17
17
  import { ToolNode as j } from "@langchain/langgraph/prebuilt";
18
18
  import G from "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
19
19
  import U from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
@@ -30,7 +30,7 @@ const W = async (t, e) => (await n({ text: "Exiting Data Exploration agent" }, e
30
30
  assignedTask: t.agentExecutionContext.assignedTask,
31
31
  userRequest: t.agentExecutionContext.userRequest,
32
32
  priorSteps: t.agentExecutionContext.priorSteps
33
- }, o = await _({
33
+ }, o = await A({
34
34
  promptText: d,
35
35
  modelTier: "advanced",
36
36
  config: e,
@@ -45,7 +45,7 @@ const W = async (t, e) => (await n({ text: "Exiting Data Exploration agent" }, e
45
45
  // Don't overwrite outputMessage if query already set it
46
46
  };
47
47
  const m = i, g = o.content.toString();
48
- return await $(o, e), { ...t, dataExplorationMessages: m, outputMessage: g };
48
+ return await _(o, e), { ...t, dataExplorationMessages: m, outputMessage: g };
49
49
  }, H = async (t, e) => {
50
50
  await n({ text: "Requesting LLM for layer query results" }, e);
51
51
  const d = await T("data_explore_query_prompt");
@@ -78,15 +78,15 @@ const W = async (t, e) => (await n({ text: "Exiting Data Exploration agent" }, e
78
78
  priorSteps: t.agentExecutionContext.priorSteps,
79
79
  lastNavigatedFeatures: c,
80
80
  lastResolvedLocation: m
81
- }, y = await _({
81
+ }, y = await A({
82
82
  promptText: d,
83
83
  modelTier: "advanced",
84
84
  config: e,
85
85
  messages: t.dataExplorationMessages,
86
86
  inputVariables: g,
87
- tools: V
87
+ tools: k
88
88
  }), h = (y.tool_calls?.length ?? 0) > 0, p = y.content.toString();
89
- return await $(y, e), {
89
+ return await _(y, e), {
90
90
  ...t,
91
91
  dataExplorationMessages: [...t.dataExplorationMessages, y],
92
92
  // Only emit output here when no tools are being called.
@@ -192,7 +192,7 @@ async function te(t, e, a, d = !0) {
192
192
  fieldName: u.name,
193
193
  didFetchStatistics: q
194
194
  }), q) {
195
- const A = Z(g, u, {
195
+ const $ = Z(g, u, {
196
196
  includeSummaryStatistics: E,
197
197
  includeUniqueValues: w
198
198
  }).then((F) => {
@@ -202,7 +202,7 @@ async function te(t, e, a, d = !0) {
202
202
  };
203
203
  E && (S.summaryStatistics = F.summaryStatistics), w && (S.uniqueValues = F.uniqueValues), y.set(u.name, { ...u, statistics: S }), u.statistics = S;
204
204
  });
205
- s.push(A);
205
+ s.push($);
206
206
  }
207
207
  h.fieldInfos.push(u);
208
208
  }
@@ -220,7 +220,7 @@ function ae(t, e) {
220
220
  const se = async (t, e) => {
221
221
  try {
222
222
  await n({ text: "Preparing field information for vector search results" }, e);
223
- const a = f(e, "layersAndFieldsRegistry"), { mapView: d } = D(e), { assignedTask: l, userRequest: s } = t.agentExecutionContext, r = ae(l, s), { layerFieldInfo: o, didFetchStatistics: i, fieldStatisticsFetchStatus: c } = await te(
223
+ const a = f(e, "layersAndFieldsRegistry"), { mapView: d } = D(e, ["mapView"]), { assignedTask: l, userRequest: s } = t.agentExecutionContext, r = ae(l, s), { layerFieldInfo: o, didFetchStatistics: i, fieldStatisticsFetchStatus: c } = await te(
224
224
  t.vectorSearchFieldResults,
225
225
  a,
226
226
  d,
@@ -293,7 +293,7 @@ ${o}` : i = "Vector search completed. No matching layers found.", await n({ text
293
293
  }, le = (t, e) => z(["layerSearch", "fieldSearch", "layersAndFieldsRegistry"], "Data Exploration Agent")(
294
294
  t,
295
295
  e
296
- ), ce = () => new I(b).addNode("requireDataExplorationServices", le).addNode("vectorSearchLayers", ne).addNode("vectorSearchFields", oe).addNode("fieldStatistics", se).addNode("queryAgent", H).addNode("queryTools", P).addNode("summarizeQueryResponseLLM", J).addNode("filterAgent", B).addNode("filterTools", K).addNode("earlyExit", W).addEdge(k, "requireDataExplorationServices").addEdge("requireDataExplorationServices", "vectorSearchLayers").addConditionalEdges(
296
+ ), ce = () => new I(b).addNode("requireDataExplorationServices", le).addNode("vectorSearchLayers", ne).addNode("vectorSearchFields", oe).addNode("fieldStatistics", se).addNode("queryAgent", H).addNode("queryTools", P).addNode("summarizeQueryResponseLLM", J).addNode("filterAgent", B).addNode("filterTools", K).addNode("earlyExit", W).addEdge(V, "requireDataExplorationServices").addEdge("requireDataExplorationServices", "vectorSearchLayers").addConditionalEdges(
297
297
  "vectorSearchLayers",
298
298
  (e) => e.vectorSearchLayerIds.length ? "vectorSearchFields" : "earlyExit"
299
299
  ).addConditionalEdges(