@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.
Files changed (147) hide show
  1. package/dist/agent-utils/LLMAgent.d.ts +5 -2
  2. package/dist/agent-utils/LLMAgent.js +1 -1
  3. package/dist/agentic-workflow/jsonTypes.d.ts +8 -1
  4. package/dist/agentic-workflow/nodes/AgentNode.d.ts +2 -0
  5. package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
  6. package/dist/cdn/253R5CBD.js +2 -0
  7. package/dist/cdn/2VBPA27M.js +18 -0
  8. package/dist/cdn/{DWYODVWW.js → 323DHVYA.js} +5 -5
  9. package/dist/cdn/34O57OGV.js +2 -0
  10. package/dist/cdn/{FSMHR7GK.js → 4HDDRBIY.js} +1 -1
  11. package/dist/cdn/4MFEKBKL.js +11 -0
  12. package/dist/cdn/{Y5UFOH54.js → 4NJ2FF7H.js} +1 -1
  13. package/dist/cdn/4YXYLX4H.js +2 -0
  14. package/dist/cdn/5DVRVY4L.js +2 -0
  15. package/dist/cdn/5PJXNTLZ.js +2 -0
  16. package/dist/cdn/5R6QUF5B.js +2 -0
  17. package/dist/cdn/5RVELJU4.js +36 -0
  18. package/dist/cdn/5WLNL4HZ.js +2 -0
  19. package/dist/cdn/66SKMECC.js +2 -0
  20. package/dist/cdn/6CLF7KIK.js +2 -0
  21. package/dist/cdn/{S6ZAQRC6.js → 6KFMRBAA.js} +1 -1
  22. package/dist/cdn/77QFSIWW.js +5 -0
  23. package/dist/cdn/7E2QMWK6.js +2 -0
  24. package/dist/cdn/{HO2YDJI2.js → 7M6VKBTK.js} +1 -1
  25. package/dist/cdn/{HJG7QM2R.js → 7VAQUCBU.js} +1 -1
  26. package/dist/cdn/ACJTJLZN.js +2 -0
  27. package/dist/cdn/AI6DYOKR.js +181 -0
  28. package/dist/cdn/AT4XVTJR.js +44 -0
  29. package/dist/cdn/BS2PFNU4.js +2 -0
  30. package/dist/cdn/CCC6LBMY.js +2 -0
  31. package/dist/cdn/CGXQAB3A.js +2 -0
  32. package/dist/cdn/{M3MRIGDZ.js → CP5BVGJU.js} +1 -1
  33. package/dist/cdn/CWD37QFT.js +2 -0
  34. package/dist/cdn/DY36ATOA.js +2 -0
  35. package/dist/cdn/DYASSC7Z.js +2 -0
  36. package/dist/cdn/EAEQONP7.js +2 -0
  37. package/dist/cdn/EMLOVMD4.js +2 -0
  38. package/dist/cdn/EWLXNGKH.js +208 -0
  39. package/dist/cdn/FAR3DFFK.js +2 -0
  40. package/dist/cdn/FDOMMK2M.js +2 -0
  41. package/dist/cdn/GRHIFCQX.js +2 -0
  42. package/dist/cdn/{S3XUYAUX.js → HHFNQR6Z.js} +1 -1
  43. package/dist/cdn/{WQKNV6KK.js → HMUWQCXU.js} +1 -1
  44. package/dist/cdn/HZ5ARNAM.js +2 -0
  45. package/dist/cdn/I6PD2HSL.js +2 -0
  46. package/dist/cdn/IDUC4CPV.js +2 -0
  47. package/dist/cdn/IRNSIUBT.js +2 -0
  48. package/dist/cdn/{OYNIFMCJ.js → J6SZIQJA.js} +1 -1
  49. package/dist/cdn/K335IAIE.js +2 -0
  50. package/dist/cdn/K33MZ726.js +2 -0
  51. package/dist/cdn/KA3FF3ZO.js +2 -0
  52. package/dist/cdn/{DBHLKLKM.js → KPO4XX6J.js} +1 -1
  53. package/dist/cdn/{I4L45WQS.js → L7XTRDFM.js} +1 -1
  54. package/dist/cdn/LCFIADOZ.js +2 -0
  55. package/dist/cdn/MDM2K3U7.js +2 -0
  56. package/dist/cdn/MM33KJPF.js +2 -0
  57. package/dist/cdn/NIY32GK2.js +2 -0
  58. package/dist/cdn/{3ZPPYCNL.js → ONMNQBPO.js} +1 -1
  59. package/dist/cdn/ONQ6JSBJ.js +2 -0
  60. package/dist/cdn/{6QJFOL6M.js → OWTGH34K.js} +1 -1
  61. package/dist/cdn/{XPTCV6YV.js → PSYRZMX2.js} +1 -1
  62. package/dist/cdn/Q4IQUEZN.js +14 -0
  63. package/dist/cdn/QNNGPA3Q.js +2 -0
  64. package/dist/cdn/QRHZXLZN.js +2 -0
  65. package/dist/cdn/QVOMX3R6.js +2 -0
  66. package/dist/cdn/QZ3NQTNQ.js +2 -0
  67. package/dist/cdn/RADWN4ZP.js +2 -0
  68. package/dist/cdn/RU2T7GUX.js +2 -0
  69. package/dist/cdn/S6OYR4VI.js +156 -0
  70. package/dist/cdn/T2GJLEYV.js +2 -0
  71. package/dist/cdn/TKYI5QRL.js +2 -0
  72. package/dist/cdn/{5SFZS2RD.js → TQXLSW4A.js} +2 -2
  73. package/dist/cdn/{NJJYZP3R.js → U6FBRUM4.js} +1 -1
  74. package/dist/cdn/UIXX3XEN.js +2 -0
  75. package/dist/cdn/UPWAOZXQ.js +2 -0
  76. package/dist/cdn/{5SF6DEMO.js → VNJMTA6O.js} +1 -1
  77. package/dist/cdn/VOKXKU7M.js +56 -0
  78. package/dist/cdn/{33BF35AO.js → VYTYVWR6.js} +4 -4
  79. package/dist/cdn/WMZ24LWS.js +2 -0
  80. package/dist/cdn/{JYVBCHR6.js → WP7ORLSB.js} +1 -1
  81. package/dist/cdn/WS3T73IY.js +2 -0
  82. package/dist/cdn/{UZL6UVE4.js → ZLWWWTH4.js} +1 -1
  83. package/dist/cdn/{PAUIFUMO.js → ZQMBJ6MI.js} +1 -1
  84. package/dist/cdn/agent-utils/index.js +1 -1
  85. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +1 -1
  86. package/dist/cdn/agent-utils/middlewares/middleware.js +1 -1
  87. package/dist/cdn/agent-utils/middlewares/trace.js +1 -1
  88. package/dist/cdn/index.js +1 -1
  89. package/dist/chunks/adapter.js +938 -1938
  90. package/dist/chunks/adapter10.js +21 -0
  91. package/dist/chunks/adapter11.js +30 -0
  92. package/dist/chunks/adapter12.js +22 -0
  93. package/dist/chunks/adapter13.js +22 -0
  94. package/dist/chunks/adapter14.js +109 -0
  95. package/dist/chunks/adapter15.js +40 -0
  96. package/dist/chunks/adapter16.js +154 -0
  97. package/dist/chunks/adapter17.js +141 -0
  98. package/dist/chunks/adapter18.js +127 -0
  99. package/dist/chunks/adapter2.js +52 -0
  100. package/dist/chunks/adapter3.js +30 -0
  101. package/dist/chunks/adapter4.js +50 -0
  102. package/dist/chunks/adapter5.js +27 -0
  103. package/dist/chunks/adapter6.js +24 -0
  104. package/dist/chunks/adapter7.js +26 -0
  105. package/dist/chunks/adapter8.js +21 -0
  106. package/dist/chunks/adapter9.js +42 -0
  107. package/dist/chunks/arcgisKnowledgeGraph.js +5 -5
  108. package/dist/chunks/dataExplorationGraph.js +30 -27
  109. package/dist/chunks/fetchAgentContext.js +13 -0
  110. package/dist/chunks/fetchService.js +10 -0
  111. package/dist/chunks/formatFeatureAttributes.js +132 -0
  112. package/dist/chunks/generateLayerDescriptions.js +145 -148
  113. package/dist/chunks/helpGraph.js +11 -9
  114. package/dist/chunks/layerStylingGraph.js +22 -21
  115. package/dist/chunks/mergeWhereClauses.js +15 -0
  116. package/dist/chunks/navigationGraph.js +68 -57
  117. package/dist/chunks/types.js +59 -0
  118. package/dist/components/arcgis-assistant-agent/customElement.js +404 -279
  119. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +15 -5
  120. package/dist/components/arcgis-assistant-help-agent/customElement.js +21 -5
  121. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +39 -22
  122. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +22 -5
  123. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +13 -5
  124. package/dist/docs/api.json +1 -1
  125. package/dist/docs/docs.json +1 -1
  126. package/dist/docs/web-types.json +1 -1
  127. package/dist/types/stencil.d.ts +2 -2
  128. package/dist/utils/index.d.ts +4 -5
  129. package/dist/utils/index.js +19 -20
  130. package/package.json +8 -8
  131. package/dist/cdn/55M2HE4U.js +0 -2
  132. package/dist/cdn/5RZGG4F2.js +0 -2
  133. package/dist/cdn/BAB3MK4Y.js +0 -2
  134. package/dist/cdn/BMBV6Y2A.js +0 -2
  135. package/dist/cdn/D3RKQSWS.js +0 -2
  136. package/dist/cdn/E7KEOJZG.js +0 -208
  137. package/dist/cdn/IGQFAL3H.js +0 -2
  138. package/dist/cdn/LUY6V4TP.js +0 -181
  139. package/dist/cdn/NSXX2KYS.js +0 -2
  140. package/dist/cdn/OFRFP4BX.js +0 -2
  141. package/dist/cdn/OUFGJV3R.js +0 -2
  142. package/dist/cdn/RWM5T4XB.js +0 -180
  143. package/dist/cdn/SRFLL6ET.js +0 -2
  144. package/dist/cdn/WDOM6Z5O.js +0 -18
  145. package/dist/cdn/WZFC5HUX.js +0 -56
  146. package/dist/cdn/Z4XUJQ2I.js +0 -36
  147. package/dist/cdn/ZJEWP2ND.js +0 -44
@@ -1,310 +1,72 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import de from "@arcgis/core/identity/IdentityManager.js";
3
- import k from "@arcgis/core/portal/Portal.js";
4
- import pe from "@arcgis/core/request.js";
5
- import { Annotation as T, messagesStateReducer as we } from "@langchain/langgraph/web";
2
+ import H from "@arcgis/core/identity/IdentityManager.js";
3
+ import P from "@arcgis/core/portal/Portal.js";
4
+ import J from "@arcgis/core/request.js";
5
+ import { Annotation as m, messagesStateReducer as ee } from "@langchain/langgraph/web";
6
6
  import "@arcgis/toolkit/string";
7
- import { i as De } from "./generateLayerDescriptions.js";
7
+ import { i as le } from "./generateLayerDescriptions.js";
8
8
  import "@langchain/core/messages";
9
9
  import "@langchain/core/callbacks/dispatch/web";
10
10
  import "@langchain/openai";
11
- import Z from "@arcgis/core/config.js";
12
- import * as Pe from "@arcgis/core/core/reactiveUtils.js";
11
+ import "@arcgis/core/config.js";
12
+ import * as ce from "@arcgis/core/core/reactiveUtils.js";
13
13
  import "@arcgis/core/layers/FeatureLayer.js";
14
14
  import "@langchain/core/prompts";
15
- import { b as Ae, a as K } from "./baseAgentState.js";
16
- import { tool as f } from "@langchain/core/tools";
17
- import Le from "@arcgis/core/Graphic.js";
18
- import { addressToLocations as je } from "@arcgis/core/rest/locator.js";
19
- import Ge from "@arcgis/core/symbols/PictureMarkerSymbol.js";
20
- import s, { z as E } from "zod";
21
- import Oe from "@arcgis/core/geometry/Extent.js";
22
- import be from "@arcgis/core/geometry/Point.js";
23
- import { createRenderer as Me } from "@arcgis/core/smartMapping/renderers/pieChart.js";
24
- import { getSchemesByTag as Qe, getSchemes as Ve } from "@arcgis/core/smartMapping/symbology/pieChart.js";
25
- import { getBackgroundColorTheme as me } from "@arcgis/core/views/support/colorUtils.js";
26
- import { a as $, s as R } from "./index.js";
27
- import { createAgeRenderer as _e, createContinuousRenderer as We } from "@arcgis/core/smartMapping/renderers/color.js";
28
- import { getSchemesByTag as ie } from "@arcgis/core/smartMapping/symbology/color.js";
29
- import { createContinuousRenderer as Be } from "@arcgis/core/smartMapping/renderers/univariateColorSize.js";
30
- import { createRenderer as Ue } from "@arcgis/core/smartMapping/renderers/dotDensity.js";
31
- import { getSchemesByTag as Ke } from "@arcgis/core/smartMapping/symbology/dotDensity.js";
32
- import { createRenderer as He } from "@arcgis/core/smartMapping/renderers/heatmap.js";
33
- import { getSchemesByTag as Je } from "@arcgis/core/smartMapping/symbology/heatmap.js";
34
- import { createRenderer as Ye } from "@arcgis/core/smartMapping/renderers/predominance.js";
35
- import { getSchemesByTag as Ze } from "@arcgis/core/smartMapping/symbology/predominance.js";
36
- import { createRenderer as Xe } from "@arcgis/core/smartMapping/renderers/relationship.js";
37
- import { getSchemesByTag as et } from "@arcgis/core/smartMapping/symbology/relationship.js";
38
- import { createAgeRenderer as tt, createContinuousRenderer as rt } from "@arcgis/core/smartMapping/renderers/size.js";
39
- import { createRenderer as at } from "@arcgis/core/smartMapping/renderers/type.js";
40
- import { getSchemesByTag as ot } from "@arcgis/core/smartMapping/symbology/type.js";
41
- import { ToolNode as nt } from "@langchain/langgraph/prebuilt";
42
- import it from "@arcgis/core/layers/support/FeatureEffect.js";
43
- import Te from "@arcgis/core/layers/support/FeatureFilter.js";
44
- import * as st from "@arcgis/core/geometry/operators/unionOperator.js";
45
- import { formatDateOnly as lt, convertDateFormatToIntlOptions as Q, formatTimeOnly as ct, formatDate as he } from "@arcgis/core/intl.js";
46
- import ut from "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
47
- import dt from "@arcgis/core/smartMapping/statistics/uniqueValues.js";
48
- import pt from "@arcgis/core/rest/support/TopFeaturesQuery.js";
49
- import mt from "@arcgis/core/rest/support/TopFilter.js";
50
- import ht from "@arcgis/core/WebLinkChart.js";
51
- import Se from "@arcgis/core/rest/knowledgeGraph/GraphQueryStreaming.js";
15
+ import { b as pe, a as G } from "./baseAgentState.js";
16
+ import c from "zod";
17
+ import { tool as g } from "@langchain/core/tools";
18
+ import { createRenderer as de } from "@arcgis/core/smartMapping/renderers/pieChart.js";
19
+ import { getSchemesByTag as ue, getSchemes as he } from "@arcgis/core/smartMapping/symbology/pieChart.js";
20
+ import { getBackgroundColorTheme as Y } from "@arcgis/core/views/support/colorUtils.js";
21
+ import { a as S, s as T } from "./index.js";
22
+ import { createAgeRenderer as ye, createContinuousRenderer as me } from "@arcgis/core/smartMapping/renderers/color.js";
23
+ import { getSchemesByTag as V } from "@arcgis/core/smartMapping/symbology/color.js";
24
+ import { createContinuousRenderer as ge } from "@arcgis/core/smartMapping/renderers/univariateColorSize.js";
25
+ import { createRenderer as fe } from "@arcgis/core/smartMapping/renderers/dotDensity.js";
26
+ import { getSchemesByTag as we } from "@arcgis/core/smartMapping/symbology/dotDensity.js";
27
+ import { createRenderer as be } from "@arcgis/core/smartMapping/renderers/heatmap.js";
28
+ import { getSchemesByTag as Te } from "@arcgis/core/smartMapping/symbology/heatmap.js";
29
+ import { createRenderer as Se } from "@arcgis/core/smartMapping/renderers/predominance.js";
30
+ import { getSchemesByTag as ve } from "@arcgis/core/smartMapping/symbology/predominance.js";
31
+ import { createRenderer as Re } from "@arcgis/core/smartMapping/renderers/relationship.js";
32
+ import { getSchemesByTag as xe } from "@arcgis/core/smartMapping/symbology/relationship.js";
33
+ import { createAgeRenderer as Ce, createContinuousRenderer as $e } from "@arcgis/core/smartMapping/renderers/size.js";
34
+ import { createRenderer as Pe } from "@arcgis/core/smartMapping/renderers/type.js";
35
+ import { getSchemesByTag as Ee } from "@arcgis/core/smartMapping/symbology/type.js";
36
+ import { ToolNode as ze } from "@langchain/langgraph/prebuilt";
37
+ import { clearFiltersTool as ke } from "./adapter12.js";
38
+ import { resetMapTool as Ae } from "./adapter13.js";
39
+ import { setFeatureEffectTool as qe } from "./adapter14.js";
40
+ import { getAttributeTool as Me } from "./adapter15.js";
41
+ import { getStatisticsTool as Ne } from "./adapter16.js";
42
+ import { getTopFeaturesTool as De } from "./adapter17.js";
43
+ import { queryFeaturesTool as Le } from "./adapter18.js";
44
+ import Ge from "@arcgis/core/WebLinkChart.js";
45
+ import re from "@arcgis/core/rest/knowledgeGraph/GraphQueryStreaming.js";
52
46
  import "@arcgis/core/views/LinkChartView.js";
53
- import { fetchKnowledgeGraph as ye, executeQueryStreaming as yt, executeSearchStreaming as ft } from "@arcgis/core/rest/knowledgeGraphService.js";
54
- import gt from "@arcgis/core/rest/knowledgeGraph/GraphSearchStreaming.js";
55
- import { getBindParametersFromCypherQuery as wt } from "@arcgis/core/applications/KnowledgeStudio/generalSharedKgUtils.js";
56
- const A = (e, t) => t ?? e, Nn = T.Root({
57
- ...Ae(),
47
+ import { fetchKnowledgeGraph as Z, executeQueryStreaming as je, executeSearchStreaming as Fe } from "@arcgis/core/rest/knowledgeGraphService.js";
48
+ import _e from "@arcgis/core/rest/knowledgeGraph/GraphSearchStreaming.js";
49
+ import { getBindParametersFromCypherQuery as Qe } from "@arcgis/core/applications/KnowledgeStudio/generalSharedKgUtils.js";
50
+ const k = (e, t) => t ?? e, va = m.Root({
51
+ ...pe(),
58
52
  // internal to the navigation agent
59
- intent: T({
60
- reducer: A
53
+ intent: m({
54
+ reducer: k
61
55
  }),
62
- vectorSearchLayerResults: T({
63
- reducer: A,
56
+ vectorSearchLayerResults: m({
57
+ reducer: k,
64
58
  default: () => []
65
59
  }),
66
- vectorSearchFieldResults: T({
67
- reducer: A
60
+ vectorSearchFieldResults: m({
61
+ reducer: k
68
62
  }),
69
- navigationInternalState: T({
70
- reducer: A,
63
+ navigationInternalState: m({
64
+ reducer: k,
71
65
  default: () => ({
72
66
  toolCallMessage: void 0
73
67
  })
74
68
  })
75
- });
76
- async function bt(e, t) {
77
- const a = k.getDefault().helperServices, o = a.geocode.find((m) => m.name === "ArcGIS World Geocoding Service") ?? a.geocode[0];
78
- if (!o)
79
- throw new Error("No geocoding service found in helperServices.");
80
- const n = o.url, l = `${Z.assetsPath?.endsWith("/") ? Z.assetsPath : `${Z.assetsPath}/`}esri/images/search/search-symbol-32.png`, c = (await je(n, {
81
- address: { SingleLine: e },
82
- outFields: ["Match_addr"]
83
- }))?.[0];
84
- if (!c?.extent || !c.location)
85
- throw new Error(`Could not find location for: ${e}`);
86
- const u = new Ge({
87
- url: l,
88
- width: 24,
89
- height: 24
90
- }), d = new Le({
91
- geometry: c.location,
92
- symbol: u
93
- });
94
- t.graphics.removeAll(), t.graphics.add(d), await t.goTo(c.extent);
95
- const p = {
96
- address: c.address ?? "",
97
- location: c.location ? c.location.toJSON() : null,
98
- extent: c.extent ? c.extent.toJSON() : null
99
- };
100
- return {
101
- text: `Successfully zoomed to ${e}.`,
102
- sharedStatePatch: { lastResolvedLocation: { value: p } }
103
- };
104
- }
105
- function v(e, t) {
106
- const a = e?.configurable?.context;
107
- if (!a || typeof a != "object")
108
- throw new Error("Agent context missing");
109
- const o = t.filter((n) => !(n in a));
110
- if (o.length)
111
- throw new Error(`Agent context missing: ${o.join(", ")}`);
112
- return a;
113
- }
114
- async function Tt({ address: e }, t) {
115
- const { mapView: r } = v(t, ["mapView"]);
116
- return await bt(e, r);
117
- }
118
- const St = s.object({
119
- address: s.string().describe("The full address or place name to locate.")
120
- }), In = f(Tt, {
121
- name: "goToAddress",
122
- description: "Geocodes an address using Esri's World Geocoding Service and zooms the map to that location.",
123
- schema: St
124
- });
125
- async function vt(e, t) {
126
- const a = t.map.bookmarks;
127
- if (!a || a.length === 0)
128
- throw new Error("No bookmarks found in the map.");
129
- const o = a.find((l) => l.name === e);
130
- if (!o)
131
- throw new Error(`Bookmark with name "${e}" not found.`);
132
- const n = o.viewpoint;
133
- if (!n)
134
- throw new Error(`Bookmark with name "${e}" does not have a valid viewpoint.`);
135
- return await t.goTo(n), { text: `Navigated to bookmark: ${e}` };
136
- }
137
- async function xt({ bookmarkName: e }, t) {
138
- const { mapView: r } = v(t, ["mapView"]);
139
- return await Promise.resolve(vt(e, r));
140
- }
141
- const Rt = E.object({
142
- bookmarkName: E.string().describe("The name of the bookmark to navigate to.")
143
- }), qn = f(xt, {
144
- name: "goToBookmark",
145
- description: "Go to the extent of the bookmark with the given name.",
146
- schema: Rt
147
- });
148
- async function $t(e, t, r) {
149
- const a = r.map?.allLayers.find((l) => l.id === e);
150
- if (!a)
151
- return { text: `Error: Layer with id ${e} not found` };
152
- const o = t?.trim() ? t : "1=1", n = a.createQuery();
153
- n.where = o;
154
- try {
155
- const { extent: l, count: i } = await a.queryExtent(n);
156
- if (i === 0)
157
- return { text: `No features found in ${a.title} matching: ${o}`, where: o };
158
- if (l)
159
- await r.goTo(l);
160
- else
161
- return { text: `Error: Unable to determine extent for ${a.title}`, where: o };
162
- const c = {
163
- layerId: e,
164
- layerTitle: a.title ?? e,
165
- where: o,
166
- count: i
167
- };
168
- return {
169
- text: `Successfully zoomed to ${i} feature(s) in ${a.title} matching: ${o}`,
170
- where: o,
171
- sharedStatePatch: { lastNavigatedFeatures: { value: c } }
172
- };
173
- } catch (l) {
174
- return console.error("Error in goToFeatures:", l), { text: `Error: ${l instanceof Error ? l.message : "Unknown error"}`, where: o };
175
- }
176
- }
177
- async function Ct({ layerId: e, where: t }, r) {
178
- const { mapView: a } = v(r, ["mapView"]);
179
- return await $t(e, t, a);
180
- }
181
- const Et = E.object({
182
- layerId: E.string().describe("The layerId of the layer to zoom to."),
183
- where: E.string().describe(
184
- "ArcGIS SQL-92 WHERE expression used for `query.where` on the selected layer. Start with a fresh filter for the current request unless the task explicitly refers to prior results. Use only field name values from the selected layer, not aliases. Use field metadata only to interpret intent: prefer LIKE '%value%' for string fields, and use =, <, >, BETWEEN, IN, IS NULL, AND/OR/NOT as appropriate for number/date fields. For coded-value domain fields, use the domain code already provided in layerInfo.domain.codedValues, never the display label. Respect range-domain bounds when they are provided. Do NOT include subqueries, nested SELECT, JOIN, GROUP BY, HAVING, ORDER BY, or semicolons."
185
- )
186
- }), zn = f(Ct, {
187
- name: "goToFeatures",
188
- description: "Go to the features that match the given filter for the given layerId. Use coded-value domain codes from layer field metadata when building the WHERE clause.",
189
- schema: Et
190
- });
191
- async function Ft(e) {
192
- const r = new Oe({
193
- xmin: -180,
194
- ymin: -90,
195
- xmax: 180,
196
- ymax: 90,
197
- spatialReference: { wkid: 4326 }
198
- }).expand(0.7);
199
- return await e.goTo(r), { text: "Successfully zoomed to world extent" };
200
- }
201
- async function kt(e, t) {
202
- const { mapView: r } = v(t, ["mapView"]);
203
- return await Ft(r);
204
- }
205
- const Nt = E.object({}), Dn = f(kt, {
206
- name: "goToFullExtent",
207
- description: "Zooms the map to the full world extent using Esri's Geocoding Service.",
208
- schema: Nt
209
- });
210
- async function It(e) {
211
- const r = e.map.initialViewProperties?.viewpoint?.targetGeometry;
212
- if (r)
213
- await e.goTo(r);
214
- else
215
- throw new Error("Initial extent is undefined");
216
- return { text: "Successfully zoomed to home extent" };
217
- }
218
- async function qt(e, t) {
219
- const { mapView: r } = v(t, ["mapView"]);
220
- return await It(r);
221
- }
222
- const zt = s.object({}), Pn = f(qt, {
223
- name: "goToHomeExtent",
224
- description: "Go to the initial web map view extent",
225
- schema: zt
226
- });
227
- async function Dt(e, t) {
228
- await t.when();
229
- const r = t.map?.allLayers.find((o) => o.id === e);
230
- if (!r)
231
- return console.warn(`[goToLayer] No matching FeatureLayer found for: ${e}`), { text: `Could not find layer for: ${e}` };
232
- let a;
233
- return (r.type === "link-chart" || r.type === "knowledge-graph-sublayer") && t.map?.activeLinkChartLayer ? a = t.map.diagramNodesExtent : a = r.fullExtent, a ? (await t.goTo(a), r.visible = !0, { text: `Successfully zoomed to: ${r.title ?? ""}` }) : { text: "Layer has no defined extent. Cannot zoom to layer." };
234
- }
235
- async function Pt({ layerId: e }, t) {
236
- const { mapView: r } = v(t, ["mapView"]);
237
- return await Dt(e, r);
238
- }
239
- const At = E.object({
240
- layerId: E.string().describe("The id of the layer to navigate to")
241
- }), An = f(Pt, {
242
- name: "goToLayer",
243
- description: "Zooms the map view to the full extent of the top matching layer.",
244
- schema: At
245
- });
246
- async function Lt(e, t) {
247
- return await t.goTo({ scale: e }), { text: `Successfully zoomed to: ${e}` };
248
- }
249
- async function jt({ scale: e }, t) {
250
- const { mapView: r } = v(t, ["mapView"]);
251
- return await Lt(e, r);
252
- }
253
- const Gt = s.object({
254
- scale: s.number().describe("The map scale of the view to go to.")
255
- }), Ln = f(jt, {
256
- name: "goToScale",
257
- description: "Go to the specified view scale.",
258
- schema: Gt
259
- });
260
- async function Ot(e, t, r) {
261
- const o = {
262
- target: new be({
263
- longitude: e.longitude,
264
- latitude: e.latitude,
265
- spatialReference: { wkid: 4326 }
266
- })
267
- };
268
- return r?.zoom !== void 0 && (o.zoom = r.zoom), r?.scale !== void 0 && (o.scale = r.scale), await t.goTo(o), { text: `Successfully navigated to: ${[
269
- `(${e.latitude}°, ${e.longitude}°)`,
270
- r?.zoom !== void 0 ? `zoom ${r.zoom}` : "",
271
- r?.scale !== void 0 ? `scale 1:${r.scale}` : ""
272
- ].filter(Boolean).join(", ")}` };
273
- }
274
- async function Mt({
275
- center: e,
276
- zoom: t,
277
- scale: r
278
- }, a) {
279
- const { mapView: o } = v(a, ["mapView"]);
280
- return await Ot(e, o, { zoom: t, scale: r });
281
- }
282
- const Qt = s.object({
283
- center: s.object({
284
- longitude: s.number().describe("The longitude (x-coordinate) of the point to navigate to."),
285
- latitude: s.number().describe("The latitude (y-coordinate) of the point to navigate to.")
286
- }),
287
- zoom: s.number().optional().describe("The zoom level. Higher values = more zoomed in."),
288
- scale: s.number().optional().describe("The map scale. Alternative to zoom. Smaller numbers = more zoomed in.")
289
- }), jn = f(Mt, {
290
- name: "goToViewpoint",
291
- description: "Go to the specified viewpoint. This can contain a combination of scale, center, zoom, etc.",
292
- schema: Qt
293
- });
294
- async function Vt(e, t) {
295
- return await t.goTo({ zoom: e }), { text: `Successfully zoomed to: ${e}` };
296
- }
297
- async function _t({ zoom: e }, t) {
298
- const { mapView: r } = v(t, ["mapView"]);
299
- return await Vt(e, r);
300
- }
301
- const Wt = s.object({
302
- zoom: s.number().min(1).max(20).describe("The zoom level of the view to go to.")
303
- }), Gn = f(_t, {
304
- name: "goToZoom",
305
- description: 'Go to the specified zoom level. If input is generic (e.g. "zoom in", then only zoom to the next appropriate level - increase level for zooming in and decrease for zooming out.).',
306
- schema: Wt
307
- }), fe = /* @__PURE__ */ Object.assign({
69
+ }), X = /* @__PURE__ */ Object.assign({
308
70
  "../agents/arcgisKnowledge/prompts/arcgis_knowledge_current_lc_context.md": () => import("./arcgis_knowledge_current_lc_context.js").then((e) => e.default),
309
71
  "../agents/arcgisKnowledge/prompts/arcgis_knowledge_current_map_context.md": () => import("./arcgis_knowledge_current_map_context.js").then((e) => e.default),
310
72
  "../agents/arcgisKnowledge/prompts/arcgis_knowledge_cypher_query_prompt.md": () => import("./arcgis_knowledge_cypher_query_prompt.js").then((e) => e.default),
@@ -319,115 +81,110 @@ const Wt = s.object({
319
81
  "../agents/navigation/prompts/navigation_intent_prompt.md": () => import("./navigation_intent_prompt.js").then((e) => e.default),
320
82
  "../agents/navigation/prompts/navigation_tool_prompt.md": () => import("./navigation_tool_prompt.js").then((e) => e.default)
321
83
  });
322
- async function W(e) {
323
- const t = Object.entries(fe).find(([r]) => r.endsWith(`/${e}.md`));
84
+ async function L(e) {
85
+ const t = Object.entries(X).find(([r]) => r.endsWith(`/${e}.md`));
324
86
  if (!t)
325
87
  throw new Error(`Prompt not found: ${e}
326
88
  Available prompts:
327
- ${Object.keys(fe).join(`
89
+ ${Object.keys(X).join(`
328
90
  `)}`);
329
91
  return await t[1]();
330
92
  }
331
- const Bt = (e, t = 300) => {
93
+ const Ie = (e, t = 300) => {
332
94
  const r = e.replace(/\s+/gu, " ").replace(/[*_`#>\-]/gu, "").trim();
333
95
  return r.length > t ? `${r.slice(0, t)}...` : r;
334
- }, ve = (e, t) => {
335
- const a = e?.configurable?.services?.[t];
336
- if (a == null)
337
- throw new Error(`${t} missing in config.configurable.services`);
338
- return a;
339
- }, On = (e, t) => (r, a) => {
96
+ }, Ra = (e, t) => (r, a) => {
340
97
  const o = a?.configurable?.services;
341
- for (const n of e)
342
- if (!o?.[n])
343
- throw new Error(`${t} requires services.${n} to be available.`);
98
+ for (const i of e)
99
+ if (!o?.[i])
100
+ throw new Error(`${t} requires services.${i} to be available.`);
344
101
  return r;
345
102
  };
346
- async function Ut(e) {
347
- const { fields: t, layer: r, view: a, styleName: o, colorSchemeTags: n } = e;
348
- let l;
349
- return n ? l = Qe({
350
- basemapTheme: await me(a),
103
+ async function Oe(e) {
104
+ const { fields: t, layer: r, view: a, styleName: o, colorSchemeTags: i } = e;
105
+ let s;
106
+ return i ? s = ue({
107
+ basemapTheme: await Y(a),
351
108
  geometryType: r.geometryType,
352
- includedTags: n,
109
+ includedTags: i,
353
110
  numColors: Math.min(t.length, 8)
354
- })[0] : l = Ve({
355
- basemapTheme: await me(a),
111
+ })[0] : s = he({
112
+ basemapTheme: await Y(a),
356
113
  geometryType: r.geometryType,
357
114
  numColors: Math.min(t.length, 8)
358
115
  }).primaryScheme, {
359
116
  layer: r,
360
117
  view: a,
361
- attributes: t.map((i) => ({
362
- field: i,
363
- label: r.fields.find((c) => c.name === i)?.alias ?? ""
118
+ attributes: t.map((n) => ({
119
+ field: n,
120
+ label: r.fields.find((l) => l.name === n)?.alias ?? ""
364
121
  })).slice(0, 8),
365
122
  outlineOptimizationEnabled: !0,
366
123
  sizeOptimizationEnabled: !0,
367
124
  includeSizeVariable: o.includes("Size"),
368
- pieChartScheme: l
125
+ pieChartScheme: s
369
126
  };
370
127
  }
371
- async function Kt(e) {
372
- return await Me(e);
128
+ async function Ke(e) {
129
+ return await de(e);
373
130
  }
374
- async function Ht({
131
+ async function Ve({
375
132
  arcgisMap: e,
376
133
  arcgisMapView: t,
377
134
  layerId: r,
378
135
  fields: a,
379
136
  colorSchemes: o,
380
- includeSize: n
137
+ includeSize: i
381
138
  }) {
382
- const l = t, i = e?.allLayers.find((d) => d.id === r);
383
- if (!i)
139
+ const s = t, n = e?.allLayers.find((d) => d.id === r);
140
+ if (!n)
384
141
  return `Could not find layer for id: ${r}`;
385
- const u = {
386
- styleName: n ? "chart-size" : "chart",
142
+ const p = {
143
+ styleName: i ? "chart-size" : "chart",
387
144
  fields: a,
388
- layer: i,
389
- view: l,
145
+ layer: n,
146
+ view: s,
390
147
  colorSchemeTags: o
391
148
  };
392
149
  try {
393
- const d = await Ut(u), p = await Kt(d);
394
- return i.renderer = p.renderer, i.visible = !0, `Chart renderer applied to layer: ${i.title ?? i.id} using fields ${a.join(", ")}`;
150
+ const d = await Oe(p), u = await Ke(d);
151
+ return n.renderer = u.renderer, n.visible = !0, `Chart renderer applied to layer: ${n.title ?? n.id} using fields ${a.join(", ")}`;
395
152
  } catch (d) {
396
153
  return `Error applying chart renderer: ${d instanceof Error ? d.message : String(d)}`;
397
154
  }
398
155
  }
399
- const Jt = ["mapView"];
400
- function C(e) {
156
+ const We = ["mapView"];
157
+ function v(e) {
401
158
  const r = e?.configurable?.context;
402
159
  if (!r || typeof r != "object")
403
160
  throw new Error("LayerStylingAgent context missing");
404
- const a = Jt.filter((o) => !(o in r));
161
+ const a = We.filter((o) => !(o in r));
405
162
  if (a.length)
406
163
  throw new Error(`LayerStylingAgent context missing: ${a.join(", ")}`);
407
164
  return r;
408
165
  }
409
- async function Yt({
166
+ async function Be({
410
167
  layerId: e,
411
168
  fields: t,
412
169
  colorSchemes: r,
413
170
  includeSize: a
414
171
  }, o) {
415
- const { mapView: n } = C(o);
416
- return await $({ type: "show-legend", data: { layerIds: [e] } }, o), await Ht({
417
- arcgisMap: n.map,
418
- arcgisMapView: n,
172
+ const { mapView: i } = v(o);
173
+ return await S({ type: "show-legend", data: { layerIds: [e] } }, o), await Ve({
174
+ arcgisMap: i.map,
175
+ arcgisMapView: i,
419
176
  layerId: e,
420
177
  fields: t,
421
178
  colorSchemes: r,
422
179
  includeSize: a
423
180
  });
424
181
  }
425
- const Zt = s.object({
426
- layerId: s.string().describe("The id of the layer to apply the chart renderer to"),
427
- fields: s.array(s.string()).describe("The fields to use for the chart renderer (multiple numeric fields)"),
428
- colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
429
- includeSize: s.boolean().optional().describe("Whether to vary the chart size (chart-size)")
430
- }), Mn = f(Yt, {
182
+ const Ue = c.object({
183
+ layerId: c.string().describe("The id of the layer to apply the chart renderer to"),
184
+ fields: c.array(c.string()).describe("The fields to use for the chart renderer (multiple numeric fields)"),
185
+ colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
186
+ includeSize: c.boolean().optional().describe("Whether to vary the chart size (chart-size)")
187
+ }), xa = g(Be, {
431
188
  name: "chart",
432
189
  description: `Label: Charts
433
190
  Description: Show the values of two or more categories as a proportion of the total using a pie chart.
@@ -440,246 +197,246 @@ const Zt = s.object({
440
197
  Keywords: pie, chart, all categories, breakdown, proportion, total, amount, how much, sum, graduated size, proportional size
441
198
  Example: Show the total number of homes built in each decade using a pie chart for each feature and vary the size of each chart based on the total of all categories.
442
199
  Fields: This style requires 2-8 number fields.`,
443
- schema: Zt
200
+ schema: Ue
444
201
  });
445
- function Xt(e) {
446
- const { fields: t, layer: r, view: a, theme: o, colorSchemeTags: n } = e, l = t[0];
447
- let i;
448
- return n && (i = ie({
202
+ function He(e) {
203
+ const { fields: t, layer: r, view: a, theme: o, colorSchemeTags: i } = e, s = t[0];
204
+ let n;
205
+ return i && (n = V({
449
206
  geometryType: r.geometryType,
450
- includedTags: n,
207
+ includedTags: i,
451
208
  theme: o || "high-to-low"
452
209
  })[0]), {
453
210
  layer: r,
454
211
  view: a,
455
- startTime: l,
212
+ startTime: s,
456
213
  endTime: /* @__PURE__ */ new Date(),
457
214
  theme: o,
458
215
  sizeOptimizationEnabled: !0,
459
216
  outlineOptimizationEnabled: !0,
460
- colorScheme: i
217
+ colorScheme: n
461
218
  };
462
219
  }
463
- async function er(e) {
464
- return await _e(e);
220
+ async function Je(e) {
221
+ return await ye(e);
465
222
  }
466
- async function tr({
223
+ async function Ye({
467
224
  arcgisMap: e,
468
225
  arcgisMapView: t,
469
226
  layerId: r,
470
227
  fields: a,
471
228
  colorSchemes: o,
472
- theme: n
229
+ theme: i
473
230
  }) {
474
- const l = t, i = e?.allLayers.find((u) => u.id === r);
475
- if (!i)
231
+ const s = t, n = e?.allLayers.find((p) => p.id === r);
232
+ if (!n)
476
233
  return `Could not find layer for id: ${r}`;
477
- const c = {
234
+ const l = {
478
235
  styleName: "color-age",
479
236
  fields: a,
480
- layer: i,
481
- view: l,
237
+ layer: n,
238
+ view: s,
482
239
  colorSchemeTags: o,
483
- theme: n
240
+ theme: i
484
241
  };
485
242
  try {
486
- const u = Xt(c), d = await er(u);
487
- return i.renderer = d.renderer, i.visible = !0, `Color-age renderer applied to layer: ${i.title ?? i.id} using fields ${a.join(", ")}`;
488
- } catch (u) {
489
- return `Error applying color-age renderer: ${u instanceof Error ? u.message : String(u)}`;
243
+ const p = He(l), d = await Je(p);
244
+ return n.renderer = d.renderer, n.visible = !0, `Color-age renderer applied to layer: ${n.title ?? n.id} using fields ${a.join(", ")}`;
245
+ } catch (p) {
246
+ return `Error applying color-age renderer: ${p instanceof Error ? p.message : String(p)}`;
490
247
  }
491
248
  }
492
- async function rr({
249
+ async function Ze({
493
250
  layerId: e,
494
251
  fields: t,
495
252
  colorSchemes: r,
496
253
  theme: a
497
254
  }, o) {
498
- const { mapView: n } = C(o);
499
- return await $({ type: "show-legend", data: { layerIds: [e] } }, o), await tr({
500
- arcgisMap: n.map,
501
- arcgisMapView: n,
255
+ const { mapView: i } = v(o);
256
+ return await S({ type: "show-legend", data: { layerIds: [e] } }, o), await Ye({
257
+ arcgisMap: i.map,
258
+ arcgisMapView: i,
502
259
  layerId: e,
503
260
  fields: t,
504
261
  colorSchemes: r,
505
262
  theme: a
506
263
  });
507
264
  }
508
- const ar = s.object({
509
- layerId: s.string().describe("The id of the layer to apply the color-age renderer to"),
510
- fields: s.array(s.string()).describe("The field(s) to use for the color-age renderer (temporal/date data)"),
511
- colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
512
- theme: s.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color ramp")
513
- }), Qn = f(rr, {
265
+ const Xe = c.object({
266
+ layerId: c.string().describe("The id of the layer to apply the color-age renderer to"),
267
+ fields: c.array(c.string()).describe("The field(s) to use for the color-age renderer (temporal/date data)"),
268
+ colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
269
+ theme: c.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color ramp")
270
+ }), Ca = g(Ze, {
514
271
  name: "color-age",
515
272
  description: `Label: Age (color)
516
273
  Description: Use colors along a continuous color ramp to represent the age of features. Age reflects the length of time from a start date to an end date.
517
274
  Keywords: since, age, how old, how long
518
275
  Example: Show the age of each feature based on its reported date.
519
276
  Fields: This style requires at least one field with a date type.`,
520
- schema: ar
277
+ schema: Xe
521
278
  });
522
- function or(e) {
279
+ function er(e) {
523
280
  const { fields: t, layer: r, view: a, colorSchemeTags: o } = e;
524
- let { theme: n } = e, l = t[1];
525
- const i = t[0];
526
- let c;
527
- return o && (c = ie({
281
+ let { theme: i } = e, s = t[1];
282
+ const n = t[0];
283
+ let l;
284
+ return o && (l = V({
528
285
  geometryType: r.geometryType,
529
286
  includedTags: o,
530
- theme: n || "high-to-low"
287
+ theme: i || "high-to-low"
531
288
  })[0]), {
532
289
  layer: r,
533
290
  view: a,
534
- field: i,
535
- normalizationField: l,
536
- theme: n,
291
+ field: n,
292
+ normalizationField: s,
293
+ theme: i,
537
294
  sizeOptimizationEnabled: !0,
538
295
  outlineOptimizationEnabled: !0,
539
- colorScheme: c
296
+ colorScheme: l
540
297
  };
541
298
  }
542
- async function nr(e) {
543
- return await We(e);
299
+ async function rr(e) {
300
+ return await me(e);
544
301
  }
545
- async function ir({
302
+ async function tr({
546
303
  arcgisMap: e,
547
304
  arcgisMapView: t,
548
305
  layerId: r,
549
306
  fields: a,
550
307
  colorSchemes: o,
551
- theme: n
308
+ theme: i
552
309
  }) {
553
- const l = t, i = e?.allLayers.find((u) => u.id === r);
554
- if (!i)
310
+ const s = t, n = e?.allLayers.find((p) => p.id === r);
311
+ if (!n)
555
312
  return `Could not find layer for id: ${r}`;
556
- const c = {
313
+ const l = {
557
314
  styleName: "color",
558
315
  fields: a,
559
- layer: i,
560
- view: l,
316
+ layer: n,
317
+ view: s,
561
318
  colorSchemeTags: o,
562
- theme: n
319
+ theme: i
563
320
  };
564
321
  try {
565
- const u = or(c), d = await nr(u);
566
- return i.renderer = d.renderer, i.visible = !0, `Color renderer applied to layer: ${i.title ?? i.id} using fields ${a.join(", ")}`;
567
- } catch (u) {
568
- return `Error applying color renderer: ${u instanceof Error ? u.message : String(u)}`;
322
+ const p = er(l), d = await rr(p);
323
+ return n.renderer = d.renderer, n.visible = !0, `Color renderer applied to layer: ${n.title ?? n.id} using fields ${a.join(", ")}`;
324
+ } catch (p) {
325
+ return `Error applying color renderer: ${p instanceof Error ? p.message : String(p)}`;
569
326
  }
570
327
  }
571
- async function sr({
328
+ async function ar({
572
329
  layerId: e,
573
330
  fields: t,
574
331
  colorSchemes: r,
575
332
  theme: a
576
333
  }, o) {
577
- const { mapView: n } = C(o);
578
- return await $({ type: "show-legend", data: { layerIds: [e] } }, o), await ir({
579
- arcgisMap: n.map,
580
- arcgisMapView: n,
334
+ const { mapView: i } = v(o);
335
+ return await S({ type: "show-legend", data: { layerIds: [e] } }, o), await tr({
336
+ arcgisMap: i.map,
337
+ arcgisMapView: i,
581
338
  layerId: e,
582
339
  fields: t,
583
340
  colorSchemes: r,
584
341
  theme: a
585
342
  });
586
343
  }
587
- const lr = s.object({
588
- layerId: s.string().describe("The id of the layer to apply the color renderer to"),
589
- fields: s.array(s.string()).describe("The field(s) to use for the color renderer"),
590
- colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
591
- theme: s.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color ramp")
592
- }), Vn = f(sr, {
344
+ const or = c.object({
345
+ layerId: c.string().describe("The id of the layer to apply the color renderer to"),
346
+ fields: c.array(c.string()).describe("The field(s) to use for the color renderer"),
347
+ colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
348
+ theme: c.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color ramp")
349
+ }), $a = g(ar, {
593
350
  name: "color",
594
351
  description: `Label: Counts and Amounts (color)
595
352
  Description: Vary color along a continuous color ramp to represent numeric or ranked data.
596
353
  Keywords: graduated color, choropleth, continuous color, hue, color, gradation, saturation, lightness, percent, rate, ratio, index, how much, increase, decrease
597
354
  Example: Color each feature based on the population density.
598
355
  Fields: This style requires a single field with a number type. A second number field may be specified for normalizing the value of the first field.`,
599
- schema: lr
356
+ schema: or
600
357
  });
601
- function cr(e) {
602
- const { fields: t, layer: r, view: a, colorSchemeTags: o, theme: n } = e;
603
- let l, i;
604
- const c = t[0];
605
- return o && (i = ie({
358
+ function nr(e) {
359
+ const { fields: t, layer: r, view: a, colorSchemeTags: o, theme: i } = e;
360
+ let s, n;
361
+ const l = t[0];
362
+ return o && (n = V({
606
363
  geometryType: r.geometryType,
607
364
  includedTags: o,
608
- theme: n || "high-to-low"
365
+ theme: i || "high-to-low"
609
366
  })[0]), {
610
367
  layer: r,
611
368
  view: a,
612
- field: c,
613
- normalizationField: l,
614
- theme: n,
369
+ field: l,
370
+ normalizationField: s,
371
+ theme: i,
615
372
  colorOptions: {
616
- colorScheme: i
373
+ colorScheme: n
617
374
  }
618
375
  };
619
376
  }
620
- async function ur(e) {
621
- return await Be(e);
377
+ async function ir(e) {
378
+ return await ge(e);
622
379
  }
623
- async function dr({
380
+ async function sr({
624
381
  arcgisMap: e,
625
382
  arcgisMapView: t,
626
383
  layerId: r,
627
384
  fields: a,
628
385
  colorSchemes: o,
629
- theme: n
386
+ theme: i
630
387
  }) {
631
- const l = t, i = e?.allLayers.find((u) => u.id === r);
632
- if (!i)
388
+ const s = t, n = e?.allLayers.find((p) => p.id === r);
389
+ if (!n)
633
390
  return `Could not find layer for id: ${r}`;
634
- const c = {
391
+ const l = {
635
392
  styleName: "color-size-univariate",
636
393
  fields: a,
637
- layer: i,
638
- view: l,
394
+ layer: n,
395
+ view: s,
639
396
  colorSchemeTags: o,
640
- theme: n
397
+ theme: i
641
398
  };
642
399
  try {
643
- const u = cr(c), d = await ur(u);
644
- return i.renderer = d.renderer, i.visible = !0, `Color-size-univariate renderer applied to layer: ${i.title ?? i.id} using fields ${a.join(", ")}`;
645
- } catch (u) {
646
- return `Error applying color-size-univariate renderer: ${u instanceof Error ? u.message : String(u)}`;
400
+ const p = nr(l), d = await ir(p);
401
+ return n.renderer = d.renderer, n.visible = !0, `Color-size-univariate renderer applied to layer: ${n.title ?? n.id} using fields ${a.join(", ")}`;
402
+ } catch (p) {
403
+ return `Error applying color-size-univariate renderer: ${p instanceof Error ? p.message : String(p)}`;
647
404
  }
648
405
  }
649
- async function pr({
406
+ async function lr({
650
407
  layerId: e,
651
408
  fields: t,
652
409
  colorSchemes: r,
653
410
  theme: a
654
411
  }, o) {
655
- const { mapView: n } = C(o);
656
- return await $({ type: "show-legend", data: { layerIds: [e] } }, o), await dr({
657
- arcgisMap: n.map,
658
- arcgisMapView: n,
412
+ const { mapView: i } = v(o);
413
+ return await S({ type: "show-legend", data: { layerIds: [e] } }, o), await sr({
414
+ arcgisMap: i.map,
415
+ arcgisMapView: i,
659
416
  layerId: e,
660
417
  fields: t,
661
418
  colorSchemes: r,
662
419
  theme: a
663
420
  });
664
421
  }
665
- const mr = s.object({
666
- layerId: s.string().describe("The id of the layer to apply the color-size univariate renderer to"),
667
- fields: s.array(s.string()).describe("The fields to use for the color-size univariate renderer"),
668
- colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
669
- theme: s.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color and size ramps")
670
- }), _n = f(pr, {
422
+ const cr = c.object({
423
+ layerId: c.string().describe("The id of the layer to apply the color-size univariate renderer to"),
424
+ fields: c.array(c.string()).describe("The fields to use for the color-size univariate renderer"),
425
+ colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
426
+ theme: c.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color and size ramps")
427
+ }), Pa = g(lr, {
671
428
  name: "color-size-univariate",
672
429
  description: `Label: Color and Size (univariate)
673
430
  Description: Vary symbol size and color based on the values of two numeric attributes.
674
431
  Keywords: continuous color, hue, color, size, gradation, saturation, lightness, percent, rate, ratio, index, how much, increase, decrease, amount
675
432
  Example: Color each feature based on the percentage of the population that owns a home and vary the size of each point based on total population.
676
433
  Fields: This style requires at least two fields: one determining the color of each feature, the other determining the size of each feature. Each field may be normalized by an additional normalization field.`,
677
- schema: mr
434
+ schema: cr
678
435
  });
679
- function hr(e) {
436
+ function pr(e) {
680
437
  const { fields: t, layer: r, view: a, colorSchemeTags: o } = e;
681
- let n;
682
- return o && (n = Ke({
438
+ let i;
439
+ return o && (i = we({
683
440
  includedTags: o,
684
441
  numColors: Math.min(t.length, 8)
685
442
  })[0]), {
@@ -688,48 +445,48 @@ function hr(e) {
688
445
  legendOptions: {
689
446
  unit: "units"
690
447
  },
691
- attributes: t.map((l) => ({
692
- field: l,
693
- label: r.fields.find((i) => i.name === l)?.alias ?? ""
448
+ attributes: t.map((s) => ({
449
+ field: s,
450
+ label: r.fields.find((n) => n.name === s)?.alias ?? ""
694
451
  })).slice(0, 8),
695
452
  outlineOptimizationEnabled: !0,
696
- dotDensityScheme: n
453
+ dotDensityScheme: i
697
454
  };
698
455
  }
699
- async function yr(e) {
700
- return await Ue(e);
456
+ async function dr(e) {
457
+ return await fe(e);
701
458
  }
702
- async function fr({
459
+ async function ur({
703
460
  arcgisMap: e,
704
461
  arcgisMapView: t,
705
462
  layerId: r,
706
463
  fields: a,
707
464
  colorSchemes: o
708
465
  }) {
709
- const n = t, l = e?.allLayers.find((c) => c.id === r);
710
- if (!l)
466
+ const i = t, s = e?.allLayers.find((l) => l.id === r);
467
+ if (!s)
711
468
  return `Could not find layer for id: ${r}`;
712
- const i = {
469
+ const n = {
713
470
  styleName: "dot-density",
714
471
  fields: a,
715
- layer: l,
716
- view: n,
472
+ layer: s,
473
+ view: i,
717
474
  colorSchemeTags: o
718
475
  };
719
476
  try {
720
- const c = hr(i), u = await yr(c);
721
- return l.renderer = u.renderer, l.visible = !0, `Dot Density renderer applied to layer: ${l.title ?? l.id} using fields ${a.join(", ")}`;
722
- } catch (c) {
723
- return `Error applying dot density renderer: ${c instanceof Error ? c.message : String(c)}`;
477
+ const l = pr(n), p = await dr(l);
478
+ return s.renderer = p.renderer, s.visible = !0, `Dot Density renderer applied to layer: ${s.title ?? s.id} using fields ${a.join(", ")}`;
479
+ } catch (l) {
480
+ return `Error applying dot density renderer: ${l instanceof Error ? l.message : String(l)}`;
724
481
  }
725
482
  }
726
- async function gr({
483
+ async function hr({
727
484
  layerId: e,
728
485
  fields: t,
729
486
  colorSchemes: r
730
487
  }, a) {
731
- const { mapView: o } = C(a);
732
- return await $({ type: "show-legend", data: { layerIds: [e] } }, a), await fr({
488
+ const { mapView: o } = v(a);
489
+ return await S({ type: "show-legend", data: { layerIds: [e] } }, a), await ur({
733
490
  arcgisMap: o.map,
734
491
  arcgisMapView: o,
735
492
  layerId: e,
@@ -737,11 +494,11 @@ async function gr({
737
494
  colorSchemes: r
738
495
  });
739
496
  }
740
- const wr = s.object({
741
- layerId: s.string().describe("The id of the layer to apply the dot density renderer to"),
742
- fields: s.array(s.string()).describe("The field(s) to use for the dot density renderer (population or count data)"),
743
- colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use")
744
- }), Wn = f(gr, {
497
+ const yr = c.object({
498
+ layerId: c.string().describe("The id of the layer to apply the dot density renderer to"),
499
+ fields: c.array(c.string()).describe("The field(s) to use for the dot density renderer (population or count data)"),
500
+ colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use")
501
+ }), Ea = g(hr, {
745
502
  name: "dot-density",
746
503
  description: `Dot Density
747
504
  Use dot density to visualize the distribution of one attribute or compare the density of multiple attributes. This is only valid for polygon layers.
@@ -755,56 +512,56 @@ const wr = s.object({
755
512
  - Display demographic patterns within census tracts
756
513
  **Fields:** Requires 2-8 number fields.
757
514
  **Keywords:** density, how much, how many, total, number, amount`,
758
- schema: wr
515
+ schema: yr
759
516
  });
760
- function br(e) {
517
+ function mr(e) {
761
518
  const { fields: t, layer: r, view: a, colorSchemeTags: o } = e;
762
- let n;
763
- const l = t[0];
764
- return o && (n = Je({
519
+ let i;
520
+ const s = t[0];
521
+ return o && (i = Te({
765
522
  includedTags: o,
766
523
  basemap: a.map?.basemap || "topo"
767
524
  })[0]), {
768
525
  layer: r,
769
526
  view: a,
770
- field: l,
771
- heatmapScheme: n
527
+ field: s,
528
+ heatmapScheme: i
772
529
  };
773
530
  }
774
- async function Tr(e) {
775
- return await He(e);
531
+ async function gr(e) {
532
+ return await be(e);
776
533
  }
777
- async function Sr({
534
+ async function fr({
778
535
  arcgisMap: e,
779
536
  arcgisMapView: t,
780
537
  layerId: r,
781
538
  fields: a,
782
539
  colorSchemes: o
783
540
  }) {
784
- const n = t, l = e?.allLayers.find((c) => c.id === r);
785
- if (!l)
541
+ const i = t, s = e?.allLayers.find((l) => l.id === r);
542
+ if (!s)
786
543
  return `Could not find layer for id: ${r}`;
787
- const i = {
544
+ const n = {
788
545
  styleName: "heatmap",
789
546
  fields: a,
790
- layer: l,
791
- view: n,
547
+ layer: s,
548
+ view: i,
792
549
  colorSchemeTags: o
793
550
  };
794
551
  try {
795
- const c = br(i), u = await Tr(c);
796
- return l.renderer = u.renderer, l.visible = !0, `Heatmap renderer applied to layer: ${l.title ?? l.id} using fields ${a.join(", ")}`;
797
- } catch (c) {
798
- return `Error applying heatmap renderer: ${c instanceof Error ? c.message : String(c)}`;
552
+ const l = mr(n), p = await gr(l);
553
+ return s.renderer = p.renderer, s.visible = !0, `Heatmap renderer applied to layer: ${s.title ?? s.id} using fields ${a.join(", ")}`;
554
+ } catch (l) {
555
+ return `Error applying heatmap renderer: ${l instanceof Error ? l.message : String(l)}`;
799
556
  }
800
557
  }
801
- async function vr({
558
+ async function wr({
802
559
  layerId: e,
803
560
  fields: t,
804
561
  colorSchemes: r
805
562
  }, a) {
806
- const { mapView: o } = C(a);
807
- return await $({ type: "show-legend", data: { layerIds: [e] } }, a), await Sr({
563
+ const { mapView: o } = v(a);
564
+ return await S({ type: "show-legend", data: { layerIds: [e] } }, a), await fr({
808
565
  arcgisMap: o.map,
809
566
  arcgisMapView: o,
810
567
  layerId: e,
@@ -812,86 +569,86 @@ async function vr({
812
569
  colorSchemes: r
813
570
  });
814
571
  }
815
- const xr = s.object({
816
- layerId: s.string().describe("The id of the layer to apply the heatmap renderer to"),
817
- fields: s.array(s.string()).describe("The field(s) to use for the heatmap renderer (typically point density)"),
818
- colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use")
819
- }), Bn = f(vr, {
572
+ const br = c.object({
573
+ layerId: c.string().describe("The id of the layer to apply the heatmap renderer to"),
574
+ fields: c.array(c.string()).describe("The field(s) to use for the heatmap renderer (typically point density)"),
575
+ colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use")
576
+ }), za = g(wr, {
820
577
  name: "heatmap",
821
578
  description: `Label: Heat Map
822
579
  Description: Show areas of high density with colors that appear to glow hotter. This is only valid for point layers.
823
580
  Keywords: density, heatmap, hot spots, pattern, cluster
824
581
  Example: Create a heatmap
825
582
  Fields: This typically requires zero or one field of type number.`,
826
- schema: xr
583
+ schema: br
827
584
  });
828
- function Rr(e) {
829
- const { fields: t, layer: r, view: a, styleName: o, colorSchemeTags: n } = e;
830
- let l;
831
- return n && (l = Ze({
585
+ function Tr(e) {
586
+ const { fields: t, layer: r, view: a, styleName: o, colorSchemeTags: i } = e;
587
+ let s;
588
+ return i && (s = ve({
832
589
  geometryType: r.geometryType,
833
- includedTags: n,
590
+ includedTags: i,
834
591
  numColors: Math.min(t.length, 10)
835
592
  })[0]), {
836
593
  layer: r,
837
594
  view: a,
838
- fields: t.map((i) => ({ name: i })).slice(0, 9),
595
+ fields: t.map((n) => ({ name: n })).slice(0, 9),
839
596
  outlineOptimizationEnabled: !0,
840
597
  sizeOptimizationEnabled: !0,
841
598
  includeSizeVariable: o.includes("Size"),
842
- predominanceScheme: l
599
+ predominanceScheme: s
843
600
  };
844
601
  }
845
- async function $r(e) {
846
- return await Ye(e);
602
+ async function Sr(e) {
603
+ return await Se(e);
847
604
  }
848
- async function Cr({
605
+ async function vr({
849
606
  arcgisMap: e,
850
607
  arcgisMapView: t,
851
608
  layerId: r,
852
609
  fields: a,
853
610
  colorSchemes: o,
854
- includeSize: n
611
+ includeSize: i
855
612
  }) {
856
- const l = t, i = e?.allLayers.find((d) => d.id === r);
857
- if (!i)
613
+ const s = t, n = e?.allLayers.find((d) => d.id === r);
614
+ if (!n)
858
615
  return `Could not find layer for id: ${r}`;
859
- const u = {
860
- styleName: n ? "predominance-size" : "predominance",
616
+ const p = {
617
+ styleName: i ? "predominance-size" : "predominance",
861
618
  fields: a,
862
- layer: i,
863
- view: l,
619
+ layer: n,
620
+ view: s,
864
621
  colorSchemeTags: o
865
622
  };
866
623
  try {
867
- const d = Rr(u), p = await $r(d);
868
- return i.renderer = p.renderer, i.visible = !0, `Predominance renderer applied to layer: ${i.title ?? i.id} using fields ${a.join(", ")}`;
624
+ const d = Tr(p), u = await Sr(d);
625
+ return n.renderer = u.renderer, n.visible = !0, `Predominance renderer applied to layer: ${n.title ?? n.id} using fields ${a.join(", ")}`;
869
626
  } catch (d) {
870
627
  return `Error applying predominance renderer: ${d instanceof Error ? d.message : String(d)}`;
871
628
  }
872
629
  }
873
- async function Er({
630
+ async function Rr({
874
631
  layerId: e,
875
632
  fields: t,
876
633
  colorSchemes: r,
877
634
  includeSize: a
878
635
  }, o) {
879
- const { mapView: n } = C(o);
880
- return await $({ type: "show-legend", data: { layerIds: [e] } }, o), await Cr({
881
- arcgisMap: n.map,
882
- arcgisMapView: n,
636
+ const { mapView: i } = v(o);
637
+ return await S({ type: "show-legend", data: { layerIds: [e] } }, o), await vr({
638
+ arcgisMap: i.map,
639
+ arcgisMapView: i,
883
640
  layerId: e,
884
641
  fields: t,
885
642
  colorSchemes: r,
886
643
  includeSize: a
887
644
  });
888
645
  }
889
- const Fr = s.object({
890
- layerId: s.string().describe("The id of the layer to apply the predominance renderer to"),
891
- fields: s.array(s.string()).describe("The fields to use for the predominance renderer (competing categories)"),
892
- colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
893
- includeSize: s.boolean().optional().describe("Whether to include size visualization (predominance-size)")
894
- }), Un = f(Er, {
646
+ const xr = c.object({
647
+ layerId: c.string().describe("The id of the layer to apply the predominance renderer to"),
648
+ fields: c.array(c.string()).describe("The fields to use for the predominance renderer (competing categories)"),
649
+ colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
650
+ includeSize: c.boolean().optional().describe("Whether to include size visualization (predominance-size)")
651
+ }), ka = g(Rr, {
895
652
  name: "predominance",
896
653
  description: `Label: Predominant category
897
654
  Description: Compare attributes that share a common subject and unit of measurement to see which has the highest value.
@@ -904,63 +661,63 @@ const Fr = s.object({
904
661
  Keywords: predominant, winner, won, competing, most, most common, most frequent, dominant, prevalent, top, amount, total, how much, proportional size, graduated size, sum
905
662
  Example: Show the predominant crop in each area and vary the size of each symbol based on the total of all categories.
906
663
  Fields: This style relies on 2-10 number fields.`,
907
- schema: Fr
664
+ schema: xr
908
665
  });
909
- function kr(e) {
666
+ function Cr(e) {
910
667
  const { fields: t, layer: r, view: a, colorSchemeTags: o } = e;
911
- let n;
912
- const l = {
668
+ let i;
669
+ const s = {
913
670
  field: t[0]
914
- }, i = {
671
+ }, n = {
915
672
  field: t[1]
916
673
  };
917
- return o && (n = et({
674
+ return o && (i = xe({
918
675
  geometryType: r.geometryType,
919
676
  includedTags: o
920
677
  })[0]), {
921
678
  layer: r,
922
679
  view: a,
923
- field1: l,
924
- field2: i,
680
+ field1: s,
681
+ field2: n,
925
682
  outlineOptimizationEnabled: !0,
926
683
  sizeOptimizationEnabled: !0,
927
- relationshipScheme: n
684
+ relationshipScheme: i
928
685
  };
929
686
  }
930
- async function Nr(e) {
931
- return await Xe(e);
687
+ async function $r(e) {
688
+ return await Re(e);
932
689
  }
933
- async function Ir({
690
+ async function Pr({
934
691
  arcgisMap: e,
935
692
  arcgisMapView: t,
936
693
  layerId: r,
937
694
  fields: a,
938
695
  colorSchemes: o
939
696
  }) {
940
- const n = t, l = e?.allLayers.find((c) => c.id === r);
941
- if (!l)
697
+ const i = t, s = e?.allLayers.find((l) => l.id === r);
698
+ if (!s)
942
699
  return `Could not find layer for id: ${r}`;
943
- const i = {
700
+ const n = {
944
701
  styleName: "relationship",
945
702
  fields: a,
946
- layer: l,
947
- view: n,
703
+ layer: s,
704
+ view: i,
948
705
  colorSchemeTags: o
949
706
  };
950
707
  try {
951
- const c = kr(i), u = await Nr(c);
952
- return l.renderer = u.renderer, l.visible = !0, `Relationship renderer applied to layer: ${l.title ?? l.id} using fields ${a.join(", ")}`;
953
- } catch (c) {
954
- return `Error applying relationship renderer: ${c instanceof Error ? c.message : String(c)}`;
708
+ const l = Cr(n), p = await $r(l);
709
+ return s.renderer = p.renderer, s.visible = !0, `Relationship renderer applied to layer: ${s.title ?? s.id} using fields ${a.join(", ")}`;
710
+ } catch (l) {
711
+ return `Error applying relationship renderer: ${l instanceof Error ? l.message : String(l)}`;
955
712
  }
956
713
  }
957
- async function qr({
714
+ async function Er({
958
715
  layerId: e,
959
716
  fields: t,
960
717
  colorSchemes: r
961
718
  }, a) {
962
- const { mapView: o } = C(a);
963
- return await $({ type: "show-legend", data: { layerIds: [e] } }, a), await Ir({
719
+ const { mapView: o } = v(a);
720
+ return await S({ type: "show-legend", data: { layerIds: [e] } }, a), await Pr({
964
721
  arcgisMap: o.map,
965
722
  arcgisMapView: o,
966
723
  layerId: e,
@@ -968,11 +725,11 @@ async function qr({
968
725
  colorSchemes: r
969
726
  });
970
727
  }
971
- const zr = s.object({
972
- layerId: s.string().describe("The id of the layer to apply the relationship renderer to"),
973
- fields: s.array(s.string()).describe("The two fields to use for the relationship renderer (bivariate visualization)"),
974
- colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use")
975
- }), Kn = f(qr, {
728
+ const zr = c.object({
729
+ layerId: c.string().describe("The id of the layer to apply the relationship renderer to"),
730
+ fields: c.array(c.string()).describe("The two fields to use for the relationship renderer (bivariate visualization)"),
731
+ colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use")
732
+ }), Aa = g(Er, {
976
733
  name: "relationship",
977
734
  description: `Label: Relationship
978
735
  Description: Overlays two color ramps to represent the relationship between two numeric attributes.
@@ -981,142 +738,142 @@ const zr = s.object({
981
738
  Fields: This style requires two number fields.`,
982
739
  schema: zr
983
740
  });
984
- function Dr(e) {
985
- const { fields: t, layer: r, view: a, theme: o } = e, n = t[0];
741
+ function kr(e) {
742
+ const { fields: t, layer: r, view: a, theme: o } = e, i = t[0];
986
743
  return {
987
744
  layer: r,
988
745
  view: a,
989
- startTime: n,
746
+ startTime: i,
990
747
  endTime: /* @__PURE__ */ new Date(),
991
748
  theme: o,
992
749
  sizeOptimizationEnabled: !0,
993
750
  outlineOptimizationEnabled: !0
994
751
  };
995
752
  }
996
- async function Pr(e) {
997
- return await tt(e);
753
+ async function Ar(e) {
754
+ return await Ce(e);
998
755
  }
999
- async function Ar({
756
+ async function qr({
1000
757
  arcgisMap: e,
1001
758
  arcgisMapView: t,
1002
759
  layerId: r,
1003
760
  fields: a,
1004
761
  colorSchemes: o,
1005
- theme: n
762
+ theme: i
1006
763
  }) {
1007
- const l = t, i = e?.allLayers.find((u) => u.id === r);
1008
- if (!i)
764
+ const s = t, n = e?.allLayers.find((p) => p.id === r);
765
+ if (!n)
1009
766
  return `Could not find layer for id: ${r}`;
1010
- const c = {
767
+ const l = {
1011
768
  styleName: "size-age",
1012
769
  fields: a,
1013
- layer: i,
1014
- view: l,
770
+ layer: n,
771
+ view: s,
1015
772
  colorSchemeTags: o,
1016
- theme: n
773
+ theme: i
1017
774
  };
1018
775
  try {
1019
- const u = Dr(c), d = await Pr(u);
1020
- return i.renderer = d.renderer, i.visible = !0, `Size-age renderer applied to layer: ${i.title ?? i.id} using fields ${a.join(", ")}`;
1021
- } catch (u) {
1022
- return `Error applying size-age renderer: ${u instanceof Error ? u.message : String(u)}`;
776
+ const p = kr(l), d = await Ar(p);
777
+ return n.renderer = d.renderer, n.visible = !0, `Size-age renderer applied to layer: ${n.title ?? n.id} using fields ${a.join(", ")}`;
778
+ } catch (p) {
779
+ return `Error applying size-age renderer: ${p instanceof Error ? p.message : String(p)}`;
1023
780
  }
1024
781
  }
1025
- async function Lr({
782
+ async function Mr({
1026
783
  layerId: e,
1027
784
  fields: t,
1028
785
  colorSchemes: r,
1029
786
  theme: a
1030
787
  }, o) {
1031
- const { mapView: n } = C(o);
1032
- return await $({ type: "show-legend", data: { layerIds: [e] } }, o), await Ar({
1033
- arcgisMap: n.map,
1034
- arcgisMapView: n,
788
+ const { mapView: i } = v(o);
789
+ return await S({ type: "show-legend", data: { layerIds: [e] } }, o), await qr({
790
+ arcgisMap: i.map,
791
+ arcgisMapView: i,
1035
792
  layerId: e,
1036
793
  fields: t,
1037
794
  colorSchemes: r,
1038
795
  theme: a
1039
796
  });
1040
797
  }
1041
- const jr = s.object({
1042
- layerId: s.string().describe("The id of the layer to apply the size-age renderer to"),
1043
- fields: s.array(s.string()).describe("The field(s) to use for the size-age renderer (temporal data with size)"),
1044
- colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
1045
- theme: s.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the size ramp")
1046
- }), Hn = f(Lr, {
798
+ const Nr = c.object({
799
+ layerId: c.string().describe("The id of the layer to apply the size-age renderer to"),
800
+ fields: c.array(c.string()).describe("The field(s) to use for the size-age renderer (temporal data with size)"),
801
+ colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
802
+ theme: c.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the size ramp")
803
+ }), qa = g(Mr, {
1047
804
  name: "size-age",
1048
805
  description: `Label: Age (size)
1049
806
  Description: Vary symbol sizes along a continuous ramp to represent the age of features. Age reflects the length of time from a start date to an end date.
1050
807
  Keywords: since, age, how old, how long
1051
808
  Example: Change the size of features so older features are larger than new features.
1052
809
  Fields: This style requires at least one field with a date type.`,
1053
- schema: jr
810
+ schema: Nr
1054
811
  });
1055
- function Gr(e) {
812
+ function Dr(e) {
1056
813
  const { fields: t, layer: r, view: a } = e;
1057
- let { theme: o } = e, n = t[1];
1058
- const l = t[0];
814
+ let { theme: o } = e, i = t[1];
815
+ const s = t[0];
1059
816
  return {
1060
817
  layer: r,
1061
818
  view: a,
1062
- field: l,
1063
- normalizationField: n,
819
+ field: s,
820
+ normalizationField: i,
1064
821
  theme: o,
1065
822
  sizeOptimizationEnabled: !0,
1066
823
  outlineOptimizationEnabled: !0
1067
824
  };
1068
825
  }
1069
- async function Or(e) {
1070
- return await rt(e);
826
+ async function Lr(e) {
827
+ return await $e(e);
1071
828
  }
1072
- async function Mr({
829
+ async function Gr({
1073
830
  arcgisMap: e,
1074
831
  arcgisMapView: t,
1075
832
  layerId: r,
1076
833
  fields: a,
1077
834
  colorSchemes: o,
1078
- theme: n
835
+ theme: i
1079
836
  }) {
1080
- const l = t, i = e?.allLayers.find((u) => u.id === r);
1081
- if (!i)
837
+ const s = t, n = e?.allLayers.find((p) => p.id === r);
838
+ if (!n)
1082
839
  return `Could not find layer for id: ${r}`;
1083
- const c = {
840
+ const l = {
1084
841
  styleName: "size",
1085
842
  fields: a,
1086
- layer: i,
1087
- view: l,
843
+ layer: n,
844
+ view: s,
1088
845
  colorSchemeTags: o,
1089
- theme: n
846
+ theme: i
1090
847
  };
1091
848
  try {
1092
- const u = Gr(c), d = await Or(u);
1093
- return i.renderer = d.renderer, i.visible = !0, `Size renderer applied to layer: ${i.title ?? i.id} using fields ${a.join(", ")}`;
1094
- } catch (u) {
1095
- return `Error applying size renderer: ${u instanceof Error ? u.message : String(u)}`;
849
+ const p = Dr(l), d = await Lr(p);
850
+ return n.renderer = d.renderer, n.visible = !0, `Size renderer applied to layer: ${n.title ?? n.id} using fields ${a.join(", ")}`;
851
+ } catch (p) {
852
+ return `Error applying size renderer: ${p instanceof Error ? p.message : String(p)}`;
1096
853
  }
1097
854
  }
1098
- async function Qr({
855
+ async function jr({
1099
856
  layerId: e,
1100
857
  fields: t,
1101
858
  colorSchemes: r,
1102
859
  theme: a
1103
860
  }, o) {
1104
- const { mapView: n } = C(o);
1105
- return await $({ type: "show-legend", data: { layerIds: [e] } }, o), await Mr({
1106
- arcgisMap: n.map,
1107
- arcgisMapView: n,
861
+ const { mapView: i } = v(o);
862
+ return await S({ type: "show-legend", data: { layerIds: [e] } }, o), await Gr({
863
+ arcgisMap: i.map,
864
+ arcgisMapView: i,
1108
865
  layerId: e,
1109
866
  fields: t,
1110
867
  colorSchemes: r,
1111
868
  theme: a
1112
869
  });
1113
870
  }
1114
- const Vr = s.object({
1115
- layerId: s.string().describe("The id of the layer to apply the size renderer to"),
1116
- fields: s.array(s.string()).describe("The field(s) to use for the size renderer (numeric data)"),
1117
- colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
1118
- theme: s.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the size ramp")
1119
- }), Jn = f(Qr, {
871
+ const Fr = c.object({
872
+ layerId: c.string().describe("The id of the layer to apply the size renderer to"),
873
+ fields: c.array(c.string()).describe("The field(s) to use for the size renderer (numeric data)"),
874
+ colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
875
+ theme: c.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the size ramp")
876
+ }), Ma = g(jr, {
1120
877
  name: "size",
1121
878
  description: `Label: Counts and Amounts (size)
1122
879
  Description: Vary symbol sizes along a continuous ramp to represent numeric or ranked data.
@@ -1129,76 +886,76 @@ const Vr = s.object({
1129
886
  Keywords: graduated size, proportional size, classed size, how much, total, number, when
1130
887
  Example: Vary the size of each feature based on the date a ticket was completed.
1131
888
  Fields: This style requires a single field with a date type.`,
1132
- schema: Vr
889
+ schema: Fr
1133
890
  });
1134
891
  function _r(e) {
1135
- const { fields: t, layer: r, view: a, colorSchemeTags: o } = e, n = t[0], l = t[1], i = t[2];
1136
- let c;
1137
- return o && (c = ot({
892
+ const { fields: t, layer: r, view: a, colorSchemeTags: o } = e, i = t[0], s = t[1], n = t[2];
893
+ let l;
894
+ return o && (l = Ee({
1138
895
  geometryType: r.geometryType,
1139
896
  includedTags: o
1140
897
  })[0]), {
1141
898
  layer: r,
1142
899
  view: a,
1143
- field: n,
1144
- field2: l,
1145
- field3: i,
900
+ field: i,
901
+ field2: s,
902
+ field3: n,
1146
903
  outlineOptimizationEnabled: !0,
1147
904
  sizeOptimizationEnabled: !0,
1148
- typeScheme: c
905
+ typeScheme: l
1149
906
  };
1150
907
  }
1151
- async function Wr(e) {
1152
- return await at(e);
908
+ async function Qr(e) {
909
+ return await Pe(e);
1153
910
  }
1154
- async function Br({
911
+ async function Ir({
1155
912
  arcgisMap: e,
1156
913
  arcgisMapView: t,
1157
914
  layerId: r,
1158
915
  fields: a,
1159
916
  colorSchemes: o,
1160
- theme: n
917
+ theme: i
1161
918
  }) {
1162
- const l = t, i = e?.allLayers.find((u) => u.id === r);
1163
- if (!i)
919
+ const s = t, n = e?.allLayers.find((p) => p.id === r);
920
+ if (!n)
1164
921
  return `Could not find layer for id: ${r}`;
1165
- const c = {
922
+ const l = {
1166
923
  styleName: "type",
1167
924
  fields: a,
1168
- layer: i,
1169
- view: l,
925
+ layer: n,
926
+ view: s,
1170
927
  colorSchemeTags: o,
1171
- theme: n
928
+ theme: i
1172
929
  };
1173
930
  try {
1174
- const u = _r(c), d = await Wr(u);
1175
- return i.renderer = d.renderer, i.visible = !0, `Type renderer applied to layer: ${i.title ?? i.id} using fields ${a.join(", ")}`;
1176
- } catch (u) {
1177
- return `Error applying type renderer: ${u instanceof Error ? u.message : String(u)}`;
931
+ const p = _r(l), d = await Qr(p);
932
+ return n.renderer = d.renderer, n.visible = !0, `Type renderer applied to layer: ${n.title ?? n.id} using fields ${a.join(", ")}`;
933
+ } catch (p) {
934
+ return `Error applying type renderer: ${p instanceof Error ? p.message : String(p)}`;
1178
935
  }
1179
936
  }
1180
- async function Ur({
937
+ async function Or({
1181
938
  layerId: e,
1182
939
  fields: t,
1183
940
  colorSchemes: r,
1184
941
  theme: a
1185
942
  }, o) {
1186
- const { mapView: n } = C(o);
1187
- return await $({ type: "show-legend", data: { layerIds: [e] } }, o), await Br({
1188
- arcgisMap: n.map,
1189
- arcgisMapView: n,
943
+ const { mapView: i } = v(o);
944
+ return await S({ type: "show-legend", data: { layerIds: [e] } }, o), await Ir({
945
+ arcgisMap: i.map,
946
+ arcgisMapView: i,
1190
947
  layerId: e,
1191
948
  fields: t,
1192
949
  colorSchemes: r,
1193
950
  theme: a
1194
951
  });
1195
952
  }
1196
- const Kr = s.object({
1197
- layerId: s.string().describe("The id of the layer to apply the type renderer to"),
1198
- fields: s.array(s.string()).describe("The field(s) to use for the type renderer (categorical data)"),
1199
- colorSchemes: s.array(s.string()).optional().describe("Optional color scheme tags to use"),
1200
- theme: s.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color scheme")
1201
- }), Yn = f(Ur, {
953
+ const Kr = c.object({
954
+ layerId: c.string().describe("The id of the layer to apply the type renderer to"),
955
+ fields: c.array(c.string()).describe("The field(s) to use for the type renderer (categorical data)"),
956
+ colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
957
+ theme: c.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color scheme")
958
+ }), Na = g(Or, {
1202
959
  name: "type",
1203
960
  description: `Label: Types (unique symbols)
1204
961
  Description: Represent features as categories with different symbol colors or shapes. Examples include type of tree, road class, or province name.
@@ -1206,883 +963,139 @@ Keywords: categorical, category, type, unique, discrete, point of interest, regi
1206
963
  Example: Color each feature based on the region it belongs to
1207
964
  Fields: This style requires a single field which may be a string, number, or date type. It is usually a string.`,
1208
965
  schema: Kr
1209
- }), Zn = T.Root({
1210
- ...K(),
1211
- vectorSearchLayerIds: T(),
1212
- vectorSearchFieldResults: T(),
1213
- layerFieldInfo: T(),
1214
- selectedLayerId: T()
1215
- }), Xn = T.Root({
1216
- ...K(),
1217
- vectorSearchLayerIds: T(),
1218
- vectorSearchFieldResults: T(),
1219
- layerFieldInfo: T(),
1220
- queryResponse: T(),
1221
- dataExplorationMessages: T({
1222
- reducer: we,
966
+ }), Da = m.Root({
967
+ ...G(),
968
+ vectorSearchLayerIds: m(),
969
+ vectorSearchFieldResults: m(),
970
+ layerFieldInfo: m(),
971
+ selectedLayerId: m()
972
+ }), La = m.Root({
973
+ ...G(),
974
+ vectorSearchLayerIds: m(),
975
+ vectorSearchFieldResults: m(),
976
+ layerFieldInfo: m(),
977
+ queryResponse: m(),
978
+ dataExplorationMessages: m({
979
+ reducer: ee,
1223
980
  default: () => []
1224
981
  })
1225
- }), Hr = (e) => {
1226
- const t = e.map?.allLayers.filter((a) => a.type === "feature");
1227
- let r = 0;
1228
- return t?.forEach((a) => {
1229
- const o = a;
1230
- o.featureEffect && (o.featureEffect = null, r++);
1231
- }), r > 0 ? `Cleared filters from ${r} layer(s). View unchanged.` : "No active filters to clear. View unchanged.";
1232
- }, Jr = async (e, t) => {
1233
- const { mapView: r } = v(t, ["mapView"]);
1234
- return Hr(r);
1235
- }, Yr = f(Jr, {
1236
- name: "clearFilters",
1237
- description: "Clears all feature effects/filters from the map but does NOT change the current view. Use when user says 'clear filters', 'reset filters', 'remove filters', 'show all features', or wants to remove emphasis without navigating anywhere.",
1238
- schema: s.object({})
1239
- }), Zr = async (e) => {
1240
- e.map?.allLayers.filter((o) => o.type === "feature")?.forEach((o) => {
1241
- const n = o;
1242
- n.featureEffect && (n.featureEffect = null);
1243
- });
1244
- const a = e.map.initialViewProperties?.viewpoint?.targetGeometry;
1245
- return a ? (await e.goTo(a), "Cleared all filters and returned to home extent.") : "Cleared all filters. Could not determine home extent.";
1246
- }, Xr = async (e, t) => {
1247
- const { mapView: r } = v(t, ["mapView"]);
1248
- return await Zr(r);
1249
- }, ea = f(Xr, {
1250
- name: "resetMap",
1251
- description: "Clears all feature effects/filters from the map AND zooms to the home extent (initial map view). Use when user says 'reset map', 'reset the map', 'start over', or wants to both clear filters and return to the initial view.",
1252
- schema: s.object({})
1253
- }), ge = 750;
1254
- function B(e) {
1255
- return "point" in e && e.point !== void 0;
1256
- }
1257
- function L(e) {
1258
- return "layerId" in e && e.layerId !== void 0;
1259
- }
1260
- const H = async (e, t) => {
1261
- if (B(e)) {
1262
- const { point: r } = e;
1263
- return { geometry: new be({
1264
- x: r.x,
1265
- y: r.y,
1266
- spatialReference: r.spatialReference ? { wkid: r.spatialReference.wkid } : t.spatialReference
1267
- }) };
1268
- }
1269
- if (L(e)) {
1270
- const r = t.map?.allLayers.find(
1271
- (n) => n.id === e.layerId
1272
- );
1273
- if (!r)
1274
- return { error: `Could not find geometry layer with ID: ${e.layerId}` };
1275
- const a = r.title ?? r.id, o = e.where?.trim() || "1=1";
1276
- try {
1277
- const n = await r.queryFeatures({
1278
- where: o,
1279
- returnGeometry: !0,
1280
- outSpatialReference: t.spatialReference,
1281
- num: ge + 1
1282
- });
1283
- if (!n.features.length)
1284
- return {
1285
- error: `No features found in geometry layer "${a}" with the specified where clause: ${o}`
1286
- };
1287
- if (n.features.length > ge)
1288
- return {
1289
- error: `Geometry filter for layer "${a}" matched too many features (${n.features.length}+). Please narrow the geometry layer filter.`
1290
- };
1291
- const l = n.features.map((c) => c.geometry).filter((c) => !!c);
1292
- if (!l.length)
1293
- return { error: "No valid geometries found for the matched geometry layer features." };
1294
- const i = l.length === 1 ? l[0] : st.executeMany(l);
1295
- return i ? (i.spatialReference || (i.spatialReference = t.spatialReference), { geometry: i }) : { error: "Failed to combine geometries from geometry layer." };
1296
- } catch (n) {
1297
- return { error: `Failed to query geometry: ${String(n)}` };
1298
- }
1299
- }
1300
- return { error: "Invalid geometry configuration provided" };
1301
- }, ta = async (e, t, r, a, o, n) => {
1302
- const l = e.map?.allLayers.find((c) => c.id === t);
1303
- if (!l)
1304
- return { success: !1, error: `Layer '${t}' not found.` };
1305
- const i = l.createQuery();
1306
- i.where = r ?? "1=1", a && (i.geometry = a, i.spatialRelationship = "intersects", o && (i.distance = o), n && (i.units = n));
1307
- try {
1308
- const { extent: c, count: u } = await l.queryExtent(i);
1309
- return !c || u === 0 ? {
1310
- success: !1,
1311
- error: `No features found for filter (where: ${i.where}${a ? ", spatial filter used" : ""})`
1312
- } : (await e.goTo(c), { success: !0 });
1313
- } catch (c) {
1314
- return {
1315
- success: !1,
1316
- error: c instanceof Error ? c.message : String(c)
1317
- };
1318
- }
1319
- }, ra = async (e, t, r, a, o, n) => {
1320
- const l = t.map?.allLayers.find(
1321
- (p) => p.id === e.layerId
1322
- );
1323
- if (!l)
1324
- return `Could not find target layer with ID: ${e.layerId}`;
1325
- let i;
1326
- if (o) {
1327
- const p = await H(o, t);
1328
- if ("error" in p)
1329
- return p.error;
1330
- i = p.geometry;
1331
- }
1332
- if (l.featureEffect = null, l.featureEffect = new it({
1333
- filter: new Te({
1334
- ...e.objectIds?.length ? { objectIds: e.objectIds } : { where: e.where },
1335
- geometry: i,
1336
- spatialRelationship: "intersects",
1337
- distance: o?.distance,
1338
- units: o?.units
1339
- }),
1340
- includedEffect: r,
1341
- excludedEffect: a
1342
- }), l.visible = !0, n)
1343
- return `Applied feature effects to "${l.title ?? e.layerId}" within current map extent.`;
1344
- const c = e.objectIds?.length ? `${l.objectIdField} IN (${e.objectIds.join(",")})` : e.where, u = await ta(
1345
- t,
1346
- e.layerId,
1347
- c,
1348
- i,
1349
- o?.distance,
1350
- o?.units
1351
- ), d = l.title ?? e.layerId;
1352
- return u.success ? `Applied feature effects to target layer "${l.title ?? e.layerId}"${o && "layerId" in o ? ` using geometry from layer "${o.layerId}"` : ""}.` : `Applied filter to "${d}" but no features matched. ${u.error}`;
1353
- }, aa = ["feet", "kilometers", "meters", "miles", "nautical-miles", "us-nautical-miles"], F = s.enum(aa), oa = async ({
1354
- targetLayer: e,
1355
- geometryFilter: t,
1356
- useCurrentExtent: r,
1357
- includedEffect: a = "drop-shadow(2px, 2px, 2px, gray)",
1358
- excludedEffect: o = "grayscale(100%) opacity(60%) blur(2px)"
1359
- }, n) => {
1360
- const { mapView: l } = v(n, ["mapView"]);
1361
- return await ra(e, l, a, o, t, r);
1362
- }, na = s.object({
1363
- layerId: s.string().describe("The layerId of the layer containing the geometry by which to filter."),
1364
- where: s.string().describe("The SQL-92 where clause representing the features from which to filter."),
1365
- distance: s.number().optional().describe("The buffer distance around the geometry."),
1366
- units: F.optional().describe("The units for the distance buffer.")
1367
- }), ia = s.object({
1368
- point: s.object({
1369
- x: s.number().describe("X coordinate (longitude) from navigation result"),
1370
- y: s.number().describe("Y coordinate (latitude) from navigation result"),
1371
- spatialReference: s.object({
1372
- wkid: s.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")
1373
- }).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")
1374
- }).describe("Point coordinates from a previous navigation/geocoding result"),
1375
- distance: s.number().optional().describe("Optional buffer distance around the point."),
1376
- units: F.optional().describe("The units for the distance buffer.")
1377
- }), sa = s.object({
1378
- targetLayer: s.object({
1379
- layerId: s.string().describe("The layerId of the layer on which to set a feature effect."),
1380
- where: s.string().describe("The SQL-92 where clause representing the features to emphasize."),
1381
- objectIds: s.array(s.number()).optional().describe(
1382
- "Array of objectIds from a previous query result. Use this instead of a where clause when the query returned objectIds (e.g. top N results). If provided, takes precedence over where clause."
1383
- )
1384
- }),
1385
- geometryFilter: s.union([na, ia]).optional().describe("Optional geometry-based filtering parameters for spatial queries."),
1386
- useCurrentExtent: s.boolean().optional().describe(
1387
- "Set to true when the previous query used the current map extent as a spatial filter. This ensures the feature effect applies only to features visible in the current view. Default is false."
1388
- ),
1389
- includedEffect: s.string().default("drop-shadow(2px, 2px, 2px, gray)").describe(
1390
- "The effect applied to features that meet the filter requirements. Valid effects include: bloom, blur, brightness, contrast, drop-shadow, grayscale, hue-rotate, invert, opacity, saturate, and sepia. Prefer default unless specified."
1391
- ),
1392
- excludedEffect: s.string().default("grayscale(100%) opacity(60%) blur(2px)").describe(
1393
- "The effect applied to features that do not meet the filter requirements. Valid effects include: bloom, blur, brightness, contrast, drop-shadow, grayscale, hue-rotate, invert, opacity, saturate, and sepia. Prefer default unless specified."
1394
- )
1395
- }), la = f(oa, {
1396
- name: "setFeatureEffect",
1397
- description: "Sets a feature effect on a given layer with given filter parameters and feature effects to emphasize certain features that meet a filter requirement. If no feature effect information is provided, then use the default effect provided.",
1398
- schema: sa
1399
- }), ca = /* @__PURE__ */ new Set([
1400
- "date",
1401
- "esrifieldtypedate",
1402
- "date-only",
1403
- "dateonly",
1404
- "esrifieldtypedateonly",
1405
- "time-only",
1406
- "timeonly",
1407
- "esrifieldtypetimeonly",
1408
- "timestamp-offset",
1409
- "timestampoffset",
1410
- "esrifieldtypetimestampoffset"
1411
- ]), xe = (e) => {
1412
- if (!e)
1413
- return !1;
1414
- const t = e.toLowerCase();
1415
- return ca.has(t);
1416
- }, ee = (e) => {
1417
- if (e instanceof Date)
1418
- return Number.isNaN(e.getTime()) ? null : e;
1419
- if (typeof e == "number" && Number.isFinite(e)) {
1420
- const t = new Date(e);
1421
- return Number.isNaN(t.getTime()) ? null : t;
1422
- }
1423
- return null;
1424
- }, ua = (e) => !e || e === "system" ? Intl.DateTimeFormat().resolvedOptions().timeZone : e === "unknown" ? "UTC" : e, da = (e) => {
1425
- if (typeof e == "string" && e)
1426
- return e;
1427
- const t = ee(e);
1428
- return t ? t.toISOString().slice(0, 10) : null;
1429
- }, ei = () => {
1430
- const e = (/* @__PURE__ */ new Date()).getTimezoneOffset(), t = e <= 0 ? "+" : "-", r = Math.floor(Math.abs(e) / 60).toString().padStart(2, "0"), a = (Math.abs(e) % 60).toString().padStart(2, "0"), o = `${t}${r}:${a}`;
1431
- return { userTimezone: Intl.DateTimeFormat().resolvedOptions().timeZone, userTimezoneOffset: o };
1432
- }, pa = (e, t, r) => {
1433
- const a = t?.toLowerCase();
1434
- if (a && !xe(a))
1435
- return e;
1436
- if (a === "date-only") {
1437
- const n = da(e);
1438
- return n ? lt(n, Q("short-date")) : e;
1439
- }
1440
- if (a === "time-only") {
1441
- if (typeof e == "string" && e)
1442
- return ct(e, Q("long-time"));
1443
- const n = ee(e);
1444
- return n ? he(n, {
1445
- ...Q("long-time"),
1446
- timeZone: "UTC"
1447
- }) : e;
1448
- }
1449
- const o = ee(e);
1450
- return o ? he(o, {
1451
- ...Q("short-date-short-time"),
1452
- timeZone: ua(r)
1453
- }) : e;
1454
- }, Re = (e, t, r) => {
1455
- if (e && typeof e != "function") {
1456
- const a = "getField" in r && r.getField?.(e), o = a && "getFieldDomain" in r && r.getFieldDomain ? r.getFieldDomain(a.name) : null;
1457
- if (o?.type === "coded-value") {
1458
- const n = o.codedValues.find((l) => l.code === t);
1459
- return n ? n.name : null;
1460
- }
1461
- }
1462
- return null;
1463
- }, ma = (e) => !e || e === "system" ? Intl.DateTimeFormat().resolvedOptions().timeZone : e === "unknown" ? "UTC" : e, ha = (e) => {
1464
- if (e instanceof Date)
1465
- return Number.isNaN(e.getTime()) ? null : e;
1466
- if (typeof e == "number" && Number.isFinite(e)) {
1467
- const t = new Date(e);
1468
- return Number.isNaN(t.getTime()) ? null : t;
1469
- }
1470
- if (typeof e == "string" && e) {
1471
- const t = new Date(e);
1472
- return Number.isNaN(t.getTime()) ? null : t;
1473
- }
1474
- return null;
1475
- }, ya = (e, t) => {
1476
- if (typeof e != "number")
1477
- return e;
1478
- const r = {};
1479
- t.minimumFractionDigits !== void 0 && (r.minimumFractionDigits = t.minimumFractionDigits), t.maximumFractionDigits !== void 0 && (r.maximumFractionDigits = t.maximumFractionDigits), t.useGrouping === "always" ? r.useGrouping = !0 : t.useGrouping === "never" && (r.useGrouping = !1);
1480
- try {
1481
- return new Intl.NumberFormat(void 0, r).format(e);
1482
- } catch {
1483
- return e;
1484
- }
1485
- }, fa = (e, t, r) => {
1486
- const a = ha(e);
1487
- if (!a)
1488
- return e;
1489
- const o = {};
1490
- t.dateStyle ? o.dateStyle = t.dateStyle : (t.year && (o.year = t.year), t.month && (o.month = t.month)), t.timeStyle && (o.timeStyle = t.timeStyle), t.timeStyle && t.hour12 === "always" ? o.hour12 = !0 : t.timeStyle && t.hour12 === "never" && (o.hour12 = !1), o.timeZone = ma(r);
1491
- try {
1492
- return new Intl.DateTimeFormat(void 0, o).format(a);
1493
- } catch {
1494
- return e;
1495
- }
1496
- }, $e = (e, t) => e.getFieldAlias?.(t) ?? e.fieldsIndex?.get(t)?.alias ?? e.fieldsIndex?.get(t)?.name ?? t, Ce = (e, t, r, a, o) => {
1497
- if (r == null)
1498
- return r;
1499
- const l = e.getFieldConfiguration?.(t)?.fieldFormat;
1500
- return l?.type === "number" ? ya(r, l) : l?.type === "date-time" ? !a || xe(a) ? fa(r, l, o) : r : pa(r, a, o);
1501
- }, ga = (e, t, r, a) => {
1502
- const o = e.fieldsIndex?.get(t), n = Re(t, r, e) ?? r;
1503
- return Ce(e, t, n, o?.type, a);
1504
- }, wa = (e, t) => $e(e, t), Ee = (e, t, r) => {
1505
- const a = e.objectIdField, o = t.features.map(
1506
- (l) => l.attributes[a]
1507
- ), n = t.features.map((l) => {
1508
- const i = l.attributes, c = {};
1509
- return e.fields.forEach((u) => {
1510
- if (!Object.hasOwn(i, u.name))
1511
- return;
1512
- const d = i[u.name];
1513
- if (u.name === a) {
1514
- c[u.name] = d;
1515
- return;
1516
- }
1517
- const p = Re(u.name, d, e) ?? d, m = $e(e, u.name);
1518
- c[m] = Ce(e, u.name, p, u.type, r);
1519
- }), c;
1520
- });
1521
- return { objectIds: o, attributes: n };
1522
- }, ba = (e, t, r) => {
1523
- const a = e.createQuery();
1524
- return a.outFields = [t], a.where = r || "1=1", a.num = 1, a;
1525
- }, Ta = async (e, t, r, a) => {
1526
- const o = a.map?.allLayers.find((m) => m.id === e), n = ba(o, t, r.where), i = (await o.queryFeatures(n)).features[0], c = i ? i.attributes[t] : null, u = ga(o, t, c, a.timeZone), d = wa(o, t);
1527
- return {
1528
- tool: "getAttribute",
1529
- layerName: o.title ?? e,
1530
- summary: `${d} = ${u}`,
1531
- details: {
1532
- fieldName: t,
1533
- fieldAlias: d !== t ? d : void 0,
1534
- value: u,
1535
- where: r.where
1536
- }
1537
- };
1538
- };
1539
- async function Sa({ layerId: e, fieldName: t, query: r }, a) {
1540
- const { mapView: o } = v(a, ["mapView"]), n = await Ta(e, t, r, o);
1541
- return JSON.stringify(n, null, 2);
1542
- }
1543
- const va = s.object({
1544
- layerId: s.string().describe("The layerId of the layer containing the field from which to get a value."),
1545
- fieldName: s.string().describe("The name of the field/attribute from which to get a field value."),
1546
- query: s.object({
1547
- where: s.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value.")
1548
- })
1549
- }), xa = f(Sa, {
1550
- name: "getAttribute",
1551
- description: "Returns an attribute value for a given feature.",
1552
- schema: va
1553
- }), se = (e, t, r) => {
1554
- if (!(r ? e.hasAllFeaturesInView : e.hasAllFeatures))
1555
- return !1;
1556
- const o = new Set((e.availableFields ?? []).map((n) => n.toLowerCase()));
1557
- return o.has("*") ? !0 : t.every((n) => o.has(n.toLowerCase()));
1558
- };
1559
- function U(e, t) {
1560
- let r = e ?? "";
1561
- return t != null && t && (r = r ? `(${r}) AND (${t})` : t), r || null;
1562
- }
1563
- const Ra = async (e) => {
1564
- const { targetLayer: t, fieldName: r, statisticType: a, mapView: o, layersAndFieldsRegistry: n, geometryFilter: l } = e, i = o.map?.allLayers.find((S) => S.id === t.layerId);
1565
- if (!i)
1566
- throw new Error(`Layer '${t.layerId}' not found.`);
1567
- const c = await o.whenLayerView(i), d = n.get(t.layerId)?.fieldRegistry.get(r), p = d?.alias;
1568
- if (!d)
1569
- throw new Error(`Field '${r}' not found.`);
1570
- let m, w;
1571
- if (l) {
1572
- const S = await H(l, o);
1573
- if ("error" in S)
1574
- throw new Error(S.error);
1575
- if (!S.geometry)
1576
- throw L(l) ? new Error(`No features found matching: ${l.where}`) : new Error("Failed to create geometry");
1577
- if (L(l)) {
1578
- const M = o.map?.allLayers.find((P) => P.id === l.layerId);
1579
- m = {
1580
- geometryLayerName: M?.title ?? M?.id,
1581
- geometryLayerId: l.layerId,
1582
- geometryWhere: l.where,
1583
- distance: l.distance,
1584
- units: l.units,
1585
- applied: !0
1586
- };
1587
- } else B(l) && (m = {
1588
- point: l.point,
1589
- distance: l.distance,
1590
- units: l.units,
1591
- applied: !0
1592
- });
1593
- w = new Te({
1594
- geometry: S.geometry,
1595
- distance: l.distance,
1596
- units: l.units,
1597
- spatialRelationship: "intersects"
1598
- });
1599
- }
1600
- const h = se(c, [r], !1);
1601
- let y = null, g = null;
1602
- const b = 10;
1603
- if (d.type !== "geometry" && d.type !== "oid" && d.type !== "global-id")
1604
- try {
1605
- const S = {
1606
- layer: i,
1607
- useFeaturesInView: h,
1608
- view: h ? o : void 0,
1609
- field: r,
1610
- sqlWhere: U(i.definitionExpression, t.where),
1611
- ...w && { filter: w },
1612
- outStatisticTypes: { include: [a] }
1613
- };
1614
- y = await ut(S);
1615
- const M = ["string", "small-integer", "integer"], P = d.domain?.type === "coded-value" ? d.domain : null;
1616
- (M.includes(d.type) || P) && (g = (await dt({
1617
- layer: i,
1618
- useFeaturesInView: h,
1619
- view: h ? o : void 0,
1620
- field: r,
1621
- sqlWhere: U(i.definitionExpression, t.where),
1622
- ...w && { filter: w }
1623
- })).uniqueValueInfos.sort((I, ze) => ze.count - I.count).slice(0, b)), g && d.domain?.type === "coded-value" && (g = g.map((I) => ({
1624
- ...I,
1625
- value: P ? P.getName(I.value) ?? I.value : I.value
1626
- })));
1627
- } catch (S) {
1628
- console.error("Statistics error:", S);
1629
- }
1630
- return {
1631
- tool: "getStatistics",
1632
- layerName: i.title ?? t.layerId,
1633
- summary: `${a} = ${typeof y?.[a] == "number" ? y[a] : "N/A"}`,
1634
- details: {
1635
- fieldName: r,
1636
- fieldAlias: p,
1637
- statisticType: a,
1638
- statistic: y?.[a] ?? null,
1639
- summaryStatistics: y,
1640
- uniqueValues: g,
1641
- where: t.where,
1642
- spatialFilterInfo: m
1643
- }
1644
- };
1645
- };
1646
- async function $a({
1647
- targetLayer: e,
1648
- fieldName: t,
1649
- statisticType: r,
1650
- geometryFilter: a
1651
- }, o) {
1652
- const n = ve(o, "layersAndFieldsRegistry"), { mapView: l } = v(o, ["mapView"]), i = await Ra({
1653
- targetLayer: e,
1654
- fieldName: t,
1655
- statisticType: r,
1656
- mapView: l,
1657
- layersAndFieldsRegistry: n,
1658
- geometryFilter: a
1659
- });
1660
- return JSON.stringify(i, null, 2);
1661
- }
1662
- const Ca = s.object({
1663
- layerId: s.string().describe("The layerId of the layer containing the geometry by which to filter."),
1664
- where: s.string().describe("The SQL-92 where clause representing the features from which to filter."),
1665
- distance: s.number().optional().describe("The buffer distance around the geometry."),
1666
- units: F.optional().describe("The units for the distance buffer.")
1667
- }), Ea = s.object({
1668
- point: s.object({
1669
- x: s.number().describe("X coordinate (longitude) from navigation result"),
1670
- y: s.number().describe("Y coordinate (latitude) from navigation result"),
1671
- spatialReference: s.object({
1672
- wkid: s.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")
1673
- }).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")
1674
- }).describe("Point coordinates from a previous navigation/geocoding result"),
1675
- distance: s.number().optional().describe("Optional buffer distance around the point."),
1676
- units: F.optional().describe("The units for the distance buffer.")
1677
- }), Fa = s.object({
1678
- targetLayer: s.object({
1679
- layerId: s.string().describe("The layerId of the layer containing the field from which to get a value."),
1680
- where: s.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value.")
1681
- }),
1682
- geometryFilter: s.union([Ca, Ea]).optional().describe(
1683
- "Geometry filter for spatial queries. Use 'point' option with x/y coordinates from navigation results to find features at that location (point-in-polygon). Use 'layerId/where' option to filter by features from another layer."
1684
- ),
1685
- fieldName: s.string().describe("The name of the field for which to get statistics. STRICTLY DO NOT use OBJECTID. Use any other field"),
1686
- statisticType: s.enum(["avg", "max", "median", "min", "stddev", "sum", "variance", "nullcount", "count"]).describe("The statistic type to calculate.")
1687
- }), ka = f($a, {
1688
- name: "getStatistics",
1689
- 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.
1690
-
1691
- USE THIS TOOL FOR:
1692
- - "What is the average/maximum/minimum/total [field]?" — aggregate computations
1693
- - "Most common/frequent value of [field]?" — frequency analysis
1694
- - Questions requiring a mathematical aggregation across many features
1695
-
1696
- DO NOT USE FOR:
1697
- - "How many features match X?" — use queryFeatures instead (it returns totalCount)
1698
- - "Show / list / find features" — use queryFeatures instead
1699
- - Simple counts of features matching a condition — use queryFeatures instead
1700
-
1701
- 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.`,
1702
- schema: Fa
1703
- }), Na = (e) => e.flatMap((t) => t.split(",")).map((t) => t.trim()).map((t) => t.split(/\s+/u)[0]?.replace(/^"|"$/gu, "")).filter((t) => !!t), Ia = async (e, t, r, a, o) => {
1704
- const n = r.map?.allLayers.find((m) => m.id === e.layerId), l = await r.whenLayerView(n), i = n.title ?? e.layerId;
1705
- let c;
1706
- if (a) {
1707
- const m = await H(a, r);
1708
- if ("error" in m)
1709
- return {
1710
- tool: "getTopFeatures",
1711
- layerName: i,
1712
- summary: "Geometry lookup failed",
1713
- details: { error: m.error }
1714
- };
1715
- if (!m.geometry)
1716
- return {
1717
- tool: "getTopFeatures",
1718
- layerName: i,
1719
- summary: "No features found for geometry filter",
1720
- details: {
1721
- error: `No features found matching: ${"where" in a ? a.where : "unknown criteria"}`
1722
- }
1723
- };
1724
- c = m.geometry;
1725
- } else o && (c = r.extent.clone());
1726
- const u = t.groupByFields && t.groupByFields.length > 0, d = n.objectIdField, p = e.outFields.includes("*") ? ["*"] : [.../* @__PURE__ */ new Set([...e.outFields, d])];
1727
- try {
1728
- let m;
1729
- if (u) {
1730
- const y = new pt({
1731
- where: e.where || "1=1",
1732
- outFields: p,
1733
- orderByFields: e.orderByFields,
1734
- geometry: c,
1735
- spatialRelationship: c ? "intersects" : void 0,
1736
- distance: a?.distance,
1737
- units: a?.units,
1738
- topFilter: new mt({
1739
- topCount: t.topCount,
1740
- groupByFields: t.groupByFields,
1741
- orderByFields: t.orderByFields
1742
- })
1743
- });
1744
- m = await n.queryTopFeatures(y);
1745
- } else {
1746
- const y = n.createQuery();
1747
- y.where = U(n.definitionExpression, e.where || "1=1"), y.outFields = p.length ? p : ["*"], y.orderByFields = t.orderByFields, y.returnGeometry = !1, y.num = t.topCount, c && (y.geometry = c, y.spatialRelationship = "intersects"), a?.distance && (y.distance = a.distance), a?.units && (y.units = a.units), y.outSpatialReference = r.spatialReference;
1748
- const g = [
1749
- .../* @__PURE__ */ new Set([...e.outFields, ...Na(t.orderByFields)])
1750
- ], b = se(l, g, o ?? !1);
1751
- try {
1752
- m = b ? await l.queryFeatures(y) : await n.queryFeatures(y);
1753
- } catch (x) {
1754
- console.warn("Client-side query failed, falling back to server:", x), m = await n.queryFeatures(y);
1755
- }
1756
- }
1757
- const w = m.features.map((y) => y.attributes[d]), { attributes: h } = Ee(n, m, r.timeZone);
1758
- return {
1759
- tool: "getTopFeatures",
1760
- layerName: i,
1761
- summary: `Top ${t.topCount} features extracted`,
1762
- details: {
1763
- topCount: t.topCount,
1764
- attributes: h,
1765
- objectIds: w,
1766
- objectIdField: d,
1767
- where: e.where,
1768
- orderByFields: t.orderByFields,
1769
- ...u && { groupByFields: t.groupByFields }
1770
- }
1771
- };
1772
- } catch (m) {
1773
- return {
1774
- tool: "getTopFeatures",
1775
- layerName: i,
1776
- summary: "Query failed",
1777
- details: { error: m instanceof Error ? m.message : String(m) }
1778
- };
1779
- }
1780
- }, qa = async ({
1781
- targetLayer: e,
1782
- topFilter: t,
1783
- geometryFilter: r,
1784
- useCurrentExtent: a
1785
- }, o) => {
1786
- const { mapView: n } = v(o, ["mapView"]), l = await Ia(e, t, n, r, a);
1787
- return JSON.stringify(l, null, 2);
1788
- }, za = s.object({
1789
- layerId: s.string().describe("The layerId of the layer containing the geometry by which to filter."),
1790
- where: s.string().describe("The SQL-92 where clause representing the features from which to filter."),
1791
- distance: s.number().optional().describe("The buffer distance around the geometry."),
1792
- units: F.optional().describe("The units for the distance buffer.")
1793
- }), Da = s.object({
1794
- point: s.object({
1795
- x: s.number().describe("X coordinate (longitude) from navigation result"),
1796
- y: s.number().describe("Y coordinate (latitude) from navigation result"),
1797
- spatialReference: s.object({
1798
- wkid: s.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")
1799
- }).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")
1800
- }).describe("Point coordinates from a previous navigation/geocoding result"),
1801
- distance: s.number().optional().describe("Optional buffer distance around the point."),
1802
- units: F.optional().describe("The units for the distance buffer.")
1803
- }), Pa = s.object({
1804
- targetLayer: s.object({
1805
- layerId: s.string().describe("The layerId of the layer containing the field from which to get a value."),
1806
- where: s.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value."),
1807
- orderByFields: s.array(s.string().describe("The field(s) and order for which to sort the resulting features.")),
1808
- outFields: s.array(
1809
- s.string().describe(
1810
- 'The fields to include in the output that will be presented to the user. This should include identifying information about the resulting features, like a name or id, along with the values desired in the output. If unsure, choose all fields ("*").'
1811
- ).default("*")
1812
- )
1813
- }),
1814
- geometryFilter: s.union([za, Da]).optional().describe(
1815
- "Geometry filter for spatial queries. Use 'point' option with x/y coordinates from navigation results to find features at that location (point-in-polygon). Use 'layerId/where' option to filter by features from another layer."
1816
- ),
1817
- topFilter: s.object({
1818
- topCount: s.number().describe("Number of top features to return per group."),
1819
- orderByFields: s.array(
1820
- s.string().describe("Field(s) to rank by with ASC/DESC. Must be existing field names, not aggregate functions.")
1821
- ),
1822
- groupByFields: s.array(s.string().describe("Field(s) to group results by. Returns top N per group."))
1823
- }).required(),
1824
- useCurrentExtent: s.boolean().optional().describe(
1825
- "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)."
1826
- )
1827
- }), Aa = f(qa, {
1828
- name: "getTopFeatures",
1829
- description: 'Returns top N features ranked by an existing field value. Use for "highest", "lowest", "top N" questions where ranking is based on a field that already exists in the data (e.g., population, value, date, depth). orderByFields must be actual field names with ASC/DESC. Do NOT use aggregate functions like COUNT(), SUM(), AVG() - those require getStatistics.',
1830
- schema: Pa
1831
- }), X = 25, La = (e) => e.flatMap((t) => t.split(",")).map((t) => t.trim()).map((t) => t.split(/\s+/u)[0]?.replace(/^"|"$/gu, "")).filter((t) => !!t), ja = async (e, t, r, a) => {
1832
- const o = t.map?.allLayers.find((g) => g.id === e.layerId), n = await t.whenLayerView(o), l = o.title ?? e.layerId;
1833
- let i;
1834
- if (r) {
1835
- const g = await H(r, t);
1836
- if ("error" in g) {
1837
- const b = { error: g.error };
1838
- if (L(r)) {
1839
- const x = t.map?.allLayers.find((S) => S.id === r.layerId);
1840
- b.geometryLayerName = x?.title ?? x?.id, b.geometryLayerId = r.layerId, b.geometryWhere = r.where;
1841
- } else B(r) && (b.point = r.point);
1842
- return {
1843
- tool: "queryFeatures",
1844
- layerName: l,
1845
- summary: "Geometry lookup failed",
1846
- details: b
1847
- };
1848
- }
1849
- if (!g.geometry) {
1850
- const b = {};
1851
- if (L(r)) {
1852
- const x = t.map?.allLayers.find((S) => S.id === r.layerId);
1853
- b.error = `No features found matching: ${r.where}`, b.geometryLayerName = x?.title ?? x?.id, b.geometryLayerId = r.layerId, b.geometryWhere = r.where;
1854
- } else B(r) && (b.error = "Failed to create point geometry", b.point = r.point);
1855
- return {
1856
- tool: "queryFeatures",
1857
- layerName: l,
1858
- summary: "No features found for geometry filter",
1859
- details: b
1860
- };
1861
- }
1862
- i = g.geometry;
1863
- } else a && (i = t.extent.clone());
1864
- const c = [
1865
- .../* @__PURE__ */ new Set([...e.outFields, ...La(e.orderByFields)])
1866
- ], u = se(n, c, a ?? !1), d = o.objectIdField, p = o.createQuery();
1867
- p.where = U(o.definitionExpression, e.where || "1=1"), p.outFields = e.outFields.includes("*") ? ["*"] : [.../* @__PURE__ */ new Set([...e.outFields, d])], p.orderByFields = e.orderByFields, i && (p.geometry = i, p.spatialRelationship = "intersects"), r?.distance && (p.distance = r.distance), r?.units && (p.units = r.units), p.outSpatialReference = t.spatialReference;
1868
- let m, w;
1869
- try {
1870
- m = u ? await n.queryFeatureCount(p) : await o.queryFeatureCount(p), m > 0 && m <= X && (w = u ? await n.queryFeatures(p) : await o.queryFeatures(p));
1871
- } catch (g) {
1872
- console.warn("Client-side query failed, falling back to server:", g), m = await o.queryFeatureCount(p), m > 0 && m <= X && (w = await o.queryFeatures(p));
1873
- }
1874
- const { objectIds: h, attributes: y } = w ? Ee(o, w, t.timeZone) : { objectIds: void 0, attributes: void 0 };
1875
- return {
1876
- tool: "queryFeatures",
1877
- layerName: l,
1878
- summary: `${m} features found`,
1879
- details: {
1880
- totalCount: m,
1881
- where: e.where,
1882
- orderByFields: e.orderByFields,
1883
- outFields: e.outFields,
1884
- ...h && { objectIds: h, objectIdField: d },
1885
- ...y && { attributes: y },
1886
- ...m > X && {
1887
- note: `${m} features found.`
1888
- }
1889
- }
1890
- };
1891
- };
1892
- async function Ga({
1893
- targetLayer: e,
1894
- geometryFilter: t,
1895
- useCurrentExtent: r
1896
- }, a) {
1897
- const { mapView: o } = v(a, ["mapView"]), n = await ja(e, o, t, r);
1898
- return JSON.stringify(n, null, 2);
1899
- }
1900
- const Oa = s.object({
1901
- layerId: s.string().describe("The layerId of the layer containing the geometry by which to filter."),
1902
- where: s.string().describe("The SQL-92 where clause representing the features from which to filter."),
1903
- distance: s.number().optional().describe("The buffer distance around the geometry."),
1904
- units: F.optional().describe("The units for the distance buffer.")
1905
- }), Ma = s.object({
1906
- point: s.object({
1907
- x: s.number().describe("X coordinate (longitude) from navigation result"),
1908
- y: s.number().describe("Y coordinate (latitude) from navigation result"),
1909
- spatialReference: s.object({
1910
- wkid: s.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")
1911
- }).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")
1912
- }).describe("Point coordinates from a previous navigation/geocoding result"),
1913
- distance: s.number().optional().describe("Optional buffer distance around the point."),
1914
- units: F.optional().describe("The units for the distance buffer.")
1915
- }), Qa = s.object({
1916
- targetLayer: s.object({
1917
- layerId: s.string().describe("The layerId of the layer containing the field from which to get a value."),
1918
- where: s.string().describe(
1919
- "SQL-92 where clause. IMPORTANT: When using geometryFilter.point for point-in-polygon queries, set this to '1=1' to return all features that intersect the point. Only add attribute filters if the user specifically requests them in addition to the spatial query."
1920
- ),
1921
- orderByFields: s.array(s.string().describe("The field(s) and order for which to sort the resulting features.")),
1922
- outFields: s.array(
1923
- s.string().describe(
1924
- 'The fields to include in the output that will be presented to the user. This should include identifying information about the resulting features, like a name or id, along with the values desired in the output. If unsure, choose all fields ("*").'
1925
- ).default("*")
1926
- )
1927
- }),
1928
- geometryFilter: s.union([Oa, Ma]).optional().describe(
1929
- "Geometry filter for spatial queries. Use 'point' option with x/y coordinates from navigation results to find features at that location (point-in-polygon). Use 'layerId/where' option to filter by features from another layer."
1930
- ),
1931
- useCurrentExtent: s.boolean().optional().describe(
1932
- "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)."
1933
- )
1934
- }), Va = f(Ga, {
1935
- name: "queryFeatures",
1936
- description: `Queries features from a layer. Returns the total count of matching features, plus individual feature attributes if ≤25 features match.
1937
-
1938
- USE THIS TOOL FOR:
1939
- - "Show / display / list features where..." — finding and listing features
1940
- - "How many X are Y?" — counting features that match a condition
1941
- - "Which features..." / "Find features..." — identifying specific features
1942
- - Spatial queries — finding features near/within/intersecting other features
1943
- - Any question where the user wants to SEE or COUNT matching features
1944
-
1945
- This is the DEFAULT tool for most queries. When in doubt, use this tool.`,
1946
- schema: Qa
1947
- }), _a = [xa, ka, Aa, Va], ti = [la, ea, Yr], Wa = new nt(_a, { handleToolErrors: !1 });
1948
- async function ri(e, t) {
1949
- const { messages: r } = await Wa.invoke({ messages: e.dataExplorationMessages }, t), a = [], o = [];
1950
- for (const n of r) {
1951
- const l = n.content;
1952
- let i;
1953
- typeof l != "string" && (i = {
1954
- tool: n.name ?? "unknown",
982
+ }), Vr = [Me, Ne, De, Le], Ga = [qe, Ae, ke], Wr = new ze(Vr, { handleToolErrors: !1 });
983
+ async function ja(e, t) {
984
+ const { messages: r } = await Wr.invoke({ messages: e.dataExplorationMessages }, t), a = [], o = [];
985
+ for (const i of r) {
986
+ const s = i.content;
987
+ let n;
988
+ typeof s != "string" && (n = {
989
+ tool: i.name ?? "unknown",
1955
990
  layerName: "unknown",
1956
991
  summary: "Query failed",
1957
- details: { error: "Skipping non-string tool output:", raw: l }
992
+ details: { error: "Skipping non-string tool output:", raw: s }
1958
993
  });
1959
994
  try {
1960
- typeof l == "string" ? i = JSON.parse(l) : i = {
1961
- tool: n.name ?? "unknown",
995
+ typeof s == "string" ? n = JSON.parse(s) : n = {
996
+ tool: i.name ?? "unknown",
1962
997
  layerName: "unknown",
1963
998
  summary: "Query failed",
1964
- details: { error: "Invalid tool output type", raw: l }
999
+ details: { error: "Invalid tool output type", raw: s }
1965
1000
  };
1966
1001
  } catch {
1967
- i = {
1968
- tool: n.name ?? "unknown",
1002
+ n = {
1003
+ tool: i.name ?? "unknown",
1969
1004
  layerName: "unknown",
1970
1005
  summary: "Query failed",
1971
- details: { error: l }
1006
+ details: { error: s }
1972
1007
  };
1973
1008
  }
1974
- a.push(i), i.details && typeof i.details == "object" && "error" in i.details ? o.push(`- ${i.tool}: Error - ${String(i.details.error)}`) : o.push(`- ${i.layerName}: ${i.summary}`);
1009
+ a.push(n), n.details && typeof n.details == "object" && "error" in n.details ? o.push(`- ${n.tool}: Error - ${String(n.details.error)}`) : o.push(`- ${n.layerName}: ${n.summary}`);
1975
1010
  }
1976
- return await R({ text: `Finished executing layer query tool: ${o.join(", ")}` }, t), {
1011
+ return await T({ text: `Finished executing layer query tool: ${o.join(", ")}` }, t), {
1977
1012
  ...e,
1978
1013
  dataExplorationMessages: [...e.dataExplorationMessages, ...r],
1979
1014
  queryResponse: a,
1980
1015
  status: "success",
1981
- summary: o.length > 0 ? Bt(o.join(`
1016
+ summary: o.length > 0 ? Ie(o.join(`
1982
1017
  `)) : "Query executed."
1983
1018
  };
1984
1019
  }
1985
- const ai = T.Root({
1986
- ...K(),
1020
+ const Fa = m.Root({
1021
+ ...G(),
1987
1022
  // internal to the help agent
1988
- helpInternalState: T({
1989
- reducer: A,
1023
+ helpInternalState: m({
1024
+ reducer: k,
1990
1025
  default: () => ({
1991
1026
  toolCallMessage: void 0
1992
1027
  })
1993
1028
  })
1994
- }), Ba = (e, t) => {
1995
- const r = Array.from(e.values()).find(
1996
- ({ layerItem: n }) => n.title?.toLowerCase().includes(t.toLowerCase())
1997
- );
1998
- if (!r) {
1999
- const n = Array.from(e.values()).map((l) => l.layerItem.title).join(", ");
2000
- return `Could not find a layer matching "${t}". Available layers: ${n}`;
2001
- }
2002
- const a = Array.from(r.fieldRegistry.values()), o = a.map((n) => `- **${n.alias || n.name}** (\`${n.name}\`, ${n.type})${n.description ? `: ${n.description}` : ""}`).join(`
2003
- `);
2004
- return `**${r.layerItem.title}** has ${a.length} field(s):
2005
-
2006
- ${o}`;
2007
- }, Ua = ({ layerTitle: e }, t) => {
2008
- const r = ve(t, "layersAndFieldsRegistry");
2009
- return Ba(r, e);
2010
- }, oi = f(Ua, {
2011
- name: "listLayerFields",
2012
- 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.",
2013
- schema: s.object({
2014
- layerTitle: s.string().describe("The title or partial title of the layer to list fields for.")
2015
- })
2016
- }), ni = T.Root({
2017
- ...K(),
2018
- intent: T({
1029
+ }), _a = m.Root({
1030
+ ...G(),
1031
+ intent: m({
2019
1032
  reducer: (e, t) => t
2020
1033
  }),
2021
- arcgisKnowledgeMessages: T({
2022
- reducer: we,
1034
+ arcgisKnowledgeMessages: m({
1035
+ reducer: ee,
2023
1036
  default: () => []
2024
1037
  }),
2025
- arcgisKnowledgeToolResult: T({
1038
+ arcgisKnowledgeToolResult: m({
2026
1039
  reducer: (e, t) => t,
2027
1040
  default: () => null
2028
1041
  })
2029
1042
  });
2030
- function le(e) {
1043
+ function W(e) {
2031
1044
  const t = e.map?.allLayers.filter((r) => r.type === "knowledge-graph");
2032
1045
  if (!t || t?.length !== 1)
2033
1046
  throw new Error("The Knowledge Agent currently only supports maps with exactly one Knowledge Graph Layer.");
2034
1047
  }
2035
- function N(e) {
1048
+ function x(e) {
2036
1049
  return !!e?.map && !("activeLinkChartLayer" in e.map);
2037
1050
  }
2038
- async function J(e) {
2039
- !e || N(e) || !e.map?.diagramNodesExtent || await e.goTo(e.map.diagramNodesExtent);
1051
+ async function j(e) {
1052
+ !e || x(e) || !e.map?.diagramNodesExtent || await e.goTo(e.map.diagramNodesExtent);
2040
1053
  }
2041
- function G(e) {
1054
+ function q(e) {
2042
1055
  const r = e?.configurable?.context;
2043
1056
  if (!r || typeof r != "object")
2044
1057
  throw new Error("ArcgisKnowledgeAgent context missing");
2045
1058
  if (!("view" in r))
2046
1059
  throw new Error("View context missing");
2047
1060
  const a = r.view;
2048
- return a.map && !("activeLinkChartLayer" in a.map) && le(a), {
1061
+ return a.map && !("activeLinkChartLayer" in a.map) && W(a), {
2049
1062
  view: a
2050
1063
  };
2051
1064
  }
2052
- function ii(e) {
1065
+ function Qa(e) {
2053
1066
  const r = e?.configurable?.context;
2054
- if (Fe(e) === "knowledgeGraph")
1067
+ if (te(e) === "knowledgeGraph")
2055
1068
  return "knowledgeGraph";
2056
1069
  const o = r.view;
2057
- return N(o) ? (le(o), "map") : "linkChart";
1070
+ return x(o) ? (W(o), "map") : "linkChart";
2058
1071
  }
2059
- async function O(e) {
1072
+ async function M(e) {
2060
1073
  const r = e?.configurable?.context;
2061
- if (Fe(e) === "knowledgeGraph")
1074
+ if (te(e) === "knowledgeGraph")
2062
1075
  return r;
2063
1076
  {
2064
1077
  const o = r.view.map;
2065
1078
  if (o && "activeLinkChartLayer" in o) {
2066
- const n = o.knowledgeGraph?.url;
2067
- if (!n)
1079
+ const i = o.knowledgeGraph?.url;
1080
+ if (!i)
2068
1081
  throw new Error("Knowledge graph url missing from link chart.");
2069
1082
  return {
2070
- knowledgeGraph: await ye(n)
1083
+ knowledgeGraph: await Z(i)
2071
1084
  };
2072
1085
  } else {
2073
- le(r.view);
2074
- const l = (r.view.map?.allLayers.find(
2075
- (c) => c.type === "knowledge-graph"
1086
+ W(r.view);
1087
+ const s = (r.view.map?.allLayers.find(
1088
+ (l) => l.type === "knowledge-graph"
2076
1089
  )).url;
2077
- if (!l)
1090
+ if (!s)
2078
1091
  throw new Error("Knowledge graph url missing from map.");
2079
1092
  return {
2080
- knowledgeGraph: await ye(l)
1093
+ knowledgeGraph: await Z(s)
2081
1094
  };
2082
1095
  }
2083
1096
  }
2084
1097
  }
2085
- function Fe(e) {
1098
+ function te(e) {
2086
1099
  const r = e?.configurable?.context;
2087
1100
  if (!r || typeof r != "object")
2088
1101
  throw new Error("ArcgisKnowledgeAgent context missing");
@@ -2094,12 +1107,12 @@ function Fe(e) {
2094
1107
  return "view";
2095
1108
  throw new Error("ArcgisKnowledgeAgent context must have either a view or knowledgeGraph property.");
2096
1109
  }
2097
- class Ka {
1110
+ class Br {
2098
1111
  constructor(t) {
2099
- this.dataModel = t, this.kind = "GraphQueryGenerationRequest", this.explainQuery = !0, this.schemaInformation = ce.fromDataModel(t);
1112
+ this.dataModel = t, this.kind = "GraphQueryGenerationRequest", this.explainQuery = !0, this.schemaInformation = B.fromDataModel(t);
2100
1113
  }
2101
1114
  }
2102
- class ce {
1115
+ class B {
2103
1116
  constructor() {
2104
1117
  this.schemaType = "ArcgisGraphSchema", this.entityTypes = [], this.relationshipTypes = [], this.identifierInfo = {
2105
1118
  mappingInfo: {
@@ -2109,14 +1122,14 @@ class ce {
2109
1122
  };
2110
1123
  }
2111
1124
  static fromDataModel(t) {
2112
- const r = new ce();
1125
+ const r = new B();
2113
1126
  for (const a of t.entityTypes)
2114
- r.entityTypes.push(j.fromEntityType(a));
1127
+ r.entityTypes.push(A.fromEntityType(a));
2115
1128
  for (const a of t.relationshipTypes)
2116
- r.relationshipTypes.push(Ha.fromRelationshipType(a));
1129
+ r.relationshipTypes.push(Ur.fromRelationshipType(a));
2117
1130
  return r.identifierInfo = {
2118
1131
  mappingInfo: {
2119
- identifierMapsTo: Ja(
1132
+ identifierMapsTo: Hr(
2120
1133
  t.identifierInfo.identifierMappingInfo.identifierInfoType
2121
1134
  ),
2122
1135
  identifierPropertyName: t.identifierInfo.identifierMappingInfo.uniformPropertyIdentifier.identifierPropertyName
@@ -2130,19 +1143,19 @@ class ce {
2130
1143
  Relationship Types: ${a}.`;
2131
1144
  }
2132
1145
  }
2133
- class j {
1146
+ class A {
2134
1147
  constructor() {
2135
1148
  this.name = "", this.properties = [];
2136
1149
  }
2137
1150
  static fromEntityType(t) {
2138
- const r = new j();
2139
- r.name = t.name, r.alias = t.alias ? t.alias : void 0, r.role = Ya(t.role);
1151
+ const r = new A();
1152
+ r.name = t.name, r.alias = t.alias ? t.alias : void 0, r.role = Jr(t.role);
2140
1153
  for (const a of t.properties) {
2141
1154
  const o = {
2142
1155
  name: a.name,
2143
1156
  alias: a.alias ? a.alias : void 0,
2144
1157
  fieldType: a.fieldType,
2145
- role: Za(a.role),
1158
+ role: Yr(a.role),
2146
1159
  geometryDef: a.fieldType === "esriFieldTypeGeometry" ? {
2147
1160
  geometryType: a.geometryType ?? "esriGeometryAny",
2148
1161
  hasM: a.hasM ? a.hasM : void 0,
@@ -2154,12 +1167,12 @@ class j {
2154
1167
  return r;
2155
1168
  }
2156
1169
  }
2157
- class Ha extends j {
1170
+ class Ur extends A {
2158
1171
  constructor() {
2159
1172
  super(...arguments), this.observedEndPoints = [];
2160
1173
  }
2161
1174
  static fromRelationshipType(t) {
2162
- const r = j.fromEntityType(t);
1175
+ const r = A.fromEntityType(t);
2163
1176
  r.observedEndPoints = [];
2164
1177
  for (const a of t.endPoints)
2165
1178
  r.observedEndPoints.push({
@@ -2169,7 +1182,7 @@ class Ha extends j {
2169
1182
  return r;
2170
1183
  }
2171
1184
  }
2172
- const Ja = (e) => {
1185
+ const Hr = (e) => {
2173
1186
  switch (e) {
2174
1187
  case "esriIdentifierInfoTypeUNSPECIFIED":
2175
1188
  return "UNSPECIFIED";
@@ -2180,7 +1193,7 @@ const Ja = (e) => {
2180
1193
  default:
2181
1194
  return e;
2182
1195
  }
2183
- }, Ya = (e) => {
1196
+ }, Jr = (e) => {
2184
1197
  switch (e) {
2185
1198
  case "Regular":
2186
1199
  return "esriGraphNamedObjectRegular";
@@ -2192,7 +1205,7 @@ const Ja = (e) => {
2192
1205
  return e;
2193
1206
  }
2194
1207
  };
2195
- function Za(e) {
1208
+ function Yr(e) {
2196
1209
  switch (e) {
2197
1210
  case "esriGraphPropertyRegular":
2198
1211
  return "Regular";
@@ -2230,11 +1243,11 @@ function Za(e) {
2230
1243
  return "Regular";
2231
1244
  }
2232
1245
  }
2233
- function Y(e) {
1246
+ function F(e) {
2234
1247
  return e?.signal;
2235
1248
  }
2236
- async function Xa(e, t) {
2237
- const r = await W("arcgis_knowledge_cypher_query_prompt");
1249
+ async function Zr(e, t) {
1250
+ const r = await L("arcgis_knowledge_cypher_query_prompt");
2238
1251
  return t ? `${e} ${r}
2239
1252
 
2240
1253
  Your previous attempt to generate a cypher query failed. See the details below and generate a new cypher query that avoids this error.
@@ -2244,424 +1257,424 @@ Execution Error: ${t.executionError}
2244
1257
  Failed Query:
2245
1258
  ${t.failedGraphQuery}` : `${e} ${r}`;
2246
1259
  }
2247
- async function eo(e, t, r, a) {
2248
- const { graphQuery: o, explanation: n } = await ue(e, t, r, a);
2249
- return { graphQuery: o, explanation: n };
1260
+ async function Xr(e, t, r, a) {
1261
+ const { graphQuery: o, explanation: i } = await U(e, t, r, a);
1262
+ return { graphQuery: o, explanation: i };
2250
1263
  }
2251
- async function ue(e, t, r, a, o) {
2252
- const n = {
2253
- message: await Xa(e, o),
2254
- context: new Ka(t)
2255
- }, l = Y(a);
2256
- await R({ text: "Attempting to generate a cypher query from your prompt..." }, a);
2257
- const i = await pe(`${r}/chat`, {
1264
+ async function U(e, t, r, a, o) {
1265
+ const i = {
1266
+ message: await Zr(e, o),
1267
+ context: new Br(t)
1268
+ }, s = F(a);
1269
+ await T({ text: "Attempting to generate a cypher query from your prompt..." }, a);
1270
+ const n = await J(`${r}/chat`, {
2258
1271
  method: "post",
2259
- body: JSON.stringify(n),
1272
+ body: JSON.stringify(i),
2260
1273
  headers: {
2261
1274
  "Content-Type": "application/json",
2262
- token: de.findCredential(k.getDefault().url)?.token ?? ""
1275
+ token: H.findCredential(P.getDefault().url)?.token ?? ""
2263
1276
  },
2264
- signal: l
1277
+ signal: s
2265
1278
  });
2266
- if (i.httpStatus !== 200)
2267
- throw new Error(`Graph query service returned an error: ${i.httpStatus}`, {
2268
- cause: i.data
1279
+ if (n.httpStatus !== 200)
1280
+ throw new Error(`Graph query service returned an error: ${n.httpStatus}`, {
1281
+ cause: n.data
2269
1282
  });
2270
- let c = !1;
2271
- const u = Date.now();
2272
- let d = i.data.sequenceNumber, p = "", m = "", w = 1;
2273
- for (; !c; ) {
2274
- await new Promise((y) => setTimeout(y, 1e3)), await R(
2275
- { text: `Periodically requesting status of job from ArcGIS AI Services${"...".substring(0, w)}` },
1283
+ let l = !1;
1284
+ const p = Date.now();
1285
+ let d = n.data.sequenceNumber, u = "", h = "", f = 1;
1286
+ for (; !l; ) {
1287
+ await new Promise((w) => setTimeout(w, 1e3)), await T(
1288
+ { text: `Periodically requesting status of job from ArcGIS AI Services${"...".substring(0, f)}` },
2276
1289
  a
2277
- ), w = w % 3 + 1;
2278
- const h = await pe(`${r}/chat`, {
1290
+ ), f = f % 3 + 1;
1291
+ const y = await J(`${r}/chat`, {
2279
1292
  method: "post",
2280
1293
  body: JSON.stringify({
2281
- conversationId: i.data.conversationId,
2282
- inquiryId: i.data.inquiryId,
1294
+ conversationId: n.data.conversationId,
1295
+ inquiryId: n.data.inquiryId,
2283
1296
  ackSequenceNumber: d
2284
1297
  }),
2285
1298
  headers: {
2286
1299
  "Content-Type": "application/json",
2287
- token: de.findCredential(k.getDefault().url)?.token ?? ""
1300
+ token: H.findCredential(P.getDefault().url)?.token ?? ""
2288
1301
  },
2289
- signal: l
1302
+ signal: s
2290
1303
  });
2291
- if (h.httpStatus !== 200)
2292
- throw new Error(`Graph query service polling returned an error: ${h.httpStatus}`, {
2293
- cause: h.data
1304
+ if (y.httpStatus !== 200)
1305
+ throw new Error(`Graph query service polling returned an error: ${y.httpStatus}`, {
1306
+ cause: y.data
2294
1307
  });
2295
- if (h.data.context?.kind) {
2296
- if (h.data.context.kind !== "GraphQueryGenerationResponse")
2297
- throw new Error(`Unexpected response from graph query service polling. Message: ${h.data.message}`, {
2298
- cause: h.data
1308
+ if (y.data.context?.kind) {
1309
+ if (y.data.context.kind !== "GraphQueryGenerationResponse")
1310
+ throw new Error(`Unexpected response from graph query service polling. Message: ${y.data.message}`, {
1311
+ cause: y.data
2299
1312
  });
2300
- p = h.data.context.graphQuery, m = h.data.message || "", c = !0;
2301
- } else if (!h.data.hasMore)
2302
- c = !0;
2303
- else if (Date.now() - u > 6e4)
1313
+ u = y.data.context.graphQuery, h = y.data.message || "", l = !0;
1314
+ } else if (!y.data.hasMore)
1315
+ l = !0;
1316
+ else if (Date.now() - p > 6e4)
2304
1317
  throw new Error("Graph query service polling timed out after 1 minute.");
2305
- d = h.data.sequenceNumber;
1318
+ d = y.data.sequenceNumber;
2306
1319
  }
2307
- return { graphQuery: p, explanation: m };
1320
+ return { graphQuery: u, explanation: h };
2308
1321
  }
2309
- function to(e, t) {
2310
- q(e, (r) => {
1322
+ function et(e, t) {
1323
+ C(e, (r) => {
2311
1324
  t.set(`${r.typeName}__${r.id}`, {
2312
1325
  id: r.id,
2313
1326
  typeName: r.typeName
2314
1327
  });
2315
1328
  });
2316
1329
  }
2317
- function q(e, t) {
1330
+ function C(e, t) {
2318
1331
  if (!(!e || typeof e != "object")) {
2319
- if (ao(e))
1332
+ if (tt(e))
2320
1333
  for (const r of e.path)
2321
- q(r, t);
2322
- else if (ro(e))
1334
+ C(r, t);
1335
+ else if (rt(e))
2323
1336
  t(e);
2324
1337
  else if (Array.isArray(e))
2325
1338
  for (const r of e)
2326
- q(r, t);
2327
- else if (oo(e))
1339
+ C(r, t);
1340
+ else if (at(e))
2328
1341
  for (const r of Object.values(e.properties ?? {}))
2329
- q(r, t);
1342
+ C(r, t);
2330
1343
  }
2331
1344
  }
2332
- function ro(e) {
1345
+ function rt(e) {
2333
1346
  return !e || typeof e != "object" || Array.isArray(e) ? !1 : "id" in e && "typeName" in e;
2334
1347
  }
2335
- function ao(e) {
1348
+ function tt(e) {
2336
1349
  return !e || typeof e != "object" || Array.isArray(e) ? !1 : e && "path" in e && Array.isArray(e.path);
2337
1350
  }
2338
- function oo(e) {
1351
+ function at(e) {
2339
1352
  return !e || typeof e != "object" || Array.isArray(e) || "id" in e ? !1 : "properties" in e && typeof e.properties == "object";
2340
1353
  }
2341
- function no(e, t) {
1354
+ function ot(e, t) {
2342
1355
  const r = [], a = [], o = [
2343
1356
  [t.dataModel.entityTypes, r],
2344
1357
  [t.dataModel.relationshipTypes, a]
2345
1358
  ];
2346
- for (const [n, l] of o)
2347
- for (const i of n) {
2348
- const c = e.getMemberIdsByType(i.name);
2349
- l.push(...c);
1359
+ for (const [i, s] of o)
1360
+ for (const n of i) {
1361
+ const l = e.getMemberIdsByType(n.name);
1362
+ s.push(...l);
2350
1363
  }
2351
1364
  return { entityIds: r, relationshipIds: a };
2352
1365
  }
2353
- function io(e, t) {
2354
- const r = { entityIds: new Array(), relationshipIds: new Array() }, a = [], n = e?.allLayers.find((c) => c.type === "knowledge-graph")?.inclusionModeDefinition;
2355
- if (!n)
1366
+ function nt(e, t) {
1367
+ const r = { entityIds: new Array(), relationshipIds: new Array() }, a = [], i = e?.allLayers.find((l) => l.type === "knowledge-graph")?.inclusionModeDefinition;
1368
+ if (!i)
2356
1369
  return { allNamedTypesFullyDynamic: !0, bindParameters: r, nonDynamicTypes: a };
2357
- const l = [
1370
+ const s = [
2358
1371
  [t.dataModel.entityTypes, r.entityIds],
2359
1372
  [t.dataModel.relationshipTypes, r.relationshipIds]
2360
1373
  ];
2361
- let i = !0;
2362
- for (const [c, u] of l)
2363
- for (const d of c) {
2364
- const p = n.namedTypeDefinitions.get(d.name);
2365
- if (!p) {
2366
- i = !1, a.push(d.name);
1374
+ let n = !0;
1375
+ for (const [l, p] of s)
1376
+ for (const d of l) {
1377
+ const u = i.namedTypeDefinitions.get(d.name);
1378
+ if (!u) {
1379
+ n = !1, a.push(d.name);
2367
1380
  continue;
2368
1381
  }
2369
- if (!p.useAllData) {
2370
- i = !1, a.push(d.name);
2371
- for (const [m] of p.members || [])
2372
- u.push(m);
1382
+ if (!u.useAllData) {
1383
+ n = !1, a.push(d.name);
1384
+ for (const [h] of u.members || [])
1385
+ p.push(h);
2373
1386
  }
2374
1387
  }
2375
- return { allNamedTypesFullyDynamic: i, bindParameters: r, nonDynamicTypes: a };
1388
+ return { allNamedTypesFullyDynamic: n, bindParameters: r, nonDynamicTypes: a };
2376
1389
  }
2377
- const z = 3;
2378
- function ke(e, t = 100) {
1390
+ const $ = 3;
1391
+ function ae(e, t = 100) {
2379
1392
  const r = {};
2380
1393
  for (const a of Object.entries(e.properties ?? {})) {
2381
- const [o, n] = a;
2382
- typeof n == "string" && n.length > t ? r[o] = `${n.slice(0, t)}... (truncated, original length: ${n.length})` : r[o] = n;
1394
+ const [o, i] = a;
1395
+ typeof i == "string" && i.length > t ? r[o] = `${i.slice(0, t)}... (truncated, original length: ${i.length})` : r[o] = i;
2383
1396
  }
2384
1397
  return e.properties = r, e;
2385
1398
  }
2386
- function D(e) {
1399
+ function E(e) {
2387
1400
  return typeof e != "object" || e === null ? String(e) : "details" in e && typeof e.details == "object" && e.details !== null && "errorMessage" in e.details && typeof e.details.errorMessage == "string" ? e.details.errorMessage : "message" in e && typeof e.message == "string" ? e.message : String(e);
2388
1401
  }
2389
- const so = async ({
1402
+ const it = async ({
2390
1403
  kg: e,
2391
1404
  queryParams: t,
2392
1405
  targetStructure: r,
2393
1406
  targetStructureReducer: a,
2394
1407
  requestOptions: o,
2395
- queryRowLimit: n,
2396
- queryTimeoutMs: l
1408
+ queryRowLimit: i,
1409
+ queryTimeoutMs: s
2397
1410
  }) => {
2398
- let i = null, c = r;
2399
- const u = new AbortController(), d = o?.signal, p = () => {
2400
- u.abort(d?.reason);
1411
+ let n = null, l = r;
1412
+ const p = new AbortController(), d = o?.signal, u = () => {
1413
+ p.abort(d?.reason);
2401
1414
  };
2402
- d && (d.aborted ? u.abort(d.reason) : d.addEventListener("abort", p, { once: !0 }));
1415
+ d && (d.aborted ? p.abort(d.reason) : d.addEventListener("abort", u, { once: !0 }));
2403
1416
  try {
2404
- const m = await yt(e, t, o);
2405
- i = m.resultHeader;
2406
- const w = m.resultRowsStream.getReader();
2407
- let h = 0;
2408
- const y = Date.now(), g = !1;
1417
+ const h = await je(e, t, o);
1418
+ n = h.resultHeader;
1419
+ const f = h.resultRowsStream.getReader();
1420
+ let y = 0;
1421
+ const w = Date.now(), b = !1;
2409
1422
  for (; ; ) {
2410
- const { done: b, value: x } = await w.read();
2411
- if (b)
1423
+ const { done: R, value: z } = await f.read();
1424
+ if (R)
2412
1425
  break;
2413
- if (!g && l && Date.now() - y > l)
2414
- return u.abort(), { type: "timeout" };
2415
- for (const S of x) {
2416
- if (h++, n && h > n)
2417
- return u.abort(), { type: "success", rowLimitReached: !0, resultHeader: i, processedResult: c };
2418
- c = a(c, S);
1426
+ if (!b && s && Date.now() - w > s)
1427
+ return p.abort(), { type: "timeout" };
1428
+ for (const se of z) {
1429
+ if (y++, i && y > i)
1430
+ return p.abort(), { type: "success", rowLimitReached: !0, resultHeader: n, processedResult: l };
1431
+ l = a(l, se);
2419
1432
  }
2420
1433
  }
2421
- } catch (m) {
2422
- return u.signal.aborted ? { type: "aborted" } : { type: "error", errorMessage: D(m), error: m };
1434
+ } catch (h) {
1435
+ return p.signal.aborted ? { type: "aborted" } : { type: "error", errorMessage: E(h), error: h };
2423
1436
  } finally {
2424
- d?.removeEventListener("abort", p);
1437
+ d?.removeEventListener("abort", u);
2425
1438
  }
2426
- return { type: "success", rowLimitReached: !1, resultHeader: i, processedResult: c };
1439
+ return { type: "success", rowLimitReached: !1, resultHeader: n, processedResult: l };
2427
1440
  };
2428
- async function Ne({
1441
+ async function oe({
2429
1442
  prompt: e,
2430
1443
  bindParameters: t,
2431
1444
  kg: r,
2432
1445
  graphQueryServiceUrl: a,
2433
1446
  targetStructure: o,
2434
- targetStructureReducer: n,
2435
- requestOptions: l,
2436
- queryRowLimit: i,
2437
- queryTimeoutMs: c,
2438
- config: u
1447
+ targetStructureReducer: i,
1448
+ requestOptions: s,
1449
+ queryRowLimit: n,
1450
+ queryTimeoutMs: l,
1451
+ config: p
2439
1452
  }) {
2440
1453
  let d;
2441
- for (let p = 1; p <= z; p++) {
2442
- let m;
1454
+ for (let u = 1; u <= $; u++) {
1455
+ let h;
2443
1456
  try {
2444
- m = await ue(e, r.dataModel, a, u, d);
2445
- } catch (g) {
1457
+ h = await U(e, r.dataModel, a, p, d);
1458
+ } catch (b) {
2446
1459
  return {
2447
1460
  type: "generation-error",
2448
- errorMessage: D(g),
2449
- error: g
1461
+ errorMessage: E(b),
1462
+ error: b
2450
1463
  };
2451
1464
  }
2452
- await R(
1465
+ await T(
2453
1466
  {
2454
- text: `Attempting to execute query: ${m.graphQuery.substring(0, 500)}${m.graphQuery.length > 500 ? "..." : ""}`
1467
+ text: `Attempting to execute query: ${h.graphQuery.substring(0, 500)}${h.graphQuery.length > 500 ? "..." : ""}`
2455
1468
  },
2456
- u
1469
+ p
2457
1470
  );
2458
- const w = await lo(m.graphQuery, t), h = await so({
1471
+ const f = await st(h.graphQuery, t), y = await it({
2459
1472
  kg: r,
2460
- queryParams: new Se({
2461
- openCypherQuery: m.graphQuery,
2462
- bindParameters: w
1473
+ queryParams: new re({
1474
+ openCypherQuery: h.graphQuery,
1475
+ bindParameters: f
2463
1476
  }),
2464
1477
  targetStructure: o,
2465
- targetStructureReducer: n,
2466
- requestOptions: l,
2467
- queryRowLimit: i,
2468
- queryTimeoutMs: c
2469
- }), y = h.type === "aborted" ? "Query execution was aborted." : h.type === "timeout" ? "Query execution timed out." : h.type === "error" ? `Query failed with error: ${h.errorMessage}` : "";
2470
- if (h.type === "success")
1478
+ targetStructureReducer: i,
1479
+ requestOptions: s,
1480
+ queryRowLimit: n,
1481
+ queryTimeoutMs: l
1482
+ }), w = y.type === "aborted" ? "Query execution was aborted." : y.type === "timeout" ? "Query execution timed out." : y.type === "error" ? `Query failed with error: ${y.errorMessage}` : "";
1483
+ if (y.type === "success")
2471
1484
  return {
2472
1485
  type: "success",
2473
- graphQuery: m.graphQuery,
2474
- explanation: m.explanation,
2475
- rowLimitReached: h.rowLimitReached,
2476
- resultHeader: h.resultHeader,
2477
- processedResult: h.processedResult
1486
+ graphQuery: h.graphQuery,
1487
+ explanation: h.explanation,
1488
+ rowLimitReached: y.rowLimitReached,
1489
+ resultHeader: y.resultHeader,
1490
+ processedResult: y.processedResult
2478
1491
  };
2479
- if (h.type === "aborted")
1492
+ if (y.type === "aborted")
2480
1493
  return {
2481
1494
  type: "aborted",
2482
- errorMessage: y,
2483
- graphQuery: m.graphQuery,
2484
- explanation: m.explanation
1495
+ errorMessage: w,
1496
+ graphQuery: h.graphQuery,
1497
+ explanation: h.explanation
2485
1498
  };
2486
- if (p >= z)
2487
- return h.type === "timeout" ? {
1499
+ if (u >= $)
1500
+ return y.type === "timeout" ? {
2488
1501
  type: "timeout",
2489
- errorMessage: y,
2490
- graphQuery: m.graphQuery,
2491
- explanation: m.explanation
1502
+ errorMessage: w,
1503
+ graphQuery: h.graphQuery,
1504
+ explanation: h.explanation
2492
1505
  } : {
2493
1506
  type: "execution-error",
2494
- errorMessage: y,
2495
- error: h.error,
2496
- graphQuery: m.graphQuery,
2497
- explanation: m.explanation
1507
+ errorMessage: w,
1508
+ error: y.error,
1509
+ graphQuery: h.graphQuery,
1510
+ explanation: h.explanation
2498
1511
  };
2499
1512
  d = {
2500
- failedGraphQuery: m.graphQuery,
2501
- executionError: y,
2502
- attemptCount: p
2503
- }, await R(
2504
- { text: `Attempt ${p} failed with error: ${y}. Retrying...` },
2505
- u
1513
+ failedGraphQuery: h.graphQuery,
1514
+ executionError: w,
1515
+ attemptCount: u
1516
+ }, await T(
1517
+ { text: `Attempt ${u} failed with error: ${w}. Retrying...` },
1518
+ p
2506
1519
  );
2507
1520
  }
2508
1521
  throw new Error(
2509
- `Failed to execute generated cypher due to an unexpected error after ${z} attempts.`
1522
+ `Failed to execute generated cypher due to an unexpected error after ${$} attempts.`
2510
1523
  );
2511
1524
  }
2512
- const lo = async (e, t) => {
1525
+ const st = async (e, t) => {
2513
1526
  if (!t)
2514
1527
  return {};
2515
- const { bindParameters: r, parseErrors: a } = await wt(e);
1528
+ const { bindParameters: r, parseErrors: a } = await Qe(e);
2516
1529
  if (a)
2517
1530
  return t;
2518
1531
  const o = {};
2519
- for (const n of r)
2520
- n in t && (o[n] = t[n]);
1532
+ for (const i of r)
1533
+ i in t && (o[i] = t[i]);
2521
1534
  return o;
2522
- }, co = async ({
1535
+ }, lt = async ({
2523
1536
  kg: e,
2524
1537
  searchQuery: t,
2525
1538
  typeCategoryFilter: r,
2526
1539
  namedTypesFilter: a,
2527
1540
  searchResultLimit: o,
2528
- requestOptions: n
1541
+ requestOptions: i
2529
1542
  }) => {
2530
- const l = [];
2531
- let i = [r];
2532
- r === "both" && !e.serviceDefinition.serviceCapabilities.searchCapabilities.searchTypeFilterCapabilities.includes("esriTypeBoth") && (i = ["entity", "relationship"]);
2533
- const c = o ?? 1 / 0;
1543
+ const s = [];
1544
+ let n = [r];
1545
+ r === "both" && !e.serviceDefinition.serviceCapabilities.searchCapabilities.searchTypeFilterCapabilities.includes("esriTypeBoth") && (n = ["entity", "relationship"]);
1546
+ const l = o ?? 1 / 0;
2534
1547
  try {
2535
- for (const u of i) {
2536
- const d = c - l.length;
1548
+ for (const p of n) {
1549
+ const d = l - s.length;
2537
1550
  if (d <= 0)
2538
1551
  break;
2539
- const w = (await ft(
1552
+ const f = (await Fe(
2540
1553
  e,
2541
- new gt({
1554
+ new _e({
2542
1555
  searchQuery: t,
2543
- typeCategoryFilter: u,
1556
+ typeCategoryFilter: p,
2544
1557
  namedTypesFilter: a ?? void 0,
2545
1558
  num: d
2546
1559
  }),
2547
- n
1560
+ i
2548
1561
  )).resultRowsStream.getReader();
2549
- let h = !1;
2550
- for (; !h; ) {
2551
- const { done: y, value: g } = await w.read();
2552
- if (y) {
2553
- h = !0;
1562
+ let y = !1;
1563
+ for (; !y; ) {
1564
+ const { done: w, value: b } = await f.read();
1565
+ if (w) {
1566
+ y = !0;
2554
1567
  break;
2555
1568
  }
2556
- for (const b of g)
2557
- for (const x of b)
2558
- l.push(x);
1569
+ for (const R of b)
1570
+ for (const z of R)
1571
+ s.push(z);
2559
1572
  }
2560
1573
  }
2561
- } catch (u) {
2562
- const d = D(u);
2563
- return n?.signal?.aborted ? {
1574
+ } catch (p) {
1575
+ const d = E(p);
1576
+ return i?.signal?.aborted ? {
2564
1577
  type: "aborted",
2565
1578
  errorMessage: d,
2566
- error: u
2567
- } : { type: "error", errorMessage: d, error: u };
1579
+ error: p
1580
+ } : { type: "error", errorMessage: d, error: p };
2568
1581
  }
2569
1582
  return {
2570
1583
  type: "success",
2571
- results: l
1584
+ results: s
2572
1585
  };
2573
- }, Ie = "IMPORTANT: The generated cypher query must return entire entities and relationships ONLY.";
2574
- async function qe({
1586
+ }, ne = "IMPORTANT: The generated cypher query must return entire entities and relationships ONLY.";
1587
+ async function ie({
2575
1588
  prompt: e,
2576
1589
  view: t,
2577
1590
  knowledgeGraph: r,
2578
1591
  includeReturnEntityAndRelationshipContext: a = !1
2579
1592
  }) {
2580
1593
  const o = [e];
2581
- if (a && o.push(Ie), !N(t) && t.map) {
2582
- const d = await W("arcgis_knowledge_current_lc_context"), p = no(t.map, r);
1594
+ if (a && o.push(ne), !x(t) && t.map) {
1595
+ const d = await L("arcgis_knowledge_current_lc_context"), u = ot(t.map, r);
2583
1596
  return o.push(d), {
2584
1597
  enhancedPrompt: o.join(`
2585
1598
 
2586
1599
  `),
2587
- bindParameters: p,
1600
+ bindParameters: u,
2588
1601
  allNamedTypesFullyDynamic: !1
2589
1602
  };
2590
1603
  }
2591
- const n = t.map, { allNamedTypesFullyDynamic: l, bindParameters: i, nonDynamicTypes: c } = io(
2592
- n,
1604
+ const i = t.map, { allNamedTypesFullyDynamic: s, bindParameters: n, nonDynamicTypes: l } = nt(
1605
+ i,
2593
1606
  r
2594
1607
  );
2595
- if (l)
1608
+ if (s)
2596
1609
  return {
2597
1610
  enhancedPrompt: o.join(`
2598
1611
 
2599
1612
  `),
2600
- bindParameters: i,
1613
+ bindParameters: n,
2601
1614
  allNamedTypesFullyDynamic: !0
2602
1615
  };
2603
- const u = (await W("arcgis_knowledge_current_map_context")).replaceAll(
1616
+ const p = (await L("arcgis_knowledge_current_map_context")).replaceAll(
2604
1617
  "{nonDynamicTypes}",
2605
- JSON.stringify(c)
1618
+ JSON.stringify(l)
2606
1619
  );
2607
- return o.push(u), {
1620
+ return o.push(p), {
2608
1621
  enhancedPrompt: o.join(`
2609
1622
 
2610
1623
  `),
2611
- bindParameters: i,
2612
- allNamedTypesFullyDynamic: l
1624
+ bindParameters: n,
1625
+ allNamedTypesFullyDynamic: s
2613
1626
  };
2614
1627
  }
2615
- async function uo(e, t, r, a, o, n) {
2616
- const { view: l } = o, i = await Ne({
1628
+ async function ct(e, t, r, a, o, i) {
1629
+ const { view: s } = o, n = await oe({
2617
1630
  prompt: e,
2618
1631
  bindParameters: t,
2619
1632
  kg: r,
2620
1633
  graphQueryServiceUrl: a,
2621
1634
  targetStructure: /* @__PURE__ */ new Map(),
2622
- targetStructureReducer: (m, w) => {
2623
- for (const h of w)
2624
- to(h, m);
2625
- return m;
1635
+ targetStructureReducer: (h, f) => {
1636
+ for (const y of f)
1637
+ et(y, h);
1638
+ return h;
2626
1639
  },
2627
1640
  requestOptions: {
2628
- signal: Y(n),
2629
- timeout: n?.timeout
1641
+ signal: F(i),
1642
+ timeout: i?.timeout
2630
1643
  },
2631
- config: n
1644
+ config: i
2632
1645
  });
2633
- if (i.type !== "success") {
2634
- const m = i.type === "generation-error" ? i.errorMessage : `${i.errorMessage} Cypher query: ${i.graphQuery}`;
2635
- throw new Error(`Failed to add records to the link chart. ${m}`);
1646
+ if (n.type !== "success") {
1647
+ const h = n.type === "generation-error" ? n.errorMessage : `${n.errorMessage} Cypher query: ${n.graphQuery}`;
1648
+ throw new Error(`Failed to add records to the link chart. ${h}`);
2636
1649
  }
2637
- const { graphQuery: c, explanation: u, processedResult: d } = i, p = Array.from(d.values());
2638
- return await R(
1650
+ const { graphQuery: l, explanation: p, processedResult: d } = n, u = Array.from(d.values());
1651
+ return await T(
2639
1652
  {
2640
- text: `Query Results parsed into ${p.length} unique relationships and entities. Atempting to add to link chart...`
1653
+ text: `Query Results parsed into ${u.length} unique relationships and entities. Atempting to add to link chart...`
2641
1654
  },
2642
- n
2643
- ), !N(l) && l?.map ? (await l.map.addRecords(p), await J(l), { generatedQuery: c, explanation: u, addedIdTypePairs: p }) : (await l?.map?.allLayers.find(
2644
- (w) => w.type === "knowledge-graph"
2645
- )?.addRecords(p), { generatedQuery: c, explanation: u, addedIdTypePairs: p });
1655
+ i
1656
+ ), !x(s) && s?.map ? (await s.map.addRecords(u), await j(s), { generatedQuery: l, explanation: p, addedIdTypePairs: u }) : (await s?.map?.allLayers.find(
1657
+ (f) => f.type === "knowledge-graph"
1658
+ )?.addRecords(u), { generatedQuery: l, explanation: p, addedIdTypePairs: u });
2646
1659
  }
2647
- const V = "addRecords", po = s.object({
2648
- prompt: s.string().describe(
1660
+ const N = "addRecords", pt = c.object({
1661
+ prompt: c.string().describe(
2649
1662
  "The user's inquiry and context required in order to generate a cypher query that will be used to add records to the link chart."
2650
1663
  )
2651
- }), mo = async ({ prompt: e }, t) => {
2652
- const { knowledgeGraph: r } = await O(t), a = G(t), { view: o } = a, l = k.getDefault().helperServices, {
2653
- enhancedPrompt: i,
2654
- bindParameters: c,
2655
- allNamedTypesFullyDynamic: u
2656
- } = await qe({
1664
+ }), dt = async ({ prompt: e }, t) => {
1665
+ const { knowledgeGraph: r } = await M(t), a = q(t), { view: o } = a, s = P.getDefault().helperServices, {
1666
+ enhancedPrompt: n,
1667
+ bindParameters: l,
1668
+ allNamedTypesFullyDynamic: p
1669
+ } = await ie({
2657
1670
  prompt: e,
2658
1671
  view: o,
2659
1672
  knowledgeGraph: r,
2660
1673
  includeReturnEntityAndRelationshipContext: !0
2661
1674
  });
2662
- if (u)
1675
+ if (p)
2663
1676
  return {
2664
- toolName: V,
1677
+ toolName: N,
2665
1678
  status: "success",
2666
1679
  summary: "No records have been added to the map because all data in the knowledge graph is contained in the map.",
2667
1680
  details: {
@@ -2671,37 +1684,37 @@ const V = "addRecords", po = s.object({
2671
1684
  }
2672
1685
  };
2673
1686
  try {
2674
- const { generatedQuery: d, explanation: p, addedIdTypePairs: m } = await uo(
2675
- i,
2676
- c,
1687
+ const { generatedQuery: d, explanation: u, addedIdTypePairs: h } = await ct(
1688
+ n,
1689
+ l,
2677
1690
  r,
2678
- `${l.aiAssistantServices.url}${l.aiAssistantServices.graphQueryAssistant}`,
1691
+ `${s.aiAssistantServices.url}${s.aiAssistantServices.graphQueryAssistant}`,
2679
1692
  a,
2680
1693
  t
2681
1694
  );
2682
1695
  return {
2683
- toolName: V,
1696
+ toolName: N,
2684
1697
  status: "success",
2685
1698
  summary: `Records added successfully. Cypher Query used: ${d}
2686
1699
 
2687
- Number of records added: ${m.length}`,
1700
+ Number of records added: ${h.length}`,
2688
1701
  details: {
2689
1702
  generatedQuery: d,
2690
- explanation: p,
2691
- addedIdTypePairs: m
1703
+ explanation: u,
1704
+ addedIdTypePairs: h
2692
1705
  }
2693
1706
  };
2694
1707
  } catch (d) {
2695
- const p = D(d);
1708
+ const u = E(d);
2696
1709
  return {
2697
- toolName: V,
1710
+ toolName: N,
2698
1711
  status: "error",
2699
- errorMessage: `Failed to add records to the link chart. ${p}`,
1712
+ errorMessage: `Failed to add records to the link chart. ${u}`,
2700
1713
  error: d
2701
1714
  };
2702
1715
  }
2703
- }, si = f(mo, {
2704
- name: V,
1716
+ }, Ia = g(dt, {
1717
+ name: N,
2705
1718
  description: `Adds records (entities or relationships) to the current link chart visualization from an inquiry into the knowledge graph data. The inquiry will retrieve data from the graph database that will serve as the basis for the records to be added to the link chart. The user should have explicitly requested to add records to the current link chart from their prompt. "add to new link chart" is not a valid prompt for this tool.
2706
1719
 
2707
1720
  example prompts:
@@ -2713,13 +1726,13 @@ Number of records added: ${m.length}`,
2713
1726
  - "connect company x and company y"
2714
1727
  - "connect all buildings on the link chart"
2715
1728
  `,
2716
- schema: po
1729
+ schema: pt
2717
1730
  });
2718
- async function ho(e, t) {
2719
- return await t.map?.applyLayout(e), await J(t), { appliedLayout: e };
1731
+ async function ut(e, t) {
1732
+ return await t.map?.applyLayout(e), await j(t), { appliedLayout: e };
2720
1733
  }
2721
- const te = "applyLayout", yo = s.object({
2722
- layout: s.enum([
1734
+ const _ = "applyLayout", ht = c.object({
1735
+ layout: c.enum([
2723
1736
  "organic-standard",
2724
1737
  "organic-community",
2725
1738
  "basic-grid",
@@ -2732,19 +1745,19 @@ const te = "applyLayout", yo = s.object({
2732
1745
  ]).describe(
2733
1746
  "The layout mode to apply to the link chart. The value must be one of the following: organic-standard, organic-community, basic-grid, hierarchical-bottom-to-top, radial-root-centric, tree-left-to-right, geographic-organic-standard, chronological-mono-timeline, chronological-multi-timeline"
2734
1747
  )
2735
- }), fo = async ({ layout: e }, t) => {
2736
- const { view: r } = G(t);
2737
- if (N(r))
1748
+ }), yt = async ({ layout: e }, t) => {
1749
+ const { view: r } = q(t);
1750
+ if (x(r))
2738
1751
  return {
2739
- toolName: te,
1752
+ toolName: _,
2740
1753
  status: "error",
2741
1754
  errorMessage: "The applyLayout tool can only be used with a LinkChartView.",
2742
1755
  error: new Error()
2743
1756
  };
2744
1757
  {
2745
- const { appliedLayout: a } = await ho(e, r);
1758
+ const { appliedLayout: a } = await ut(e, r);
2746
1759
  return {
2747
- toolName: te,
1760
+ toolName: _,
2748
1761
  status: "success",
2749
1762
  summary: `Successfully applied layout: ${a}.`,
2750
1763
  details: {
@@ -2752,29 +1765,29 @@ const te = "applyLayout", yo = s.object({
2752
1765
  }
2753
1766
  };
2754
1767
  }
2755
- }, li = f(fo, {
2756
- name: te,
1768
+ }, Oa = g(yt, {
1769
+ name: _,
2757
1770
  description: "Apply a diagram layout to the link chart",
2758
- schema: yo
1771
+ schema: ht
2759
1772
  });
2760
- async function go(e, t) {
2761
- return t.map?.changeNonspatialDataDisplay(e), await J(t), { appliedNonspatialDataDisplayMode: e };
2762
- }
2763
- const re = "changeNonspatialVisibility", wo = s.object({
2764
- setting: s.enum(["hidden", "visible"]).describe("The setting of nonspatial visibility")
2765
- }), bo = async ({ setting: e }, t) => {
2766
- const { view: r } = G(t);
2767
- if (N(r))
1773
+ async function mt(e, t) {
1774
+ return t.map?.changeNonspatialDataDisplay(e), await j(t), { appliedNonspatialDataDisplayMode: e };
1775
+ }
1776
+ const Q = "changeNonspatialVisibility", gt = c.object({
1777
+ setting: c.enum(["hidden", "visible"]).describe("The setting of nonspatial visibility")
1778
+ }), ft = async ({ setting: e }, t) => {
1779
+ const { view: r } = q(t);
1780
+ if (x(r))
2768
1781
  return {
2769
- toolName: re,
1782
+ toolName: Q,
2770
1783
  status: "error",
2771
1784
  errorMessage: "The changeNonspatialVisibility tool can only be used with a LinkChartView.",
2772
1785
  error: new Error()
2773
1786
  };
2774
1787
  {
2775
- const { appliedNonspatialDataDisplayMode: a } = await go(e, r);
1788
+ const { appliedNonspatialDataDisplayMode: a } = await mt(e, r);
2776
1789
  return {
2777
- toolName: re,
1790
+ toolName: Q,
2778
1791
  status: "success",
2779
1792
  summary: `Successfully applied nonspatial visibility setting: ${a}.`,
2780
1793
  details: {
@@ -2782,303 +1795,303 @@ const re = "changeNonspatialVisibility", wo = s.object({
2782
1795
  }
2783
1796
  };
2784
1797
  }
2785
- }, ci = f(bo, {
2786
- name: re,
1798
+ }, Ka = g(ft, {
1799
+ name: Q,
2787
1800
  description: "Change whether or not nonspatial data is visible in the link chart. The value must be either 'hidden' or 'visible'.",
2788
- schema: wo
1801
+ schema: gt
2789
1802
  });
2790
- async function To(e, t, r, a, o) {
2791
- let n, l = "";
2792
- for (let i = 1; i <= z; i++) {
2793
- const { graphQuery: c, explanation: u } = await ue(
1803
+ async function wt(e, t, r, a, o) {
1804
+ let i, s = "";
1805
+ for (let n = 1; n <= $; n++) {
1806
+ const { graphQuery: l, explanation: p } = await U(
2794
1807
  e,
2795
1808
  t.dataModel,
2796
1809
  r,
2797
1810
  o,
2798
- n
1811
+ i
2799
1812
  );
2800
1813
  try {
2801
- await R({ text: `Attempting to create link chart from derived query: ${c}` }, o);
2802
- const d = await ht.fromCypherQuery(
1814
+ await T({ text: `Attempting to create link chart from derived query: ${l}` }, o);
1815
+ const d = await Ge.fromCypherQuery(
2803
1816
  t,
2804
- new Se({
2805
- openCypherQuery: c
1817
+ new re({
1818
+ openCypherQuery: l
2806
1819
  })
2807
1820
  );
2808
- await R({ text: "Link chart created successfully, loading..." }, o), await d.load();
2809
- const p = a.map;
2810
- return a.map = d, await a.when(), await Pe.whenOnce(() => !a.updating), d.entityCount === 0 && d.relationshipCount === 0 ? (a.map === d && (a.map = p), d.destroy(), {
1821
+ await T({ text: "Link chart created successfully, loading..." }, o), await d.load();
1822
+ const u = a.map;
1823
+ return a.map = d, await a.when(), await ce.whenOnce(() => !a.updating), d.entityCount === 0 && d.relationshipCount === 0 ? (a.map === d && (a.map = u), d.destroy(), {
2811
1824
  type: "error",
2812
1825
  errorMessage: `Query returned no results. Cypher Query used to create the link chart:
2813
- ${c}
1826
+ ${l}
2814
1827
 
2815
- Explanation: ${u}`
2816
- }) : (await J(a), {
1828
+ Explanation: ${p}`
1829
+ }) : (await j(a), {
2817
1830
  type: "success",
2818
- graphQuery: c,
2819
- explanation: u
1831
+ graphQuery: l,
1832
+ explanation: p
2820
1833
  });
2821
1834
  } catch (d) {
2822
- const p = D(d);
2823
- if (i >= z) {
2824
- l = p;
1835
+ const u = E(d);
1836
+ if (n >= $) {
1837
+ s = u;
2825
1838
  break;
2826
1839
  }
2827
- n = {
2828
- failedGraphQuery: c,
2829
- executionError: p,
2830
- attemptCount: i
2831
- }, await R(
2832
- { text: `Attempt ${i} to create link chart failed with error: ${p}. Retrying ...` },
1840
+ i = {
1841
+ failedGraphQuery: l,
1842
+ executionError: u,
1843
+ attemptCount: n
1844
+ }, await T(
1845
+ { text: `Attempt ${n} to create link chart failed with error: ${u}. Retrying ...` },
2833
1846
  o
2834
1847
  );
2835
1848
  }
2836
1849
  }
2837
1850
  return {
2838
1851
  type: "error",
2839
- errorMessage: `Failed to create link chart after ${z} attempts. Last error: ${l}`
1852
+ errorMessage: `Failed to create link chart after ${$} attempts. Last error: ${s}`
2840
1853
  };
2841
1854
  }
2842
- const _ = "createLinkChart", So = s.object({
2843
- prompt: s.string().describe(
1855
+ const D = "createLinkChart", bt = c.object({
1856
+ prompt: c.string().describe(
2844
1857
  "The user's inquiry and context required in order to generate a cypher query that will be used to create a link chart visualization. Only include information relevant to generating a cypher query. Do not suggest entity types, relationship types or properties. Do not include limits or formatting instructions for the query results unless specifically requested by the user. The prompt should be focused on the data the user wants to see in the link chart, not how to generate it."
2845
1858
  )
2846
- }), vo = async ({ prompt: e }, t) => {
2847
- const { knowledgeGraph: r } = await O(t), { view: a } = G(t);
2848
- if (N(a))
1859
+ }), Tt = async ({ prompt: e }, t) => {
1860
+ const { knowledgeGraph: r } = await M(t), { view: a } = q(t);
1861
+ if (x(a))
2849
1862
  return {
2850
- toolName: _,
1863
+ toolName: D,
2851
1864
  status: "error",
2852
1865
  errorMessage: "The createLinkChart tool can only be used with a LinkChartView.",
2853
1866
  error: new Error()
2854
1867
  };
2855
1868
  {
2856
- const n = k.getDefault().helperServices, l = await To(
1869
+ const i = P.getDefault().helperServices, s = await wt(
2857
1870
  `${e}
2858
1871
 
2859
- ${Ie}`,
1872
+ ${ne}`,
2860
1873
  r,
2861
- `${n.aiAssistantServices.url}${n.aiAssistantServices.graphQueryAssistant}`,
1874
+ `${i.aiAssistantServices.url}${i.aiAssistantServices.graphQueryAssistant}`,
2862
1875
  a,
2863
1876
  t
2864
1877
  );
2865
- if (l.type === "error")
1878
+ if (s.type === "error")
2866
1879
  return {
2867
- toolName: _,
1880
+ toolName: D,
2868
1881
  status: "error",
2869
- errorMessage: l.errorMessage,
1882
+ errorMessage: s.errorMessage,
2870
1883
  error: new Error()
2871
1884
  };
2872
- const { graphQuery: i, explanation: c } = l;
1885
+ const { graphQuery: n, explanation: l } = s;
2873
1886
  return {
2874
- toolName: _,
1887
+ toolName: D,
2875
1888
  status: "success",
2876
1889
  summary: `Link chart created successfully. Cypher Query used to create the link chart:
2877
- ${i}
1890
+ ${n}
2878
1891
 
2879
- Explanation: ${c}`,
1892
+ Explanation: ${l}`,
2880
1893
  details: {
2881
- generatedQuery: i,
2882
- explanation: c
1894
+ generatedQuery: n,
1895
+ explanation: l
2883
1896
  }
2884
1897
  };
2885
1898
  }
2886
- }, ui = f(vo, {
2887
- name: _,
1899
+ }, Va = g(Tt, {
1900
+ name: D,
2888
1901
  description: "Creates a new link chart visualization from an inquiry into the knowledge graph data. The inquiry will retrieve data from the graph database that will serve as the basis for the new link chart. The user should have explicitly requested the creation of a new link chart from their prompt using language like 'create new link chart' or 'add to new link chart'.",
2889
- schema: So
2890
- }), ae = "queryGraphData", xo = s.object({
2891
- prompt: s.string().describe(
1902
+ schema: bt
1903
+ }), I = "queryGraphData", St = c.object({
1904
+ prompt: c.string().describe(
2892
1905
  "The user's inquiry into the knowledge graph, from which a cypher query will be generated and executed to answer the inquiry. Only include entity types, relationship types or properties if they are provided in the user prompt or prior steps. Do not suggest entity types, relationship types or properties. Do not include limits, information on what to return, instructions on how to write the query, or formatting instructions for the query results unless specifically requested by the user."
2893
1906
  )
2894
- }), Ro = async ({ prompt: e }, t) => {
2895
- const { knowledgeGraph: r } = await O(t), o = k.getDefault().helperServices;
2896
- let n = e, l = null, i = null;
1907
+ }), vt = async ({ prompt: e }, t) => {
1908
+ const { knowledgeGraph: r } = await M(t), o = P.getDefault().helperServices;
1909
+ let i = e, s = null, n = null;
2897
1910
  try {
2898
- ({ view: i } = G(t));
1911
+ ({ view: n } = q(t));
2899
1912
  } catch {
2900
1913
  }
2901
- i && ({ enhancedPrompt: n, bindParameters: l } = await qe({
1914
+ n && ({ enhancedPrompt: i, bindParameters: s } = await ie({
2902
1915
  prompt: e,
2903
- view: i,
1916
+ view: n,
2904
1917
  knowledgeGraph: r,
2905
1918
  includeReturnEntityAndRelationshipContext: !1
2906
1919
  }));
2907
- const c = await Ne({
2908
- prompt: n,
2909
- bindParameters: l,
1920
+ const l = await oe({
1921
+ prompt: i,
1922
+ bindParameters: s,
2910
1923
  kg: r,
2911
1924
  graphQueryServiceUrl: `${o.aiAssistantServices.url}${o.aiAssistantServices.graphQueryAssistant}`,
2912
1925
  targetStructure: new Array(),
2913
- targetStructureReducer: (g, b) => (g.push(b), g),
1926
+ targetStructureReducer: (b, R) => (b.push(R), b),
2914
1927
  requestOptions: {
2915
- signal: Y(t),
1928
+ signal: F(t),
2916
1929
  timeout: t?.timeout
2917
1930
  },
2918
1931
  config: t
2919
1932
  });
2920
- if (c.type !== "success") {
2921
- const g = c.type === "generation-error" ? c.errorMessage : `${c.errorMessage} Cypher query: ${c.graphQuery}`;
1933
+ if (l.type !== "success") {
1934
+ const b = l.type === "generation-error" ? l.errorMessage : `${l.errorMessage} Cypher query: ${l.graphQuery}`;
2922
1935
  return {
2923
- toolName: ae,
1936
+ toolName: I,
2924
1937
  status: "error",
2925
- errorMessage: `Failed to query the knowledge graph. ${g}`,
2926
- error: "error" in c ? c.error : null
1938
+ errorMessage: `Failed to query the knowledge graph. ${b}`,
1939
+ error: "error" in l ? l.error : null
2927
1940
  };
2928
1941
  }
2929
- const { graphQuery: u, explanation: d, processedResult: p, resultHeader: m } = c, w = m.headerKeys;
2930
- for (const g of p)
2931
- for (const b of g)
2932
- q(
2933
- b,
2934
- (x) => ke(x)
1942
+ const { graphQuery: p, explanation: d, processedResult: u, resultHeader: h } = l, f = h.headerKeys;
1943
+ for (const b of u)
1944
+ for (const R of b)
1945
+ C(
1946
+ R,
1947
+ (z) => ae(z)
2935
1948
  );
2936
- const h = 50, y = p.slice(0, h).map((g) => JSON.stringify(g));
1949
+ const y = 50, w = u.slice(0, y).map((b) => JSON.stringify(b));
2937
1950
  return {
2938
- toolName: ae,
1951
+ toolName: I,
2939
1952
  status: "success",
2940
1953
  summary: `To answer the inquiry, the following cypher query was executed against the knowledge graph:
2941
1954
 
2942
1955
  \`\`\`cypher
2943
- ${u}
1956
+ ${p}
2944
1957
  \`\`\`
2945
1958
 
2946
1959
  Query Results:
2947
- ${y.length} result(s) found.
1960
+ ${w.length} result(s) found.
2948
1961
 
2949
- Column Headers: ${w.join(", ")}
1962
+ Column Headers: ${f.join(", ")}
2950
1963
 
2951
- ${y.length > h ? `Showing top ${h} results:
1964
+ ${w.length > y ? `Showing top ${y} results:
2952
1965
 
2953
1966
  ` : `Results:
2954
1967
 
2955
- `}${y.join(`
1968
+ `}${w.join(`
2956
1969
  `)}
2957
1970
  `,
2958
1971
  details: {
2959
- generatedQuery: u,
1972
+ generatedQuery: p,
2960
1973
  explanation: d,
2961
- resultHeader: m,
2962
- queryResults: p
1974
+ resultHeader: h,
1975
+ queryResults: u
2963
1976
  }
2964
1977
  };
2965
- }, di = f(Ro, {
2966
- name: ae,
1978
+ }, Wa = g(vt, {
1979
+ name: I,
2967
1980
  description: "Allows users to explore the data in their knowledge graph via cypher query. Generates and executes a cypher query based on the user's inquiry into the knowledge graph, and displays the results in the chat pane without modifying the user's link chart if any. Use this tool when the user is asking an exploratory question about their data as a whole that can be answered via cypher query, for example 'What are the top 5 suppliers by total parts cost?' or 'How many employees do we have in each department?'.",
2968
- schema: xo
2969
- }), oe = "generateCypher", $o = s.object({
2970
- prompt: s.string().describe("The user's inquiry into the knowledge graph that needs to be translated into a cypher query.")
2971
- }), Co = async ({ prompt: e }, t) => {
2972
- const { knowledgeGraph: r } = await O(t), o = k.getDefault().helperServices;
1981
+ schema: St
1982
+ }), O = "generateCypher", Rt = c.object({
1983
+ prompt: c.string().describe("The user's inquiry into the knowledge graph that needs to be translated into a cypher query.")
1984
+ }), xt = async ({ prompt: e }, t) => {
1985
+ const { knowledgeGraph: r } = await M(t), o = P.getDefault().helperServices;
2973
1986
  try {
2974
- const { graphQuery: n, explanation: l } = await eo(
1987
+ const { graphQuery: i, explanation: s } = await Xr(
2975
1988
  e,
2976
1989
  r.dataModel,
2977
1990
  `${o.aiAssistantServices.url}${o.aiAssistantServices.graphQueryAssistant}`,
2978
1991
  t
2979
1992
  );
2980
1993
  return {
2981
- toolName: oe,
1994
+ toolName: O,
2982
1995
  status: "success",
2983
1996
  summary: `Generated Graph Query:
2984
- ${n}
1997
+ ${i}
2985
1998
 
2986
- Explanation: ${l}`,
1999
+ Explanation: ${s}`,
2987
2000
  details: {
2988
- generatedQuery: n,
2989
- explanation: l
2001
+ generatedQuery: i,
2002
+ explanation: s
2990
2003
  }
2991
2004
  };
2992
- } catch (n) {
2993
- const l = D(n);
2005
+ } catch (i) {
2006
+ const s = E(i);
2994
2007
  return {
2995
- toolName: oe,
2008
+ toolName: O,
2996
2009
  status: "error",
2997
- errorMessage: `Failed to generate Cypher query. ${l}`,
2998
- error: n
2010
+ errorMessage: `Failed to generate Cypher query. ${s}`,
2011
+ error: i
2999
2012
  };
3000
2013
  }
3001
- }, pi = f(Co, {
3002
- name: oe,
2014
+ }, Ba = g(xt, {
2015
+ name: O,
3003
2016
  description: "Generates an Open Cypher query based on the user's prompt which represents an inquiry into the data of the knowledge service and its graph database, attempting to filter based on certain conditions and traverse specified relationships. The generated query should be syntactically correct and optimized for performance.",
3004
- schema: $o
3005
- }), Eo = (e) => {
2017
+ schema: Rt
2018
+ }), Ct = (e) => {
3006
2019
  const t = e.dataModel, r = /* @__PURE__ */ new Map();
3007
- for (const i of t.searchIndexes)
3008
- if (i.supportedCategory !== "esriTypeMetaEntityProvenance")
3009
- for (const [c, u] of i.searchProperties.entries()) {
3010
- const d = r.get(c) ?? /* @__PURE__ */ new Set();
3011
- u.propertyNames.forEach((p) => d.add(p)), r.set(c, d);
2020
+ for (const n of t.searchIndexes)
2021
+ if (n.supportedCategory !== "esriTypeMetaEntityProvenance")
2022
+ for (const [l, p] of n.searchProperties.entries()) {
2023
+ const d = r.get(l) ?? /* @__PURE__ */ new Set();
2024
+ p.propertyNames.forEach((u) => d.add(u)), r.set(l, d);
3012
2025
  }
3013
- const a = t.entityTypes.filter((i) => r.has(i.name)), o = t.relationshipTypes.filter((i) => r.has(i.name)), n = `Entity Types:
3014
- ${a.map(({ name: i }) => `${i}: [${Array.from(r.get(i) ?? []).join(", ")}]`).join(`
3015
- `)}`, l = `Relationship Types:
3016
- ${o.map(({ name: i }) => `${i}: [${Array.from(r.get(i) ?? []).join(", ")}]`).join(`
2026
+ const a = t.entityTypes.filter((n) => r.has(n.name)), o = t.relationshipTypes.filter((n) => r.has(n.name)), i = `Entity Types:
2027
+ ${a.map(({ name: n }) => `${n}: [${Array.from(r.get(n) ?? []).join(", ")}]`).join(`
2028
+ `)}`, s = `Relationship Types:
2029
+ ${o.map(({ name: n }) => `${n}: [${Array.from(r.get(n) ?? []).join(", ")}]`).join(`
3017
2030
  `)}`;
3018
- return `${n}
2031
+ return `${i}
3019
2032
 
3020
- ${l}`;
2033
+ ${s}`;
3021
2034
  };
3022
- async function Fo(e, t, r) {
3023
- const a = await W("arcgis_knowledge_lucene_generation_prompt"), o = {
2035
+ async function $t(e, t, r) {
2036
+ const a = await L("arcgis_knowledge_lucene_generation_prompt"), o = {
3024
2037
  inquiry: e,
3025
- dataModelForSearch: Eo(t)
3026
- }, n = s.enum(["entity", "relationship", "both"]).describe("The graph element category to search against - entity, relationship, or both"), l = s.number().int().positive().nullable().describe(
2038
+ dataModelForSearch: Ct(t)
2039
+ }, i = c.enum(["entity", "relationship", "both"]).describe("The graph element category to search against - entity, relationship, or both"), s = c.number().int().positive().nullable().describe(
3027
2040
  "The maximum number of search results to return. Default to 10 if not specified by the user, or set to null if the user specifically requests no limits or all results."
3028
- ), i = s.array(
3029
- s.enum(
2041
+ ), n = c.array(
2042
+ c.enum(
3030
2043
  t.dataModel.entityTypes.map((d) => d.name).concat(t.dataModel.relationshipTypes.map((d) => d.name))
3031
2044
  )
3032
- ).min(1), c = s.object({
3033
- query: s.string().describe("A lucene syntax query string to be executed against the knowledge graph search API"),
3034
- typeFilters: i.nullable().describe(
2045
+ ).min(1), l = c.object({
2046
+ query: c.string().describe("A lucene syntax query string to be executed against the knowledge graph search API"),
2047
+ typeFilters: n.nullable().describe(
3035
2048
  "Nullable list of entity or relationship types from the graph to limit the search to. If set to null, search will execute against all named types with indexed properties in the graph"
3036
2049
  ),
3037
- typeCategoryFilter: n,
3038
- resultLimit: l
2050
+ typeCategoryFilter: i,
2051
+ resultLimit: s
3039
2052
  });
3040
- return await De({
2053
+ return await le({
3041
2054
  promptText: a,
3042
2055
  inputVariables: o,
3043
- schema: c,
2056
+ schema: l,
3044
2057
  config: r
3045
2058
  });
3046
2059
  }
3047
- const ne = "searchGraphData", ko = s.object({
3048
- prompt: s.string().describe(
2060
+ const K = "searchGraphData", Pt = c.object({
2061
+ prompt: c.string().describe(
3049
2062
  "The user's inquiry into the knowledge graph, from which a lucene search query will be generated and executed against the graph to return relevant results."
3050
2063
  )
3051
- }), No = async ({ prompt: e }, t) => {
3052
- const { knowledgeGraph: r } = await O(t);
3053
- await R({ text: "Generating search query for the user inquiry" }, t);
3054
- const a = await Fo(e, r, t);
3055
- await R({ text: "Executing graph search with generated search query" }, t);
3056
- const o = await co({
2064
+ }), Et = async ({ prompt: e }, t) => {
2065
+ const { knowledgeGraph: r } = await M(t);
2066
+ await T({ text: "Generating search query for the user inquiry" }, t);
2067
+ const a = await $t(e, r, t);
2068
+ await T({ text: "Executing graph search with generated search query" }, t);
2069
+ const o = await lt({
3057
2070
  kg: r,
3058
2071
  searchQuery: a.query,
3059
2072
  typeCategoryFilter: a.typeCategoryFilter,
3060
2073
  namedTypesFilter: a.typeFilters,
3061
2074
  searchResultLimit: a.resultLimit,
3062
2075
  requestOptions: {
3063
- signal: Y(t),
2076
+ signal: F(t),
3064
2077
  timeout: t?.timeout
3065
2078
  }
3066
2079
  });
3067
2080
  if (o.type !== "success")
3068
2081
  return {
3069
- toolName: ne,
2082
+ toolName: K,
3070
2083
  status: "error",
3071
2084
  errorMessage: o.errorMessage,
3072
2085
  error: "error" in o ? o.error : null
3073
2086
  };
3074
- for (const i of o.results)
3075
- q(
3076
- i,
3077
- (c) => ke(c)
2087
+ for (const n of o.results)
2088
+ C(
2089
+ n,
2090
+ (l) => ae(l)
3078
2091
  );
3079
- const n = 10, l = o.results.slice(0, n);
2092
+ const i = 10, s = o.results.slice(0, i);
3080
2093
  return {
3081
- toolName: ne,
2094
+ toolName: K,
3082
2095
  status: "success",
3083
2096
  summary: `To answer the query, the following lucene query was generated and executed:
3084
2097
  Query: ${a.query}
@@ -3088,17 +2101,17 @@ const ne = "searchGraphData", ko = s.object({
3088
2101
 
3089
2102
  Search Results: ${o.results.length} result(s) found.
3090
2103
 
3091
- ${o.results.length > n ? `Showing top ${n} results:
2104
+ ${o.results.length > i ? `Showing top ${i} results:
3092
2105
 
3093
- ` : ""}${l.map((i) => JSON.stringify(i)).join(`
2106
+ ` : ""}${s.map((n) => JSON.stringify(n)).join(`
3094
2107
  `)}`,
3095
2108
  details: {
3096
2109
  generatedSearchQuery: a,
3097
2110
  searchResults: o.results
3098
2111
  }
3099
2112
  };
3100
- }, mi = f(No, {
3101
- name: ne,
2113
+ }, Ua = g(Et, {
2114
+ name: K,
3102
2115
  description: `
3103
2116
  Search the knowledge graph using one or more search texts, using lucene search syntax, against indexed string properties defined on their entities and relationships. Use this tool when the user asks a question about their knowledge graph data as a whole, that could be answered via lucene text search of properties stored on graph elements, e.g requiring fuzzy matching. Otherwise if the inquiry is looking for connected records (e.g. paths), data aggregations, etc explore the data via the queryGraphData tool.
3104
2117
  Example prompts:
@@ -3109,52 +2122,39 @@ const ne = "searchGraphData", ko = s.object({
3109
2122
  - "Find all reports authored by someone with the title of 'Researcher'"
3110
2123
  - "Find the first 5 reports where summary mentions flood zoning near Sacramento, and the organization name is the City of Sacramento Utilities, and tags containing stormwater".
3111
2124
  - "Search for all john smiths and show their global ids`,
3112
- schema: ko
2125
+ schema: Pt
3113
2126
  });
3114
2127
  export {
3115
- Qn as A,
3116
- Vn as B,
3117
- _n as C,
3118
- Wn as D,
3119
- Bn as E,
3120
- Un as F,
3121
- ce as G,
3122
- ai as H,
3123
- Kn as I,
3124
- Hn as J,
3125
- Jn as K,
3126
- Yn as L,
3127
- Zn as M,
3128
- Nn as N,
3129
- ei as O,
3130
- ti as P,
3131
- _a as Q,
3132
- Xn as R,
3133
- ri as S,
3134
- li as a,
3135
- pi as b,
3136
- ci as c,
3137
- ui as d,
3138
- si as e,
3139
- ve as f,
3140
- W as g,
3141
- ii as h,
3142
- O as i,
3143
- ni as j,
3144
- In as k,
3145
- oi as l,
3146
- qn as m,
3147
- zn as n,
3148
- Dn as o,
3149
- Pn as p,
3150
- di as q,
3151
- On as r,
3152
- mi as s,
3153
- Bt as t,
3154
- An as u,
3155
- Ln as v,
3156
- jn as w,
3157
- Gn as x,
3158
- v as y,
3159
- Mn as z
2128
+ ja as A,
2129
+ La as D,
2130
+ B as G,
2131
+ Fa as H,
2132
+ Da as L,
2133
+ va as N,
2134
+ Oa as a,
2135
+ Ba as b,
2136
+ Ka as c,
2137
+ Va as d,
2138
+ Ia as e,
2139
+ Qa as f,
2140
+ L as g,
2141
+ M as h,
2142
+ _a as i,
2143
+ xa as j,
2144
+ Ca as k,
2145
+ $a as l,
2146
+ Pa as m,
2147
+ Ea as n,
2148
+ za as o,
2149
+ ka as p,
2150
+ Wa as q,
2151
+ Ra as r,
2152
+ Ua as s,
2153
+ Ie as t,
2154
+ Aa as u,
2155
+ qa as v,
2156
+ Ma as w,
2157
+ Na as x,
2158
+ Ga as y,
2159
+ Vr as z
3160
2160
  };