@esri/solutions-components 5.1.0-next.142 → 5.1.0-next.144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{D4MZYBH7.js → 4JGB6WLL.js} +1 -1
- package/dist/cdn/{7NAC32PQ.js → 4MAZNAHZ.js} +1 -1
- package/dist/cdn/{Z6UCVV4K.js → 4RLG6MXK.js} +1 -1
- package/dist/cdn/56A5UMZG.js +9 -0
- package/dist/cdn/{WCOEPRRK.js → 56XVVIG7.js} +1 -1
- package/dist/cdn/{W5FWW67G.js → 5LIR6BQY.js} +1 -1
- package/dist/cdn/{UVOAWVML.js → 5MPYPIR2.js} +1 -1
- package/dist/cdn/{LLPT3R4B.js → 5YXQ4UXZ.js} +27 -27
- package/dist/cdn/{UFPB7JD3.js → 65L2LQGD.js} +1 -1
- package/dist/cdn/{HO4GBQJG.js → 6Z3DXRF6.js} +1 -1
- package/dist/cdn/{HT2HC33W.js → 7FJTZ7VA.js} +1 -1
- package/dist/cdn/{GPL6FNKN.js → 7GXMCAWQ.js} +1 -1
- package/dist/cdn/{E5EU4SVV.js → 7WD3GNG4.js} +1 -1
- package/dist/cdn/{3UJAJDSF.js → AGB374BK.js} +1 -1
- package/dist/cdn/{2KSXH2TC.js → AHB7W7RI.js} +1 -1
- package/dist/cdn/{6ID6N5BF.js → BGLTC5SO.js} +1 -1
- package/dist/cdn/{SSH4MSHE.js → BVSSQNES.js} +1 -1
- package/dist/cdn/{CEWRVOKP.js → C4OXBZJK.js} +1 -1
- package/dist/cdn/CGCNGFBL.js +2 -0
- package/dist/cdn/{SXVCHOTK.js → DFZZNKPK.js} +3 -6
- package/dist/cdn/{B33EUN4X.js → DKEYOEI7.js} +1 -1
- package/dist/cdn/{5UIJ4Z3C.js → DNPN62O5.js} +1 -1
- package/dist/cdn/{KEOBSFBN.js → EPOIEXNS.js} +1 -1
- package/dist/cdn/{FV4F6RW3.js → FE2GEHNL.js} +1 -1
- package/dist/cdn/{JMCZPJDW.js → FVOCVCEE.js} +1 -1
- package/dist/cdn/H2UL463J.js +2 -0
- package/dist/cdn/{FMTXVLZB.js → I22C4HE4.js} +1 -1
- package/dist/cdn/{SRT2KXZG.js → IEOFEUZI.js} +1 -1
- package/dist/cdn/{P2TNN5UL.js → J3HJC4SO.js} +1 -1
- package/dist/cdn/K4TDKKPB.js +18 -0
- package/dist/cdn/{23LRX7AS.js → KSQHSNTW.js} +1 -1
- package/dist/cdn/{CB7QDBRG.js → KUGXNF5Y.js} +1 -1
- package/dist/cdn/{52QHFDTC.js → LEK4P4OY.js} +1 -1
- package/dist/cdn/LKZFKOG4.js +2 -0
- package/dist/cdn/{RYEEEMFO.js → LYAXTCCM.js} +1 -1
- package/dist/cdn/LYK2CASU.js +2 -0
- package/dist/cdn/{TFTW5B3R.js → MC5ARLKZ.js} +1 -1
- package/dist/cdn/{DNZ5U52C.js → MT5J66WR.js} +1 -1
- package/dist/cdn/{IFI66PVI.js → MVF7I3RU.js} +1 -1
- package/dist/cdn/{F3NG6RFP.js → NIHPHDXG.js} +31 -18
- package/dist/cdn/{ZIX74MNU.js → PPRV6EZZ.js} +1 -1
- package/dist/cdn/{PZW6JMSM.js → PUCDO65D.js} +1 -1
- package/dist/cdn/Q5TICZRX.js +15 -0
- package/dist/cdn/{GSD6O5J7.js → QHDEVLC3.js} +1 -1
- package/dist/cdn/{HNWINTTY.js → QQEYWBVV.js} +1 -1
- package/dist/cdn/{CUJ3M6UT.js → RRD4QUQS.js} +1 -1
- package/dist/cdn/{GWWU6HWB.js → RSCBZIAN.js} +17 -19
- package/dist/cdn/{UY5JVVRO.js → S5AQVTR2.js} +1 -1
- package/dist/cdn/{H7J2FXMS.js → SGQBWAPU.js} +1 -1
- package/dist/cdn/{MEDCFXMB.js → SOLCNPHW.js} +1 -1
- package/dist/cdn/{BQE2XAKC.js → SSIUWTQX.js} +1 -1
- package/dist/cdn/{34JROLRM.js → SYZEWVHU.js} +1 -1
- package/dist/cdn/{KGSB4I6Y.js → TWJSFINX.js} +1 -1
- package/dist/cdn/{VEDAG7UO.js → TX3LBQ6V.js} +1 -1
- package/dist/cdn/{TIRNZIMX.js → U4RHWD57.js} +1 -1
- package/dist/cdn/{UM3P3Q52.js → U6JZYJ4D.js} +1 -1
- package/dist/cdn/{PQNFWMST.js → ULFPP7PF.js} +1 -1
- package/dist/cdn/{N5D5ABJ6.js → UOGZGAJD.js} +1 -1
- package/dist/cdn/{NWCKV677.js → VBJSVR6T.js} +1 -1
- package/dist/cdn/WGS5W6W5.js +2 -0
- package/dist/cdn/{RPEQD2MH.js → WLM4HMMF.js} +1 -1
- package/dist/cdn/{MOH6GREK.js → X6JL6SAH.js} +1 -1
- package/dist/cdn/{DGNAMFJN.js → XBFG3KX6.js} +6 -2
- package/dist/cdn/{TIF36KTA.js → XXGM7HGO.js} +1 -1
- package/dist/cdn/{BLCW2CZO.js → Y77RX7KL.js} +1 -1
- package/dist/cdn/{ATHNXWV4.js → YLC2EM5A.js} +115 -115
- package/dist/cdn/{ICSHJV2N.js → ZCSF2MJ5.js} +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/solution-builder-assistant/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/solution-deployed-card/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/Auth.js +1 -1
- package/dist/chunks/CardsFetcher.js +2 -2
- package/dist/chunks/assistantResponse.js +17 -19
- package/dist/chunks/cardsHelpers.js +12 -12
- package/dist/chunks/classifyIntent.js +31 -18
- package/dist/chunks/description.js +7 -3
- package/dist/chunks/designSolution.js +1 -1
- package/dist/chunks/downloadUtils.js +5 -5
- package/dist/chunks/getRelatedInfos.js +1 -1
- package/dist/chunks/helpers.js +75 -55
- package/dist/chunks/initialAssessment.js +3 -6
- package/dist/chunks/interfaces.js +45 -41
- package/dist/chunks/mapViewUtils.js +9 -9
- package/dist/chunks/popupUtils.js +1 -1
- package/dist/chunks/queryUtils.js +3 -3
- package/dist/chunks/responseOptionsBuilderExclusion.js +12 -0
- package/dist/chunks/responseOptionsDefault.js +18 -0
- package/dist/chunks/solution-builder-assistant.js +15 -15
- package/dist/chunks/solution-deploy-dialog.js +157 -153
- package/dist/chunks/solutions-deploy-app-nav.js +3 -4
- package/dist/chunks/templates.js +6 -6
- package/dist/chunks/updateDesign.js +1 -1
- package/dist/chunks/validators.js +6 -6
- package/dist/components/arcgis-solutions-assistant/customElement.d.ts +8 -0
- package/dist/components/arcgis-solutions-assistant/customElement.js +414 -359
- package/dist/components/arcgis-solutions-assistant/index.js +1 -0
- package/dist/components/card-manager/customElement.js +6 -6
- package/dist/components/create-feature/customElement.js +1 -1
- package/dist/components/crowdsource-manager/customElement.js +1 -1
- package/dist/components/crowdsource-reporter/customElement.js +2 -2
- package/dist/components/edit-card/customElement.js +1 -1
- package/dist/components/feature-details/customElement.js +1 -1
- package/dist/components/feature-list/customElement.js +1 -1
- package/dist/components/layer-list/customElement.js +1 -1
- package/dist/components/layer-table/customElement.js +2 -2
- package/dist/components/map-card/customElement.js +2 -2
- package/dist/components/map-layer-picker/customElement.js +1 -1
- package/dist/components/map-select-tools/customElement.js +2 -2
- package/dist/components/pdf-download/customElement.js +1 -1
- package/dist/components/public-notification/customElement.js +2 -2
- package/dist/components/refine-selection/customElement.js +2 -2
- package/dist/components/selection-tool/customElement.js +1 -1
- package/dist/components/solution-builder-assistant/customElement.d.ts +6 -2
- package/dist/components/solution-configure-titles/customElement.js +6 -6
- package/dist/components/solution-delete-dialog/customElement.js +2 -2
- package/dist/components/solution-deployed-card/customElement.js +2 -2
- package/dist/components/solution-deployed-card-panel/customElement.js +3 -3
- package/dist/components/solution-details-card/customElement.js +2 -2
- package/dist/components/solution-details-panel/customElement.js +2 -2
- package/dist/components/solution-resource-card/customElement.js +1 -1
- package/dist/components/solution-snapshot-gallery/customElement.js +2 -2
- package/dist/components/solution-social-share/customElement.js +1 -1
- package/dist/components/solution-user-avatar/customElement.js +1 -1
- package/dist/components/solutions-all-panel/customElement.js +1 -1
- package/dist/components/solutions-deploy-app/customElement.js +160 -32
- package/dist/components/solutions-deploy-app/index.js +1 -1
- package/dist/components/solutions-deployed-list/customElement.js +1 -1
- package/dist/components/solutions-deployed-panel/customElement.js +1 -1
- package/dist/components/solutions-deployed-shell/customElement.js +1 -1
- package/dist/components/solutions-filter-panel/customElement.js +1 -1
- package/dist/components/solutions-searchsort-toolbar/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/solutions-components_commit.txt +7 -7
- package/dist/utils/interfaces.d.ts +1 -6
- package/package.json +1 -1
- package/dist/cdn/4WJ2UJWQ.js +0 -2
- package/dist/cdn/EXC566PM.js +0 -2
- package/dist/cdn/PUQBEN7F.js +0 -18
- package/dist/cdn/SFFLZSAY.js +0 -2
- package/dist/cdn/XC3IZAIH.js +0 -2
- package/dist/cdn/YM3CRTWP.js +0 -2
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import { c as Ce } from "../../chunks/runtime.js";
|
|
3
3
|
import { u as _e } from "../../chunks/useT9n.js";
|
|
4
|
-
import { LitElement as ke, createEvent as
|
|
5
|
-
import { css as
|
|
6
|
-
import { unsafeHTML as
|
|
7
|
-
import { useContextConsumer as
|
|
8
|
-
import { c as Ae, b as
|
|
9
|
-
import { T as
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import { createRef as $e, ref as
|
|
13
|
-
import {
|
|
14
|
-
import { createAgentRuntimeState as j, sendTraceMessage as
|
|
15
|
-
import r, { z as
|
|
4
|
+
import { LitElement as ke, createEvent as Z, nothing as X } from "@arcgis/lumina";
|
|
5
|
+
import { css as Ee, html as k } from "lit";
|
|
6
|
+
import { unsafeHTML as Te } from "lit/directives/unsafe-html.js";
|
|
7
|
+
import { useContextConsumer as ee } from "@arcgis/lumina/context";
|
|
8
|
+
import { c as Ae, b as De } from "../../chunks/deployAppContexts.js";
|
|
9
|
+
import { T as Le } from "../../chunks/interfaces.js";
|
|
10
|
+
import { l as Re } from "../../chunks/helpers.js";
|
|
11
|
+
import te from "@arcgis/core/config.js";
|
|
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 x, NodeInterrupt as ne } from "@langchain/langgraph/web";
|
|
14
|
+
import { createAgentRuntimeState as j, sendTraceMessage as v, invokeStructuredPrompt as D, getEmbeddings as Be, cosineSimilarity as Fe, invokeTextPrompt as Pe } from "@arcgis/ai-orchestrator";
|
|
15
|
+
import r, { z as T } from "zod";
|
|
16
16
|
import * as J from "@esri/arcgis-rest-portal";
|
|
17
|
-
import { applyPatch as
|
|
17
|
+
import { applyPatch as Ne } from "fast-json-patch";
|
|
18
18
|
import "@langchain/core/messages";
|
|
19
|
-
import { C as
|
|
20
|
-
import { g as
|
|
19
|
+
import { C as ie } from "../../chunks/converter.js";
|
|
20
|
+
import { g as F, t as oe, r as ae, c as qe, d as A } from "../../chunks/templates.js";
|
|
21
21
|
import Ue from "@arcgis/core/portal/Portal.js";
|
|
22
|
-
import
|
|
23
|
-
const
|
|
24
|
-
async function
|
|
22
|
+
import Oe from "@arcgis/core/portal/PortalItem.js";
|
|
23
|
+
const ze = Ee`:host{display:block;height:100%}.margin-lg{margin:var(--calcite-spacing-lg)}.display-flex-row{display:flex;flex-direction:row}.assistant-split-container{display:flex;width:100%;height:calc(100vh - 78px);overflow:hidden;border-radius:10px}.assistant-panel{display:flex;flex-direction:column;height:100%;border:1px solid var(--calcite-color-surface-3);background-color:var(--calcite-color-surface-2);overflow:hidden}.chat-panel{min-width:320px}.builder-panel{min-width:320px;max-width:100%;border-left:1px solid var(--calcite-color-surface-3)}.panel-actions{display:flex;gap:8px;padding:6px;align-items:center}.builder-header,.builder-footer{padding:10px;background:var(--calcite-color-surface-1);border-bottom:1px solid var(--calcite-color-surface-3)}.builder-content{flex:1;overflow:auto;padding:12px}.builder-content pre{white-space:pre-wrap;word-wrap:break-word;max-height:100%;overflow:auto}.builder-actions{display:flex;gap:6px;align-items:center}.padding-left-10{padding-left:10px}.chat-container{display:flex;flex-direction:column;gap:0px;max-width:600px;height:75%;background-color:var(--calcite-color-surface-4);padding:1px}.chat-container_expanded{display:flex;flex-direction:column;gap:0px;max-width:100%;height:95%;background-color:var(--calcite-color-surface-1);border-radius:10px;padding:10px}.chat-panel{--calcite-color-focus: var(--calcite-color-brand);--calcite-panel-border-color: var(--calcite-color-border-2);--calcite-internal-panel-header-vertical-padding: 0px;--calcite-panel-header-content-space: 0px;border:var(--calcite-border-width-sm) solid var(--calcite-color-border-2);height:100%}.header-content{display:flex;align-items:center;gap:var(--calcite-spacing-sm);height:65px;box-sizing:border-box;padding-inline-start:var(--calcite-space-2xl)}.header-title{font-size:var(--calcite-font-size-md);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.beta-chip{--calcite-chip-corner-radius: var(--calcite-corner-radius-half)}.chat-panel calcite-card,.chat-panel calcite-text-area,.chat-panel calcite-button,.chat-panel .chat-messages,.chat-panel .chat-input{--calcite-color-focus: var(--calcite-color-brand)}.assistant-followup-chip:focus{outline:2px solid var(--calcite-color-brand)}.chat-panel-heading{font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-surface-1, var(--calcite-color-text-1))}.chat-messages{display:flex;flex-direction:column;gap:20px;padding:4px;height:100%;overflow-y:auto}.user-message{align-self:flex-end;background:var(--calcite-color-brand);border-radius:8px;max-width:90%;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-brand);--calcite-card-border-color: var(--calcite-color-brand);color:var(--calcite-color-text-inverse);text-align:left}.system-message{align-self:flex-start;background:var(--calcite-color-surface-3);border-radius:8px;max-width:90%;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-surface-4);--calcite-card-border-color: var(--calcite-color-surface-4);color:var(--calcite-color-inverse);text-align:left}.loader-message{align-self:flex-start;background:var(--calcite-color-surface-4);border-radius:8px;--calcite-card-corner-radius: 8px;--calcite-card-background-color: var(--calcite-color-surface-4);--calcite-card-border-color: var(--calcite-color-surface-4)}.message-content{padding:0;font-size:14px}.response-message.message-content>p:first-of-type{margin-top:0}.message-content img{max-width:100%;height:auto;display:block;object-fit:contain}.message-content-pad{padding-bottom:10px;font-size:14px}.message-content-summary{padding-bottom:14px}.message-content-alignment{display:flex;align-items:center;gap:var(--calcite-spacing-md);font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-1)}.padding-top-10{padding-top:10px}.padding-right-8{padding-right:8px}.padding-left-right-5{padding-right:5px;padding-left:5px}.chip-content{padding:5px 5px 5px 0}.chat-input{display:flex;flex-direction:row;flex-grow:1}.table-cell{--calcite-table-cell-background: var(--calcite-color-surface-4)}.cursor-pointer{cursor:pointer}.notice-border-color{--temp-initial-brand: var(--calcite-color-brand)}.notice-border-color calcite-notice{--calcite-color-brand: #ddd;--calcite-icon-color: var(--temp-initial-brand)}.notice-border-color calcite-notice *{--calcite-color-brand: var(--temp-initial-brand)}.solution-card{padding:5px 0;text-decoration:none;display:block;width:100%;cursor:pointer}.solution-card calcite-card{display:flex;flex-direction:column;max-width:520px;overflow:hidden;--calcite-card-corner-radius: var(--calcite-corner-radius-round) !important;--calcite-card-shadow: var(--calcite-shadow-sm);--calcite-card-background-color: var(--calcite-card-background-color) }.solution-card div[slot=thumbnail]{max-height:100%;width:100%;position:relative;&:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;transition:all .15s ease-in-out}}.solution-card div[slot=thumbnail] img{max-height:100%;width:100%;object-fit:cover}.solution-card span[slot=description]{padding-top:10px}.solution-card calcite-chip{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);visibility:hidden;pointer-events:none;opacity:0;transition:all .15s ease-in-out;z-index:9999}.solution-card:hover calcite-chip{visibility:visible;opacity:1}.solution-card:hover div[slot=thumbnail]:after{background-color:#00000080}.solution-card:hover h3{text-decoration:underline}.solution-card:focus{outline:2px solid var(--calcite-color-brand)}.references-container{padding-top:10px;display:block}.references-container.collapsed{display:none}.width-100{width:100%}.disclaimer-div{display:flex;align-items:center;gap:var(--calcite-spacing-sm);font-size:var(--calcite-font-size--0);color:var(--calcite-color-text-1)}.display-none{display:none}.chat-messages calcite-fab{position:absolute;bottom:16px;left:50%;transform:translate(-50%);z-index:999}.icon-color-background{--calcite-button-icon-color: var(--calcite-color-surface-1)}#closeAssistantButton{--calcite-action-text-color: var(--calcite-color-text-1)}.icon-color-background:focus{--calcite-color-focus: var(--calcite-color-surface-1)}@media(max-width:430px){.solution-card .solution-snippet{display:none}}.height-32-flex-auto{height:32px;flex:0 0 auto}.margin-top-0.message-content>p:first-of-type{margin-top:0}a:not(.solution-card){color:var(--calcite-link-text-color, var(--calcite-color-text-link));cursor:pointer;text-decoration:none;line-height:inherit;background-image:linear-gradient(currentColor,currentColor),linear-gradient(var(--calcite-color-brand-underline),var(--calcite-color-brand-underline));background-position-x:0%,100%;background-position-y:min(1.5em,100%);background-repeat:no-repeat,no-repeat;background-size:0% 1px,100% 1px;transition-property:background-size,color;transition-duration:var(--calcite-animation-timing, .15s);transition-timing-function:ease-in-out;outline-color:transparent;position:relative}a:not(.solution-card):hover{background-size:100% 1px,100% 1px}a:not(.solution-card):focus{outline:2px solid var(--calcite-color-brand);outline-offset:2px;outline-color:var(--calcite-color-brand)}a:not(.solution-card):active{color:var(--calcite-color-brand-press)}`;
|
|
24
|
+
async function y(t, e) {
|
|
25
25
|
const s = Object.entries(t).find(
|
|
26
26
|
([n]) => n.endsWith(`/${e}.md`)
|
|
27
27
|
);
|
|
@@ -37,7 +37,7 @@ ${Object.keys(t).join(`
|
|
|
37
37
|
function N(t) {
|
|
38
38
|
return t?.configurable?.context?.translations;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function re(t) {
|
|
41
41
|
if (typeof window > "u" || t.length <= 1)
|
|
42
42
|
return;
|
|
43
43
|
const e = t.map((n) => n.solution.id), s = t.map((n) => n.solution.title);
|
|
@@ -59,7 +59,7 @@ function le(t) {
|
|
|
59
59
|
}
|
|
60
60
|
}));
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function le(t) {
|
|
63
63
|
if (typeof window > "u" || !t)
|
|
64
64
|
return;
|
|
65
65
|
const e = new CustomEvent("solutionIDFromAssistant", {
|
|
@@ -77,16 +77,16 @@ function Je(t) {
|
|
|
77
77
|
}
|
|
78
78
|
function Ge(t, e) {
|
|
79
79
|
const s = [];
|
|
80
|
-
return (e?.configurable?.context?.configContext.allCards ?? []).forEach((
|
|
81
|
-
const
|
|
82
|
-
if (t.toLowerCase().includes(
|
|
83
|
-
const a = `<a href="" target="solutionId:${
|
|
80
|
+
return (e?.configurable?.context?.configContext.allCards ?? []).forEach((i) => {
|
|
81
|
+
const o = i.title;
|
|
82
|
+
if (t.toLowerCase().includes(o.toLowerCase())) {
|
|
83
|
+
const a = `<a href="" target="solutionId:${i.deployCommonId}">${o}</a>`, l = new RegExp(o, "gi");
|
|
84
84
|
t = t.replace(l, a), s.push({
|
|
85
85
|
solution: {
|
|
86
|
-
title:
|
|
87
|
-
id:
|
|
88
|
-
snippet:
|
|
89
|
-
description:
|
|
86
|
+
title: i.title,
|
|
87
|
+
id: i.deployCommonId,
|
|
88
|
+
snippet: i.snippet,
|
|
89
|
+
description: i.description
|
|
90
90
|
},
|
|
91
91
|
score: 100
|
|
92
92
|
});
|
|
@@ -96,7 +96,7 @@ function Ge(t, e) {
|
|
|
96
96
|
function He(t) {
|
|
97
97
|
return t && t.helperServices.aiAssistantServices ? `${t.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/chat` : null;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function ce(t) {
|
|
100
100
|
return t && t.helperServices.aiAssistantServices ? `${t.helperServices.aiAssistantServices.url}/skills/doc_ai_assistant/api/pre-chat` : null;
|
|
101
101
|
}
|
|
102
102
|
async function U(t, e, s) {
|
|
@@ -112,47 +112,50 @@ 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 Ve = (t) => new Promise((e) => setTimeout(e, t)),
|
|
115
|
+
const Ve = (t) => new Promise((e) => setTimeout(e, t)), We = b.Root({
|
|
116
116
|
// Provides agentExecutionContext, outputMessage, summary, and status
|
|
117
117
|
// channels with the orchestrator's standard reducers/defaults so the
|
|
118
118
|
// sub-agent reports back through the same shape the orchestrator
|
|
119
119
|
// persists into priorSteps.
|
|
120
120
|
...j(),
|
|
121
|
-
solutionResponse:
|
|
121
|
+
solutionResponse: b({
|
|
122
122
|
reducer: (t, e) => e ?? null,
|
|
123
123
|
default: () => null
|
|
124
124
|
}),
|
|
125
|
-
documentSkillUrl:
|
|
125
|
+
documentSkillUrl: b({
|
|
126
126
|
reducer: (t, e) => e ?? null,
|
|
127
127
|
default: () => null
|
|
128
128
|
}),
|
|
129
129
|
// Persisted across turns via the graph checkpointer so follow-up questions
|
|
130
130
|
// continue the same service conversation. Null on the very first interaction
|
|
131
131
|
// or after messages are cleared.
|
|
132
|
-
conversationId:
|
|
132
|
+
conversationId: b({
|
|
133
133
|
reducer: (t, e) => e ?? t,
|
|
134
134
|
default: () => null
|
|
135
135
|
})
|
|
136
|
-
}), Ke = () => new
|
|
136
|
+
}), Ke = () => new O(We).addNode("initializeAgent", Ye).addNode("askSolutionsQuestions", Qe).addEdge(z, "initializeAgent").addEdge("initializeAgent", "askSolutionsQuestions").addEdge("askSolutionsQuestions", x), de = async (t, e, s, n) => {
|
|
137
137
|
if (!t) return;
|
|
138
|
-
const
|
|
139
|
-
if (!
|
|
140
|
-
const
|
|
138
|
+
const i = ce(t);
|
|
139
|
+
if (!i) return;
|
|
140
|
+
const a = { context: {
|
|
141
141
|
kind: "DocAIAssistantRequest",
|
|
142
142
|
filters: {
|
|
143
143
|
products: "ArcGIS Solutions",
|
|
144
|
-
persona: { persona: "apps-solutions" }
|
|
144
|
+
persona: { persona: "apps-solutions" },
|
|
145
|
+
pipeline: {
|
|
146
|
+
translation: { allow: !0, language: s, use_llm: !1 }
|
|
147
|
+
}
|
|
145
148
|
}
|
|
146
149
|
} };
|
|
147
|
-
|
|
148
|
-
},
|
|
150
|
+
n && (a.conversationId = n), U(a, i, e ?? "");
|
|
151
|
+
}, Qe = async (t, e) => {
|
|
149
152
|
const s = N(e), n = t.documentSkillUrl;
|
|
150
|
-
let
|
|
151
|
-
await
|
|
153
|
+
let i = [];
|
|
154
|
+
await v(
|
|
152
155
|
{ text: s.agentProgress.explorerAgentSearching },
|
|
153
156
|
e
|
|
154
157
|
);
|
|
155
|
-
let
|
|
158
|
+
let o = await U(
|
|
156
159
|
{
|
|
157
160
|
message: t.agentExecutionContext.userRequest,
|
|
158
161
|
conversationId: e?.configurable?.context?.convoId ?? void 0,
|
|
@@ -160,41 +163,43 @@ const Ve = (t) => new Promise((e) => setTimeout(e, t)), Qe = f.Root({
|
|
|
160
163
|
kind: "DocAIAssistantRequest",
|
|
161
164
|
filters: {
|
|
162
165
|
products: "ArcGIS Solutions",
|
|
163
|
-
persona: { persona: "apps-solutions" }
|
|
166
|
+
persona: { persona: "apps-solutions" },
|
|
167
|
+
pipeline: {
|
|
168
|
+
translation: { allow: !0, language: e?.configurable?.context?.configContext.locale ?? "en", use_llm: !1 }
|
|
169
|
+
}
|
|
164
170
|
}
|
|
165
171
|
}
|
|
166
172
|
},
|
|
167
173
|
n,
|
|
168
174
|
e?.configurable?.context?.token ?? ""
|
|
169
175
|
);
|
|
170
|
-
|
|
176
|
+
o.conversationId && e?.configurable?.context?.setConversationId && e.configurable.context.setConversationId(o.conversationId);
|
|
171
177
|
let a = {
|
|
172
|
-
message:
|
|
173
|
-
conversationId:
|
|
174
|
-
hasMore:
|
|
175
|
-
ackSequenceNumber:
|
|
176
|
-
inquiryId:
|
|
177
|
-
}, l = ""
|
|
178
|
-
const
|
|
179
|
-
const
|
|
180
|
-
if (
|
|
181
|
-
const
|
|
182
|
-
l =
|
|
183
|
-
...
|
|
184
|
-
...
|
|
185
|
-
(
|
|
178
|
+
message: o.message,
|
|
179
|
+
conversationId: o.conversationId,
|
|
180
|
+
hasMore: o.hasMore,
|
|
181
|
+
ackSequenceNumber: o.sequenceNumber,
|
|
182
|
+
inquiryId: o.inquiryId
|
|
183
|
+
}, l = "";
|
|
184
|
+
const d = async (g) => {
|
|
185
|
+
const h = g.context?.results?.[0]?.reply ?? "";
|
|
186
|
+
if (h !== "") {
|
|
187
|
+
const m = Je(h), E = Ge(m, e);
|
|
188
|
+
l = E.source, i = [
|
|
189
|
+
...i,
|
|
190
|
+
...E.allMatches.filter(
|
|
191
|
+
(C) => !i.some((_) => _.solution.id === C.solution.id)
|
|
186
192
|
)
|
|
187
193
|
];
|
|
188
194
|
}
|
|
189
|
-
c
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
g === 1 ? y = s.agentProgress.explorerAgentReading : g === 2 ? y = s.agentProgress.explorerAgentReviewing : g === 3 && (y = s.agentProgress.explorerAgentPreparing), await x({ text: y }, e);
|
|
195
|
+
const c = g.context?.results?.[0]?.status?.currentStatusStep;
|
|
196
|
+
if (c) {
|
|
197
|
+
let m = "";
|
|
198
|
+
c === 1 ? m = s.agentProgress.explorerAgentReading : c === 2 ? m = s.agentProgress.explorerAgentReviewing : c === 3 && (m = s.agentProgress.explorerAgentPreparing), await v({ text: m }, e);
|
|
194
199
|
}
|
|
195
200
|
};
|
|
196
|
-
for (await
|
|
197
|
-
await Ve(500),
|
|
201
|
+
for (await d(o); a.hasMore; )
|
|
202
|
+
await Ve(500), o = await U(
|
|
198
203
|
{
|
|
199
204
|
conversationId: a.conversationId,
|
|
200
205
|
ackSequenceNumber: a.ackSequenceNumber,
|
|
@@ -203,17 +208,18 @@ const Ve = (t) => new Promise((e) => setTimeout(e, t)), Qe = f.Root({
|
|
|
203
208
|
n,
|
|
204
209
|
e?.configurable?.context?.token ?? ""
|
|
205
210
|
), a = {
|
|
206
|
-
message:
|
|
207
|
-
conversationId:
|
|
208
|
-
hasMore:
|
|
209
|
-
ackSequenceNumber:
|
|
210
|
-
inquiryId:
|
|
211
|
-
}, await
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
211
|
+
message: o.message,
|
|
212
|
+
conversationId: o.conversationId,
|
|
213
|
+
hasMore: o.hasMore,
|
|
214
|
+
ackSequenceNumber: o.sequenceNumber,
|
|
215
|
+
inquiryId: o.inquiryId
|
|
216
|
+
}, await d(o);
|
|
217
|
+
return ce(e?.configurable?.context.portal) && de(
|
|
218
|
+
e?.configurable?.context.portal,
|
|
219
|
+
e?.configurable?.context.token ?? "",
|
|
220
|
+
e?.configurable?.context.configContext.locale ?? "en",
|
|
221
|
+
a.conversationId
|
|
222
|
+
), i.length && (i.length === 1 ? le(i[0].solution.id) : re(i)), {
|
|
217
223
|
outputMessage: l,
|
|
218
224
|
summary: l,
|
|
219
225
|
status: "success",
|
|
@@ -226,8 +232,8 @@ const Ve = (t) => new Promise((e) => setTimeout(e, t)), Qe = f.Root({
|
|
|
226
232
|
documentSkillUrl: s
|
|
227
233
|
};
|
|
228
234
|
};
|
|
229
|
-
await
|
|
230
|
-
const
|
|
235
|
+
await y(je, "solutions_explorer_description");
|
|
236
|
+
const ue = (t) => {
|
|
231
237
|
if (t && Array.isArray(t.id) && t.id.length > 0)
|
|
232
238
|
return t.id[t.id.length - 1].replace("Message", "").toLowerCase();
|
|
233
239
|
if (t && typeof t._getType == "function")
|
|
@@ -238,7 +244,7 @@ const pe = (t) => {
|
|
|
238
244
|
}
|
|
239
245
|
return "human";
|
|
240
246
|
}, Ze = (t) => {
|
|
241
|
-
const e =
|
|
247
|
+
const e = ue(t);
|
|
242
248
|
if (t && t.kwargs)
|
|
243
249
|
return {
|
|
244
250
|
role: e,
|
|
@@ -253,7 +259,7 @@ const pe = (t) => {
|
|
|
253
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;
|
|
254
260
|
}
|
|
255
261
|
return { role: "human", content: String(t) };
|
|
256
|
-
}, Xe = (t) =>
|
|
262
|
+
}, Xe = (t) => ue(t) === "human", et = (t, e = 3) => t.filter((s) => Xe(s)).slice(-e).map(Ze), tt = (t, e = " ") => et(t).map((i) => i.content).join(e).trim(), st = { understandingRequest: "Understanding your request...", selectTemplatePrompt: "This use case could be supported in a few different ways. Choose the option that best matches what you want to accomplish.", searchingExistingSolutions: "Searching for existing solutions...", existingSolutionMatch: "I found one or more existing solutions that match your use case. These are ready-to-use solutions that may already meet your needs and can be deployed now. Do you want to continue building your own solution?", continueBuildingYes: "Yes, I want to build a new solution", continueBuildingNo: "No, I’ll review existing solutions", continueBuildingDeclined: "Sounds good. We can focus on existing solutions. Let me know if I can help answer any questions or provide more details.", creatingDesign: "Generating solution design...", updatingDesign: "Updating solution design...", applyChangeFailed: "I wasn't able to apply that change. The design was not modified. Please try rephrasing your request.", createDesignFailed: "I wasn't able to create a solution design from that request. Please try rephrasing and try again.", discardMessage: "Are you sure you want to discard your solution?", discardForNewSolution: "I can help you build a new solution, but I will need to discard your current solution design. Do you want to continue?" }, nt = {
|
|
257
263
|
builderMessages: st
|
|
258
264
|
}, it = /* @__PURE__ */ new Set([
|
|
259
265
|
"add",
|
|
@@ -318,7 +324,7 @@ const pe = (t) => {
|
|
|
318
324
|
"view",
|
|
319
325
|
"where"
|
|
320
326
|
]);
|
|
321
|
-
class
|
|
327
|
+
class pe {
|
|
322
328
|
constructor(e, s, n = !0) {
|
|
323
329
|
this.isValid = !0, this.issues = [], this.response = e, this.template = s, this.newDesign = n, this.validate();
|
|
324
330
|
}
|
|
@@ -345,14 +351,14 @@ class me {
|
|
|
345
351
|
return;
|
|
346
352
|
}
|
|
347
353
|
if (!e.addLayers) {
|
|
348
|
-
const n = new Set(e.layers.map((
|
|
349
|
-
if (!(n.size ===
|
|
354
|
+
const n = new Set(e.layers.map((o) => o.id)), i = new Set(s.layers.map((o) => o.id));
|
|
355
|
+
if (!(n.size === i.size && [...n].every((o) => i.has(o))))
|
|
350
356
|
this.logIssue(`Feature Layer '${e.itemId}' had its layer ids altered.`);
|
|
351
357
|
else
|
|
352
|
-
for (const
|
|
353
|
-
if (
|
|
354
|
-
const a = s.layers.find((l) => l.id ===
|
|
355
|
-
a && a.type !==
|
|
358
|
+
for (const o of e.layers)
|
|
359
|
+
if (o.type) {
|
|
360
|
+
const a = s.layers.find((l) => l.id === o.id);
|
|
361
|
+
a && a.type !== o.type && this.logIssue(`Layer '${o.id}' type '${a.type}' does not match template type '${o.type}'. This layer type is immutable.`);
|
|
356
362
|
}
|
|
357
363
|
}
|
|
358
364
|
}
|
|
@@ -363,14 +369,14 @@ class me {
|
|
|
363
369
|
s.length !== new Set(s).size && this.logIssue("Layer names must be unique (case-insensitive).");
|
|
364
370
|
for (const n of this.response.featureLayer.layers) {
|
|
365
371
|
this.validateLayer(n);
|
|
366
|
-
const
|
|
367
|
-
|
|
372
|
+
const i = e.find((o) => o.id === n.id);
|
|
373
|
+
i && this.validateRequiredFields(n, i);
|
|
368
374
|
}
|
|
369
375
|
}
|
|
370
376
|
validateRequiredFields(e, s) {
|
|
371
|
-
const n = new Set(e.requiredFields.map((
|
|
372
|
-
for (const
|
|
373
|
-
n.has(
|
|
377
|
+
const n = new Set(e.requiredFields.map((i) => i.name));
|
|
378
|
+
for (const i of s.requiredFields)
|
|
379
|
+
n.has(i.name) || this.logIssue(`Layer '${e.name}' is missing required field '${i.name}'.`);
|
|
374
380
|
}
|
|
375
381
|
validateLayer(e) {
|
|
376
382
|
const s = /* @__PURE__ */ new Set([
|
|
@@ -382,19 +388,19 @@ class me {
|
|
|
382
388
|
"last_edited_user"
|
|
383
389
|
]), n = e.systemFields ?? [];
|
|
384
390
|
if (n.length) {
|
|
385
|
-
const
|
|
386
|
-
(
|
|
387
|
-
`Layer '${e.name}' has invalid system fields: ${JSON.stringify([...
|
|
391
|
+
const o = new Set(n.map((l) => l.name));
|
|
392
|
+
(o.size !== s.size || [...s].some((l) => !o.has(l))) && this.logIssue(
|
|
393
|
+
`Layer '${e.name}' has invalid system fields: ${JSON.stringify([...o])}.`
|
|
388
394
|
);
|
|
389
395
|
}
|
|
390
|
-
const
|
|
396
|
+
const i = [
|
|
391
397
|
...e.customFields,
|
|
392
398
|
...e.requiredFields,
|
|
393
399
|
...n
|
|
394
|
-
].map((
|
|
395
|
-
|
|
396
|
-
for (const
|
|
397
|
-
this.validateField(
|
|
400
|
+
].map((o) => o.name);
|
|
401
|
+
i.length !== new Set(i).size && this.logIssue(`Layer '${e.name}' has duplicate fields: ${JSON.stringify(i)}.`);
|
|
402
|
+
for (const o of [...e.customFields, ...e.requiredFields, ...n])
|
|
403
|
+
this.validateField(o);
|
|
398
404
|
}
|
|
399
405
|
validateField(e) {
|
|
400
406
|
if (e.alias || this.logIssue(`Field '${e.name}' has no display name (alias).`), /^[A-Za-z]/u.test(e.name) || this.logIssue(`Field '${e.name}' does not start with a letter.`), /^[A-Za-z][A-Za-z0-9_]*$/u.test(e.name) || this.logIssue(`Field '${e.name}' contains invalid characters (only letters, numbers, and underscores allowed).`), e.name.length > 31 && this.logIssue(`Field '${e.name}' exceeds 31 characters.`), it.has(e.name.toLowerCase()) && this.logIssue(`Field '${e.name}' is a SQL reserved keyword.`), e.choiceList && (e.choiceList.some((s) => !s) && 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)) {
|
|
@@ -433,7 +439,7 @@ const ot = r.object({
|
|
|
433
439
|
"Notebook",
|
|
434
440
|
"QuickCapture Project"
|
|
435
441
|
]).describe("ArcGIS item type.")
|
|
436
|
-
}),
|
|
442
|
+
}), se = r.object({
|
|
437
443
|
name: r.string().describe("Field name."),
|
|
438
444
|
type: r.enum(["string", "integer", "double", "date", "oid", "guid", "globalid"]).describe("Field data type."),
|
|
439
445
|
alias: r.string().describe("Field alias for display."),
|
|
@@ -448,8 +454,8 @@ const ot = r.object({
|
|
|
448
454
|
typeMutable: r.boolean().describe("Indicates whether the layer type can be changed."),
|
|
449
455
|
name: r.string().describe("Layer/table name."),
|
|
450
456
|
description: r.string().describe("Layer/table description."),
|
|
451
|
-
customFields: r.array(
|
|
452
|
-
requiredFields: r.array(
|
|
457
|
+
customFields: r.array(se).describe("User/business fields specific to the solution."),
|
|
458
|
+
requiredFields: r.array(se).describe("Fields required for solution functionality (e.g., relationship keys).")
|
|
453
459
|
}), lt = r.object({
|
|
454
460
|
itemId: r.string().describe("ArcGIS item id for the feature layer."),
|
|
455
461
|
addLayers: r.boolean().describe("Indicates whether new layers can be added during solution design."),
|
|
@@ -483,22 +489,15 @@ const ot = r.object({
|
|
|
483
489
|
assistantResponse: r.string().describe("Natural-language response for the user."),
|
|
484
490
|
isValidUseCase: r.boolean().describe("True only when the request is concrete, appropriate, and has at least one matching template."),
|
|
485
491
|
matchedTemplates: r.array(pt).describe("Ordered list of matching templates, best match first. Empty when no valid match exists.")
|
|
486
|
-
}), H = (t) => t in
|
|
487
|
-
let $ = null, q = null,
|
|
488
|
-
const
|
|
492
|
+
}), H = (t) => t in A, gt = 5, ht = 0.8, ft = 0.15, bt = "Web Mapping Application", yt = "Embeddings";
|
|
493
|
+
let $ = null, q = null, M = null, B = null;
|
|
494
|
+
const xt = "Build", L = /* @__PURE__ */ Object.assign({
|
|
489
495
|
"./prompts/description.md": () => import("../../chunks/description2.js").then((t) => t.default),
|
|
490
496
|
"./prompts/designSolution.md": () => import("../../chunks/designSolution.js").then((t) => t.default),
|
|
491
497
|
"./prompts/findExistingSolution.md": () => import("../../chunks/findExistingSolution.js").then((t) => t.default),
|
|
492
498
|
"./prompts/initialAssessment.md": () => import("../../chunks/initialAssessment.js").then((t) => t.default),
|
|
493
499
|
"./prompts/updateDesign.md": () => import("../../chunks/updateDesign.js").then((t) => t.default)
|
|
494
|
-
}),
|
|
495
|
-
let o = N(e)?.builderMessages?.[t] ?? xt[t];
|
|
496
|
-
if (!s)
|
|
497
|
-
return o;
|
|
498
|
-
for (const [i, a] of Object.entries(s))
|
|
499
|
-
o = o.replaceAll(`{{${i}}}`, a);
|
|
500
|
-
return o;
|
|
501
|
-
}, ge = (t) => {
|
|
500
|
+
}), vt = nt.builderMessages, f = (t, e, s) => N(e)?.builderMessages?.[t] ?? vt[t], me = (t) => {
|
|
502
501
|
typeof window < "u" && window.dispatchEvent(new CustomEvent("arcgis-solution-design-update", {
|
|
503
502
|
detail: t
|
|
504
503
|
}));
|
|
@@ -516,15 +515,15 @@ async function St(t, e, s) {
|
|
|
516
515
|
try {
|
|
517
516
|
const n = await wt(t, e, s);
|
|
518
517
|
if (!n) return null;
|
|
519
|
-
const
|
|
520
|
-
return await
|
|
518
|
+
const i = new Oe({ id: n.id });
|
|
519
|
+
return await i.load(), await i.fetchData("json");
|
|
521
520
|
} catch {
|
|
522
521
|
return null;
|
|
523
522
|
}
|
|
524
523
|
}
|
|
525
524
|
const It = async (t, e, s) => {
|
|
526
525
|
if (!t) return [];
|
|
527
|
-
const n = `type:Solution AND typekeywords:${
|
|
526
|
+
const n = `type:Solution AND typekeywords:${xt} AND group:${t}`;
|
|
528
527
|
return (await J.searchItems({
|
|
529
528
|
q: n,
|
|
530
529
|
params: e ? { token: e } : void 0,
|
|
@@ -536,14 +535,14 @@ const It = async (t, e, s) => {
|
|
|
536
535
|
const n = await J.getItemData(t, {
|
|
537
536
|
params: e ? { token: e } : void 0,
|
|
538
537
|
portal: s
|
|
539
|
-
}),
|
|
540
|
-
if (!
|
|
541
|
-
const
|
|
542
|
-
return { buildSolution:
|
|
538
|
+
}), i = n?.buildSolution;
|
|
539
|
+
if (!i) return null;
|
|
540
|
+
const o = n?.params, a = o && typeof o == "object" && !Array.isArray(o) ? o : null;
|
|
541
|
+
return { buildSolution: i, params: a };
|
|
543
542
|
} catch {
|
|
544
543
|
return null;
|
|
545
544
|
}
|
|
546
|
-
},
|
|
545
|
+
}, I = (t, e = {}) => {
|
|
547
546
|
let s = t;
|
|
548
547
|
return "itemId" in e && (s = {
|
|
549
548
|
...s,
|
|
@@ -561,12 +560,12 @@ const It = async (t, e, s) => {
|
|
|
561
560
|
...s,
|
|
562
561
|
templateId: e.templateId ?? null
|
|
563
562
|
}), s;
|
|
564
|
-
},
|
|
563
|
+
}, ge = (t, e) => {
|
|
565
564
|
if (t == null || e == null)
|
|
566
565
|
return { ok: !1, error: "design or sourceBuildSolution is null/undefined" };
|
|
567
566
|
try {
|
|
568
567
|
const s = structuredClone(e);
|
|
569
|
-
return new
|
|
568
|
+
return new ie({ buildSolution: s }).applyLlmTemplate(t), { ok: !0 };
|
|
570
569
|
} catch (s) {
|
|
571
570
|
return {
|
|
572
571
|
ok: !1,
|
|
@@ -576,51 +575,51 @@ const It = async (t, e, s) => {
|
|
|
576
575
|
}, V = async (t) => {
|
|
577
576
|
if (q) {
|
|
578
577
|
Object.entries(q).forEach(([a, l]) => {
|
|
579
|
-
|
|
578
|
+
A[a] && (A[a].initialTemplate = l);
|
|
580
579
|
});
|
|
581
580
|
return;
|
|
582
581
|
}
|
|
583
|
-
const e = t?.configurable?.context?.token, s =
|
|
582
|
+
const e = t?.configurable?.context?.token, s = fe(t), n = be(t);
|
|
584
583
|
if (!s) {
|
|
585
584
|
console.warn("Solution Builder: missing primarySolutionsGroupId in appConfig; skipping live template hydration.");
|
|
586
585
|
return;
|
|
587
586
|
}
|
|
588
|
-
const
|
|
589
|
-
await Promise.all(
|
|
587
|
+
const i = await It(s, e, n), o = {};
|
|
588
|
+
await Promise.all(i.map(async (a) => {
|
|
590
589
|
const l = a.properties?.templateInfo;
|
|
591
590
|
if (!l || typeof l != "object") return;
|
|
592
591
|
const d = l.id;
|
|
593
|
-
if (typeof d != "string" ||
|
|
592
|
+
if (typeof d != "string" || o[d]) return;
|
|
594
593
|
const u = await Ct(a.id, e, n);
|
|
595
594
|
if (!u) return;
|
|
596
|
-
const { buildSolution:
|
|
597
|
-
if (typeof
|
|
598
|
-
const
|
|
599
|
-
|
|
595
|
+
const { buildSolution: g, params: h } = u;
|
|
596
|
+
if (typeof g == "object" && g !== null && "solution" in g) {
|
|
597
|
+
const m = g.solution;
|
|
598
|
+
m.thumbnailUrl = a.thumbnail ? `${n ?? "https://www.arcgis.com/sharing/rest"}/content/items/${a.id}/info/${a.thumbnail}` : void 0, m.item = a;
|
|
600
599
|
}
|
|
601
600
|
const c = {
|
|
602
601
|
...l,
|
|
603
|
-
buildSolution:
|
|
602
|
+
buildSolution: g
|
|
604
603
|
};
|
|
605
|
-
|
|
606
|
-
new
|
|
604
|
+
o[d] = I(
|
|
605
|
+
new ie(c).dumpToLlmTemplate(),
|
|
607
606
|
{
|
|
608
607
|
itemId: a.id,
|
|
609
|
-
sourceBuildSolution: structuredClone(
|
|
610
|
-
params:
|
|
608
|
+
sourceBuildSolution: structuredClone(g),
|
|
609
|
+
params: h ? structuredClone(h) : null
|
|
611
610
|
}
|
|
612
|
-
),
|
|
611
|
+
), A[d] = {
|
|
613
612
|
...l,
|
|
614
|
-
initialTemplate:
|
|
613
|
+
initialTemplate: o[d]
|
|
615
614
|
};
|
|
616
|
-
})), q =
|
|
617
|
-
},
|
|
615
|
+
})), q = o;
|
|
616
|
+
}, he = (t) => {
|
|
618
617
|
const e = t?.configurable?.context?.token;
|
|
619
618
|
return typeof e != "string" || !e.trim() ? null : e;
|
|
620
|
-
},
|
|
619
|
+
}, fe = (t) => {
|
|
621
620
|
const e = t?.configurable?.context?.configContext?.primarySolutionsGroupId;
|
|
622
621
|
return typeof e != "string" || !e.trim() ? null : e;
|
|
623
|
-
},
|
|
622
|
+
}, be = (t) => {
|
|
624
623
|
const e = t?.configurable?.context?.configContext?.portalURL;
|
|
625
624
|
if (!(typeof e != "string" || !e.trim()))
|
|
626
625
|
return `${e.replace(/\/+$/, "")}/sharing/rest`;
|
|
@@ -629,39 +628,39 @@ const It = async (t, e, s) => {
|
|
|
629
628
|
xe(t),
|
|
630
629
|
V(t)
|
|
631
630
|
]);
|
|
632
|
-
},
|
|
633
|
-
const e =
|
|
634
|
-
(!
|
|
635
|
-
throw
|
|
636
|
-
})), await
|
|
631
|
+
}, ye = async (t) => {
|
|
632
|
+
const e = he(t);
|
|
633
|
+
(!M || e && e !== B) && (B = e ?? B, M = _t(t).catch((n) => {
|
|
634
|
+
throw M = null, B = null, n;
|
|
635
|
+
})), await M;
|
|
637
636
|
};
|
|
638
637
|
async function xe(t) {
|
|
639
638
|
if ($) return $;
|
|
640
|
-
const e =
|
|
639
|
+
const e = fe(t);
|
|
641
640
|
if (!e)
|
|
642
641
|
return console.warn("Solution Builder: missing primarySolutionsGroupId in appConfig; skipping embeddings load."), null;
|
|
643
|
-
const s =
|
|
642
|
+
const s = be(t), n = t?.configurable?.context?.configContext?.portalURL;
|
|
644
643
|
await new Ue(n ? { url: n } : void 0).load();
|
|
645
|
-
const
|
|
644
|
+
const o = he(t) ?? void 0, a = await St(e, o, s);
|
|
646
645
|
return a ? ($ = a.items, $) : null;
|
|
647
646
|
}
|
|
648
|
-
const kt = () => Object.entries(
|
|
647
|
+
const kt = () => Object.entries(A).map(([t, e]) => `ID: ${t}
|
|
649
648
|
Label: ${e.label}
|
|
650
649
|
Description: ${e.description}`).join(`
|
|
651
650
|
|
|
652
|
-
`),
|
|
651
|
+
`), Et = (t) => {
|
|
653
652
|
const e = t?.configurable?.context?.solutionDesignJson;
|
|
654
653
|
if (typeof e != "string" || !e.trim())
|
|
655
654
|
return null;
|
|
656
655
|
try {
|
|
657
|
-
const s = JSON.parse(e), n =
|
|
656
|
+
const s = JSON.parse(e), n = I(
|
|
658
657
|
{ response: "", ...s },
|
|
659
658
|
{ itemId: s?.solution?.itemId ?? null }
|
|
660
|
-
),
|
|
661
|
-
if (!
|
|
659
|
+
), i = G.safeParse(n);
|
|
660
|
+
if (!i.success)
|
|
662
661
|
return null;
|
|
663
|
-
const { response:
|
|
664
|
-
return
|
|
662
|
+
const { response: o, ...a } = i.data, l = s.templateId, d = typeof l == "string" && H(l) ? l : null;
|
|
663
|
+
return I(
|
|
665
664
|
a,
|
|
666
665
|
{
|
|
667
666
|
sourceBuildSolution: s.sourceBuildSolution,
|
|
@@ -672,93 +671,99 @@ Description: ${e.description}`).join(`
|
|
|
672
671
|
} catch {
|
|
673
672
|
return null;
|
|
674
673
|
}
|
|
675
|
-
},
|
|
674
|
+
}, Tt = b.Root({
|
|
676
675
|
...j(),
|
|
677
676
|
/** Optional human-readable template description retained for UI use. */
|
|
678
|
-
templateDescription:
|
|
677
|
+
templateDescription: b({
|
|
679
678
|
reducer: (t, e) => typeof e == "string" || e === null ? e : t ?? null,
|
|
680
679
|
default: () => null
|
|
681
680
|
}),
|
|
682
681
|
/** Current editable design payload being refined across turns. */
|
|
683
|
-
currentDesign:
|
|
682
|
+
currentDesign: b({
|
|
684
683
|
reducer: (t = null, e) => e === void 0 ? t : e ?? null,
|
|
685
684
|
default: () => null
|
|
686
685
|
}),
|
|
687
686
|
/** Initial request assessment produced by the intake prompt. */
|
|
688
|
-
assessment:
|
|
687
|
+
assessment: b({
|
|
689
688
|
reducer: (t = null, e) => e === void 0 ? t : e ?? null,
|
|
690
689
|
default: () => null
|
|
691
690
|
}),
|
|
692
691
|
/** Template selected automatically or by human-in-the-loop choice. */
|
|
693
|
-
selectedTemplate:
|
|
692
|
+
selectedTemplate: b({
|
|
694
693
|
reducer: (t = null, e) => e === void 0 ? t : e ?? null,
|
|
695
694
|
default: () => null
|
|
696
695
|
}),
|
|
697
696
|
/** Existing solution matches surfaced before building a new solution. */
|
|
698
|
-
existingMatches:
|
|
697
|
+
existingMatches: b({
|
|
699
698
|
reducer: (t = [], e) => e === void 0 ? t : e ?? [],
|
|
700
699
|
default: () => []
|
|
700
|
+
}),
|
|
701
|
+
/** User decision for whether to continue building after existing matches are shown. */
|
|
702
|
+
continueBuilding: b({
|
|
703
|
+
reducer: (t = null, e) => e === void 0 ? t : e ?? null,
|
|
704
|
+
default: () => null
|
|
701
705
|
})
|
|
702
706
|
}), At = (t, e) => {
|
|
703
|
-
const s =
|
|
704
|
-
return JSON.stringify(t.currentDesign) !== JSON.stringify(s) && (
|
|
705
|
-
},
|
|
706
|
-
await
|
|
707
|
-
const s = t.agentExecutionContext.userRequest, n = kt(),
|
|
708
|
-
promptText: await
|
|
707
|
+
const s = Et(e), n = s?.templateId ?? null, i = {};
|
|
708
|
+
return JSON.stringify(t.currentDesign) !== JSON.stringify(s) && (i.currentDesign = s), n && t.selectedTemplate !== n && (i.selectedTemplate = n), i;
|
|
709
|
+
}, Dt = async (t, e) => {
|
|
710
|
+
await v({ text: f("understandingRequest", e) }, e), await ye(e);
|
|
711
|
+
const s = t.agentExecutionContext.userRequest, n = kt(), i = t.agentExecutionContext.messages.slice(-11), o = await D({
|
|
712
|
+
promptText: await y(L, "initialAssessment"),
|
|
709
713
|
modelTier: "advanced",
|
|
710
714
|
temperature: 0,
|
|
711
715
|
schema: mt,
|
|
712
|
-
messages:
|
|
716
|
+
messages: i,
|
|
713
717
|
inputVariables: { query: s, availableTemplates: n }
|
|
714
|
-
}), a =
|
|
718
|
+
}), a = o.matchedTemplates.filter(
|
|
715
719
|
(c) => H(c.templateId)
|
|
716
720
|
), l = {
|
|
717
|
-
...
|
|
721
|
+
...o,
|
|
718
722
|
matchedTemplates: a
|
|
719
|
-
}, [d, u] = a,
|
|
723
|
+
}, [d, u] = a, h = !!d && d.confidence >= ht && (u === void 0 || d.confidence - u.confidence >= ft) ? d.templateId : null;
|
|
720
724
|
return {
|
|
721
725
|
assessment: l,
|
|
722
|
-
selectedTemplate:
|
|
723
|
-
existingMatches: []
|
|
726
|
+
selectedTemplate: h,
|
|
727
|
+
existingMatches: [],
|
|
728
|
+
continueBuilding: null
|
|
724
729
|
};
|
|
725
|
-
},
|
|
730
|
+
}, Lt = (t) => {
|
|
726
731
|
const e = t.assessment?.assistantResponse ?? "";
|
|
727
732
|
return {
|
|
728
733
|
outputMessage: e,
|
|
729
734
|
summary: e,
|
|
730
735
|
status: "success"
|
|
731
736
|
};
|
|
732
|
-
},
|
|
733
|
-
const { hitlResponse: s } = e.configurable, n = "selectTemplate",
|
|
737
|
+
}, Rt = (t, e) => {
|
|
738
|
+
const { hitlResponse: s } = e.configurable, n = "selectTemplate", i = t.assessment?.matchedTemplates.filter(
|
|
734
739
|
(u) => H(u.templateId)
|
|
735
|
-
) ?? [],
|
|
740
|
+
) ?? [], o = i.map((u) => `${u.templateDescription}`);
|
|
736
741
|
if (s?.agentId !== "solutionBuilder" || s.id !== n) {
|
|
737
742
|
const u = {
|
|
738
743
|
agentId: "solutionBuilder",
|
|
739
744
|
id: n,
|
|
740
745
|
kind: "singleSelection",
|
|
741
|
-
message:
|
|
742
|
-
metadata: [...
|
|
746
|
+
message: f("selectTemplatePrompt", e),
|
|
747
|
+
metadata: [...o]
|
|
743
748
|
};
|
|
744
|
-
throw new
|
|
749
|
+
throw new ne(u);
|
|
745
750
|
}
|
|
746
|
-
const a = String(s.payload ?? ""), l =
|
|
751
|
+
const a = String(s.payload ?? ""), l = o.findIndex((u) => u === a);
|
|
747
752
|
return {
|
|
748
|
-
selectedTemplate: (l >= 0 ?
|
|
753
|
+
selectedTemplate: (l >= 0 ? i[l] : void 0)?.templateId ?? i[0]?.templateId ?? null
|
|
749
754
|
};
|
|
750
755
|
}, $t = async (t, e) => {
|
|
751
|
-
await
|
|
752
|
-
const s = t.agentExecutionContext.userRequest, n = tt(t.agentExecutionContext.messages) || s,
|
|
753
|
-
if (!
|
|
756
|
+
await v({ text: f("searchingExistingSolutions", e) }, e);
|
|
757
|
+
const s = t.agentExecutionContext.userRequest, n = tt(t.agentExecutionContext.messages) || s, i = await xe(e);
|
|
758
|
+
if (!i)
|
|
754
759
|
return console.warn("Solutions Search: failed to load solution embeddings cache; skipping search."), { existingMatches: [] };
|
|
755
|
-
if (!
|
|
760
|
+
if (!i.length)
|
|
756
761
|
return { existingMatches: [] };
|
|
757
|
-
const [
|
|
762
|
+
const [o] = await Be([n]), a = i.map((c) => ({
|
|
758
763
|
solution: c,
|
|
759
|
-
score:
|
|
764
|
+
score: Fe(o, c.embedding)
|
|
760
765
|
}));
|
|
761
|
-
a.sort((c,
|
|
766
|
+
a.sort((c, m) => m.score - c.score);
|
|
762
767
|
const l = a.slice(0, gt);
|
|
763
768
|
if (!l.length)
|
|
764
769
|
return { existingMatches: [] };
|
|
@@ -767,86 +772,97 @@ Snippet: ${c.snippet}
|
|
|
767
772
|
Description: ${c.description}`).join(`
|
|
768
773
|
|
|
769
774
|
`), u = t.agentExecutionContext.messages.slice(-11);
|
|
770
|
-
return { existingMatches: (await
|
|
771
|
-
promptText: await
|
|
775
|
+
return { existingMatches: (await D({
|
|
776
|
+
promptText: await y(L, "findExistingSolution"),
|
|
772
777
|
modelTier: "fast",
|
|
773
778
|
temperature: 0,
|
|
774
779
|
schema: ut,
|
|
775
780
|
messages: u,
|
|
776
781
|
inputVariables: { query: s, candidates: d }
|
|
777
|
-
})).matchedTitles.map((c) => l.find(({ solution:
|
|
778
|
-
},
|
|
779
|
-
const { existingMatches: s } = t, { hitlResponse: n } = e.configurable,
|
|
780
|
-
if (n?.agentId !== "solutionBuilder" || n.id !==
|
|
781
|
-
s.length === 1 ?
|
|
782
|
-
const
|
|
782
|
+
})).matchedTitles.map((c) => l.find(({ solution: m }) => m.title === c)).filter((c) => c !== void 0) };
|
|
783
|
+
}, Mt = (t, e) => {
|
|
784
|
+
const { existingMatches: s } = t, { hitlResponse: n } = e.configurable, i = `confirmExistingSolution:${s[0].solution.id}`;
|
|
785
|
+
if (n?.agentId !== "solutionBuilder" || n.id !== i) {
|
|
786
|
+
s.length === 1 ? le(s[0].solution.id) : re(s);
|
|
787
|
+
const d = f("existingSolutionMatch", e), u = [
|
|
788
|
+
f("continueBuildingYes", e),
|
|
789
|
+
f("continueBuildingNo", e)
|
|
790
|
+
], g = {
|
|
783
791
|
agentId: "solutionBuilder",
|
|
784
|
-
id:
|
|
785
|
-
kind: "
|
|
786
|
-
message:
|
|
787
|
-
metadata:
|
|
792
|
+
id: i,
|
|
793
|
+
kind: "singleSelection",
|
|
794
|
+
message: d,
|
|
795
|
+
metadata: u
|
|
788
796
|
};
|
|
789
|
-
throw new
|
|
797
|
+
throw new ne(g);
|
|
790
798
|
}
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
799
|
+
const o = String(n.payload ?? "").trim(), a = f("continueBuildingNo", e);
|
|
800
|
+
return { continueBuilding: o !== a };
|
|
801
|
+
}, Bt = (t, e) => {
|
|
802
|
+
const s = f("continueBuildingDeclined", e);
|
|
803
|
+
return {
|
|
804
|
+
outputMessage: s,
|
|
805
|
+
summary: s,
|
|
806
|
+
status: "success"
|
|
807
|
+
};
|
|
808
|
+
}, ve = async (t, e) => {
|
|
809
|
+
await ye(e);
|
|
794
810
|
const { currentDesign: s } = t, n = t.agentExecutionContext.userRequest;
|
|
795
|
-
await
|
|
796
|
-
let
|
|
797
|
-
if (
|
|
811
|
+
await v({ text: f("creatingDesign", e) }, e);
|
|
812
|
+
let i = F(t.selectedTemplate);
|
|
813
|
+
if (i?.initialTemplate || (await V(e), i = F(t.selectedTemplate)), !i?.initialTemplate)
|
|
798
814
|
throw new Error("No hydrated templates are available for solution design.");
|
|
799
|
-
const
|
|
800
|
-
s ??
|
|
815
|
+
const o = I(
|
|
816
|
+
s ?? i.initialTemplate,
|
|
801
817
|
{
|
|
802
|
-
itemId: (s ??
|
|
803
|
-
sourceBuildSolution: s?.sourceBuildSolution ??
|
|
804
|
-
params: s?.params ??
|
|
818
|
+
itemId: (s ?? i.initialTemplate)?.solution?.itemId ?? null,
|
|
819
|
+
sourceBuildSolution: s?.sourceBuildSolution ?? i.initialTemplate.sourceBuildSolution,
|
|
820
|
+
params: s?.params ?? i.initialTemplate.params ?? null
|
|
805
821
|
}
|
|
806
|
-
), a = t.agentExecutionContext.messages.slice(-11), l = await
|
|
807
|
-
promptText: await
|
|
822
|
+
), a = t.agentExecutionContext.messages.slice(-11), l = await D({
|
|
823
|
+
promptText: await y(L, "designSolution"),
|
|
808
824
|
modelTier: "advanced",
|
|
809
825
|
temperature: 0,
|
|
810
826
|
schema: G,
|
|
811
827
|
messages: a,
|
|
812
828
|
inputVariables: {
|
|
813
|
-
currentDesign: JSON.stringify(
|
|
814
|
-
templateInstructions:
|
|
829
|
+
currentDesign: JSON.stringify(oe(o)),
|
|
830
|
+
templateInstructions: i.instructions,
|
|
815
831
|
query: n
|
|
816
832
|
}
|
|
817
|
-
}), { response: d, featureLayer: u, ...
|
|
833
|
+
}), { response: d, featureLayer: u, ...g } = l, h = ae(
|
|
818
834
|
u,
|
|
819
|
-
|
|
820
|
-
), c =
|
|
821
|
-
{ ...
|
|
835
|
+
o.featureLayer
|
|
836
|
+
), c = I(
|
|
837
|
+
{ ...g, featureLayer: h },
|
|
822
838
|
{
|
|
823
|
-
itemId:
|
|
824
|
-
sourceBuildSolution:
|
|
839
|
+
itemId: o?.solution?.itemId,
|
|
840
|
+
sourceBuildSolution: o.sourceBuildSolution,
|
|
825
841
|
templateId: t.selectedTemplate ?? null,
|
|
826
|
-
params:
|
|
842
|
+
params: o.params ?? null
|
|
827
843
|
}
|
|
828
|
-
),
|
|
829
|
-
if (!
|
|
844
|
+
), m = new pe(c, i.initialTemplate);
|
|
845
|
+
if (!m.isValid)
|
|
830
846
|
return console.warn(
|
|
831
847
|
"[SolutionBuilder] designSolution validation failed:",
|
|
832
|
-
{ issues:
|
|
848
|
+
{ issues: m.issues, llmResponse: l }
|
|
833
849
|
), {
|
|
834
|
-
outputMessage:
|
|
850
|
+
outputMessage: f("createDesignFailed", e)
|
|
835
851
|
};
|
|
836
|
-
const
|
|
837
|
-
if (!
|
|
852
|
+
const E = c.sourceBuildSolution, C = ge(c, E);
|
|
853
|
+
if (!C.ok) {
|
|
838
854
|
console.warn(
|
|
839
855
|
"[SolutionBuilder] designSolution Esri JSON conversion failed:",
|
|
840
|
-
{ error:
|
|
856
|
+
{ error: C.error, llmResponse: l, design: c }
|
|
841
857
|
);
|
|
842
|
-
const
|
|
858
|
+
const _ = f("createDesignFailed", e);
|
|
843
859
|
return {
|
|
844
|
-
outputMessage:
|
|
845
|
-
summary:
|
|
860
|
+
outputMessage: _,
|
|
861
|
+
summary: _,
|
|
846
862
|
status: "success"
|
|
847
863
|
};
|
|
848
864
|
}
|
|
849
|
-
return
|
|
865
|
+
return me(c), {
|
|
850
866
|
outputMessage: d,
|
|
851
867
|
summary: d,
|
|
852
868
|
status: "success",
|
|
@@ -855,20 +871,20 @@ Description: ${c.description}`).join(`
|
|
|
855
871
|
}, Ft = async (t, e) => {
|
|
856
872
|
const { currentDesign: s } = t;
|
|
857
873
|
if (!s)
|
|
858
|
-
return
|
|
859
|
-
const n = t.agentExecutionContext.userRequest,
|
|
860
|
-
await
|
|
861
|
-
const
|
|
862
|
-
promptText: await
|
|
874
|
+
return ve(t, e);
|
|
875
|
+
const n = t.agentExecutionContext.userRequest, i = t.agentExecutionContext.messages.slice(-11);
|
|
876
|
+
await v({ text: f("updatingDesign", e) }, e);
|
|
877
|
+
const o = await D({
|
|
878
|
+
promptText: await y(L, "updateDesign"),
|
|
863
879
|
modelTier: "advanced",
|
|
864
880
|
temperature: 0,
|
|
865
881
|
schema: dt,
|
|
866
|
-
messages:
|
|
882
|
+
messages: i,
|
|
867
883
|
inputVariables: {
|
|
868
884
|
currentDesign: JSON.stringify(qe(s)),
|
|
869
885
|
query: n
|
|
870
886
|
}
|
|
871
|
-
}), { response: a, patches: l } =
|
|
887
|
+
}), { response: a, patches: l } = o;
|
|
872
888
|
if (!l || l.length === 0)
|
|
873
889
|
return {
|
|
874
890
|
outputMessage: a,
|
|
@@ -879,8 +895,8 @@ Description: ${c.description}`).join(`
|
|
|
879
895
|
try {
|
|
880
896
|
return JSON.parse(p);
|
|
881
897
|
} catch {
|
|
882
|
-
const
|
|
883
|
-
switch (
|
|
898
|
+
const S = p.replace(/[\u0000-\u001F]/g, (Y) => {
|
|
899
|
+
switch (Y) {
|
|
884
900
|
case "\b":
|
|
885
901
|
return "\\b";
|
|
886
902
|
case "\f":
|
|
@@ -893,58 +909,58 @@ Description: ${c.description}`).join(`
|
|
|
893
909
|
case " ":
|
|
894
910
|
return "\\t";
|
|
895
911
|
default:
|
|
896
|
-
return "\\u" +
|
|
912
|
+
return "\\u" + Y.charCodeAt(0).toString(16).padStart(4, "0");
|
|
897
913
|
}
|
|
898
914
|
});
|
|
899
915
|
try {
|
|
900
|
-
return JSON.parse(
|
|
916
|
+
return JSON.parse(S);
|
|
901
917
|
} catch {
|
|
902
918
|
return p;
|
|
903
919
|
}
|
|
904
920
|
}
|
|
905
|
-
},
|
|
921
|
+
}, g = [...l.map((p) => ({
|
|
906
922
|
op: p.op,
|
|
907
923
|
path: p.path.replace(/\/+$/, ""),
|
|
908
924
|
...p.value != null && p.value !== "" ? { value: d(p.value) } : {},
|
|
909
925
|
...p.from != null && p.from !== "" ? { from: p.from } : {}
|
|
910
|
-
}))].sort((p,
|
|
911
|
-
|
|
926
|
+
}))].sort((p, S) => p.op !== "remove" || S.op !== "remove" ? 0 : S.path.localeCompare(p.path, void 0, { numeric: !0 })), h = structuredClone(
|
|
927
|
+
oe(s)
|
|
912
928
|
);
|
|
913
929
|
try {
|
|
914
|
-
|
|
930
|
+
Ne(h, g, !0);
|
|
915
931
|
} catch (p) {
|
|
916
932
|
console.warn(
|
|
917
933
|
"[SolutionBuilder] updateDesign JSON patch failed:",
|
|
918
|
-
{ error: p, llmResponse:
|
|
934
|
+
{ error: p, llmResponse: o, patches: g, patchTarget: h }
|
|
919
935
|
);
|
|
920
|
-
const
|
|
936
|
+
const S = f("applyChangeFailed", e);
|
|
921
937
|
return {
|
|
922
|
-
outputMessage:
|
|
923
|
-
summary:
|
|
938
|
+
outputMessage: S,
|
|
939
|
+
summary: S,
|
|
924
940
|
status: "success"
|
|
925
941
|
};
|
|
926
942
|
}
|
|
927
|
-
const c =
|
|
928
|
-
{ response: "", ...
|
|
943
|
+
const c = I(
|
|
944
|
+
{ response: "", ...h },
|
|
929
945
|
{ itemId: s.solution?.itemId ?? null }
|
|
930
|
-
),
|
|
931
|
-
if (!
|
|
946
|
+
), m = G.safeParse(c);
|
|
947
|
+
if (!m.success) {
|
|
932
948
|
console.warn(
|
|
933
949
|
"[SolutionBuilder] updateDesign schema validation failed:",
|
|
934
|
-
{ errors:
|
|
950
|
+
{ errors: m.error.issues, llmResponse: o, patchedDesign: c }
|
|
935
951
|
);
|
|
936
|
-
const p =
|
|
952
|
+
const p = f("applyChangeFailed", e);
|
|
937
953
|
return {
|
|
938
954
|
outputMessage: p,
|
|
939
955
|
summary: p,
|
|
940
956
|
status: "success"
|
|
941
957
|
};
|
|
942
958
|
}
|
|
943
|
-
const { response:
|
|
944
|
-
|
|
959
|
+
const { response: E, featureLayer: C, ..._ } = m.data, Se = ae(
|
|
960
|
+
C,
|
|
945
961
|
s.featureLayer
|
|
946
|
-
),
|
|
947
|
-
{ ...
|
|
962
|
+
), w = I(
|
|
963
|
+
{ ..._, featureLayer: Se },
|
|
948
964
|
{
|
|
949
965
|
itemId: s.solution?.itemId,
|
|
950
966
|
sourceBuildSolution: s.sourceBuildSolution,
|
|
@@ -952,153 +968,167 @@ Description: ${c.description}`).join(`
|
|
|
952
968
|
params: s.params ?? null
|
|
953
969
|
}
|
|
954
970
|
);
|
|
955
|
-
let
|
|
956
|
-
if (
|
|
971
|
+
let R = F(t.selectedTemplate);
|
|
972
|
+
if (R?.initialTemplate || (await V(e), R = F(t.selectedTemplate)), !R?.initialTemplate)
|
|
957
973
|
throw new Error("No hydrated templates are available for solution design.");
|
|
958
|
-
const
|
|
959
|
-
if (!
|
|
974
|
+
const K = new pe(w, R.initialTemplate, !1);
|
|
975
|
+
if (!K.isValid)
|
|
960
976
|
return console.warn(
|
|
961
977
|
"[SolutionBuilder] updateDesign validation failed:",
|
|
962
|
-
{ issues:
|
|
978
|
+
{ issues: K.issues, llmResponse: o, patchedDesign: w }
|
|
963
979
|
), {
|
|
964
|
-
outputMessage:
|
|
980
|
+
outputMessage: f("applyChangeFailed", e)
|
|
965
981
|
};
|
|
966
|
-
const Ie =
|
|
967
|
-
if (!
|
|
982
|
+
const Ie = w.sourceBuildSolution, Q = ge(w, Ie);
|
|
983
|
+
if (!Q.ok) {
|
|
968
984
|
console.warn(
|
|
969
985
|
"[SolutionBuilder] updateDesign Esri JSON conversion failed:",
|
|
970
|
-
{ error:
|
|
986
|
+
{ error: Q.error, llmResponse: o, design: w }
|
|
971
987
|
);
|
|
972
|
-
const p =
|
|
988
|
+
const p = f("applyChangeFailed", e);
|
|
973
989
|
return {
|
|
974
990
|
outputMessage: p,
|
|
975
991
|
summary: p,
|
|
976
992
|
status: "success"
|
|
977
993
|
};
|
|
978
994
|
}
|
|
979
|
-
return
|
|
995
|
+
return me(w), {
|
|
980
996
|
outputMessage: a,
|
|
981
997
|
summary: a,
|
|
982
998
|
status: "success",
|
|
983
|
-
currentDesign:
|
|
999
|
+
currentDesign: w
|
|
984
1000
|
};
|
|
985
|
-
}, Pt = (t) => t.currentDesign !== null ? "updateDesign" : "assessInitialRequest", Nt = (t) => !t.assessment || !t.assessment.isValidUseCase ? "invalidUseCaseExit" : !t.selectedTemplate && t.assessment.matchedTemplates.length > 1 ? "selectTemplateHIL" : "findExistingSolutions",
|
|
1001
|
+
}, Pt = (t) => t.currentDesign !== null ? "updateDesign" : "assessInitialRequest", Nt = (t) => !t.assessment || !t.assessment.isValidUseCase ? "invalidUseCaseExit" : !t.selectedTemplate && t.assessment.matchedTemplates.length > 1 ? "selectTemplateHIL" : "findExistingSolutions", qt = (t) => t.existingMatches.length > 0 ? "confirmContinueBuildingHIL" : "designSolution", Ut = (t) => t.continueBuilding === !1 ? "declineContinueBuildingExit" : "designSolution", Ot = () => new O(Tt).addNode("syncCurrentDesignFromContext", At).addNode("assessInitialRequest", Dt).addNode("invalidUseCaseExit", Lt).addNode("selectTemplateHIL", Rt).addNode("findExistingSolutions", $t).addNode("confirmContinueBuildingHIL", Mt).addNode("declineContinueBuildingExit", Bt).addNode("designSolution", ve).addNode("updateDesign", Ft).addEdge(z, "syncCurrentDesignFromContext").addConditionalEdges("syncCurrentDesignFromContext", Pt, {
|
|
986
1002
|
updateDesign: "updateDesign",
|
|
987
1003
|
assessInitialRequest: "assessInitialRequest"
|
|
988
1004
|
}).addConditionalEdges("assessInitialRequest", Nt, {
|
|
989
1005
|
invalidUseCaseExit: "invalidUseCaseExit",
|
|
990
1006
|
selectTemplateHIL: "selectTemplateHIL",
|
|
991
1007
|
findExistingSolutions: "findExistingSolutions"
|
|
992
|
-
}).addEdge("invalidUseCaseExit",
|
|
1008
|
+
}).addEdge("invalidUseCaseExit", x).addEdge("selectTemplateHIL", "findExistingSolutions").addConditionalEdges("findExistingSolutions", qt, {
|
|
993
1009
|
confirmContinueBuildingHIL: "confirmContinueBuildingHIL",
|
|
994
1010
|
designSolution: "designSolution"
|
|
995
|
-
}).
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1011
|
+
}).addConditionalEdges("confirmContinueBuildingHIL", Ut, {
|
|
1012
|
+
declineContinueBuildingExit: "declineContinueBuildingExit",
|
|
1013
|
+
designSolution: "designSolution"
|
|
1014
|
+
}).addEdge("declineContinueBuildingExit", x).addEdge("designSolution", x).addEdge("updateDesign", x);
|
|
1015
|
+
await y(L, "description");
|
|
1016
|
+
const zt = T.object({
|
|
1017
|
+
tool: T.enum(["explorer", "builder", "other"]).describe("The selected tool based on the user's query."),
|
|
1018
|
+
confidence: T.number().min(0).max(1).describe("A confidence score (0.00–1.00)."),
|
|
1019
|
+
rationale: T.string().min(1).describe("A brief rationale for the tool choice (≤140 characters)"),
|
|
1020
|
+
builderExclusion: T.boolean().describe("True only when tool is other specifically due to Builder Exclusion Override.")
|
|
1021
|
+
}), P = /* @__PURE__ */ Object.assign({
|
|
1002
1022
|
"./prompts/assistantResponse.md": () => import("../../chunks/assistantResponse.js").then((t) => t.default),
|
|
1003
1023
|
"./prompts/classifyIntent.md": () => import("../../chunks/classifyIntent.js").then((t) => t.default),
|
|
1004
|
-
"./prompts/description.md": () => import("../../chunks/description.js").then((t) => t.default)
|
|
1005
|
-
|
|
1024
|
+
"./prompts/description.md": () => import("../../chunks/description.js").then((t) => t.default),
|
|
1025
|
+
"./prompts/responseOptionsBuilderExclusion.md": () => import("../../chunks/responseOptionsBuilderExclusion.js").then((t) => t.default),
|
|
1026
|
+
"./prompts/responseOptionsDefault.md": () => import("../../chunks/responseOptionsDefault.js").then((t) => t.default)
|
|
1027
|
+
}), W = () => {
|
|
1006
1028
|
const t = new CustomEvent("assistantProcessing", {
|
|
1007
1029
|
detail: !1
|
|
1008
1030
|
});
|
|
1009
1031
|
window.dispatchEvent(t);
|
|
1010
|
-
},
|
|
1032
|
+
}, we = b.Root({
|
|
1011
1033
|
...j(),
|
|
1012
|
-
selectedTool:
|
|
1034
|
+
selectedTool: b({
|
|
1013
1035
|
reducer: (t, e) => e ?? null,
|
|
1014
1036
|
default: () => null
|
|
1015
1037
|
}),
|
|
1016
|
-
intentRationale:
|
|
1038
|
+
intentRationale: b({
|
|
1017
1039
|
reducer: (t, e) => e ?? null,
|
|
1018
1040
|
default: () => null
|
|
1041
|
+
}),
|
|
1042
|
+
builderExclusion: b({
|
|
1043
|
+
reducer: (t, e) => e ?? !1,
|
|
1044
|
+
default: () => !1
|
|
1019
1045
|
})
|
|
1020
|
-
}),
|
|
1046
|
+
}), jt = async (t, e) => {
|
|
1021
1047
|
const s = N(e);
|
|
1022
|
-
await
|
|
1048
|
+
await v(
|
|
1023
1049
|
{ text: s?.builderMessages.understandingRequest },
|
|
1024
1050
|
e
|
|
1025
1051
|
);
|
|
1026
|
-
const n = t.agentExecutionContext.userRequest,
|
|
1052
|
+
const n = t.agentExecutionContext.userRequest, i = t.agentExecutionContext.messages.slice(-11), o = e?.configurable?.context?.solutionDesignJson;
|
|
1027
1053
|
let a = !1;
|
|
1028
|
-
if (typeof
|
|
1054
|
+
if (typeof o == "string" && o.trim())
|
|
1029
1055
|
try {
|
|
1030
|
-
a = JSON.parse(
|
|
1056
|
+
a = JSON.parse(o).solution != null;
|
|
1031
1057
|
} catch {
|
|
1032
1058
|
a = !1;
|
|
1033
1059
|
}
|
|
1034
|
-
const l = await
|
|
1060
|
+
const l = await y(P, "classifyIntent"), d = await D({
|
|
1035
1061
|
promptText: l,
|
|
1036
1062
|
modelTier: "advanced",
|
|
1037
1063
|
temperature: 0,
|
|
1038
|
-
schema:
|
|
1039
|
-
messages:
|
|
1064
|
+
schema: zt,
|
|
1065
|
+
messages: i,
|
|
1040
1066
|
inputVariables: { query: n, activeSolutionDesign: a }
|
|
1041
1067
|
});
|
|
1042
1068
|
return {
|
|
1043
1069
|
selectedTool: d.tool,
|
|
1044
|
-
intentRationale: d.rationale
|
|
1070
|
+
intentRationale: d.rationale,
|
|
1071
|
+
builderExclusion: d.builderExclusion
|
|
1045
1072
|
};
|
|
1046
|
-
}, Ot = async (t, e) => {
|
|
1047
|
-
const n = await Ke().compile().invoke(t, e);
|
|
1048
|
-
return K(), n;
|
|
1049
|
-
}, jt = async (t, e) => {
|
|
1050
|
-
const n = await qt().compile().invoke(t, e);
|
|
1051
|
-
return K(), n;
|
|
1052
1073
|
}, Jt = async (t, e) => {
|
|
1053
|
-
const
|
|
1054
|
-
|
|
1074
|
+
const n = await Ke().compile().invoke(t, e);
|
|
1075
|
+
return W(), n;
|
|
1076
|
+
}, Gt = async (t, e) => {
|
|
1077
|
+
const n = await Ot().compile().invoke(t, e);
|
|
1078
|
+
return W(), n;
|
|
1079
|
+
}, Ht = async (t, e) => {
|
|
1080
|
+
const s = N(e), n = t.agentExecutionContext.userRequest, i = t.intentRationale ?? "No rationale available.", o = t.builderExclusion ? "responseOptionsBuilderExclusion" : "responseOptionsDefault";
|
|
1081
|
+
await v(
|
|
1055
1082
|
{ text: s?.executingSolutionsAssistantAgent },
|
|
1056
1083
|
e
|
|
1057
1084
|
);
|
|
1058
|
-
const
|
|
1059
|
-
|
|
1060
|
-
|
|
1085
|
+
const a = await y(P, "assistantResponse"), l = await y(
|
|
1086
|
+
P,
|
|
1087
|
+
o
|
|
1088
|
+
), d = t.agentExecutionContext.messages.slice(-11), u = await Pe({
|
|
1089
|
+
promptText: a,
|
|
1090
|
+
modelTier: "advanced",
|
|
1061
1091
|
temperature: 0,
|
|
1062
|
-
messages:
|
|
1063
|
-
inputVariables: { query: n, rationale:
|
|
1092
|
+
messages: d,
|
|
1093
|
+
inputVariables: { query: n, rationale: i, responseOptions: l }
|
|
1064
1094
|
});
|
|
1065
|
-
return
|
|
1066
|
-
outputMessage:
|
|
1067
|
-
summary:
|
|
1095
|
+
return W(), {
|
|
1096
|
+
outputMessage: u,
|
|
1097
|
+
summary: u,
|
|
1068
1098
|
status: "success"
|
|
1069
1099
|
};
|
|
1070
|
-
},
|
|
1100
|
+
}, Vt = (t) => t.selectedTool ?? "other", Wt = () => new O(we).addNode("classifyIntent", jt).addNode("routeToExplorer", Jt).addNode("routeToBuilder", Gt).addNode("assistantResponse", Ht).addEdge(z, "classifyIntent").addConditionalEdges("classifyIntent", Vt, {
|
|
1071
1101
|
explorer: "routeToExplorer",
|
|
1072
1102
|
builder: "routeToBuilder",
|
|
1073
1103
|
other: "assistantResponse"
|
|
1074
|
-
}).addEdge("routeToExplorer",
|
|
1104
|
+
}).addEdge("routeToExplorer", x).addEdge("routeToBuilder", x).addEdge("assistantResponse", x), Kt = await y(P, "description"), Qt = {
|
|
1075
1105
|
id: "solutionsAssistant",
|
|
1076
1106
|
name: "Solutions Assistant Agent",
|
|
1077
|
-
description:
|
|
1078
|
-
createGraph:
|
|
1079
|
-
workspace:
|
|
1080
|
-
},
|
|
1081
|
-
class
|
|
1107
|
+
description: Kt,
|
|
1108
|
+
createGraph: Wt,
|
|
1109
|
+
workspace: we
|
|
1110
|
+
}, Yt = "https://links.esri.com/solutions/agol-organizational-account", Zt = "https://links.esri.com/solutions/configure-assistants";
|
|
1111
|
+
class Xt extends ke {
|
|
1082
1112
|
constructor() {
|
|
1083
1113
|
super(), this.open = !1, this.userFirstName = "", this.builderVisible = !1, this.hasActiveBuilderDesign = !1, this._conversationId = void 0, this._orgSettings = {
|
|
1084
1114
|
aiAssistantsEnabled: !1,
|
|
1085
1115
|
blockBetaApps: !0,
|
|
1086
1116
|
colocateCompute: !1
|
|
1087
|
-
}, this._suggestedPrompts = [], this._hasInteracted = !1, this._isMobile = window.innerWidth <= 800, this._translations = _e({ name: "arcgis-solutions-assistant", blocking: !0 }), this._builderWidth = 48, this._solutionDesignJson = '{ "solution": null }', this._isAssistantBusy = !1, this._isBuilderBusy = !1, this._preChatCheck = !1, this._assistantRef = $e(), this._configContextConsumer =
|
|
1117
|
+
}, this._suggestedPrompts = [], this._hasInteracted = !1, this._isMobile = window.innerWidth <= 800, this._translations = _e({ name: "arcgis-solutions-assistant", blocking: !0 }), this._builderWidth = 48, this._solutionDesignJson = '{ "solution": null }', this._isAssistantBusy = !1, this._isBuilderBusy = !1, this._preChatCheck = !1, this._assistantRef = $e(), this._configContextConsumer = ee({
|
|
1088
1118
|
context: Ae,
|
|
1089
1119
|
subscribe: !0,
|
|
1090
1120
|
callback: (e) => {
|
|
1091
|
-
e?.portalURL && (
|
|
1121
|
+
e?.portalURL && (te.portalUrl = e.portalURL), e?.userSession && !this.userFirstName && this._loadUserFirstName(), e?.authentication?.PortalSubset?.orgSettings && (this._orgSettings = e?.authentication?.PortalSubset?.orgSettings);
|
|
1092
1122
|
}
|
|
1093
|
-
}), this._builderDesignContextConsumer =
|
|
1094
|
-
context:
|
|
1123
|
+
}), this._builderDesignContextConsumer = ee({
|
|
1124
|
+
context: De,
|
|
1095
1125
|
subscribe: !0,
|
|
1096
1126
|
callback: (e) => {
|
|
1097
1127
|
e?.design && (this._solutionDesignJson = JSON.stringify(e.design, null, 2));
|
|
1098
1128
|
}
|
|
1099
1129
|
}), this._handleResize = () => {
|
|
1100
1130
|
this._isMobile = window.innerWidth <= 800;
|
|
1101
|
-
}, this.closeAssistant =
|
|
1131
|
+
}, this.closeAssistant = Z(), this.assistantProcessing = Z(), this._handleAssistantLinkClick = (e) => {
|
|
1102
1132
|
const s = e.composedPath().find((n) => n instanceof HTMLAnchorElement);
|
|
1103
1133
|
if (s?.href)
|
|
1104
1134
|
if (e.preventDefault(), s.target.indexOf("solutionId:") > -1) {
|
|
@@ -1114,15 +1144,15 @@ class Yt extends ke {
|
|
|
1114
1144
|
}, this._checkURLOpenParameter = () => {
|
|
1115
1145
|
this.open = this._configContextConsumer.value?.authentication?.SignInParam === "aiOpen" || this.open;
|
|
1116
1146
|
}, this.listenOn(window, "arcgisFeedback", (e) => {
|
|
1117
|
-
const s = e.detail, { agentPicked: n, taskAssigned:
|
|
1118
|
-
this._sendFeedback(s.content,
|
|
1147
|
+
const s = e.detail, { agentPicked: n, taskAssigned: i, userMessage: o } = this._parseAgentPickedAndTask(s);
|
|
1148
|
+
this._sendFeedback(s.content, o ?? i ?? "", s.feedback?.positive ? "Good" : s.feedback?.positive == "Bad" ? "Bad" : "N/A", n ?? "");
|
|
1119
1149
|
});
|
|
1120
1150
|
}
|
|
1121
1151
|
static {
|
|
1122
1152
|
this.properties = { open: 5, userFirstName: 1, builderVisible: 5, hasActiveBuilderDesign: 5, _conversationId: 16, _orgSettings: 16, _suggestedPrompts: 16, _hasInteracted: 16, _isMobile: 16, _translations: 16, _builderWidth: 16, _solutionDesignJson: 16, _isAssistantBusy: 16, _isBuilderBusy: 16, _preChatCheck: 16 };
|
|
1123
1153
|
}
|
|
1124
1154
|
static {
|
|
1125
|
-
this.styles =
|
|
1155
|
+
this.styles = ze;
|
|
1126
1156
|
}
|
|
1127
1157
|
get _telemetry() {
|
|
1128
1158
|
return this._configContextConsumer.value?.telemetrySession;
|
|
@@ -1137,38 +1167,44 @@ class Yt extends ke {
|
|
|
1137
1167
|
this._checkURLOpenParameter();
|
|
1138
1168
|
}
|
|
1139
1169
|
load() {
|
|
1140
|
-
this._configContextConsumer.value?.portalURL && (
|
|
1170
|
+
this._configContextConsumer.value?.portalURL && (te.portalUrl = this._configContextConsumer.value.portalURL);
|
|
1141
1171
|
}
|
|
1142
1172
|
firstUpdated(e) {
|
|
1143
1173
|
this._loadUserFirstName();
|
|
1144
1174
|
}
|
|
1145
1175
|
willUpdate(e) {
|
|
1146
|
-
e.has("open") && this.open && window.dispatchEvent(new CustomEvent("openAssistant")), this._configContextConsumer.value?.authentication && this._configContextConsumer.value?.userSession?.token && (this._preChatCheck || (
|
|
1176
|
+
e.has("open") && this.open && window.dispatchEvent(new CustomEvent("openAssistant")), this._configContextConsumer.value?.authentication && this._configContextConsumer.value?.userSession?.token && (this._preChatCheck || (de(this._configContextConsumer.value?.authentication.Portal, this._configContextConsumer.value?.userSession?.token, this._configContextConsumer.value?.locale ?? "en"), this._preChatCheck = !0)), this._configContextConsumer.value?.userSession?.token && this._configContextConsumer.value?.authentication?.CanUseAI;
|
|
1147
1177
|
}
|
|
1148
1178
|
_renderNoSign() {
|
|
1149
|
-
return
|
|
1179
|
+
return k`<calcite-notice class="margin-lg" open scale=m icon=effects kind=info><div slot=message>${this._translations.signInMessage}</div><calcite-link @click=${this._handleSignIn} slot=link title=${this._translations.signInMessage ?? X} class="padding-top-10">${this._translations.signIn}</calcite-link></calcite-notice>`;
|
|
1150
1180
|
}
|
|
1151
1181
|
_renderNoPermission() {
|
|
1152
|
-
return
|
|
1182
|
+
return k`<calcite-notice open scale=m icon=effects kind=info><div slot=title>${this._translations.noPermissionTitle}</div><div slot=message class="padding-top-10">${Te(this._translations.noPermissionMessage.replace("{{orgUrl}}", Yt).replace("{{configAI}}", Zt))}</div></calcite-notice>`;
|
|
1153
1183
|
}
|
|
1154
1184
|
render() {
|
|
1155
1185
|
let e = this._suggestedPrompts.length > 0 ? this._suggestedPrompts : this._hasInteracted ? [] : Object.values(this._translations.defaultFollowUpQuestions);
|
|
1156
|
-
return this._suggestedPrompts.length > 0 ? e = this._suggestedPrompts : this._hasInteracted || (e = [...Object.values(this._translations.defaultFollowUpQuestions)]),
|
|
1186
|
+
return this._suggestedPrompts.length > 0 ? e = this._suggestedPrompts : this._hasInteracted || (e = [...Object.values(this._translations.defaultFollowUpQuestions)]), k`<calcite-panel class="chat-panel"><div class="header-content" slot=header-content><span class="header-title">${this._translations.solutionAssistantTitle}</span></div>${this._configContextConsumer.value?.userSession?.token ? this._configContextConsumer.value?.authentication?.CanUseAI ? k`${!this._isMobile && k`<calcite-action id=solutionBuilderAction icon=pencil-square .text=${this._translations.tooltips.builder} text-enabled .indicator=${this.hasActiveBuilderDesign} .disabled=${!this.hasActiveBuilderDesign} .active=${this.builderVisible} selection-appearance=highlight @click=${() => {
|
|
1157
1187
|
window.dispatchEvent(new CustomEvent("toggleSolutionBuilder"));
|
|
1158
|
-
}} scale=m slot=header-actions-end></calcite-action>` || ""}
|
|
1159
|
-
this._conversationId = void 0, this._suggestedPrompts = [], this._hasInteracted = !1, this._assistantRef.value?.clearChatHistory();
|
|
1160
|
-
}} scale=m slot=header-actions-end></calcite-action><calcite-tooltip placement=bottom reference-element=newChatButton><span>${this._translations.tooltips.newConversation}</span></calcite-tooltip>${!this._isMobile && T`<calcite-tooltip placement=bottom reference-element=solutionBuilderAction><span>${this._translations.tooltips.toggleSolutionBuilder}</span></calcite-tooltip>` || ""}<arcgis-assistant reference-element copy-enabled feedback-enabled heading description entry-message=${this._translations.defaultStartUpMessage ?? ee} .suggestedPrompts=${e} @arcgisSubmit=${(s) => {
|
|
1188
|
+
}} scale=m slot=header-actions-end></calcite-action>` || ""}${!this._isMobile && k`<calcite-tooltip placement=bottom reference-element=solutionBuilderAction><span>${this._translations.tooltips.solutionBuilder}</span></calcite-tooltip>` || ""}<arcgis-assistant reference-element copy-enabled feedback-enabled heading description entry-message=${this._translations.defaultStartUpMessage ?? X} .suggestedPrompts=${e} @arcgisSubmit=${(s) => {
|
|
1161
1189
|
console.log("arcgis submit: ", s.detail), this._suggestedPrompts = [], e = [], this._hasInteracted = !0;
|
|
1162
|
-
const n = Date.now(),
|
|
1190
|
+
const n = Date.now(), i = Re(n), o = s.detail || "Unknown";
|
|
1163
1191
|
this._telemetry?.logEvent({
|
|
1164
|
-
category:
|
|
1192
|
+
category: Le.ASSISTANT,
|
|
1165
1193
|
action: "Chat",
|
|
1166
|
-
dimensions: [
|
|
1167
|
-
metrics: [
|
|
1194
|
+
dimensions: [o],
|
|
1195
|
+
metrics: [i]
|
|
1168
1196
|
}), this.assistantProcessing.emit(!0);
|
|
1169
1197
|
}} @arcgisFeedback=${(s) => {
|
|
1170
1198
|
s.detail;
|
|
1171
|
-
}}
|
|
1199
|
+
}} @arcgisInterrupt=${() => {
|
|
1200
|
+
this._queryElementInShadowDom(this.el, ".footer-container", !0);
|
|
1201
|
+
}} @arcgisInterruptCancel=${() => {
|
|
1202
|
+
this._queryElementInShadowDom(this.el, ".footer-container", !1);
|
|
1203
|
+
}} @arcgisInterruptSubmit=${() => {
|
|
1204
|
+
this._queryElementInShadowDom(this.el, ".footer-container", !1);
|
|
1205
|
+
}} ${Me(this._assistantRef)}><calcite-button appearance=solid id=newChatButton icon-start=speech-bubble-plus kind=neutral .label=${this._translations.tooltips.newChat} @click=${() => {
|
|
1206
|
+
this._conversationId = void 0, this._suggestedPrompts = [], this._hasInteracted = !1, this._assistantRef.value?.clearChatHistory(), this._queryElementInShadowDom(this.el, ".footer-container", !1);
|
|
1207
|
+
}} round scale=s slot=entry-actions-start>${this._translations.tooltips.newChat}</calcite-button><arcgis-assistant-agent .agent=${Qt} .context=${{
|
|
1172
1208
|
token: this._configContextConsumer.value?.userSession?.token,
|
|
1173
1209
|
configContext: this._configContextConsumer.value,
|
|
1174
1210
|
convoId: this._conversationId,
|
|
@@ -1176,9 +1212,6 @@ class Yt extends ke {
|
|
|
1176
1212
|
assistantRef: this._assistantRef,
|
|
1177
1213
|
translations: this._translations,
|
|
1178
1214
|
solutionDesignJson: this._solutionDesignJson,
|
|
1179
|
-
updateSuggestedPrompts: (s) => {
|
|
1180
|
-
this._suggestedPrompts = s;
|
|
1181
|
-
},
|
|
1182
1215
|
setConversationId: (s) => {
|
|
1183
1216
|
this._conversationId = s;
|
|
1184
1217
|
},
|
|
@@ -1189,9 +1222,9 @@ class Yt extends ke {
|
|
|
1189
1222
|
this.closeAssistant.emit(!0);
|
|
1190
1223
|
}} 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>`;
|
|
1191
1224
|
}
|
|
1192
|
-
_sendFeedback(e, s, n,
|
|
1193
|
-
const
|
|
1194
|
-
window.open(
|
|
1225
|
+
_sendFeedback(e, s, n, i) {
|
|
1226
|
+
const o = `https://survey123.arcgis.com/share/6e349a50b4504ca6b6107216d568db5f?field:_source=${encodeURIComponent("Solutions Assistant")}&field:user_evaluation=${encodeURIComponent(n)}&field:question=${encodeURIComponent(s)}&field:answer=${encodeURIComponent(e)}&field:context=${encodeURIComponent(JSON.stringify({ agent: i }))}&field:version=${encodeURIComponent("v2")}`;
|
|
1227
|
+
window.open(o, "_blank");
|
|
1195
1228
|
}
|
|
1196
1229
|
async _loadUserFirstName() {
|
|
1197
1230
|
try {
|
|
@@ -1204,14 +1237,14 @@ class Yt extends ke {
|
|
|
1204
1237
|
}
|
|
1205
1238
|
}
|
|
1206
1239
|
_parseAgentPickedAndTask(e) {
|
|
1207
|
-
const s = Array.from(this._assistantRef.value?.messages || []), n = e.log || [], a = [...s].sort((c,
|
|
1240
|
+
const s = Array.from(this._assistantRef.value?.messages || []), n = e.log || [], a = [...s].sort((c, m) => m.id - c.id).find((c) => c.role === "user" && c.id <= e.id)?.content || null, l = n.find((c) => typeof c == "string" && c.includes("Agent picked:")) ?? null;
|
|
1208
1241
|
if (!l)
|
|
1209
1242
|
return { agentPicked: null, taskAssigned: null, userMessage: a };
|
|
1210
1243
|
const d = /Agent picked:\s*(.*?)\s*(?:\\n|\r?\n)\s*Task Assigned:\s*([\s\S]*)$/i, u = l.match(d);
|
|
1211
1244
|
if (!u)
|
|
1212
1245
|
return { agentPicked: null, taskAssigned: null, userMessage: a };
|
|
1213
|
-
const
|
|
1214
|
-
return { agentPicked:
|
|
1246
|
+
const g = u[1].trim(), h = u[2].trim();
|
|
1247
|
+
return { agentPicked: g, taskAssigned: h, userMessage: a };
|
|
1215
1248
|
}
|
|
1216
1249
|
_emitItemIdFromAI(e) {
|
|
1217
1250
|
const s = new CustomEvent("solutionIDFromAssistant", {
|
|
@@ -1221,8 +1254,30 @@ class Yt extends ke {
|
|
|
1221
1254
|
});
|
|
1222
1255
|
window.dispatchEvent(s);
|
|
1223
1256
|
}
|
|
1257
|
+
_queryElementInShadowDom(e, s, n) {
|
|
1258
|
+
const i = e.shadowRoot;
|
|
1259
|
+
if (i) {
|
|
1260
|
+
const o = i.querySelector("arcgis-assistant");
|
|
1261
|
+
o && o.shadowRoot && this._findElementInShadowDom(o.shadowRoot, s, n);
|
|
1262
|
+
} else
|
|
1263
|
+
console.log("No shadowRoot found on this component.");
|
|
1264
|
+
}
|
|
1265
|
+
_findElementInShadowDom(e, s, n) {
|
|
1266
|
+
const i = e.querySelector(s);
|
|
1267
|
+
i && this._disableElementAndChildren(i, n);
|
|
1268
|
+
const o = e.children;
|
|
1269
|
+
for (const a of Array.from(o))
|
|
1270
|
+
a.classList.contains(s) && this._disableElementAndChildren(a, n), this._findElementInShadowDom(a, s, n);
|
|
1271
|
+
}
|
|
1272
|
+
_disableElementAndChildren(e, s) {
|
|
1273
|
+
"disabled" in e && (e.disabled = s), e.querySelectorAll("*").forEach((i) => {
|
|
1274
|
+
i.nodeName.toLowerCase() === "arcgis-assistant-chat-entry" && i.shadowRoot && i.shadowRoot.querySelectorAll("*").forEach((l) => {
|
|
1275
|
+
"disabled" in l && (l.disabled = s);
|
|
1276
|
+
}), "disabled" in i && (i.disabled = s);
|
|
1277
|
+
});
|
|
1278
|
+
}
|
|
1224
1279
|
}
|
|
1225
|
-
Ce("arcgis-solutions-assistant",
|
|
1280
|
+
Ce("arcgis-solutions-assistant", Xt);
|
|
1226
1281
|
export {
|
|
1227
|
-
|
|
1282
|
+
Xt as ArcgisSolutionsAssistant
|
|
1228
1283
|
};
|