@esri/solutions-components 5.1.0-next.144 → 5.1.0-next.146
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/2BIUOM64.js +2 -0
- package/dist/cdn/{MT5J66WR.js → 2IGILR4T.js} +1 -1
- package/dist/cdn/{S5AQVTR2.js → 2PUK3PST.js} +1 -1
- package/dist/cdn/{KUGXNF5Y.js → 2UMMLVCR.js} +1 -1
- package/dist/cdn/{SOLCNPHW.js → 3DCFUYKP.js} +1 -1
- package/dist/cdn/{65L2LQGD.js → 3JQ2RXVJ.js} +1 -1
- package/dist/cdn/{I22C4HE4.js → 3KYQE6O5.js} +1 -1
- package/dist/cdn/{ULFPP7PF.js → 463VANZI.js} +1 -1
- package/dist/cdn/{ZCSF2MJ5.js → 4NZDPHHF.js} +1 -1
- package/dist/cdn/{BNRFT546.js → 5DEYOM7D.js} +1 -1
- package/dist/cdn/{WLM4HMMF.js → 5LF6C3S5.js} +1 -1
- package/dist/cdn/{PUCDO65D.js → 6T35OGRG.js} +1 -1
- package/dist/cdn/{Y77RX7KL.js → 7ADKNWWI.js} +1 -1
- package/dist/cdn/{DKEYOEI7.js → 7CLM77HQ.js} +1 -1
- package/dist/cdn/{RSCBZIAN.js → 7WIFBTQF.js} +12 -1
- package/dist/cdn/{3UKDJZ2D.js → AE5HNAOV.js} +1 -1
- package/dist/cdn/{YQWQG523.js → AOWNMC3W.js} +1 -1
- package/dist/cdn/{EDZIFJZR.js → B5MBF4JC.js} +13 -13
- package/dist/cdn/BG4LNU44.js +2 -0
- package/dist/cdn/BMMIXOTR.js +2 -0
- package/dist/cdn/{6Z3DXRF6.js → BQE6IVEF.js} +1 -1
- package/dist/cdn/{7GXMCAWQ.js → CVRBLJ5O.js} +1 -1
- package/dist/cdn/D3XPV5W4.js +2 -0
- package/dist/cdn/{ENG5BCAV.js → DXQQQNOF.js} +1 -1
- package/dist/cdn/{5YXQ4UXZ.js → E6YCTW3S.js} +27 -26
- package/dist/cdn/{BGLTC5SO.js → F26SXWZ5.js} +1 -1
- package/dist/cdn/FAIQTEVJ.js +2 -0
- package/dist/cdn/{4JGB6WLL.js → FCJSMT5G.js} +1 -1
- package/dist/cdn/FSWG7SUT.js +2 -0
- package/dist/cdn/{AHB7W7RI.js → GJD7AOUI.js} +1 -1
- package/dist/cdn/{SGQBWAPU.js → IDEOFV22.js} +1 -1
- package/dist/cdn/{FW2HWQC7.js → IEC46RE7.js} +1 -1
- package/dist/cdn/{4RLG6MXK.js → JOAEH3CI.js} +1 -1
- package/dist/cdn/{LKZFKOG4.js → KDNGZ47C.js} +1 -1
- package/dist/cdn/KIPRPYME.js +2 -0
- package/dist/cdn/{7FJTZ7VA.js → L3UI7EZZ.js} +1 -1
- package/dist/cdn/{MC5ARLKZ.js → L6P26BYB.js} +1 -1
- package/dist/cdn/{YLC2EM5A.js → LCV5GKUD.js} +2 -2
- package/dist/cdn/{NIHPHDXG.js → LWT3JEQ6.js} +21 -52
- package/dist/cdn/LZDMYPQ2.js +75 -0
- package/dist/cdn/{SSIUWTQX.js → M3NML7ZV.js} +1 -1
- package/dist/cdn/{KSQHSNTW.js → M4II4TSX.js} +1 -1
- package/dist/cdn/MHVLVLRA.js +2 -0
- package/dist/cdn/{UOGZGAJD.js → MIH5YMTN.js} +1 -1
- package/dist/cdn/{K4TDKKPB.js → MPCJZCL5.js} +1 -1
- package/dist/cdn/MZ73EAAV.js +29 -0
- package/dist/cdn/{TX3LBQ6V.js → NOXANMDF.js} +1 -1
- package/dist/cdn/{QQEYWBVV.js → O6ZQYZKL.js} +1 -1
- package/dist/cdn/{QHDEVLC3.js → P4XNRWG7.js} +1 -1
- package/dist/cdn/{EPOIEXNS.js → PBGG3TGN.js} +1 -1
- package/dist/cdn/{H2UL463J.js → PBMTIFFX.js} +1 -1
- package/dist/cdn/{VBJSVR6T.js → PECGJO2P.js} +1 -1
- package/dist/cdn/{FILMKUOU.js → PNESECPO.js} +1 -1
- package/dist/cdn/QGCF64WY.js +2 -0
- package/dist/cdn/{5LIR6BQY.js → QKJJHBMB.js} +1 -1
- package/dist/cdn/{J3HJC4SO.js → QU25YPPX.js} +2 -2
- package/dist/cdn/{56XVVIG7.js → RIHOGDUV.js} +1 -1
- package/dist/cdn/{AGB374BK.js → RUQ4RO4T.js} +1 -1
- package/dist/cdn/U56TK45K.js +113 -0
- package/dist/cdn/{MVF7I3RU.js → UKQPYE7U.js} +1 -1
- package/dist/cdn/{BVSSQNES.js → ULUJKWT5.js} +1 -1
- package/dist/cdn/{LYAXTCCM.js → V3MSUKLX.js} +10 -7
- package/dist/cdn/{FVOCVCEE.js → WC37HMOI.js} +1 -1
- package/dist/cdn/WUKFT5AY.js +4 -0
- package/dist/cdn/{XXGM7HGO.js → XGYNSCTA.js} +1 -1
- package/dist/cdn/{DNPN62O5.js → Y4KGXRSD.js} +1 -1
- package/dist/cdn/{LEK4P4OY.js → ZM27FRZG.js} +1 -1
- package/dist/cdn/ZUPXKH75.js +2 -0
- package/dist/cdn/{IEOFEUZI.js → ZYLKUZID.js} +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/assessBuildRequest.js +116 -0
- package/dist/chunks/assessUpdateRequest.js +78 -0
- package/dist/chunks/assistantResponse.js +12 -1
- package/dist/chunks/classifyIntent.js +21 -52
- package/dist/chunks/converter.js +633 -367
- package/dist/chunks/deployFlowController.js +46 -0
- package/dist/chunks/designSolution.js +10 -7
- package/dist/chunks/explainValidationFailure.js +32 -0
- package/dist/chunks/solution-builder-assistant.js +157 -71
- package/dist/chunks/templates.js +2 -2
- package/dist/chunks/updateDesign.js +1 -1
- package/dist/components/arcgis-solutions-assistant/customElement.js +469 -338
- package/dist/components/solution-builder-assistant/customElement.js +3 -2
- package/dist/components/solution-deployed-card-panel/customElement.js +4 -4
- package/dist/components/solution-deploying-dialog/customElement.js +12 -12
- package/dist/components/solution-details-panel/customElement.js +112 -102
- package/dist/components/solution-item-diagram/customElement.js +321 -285
- package/dist/components/solutions-all-panel/customElement.js +4 -4
- package/dist/components/solutions-deploy-app/customElement.js +5 -5
- 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 -9
- package/package.json +1 -1
- package/dist/cdn/56A5UMZG.js +0 -9
- package/dist/cdn/5MPYPIR2.js +0 -2
- package/dist/cdn/C4OXBZJK.js +0 -2
- package/dist/cdn/CGCNGFBL.js +0 -2
- package/dist/cdn/DFZZNKPK.js +0 -76
- package/dist/cdn/FE2GEHNL.js +0 -2
- package/dist/cdn/GLQZHYJP.js +0 -4
- package/dist/cdn/LYK2CASU.js +0 -2
- package/dist/cdn/Q5TICZRX.js +0 -15
- package/dist/cdn/S6U6SXMD.js +0 -2
- package/dist/cdn/SYZEWVHU.js +0 -2
- package/dist/cdn/U4RHWD57.js +0 -2
- package/dist/cdn/WGS5W6W5.js +0 -2
- package/dist/chunks/initialAssessment.js +0 -79
- package/dist/chunks/responseOptionsBuilderExclusion.js +0 -12
- package/dist/chunks/responseOptionsDefault.js +0 -18
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { u as
|
|
4
|
-
import { LitElement as ke, createEvent as
|
|
5
|
-
import { css as Ee, html as
|
|
6
|
-
import { unsafeHTML as
|
|
2
|
+
import { c as _e } from "../../chunks/runtime.js";
|
|
3
|
+
import { u as Te } from "../../chunks/useT9n.js";
|
|
4
|
+
import { LitElement as ke, createEvent as X, nothing as Z } from "@arcgis/lumina";
|
|
5
|
+
import { css as Ee, html as E } from "lit";
|
|
6
|
+
import { unsafeHTML as Ae } from "lit/directives/unsafe-html.js";
|
|
7
7
|
import { useContextConsumer as ee } from "@arcgis/lumina/context";
|
|
8
|
-
import { c as
|
|
9
|
-
import { T as
|
|
10
|
-
import { l as
|
|
8
|
+
import { c as Le, b as Re } from "../../chunks/deployAppContexts.js";
|
|
9
|
+
import { T as De } from "../../chunks/interfaces.js";
|
|
10
|
+
import { l as Fe } from "../../chunks/helpers.js";
|
|
11
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 O, START as z, END as
|
|
14
|
-
import { createAgentRuntimeState as j, sendTraceMessage as
|
|
15
|
-
import r, { z as
|
|
13
|
+
import { Annotation as b, StateGraph as O, START as z, END as v, NodeInterrupt as ne } from "@langchain/langgraph/web";
|
|
14
|
+
import { createAgentRuntimeState as j, sendTraceMessage as w, invokeStructuredPrompt as _, getEmbeddings as Be, cosineSimilarity as Ne, invokeTextPrompt as qe } from "@arcgis/ai-orchestrator";
|
|
15
|
+
import r, { z as D } from "zod";
|
|
16
16
|
import * as J from "@esri/arcgis-rest-portal";
|
|
17
|
-
import { applyPatch as
|
|
17
|
+
import { applyPatch as Pe } from "fast-json-patch";
|
|
18
18
|
import "@langchain/core/messages";
|
|
19
19
|
import { C as ie } from "../../chunks/converter.js";
|
|
20
|
-
import {
|
|
20
|
+
import { t as oe, g as B, c as ae, r as re, d as L } 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
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)}`;
|
|
@@ -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 le(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 re(t) {
|
|
|
59
59
|
}
|
|
60
60
|
}));
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function ce(t) {
|
|
63
63
|
if (typeof window > "u" || !t)
|
|
64
64
|
return;
|
|
65
65
|
const e = new CustomEvent("solutionIDFromAssistant", {
|
|
@@ -93,10 +93,10 @@ function Ge(t, e) {
|
|
|
93
93
|
}
|
|
94
94
|
}), { source: t, allMatches: s };
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function Ve(t) {
|
|
97
97
|
return t && t.helperServices.aiAssistantServices ? `${t.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/chat` : null;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function de(t) {
|
|
100
100
|
return t && t.helperServices.aiAssistantServices ? `${t.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/api/pre-chat` : null;
|
|
101
101
|
}
|
|
102
102
|
async function U(t, e, s) {
|
|
@@ -112,7 +112,7 @@ async function U(t, e, s) {
|
|
|
112
112
|
throw new Error(`HTTP ${n.status} calling ${e}`);
|
|
113
113
|
return n.json();
|
|
114
114
|
}
|
|
115
|
-
const
|
|
115
|
+
const He = (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
|
|
@@ -133,9 +133,9 @@ const Ve = (t) => new Promise((e) => setTimeout(e, t)), We = b.Root({
|
|
|
133
133
|
reducer: (t, e) => e ?? t,
|
|
134
134
|
default: () => null
|
|
135
135
|
})
|
|
136
|
-
}), Ke = () => new O(We).addNode("initializeAgent", Ye).addNode("askSolutionsQuestions", Qe).addEdge(z, "initializeAgent").addEdge("initializeAgent", "askSolutionsQuestions").addEdge("askSolutionsQuestions",
|
|
136
|
+
}), Ke = () => new O(We).addNode("initializeAgent", Ye).addNode("askSolutionsQuestions", Qe).addEdge(z, "initializeAgent").addEdge("initializeAgent", "askSolutionsQuestions").addEdge("askSolutionsQuestions", v), ue = async (t, e, s, n) => {
|
|
137
137
|
if (!t) return;
|
|
138
|
-
const i =
|
|
138
|
+
const i = de(t);
|
|
139
139
|
if (!i) return;
|
|
140
140
|
const a = { context: {
|
|
141
141
|
kind: "DocAIAssistantRequest",
|
|
@@ -151,7 +151,7 @@ const Ve = (t) => new Promise((e) => setTimeout(e, t)), We = b.Root({
|
|
|
151
151
|
}, Qe = async (t, e) => {
|
|
152
152
|
const s = N(e), n = t.documentSkillUrl;
|
|
153
153
|
let i = [];
|
|
154
|
-
await
|
|
154
|
+
await w(
|
|
155
155
|
{ text: s.agentProgress.explorerAgentSearching },
|
|
156
156
|
e
|
|
157
157
|
);
|
|
@@ -181,25 +181,25 @@ const Ve = (t) => new Promise((e) => setTimeout(e, t)), We = b.Root({
|
|
|
181
181
|
ackSequenceNumber: o.sequenceNumber,
|
|
182
182
|
inquiryId: o.inquiryId
|
|
183
183
|
}, l = "";
|
|
184
|
-
const
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
187
|
-
const
|
|
188
|
-
l =
|
|
184
|
+
const u = async (m) => {
|
|
185
|
+
const f = m.context?.results?.[0]?.reply ?? "";
|
|
186
|
+
if (f !== "") {
|
|
187
|
+
const g = Je(f), A = Ge(g, e);
|
|
188
|
+
l = A.source, i = [
|
|
189
189
|
...i,
|
|
190
|
-
...
|
|
191
|
-
(
|
|
190
|
+
...A.allMatches.filter(
|
|
191
|
+
(T) => !i.some((k) => k.solution.id === T.solution.id)
|
|
192
192
|
)
|
|
193
193
|
];
|
|
194
194
|
}
|
|
195
|
-
const
|
|
196
|
-
if (
|
|
197
|
-
let
|
|
198
|
-
|
|
195
|
+
const d = m.context?.results?.[0]?.status?.currentStatusStep;
|
|
196
|
+
if (d) {
|
|
197
|
+
let g = "";
|
|
198
|
+
d === 1 ? g = s.agentProgress.explorerAgentReading : d === 2 ? g = s.agentProgress.explorerAgentReviewing : d === 3 && (g = s.agentProgress.explorerAgentPreparing), await w({ text: g }, e);
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
for (await
|
|
202
|
-
await
|
|
201
|
+
for (await u(o); a.hasMore; )
|
|
202
|
+
await He(500), o = await U(
|
|
203
203
|
{
|
|
204
204
|
conversationId: a.conversationId,
|
|
205
205
|
ackSequenceNumber: a.ackSequenceNumber,
|
|
@@ -213,13 +213,13 @@ const Ve = (t) => new Promise((e) => setTimeout(e, t)), We = b.Root({
|
|
|
213
213
|
hasMore: o.hasMore,
|
|
214
214
|
ackSequenceNumber: o.sequenceNumber,
|
|
215
215
|
inquiryId: o.inquiryId
|
|
216
|
-
}, await
|
|
217
|
-
return
|
|
216
|
+
}, await u(o);
|
|
217
|
+
return de(e?.configurable?.context.portal) && ue(
|
|
218
218
|
e?.configurable?.context.portal,
|
|
219
219
|
e?.configurable?.context.token ?? "",
|
|
220
220
|
e?.configurable?.context.configContext.locale ?? "en",
|
|
221
221
|
a.conversationId
|
|
222
|
-
), i.length && (i.length === 1 ?
|
|
222
|
+
), i.length && (i.length === 1 ? ce(i[0].solution.id) : le(i)), {
|
|
223
223
|
outputMessage: l,
|
|
224
224
|
summary: l,
|
|
225
225
|
status: "success",
|
|
@@ -228,12 +228,12 @@ const Ve = (t) => new Promise((e) => setTimeout(e, t)), We = b.Root({
|
|
|
228
228
|
};
|
|
229
229
|
}, Ye = async (t, e) => {
|
|
230
230
|
let s = null;
|
|
231
|
-
return t.documentSkillUrl === null && e?.configurable?.context?.portal && (s =
|
|
231
|
+
return t.documentSkillUrl === null && e?.configurable?.context?.portal && (s = Ve(e.configurable.context.portal)), {
|
|
232
232
|
documentSkillUrl: s
|
|
233
233
|
};
|
|
234
234
|
};
|
|
235
235
|
await y(je, "solutions_explorer_description");
|
|
236
|
-
const
|
|
236
|
+
const pe = (t) => {
|
|
237
237
|
if (t && Array.isArray(t.id) && t.id.length > 0)
|
|
238
238
|
return t.id[t.id.length - 1].replace("Message", "").toLowerCase();
|
|
239
239
|
if (t && typeof t._getType == "function")
|
|
@@ -243,8 +243,8 @@ const ue = (t) => {
|
|
|
243
243
|
return "human";
|
|
244
244
|
}
|
|
245
245
|
return "human";
|
|
246
|
-
},
|
|
247
|
-
const e =
|
|
246
|
+
}, Xe = (t) => {
|
|
247
|
+
const e = pe(t);
|
|
248
248
|
if (t && t.kwargs)
|
|
249
249
|
return {
|
|
250
250
|
role: e,
|
|
@@ -259,7 +259,7 @@ const ue = (t) => {
|
|
|
259
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;
|
|
260
260
|
}
|
|
261
261
|
return { role: "human", content: String(t) };
|
|
262
|
-
},
|
|
262
|
+
}, Ze = (t) => pe(t) === "human", et = (t, e = 3) => t.filter((s) => Ze(s)).slice(-e).map(Xe), 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 = {
|
|
263
263
|
builderMessages: st
|
|
264
264
|
}, it = /* @__PURE__ */ new Set([
|
|
265
265
|
"add",
|
|
@@ -314,6 +314,8 @@ const ue = (t) => {
|
|
|
314
314
|
"rownum",
|
|
315
315
|
"select",
|
|
316
316
|
"set",
|
|
317
|
+
"shape",
|
|
318
|
+
"subtype",
|
|
317
319
|
"table",
|
|
318
320
|
"top",
|
|
319
321
|
"truncate",
|
|
@@ -324,9 +326,9 @@ const ue = (t) => {
|
|
|
324
326
|
"view",
|
|
325
327
|
"where"
|
|
326
328
|
]);
|
|
327
|
-
class
|
|
329
|
+
class me {
|
|
328
330
|
constructor(e, s, n = !0) {
|
|
329
|
-
this.isValid = !0, this.issues = [], this.response = e, this.template = s, this.newDesign = n, this.validate();
|
|
331
|
+
this.isValid = !0, this.issues = [], this.fieldNameRegistry = null, this.response = e, this.template = s, this.newDesign = n, this.validate();
|
|
330
332
|
}
|
|
331
333
|
validate() {
|
|
332
334
|
this.compareModels(), this.validateResponse();
|
|
@@ -338,11 +340,11 @@ class pe {
|
|
|
338
340
|
const e = new Set(this.template.solution.strings.map((n) => n.key)), s = new Set(this.response.solution.strings.map((n) => n.key));
|
|
339
341
|
e.size === s.size && [...e].every((n) => s.has(n)) || this.logIssue("String keys in llm response do not match the template.");
|
|
340
342
|
for (const n of this.response.solution.strings)
|
|
341
|
-
n.value || this.logIssue(`String key '${n.key}' has no value.`);
|
|
343
|
+
n.value || this.logIssue(`String key '${n.key}' has no value in the design. It must be populated.`);
|
|
342
344
|
}
|
|
343
345
|
compareItems() {
|
|
344
346
|
const e = new Set(this.template.items.map((n) => n.id)), s = new Set(this.response.items.map((n) => n.id));
|
|
345
|
-
e.size === s.size && [...e].every((n) => s.has(n)) || this.logIssue("Item
|
|
347
|
+
e.size === s.size && [...e].every((n) => s.has(n)) || this.logIssue("Item IDs in design do not match the template.");
|
|
346
348
|
}
|
|
347
349
|
compareFeatureLayers() {
|
|
348
350
|
const e = this.template.featureLayer, s = this.response.featureLayer;
|
|
@@ -363,14 +365,20 @@ class pe {
|
|
|
363
365
|
}
|
|
364
366
|
}
|
|
365
367
|
validateResponse() {
|
|
366
|
-
const e =
|
|
368
|
+
const e = /* @__PURE__ */ new Set([
|
|
369
|
+
"Feature Layer (hosted)",
|
|
370
|
+
"Feature Layer (hosted, view)"
|
|
371
|
+
]);
|
|
372
|
+
for (const i of this.response.items)
|
|
373
|
+
e.has(i.type) && i.title.length > 100 && this.logIssue(`Service name '${i.title}' exceeds 100 characters.`);
|
|
374
|
+
const s = this.template.featureLayer.layers;
|
|
367
375
|
this.response.featureLayer.layers.length || this.logIssue("Feature layer item must contain at least one layer.");
|
|
368
|
-
const
|
|
369
|
-
|
|
370
|
-
for (const
|
|
371
|
-
this.validateLayer(
|
|
372
|
-
const
|
|
373
|
-
|
|
376
|
+
const n = this.response.featureLayer.layers.map((i) => i.name.toLowerCase());
|
|
377
|
+
n.length !== new Set(n).size && this.logIssue(`Layer names must be unique (case-insensitive). Layer names in design: ${n}.`);
|
|
378
|
+
for (const i of this.response.featureLayer.layers) {
|
|
379
|
+
this.validateLayer(i, this.response.featureLayer.addLayers);
|
|
380
|
+
const o = s.find((a) => a.id === i.id);
|
|
381
|
+
o && this.validateRequiredFields(i, o);
|
|
374
382
|
}
|
|
375
383
|
}
|
|
376
384
|
validateRequiredFields(e, s) {
|
|
@@ -378,7 +386,12 @@ class pe {
|
|
|
378
386
|
for (const i of s.requiredFields)
|
|
379
387
|
n.has(i.name) || this.logIssue(`Layer '${e.name}' is missing required field '${i.name}'.`);
|
|
380
388
|
}
|
|
381
|
-
validateLayer(e) {
|
|
389
|
+
validateLayer(e, s) {
|
|
390
|
+
!s && e.typeMutable === !0 && e.type === "Table" && this.logIssue(
|
|
391
|
+
`Layer '${e.name}' cannot be a Table. It may be a Point, Line, or Polygon.`
|
|
392
|
+
), this.validateLayerFields(e);
|
|
393
|
+
}
|
|
394
|
+
validateLayerFields(e) {
|
|
382
395
|
const s = /* @__PURE__ */ new Set([
|
|
383
396
|
"objectid",
|
|
384
397
|
"globalid",
|
|
@@ -386,26 +399,57 @@ class pe {
|
|
|
386
399
|
"created_user",
|
|
387
400
|
"last_edited_date",
|
|
388
401
|
"last_edited_user"
|
|
389
|
-
]), n = e.
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
402
|
+
]), n = e.customFields.map((c) => c.name), i = new Set(e.requiredFields.map((c) => c.name)), o = [...new Set(
|
|
403
|
+
n.filter((c) => s.has(c))
|
|
404
|
+
)];
|
|
405
|
+
for (const c of o)
|
|
406
|
+
this.logIssue(`Layer '${e.name}' field '${c}' collides with a reserved system field name.`);
|
|
407
|
+
const a = [...new Set(
|
|
408
|
+
n.filter((c) => i.has(c))
|
|
409
|
+
)];
|
|
410
|
+
for (const c of a)
|
|
411
|
+
this.logIssue(`Layer '${e.name}' field '${c}' collides with a required field name.`);
|
|
412
|
+
if (!o.length && !a.length) {
|
|
413
|
+
const c = e.systemFields ?? [], m = [
|
|
414
|
+
...e.customFields,
|
|
415
|
+
...e.requiredFields,
|
|
416
|
+
...c
|
|
417
|
+
].map((f) => f.name);
|
|
418
|
+
m.length !== new Set(m).size && this.logIssue(`Layer '${e.name}' has duplicate fields: ${JSON.stringify(m)}.`);
|
|
395
419
|
}
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
420
|
+
const l = e.systemFields ?? [], u = [...e.customFields, ...e.requiredFields, ...l].map((c) => c.name.toLowerCase());
|
|
421
|
+
this.fieldNameRegistry = new Set(u);
|
|
422
|
+
for (const c of [...e.customFields, ...e.requiredFields])
|
|
423
|
+
this.validateField(c);
|
|
424
|
+
this.fieldNameRegistry = null;
|
|
425
|
+
}
|
|
426
|
+
getUniqueTruncatedFieldName(e) {
|
|
427
|
+
const n = this.fieldNameRegistry;
|
|
428
|
+
if (!n)
|
|
429
|
+
return e.slice(0, 31);
|
|
430
|
+
const i = e.toLowerCase();
|
|
431
|
+
n.delete(i);
|
|
432
|
+
const o = e.slice(0, 31);
|
|
433
|
+
let a = o, l = 1;
|
|
434
|
+
for (; n.has(a.toLowerCase()); ) {
|
|
435
|
+
const u = `_${l}`, c = Math.max(1, 31 - u.length);
|
|
436
|
+
a = `${o.slice(0, c)}${u}`, l += 1;
|
|
437
|
+
}
|
|
438
|
+
return n.add(a.toLowerCase()), a;
|
|
404
439
|
}
|
|
405
440
|
validateField(e) {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
441
|
+
const s = /^\p{L}/u, n = /^.[\p{L}\p{M}\p{N}_]*$/u;
|
|
442
|
+
if (e.alias || this.logIssue(`Field '${e.name}' has no display name (alias).`), s.test(e.name) || this.logIssue(`Field '${e.name}' does not start with a letter.`), n.test(e.name) || this.logIssue(
|
|
443
|
+
`Field '${e.name}' contains invalid characters (only letters from any writing system, numbers, and underscores are allowed; emojis and punctuation are not allowed).`
|
|
444
|
+
), e.name.length > 31)
|
|
445
|
+
if (this.newDesign) {
|
|
446
|
+
const i = e.name;
|
|
447
|
+
e.name = this.getUniqueTruncatedFieldName(e.name), console.debug(`Field '${i}' exceeds 31 characters. Auto-fixing to '${e.name}'.`);
|
|
448
|
+
} else
|
|
449
|
+
this.logIssue(`Field '${e.name}' exceeds 31 characters.`);
|
|
450
|
+
if (it.has(e.name.toLowerCase()) && this.logIssue(`Field '${e.name}' is a SQL reserved keyword.`), e.choiceList && (e.type !== "string" && this.logIssue(`Field '${e.name}' must be of type 'string' to have a domain.`), e.choiceList.some((i) => !i) && this.logIssue(`Field '${e.name}' has empty domain values.`), e.choiceList.length !== new Set(e.choiceList).size && this.logIssue(`Field '${e.name}' has duplicate domain values.`), e.length != null)) {
|
|
451
|
+
const i = Math.max(...e.choiceList.map((o) => o.length));
|
|
452
|
+
i > e.length && (this.newDesign ? (console.debug(`Field '${e.name}' length ${e.length} is insufficient for choiceList value of length ${i}. Auto-fixing to ${i}.`), e.length = i) : this.logIssue(`Field '${e.name}' length ${e.length} is insufficient for choiceList value of length ${i}.`));
|
|
409
453
|
}
|
|
410
454
|
}
|
|
411
455
|
logIssue(e) {
|
|
@@ -480,30 +524,66 @@ const ot = r.object({
|
|
|
480
524
|
response: r.string().describe("Conversational response describing the accepted design changes."),
|
|
481
525
|
patches: r.array(ct).describe("Minimal RFC 6902 patch operations needed to update the current design.")
|
|
482
526
|
}), ut = r.object({
|
|
483
|
-
|
|
527
|
+
response: r.string().describe("Short, user-friendly explanation of why the requested update was not applied.")
|
|
484
528
|
}), pt = r.object({
|
|
529
|
+
assistantResponse: r.string().describe("Natural-language response for the user."),
|
|
530
|
+
isValidUpdate: r.boolean().describe("True only when the request is in scope for supported design updates.")
|
|
531
|
+
}), mt = r.object({
|
|
532
|
+
matchedTitles: r.array(r.string()).describe("Titles of solutions that match the user's request. Empty array if no strong match.")
|
|
533
|
+
}), gt = r.object({
|
|
485
534
|
templateId: r.string().min(1).describe("Template id from the available template list."),
|
|
486
535
|
confidence: r.number().min(0).max(1).describe("Confidence score from 0 to 1 for this template match."),
|
|
487
|
-
templateDescription: r.string().min(1).describe("Short description
|
|
488
|
-
}),
|
|
489
|
-
assistantResponse: r.string().describe("Natural-language response for the user."),
|
|
536
|
+
templateDescription: r.string().min(1).describe("Short action‑oriented description of the template in the user's use case/workflow, starting with a verb.")
|
|
537
|
+
}), ht = r.object({
|
|
538
|
+
assistantResponse: r.string().nullable().describe("Natural-language response for the user."),
|
|
490
539
|
isValidUseCase: r.boolean().describe("True only when the request is concrete, appropriate, and has at least one matching template."),
|
|
491
|
-
matchedTemplates: r.array(
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
540
|
+
matchedTemplates: r.array(gt).describe("Ordered list of matching templates, best match first. Empty when no valid match exists."),
|
|
541
|
+
rationale: r.string().min(1).describe("A brief rationale for the choice for isValidUseCase and matchedTemplates (≤140 characters)")
|
|
542
|
+
}), ft = (t) => t.length ? t.map((e, s) => `${s + 1}. ${e}`).join(`
|
|
543
|
+
`) : "No validation errors were provided.", bt = async (t) => {
|
|
544
|
+
const {
|
|
545
|
+
query: e,
|
|
546
|
+
validationIssues: s,
|
|
547
|
+
recentMessages: n,
|
|
548
|
+
fallbackMessage: i,
|
|
549
|
+
promptModules: o
|
|
550
|
+
} = t;
|
|
551
|
+
try {
|
|
552
|
+
return (await _({
|
|
553
|
+
promptText: await y(o, "explainValidationFailure"),
|
|
554
|
+
modelTier: "fast",
|
|
555
|
+
temperature: 0,
|
|
556
|
+
schema: ut,
|
|
557
|
+
messages: n,
|
|
558
|
+
inputVariables: {
|
|
559
|
+
query: e,
|
|
560
|
+
validationIssueCount: String(s.length),
|
|
561
|
+
validationIssues: ft(s)
|
|
562
|
+
}
|
|
563
|
+
})).response?.trim() || i;
|
|
564
|
+
} catch (a) {
|
|
565
|
+
return console.warn(
|
|
566
|
+
"Natural language response failed:",
|
|
567
|
+
{ error: a }
|
|
568
|
+
), i;
|
|
569
|
+
}
|
|
570
|
+
}, V = (t) => t in L, yt = 5, xt = 0.8, vt = 0.15, wt = "Web Mapping Application", St = "Embeddings";
|
|
571
|
+
let F = null, P = null, $ = null, M = null;
|
|
572
|
+
const It = "Build", I = /* @__PURE__ */ Object.assign({
|
|
573
|
+
"./prompts/assessBuildRequest.md": () => import("../../chunks/assessBuildRequest.js").then((t) => t.default),
|
|
574
|
+
"./prompts/assessUpdateRequest.md": () => import("../../chunks/assessUpdateRequest.js").then((t) => t.default),
|
|
495
575
|
"./prompts/description.md": () => import("../../chunks/description2.js").then((t) => t.default),
|
|
496
576
|
"./prompts/designSolution.md": () => import("../../chunks/designSolution.js").then((t) => t.default),
|
|
577
|
+
"./prompts/explainValidationFailure.md": () => import("../../chunks/explainValidationFailure.js").then((t) => t.default),
|
|
497
578
|
"./prompts/findExistingSolution.md": () => import("../../chunks/findExistingSolution.js").then((t) => t.default),
|
|
498
|
-
"./prompts/initialAssessment.md": () => import("../../chunks/initialAssessment.js").then((t) => t.default),
|
|
499
579
|
"./prompts/updateDesign.md": () => import("../../chunks/updateDesign.js").then((t) => t.default)
|
|
500
|
-
}),
|
|
580
|
+
}), Ct = nt.builderMessages, h = (t, e, s) => N(e)?.builderMessages?.[t] ?? Ct[t], ge = (t) => {
|
|
501
581
|
typeof window < "u" && window.dispatchEvent(new CustomEvent("arcgis-solution-design-update", {
|
|
502
582
|
detail: t
|
|
503
583
|
}));
|
|
504
|
-
},
|
|
584
|
+
}, _t = async (t, e, s) => {
|
|
505
585
|
if (!t) return null;
|
|
506
|
-
const n = `type:"${
|
|
586
|
+
const n = `type:"${wt}" AND typekeywords:${St} AND group:${t}`;
|
|
507
587
|
return (await J.searchItems({
|
|
508
588
|
q: n,
|
|
509
589
|
params: e ? { token: e } : void 0,
|
|
@@ -511,9 +591,9 @@ const xt = "Build", L = /* @__PURE__ */ Object.assign({
|
|
|
511
591
|
num: 1
|
|
512
592
|
}))?.results?.[0] ?? null;
|
|
513
593
|
};
|
|
514
|
-
async function
|
|
594
|
+
async function Tt(t, e, s) {
|
|
515
595
|
try {
|
|
516
|
-
const n = await
|
|
596
|
+
const n = await _t(t, e, s);
|
|
517
597
|
if (!n) return null;
|
|
518
598
|
const i = new Oe({ id: n.id });
|
|
519
599
|
return await i.load(), await i.fetchData("json");
|
|
@@ -521,16 +601,16 @@ async function St(t, e, s) {
|
|
|
521
601
|
return null;
|
|
522
602
|
}
|
|
523
603
|
}
|
|
524
|
-
const
|
|
604
|
+
const kt = async (t, e, s) => {
|
|
525
605
|
if (!t) return [];
|
|
526
|
-
const n = `type:Solution AND typekeywords:${
|
|
606
|
+
const n = `type:Solution AND typekeywords:${It} AND group:${t}`;
|
|
527
607
|
return (await J.searchItems({
|
|
528
608
|
q: n,
|
|
529
609
|
params: e ? { token: e } : void 0,
|
|
530
610
|
portal: s,
|
|
531
611
|
num: 100
|
|
532
612
|
}))?.results ?? [];
|
|
533
|
-
},
|
|
613
|
+
}, Et = async (t, e, s) => {
|
|
534
614
|
try {
|
|
535
615
|
const n = await J.getItemData(t, {
|
|
536
616
|
params: e ? { token: e } : void 0,
|
|
@@ -542,7 +622,7 @@ const It = async (t, e, s) => {
|
|
|
542
622
|
} catch {
|
|
543
623
|
return null;
|
|
544
624
|
}
|
|
545
|
-
},
|
|
625
|
+
}, C = (t, e = {}) => {
|
|
546
626
|
let s = t;
|
|
547
627
|
return "itemId" in e && (s = {
|
|
548
628
|
...s,
|
|
@@ -560,7 +640,7 @@ const It = async (t, e, s) => {
|
|
|
560
640
|
...s,
|
|
561
641
|
templateId: e.templateId ?? null
|
|
562
642
|
}), s;
|
|
563
|
-
},
|
|
643
|
+
}, he = (t, e) => {
|
|
564
644
|
if (t == null || e == null)
|
|
565
645
|
return { ok: !1, error: "design or sourceBuildSolution is null/undefined" };
|
|
566
646
|
try {
|
|
@@ -572,106 +652,106 @@ const It = async (t, e, s) => {
|
|
|
572
652
|
error: s instanceof Error ? s.stack ?? s.message : String(s)
|
|
573
653
|
};
|
|
574
654
|
}
|
|
575
|
-
},
|
|
576
|
-
if (
|
|
577
|
-
Object.entries(
|
|
578
|
-
|
|
655
|
+
}, H = async (t) => {
|
|
656
|
+
if (P) {
|
|
657
|
+
Object.entries(P).forEach(([a, l]) => {
|
|
658
|
+
L[a] && (L[a].initialTemplate = l);
|
|
579
659
|
});
|
|
580
660
|
return;
|
|
581
661
|
}
|
|
582
|
-
const e = t?.configurable?.context?.token, s =
|
|
662
|
+
const e = t?.configurable?.context?.token, s = be(t), n = ye(t);
|
|
583
663
|
if (!s) {
|
|
584
664
|
console.warn("Solution Builder: missing primarySolutionsGroupId in appConfig; skipping live template hydration.");
|
|
585
665
|
return;
|
|
586
666
|
}
|
|
587
|
-
const i = await
|
|
667
|
+
const i = await kt(s, e, n), o = {};
|
|
588
668
|
await Promise.all(i.map(async (a) => {
|
|
589
669
|
const l = a.properties?.templateInfo;
|
|
590
670
|
if (!l || typeof l != "object") return;
|
|
591
|
-
const
|
|
592
|
-
if (typeof
|
|
593
|
-
const
|
|
594
|
-
if (!
|
|
595
|
-
const { buildSolution:
|
|
596
|
-
if (typeof
|
|
597
|
-
const
|
|
598
|
-
|
|
671
|
+
const u = l.id;
|
|
672
|
+
if (typeof u != "string" || o[u]) return;
|
|
673
|
+
const c = await Et(a.id, e, n);
|
|
674
|
+
if (!c) return;
|
|
675
|
+
const { buildSolution: m, params: f } = c;
|
|
676
|
+
if (typeof m == "object" && m !== null && "solution" in m) {
|
|
677
|
+
const g = m.solution;
|
|
678
|
+
g.thumbnailUrl = a.thumbnail ? `${n ?? "https://www.arcgis.com/sharing/rest"}/content/items/${a.id}/info/${a.thumbnail}` : void 0, g.item = a;
|
|
599
679
|
}
|
|
600
|
-
const
|
|
680
|
+
const d = {
|
|
601
681
|
...l,
|
|
602
|
-
buildSolution:
|
|
682
|
+
buildSolution: m
|
|
603
683
|
};
|
|
604
|
-
o[
|
|
605
|
-
new ie(
|
|
684
|
+
o[u] = C(
|
|
685
|
+
new ie(d).dumpToLlmTemplate(),
|
|
606
686
|
{
|
|
607
687
|
itemId: a.id,
|
|
608
|
-
sourceBuildSolution: structuredClone(
|
|
609
|
-
params:
|
|
688
|
+
sourceBuildSolution: structuredClone(m),
|
|
689
|
+
params: f ? structuredClone(f) : null
|
|
610
690
|
}
|
|
611
|
-
),
|
|
691
|
+
), L[u] = {
|
|
612
692
|
...l,
|
|
613
|
-
initialTemplate: o[
|
|
693
|
+
initialTemplate: o[u]
|
|
614
694
|
};
|
|
615
|
-
})),
|
|
616
|
-
},
|
|
695
|
+
})), P = o;
|
|
696
|
+
}, fe = (t) => {
|
|
617
697
|
const e = t?.configurable?.context?.token;
|
|
618
698
|
return typeof e != "string" || !e.trim() ? null : e;
|
|
619
|
-
},
|
|
699
|
+
}, be = (t) => {
|
|
620
700
|
const e = t?.configurable?.context?.configContext?.primarySolutionsGroupId;
|
|
621
701
|
return typeof e != "string" || !e.trim() ? null : e;
|
|
622
|
-
},
|
|
702
|
+
}, ye = (t) => {
|
|
623
703
|
const e = t?.configurable?.context?.configContext?.portalURL;
|
|
624
704
|
if (!(typeof e != "string" || !e.trim()))
|
|
625
705
|
return `${e.replace(/\/+$/, "")}/sharing/rest`;
|
|
626
|
-
},
|
|
706
|
+
}, At = async (t) => {
|
|
627
707
|
await Promise.all([
|
|
628
|
-
|
|
629
|
-
|
|
708
|
+
ve(t),
|
|
709
|
+
H(t)
|
|
630
710
|
]);
|
|
631
|
-
},
|
|
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;
|
|
635
|
-
})), await M;
|
|
636
|
-
};
|
|
637
|
-
async function xe(t) {
|
|
638
|
-
if ($) return $;
|
|
711
|
+
}, xe = async (t) => {
|
|
639
712
|
const e = fe(t);
|
|
713
|
+
(!$ || e && e !== M) && (M = e ?? M, $ = At(t).catch((n) => {
|
|
714
|
+
throw $ = null, M = null, n;
|
|
715
|
+
})), await $;
|
|
716
|
+
};
|
|
717
|
+
async function ve(t) {
|
|
718
|
+
if (F) return F;
|
|
719
|
+
const e = be(t);
|
|
640
720
|
if (!e)
|
|
641
721
|
return console.warn("Solution Builder: missing primarySolutionsGroupId in appConfig; skipping embeddings load."), null;
|
|
642
|
-
const s =
|
|
722
|
+
const s = ye(t), n = t?.configurable?.context?.configContext?.portalURL;
|
|
643
723
|
await new Ue(n ? { url: n } : void 0).load();
|
|
644
|
-
const o =
|
|
645
|
-
return a ? (
|
|
724
|
+
const o = fe(t) ?? void 0, a = await Tt(e, o, s);
|
|
725
|
+
return a ? (F = a.items, F) : null;
|
|
646
726
|
}
|
|
647
|
-
const
|
|
727
|
+
const Lt = () => Object.entries(L).map(([t, e]) => `ID: ${t}
|
|
648
728
|
Label: ${e.label}
|
|
649
729
|
Description: ${e.description}`).join(`
|
|
650
730
|
|
|
651
|
-
`),
|
|
731
|
+
`), Rt = (t) => {
|
|
652
732
|
const e = t?.configurable?.context?.solutionDesignJson;
|
|
653
733
|
if (typeof e != "string" || !e.trim())
|
|
654
734
|
return null;
|
|
655
735
|
try {
|
|
656
|
-
const s = JSON.parse(e), n =
|
|
736
|
+
const s = JSON.parse(e), n = C(
|
|
657
737
|
{ response: "", ...s },
|
|
658
738
|
{ itemId: s?.solution?.itemId ?? null }
|
|
659
739
|
), i = G.safeParse(n);
|
|
660
740
|
if (!i.success)
|
|
661
741
|
return null;
|
|
662
|
-
const { response: o, ...a } = i.data, l = s.templateId,
|
|
663
|
-
return
|
|
742
|
+
const { response: o, ...a } = i.data, l = s.templateId, u = typeof l == "string" && V(l) ? l : null;
|
|
743
|
+
return C(
|
|
664
744
|
a,
|
|
665
745
|
{
|
|
666
746
|
sourceBuildSolution: s.sourceBuildSolution,
|
|
667
|
-
templateId:
|
|
747
|
+
templateId: u,
|
|
668
748
|
params: s.params ?? null
|
|
669
749
|
}
|
|
670
750
|
);
|
|
671
751
|
} catch {
|
|
672
752
|
return null;
|
|
673
753
|
}
|
|
674
|
-
},
|
|
754
|
+
}, Dt = b.Root({
|
|
675
755
|
...j(),
|
|
676
756
|
/** Optional human-readable template description retained for UI use. */
|
|
677
757
|
templateDescription: b({
|
|
@@ -693,6 +773,11 @@ Description: ${e.description}`).join(`
|
|
|
693
773
|
reducer: (t = null, e) => e === void 0 ? t : e ?? null,
|
|
694
774
|
default: () => null
|
|
695
775
|
}),
|
|
776
|
+
/** Update request assessment produced when an active design exists. */
|
|
777
|
+
updateAssessment: b({
|
|
778
|
+
reducer: (t = null, e) => e === void 0 ? t : e ?? null,
|
|
779
|
+
default: () => null
|
|
780
|
+
}),
|
|
696
781
|
/** Existing solution matches surfaced before building a new solution. */
|
|
697
782
|
existingMatches: b({
|
|
698
783
|
reducer: (t = [], e) => e === void 0 ? t : e ?? [],
|
|
@@ -703,199 +788,242 @@ Description: ${e.description}`).join(`
|
|
|
703
788
|
reducer: (t = null, e) => e === void 0 ? t : e ?? null,
|
|
704
789
|
default: () => null
|
|
705
790
|
})
|
|
706
|
-
}),
|
|
707
|
-
const s =
|
|
791
|
+
}), Ft = (t, e) => {
|
|
792
|
+
const s = Rt(e), n = s?.templateId ?? null, i = {};
|
|
708
793
|
return JSON.stringify(t.currentDesign) !== JSON.stringify(s) && (i.currentDesign = s), n && t.selectedTemplate !== n && (i.selectedTemplate = n), i;
|
|
709
|
-
},
|
|
710
|
-
await
|
|
711
|
-
const s = t.agentExecutionContext.userRequest, n =
|
|
712
|
-
promptText: await y(
|
|
794
|
+
}, $t = async (t, e) => {
|
|
795
|
+
await w({ text: h("understandingRequest", e) }, e), await xe(e);
|
|
796
|
+
const s = t.agentExecutionContext.userRequest, n = Lt(), i = t.agentExecutionContext.messages.slice(-11), o = await _({
|
|
797
|
+
promptText: await y(I, "assessBuildRequest"),
|
|
713
798
|
modelTier: "advanced",
|
|
714
799
|
temperature: 0,
|
|
715
|
-
schema:
|
|
800
|
+
schema: ht,
|
|
716
801
|
messages: i,
|
|
717
802
|
inputVariables: { query: s, availableTemplates: n }
|
|
718
803
|
}), a = o.matchedTemplates.filter(
|
|
719
|
-
(
|
|
804
|
+
(d) => V(d.templateId)
|
|
720
805
|
), l = {
|
|
721
806
|
...o,
|
|
722
807
|
matchedTemplates: a
|
|
723
|
-
}, [
|
|
808
|
+
}, [u, c] = a, f = !!u && u.confidence >= xt && (c === void 0 || u.confidence - c.confidence >= vt) ? u.templateId : null;
|
|
724
809
|
return {
|
|
725
810
|
assessment: l,
|
|
726
|
-
selectedTemplate:
|
|
811
|
+
selectedTemplate: f,
|
|
727
812
|
existingMatches: [],
|
|
728
813
|
continueBuilding: null
|
|
729
814
|
};
|
|
730
|
-
},
|
|
815
|
+
}, Mt = (t) => {
|
|
731
816
|
const e = t.assessment?.assistantResponse ?? "";
|
|
732
817
|
return {
|
|
733
818
|
outputMessage: e,
|
|
734
819
|
summary: e,
|
|
735
820
|
status: "success"
|
|
736
821
|
};
|
|
737
|
-
},
|
|
822
|
+
}, Bt = async (t, e) => {
|
|
823
|
+
const { currentDesign: s } = t;
|
|
824
|
+
if (!s)
|
|
825
|
+
return {
|
|
826
|
+
updateAssessment: {
|
|
827
|
+
assistantResponse: "",
|
|
828
|
+
isValidUpdate: !0
|
|
829
|
+
}
|
|
830
|
+
};
|
|
831
|
+
await w({ text: h("understandingRequest", e) }, e);
|
|
832
|
+
const n = t.agentExecutionContext.userRequest, i = t.agentExecutionContext.messages.slice(-11);
|
|
833
|
+
return {
|
|
834
|
+
updateAssessment: await _({
|
|
835
|
+
promptText: await y(I, "assessUpdateRequest"),
|
|
836
|
+
modelTier: "advanced",
|
|
837
|
+
temperature: 0,
|
|
838
|
+
schema: pt,
|
|
839
|
+
messages: i,
|
|
840
|
+
inputVariables: {
|
|
841
|
+
currentDesign: JSON.stringify(oe(s)),
|
|
842
|
+
query: n
|
|
843
|
+
}
|
|
844
|
+
})
|
|
845
|
+
};
|
|
846
|
+
}, Nt = (t, e) => {
|
|
847
|
+
const s = t.updateAssessment?.assistantResponse ?? h("applyChangeFailed", e);
|
|
848
|
+
return {
|
|
849
|
+
outputMessage: s,
|
|
850
|
+
summary: s,
|
|
851
|
+
status: "success"
|
|
852
|
+
};
|
|
853
|
+
}, qt = (t, e) => {
|
|
738
854
|
const { hitlResponse: s } = e.configurable, n = "selectTemplate", i = t.assessment?.matchedTemplates.filter(
|
|
739
|
-
(
|
|
740
|
-
) ?? [], o = i.map((
|
|
855
|
+
(c) => V(c.templateId)
|
|
856
|
+
) ?? [], o = i.map((c) => `${c.templateDescription}`);
|
|
741
857
|
if (s?.agentId !== "solutionBuilder" || s.id !== n) {
|
|
742
|
-
const
|
|
858
|
+
const c = {
|
|
743
859
|
agentId: "solutionBuilder",
|
|
744
860
|
id: n,
|
|
745
861
|
kind: "singleSelection",
|
|
746
|
-
message:
|
|
862
|
+
message: h("selectTemplatePrompt", e),
|
|
747
863
|
metadata: [...o]
|
|
748
864
|
};
|
|
749
|
-
throw new ne(
|
|
865
|
+
throw new ne(c);
|
|
750
866
|
}
|
|
751
|
-
const a = String(s.payload ?? ""), l = o.findIndex((
|
|
867
|
+
const a = String(s.payload ?? ""), l = o.findIndex((c) => c === a);
|
|
752
868
|
return {
|
|
753
869
|
selectedTemplate: (l >= 0 ? i[l] : void 0)?.templateId ?? i[0]?.templateId ?? null
|
|
754
870
|
};
|
|
755
|
-
},
|
|
756
|
-
await
|
|
757
|
-
const s = t.agentExecutionContext.userRequest, n = tt(t.agentExecutionContext.messages) || s, i = await
|
|
871
|
+
}, Pt = async (t, e) => {
|
|
872
|
+
await w({ text: h("searchingExistingSolutions", e) }, e);
|
|
873
|
+
const s = t.agentExecutionContext.userRequest, n = tt(t.agentExecutionContext.messages) || s, i = await ve(e);
|
|
758
874
|
if (!i)
|
|
759
875
|
return console.warn("Solutions Search: failed to load solution embeddings cache; skipping search."), { existingMatches: [] };
|
|
760
876
|
if (!i.length)
|
|
761
877
|
return { existingMatches: [] };
|
|
762
|
-
const [o] = await Be([n]), a = i.map((
|
|
763
|
-
solution:
|
|
764
|
-
score:
|
|
878
|
+
const [o] = await Be([n]), a = i.map((d) => ({
|
|
879
|
+
solution: d,
|
|
880
|
+
score: Ne(o, d.embedding)
|
|
765
881
|
}));
|
|
766
|
-
a.sort((
|
|
767
|
-
const l = a.slice(0,
|
|
882
|
+
a.sort((d, g) => g.score - d.score);
|
|
883
|
+
const l = a.slice(0, yt);
|
|
768
884
|
if (!l.length)
|
|
769
885
|
return { existingMatches: [] };
|
|
770
|
-
const
|
|
771
|
-
Snippet: ${
|
|
772
|
-
Description: ${
|
|
886
|
+
const u = l.map(({ solution: d }) => `${d.title}
|
|
887
|
+
Snippet: ${d.snippet}
|
|
888
|
+
Description: ${d.description}`).join(`
|
|
773
889
|
|
|
774
|
-
`),
|
|
775
|
-
return { existingMatches: (await
|
|
776
|
-
promptText: await y(
|
|
890
|
+
`), c = t.agentExecutionContext.messages.slice(-11);
|
|
891
|
+
return { existingMatches: (await _({
|
|
892
|
+
promptText: await y(I, "findExistingSolution"),
|
|
777
893
|
modelTier: "fast",
|
|
778
894
|
temperature: 0,
|
|
779
|
-
schema:
|
|
780
|
-
messages:
|
|
781
|
-
inputVariables: { query: s, candidates:
|
|
782
|
-
})).matchedTitles.map((
|
|
783
|
-
},
|
|
895
|
+
schema: mt,
|
|
896
|
+
messages: c,
|
|
897
|
+
inputVariables: { query: s, candidates: u }
|
|
898
|
+
})).matchedTitles.map((d) => l.find(({ solution: g }) => g.title === d)).filter((d) => d !== void 0) };
|
|
899
|
+
}, Ut = (t, e) => {
|
|
784
900
|
const { existingMatches: s } = t, { hitlResponse: n } = e.configurable, i = `confirmExistingSolution:${s[0].solution.id}`;
|
|
785
901
|
if (n?.agentId !== "solutionBuilder" || n.id !== i) {
|
|
786
|
-
s.length === 1 ?
|
|
787
|
-
const
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
],
|
|
902
|
+
s.length === 1 ? ce(s[0].solution.id) : le(s);
|
|
903
|
+
const u = h("existingSolutionMatch", e), c = [
|
|
904
|
+
h("continueBuildingYes", e),
|
|
905
|
+
h("continueBuildingNo", e)
|
|
906
|
+
], m = {
|
|
791
907
|
agentId: "solutionBuilder",
|
|
792
908
|
id: i,
|
|
793
909
|
kind: "singleSelection",
|
|
794
|
-
message:
|
|
795
|
-
metadata:
|
|
910
|
+
message: u,
|
|
911
|
+
metadata: c
|
|
796
912
|
};
|
|
797
|
-
throw new ne(
|
|
913
|
+
throw new ne(m);
|
|
798
914
|
}
|
|
799
|
-
const o = String(n.payload ?? "").trim(), a =
|
|
915
|
+
const o = String(n.payload ?? "").trim(), a = h("continueBuildingNo", e);
|
|
800
916
|
return { continueBuilding: o !== a };
|
|
801
|
-
},
|
|
802
|
-
const s =
|
|
917
|
+
}, Ot = (t, e) => {
|
|
918
|
+
const s = h("continueBuildingDeclined", e);
|
|
803
919
|
return {
|
|
804
920
|
outputMessage: s,
|
|
805
921
|
summary: s,
|
|
806
922
|
status: "success"
|
|
807
923
|
};
|
|
808
|
-
},
|
|
809
|
-
await
|
|
924
|
+
}, we = async (t, e) => {
|
|
925
|
+
await xe(e);
|
|
810
926
|
const { currentDesign: s } = t, n = t.agentExecutionContext.userRequest;
|
|
811
|
-
await
|
|
812
|
-
let i =
|
|
813
|
-
if (i?.initialTemplate || (await
|
|
927
|
+
await w({ text: h("creatingDesign", e) }, e);
|
|
928
|
+
let i = B(t.selectedTemplate);
|
|
929
|
+
if (i?.initialTemplate || (await H(e), i = B(t.selectedTemplate)), !i?.initialTemplate)
|
|
814
930
|
throw new Error("No hydrated templates are available for solution design.");
|
|
815
|
-
const o =
|
|
931
|
+
const o = C(
|
|
816
932
|
s ?? i.initialTemplate,
|
|
817
933
|
{
|
|
818
934
|
itemId: (s ?? i.initialTemplate)?.solution?.itemId ?? null,
|
|
819
935
|
sourceBuildSolution: s?.sourceBuildSolution ?? i.initialTemplate.sourceBuildSolution,
|
|
820
936
|
params: s?.params ?? i.initialTemplate.params ?? null
|
|
821
937
|
}
|
|
822
|
-
), a = t.agentExecutionContext.messages.slice(-11), l = await
|
|
823
|
-
promptText: await y(
|
|
938
|
+
), a = t.agentExecutionContext.messages.slice(-11), l = await _({
|
|
939
|
+
promptText: await y(I, "designSolution"),
|
|
824
940
|
modelTier: "advanced",
|
|
825
941
|
temperature: 0,
|
|
826
942
|
schema: G,
|
|
827
943
|
messages: a,
|
|
828
944
|
inputVariables: {
|
|
829
|
-
currentDesign: JSON.stringify(
|
|
945
|
+
currentDesign: JSON.stringify(ae(o)),
|
|
830
946
|
templateInstructions: i.instructions,
|
|
831
947
|
query: n
|
|
832
948
|
}
|
|
833
|
-
}), { response:
|
|
834
|
-
|
|
949
|
+
}), { response: u, featureLayer: c, ...m } = l, f = re(
|
|
950
|
+
c,
|
|
835
951
|
o.featureLayer
|
|
836
|
-
),
|
|
837
|
-
{ ...
|
|
952
|
+
), d = C(
|
|
953
|
+
{ ...m, featureLayer: f },
|
|
838
954
|
{
|
|
839
955
|
itemId: o?.solution?.itemId,
|
|
840
956
|
sourceBuildSolution: o.sourceBuildSolution,
|
|
841
957
|
templateId: t.selectedTemplate ?? null,
|
|
842
958
|
params: o.params ?? null
|
|
843
959
|
}
|
|
844
|
-
),
|
|
845
|
-
if (!
|
|
960
|
+
), g = new me(d, i.initialTemplate);
|
|
961
|
+
if (!g.isValid)
|
|
846
962
|
return console.warn(
|
|
847
963
|
"[SolutionBuilder] designSolution validation failed:",
|
|
848
|
-
{ issues:
|
|
964
|
+
{ issues: g.issues, llmResponse: l }
|
|
849
965
|
), {
|
|
850
|
-
outputMessage:
|
|
966
|
+
outputMessage: h("createDesignFailed", e)
|
|
851
967
|
};
|
|
852
|
-
const
|
|
853
|
-
if (!
|
|
968
|
+
const A = d.sourceBuildSolution, T = he(d, A);
|
|
969
|
+
if (!T.ok) {
|
|
854
970
|
console.warn(
|
|
855
971
|
"[SolutionBuilder] designSolution Esri JSON conversion failed:",
|
|
856
|
-
{ error:
|
|
972
|
+
{ error: T.error, llmResponse: l, design: d }
|
|
857
973
|
);
|
|
858
|
-
const
|
|
974
|
+
const k = h("createDesignFailed", e);
|
|
859
975
|
return {
|
|
860
|
-
outputMessage:
|
|
861
|
-
summary:
|
|
976
|
+
outputMessage: k,
|
|
977
|
+
summary: k,
|
|
862
978
|
status: "success"
|
|
863
979
|
};
|
|
864
980
|
}
|
|
865
|
-
return
|
|
866
|
-
outputMessage:
|
|
867
|
-
summary:
|
|
981
|
+
return ge(d), {
|
|
982
|
+
outputMessage: u,
|
|
983
|
+
summary: u,
|
|
868
984
|
status: "success",
|
|
869
|
-
currentDesign:
|
|
985
|
+
currentDesign: d
|
|
870
986
|
};
|
|
871
|
-
},
|
|
987
|
+
}, zt = async (t, e) => {
|
|
872
988
|
const { currentDesign: s } = t;
|
|
873
989
|
if (!s)
|
|
874
|
-
return
|
|
990
|
+
return we(t, e);
|
|
875
991
|
const n = t.agentExecutionContext.userRequest, i = t.agentExecutionContext.messages.slice(-11);
|
|
876
|
-
await
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
992
|
+
await w({ text: h("updatingDesign", e) }, e);
|
|
993
|
+
let o;
|
|
994
|
+
try {
|
|
995
|
+
o = await _({
|
|
996
|
+
promptText: await y(I, "updateDesign"),
|
|
997
|
+
modelTier: "advanced",
|
|
998
|
+
temperature: 0,
|
|
999
|
+
schema: dt,
|
|
1000
|
+
messages: i,
|
|
1001
|
+
inputVariables: {
|
|
1002
|
+
currentDesign: JSON.stringify(oe(s)),
|
|
1003
|
+
query: n
|
|
1004
|
+
}
|
|
1005
|
+
});
|
|
1006
|
+
} catch (p) {
|
|
1007
|
+
console.warn("[SolutionBuilder] updateDesign structured prompt failed:", p);
|
|
1008
|
+
const x = h("applyChangeFailed", e);
|
|
1009
|
+
return {
|
|
1010
|
+
outputMessage: x,
|
|
1011
|
+
summary: x,
|
|
1012
|
+
status: "success"
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
const { response: a, patches: l } = o;
|
|
888
1016
|
if (!l || l.length === 0)
|
|
889
1017
|
return {
|
|
890
1018
|
outputMessage: a,
|
|
891
1019
|
summary: a,
|
|
892
1020
|
status: "success"
|
|
893
1021
|
};
|
|
894
|
-
const
|
|
1022
|
+
const u = (p) => {
|
|
895
1023
|
try {
|
|
896
1024
|
return JSON.parse(p);
|
|
897
1025
|
} catch {
|
|
898
|
-
const
|
|
1026
|
+
const x = p.replace(/[\u0000-\u001F]/g, (Y) => {
|
|
899
1027
|
switch (Y) {
|
|
900
1028
|
case "\b":
|
|
901
1029
|
return "\\b";
|
|
@@ -913,54 +1041,54 @@ Description: ${c.description}`).join(`
|
|
|
913
1041
|
}
|
|
914
1042
|
});
|
|
915
1043
|
try {
|
|
916
|
-
return JSON.parse(
|
|
1044
|
+
return JSON.parse(x);
|
|
917
1045
|
} catch {
|
|
918
1046
|
return p;
|
|
919
1047
|
}
|
|
920
1048
|
}
|
|
921
|
-
},
|
|
1049
|
+
}, m = [...l.map((p) => ({
|
|
922
1050
|
op: p.op,
|
|
923
1051
|
path: p.path.replace(/\/+$/, ""),
|
|
924
|
-
...p.value != null && p.value !== "" ? { value:
|
|
1052
|
+
...p.value != null && p.value !== "" ? { value: u(p.value) } : {},
|
|
925
1053
|
...p.from != null && p.from !== "" ? { from: p.from } : {}
|
|
926
|
-
}))].sort((p,
|
|
927
|
-
|
|
1054
|
+
}))].sort((p, x) => p.op !== "remove" || x.op !== "remove" ? 0 : x.path.localeCompare(p.path, void 0, { numeric: !0 })), f = structuredClone(
|
|
1055
|
+
ae(s)
|
|
928
1056
|
);
|
|
929
1057
|
try {
|
|
930
|
-
|
|
1058
|
+
Pe(f, m, !0);
|
|
931
1059
|
} catch (p) {
|
|
932
1060
|
console.warn(
|
|
933
1061
|
"[SolutionBuilder] updateDesign JSON patch failed:",
|
|
934
|
-
{ error: p, llmResponse: o, patches:
|
|
1062
|
+
{ error: p, llmResponse: o, patches: m, patchTarget: f }
|
|
935
1063
|
);
|
|
936
|
-
const
|
|
1064
|
+
const x = h("applyChangeFailed", e);
|
|
937
1065
|
return {
|
|
938
|
-
outputMessage:
|
|
939
|
-
summary:
|
|
1066
|
+
outputMessage: x,
|
|
1067
|
+
summary: x,
|
|
940
1068
|
status: "success"
|
|
941
1069
|
};
|
|
942
1070
|
}
|
|
943
|
-
const
|
|
944
|
-
{ response: "", ...
|
|
1071
|
+
const d = C(
|
|
1072
|
+
{ response: "", ...f },
|
|
945
1073
|
{ itemId: s.solution?.itemId ?? null }
|
|
946
|
-
),
|
|
947
|
-
if (!
|
|
1074
|
+
), g = G.safeParse(d);
|
|
1075
|
+
if (!g.success) {
|
|
948
1076
|
console.warn(
|
|
949
1077
|
"[SolutionBuilder] updateDesign schema validation failed:",
|
|
950
|
-
{ errors:
|
|
1078
|
+
{ errors: g.error.issues, llmResponse: o, patchedDesign: d }
|
|
951
1079
|
);
|
|
952
|
-
const p =
|
|
1080
|
+
const p = h("applyChangeFailed", e);
|
|
953
1081
|
return {
|
|
954
1082
|
outputMessage: p,
|
|
955
1083
|
summary: p,
|
|
956
1084
|
status: "success"
|
|
957
1085
|
};
|
|
958
1086
|
}
|
|
959
|
-
const { response:
|
|
960
|
-
|
|
1087
|
+
const { response: A, featureLayer: T, ...k } = g.data, Ie = re(
|
|
1088
|
+
T,
|
|
961
1089
|
s.featureLayer
|
|
962
|
-
),
|
|
963
|
-
{ ...
|
|
1090
|
+
), S = C(
|
|
1091
|
+
{ ...k, featureLayer: Ie },
|
|
964
1092
|
{
|
|
965
1093
|
itemId: s.solution?.itemId,
|
|
966
1094
|
sourceBuildSolution: s.sourceBuildSolution,
|
|
@@ -968,68 +1096,79 @@ Description: ${c.description}`).join(`
|
|
|
968
1096
|
params: s.params ?? null
|
|
969
1097
|
}
|
|
970
1098
|
);
|
|
971
|
-
let R =
|
|
972
|
-
if (R?.initialTemplate || (await
|
|
1099
|
+
let R = B(t.selectedTemplate);
|
|
1100
|
+
if (R?.initialTemplate || (await H(e), R = B(t.selectedTemplate)), !R?.initialTemplate)
|
|
973
1101
|
throw new Error("No hydrated templates are available for solution design.");
|
|
974
|
-
const
|
|
975
|
-
if (!
|
|
976
|
-
|
|
1102
|
+
const q = new me(S, R.initialTemplate, !1);
|
|
1103
|
+
if (!q.isValid) {
|
|
1104
|
+
console.warn(
|
|
977
1105
|
"[SolutionBuilder] updateDesign validation failed:",
|
|
978
|
-
{ issues:
|
|
979
|
-
)
|
|
980
|
-
|
|
1106
|
+
{ issues: q.issues, llmResponse: o, patchedDesign: S }
|
|
1107
|
+
);
|
|
1108
|
+
const p = await bt({
|
|
1109
|
+
query: n,
|
|
1110
|
+
validationIssues: q.issues,
|
|
1111
|
+
recentMessages: i,
|
|
1112
|
+
fallbackMessage: h("applyChangeFailed", e),
|
|
1113
|
+
promptModules: I
|
|
1114
|
+
});
|
|
1115
|
+
return {
|
|
1116
|
+
outputMessage: p,
|
|
1117
|
+
summary: p,
|
|
1118
|
+
status: "success"
|
|
981
1119
|
};
|
|
982
|
-
|
|
1120
|
+
}
|
|
1121
|
+
const Ce = S.sourceBuildSolution, Q = he(S, Ce);
|
|
983
1122
|
if (!Q.ok) {
|
|
984
1123
|
console.warn(
|
|
985
1124
|
"[SolutionBuilder] updateDesign Esri JSON conversion failed:",
|
|
986
|
-
{ error: Q.error, llmResponse: o, design:
|
|
1125
|
+
{ error: Q.error, llmResponse: o, design: S }
|
|
987
1126
|
);
|
|
988
|
-
const p =
|
|
1127
|
+
const p = h("applyChangeFailed", e);
|
|
989
1128
|
return {
|
|
990
1129
|
outputMessage: p,
|
|
991
1130
|
summary: p,
|
|
992
1131
|
status: "success"
|
|
993
1132
|
};
|
|
994
1133
|
}
|
|
995
|
-
return
|
|
1134
|
+
return ge(S), {
|
|
996
1135
|
outputMessage: a,
|
|
997
1136
|
summary: a,
|
|
998
1137
|
status: "success",
|
|
999
|
-
currentDesign:
|
|
1138
|
+
currentDesign: S
|
|
1000
1139
|
};
|
|
1001
|
-
},
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
}).addConditionalEdges("
|
|
1005
|
-
|
|
1140
|
+
}, jt = (t) => t.currentDesign !== null ? "assessUpdateRequest" : "assessBuildRequest", Jt = (t) => !t.updateAssessment || !t.updateAssessment.isValidUpdate ? "invalidUpdateExit" : "updateDesign", Gt = (t) => !t.assessment || !t.assessment.isValidUseCase ? "invalidBuildExit" : !t.selectedTemplate && t.assessment.matchedTemplates.length > 1 ? "selectTemplateHIL" : "findExistingSolutions", Vt = (t) => t.existingMatches.length > 0 ? "confirmContinueBuildingHIL" : "designSolution", Ht = (t) => t.continueBuilding === !1 ? "declineContinueBuildingExit" : "designSolution", Wt = () => new O(Dt).addNode("syncCurrentDesignFromContext", Ft).addNode("assessBuildRequest", $t).addNode("assessUpdateRequest", Bt).addNode("invalidBuildExit", Mt).addNode("invalidUpdateExit", Nt).addNode("selectTemplateHIL", qt).addNode("findExistingSolutions", Pt).addNode("confirmContinueBuildingHIL", Ut).addNode("declineContinueBuildingExit", Ot).addNode("designSolution", we).addNode("updateDesign", zt).addEdge(z, "syncCurrentDesignFromContext").addConditionalEdges("syncCurrentDesignFromContext", jt, {
|
|
1141
|
+
assessUpdateRequest: "assessUpdateRequest",
|
|
1142
|
+
assessBuildRequest: "assessBuildRequest"
|
|
1143
|
+
}).addConditionalEdges("assessUpdateRequest", Jt, {
|
|
1144
|
+
invalidUpdateExit: "invalidUpdateExit",
|
|
1145
|
+
updateDesign: "updateDesign"
|
|
1146
|
+
}).addConditionalEdges("assessBuildRequest", Gt, {
|
|
1147
|
+
invalidBuildExit: "invalidBuildExit",
|
|
1006
1148
|
selectTemplateHIL: "selectTemplateHIL",
|
|
1007
1149
|
findExistingSolutions: "findExistingSolutions"
|
|
1008
|
-
}).addEdge("
|
|
1150
|
+
}).addEdge("invalidBuildExit", v).addEdge("invalidUpdateExit", v).addEdge("selectTemplateHIL", "findExistingSolutions").addConditionalEdges("findExistingSolutions", Vt, {
|
|
1009
1151
|
confirmContinueBuildingHIL: "confirmContinueBuildingHIL",
|
|
1010
1152
|
designSolution: "designSolution"
|
|
1011
|
-
}).addConditionalEdges("confirmContinueBuildingHIL",
|
|
1153
|
+
}).addConditionalEdges("confirmContinueBuildingHIL", Ht, {
|
|
1012
1154
|
declineContinueBuildingExit: "declineContinueBuildingExit",
|
|
1013
1155
|
designSolution: "designSolution"
|
|
1014
|
-
}).addEdge("declineContinueBuildingExit",
|
|
1015
|
-
await y(
|
|
1016
|
-
const
|
|
1017
|
-
tool:
|
|
1018
|
-
confidence:
|
|
1019
|
-
rationale:
|
|
1020
|
-
|
|
1021
|
-
}), P = /* @__PURE__ */ Object.assign({
|
|
1156
|
+
}).addEdge("declineContinueBuildingExit", v).addEdge("designSolution", v).addEdge("updateDesign", v);
|
|
1157
|
+
await y(I, "description");
|
|
1158
|
+
const Kt = D.object({
|
|
1159
|
+
tool: D.enum(["explorer", "builder", "other"]).describe("The selected tool based on the user's query."),
|
|
1160
|
+
confidence: D.number().min(0).max(1).describe("A confidence score (0.00–1.00)."),
|
|
1161
|
+
rationale: D.string().min(1).describe("A brief rationale for the tool choice (≤140 characters)")
|
|
1162
|
+
}), W = /* @__PURE__ */ Object.assign({
|
|
1022
1163
|
"./prompts/assistantResponse.md": () => import("../../chunks/assistantResponse.js").then((t) => t.default),
|
|
1023
1164
|
"./prompts/classifyIntent.md": () => import("../../chunks/classifyIntent.js").then((t) => t.default),
|
|
1024
|
-
"./prompts/description.md": () => import("../../chunks/description.js").then((t) => t.default)
|
|
1025
|
-
|
|
1026
|
-
"./prompts/responseOptionsDefault.md": () => import("../../chunks/responseOptionsDefault.js").then((t) => t.default)
|
|
1027
|
-
}), W = () => {
|
|
1165
|
+
"./prompts/description.md": () => import("../../chunks/description.js").then((t) => t.default)
|
|
1166
|
+
}), K = () => {
|
|
1028
1167
|
const t = new CustomEvent("assistantProcessing", {
|
|
1029
1168
|
detail: !1
|
|
1030
1169
|
});
|
|
1031
1170
|
window.dispatchEvent(t);
|
|
1032
|
-
},
|
|
1171
|
+
}, Se = b.Root({
|
|
1033
1172
|
...j(),
|
|
1034
1173
|
selectedTool: b({
|
|
1035
1174
|
reducer: (t, e) => e ?? null,
|
|
@@ -1038,14 +1177,10 @@ const zt = T.object({
|
|
|
1038
1177
|
intentRationale: b({
|
|
1039
1178
|
reducer: (t, e) => e ?? null,
|
|
1040
1179
|
default: () => null
|
|
1041
|
-
}),
|
|
1042
|
-
builderExclusion: b({
|
|
1043
|
-
reducer: (t, e) => e ?? !1,
|
|
1044
|
-
default: () => !1
|
|
1045
1180
|
})
|
|
1046
|
-
}),
|
|
1181
|
+
}), Qt = async (t, e) => {
|
|
1047
1182
|
const s = N(e);
|
|
1048
|
-
await
|
|
1183
|
+
await w(
|
|
1049
1184
|
{ text: s?.builderMessages.understandingRequest },
|
|
1050
1185
|
e
|
|
1051
1186
|
);
|
|
@@ -1057,78 +1192,74 @@ const zt = T.object({
|
|
|
1057
1192
|
} catch {
|
|
1058
1193
|
a = !1;
|
|
1059
1194
|
}
|
|
1060
|
-
const l = await y(
|
|
1195
|
+
const l = await y(W, "classifyIntent"), u = await _({
|
|
1061
1196
|
promptText: l,
|
|
1062
1197
|
modelTier: "advanced",
|
|
1063
1198
|
temperature: 0,
|
|
1064
|
-
schema:
|
|
1199
|
+
schema: Kt,
|
|
1065
1200
|
messages: i,
|
|
1066
1201
|
inputVariables: { query: n, activeSolutionDesign: a }
|
|
1067
1202
|
});
|
|
1068
1203
|
return {
|
|
1069
|
-
selectedTool:
|
|
1070
|
-
intentRationale:
|
|
1071
|
-
builderExclusion: d.builderExclusion
|
|
1204
|
+
selectedTool: u.tool,
|
|
1205
|
+
intentRationale: u.rationale
|
|
1072
1206
|
};
|
|
1073
|
-
},
|
|
1207
|
+
}, Yt = async (t, e) => {
|
|
1074
1208
|
const n = await Ke().compile().invoke(t, e);
|
|
1075
|
-
return
|
|
1076
|
-
},
|
|
1077
|
-
const n = await
|
|
1078
|
-
return
|
|
1079
|
-
},
|
|
1080
|
-
const s = N(e), n = t.agentExecutionContext.userRequest, i = t.intentRationale ?? "No rationale available."
|
|
1081
|
-
await
|
|
1209
|
+
return K(), n;
|
|
1210
|
+
}, Xt = async (t, e) => {
|
|
1211
|
+
const n = await Wt().compile().invoke(t, e);
|
|
1212
|
+
return K(), n;
|
|
1213
|
+
}, Zt = async (t, e) => {
|
|
1214
|
+
const s = N(e), n = t.agentExecutionContext.userRequest, i = t.intentRationale ?? "No rationale available.";
|
|
1215
|
+
await w(
|
|
1082
1216
|
{ text: s?.executingSolutionsAssistantAgent },
|
|
1083
1217
|
e
|
|
1084
1218
|
);
|
|
1085
|
-
const
|
|
1086
|
-
|
|
1087
|
-
o
|
|
1088
|
-
), d = t.agentExecutionContext.messages.slice(-11), u = await Pe({
|
|
1089
|
-
promptText: a,
|
|
1219
|
+
const o = await y(W, "assistantResponse"), a = t.agentExecutionContext.messages.slice(-11), l = await qe({
|
|
1220
|
+
promptText: o,
|
|
1090
1221
|
modelTier: "advanced",
|
|
1091
1222
|
temperature: 0,
|
|
1092
|
-
messages:
|
|
1093
|
-
inputVariables: { query: n, rationale: i
|
|
1223
|
+
messages: a,
|
|
1224
|
+
inputVariables: { query: n, rationale: i }
|
|
1094
1225
|
});
|
|
1095
|
-
return
|
|
1096
|
-
outputMessage:
|
|
1097
|
-
summary:
|
|
1226
|
+
return K(), {
|
|
1227
|
+
outputMessage: l,
|
|
1228
|
+
summary: l,
|
|
1098
1229
|
status: "success"
|
|
1099
1230
|
};
|
|
1100
|
-
},
|
|
1231
|
+
}, es = (t) => t.selectedTool ?? "other", ts = () => new O(Se).addNode("classifyIntent", Qt).addNode("routeToExplorer", Yt).addNode("routeToBuilder", Xt).addNode("assistantResponse", Zt).addEdge(z, "classifyIntent").addConditionalEdges("classifyIntent", es, {
|
|
1101
1232
|
explorer: "routeToExplorer",
|
|
1102
1233
|
builder: "routeToBuilder",
|
|
1103
1234
|
other: "assistantResponse"
|
|
1104
|
-
}).addEdge("routeToExplorer",
|
|
1235
|
+
}).addEdge("routeToExplorer", v).addEdge("routeToBuilder", v).addEdge("assistantResponse", v), ss = await y(W, "description"), ns = {
|
|
1105
1236
|
id: "solutionsAssistant",
|
|
1106
1237
|
name: "Solutions Assistant Agent",
|
|
1107
|
-
description:
|
|
1108
|
-
createGraph:
|
|
1109
|
-
workspace:
|
|
1110
|
-
},
|
|
1111
|
-
class
|
|
1238
|
+
description: ss,
|
|
1239
|
+
createGraph: ts,
|
|
1240
|
+
workspace: Se
|
|
1241
|
+
}, is = "https://links.esri.com/solutions/agol-organizational-account", os = "https://links.esri.com/solutions/configure-assistants";
|
|
1242
|
+
class as extends ke {
|
|
1112
1243
|
constructor() {
|
|
1113
1244
|
super(), this.open = !1, this.userFirstName = "", this.builderVisible = !1, this.hasActiveBuilderDesign = !1, this._conversationId = void 0, this._orgSettings = {
|
|
1114
1245
|
aiAssistantsEnabled: !1,
|
|
1115
1246
|
blockBetaApps: !0,
|
|
1116
1247
|
colocateCompute: !1
|
|
1117
|
-
}, this._suggestedPrompts = [], this._hasInteracted = !1, this._isMobile = window.innerWidth <= 800, this._translations =
|
|
1118
|
-
context:
|
|
1248
|
+
}, this._suggestedPrompts = [], this._hasInteracted = !1, this._isMobile = window.innerWidth <= 800, this._translations = Te({ 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({
|
|
1249
|
+
context: Le,
|
|
1119
1250
|
subscribe: !0,
|
|
1120
1251
|
callback: (e) => {
|
|
1121
1252
|
e?.portalURL && (te.portalUrl = e.portalURL), e?.userSession && !this.userFirstName && this._loadUserFirstName(), e?.authentication?.PortalSubset?.orgSettings && (this._orgSettings = e?.authentication?.PortalSubset?.orgSettings);
|
|
1122
1253
|
}
|
|
1123
1254
|
}), this._builderDesignContextConsumer = ee({
|
|
1124
|
-
context:
|
|
1255
|
+
context: Re,
|
|
1125
1256
|
subscribe: !0,
|
|
1126
1257
|
callback: (e) => {
|
|
1127
1258
|
e?.design && (this._solutionDesignJson = JSON.stringify(e.design, null, 2));
|
|
1128
1259
|
}
|
|
1129
1260
|
}), this._handleResize = () => {
|
|
1130
1261
|
this._isMobile = window.innerWidth <= 800;
|
|
1131
|
-
}, this.closeAssistant =
|
|
1262
|
+
}, this.closeAssistant = X(), this.assistantProcessing = X(), this._handleAssistantLinkClick = (e) => {
|
|
1132
1263
|
const s = e.composedPath().find((n) => n instanceof HTMLAnchorElement);
|
|
1133
1264
|
if (s?.href)
|
|
1134
1265
|
if (e.preventDefault(), s.target.indexOf("solutionId:") > -1) {
|
|
@@ -1173,23 +1304,23 @@ class Xt extends ke {
|
|
|
1173
1304
|
this._loadUserFirstName();
|
|
1174
1305
|
}
|
|
1175
1306
|
willUpdate(e) {
|
|
1176
|
-
e.has("open") && this.open && window.dispatchEvent(new CustomEvent("openAssistant")), this._configContextConsumer.value?.authentication && this._configContextConsumer.value?.userSession?.token && (this._preChatCheck || (
|
|
1307
|
+
e.has("open") && this.open && window.dispatchEvent(new CustomEvent("openAssistant")), this._configContextConsumer.value?.authentication && this._configContextConsumer.value?.userSession?.token && (this._preChatCheck || (ue(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;
|
|
1177
1308
|
}
|
|
1178
1309
|
_renderNoSign() {
|
|
1179
|
-
return
|
|
1310
|
+
return E`<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 ?? Z} class="padding-top-10">${this._translations.signIn}</calcite-link></calcite-notice>`;
|
|
1180
1311
|
}
|
|
1181
1312
|
_renderNoPermission() {
|
|
1182
|
-
return
|
|
1313
|
+
return E`<calcite-notice open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${Ae(this._translations.noPermissionMessage.replace("{{orgUrl}}", is).replace("{{configAI}}", os))}</div></calcite-notice>`;
|
|
1183
1314
|
}
|
|
1184
1315
|
render() {
|
|
1185
1316
|
let e = this._suggestedPrompts.length > 0 ? this._suggestedPrompts : this._hasInteracted ? [] : Object.values(this._translations.defaultFollowUpQuestions);
|
|
1186
|
-
return this._suggestedPrompts.length > 0 ? e = this._suggestedPrompts : this._hasInteracted || (e = [...Object.values(this._translations.defaultFollowUpQuestions)]),
|
|
1317
|
+
return this._suggestedPrompts.length > 0 ? e = this._suggestedPrompts : this._hasInteracted || (e = [...Object.values(this._translations.defaultFollowUpQuestions)]), E`<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 ? E`${!this._isMobile && E`<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=${() => {
|
|
1187
1318
|
window.dispatchEvent(new CustomEvent("toggleSolutionBuilder"));
|
|
1188
|
-
}} scale=m slot=header-actions-end></calcite-action>` || ""}${!this._isMobile &&
|
|
1319
|
+
}} scale=m slot=header-actions-end></calcite-action>` || ""}${!this._isMobile && E`<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 ?? Z} .suggestedPrompts=${e} @arcgisSubmit=${(s) => {
|
|
1189
1320
|
console.log("arcgis submit: ", s.detail), this._suggestedPrompts = [], e = [], this._hasInteracted = !0;
|
|
1190
|
-
const n = Date.now(), i =
|
|
1321
|
+
const n = Date.now(), i = Fe(n), o = s.detail || "Unknown";
|
|
1191
1322
|
this._telemetry?.logEvent({
|
|
1192
|
-
category:
|
|
1323
|
+
category: De.ASSISTANT,
|
|
1193
1324
|
action: "Chat",
|
|
1194
1325
|
dimensions: [o],
|
|
1195
1326
|
metrics: [i]
|
|
@@ -1202,9 +1333,9 @@ class Xt extends ke {
|
|
|
1202
1333
|
this._queryElementInShadowDom(this.el, ".footer-container", !1);
|
|
1203
1334
|
}} @arcgisInterruptSubmit=${() => {
|
|
1204
1335
|
this._queryElementInShadowDom(this.el, ".footer-container", !1);
|
|
1205
|
-
}} ${Me(this._assistantRef)}><calcite-button appearance=
|
|
1336
|
+
}} ${Me(this._assistantRef)}><calcite-button appearance=transparent id=newChatButton icon-start=speech-bubble-plus kind=neutral .label=${this._translations.tooltips.newChat} @click=${() => {
|
|
1206
1337
|
this._conversationId = void 0, this._suggestedPrompts = [], this._hasInteracted = !1, this._assistantRef.value?.clearChatHistory(), this._queryElementInShadowDom(this.el, ".footer-container", !1);
|
|
1207
|
-
}} round scale=
|
|
1338
|
+
}} round scale=m slot=entry-actions-start>${this._translations.tooltips.newChat}</calcite-button><arcgis-assistant-agent .agent=${ns} .context=${{
|
|
1208
1339
|
token: this._configContextConsumer.value?.userSession?.token,
|
|
1209
1340
|
configContext: this._configContextConsumer.value,
|
|
1210
1341
|
convoId: this._conversationId,
|
|
@@ -1218,7 +1349,7 @@ class Xt extends ke {
|
|
|
1218
1349
|
clearSuggestedPrompts: () => {
|
|
1219
1350
|
this._suggestedPrompts = [];
|
|
1220
1351
|
}
|
|
1221
|
-
}}></arcgis-assistant-agent></arcgis-assistant><div slot=footer class="disclaimer-div width-100"><calcite-chip class="beta-chip" appearance=
|
|
1352
|
+
}}></arcgis-assistant-agent></arcgis-assistant><div slot=footer class="disclaimer-div width-100"><calcite-chip class="beta-chip" appearance=solid kind=neutral .label=${this._translations.betaTag} scale=s>${this._translations.betaTag}</calcite-chip><span>${this._translations.disclaimerMessage} <a href=https://links.esri.com/solutions/security-concern rel="noopener noreferrer" target=_blank>${this._translations.reportConcern}</a></span></div>` : this._renderNoPermission() : this._renderNoSign()}<calcite-action icon=x id=closeAssistantButton .label=${this._translations.tooltips.close} @click=${() => {
|
|
1222
1353
|
this.closeAssistant.emit(!0);
|
|
1223
1354
|
}} slot=header-actions-end .text=${this._translations.tooltips.close}></calcite-action><calcite-tooltip placement=bottom reference-element=closeAssistantButton><span>${this._translations.tooltips.close}</span></calcite-tooltip></calcite-panel>`;
|
|
1224
1355
|
}
|
|
@@ -1237,14 +1368,14 @@ class Xt extends ke {
|
|
|
1237
1368
|
}
|
|
1238
1369
|
}
|
|
1239
1370
|
_parseAgentPickedAndTask(e) {
|
|
1240
|
-
const s = Array.from(this._assistantRef.value?.messages || []), n = e.log || [], a = [...s].sort((
|
|
1371
|
+
const s = Array.from(this._assistantRef.value?.messages || []), n = e.log || [], a = [...s].sort((d, g) => g.id - d.id).find((d) => d.role === "user" && d.id <= e.id)?.content || null, l = n.find((d) => typeof d == "string" && d.includes("Agent picked:")) ?? null;
|
|
1241
1372
|
if (!l)
|
|
1242
1373
|
return { agentPicked: null, taskAssigned: null, userMessage: a };
|
|
1243
|
-
const
|
|
1244
|
-
if (!
|
|
1374
|
+
const u = /Agent picked:\s*(.*?)\s*(?:\\n|\r?\n)\s*Task Assigned:\s*([\s\S]*)$/i, c = l.match(u);
|
|
1375
|
+
if (!c)
|
|
1245
1376
|
return { agentPicked: null, taskAssigned: null, userMessage: a };
|
|
1246
|
-
const
|
|
1247
|
-
return { agentPicked:
|
|
1377
|
+
const m = c[1].trim(), f = c[2].trim();
|
|
1378
|
+
return { agentPicked: m, taskAssigned: f, userMessage: a };
|
|
1248
1379
|
}
|
|
1249
1380
|
_emitItemIdFromAI(e) {
|
|
1250
1381
|
const s = new CustomEvent("solutionIDFromAssistant", {
|
|
@@ -1277,7 +1408,7 @@ class Xt extends ke {
|
|
|
1277
1408
|
});
|
|
1278
1409
|
}
|
|
1279
1410
|
}
|
|
1280
|
-
|
|
1411
|
+
_e("arcgis-solutions-assistant", as);
|
|
1281
1412
|
export {
|
|
1282
|
-
|
|
1413
|
+
as as ArcgisSolutionsAssistant
|
|
1283
1414
|
};
|