@arcgis/ai-components 6.0.0-next.0 → 6.0.0-next.1

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 (181) hide show
  1. package/dist/agent-utils/LLMAgent.d.ts +9 -2
  2. package/dist/agent-utils/LLMAgent.js +45 -36
  3. package/dist/agent-utils/tools/FunctionTool.d.ts +12 -1
  4. package/dist/agent-utils/tools/FunctionTool.js +15 -14
  5. package/dist/agent-utils/tools/MCPToolProvider.d.ts +54 -0
  6. package/dist/agent-utils/tools/MCPToolProvider.js +120 -0
  7. package/dist/agent-utils/tools/ToolProvider.d.ts +13 -0
  8. package/dist/agent-utils/tools/WebMCPToolProvider.d.ts +37 -0
  9. package/dist/agent-utils/tools/WebMCPToolProvider.js +71 -0
  10. package/dist/agents/tools/query/getAttribute/adapter.js +28 -24
  11. package/dist/agents/tools/query/getStatistics/adapter.js +70 -66
  12. package/dist/agents/tools/query/getTopFeatures/adapter.js +74 -70
  13. package/dist/agents/tools/query/queryFeatures/adapter.js +40 -36
  14. package/dist/cdn/{3HV6OXCZ.js → 24TK55FP.js} +1 -1
  15. package/dist/cdn/{4OLV5LA7.js → 2DWN3SKH.js} +1 -1
  16. package/dist/cdn/2O52MJ3D.js +2 -0
  17. package/dist/cdn/2UDDCWNW.js +2 -0
  18. package/dist/cdn/5FDBJI24.js +5 -0
  19. package/dist/cdn/5LA77ZBW.js +2 -0
  20. package/dist/cdn/{SBIYXWXZ.js → 5REENYPV.js} +1 -1
  21. package/dist/cdn/{V6AQFRUC.js → 5TW2NFES.js} +1 -1
  22. package/dist/cdn/{RBRHDEOB.js → 66VWTARH.js} +1 -1
  23. package/dist/cdn/6E6T6U7W.js +2 -0
  24. package/dist/cdn/{KKXOSV62.js → 6PK2UPG3.js} +1 -1
  25. package/dist/cdn/{OFM2S6U7.js → 6WYVG3JI.js} +1 -1
  26. package/dist/cdn/7HVIVV3O.js +2 -0
  27. package/dist/cdn/{U53SVXZK.js → 7MCFHVEH.js} +1 -1
  28. package/dist/cdn/{XI4BPYGB.js → 7X22QXJP.js} +1 -1
  29. package/dist/cdn/{EU6YSCZL.js → 7ZTYHZIN.js} +1 -1
  30. package/dist/cdn/A22375P3.js +2 -0
  31. package/dist/cdn/{2XXM52PS.js → AMP43OT2.js} +1 -1
  32. package/dist/cdn/{TTPTZBCM.js → AMURN3LO.js} +1 -1
  33. package/dist/cdn/AO2G4EXA.js +2 -0
  34. package/dist/cdn/{6GQCLDLJ.js → AQF6BBWC.js} +1 -1
  35. package/dist/cdn/AWPLRVPS.js +2 -0
  36. package/dist/cdn/{W3ZLMBEE.js → BBB5EJUB.js} +1 -1
  37. package/dist/cdn/{Q6PCXSZT.js → BMPBJXD7.js} +1 -1
  38. package/dist/cdn/{ZBRZU4XB.js → C67KQCPS.js} +1 -1
  39. package/dist/cdn/C76HLPKU.js +2 -0
  40. package/dist/cdn/{FFWPUYGD.js → CDS2HGQY.js} +1 -1
  41. package/dist/cdn/CHHC6YNW.js +2 -0
  42. package/dist/cdn/DBRBT54R.js +2 -0
  43. package/dist/cdn/{NN6MELJ7.js → DGCWQYN3.js} +1 -1
  44. package/dist/cdn/{IEAHAC6B.js → DI3VGUJY.js} +1 -1
  45. package/dist/cdn/{B4C7NIB5.js → DJG6DBCU.js} +2 -2
  46. package/dist/cdn/DJKEGIQZ.js +2 -0
  47. package/dist/cdn/{T2FKFOHE.js → DZOQFEOB.js} +1 -1
  48. package/dist/cdn/{AMFZY5QK.js → EEHDAYOG.js} +1 -1
  49. package/dist/cdn/{YO3L3XIH.js → EG5BMYZO.js} +1 -1
  50. package/dist/cdn/EGSD465U.js +2 -0
  51. package/dist/cdn/{ZMMUAYDN.js → EXLDRGUC.js} +1 -1
  52. package/dist/cdn/{WVMQ3I6F.js → FBARYPZ7.js} +1 -1
  53. package/dist/cdn/{M7TMD2HP.js → FJV7CI7O.js} +1 -1
  54. package/dist/cdn/{TRZJYWEB.js → FSLPYC4Y.js} +2 -2
  55. package/dist/cdn/{W6TS2TIE.js → GBFRJF4F.js} +1 -1
  56. package/dist/cdn/{7DRHB24Z.js → GHFOAS7T.js} +1 -1
  57. package/dist/cdn/HC5DJL2U.js +3 -0
  58. package/dist/cdn/HLWG7OIR.js +2 -0
  59. package/dist/cdn/{V7ERVXIO.js → HSMAXOOA.js} +1 -1
  60. package/dist/cdn/HWIM4KWF.js +2 -0
  61. package/dist/cdn/{VVWKEN53.js → JEWJ4M25.js} +1 -1
  62. package/dist/cdn/{I5OBL24F.js → JFL5IWPK.js} +1 -1
  63. package/dist/cdn/JUPTVXLY.js +2 -0
  64. package/dist/cdn/{B2JRBDJZ.js → JZPPP4QY.js} +1 -1
  65. package/dist/cdn/KKWCHNYQ.js +2 -0
  66. package/dist/cdn/{I7PHDOEQ.js → KX6CZEVZ.js} +1 -1
  67. package/dist/cdn/{XJUYG2M3.js → KY7M4WHO.js} +1 -1
  68. package/dist/cdn/L5IPMRHC.js +2 -0
  69. package/dist/cdn/M2G44RTS.js +2 -0
  70. package/dist/cdn/{H7WJUUJT.js → M6JQGHCE.js} +1 -1
  71. package/dist/cdn/MB7SEHPZ.js +2 -0
  72. package/dist/cdn/MC2V5WT3.js +2 -0
  73. package/dist/cdn/{ZBBI5M2X.js → MD2FTKQT.js} +1 -1
  74. package/dist/cdn/{645SDZBB.js → MPQ2OZXN.js} +1 -1
  75. package/dist/cdn/MZFWD5CQ.js +2 -0
  76. package/dist/cdn/{7OQA4GCM.js → NHWT7CXX.js} +1 -1
  77. package/dist/cdn/NMFEXE4D.js +2 -0
  78. package/dist/cdn/{MQSOVP27.js → NPV4MEAZ.js} +1 -1
  79. package/dist/cdn/{ENVTUTY6.js → OGZFST2A.js} +1 -1
  80. package/dist/cdn/P4CHI7W3.js +9 -0
  81. package/dist/cdn/{TPMZRJEC.js → PCAMBPOA.js} +1 -1
  82. package/dist/cdn/{O62IJLTZ.js → PGH7POKS.js} +1 -1
  83. package/dist/cdn/{37EJSNE3.js → PGUEODFA.js} +1 -1
  84. package/dist/cdn/{QJOO6IIX.js → QEGO4B2W.js} +1 -1
  85. package/dist/cdn/{FXRZCD5Y.js → QT3B5K4R.js} +1 -1
  86. package/dist/cdn/{2FUTKTNO.js → RE7MJTEF.js} +1 -1
  87. package/dist/cdn/RF6HWZMB.js +2 -0
  88. package/dist/cdn/{DWMZ23QK.js → RFDMNYTA.js} +1 -1
  89. package/dist/cdn/{OJP56R5R.js → RFPTOFM4.js} +1 -1
  90. package/dist/cdn/RKURZ5T2.js +2 -0
  91. package/dist/cdn/SJ4UMNIS.js +2 -0
  92. package/dist/cdn/{U3ZTF2BC.js → SWXUQFB6.js} +1 -1
  93. package/dist/cdn/{KJZVYKWL.js → T3SCINN5.js} +1 -1
  94. package/dist/cdn/{W3OJTTVX.js → TENUVOFJ.js} +1 -1
  95. package/dist/cdn/{UPSFL6U3.js → TJBU5BQK.js} +1 -1
  96. package/dist/cdn/UOKYHQNO.js +2 -0
  97. package/dist/cdn/UQRBY7ID.js +11 -0
  98. package/dist/cdn/{ZS5P7NRI.js → USPB2QBX.js} +1 -1
  99. package/dist/cdn/{ZKDCEL6K.js → UYP5PH5E.js} +1 -1
  100. package/dist/cdn/V6EX4YCY.js +2 -0
  101. package/dist/cdn/VA4M72JC.js +2 -0
  102. package/dist/cdn/VQ67NANV.js +2 -0
  103. package/dist/cdn/{2ZH5JNHL.js → X5ET73QZ.js} +1 -1
  104. package/dist/cdn/{DXCDVRGL.js → XC3T3Z5R.js} +1 -1
  105. package/dist/cdn/{J37GSI7C.js → XCLICBG7.js} +1 -1
  106. package/dist/cdn/XEJFVUNQ.js +2 -0
  107. package/dist/cdn/{EXIA3APU.js → XWNZMKQF.js} +1 -1
  108. package/dist/cdn/{UYEF3IKE.js → YBWRFVA6.js} +1 -1
  109. package/dist/cdn/YI6NIHNI.js +14 -0
  110. package/dist/cdn/{MHUEU6MR.js → YJXRCO4T.js} +1 -1
  111. package/dist/cdn/{2GSHUAQ2.js → YPLPDUMB.js} +1 -1
  112. package/dist/cdn/{YOQCQAKT.js → ZKWXHSEQ.js} +1 -1
  113. package/dist/cdn/{HWNPZ4CF.js → ZSLHB6MF.js} +1 -1
  114. package/dist/cdn/agent-utils/BaseAgent.js +1 -1
  115. package/dist/cdn/agent-utils/FunctionAgent.js +1 -1
  116. package/dist/cdn/agent-utils/LLMAgent.js +1 -1
  117. package/dist/cdn/agent-utils/SkillAgent.js +1 -1
  118. package/dist/cdn/agent-utils/WorkflowAgent.js +1 -1
  119. package/dist/cdn/agent-utils/createSchema.js +1 -1
  120. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +1 -1
  121. package/dist/cdn/agent-utils/middlewares/middleware.js +1 -1
  122. package/dist/cdn/agent-utils/middlewares/trace.js +1 -1
  123. package/dist/cdn/agent-utils/tools/FunctionTool.js +1 -1
  124. package/dist/cdn/agent-utils/tools/MCPToolProvider.js +15 -0
  125. package/dist/cdn/agent-utils/tools/WebMCPToolProvider.js +2 -0
  126. package/dist/cdn/agent-utils/workflows/ConditionalWorkflow.js +1 -1
  127. package/dist/cdn/agent-utils/workflows/LoopWorkflow.js +1 -1
  128. package/dist/cdn/agent-utils/workflows/ParallelWorkflow.js +1 -1
  129. package/dist/cdn/agent-utils/workflows/RouterWorkflow.js +1 -1
  130. package/dist/cdn/agent-utils/workflows/SequentialWorkflow.js +1 -1
  131. package/dist/cdn/agent-utils/workflows/SwitchWorkflow.js +1 -1
  132. package/dist/cdn/index.js +1 -1
  133. package/dist/cdn/orchestrator/embeddings/getEmbeddings.js +1 -1
  134. package/dist/cdn/orchestrator/models/chatModel.js +1 -1
  135. package/dist/cdn/orchestrator/models/prompts.js +1 -1
  136. package/dist/cdn/orchestrator/state/runtime.js +1 -1
  137. package/dist/chunks/converterUtils.js +65 -109
  138. package/dist/chunks/resolveFieldNames.js +9 -0
  139. package/dist/components/arcgis-assistant-message-log/customElement.js +4 -5
  140. package/dist/components/arcgis-assistant-message-log/index.js +5 -0
  141. package/dist/components/arcgis-assistant-message-text/customElement.js +10 -11
  142. package/dist/components/arcgis-assistant-message-text/index.js +5 -0
  143. package/dist/components/arcgis-assistant-user-message/customElement.js +7 -8
  144. package/dist/components/arcgis-assistant-user-message/index.js +5 -0
  145. package/dist/docs/api.json +1 -1
  146. package/dist/docs/docs.json +1 -1
  147. package/package.json +8 -5
  148. package/dist/cdn/25CQLMB4.js +0 -2
  149. package/dist/cdn/34HKOU3T.js +0 -2
  150. package/dist/cdn/3WS4DSWD.js +0 -2
  151. package/dist/cdn/43OJZMBB.js +0 -2
  152. package/dist/cdn/4BRIOLDJ.js +0 -2
  153. package/dist/cdn/4ZPGFIE2.js +0 -2
  154. package/dist/cdn/6JCDY4FL.js +0 -2
  155. package/dist/cdn/7GQCNR4P.js +0 -11
  156. package/dist/cdn/A3KIOUWB.js +0 -2
  157. package/dist/cdn/BKKLQUK2.js +0 -2
  158. package/dist/cdn/DQRKGYR3.js +0 -2
  159. package/dist/cdn/EOSKJPQV.js +0 -2
  160. package/dist/cdn/F7VQ3WH2.js +0 -2
  161. package/dist/cdn/FBIPIDP7.js +0 -2
  162. package/dist/cdn/GOET2CH4.js +0 -2
  163. package/dist/cdn/ISDNOFHU.js +0 -3
  164. package/dist/cdn/JZS6ZSWH.js +0 -2
  165. package/dist/cdn/KEBMHD4R.js +0 -9
  166. package/dist/cdn/KPHHXMRK.js +0 -2
  167. package/dist/cdn/LVSIZRTB.js +0 -2
  168. package/dist/cdn/QQPVN5MG.js +0 -2
  169. package/dist/cdn/REE4K4J7.js +0 -2
  170. package/dist/cdn/RFKOCMMT.js +0 -2
  171. package/dist/cdn/RKHDRUX5.js +0 -2
  172. package/dist/cdn/TGI7QCB2.js +0 -2
  173. package/dist/cdn/UALF45Q2.js +0 -2
  174. package/dist/cdn/WB5AFS42.js +0 -2
  175. package/dist/cdn/WC6SHIEX.js +0 -2
  176. package/dist/cdn/XPSPAZUD.js +0 -2
  177. package/dist/cdn/YAUQJ6NV.js +0 -2
  178. package/dist/cdn/YD3DLETZ.js +0 -2
  179. package/dist/cdn/YKKIJTJY.js +0 -2
  180. package/dist/cdn/ZCNCYKXW.js +0 -14
  181. package/dist/cdn/ZESTW6HJ.js +0 -2
@@ -1,31 +1,35 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { tool as L } from "@langchain/core/tools";
2
+ import { tool as E } from "@langchain/core/tools";
3
3
  import t from "zod";
4
- import E from "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
4
+ import N from "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
5
5
  import R from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
6
6
  import V from "@arcgis/core/layers/support/FeatureFilter.js";
7
- import { c as x, m as v } from "../../../../chunks/mergeWhereClauses.js";
8
- import { g as O, i as S, a as C, s as N, r as G } from "../../../../chunks/resolveGeometryFilter.js";
9
- import { f as U } from "../../../../chunks/fetchAgentContext.js";
10
- import { f as W } from "../../../../chunks/fetchService.js";
7
+ import { c as x, m as S } from "../../../../chunks/mergeWhereClauses.js";
8
+ import { g as O, i as F, a as C, s as G, r as U } from "../../../../chunks/resolveGeometryFilter.js";
9
+ import { r as W } from "../../../../chunks/resolveFieldNames.js";
10
+ import { f as j } from "../../../../chunks/fetchAgentContext.js";
11
+ import { f as A } from "../../../../chunks/fetchService.js";
11
12
  import { distanceUnitsSchema as I } from "../../shared/types.js";
12
- const j = async (h) => {
13
- const { targetLayer: a, fieldName: n, statisticType: l, mapView: i, layersAndFieldsRegistry: p, geometryFilter: e } = h, s = i.map?.allLayers.find((r) => r.id === a.layerId);
14
- if (!s)
15
- throw new Error(`Layer '${a.layerId}' not found.`);
16
- const w = await i.whenLayerView(s), o = p.get(a.layerId)?.fieldRegistry.get(n), F = o?.alias;
13
+ const D = async (h) => {
14
+ const { targetLayer: s, fieldName: l, statisticType: n, mapView: r, layersAndFieldsRegistry: p, geometryFilter: e } = h, a = r.map?.allLayers.find((i) => i.id === s.layerId);
15
+ if (!a)
16
+ throw new Error(`Layer '${s.layerId}' not found.`);
17
+ const w = await r.whenLayerView(a), b = W(
18
+ l,
19
+ a.fields.map((i) => i.name)
20
+ ), o = p.get(s.layerId)?.fieldRegistry.get(b), T = o?.alias;
17
21
  if (!o)
18
- throw new Error(`Field '${n}' not found.`);
19
- let b, u;
22
+ throw new Error(`Field '${b}' not found.`);
23
+ let v, u;
20
24
  if (e) {
21
- const r = await O(e, i);
22
- if ("error" in r)
23
- throw new Error(r.error);
24
- if (!r.geometry)
25
- throw S(e) ? new Error(`No features found matching: ${e.where}`) : new Error("Failed to create geometry");
26
- if (S(e)) {
27
- const g = i.map?.allLayers.find((f) => f.id === e.layerId);
28
- b = {
25
+ const i = await O(e, r);
26
+ if ("error" in i)
27
+ throw new Error(i.error);
28
+ if (!i.geometry)
29
+ throw F(e) ? new Error(`No features found matching: ${e.where}`) : new Error("Failed to create geometry");
30
+ if (F(e)) {
31
+ const g = r.map?.allLayers.find((f) => f.id === e.layerId);
32
+ v = {
29
33
  geometryLayerName: g?.title ?? g?.id,
30
34
  geometryLayerId: e.layerId,
31
35
  geometryWhere: e.where,
@@ -33,90 +37,90 @@ const j = async (h) => {
33
37
  units: e.units,
34
38
  applied: !0
35
39
  };
36
- } else C(e) && (b = {
40
+ } else C(e) && (v = {
37
41
  point: e.point,
38
42
  distance: e.distance,
39
43
  units: e.units,
40
44
  applied: !0
41
45
  });
42
46
  u = new V({
43
- geometry: r.geometry,
47
+ geometry: i.geometry,
44
48
  distance: e.distance,
45
49
  units: e.units,
46
50
  spatialRelationship: "intersects"
47
51
  });
48
52
  }
49
- const y = x(w, [n], !1);
53
+ const y = x(w, [l], !1);
50
54
  let d = null, m = null;
51
- const T = 10;
55
+ const q = 10;
52
56
  if (o.type !== "geometry" && o.type !== "oid" && o.type !== "global-id")
53
57
  try {
54
- const r = {
55
- layer: s,
58
+ const i = {
59
+ layer: a,
56
60
  useFeaturesInView: y,
57
- view: y ? i : void 0,
58
- field: n,
59
- sqlWhere: v(s.definitionExpression, a.where),
61
+ view: y ? r : void 0,
62
+ field: l,
63
+ sqlWhere: S(a.definitionExpression, s.where),
60
64
  ...u && { filter: u },
61
- outStatisticTypes: { include: [l] }
65
+ outStatisticTypes: { include: [n] }
62
66
  };
63
- d = await E(r);
67
+ d = await N(i);
64
68
  const g = ["string", "small-integer", "integer"], f = o.domain?.type === "coded-value" ? o.domain : null;
65
69
  (g.includes(o.type) || f) && (m = (await R({
66
- layer: s,
70
+ layer: a,
67
71
  useFeaturesInView: y,
68
- view: y ? i : void 0,
69
- field: n,
70
- sqlWhere: v(s.definitionExpression, a.where),
72
+ view: y ? r : void 0,
73
+ field: l,
74
+ sqlWhere: S(a.definitionExpression, s.where),
71
75
  ...u && { filter: u }
72
- })).uniqueValueInfos.sort((c, q) => q.count - c.count).slice(0, T)), m && o.domain?.type === "coded-value" && (m = m.map((c) => ({
76
+ })).uniqueValueInfos.sort((c, L) => L.count - c.count).slice(0, q)), m && o.domain?.type === "coded-value" && (m = m.map((c) => ({
73
77
  ...c,
74
78
  value: f ? f.getName(c.value) ?? c.value : c.value
75
79
  })));
76
- } catch (r) {
77
- console.error("Statistics error:", r);
80
+ } catch (i) {
81
+ console.error("Statistics error:", i);
78
82
  }
79
83
  return {
80
84
  tool: "getStatistics",
81
- layerName: s.title ?? a.layerId,
82
- summary: `${l} = ${typeof d?.[l] == "number" ? d[l] : "N/A"}`,
85
+ layerName: a.title ?? s.layerId,
86
+ summary: `${n} = ${typeof d?.[n] == "number" ? d[n] : "N/A"}`,
83
87
  details: {
84
- fieldName: n,
85
- fieldAlias: F,
86
- statisticType: l,
87
- statistic: d?.[l] ?? null,
88
+ fieldName: l,
89
+ fieldAlias: T,
90
+ statisticType: n,
91
+ statistic: d?.[n] ?? null,
88
92
  summaryStatistics: d,
89
93
  uniqueValues: m,
90
- where: a.where,
91
- spatialFilterInfo: b
94
+ where: s.where,
95
+ spatialFilterInfo: v
92
96
  }
93
97
  };
94
98
  };
95
- async function A({
99
+ async function $({
96
100
  targetLayer: h,
97
- fieldName: a,
98
- statisticType: n,
99
- geometryFilter: l
100
- }, i) {
101
- const p = W(i, "layersAndFieldsRegistry"), { mapView: e } = U(i, ["mapView"]), s = G(
102
- l,
103
- i.state?.agentExecutionContext?.sharedResources
104
- ), w = await j({
101
+ fieldName: s,
102
+ statisticType: l,
103
+ geometryFilter: n
104
+ }, r) {
105
+ const p = A(r, "layersAndFieldsRegistry"), { mapView: e } = j(r, ["mapView"]), a = U(
106
+ n,
107
+ r.state?.agentExecutionContext?.sharedResources
108
+ ), w = await D({
105
109
  targetLayer: h,
106
- fieldName: a,
107
- statisticType: n,
110
+ fieldName: s,
111
+ statisticType: l,
108
112
  mapView: e,
109
113
  layersAndFieldsRegistry: p,
110
- geometryFilter: s
114
+ geometryFilter: a
111
115
  });
112
116
  return JSON.stringify(w, null, 2);
113
117
  }
114
- const D = t.object({
118
+ const P = t.object({
115
119
  layerId: t.string().describe("The layerId of the layer containing the geometry by which to filter."),
116
120
  where: t.string().describe("The SQL-92 where clause representing the features from which to filter."),
117
121
  distance: t.number().optional().describe("The buffer distance around the geometry."),
118
122
  units: I.optional().describe("The units for the distance buffer.")
119
- }), $ = t.object({
123
+ }), Q = t.object({
120
124
  point: t.object({
121
125
  x: t.number().describe("X coordinate (longitude) from navigation result"),
122
126
  y: t.number().describe("Y coordinate (latitude) from navigation result"),
@@ -126,17 +130,17 @@ const D = t.object({
126
130
  }).describe("Point coordinates from a previous navigation/geocoding result"),
127
131
  distance: t.number().optional().describe("Optional buffer distance around the point."),
128
132
  units: I.optional().describe("The units for the distance buffer.")
129
- }), P = t.object({
133
+ }), H = t.object({
130
134
  targetLayer: t.object({
131
135
  layerId: t.string().describe("The layerId of the layer containing the field from which to get a value."),
132
136
  where: t.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value.")
133
137
  }),
134
- geometryFilter: t.union([D, $, N]).optional().describe(
138
+ geometryFilter: t.union([P, Q, G]).optional().describe(
135
139
  "Geometry filter for spatial queries. Use 'sharedResourceId' with an ID from listSharedResources for a previously geocoded location. Use 'point' for inline coordinates or 'layerId/where' for features from another layer."
136
140
  ),
137
141
  fieldName: t.string().describe("The name of the field for which to get statistics. STRICTLY DO NOT use OBJECTID. Use any other field"),
138
142
  statisticType: t.enum(["avg", "max", "median", "min", "stddev", "sum", "variance", "nullcount", "count"]).describe("The statistic type to calculate.")
139
- }), ee = L(A, {
143
+ }), re = E($, {
140
144
  name: "getStatistics",
141
145
  description: `Computes a single aggregate statistic (max, min, avg, sum, median, stddev, variance) for a numeric field across matching features. Also returns frequency analysis for categorical fields.
142
146
 
@@ -151,8 +155,8 @@ DO NOT USE FOR:
151
155
  - Simple counts of features matching a condition — use queryFeatures instead
152
156
 
153
157
  Only call this tool when the answer requires computing an aggregate (avg, max, min, sum, median, stddev) over a field's values, not just counting or listing features.`,
154
- schema: P
158
+ schema: H
155
159
  });
156
160
  export {
157
- ee as getStatisticsTool
161
+ re as getStatisticsTool
158
162
  };
@@ -2,130 +2,134 @@
2
2
  import { tool as x } from "@langchain/core/tools";
3
3
  import t from "zod";
4
4
  import G from "@arcgis/core/rest/support/TopFeaturesQuery.js";
5
- import N from "@arcgis/core/rest/support/TopFilter.js";
6
- import { m as b, c as R } from "../../../../chunks/mergeWhereClauses.js";
7
- import { a as j } from "../../../../chunks/formatFeatureAttributes.js";
8
- import { g as D, s as Q, r as $ } from "../../../../chunks/resolveGeometryFilter.js";
9
- import { f as E } from "../../../../chunks/fetchAgentContext.js";
10
- import { distanceUnitsSchema as T } from "../../shared/types.js";
11
- const S = (r) => r.flatMap((e) => e.split(",")).map((e) => e.trim()).map((e) => e.split(/\s+/u)[0]?.replace(/^"|"$/gu, "")).filter((e) => !!e), O = (r, e, a) => {
12
- if (a === "date") {
13
- const o = e instanceof Date ? e : typeof e == "number" ? new Date(e) : void 0;
14
- if (o && Number.isFinite(o.getTime())) {
15
- const l = o.toISOString().replace("T", " ").replace("Z", " +00:00");
16
- return `${r} = TIMESTAMP'${l}'`;
5
+ import R from "@arcgis/core/rest/support/TopFilter.js";
6
+ import { m as w, c as j } from "../../../../chunks/mergeWhereClauses.js";
7
+ import { a as D } from "../../../../chunks/formatFeatureAttributes.js";
8
+ import { g as Q, s as $, r as E } from "../../../../chunks/resolveGeometryFilter.js";
9
+ import { f as O } from "../../../../chunks/resolveFieldNames.js";
10
+ import { f as U } from "../../../../chunks/fetchAgentContext.js";
11
+ import { distanceUnitsSchema as B } from "../../shared/types.js";
12
+ const T = (o) => o.flatMap((e) => e.split(",")).map((e) => e.trim()).map((e) => e.split(/\s+/u)[0]?.replace(/^"|"$/gu, "")).filter((e) => !!e), W = (o, e, n) => {
13
+ if (n === "date") {
14
+ const s = e instanceof Date ? e : typeof e == "number" ? new Date(e) : void 0;
15
+ if (s && Number.isFinite(s.getTime())) {
16
+ const l = s.toISOString().replace("T", " ").replace("Z", " +00:00");
17
+ return `${o} = TIMESTAMP'${l}'`;
17
18
  }
18
19
  return;
19
20
  }
20
21
  if (typeof e == "number" && Number.isFinite(e))
21
- return `${r} = ${e}`;
22
+ return `${o} = ${e}`;
22
23
  if (typeof e == "string")
23
- return `${r} = '${e.replace(/'/gu, "''")}'`;
24
- }, U = async (r, e, a, o, l) => {
25
- const i = a.map?.allLayers.find((s) => s.id === r.layerId), p = await a.whenLayerView(i), c = i.title ?? r.layerId;
24
+ return `${o} = '${e.replace(/'/gu, "''")}'`;
25
+ }, A = async (o, e, n, s, l) => {
26
+ const i = n.map?.allLayers.find((r) => r.id === o.layerId), p = await n.whenLayerView(i), c = i.title ?? o.layerId, y = O(
27
+ o.outFields,
28
+ i.fields.map((r) => r.name)
29
+ );
26
30
  let f;
27
- if (o) {
28
- const s = await D(o, a);
29
- if ("error" in s)
31
+ if (s) {
32
+ const r = await Q(s, n);
33
+ if ("error" in r)
30
34
  return {
31
35
  tool: "getTopFeatures",
32
36
  layerName: c,
33
37
  summary: "Geometry lookup failed",
34
- details: { error: s.error }
38
+ details: { error: r.error }
35
39
  };
36
- if (!s.geometry)
40
+ if (!r.geometry)
37
41
  return {
38
42
  tool: "getTopFeatures",
39
43
  layerName: c,
40
44
  summary: "No features found for geometry filter",
41
45
  details: {
42
- error: `No features found matching: ${"where" in o ? o.where : "unknown criteria"}`
46
+ error: `No features found matching: ${"where" in s ? s.where : "unknown criteria"}`
43
47
  }
44
48
  };
45
- f = s.geometry;
46
- } else l && (f = a.extent.clone());
47
- const w = e.groupByFields && e.groupByFields.length > 0, y = i.objectIdField, g = r.outFields.includes("*") ? ["*"] : [.../* @__PURE__ */ new Set([...r.outFields, y])];
49
+ f = r.geometry;
50
+ } else l && (f = n.extent.clone());
51
+ const F = e.groupByFields && e.groupByFields.length > 0, g = i.objectIdField, b = y.includes("*") ? ["*"] : [.../* @__PURE__ */ new Set([...y, g])];
48
52
  try {
49
- let s;
50
- if (w) {
53
+ let r;
54
+ if (F) {
51
55
  const u = new G({
52
- where: r.where || "1=1",
53
- outFields: g,
54
- orderByFields: r.orderByFields,
56
+ where: o.where || "1=1",
57
+ outFields: b,
58
+ orderByFields: o.orderByFields,
55
59
  geometry: f,
56
60
  spatialRelationship: f ? "intersects" : void 0,
57
- distance: o?.distance,
58
- units: o?.units,
59
- topFilter: new N({
61
+ distance: s?.distance,
62
+ units: s?.units,
63
+ topFilter: new R({
60
64
  topCount: e.topCount,
61
65
  groupByFields: e.groupByFields,
62
66
  orderByFields: e.orderByFields
63
67
  })
64
68
  });
65
- s = await i.queryTopFeatures(u);
69
+ r = await i.queryTopFeatures(u);
66
70
  } else {
67
71
  let u;
68
72
  if (e.topCount === 1) {
69
73
  const d = i.createQuery();
70
- d.where = b(i.definitionExpression, r.where || "1=1");
71
- const q = S(e.orderByFields)[0], h = i.fields.find((m) => m.name.toLowerCase() === q?.toLowerCase());
72
- if (h) {
74
+ d.where = w(i.definitionExpression, o.where || "1=1");
75
+ const N = T(e.orderByFields)[0], m = i.fields.find((h) => h.name.toLowerCase() === N?.toLowerCase());
76
+ if (m) {
73
77
  d.outFields = ["*"], d.orderByFields = e.orderByFields, d.num = e.topCount, d.returnGeometry = !1;
74
- const m = await i.queryFeatures(d), v = m.features[m.features.length - 1]?.attributes?.[h.name];
75
- u = O(h.name, v, h.type);
78
+ const h = await i.queryFeatures(d), q = h.features[h.features.length - 1]?.attributes?.[m.name];
79
+ u = W(m.name, q, m.type);
76
80
  }
77
81
  }
78
- const n = i.createQuery(), F = b(i.definitionExpression, r.where || "1=1");
79
- n.where = u ? b(F, u) : F, n.outFields = g.length ? g : ["*"], n.orderByFields = e.orderByFields, n.returnGeometry = !1, u || (n.num = e.topCount), f && (n.geometry = f, n.spatialRelationship = "intersects"), o?.distance && (n.distance = o.distance), o?.units && (n.units = o.units), n.outSpatialReference = a.spatialReference;
80
- const I = [
81
- .../* @__PURE__ */ new Set([...r.outFields, ...S(e.orderByFields)])
82
- ], k = R(p, I, l ?? !1);
82
+ const a = i.createQuery(), S = w(i.definitionExpression, o.where || "1=1");
83
+ a.where = u ? w(S, u) : S, a.outFields = b.length ? b : ["*"], a.orderByFields = e.orderByFields, a.returnGeometry = !1, u || (a.num = e.topCount), f && (a.geometry = f, a.spatialRelationship = "intersects"), s?.distance && (a.distance = s.distance), s?.units && (a.units = s.units), a.outSpatialReference = n.spatialReference;
84
+ const k = [
85
+ .../* @__PURE__ */ new Set([...y, ...T(e.orderByFields)])
86
+ ], v = j(p, k, l ?? !1);
83
87
  try {
84
- s = k ? await p.queryFeatures(n) : await i.queryFeatures(n);
88
+ r = v ? await p.queryFeatures(a) : await i.queryFeatures(a);
85
89
  } catch (d) {
86
- console.warn("Client-side query failed, falling back to server:", d), s = await i.queryFeatures(n);
90
+ console.warn("Client-side query failed, falling back to server:", d), r = await i.queryFeatures(a);
87
91
  }
88
92
  }
89
- const B = s.features.map((u) => u.attributes[y]), { attributes: C } = j(i, s, a.timeZone);
93
+ const C = r.features.map((u) => u.attributes[g]), { attributes: I } = D(i, r, n.timeZone);
90
94
  return {
91
95
  tool: "getTopFeatures",
92
96
  layerName: c,
93
97
  summary: `Top ${e.topCount} features extracted`,
94
98
  details: {
95
99
  topCount: e.topCount,
96
- attributes: C,
97
- objectIds: B,
98
- objectIdField: y,
99
- where: r.where,
100
+ attributes: I,
101
+ objectIds: C,
102
+ objectIdField: g,
103
+ where: o.where,
100
104
  orderByFields: e.orderByFields,
101
- ...w && { groupByFields: e.groupByFields }
105
+ ...F && { groupByFields: e.groupByFields }
102
106
  }
103
107
  };
104
- } catch (s) {
108
+ } catch (r) {
105
109
  return {
106
110
  tool: "getTopFeatures",
107
111
  layerName: c,
108
112
  summary: "Query failed",
109
- details: { error: s instanceof Error ? s.message : String(s) }
113
+ details: { error: r instanceof Error ? r.message : String(r) }
110
114
  };
111
115
  }
112
- }, W = async ({
113
- targetLayer: r,
116
+ }, V = async ({
117
+ targetLayer: o,
114
118
  topFilter: e,
115
- geometryFilter: a,
116
- useCurrentExtent: o
119
+ geometryFilter: n,
120
+ useCurrentExtent: s
117
121
  }, l) => {
118
- const { mapView: i } = E(l, ["mapView"]), p = $(
119
- a,
122
+ const { mapView: i } = U(l, ["mapView"]), p = E(
123
+ n,
120
124
  l.state?.agentExecutionContext?.sharedResources
121
- ), c = await U(r, e, i, p, o);
125
+ ), c = await A(o, e, i, p, s);
122
126
  return JSON.stringify(c, null, 2);
123
- }, A = t.object({
127
+ }, P = t.object({
124
128
  layerId: t.string().describe("The layerId of the layer containing the geometry by which to filter."),
125
129
  where: t.string().describe("The SQL-92 where clause representing the features from which to filter."),
126
130
  distance: t.number().optional().describe("The buffer distance around the geometry."),
127
- units: T.optional().describe("The units for the distance buffer.")
128
- }), V = t.object({
131
+ units: B.optional().describe("The units for the distance buffer.")
132
+ }), Y = t.object({
129
133
  point: t.object({
130
134
  x: t.number().describe("X coordinate (longitude) from navigation result"),
131
135
  y: t.number().describe("Y coordinate (latitude) from navigation result"),
@@ -134,8 +138,8 @@ const S = (r) => r.flatMap((e) => e.split(",")).map((e) => e.trim()).map((e) =>
134
138
  }).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")
135
139
  }).describe("Point coordinates from a previous navigation/geocoding result"),
136
140
  distance: t.number().optional().describe("Optional buffer distance around the point."),
137
- units: T.optional().describe("The units for the distance buffer.")
138
- }), P = t.object({
141
+ units: B.optional().describe("The units for the distance buffer.")
142
+ }), Z = t.object({
139
143
  targetLayer: t.object({
140
144
  layerId: t.string().describe("The layerId of the layer containing the field from which to get a value."),
141
145
  where: t.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value."),
@@ -146,7 +150,7 @@ const S = (r) => r.flatMap((e) => e.split(",")).map((e) => e.trim()).map((e) =>
146
150
  ).default("*")
147
151
  )
148
152
  }),
149
- geometryFilter: t.union([A, V, Q]).optional().describe(
153
+ geometryFilter: t.union([P, Y, $]).optional().describe(
150
154
  "Geometry filter for spatial queries. Use 'sharedResourceId' with an ID from listSharedResources for a previously geocoded location. Use 'point' for inline coordinates or 'layerId/where' for features from another layer."
151
155
  ),
152
156
  topFilter: t.object({
@@ -159,11 +163,11 @@ const S = (r) => r.flatMap((e) => e.split(",")).map((e) => e.trim()).map((e) =>
159
163
  useCurrentExtent: t.boolean().optional().describe(
160
164
  "Set to true ONLY when user explicitly asks about features 'in my view', 'on my map', 'I am looking at'. Default is false (queries entire layer)."
161
165
  )
162
- }), te = x(W, {
166
+ }), se = x(V, {
163
167
  name: "getTopFeatures",
164
168
  description: 'Returns top N features ranked by an existing field value. Use for "highest", "lowest", "latest", "earliest", "top N" questions where ranking is based on a field that already exists in the data (e.g., population, value, date, depth). Display all the features that meet the ranking criteria, including ties at the cutoff value. orderByFields must be actual field names with ASC/DESC. Do NOT use aggregate functions like COUNT(), SUM(), AVG() - those require getStatistics.',
165
- schema: P
169
+ schema: Z
166
170
  });
167
171
  export {
168
- te as getTopFeaturesTool
172
+ se as getTopFeaturesTool
169
173
  };
@@ -1,55 +1,59 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { tool as v } from "@langchain/core/tools";
3
- import { a as C } from "../../../../chunks/formatFeatureAttributes.js";
4
- import { g as R, i as F, a as I, s as G, r as O } from "../../../../chunks/resolveGeometryFilter.js";
2
+ import { tool as C } from "@langchain/core/tools";
3
+ import { a as R } from "../../../../chunks/formatFeatureAttributes.js";
4
+ import { g as O, i as S, a as I, s as G, r as N } from "../../../../chunks/resolveGeometryFilter.js";
5
5
  import { c as j, m as x } from "../../../../chunks/mergeWhereClauses.js";
6
+ import { f as W } from "../../../../chunks/resolveFieldNames.js";
6
7
  import t from "zod";
7
- import { f as N } from "../../../../chunks/fetchAgentContext.js";
8
+ import { f as B } from "../../../../chunks/fetchAgentContext.js";
8
9
  import { distanceUnitsSchema as q } from "../../shared/types.js";
9
- const p = 25, W = (i) => i.flatMap((r) => r.split(",")).map((r) => r.trim()).map((r) => r.split(/\s+/u)[0]?.replace(/^"|"$/gu, "")).filter((r) => !!r), B = async (i, r, e, l) => {
10
- const a = r.map?.allLayers.find((u) => u.id === i.layerId), d = await r.whenLayerView(a), f = a.title ?? i.layerId;
10
+ const p = 25, k = (i) => i.flatMap((r) => r.split(",")).map((r) => r.trim()).map((r) => r.split(/\s+/u)[0]?.replace(/^"|"$/gu, "")).filter((r) => !!r), D = async (i, r, e, l) => {
11
+ const s = r.map?.allLayers.find((u) => u.id === i.layerId), d = await r.whenLayerView(s), f = s.title ?? i.layerId;
11
12
  let h;
12
13
  if (e) {
13
- const u = await R(e, r);
14
+ const u = await O(e, r);
14
15
  if ("error" in u) {
15
- const s = { error: u.error };
16
- if (F(e)) {
16
+ const a = { error: u.error };
17
+ if (S(e)) {
17
18
  const c = r.map?.allLayers.find((y) => y.id === e.layerId);
18
- s.geometryLayerName = c?.title ?? c?.id, s.geometryLayerId = e.layerId, s.geometryWhere = e.where;
19
- } else I(e) && (s.point = e.point);
19
+ a.geometryLayerName = c?.title ?? c?.id, a.geometryLayerId = e.layerId, a.geometryWhere = e.where;
20
+ } else I(e) && (a.point = e.point);
20
21
  return {
21
22
  tool: "queryFeatures",
22
23
  layerName: f,
23
24
  summary: "Geometry lookup failed",
24
- details: s
25
+ details: a
25
26
  };
26
27
  }
27
28
  if (!u.geometry) {
28
- const s = {};
29
- if (F(e)) {
29
+ const a = {};
30
+ if (S(e)) {
30
31
  const c = r.map?.allLayers.find((y) => y.id === e.layerId);
31
- s.error = `No features found matching: ${e.where}`, s.geometryLayerName = c?.title ?? c?.id, s.geometryLayerId = e.layerId, s.geometryWhere = e.where;
32
- } else I(e) && (s.error = "Failed to create point geometry", s.point = e.point);
32
+ a.error = `No features found matching: ${e.where}`, a.geometryLayerName = c?.title ?? c?.id, a.geometryLayerId = e.layerId, a.geometryWhere = e.where;
33
+ } else I(e) && (a.error = "Failed to create point geometry", a.point = e.point);
33
34
  return {
34
35
  tool: "queryFeatures",
35
36
  layerName: f,
36
37
  summary: "No features found for geometry filter",
37
- details: s
38
+ details: a
38
39
  };
39
40
  }
40
41
  h = u.geometry;
41
42
  } else l && (h = r.extent.clone());
42
- const T = [
43
- .../* @__PURE__ */ new Set([...i.outFields, ...W(i.orderByFields)])
44
- ], b = j(d, T, l ?? !1), w = a.objectIdField, o = a.createQuery();
45
- o.where = x(a.definitionExpression, i.where || "1=1"), o.outFields = i.outFields.includes("*") ? ["*"] : [.../* @__PURE__ */ new Set([...i.outFields, w])], o.orderByFields = i.orderByFields, h && (o.geometry = h, o.spatialRelationship = "intersects"), e?.distance && (o.distance = e.distance), e?.units && (o.units = e.units), o.outSpatialReference = r.spatialReference;
43
+ const v = [
44
+ .../* @__PURE__ */ new Set([...i.outFields, ...k(i.orderByFields)])
45
+ ], b = j(d, v, l ?? !1), w = s.objectIdField, o = s.createQuery();
46
+ o.where = x(s.definitionExpression, i.where || "1=1"), o.outFields = i.outFields.includes("*") ? ["*"] : [.../* @__PURE__ */ new Set([...i.outFields, w])], o.orderByFields = i.orderByFields, h && (o.geometry = h, o.spatialRelationship = "intersects"), e?.distance && (o.distance = e.distance), e?.units && (o.units = e.units), o.outSpatialReference = r.spatialReference;
46
47
  let n, m;
47
48
  try {
48
- n = b ? await d.queryFeatureCount(o) : await a.queryFeatureCount(o), n > 0 && n <= p && (m = b ? await d.queryFeatures(o) : await a.queryFeatures(o));
49
+ n = b ? await d.queryFeatureCount(o) : await s.queryFeatureCount(o), n > 0 && n <= p && (m = b ? await d.queryFeatures(o) : await s.queryFeatures(o));
49
50
  } catch (u) {
50
- console.warn("Client-side query failed, falling back to server:", u), n = await a.queryFeatureCount(o), n > 0 && n <= p && (m = await a.queryFeatures(o));
51
+ console.warn("Client-side query failed, falling back to server:", u), n = await s.queryFeatureCount(o), n > 0 && n <= p && (m = await s.queryFeatures(o));
51
52
  }
52
- const { objectIds: g, attributes: S } = m ? C(a, m, r.timeZone) : { objectIds: void 0, attributes: void 0 };
53
+ const { objectIds: g, attributes: F } = m ? R(s, m, r.timeZone) : { objectIds: void 0, attributes: void 0 }, T = W(
54
+ i.outFields,
55
+ s.fields.map((u) => u.name)
56
+ );
53
57
  return {
54
58
  tool: "queryFeatures",
55
59
  layerName: f,
@@ -58,32 +62,32 @@ const p = 25, W = (i) => i.flatMap((r) => r.split(",")).map((r) => r.trim()).map
58
62
  totalCount: n,
59
63
  where: i.where,
60
64
  orderByFields: i.orderByFields,
61
- outFields: i.outFields,
65
+ outFields: T,
62
66
  ...g && { objectIds: g, objectIdField: w },
63
- ...S && { attributes: S },
67
+ ...F && { attributes: F },
64
68
  ...n > p && {
65
69
  note: `${n} features found.`
66
70
  }
67
71
  }
68
72
  };
69
73
  };
70
- async function k({
74
+ async function L({
71
75
  targetLayer: i,
72
76
  geometryFilter: r,
73
77
  useCurrentExtent: e
74
78
  }, l) {
75
- const { mapView: a } = N(l, ["mapView"]), d = O(
79
+ const { mapView: s } = B(l, ["mapView"]), d = N(
76
80
  r,
77
81
  l.state?.agentExecutionContext?.sharedResources
78
- ), f = await B(i, a, d, e);
82
+ ), f = await D(i, s, d, e);
79
83
  return JSON.stringify(f, null, 2);
80
84
  }
81
- const D = t.object({
85
+ const U = t.object({
82
86
  layerId: t.string().describe("The layerId of the layer containing the geometry by which to filter."),
83
87
  where: t.string().describe("The SQL-92 where clause representing the features from which to filter."),
84
88
  distance: t.number().optional().describe("The buffer distance around the geometry."),
85
89
  units: q.optional().describe("The units for the distance buffer.")
86
- }), L = t.object({
90
+ }), A = t.object({
87
91
  point: t.object({
88
92
  x: t.number().describe("X coordinate (longitude) from navigation result"),
89
93
  y: t.number().describe("Y coordinate (latitude) from navigation result"),
@@ -93,7 +97,7 @@ const D = t.object({
93
97
  }).describe("Point coordinates from a previous navigation/geocoding result"),
94
98
  distance: t.number().optional().describe("Optional buffer distance around the point."),
95
99
  units: q.optional().describe("The units for the distance buffer.")
96
- }), U = t.object({
100
+ }), E = t.object({
97
101
  targetLayer: t.object({
98
102
  layerId: t.string().describe("The layerId of the layer containing the field from which to get a value."),
99
103
  where: t.string().describe(
@@ -106,13 +110,13 @@ const D = t.object({
106
110
  ).default("*")
107
111
  )
108
112
  }),
109
- geometryFilter: t.union([D, L, G]).optional().describe(
113
+ geometryFilter: t.union([U, A, G]).optional().describe(
110
114
  "Geometry filter for spatial queries. Use 'sharedResourceId' with an ID from listSharedResources for a previously geocoded location. Use 'point' for inline coordinates or 'layerId/where' for features from another layer."
111
115
  ),
112
116
  useCurrentExtent: t.boolean().optional().describe(
113
117
  "Set to true ONLY when user explicitly asks about features 'in my view', 'on my map', 'I am looking at', OR when the user refers back to features previously identified using the current extent (e.g. 'these', 'those', 'them', 'the same ones'). Default is false (queries entire layer)."
114
118
  )
115
- }), X = v(k, {
119
+ }), K = C(L, {
116
120
  name: "queryFeatures",
117
121
  description: `Queries features from a layer. Returns the total count of matching features, plus individual feature attributes if ≤25 features match.
118
122
 
@@ -124,8 +128,8 @@ USE THIS TOOL FOR:
124
128
  - Any question where the user wants to SEE or COUNT matching features
125
129
 
126
130
  This is the DEFAULT tool for most queries. When in doubt, use this tool.`,
127
- schema: U
131
+ schema: E
128
132
  });
129
133
  export {
130
- X as queryFeaturesTool
134
+ K as queryFeaturesTool
131
135
  };
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a}from"./M7TMD2HP.js";import{a as t}from"./WSIZ2OTL.js";var l=async(i={})=>{let{modelTier:e="default",config:o}=i,{getChatAIUtilityServiceUrl:r}=await import("./4KFTUBFL.js").then(m=>m.default),{createAuthenticatedFetch:n}=await import("./OYHYHALE.js").then(m=>m.default.then(e=>({createAuthenticatedFetch:e}))),c=t[e],s=await r(e);return new a({modelName:c,apiKey:"dummy-key",useResponsesApi:!0,zdrEnabled:!0,configuration:{baseURL:s,fetch:await n({config:o,withCredentials:!0})}})};export{l as a};
2
+ import{a}from"./FJV7CI7O.js";import{a as t}from"./WSIZ2OTL.js";var l=async(i={})=>{let{modelTier:e="default",config:o}=i,{getChatAIUtilityServiceUrl:r}=await import("./4KFTUBFL.js").then(m=>m.default),{createAuthenticatedFetch:n}=await import("./OYHYHALE.js").then(m=>m.default.then(e=>({createAuthenticatedFetch:e}))),c=t[e],s=await r(e);return new a({modelName:c,apiKey:"dummy-key",useResponsesApi:!0,zdrEnabled:!0,configuration:{baseURL:s,fetch:await n({config:o,withCredentials:!0})}})};export{l as a};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as o}from"./FDOMMK2M.js";import{a as r}from"./OJP56R5R.js";import{Fa as a}from"./TRZJYWEB.js";var f=(l,i)=>{let t=Array.from(l.values()).find(({layerItem:e})=>e.title?.toLowerCase().includes(i.toLowerCase()));if(!t){let e=Array.from(l.values()).map(y=>y.layerItem.title).join(", ");return`Could not find a layer matching "${i}". Available layers: ${e}`}let s=Array.from(t.fieldRegistry.values()),n=s.map(e=>`- **${e.alias||e.name}** (\`${e.name}\`, ${e.type})${e.description?`: ${e.description}`:""}`).join(`
2
+ import{a as o}from"./FDOMMK2M.js";import{a as r}from"./RFPTOFM4.js";import{Ga as a}from"./FSLPYC4Y.js";var f=(l,i)=>{let t=Array.from(l.values()).find(({layerItem:e})=>e.title?.toLowerCase().includes(i.toLowerCase()));if(!t){let e=Array.from(l.values()).map(y=>y.layerItem.title).join(", ");return`Could not find a layer matching "${i}". Available layers: ${e}`}let s=Array.from(t.fieldRegistry.values()),n=s.map(e=>`- **${e.alias||e.name}** (\`${e.name}\`, ${e.type})${e.description?`: ${e.description}`:""}`).join(`
3
3
  `);return`**${t.layerItem.title}** has ${s.length} field(s):
4
4
 
5
5
  ${n}`},m=({layerTitle:l},i)=>{let t=o(i,"layersAndFieldsRegistry");return f(t,l)},u=a(m,{name:"listLayerFields",description:"Lists all fields for a given layer by title. Use ONLY when the user explicitly asks to see fields, columns, or attributes of a specific named layer. Do NOT call this tool for general help questions, capability overviews, or layer listing.",schema:r.object({layerTitle:r.string().describe("The title or partial title of the layer to list fields for.")})});export{u as a};