@arcgis/ai-components 6.0.0-next.2 → 6.0.0-next.4
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/agent-utils/middlewares/humanInTheLoop.js +22 -20
- package/dist/agents/agents/help/helpAgent.js +10 -10
- package/dist/agents/tools/navigation/goToBookmark/adapter.js +34 -17
- package/dist/cdn/46NXKDIE.js +2 -0
- package/dist/cdn/{7APXFHDF.js → 5OGABLOF.js} +4 -4
- package/dist/cdn/CKDKQVS3.js +2 -0
- package/dist/cdn/CV5YAJMD.js +2 -0
- package/dist/cdn/{L5OYOLWV.js → CWZG7DML.js} +1 -1
- package/dist/cdn/{UJMM5QA4.js → EWZNZZ5S.js} +1 -1
- package/dist/cdn/G4L7RUTK.js +49 -0
- package/dist/cdn/H653UVNH.js +2 -0
- package/dist/cdn/{Q7BJGEFH.js → I2RQZAFF.js} +1 -1
- package/dist/cdn/JZT4ECVH.js +2 -0
- package/dist/cdn/MNMCIS4E.js +15 -0
- package/dist/cdn/{ZROI63CW.js → MSHEHZYP.js} +2 -2
- package/dist/cdn/OVH4S4ZB.js +3 -0
- package/dist/cdn/{5SRRG7WG.js → RQYDIQVD.js} +2 -2
- package/dist/cdn/TZQ6XEKW.js +2 -0
- package/dist/cdn/YIF2OD6F.js +2 -0
- package/dist/cdn/agent-utils/SkillAgent.js +1 -1
- package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/SKILL3.js +6 -10
- package/dist/chunks/intent_prompt.js +18 -107
- package/dist/components/arcgis-assistant/customElement.js +100 -100
- package/dist/components/arcgis-assistant/types.d.ts +2 -0
- package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +6 -0
- package/dist/components/arcgis-assistant-interrupt/customElement.js +24 -23
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +1 -1
- package/dist/orchestrator/types.d.ts +6 -0
- package/dist/types/lumina.d.ts +1 -1
- package/dist/types/preact.d.ts +1 -1
- package/dist/types/react.d.ts +1 -1
- package/dist/types/stencil.d.ts +1 -1
- package/package.json +5 -5
- package/dist/cdn/7XVIZ7HK.js +0 -2
- package/dist/cdn/AWH4VDPD.js +0 -2
- package/dist/cdn/G3KILEGJ.js +0 -2
- package/dist/cdn/HOMSK66Q.js +0 -2
- package/dist/cdn/MHXM37QI.js +0 -2
- package/dist/cdn/RFIN7KO6.js +0 -138
- package/dist/cdn/SG6PAUVR.js +0 -2
- package/dist/cdn/SRXUC4QB.js +0 -3
- package/dist/cdn/V66TS2BB.js +0 -2
- package/dist/cdn/ZEDDYT24.js +0 -19
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import"./5PV2GUZW.js";var e=`## GIS Agent Orchestrator
|
|
3
|
+
|
|
4
|
+
Select the single best next agent for an ArcGIS Maps SDK for JavaScript system using the latest user request, registered agents, relevant chat history, and prior execution steps.
|
|
5
|
+
|
|
6
|
+
## Output
|
|
7
|
+
|
|
8
|
+
Return an object matching the response schema:
|
|
9
|
+
|
|
10
|
+
- \`intent\`: the selected registered agent's \`id\`.
|
|
11
|
+
- \`assignedTask\`: a short, actionable task for that agent.
|
|
12
|
+
- \`requiresFollowUp\`: \`true\` when another orchestration step will likely be needed after this agent succeeds; \`false\` when success would complete the user-visible request. This indicates remaining work, not uncertainty.
|
|
13
|
+
|
|
14
|
+
If no registered agent applies, return \`intent: null\`, \`assignedTask: null\`, and \`requiresFollowUp: false\`. If any agent can take a useful next step, select it instead.
|
|
15
|
+
|
|
16
|
+
## Routing Rules
|
|
17
|
+
|
|
18
|
+
- Use each agent's registered name and description together to determine whether it can handle the request.
|
|
19
|
+
- A user naming an agent does not override its registered capabilities.
|
|
20
|
+
- Decide only the next step, not the full workflow. Consider supported actions and available app context, not exact keyword matches.
|
|
21
|
+
- Prefer an agent that can complete the request directly. Route a prerequisite to another agent only when the registered capabilities and provided context establish that it is required and cannot be handled by the completing agent. Do not infer extra steps from a mentioned entity alone. Completing a prerequisite does not complete the original request.
|
|
22
|
+
- Use prior steps to avoid repeating successful work and to retry or adjust failed steps when appropriate.
|
|
23
|
+
|
|
24
|
+
## Task And Context Rules
|
|
25
|
+
|
|
26
|
+
- Preserve the latest request's meaning and constraints exactly. Do not add, remove, infer, or substitute constraints, such as distance versus containment or range versus exact match.
|
|
27
|
+
- Keep \`assignedTask\` concise, directly executable, and close to the user's wording. It may cover only the next necessary part of the request, but must not introduce unsolicited recommendations, implementation or publishing guidance, classification proposals, future analysis, or other work the user did not request.
|
|
28
|
+
- Use only information explicitly present in the request or provided context. Use chat history only when the latest request depends on it; do not carry unrelated earlier constraints forward.
|
|
29
|
+
- For references such as "these", "those", "it", "this location", or "the previous results", including equivalents in other languages, resolve them from the most recent relevant history or successful prior step. Make the assigned task standalone by replacing resolvable references, preserving the referenced constraints, and adding only the latest request's changes. Do not otherwise rewrite the request.
|
|
30
|
+
|
|
31
|
+
## Context
|
|
32
|
+
|
|
33
|
+
### Latest user request
|
|
34
|
+
|
|
35
|
+
{userRequest}
|
|
36
|
+
|
|
37
|
+
### Registered agents
|
|
38
|
+
|
|
39
|
+
Format:
|
|
40
|
+
{{id: string, name: string, description: string}}[]
|
|
41
|
+
|
|
42
|
+
{registeredAgents}
|
|
43
|
+
|
|
44
|
+
### Prior steps
|
|
45
|
+
|
|
46
|
+
Each step contains \`agentId\`, \`assignedTask\`, \`summary\`, and \`status\` (\`"success"\`, \`"failed"\`, or \`"unknown"\`).
|
|
47
|
+
|
|
48
|
+
{priorSteps}
|
|
49
|
+
`;export{e as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
var a=new Map([["clearFilters",async()=>(await import("./EUIURCPS.js")).clearFiltersTool],["resetMap",async()=>(await import("./AO42IPOX.js")).resetMapTool],["setFeatureEffect",async()=>(await import("./24KEZCPF.js").then(m=>m.default.then(e=>({setFeatureEffectTool:e})))).setFeatureEffectTool],["listLayerFields",async()=>(await import("./BWUQRZPK.js")).listLayerFieldsTool],["goToAddress",async()=>(await import("./KRPPMEOF.js").then(m=>m.default.then(e=>({goToAddressTool:e})))).goToAddressTool],["goToBookmark",async()=>(await import("./JZT4ECVH.js").then(m=>m.default.then(e=>({goToBookmarkTool:e})))).goToBookmarkTool],["goToFeatures",async()=>(await import("./AY2ZONWQ.js")).goToFeaturesTool],["goToFullExtent",async()=>(await import("./ZVVNATCX.js").then(m=>m.default.then(e=>({goToFullExtentTool:e})))).goToFullExtentTool],["goToHomeExtent",async()=>(await import("./SW3D6QD4.js")).goToHomeExtentTool],["goToLayer",async()=>(await import("./2PGZDONH.js")).goToLayerTool],["goToScale",async()=>(await import("./MYLY2ABI.js")).goToScaleTool],["goToViewpoint",async()=>(await import("./D7FEOAW3.js").then(m=>m.default.then(e=>({goToViewpointTool:e})))).goToViewpointTool],["goToZoom",async()=>(await import("./IH5P2PWJ.js")).goToZoomTool],["findRelevantFields",async()=>(await import("./VU7IOGNS.js").then(m=>m.default.then(e=>({findRelevantFieldsTool:e})))).findRelevantFieldsTool],["findRelevantLayers",async()=>(await import("./OMUWBY75.js")).findRelevantLayersTool],["listSharedResources",async()=>(await import("./KURNYULZ.js")).listSharedResourcesTool],["getAttribute",async()=>(await import("./RNJ7T5GF.js").then(m=>m.default.then(e=>({getAttributeTool:e})))).getAttributeTool],["getStatistics",async()=>(await import("./WOL5YMJ2.js").then(m=>m.default.then(e=>({getStatisticsTool:e})))).getStatisticsTool],["getTopFeatures",async()=>(await import("./I37ZJHTM.js").then(m=>m.default.then(e=>({getTopFeaturesTool:e})))).getTopFeaturesTool],["queryFeatures",async()=>(await import("./EKMCGN6R.js").then(m=>m.default.then(e=>({queryFeaturesTool:e})))).queryFeaturesTool]]);async function e(o){let t=a.get(o);if(!t)throw new Error(`"${o}" tool not found`);return await t()}export{e as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as P}from"./
|
|
2
|
+
import{a as P}from"./H653UVNH.js";import{a as f}from"./GS5JDPZH.js";import{a as u}from"./2WY5MPMY.js";import{a as $,b as w,c as T}from"./S6OUM5X2.js";import{e as E}from"./XLHYQNAM.js";import{Ea as C,S as M,a as v,b,y as S}from"./7GDMXAF5.js";import{Ga as x}from"./A4ZVCRVF.js";import{N as d}from"./N2GN5WOI.js";import{V as A}from"./272R36XK.js";var m=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),K=["point","polyline","polygon","extent","custom"],Q=e=>typeof e=="string"&&K.some(a=>a===e),V=(e,a)=>{if(!(!m(e)||!("value"in e))){if(m(e.sharedStatePatch)){let o={...a.sharedStatePatch};for(let[t,r]of Object.entries(e.sharedStatePatch))m(r)&&"value"in r&&(o[t]={value:r.value});a.sharedStatePatch=o}if(Array.isArray(e.sharedResourceAdditions))for(let o of e.sharedResourceAdditions)m(o)&&Q(o.kind)&&typeof o.description=="string"&&"payload"in o&&a.sharedResourceAdditions.push({kind:o.kind,description:o.description,payload:o.payload})}},W=()=>{let e={sharedResourceAdditions:[]};return{middleware:w({name:"ToolArtifactMiddleware",afterAgent:a=>{if(delete e.sharedStatePatch,e.sharedResourceAdditions.length=0,!m(a))return;let o=a.messages;if(Array.isArray(o)){for(let t of o)if(A.isInstance(t)&&t.status!=="error"){let r=t.artifact;V(r,e)}}}}),collectedEffects:e}},X=async e=>{let{getLocaleFromConfig:a,getStrings:o}=await import("./T7LYQ56H.js"),t=await o({path:"./assets/agents/t9n",locale:a(e)});return w({name:"TraceMiddleware",wrapModelCall:async(r,s)=>{await u({text:t.determiningNextSteps},e);try{return await s(r)}catch(n){throw await u({text:t.failedCallingModel},e),n}},wrapToolCall:async(r,s)=>{await u({text:t.callingTool.replace("{toolName}",r.toolCall.name).replace("{toolArgs}",JSON.stringify(r.toolCall.args))},e);try{return await s(r)}catch(n){throw await u({text:t.failedExecutingTool.replace("{toolName}",r.toolCall.name)},e),n}}})},Y=(e,a)=>{let o=e.get(a);if(!o)throw new Error(`Skill not found: ${a}`);return o.instructions},Z=e=>{if(e.size===0)throw new Error("At least one skill is required.");let a=[...e.keys()];return x(({name:o})=>Y(e,o),{name:"load_skill",description:"Load the detailed instructions for an available skill.",schema:f.object({name:f.enum(a)})})},ee=e=>{let a=/^---\r?\nname: (?<name>[^\r\n]+)\r?\ndescription: (?<description>[^\r\n]+)\r?\n(?:allowed-tools: (?<allowedTools>[^\r\n]+)\r?\n)?---\r?\n(?<instructions>[\s\S]+)$/u.exec(e)?.groups;if(!a?.name||!/^[a-z0-9]+(?:-[a-z0-9]+)*$/u.test(a.name)||a.name.length>64||!a.description||a.description.length>1024||!a.instructions)throw new Error("Invalid skill Markdown.");return{allowedTools:a.allowedTools?.split(/\s+/u)??[],name:a.name,description:a.description,instructions:a.instructions.trim()}},te=async e=>{let a=await Promise.all(e.map(async t=>ee(await t()))),o=new Map;for(let t of a){if(o.has(t.name))throw new Error(`Skill name must be unique: ${t.name}`);o.set(t.name,t)}return o},R="load_skill",q=e=>typeof e=="object"&&e!==null&&"name"in e&&typeof e.name=="string"?e.name:void 0,ae=(e,a)=>{let o=a;return w({name:"ActiveSkillMiddleware",wrapModelCall:async(t,r)=>{let s=new Set([R,...o?.allowedTools??[]]);return await r({...t,tools:t.tools.filter(n=>{let l=q(n);return l!==void 0&&s.has(l)})})},wrapToolCall:async(t,r)=>{let s=await r(t);if(t.toolCall.name===R){let n=q(t.toolCall.args),l=n?e.get(n):void 0;l&&(o=l)}return s}})},oe=async(e,a={})=>{let o=new Set([...e.values()].flatMap(t=>t.allowedTools));return await Promise.all([...o].map(async t=>{let r=a[t],s=r?await r():await P(t);if(s.name!==t)throw new Error(`Skill tool "${t}" resolved to "${s.name}".`);return s}))},re=async(e,a={})=>{let o=await te(e),t=[...o.values()];if(t.length===0)throw new Error("createSkillRuntime requires at least one skill.");let r=await oe(o,a),s=t.length===1?t[0]:void 0;return{activeSkillMiddleware:ae(o,s),skillsPrompt:s?`Active skill:
|
|
3
3
|
${s.name}
|
|
4
4
|
|
|
5
5
|
${s.instructions}`:`Available skills:
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import"./5PV2GUZW.js";var e=`---
|
|
3
|
+
name: help
|
|
4
|
+
description: Answers questions about this map's layers and schema, explains assistant capabilities, and redirects unsupported actions or unrelated questions to map-related help.
|
|
5
|
+
allowed-tools: listLayerFields
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Help
|
|
9
|
+
|
|
10
|
+
- Use runtime context to describe the map, list layers, and explain registered capabilities. Its field names may be incomplete; never treat them as a full schema.
|
|
11
|
+
- For field, column, or attribute requests, call \`listLayerFields\`. Resolve the layer from the request and conversation; use the only available layer when unambiguous, otherwise ask which layer. Pass its exact title from context.
|
|
12
|
+
- Treat tool results as the source of truth. Include every matching field, always showing both its alias and exact field name, even when identical. Preserve field-name casing; never omit, combine, rename, or invent fields or metadata. Copy field descriptions exactly as returned by \`listLayerFields\`; do not paraphrase, summarize, expand, or infer them. If no description is returned, say it is unavailable.
|
|
13
|
+
- For field lists with metadata, use a Markdown table with separate \`Alias\` and \`Field name\` columns, plus only the requested metadata columns. For names-only lists or simple subsets, use bullets in the format \`Alias (field name: exact name)\`. Be concise, but never omit either label.
|
|
14
|
+
- Explain capabilities only when supported by registered-agent descriptions. For "what can I ask?" give 3-5 examples using actual map details. For unsupported map actions or unrelated questions, redirect to a relevant map question when possible.
|
|
15
|
+
`;export{e as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as P}from"./TIQUULA4.js";import
|
|
2
|
+
import{a as P}from"./TIQUULA4.js";import n from"./CWZG7DML.js";import{a as I,c as v}from"./NYFL2F5L.js";import"./YD5LVM7V.js";import l from"./AOT3PM2Q.js";import k from"./YGSDJ4V3.js";import j from"./M52LKZN7.js";import i from"./UXDRYDOD.js";import g from"./2H32MDP2.js";import"./OPQCY33W.js";import"./QAVDW7A7.js";import f from"./YSEHJQ4L.js";import e from"./CV5YAJMD.js";import"./OKDXM5D4.js";import d from"./UP7RW5K2.js";import"./M5UMOOL2.js";import"./H6J65TWL.js";import"./XBWGOD6I.js";import c from"./J3T5HB77.js";import"./AGDGDULE.js";import"./FIZMK7GS.js";import"./LMAIOLS2.js";import"./7OQK2F7O.js";import b from"./Y3ZKMD47.js";import a from"./BMVPOFHU.js";import"./QBZP6XOE.js";import"./3COVQI26.js";import{a as m}from"./CETIZ4IQ.js";import"./PR4VMSKD.js";import{c as M}from"./X3YFCWQZ.js";import"./2JD3G7IW.js";import"./LDDP7NSY.js";import"./WHIWOYHN.js";import{C as x,x as S}from"./NAVK5JJ2.js";import"./OUMTV5H5.js";import"./I2RQZAFF.js";import"./H653UVNH.js";import"./GS5JDPZH.js";import{a as s}from"./2WY5MPMY.js";import"./S6OUM5X2.js";import"./XLHYQNAM.js";import{Ea as L,a as w,b as h,s as E}from"./7GDMXAF5.js";import"./5XZ5VL42.js";import"./C3VLDYS2.js";import"./A4ZVCRVF.js";import"./N2GN5WOI.js";import"./272R36XK.js";import"./5PV2GUZW.js";export default $arcgis.t(([,,,,,,,,,,,,,,,{a:F,c:$,d:C,e:N,f:T,g:A,h:b,i:R,j:_,k:k,l:q,m:V,n:u,o:j}])=>{var z=async(t,r)=>{let e=t.tool_calls??[];if(e.length===0){await s({text:`LLM did not request any tool calls: ${String(t?.content)}`},r);return}await Promise.all(e.map(async a=>await s({text:`LLM invoked ${a.name} tool with arguments: ${JSON.stringify(a.args,null,2)}`},r)))};var D=.7,B=10,J=async(t,r)=>{try{await s({text:"Similarity search to find fields"},r);let e=m(r,"fieldSearch"),a=m(r,"layersAndFieldsRegistry"),i=m(r,"embeddingCache"),o=await e.searchFields({text:t.agentExecutionContext.assignedTask,layerIds:t.vectorSearchLayerIds,minScore:D,topResults:B,embeddingCache:i}),p=o.map(({layerId:c,results:d})=>{let g=d.map(n=>` - ${n.name} (${n.score.toFixed(2)})`).join(`
|
|
3
3
|
`);return`${a.get(c)?.layerItem.name??c}:
|
|
4
4
|
${g}`}).join(`
|
|
5
5
|
`),l;return o.length>0?l=`Vector search completed. Matching layers and fields with scores:
|
|
@@ -11,4 +11,4 @@ ${p}`:l="Vector search completed. No matching layers found.",await s({text:l},r)
|
|
|
11
11
|
_Example: “Color points by sales amount”_
|
|
12
12
|
_Example: “Show population density with a color gradient”_
|
|
13
13
|
_Example: “Create a relationship map between height and depth”_
|
|
14
|
-
_Example: “Vary circle sizes according to population”_`,y={id:"layerStyling",name:"Layer Styling Agent",description:te,createGraph:ee,workspace:u};var f=class extends S{constructor(){super(...arguments),this.agent=y}static{this.properties={referenceElement:1}}#e;#t;getContext(){if(!this.#e)throw new Error("arcgis-assistant-layer-styling-agent requires a mapView");return{mapView:this.#e}}load(){this.#e=I(this,"arcgis-assistant-layer-styling-agent"),this.#t=v(this)}disconnectedCallback(){this.#t?.unregister(this.agent.id),super.disconnectedCallback()}};x("arcgis-assistant-layer-styling-agent",f);return f},"intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",a,b,c,d,e,f,g,i,j,k,l)
|
|
14
|
+
_Example: “Vary circle sizes according to population”_`,y={id:"layerStyling",name:"Layer Styling Agent",description:te,createGraph:ee,workspace:u};var f=class extends S{constructor(){super(...arguments),this.agent=y}static{this.properties={referenceElement:1}}#e;#t;getContext(){if(!this.#e)throw new Error("arcgis-assistant-layer-styling-agent requires a mapView");return{mapView:this.#e}}load(){this.#e=I(this,"arcgis-assistant-layer-styling-agent"),this.#t=v(this)}disconnectedCallback(){this.#t?.unregister(this.agent.id),super.disconnectedCallback()}};x("arcgis-assistant-layer-styling-agent",f);return f},"intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",a,b,c,d,e,f,g,i,j,k,l,n)
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import{a as p,b as g}from"./63OF33IL.js";import{s as l}from"./7GDMXAF5.js";var h="human-in-the-loop",m="Agent execution requires approval",f="Agent execution rejected by the user.",w="human-in-the-loop-tool",y="Tool execution requires approval";function A(t={}){let{outputKey:e}=t;return p(h,{wrapAgent:async(n,r)=>{let a=b(n),o=$(a,n),i=c(n.config?.configurable);if(i?.agentId!==a)throw new l(await I({agentId:a,interruptId:o,options:t,request:n}));if(i.id!==o){if(T(a,i.id))return await r(n);throw new l(await I({agentId:a,interruptId:o,options:t,request:n}))}if(i.payload===!1)return{outputMessage:f,status:"failed",summary:f};let u=e?{...n.state,[e]:i.payload}:n.state,s={...n,state:u};return await r(s)}},{outputKey:e})}function x(t={}){let{outputKey:e}=t;return g(w,{wrapToolCall:async(n,r)=>{let a=n.tool.name,o=C(n.config?.configurable),i=O(o,n.toolCallId??a),u=c(n.config?.configurable);if(u?.agentId!==o||u.id!==i)throw new l(await q({agentId:o,interruptId:i,options:t,request:n}));if(u.payload===!1)return`Tool call "${a}" was rejected by the user.`;let s=e?{...n.input,[e]:u.payload}:n.input,d={...n,input:s};return await r(d)}})}async function I(t){let{agentId:e,interruptId:n,options:r,request:a}=t,o=await r.interrupt?.({...a,agentId:e});return{agentId:e,id:n,kind:o?.kind??"booleanChoice",message:o?.message??m,metadata:o?.metadata,showOtherOption:o?.showOtherOption}}function b(t){return typeof t.config?.configurable?.agentId=="string"?t.config.configurable.agentId:t.agent.id}function $(t,e){let n=e.config?.configurable?.thread_id,r=typeof n=="string"&&n?`${n}:`:"";return`${t}:${r}${e.nodeName}`}function T(t,e){return e.startsWith(`${t}:tool:`)}function C(t){return typeof t?.agentId=="string"?t.agentId:"llm-agent"}function O(t,e){return`${t}:tool:${e}`}async function q(t){let{agentId:e,interruptId:n,options:r,request:a}=t,{input:o,tool:i,toolCallId:u}=a,s=i.name,d=await r.interrupt?.({...a,args:o,toolName:s,toolCallId:u});return{agentId:e,id:n,kind:d?.kind??"booleanChoice",message:d?.message??`${y}
|
|
3
|
+
Tool: ${s}`,showOtherOption:d?.showOtherOption,metadata:d?.metadata??{args:o,toolCallId:u,toolName:s}}}function N(t){return c(t?.configurable)?.payload}function c(t){let e=t?.hitlResponse;return e&&typeof e=="object"&&"id"in e&&"agentId"in e?e:null}export{A as a,x as b,N as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as I}from"./TIQUULA4.js";import
|
|
2
|
+
import{a as I}from"./TIQUULA4.js";import p from"./CWZG7DML.js";import{c as A,d as K}from"./NYFL2F5L.js";import"./YD5LVM7V.js";import o from"./AOT3PM2Q.js";import n from"./YGSDJ4V3.js";import m from"./M52LKZN7.js";import l from"./UXDRYDOD.js";import j from"./2H32MDP2.js";import"./OPQCY33W.js";import"./QAVDW7A7.js";import i from"./YSEHJQ4L.js";import h from"./CV5YAJMD.js";import"./OKDXM5D4.js";import g from"./UP7RW5K2.js";import"./M5UMOOL2.js";import"./H6J65TWL.js";import"./XBWGOD6I.js";import f from"./J3T5HB77.js";import"./AGDGDULE.js";import"./FIZMK7GS.js";import"./LMAIOLS2.js";import"./7OQK2F7O.js";import e from"./Y3ZKMD47.js";import a from"./BMVPOFHU.js";import"./QBZP6XOE.js";import"./3COVQI26.js";import"./CETIZ4IQ.js";import"./PR4VMSKD.js";import{a as S,c as T}from"./X3YFCWQZ.js";import"./2JD3G7IW.js";import"./LDDP7NSY.js";import"./WHIWOYHN.js";import{C as x,x as y}from"./NAVK5JJ2.js";import"./OUMTV5H5.js";import"./I2RQZAFF.js";import"./H653UVNH.js";import"./GS5JDPZH.js";import{a as c,b}from"./2WY5MPMY.js";import"./S6OUM5X2.js";import"./XLHYQNAM.js";import{Ea as _,a as k,b as d,j as v}from"./7GDMXAF5.js";import"./5XZ5VL42.js";import"./C3VLDYS2.js";import"./A4ZVCRVF.js";import"./N2GN5WOI.js";import{fa as u}from"./272R36XK.js";import"./5PV2GUZW.js";export default $arcgis.t(([,,,{fetchKnowledgeGraph:W},,,,,,,,,,,,{a:q,b:h,o:m,p:w,q:E,r:M,s:C,t:G,u:N,v:R,w:z,x:L,y:$,z:F}])=>{var D=[N,R,$,z,G,F,L];async function O(e,t){let o=await m("arcgis_knowledge_tool_prompt"),s=E(t),r={assignedTask:e.agentExecutionContext.assignedTask,userRequest:e.agentExecutionContext.userRequest,priorSteps:e.agentExecutionContext.priorSteps,contextType:s},n=await T({promptText:o,messages:e.arcgisKnowledgeMessages,inputVariables:r,tools:D,config:t}),i=(n.tool_calls?.length??0)>0,a=typeof n.text=="string"?n.text.trim():"",l=a.length>0,g=n.text;return!i&&(s==="map"||s==="knowledgeGraph")?{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,n],outputMessage:s==="map"?"No tools were found for the current view and prompt. Maps do not support changing nonspatial visibility, layout changes, or generation from queries.":"No tools were found for the current prompt and knowledge graph service. A knowledge graph service only supports search and query.",status:"success"}:{...e,arcgisKnowledgeMessages:[...e.arcgisKnowledgeMessages,n],outputMessage:i?g:a,status:i?e.status:l?"success":"failed",summary:g?h(g):"ArcGIS Knowledge Agent tool executed."}}var U={generateCypher:"generated-cypher-query",queryGraphData:"graph-query-result",searchGraphData:"graph-search-result",addRecords:"added-records",applyLayout:"applied-layout",changeNonspatialVisibility:"changed-nonspatial-visibility",createLinkChart:"created-link-chart"};function j(e){return!!e&&e.status==="success"&&!!U[e.toolName]}function J(e){return{type:U[e.toolName],data:e.details}}async function P(e,t){let o=new q(D,{handleToolErrors:!1});try{let s=await o.invoke({messages:e.arcgisKnowledgeMessages},t),r=[];for(let a of s.messages){let l;if(typeof a.content!="string")throw new Error(`Unexpected tool message content type: ${typeof a.content}. Expected string.`);try{l=JSON.parse(a.content)}catch{throw new Error(`Failed to parse tool message content as JSON. Tool: ${a.name??"unknown"}.
|
|
3
3
|
|
|
4
4
|
Original Content: ${a.content}`)}if(!l||typeof l!="object"||!("toolName"in l))throw new Error(`Parsed tool message content does not have expected structure. Parsed content: ${JSON.stringify(l)}`);r.push(l)}await c({text:`Finished executing ArcGIS Knowledge Agent tools: ${s.messages.filter(a=>a.name).map(a=>a.name).join(", ")}`},t);let n=r.filter(a=>typeof a!="string").map(a=>`- Called Tool: ${a.toolName}, Status: ${a.status}`),i=r[0];return i&&j(i)&&await b(J(i),t),{...e,outputMessage:n.join(`
|
|
5
5
|
`),summary:n.length?h(n.join(`
|
|
@@ -41,4 +41,4 @@ _example: "Discover and add all the relationships originating at 'Entity E' to t
|
|
|
41
41
|
_example: "Show me all entities with a name similar to 'Smith' and add them to the link chart"_
|
|
42
42
|
_example: "Find reports in my graph that have a title similar to 'Quarterly Earnings'"_
|
|
43
43
|
_example: "Find John Smith and all people he has made phone calls to in the last year"_
|
|
44
|
-
_example: "What is the average age of all people who work for Esri?"_`,V={id:"knowledge",name:"ArcgisKnowledge Agent",description:B,createGraph:Y,workspace:w};var f=class extends y{constructor(){super(...arguments),this.agent=V}static{this.properties={referenceElement:1,serviceUrl:3,context:0}}#t;#a;#e;#o;get serviceUrl(){return this.#a}set serviceUrl(t){this.#a=t}async getContext(){let t=this.context?{...this.context,knowledgeGraph:void 0,view:void 0}:{};if(this.#t)return{...t,view:this.#t};if(this.#e)try{let o=await this.#e;return{...t,knowledgeGraph:o}}catch(o){console.error("Failed to load knowledge graph via service URL:",o)}if(!this.context?.knowledgeGraph&&!this.context?.view)throw new Error("arcgis-assistant-knowledge-agent requires either a knowledgeGraph or view in context, and neither were provided");return this.context}willUpdate(t){t.has("serviceUrl")&&this.serviceUrl?this.#e=W(this.serviceUrl):this.#e=void 0}load(){this.#t=K(this)??void 0,this.#o=A(this)}disconnectedCallback(){this.#o?.unregister(this.agent.id),super.disconnectedCallback()}};x("arcgis-assistant-knowledge-agent",f);return f},"intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",a,e,f,g,h,i,j,l,m,n,o)
|
|
44
|
+
_example: "What is the average age of all people who work for Esri?"_`,V={id:"knowledge",name:"ArcgisKnowledge Agent",description:B,createGraph:Y,workspace:w};var f=class extends y{constructor(){super(...arguments),this.agent=V}static{this.properties={referenceElement:1,serviceUrl:3,context:0}}#t;#a;#e;#o;get serviceUrl(){return this.#a}set serviceUrl(t){this.#a=t}async getContext(){let t=this.context?{...this.context,knowledgeGraph:void 0,view:void 0}:{};if(this.#t)return{...t,view:this.#t};if(this.#e)try{let o=await this.#e;return{...t,knowledgeGraph:o}}catch(o){console.error("Failed to load knowledge graph via service URL:",o)}if(!this.context?.knowledgeGraph&&!this.context?.view)throw new Error("arcgis-assistant-knowledge-agent requires either a knowledgeGraph or view in context, and neither were provided");return this.context}willUpdate(t){t.has("serviceUrl")&&this.serviceUrl?this.#e=W(this.serviceUrl):this.#e=void 0}load(){this.#t=K(this)??void 0,this.#o=A(this)}disconnectedCallback(){this.#o?.unregister(this.agent.id),super.disconnectedCallback()}};x("arcgis-assistant-knowledge-agent",f);return f},"intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",a,e,f,g,h,i,j,l,m,n,o,p)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import p from"./CWZG7DML.js";import{a as e,c as s}from"./NYFL2F5L.js";import"./YD5LVM7V.js";import o from"./AOT3PM2Q.js";import l from"./YGSDJ4V3.js";import k from"./M52LKZN7.js";import j from"./UXDRYDOD.js";import i from"./2H32MDP2.js";import"./OPQCY33W.js";import"./QAVDW7A7.js";import h from"./YSEHJQ4L.js";import g from"./CV5YAJMD.js";import"./OKDXM5D4.js";import f from"./UP7RW5K2.js";import"./M5UMOOL2.js";import"./H6J65TWL.js";import"./XBWGOD6I.js";import d from"./J3T5HB77.js";import"./AGDGDULE.js";import"./FIZMK7GS.js";import"./LMAIOLS2.js";import"./7OQK2F7O.js";import c from"./Y3ZKMD47.js";import b from"./BMVPOFHU.js";import{a as m}from"./QBZP6XOE.js";import"./3COVQI26.js";import"./CETIZ4IQ.js";import"./PR4VMSKD.js";import"./X3YFCWQZ.js";import"./2JD3G7IW.js";import"./LDDP7NSY.js";import"./WHIWOYHN.js";import{C as a,x as r}from"./NAVK5JJ2.js";import"./OUMTV5H5.js";import{a as n}from"./I2RQZAFF.js";import"./H653UVNH.js";import"./GS5JDPZH.js";import"./2WY5MPMY.js";import"./S6OUM5X2.js";import"./XLHYQNAM.js";import"./7GDMXAF5.js";import"./5XZ5VL42.js";import"./C3VLDYS2.js";import"./A4ZVCRVF.js";import"./N2GN5WOI.js";import"./272R36XK.js";import"./5PV2GUZW.js";export default $arcgis.t(([])=>{var d=({config:o})=>{let{mapView:t}=m(o,["mapView"]),l=t.map,g=Number.isFinite(t.zoom)?t.zoom:void 0;return JSON.stringify({availableBookmarks:l.bookmarks?.map(({name:c})=>c).filter(Boolean)??[],currentZoom:g},null,2)},u=[async()=>(await import("./LWEKPFV6.js")).default],p=n({id:"navigation",name:"Navigation Agent",description:"Navigates the map for explicit zoom, center, address, bookmark, layer, feature, extent, scale, and viewpoint requests. Use for questions asking where a place is or to resolve an address or place as a reusable spatial anchor for a proximity request. Resolves only the location; it does not query, display, filter, or highlight feature data.",skillLoaders:u,modelTier:"default",systemPrompt:"You are an ArcGIS map navigation agent.",runtimeContextLoader:d});var i=class extends r{constructor(){super(...arguments),this.agent=p}static{this.properties={referenceElement:1}}#t;#i;getContext(){if(!this.#t)throw new Error("arcgis-assistant-navigation-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=e(this,"arcgis-assistant-navigation-agent"),this.#i=s(this)}disconnectedCallback(){this.#i?.unregister(this.agent.id),super.disconnectedCallback()}};a("arcgis-assistant-navigation-agent",i);return i},"intl","smartMapping/statistics/summaryStatistics","smartMapping/statistics/uniqueValues","rest/knowledgeGraphService",b,c,d,f,g,h,i,j,k,l,o,p)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import{b as d}from"./ZUKM4DGB.js";import"./FIZMK7GS.js";import"./SUMXIUIS.js";import"./PR4VMSKD.js";import{C as u,g as n,h as e,o as c,v as r,w as i,x as h,y as p}from"./NAVK5JJ2.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";var _=n`:host{padding:var(--calcite-spacing-md);background:var(--calcite-panel-background-color, var(--calcite-color-background))}calcite-panel{border-radius:var(--calcite-dialog-corner-radius, var(--calcite-corner-radius-sm));border:0 solid var(--calcite-color-brand);border-block-start-width:4px;box-shadow:var(--calcite-shadow-md);width:100%;--calcite-panel-border-color: none}.interrupt-content{padding:0 var(--calcite-spacing-md);background:var(--calcite-color-foreground-1)}.other-input calcite-input[disabled]{pointer-events:none}.last-option{--calcite-list-border-color: transparent}`,o=class extends h{constructor(){super(...arguments),this.#e=r(),this.#t=r(),this._messages=d({blocking:!0}),this._selectedOptions=[],this._otherValue="",this._otherSelected=!1,this.showOtherOption=!1,this.arcgisCancel=c(),this.arcgisSubmit=c()}static{this.properties={_selectedOptions:16,_otherValue:16,_otherSelected:16,type:1,message:1,options:[1,{type:Array}],showOtherOption:5}}static{this.styles=_}#e;#t;_isSubmitDisabled(){return this._otherSelected&&this.showOtherOption?!this._otherValue.trim():!this._selectedOptions.length}_getSubmitValue(){let t=this._otherSelected&&this.showOtherOption;return typeof this._selectedOptions=="string"?t?this._otherValue.trim():this._selectedOptions:this._selectedOptions.concat(t?this._otherValue.trim():[])}_getSkipValue(){return this.type==="multi-select"?[]:""}_selectOtherOption(){this._otherSelected||(this._otherSelected=!0,this.type!=="multi-select"&&(this._selectedOptions=""),this._focusOtherInput())}_handleSingleSelectChange(t){let s=this._otherSelected;this._otherSelected=t.target.selectedItems[0]===this.#t.value,this._selectedOptions=this._otherSelected?"":t.target.selectedItems[0]?.value,this._otherSelected&&!s&&this._focusOtherInput()}_handleMultiSelectChange(t){let s=this._otherSelected,l=this.#t.value;this._otherSelected=l?t.target.selectedItems.includes(l):!1,this._selectedOptions=t.target.selectedItems.filter(a=>a!==l).map(a=>a.value),this._otherSelected&&!s&&this._focusOtherInput()}async _focusOtherInput(){await this.updateComplete,await this.#e.value?.setFocus()}_renderOptions(){return this.options?.map((t,s)=>e`<calcite-list-item class=${p({"last-option":s===this.options.length-1})} .label=${t} .value=${t}></calcite-list-item>`)}_renderOtherInput(){return e`<div slot=content class="other-input" @click=${t=>{t.stopPropagation(),this._selectOtherOption()}}><calcite-input .label=${this._messages.otherLabel} .placeholder=${this._messages.otherLabel} .disabled=${!this._otherSelected} @calciteInputInput=${t=>this._otherValue=t.target.value} ${i(this.#e)}></calcite-input></div>`}_renderInterruptOptions(){switch(this.type){case"single-select":return e`<calcite-list selection-mode=single-persist .label=${this._messages.optionsLabel} @calciteListChange=${t=>this._handleSingleSelectChange(t)}>${this._renderOptions()}${this.showOtherOption?e`<calcite-list-item .selected=${this._otherSelected} ${i(this.#t)}>${this._renderOtherInput()}</calcite-list-item>`:null}</calcite-list>`;case"multi-select":return e`<calcite-list selection-mode=multiple .label=${this._messages.optionsLabel} @calciteListChange=${t=>this._handleMultiSelectChange(t)}>${this._renderOptions()}${this.showOtherOption?e`<calcite-list-item .selected=${this._otherSelected} ${i(this.#t)}>${this._renderOtherInput()}</calcite-list-item>`:null}</calcite-list>`;case"boolean-choice":return null;case"text-input":return e`<calcite-input .label=${this._messages.enterTextLabel} @calciteInputInput=${t=>this._selectedOptions=t.target.value}></calcite-input>`}}render(){return e`<calcite-panel .description=${this.message}><div class="interrupt-content">${this._renderInterruptOptions()}</div>${this.type==="boolean-choice"?e`<calcite-button slot=footer-end appearance=outline @click=${()=>this.arcgisSubmit.emit(!1)}>${this._messages.declineButtonLabel}</calcite-button><calcite-button slot=footer-end appearance=solid @click=${()=>this.arcgisSubmit.emit(!0)}>${this._messages.approveButtonLabel}</calcite-button>`:e`<calcite-button slot=footer-end appearance=outline @click=${()=>this.arcgisSubmit.emit(this._getSkipValue())}>${this._messages.skipButtonLabel}</calcite-button><calcite-button slot=footer-end appearance=solid .disabled=${this._isSubmitDisabled()} @click=${()=>this.arcgisSubmit.emit(this._getSubmitValue())}>${this._messages.submitButtonLabel}</calcite-button>`}</calcite-panel>`}};u("arcgis-assistant-interrupt",o);export{o as ArcgisAssistantInterrupt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as o}from"../
|
|
2
|
+
import{a as o}from"../I2RQZAFF.js";import"../H653UVNH.js";import"../GS5JDPZH.js";import"../2WY5MPMY.js";import"../S6OUM5X2.js";import{a as i}from"../HU527DML.js";import"../WEBAQIUT.js";import"../XLHYQNAM.js";import"../7GDMXAF5.js";import"../5XZ5VL42.js";import"../C3VLDYS2.js";import"../A4ZVCRVF.js";import"../N2GN5WOI.js";import"../272R36XK.js";import"../5PV2GUZW.js";var r=class extends i{constructor(t){super(),this.modelTier="default",Object.assign(this,t),this.generate()}generate(){let t=this.toolLoaders?Object.fromEntries(Object.entries(this.toolLoaders).map(([a,n])=>[a,async()=>{let e=await n();return"getTool"in e?e.getTool():e}])):void 0,s=o({id:this.id,name:this.name,description:this.description,systemPrompt:this.systemPrompt,skillLoaders:this.skillLoaders,toolLoaders:t,modelTier:this.modelTier,runtimeContextLoader:this.runtimeContextLoader,instructions:this.instructions});this.createGraph=s.createGraph,this.workspace=s.workspace}};export{r as SkillAgent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a,b,c}from"../../
|
|
2
|
+
import{a,b,c}from"../../OVH4S4ZB.js";import"../../63OF33IL.js";import"../../S6OUM5X2.js";import"../../7GDMXAF5.js";import"../../5XZ5VL42.js";import"../../C3VLDYS2.js";import"../../A4ZVCRVF.js";import"../../N2GN5WOI.js";import"../../272R36XK.js";import"../../5PV2GUZW.js";export{a as createHumanInTheLoopMiddleware,b as createHumanInTheLoopToolMiddleware,c as getHumanInTheLoopPayload};
|
package/dist/cdn/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{B as e,q as s}from"./NAVK5JJ2.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";var a=s(e,{"arcgis-assistant":[()=>import("./
|
|
2
|
+
import{B as e,q as s}from"./NAVK5JJ2.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";var a=s(e,{"arcgis-assistant":[()=>import("./5OGABLOF.js"),"_messages:,allowedAgentIds,alwaysUseAgentId,assistantAvatarEnabled,awaitingResponse:,awaitingResponseStep:,commandProvider:,copyEnabled,description,entityProviders:,entryMessage,feedbackEnabled,heading,interrupt:,keepSuggestedPrompts,logEnabled,messages:,orchestrator:,readAloudEnabled,referenceElement,runtimeEventsEnabled,streamingDisabled,suggestedPrompts,userAvatarEnabled,voiceInputEnabled;clearChatHistory,submitMessage;cancelInterrupt,register,submitInterrupt,unregister"],"arcgis-assistant-agent":[()=>import("./EWZNZZ5S.js"),"agent:,context:,itemId,workflow:;getContext"],"arcgis-assistant-data-exploration-agent":[()=>import("./CKDKQVS3.js"),"referenceElement;;getContext"],"arcgis-assistant-help-agent":[()=>import("./46NXKDIE.js"),"referenceElement;;getContext"],"arcgis-assistant-knowledge-agent":[()=>import("./RQYDIQVD.js"),"context:,referenceElement,serviceUrl;getContext"],"arcgis-assistant-layer-styling-agent":[()=>import("./MSHEHZYP.js"),"referenceElement;;getContext"],"arcgis-assistant-navigation-agent":[()=>import("./TZQ6XEKW.js"),"referenceElement;;getContext"],"arcgis-assistant-chat":[()=>import("./JCWFLYB4.js"),"interrupt:,loading,messages:"],"arcgis-assistant-chat-entry":[()=>import("./XGDXTTYW.js"),"_messages:,awaitingResponse,commandProvider:,disabled,entityProviders:,entryPlaceholder,inputValue,keyboardShortcutsDisabled,messages:,status,voiceInputEnabled;submitMessage"],"arcgis-assistant-interrupt":[()=>import("./YIF2OD6F.js"),"_messages:,message,options,showOtherOption,type"],"arcgis-assistant-interrupt-preview":[()=>import("./NK2QRPS6.js"),"interrupts:"],"arcgis-assistant-message":[()=>import("./H4QWVTEZ.js"),"_messages:,assistantAvatarEnabled,copyEnabled,feedbackEnabled,footerDisabled,logEnabled,message:,readAloudEnabled"],"arcgis-assistant-message-block":[()=>import("./XQUKC4YK.js"),"block:"],"arcgis-assistant-message-feedback":[()=>import("./MUSLUFKI.js"),"_messages:,feedbackEnabled,message:"],"arcgis-assistant-message-footer":[()=>import("./DY6MO2CA.js"),"_messages:,copyEnabled,feedbackEnabled,logEnabled,message:,readAloudEnabled"],"arcgis-assistant-message-loading":[()=>import("./L46O52F7.js"),"_messages:,assistantAvatarEnabled,interrupts:,loading,loadingMessage"],"arcgis-assistant-message-log":[()=>import("./W2SIOY2B.js"),"log,logEnabled,showLog"],"arcgis-assistant-message-read-aloud":[()=>import("./MR3R5YHQ.js"),"_messages:,message:,readAloudEnabled"],"arcgis-assistant-message-text":[()=>import("./UZ7XFHYI.js"),"content,parts"],"arcgis-assistant-speech-input":[()=>import("./YAANCUW2.js"),"awaitingResponse,inputValue,language,mode;;clearDraftSession"],"arcgis-assistant-suggested-prompts":[()=>import("./UR2S7L6Z.js"),"_messages:,label,prompts:"],"arcgis-assistant-user-message":[()=>import("./UMTRLI63.js"),"content,message:,user,userAvatarEnabled"],"arcgis-assistant-observation-panel":[()=>import("./HTNKDDEV.js"),"events:,pricing:,referenceElement,snapshot:"],"arcgis-assistant-observation-inspector":[()=>import("./PXBS2FXE.js"),"pricing:,run:,span:"],"arcgis-assistant-observation-latency":[()=>import("./AQ7KG25Q.js"),"run:,span:"],"arcgis-assistant-observation-run":[()=>import("./COANVCKH.js"),"events:,pricing:,run:,selectedSpanId"],"arcgis-assistant-observation-usage":[()=>import("./5LBUP33F.js"),"aggregate,pricing:,usage:"]});a({resourcesUrl:import.meta.url});var t=new CSSStyleSheet;t.replaceSync("@layer{:not([hydrated]):is(arcgis-assistant,arcgis-assistant-agent,arcgis-assistant-data-exploration-agent,arcgis-assistant-help-agent,arcgis-assistant-knowledge-agent,arcgis-assistant-layer-styling-agent,arcgis-assistant-navigation-agent,arcgis-assistant-chat,arcgis-assistant-chat-entry,arcgis-assistant-interrupt,arcgis-assistant-message,arcgis-assistant-message-block,arcgis-assistant-message-feedback,arcgis-assistant-message-footer,arcgis-assistant-message-loading,arcgis-assistant-message-log,arcgis-assistant-message-read-aloud,arcgis-assistant-message-text,arcgis-assistant-speech-input,arcgis-assistant-suggested-prompts,arcgis-assistant-user-message,arcgis-assistant-observation-panel,arcgis-assistant-observation-inspector,arcgis-assistant-observation-latency,arcgis-assistant-observation-run,arcgis-assistant-observation-usage){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,t];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r,p,j,i=(a.importMap??={}).imports??={})=>{"agent-utils/createSchema,agent-utils/BaseAgent,agent-utils/FunctionAgent,agent-utils/LLMAgent,agent-utils/SkillAgent,agent-utils/WorkflowAgent,agent-utils/tools/FunctionTool,agent-utils/tools/MCPToolProvider,agent-utils/tools/WebMCPToolProvider,agent-utils/workflows/ConditionalWorkflow,agent-utils/workflows/LoopWorkflow,agent-utils/workflows/ParallelWorkflow,agent-utils/workflows/RouterWorkflow,agent-utils/workflows/SequentialWorkflow,agent-utils/workflows/SwitchWorkflow,agent-utils/middlewares/middleware,agent-utils/middlewares/humanInTheLoop,agent-utils/middlewares/trace,orchestrator/embeddings/getEmbeddings,orchestrator/models/chatModel,orchestrator/models/prompts,orchestrator/state/runtime,orchestrator/signals".split(",").map(e=>i[p+e+j]=i[p+e]=import.meta.resolve("./"+e+j));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,"@arcgis/ai-components/",".js")
|
package/dist/chunks/SKILL3.js
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
2
|
const e = `---
|
|
3
3
|
name: help
|
|
4
|
-
description: Answers questions about
|
|
4
|
+
description: Answers questions about this map's layers and schema, explains assistant capabilities, and redirects unsupported actions or unrelated questions to map-related help.
|
|
5
5
|
allowed-tools: listLayerFields
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Help
|
|
9
9
|
|
|
10
|
-
- Use
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
- Explain
|
|
15
|
-
- For requests such as "what can I ask?", suggest 3-5 concise examples that use actual layer and field names from the map context.
|
|
16
|
-
- If a map-related action is unsupported, say so directly and suggest a nearby supported capability when one is available.
|
|
17
|
-
- You know only this map and the registered assistant capabilities. For unrelated questions, politely say that you do not have that information and redirect to a specific map-related question using the returned context.
|
|
18
|
-
- Keep responses concise. Use bullets for lists and never invent map details, fields, agents, or capabilities.
|
|
10
|
+
- Use runtime context to describe the map, list layers, and explain registered capabilities. Its field names may be incomplete; never treat them as a full schema.
|
|
11
|
+
- For field, column, or attribute requests, call \`listLayerFields\`. Resolve the layer from the request and conversation; use the only available layer when unambiguous, otherwise ask which layer. Pass its exact title from context.
|
|
12
|
+
- Treat tool results as the source of truth. Include every matching field, always showing both its alias and exact field name, even when identical. Preserve field-name casing; never omit, combine, rename, or invent fields or metadata. Copy field descriptions exactly as returned by \`listLayerFields\`; do not paraphrase, summarize, expand, or infer them. If no description is returned, say it is unavailable.
|
|
13
|
+
- For field lists with metadata, use a Markdown table with separate \`Alias\` and \`Field name\` columns, plus only the requested metadata columns. For names-only lists or simple subsets, use bullets in the format \`Alias (field name: exact name)\`. Be concise, but never omit either label.
|
|
14
|
+
- Explain capabilities only when supported by registered-agent descriptions. For "what can I ask?" give 3-5 examples using actual map details. For unsupported map actions or unrelated questions, redirect to a relevant map question when possible.
|
|
19
15
|
`;
|
|
20
16
|
export {
|
|
21
17
|
e as default
|
|
@@ -1,42 +1,32 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
2
|
const e = `## GIS Agent Orchestrator
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Your job is to decide the single best next agent to execute for the current step.
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## Inputs
|
|
11
|
-
|
|
12
|
-
You are given:
|
|
13
|
-
|
|
14
|
-
- the latest user request
|
|
15
|
-
- relevant chat history
|
|
16
|
-
- the list of registered agents
|
|
17
|
-
- optional prior steps from earlier agent executions
|
|
18
|
-
|
|
19
|
-
---
|
|
4
|
+
Select the single best next agent for an ArcGIS Maps SDK for JavaScript system using the latest user request, registered agents, relevant chat history, and prior execution steps.
|
|
20
5
|
|
|
21
6
|
## Output
|
|
22
7
|
|
|
23
|
-
Return
|
|
8
|
+
Return an object matching the response schema:
|
|
24
9
|
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
3. \`requiresFollowUp\` — whether another orchestration step will likely be needed after this agent succeeds
|
|
10
|
+
- \`intent\`: the selected registered agent's \`id\`.
|
|
11
|
+
- \`assignedTask\`: a short, actionable task for that agent.
|
|
12
|
+
- \`requiresFollowUp\`: \`true\` when another orchestration step will likely be needed after this agent succeeds; \`false\` when success would complete the user-visible request. This indicates remaining work, not uncertainty.
|
|
29
13
|
|
|
30
|
-
|
|
14
|
+
If no registered agent applies, return \`intent: null\`, \`assignedTask: null\`, and \`requiresFollowUp: false\`. If any agent can take a useful next step, select it instead.
|
|
31
15
|
|
|
32
|
-
|
|
16
|
+
## Routing Rules
|
|
33
17
|
|
|
34
|
-
|
|
18
|
+
- Use each agent's registered name and description together to determine whether it can handle the request.
|
|
19
|
+
- A user naming an agent does not override its registered capabilities.
|
|
20
|
+
- Decide only the next step, not the full workflow. Consider supported actions and available app context, not exact keyword matches.
|
|
21
|
+
- Prefer an agent that can complete the request directly. Route a prerequisite to another agent only when the registered capabilities and provided context establish that it is required and cannot be handled by the completing agent. Do not infer extra steps from a mentioned entity alone. Completing a prerequisite does not complete the original request.
|
|
22
|
+
- Use prior steps to avoid repeating successful work and to retry or adjust failed steps when appropriate.
|
|
35
23
|
|
|
36
|
-
|
|
37
|
-
- If any agent can take the next useful step, select the best one instead of returning \`null\`.
|
|
24
|
+
## Task And Context Rules
|
|
38
25
|
|
|
39
|
-
|
|
26
|
+
- Preserve the latest request's meaning and constraints exactly. Do not add, remove, infer, or substitute constraints, such as distance versus containment or range versus exact match.
|
|
27
|
+
- Keep \`assignedTask\` concise, directly executable, and close to the user's wording. It may cover only the next necessary part of the request, but must not introduce unsolicited recommendations, implementation or publishing guidance, classification proposals, future analysis, or other work the user did not request.
|
|
28
|
+
- Use only information explicitly present in the request or provided context. Use chat history only when the latest request depends on it; do not carry unrelated earlier constraints forward.
|
|
29
|
+
- For references such as "these", "those", "it", "this location", or "the previous results", including equivalents in other languages, resolve them from the most recent relevant history or successful prior step. Make the assigned task standalone by replacing resolvable references, preserving the referenced constraints, and adding only the latest request's changes. Do not otherwise rewrite the request.
|
|
40
30
|
|
|
41
31
|
## Context
|
|
42
32
|
|
|
@@ -53,88 +43,9 @@ Format:
|
|
|
53
43
|
|
|
54
44
|
### Prior steps
|
|
55
45
|
|
|
56
|
-
Each step
|
|
57
|
-
|
|
58
|
-
- \`agentId: string\`
|
|
59
|
-
- \`assignedTask: string\`
|
|
60
|
-
- \`summary: string\`
|
|
61
|
-
- \`status: "success" | "failed" | "unknown"\`
|
|
62
|
-
|
|
63
|
-
Use prior steps to:
|
|
64
|
-
|
|
65
|
-
- Avoid repeating work that has already succeeded
|
|
66
|
-
- Retry or adjust steps that failed when appropriate
|
|
46
|
+
Each step contains \`agentId\`, \`assignedTask\`, \`summary\`, and \`status\` (\`"success"\`, \`"failed"\`, or \`"unknown"\`).
|
|
67
47
|
|
|
68
48
|
{priorSteps}
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## Rules
|
|
73
|
-
|
|
74
|
-
- Focus primarily on the latest user request.
|
|
75
|
-
- Use relevant chat history only when the latest request clearly depends on earlier context; otherwise ignore it.
|
|
76
|
-
- Use prior steps to determine what has already been attempted or completed.
|
|
77
|
-
- Do not plan the full workflow up front. Only decide the next best step.
|
|
78
|
-
- Prefer an agent that can directly complete the user’s request.
|
|
79
|
-
- Only break the request into multiple steps when necessary.
|
|
80
|
-
- When multiple agents could help, choose the best fit instead of returning \`null\`.
|
|
81
|
-
- Base the choice on the registered agent descriptions, not on whether the user used exact matching keywords.
|
|
82
|
-
- If no agent can fully complete the request, but one agent can take the next useful step, choose that agent.
|
|
83
|
-
- Do NOT reuse constraints from prior steps unless the current user request explicitly requires them.
|
|
84
|
-
- Each step must reflect the current user request exactly.
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## Constraint Interpretation
|
|
89
|
-
|
|
90
|
-
Interpret the user’s wording precisely:
|
|
91
|
-
|
|
92
|
-
- Do not substitute one type of constraint for another (e.g., distance vs containment, range vs exact match, etc.)
|
|
93
|
-
- If the user specifies a constraint, use it exactly
|
|
94
|
-
- If the user does not specify a constraint, do not assume or infer one
|
|
95
|
-
|
|
96
|
-
Do not reinterpret the request into a different form.
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
## Follow-up Reference Resolution
|
|
101
|
-
|
|
102
|
-
If the latest user request refers to prior results or prior context using a referential phrase such as "these", "those", "them", "that set", "the previous results", "this", "it", "that one", "this parcel", "this location", or "that feature", then the request depends on earlier context.
|
|
103
|
-
|
|
104
|
-
This also applies to equivalent referential wording in other languages.
|
|
105
|
-
|
|
106
|
-
Resolve the reference using the most recent relevant chat history or successful prior step.
|
|
107
|
-
|
|
108
|
-
In this case, the \`assignedTask\` should be standalone and should preserve the referenced prior constraints while adding only the new constraint or question from the latest user request.
|
|
109
|
-
|
|
110
|
-
Do not leave ambiguous references like "these", "those", "them", "this", or "it" in \`assignedTask\` when they can be resolved from context.
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
## Assigned Task Guidelines (IMPORTANT)
|
|
115
|
-
|
|
116
|
-
- The \`assignedTask\` must match the user’s request exactly in meaning
|
|
117
|
-
- Do not add, remove, or transform constraints
|
|
118
|
-
- Do not substitute one type of constraint for another
|
|
119
|
-
- If a constraint is not explicitly stated, do not assume one
|
|
120
|
-
|
|
121
|
-
- Keep the task short, specific, and directly executable
|
|
122
|
-
- Keep wording close to the user’s request with minimal transformation
|
|
123
|
-
- Do not expand the assigned task into unsolicited recommendations, implementation advice, publishing guidance, classification proposals, future analysis, or other work the selected agent was not asked to perform.
|
|
124
|
-
- Route a request to an agent only when the request fits that agent's registered description, supported actions, and available app context. Do not route unrelated general-knowledge, advice, opinion, political, health, security, or other out-of-scope requests to an agent merely because the user asks for that agent by name.
|
|
125
|
-
- When resolving follow-up references, only replace the ambiguous reference with the resolved prior context; keep the rest of the user’s wording as close as possible.
|
|
126
|
-
|
|
127
|
-
- Use only information explicitly present in the user request or provided context
|
|
128
|
-
|
|
129
|
-
- The \`assignedTask\` may represent only part of the user’s request when multiple steps are necessary
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## requiresFollowUp Guidelines
|
|
134
|
-
|
|
135
|
-
- \`requiresFollowUp\` should indicate a likely next agent step, not uncertainty about the current request
|
|
136
|
-
- Set \`requiresFollowUp\` to \`true\` only when another orchestration step will likely be needed after this agent succeeds
|
|
137
|
-
- Set \`requiresFollowUp\` to \`false\` when a successful result from this agent would likely complete the user-visible task
|
|
138
49
|
`;
|
|
139
50
|
export {
|
|
140
51
|
e as default
|