@esri/solutions-components 5.1.0-next.143 → 5.1.0-next.144
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/{E5E6J57F.js → 5YXQ4UXZ.js} +26 -26
- package/dist/cdn/{P67K4TAX.js → 65L2LQGD.js} +1 -1
- package/dist/cdn/{ILLTWR2W.js → CGCNGFBL.js} +1 -1
- package/dist/cdn/{FYT4Q5GJ.js → FE2GEHNL.js} +1 -1
- package/dist/cdn/LYK2CASU.js +2 -0
- package/dist/cdn/{U3CNAJQZ.js → YLC2EM5A.js} +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/solution-builder-assistant.js +9 -10
- package/dist/components/arcgis-solutions-assistant/customElement.js +197 -205
- package/dist/components/arcgis-solutions-assistant/index.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/solutions-components_commit.txt +6 -6
- package/package.json +1 -1
- package/dist/cdn/RUF6QBY7.js +0 -2
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import { c as Ce } from "../../chunks/runtime.js";
|
|
3
3
|
import { u as _e } from "../../chunks/useT9n.js";
|
|
4
|
-
import { LitElement as ke, createEvent as
|
|
5
|
-
import { css as
|
|
6
|
-
import { unsafeHTML as
|
|
7
|
-
import { useContextConsumer as
|
|
4
|
+
import { LitElement as ke, createEvent as Z, nothing as X } from "@arcgis/lumina";
|
|
5
|
+
import { css as Ee, html as k } from "lit";
|
|
6
|
+
import { unsafeHTML as Te } from "lit/directives/unsafe-html.js";
|
|
7
|
+
import { useContextConsumer as ee } from "@arcgis/lumina/context";
|
|
8
8
|
import { c as Ae, b as De } from "../../chunks/deployAppContexts.js";
|
|
9
9
|
import { T as Le } from "../../chunks/interfaces.js";
|
|
10
10
|
import { l as Re } from "../../chunks/helpers.js";
|
|
11
|
-
import
|
|
11
|
+
import te from "@arcgis/core/config.js";
|
|
12
12
|
import { createRef as $e, ref as Me } from "lit-html/directives/ref.js";
|
|
13
|
-
import { Annotation as b, StateGraph as
|
|
14
|
-
import { createAgentRuntimeState as
|
|
15
|
-
import r, { z as
|
|
16
|
-
import * as
|
|
13
|
+
import { Annotation as b, StateGraph as O, START as z, END as x, NodeInterrupt as ne } from "@langchain/langgraph/web";
|
|
14
|
+
import { createAgentRuntimeState as j, sendTraceMessage as v, invokeStructuredPrompt as D, getEmbeddings as Be, cosineSimilarity as Fe, invokeTextPrompt as Pe } from "@arcgis/ai-orchestrator";
|
|
15
|
+
import r, { z as T } from "zod";
|
|
16
|
+
import * as J from "@esri/arcgis-rest-portal";
|
|
17
17
|
import { applyPatch as Ne } from "fast-json-patch";
|
|
18
18
|
import "@langchain/core/messages";
|
|
19
|
-
import { C as
|
|
20
|
-
import { g as F, t as
|
|
19
|
+
import { C as ie } from "../../chunks/converter.js";
|
|
20
|
+
import { g as F, t as oe, r as ae, c as qe, d as A } from "../../chunks/templates.js";
|
|
21
21
|
import Ue from "@arcgis/core/portal/Portal.js";
|
|
22
22
|
import Oe from "@arcgis/core/portal/PortalItem.js";
|
|
23
|
-
const ze =
|
|
23
|
+
const ze = Ee`:host{display:block;height:100%}.margin-lg{margin:var(--calcite-spacing-lg)}.display-flex-row{display:flex;flex-direction:row}.assistant-split-container{display:flex;width:100%;height:calc(100vh - 78px);overflow:hidden;border-radius:10px}.assistant-panel{display:flex;flex-direction:column;height:100%;border:1px solid var(--calcite-color-surface-3);background-color:var(--calcite-color-surface-2);overflow:hidden}.chat-panel{min-width:320px}.builder-panel{min-width:320px;max-width:100%;border-left:1px solid var(--calcite-color-surface-3)}.panel-actions{display:flex;gap:8px;padding:6px;align-items:center}.builder-header,.builder-footer{padding:10px;background:var(--calcite-color-surface-1);border-bottom:1px solid var(--calcite-color-surface-3)}.builder-content{flex:1;overflow:auto;padding:12px}.builder-content pre{white-space:pre-wrap;word-wrap:break-word;max-height:100%;overflow:auto}.builder-actions{display:flex;gap:6px;align-items:center}.padding-left-10{padding-left:10px}.chat-container{display:flex;flex-direction:column;gap:0px;max-width:600px;height:75%;background-color:var(--calcite-color-surface-4);padding:1px}.chat-container_expanded{display:flex;flex-direction:column;gap:0px;max-width:100%;height:95%;background-color:var(--calcite-color-surface-1);border-radius:10px;padding:10px}.chat-panel{--calcite-color-focus: var(--calcite-color-brand);--calcite-panel-border-color: var(--calcite-color-border-2);--calcite-internal-panel-header-vertical-padding: 0px;--calcite-panel-header-content-space: 0px;border:var(--calcite-border-width-sm) solid var(--calcite-color-border-2);height:100%}.header-content{display:flex;align-items:center;gap:var(--calcite-spacing-sm);height:65px;box-sizing:border-box;padding-inline-start:var(--calcite-space-2xl)}.header-title{font-size:var(--calcite-font-size-md);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.beta-chip{--calcite-chip-corner-radius: var(--calcite-corner-radius-half)}.chat-panel calcite-card,.chat-panel calcite-text-area,.chat-panel calcite-button,.chat-panel .chat-messages,.chat-panel .chat-input{--calcite-color-focus: var(--calcite-color-brand)}.assistant-followup-chip:focus{outline:2px solid var(--calcite-color-brand)}.chat-panel-heading{font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-surface-1, var(--calcite-color-text-1))}.chat-messages{display:flex;flex-direction:column;gap:20px;padding:4px;height:100%;overflow-y:auto}.user-message{align-self:flex-end;background:var(--calcite-color-brand);border-radius:8px;max-width:90%;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-brand);--calcite-card-border-color: var(--calcite-color-brand);color:var(--calcite-color-text-inverse);text-align:left}.system-message{align-self:flex-start;background:var(--calcite-color-surface-3);border-radius:8px;max-width:90%;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-surface-4);--calcite-card-border-color: var(--calcite-color-surface-4);color:var(--calcite-color-inverse);text-align:left}.loader-message{align-self:flex-start;background:var(--calcite-color-surface-4);border-radius:8px;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-surface-4);--calcite-card-border-color: var(--calcite-color-surface-4)}.message-content{padding:0;font-size:14px}.response-message.message-content>p:first-of-type{margin-top:0}.message-content img{max-width:100%;height:auto;display:block;object-fit:contain}.message-content-pad{padding-bottom:10px;font-size:14px}.message-content-summary{padding-bottom:14px}.message-content-alignment{display:flex;align-items:center;gap:var(--calcite-spacing-md);font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-1)}.padding-top-10{padding-top:10px}.padding-right-8{padding-right:8px}.padding-left-right-5{padding-right:5px;padding-left:5px}.chip-content{padding:5px 5px 5px 0}.chat-input{display:flex;flex-direction:row;flex-grow:1}.table-cell{--calcite-table-cell-background: var(--calcite-color-surface-4)}.cursor-pointer{cursor:pointer}.notice-border-color{--temp-initial-brand: var(--calcite-color-brand)}.notice-border-color calcite-notice{--calcite-color-brand: #ddd;--calcite-icon-color: var(--temp-initial-brand)}.notice-border-color calcite-notice *{--calcite-color-brand: var(--temp-initial-brand)}.solution-card{padding:5px 0;text-decoration:none;display:block;width:100%;cursor:pointer}.solution-card calcite-card{display:flex;flex-direction:column;max-width:520px;overflow:hidden;--calcite-card-corner-radius: var(--calcite-corner-radius-round) !important;--calcite-card-shadow: var(--calcite-shadow-sm);--calcite-card-background-color: var(--calcite-card-background-color) }.solution-card div[slot=thumbnail]{max-height:100%;width:100%;position:relative;&:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;transition:all .15s ease-in-out}}.solution-card div[slot=thumbnail] img{max-height:100%;width:100%;object-fit:cover}.solution-card span[slot=description]{padding-top:10px}.solution-card calcite-chip{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);visibility:hidden;pointer-events:none;opacity:0;transition:all .15s ease-in-out;z-index:9999}.solution-card:hover calcite-chip{visibility:visible;opacity:1}.solution-card:hover div[slot=thumbnail]:after{background-color:#00000080}.solution-card:hover h3{text-decoration:underline}.solution-card:focus{outline:2px solid var(--calcite-color-brand)}.references-container{padding-top:10px;display:block}.references-container.collapsed{display:none}.width-100{width:100%}.disclaimer-div{display:flex;align-items:center;gap:var(--calcite-spacing-sm);font-size:var(--calcite-font-size--0);color:var(--calcite-color-text-1)}.display-none{display:none}.chat-messages calcite-fab{position:absolute;bottom:16px;left:50%;transform:translate(-50%);z-index:999}.icon-color-background{--calcite-button-icon-color: var(--calcite-color-surface-1)}#closeAssistantButton{--calcite-action-text-color: var(--calcite-color-text-1)}.icon-color-background:focus{--calcite-color-focus: var(--calcite-color-surface-1)}@media(max-width:430px){.solution-card .solution-snippet{display:none}}.height-32-flex-auto{height:32px;flex:0 0 auto}.margin-top-0.message-content>p:first-of-type{margin-top:0}a:not(.solution-card){color:var(--calcite-link-text-color, var(--calcite-color-text-link));cursor:pointer;text-decoration:none;line-height:inherit;background-image:linear-gradient(currentColor,currentColor),linear-gradient(var(--calcite-color-brand-underline),var(--calcite-color-brand-underline));background-position-x:0%,100%;background-position-y:min(1.5em,100%);background-repeat:no-repeat,no-repeat;background-size:0% 1px,100% 1px;transition-property:background-size,color;transition-duration:var(--calcite-animation-timing, .15s);transition-timing-function:ease-in-out;outline-color:transparent;position:relative}a:not(.solution-card):hover{background-size:100% 1px,100% 1px}a:not(.solution-card):focus{outline:2px solid var(--calcite-color-brand);outline-offset:2px;outline-color:var(--calcite-color-brand)}a:not(.solution-card):active{color:var(--calcite-color-brand-press)}`;
|
|
24
24
|
async function y(t, e) {
|
|
25
25
|
const s = Object.entries(t).find(
|
|
26
26
|
([n]) => n.endsWith(`/${e}.md`)
|
|
@@ -37,7 +37,7 @@ ${Object.keys(t).join(`
|
|
|
37
37
|
function N(t) {
|
|
38
38
|
return t?.configurable?.context?.translations;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function re(t) {
|
|
41
41
|
if (typeof window > "u" || t.length <= 1)
|
|
42
42
|
return;
|
|
43
43
|
const e = t.map((n) => n.solution.id), s = t.map((n) => n.solution.title);
|
|
@@ -59,7 +59,7 @@ function le(t) {
|
|
|
59
59
|
}
|
|
60
60
|
}));
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function le(t) {
|
|
63
63
|
if (typeof window > "u" || !t)
|
|
64
64
|
return;
|
|
65
65
|
const e = new CustomEvent("solutionIDFromAssistant", {
|
|
@@ -96,10 +96,10 @@ function Ge(t, e) {
|
|
|
96
96
|
function He(t) {
|
|
97
97
|
return t && t.helperServices.aiAssistantServices ? `${t.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/chat` : null;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function ce(t) {
|
|
100
100
|
return t && t.helperServices.aiAssistantServices ? `${t.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/api/pre-chat` : null;
|
|
101
101
|
}
|
|
102
|
-
async function
|
|
102
|
+
async function U(t, e, s) {
|
|
103
103
|
const n = await fetch(e, {
|
|
104
104
|
method: "POST",
|
|
105
105
|
headers: {
|
|
@@ -112,12 +112,12 @@ async function O(t, e, s) {
|
|
|
112
112
|
throw new Error(`HTTP ${n.status} calling ${e}`);
|
|
113
113
|
return n.json();
|
|
114
114
|
}
|
|
115
|
-
const Ve = (t) => new Promise((e) => setTimeout(e, t)),
|
|
115
|
+
const Ve = (t) => new Promise((e) => setTimeout(e, t)), We = b.Root({
|
|
116
116
|
// Provides agentExecutionContext, outputMessage, summary, and status
|
|
117
117
|
// channels with the orchestrator's standard reducers/defaults so the
|
|
118
118
|
// sub-agent reports back through the same shape the orchestrator
|
|
119
119
|
// persists into priorSteps.
|
|
120
|
-
...
|
|
120
|
+
...j(),
|
|
121
121
|
solutionResponse: b({
|
|
122
122
|
reducer: (t, e) => e ?? null,
|
|
123
123
|
default: () => null
|
|
@@ -133,9 +133,9 @@ const Ve = (t) => new Promise((e) => setTimeout(e, t)), Qe = b.Root({
|
|
|
133
133
|
reducer: (t, e) => e ?? t,
|
|
134
134
|
default: () => null
|
|
135
135
|
})
|
|
136
|
-
}),
|
|
136
|
+
}), Ke = () => new O(We).addNode("initializeAgent", Ye).addNode("askSolutionsQuestions", Qe).addEdge(z, "initializeAgent").addEdge("initializeAgent", "askSolutionsQuestions").addEdge("askSolutionsQuestions", x), de = async (t, e, s, n) => {
|
|
137
137
|
if (!t) return;
|
|
138
|
-
const i =
|
|
138
|
+
const i = ce(t);
|
|
139
139
|
if (!i) return;
|
|
140
140
|
const a = { context: {
|
|
141
141
|
kind: "DocAIAssistantRequest",
|
|
@@ -147,15 +147,15 @@ const Ve = (t) => new Promise((e) => setTimeout(e, t)), Qe = b.Root({
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
} };
|
|
150
|
-
n && (a.conversationId = n),
|
|
151
|
-
},
|
|
150
|
+
n && (a.conversationId = n), U(a, i, e ?? "");
|
|
151
|
+
}, Qe = async (t, e) => {
|
|
152
152
|
const s = N(e), n = t.documentSkillUrl;
|
|
153
153
|
let i = [];
|
|
154
|
-
await
|
|
154
|
+
await v(
|
|
155
155
|
{ text: s.agentProgress.explorerAgentSearching },
|
|
156
156
|
e
|
|
157
157
|
);
|
|
158
|
-
let o = await
|
|
158
|
+
let o = await U(
|
|
159
159
|
{
|
|
160
160
|
message: t.agentExecutionContext.userRequest,
|
|
161
161
|
conversationId: e?.configurable?.context?.convoId ?? void 0,
|
|
@@ -180,27 +180,26 @@ const Ve = (t) => new Promise((e) => setTimeout(e, t)), Qe = b.Root({
|
|
|
180
180
|
hasMore: o.hasMore,
|
|
181
181
|
ackSequenceNumber: o.sequenceNumber,
|
|
182
182
|
inquiryId: o.inquiryId
|
|
183
|
-
}, l = ""
|
|
184
|
-
const
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
187
|
-
const
|
|
188
|
-
l =
|
|
183
|
+
}, l = "";
|
|
184
|
+
const d = async (g) => {
|
|
185
|
+
const h = g.context?.results?.[0]?.reply ?? "";
|
|
186
|
+
if (h !== "") {
|
|
187
|
+
const m = Je(h), E = Ge(m, e);
|
|
188
|
+
l = E.source, i = [
|
|
189
189
|
...i,
|
|
190
|
-
...
|
|
191
|
-
(
|
|
190
|
+
...E.allMatches.filter(
|
|
191
|
+
(C) => !i.some((_) => _.solution.id === C.solution.id)
|
|
192
192
|
)
|
|
193
193
|
];
|
|
194
194
|
}
|
|
195
|
-
c
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
g === 1 ? x = s.agentProgress.explorerAgentReading : g === 2 ? x = s.agentProgress.explorerAgentReviewing : g === 3 && (x = s.agentProgress.explorerAgentPreparing), await w({ text: x }, e);
|
|
195
|
+
const c = g.context?.results?.[0]?.status?.currentStatusStep;
|
|
196
|
+
if (c) {
|
|
197
|
+
let m = "";
|
|
198
|
+
c === 1 ? m = s.agentProgress.explorerAgentReading : c === 2 ? m = s.agentProgress.explorerAgentReviewing : c === 3 && (m = s.agentProgress.explorerAgentPreparing), await v({ text: m }, e);
|
|
200
199
|
}
|
|
201
200
|
};
|
|
202
|
-
for (await
|
|
203
|
-
await Ve(500), o = await
|
|
201
|
+
for (await d(o); a.hasMore; )
|
|
202
|
+
await Ve(500), o = await U(
|
|
204
203
|
{
|
|
205
204
|
conversationId: a.conversationId,
|
|
206
205
|
ackSequenceNumber: a.ackSequenceNumber,
|
|
@@ -214,17 +213,13 @@ const Ve = (t) => new Promise((e) => setTimeout(e, t)), Qe = b.Root({
|
|
|
214
213
|
hasMore: o.hasMore,
|
|
215
214
|
ackSequenceNumber: o.sequenceNumber,
|
|
216
215
|
inquiryId: o.inquiryId
|
|
217
|
-
}, await
|
|
218
|
-
|
|
219
|
-
const m = e.configurable.context.updateSuggestedPrompts, c = d;
|
|
220
|
-
setTimeout(() => m(c), 0);
|
|
221
|
-
}
|
|
222
|
-
return de(e?.configurable?.context.portal) && ue(
|
|
216
|
+
}, await d(o);
|
|
217
|
+
return ce(e?.configurable?.context.portal) && de(
|
|
223
218
|
e?.configurable?.context.portal,
|
|
224
219
|
e?.configurable?.context.token ?? "",
|
|
225
220
|
e?.configurable?.context.configContext.locale ?? "en",
|
|
226
221
|
a.conversationId
|
|
227
|
-
), i.length && (i.length === 1 ?
|
|
222
|
+
), i.length && (i.length === 1 ? le(i[0].solution.id) : re(i)), {
|
|
228
223
|
outputMessage: l,
|
|
229
224
|
summary: l,
|
|
230
225
|
status: "success",
|
|
@@ -238,7 +233,7 @@ const Ve = (t) => new Promise((e) => setTimeout(e, t)), Qe = b.Root({
|
|
|
238
233
|
};
|
|
239
234
|
};
|
|
240
235
|
await y(je, "solutions_explorer_description");
|
|
241
|
-
const
|
|
236
|
+
const ue = (t) => {
|
|
242
237
|
if (t && Array.isArray(t.id) && t.id.length > 0)
|
|
243
238
|
return t.id[t.id.length - 1].replace("Message", "").toLowerCase();
|
|
244
239
|
if (t && typeof t._getType == "function")
|
|
@@ -249,7 +244,7 @@ const pe = (t) => {
|
|
|
249
244
|
}
|
|
250
245
|
return "human";
|
|
251
246
|
}, Ze = (t) => {
|
|
252
|
-
const e =
|
|
247
|
+
const e = ue(t);
|
|
253
248
|
if (t && t.kwargs)
|
|
254
249
|
return {
|
|
255
250
|
role: e,
|
|
@@ -264,7 +259,7 @@ const pe = (t) => {
|
|
|
264
259
|
return t.id && (s.id = t.id), t.name && (s.name = t.name), t.additional_kwargs && (s.additional_kwargs = t.additional_kwargs), t.response_metadata && (s.response_metadata = t.response_metadata), s;
|
|
265
260
|
}
|
|
266
261
|
return { role: "human", content: String(t) };
|
|
267
|
-
}, Xe = (t) =>
|
|
262
|
+
}, Xe = (t) => ue(t) === "human", et = (t, e = 3) => t.filter((s) => Xe(s)).slice(-e).map(Ze), tt = (t, e = " ") => et(t).map((i) => i.content).join(e).trim(), st = { understandingRequest: "Understanding your request...", selectTemplatePrompt: "This use case could be supported in a few different ways. Choose the option that best matches what you want to accomplish.", searchingExistingSolutions: "Searching for existing solutions...", existingSolutionMatch: "I found one or more existing solutions that match your use case. These are ready-to-use solutions that may already meet your needs and can be deployed now. Do you want to continue building your own solution?", continueBuildingYes: "Yes, I want to build a new solution", continueBuildingNo: "No, I’ll review existing solutions", continueBuildingDeclined: "Sounds good. We can focus on existing solutions. Let me know if I can help answer any questions or provide more details.", creatingDesign: "Generating solution design...", updatingDesign: "Updating solution design...", applyChangeFailed: "I wasn't able to apply that change. The design was not modified. Please try rephrasing your request.", createDesignFailed: "I wasn't able to create a solution design from that request. Please try rephrasing and try again.", discardMessage: "Are you sure you want to discard your solution?", discardForNewSolution: "I can help you build a new solution, but I will need to discard your current solution design. Do you want to continue?" }, nt = {
|
|
268
263
|
builderMessages: st
|
|
269
264
|
}, it = /* @__PURE__ */ new Set([
|
|
270
265
|
"add",
|
|
@@ -329,7 +324,7 @@ const pe = (t) => {
|
|
|
329
324
|
"view",
|
|
330
325
|
"where"
|
|
331
326
|
]);
|
|
332
|
-
class
|
|
327
|
+
class pe {
|
|
333
328
|
constructor(e, s, n = !0) {
|
|
334
329
|
this.isValid = !0, this.issues = [], this.response = e, this.template = s, this.newDesign = n, this.validate();
|
|
335
330
|
}
|
|
@@ -444,7 +439,7 @@ const ot = r.object({
|
|
|
444
439
|
"Notebook",
|
|
445
440
|
"QuickCapture Project"
|
|
446
441
|
]).describe("ArcGIS item type.")
|
|
447
|
-
}),
|
|
442
|
+
}), se = r.object({
|
|
448
443
|
name: r.string().describe("Field name."),
|
|
449
444
|
type: r.enum(["string", "integer", "double", "date", "oid", "guid", "globalid"]).describe("Field data type."),
|
|
450
445
|
alias: r.string().describe("Field alias for display."),
|
|
@@ -459,13 +454,13 @@ const ot = r.object({
|
|
|
459
454
|
typeMutable: r.boolean().describe("Indicates whether the layer type can be changed."),
|
|
460
455
|
name: r.string().describe("Layer/table name."),
|
|
461
456
|
description: r.string().describe("Layer/table description."),
|
|
462
|
-
customFields: r.array(
|
|
463
|
-
requiredFields: r.array(
|
|
457
|
+
customFields: r.array(se).describe("User/business fields specific to the solution."),
|
|
458
|
+
requiredFields: r.array(se).describe("Fields required for solution functionality (e.g., relationship keys).")
|
|
464
459
|
}), lt = r.object({
|
|
465
460
|
itemId: r.string().describe("ArcGIS item id for the feature layer."),
|
|
466
461
|
addLayers: r.boolean().describe("Indicates whether new layers can be added during solution design."),
|
|
467
462
|
layers: r.array(rt)
|
|
468
|
-
}),
|
|
463
|
+
}), G = r.object({
|
|
469
464
|
response: r.string().describe("Conversational response to the user's query."),
|
|
470
465
|
solution: r.object({
|
|
471
466
|
itemId: r.string().nullable().describe("ArcGIS item id of the source Solution template used for deployment. Preserve the existing value exactly when known; otherwise use null."),
|
|
@@ -494,22 +489,22 @@ const ot = r.object({
|
|
|
494
489
|
assistantResponse: r.string().describe("Natural-language response for the user."),
|
|
495
490
|
isValidUseCase: r.boolean().describe("True only when the request is concrete, appropriate, and has at least one matching template."),
|
|
496
491
|
matchedTemplates: r.array(pt).describe("Ordered list of matching templates, best match first. Empty when no valid match exists.")
|
|
497
|
-
}),
|
|
498
|
-
let $ = null,
|
|
492
|
+
}), H = (t) => t in A, gt = 5, ht = 0.8, ft = 0.15, bt = "Web Mapping Application", yt = "Embeddings";
|
|
493
|
+
let $ = null, q = null, M = null, B = null;
|
|
499
494
|
const xt = "Build", L = /* @__PURE__ */ Object.assign({
|
|
500
495
|
"./prompts/description.md": () => import("../../chunks/description2.js").then((t) => t.default),
|
|
501
496
|
"./prompts/designSolution.md": () => import("../../chunks/designSolution.js").then((t) => t.default),
|
|
502
497
|
"./prompts/findExistingSolution.md": () => import("../../chunks/findExistingSolution.js").then((t) => t.default),
|
|
503
498
|
"./prompts/initialAssessment.md": () => import("../../chunks/initialAssessment.js").then((t) => t.default),
|
|
504
499
|
"./prompts/updateDesign.md": () => import("../../chunks/updateDesign.js").then((t) => t.default)
|
|
505
|
-
}), vt = nt.builderMessages, f = (t, e, s) => N(e)?.builderMessages?.[t] ?? vt[t],
|
|
500
|
+
}), vt = nt.builderMessages, f = (t, e, s) => N(e)?.builderMessages?.[t] ?? vt[t], me = (t) => {
|
|
506
501
|
typeof window < "u" && window.dispatchEvent(new CustomEvent("arcgis-solution-design-update", {
|
|
507
502
|
detail: t
|
|
508
503
|
}));
|
|
509
504
|
}, wt = async (t, e, s) => {
|
|
510
505
|
if (!t) return null;
|
|
511
506
|
const n = `type:"${bt}" AND typekeywords:${yt} AND group:${t}`;
|
|
512
|
-
return (await
|
|
507
|
+
return (await J.searchItems({
|
|
513
508
|
q: n,
|
|
514
509
|
params: e ? { token: e } : void 0,
|
|
515
510
|
portal: s,
|
|
@@ -529,7 +524,7 @@ async function St(t, e, s) {
|
|
|
529
524
|
const It = async (t, e, s) => {
|
|
530
525
|
if (!t) return [];
|
|
531
526
|
const n = `type:Solution AND typekeywords:${xt} AND group:${t}`;
|
|
532
|
-
return (await
|
|
527
|
+
return (await J.searchItems({
|
|
533
528
|
q: n,
|
|
534
529
|
params: e ? { token: e } : void 0,
|
|
535
530
|
portal: s,
|
|
@@ -537,7 +532,7 @@ const It = async (t, e, s) => {
|
|
|
537
532
|
}))?.results ?? [];
|
|
538
533
|
}, Ct = async (t, e, s) => {
|
|
539
534
|
try {
|
|
540
|
-
const n = await
|
|
535
|
+
const n = await J.getItemData(t, {
|
|
541
536
|
params: e ? { token: e } : void 0,
|
|
542
537
|
portal: s
|
|
543
538
|
}), i = n?.buildSolution;
|
|
@@ -547,7 +542,7 @@ const It = async (t, e, s) => {
|
|
|
547
542
|
} catch {
|
|
548
543
|
return null;
|
|
549
544
|
}
|
|
550
|
-
},
|
|
545
|
+
}, I = (t, e = {}) => {
|
|
551
546
|
let s = t;
|
|
552
547
|
return "itemId" in e && (s = {
|
|
553
548
|
...s,
|
|
@@ -565,26 +560,26 @@ const It = async (t, e, s) => {
|
|
|
565
560
|
...s,
|
|
566
561
|
templateId: e.templateId ?? null
|
|
567
562
|
}), s;
|
|
568
|
-
},
|
|
563
|
+
}, ge = (t, e) => {
|
|
569
564
|
if (t == null || e == null)
|
|
570
565
|
return { ok: !1, error: "design or sourceBuildSolution is null/undefined" };
|
|
571
566
|
try {
|
|
572
567
|
const s = structuredClone(e);
|
|
573
|
-
return new
|
|
568
|
+
return new ie({ buildSolution: s }).applyLlmTemplate(t), { ok: !0 };
|
|
574
569
|
} catch (s) {
|
|
575
570
|
return {
|
|
576
571
|
ok: !1,
|
|
577
572
|
error: s instanceof Error ? s.stack ?? s.message : String(s)
|
|
578
573
|
};
|
|
579
574
|
}
|
|
580
|
-
},
|
|
581
|
-
if (
|
|
582
|
-
Object.entries(
|
|
575
|
+
}, V = async (t) => {
|
|
576
|
+
if (q) {
|
|
577
|
+
Object.entries(q).forEach(([a, l]) => {
|
|
583
578
|
A[a] && (A[a].initialTemplate = l);
|
|
584
579
|
});
|
|
585
580
|
return;
|
|
586
581
|
}
|
|
587
|
-
const e = t?.configurable?.context?.token, s =
|
|
582
|
+
const e = t?.configurable?.context?.token, s = fe(t), n = be(t);
|
|
588
583
|
if (!s) {
|
|
589
584
|
console.warn("Solution Builder: missing primarySolutionsGroupId in appConfig; skipping live template hydration.");
|
|
590
585
|
return;
|
|
@@ -597,75 +592,75 @@ const It = async (t, e, s) => {
|
|
|
597
592
|
if (typeof d != "string" || o[d]) return;
|
|
598
593
|
const u = await Ct(a.id, e, n);
|
|
599
594
|
if (!u) return;
|
|
600
|
-
const { buildSolution:
|
|
601
|
-
if (typeof
|
|
602
|
-
const
|
|
603
|
-
|
|
595
|
+
const { buildSolution: g, params: h } = u;
|
|
596
|
+
if (typeof g == "object" && g !== null && "solution" in g) {
|
|
597
|
+
const m = g.solution;
|
|
598
|
+
m.thumbnailUrl = a.thumbnail ? `${n ?? "https://www.arcgis.com/sharing/rest"}/content/items/${a.id}/info/${a.thumbnail}` : void 0, m.item = a;
|
|
604
599
|
}
|
|
605
600
|
const c = {
|
|
606
601
|
...l,
|
|
607
|
-
buildSolution:
|
|
602
|
+
buildSolution: g
|
|
608
603
|
};
|
|
609
|
-
o[d] =
|
|
610
|
-
new
|
|
604
|
+
o[d] = I(
|
|
605
|
+
new ie(c).dumpToLlmTemplate(),
|
|
611
606
|
{
|
|
612
607
|
itemId: a.id,
|
|
613
|
-
sourceBuildSolution: structuredClone(
|
|
614
|
-
params:
|
|
608
|
+
sourceBuildSolution: structuredClone(g),
|
|
609
|
+
params: h ? structuredClone(h) : null
|
|
615
610
|
}
|
|
616
611
|
), A[d] = {
|
|
617
612
|
...l,
|
|
618
613
|
initialTemplate: o[d]
|
|
619
614
|
};
|
|
620
|
-
})),
|
|
621
|
-
},
|
|
615
|
+
})), q = o;
|
|
616
|
+
}, he = (t) => {
|
|
622
617
|
const e = t?.configurable?.context?.token;
|
|
623
618
|
return typeof e != "string" || !e.trim() ? null : e;
|
|
624
|
-
},
|
|
619
|
+
}, fe = (t) => {
|
|
625
620
|
const e = t?.configurable?.context?.configContext?.primarySolutionsGroupId;
|
|
626
621
|
return typeof e != "string" || !e.trim() ? null : e;
|
|
627
|
-
},
|
|
622
|
+
}, be = (t) => {
|
|
628
623
|
const e = t?.configurable?.context?.configContext?.portalURL;
|
|
629
624
|
if (!(typeof e != "string" || !e.trim()))
|
|
630
625
|
return `${e.replace(/\/+$/, "")}/sharing/rest`;
|
|
631
626
|
}, _t = async (t) => {
|
|
632
627
|
await Promise.all([
|
|
633
|
-
|
|
634
|
-
|
|
628
|
+
xe(t),
|
|
629
|
+
V(t)
|
|
635
630
|
]);
|
|
636
|
-
},
|
|
637
|
-
const e =
|
|
638
|
-
(!M || e && e !==
|
|
639
|
-
throw M = null,
|
|
631
|
+
}, ye = async (t) => {
|
|
632
|
+
const e = he(t);
|
|
633
|
+
(!M || e && e !== B) && (B = e ?? B, M = _t(t).catch((n) => {
|
|
634
|
+
throw M = null, B = null, n;
|
|
640
635
|
})), await M;
|
|
641
636
|
};
|
|
642
|
-
async function
|
|
637
|
+
async function xe(t) {
|
|
643
638
|
if ($) return $;
|
|
644
|
-
const e =
|
|
639
|
+
const e = fe(t);
|
|
645
640
|
if (!e)
|
|
646
641
|
return console.warn("Solution Builder: missing primarySolutionsGroupId in appConfig; skipping embeddings load."), null;
|
|
647
|
-
const s =
|
|
642
|
+
const s = be(t), n = t?.configurable?.context?.configContext?.portalURL;
|
|
648
643
|
await new Ue(n ? { url: n } : void 0).load();
|
|
649
|
-
const o =
|
|
644
|
+
const o = he(t) ?? void 0, a = await St(e, o, s);
|
|
650
645
|
return a ? ($ = a.items, $) : null;
|
|
651
646
|
}
|
|
652
647
|
const kt = () => Object.entries(A).map(([t, e]) => `ID: ${t}
|
|
653
648
|
Label: ${e.label}
|
|
654
649
|
Description: ${e.description}`).join(`
|
|
655
650
|
|
|
656
|
-
`),
|
|
651
|
+
`), Et = (t) => {
|
|
657
652
|
const e = t?.configurable?.context?.solutionDesignJson;
|
|
658
653
|
if (typeof e != "string" || !e.trim())
|
|
659
654
|
return null;
|
|
660
655
|
try {
|
|
661
|
-
const s = JSON.parse(e), n =
|
|
656
|
+
const s = JSON.parse(e), n = I(
|
|
662
657
|
{ response: "", ...s },
|
|
663
658
|
{ itemId: s?.solution?.itemId ?? null }
|
|
664
|
-
), i =
|
|
659
|
+
), i = G.safeParse(n);
|
|
665
660
|
if (!i.success)
|
|
666
661
|
return null;
|
|
667
|
-
const { response: o, ...a } = i.data, l = s.templateId, d = typeof l == "string" &&
|
|
668
|
-
return
|
|
662
|
+
const { response: o, ...a } = i.data, l = s.templateId, d = typeof l == "string" && H(l) ? l : null;
|
|
663
|
+
return I(
|
|
669
664
|
a,
|
|
670
665
|
{
|
|
671
666
|
sourceBuildSolution: s.sourceBuildSolution,
|
|
@@ -676,8 +671,8 @@ Description: ${e.description}`).join(`
|
|
|
676
671
|
} catch {
|
|
677
672
|
return null;
|
|
678
673
|
}
|
|
679
|
-
},
|
|
680
|
-
...
|
|
674
|
+
}, Tt = b.Root({
|
|
675
|
+
...j(),
|
|
681
676
|
/** Optional human-readable template description retained for UI use. */
|
|
682
677
|
templateDescription: b({
|
|
683
678
|
reducer: (t, e) => typeof e == "string" || e === null ? e : t ?? null,
|
|
@@ -709,10 +704,10 @@ Description: ${e.description}`).join(`
|
|
|
709
704
|
default: () => null
|
|
710
705
|
})
|
|
711
706
|
}), At = (t, e) => {
|
|
712
|
-
const s =
|
|
707
|
+
const s = Et(e), n = s?.templateId ?? null, i = {};
|
|
713
708
|
return JSON.stringify(t.currentDesign) !== JSON.stringify(s) && (i.currentDesign = s), n && t.selectedTemplate !== n && (i.selectedTemplate = n), i;
|
|
714
709
|
}, Dt = async (t, e) => {
|
|
715
|
-
await
|
|
710
|
+
await v({ text: f("understandingRequest", e) }, e), await ye(e);
|
|
716
711
|
const s = t.agentExecutionContext.userRequest, n = kt(), i = t.agentExecutionContext.messages.slice(-11), o = await D({
|
|
717
712
|
promptText: await y(L, "initialAssessment"),
|
|
718
713
|
modelTier: "advanced",
|
|
@@ -721,14 +716,14 @@ Description: ${e.description}`).join(`
|
|
|
721
716
|
messages: i,
|
|
722
717
|
inputVariables: { query: s, availableTemplates: n }
|
|
723
718
|
}), a = o.matchedTemplates.filter(
|
|
724
|
-
(c) =>
|
|
719
|
+
(c) => H(c.templateId)
|
|
725
720
|
), l = {
|
|
726
721
|
...o,
|
|
727
722
|
matchedTemplates: a
|
|
728
|
-
}, [d, u] = a,
|
|
723
|
+
}, [d, u] = a, h = !!d && d.confidence >= ht && (u === void 0 || d.confidence - u.confidence >= ft) ? d.templateId : null;
|
|
729
724
|
return {
|
|
730
725
|
assessment: l,
|
|
731
|
-
selectedTemplate:
|
|
726
|
+
selectedTemplate: h,
|
|
732
727
|
existingMatches: [],
|
|
733
728
|
continueBuilding: null
|
|
734
729
|
};
|
|
@@ -741,7 +736,7 @@ Description: ${e.description}`).join(`
|
|
|
741
736
|
};
|
|
742
737
|
}, Rt = (t, e) => {
|
|
743
738
|
const { hitlResponse: s } = e.configurable, n = "selectTemplate", i = t.assessment?.matchedTemplates.filter(
|
|
744
|
-
(u) =>
|
|
739
|
+
(u) => H(u.templateId)
|
|
745
740
|
) ?? [], o = i.map((u) => `${u.templateDescription}`);
|
|
746
741
|
if (s?.agentId !== "solutionBuilder" || s.id !== n) {
|
|
747
742
|
const u = {
|
|
@@ -751,24 +746,24 @@ Description: ${e.description}`).join(`
|
|
|
751
746
|
message: f("selectTemplatePrompt", e),
|
|
752
747
|
metadata: [...o]
|
|
753
748
|
};
|
|
754
|
-
throw new
|
|
749
|
+
throw new ne(u);
|
|
755
750
|
}
|
|
756
751
|
const a = String(s.payload ?? ""), l = o.findIndex((u) => u === a);
|
|
757
752
|
return {
|
|
758
753
|
selectedTemplate: (l >= 0 ? i[l] : void 0)?.templateId ?? i[0]?.templateId ?? null
|
|
759
754
|
};
|
|
760
755
|
}, $t = async (t, e) => {
|
|
761
|
-
await
|
|
762
|
-
const s = t.agentExecutionContext.userRequest, n = tt(t.agentExecutionContext.messages) || s, i = await
|
|
756
|
+
await v({ text: f("searchingExistingSolutions", e) }, e);
|
|
757
|
+
const s = t.agentExecutionContext.userRequest, n = tt(t.agentExecutionContext.messages) || s, i = await xe(e);
|
|
763
758
|
if (!i)
|
|
764
759
|
return console.warn("Solutions Search: failed to load solution embeddings cache; skipping search."), { existingMatches: [] };
|
|
765
760
|
if (!i.length)
|
|
766
761
|
return { existingMatches: [] };
|
|
767
|
-
const [o] = await
|
|
762
|
+
const [o] = await Be([n]), a = i.map((c) => ({
|
|
768
763
|
solution: c,
|
|
769
764
|
score: Fe(o, c.embedding)
|
|
770
765
|
}));
|
|
771
|
-
a.sort((c,
|
|
766
|
+
a.sort((c, m) => m.score - c.score);
|
|
772
767
|
const l = a.slice(0, gt);
|
|
773
768
|
if (!l.length)
|
|
774
769
|
return { existingMatches: [] };
|
|
@@ -784,40 +779,40 @@ Description: ${c.description}`).join(`
|
|
|
784
779
|
schema: ut,
|
|
785
780
|
messages: u,
|
|
786
781
|
inputVariables: { query: s, candidates: d }
|
|
787
|
-
})).matchedTitles.map((c) => l.find(({ solution:
|
|
782
|
+
})).matchedTitles.map((c) => l.find(({ solution: m }) => m.title === c)).filter((c) => c !== void 0) };
|
|
788
783
|
}, Mt = (t, e) => {
|
|
789
784
|
const { existingMatches: s } = t, { hitlResponse: n } = e.configurable, i = `confirmExistingSolution:${s[0].solution.id}`;
|
|
790
785
|
if (n?.agentId !== "solutionBuilder" || n.id !== i) {
|
|
791
|
-
s.length === 1 ?
|
|
786
|
+
s.length === 1 ? le(s[0].solution.id) : re(s);
|
|
792
787
|
const d = f("existingSolutionMatch", e), u = [
|
|
793
788
|
f("continueBuildingYes", e),
|
|
794
789
|
f("continueBuildingNo", e)
|
|
795
|
-
],
|
|
790
|
+
], g = {
|
|
796
791
|
agentId: "solutionBuilder",
|
|
797
792
|
id: i,
|
|
798
793
|
kind: "singleSelection",
|
|
799
794
|
message: d,
|
|
800
795
|
metadata: u
|
|
801
796
|
};
|
|
802
|
-
throw new
|
|
797
|
+
throw new ne(g);
|
|
803
798
|
}
|
|
804
799
|
const o = String(n.payload ?? "").trim(), a = f("continueBuildingNo", e);
|
|
805
800
|
return { continueBuilding: o !== a };
|
|
806
|
-
},
|
|
801
|
+
}, Bt = (t, e) => {
|
|
807
802
|
const s = f("continueBuildingDeclined", e);
|
|
808
803
|
return {
|
|
809
804
|
outputMessage: s,
|
|
810
805
|
summary: s,
|
|
811
806
|
status: "success"
|
|
812
807
|
};
|
|
813
|
-
},
|
|
814
|
-
await
|
|
808
|
+
}, ve = async (t, e) => {
|
|
809
|
+
await ye(e);
|
|
815
810
|
const { currentDesign: s } = t, n = t.agentExecutionContext.userRequest;
|
|
816
|
-
await
|
|
811
|
+
await v({ text: f("creatingDesign", e) }, e);
|
|
817
812
|
let i = F(t.selectedTemplate);
|
|
818
|
-
if (i?.initialTemplate || (await
|
|
813
|
+
if (i?.initialTemplate || (await V(e), i = F(t.selectedTemplate)), !i?.initialTemplate)
|
|
819
814
|
throw new Error("No hydrated templates are available for solution design.");
|
|
820
|
-
const o =
|
|
815
|
+
const o = I(
|
|
821
816
|
s ?? i.initialTemplate,
|
|
822
817
|
{
|
|
823
818
|
itemId: (s ?? i.initialTemplate)?.solution?.itemId ?? null,
|
|
@@ -828,46 +823,46 @@ Description: ${c.description}`).join(`
|
|
|
828
823
|
promptText: await y(L, "designSolution"),
|
|
829
824
|
modelTier: "advanced",
|
|
830
825
|
temperature: 0,
|
|
831
|
-
schema:
|
|
826
|
+
schema: G,
|
|
832
827
|
messages: a,
|
|
833
828
|
inputVariables: {
|
|
834
|
-
currentDesign: JSON.stringify(
|
|
829
|
+
currentDesign: JSON.stringify(oe(o)),
|
|
835
830
|
templateInstructions: i.instructions,
|
|
836
831
|
query: n
|
|
837
832
|
}
|
|
838
|
-
}), { response: d, featureLayer: u, ...
|
|
833
|
+
}), { response: d, featureLayer: u, ...g } = l, h = ae(
|
|
839
834
|
u,
|
|
840
835
|
o.featureLayer
|
|
841
|
-
), c =
|
|
842
|
-
{ ...
|
|
836
|
+
), c = I(
|
|
837
|
+
{ ...g, featureLayer: h },
|
|
843
838
|
{
|
|
844
839
|
itemId: o?.solution?.itemId,
|
|
845
840
|
sourceBuildSolution: o.sourceBuildSolution,
|
|
846
841
|
templateId: t.selectedTemplate ?? null,
|
|
847
842
|
params: o.params ?? null
|
|
848
843
|
}
|
|
849
|
-
),
|
|
850
|
-
if (!
|
|
844
|
+
), m = new pe(c, i.initialTemplate);
|
|
845
|
+
if (!m.isValid)
|
|
851
846
|
return console.warn(
|
|
852
847
|
"[SolutionBuilder] designSolution validation failed:",
|
|
853
|
-
{ issues:
|
|
848
|
+
{ issues: m.issues, llmResponse: l }
|
|
854
849
|
), {
|
|
855
850
|
outputMessage: f("createDesignFailed", e)
|
|
856
851
|
};
|
|
857
|
-
const
|
|
858
|
-
if (!
|
|
852
|
+
const E = c.sourceBuildSolution, C = ge(c, E);
|
|
853
|
+
if (!C.ok) {
|
|
859
854
|
console.warn(
|
|
860
855
|
"[SolutionBuilder] designSolution Esri JSON conversion failed:",
|
|
861
|
-
{ error:
|
|
856
|
+
{ error: C.error, llmResponse: l, design: c }
|
|
862
857
|
);
|
|
863
|
-
const
|
|
858
|
+
const _ = f("createDesignFailed", e);
|
|
864
859
|
return {
|
|
865
|
-
outputMessage:
|
|
866
|
-
summary:
|
|
860
|
+
outputMessage: _,
|
|
861
|
+
summary: _,
|
|
867
862
|
status: "success"
|
|
868
863
|
};
|
|
869
864
|
}
|
|
870
|
-
return
|
|
865
|
+
return me(c), {
|
|
871
866
|
outputMessage: d,
|
|
872
867
|
summary: d,
|
|
873
868
|
status: "success",
|
|
@@ -876,9 +871,9 @@ Description: ${c.description}`).join(`
|
|
|
876
871
|
}, Ft = async (t, e) => {
|
|
877
872
|
const { currentDesign: s } = t;
|
|
878
873
|
if (!s)
|
|
879
|
-
return
|
|
874
|
+
return ve(t, e);
|
|
880
875
|
const n = t.agentExecutionContext.userRequest, i = t.agentExecutionContext.messages.slice(-11);
|
|
881
|
-
await
|
|
876
|
+
await v({ text: f("updatingDesign", e) }, e);
|
|
882
877
|
const o = await D({
|
|
883
878
|
promptText: await y(L, "updateDesign"),
|
|
884
879
|
modelTier: "advanced",
|
|
@@ -900,8 +895,8 @@ Description: ${c.description}`).join(`
|
|
|
900
895
|
try {
|
|
901
896
|
return JSON.parse(p);
|
|
902
897
|
} catch {
|
|
903
|
-
const
|
|
904
|
-
switch (
|
|
898
|
+
const S = p.replace(/[\u0000-\u001F]/g, (Y) => {
|
|
899
|
+
switch (Y) {
|
|
905
900
|
case "\b":
|
|
906
901
|
return "\\b";
|
|
907
902
|
case "\f":
|
|
@@ -914,45 +909,45 @@ Description: ${c.description}`).join(`
|
|
|
914
909
|
case " ":
|
|
915
910
|
return "\\t";
|
|
916
911
|
default:
|
|
917
|
-
return "\\u" +
|
|
912
|
+
return "\\u" + Y.charCodeAt(0).toString(16).padStart(4, "0");
|
|
918
913
|
}
|
|
919
914
|
});
|
|
920
915
|
try {
|
|
921
|
-
return JSON.parse(
|
|
916
|
+
return JSON.parse(S);
|
|
922
917
|
} catch {
|
|
923
918
|
return p;
|
|
924
919
|
}
|
|
925
920
|
}
|
|
926
|
-
},
|
|
921
|
+
}, g = [...l.map((p) => ({
|
|
927
922
|
op: p.op,
|
|
928
923
|
path: p.path.replace(/\/+$/, ""),
|
|
929
924
|
...p.value != null && p.value !== "" ? { value: d(p.value) } : {},
|
|
930
925
|
...p.from != null && p.from !== "" ? { from: p.from } : {}
|
|
931
|
-
}))].sort((p,
|
|
932
|
-
|
|
926
|
+
}))].sort((p, S) => p.op !== "remove" || S.op !== "remove" ? 0 : S.path.localeCompare(p.path, void 0, { numeric: !0 })), h = structuredClone(
|
|
927
|
+
oe(s)
|
|
933
928
|
);
|
|
934
929
|
try {
|
|
935
|
-
Ne(
|
|
930
|
+
Ne(h, g, !0);
|
|
936
931
|
} catch (p) {
|
|
937
932
|
console.warn(
|
|
938
933
|
"[SolutionBuilder] updateDesign JSON patch failed:",
|
|
939
|
-
{ error: p, llmResponse: o, patches:
|
|
934
|
+
{ error: p, llmResponse: o, patches: g, patchTarget: h }
|
|
940
935
|
);
|
|
941
|
-
const
|
|
936
|
+
const S = f("applyChangeFailed", e);
|
|
942
937
|
return {
|
|
943
|
-
outputMessage:
|
|
944
|
-
summary:
|
|
938
|
+
outputMessage: S,
|
|
939
|
+
summary: S,
|
|
945
940
|
status: "success"
|
|
946
941
|
};
|
|
947
942
|
}
|
|
948
|
-
const c =
|
|
949
|
-
{ response: "", ...
|
|
943
|
+
const c = I(
|
|
944
|
+
{ response: "", ...h },
|
|
950
945
|
{ itemId: s.solution?.itemId ?? null }
|
|
951
|
-
),
|
|
952
|
-
if (!
|
|
946
|
+
), m = G.safeParse(c);
|
|
947
|
+
if (!m.success) {
|
|
953
948
|
console.warn(
|
|
954
949
|
"[SolutionBuilder] updateDesign schema validation failed:",
|
|
955
|
-
{ errors:
|
|
950
|
+
{ errors: m.error.issues, llmResponse: o, patchedDesign: c }
|
|
956
951
|
);
|
|
957
952
|
const p = f("applyChangeFailed", e);
|
|
958
953
|
return {
|
|
@@ -961,11 +956,11 @@ Description: ${c.description}`).join(`
|
|
|
961
956
|
status: "success"
|
|
962
957
|
};
|
|
963
958
|
}
|
|
964
|
-
const { response:
|
|
965
|
-
|
|
959
|
+
const { response: E, featureLayer: C, ..._ } = m.data, Se = ae(
|
|
960
|
+
C,
|
|
966
961
|
s.featureLayer
|
|
967
|
-
),
|
|
968
|
-
{ ...
|
|
962
|
+
), w = I(
|
|
963
|
+
{ ..._, featureLayer: Se },
|
|
969
964
|
{
|
|
970
965
|
itemId: s.solution?.itemId,
|
|
971
966
|
sourceBuildSolution: s.sourceBuildSolution,
|
|
@@ -974,21 +969,21 @@ Description: ${c.description}`).join(`
|
|
|
974
969
|
}
|
|
975
970
|
);
|
|
976
971
|
let R = F(t.selectedTemplate);
|
|
977
|
-
if (R?.initialTemplate || (await
|
|
972
|
+
if (R?.initialTemplate || (await V(e), R = F(t.selectedTemplate)), !R?.initialTemplate)
|
|
978
973
|
throw new Error("No hydrated templates are available for solution design.");
|
|
979
|
-
const K = new
|
|
974
|
+
const K = new pe(w, R.initialTemplate, !1);
|
|
980
975
|
if (!K.isValid)
|
|
981
976
|
return console.warn(
|
|
982
977
|
"[SolutionBuilder] updateDesign validation failed:",
|
|
983
|
-
{ issues: K.issues, llmResponse: o, patchedDesign:
|
|
978
|
+
{ issues: K.issues, llmResponse: o, patchedDesign: w }
|
|
984
979
|
), {
|
|
985
980
|
outputMessage: f("applyChangeFailed", e)
|
|
986
981
|
};
|
|
987
|
-
const Ie =
|
|
988
|
-
if (!
|
|
982
|
+
const Ie = w.sourceBuildSolution, Q = ge(w, Ie);
|
|
983
|
+
if (!Q.ok) {
|
|
989
984
|
console.warn(
|
|
990
985
|
"[SolutionBuilder] updateDesign Esri JSON conversion failed:",
|
|
991
|
-
{ error:
|
|
986
|
+
{ error: Q.error, llmResponse: o, design: w }
|
|
992
987
|
);
|
|
993
988
|
const p = f("applyChangeFailed", e);
|
|
994
989
|
return {
|
|
@@ -997,33 +992,33 @@ Description: ${c.description}`).join(`
|
|
|
997
992
|
status: "success"
|
|
998
993
|
};
|
|
999
994
|
}
|
|
1000
|
-
return
|
|
995
|
+
return me(w), {
|
|
1001
996
|
outputMessage: a,
|
|
1002
997
|
summary: a,
|
|
1003
998
|
status: "success",
|
|
1004
|
-
currentDesign:
|
|
999
|
+
currentDesign: w
|
|
1005
1000
|
};
|
|
1006
|
-
},
|
|
1001
|
+
}, Pt = (t) => t.currentDesign !== null ? "updateDesign" : "assessInitialRequest", Nt = (t) => !t.assessment || !t.assessment.isValidUseCase ? "invalidUseCaseExit" : !t.selectedTemplate && t.assessment.matchedTemplates.length > 1 ? "selectTemplateHIL" : "findExistingSolutions", qt = (t) => t.existingMatches.length > 0 ? "confirmContinueBuildingHIL" : "designSolution", Ut = (t) => t.continueBuilding === !1 ? "declineContinueBuildingExit" : "designSolution", Ot = () => new O(Tt).addNode("syncCurrentDesignFromContext", At).addNode("assessInitialRequest", Dt).addNode("invalidUseCaseExit", Lt).addNode("selectTemplateHIL", Rt).addNode("findExistingSolutions", $t).addNode("confirmContinueBuildingHIL", Mt).addNode("declineContinueBuildingExit", Bt).addNode("designSolution", ve).addNode("updateDesign", Ft).addEdge(z, "syncCurrentDesignFromContext").addConditionalEdges("syncCurrentDesignFromContext", Pt, {
|
|
1007
1002
|
updateDesign: "updateDesign",
|
|
1008
1003
|
assessInitialRequest: "assessInitialRequest"
|
|
1009
1004
|
}).addConditionalEdges("assessInitialRequest", Nt, {
|
|
1010
1005
|
invalidUseCaseExit: "invalidUseCaseExit",
|
|
1011
1006
|
selectTemplateHIL: "selectTemplateHIL",
|
|
1012
1007
|
findExistingSolutions: "findExistingSolutions"
|
|
1013
|
-
}).addEdge("invalidUseCaseExit",
|
|
1008
|
+
}).addEdge("invalidUseCaseExit", x).addEdge("selectTemplateHIL", "findExistingSolutions").addConditionalEdges("findExistingSolutions", qt, {
|
|
1014
1009
|
confirmContinueBuildingHIL: "confirmContinueBuildingHIL",
|
|
1015
1010
|
designSolution: "designSolution"
|
|
1016
1011
|
}).addConditionalEdges("confirmContinueBuildingHIL", Ut, {
|
|
1017
1012
|
declineContinueBuildingExit: "declineContinueBuildingExit",
|
|
1018
1013
|
designSolution: "designSolution"
|
|
1019
|
-
}).addEdge("declineContinueBuildingExit",
|
|
1014
|
+
}).addEdge("declineContinueBuildingExit", x).addEdge("designSolution", x).addEdge("updateDesign", x);
|
|
1020
1015
|
await y(L, "description");
|
|
1021
|
-
const zt =
|
|
1022
|
-
tool:
|
|
1023
|
-
confidence:
|
|
1024
|
-
rationale:
|
|
1025
|
-
builderExclusion:
|
|
1026
|
-
}),
|
|
1016
|
+
const zt = T.object({
|
|
1017
|
+
tool: T.enum(["explorer", "builder", "other"]).describe("The selected tool based on the user's query."),
|
|
1018
|
+
confidence: T.number().min(0).max(1).describe("A confidence score (0.00–1.00)."),
|
|
1019
|
+
rationale: T.string().min(1).describe("A brief rationale for the tool choice (≤140 characters)"),
|
|
1020
|
+
builderExclusion: T.boolean().describe("True only when tool is other specifically due to Builder Exclusion Override.")
|
|
1021
|
+
}), P = /* @__PURE__ */ Object.assign({
|
|
1027
1022
|
"./prompts/assistantResponse.md": () => import("../../chunks/assistantResponse.js").then((t) => t.default),
|
|
1028
1023
|
"./prompts/classifyIntent.md": () => import("../../chunks/classifyIntent.js").then((t) => t.default),
|
|
1029
1024
|
"./prompts/description.md": () => import("../../chunks/description.js").then((t) => t.default),
|
|
@@ -1034,8 +1029,8 @@ const zt = E.object({
|
|
|
1034
1029
|
detail: !1
|
|
1035
1030
|
});
|
|
1036
1031
|
window.dispatchEvent(t);
|
|
1037
|
-
},
|
|
1038
|
-
...
|
|
1032
|
+
}, we = b.Root({
|
|
1033
|
+
...j(),
|
|
1039
1034
|
selectedTool: b({
|
|
1040
1035
|
reducer: (t, e) => e ?? null,
|
|
1041
1036
|
default: () => null
|
|
@@ -1050,7 +1045,7 @@ const zt = E.object({
|
|
|
1050
1045
|
})
|
|
1051
1046
|
}), jt = async (t, e) => {
|
|
1052
1047
|
const s = N(e);
|
|
1053
|
-
await
|
|
1048
|
+
await v(
|
|
1054
1049
|
{ text: s?.builderMessages.understandingRequest },
|
|
1055
1050
|
e
|
|
1056
1051
|
);
|
|
@@ -1062,7 +1057,7 @@ const zt = E.object({
|
|
|
1062
1057
|
} catch {
|
|
1063
1058
|
a = !1;
|
|
1064
1059
|
}
|
|
1065
|
-
const l = await y(
|
|
1060
|
+
const l = await y(P, "classifyIntent"), d = await D({
|
|
1066
1061
|
promptText: l,
|
|
1067
1062
|
modelTier: "advanced",
|
|
1068
1063
|
temperature: 0,
|
|
@@ -1076,21 +1071,21 @@ const zt = E.object({
|
|
|
1076
1071
|
builderExclusion: d.builderExclusion
|
|
1077
1072
|
};
|
|
1078
1073
|
}, Jt = async (t, e) => {
|
|
1079
|
-
const n = await
|
|
1074
|
+
const n = await Ke().compile().invoke(t, e);
|
|
1080
1075
|
return W(), n;
|
|
1081
1076
|
}, Gt = async (t, e) => {
|
|
1082
1077
|
const n = await Ot().compile().invoke(t, e);
|
|
1083
1078
|
return W(), n;
|
|
1084
1079
|
}, Ht = async (t, e) => {
|
|
1085
1080
|
const s = N(e), n = t.agentExecutionContext.userRequest, i = t.intentRationale ?? "No rationale available.", o = t.builderExclusion ? "responseOptionsBuilderExclusion" : "responseOptionsDefault";
|
|
1086
|
-
await
|
|
1081
|
+
await v(
|
|
1087
1082
|
{ text: s?.executingSolutionsAssistantAgent },
|
|
1088
1083
|
e
|
|
1089
1084
|
);
|
|
1090
|
-
const a = await y(
|
|
1091
|
-
|
|
1085
|
+
const a = await y(P, "assistantResponse"), l = await y(
|
|
1086
|
+
P,
|
|
1092
1087
|
o
|
|
1093
|
-
), d = t.agentExecutionContext.messages.slice(-11), u = await
|
|
1088
|
+
), d = t.agentExecutionContext.messages.slice(-11), u = await Pe({
|
|
1094
1089
|
promptText: a,
|
|
1095
1090
|
modelTier: "advanced",
|
|
1096
1091
|
temperature: 0,
|
|
@@ -1102,16 +1097,16 @@ const zt = E.object({
|
|
|
1102
1097
|
summary: u,
|
|
1103
1098
|
status: "success"
|
|
1104
1099
|
};
|
|
1105
|
-
}, Vt = (t) => t.selectedTool ?? "other",
|
|
1100
|
+
}, Vt = (t) => t.selectedTool ?? "other", Wt = () => new O(we).addNode("classifyIntent", jt).addNode("routeToExplorer", Jt).addNode("routeToBuilder", Gt).addNode("assistantResponse", Ht).addEdge(z, "classifyIntent").addConditionalEdges("classifyIntent", Vt, {
|
|
1106
1101
|
explorer: "routeToExplorer",
|
|
1107
1102
|
builder: "routeToBuilder",
|
|
1108
1103
|
other: "assistantResponse"
|
|
1109
|
-
}).addEdge("routeToExplorer",
|
|
1104
|
+
}).addEdge("routeToExplorer", x).addEdge("routeToBuilder", x).addEdge("assistantResponse", x), Kt = await y(P, "description"), Qt = {
|
|
1110
1105
|
id: "solutionsAssistant",
|
|
1111
1106
|
name: "Solutions Assistant Agent",
|
|
1112
|
-
description:
|
|
1113
|
-
createGraph:
|
|
1114
|
-
workspace:
|
|
1107
|
+
description: Kt,
|
|
1108
|
+
createGraph: Wt,
|
|
1109
|
+
workspace: we
|
|
1115
1110
|
}, Yt = "https://links.esri.com/solutions/agol-organizational-account", Zt = "https://links.esri.com/solutions/configure-assistants";
|
|
1116
1111
|
class Xt extends ke {
|
|
1117
1112
|
constructor() {
|
|
@@ -1119,13 +1114,13 @@ class Xt extends ke {
|
|
|
1119
1114
|
aiAssistantsEnabled: !1,
|
|
1120
1115
|
blockBetaApps: !0,
|
|
1121
1116
|
colocateCompute: !1
|
|
1122
|
-
}, this._suggestedPrompts = [], this._hasInteracted = !1, this._isMobile = window.innerWidth <= 800, this._translations = _e({ name: "arcgis-solutions-assistant", blocking: !0 }), this._builderWidth = 48, this._solutionDesignJson = '{ "solution": null }', this._isAssistantBusy = !1, this._isBuilderBusy = !1, this._preChatCheck = !1, this._assistantRef = $e(), this._configContextConsumer =
|
|
1117
|
+
}, this._suggestedPrompts = [], this._hasInteracted = !1, this._isMobile = window.innerWidth <= 800, this._translations = _e({ name: "arcgis-solutions-assistant", blocking: !0 }), this._builderWidth = 48, this._solutionDesignJson = '{ "solution": null }', this._isAssistantBusy = !1, this._isBuilderBusy = !1, this._preChatCheck = !1, this._assistantRef = $e(), this._configContextConsumer = ee({
|
|
1123
1118
|
context: Ae,
|
|
1124
1119
|
subscribe: !0,
|
|
1125
1120
|
callback: (e) => {
|
|
1126
|
-
e?.portalURL && (
|
|
1121
|
+
e?.portalURL && (te.portalUrl = e.portalURL), e?.userSession && !this.userFirstName && this._loadUserFirstName(), e?.authentication?.PortalSubset?.orgSettings && (this._orgSettings = e?.authentication?.PortalSubset?.orgSettings);
|
|
1127
1122
|
}
|
|
1128
|
-
}), this._builderDesignContextConsumer =
|
|
1123
|
+
}), this._builderDesignContextConsumer = ee({
|
|
1129
1124
|
context: De,
|
|
1130
1125
|
subscribe: !0,
|
|
1131
1126
|
callback: (e) => {
|
|
@@ -1133,7 +1128,7 @@ class Xt extends ke {
|
|
|
1133
1128
|
}
|
|
1134
1129
|
}), this._handleResize = () => {
|
|
1135
1130
|
this._isMobile = window.innerWidth <= 800;
|
|
1136
|
-
}, this.closeAssistant =
|
|
1131
|
+
}, this.closeAssistant = Z(), this.assistantProcessing = Z(), this._handleAssistantLinkClick = (e) => {
|
|
1137
1132
|
const s = e.composedPath().find((n) => n instanceof HTMLAnchorElement);
|
|
1138
1133
|
if (s?.href)
|
|
1139
1134
|
if (e.preventDefault(), s.target.indexOf("solutionId:") > -1) {
|
|
@@ -1172,25 +1167,25 @@ class Xt extends ke {
|
|
|
1172
1167
|
this._checkURLOpenParameter();
|
|
1173
1168
|
}
|
|
1174
1169
|
load() {
|
|
1175
|
-
this._configContextConsumer.value?.portalURL && (
|
|
1170
|
+
this._configContextConsumer.value?.portalURL && (te.portalUrl = this._configContextConsumer.value.portalURL);
|
|
1176
1171
|
}
|
|
1177
1172
|
firstUpdated(e) {
|
|
1178
1173
|
this._loadUserFirstName();
|
|
1179
1174
|
}
|
|
1180
1175
|
willUpdate(e) {
|
|
1181
|
-
e.has("open") && this.open && window.dispatchEvent(new CustomEvent("openAssistant")), this._configContextConsumer.value?.authentication && this._configContextConsumer.value?.userSession?.token && (this._preChatCheck || (
|
|
1176
|
+
e.has("open") && this.open && window.dispatchEvent(new CustomEvent("openAssistant")), this._configContextConsumer.value?.authentication && this._configContextConsumer.value?.userSession?.token && (this._preChatCheck || (de(this._configContextConsumer.value?.authentication.Portal, this._configContextConsumer.value?.userSession?.token, this._configContextConsumer.value?.locale ?? "en"), this._preChatCheck = !0)), this._configContextConsumer.value?.userSession?.token && this._configContextConsumer.value?.authentication?.CanUseAI;
|
|
1182
1177
|
}
|
|
1183
1178
|
_renderNoSign() {
|
|
1184
|
-
return
|
|
1179
|
+
return k`<calcite-notice class="margin-lg" open scale=m icon=effects kind=info><div slot=message>${this._translations.signInMessage}</div><calcite-link @click=${this._handleSignIn} slot=link title=${this._translations.signInMessage ?? X} class="padding-top-10">${this._translations.signIn}</calcite-link></calcite-notice>`;
|
|
1185
1180
|
}
|
|
1186
1181
|
_renderNoPermission() {
|
|
1187
|
-
return
|
|
1182
|
+
return k`<calcite-notice open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${Te(this._translations.noPermissionMessage.replace("{{orgUrl}}", Yt).replace("{{configAI}}", Zt))}</div></calcite-notice>`;
|
|
1188
1183
|
}
|
|
1189
1184
|
render() {
|
|
1190
1185
|
let e = this._suggestedPrompts.length > 0 ? this._suggestedPrompts : this._hasInteracted ? [] : Object.values(this._translations.defaultFollowUpQuestions);
|
|
1191
|
-
return this._suggestedPrompts.length > 0 ? e = this._suggestedPrompts : this._hasInteracted || (e = [...Object.values(this._translations.defaultFollowUpQuestions)]),
|
|
1186
|
+
return this._suggestedPrompts.length > 0 ? e = this._suggestedPrompts : this._hasInteracted || (e = [...Object.values(this._translations.defaultFollowUpQuestions)]), k`<calcite-panel class="chat-panel"><div class="header-content" slot=header-content><span class="header-title">${this._translations.solutionAssistantTitle}</span></div>${this._configContextConsumer.value?.userSession?.token ? this._configContextConsumer.value?.authentication?.CanUseAI ? k`${!this._isMobile && k`<calcite-action id=solutionBuilderAction icon=pencil-square .text=${this._translations.tooltips.builder} text-enabled .indicator=${this.hasActiveBuilderDesign} .disabled=${!this.hasActiveBuilderDesign} .active=${this.builderVisible} selection-appearance=highlight @click=${() => {
|
|
1192
1187
|
window.dispatchEvent(new CustomEvent("toggleSolutionBuilder"));
|
|
1193
|
-
}} scale=m slot=header-actions-end></calcite-action>` || ""}${!this._isMobile &&
|
|
1188
|
+
}} scale=m slot=header-actions-end></calcite-action>` || ""}${!this._isMobile && k`<calcite-tooltip placement=bottom reference-element=solutionBuilderAction><span>${this._translations.tooltips.solutionBuilder}</span></calcite-tooltip>` || ""}<arcgis-assistant reference-element copy-enabled feedback-enabled heading description entry-message=${this._translations.defaultStartUpMessage ?? X} .suggestedPrompts=${e} @arcgisSubmit=${(s) => {
|
|
1194
1189
|
console.log("arcgis submit: ", s.detail), this._suggestedPrompts = [], e = [], this._hasInteracted = !0;
|
|
1195
1190
|
const n = Date.now(), i = Re(n), o = s.detail || "Unknown";
|
|
1196
1191
|
this._telemetry?.logEvent({
|
|
@@ -1207,9 +1202,9 @@ class Xt extends ke {
|
|
|
1207
1202
|
this._queryElementInShadowDom(this.el, ".footer-container", !1);
|
|
1208
1203
|
}} @arcgisInterruptSubmit=${() => {
|
|
1209
1204
|
this._queryElementInShadowDom(this.el, ".footer-container", !1);
|
|
1210
|
-
}} ${Me(this._assistantRef)}><calcite-
|
|
1205
|
+
}} ${Me(this._assistantRef)}><calcite-button appearance=solid id=newChatButton icon-start=speech-bubble-plus kind=neutral .label=${this._translations.tooltips.newChat} @click=${() => {
|
|
1211
1206
|
this._conversationId = void 0, this._suggestedPrompts = [], this._hasInteracted = !1, this._assistantRef.value?.clearChatHistory(), this._queryElementInShadowDom(this.el, ".footer-container", !1);
|
|
1212
|
-
}} scale=s
|
|
1207
|
+
}} round scale=s slot=entry-actions-start>${this._translations.tooltips.newChat}</calcite-button><arcgis-assistant-agent .agent=${Qt} .context=${{
|
|
1213
1208
|
token: this._configContextConsumer.value?.userSession?.token,
|
|
1214
1209
|
configContext: this._configContextConsumer.value,
|
|
1215
1210
|
convoId: this._conversationId,
|
|
@@ -1217,9 +1212,6 @@ class Xt extends ke {
|
|
|
1217
1212
|
assistantRef: this._assistantRef,
|
|
1218
1213
|
translations: this._translations,
|
|
1219
1214
|
solutionDesignJson: this._solutionDesignJson,
|
|
1220
|
-
updateSuggestedPrompts: (s) => {
|
|
1221
|
-
this._suggestedPrompts = s;
|
|
1222
|
-
},
|
|
1223
1215
|
setConversationId: (s) => {
|
|
1224
1216
|
this._conversationId = s;
|
|
1225
1217
|
},
|
|
@@ -1245,14 +1237,14 @@ class Xt extends ke {
|
|
|
1245
1237
|
}
|
|
1246
1238
|
}
|
|
1247
1239
|
_parseAgentPickedAndTask(e) {
|
|
1248
|
-
const s = Array.from(this._assistantRef.value?.messages || []), n = e.log || [], a = [...s].sort((c,
|
|
1240
|
+
const s = Array.from(this._assistantRef.value?.messages || []), n = e.log || [], a = [...s].sort((c, m) => m.id - c.id).find((c) => c.role === "user" && c.id <= e.id)?.content || null, l = n.find((c) => typeof c == "string" && c.includes("Agent picked:")) ?? null;
|
|
1249
1241
|
if (!l)
|
|
1250
1242
|
return { agentPicked: null, taskAssigned: null, userMessage: a };
|
|
1251
1243
|
const d = /Agent picked:\s*(.*?)\s*(?:\\n|\r?\n)\s*Task Assigned:\s*([\s\S]*)$/i, u = l.match(d);
|
|
1252
1244
|
if (!u)
|
|
1253
1245
|
return { agentPicked: null, taskAssigned: null, userMessage: a };
|
|
1254
|
-
const
|
|
1255
|
-
return { agentPicked:
|
|
1246
|
+
const g = u[1].trim(), h = u[2].trim();
|
|
1247
|
+
return { agentPicked: g, taskAssigned: h, userMessage: a };
|
|
1256
1248
|
}
|
|
1257
1249
|
_emitItemIdFromAI(e) {
|
|
1258
1250
|
const s = new CustomEvent("solutionIDFromAssistant", {
|