@arcgis/ai-components 5.0.0-next.150 → 5.1.0-next.0
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.
- package/dist/cdn/26V7SXDR.js +4 -0
- package/dist/cdn/3EBDE5UU.js +2 -0
- package/dist/cdn/4Y73V2HU.js +2 -0
- package/dist/cdn/62K6RJZZ.js +41 -0
- package/dist/cdn/63ACCRM5.js +239 -0
- package/dist/cdn/6T2EIYO4.js +59 -0
- package/dist/cdn/AF7UTDDE.js +4 -0
- package/dist/cdn/AQZDEJJZ.js +2 -0
- package/dist/cdn/CFDTXKJ6.js +2 -0
- package/dist/cdn/CFT5BBC6.js +69 -0
- package/dist/cdn/CN6VFVA2.js +19 -0
- package/dist/cdn/GCFT45CD.js +2 -0
- package/dist/cdn/HN2HMAMX.js +28 -0
- package/dist/cdn/I22GHLAO.js +2 -0
- package/dist/cdn/IFWK7P7O.js +2 -0
- package/dist/cdn/JDL3HFFX.js +56 -0
- package/dist/cdn/JOZLOFW3.js +271 -0
- package/dist/cdn/KJZARHAM.js +2 -0
- package/dist/cdn/KKHKKCYH.js +17 -0
- package/dist/cdn/KQ6LEQHH.js +14 -0
- package/dist/cdn/LSGRWCAO.js +5 -0
- package/dist/cdn/LTBEINKG.js +25 -0
- package/dist/cdn/M672SFG6.js +2 -0
- package/dist/cdn/M7XUI5KY.js +77 -0
- package/dist/cdn/NKNUZCLA.js +17 -0
- package/dist/cdn/OLPFL2NN.js +2 -0
- package/dist/cdn/OUVX4QS2.js +2 -0
- package/dist/cdn/PWXNH5LQ.js +2 -0
- package/dist/cdn/Q674OE2M.js +2 -0
- package/dist/cdn/QTP47HEP.js +2 -0
- package/dist/cdn/SOWNHB7F.js +30 -0
- package/dist/cdn/UY4FI7AP.js +2 -0
- package/dist/cdn/VUHDKXFM.js +2 -0
- package/dist/cdn/W5CHGOOR.js +109 -0
- package/dist/cdn/WBSNYWJJ.js +2 -0
- package/dist/cdn/X7WF7TCS.js +2 -0
- package/dist/cdn/XVUE27HC.js +2 -0
- package/dist/cdn/ZYQ6U2YH.js +88 -0
- package/dist/cdn/index.js +2 -2
- package/dist/chunks/runtime.js +2 -2
- package/dist/chunks/useT9n.js +1 -1
- package/dist/chunks/utils.js +1 -1
- package/dist/chunks/utils2.js +1 -1
- package/dist/components/arcgis-assistant/customElement.js +1 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-chat/customElement.js +1 -1
- package/dist/components/arcgis-assistant-chat-card/customElement.js +1 -1
- package/dist/components/arcgis-assistant-chat-card-content/customElement.js +1 -1
- package/dist/components/arcgis-assistant-chat-entry/customElement.js +1 -1
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-interrupt/customElement.js +1 -1
- package/dist/components/arcgis-assistant-layer-filter-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-layer-query-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +1 -1
- package/dist/components/arcgis-assistant-shell/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +1 -1
- package/dist/loader.js +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{a as o}from"./UY4FI7AP.js";import"./WBSNYWJJ.js";import{g as a,h as t,k as e,p as n,t as l}from"./26V7SXDR.js";import"./CFDTXKJ6.js";var r=a`.assistant-shell__footer-container{display:flex;flex-direction:column;flex:1 1 0;gap:var(--calcite-spacing-md)}.assistant-shell__content-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0;position:relative}.assistant-shell__suggested-prompts-container{position:absolute;bottom:0;display:flex;justify-content:center;width:100%}.assistant-shell__suggested-prompts{padding:var(--calcite-spacing-md)}.assistant-shell__suggested-prompt{max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal}`,i=class extends n{constructor(){super(...arguments),this._messages=o({blocking:!0}),this.description="",this.loading=!1,this.entryMessageClosed=!1,this.awaitingResponse=!1,this.suggestedPrompts=[],this.inputValue="",this.arcgisCancel=e(),this.arcgisSubmit=e()}static{this.properties={heading:1,description:1,loading:5,entryMessage:1,entryMessageClosed:5,awaitingResponse:5,suggestedPrompts:0,inputValue:1,status:1}}static{this.styles=r}_renderSuggestedPrompts(){return this.suggestedPrompts?.length?t`<div class="assistant-shell__suggested-prompts-container"><calcite-chip-group class="assistant-shell__suggested-prompts" .label=${this._messages.suggestedPromptsLabel??"suggested prompts"} selection-mode=single-persist @calciteChipGroupSelect=${s=>this.inputValue=s.target.selectedItems[0]?.value??""}>${this.suggestedPrompts.map(s=>t`<calcite-chip closable .value=${s} .label=${s} appearance=outline-fill kind=brand><div class="assistant-shell__suggested-prompt">${s}</div></calcite-chip>`)}</calcite-chip-group></div>`:null}render(){return t`<calcite-panel .loading=${this.loading} .heading=${this.heading??this._messages.shellHeading} .description=${this.description}><slot slot=header-actions-end name=header-actions-end></slot><div class="assistant-shell__content-container"><slot></slot>${this._renderSuggestedPrompts()}</div><div class="assistant-shell__footer-container" slot=footer><slot name=entry-message>${this.entryMessageClosed?null:t`<calcite-notice slot=entry-message .open=${!this.entryMessageClosed} kind=info closable icon width=full><div slot=message>${this.entryMessage??this._messages.shellEntryMessage}</div></calcite-notice>`}</slot><arcgis-assistant-chat-entry .awaitingResponse=${this.awaitingResponse} .arcgisSubmit=${this.arcgisSubmit} .arcgisCancel=${this.arcgisCancel} .inputValue=${this.inputValue} .status=${this.status}><slot name=entry-actions-start slot=entry-actions-start></slot></arcgis-assistant-chat-entry><slot name=footer-content></slot></div></calcite-panel>`}};l("arcgis-assistant-shell",i);export{i as ArcgisAssistantShell};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import"./CFDTXKJ6.js";var e=`## ArcgisKnowledge Agent - Tool Intent Classifier
|
|
3
|
+
|
|
4
|
+
You are an assistant that classifies user intent for arcgisKnowledge agent.
|
|
5
|
+
|
|
6
|
+
You are given the following tool options:
|
|
7
|
+
{tools}
|
|
8
|
+
|
|
9
|
+
Use the most recent relevant user question from the chat history. The question will **not** be restated again here.
|
|
10
|
+
|
|
11
|
+
Return exactly one intent (tool name) based on the user's request.
|
|
12
|
+
If none apply, return an **empty string**.
|
|
13
|
+
|
|
14
|
+
Choose only from provided tools.
|
|
15
|
+
|
|
16
|
+
Return the name of the tool as a string.
|
|
17
|
+
`;export{e as default};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import"./CFDTXKJ6.js";var e=`# ArcgisKnowledge Tool Instructions
|
|
3
|
+
|
|
4
|
+
CRITICAL: You are FORBIDDEN from making multiple tool calls. You MUST make exactly ONE tool call.
|
|
5
|
+
|
|
6
|
+
Use the most recent relevant user question from the chat history. The question will **not** be restated again here.
|
|
7
|
+
|
|
8
|
+
Detected intent:
|
|
9
|
+
{intent}
|
|
10
|
+
|
|
11
|
+
Rules:
|
|
12
|
+
|
|
13
|
+
- Call exactly one arcgisKnowledge tool
|
|
14
|
+
`;export{e as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import"./CFDTXKJ6.js";var e=`## Additional System Context
|
|
3
|
+
|
|
4
|
+
In addition to the user's inquiry prompt that precedes this system context, the current link chart has entities and relationships on it already, in the format of an array of objects containing identifiers and typeNames, in case this is needed for query generation (for example 'Add all records that are connected to people on this link chart to the link chart'). If the user is asking for a query that acts on 'the current link chart', 'my link chart', or similar then the cypher query should be filtered by the ids. For example, 'Match (n:Person)-[\\r]->(m) WHERE id(n) IN [\\'identifier1','identifier2'] return r, m. Curly braces (the '{' and '}' characters) are often part of identifier strings and should not be stripped out - the process of filtering by ids should not be altering the id strings. The entities and relationships that are on the current link chart are as follows:
|
|
5
|
+
`;export{e as default};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import"./CFDTXKJ6.js";var e=`# Navigation Tool Instructions
|
|
3
|
+
|
|
4
|
+
CRITICAL: You are FORBIDDEN from making multiple tool calls. You MUST make exactly ONE tool call.
|
|
5
|
+
|
|
6
|
+
Use the most recent relevant user question from the chat history. The question will **not** be restated again here.
|
|
7
|
+
|
|
8
|
+
Detected intent:
|
|
9
|
+
{intent}
|
|
10
|
+
|
|
11
|
+
{bookmarksSection}
|
|
12
|
+
|
|
13
|
+
{layersSection}
|
|
14
|
+
|
|
15
|
+
{fieldsSection}
|
|
16
|
+
|
|
17
|
+
Current zoom level: {currentZoom}
|
|
18
|
+
|
|
19
|
+
Rules:
|
|
20
|
+
|
|
21
|
+
- Call exactly one navigation tool
|
|
22
|
+
- Use ONLY provided layerIds and fields if present
|
|
23
|
+
- Do NOT invent layerIds or field names
|
|
24
|
+
- If required context is missing, fall back to a valid non-layer tool
|
|
25
|
+
`;export{e as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{a as s}from"./I22GHLAO.js";import{b as o}from"./WBSNYWJJ.js";function i(e,t){let n=s(e.referenceElement);if(n)return n;let r=o(e.el,"arcgis-assistant"),a=s(r?.referenceElement);if(a)return a;throw new Error(`${t}: Reference element not found`)}async function m(e,t){let n=i(e,t);await n.componentOnReady();let r=n.view;if(!r)throw new Error(`${t}: Reference element does not have a view`);return await r.when(),r}function g(e){let t=o(e.el,"arcgis-assistant");if(t===void 0)throw new Error("arcgis-assistant-agent must be used within an arcgis-assistant element");t.register({agent:e.agent,getContext:()=>e.getContext?.()??e.context??{}})}export{m as a,g as b};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import"./CFDTXKJ6.js";var e=`# ArcGIS Online Map Viewer \u2014 Layer Filter Tool Calling Assistant
|
|
3
|
+
|
|
4
|
+
You are an assistant that helps generate layer filter expressions for **ArcGIS Online Map Viewer** by selecting and calling the appropriate tool.
|
|
5
|
+
|
|
6
|
+
CRITICAL: You MUST make exactly ONE tool call. You are FORBIDDEN from making zero or multiple tool calls. Even if the question has been answered, you need to filter the features.
|
|
7
|
+
|
|
8
|
+
## You are given:
|
|
9
|
+
|
|
10
|
+
A list of layers, with layerId, layerSummary and each with associated field information
|
|
11
|
+
{layerFieldInfo}
|
|
12
|
+
|
|
13
|
+
FieldInfo:
|
|
14
|
+
|
|
15
|
+
- \`name\`: the actual field name used in layer filter expressions
|
|
16
|
+
- \`type\`: one of \`string\`, \`number\`, \`date\`, etc.
|
|
17
|
+
- \`alias\`: a human-readable label
|
|
18
|
+
- \`description\`: optional field metadata
|
|
19
|
+
- \`statistics\`: such as min, max, unique values, etc.
|
|
20
|
+
|
|
21
|
+
## Your task
|
|
22
|
+
|
|
23
|
+
1. Analyze the user's request and the provided layer and field information.
|
|
24
|
+
2. Generate a **single ArcGIS SQL WHERE clause** to match features based on the user's request and intent.
|
|
25
|
+
3. Select the most appropriate tool to call based on the user's request.
|
|
26
|
+
|
|
27
|
+
The tool will apply the provided WHERE clause to the layer in the map viewer.
|
|
28
|
+
|
|
29
|
+
### Rules for generating Layer Filter expressions:
|
|
30
|
+
|
|
31
|
+
- Use only the field\u2019s **\`name\`** in the output expression.
|
|
32
|
+
- Use metadata (\`alias\`, \`description\`, \`statistics\`) only to help understand the user's meaning \u2014 not in the syntax.
|
|
33
|
+
- Use field \`type\` to choose appropriate operators:
|
|
34
|
+
- **String** \u2192 \`LIKE '%value%'\`, \`=\`, \`IN (...)\`
|
|
35
|
+
- **Number/Date** \u2192 \`=\`, \`<\`, \`>\`, \`BETWEEN\`, etc.
|
|
36
|
+
- Use fields with the **highest \`relevanceScore\`**.
|
|
37
|
+
- DO NOT use subqueries or \`SELECT\` keyword.
|
|
38
|
+
- Combine conditions with \`AND\`, \`OR\`, or \`NOT\` as appropriate.
|
|
39
|
+
- If no meaningful layer filter can be generated, do not call a tool.
|
|
40
|
+
|
|
41
|
+
## SQL-92 Date/Time Syntax
|
|
42
|
+
|
|
43
|
+
User timezone: {userTimezone} ({userTimezoneOffset})
|
|
44
|
+
|
|
45
|
+
Database stores dates in UTC. Convert user's local time to UTC.
|
|
46
|
+
|
|
47
|
+
To convert: if offset is \`-08:00\`, add 8 hours. If \`-05:00\`, add 5 hours.
|
|
48
|
+
|
|
49
|
+
Format: \`TIMESTAMP 'YYYY-MM-DD HH:MM:SS'\`
|
|
50
|
+
|
|
51
|
+
## RULES
|
|
52
|
+
|
|
53
|
+
When dealing with geometry and proximity and spatial queries:
|
|
54
|
+
|
|
55
|
+
1. TARGET LAYER = What you want to FIND/RETURN in results
|
|
56
|
+
2. GEOMETRY LAYER = The location to search FROM (with distance buffer)
|
|
57
|
+
|
|
58
|
+
For questions like "Is [specific item A] near/within [any of type B]":
|
|
59
|
+
|
|
60
|
+
- Target: Type B (what we're searching for)
|
|
61
|
+
- Geometry: Specific item A (where we're searching from)
|
|
62
|
+
|
|
63
|
+
Examples:
|
|
64
|
+
|
|
65
|
+
Q: "Is well P132_1873 within 300m from a protected area?"
|
|
66
|
+
Target: Protected Areas (what we want to find)
|
|
67
|
+
Geometry: Well (where="ID = 'P132_1873'" - single point)
|
|
68
|
+
Result: Returns which protected areas are nearby
|
|
69
|
+
|
|
70
|
+
Q: "Find roads within 500m of park X"
|
|
71
|
+
Target: Roads (what we want to find)
|
|
72
|
+
Geometry: Park X (specific location)
|
|
73
|
+
Result: Returns which roads are nearby
|
|
74
|
+
|
|
75
|
+
Key principle: The geometry layer should be the SIMPLER geometry (ideally a single feature or small set),
|
|
76
|
+
not a large collection that requires union operations.
|
|
77
|
+
`;export{e as default};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import"./CFDTXKJ6.js";var e=`## Navigation Agent - Tool Intent Classifier
|
|
3
|
+
|
|
4
|
+
You are an assistant that classifies user intent for navigation agent.
|
|
5
|
+
|
|
6
|
+
You are given the following tool options:
|
|
7
|
+
{tools}
|
|
8
|
+
|
|
9
|
+
Use the most recent relevant user question from the chat history. The question will **not** be restated again here.
|
|
10
|
+
|
|
11
|
+
Return exactly one intent (tool name) based on the user's request.
|
|
12
|
+
If none apply, return an **empty string**.
|
|
13
|
+
|
|
14
|
+
Choose only from provided tools.
|
|
15
|
+
|
|
16
|
+
Return the name of the tool as a string.
|
|
17
|
+
`;export{e as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import c from"./63ACCRM5.js";import b from"./JOZLOFW3.js";import{a as s,b as a}from"./M672SFG6.js";import"./I22GHLAO.js";import"./WBSNYWJJ.js";import{p as r,t as e}from"./26V7SXDR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{c:i}])=>{var t=class extends r{constructor(){super(...arguments),this.agent=i}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-layer-filter-agent requires a mapView");return{mapView:this.#t}}async load(){this.#t=await s(this,"arcgis-assistant-layer-filter-agent"),a(this)}};e("arcgis-assistant-layer-filter-agent",t);return t},b,c)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import c from"./63ACCRM5.js";import b from"./JOZLOFW3.js";import{a as i,b as e}from"./M672SFG6.js";import"./I22GHLAO.js";import"./WBSNYWJJ.js";import{p as a,t as s}from"./26V7SXDR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{a:r}])=>{var t=class extends a{constructor(){super(...arguments),this.agent=r}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-navigation-agent requires a mapView");return{mapView:this.#t}}async load(){this.#t=await i(this,"arcgis-assistant-navigation-agent"),e(this)}};s("arcgis-assistant-navigation-agent",t);return t},b,c)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import c from"./63ACCRM5.js";import b from"./JOZLOFW3.js";import{a as s,b as a}from"./M672SFG6.js";import"./I22GHLAO.js";import"./WBSNYWJJ.js";import{p as r,t as e}from"./26V7SXDR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{d:i}])=>{var t=class extends r{constructor(){super(...arguments),this.agent=i}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-layer-query-agent requires a mapView");return{mapView:this.#t}}async load(){this.#t=await s(this,"arcgis-assistant-layer-query-agent"),a(this)}};e("arcgis-assistant-layer-query-agent",t);return t},b,c)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{a as n}from"./UY4FI7AP.js";import"./WBSNYWJJ.js";import{g as a,h as e,k as s,p as l,t as c}from"./26V7SXDR.js";import"./CFDTXKJ6.js";var o=a``,i=class extends l{constructor(){super(...arguments),this.#t=[],this._messages=n({blocking:!0}),this.arcgisCancel=s(),this.arcgisSubmit=s()}static{this.properties={type:1,message:1,options:0}}static{this.styles=o}#t;_renderInterruptOptions(){switch(this.type){case"single-select":return e`<calcite-list selection-mode=single-persist .label=${this._messages.optionsLabel} @calciteListChange=${t=>this.#t=t.target.selectedItems[0]?.value}>${this.options?.map(t=>e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;case"multi-select":return e`<calcite-list selection-mode=multiple .label=${this._messages.optionsLabel} @calciteListChange=${t=>this.#t=t.target.selectedItems.map(r=>r.value)}>${this.options?.map(t=>e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;case"boolean-choice":return e`<calcite-list selection-mode=single-persist .label=${this._messages.optionsLabel} @calciteListChange=${t=>this.#t=t.target.selectedItems[0]?.value}>${this.options?.map(t=>e`<calcite-list-item .label=${t} .value=${t}></calcite-list-item>`)}</calcite-list>`;case"text-input":return e`<calcite-input .label=${this._messages.enterTextLabel} @calciteInputInput=${t=>this.#t=t.target.value}></calcite-input>`}}render(){return e`<calcite-panel .description=${this.message}>${this._renderInterruptOptions()}<calcite-button slot=footer-end appearance=outline @click=${()=>this.arcgisCancel.emit()}>${this._messages.cancelButtonLabel}</calcite-button><calcite-button slot=footer-end appearance=solid @click=${()=>this.arcgisSubmit.emit(this.#t)}>${this._messages.submitButtonLabel}</calcite-button></calcite-panel>`}};c("arcgis-assistant-interrupt",i);export{i as ArcgisAssistantInterrupt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import c from"./63ACCRM5.js";import b from"./JOZLOFW3.js";import{a as e,b as i}from"./M672SFG6.js";import"./I22GHLAO.js";import"./WBSNYWJJ.js";import{p as s,t as a}from"./26V7SXDR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{e:r}])=>{var t=class extends s{constructor(){super(...arguments),this.agent=r}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-layer-styling-agent requires a mapView");return{mapView:this.#t}}async load(){this.#t=await e(this,"arcgis-assistant-layer-styling-agent"),i(this)}};a("arcgis-assistant-layer-styling-agent",t);return t},b,c)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import"./CFDTXKJ6.js";var e=`## Task: Summarize Geographic Features
|
|
3
|
+
|
|
4
|
+
You are given features from ArcGIS Feature layer for multiple layers:
|
|
5
|
+
{queryResponse}
|
|
6
|
+
|
|
7
|
+
Also consider any **relevant context from the chat history**, such as user questions or instructions.
|
|
8
|
+
|
|
9
|
+
### Your goal:
|
|
10
|
+
|
|
11
|
+
1. If the user question is about a **specific calculation** (e.g., average, total, count, min, max), return only the **direct numeric answer** \u2014 short and clear.
|
|
12
|
+
- Example: \u201CThe average price is $4.00.\u201D
|
|
13
|
+
|
|
14
|
+
2. If the question is more general or there are **multiple features with varying attributes**, write a **brief summary** (2\u20133 sentences max) that highlights key patterns or insights.
|
|
15
|
+
|
|
16
|
+
3. The response can be per layer, or summarize based on the question.
|
|
17
|
+
|
|
18
|
+
4. When the user asks "where" a feature is located: Simply confirm whether the feature was found and in which layer. DO NOT attempt to provide coordinates, addresses, or geographic descriptions.
|
|
19
|
+
|
|
20
|
+
5. DO NOT ramble.
|
|
21
|
+
|
|
22
|
+
6. Use bullet points for lists and use new lines (\\n) and appropriate formatting in your response
|
|
23
|
+
|
|
24
|
+
In all cases:
|
|
25
|
+
|
|
26
|
+
- Focus on **notable attribute values**, **commonalities or differences**, and **interesting trends**.
|
|
27
|
+
- If the feature list is empty or not meaningful, state that clearly.
|
|
28
|
+
|
|
29
|
+
**Keep your response concise and relevant to the user\u2019s question.**
|
|
30
|
+
`;export{e as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{a as $,c as k}from"./WBSNYWJJ.js";import{a as C,b as L,c as m,d as f,e as P,f as O,i as g,j as v,l as w,u as N}from"./26V7SXDR.js";var _=t=>(...s)=>{let o=f(),e=new t(...s),r=e.exports;m(o.at(-1));let n=e.component.manager;n.W(e,r),e.watchExports(n.W.bind(n,e)),P(e);let a=[e.component,...o].reverse();return v(a,i=>i===void 0?void 0:j(e,i,r),r)},j=(t,{host:s,key:o,isReactive:e},r)=>{let n=s,a=n[o]!==t.exports,i=n[o]!==r,c=r!==t.exports;if(a&&!i&&c&&(n[o]=t.exports),s===t.component){if(e){let l=t.component.manager;i&&l.W(t,n[o]),t.onUpdate(u=>{if(u.has(o)){let x=n[o];x!==t.exports&&l.W(t,x)}})}t.O=e?void 0:o}let d=t.component.constructor.elementProperties.get(o)?.readOnly;t.watchExports(()=>{n[o]!==t.exports&&(d?O(()=>{n[o]=t.exports}):n[o]=t.exports)})};var z="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),M=new Set(z),h="en",U={pt:"pt-PT",nb:"no",nn:"no",zh:"zh-CN"},F=async(t,s,o="")=>{let e=`${s}/${o}`,r=`${e}${t}.json`;return b[r]??(b[r]=A(t,e)),await b[r]},b={},A=async(t,s)=>{let o=`${s}${t}.json`;try{let e=await fetch(o);if(e.ok)return await e.json()}catch(e){return g("error","intl",`An unknown error occurred while fetching localization strings at ${o}`,{detail:{error:e}}),{}}return t===h?{}:await A(h,s)},y=t=>{let s=k(t,"lang",globalThis.navigator?.language||h);return{lang:s,t9nLocale:T(s)}},T=t=>{let[s,o]=t.split("-"),e=s.toLowerCase(),r=e;return o&&(r=`${e}-${o.toUpperCase()}`),r=U[r]??r,M.has(r)?r:o?T(e):h},D=(t,s,o,e)=>{let r,n=()=>K(t,s(),e).then(a=>{(r?.lang!==a.lang||r.t9nLocale!==a.t9nLocale||r.t9nStrings!==a.t9nStrings)&&o(a),r=a}).catch(a=>{g("error","intl","Error updating component locale state",{detail:{error:a}})});return queueMicrotask(n),$(t,["lang"],n)},K=async(t,s,o=t.localName.split("-").slice(1).join("-"))=>{let{lang:e,t9nLocale:r}=y(t),n=`${s}/${o}/t9n`,i=o===null?{}:await F(r,n,"messages.");return{lang:e,t9nLocale:r,t9nStrings:i}};var W=t=>I(void 0,t);var E=class extends w{constructor(s,o){super(s);let e=this.exports;try{L(this.component);let r=o(this.component,this),n=this.exports!==e;if(C(r)){n||this.setProvisionalExports(r);let a=r.then(i=>{this.exports=i,super.catchUpLifecycle()}).catch(i=>{this.P.reject(i)});this.onLoad(async()=>await a)}else(!n||r!==void 0)&&(this.exports=r),queueMicrotask(()=>super.catchUpLifecycle())}catch(r){this.P.reject(r)}}catchUpLifecycle(){}},I=_(E);var S=t=>(s={})=>W((o,e)=>{let r=y(o.el),n={_lang:r.lang,_t9nLocale:r.t9nLocale,_loading:!0},a=o;e.onLifecycle(()=>D(o.el,()=>t("./assets"),({t9nLocale:c,t9nStrings:p,lang:d})=>{let l={...p,_lang:d,_t9nLocale:c,_loading:!1};e.exports=l;let u=p.componentLabel;typeof u=="string"&&"label"in o&&o.label==null&&(o.label??=u),i(a.messageOverrides)},s.name));let i=c=>{let p=e.exports,d=p._original??p,l=V(d,c);c&&(l._original=d),e.exports=l};return"messageOverrides"in a&&e.onUpdate(c=>{c.has("messageOverrides")&&i(a.messageOverrides)}),s.blocking?(e.setProvisionalExports(n,!1),e.ready):n}),V=(t,s)=>{if(!s)return t;let o={...t};return Object.entries(s).forEach(([e,r])=>{t[e]!==void 0&&(typeof r=="object"?o[e]=V(t[e],r):o[e]=r??t[e])}),o};var ct=S(N);export{ct as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{a as u}from"./UY4FI7AP.js";import"./WBSNYWJJ.js";import{g as i,h as s,k as a,n as r,o as n,p as c,r as o,t as l}from"./26V7SXDR.js";import"./CFDTXKJ6.js";export default $arcgis.t(([{watch:h}])=>{var d=i`.assistant-chat-entry__input-container{display:flex;flex-direction:column}.assistant-chat-entry__footer-start{display:flex;gap:var(--calcite-spacing-md);flex-wrap:wrap;align-items:center}.assistant-chat-entry__footer-end{display:flex;gap:var(--calcite-spacing-md);align-items:center}.assistant-chat-entry__status-indicator{width:9px;height:9px;border-radius:100%;background-color:var(--calcite-color-status-success)}.assistant-chat-entry__status-indicator[data-status=working]{background-color:var(--calcite-color-status-warning)}.assistant-chat-entry__status-indicator[data-status=error]{background-color:var(--calcite-color-status-danger)}.assistant-chat-entry__status-text{text-transform:capitalize}`,e=class extends c{constructor(){super(...arguments),this.#t=r(),this._messages=u({blocking:!0}),this.enterKeySubmits=!0,this.awaitingResponse=!1,this.inputValue="",this.arcgisCancel=a(),this.arcgisSubmit=a()}static{this.properties={enterKeySubmits:5,entryPlaceholder:1,awaitingResponse:5,inputValue:1,status:1}}static{this.styles=d}#t;loaded(){this.manager.onLifecycle(()=>[h(()=>this.inputValue,t=>{this.#t.value&&(this.#t.value.value=t)},{initial:!0})])}async _submitMessage(){if(this.awaitingResponse){this.arcgisCancel.emit();return}let t=this.#t.value?.value.trim();t&&(this.arcgisSubmit.emit(t),this.#t.value&&(this.#t.value.value="",await this.#t.value.setFocus()))}render(){return s`<div class="assistant-chat-entry__input-container"><calcite-text-area .value=${this.#t.value?.value} .placeholder=${this.entryPlaceholder??this._messages.entryPlaceholder} @keydown=${async t=>{t.key==="Enter"&&!t.shiftKey&&this.enterKeySubmits&&(t.preventDefault(),await this._submitMessage())}} ${n(this.#t)}><div slot=footer-start class="assistant-chat-entry__footer-start"><slot name=entry-actions-start></slot></div><div slot=footer-end class="assistant-chat-entry__footer-end">${this.status?s`<div id=tooltip-status class="assistant-chat-entry__status-indicator" data-status=${this.status??o}></div><calcite-tooltip reference-element=tooltip-status offset-distance=12><span class="assistant-chat-entry__status-text">${this.status}</span></calcite-tooltip>`:null}<calcite-button .iconStart=${this.awaitingResponse?"circle-stop":"send"} slot=footer-end round @click=${()=>void this._submitMessage()}>${this.awaitingResponse?this._messages.stopButtonLabel:this._messages.askButtonLabel}</calcite-button></div></calcite-text-area></div>`}};l("arcgis-assistant-chat-entry",e);return e},"core/reactiveUtils")
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import"./CFDTXKJ6.js";var e=`You are a knowledgeable GIS expert.
|
|
3
|
+
|
|
4
|
+
You are given a Feature Service description and title.
|
|
5
|
+
|
|
6
|
+
{existingItemTitle}
|
|
7
|
+
{existingItemDescription}
|
|
8
|
+
|
|
9
|
+
You are given Feature Layer descriptions and title.
|
|
10
|
+
|
|
11
|
+
{existingLayerTitle}
|
|
12
|
+
{existingLayerDescription}
|
|
13
|
+
|
|
14
|
+
## Existing field descriptions:
|
|
15
|
+
|
|
16
|
+
Here is an extensive list of fields with their existing descriptions. These fields together represent a summary of the data contained in this feature layer. NOTE that these field descriptions are not final and may need to be improved.
|
|
17
|
+
Some fields will have summary statistics, which are also included in the field descriptions. Statistics can help you decipher the type of data better.
|
|
18
|
+
|
|
19
|
+
{fieldInformation}
|
|
20
|
+
|
|
21
|
+
Your task is to generate the following for each field:
|
|
22
|
+
|
|
23
|
+
1. field_description: A short description of the field.
|
|
24
|
+
2. field_value_type: Field Value Type
|
|
25
|
+
3. field_alias: A display name that concisely conveys the field contents to help readers understand the data
|
|
26
|
+
|
|
27
|
+
## Instructions to generate Field Description:
|
|
28
|
+
|
|
29
|
+
- You must generate a field description for each field in the feature layer.
|
|
30
|
+
- You must not skip any field.
|
|
31
|
+
- If you think the existing field description is good, you must still add it in your response.
|
|
32
|
+
- If the existing field description is empty, you must generate a new field description.
|
|
33
|
+
- The field description should be a short description of the field.
|
|
34
|
+
- If the existing field description has units, you should include them in the new field description.
|
|
35
|
+
- If the existing field description is not clear, you should improve it.
|
|
36
|
+
- Do not have duplicate field descriptions. Always keep the one that is the best.
|
|
37
|
+
|
|
38
|
+
## Instructions to determine Field Value Type:
|
|
39
|
+
|
|
40
|
+
Following is a list of field value types you can assign to a field in a feature layer. Each field value type is used to define the kind of data that can be stored in that field. The field value type you choose for a field should be based on the kind of data stored in that field.
|
|
41
|
+
|
|
42
|
+
- NAME_OR_TITLE:
|
|
43
|
+
Text that represents a name, title, label, or keyword for each feature.
|
|
44
|
+
|
|
45
|
+
- DESCRIPTION:
|
|
46
|
+
Text that provides a longer description of the feature, more than just a name or title.
|
|
47
|
+
|
|
48
|
+
For example, if you have a layer to collect information from the public regarding issues in the community, a field in that layer that allows people to specify the nature of the issue can be defined with the Description field value type.
|
|
49
|
+
|
|
50
|
+
- TYPE_OR_CATEGORY:
|
|
51
|
+
Field values represent types or categories for group features that are based on a common characteristic, for example, soil type, zoning code, species, or asset type.
|
|
52
|
+
|
|
53
|
+
- COUNT_OR_AMOUNT:
|
|
54
|
+
Integers (no decimal) that represent the quantity of a specific attribute.
|
|
55
|
+
|
|
56
|
+
- PERCENTAGE_OR_RATIO:
|
|
57
|
+
Number values in this field reflect the relationship between different quantities, for example, the percentage of males in a population or the ratio between the number of males and females.
|
|
58
|
+
|
|
59
|
+
- MEASUREMENT:
|
|
60
|
+
A number that reflects a characteristic that you can precisely measure, for example, elevation, distance, temperature, or age.
|
|
61
|
+
|
|
62
|
+
- CURRENCY:
|
|
63
|
+
A number that represents monetary values.
|
|
64
|
+
|
|
65
|
+
- UNIQUE_IDENTIFIER:
|
|
66
|
+
The values in this field are used to positively distinguish one feature or entity from another, for example, an assessor's parcel number, a membership ID, or an invoice number.
|
|
67
|
+
|
|
68
|
+
Each value per entity must be unique, but that does not necessarily mean all the values in this field will be unique for the layer.
|
|
69
|
+
|
|
70
|
+
For example, if you have two layers\u2014one for employees and one for job sites\u2014both can contain an employee ID unique identifier field. In the employees layer, the employee ID field should contain unique values. In the job sites layer, the employee ID field can contain duplicate values, as an employee may work at multiple job sites. The employee ID field in the job sites layer is still a unique identifier because it distinguishes one employee from another, even though the field does not contain unique values in the job sites layer.
|
|
71
|
+
|
|
72
|
+
- PHONE_NUMBER:
|
|
73
|
+
This field stores phone numbers.
|
|
74
|
+
|
|
75
|
+
- EMAIL_ADDRESS:
|
|
76
|
+
This field stores email address strings.
|
|
77
|
+
|
|
78
|
+
- ORDERED_OR_RANKED_LIST:
|
|
79
|
+
The values in this field represent a feature's status in an ordered or ranked list. For example, a feature can be one of the following:
|
|
80
|
+
|
|
81
|
+
Small, medium, or large
|
|
82
|
+
First, second, third, or fourth
|
|
83
|
+
Informational, warning, error, or failure
|
|
84
|
+
|
|
85
|
+
- BINARY
|
|
86
|
+
Only one of two values are possible for each feature. Examples include the following:
|
|
87
|
+
|
|
88
|
+
On or off
|
|
89
|
+
Yes or no
|
|
90
|
+
True or false
|
|
91
|
+
Inhabited or vacant
|
|
92
|
+
|
|
93
|
+
- LOCATION_OR_PLACE_NAME:
|
|
94
|
+
Values in this field represent a geographic location. Examples include a street address, city name, region, building name (such as A.K. Smiley Public Library), attraction name (such as Alameda County Fairgrounds or Cairngorms National Park), postal code, or country.
|
|
95
|
+
|
|
96
|
+
- COORDINATE:
|
|
97
|
+
These fields store a geographic coordinate value such as x, y, z, latitude, or longitude.
|
|
98
|
+
|
|
99
|
+
- DATE_AND_TIME:
|
|
100
|
+
Values in this field store explicit dates and times or date references such as days of the week, months, or years.
|
|
101
|
+
|
|
102
|
+
- OTHER:
|
|
103
|
+
If a field does not fit any of the above categories, you can assign it to the "OTHER" category.
|
|
104
|
+
|
|
105
|
+
If a field already has a field value type assigned, you MUST use that value type.
|
|
106
|
+
If a field already has a field description assigned, you MUST use it in order to determine a fitting field value type and field alias. You can improve the field description if you think it is necessary.
|
|
107
|
+
If a field already has a field alias assigned, you must use it in order to determine a fitting field description. You can improve the field alias if you think it is necessary.
|
|
108
|
+
If a field does not have a field description, field value type, or field alias assigned, you must generate them based on the field name and the data type of the field. You can also use the existing layer description and title to help you generate the field description, field value type, and field alias.
|
|
109
|
+
`;export{e as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
var a=(n,t)=>{let e=n;for(;e;){if(e===t)return!0;if(!e.parentNode)return!1;e.parentNode instanceof ShadowRoot?e=e.parentNode.host:e=e.parentNode}return!1},f=(n,t,e)=>{let s=l(t).subscribe;return s(o=>{o.some(r=>a(n,r.target))&&e()})},c={},l=n=>{let t=n.join(","),e=c[t];if(e!==void 0)return e;let s=new Set,o=new MutationObserver(r=>s.forEach(u=>u(r)));globalThis.document&&o.observe(document.documentElement,{attributes:!0,attributeFilter:n,subtree:!0});let i={subscribe:r=>(s.add(r),()=>{s.delete(r),s.size===0&&(o.disconnect(),c[t]=void 0)})};return c[t]=i,i},d=(n,t)=>{let e=n;for(;e;){let s=e.closest?.(t);if(s)return s;let o=e.getRootNode?.();if(o===globalThis.document)return;e=o.host}};var h=(n,t,e)=>d(n,`[${t}]`)?.getAttribute(t)??e;export{f as a,d as b,h as c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import"./CFDTXKJ6.js";var e="# ArcGIS Online Map Viewer \u2014 Layer Filter Tool Calling Assistant\n\nYou are an assistant that helps generate layer filter expressions for **ArcGIS Online Map Viewer** by selecting and calling the appropriate tool.\n\nCRITICAL: You are FORBIDDEN from making multiple tool calls. You MUST make exactly ONE tool call.\n\n## You are given:\n\nA list of layers, with layerId, layerSummary and each with associated field information\n{layerFieldInfo}\n\nFieldInfo:\n\n- `name`: the actual field name used in layer filter expressions\n- `type`: one of `string`, `number`, `date`, etc.\n- `alias`: a human-readable label\n- `description`: optional field metadata\n- `statistics`: such as min, max, unique values, etc.\n\n## Your task\n\n1. Analyze the user's request and the provided layer and field information.\n2. Generate a **single ArcGIS SQL WHERE clause** to match features based on the user's request and intent.\n3. Select the most appropriate tool to call based on the user's request.\n\nThe tool will apply the provided WHERE clause to the layer in the map viewer.\n\n## SQL-92 Date/Time Syntax\n\nUser timezone: {userTimezone} ({userTimezoneOffset})\n\nDatabase stores dates in UTC. Convert user's local time to UTC.\n\nTo convert: if offset is `-08:00`, add 8 hours. If `-05:00`, add 5 hours.\n\nFormat: `TIMESTAMP 'YYYY-MM-DD HH:MM:SS'`\n\n### Rules for generating Layer Filter expressions:\n\n- Use only the field\u2019s **`name`** in the output expression.\n- Use metadata (`alias`, `description`, `statistics`) only to help understand the user's meaning \u2014 not in the syntax.\n- Use field `type` to choose appropriate operators:\n - **String** \u2192 `LIKE '%value%'`, `=`, `IN (...)`\n - **Number/Date** \u2192 `=`, `<`, `>`, `BETWEEN`, etc.\n- Use fields with the **highest `relevanceScore`**.\n- Fields are case sensitive.\n- DO NOT use subqueries or `SELECT` keyword.\n- Combine conditions with `AND`, `OR`, or `NOT` as appropriate.\n- If no meaningful layer filter can be generated, do not call a tool.\n";export{e as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{g as i,h as t,p as r,q as e,t as o}from"./26V7SXDR.js";import"./CFDTXKJ6.js";var c=i`.assistant-chat-card-content__skeleton-block{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm);width:100%}.assistant-chat-card-content__skeleton-text{display:block;height:.95em;border-radius:6px;background:linear-gradient(90deg,color-mix(in srgb,var(--calcite-color-foreground-2) 65%,transparent),color-mix(in srgb,var(--calcite-color-foreground-3) 85%,transparent),color-mix(in srgb,var(--calcite-color-foreground-2) 65%,transparent));background-size:200% 100%;animation:assistant-chat-card-content-shimmer 1.2s ease-in-out infinite;width:85%}.assistant-chat-card-content__skeleton-text:last-child{width:70%}@keyframes assistant-chat-card-content-shimmer{0%{background-position:-150% 0}to{background-position:150% 0}}@media(prefers-reduced-motion){.assistant-chat-card-content__skeleton-text{animation:none}}.assistant-chat-card-content__text-container{padding:var(--calcite-spacing-sm);display:flex;flex-direction:column;gap:var(--calcite-spacing-sm);color:var(--calcite-color-text-1)}.assistant-chat-card-content__text-loading{font-style:italic;word-wrap:break-word;word-break:break-all;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}.assistant-chat-card-content__error-notice{padding:var(--calcite-spacing-sm)}`,n="assistant-chat-card-content",a={textLoading:`${n}__text-loading`,skeletonBlock:`${n}__skeleton-block`,skeletonText:`${n}__skeleton-text`},s=class extends r{constructor(){super(...arguments),this.loading=!1,this.type="text"}static{this.properties={loading:5,type:1,content:1,loadingMessage:1}}static{this.styles=c}_renderText(){return t`<div class="assistant-chat-card-content__text-container"><div><span class=${e(this.loading?a.textLoading:void 0)}>${this.loading?this.loadingMessage:this.content}</span></div>${this.loading?t`<div class=${e(a.skeletonBlock)}><span class=${e(a.skeletonText)}></span><span class=${e(a.skeletonText)}></span></div>`:null}</div>`}_renderError(){return t`<calcite-notice class="assistant-chat-card-content__error-notice" open icon kind=warning width=auto><div slot=message>${this.content}</div></calcite-notice>`}render(){switch(this.type){case"text":return this._renderText();case"error":return this._renderError();default:return t`<p>Unsupported content type</p>`}}};o("arcgis-assistant-chat-card-content",s);export{s as ArcgisAssistantChatCardContent};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import"./CFDTXKJ6.js";var e=`# ArcGIS JavaScript SDK FeatureLayerView Query Assistant
|
|
3
|
+
|
|
4
|
+
You are a GIS assistant that generates query parameters for the ArcGIS JavaScript SDK FeatureLayerView \`queryFeatures()\` method.
|
|
5
|
+
|
|
6
|
+
Analyze the user's request and construct appropriate query parameters for each relevant layer. Only include parameters that are necessary to answer the user's question.
|
|
7
|
+
|
|
8
|
+
## Layer and Field Information
|
|
9
|
+
|
|
10
|
+
In addition to field info, layer info with layerId, name, and description will also be provided.
|
|
11
|
+
It will be an array of multiple layers.
|
|
12
|
+
|
|
13
|
+
You are only allowed to use the field names listed under each layer. Do not invent or use any fields not listed.
|
|
14
|
+
|
|
15
|
+
{layerFieldInfo}
|
|
16
|
+
|
|
17
|
+
## Critical Guard \u2014 Do NOT Hallucinate Fields
|
|
18
|
+
|
|
19
|
+
If the user asks for a filter that requires a field not present in the list above, do not invent the field and do not include it.
|
|
20
|
+
|
|
21
|
+
Instead:
|
|
22
|
+
If you can still answer something with the allowed fields, do so (for example: return an unfiltered count).
|
|
23
|
+
Otherwise, return a valid query with where: "1=1" and omit any unsupported filters entirely.
|
|
24
|
+
Never reference fields beyond those listed. If a temporal filter is requested but there is no date field in the schema, omit the temporal filter completely.
|
|
25
|
+
|
|
26
|
+
Validator: Before producing output, verify every field used exists in the listed fields. If any do not, remove the offending clause(s) and proceed per the Guard rules above.
|
|
27
|
+
|
|
28
|
+
## Input
|
|
29
|
+
|
|
30
|
+
Use the most recent relevant user question from the chat history. The question will **not** be restated again here. Start with a fresh WHERE clause for each question - do not inherit filters from previous questions unless user explicitly asks to combine them.
|
|
31
|
+
|
|
32
|
+
### Mixed Questions
|
|
33
|
+
|
|
34
|
+
If a question has both aggregate and display components (e.g., "How many wells have depth > 100? Show them"):
|
|
35
|
+
|
|
36
|
+
- Focus ONLY on the aggregate part ("how many") for this query
|
|
37
|
+
- The visualization part ("show them") is handled by a separate system
|
|
38
|
+
|
|
39
|
+
## RULES
|
|
40
|
+
|
|
41
|
+
DO NOT generate sub queries or nested queries as they are not supported by ArcGIS.
|
|
42
|
+
|
|
43
|
+
When dealing with geometry and proximity and spatial queries:
|
|
44
|
+
|
|
45
|
+
1. TARGET LAYER = What you want to FIND/RETURN in results
|
|
46
|
+
2. GEOMETRY LAYER = The location to search FROM (with distance buffer)
|
|
47
|
+
|
|
48
|
+
For questions like "Is [specific item A] near/within [any of type B]":
|
|
49
|
+
|
|
50
|
+
- Target: Type B (what we're searching for)
|
|
51
|
+
- Geometry: Specific item A (where we're searching from)
|
|
52
|
+
|
|
53
|
+
Examples:
|
|
54
|
+
|
|
55
|
+
Q: "Is well P132_1873 within 300m from a protected area?"
|
|
56
|
+
Target: Protected Areas (what we want to find)
|
|
57
|
+
Geometry: Well (where="ID = 'P132_1873'" - single point)
|
|
58
|
+
Result: Returns which protected areas are nearby
|
|
59
|
+
|
|
60
|
+
Q: "Find roads within 500m of park X"
|
|
61
|
+
Target: Roads (what we want to find)
|
|
62
|
+
Geometry: Park X (specific location)
|
|
63
|
+
Result: Returns which roads are nearby
|
|
64
|
+
|
|
65
|
+
Key principle: The geometry layer should be the SIMPLER geometry (ideally a single feature or small set),
|
|
66
|
+
not a large collection that requires union operations.
|
|
67
|
+
|
|
68
|
+
### NOTE:
|
|
69
|
+
|
|
70
|
+
If the user request includes no filter (where: 1=1) and the answer can be derived from precomputed fieldStatistics, do NOT call a tool. Instead, respond directly using the provided statistics.
|
|
71
|
+
|
|
72
|
+
If you cannot answer directly, you MUST call a tool.
|
|
73
|
+
|
|
74
|
+
## SQL-92 Date/Time Syntax
|
|
75
|
+
|
|
76
|
+
User timezone: {userTimezone} ({userTimezoneOffset})
|
|
77
|
+
|
|
78
|
+
Database stores dates in UTC. Convert user's local time to UTC.
|
|
79
|
+
|
|
80
|
+
To convert: if offset is \`-08:00\`, add 8 hours. If \`-05:00\`, add 5 hours.
|
|
81
|
+
|
|
82
|
+
Format: \`TIMESTAMP 'YYYY-MM-DD HH:MM:SS'\`
|
|
83
|
+
|
|
84
|
+
## Your Task
|
|
85
|
+
|
|
86
|
+
1. Analyze the most recent user question from the chat history and the provided layer and field information.
|
|
87
|
+
2. Select zero or one most appropriate tool to call based on the user's request.
|
|
88
|
+
`;export{e as default};
|
package/dist/cdn/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.
|
|
2
|
-
import{m as t,s as e}from"./
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{m as t,s as e}from"./26V7SXDR.js";import"./CFDTXKJ6.js";var s=t(e,{"arcgis-assistant":[()=>import("./AF7UTDDE.js"),"_messages:,description,entryMessage,heading,orchestrator:,portal:,referenceElement,suggestedPrompts:;;register"],"arcgis-assistant-agent":[()=>import("./4Y73V2HU.js"),"agent:,context:;;getContext"],"arcgis-assistant-data-exploration-agent":[()=>import("./3EBDE5UU.js"),"referenceElement;;getContext"],"arcgis-assistant-layer-filter-agent":[()=>import("./OLPFL2NN.js"),"referenceElement;;getContext"],"arcgis-assistant-layer-query-agent":[()=>import("./PWXNH5LQ.js"),"referenceElement;;getContext"],"arcgis-assistant-layer-styling-agent":[()=>import("./QTP47HEP.js"),"referenceElement;;getContext"],"arcgis-assistant-navigation-agent":[()=>import("./OUVX4QS2.js"),"referenceElement;;getContext"],"arcgis-assistant-chat":[()=>import("./IFWK7P7O.js"),"loading,loadingMessage,messages:,user"],"arcgis-assistant-chat-card":[()=>import("./GCFT45CD.js"),"_messages:,content,error,feedbackDisabled,loading,loadingMessage,log,timestampDisabled,type,user"],"arcgis-assistant-chat-card-content":[()=>import("./XVUE27HC.js"),"content,loading,loadingMessage,type"],"arcgis-assistant-chat-entry":[()=>import("./VUHDKXFM.js"),"_messages:,awaitingResponse,enterKeySubmits,entryPlaceholder,inputValue,status"],"arcgis-assistant-interrupt":[()=>import("./Q674OE2M.js"),"_messages:,message,options:,type"],"arcgis-assistant-shell":[()=>import("./KJZARHAM.js"),"_messages:,awaitingResponse,description,entryMessage,entryMessageClosed,heading,inputValue,loading,status,suggestedPrompts:"]});s({resourcesUrl:import.meta.url});var a=new CSSStyleSheet;a.replaceSync("@layer{:not([hydrated]):is(arcgis-assistant,arcgis-assistant-agent,arcgis-assistant-data-exploration-agent,arcgis-assistant-layer-filter-agent,arcgis-assistant-layer-query-agent,arcgis-assistant-layer-styling-agent,arcgis-assistant-navigation-agent,arcgis-assistant-chat,arcgis-assistant-chat-card,arcgis-assistant-chat-card-content,arcgis-assistant-chat-entry,arcgis-assistant-interrupt,arcgis-assistant-shell){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,a];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,e)
|
package/dist/chunks/runtime.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import "../cdn/main.css";
|
|
3
3
|
import { makeRuntime as e } from "@arcgis/lumina";
|
|
4
4
|
import { trackAccess as s, createObservable as a, createTrackingTarget as r, runTracked as c } from "@arcgis/core/applications/Components/reactiveUtils.js";
|
|
5
|
-
const t = e({ defaultAssetPath: "https://jsdev.arcgis.com/5.
|
|
5
|
+
const t = e({ defaultAssetPath: "https://jsdev.arcgis.com/5.1.0-next/ai-components/", hydratedAttribute: "hydrated" }), { customElement: n, getAssetPath: i, setAssetPath: d } = t;
|
|
6
6
|
t.t = s;
|
|
7
7
|
t.o = a;
|
|
8
8
|
t.c = r;
|
package/dist/chunks/useT9n.js
CHANGED
package/dist/chunks/utils.js
CHANGED
package/dist/chunks/utils2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import { c as t } from "../../chunks/runtime.js";
|
|
3
3
|
import { LitElement as s } from "@arcgis/lumina";
|
|
4
4
|
import { i as e } from "../../chunks/utils.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import { c as a } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as e, html as t } from "lit";
|
|
4
4
|
import { LitElement as i } from "@arcgis/lumina";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import { c as e } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as s, html as t } from "lit";
|
|
4
4
|
import { LitElement as i } from "@arcgis/lumina";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import { c as n } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as i, html as t } from "lit";
|
|
4
4
|
import { LitElement as o, safeClassMap as e } from "@arcgis/lumina";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import { c as e } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as i, html as s } from "lit";
|
|
4
4
|
import { LitElement as r, createEvent as a, nothing as n } from "@arcgis/lumina";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import { c as t } from "../../chunks/runtime.js";
|
|
3
3
|
import { LitElement as a } from "@arcgis/lumina";
|
|
4
4
|
import { DataExplorationAgent as s } from "@arcgis/ai-agents";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import { c as l } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as a, html as e } from "lit";
|
|
4
4
|
import { LitElement as c, createEvent as s } from "@arcgis/lumina";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import { c as t } from "../../chunks/runtime.js";
|
|
3
3
|
import { LitElement as e } from "@arcgis/lumina";
|
|
4
4
|
import { LayerFilterAgent as r } from "@arcgis/ai-agents";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import { c as t } from "../../chunks/runtime.js";
|
|
3
3
|
import { LitElement as e } from "@arcgis/lumina";
|
|
4
4
|
import { LayerQueryAgent as r } from "@arcgis/ai-agents";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import { c as t } from "../../chunks/runtime.js";
|
|
3
3
|
import { LitElement as s } from "@arcgis/lumina";
|
|
4
4
|
import { LayerStylingAgent as e } from "@arcgis/ai-agents";
|