@esri/solutions-components 5.1.13 → 5.1.15
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/{BP5ZQTYK.js → 2A7FDE6T.js} +1 -1
- package/dist/cdn/{4QXIKPGO.js → 2CIYQPV2.js} +1 -1
- package/dist/cdn/{ODJ7OCZ6.js → 2WXIVPKA.js} +1 -1
- package/dist/cdn/{WPDKKXGG.js → 3CQUAISD.js} +1 -1
- package/dist/cdn/{XIUOFNHN.js → 3JF7PWPA.js} +1 -1
- package/dist/cdn/{WQUCBG6T.js → 4ESJPQUS.js} +1 -1
- package/dist/cdn/{URV3LNEF.js → 4QGYS5DL.js} +1 -1
- package/dist/cdn/{J2HB6QQJ.js → 5AGI2QC2.js} +1 -1
- package/dist/cdn/{BPZVE5D3.js → 5DMFGBJJ.js} +1 -1
- package/dist/cdn/{FTK634CB.js → 5DZ55HIG.js} +1 -1
- package/dist/cdn/{OIGQMEOA.js → 5O6454VY.js} +1 -1
- package/dist/cdn/{AHGIIRD2.js → 5O6E2RIA.js} +1 -1
- package/dist/cdn/{76MTNIFR.js → 5OMXJXRL.js} +1 -1
- package/dist/cdn/{M6KMGWHY.js → 64DMFXX3.js} +118 -118
- package/dist/cdn/{DASTXYVJ.js → 65VKA5R3.js} +1 -1
- package/dist/cdn/{QQL4IXXC.js → 6A4MHJFZ.js} +1 -1
- package/dist/cdn/6JPXLTNI.js +358 -0
- package/dist/cdn/{SRUCCYYK.js → 6MQWDLJ6.js} +1 -1
- package/dist/cdn/{ZSTTH25D.js → 6RHFFYNC.js} +1 -1
- package/dist/cdn/{L3DICS7J.js → 7IN2LLKR.js} +1 -1
- package/dist/cdn/{AKGLWV53.js → 7LP2DUHS.js} +1 -1
- package/dist/cdn/{PGY6VBLA.js → 7SZY3VBD.js} +1 -1
- package/dist/cdn/{LT6TNRF6.js → 7ZZNR4FQ.js} +1 -1
- package/dist/cdn/{SYKVEYMY.js → ABPXUFXN.js} +1 -1
- package/dist/cdn/{EGBJGHKB.js → AIUJXRA5.js} +1 -1
- package/dist/cdn/{HWD4BGMW.js → AONULVO2.js} +1 -1
- package/dist/cdn/{U26OIB2P.js → AQ2USXUY.js} +1 -1
- package/dist/cdn/{WZSXP6GC.js → BA3J7L5N.js} +1 -1
- package/dist/cdn/{NT2KAJ24.js → BAVVBOOM.js} +1 -1
- package/dist/cdn/{WQ5UIZ6O.js → BDVFJJR4.js} +1 -1
- package/dist/cdn/{6VUGQJW4.js → BOA6VQK6.js} +1 -1
- package/dist/cdn/BPHZAC66.js +2 -0
- package/dist/cdn/{NISCRPTA.js → CNNBPMQT.js} +1 -1
- package/dist/cdn/{TCPO7PEE.js → CNV2ZCFA.js} +1 -1
- package/dist/cdn/{3562Z3EC.js → COEHM4BJ.js} +1 -1
- package/dist/cdn/{EXPBVOCZ.js → COJMQQT5.js} +1 -1
- package/dist/cdn/{DZ6PL4HK.js → COKMQSEA.js} +1 -1
- package/dist/cdn/{2EEHG5XR.js → CPWYI2FO.js} +1 -1
- package/dist/cdn/{GDBULXEH.js → D65S424V.js} +1 -1
- package/dist/cdn/{UZVU2CPJ.js → DERWSE25.js} +1 -1
- package/dist/cdn/{NTFCCNHZ.js → DMMSPGOK.js} +1 -1
- package/dist/cdn/{X5HRQ34A.js → ECJQJ4BY.js} +1 -1
- package/dist/cdn/{WB4DH4SS.js → F5EJPIW4.js} +1 -1
- package/dist/cdn/{XYGCPNIM.js → FLPXST7W.js} +1 -1
- package/dist/cdn/{OQUU2BPX.js → FPF7E4SX.js} +1 -1
- package/dist/cdn/{YTIFVDAA.js → FX2C3BL4.js} +1 -1
- package/dist/cdn/{DP6WOAWH.js → G2OBSHPX.js} +1 -1
- package/dist/cdn/{PHCPY4ZR.js → GEEQWXOZ.js} +1 -1
- package/dist/cdn/{R2UFZXIQ.js → GWLE7PJQ.js} +1 -1
- package/dist/cdn/{CEQ7OSXE.js → H3QX6XOJ.js} +1 -1
- package/dist/cdn/{3Q6BLEUW.js → HBB7AS7K.js} +1 -1
- package/dist/cdn/{YCHAOPMX.js → HW4LYJUR.js} +1 -1
- package/dist/cdn/{AO6C3Y72.js → IBSFJBIL.js} +1 -1
- package/dist/cdn/{K64MB7UB.js → IDJHBEJC.js} +1 -1
- package/dist/cdn/{U2J33BNN.js → ILEHAZV2.js} +1 -1
- package/dist/cdn/{DUFBYCNV.js → IYZ2PDYK.js} +1 -1
- package/dist/cdn/{KMN7UYCS.js → JNZBNQ3F.js} +1 -1
- package/dist/cdn/JRUIRTL7.js +2 -0
- package/dist/cdn/{KXJZZIT3.js → JXERXJF5.js} +1 -1
- package/dist/cdn/{Q5USRVF5.js → K3ALRIQF.js} +1 -1
- package/dist/cdn/{XT7FRIZE.js → KC3LIHE2.js} +1 -1
- package/dist/cdn/{IHC3D35G.js → KF64ALRP.js} +1 -1
- package/dist/cdn/{7MHXB6MA.js → KJTTBON2.js} +1 -1
- package/dist/cdn/{LQHZEFT7.js → KN2PNGQX.js} +1 -1
- package/dist/cdn/{TBPIA7X3.js → KOIHVAUY.js} +1 -1
- package/dist/cdn/{YKWVEXEV.js → L5DQOHD5.js} +1 -1
- package/dist/cdn/{7NRAPL4U.js → LGJMYSGU.js} +1 -1
- package/dist/cdn/{7TAWNPBZ.js → LX3ZJGZ3.js} +1 -1
- package/dist/cdn/{MPOW6X2Q.js → M6CYGIKU.js} +1 -1
- package/dist/cdn/{AK6SGWFY.js → MBZESGLB.js} +1 -1
- package/dist/cdn/{YRN3GNV2.js → MECI4R4R.js} +1 -1
- package/dist/cdn/{TM3HQUQN.js → MXLUHQFQ.js} +1 -1
- package/dist/cdn/{ZNNM4VOZ.js → NF77ALHM.js} +1 -1
- package/dist/cdn/{WDSHKWCQ.js → O37KXBBH.js} +1 -1
- package/dist/cdn/{QAVOSU5J.js → O3FK6QQ2.js} +1 -1
- package/dist/cdn/{WFFDEQ3T.js → O62JG2Y6.js} +1 -1
- package/dist/cdn/{SSE3OV4D.js → OJH4NUGT.js} +1 -1
- package/dist/cdn/{YZCNLWCK.js → OQMMSCLX.js} +1 -1
- package/dist/cdn/{E33FRS3A.js → OZVQRDTO.js} +1 -1
- package/dist/cdn/{E7C4ISUJ.js → P3YHSJCB.js} +1 -1
- package/dist/cdn/{2PTMXOMF.js → PHGSNNMQ.js} +1 -1
- package/dist/cdn/{H3NTIWHD.js → QBPJLGAM.js} +1 -1
- package/dist/cdn/{TWCRSSGO.js → QLTSABSA.js} +1 -1
- package/dist/cdn/{2GXKCJ2T.js → QMUSSZL2.js} +1 -1
- package/dist/cdn/{5Z4SUP7T.js → QNGGDSZS.js} +1 -1
- package/dist/cdn/{ZGEPGEKV.js → QPMXVWMP.js} +1 -1
- package/dist/cdn/{FETSFCBL.js → QPQKALNN.js} +1 -1
- package/dist/cdn/{UK7FBP7U.js → RD7MZ7SN.js} +1 -1
- package/dist/cdn/{T5H5QDAS.js → RGOUIRT7.js} +1 -1
- package/dist/cdn/{CL3AYK25.js → RI7U6FA5.js} +1 -1
- package/dist/cdn/{N63JOPKM.js → RPLXKWJA.js} +1 -1
- package/dist/cdn/{NYLOU7ZM.js → RSJVFZPY.js} +1 -1
- package/dist/cdn/{CTCWANBA.js → RUPNX57X.js} +1 -1
- package/dist/cdn/{HXRZFGOY.js → RX2VR5KK.js} +1 -1
- package/dist/cdn/{ZDXFFQJI.js → SEBM4AAA.js} +1 -1
- package/dist/cdn/{2S26J4GF.js → SNRLIWGC.js} +1 -1
- package/dist/cdn/{BOTOPHKQ.js → SOELU2Q6.js} +1 -1
- package/dist/cdn/{VINK2SLZ.js → SONZCBAV.js} +1 -1
- package/dist/cdn/{MCHVWDD7.js → SSNO5VHY.js} +1 -1
- package/dist/cdn/{Z7SEICRM.js → ST2WEDFS.js} +1 -1
- package/dist/cdn/{3ADRLEU7.js → SV2XM7U2.js} +1 -1
- package/dist/cdn/{7QSOGNZM.js → SYHEO472.js} +1 -1
- package/dist/cdn/{FM47F4IP.js → SZYWQAVW.js} +1 -1
- package/dist/cdn/{3BNJMNCD.js → T5DCIH4Q.js} +1 -1
- package/dist/cdn/{7Q5LNER7.js → T6F3TWF6.js} +1 -1
- package/dist/cdn/{JLQOOJFJ.js → T7JWS4CF.js} +1 -1
- package/dist/cdn/{YQI2AE2N.js → TBB4KG37.js} +1 -1
- package/dist/cdn/{3DWPAQFI.js → TRNQ5OTY.js} +1 -1
- package/dist/cdn/{3VP33LM6.js → TTXN5R4E.js} +1 -1
- package/dist/cdn/{6R6R4TFH.js → U4D4YJ7L.js} +1 -1
- package/dist/cdn/{6OHUYDZC.js → UK5XQCTX.js} +1 -1
- package/dist/cdn/{WRO2YCVL.js → UNN6SVUI.js} +1 -1
- package/dist/cdn/{UNGZMOQE.js → VCKCRMSD.js} +1 -1
- package/dist/cdn/{RFKW5BFU.js → VM2LS6TR.js} +1 -1
- package/dist/cdn/{AZJ5EUBD.js → VNWIFVKC.js} +1 -1
- package/dist/cdn/{YMJF3GAO.js → VW4UJ7IY.js} +1 -1
- package/dist/cdn/{5DFDXWTM.js → VWNMKVMJ.js} +1 -1
- package/dist/cdn/{KIGTSUFO.js → VYOCZUVH.js} +1 -1
- package/dist/cdn/{7ESYN6XO.js → W6GIBBBE.js} +1 -1
- package/dist/cdn/{S2E4VZKV.js → WCFHQRWL.js} +1 -1
- package/dist/cdn/{2MNK2M2M.js → WMXP3LPH.js} +1 -1
- package/dist/cdn/{QCME7YYI.js → WQUZG2NJ.js} +1 -1
- package/dist/cdn/{QCLWTDIC.js → WVRDKKBC.js} +1 -1
- package/dist/cdn/{LJTZPQQH.js → X3YWKGD7.js} +1 -1
- package/dist/cdn/{NFLDV2BR.js → XGUD7O6G.js} +1 -1
- package/dist/cdn/{JH2LBLK4.js → XRQNNWH3.js} +1 -1
- package/dist/cdn/{LFBK5LL3.js → Y2Y7HUJR.js} +1 -1
- package/dist/cdn/{COSMV4TW.js → YEER3LD7.js} +1 -1
- package/dist/cdn/{S5QUASO4.js → YEMYE6JK.js} +1 -1
- package/dist/cdn/{DQHGHZDB.js → YGVATVII.js} +1 -1
- package/dist/cdn/{2W2FGE2Q.js → YR6F4HW7.js} +1 -1
- package/dist/cdn/{2VVUA5HG.js → Z4LGN5M5.js} +1 -1
- package/dist/cdn/{PFI2WBBU.js → ZFPRM3GK.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/components/arcgis-solutions-assistant/customElement.js +335 -324
- package/dist/components/solutions-deploy-app/customElement.js +3 -3
- 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 +9 -6
- package/package.json +1 -1
- package/dist/cdn/JGPIG5MJ.js +0 -358
- package/dist/cdn/VQ7WZGV2.js +0 -2
- package/dist/cdn/XXE533EC.js +0 -2
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { u as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { css as
|
|
2
|
+
import { c as De } from "../../chunks/runtime.js";
|
|
3
|
+
import { u as Me } from "../../chunks/useT9n.js";
|
|
4
|
+
import { LitElement as Re, createEvent as ae, nothing as re } from "@arcgis/lumina";
|
|
5
|
+
import { css as Be, html as L } from "lit";
|
|
6
6
|
import { unsafeHTML as Pe } from "lit/directives/unsafe-html.js";
|
|
7
7
|
import { useContextConsumer as le } from "@arcgis/lumina/context";
|
|
8
|
-
import { c as
|
|
9
|
-
import { T as
|
|
10
|
-
import { m as
|
|
8
|
+
import { c as qe, b as Ue } from "../../chunks/deployAppContexts.js";
|
|
9
|
+
import { T as R } from "../../chunks/interfaces.js";
|
|
10
|
+
import { m as Oe } from "../../chunks/helpers.js";
|
|
11
11
|
import G from "@arcgis/core/config.js";
|
|
12
|
-
import { createRef as
|
|
13
|
-
import { Annotation as
|
|
14
|
-
import { createAgentRuntimeState as X, sendTraceMessage as
|
|
15
|
-
import c, { z as
|
|
12
|
+
import { createRef as ze, ref as je } from "lit-html/directives/ref.js";
|
|
13
|
+
import { Annotation as x, StateGraph as W, START as K, END as T, NodeInterrupt as de } from "@langchain/langgraph/web";
|
|
14
|
+
import { createAgentRuntimeState as X, sendTraceMessage as I, invokeStructuredPrompt as E, getEmbeddings as Ge, cosineSimilarity as Je, invokeTextPrompt as He } from "@arcgis/ai-components/utils/index.js";
|
|
15
|
+
import c, { z as $ } from "zod";
|
|
16
16
|
import * as Y from "@esri/arcgis-rest-portal";
|
|
17
|
-
import { applyPatch as
|
|
17
|
+
import { applyPatch as Ve } from "fast-json-patch";
|
|
18
18
|
import "@langchain/core/messages";
|
|
19
19
|
import { C as pe } from "../../chunks/converter.js";
|
|
20
|
-
import { v as J, b as H, S as
|
|
21
|
-
import { t as me, g as
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
const
|
|
25
|
-
async function
|
|
20
|
+
import { v as J, b as H, S as Qe, h as We, E as Ke, g as Xe } from "../../chunks/validators.js";
|
|
21
|
+
import { t as me, g as U, c as ge, r as he, d as D } from "../../chunks/templates.js";
|
|
22
|
+
import Ye from "@arcgis/core/portal/Portal.js";
|
|
23
|
+
import Ze from "@arcgis/core/portal/PortalItem.js";
|
|
24
|
+
const et = Be`: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)}@media(resolution:1.25dppx),(resolution:1.75dppx){.chat-panel{margin-top:.5px}}.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)}`;
|
|
25
|
+
async function w(s, e) {
|
|
26
26
|
const t = Object.entries(s).find(
|
|
27
27
|
([i]) => i.endsWith(`/${e}.md`)
|
|
28
28
|
);
|
|
@@ -35,7 +35,7 @@ ${Object.keys(s).join(`
|
|
|
35
35
|
);
|
|
36
36
|
return await t[1]();
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function O(s) {
|
|
39
39
|
return s?.configurable?.context?.translations;
|
|
40
40
|
}
|
|
41
41
|
function fe(s) {
|
|
@@ -70,17 +70,17 @@ function ye(s) {
|
|
|
70
70
|
});
|
|
71
71
|
window.dispatchEvent(e);
|
|
72
72
|
}
|
|
73
|
-
const
|
|
74
|
-
needsContext:
|
|
75
|
-
rewrittenQuery:
|
|
73
|
+
const tt = $.object({
|
|
74
|
+
needsContext: $.boolean().describe("True when the explorer query requires added context from prior turns."),
|
|
75
|
+
rewrittenQuery: $.string().min(1).describe("The final query to send to doc AI. Keep original query if no context is needed.")
|
|
76
76
|
}), ce = (s) => s?.signal?.aborted ?? !1, be = /* @__PURE__ */ Object.assign({
|
|
77
77
|
"./prompts/solutions_explorer_description.md": () => import("../../chunks/solutions_explorer_description.js").then((s) => s.default),
|
|
78
78
|
"./prompts/transformQuery.md": () => import("../../chunks/transformQuery.js").then((s) => s.default)
|
|
79
79
|
});
|
|
80
|
-
function
|
|
80
|
+
function st(s) {
|
|
81
81
|
return s.replace(/<sup>\[\[(\d+)\]\]\(([^)]+)\)<\/sup>/g, '<sup><a href="$2">[$1]</a></sup>');
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function it(s) {
|
|
84
84
|
return s.replace(/!\[([^\]]*)\]\(([^)]+)\)/g, (e, t, i) => `<img src="${i}" alt="${t}" style="width: 100%;">`);
|
|
85
85
|
}
|
|
86
86
|
function xe(s) {
|
|
@@ -90,7 +90,7 @@ function xe(s) {
|
|
|
90
90
|
const t = e.split(/[-_]/)[0]?.toLowerCase();
|
|
91
91
|
return t ? t.slice(0, 2) : "en";
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function nt(s, e) {
|
|
94
94
|
const t = [];
|
|
95
95
|
return (e?.configurable?.context?.configContext.allCards ?? []).forEach((n) => {
|
|
96
96
|
const o = n.title;
|
|
@@ -98,9 +98,9 @@ function it(s, e) {
|
|
|
98
98
|
return;
|
|
99
99
|
const a = new RegExp(`(?<![\\p{L}\\p{N}])${o}(?![\\p{L}\\p{N}])`, "giu");
|
|
100
100
|
let r = !1;
|
|
101
|
-
s = s.replace(a, (l, d,
|
|
102
|
-
const
|
|
103
|
-
return /<img[^>]*alt\s*=\s*["'][^"']*$/i.test(
|
|
101
|
+
s = s.replace(a, (l, d, m) => {
|
|
102
|
+
const g = m.slice(0, d);
|
|
103
|
+
return /<img[^>]*alt\s*=\s*["'][^"']*$/i.test(g) ? l : (r = !0, `<a href="" target="solutionId:${n.deployCommonId}">${o}</a>`);
|
|
104
104
|
}), r && t.push({
|
|
105
105
|
solution: {
|
|
106
106
|
title: n.title,
|
|
@@ -112,7 +112,7 @@ function it(s, e) {
|
|
|
112
112
|
});
|
|
113
113
|
}), { source: s, allMatches: t };
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function ot(s) {
|
|
116
116
|
return s && s.helperServices.aiAssistantServices ? `${s.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/chat` : null;
|
|
117
117
|
}
|
|
118
118
|
function ve(s) {
|
|
@@ -131,17 +131,17 @@ async function Q(s, e, t) {
|
|
|
131
131
|
throw new Error(`HTTP ${i.status} calling ${e}`);
|
|
132
132
|
return i.json();
|
|
133
133
|
}
|
|
134
|
-
const
|
|
135
|
-
async function
|
|
134
|
+
const at = (s) => new Promise((e) => setTimeout(e, s));
|
|
135
|
+
async function rt(s, e) {
|
|
136
136
|
const t = s.agentExecutionContext.userRequest, i = e?.configurable?.context?.lastTurnAgent, n = s.agentExecutionContext.messages ?? [];
|
|
137
137
|
if (!i || n.length <= 1)
|
|
138
138
|
return t;
|
|
139
139
|
try {
|
|
140
|
-
const o = await
|
|
140
|
+
const o = await w(be, "transformQuery"), a = await E({
|
|
141
141
|
promptText: o,
|
|
142
142
|
modelTier: "advanced",
|
|
143
143
|
temperature: 0,
|
|
144
|
-
schema:
|
|
144
|
+
schema: tt,
|
|
145
145
|
messages: n.slice(-11),
|
|
146
146
|
inputVariables: { query: t, lastTurnAgent: i }
|
|
147
147
|
});
|
|
@@ -151,28 +151,28 @@ async function at(s, e) {
|
|
|
151
151
|
}
|
|
152
152
|
return t;
|
|
153
153
|
}
|
|
154
|
-
const
|
|
154
|
+
const lt = x.Root({
|
|
155
155
|
// Provides agentExecutionContext, outputMessage, summary, and status
|
|
156
156
|
// channels with the orchestrator's standard reducers/defaults so the
|
|
157
157
|
// sub-agent reports back through the same shape the orchestrator
|
|
158
158
|
// persists into priorSteps.
|
|
159
159
|
...X(),
|
|
160
|
-
solutionResponse:
|
|
160
|
+
solutionResponse: x({
|
|
161
161
|
reducer: (s, e) => e ?? null,
|
|
162
162
|
default: () => null
|
|
163
163
|
}),
|
|
164
|
-
documentSkillUrl:
|
|
164
|
+
documentSkillUrl: x({
|
|
165
165
|
reducer: (s, e) => e ?? null,
|
|
166
166
|
default: () => null
|
|
167
167
|
}),
|
|
168
168
|
// Persisted across turns via the graph checkpointer so follow-up questions
|
|
169
169
|
// continue the same service conversation. Null on the very first interaction
|
|
170
170
|
// or after messages are cleared.
|
|
171
|
-
conversationId:
|
|
171
|
+
conversationId: x({
|
|
172
172
|
reducer: (s, e) => e ?? s,
|
|
173
173
|
default: () => null
|
|
174
174
|
})
|
|
175
|
-
}),
|
|
175
|
+
}), ct = () => new W(lt).addNode("initializeAgent", dt).addNode("askSolutionsQuestions", ut).addEdge(K, "initializeAgent").addEdge("initializeAgent", "askSolutionsQuestions").addEdge("askSolutionsQuestions", T), we = async (s, e, t, i) => {
|
|
176
176
|
if (!s) return;
|
|
177
177
|
const n = ve(s);
|
|
178
178
|
if (!n) return;
|
|
@@ -187,13 +187,13 @@ const rt = b.Root({
|
|
|
187
187
|
}
|
|
188
188
|
} };
|
|
189
189
|
i && (a.conversationId = i), Q(a, n, e ?? "");
|
|
190
|
-
},
|
|
190
|
+
}, ut = async (s, e) => {
|
|
191
191
|
if (ce(e))
|
|
192
192
|
return {};
|
|
193
|
-
const t =
|
|
193
|
+
const t = O(e), i = s.documentSkillUrl;
|
|
194
194
|
let n = [];
|
|
195
|
-
const o = await
|
|
196
|
-
await
|
|
195
|
+
const o = await rt(s, e);
|
|
196
|
+
await I(
|
|
197
197
|
{ text: t.agentProgress.explorerAgentSearching },
|
|
198
198
|
e
|
|
199
199
|
);
|
|
@@ -227,27 +227,27 @@ const rt = b.Root({
|
|
|
227
227
|
ackSequenceNumber: a.sequenceNumber,
|
|
228
228
|
inquiryId: a.inquiryId
|
|
229
229
|
}, l = "";
|
|
230
|
-
const d = async (
|
|
231
|
-
const u =
|
|
230
|
+
const d = async (g) => {
|
|
231
|
+
const u = g.context?.results?.[0]?.reply ?? "";
|
|
232
232
|
if (u !== "") {
|
|
233
|
-
const
|
|
234
|
-
l =
|
|
233
|
+
const b = st(u), S = it(b), A = nt(S, e);
|
|
234
|
+
l = A.source, n = [
|
|
235
235
|
...n,
|
|
236
|
-
...
|
|
237
|
-
(
|
|
236
|
+
...A.allMatches.filter(
|
|
237
|
+
(N) => !n.some((C) => C.solution.id === N.solution.id)
|
|
238
238
|
)
|
|
239
239
|
];
|
|
240
240
|
}
|
|
241
|
-
const
|
|
242
|
-
if (
|
|
243
|
-
let
|
|
244
|
-
|
|
241
|
+
const f = g.context?.results?.[0]?.status?.currentStatusStep;
|
|
242
|
+
if (f) {
|
|
243
|
+
let b = "";
|
|
244
|
+
f === 1 ? b = t.agentProgress.explorerAgentReading : f === 2 ? b = t.agentProgress.explorerAgentReviewing : f === 3 && (b = t.agentProgress.explorerAgentPreparing), await I({ text: b }, e);
|
|
245
245
|
}
|
|
246
246
|
};
|
|
247
247
|
for (await d(a); r.hasMore; ) {
|
|
248
248
|
if (ce(e))
|
|
249
249
|
return {};
|
|
250
|
-
await
|
|
250
|
+
await at(500), a = await Q(
|
|
251
251
|
{
|
|
252
252
|
conversationId: r.conversationId,
|
|
253
253
|
ackSequenceNumber: r.ackSequenceNumber,
|
|
@@ -263,7 +263,7 @@ const rt = b.Root({
|
|
|
263
263
|
inquiryId: a.inquiryId
|
|
264
264
|
}, await d(a);
|
|
265
265
|
}
|
|
266
|
-
return ve(e?.configurable?.context.portal) &&
|
|
266
|
+
return ve(e?.configurable?.context.portal) && we(
|
|
267
267
|
e?.configurable?.context.portal,
|
|
268
268
|
e?.configurable?.context.token ?? "",
|
|
269
269
|
e?.configurable?.context.configContext.locale ?? "en",
|
|
@@ -275,14 +275,14 @@ const rt = b.Root({
|
|
|
275
275
|
solutionResponse: r,
|
|
276
276
|
conversationId: r.conversationId
|
|
277
277
|
};
|
|
278
|
-
},
|
|
278
|
+
}, dt = async (s, e) => {
|
|
279
279
|
let t = null;
|
|
280
|
-
return s.documentSkillUrl === null && e?.configurable?.context?.portal && (t =
|
|
280
|
+
return s.documentSkillUrl === null && e?.configurable?.context?.portal && (t = ot(e.configurable.context.portal)), {
|
|
281
281
|
documentSkillUrl: t
|
|
282
282
|
};
|
|
283
283
|
};
|
|
284
|
-
await
|
|
285
|
-
const
|
|
284
|
+
await w(be, "solutions_explorer_description");
|
|
285
|
+
const _e = (s) => {
|
|
286
286
|
if (s && Array.isArray(s.id) && s.id.length > 0)
|
|
287
287
|
return s.id[s.id.length - 1].replace("Message", "").toLowerCase();
|
|
288
288
|
if (s && typeof s._getType == "function")
|
|
@@ -292,8 +292,8 @@ const we = (s) => {
|
|
|
292
292
|
return "human";
|
|
293
293
|
}
|
|
294
294
|
return "human";
|
|
295
|
-
},
|
|
296
|
-
const e =
|
|
295
|
+
}, pt = (s) => {
|
|
296
|
+
const e = _e(s);
|
|
297
297
|
if (s && s.kwargs)
|
|
298
298
|
return {
|
|
299
299
|
role: e,
|
|
@@ -308,10 +308,10 @@ const we = (s) => {
|
|
|
308
308
|
return s.id && (t.id = s.id), s.name && (t.name = s.name), s.additional_kwargs && (t.additional_kwargs = s.additional_kwargs), s.response_metadata && (t.response_metadata = s.response_metadata), t;
|
|
309
309
|
}
|
|
310
310
|
return { role: "human", content: String(s) };
|
|
311
|
-
},
|
|
312
|
-
builderMessages:
|
|
311
|
+
}, mt = (s) => _e(s) === "human", gt = (s, e = 3) => s.filter((t) => mt(t)).slice(-e).map(pt), ht = (s, e = " ") => gt(s).map((n) => n.content).join(e).trim(), ft = { 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?" }, yt = {
|
|
312
|
+
builderMessages: ft
|
|
313
313
|
};
|
|
314
|
-
class
|
|
314
|
+
class v {
|
|
315
315
|
//--------------------------------------------------------------------------
|
|
316
316
|
//
|
|
317
317
|
// Public API
|
|
@@ -514,7 +514,7 @@ class x {
|
|
|
514
514
|
if (o.isValid || this._tryFixName(o.errorType, n, (a) => {
|
|
515
515
|
this.response.solution.title = a;
|
|
516
516
|
}, "Solution title", "Solution Title") || this._logIssue(`Solution title is invalid (${o.errorType}).`), t) {
|
|
517
|
-
const a = H(t,
|
|
517
|
+
const a = H(t, v.DESCRIPTION_MAX_LENGTH, !0);
|
|
518
518
|
a.isValid || this._tryFixDescription(t, (r) => {
|
|
519
519
|
this.response.solution.description = r;
|
|
520
520
|
}, "Solution description") || this._logIssue(`Solution description is invalid (${a.errorType}).`);
|
|
@@ -529,7 +529,7 @@ class x {
|
|
|
529
529
|
if (t.isValid || this._tryFixName(t.errorType, e.title ?? "", (i) => {
|
|
530
530
|
e.title = i;
|
|
531
531
|
}, `Item '${e.id}' title`, "Item Title") || this._logIssue(`Item '${e.id}' title is invalid (${t.errorType}).`), e.description) {
|
|
532
|
-
const i = H(e.description,
|
|
532
|
+
const i = H(e.description, v.DESCRIPTION_MAX_LENGTH, !0);
|
|
533
533
|
i.isValid || this._tryFixDescription(e.description, (n) => {
|
|
534
534
|
e.description = n;
|
|
535
535
|
}, `Item '${e.id}' description`) || this._logIssue(`Item '${e.id}' description is invalid (${i.errorType}).`);
|
|
@@ -571,7 +571,7 @@ class x {
|
|
|
571
571
|
if (i.isValid || this._tryFixName(i.errorType, e.name ?? "", (n) => {
|
|
572
572
|
e.name = n;
|
|
573
573
|
}, `Layer '${e.name}' name`, "Layer Title") || this._logIssue(`Layer '${e.name}' name is invalid (${i.errorType}).`), e.description) {
|
|
574
|
-
const n = H(e.description,
|
|
574
|
+
const n = H(e.description, v.DESCRIPTION_MAX_LENGTH, !0);
|
|
575
575
|
n.isValid || this._tryFixDescription(e.description, (o) => {
|
|
576
576
|
e.description = o;
|
|
577
577
|
}, `Layer '${e.name}' description`) || this._logIssue(`Layer '${e.name}' description is invalid (${n.errorType}).`);
|
|
@@ -624,26 +624,26 @@ class x {
|
|
|
624
624
|
n || this._logIssue(`Field '${e.name}' does not start with a letter.`), o || this._logIssue(
|
|
625
625
|
`Field '${e.name}' contains invalid characters (only letters from any writing system, numbers, and underscores are allowed; emojis and punctuation are not allowed).`
|
|
626
626
|
);
|
|
627
|
-
if (e.name.length >
|
|
627
|
+
if (e.name.length > v.FIELD_NAME_MAX_LENGTH)
|
|
628
628
|
if (this.newDesign) {
|
|
629
629
|
const l = e.name;
|
|
630
|
-
e.name = this._getUniqueTruncatedFieldName(e.name, this.fieldNameRegistry), this.fieldNameRegistry.add(e.name.toLowerCase()), this._logAutoFix(`Field '${l}' exceeds ${
|
|
630
|
+
e.name = this._getUniqueTruncatedFieldName(e.name, this.fieldNameRegistry), this.fieldNameRegistry.add(e.name.toLowerCase()), this._logAutoFix(`Field '${l}' exceeds ${v.FIELD_NAME_MAX_LENGTH} characters. Auto-fixing to '${e.name}'.`);
|
|
631
631
|
} else
|
|
632
|
-
this._logIssue(`Field '${e.name}' exceeds ${
|
|
633
|
-
if (
|
|
632
|
+
this._logIssue(`Field '${e.name}' exceeds ${v.FIELD_NAME_MAX_LENGTH} characters.`);
|
|
633
|
+
if (Qe.has(e.name.toLowerCase()))
|
|
634
634
|
if (this.newDesign) {
|
|
635
635
|
const l = e.name;
|
|
636
636
|
e.name = this._getUniqueTruncatedFieldName(l, this.fieldNameRegistry), this.fieldNameRegistry.add(e.name.toLowerCase()), this._logAutoFix(`Field '${l}' is a SQL reserved keyword. Auto-fixing to '${e.name}'.`);
|
|
637
637
|
} else
|
|
638
638
|
this._logIssue(`Field '${e.name}' is a SQL reserved keyword.`);
|
|
639
|
-
if (
|
|
639
|
+
if (We.has(e.name.toLowerCase()))
|
|
640
640
|
if (this.newDesign) {
|
|
641
641
|
const l = e.name;
|
|
642
642
|
e.name = this._getUniqueTruncatedFieldName(l, this.fieldNameRegistry), this.fieldNameRegistry.add(e.name.toLowerCase()), this._logAutoFix(`Field '${l}' is a reserved system field name. Auto-fixing to '${e.name}'.`);
|
|
643
643
|
} else
|
|
644
644
|
this._logIssue(`Field '${e.name}' is a reserved system field name.`);
|
|
645
645
|
const a = e.type ?? "", r = a.toLowerCase();
|
|
646
|
-
if (a !== r && (e.type = r), !
|
|
646
|
+
if (a !== r && (e.type = r), !v.ALLOWED_FIELD_TYPES.has(r))
|
|
647
647
|
if (this.newDesign) {
|
|
648
648
|
const l = e.type;
|
|
649
649
|
r === "globalid" ? e.type = "guid" : r === "oid" ? e.type = "integer" : e.type = "string", this._logAutoFix(`Field '${e.name}' had unsupported type '${l}'. Auto-fixed to '${e.type}'.`);
|
|
@@ -687,7 +687,7 @@ class x {
|
|
|
687
687
|
return;
|
|
688
688
|
}
|
|
689
689
|
const t = e.length;
|
|
690
|
-
if (!
|
|
690
|
+
if (!Xe(t).isValid) {
|
|
691
691
|
const n = t > 4e3 ? 4e3 : 256;
|
|
692
692
|
this._handleInvalidStringFieldLength(e, n);
|
|
693
693
|
}
|
|
@@ -719,7 +719,7 @@ class x {
|
|
|
719
719
|
* appending a numeric suffix as needed.
|
|
720
720
|
*/
|
|
721
721
|
_getUniqueTruncatedFieldName(e, t) {
|
|
722
|
-
const i =
|
|
722
|
+
const i = v.FIELD_NAME_MAX_LENGTH, n = e.slice(0, i);
|
|
723
723
|
let o = n, a = 1;
|
|
724
724
|
for (; t.has(o.toLowerCase()); ) {
|
|
725
725
|
const r = `_${a}`, l = Math.max(1, i - r.length);
|
|
@@ -732,15 +732,15 @@ class x {
|
|
|
732
732
|
* collapsing whitespace, trimming, and truncating to the name length limit.
|
|
733
733
|
* May return an empty string when no valid characters remain.
|
|
734
734
|
*/
|
|
735
|
-
_sanitizeItemName(e, t =
|
|
736
|
-
let i = (e ?? "").replace(new RegExp(
|
|
735
|
+
_sanitizeItemName(e, t = v.NAME_MAX_LENGTH) {
|
|
736
|
+
let i = (e ?? "").replace(new RegExp(Ke.source, "gu"), "").replace(v.INVALID_NAME_CHARS, "").replace(/\s+/gu, " ").trim();
|
|
737
737
|
return i.length > t && (i = i.slice(0, t).trim()), i;
|
|
738
738
|
}
|
|
739
739
|
/**
|
|
740
740
|
* Sanitizes a description by stripping the disallowed `<` and `>` characters
|
|
741
741
|
* (forward slash is allowed) and truncating to the description length limit.
|
|
742
742
|
*/
|
|
743
|
-
_sanitizeDescription(e, t =
|
|
743
|
+
_sanitizeDescription(e, t = v.DESCRIPTION_MAX_LENGTH) {
|
|
744
744
|
let i = (e ?? "").replace(/[<>]/gu, "");
|
|
745
745
|
return i.length > t && (i = i.slice(0, t)), i;
|
|
746
746
|
}
|
|
@@ -788,11 +788,11 @@ class x {
|
|
|
788
788
|
console.debug(e), this.issues.push(e), this.isValid = !1;
|
|
789
789
|
}
|
|
790
790
|
}
|
|
791
|
-
const
|
|
791
|
+
const bt = c.object({
|
|
792
792
|
key: c.string().describe("Stable key identifier for the string."),
|
|
793
793
|
value: c.string().describe("Display value for the string."),
|
|
794
794
|
description: c.string().describe("Explanation of where/how the string is used.")
|
|
795
|
-
}),
|
|
795
|
+
}), xt = c.object({
|
|
796
796
|
id: c.string().describe("ArcGIS item id (32 hex characters)."),
|
|
797
797
|
title: c.string().describe("Item title."),
|
|
798
798
|
description: c.string().describe("Item description."),
|
|
@@ -824,7 +824,7 @@ const yt = c.object({
|
|
|
824
824
|
"List of allowed values for string fields with a controlled vocabulary. Null if unrestricted or not applicable."
|
|
825
825
|
),
|
|
826
826
|
length: c.number().int().nullable().describe("Maximum string length for string fields. Null for non-string fields.")
|
|
827
|
-
}),
|
|
827
|
+
}), vt = c.object({
|
|
828
828
|
id: c.number().int().describe("Layer/table id within the feature service."),
|
|
829
829
|
type: c.enum(["Point", "Polyline", "Polygon", "Table"]).describe("Layer type."),
|
|
830
830
|
typeMutable: c.boolean().describe("Indicates whether the layer type can be changed."),
|
|
@@ -832,10 +832,10 @@ const yt = c.object({
|
|
|
832
832
|
description: c.string().describe("Layer/table description."),
|
|
833
833
|
customFields: c.array(ue).describe("User/business fields specific to the solution."),
|
|
834
834
|
requiredFields: c.array(ue).describe("Fields required for solution functionality (e.g., relationship keys).")
|
|
835
|
-
}),
|
|
835
|
+
}), wt = c.object({
|
|
836
836
|
itemId: c.string().describe("ArcGIS item id for the feature layer."),
|
|
837
837
|
addLayers: c.boolean().describe("Indicates whether new layers can be added during solution design."),
|
|
838
|
-
layers: c.array(
|
|
838
|
+
layers: c.array(vt)
|
|
839
839
|
}), Z = c.object({
|
|
840
840
|
response: c.string().describe("Conversational response to the user's query."),
|
|
841
841
|
solution: c.object({
|
|
@@ -843,35 +843,35 @@ const yt = c.object({
|
|
|
843
843
|
title: c.string().describe("Title of the solution."),
|
|
844
844
|
description: c.string().describe("Description of the solution."),
|
|
845
845
|
tags: c.array(c.string()).describe("Keywords/tags associated with the solution."),
|
|
846
|
-
strings: c.array(
|
|
846
|
+
strings: c.array(bt).describe("Localized strings/labels used by apps (dashboards, forms, etc.).")
|
|
847
847
|
}),
|
|
848
|
-
items: c.array(
|
|
849
|
-
featureLayer:
|
|
848
|
+
items: c.array(xt).describe("ArcGIS items that belong to the solution (apps, maps, layers, etc.)."),
|
|
849
|
+
featureLayer: wt.describe("Primary feature layer item and its schema/layers/tables details.")
|
|
850
850
|
}), _t = c.object({
|
|
851
851
|
op: c.enum(["add", "remove", "replace", "move", "copy"]).describe("RFC 6902 operation type."),
|
|
852
852
|
path: c.string().describe("RFC 6901 JSON Pointer to the target location."),
|
|
853
853
|
value: c.string().nullable().describe(`JSON-encoded value to apply (required for add and replace). Must be null — not an empty string — for remove, move, and copy operations. Serialize as a JSON string, e.g. '\\"text\\"' for a string, '[\\"a\\",\\"b\\"]' for an array, or '{\\"name\\":\\"x\\"}' for an object.`),
|
|
854
854
|
from: c.string().nullable().describe("RFC 6901 JSON Pointer to the source location (required for move and copy). Must be null — not an empty string — for all other operations.")
|
|
855
|
-
}),
|
|
855
|
+
}), It = c.object({
|
|
856
856
|
response: c.string().describe("Conversational response describing the accepted design changes."),
|
|
857
857
|
patches: c.array(_t).describe("Minimal RFC 6902 patch operations needed to update the current design.")
|
|
858
|
-
}), It = c.object({
|
|
859
|
-
response: c.string().describe("Short, user-friendly explanation of why the requested update was not applied.")
|
|
860
858
|
}), St = c.object({
|
|
859
|
+
response: c.string().describe("Short, user-friendly explanation of why the requested update was not applied.")
|
|
860
|
+
}), At = c.object({
|
|
861
861
|
assistantResponse: c.string().describe("Natural-language response for the user."),
|
|
862
862
|
isValidUpdate: c.boolean().describe("True only when the request is in scope for supported design updates.")
|
|
863
|
-
}), At = c.object({
|
|
864
|
-
matchedTitles: c.array(c.string()).describe("Titles of solutions that match the user's request. Empty array if no strong match.")
|
|
865
863
|
}), Ct = c.object({
|
|
864
|
+
matchedTitles: c.array(c.string()).describe("Titles of solutions that match the user's request. Empty array if no strong match.")
|
|
865
|
+
}), Tt = c.object({
|
|
866
866
|
templateId: c.string().min(1).describe("Template id from the available template list."),
|
|
867
867
|
confidence: c.number().min(0).max(1).describe("Confidence score from 0 to 1 for this template match."),
|
|
868
868
|
templateDescription: c.string().min(1).describe("Short action‑oriented description of the template in the user's use case/workflow, starting with a verb.")
|
|
869
|
-
}),
|
|
869
|
+
}), Et = c.object({
|
|
870
870
|
assistantResponse: c.string().nullable().describe("Natural-language response for the user."),
|
|
871
871
|
isValidUseCase: c.boolean().describe("True only when the request is concrete, appropriate, and has at least one matching template."),
|
|
872
|
-
matchedTemplates: c.array(
|
|
872
|
+
matchedTemplates: c.array(Tt).describe("Ordered list of matching templates, best match first. Empty when no valid match exists.")
|
|
873
873
|
}), Lt = (s) => s.length ? s.map((e, t) => `${t + 1}. ${e}`).join(`
|
|
874
|
-
`) : "No validation errors were provided.",
|
|
874
|
+
`) : "No validation errors were provided.", $t = async (s) => {
|
|
875
875
|
const {
|
|
876
876
|
query: e,
|
|
877
877
|
validationIssues: t,
|
|
@@ -880,11 +880,11 @@ const yt = c.object({
|
|
|
880
880
|
promptModules: o
|
|
881
881
|
} = s;
|
|
882
882
|
try {
|
|
883
|
-
return (await
|
|
884
|
-
promptText: await
|
|
883
|
+
return (await E({
|
|
884
|
+
promptText: await w(o, "explainValidationFailure"),
|
|
885
885
|
modelTier: "fast",
|
|
886
886
|
temperature: 0,
|
|
887
|
-
schema:
|
|
887
|
+
schema: St,
|
|
888
888
|
messages: i,
|
|
889
889
|
inputVariables: {
|
|
890
890
|
query: e,
|
|
@@ -898,9 +898,9 @@ const yt = c.object({
|
|
|
898
898
|
{ error: a }
|
|
899
899
|
), n;
|
|
900
900
|
}
|
|
901
|
-
}, ee = (s) => s in
|
|
902
|
-
let
|
|
903
|
-
const
|
|
901
|
+
}, ee = (s) => s in D, kt = 5, Ft = 0.8, Nt = 0.5, Dt = "Web Mapping Application", Mt = "Embeddings";
|
|
902
|
+
let B = null, V = null, P = null, q = null;
|
|
903
|
+
const Rt = "Build", k = /* @__PURE__ */ Object.assign({
|
|
904
904
|
"./prompts/assessBuildRequest.md": () => import("../../chunks/assessBuildRequest.js").then((s) => s.default),
|
|
905
905
|
"./prompts/assessUpdateRequest.md": () => import("../../chunks/assessUpdateRequest.js").then((s) => s.default),
|
|
906
906
|
"./prompts/description.md": () => import("../../chunks/description2.js").then((s) => s.default),
|
|
@@ -908,13 +908,13 @@ const Mt = "Build", $ = /* @__PURE__ */ Object.assign({
|
|
|
908
908
|
"./prompts/explainValidationFailure.md": () => import("../../chunks/explainValidationFailure.js").then((s) => s.default),
|
|
909
909
|
"./prompts/findExistingSolution.md": () => import("../../chunks/findExistingSolution.js").then((s) => s.default),
|
|
910
910
|
"./prompts/updateDesign.md": () => import("../../chunks/updateDesign.js").then((s) => s.default)
|
|
911
|
-
}),
|
|
911
|
+
}), Bt = yt.builderMessages, h = (s) => s?.signal?.aborted ?? !1, y = (s, e, t) => O(e)?.builderMessages?.[s] ?? Bt[s], Ie = (s) => {
|
|
912
912
|
typeof window < "u" && window.dispatchEvent(new CustomEvent("arcgis-solution-design-update", {
|
|
913
913
|
detail: s
|
|
914
914
|
}));
|
|
915
915
|
}, Pt = async (s, e, t) => {
|
|
916
916
|
if (!s) return null;
|
|
917
|
-
const i = `type:"${
|
|
917
|
+
const i = `type:"${Dt}" AND typekeywords:${Mt} AND group:${s}`;
|
|
918
918
|
return (await Y.searchItems({
|
|
919
919
|
q: i,
|
|
920
920
|
params: e ? { token: e } : void 0,
|
|
@@ -922,27 +922,27 @@ const Mt = "Build", $ = /* @__PURE__ */ Object.assign({
|
|
|
922
922
|
num: 1
|
|
923
923
|
}))?.results?.[0] ?? null;
|
|
924
924
|
};
|
|
925
|
-
async function
|
|
925
|
+
async function qt(s, e, t, i) {
|
|
926
926
|
try {
|
|
927
927
|
const n = await Pt(s, e, t);
|
|
928
|
-
if (!n ||
|
|
928
|
+
if (!n || h(i))
|
|
929
929
|
return null;
|
|
930
|
-
const o = new
|
|
931
|
-
return await o.load(),
|
|
930
|
+
const o = new Ze({ id: n.id });
|
|
931
|
+
return await o.load(), h(i) ? null : await o.fetchData("json");
|
|
932
932
|
} catch {
|
|
933
933
|
return null;
|
|
934
934
|
}
|
|
935
935
|
}
|
|
936
|
-
const
|
|
936
|
+
const Ut = async (s, e, t) => {
|
|
937
937
|
if (!s) return [];
|
|
938
|
-
const i = `type:Solution AND typekeywords:${
|
|
938
|
+
const i = `type:Solution AND typekeywords:${Rt} AND group:${s}`;
|
|
939
939
|
return (await Y.searchItems({
|
|
940
940
|
q: i,
|
|
941
941
|
params: e ? { token: e } : void 0,
|
|
942
942
|
portal: t,
|
|
943
943
|
num: 100
|
|
944
944
|
}))?.results ?? [];
|
|
945
|
-
},
|
|
945
|
+
}, Ot = async (s, e, t) => {
|
|
946
946
|
try {
|
|
947
947
|
const i = await Y.getItemData(s, {
|
|
948
948
|
params: e ? { token: e } : void 0,
|
|
@@ -954,7 +954,7 @@ const qt = async (s, e, t) => {
|
|
|
954
954
|
} catch {
|
|
955
955
|
return null;
|
|
956
956
|
}
|
|
957
|
-
},
|
|
957
|
+
}, F = (s, e = {}) => {
|
|
958
958
|
let t = s;
|
|
959
959
|
return "itemId" in e && (t = {
|
|
960
960
|
...t,
|
|
@@ -986,46 +986,51 @@ const qt = async (s, e, t) => {
|
|
|
986
986
|
}
|
|
987
987
|
}, te = async (s) => {
|
|
988
988
|
if (V) {
|
|
989
|
-
Object.entries(V).forEach(([
|
|
990
|
-
|
|
989
|
+
Object.entries(V).forEach(([m, g]) => {
|
|
990
|
+
D[m] && (D[m].initialTemplate = g);
|
|
991
991
|
});
|
|
992
992
|
return;
|
|
993
993
|
}
|
|
994
|
-
const e = s?.configurable?.context?.token, t = Ce(s), i =
|
|
994
|
+
const e = s?.configurable?.context?.token, t = Ce(s), i = Ee(s);
|
|
995
995
|
if (!t) {
|
|
996
996
|
console.warn("Solution Builder: missing primarySolutionsGroupId in appConfig; skipping live template hydration.");
|
|
997
997
|
return;
|
|
998
998
|
}
|
|
999
|
-
const n =
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
999
|
+
const n = s?.configurable?.context.configContext.isEnterprise, o = Te(s), a = n ? o : t, r = n ? "https://www.arcgis.com/rest/sharing" : i;
|
|
1000
|
+
if (!a) {
|
|
1001
|
+
console.warn("Solution Builder: missing solutions group ID for templates; skipping template hydration.");
|
|
1002
|
+
return;
|
|
1003
|
+
}
|
|
1004
|
+
const l = await Ut(a, e, r), d = {};
|
|
1005
|
+
h(s) || (await Promise.all(l.map(async (m) => {
|
|
1006
|
+
const g = m.properties?.templateInfo;
|
|
1007
|
+
if (!g || typeof g != "object") return;
|
|
1008
|
+
const u = g.id;
|
|
1009
|
+
if (typeof u != "string" || d[u]) return;
|
|
1010
|
+
const f = await Ot(m.id, e, r);
|
|
1011
|
+
if (!f || h(s))
|
|
1007
1012
|
return;
|
|
1008
|
-
const { buildSolution:
|
|
1009
|
-
if (typeof
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1013
|
+
const { buildSolution: b, params: S } = f;
|
|
1014
|
+
if (typeof b == "object" && b !== null && "solution" in b) {
|
|
1015
|
+
const N = b.solution;
|
|
1016
|
+
N.thumbnailUrl = m.thumbnail ? `${i ?? "https://www.arcgis.com/sharing/rest"}/content/items/${m.id}/info/${m.thumbnail}` : void 0, N.item = m;
|
|
1012
1017
|
}
|
|
1013
|
-
const
|
|
1014
|
-
...
|
|
1015
|
-
buildSolution:
|
|
1018
|
+
const A = {
|
|
1019
|
+
...g,
|
|
1020
|
+
buildSolution: b
|
|
1016
1021
|
};
|
|
1017
|
-
|
|
1018
|
-
new pe(
|
|
1022
|
+
d[u] = F(
|
|
1023
|
+
new pe(A).dumpToLlmTemplate(),
|
|
1019
1024
|
{
|
|
1020
|
-
itemId:
|
|
1021
|
-
sourceBuildSolution: structuredClone(
|
|
1022
|
-
params:
|
|
1025
|
+
itemId: m.id,
|
|
1026
|
+
sourceBuildSolution: structuredClone(b),
|
|
1027
|
+
params: S ? structuredClone(S) : null
|
|
1023
1028
|
}
|
|
1024
|
-
),
|
|
1025
|
-
...
|
|
1026
|
-
initialTemplate:
|
|
1029
|
+
), D[u] = {
|
|
1030
|
+
...g,
|
|
1031
|
+
initialTemplate: d[u]
|
|
1027
1032
|
};
|
|
1028
|
-
})), V =
|
|
1033
|
+
})), V = d);
|
|
1029
1034
|
}, Ae = (s) => {
|
|
1030
1035
|
const e = s?.configurable?.context?.token;
|
|
1031
1036
|
return typeof e != "string" || !e.trim() ? null : e;
|
|
@@ -1033,48 +1038,54 @@ const qt = async (s, e, t) => {
|
|
|
1033
1038
|
const e = s?.configurable?.context?.configContext?.primarySolutionsGroupId;
|
|
1034
1039
|
return typeof e != "string" || !e.trim() ? null : e;
|
|
1035
1040
|
}, Te = (s) => {
|
|
1041
|
+
const e = s?.configurable?.context?.configContext?.agoBasedEnterpriseSolutionsGroupId;
|
|
1042
|
+
return typeof e != "string" || !e.trim() ? null : e;
|
|
1043
|
+
}, Ee = (s) => {
|
|
1036
1044
|
const e = s?.configurable?.context?.configContext?.portalURL;
|
|
1037
1045
|
if (!(typeof e != "string" || !e.trim()))
|
|
1038
1046
|
return `${e.replace(/\/+$/, "")}/sharing/rest`;
|
|
1039
|
-
},
|
|
1047
|
+
}, zt = async (s) => {
|
|
1040
1048
|
await Promise.all([
|
|
1041
|
-
|
|
1049
|
+
$e(s),
|
|
1042
1050
|
te(s)
|
|
1043
1051
|
]);
|
|
1044
1052
|
}, Le = async (s) => {
|
|
1045
1053
|
const e = Ae(s);
|
|
1046
|
-
(!P || e && e !==
|
|
1047
|
-
throw P = null,
|
|
1054
|
+
(!P || e && e !== q) && (q = e ?? q, P = zt(s).catch((i) => {
|
|
1055
|
+
throw P = null, q = null, i;
|
|
1048
1056
|
})), await P;
|
|
1049
1057
|
};
|
|
1050
|
-
async function
|
|
1051
|
-
if (
|
|
1058
|
+
async function $e(s) {
|
|
1059
|
+
if (B) return B;
|
|
1052
1060
|
const e = Ce(s);
|
|
1053
1061
|
if (!e)
|
|
1054
1062
|
return console.warn("Solution Builder: missing primarySolutionsGroupId in appConfig; skipping embeddings load."), null;
|
|
1055
|
-
const t =
|
|
1056
|
-
if (await new
|
|
1063
|
+
const t = Ee(s), i = s?.configurable?.context?.configContext?.portalURL;
|
|
1064
|
+
if (await new Ye(i ? { url: i } : void 0).load(), h(s))
|
|
1057
1065
|
return null;
|
|
1058
|
-
const o = Ae(s) ?? void 0, a =
|
|
1059
|
-
|
|
1066
|
+
const o = Ae(s) ?? void 0, a = s?.configurable?.context.configContext.isEnterprise, r = Te(s), l = a ? r : e, d = a ? "https://www.arcgis.com/rest/sharing" : t;
|
|
1067
|
+
if (!l)
|
|
1068
|
+
return console.warn("Solution Builder: missing solutions group ID for embeddings; skipping embeddings load."), null;
|
|
1069
|
+
const m = await qt(l, o, d, s);
|
|
1070
|
+
return h(s) ? null : m ? (B = m.items, B) : null;
|
|
1060
1071
|
}
|
|
1061
|
-
const
|
|
1072
|
+
const jt = () => Object.entries(D).map(([s, e]) => `ID: ${s}
|
|
1062
1073
|
Label: ${e.label}
|
|
1063
1074
|
Description: ${e.description}`).join(`
|
|
1064
1075
|
|
|
1065
|
-
`),
|
|
1076
|
+
`), Gt = (s) => {
|
|
1066
1077
|
const e = s?.configurable?.context?.solutionDesignJson;
|
|
1067
1078
|
if (typeof e != "string" || !e.trim())
|
|
1068
1079
|
return null;
|
|
1069
1080
|
try {
|
|
1070
|
-
const t = JSON.parse(e), i =
|
|
1081
|
+
const t = JSON.parse(e), i = F(
|
|
1071
1082
|
{ response: "", ...t },
|
|
1072
1083
|
{ itemId: t?.solution?.itemId ?? null }
|
|
1073
1084
|
), n = Z.safeParse(i);
|
|
1074
1085
|
if (!n.success)
|
|
1075
1086
|
return null;
|
|
1076
1087
|
const { response: o, ...a } = n.data, r = t.templateId, l = typeof r == "string" && ee(r) ? r : null;
|
|
1077
|
-
return
|
|
1088
|
+
return F(
|
|
1078
1089
|
a,
|
|
1079
1090
|
{
|
|
1080
1091
|
sourceBuildSolution: t.sourceBuildSolution,
|
|
@@ -1085,57 +1096,57 @@ Description: ${e.description}`).join(`
|
|
|
1085
1096
|
} catch {
|
|
1086
1097
|
return null;
|
|
1087
1098
|
}
|
|
1088
|
-
},
|
|
1099
|
+
}, Jt = x.Root({
|
|
1089
1100
|
...X(),
|
|
1090
1101
|
/** Optional human-readable template description retained for UI use. */
|
|
1091
|
-
templateDescription:
|
|
1102
|
+
templateDescription: x({
|
|
1092
1103
|
reducer: (s, e) => typeof e == "string" || e === null ? e : s ?? null,
|
|
1093
1104
|
default: () => null
|
|
1094
1105
|
}),
|
|
1095
1106
|
/** Current editable design payload being refined across turns. */
|
|
1096
|
-
currentDesign:
|
|
1107
|
+
currentDesign: x({
|
|
1097
1108
|
reducer: (s = null, e) => e === void 0 ? s : e ?? null,
|
|
1098
1109
|
default: () => null
|
|
1099
1110
|
}),
|
|
1100
1111
|
/** Initial request assessment produced by the intake prompt. */
|
|
1101
|
-
assessment:
|
|
1112
|
+
assessment: x({
|
|
1102
1113
|
reducer: (s = null, e) => e === void 0 ? s : e ?? null,
|
|
1103
1114
|
default: () => null
|
|
1104
1115
|
}),
|
|
1105
1116
|
/** Template selected automatically or by human-in-the-loop choice. */
|
|
1106
|
-
selectedTemplate:
|
|
1117
|
+
selectedTemplate: x({
|
|
1107
1118
|
reducer: (s = null, e) => e === void 0 ? s : e ?? null,
|
|
1108
1119
|
default: () => null
|
|
1109
1120
|
}),
|
|
1110
1121
|
/** Update request assessment produced when an active design exists. */
|
|
1111
|
-
updateAssessment:
|
|
1122
|
+
updateAssessment: x({
|
|
1112
1123
|
reducer: (s = null, e) => e === void 0 ? s : e ?? null,
|
|
1113
1124
|
default: () => null
|
|
1114
1125
|
}),
|
|
1115
1126
|
/** Existing solution matches surfaced before building a new solution. */
|
|
1116
|
-
existingMatches:
|
|
1127
|
+
existingMatches: x({
|
|
1117
1128
|
reducer: (s = [], e) => e === void 0 ? s : e ?? [],
|
|
1118
1129
|
default: () => []
|
|
1119
1130
|
}),
|
|
1120
1131
|
/** User decision for whether to continue building after existing matches are shown. */
|
|
1121
|
-
continueBuilding:
|
|
1132
|
+
continueBuilding: x({
|
|
1122
1133
|
reducer: (s = null, e) => e === void 0 ? s : e ?? null,
|
|
1123
1134
|
default: () => null
|
|
1124
1135
|
})
|
|
1125
|
-
}),
|
|
1126
|
-
if (
|
|
1136
|
+
}), Ht = (s, e) => {
|
|
1137
|
+
if (h(e))
|
|
1127
1138
|
return {};
|
|
1128
|
-
const t =
|
|
1139
|
+
const t = Gt(e), i = t?.templateId ?? null, n = {};
|
|
1129
1140
|
return JSON.stringify(s.currentDesign) !== JSON.stringify(t) && (n.currentDesign = t), i && s.selectedTemplate !== i && (n.selectedTemplate = i), n;
|
|
1130
|
-
},
|
|
1131
|
-
if (
|
|
1141
|
+
}, Vt = async (s, e) => {
|
|
1142
|
+
if (h(e))
|
|
1132
1143
|
return {};
|
|
1133
|
-
await
|
|
1134
|
-
const t = s.agentExecutionContext.userRequest, i =
|
|
1135
|
-
promptText: await
|
|
1144
|
+
await I({ text: y("understandingRequest", e) }, e), await Le(e);
|
|
1145
|
+
const t = s.agentExecutionContext.userRequest, i = jt(), n = s.agentExecutionContext.messages.slice(-11), o = await E({
|
|
1146
|
+
promptText: await w(k, "assessBuildRequest"),
|
|
1136
1147
|
modelTier: "advanced",
|
|
1137
1148
|
temperature: 0,
|
|
1138
|
-
schema:
|
|
1149
|
+
schema: Et,
|
|
1139
1150
|
messages: n,
|
|
1140
1151
|
inputVariables: { query: t, availableTemplates: i }
|
|
1141
1152
|
}), a = o.matchedTemplates.filter(
|
|
@@ -1143,22 +1154,22 @@ Description: ${e.description}`).join(`
|
|
|
1143
1154
|
), r = {
|
|
1144
1155
|
...o,
|
|
1145
1156
|
matchedTemplates: a
|
|
1146
|
-
}, [l, d] = a,
|
|
1157
|
+
}, [l, d] = a, g = !!l && l.confidence >= Ft && (d === void 0 || l.confidence - d.confidence >= Nt) ? l.templateId : null;
|
|
1147
1158
|
return {
|
|
1148
1159
|
assessment: r,
|
|
1149
|
-
selectedTemplate:
|
|
1160
|
+
selectedTemplate: g,
|
|
1150
1161
|
existingMatches: [],
|
|
1151
1162
|
continueBuilding: null
|
|
1152
1163
|
};
|
|
1153
|
-
},
|
|
1164
|
+
}, Qt = (s) => {
|
|
1154
1165
|
const e = s.assessment?.assistantResponse ?? "";
|
|
1155
1166
|
return {
|
|
1156
1167
|
outputMessage: e,
|
|
1157
1168
|
summary: e,
|
|
1158
1169
|
status: "success"
|
|
1159
1170
|
};
|
|
1160
|
-
},
|
|
1161
|
-
if (
|
|
1171
|
+
}, Wt = async (s, e) => {
|
|
1172
|
+
if (h(e))
|
|
1162
1173
|
return {};
|
|
1163
1174
|
const { currentDesign: t } = s;
|
|
1164
1175
|
if (!t)
|
|
@@ -1168,14 +1179,14 @@ Description: ${e.description}`).join(`
|
|
|
1168
1179
|
isValidUpdate: !0
|
|
1169
1180
|
}
|
|
1170
1181
|
};
|
|
1171
|
-
await
|
|
1182
|
+
await I({ text: y("understandingRequest", e) }, e);
|
|
1172
1183
|
const i = s.agentExecutionContext.userRequest, n = s.agentExecutionContext.messages.slice(-11);
|
|
1173
1184
|
return {
|
|
1174
|
-
updateAssessment: await
|
|
1175
|
-
promptText: await
|
|
1185
|
+
updateAssessment: await E({
|
|
1186
|
+
promptText: await w(k, "assessUpdateRequest"),
|
|
1176
1187
|
modelTier: "advanced",
|
|
1177
1188
|
temperature: 0,
|
|
1178
|
-
schema:
|
|
1189
|
+
schema: At,
|
|
1179
1190
|
messages: n,
|
|
1180
1191
|
inputVariables: {
|
|
1181
1192
|
currentDesign: JSON.stringify(me(t)),
|
|
@@ -1183,15 +1194,15 @@ Description: ${e.description}`).join(`
|
|
|
1183
1194
|
}
|
|
1184
1195
|
})
|
|
1185
1196
|
};
|
|
1186
|
-
},
|
|
1187
|
-
const t = s.updateAssessment?.assistantResponse ??
|
|
1197
|
+
}, Kt = (s, e) => {
|
|
1198
|
+
const t = s.updateAssessment?.assistantResponse ?? y("applyChangeFailed", e);
|
|
1188
1199
|
return {
|
|
1189
1200
|
outputMessage: t,
|
|
1190
1201
|
summary: t,
|
|
1191
1202
|
status: "success"
|
|
1192
1203
|
};
|
|
1193
|
-
},
|
|
1194
|
-
if (
|
|
1204
|
+
}, Xt = (s, e) => {
|
|
1205
|
+
if (h(e))
|
|
1195
1206
|
return {};
|
|
1196
1207
|
const { hitlResponse: t } = e.configurable, i = "selectTemplate", n = s.assessment?.matchedTemplates.filter(
|
|
1197
1208
|
(d) => ee(d.templateId)
|
|
@@ -1201,7 +1212,7 @@ Description: ${e.description}`).join(`
|
|
|
1201
1212
|
agentId: "solutionBuilder",
|
|
1202
1213
|
id: i,
|
|
1203
1214
|
kind: "singleSelection",
|
|
1204
|
-
message:
|
|
1215
|
+
message: y("selectTemplatePrompt", e),
|
|
1205
1216
|
metadata: [...o]
|
|
1206
1217
|
};
|
|
1207
1218
|
throw new de(d);
|
|
@@ -1210,26 +1221,26 @@ Description: ${e.description}`).join(`
|
|
|
1210
1221
|
return {
|
|
1211
1222
|
selectedTemplate: (r >= 0 ? n[r] : void 0)?.templateId ?? n[0]?.templateId ?? null
|
|
1212
1223
|
};
|
|
1213
|
-
},
|
|
1214
|
-
if (
|
|
1224
|
+
}, Yt = async (s, e) => {
|
|
1225
|
+
if (h(e))
|
|
1215
1226
|
return {};
|
|
1216
|
-
await
|
|
1217
|
-
const t = s.agentExecutionContext.userRequest, i = ht(s.agentExecutionContext.messages) || t, n = await
|
|
1218
|
-
if (
|
|
1227
|
+
await I({ text: y("searchingExistingSolutions", e) }, e);
|
|
1228
|
+
const t = s.agentExecutionContext.userRequest, i = ht(s.agentExecutionContext.messages) || t, n = await $e(e);
|
|
1229
|
+
if (h(e))
|
|
1219
1230
|
return {};
|
|
1220
1231
|
if (!n)
|
|
1221
1232
|
return console.warn("Solutions Search: failed to load solution embeddings cache; skipping search."), { existingMatches: [] };
|
|
1222
1233
|
if (!n.length)
|
|
1223
1234
|
return { existingMatches: [] };
|
|
1224
|
-
const [o] = await
|
|
1225
|
-
if (
|
|
1235
|
+
const [o] = await Ge([i]);
|
|
1236
|
+
if (h(e))
|
|
1226
1237
|
return {};
|
|
1227
1238
|
const a = n.map((u) => ({
|
|
1228
1239
|
solution: u,
|
|
1229
|
-
score:
|
|
1240
|
+
score: Je(o, u.embedding)
|
|
1230
1241
|
}));
|
|
1231
|
-
a.sort((u,
|
|
1232
|
-
const r = a.slice(0,
|
|
1242
|
+
a.sort((u, f) => f.score - u.score);
|
|
1243
|
+
const r = a.slice(0, kt);
|
|
1233
1244
|
if (!r.length)
|
|
1234
1245
|
return { existingMatches: [] };
|
|
1235
1246
|
const l = r.map(({ solution: u }) => `${u.title}
|
|
@@ -1237,127 +1248,127 @@ Snippet: ${u.snippet}
|
|
|
1237
1248
|
Description: ${u.description}`).join(`
|
|
1238
1249
|
|
|
1239
1250
|
`), d = s.agentExecutionContext.messages.slice(-11);
|
|
1240
|
-
return { existingMatches: (await
|
|
1241
|
-
promptText: await
|
|
1251
|
+
return { existingMatches: (await E({
|
|
1252
|
+
promptText: await w(k, "findExistingSolution"),
|
|
1242
1253
|
modelTier: "fast",
|
|
1243
1254
|
temperature: 0,
|
|
1244
|
-
schema:
|
|
1255
|
+
schema: Ct,
|
|
1245
1256
|
messages: d,
|
|
1246
1257
|
inputVariables: { query: t, candidates: l }
|
|
1247
|
-
})).matchedTitles.map((u) => r.find(({ solution:
|
|
1248
|
-
},
|
|
1249
|
-
if (
|
|
1258
|
+
})).matchedTitles.map((u) => r.find(({ solution: f }) => f.title === u)).filter((u) => u !== void 0) };
|
|
1259
|
+
}, Zt = (s, e) => {
|
|
1260
|
+
if (h(e))
|
|
1250
1261
|
return {};
|
|
1251
1262
|
const { existingMatches: t } = s, { hitlResponse: i } = e.configurable, n = `confirmExistingSolution:${t[0].solution.id}`;
|
|
1252
1263
|
if (i?.agentId !== "solutionBuilder" || i.id !== n) {
|
|
1253
1264
|
t.length === 1 ? ye(t[0].solution.id) : fe(t);
|
|
1254
|
-
const l =
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
],
|
|
1265
|
+
const l = y("existingSolutionMatch", e), d = [
|
|
1266
|
+
y("continueBuildingYes", e),
|
|
1267
|
+
y("continueBuildingNo", e)
|
|
1268
|
+
], m = {
|
|
1258
1269
|
agentId: "solutionBuilder",
|
|
1259
1270
|
id: n,
|
|
1260
1271
|
kind: "singleSelection",
|
|
1261
1272
|
message: l,
|
|
1262
1273
|
metadata: d
|
|
1263
1274
|
};
|
|
1264
|
-
throw new de(
|
|
1275
|
+
throw new de(m);
|
|
1265
1276
|
}
|
|
1266
|
-
const o = String(i.payload ?? "").trim(), a =
|
|
1277
|
+
const o = String(i.payload ?? "").trim(), a = y("continueBuildingNo", e);
|
|
1267
1278
|
return { continueBuilding: o !== a };
|
|
1268
|
-
},
|
|
1269
|
-
const t =
|
|
1279
|
+
}, es = (s, e) => {
|
|
1280
|
+
const t = y("continueBuildingDeclined", e);
|
|
1270
1281
|
return {
|
|
1271
1282
|
outputMessage: t,
|
|
1272
1283
|
summary: t,
|
|
1273
1284
|
status: "success"
|
|
1274
1285
|
};
|
|
1275
|
-
},
|
|
1276
|
-
if (
|
|
1286
|
+
}, ke = async (s, e) => {
|
|
1287
|
+
if (h(e))
|
|
1277
1288
|
return {};
|
|
1278
|
-
if (await Le(e),
|
|
1289
|
+
if (await Le(e), h(e))
|
|
1279
1290
|
return {};
|
|
1280
1291
|
const { currentDesign: t } = s, i = s.agentExecutionContext.userRequest;
|
|
1281
|
-
await
|
|
1282
|
-
let n =
|
|
1283
|
-
if (n?.initialTemplate || (await te(e), n =
|
|
1292
|
+
await I({ text: y("creatingDesign", e) }, e);
|
|
1293
|
+
let n = U(s.selectedTemplate);
|
|
1294
|
+
if (n?.initialTemplate || (await te(e), n = U(s.selectedTemplate)), h(e))
|
|
1284
1295
|
return {};
|
|
1285
1296
|
if (!n?.initialTemplate)
|
|
1286
1297
|
throw new Error("No hydrated templates are available for solution design.");
|
|
1287
|
-
const o =
|
|
1298
|
+
const o = F(
|
|
1288
1299
|
t ?? n.initialTemplate,
|
|
1289
1300
|
{
|
|
1290
1301
|
itemId: (t ?? n.initialTemplate)?.solution?.itemId ?? null,
|
|
1291
1302
|
sourceBuildSolution: t?.sourceBuildSolution ?? n.initialTemplate.sourceBuildSolution,
|
|
1292
1303
|
params: t?.params ?? n.initialTemplate.params ?? null
|
|
1293
1304
|
}
|
|
1294
|
-
), a = s.agentExecutionContext.messages.slice(-11), r = await
|
|
1295
|
-
promptText: await
|
|
1305
|
+
), a = s.agentExecutionContext.messages.slice(-11), r = await E({
|
|
1306
|
+
promptText: await w(k, "designSolution"),
|
|
1296
1307
|
modelTier: "advanced",
|
|
1297
1308
|
temperature: 0,
|
|
1298
1309
|
schema: Z,
|
|
1299
1310
|
messages: a,
|
|
1300
1311
|
inputVariables: {
|
|
1301
|
-
currentDesign: JSON.stringify(
|
|
1312
|
+
currentDesign: JSON.stringify(ge(o)),
|
|
1302
1313
|
templateInstructions: n.instructions,
|
|
1303
1314
|
query: i
|
|
1304
1315
|
}
|
|
1305
1316
|
});
|
|
1306
|
-
if (await
|
|
1317
|
+
if (await I({ text: " of design solution 1" }, e), h(e))
|
|
1307
1318
|
return {};
|
|
1308
|
-
const { response: l, featureLayer: d, ...
|
|
1319
|
+
const { response: l, featureLayer: d, ...m } = r, g = he(
|
|
1309
1320
|
d,
|
|
1310
1321
|
o.featureLayer
|
|
1311
|
-
), u =
|
|
1312
|
-
{ ...
|
|
1322
|
+
), u = F(
|
|
1323
|
+
{ ...m, featureLayer: g },
|
|
1313
1324
|
{
|
|
1314
1325
|
itemId: o?.solution?.itemId,
|
|
1315
1326
|
sourceBuildSolution: o.sourceBuildSolution,
|
|
1316
1327
|
templateId: s.selectedTemplate ?? null,
|
|
1317
1328
|
params: o.params ?? null
|
|
1318
1329
|
}
|
|
1319
|
-
),
|
|
1320
|
-
if (!
|
|
1330
|
+
), f = new v(u, n.initialTemplate);
|
|
1331
|
+
if (!f.isValid)
|
|
1321
1332
|
return console.warn(
|
|
1322
1333
|
"[SolutionBuilder] designSolution validation failed:",
|
|
1323
|
-
{ issues:
|
|
1334
|
+
{ issues: f.issues, llmResponse: r }
|
|
1324
1335
|
), {
|
|
1325
|
-
outputMessage:
|
|
1336
|
+
outputMessage: y("createDesignFailed", e)
|
|
1326
1337
|
};
|
|
1327
|
-
const
|
|
1328
|
-
if (!
|
|
1338
|
+
const b = u.sourceBuildSolution, S = Se(u, b);
|
|
1339
|
+
if (!S.ok) {
|
|
1329
1340
|
console.warn(
|
|
1330
1341
|
"[SolutionBuilder] designSolution Esri JSON conversion failed:",
|
|
1331
|
-
{ error:
|
|
1342
|
+
{ error: S.error, llmResponse: r, design: u }
|
|
1332
1343
|
);
|
|
1333
|
-
const
|
|
1344
|
+
const A = y("createDesignFailed", e);
|
|
1334
1345
|
return {
|
|
1335
|
-
outputMessage:
|
|
1336
|
-
summary:
|
|
1346
|
+
outputMessage: A,
|
|
1347
|
+
summary: A,
|
|
1337
1348
|
status: "success"
|
|
1338
1349
|
};
|
|
1339
1350
|
}
|
|
1340
|
-
return
|
|
1351
|
+
return h(e) ? {} : (Ie(u), {
|
|
1341
1352
|
outputMessage: l,
|
|
1342
1353
|
summary: l,
|
|
1343
1354
|
status: "success",
|
|
1344
1355
|
currentDesign: u
|
|
1345
1356
|
});
|
|
1346
|
-
},
|
|
1347
|
-
if (
|
|
1357
|
+
}, ts = async (s, e) => {
|
|
1358
|
+
if (h(e))
|
|
1348
1359
|
return {};
|
|
1349
1360
|
const { currentDesign: t } = s;
|
|
1350
1361
|
if (!t)
|
|
1351
|
-
return
|
|
1362
|
+
return ke(s, e);
|
|
1352
1363
|
const i = s.agentExecutionContext.userRequest, n = s.agentExecutionContext.messages.slice(-11);
|
|
1353
|
-
await
|
|
1364
|
+
await I({ text: y("updatingDesign", e) }, e);
|
|
1354
1365
|
let o;
|
|
1355
1366
|
try {
|
|
1356
|
-
o = await
|
|
1357
|
-
promptText: await
|
|
1367
|
+
o = await E({
|
|
1368
|
+
promptText: await w(k, "updateDesign"),
|
|
1358
1369
|
modelTier: "advanced",
|
|
1359
1370
|
temperature: 0,
|
|
1360
|
-
schema:
|
|
1371
|
+
schema: It,
|
|
1361
1372
|
messages: n,
|
|
1362
1373
|
inputVariables: {
|
|
1363
1374
|
currentDesign: JSON.stringify(me(t)),
|
|
@@ -1366,7 +1377,7 @@ Description: ${u.description}`).join(`
|
|
|
1366
1377
|
});
|
|
1367
1378
|
} catch (p) {
|
|
1368
1379
|
console.warn("[SolutionBuilder] updateDesign structured prompt failed:", p);
|
|
1369
|
-
const _ =
|
|
1380
|
+
const _ = y("applyChangeFailed", e);
|
|
1370
1381
|
return {
|
|
1371
1382
|
outputMessage: _,
|
|
1372
1383
|
summary: _,
|
|
@@ -1407,49 +1418,49 @@ Description: ${u.description}`).join(`
|
|
|
1407
1418
|
return p;
|
|
1408
1419
|
}
|
|
1409
1420
|
}
|
|
1410
|
-
},
|
|
1421
|
+
}, m = [...r.map((p) => ({
|
|
1411
1422
|
op: p.op,
|
|
1412
1423
|
path: p.path.replace(/\/+$/, ""),
|
|
1413
1424
|
...p.value != null && p.value !== "" ? { value: l(p.value) } : {},
|
|
1414
1425
|
...p.from != null && p.from !== "" ? { from: p.from } : {}
|
|
1415
|
-
}))].sort((p, _) => p.op !== "remove" || _.op !== "remove" ? 0 : _.path.localeCompare(p.path, void 0, { numeric: !0 })),
|
|
1416
|
-
|
|
1426
|
+
}))].sort((p, _) => p.op !== "remove" || _.op !== "remove" ? 0 : _.path.localeCompare(p.path, void 0, { numeric: !0 })), g = structuredClone(
|
|
1427
|
+
ge(t)
|
|
1417
1428
|
);
|
|
1418
1429
|
try {
|
|
1419
|
-
|
|
1430
|
+
Ve(g, m, !0);
|
|
1420
1431
|
} catch (p) {
|
|
1421
1432
|
console.warn(
|
|
1422
1433
|
"[SolutionBuilder] updateDesign JSON patch failed:",
|
|
1423
|
-
{ error: p, llmResponse: o, patches:
|
|
1434
|
+
{ error: p, llmResponse: o, patches: m, patchTarget: g }
|
|
1424
1435
|
);
|
|
1425
|
-
const _ =
|
|
1436
|
+
const _ = y("applyChangeFailed", e);
|
|
1426
1437
|
return {
|
|
1427
1438
|
outputMessage: _,
|
|
1428
1439
|
summary: _,
|
|
1429
1440
|
status: "success"
|
|
1430
1441
|
};
|
|
1431
1442
|
}
|
|
1432
|
-
const u =
|
|
1433
|
-
{ response: "", ...
|
|
1443
|
+
const u = F(
|
|
1444
|
+
{ response: "", ...g },
|
|
1434
1445
|
{ itemId: t.solution?.itemId ?? null }
|
|
1435
|
-
),
|
|
1436
|
-
if (!
|
|
1446
|
+
), f = Z.safeParse(u);
|
|
1447
|
+
if (!f.success) {
|
|
1437
1448
|
console.warn(
|
|
1438
1449
|
"[SolutionBuilder] updateDesign schema validation failed:",
|
|
1439
|
-
{ errors:
|
|
1450
|
+
{ errors: f.error.issues, llmResponse: o, patchedDesign: u }
|
|
1440
1451
|
);
|
|
1441
|
-
const p =
|
|
1452
|
+
const p = y("applyChangeFailed", e);
|
|
1442
1453
|
return {
|
|
1443
1454
|
outputMessage: p,
|
|
1444
1455
|
summary: p,
|
|
1445
1456
|
status: "success"
|
|
1446
1457
|
};
|
|
1447
1458
|
}
|
|
1448
|
-
const { response:
|
|
1449
|
-
|
|
1459
|
+
const { response: b, featureLayer: S, ...A } = f.data, N = he(
|
|
1460
|
+
S,
|
|
1450
1461
|
t.featureLayer
|
|
1451
|
-
),
|
|
1452
|
-
{ ...
|
|
1462
|
+
), C = F(
|
|
1463
|
+
{ ...A, featureLayer: N },
|
|
1453
1464
|
{
|
|
1454
1465
|
itemId: t.solution?.itemId,
|
|
1455
1466
|
sourceBuildSolution: t.sourceBuildSolution,
|
|
@@ -1457,23 +1468,23 @@ Description: ${u.description}`).join(`
|
|
|
1457
1468
|
params: t.params ?? null
|
|
1458
1469
|
}
|
|
1459
1470
|
);
|
|
1460
|
-
let
|
|
1461
|
-
if (
|
|
1471
|
+
let M = U(s.selectedTemplate);
|
|
1472
|
+
if (M?.initialTemplate || (await te(e), M = U(s.selectedTemplate)), h(e))
|
|
1462
1473
|
return {};
|
|
1463
|
-
if (!
|
|
1474
|
+
if (!M?.initialTemplate)
|
|
1464
1475
|
throw new Error("No hydrated templates are available for solution design.");
|
|
1465
|
-
const j = new
|
|
1476
|
+
const j = new v(C, M.initialTemplate, !1);
|
|
1466
1477
|
if (!j.isValid) {
|
|
1467
1478
|
console.warn(
|
|
1468
1479
|
"[SolutionBuilder] updateDesign validation failed:",
|
|
1469
|
-
{ issues: j.issues, llmResponse: o, patchedDesign:
|
|
1480
|
+
{ issues: j.issues, llmResponse: o, patchedDesign: C }
|
|
1470
1481
|
);
|
|
1471
|
-
const p = await
|
|
1482
|
+
const p = await $t({
|
|
1472
1483
|
query: i,
|
|
1473
1484
|
validationIssues: j.issues,
|
|
1474
1485
|
recentMessages: n,
|
|
1475
|
-
fallbackMessage:
|
|
1476
|
-
promptModules:
|
|
1486
|
+
fallbackMessage: y("applyChangeFailed", e),
|
|
1487
|
+
promptModules: k
|
|
1477
1488
|
});
|
|
1478
1489
|
return {
|
|
1479
1490
|
outputMessage: p,
|
|
@@ -1481,52 +1492,52 @@ Description: ${u.description}`).join(`
|
|
|
1481
1492
|
status: "success"
|
|
1482
1493
|
};
|
|
1483
1494
|
}
|
|
1484
|
-
const
|
|
1495
|
+
const Ne = C.sourceBuildSolution, ne = Se(C, Ne);
|
|
1485
1496
|
if (!ne.ok) {
|
|
1486
1497
|
console.warn(
|
|
1487
1498
|
"[SolutionBuilder] updateDesign Esri JSON conversion failed:",
|
|
1488
|
-
{ error: ne.error, llmResponse: o, design:
|
|
1499
|
+
{ error: ne.error, llmResponse: o, design: C }
|
|
1489
1500
|
);
|
|
1490
|
-
const p =
|
|
1501
|
+
const p = y("applyChangeFailed", e);
|
|
1491
1502
|
return {
|
|
1492
1503
|
outputMessage: p,
|
|
1493
1504
|
summary: p,
|
|
1494
1505
|
status: "success"
|
|
1495
1506
|
};
|
|
1496
1507
|
}
|
|
1497
|
-
return
|
|
1508
|
+
return h(e) ? {} : (Ie(C), {
|
|
1498
1509
|
outputMessage: a,
|
|
1499
1510
|
summary: a,
|
|
1500
1511
|
status: "success",
|
|
1501
|
-
currentDesign:
|
|
1512
|
+
currentDesign: C
|
|
1502
1513
|
});
|
|
1503
|
-
},
|
|
1514
|
+
}, ss = (s) => s.currentDesign !== null ? "assessUpdateRequest" : "assessBuildRequest", is = (s) => !s.updateAssessment || !s.updateAssessment.isValidUpdate ? "invalidUpdateExit" : "updateDesign", ns = (s) => !s.assessment || !s.assessment.isValidUseCase ? "invalidBuildExit" : !s.selectedTemplate && s.assessment.matchedTemplates.length > 1 ? "selectTemplateHIL" : "findExistingSolutions", os = (s) => s.existingMatches.length > 0 ? "confirmContinueBuildingHIL" : "designSolution", as = (s) => s.continueBuilding === !1 ? "declineContinueBuildingExit" : "designSolution", rs = () => new W(Jt).addNode("syncCurrentDesignFromContext", Ht).addNode("assessBuildRequest", Vt).addNode("assessUpdateRequest", Wt).addNode("invalidBuildExit", Qt).addNode("invalidUpdateExit", Kt).addNode("selectTemplateHIL", Xt).addNode("findExistingSolutions", Yt).addNode("confirmContinueBuildingHIL", Zt).addNode("declineContinueBuildingExit", es).addNode("designSolution", ke).addNode("updateDesign", ts).addEdge(K, "syncCurrentDesignFromContext").addConditionalEdges("syncCurrentDesignFromContext", ss, {
|
|
1504
1515
|
assessUpdateRequest: "assessUpdateRequest",
|
|
1505
1516
|
assessBuildRequest: "assessBuildRequest"
|
|
1506
|
-
}).addConditionalEdges("assessUpdateRequest",
|
|
1517
|
+
}).addConditionalEdges("assessUpdateRequest", is, {
|
|
1507
1518
|
invalidUpdateExit: "invalidUpdateExit",
|
|
1508
1519
|
updateDesign: "updateDesign"
|
|
1509
|
-
}).addConditionalEdges("assessBuildRequest",
|
|
1520
|
+
}).addConditionalEdges("assessBuildRequest", ns, {
|
|
1510
1521
|
invalidBuildExit: "invalidBuildExit",
|
|
1511
1522
|
selectTemplateHIL: "selectTemplateHIL",
|
|
1512
1523
|
findExistingSolutions: "findExistingSolutions"
|
|
1513
|
-
}).addEdge("invalidBuildExit",
|
|
1524
|
+
}).addEdge("invalidBuildExit", T).addEdge("invalidUpdateExit", T).addEdge("selectTemplateHIL", "findExistingSolutions").addConditionalEdges("findExistingSolutions", os, {
|
|
1514
1525
|
confirmContinueBuildingHIL: "confirmContinueBuildingHIL",
|
|
1515
1526
|
designSolution: "designSolution"
|
|
1516
|
-
}).addConditionalEdges("confirmContinueBuildingHIL",
|
|
1527
|
+
}).addConditionalEdges("confirmContinueBuildingHIL", as, {
|
|
1517
1528
|
declineContinueBuildingExit: "declineContinueBuildingExit",
|
|
1518
1529
|
designSolution: "designSolution"
|
|
1519
|
-
}).addEdge("declineContinueBuildingExit",
|
|
1520
|
-
await
|
|
1521
|
-
const
|
|
1522
|
-
tool:
|
|
1523
|
-
confidence:
|
|
1524
|
-
rationale:
|
|
1525
|
-
}),
|
|
1530
|
+
}).addEdge("declineContinueBuildingExit", T).addEdge("designSolution", T).addEdge("updateDesign", T);
|
|
1531
|
+
await w(k, "description");
|
|
1532
|
+
const ls = $.object({
|
|
1533
|
+
tool: $.enum(["explorer", "builder", "other"]).describe("The selected tool based on the user’s intent using the conversation context."),
|
|
1534
|
+
confidence: $.number().min(0).max(1).describe("A confidence score (0.00–1.00)."),
|
|
1535
|
+
rationale: $.string().min(1).describe("A brief rationale for the tool choice (≤140 characters)")
|
|
1536
|
+
}), z = (s) => s?.signal?.aborted ?? !1, se = /* @__PURE__ */ Object.assign({
|
|
1526
1537
|
"./prompts/assistantResponse.md": () => import("../../chunks/assistantResponse.js").then((s) => s.default),
|
|
1527
1538
|
"./prompts/classifyIntent.md": () => import("../../chunks/classifyIntent.js").then((s) => s.default),
|
|
1528
1539
|
"./prompts/description.md": () => import("../../chunks/description.js").then((s) => s.default)
|
|
1529
|
-
}),
|
|
1540
|
+
}), cs = (s) => {
|
|
1530
1541
|
const e = s?.configurable?.context?.solutionDesignJson, t = s?.configurable?.context?.lastTurnAgent, i = t === "assistant" ? "other" : t;
|
|
1531
1542
|
let n = !1;
|
|
1532
1543
|
if (typeof e == "string" && e.trim())
|
|
@@ -1543,29 +1554,29 @@ const rs = E.object({
|
|
|
1543
1554
|
detail: { finished: !0, agent: e }
|
|
1544
1555
|
});
|
|
1545
1556
|
window.dispatchEvent(i);
|
|
1546
|
-
},
|
|
1557
|
+
}, Fe = x.Root({
|
|
1547
1558
|
...X(),
|
|
1548
|
-
selectedTool:
|
|
1559
|
+
selectedTool: x({
|
|
1549
1560
|
reducer: (s, e) => e ?? null,
|
|
1550
1561
|
default: () => null
|
|
1551
1562
|
}),
|
|
1552
|
-
intentRationale:
|
|
1563
|
+
intentRationale: x({
|
|
1553
1564
|
reducer: (s, e) => e ?? null,
|
|
1554
1565
|
default: () => null
|
|
1555
1566
|
})
|
|
1556
|
-
}),
|
|
1557
|
-
if (
|
|
1567
|
+
}), us = async (s, e) => {
|
|
1568
|
+
if (z(e))
|
|
1558
1569
|
return {};
|
|
1559
|
-
const t =
|
|
1560
|
-
await
|
|
1570
|
+
const t = O(e);
|
|
1571
|
+
await I(
|
|
1561
1572
|
{ text: t?.builderMessages.understandingRequest },
|
|
1562
1573
|
e
|
|
1563
1574
|
);
|
|
1564
|
-
const i = s.agentExecutionContext.userRequest, n = s.agentExecutionContext.messages.slice(-11), { activeSolutionDesign: o, lastTool: a } =
|
|
1575
|
+
const i = s.agentExecutionContext.userRequest, n = s.agentExecutionContext.messages.slice(-11), { activeSolutionDesign: o, lastTool: a } = cs(e), r = await w(se, "classifyIntent"), l = await E({
|
|
1565
1576
|
promptText: r,
|
|
1566
1577
|
modelTier: "advanced",
|
|
1567
1578
|
temperature: 0,
|
|
1568
|
-
schema:
|
|
1579
|
+
schema: ls,
|
|
1569
1580
|
messages: n,
|
|
1570
1581
|
inputVariables: { query: i, activeSolutionDesign: o, lastTool: a }
|
|
1571
1582
|
});
|
|
@@ -1573,25 +1584,25 @@ const rs = E.object({
|
|
|
1573
1584
|
selectedTool: l.tool,
|
|
1574
1585
|
intentRationale: l.rationale
|
|
1575
1586
|
};
|
|
1576
|
-
},
|
|
1577
|
-
if (
|
|
1587
|
+
}, ds = async (s, e) => {
|
|
1588
|
+
if (z(e))
|
|
1578
1589
|
return {};
|
|
1579
|
-
const i = await
|
|
1590
|
+
const i = await ct().compile().invoke(s, e);
|
|
1580
1591
|
return ie(e, "explorer"), i;
|
|
1581
|
-
},
|
|
1582
|
-
if (
|
|
1592
|
+
}, ps = async (s, e) => {
|
|
1593
|
+
if (z(e))
|
|
1583
1594
|
return {};
|
|
1584
|
-
const i = await
|
|
1595
|
+
const i = await rs().compile().invoke(s, e);
|
|
1585
1596
|
return ie(e, "builder"), i;
|
|
1586
|
-
},
|
|
1587
|
-
if (
|
|
1597
|
+
}, ms = async (s, e) => {
|
|
1598
|
+
if (z(e))
|
|
1588
1599
|
return {};
|
|
1589
|
-
const t =
|
|
1590
|
-
await
|
|
1600
|
+
const t = O(e), i = s.agentExecutionContext.userRequest;
|
|
1601
|
+
await I(
|
|
1591
1602
|
{ text: t?.executingSolutionsAssistantAgent },
|
|
1592
1603
|
e
|
|
1593
1604
|
);
|
|
1594
|
-
const n = await
|
|
1605
|
+
const n = await w(se, "assistantResponse"), o = s.agentExecutionContext.messages.slice(-11), a = await He({
|
|
1595
1606
|
promptText: n,
|
|
1596
1607
|
modelTier: "advanced",
|
|
1597
1608
|
temperature: 0,
|
|
@@ -1603,31 +1614,31 @@ const rs = E.object({
|
|
|
1603
1614
|
summary: a,
|
|
1604
1615
|
status: "success"
|
|
1605
1616
|
};
|
|
1606
|
-
},
|
|
1617
|
+
}, gs = (s) => s.selectedTool ?? "other", hs = () => new W(Fe).addNode("classifyIntent", us).addNode("routeToExplorer", ds).addNode("routeToBuilder", ps).addNode("assistantResponse", ms).addEdge(K, "classifyIntent").addConditionalEdges("classifyIntent", gs, {
|
|
1607
1618
|
explorer: "routeToExplorer",
|
|
1608
1619
|
builder: "routeToBuilder",
|
|
1609
1620
|
other: "assistantResponse"
|
|
1610
|
-
}).addEdge("routeToExplorer",
|
|
1621
|
+
}).addEdge("routeToExplorer", T).addEdge("routeToBuilder", T).addEdge("assistantResponse", T), fs = await w(se, "description"), ys = {
|
|
1611
1622
|
id: "solutionsAssistant",
|
|
1612
1623
|
name: "Solutions Assistant Agent",
|
|
1613
|
-
description:
|
|
1624
|
+
description: fs,
|
|
1614
1625
|
createGraph: hs,
|
|
1615
|
-
workspace:
|
|
1616
|
-
},
|
|
1617
|
-
class
|
|
1626
|
+
workspace: Fe
|
|
1627
|
+
}, bs = "https://links.esri.com/solutions/agol-organizational-account", xs = "https://links.esri.com/solutions/configure-assistants";
|
|
1628
|
+
class vs extends Re {
|
|
1618
1629
|
constructor() {
|
|
1619
1630
|
super(), this.open = !1, this.userFirstName = "", this.builderVisible = !1, this.hasActiveBuilderDesign = !1, this._conversationId = void 0, this._lastTurnAgent = void 0, this._lastResponseAgent = void 0, this._orgSettings = {
|
|
1620
1631
|
aiAssistantsEnabled: !1,
|
|
1621
1632
|
blockBetaApps: !0,
|
|
1622
1633
|
colocateCompute: !1
|
|
1623
|
-
}, this._suggestedPrompts = [], this._hasInteracted = !1, this._isMobile = window.innerWidth <= 800, this._translations =
|
|
1624
|
-
context:
|
|
1634
|
+
}, this._suggestedPrompts = [], this._hasInteracted = !1, this._isMobile = window.innerWidth <= 800, this._translations = Me({ name: "arcgis-solutions-assistant", blocking: !0 }), this._builderWidth = 48, this._solutionDesignJson = '{ "solution": null }', this._isAssistantBusy = !1, this._isBuilderBusy = !1, this._preChatCheck = !1, this._showNewChatConfirm = !1, this._assistantRef = ze(), this._configContextConsumer = le({
|
|
1635
|
+
context: qe,
|
|
1625
1636
|
subscribe: !0,
|
|
1626
1637
|
callback: (e) => {
|
|
1627
1638
|
e?.portalURL && (G.portalUrl = e.portalURL), e?.userSession && !this.userFirstName && this._loadUserFirstName(), e?.authentication?.PortalSubset?.orgSettings && (this._orgSettings = e?.authentication?.PortalSubset?.orgSettings);
|
|
1628
1639
|
}
|
|
1629
1640
|
}), this._builderDesignContextConsumer = le({
|
|
1630
|
-
context:
|
|
1641
|
+
context: Ue,
|
|
1631
1642
|
subscribe: !0,
|
|
1632
1643
|
callback: (e) => {
|
|
1633
1644
|
e?.design && (this._solutionDesignJson = JSON.stringify(e.design, null, 2));
|
|
@@ -1639,9 +1650,9 @@ class xs extends Me {
|
|
|
1639
1650
|
if (t.detail?.finished && this._chatStartTime !== null) {
|
|
1640
1651
|
const i = t.detail.agent;
|
|
1641
1652
|
this._lastResponseAgent = i, this._pendingResponseAgent = i;
|
|
1642
|
-
const n =
|
|
1653
|
+
const n = Oe(this._chatStartTime);
|
|
1643
1654
|
this._telemetry?.logEvent({
|
|
1644
|
-
category:
|
|
1655
|
+
category: R.ASSISTANT,
|
|
1645
1656
|
action: "Chat",
|
|
1646
1657
|
dimensions: [i],
|
|
1647
1658
|
metrics: [n]
|
|
@@ -1673,7 +1684,7 @@ class xs extends Me {
|
|
|
1673
1684
|
this.properties = { open: 5, userFirstName: 1, builderVisible: 5, hasActiveBuilderDesign: 5, _conversationId: 16, _lastTurnAgent: 16, _lastResponseAgent: 16, _orgSettings: 16, _suggestedPrompts: 16, _hasInteracted: 16, _isMobile: 16, _translations: 16, _builderWidth: 16, _solutionDesignJson: 16, _isAssistantBusy: 16, _isBuilderBusy: 16, _preChatCheck: 16, _showNewChatConfirm: 16 };
|
|
1674
1685
|
}
|
|
1675
1686
|
static {
|
|
1676
|
-
this.styles =
|
|
1687
|
+
this.styles = et;
|
|
1677
1688
|
}
|
|
1678
1689
|
get _telemetry() {
|
|
1679
1690
|
return this._configContextConsumer.value?.telemetrySession;
|
|
@@ -1694,19 +1705,19 @@ class xs extends Me {
|
|
|
1694
1705
|
this._loadUserFirstName();
|
|
1695
1706
|
}
|
|
1696
1707
|
willUpdate(e) {
|
|
1697
|
-
e.has("open") && this.open && window.dispatchEvent(new CustomEvent("openAssistant")), this._configContextConsumer.value?.authentication && this._configContextConsumer.value?.userSession?.token && (this._preChatCheck || (
|
|
1708
|
+
e.has("open") && this.open && window.dispatchEvent(new CustomEvent("openAssistant")), this._configContextConsumer.value?.authentication && this._configContextConsumer.value?.userSession?.token && (this._preChatCheck || (we(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;
|
|
1698
1709
|
}
|
|
1699
1710
|
_renderNoSign() {
|
|
1700
1711
|
return L`<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 ?? re} class="padding-top-10">${this._translations.signIn}</calcite-link></calcite-notice>`;
|
|
1701
1712
|
}
|
|
1702
1713
|
_renderNoPermission() {
|
|
1703
|
-
return L`<calcite-notice class="margin-lg" open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${Pe(this._translations.noPermissionMessage.replace("{{orgUrl}}",
|
|
1714
|
+
return L`<calcite-notice class="margin-lg" open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${Pe(this._translations.noPermissionMessage.replace("{{orgUrl}}", bs).replace("{{configAI}}", xs))}</div></calcite-notice>`;
|
|
1704
1715
|
}
|
|
1705
1716
|
render() {
|
|
1706
1717
|
let e = this._suggestedPrompts.length > 0 ? this._suggestedPrompts : this._hasInteracted ? [] : Object.values(this._translations.defaultFollowUpQuestions);
|
|
1707
1718
|
return this._suggestedPrompts.length > 0 ? e = this._suggestedPrompts : this._hasInteracted || (e = [...Object.values(this._translations.defaultFollowUpQuestions)]), L`<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 ? L`${!this._isMobile && L`<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=${() => {
|
|
1708
1719
|
this._telemetry?.logEvent({
|
|
1709
|
-
category:
|
|
1720
|
+
category: R.ASSISTANT,
|
|
1710
1721
|
action: "Toggle Builder Panel",
|
|
1711
1722
|
dimensions: [this.builderVisible ? "Close" : "Open"]
|
|
1712
1723
|
}), window.dispatchEvent(new CustomEvent("toggleSolutionBuilder"));
|
|
@@ -1727,13 +1738,13 @@ class xs extends Me {
|
|
|
1727
1738
|
requestAnimationFrame(() => i(1));
|
|
1728
1739
|
}
|
|
1729
1740
|
this.assistantProcessing.emit(!1);
|
|
1730
|
-
}} ${
|
|
1741
|
+
}} ${je(this._assistantRef)}><calcite-button appearance=transparent id=newChatButton icon-start=speech-bubble-plus kind=neutral .label=${this._translations.tooltips.newChat} @click=${() => {
|
|
1731
1742
|
this.hasActiveBuilderDesign ? this._showNewChatConfirm = !0 : (this._telemetry?.logEvent({
|
|
1732
|
-
category:
|
|
1743
|
+
category: R.ASSISTANT,
|
|
1733
1744
|
action: "New Chat",
|
|
1734
1745
|
dimensions: ["No Active Design"]
|
|
1735
1746
|
}), this._clearConversation());
|
|
1736
|
-
}} round scale=m slot=entry-actions-start>${this._translations.tooltips.newChat}</calcite-button><arcgis-assistant-agent .agent=${
|
|
1747
|
+
}} round scale=m slot=entry-actions-start>${this._translations.tooltips.newChat}</calcite-button><arcgis-assistant-agent .agent=${ys} .context=${{
|
|
1737
1748
|
token: this._configContextConsumer.value?.userSession?.token,
|
|
1738
1749
|
configContext: this._configContextConsumer.value,
|
|
1739
1750
|
convoId: this._conversationId,
|
|
@@ -1755,7 +1766,7 @@ class xs extends Me {
|
|
|
1755
1766
|
this._showNewChatConfirm = !1;
|
|
1756
1767
|
}} slot=footer-end>${this._translations.cancel}</calcite-button><calcite-button appearance=solid kind=danger @click=${() => {
|
|
1757
1768
|
this._telemetry?.logEvent({
|
|
1758
|
-
category:
|
|
1769
|
+
category: R.ASSISTANT,
|
|
1759
1770
|
action: "New Chat",
|
|
1760
1771
|
dimensions: ["With Design Discard"]
|
|
1761
1772
|
}), this._showNewChatConfirm = !1, window.dispatchEvent(new CustomEvent("requestBuilderDiscard"));
|
|
@@ -1799,14 +1810,14 @@ class xs extends Me {
|
|
|
1799
1810
|
return !1;
|
|
1800
1811
|
}
|
|
1801
1812
|
_parseAgentPickedAndTask(e) {
|
|
1802
|
-
const t = Array.from(this._assistantRef.value?.messages || []), i = e.log || [], a = [...t].sort((u,
|
|
1813
|
+
const t = Array.from(this._assistantRef.value?.messages || []), i = e.log || [], a = [...t].sort((u, f) => f.id - u.id).find((u) => u.role === "user" && u.id <= e.id)?.content || null, r = i.find((u) => typeof u == "string" && u.includes("Agent picked:")) ?? null;
|
|
1803
1814
|
if (!r)
|
|
1804
1815
|
return { agentPicked: null, taskAssigned: null, userMessage: a };
|
|
1805
1816
|
const l = /Agent picked:\s*(.*?)\s*(?:\\n|\r?\n)\s*Task Assigned:\s*([\s\S]*)$/i, d = r.match(l);
|
|
1806
1817
|
if (!d)
|
|
1807
1818
|
return { agentPicked: null, taskAssigned: null, userMessage: a };
|
|
1808
|
-
const
|
|
1809
|
-
return { agentPicked:
|
|
1819
|
+
const m = d[1].trim(), g = d[2].trim();
|
|
1820
|
+
return { agentPicked: m, taskAssigned: g, userMessage: a };
|
|
1810
1821
|
}
|
|
1811
1822
|
_emitItemIdFromAI(e) {
|
|
1812
1823
|
const t = new CustomEvent("solutionIDFromAssistant", {
|
|
@@ -1817,7 +1828,7 @@ class xs extends Me {
|
|
|
1817
1828
|
window.dispatchEvent(t);
|
|
1818
1829
|
}
|
|
1819
1830
|
}
|
|
1820
|
-
|
|
1831
|
+
De("arcgis-solutions-assistant", vs);
|
|
1821
1832
|
export {
|
|
1822
|
-
|
|
1833
|
+
vs as ArcgisSolutionsAssistant
|
|
1823
1834
|
};
|