@arcgis/portal-components 5.2.0-next.9 → 5.2.0-next.90
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/LICENSE.md +4 -2
- package/README.md +2 -2
- package/dist/cdn/2GBRZSEC.js +2 -0
- package/dist/cdn/2T33E2DS.js +2 -0
- package/dist/cdn/2VGYRITT.js +2 -0
- package/dist/cdn/3HAZNYCD.js +2 -0
- package/dist/cdn/{GQFWFZXP.js → 3OBIA66A.js} +1 -1
- package/dist/cdn/3YCG5UCH.js +2 -0
- package/dist/cdn/42FCLPNH.js +2 -0
- package/dist/cdn/433M2GP4.js +2 -0
- package/dist/cdn/4QA4AYHJ.js +3 -0
- package/dist/cdn/4XSXCKIG.js +2 -0
- package/dist/cdn/546M6SVH.js +2 -0
- package/dist/cdn/5IXABPXR.js +2 -0
- package/dist/cdn/5YCQRL4K.js +2 -0
- package/dist/cdn/{7WZHZP6U.js → 63THOLAY.js} +9 -3
- package/dist/cdn/6KVA4AKM.js +2 -0
- package/dist/cdn/6TO2BYXU.js +2 -0
- package/dist/cdn/6XLTWENT.js +2 -0
- package/dist/cdn/7FVPT4SA.js +2 -0
- package/dist/cdn/{LAFNDBTQ.js → 7HHPKD5C.js} +1 -1
- package/dist/cdn/7TXGDAEX.js +2 -0
- package/dist/cdn/{QNUYUNEY.js → 7XD6KSXV.js} +1 -1
- package/dist/cdn/AMBLICID.js +2 -0
- package/dist/cdn/{DHHSKOUY.js → BTSXQQKZ.js} +2 -2
- package/dist/cdn/{DKBTJJMW.js → C7ZFXRPS.js} +1 -1
- package/dist/cdn/CBXQFKN5.js +2 -0
- package/dist/cdn/CFBSBZSS.js +2 -0
- package/dist/cdn/CNDTRZJT.js +2 -0
- package/dist/cdn/CYGZYLOQ.js +2 -0
- package/dist/cdn/E7MAKHJ5.js +2 -0
- package/dist/cdn/EBYEZR4N.js +2 -0
- package/dist/cdn/EUWBMLIT.js +2 -0
- package/dist/cdn/EZNTXOKK.js +2 -0
- package/dist/cdn/F3ODJVJC.js +2 -0
- package/dist/cdn/FDZ3XHNB.js +66 -0
- package/dist/cdn/G2G3GSS7.js +2 -0
- package/dist/cdn/GJ7GKO7I.js +2 -0
- package/dist/cdn/GRZLC33Y.js +2 -0
- package/dist/cdn/H76EB2WF.js +2 -0
- package/dist/cdn/HNWQS7DU.js +2 -0
- package/dist/cdn/I2KQQXOO.js +2 -0
- package/dist/cdn/IJ3CLFAU.js +22 -0
- package/dist/cdn/IJUSJCYL.js +2 -0
- package/dist/cdn/ILDTKRON.js +2 -0
- package/dist/cdn/JCYCRSPL.js +451 -0
- package/dist/cdn/JMPVXCF5.js +2 -0
- package/dist/cdn/K6A3QM3A.js +660 -0
- package/dist/cdn/KIKZIZGV.js +2 -0
- package/dist/cdn/{3PAHY5KA.js → KNRJ3WXR.js} +1 -1
- package/dist/cdn/KQCTBRGJ.js +2 -0
- package/dist/cdn/KYNL256E.js +2 -0
- package/dist/cdn/{F6V7MLPY.js → L6KBBJEC.js} +1 -1
- package/dist/cdn/LTHZ2TRG.js +2 -0
- package/dist/cdn/{WOZDQW3S.js → MRHDSM6U.js} +1 -1
- package/dist/cdn/NQQLTGIK.js +2 -0
- package/dist/cdn/NVGQFC2K.js +2 -0
- package/dist/cdn/O3JIWIMI.js +2 -0
- package/dist/cdn/O6ZQ4BRU.js +2 -0
- package/dist/cdn/O7KHFGHS.js +2 -0
- package/dist/cdn/OBBYT2AV.js +2 -0
- package/dist/cdn/OHEUIODH.js +2 -0
- package/dist/cdn/OJCKEXGE.js +2 -0
- package/dist/cdn/{53MSUMA3.js → OT4PZJNB.js} +17 -1
- package/dist/cdn/P4ELMYQQ.js +2 -0
- package/dist/cdn/{ZTHTFEYA.js → PF3TB3QZ.js} +1 -1
- package/dist/cdn/PJLV3EQS.js +2 -0
- package/dist/cdn/Q54ZD7WJ.js +2 -0
- package/dist/cdn/QE4CNVDQ.js +34 -0
- package/dist/cdn/{AQWTJKUH.js → QKCV7CY2.js} +10 -8
- package/dist/cdn/{LQ3DMZ3K.js → QLHCXOVQ.js} +1 -1
- package/dist/cdn/QMA3U3H3.js +2 -0
- package/dist/cdn/QS3GXAIH.js +2 -0
- package/dist/cdn/QTFWIDAL.js +2 -0
- package/dist/cdn/RBQG66FL.js +2 -0
- package/dist/cdn/RDAUPHB6.js +2 -0
- package/dist/cdn/RVWAHK4A.js +2 -0
- package/dist/cdn/SFD33DHG.js +2 -0
- package/dist/cdn/SKRCLDPZ.js +2 -0
- package/dist/cdn/SLTFLCVR.js +99 -0
- package/dist/cdn/STLVXLPU.js +2 -0
- package/dist/cdn/{GT26WGJS.js → T3LU5V74.js} +1 -1
- package/dist/cdn/TB4YQUMO.js +2 -0
- package/dist/cdn/TGTT2CVD.js +2 -0
- package/dist/cdn/{DXCPWJU4.js → TKCE4WYE.js} +1 -1
- package/dist/cdn/UZLQALHY.js +2 -0
- package/dist/cdn/{RR4BIAPA.js → V4EYW3O6.js} +1 -1
- package/dist/cdn/V6VNED6L.js +2 -0
- package/dist/cdn/VMQIDO4Z.js +2 -0
- package/dist/cdn/{74XFARCV.js → VW7DSKPH.js} +1 -1
- package/dist/cdn/W2SYL7IJ.js +71 -0
- package/dist/cdn/{W6PSG4GX.js → W4FGRGLV.js} +10 -5
- package/dist/cdn/{SYJSVUUR.js → W4SAWMXS.js} +1 -1
- package/dist/cdn/W7O7ZYZ4.js +2 -0
- package/dist/cdn/WBZLQZYR.js +134 -0
- package/dist/cdn/WNYL4EZA.js +2 -0
- package/dist/cdn/WYLEYSM3.js +2 -0
- package/dist/cdn/XAPOJUIC.js +2 -0
- package/dist/cdn/XEK22IDA.js +2 -0
- package/dist/cdn/YMLZCVEI.js +2 -0
- package/dist/cdn/YS2SZ3DL.js +2 -0
- package/dist/cdn/YUVVUBJB.js +2 -0
- package/dist/cdn/YVKSTDL6.js +2 -0
- package/dist/cdn/ZDU24JOQ.js +2 -0
- package/dist/cdn/ZGNXS6U5.js +2 -0
- package/dist/cdn/ZTGGJIVB.js +2 -0
- package/dist/cdn/assets/portal-account-switcher/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/portal-ai-assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/portal-browser/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/portal-group-browser/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/portal-group-card/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/portal-item-badges/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/portal-item-card/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/portal-item-favorite/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/portal-item-type/icons/applicationtheme16.svg +1 -0
- package/dist/cdn/assets/portal-item-type/icons/applicationtheme32.svg +1 -0
- package/dist/cdn/assets/portal-item-type/icons/knowledgegraphconfiguration16.svg +1 -0
- package/dist/cdn/assets/portal-item-type/icons/knowledgegraphconfiguration32.svg +1 -0
- package/dist/cdn/assets/portal-item-type/icons/layout16.svg +1 -0
- package/dist/cdn/assets/portal-item-type/icons/layout32.svg +1 -0
- package/dist/cdn/assets/portal-item-type/icons/parquetfeaturelayer16.svg +1 -0
- package/dist/cdn/assets/portal-item-type/icons/parquetfeaturelayer32.svg +1 -0
- package/dist/cdn/assets/portal-item-type/icons/storymapframe16.svg +1 -0
- package/dist/cdn/assets/portal-item-type/icons/storymapframe32.svg +1 -0
- package/dist/cdn/assets/portal-item-type/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/portal-navigation/apps/api-for-python.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/appstudio.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/arcade.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/arcgis-360-vr.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/arcgis-earth.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/arcgis-enterprise.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/arcgis-experience-builder.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/arcgis-geoanalytics.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/arcgis-hub.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/arcgis-online.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/arcgis-pro.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/arcgis-reality-studio.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/arcgis-urban.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/blank.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/business-analyst.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/city-engine.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/collector.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/community-analyst.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/configurable-apps.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/dashboards-beta.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/dashboards-classic.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/data-pipelines.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/deeplearningstudio.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/demographics.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/drone2map.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/esri-events.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/essential-apps.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/excalibur.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/explorer.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/field-apps.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/fieldmaps-beta.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/fieldmaps-ea.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/fieldmaps.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/generic-app.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/geobim.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/geoplanner.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/grid-view-9.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/indoor.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/indoors.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/insights.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/instant-apps.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/ips.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/knowledge-studio.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/living-atlas.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/location-platform.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/map-maker.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/map-viewer-beta.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/map-viewer-classic.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/map-viewer.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/maps-adobe-cloud.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/maps-for-office.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/maps-for-power-bi.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/maps-for-sharepoint.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/marketplace.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/mission.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/monitor.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/navigator.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/notebook.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/office-apps.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/open-data.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/operations-dashboard.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/ortho-maker.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/pro-extension.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/quick-capture.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/redistricting.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/runtime.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/scene-viewer.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/sites.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/solutions.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/story-maps.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/streetmap-premium.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/survey123.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/svg-app-circle.svg +1 -0
- package/dist/cdn/assets/portal-navigation/apps/svg-app-icon.svg +1 -0
- package/dist/cdn/assets/portal-navigation/apps/track-viewer.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/user-type-extension-online.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/user-type-extension.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/vector-tile-style-editor.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/velocity.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/web-app-builder.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/web-editor.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/web-mapping.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/workflow-manager-beta.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/workflow-manager.avif +0 -0
- package/dist/cdn/assets/portal-navigation/apps/workforce.avif +0 -0
- package/dist/cdn/assets/portal-navigation/product-logos/advanced-editing-user-type-extension-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arc-hydro-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-360-vr-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-api-for-python-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-appstudio-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-arcade-expression-language-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-business-analyst-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-cityengine-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-collector-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-community-analyst-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-connectors-for-power-automate-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-dashboards-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-data-interoperability-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-data-pipelines-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-data-reviewer-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-deep-learning-studio-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-drone2map-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-earth-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-enterprise-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-excalibur-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-excalibur-gray-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-experience-builder-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-explorer-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-field-maps-designer-ea-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-field-maps-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-flight-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-autocad-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-autodesk-forma-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-developers-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-excel-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-microsoft-365-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-power-apps-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-teams-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-geoanalytics-engine-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-geobim-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-geoplanner-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-hub-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-image-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-indoors-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-insights-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-instant-apps-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-knowledge-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-living-atlas-of-the-world-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-location-platform-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-logo-glyph-32.svg +76 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-for-adobe-creative-cloud-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-for-power-bi-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-for-sharepoint-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-sdk-for-javascript-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-sdks-for-game-engines-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-sdks-for-native-apps-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maritime-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-marketplace-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-mission-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-monitor-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-monitor-white-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-navigator-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-notebooks-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-online-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-open-data-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-open-source-apps-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-ortho-maker-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-parcel-fabric-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-pipeline-referencing-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-pro-for-intelligence-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-pro-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-quickcapture-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-reality-studio-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-roads-and-highways-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-sites-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-solutions-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-storymaps-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-streetmap-premium-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-survey123-connect-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-survey123-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-tracker-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-urban-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-utility-network-management-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-velocity-glyph-32.svg +6 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-web-appbuilder-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-web-editor-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-workflow-manager-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-workforce-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/arcgis-world-geocoder-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/calcite-design-system-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/esri-community-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/esri-demographics-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/esri-events-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/esri-offline-documentation-center--glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/esri-redistricting-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/esri-reports-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/esri-support-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/map-viewer-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/sceneviewer-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/site-scan-for-arcgis-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/site-scan-for-arcgis-le-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/vector-tile-style-editor-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/product-logos/xr-viewer-glyph-32.svg +1 -0
- package/dist/cdn/assets/portal-navigation/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/dom.js +41 -0
- package/dist/chunks/fieldAddDelete.js +2 -2
- package/dist/chunks/functionalities.js +6 -4
- package/dist/chunks/groups.js +8 -83
- package/dist/chunks/groups2.js +64 -0
- package/dist/chunks/icons.js +11 -0
- package/dist/chunks/info.js +179 -0
- package/dist/chunks/item.js +29 -123
- package/dist/chunks/item2.js +128 -0
- package/dist/chunks/items.js +16 -0
- package/dist/chunks/loadClassificationData.js +19 -19
- package/dist/chunks/portal-account-switcher.js +6 -0
- package/dist/chunks/portal-browser-filter-date.js +63 -0
- package/dist/chunks/portal-browser.js +220 -0
- package/dist/chunks/portal-item-badge.js +349 -0
- package/dist/chunks/portal.js +91 -8
- package/dist/chunks/portal2.js +59 -0
- package/dist/chunks/query.js +159 -0
- package/dist/chunks/request.js +87 -0
- package/dist/chunks/requests.js +92 -44
- package/dist/chunks/services.js +17 -0
- package/dist/chunks/store.js +14 -0
- package/dist/chunks/string.js +36 -0
- package/dist/chunks/thumbnail.js +189 -0
- package/dist/chunks/ui.js +9 -0
- package/dist/chunks/url.js +17 -0
- package/dist/chunks/user.js +99 -4
- package/dist/chunks/user2.js +13 -107
- package/dist/chunks/users.js +7 -0
- package/dist/chunks/utils.js +88 -0
- package/dist/chunks/utils2.js +656 -0
- package/dist/chunks/verified.js +40 -0
- package/dist/components/arcgis-portal-account-switcher/customElement.d.ts +119 -0
- package/dist/components/arcgis-portal-account-switcher/customElement.js +369 -0
- package/dist/components/arcgis-portal-account-switcher/index.d.ts +1 -0
- package/dist/components/arcgis-portal-account-switcher/index.js +9 -0
- package/dist/components/arcgis-portal-account-switcher/types.d.ts +6 -0
- package/dist/components/arcgis-portal-account-switcher-accounts/customElement.d.ts +118 -0
- package/dist/components/arcgis-portal-account-switcher-accounts/customElement.js +31 -0
- package/dist/components/arcgis-portal-account-switcher-accounts/index.d.ts +1 -0
- package/dist/components/arcgis-portal-account-switcher-accounts/index.js +5 -0
- package/dist/components/arcgis-portal-account-switcher-list/customElement.d.ts +122 -0
- package/dist/components/arcgis-portal-account-switcher-list/customElement.js +72 -0
- package/dist/components/arcgis-portal-account-switcher-list/index.d.ts +1 -0
- package/dist/components/arcgis-portal-account-switcher-list/index.js +6 -0
- package/dist/components/arcgis-portal-ai-assistant/agents/portalRouteKeys.d.ts +35 -0
- package/dist/components/arcgis-portal-ai-assistant/agents/types.d.ts +77 -3
- package/dist/components/arcgis-portal-ai-assistant/customElement.d.ts +65 -3
- package/dist/components/arcgis-portal-ai-assistant/customElement.js +1942 -615
- package/dist/components/arcgis-portal-ai-assistant/data/capability-registries/types.d.ts +34 -0
- package/dist/components/arcgis-portal-browser/customElement.d.ts +243 -0
- package/dist/components/arcgis-portal-browser/customElement.js +16 -0
- package/dist/components/arcgis-portal-browser/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser/index.js +6 -0
- package/dist/components/arcgis-portal-browser/utils/store.d.ts +35 -0
- package/dist/components/arcgis-portal-browser/utils/types.d.ts +24 -0
- package/dist/components/arcgis-portal-browser-actions/customElement.d.ts +185 -0
- package/dist/components/arcgis-portal-browser-actions/customElement.js +73 -0
- package/dist/components/arcgis-portal-browser-actions/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser-actions/index.js +6 -0
- package/dist/components/arcgis-portal-browser-actions/types.d.ts +9 -0
- package/dist/components/arcgis-portal-browser-filter-status/customElement.d.ts +193 -0
- package/dist/components/arcgis-portal-browser-filter-status/customElement.js +56 -0
- package/dist/components/arcgis-portal-browser-filter-status/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser-filter-status/index.js +5 -0
- package/dist/components/arcgis-portal-browser-pagination/customElement.d.ts +194 -0
- package/dist/components/arcgis-portal-browser-pagination/customElement.js +49 -0
- package/dist/components/arcgis-portal-browser-pagination/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser-pagination/index.js +2 -0
- package/dist/components/arcgis-portal-browser-search/customElement.d.ts +195 -0
- package/dist/components/arcgis-portal-browser-search/customElement.js +62 -0
- package/dist/components/arcgis-portal-browser-search/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser-search/index.js +3 -0
- package/dist/components/arcgis-portal-browser-sort/customElement.d.ts +196 -0
- package/dist/components/arcgis-portal-browser-sort/customElement.js +93 -0
- package/dist/components/arcgis-portal-browser-sort/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser-sort/index.js +9 -0
- package/dist/components/arcgis-portal-browser-sort/utils.d.ts +3 -0
- package/dist/components/arcgis-portal-browser-top-bar/customElement.d.ts +190 -0
- package/dist/components/arcgis-portal-browser-top-bar/customElement.js +50 -0
- package/dist/components/arcgis-portal-browser-top-bar/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser-top-bar/index.js +3 -0
- package/dist/components/arcgis-portal-browser-view/customElement.d.ts +21 -0
- package/dist/components/arcgis-portal-browser-view/customElement.js +30 -0
- package/dist/components/arcgis-portal-browser-view/index.d.ts +1 -0
- package/dist/components/arcgis-portal-browser-view/index.js +5 -0
- package/dist/components/arcgis-portal-classification-config/customElement.js +7 -7
- package/dist/components/arcgis-portal-classification-favorite/customElement.js +1 -1
- package/dist/components/arcgis-portal-field-delete/customElement.js +3 -2
- package/dist/components/arcgis-portal-group-badges/customElement.d.ts +0 -1
- package/dist/components/arcgis-portal-group-badges/customElement.js +26 -33
- package/dist/components/arcgis-portal-group-browser/customElement.d.ts +477 -0
- package/dist/components/arcgis-portal-group-browser/customElement.js +736 -0
- package/dist/components/arcgis-portal-group-browser/index.d.ts +1 -0
- package/dist/components/arcgis-portal-group-browser/index.js +6 -0
- package/dist/components/arcgis-portal-group-browser/types.d.ts +214 -0
- package/dist/components/arcgis-portal-group-browser-preview/customElement.d.ts +225 -0
- package/dist/components/arcgis-portal-group-browser-preview/customElement.js +150 -0
- package/dist/components/arcgis-portal-group-browser-preview/index.d.ts +1 -0
- package/dist/components/arcgis-portal-group-browser-preview/index.js +12 -0
- package/dist/components/arcgis-portal-group-browser-preview-card/customElement.d.ts +82 -0
- package/dist/components/arcgis-portal-group-browser-preview-card/customElement.js +93 -0
- package/dist/components/arcgis-portal-group-browser-preview-card/index.d.ts +1 -0
- package/dist/components/arcgis-portal-group-browser-preview-card/index.js +6 -0
- package/dist/components/arcgis-portal-group-card/customElement.d.ts +30 -26
- package/dist/components/arcgis-portal-group-card/customElement.js +71 -95
- package/dist/components/arcgis-portal-group-card/index.js +3 -3
- package/dist/components/arcgis-portal-group-thumbnail/customElement.js +1 -1
- package/dist/components/arcgis-portal-info-banner/customElement.d.ts +14 -0
- package/dist/components/arcgis-portal-info-banner/customElement.js +31 -0
- package/dist/components/arcgis-portal-info-banner/index.d.ts +1 -0
- package/dist/components/arcgis-portal-info-banner/index.js +1 -0
- package/dist/components/arcgis-portal-item-actions/customElement.d.ts +74 -0
- package/dist/components/arcgis-portal-item-actions/customElement.js +89 -0
- package/dist/components/arcgis-portal-item-actions/index.d.ts +1 -0
- package/dist/components/arcgis-portal-item-actions/index.js +5 -0
- package/dist/components/arcgis-portal-item-badge/customElement.d.ts +260 -0
- package/dist/components/arcgis-portal-item-badge/customElement.js +9 -0
- package/dist/components/arcgis-portal-item-badge/index.d.ts +1 -0
- package/dist/components/arcgis-portal-item-badge/index.js +5 -0
- package/dist/components/arcgis-portal-item-badges/customElement.d.ts +48 -0
- package/dist/components/arcgis-portal-item-badges/customElement.js +35 -0
- package/dist/components/arcgis-portal-item-badges/index.d.ts +1 -0
- package/dist/components/arcgis-portal-item-badges/index.js +2 -0
- package/dist/components/arcgis-portal-item-badges/types.d.ts +1 -0
- package/dist/components/arcgis-portal-item-card/customElement.d.ts +215 -0
- package/dist/components/arcgis-portal-item-card/customElement.js +190 -0
- package/dist/components/arcgis-portal-item-card/index.d.ts +1 -0
- package/dist/components/arcgis-portal-item-card/index.js +10 -0
- package/dist/components/arcgis-portal-item-favorite/customElement.d.ts +36 -0
- package/dist/components/arcgis-portal-item-favorite/customElement.js +66 -0
- package/dist/components/arcgis-portal-item-favorite/index.d.ts +1 -0
- package/dist/components/arcgis-portal-item-favorite/index.js +3 -0
- package/dist/components/arcgis-portal-item-favorite/utils.d.ts +4 -0
- package/dist/components/arcgis-portal-item-type/customElement.d.ts +3 -1
- package/dist/components/arcgis-portal-item-type/customElement.js +22 -651
- package/dist/components/arcgis-portal-mentionable-text-area/customElement.js +40 -38
- package/dist/components/arcgis-portal-navigation/customElement.d.ts +530 -0
- package/dist/components/arcgis-portal-navigation/customElement.js +1857 -0
- package/dist/components/arcgis-portal-navigation/index.d.ts +1 -0
- package/dist/components/arcgis-portal-navigation/index.js +30 -0
- package/dist/components/arcgis-portal-navigation/types.d.ts +44 -0
- package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +53 -410
- package/dist/components/arcgis-portal-user-avatar/customElement.js +26 -37
- package/dist/components/arcgis-portal-user-popup/customElement.d.ts +5 -2
- package/dist/components/arcgis-portal-user-popup/customElement.js +82 -141
- package/dist/components/arcgis-portal-voice-input/customElement.d.ts +1 -1
- package/dist/components/portal-browser/components/portal-browser-filter/customElement.js +14 -0
- package/dist/components/portal-browser/components/portal-browser-filter/index.js +3 -0
- package/dist/components/portal-browser/components/portal-browser-filter-date/customElement.js +9 -0
- package/dist/components/portal-browser/components/portal-browser-filter-date/index.js +4 -0
- package/dist/components/portal-browser/components/portal-browser-filters/customElement.js +11 -0
- package/dist/components/portal-browser/components/portal-browser-filters/index.js +2 -0
- package/dist/components/portal-group-browser-filters/customElement.js +129 -0
- package/dist/components/portal-group-browser-filters/index.js +5 -0
- package/dist/components/portal-group-browser-pagination/customElement.js +13 -0
- package/dist/components/portal-group-browser-pagination/index.js +2 -0
- package/dist/components/portal-group-browser-sort/customElement.js +16 -0
- package/dist/components/portal-group-browser-sort/index.js +2 -0
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.css-custom-data.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +186 -0
- package/dist/loader.js +26 -5
- package/dist/types/app-switcher.d.ts +71 -0
- package/dist/types/group.d.ts +14 -16
- package/dist/types/item.d.ts +80 -1
- package/dist/types/lumina.d.ts +153 -2
- package/dist/types/portal.d.ts +6 -0
- package/dist/types/preact.d.ts +174 -2
- package/dist/types/react.d.ts +195 -2
- package/dist/types/search.d.ts +30 -0
- package/dist/types/stencil.d.ts +155 -4
- package/dist/types/user.d.ts +16 -3
- package/package.json +10 -11
- package/dist/cdn/35SKVD6F.js +0 -2
- package/dist/cdn/5VSDGPHH.js +0 -2
- package/dist/cdn/72N3KAXN.js +0 -2
- package/dist/cdn/ANPXRYLV.js +0 -5
- package/dist/cdn/B7633S2A.js +0 -422
- package/dist/cdn/BEHLBKKM.js +0 -2
- package/dist/cdn/EVDOPN3G.js +0 -54
- package/dist/cdn/F2AM2M4H.js +0 -2
- package/dist/cdn/G47ZZQYL.js +0 -2
- package/dist/cdn/GAHILDQF.js +0 -45
- package/dist/cdn/GHQ3ZW4U.js +0 -2
- package/dist/cdn/IWJIVHBS.js +0 -65
- package/dist/cdn/JNRN6DTV.js +0 -2
- package/dist/cdn/JUN4NQAO.js +0 -2
- package/dist/cdn/K3HS2LQ7.js +0 -2
- package/dist/cdn/KEKBRUUC.js +0 -2
- package/dist/cdn/MX3F5ZCL.js +0 -2
- package/dist/cdn/O3KBWLGU.js +0 -2
- package/dist/cdn/OQDPULPD.js +0 -2
- package/dist/cdn/QB34ACZ2.js +0 -2
- package/dist/cdn/RBC6VGDJ.js +0 -516
- package/dist/cdn/RNLVNDGG.js +0 -2
- package/dist/cdn/TMYTUOSS.js +0 -2
- package/dist/cdn/UPEVTVNZ.js +0 -2
- package/dist/cdn/V2EOXGK2.js +0 -2
- package/dist/cdn/WZC4LHVH.js +0 -2
- package/dist/cdn/X5NBQPTM.js +0 -2
- package/dist/cdn/YG5YYL6X.js +0 -2
- package/dist/cdn/YIMNOUTF.js +0 -2
- package/dist/cdn/YL7PGYWC.js +0 -5
- package/dist/cdn/YMPTDKT6.js +0 -2
- package/dist/cdn/YVJRXWM3.js +0 -3
|
@@ -1,292 +1,111 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { LitElement as
|
|
4
|
-
import { css as
|
|
5
|
-
import { createRef as
|
|
6
|
-
import { u as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return a;
|
|
26
|
-
if (Array.isArray(a))
|
|
27
|
-
return a.map(
|
|
28
|
-
(r) => typeof r == "string" ? r : "text" in r && typeof r.text == "string" ? r.text : ""
|
|
29
|
-
).join(" ").trim();
|
|
30
|
-
}
|
|
31
|
-
return "";
|
|
32
|
-
}, pt = () => ({ latestItemId: null, memory: {} }), N = (s) => {
|
|
33
|
-
const t = s?.agentExecutionContext.sharedState.portalItemAnalyticsSummaryMemory?.value;
|
|
34
|
-
return t ? { latestItemId: t.latestItemId, memory: t.memory } : pt();
|
|
35
|
-
}, gt = n.object({
|
|
36
|
-
intent: n.enum(["summarize", "followUp", "clarify"]),
|
|
37
|
-
itemId: n.string().default(""),
|
|
38
|
-
question: n.string().default("")
|
|
39
|
-
}), ht = n.object({ summary: n.string(), followUpQuestions: n.array(n.string()).default([]) }), ft = n.object({ answer: n.string(), isRelevant: n.boolean() }), yt = async (s, t) => {
|
|
40
|
-
await g({ text: "Answering follow-up...", agentName: "analytics" }, t);
|
|
41
|
-
const e = N(s), a = s.analyticsItemId ?? e.latestItemId, r = a ? e.memory[a] : void 0, l = s.analyticsQuestion || x(s.agentExecutionContext.messages);
|
|
42
|
-
return r ? {
|
|
43
|
-
status: "success",
|
|
44
|
-
outputMessage: (await b({
|
|
45
|
-
promptText: bt,
|
|
46
|
-
schema: ft,
|
|
47
|
-
modelTier: "default",
|
|
48
|
-
inputVariables: {
|
|
49
|
-
summary: r.summary,
|
|
50
|
-
question: l,
|
|
51
|
-
fullContext: JSON.stringify(r.fullContext)
|
|
52
|
-
}
|
|
53
|
-
})).answer
|
|
54
|
-
} : {
|
|
55
|
-
status: "success",
|
|
56
|
-
outputMessage: "I don't have enough information yet. Please ask me to summarize the item first using summarize item <item id>."
|
|
57
|
-
};
|
|
58
|
-
}, bt = `
|
|
59
|
-
You answer follow-up questions about an ArcGIS item.
|
|
60
|
-
|
|
61
|
-
Ground your answer in the provided item context.
|
|
62
|
-
If the answer is not available from the provided context, state that clearly and suggest what to check next.
|
|
63
|
-
|
|
64
|
-
Response rules:
|
|
65
|
-
- Reply in concise markdown.
|
|
66
|
-
- Keep the answer focused on the follow-up question.
|
|
67
|
-
- Do not include internal identifiers.
|
|
68
|
-
- Mark isRelevant=false when the question is not about this item or cannot be grounded in this item context.
|
|
69
|
-
|
|
70
|
-
Item summary:
|
|
71
|
-
{summary}
|
|
72
|
-
|
|
73
|
-
Item full context
|
|
74
|
-
{fullContext}
|
|
75
|
-
|
|
76
|
-
Question:
|
|
77
|
-
{question}
|
|
78
|
-
`;
|
|
79
|
-
function I(s) {
|
|
80
|
-
const { portal: t, user: e } = s ?? {};
|
|
81
|
-
if (!s || !t || !e)
|
|
2
|
+
import { c as Ue } from "../../chunks/runtime.js";
|
|
3
|
+
import { LitElement as Fe, createEvent as Oe } from "@arcgis/lumina";
|
|
4
|
+
import { css as Le, render as je, html as v } from "lit";
|
|
5
|
+
import { createRef as E, ref as k } from "lit/directives/ref.js";
|
|
6
|
+
import { u as Ve } from "../../chunks/useT9n.js";
|
|
7
|
+
import { NodeInterrupt as ve, Annotation as h, StateGraph as N, START as G, END as w } from "@langchain/langgraph/web";
|
|
8
|
+
import { sendTraceMessage as g, invokeStructuredPrompt as b, sendUXSuggestion as J, createAgentRuntimeStateWithSharedState as P, createChatModel as _, getEmbeddings as Be } from "@arcgis/ai-components/utils/index.js";
|
|
9
|
+
import s from "zod";
|
|
10
|
+
import { a as Ke, c as Qe, q as We } from "../../chunks/groups2.js";
|
|
11
|
+
import Z from "@arcgis/core/identity/IdentityManager.js";
|
|
12
|
+
import ee from "@arcgis/core/request.js";
|
|
13
|
+
import { a as U, t as Je, b as Q } from "../../chunks/functionalities.js";
|
|
14
|
+
import { ChatPromptTemplate as Y } from "@langchain/core/prompts";
|
|
15
|
+
import { tool as be } from "@langchain/core/tools";
|
|
16
|
+
import { s as _e, a as Ye } from "../../chunks/item.js";
|
|
17
|
+
import { g as He, e as Xe, i as Ze, c as et, a as tt } from "../../chunks/groups.js";
|
|
18
|
+
import at from "@arcgis/core/portal/Portal.js";
|
|
19
|
+
const Ie = (e) => {
|
|
20
|
+
const { portal: t, user: a } = e ?? {};
|
|
21
|
+
return !!e && !!t && !!a;
|
|
22
|
+
};
|
|
23
|
+
function x(e) {
|
|
24
|
+
if (!Ie(e))
|
|
82
25
|
throw new Error("Invalid context: PortalAssistantContext with portal and user is required.");
|
|
83
26
|
}
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
const e = s.trim();
|
|
87
|
-
if (!e)
|
|
88
|
-
return null;
|
|
89
|
-
const a = t?.configurable?.context;
|
|
90
|
-
I(a);
|
|
91
|
-
const { result: r, error: l } = await nt(a.portal, e, { num: 1 });
|
|
92
|
-
return l && console.error("Error searching for portal item by title:", l), r?.results[0]?.id || null;
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
name: "resolvePortalItemIdByTitle",
|
|
96
|
-
description: 'Resolves an ArcGIS Portal item title to the best-match item id. Use this when a user references an item by title (including hash mentions like #title or #"title with spaces") instead of an explicit item id.',
|
|
97
|
-
schema: n.object({
|
|
98
|
-
itemTitle: n.string().describe("The portal item title to resolve to an item id.")
|
|
99
|
-
})
|
|
100
|
-
}
|
|
101
|
-
), It = async (s, t) => {
|
|
102
|
-
await g({ text: "Analyzing intent...", agentName: "analytics" }, t);
|
|
103
|
-
const e = x(s.agentExecutionContext.messages), a = !!N(s).latestItemId, r = await L.fromTemplate(wt).format({
|
|
104
|
-
userMessage: e,
|
|
105
|
-
hasSummaryContext: String(a)
|
|
106
|
-
}), c = await Q({
|
|
107
|
-
model: await F({ modelTier: "fast" }),
|
|
108
|
-
tools: [W],
|
|
109
|
-
systemPrompt: r,
|
|
110
|
-
responseFormat: gt,
|
|
111
|
-
checkpointer: !0
|
|
112
|
-
}).invoke({ messages: s.agentExecutionContext.messages }, t), { intent: i, itemId: o, question: u } = c.structuredResponse, m = i === "clarify" || i === "summarize" && !o || i === "followUp" && !u;
|
|
113
|
-
return {
|
|
114
|
-
agentExecutionContext: { ...s.agentExecutionContext },
|
|
115
|
-
analyticsIntent: m ? "clarify" : i,
|
|
116
|
-
analyticsItemId: o || null,
|
|
117
|
-
analyticsQuestion: u || "",
|
|
118
|
-
status: "success",
|
|
119
|
-
outputMessage: m ? 'Please clarify with summarize item <item id>, summarize item #<title>, or summarize item #"<title with spaces>".' : ""
|
|
120
|
-
};
|
|
121
|
-
}, wt = `
|
|
122
|
-
Classify the user analytics request.
|
|
27
|
+
const nt = `
|
|
28
|
+
Write a concise, friendly success message for adding members to a group.
|
|
123
29
|
|
|
124
30
|
Rules:
|
|
125
|
-
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
- If request references item title (for example #title, #"title with spaces", or plain quoted title), call resolvePortalItemIdByTitle and set itemId to the returned value.
|
|
131
|
-
- Never return item titles in output fields.
|
|
132
|
-
- If intent is "followUp", set question to the user's full question/request text.
|
|
133
|
-
- If intent is "summarize", set question="".
|
|
134
|
-
- When user asks to show/list/explain fields, schema, attributes, columns, or layer details, classify as "followUp" unless they explicitly request a summary.
|
|
135
|
-
- If hasSummaryContext is true, prefer "followUp" for detail-oriented requests that do not explicitly ask to summarize.
|
|
136
|
-
|
|
137
|
-
Examples:
|
|
138
|
-
- "Summarize item 0123456789abcdef0123456789abcdef" => summarize, itemId="0123456789abcdef0123456789abcdef"
|
|
139
|
-
- "Summarize item #california" => summarize, call resolvePortalItemIdByTitle("california") and set itemId to tool result
|
|
140
|
-
- "Summarize item #"california farmland"" => summarize, call resolvePortalItemIdByTitle("california farmland") and set itemId to tool result
|
|
141
|
-
- "Show the layer's available fields" => followUp
|
|
142
|
-
- "List attributes and explain what status means" => followUp
|
|
143
|
-
- "What fields are available?" with hasSummaryContext=true => followUp
|
|
144
|
-
- "Give me an overview of item 0123456789abcdef0123456789abcdef" => summarize
|
|
31
|
+
- Keep it to 1-2 short sentences.
|
|
32
|
+
- Use plain text only.
|
|
33
|
+
- If there is no notAddedMembers, confirm that all requested members were added successfully.
|
|
34
|
+
- If there are notAddedMembers, acknowledge that some members could not be added and list the added and not added members separately then mention why based on the context
|
|
35
|
+
- Make sure to bold the usernames
|
|
145
36
|
|
|
146
|
-
|
|
147
|
-
{
|
|
37
|
+
Added members:
|
|
38
|
+
{addedMembers}
|
|
148
39
|
|
|
149
|
-
|
|
150
|
-
{
|
|
151
|
-
`,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
status: "success",
|
|
156
|
-
outputMessage: 'Please clarify with summarize item <item id>, summarize item #<title>, or summarize item #"<title with spaces>".'
|
|
157
|
-
};
|
|
158
|
-
await g({ text: `Summarizing item ${e}...`, agentName: "analytics" }, t);
|
|
159
|
-
const a = t?.configurable?.context;
|
|
160
|
-
I(a);
|
|
161
|
-
const { portal: r, user: l } = a, { result: c, error: i } = await it(l, r, e);
|
|
162
|
-
if (i || !c)
|
|
163
|
-
return await g({ text: "Failed to get item context for summarization", agentName: "analytics" }, t), {
|
|
164
|
-
status: "success",
|
|
165
|
-
outputMessage: "Unable to retrieve item context for summarization."
|
|
166
|
-
};
|
|
167
|
-
const { context: o } = c, u = await b({
|
|
168
|
-
promptText: vt,
|
|
169
|
-
schema: ht,
|
|
170
|
-
modelTier: "default",
|
|
171
|
-
inputVariables: { context: JSON.stringify(o) }
|
|
172
|
-
}), { followUpQuestions: d, summary: p } = u, m = N(s), f = {
|
|
173
|
-
latestItemId: e,
|
|
174
|
-
memory: {
|
|
175
|
-
...m.memory,
|
|
176
|
-
[e]: { summary: p, followUpQuestions: d, fullContext: o }
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
return d.length && await B({ type: "suggested-prompts", data: { prompts: d } }, t), {
|
|
180
|
-
status: "success",
|
|
181
|
-
outputMessage: p,
|
|
182
|
-
sharedStatePatch: { portalItemAnalyticsSummaryMemory: { value: f } }
|
|
183
|
-
};
|
|
184
|
-
}, vt = `
|
|
185
|
-
You are a item summary tool for ArcGIS. Your job is to summarize an item's info based on the provided context.
|
|
186
|
-
Summary rules:
|
|
187
|
-
- The summary should be concise markdown, make sure to format the output nicely so it's easy to read.
|
|
188
|
-
- Target length: 80-150 words.
|
|
189
|
-
- Provide one short descriptive paragraph.
|
|
190
|
-
- Also propose 3 concise follow-up questions grounded in the item summary.
|
|
191
|
-
- Keep follow-up questions specific and actionable.
|
|
192
|
-
Follow-up questions rules:
|
|
193
|
-
- These questions should be in the format of a prompt that the user can click on.
|
|
194
|
-
- Make sure the questions are relevant to the item summary and that you can answer based solely on the provided context.
|
|
195
|
-
Do not include internal identifiers.
|
|
196
|
-
If the user asks for a detailed summary, you may expand the response up to 300 words.
|
|
197
|
-
Item context:
|
|
198
|
-
{context}
|
|
199
|
-
`, C = (s, t) => t ?? s, O = h.Root({
|
|
200
|
-
...E(),
|
|
201
|
-
// States shared only across nodes in the graph, not between invocations
|
|
202
|
-
analyticsIntent: h({
|
|
203
|
-
reducer: C,
|
|
204
|
-
default: () => "clarify"
|
|
205
|
-
}),
|
|
206
|
-
analyticsItemId: h({
|
|
207
|
-
reducer: C,
|
|
208
|
-
default: () => null
|
|
209
|
-
}),
|
|
210
|
-
analyticsQuestion: h({
|
|
211
|
-
reducer: C,
|
|
212
|
-
default: () => ""
|
|
213
|
-
})
|
|
214
|
-
}), St = () => new $(O).addNode("detectAnalyticsIntent", It).addNode("summarizePortalItem", xt).addNode("answerAnalyticsFollowUp", yt).addEdge(G, "detectAnalyticsIntent").addConditionalEdges("detectAnalyticsIntent", (t) => t.analyticsIntent === "summarize" ? "summarizePortalItem" : t.analyticsIntent === "followUp" ? "answerAnalyticsFollowUp" : y).addEdge("summarizePortalItem", y).addEdge("answerAnalyticsFollowUp", y), Mt = String.raw`- **portal-item-analytics** - Portal item analytics assistant:
|
|
215
|
-
- summarizes ArcGIS portal items from item context
|
|
216
|
-
- suggests follow-up prompts grounded in the item
|
|
217
|
-
`, Tt = {
|
|
218
|
-
id: "portal-item-analytics",
|
|
219
|
-
name: "Portal Item Analytics",
|
|
220
|
-
description: Mt,
|
|
221
|
-
createGraph: St,
|
|
222
|
-
workspace: O
|
|
223
|
-
}, Pt = (s) => s.map((t) => `"${t}"`).join(", "), At = n.object({
|
|
224
|
-
successMessage: n.string().default("")
|
|
225
|
-
}), q = "portal-group-creation", D = "approveAddMembers", Ct = async (s, t) => {
|
|
226
|
-
if (s.intentParams.intent !== "addMembers")
|
|
40
|
+
Not added members:
|
|
41
|
+
{notAddedMembers}
|
|
42
|
+
`, ot = (e) => e.map((t) => `"${t}"`).join(", "), rt = s.object({
|
|
43
|
+
successMessage: s.string().default("")
|
|
44
|
+
}), te = "portal-group-creation", ae = "approveAddMembers", st = async (e, t) => {
|
|
45
|
+
if (e.intentParams.intent !== "addMembers")
|
|
227
46
|
return {
|
|
228
47
|
status: "success",
|
|
229
48
|
outputMessage: "Use @mention usernames for the members you want to add."
|
|
230
49
|
};
|
|
231
|
-
const
|
|
232
|
-
if (!
|
|
50
|
+
const a = e.agentExecutionContext.sharedState.createdGroupId?.value;
|
|
51
|
+
if (!a)
|
|
233
52
|
return {
|
|
234
53
|
status: "success",
|
|
235
54
|
outputMessage: "Create a group first, then add members using @mention usernames."
|
|
236
55
|
};
|
|
237
|
-
const
|
|
238
|
-
if (!
|
|
56
|
+
const n = e.intentParams.memberInfo.memberIdentifiers.map((m) => m.trim()).filter(Boolean);
|
|
57
|
+
if (!n.length)
|
|
239
58
|
return {
|
|
240
59
|
status: "success",
|
|
241
60
|
outputMessage: "Use @mention usernames for the members you want to add."
|
|
242
61
|
};
|
|
243
|
-
const
|
|
62
|
+
const r = `The following member(s) will be added to the newly created group:
|
|
244
63
|
|
|
245
|
-
${
|
|
64
|
+
${n.map((m) => `- **@${m}**`).join(`
|
|
246
65
|
`)}
|
|
247
66
|
|
|
248
|
-
Do you want to continue?`, { hitlResponse:
|
|
249
|
-
if (
|
|
67
|
+
Do you want to continue?`, { hitlResponse: i } = t?.configurable ?? {};
|
|
68
|
+
if (i?.agentId !== te || i.id !== ae) {
|
|
250
69
|
const m = {
|
|
251
|
-
agentId:
|
|
252
|
-
id:
|
|
70
|
+
agentId: te,
|
|
71
|
+
id: ae,
|
|
253
72
|
kind: "booleanChoice",
|
|
254
|
-
message:
|
|
73
|
+
message: r,
|
|
255
74
|
metadata: {
|
|
256
75
|
action: "addMembers",
|
|
257
|
-
groupId:
|
|
258
|
-
members: [...
|
|
76
|
+
groupId: a,
|
|
77
|
+
members: [...n]
|
|
259
78
|
}
|
|
260
79
|
};
|
|
261
|
-
throw new
|
|
80
|
+
throw new ve(m);
|
|
262
81
|
}
|
|
263
|
-
if (
|
|
82
|
+
if (i.payload !== !0)
|
|
264
83
|
return {
|
|
265
84
|
status: "success",
|
|
266
85
|
outputMessage: "Okay, I cancelled adding members to the group."
|
|
267
86
|
};
|
|
268
87
|
await g(
|
|
269
|
-
{ text: `Adding members ${
|
|
88
|
+
{ text: `Adding members ${ot(n)}...`, agentName: "group-creation" },
|
|
270
89
|
t
|
|
271
90
|
);
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
const { result:
|
|
275
|
-
if (
|
|
91
|
+
const c = t?.configurable?.context;
|
|
92
|
+
x(c);
|
|
93
|
+
const { result: u, error: d } = await Ke(c.portal, a, n);
|
|
94
|
+
if (d || !u)
|
|
276
95
|
return {
|
|
277
96
|
status: "success",
|
|
278
97
|
outputMessage: "I could not add members to that group. Please confirm group access and user accounts, then try again."
|
|
279
98
|
};
|
|
280
|
-
const { addedUsernames:
|
|
99
|
+
const { addedUsernames: l, notAddedUsers: p } = u;
|
|
281
100
|
try {
|
|
282
101
|
const f = (await b({
|
|
283
|
-
promptText:
|
|
284
|
-
schema:
|
|
102
|
+
promptText: nt,
|
|
103
|
+
schema: rt,
|
|
285
104
|
modelTier: "fast",
|
|
286
105
|
inputVariables: {
|
|
287
|
-
addedMembers:
|
|
106
|
+
addedMembers: l.join(", "),
|
|
288
107
|
notAddedMembers: JSON.stringify(
|
|
289
|
-
p.map((
|
|
108
|
+
p.map((y) => ({ username: y.username, reason: y.error.message }))
|
|
290
109
|
)
|
|
291
110
|
}
|
|
292
111
|
})).successMessage;
|
|
@@ -296,74 +115,85 @@ Do you want to continue?`, { hitlResponse: c } = t?.configurable ?? {};
|
|
|
296
115
|
console.error("Error generating add-members success message:", m);
|
|
297
116
|
}
|
|
298
117
|
return {};
|
|
299
|
-
},
|
|
300
|
-
Write a concise, friendly success message
|
|
118
|
+
}, it = `
|
|
119
|
+
Write a concise, friendly success message after creating a portal group.
|
|
120
|
+
|
|
121
|
+
Rules:
|
|
122
|
+
- Mention that the group was created successfully.
|
|
123
|
+
- Mention that the user can add members by using @mention usernames.
|
|
124
|
+
- Keep it to 1-2 short sentences.
|
|
125
|
+
- Make sure to bold the group title in the message.
|
|
126
|
+
|
|
127
|
+
Group title:
|
|
128
|
+
{groupTitle}
|
|
129
|
+
`, ct = `
|
|
130
|
+
Write a concise, friendly failure message after an attempt to create a portal group.
|
|
301
131
|
|
|
302
132
|
Rules:
|
|
303
133
|
- Keep it to 1-2 short sentences.
|
|
304
134
|
- Use plain text only.
|
|
305
|
-
-
|
|
306
|
-
-
|
|
307
|
-
-
|
|
135
|
+
- Mention that group creation failed.
|
|
136
|
+
- Include the failure reason in user-friendly language.
|
|
137
|
+
- End with a clear next step the user can try.
|
|
308
138
|
|
|
309
|
-
|
|
310
|
-
{
|
|
139
|
+
Group title:
|
|
140
|
+
{groupTitle}
|
|
311
141
|
|
|
312
|
-
|
|
313
|
-
{
|
|
314
|
-
`,
|
|
315
|
-
successMessage:
|
|
316
|
-
}),
|
|
317
|
-
failureMessage:
|
|
318
|
-
}),
|
|
319
|
-
if (
|
|
142
|
+
Failure reason:
|
|
143
|
+
{failureReason}
|
|
144
|
+
`, ne = "portal-group-creation", oe = "approveCreateGroup", ut = s.object({
|
|
145
|
+
successMessage: s.string().default("")
|
|
146
|
+
}), lt = s.object({
|
|
147
|
+
failureMessage: s.string().default("")
|
|
148
|
+
}), dt = async (e, t) => {
|
|
149
|
+
if (e.intentParams.intent !== "create")
|
|
320
150
|
return {
|
|
321
151
|
status: "success",
|
|
322
152
|
outputMessage: "Tell me the group title you want to use."
|
|
323
153
|
};
|
|
324
|
-
const
|
|
325
|
-
if (!
|
|
154
|
+
const a = e.intentParams.title.trim();
|
|
155
|
+
if (!a)
|
|
326
156
|
return {
|
|
327
157
|
status: "success",
|
|
328
158
|
outputMessage: "What title would you like for the new group?"
|
|
329
159
|
};
|
|
330
|
-
const
|
|
331
|
-
if (
|
|
332
|
-
const
|
|
333
|
-
agentId:
|
|
334
|
-
id:
|
|
160
|
+
const n = `A group with the title **${a}** will be created. Do you want to continue?`, { hitlResponse: o } = t?.configurable;
|
|
161
|
+
if (o?.agentId !== ne || o.id !== oe) {
|
|
162
|
+
const d = {
|
|
163
|
+
agentId: ne,
|
|
164
|
+
id: oe,
|
|
335
165
|
kind: "booleanChoice",
|
|
336
|
-
message:
|
|
166
|
+
message: n,
|
|
337
167
|
metadata: {
|
|
338
168
|
action: "createGroup",
|
|
339
|
-
title:
|
|
169
|
+
title: a,
|
|
340
170
|
access: "private"
|
|
341
171
|
}
|
|
342
172
|
};
|
|
343
|
-
throw new
|
|
173
|
+
throw new ve(d);
|
|
344
174
|
}
|
|
345
|
-
if (
|
|
175
|
+
if (o.payload !== !0)
|
|
346
176
|
return {
|
|
347
177
|
status: "success",
|
|
348
|
-
outputMessage: `Okay, I cancelled creating **${
|
|
178
|
+
outputMessage: `Okay, I cancelled creating **${a}**.`
|
|
349
179
|
};
|
|
350
|
-
await g({ text: `Creating group "${
|
|
351
|
-
const
|
|
352
|
-
|
|
353
|
-
const { result:
|
|
354
|
-
title:
|
|
180
|
+
await g({ text: `Creating group "${a}"...`, agentName: "group-creation" }, t);
|
|
181
|
+
const r = t?.configurable?.context;
|
|
182
|
+
x(r);
|
|
183
|
+
const { result: i, error: c } = await Qe(r.portal, {
|
|
184
|
+
title: a,
|
|
355
185
|
access: "private"
|
|
356
186
|
});
|
|
357
|
-
if (
|
|
358
|
-
const
|
|
187
|
+
if (c || !i) {
|
|
188
|
+
const d = c?.message?.trim() || "No additional details were provided.";
|
|
359
189
|
try {
|
|
360
190
|
const p = (await b({
|
|
361
|
-
promptText:
|
|
362
|
-
schema:
|
|
191
|
+
promptText: ct,
|
|
192
|
+
schema: lt,
|
|
363
193
|
modelTier: "fast",
|
|
364
194
|
inputVariables: {
|
|
365
|
-
groupTitle:
|
|
366
|
-
failureReason:
|
|
195
|
+
groupTitle: a,
|
|
196
|
+
failureReason: d
|
|
367
197
|
}
|
|
368
198
|
})).failureMessage.trim();
|
|
369
199
|
if (p)
|
|
@@ -371,80 +201,50 @@ Not added members:
|
|
|
371
201
|
status: "success",
|
|
372
202
|
outputMessage: p
|
|
373
203
|
};
|
|
374
|
-
} catch (
|
|
375
|
-
console.error("Error generating create-group failure message:",
|
|
204
|
+
} catch (l) {
|
|
205
|
+
console.error("Error generating create-group failure message:", l);
|
|
376
206
|
}
|
|
377
207
|
return {
|
|
378
208
|
status: "success",
|
|
379
209
|
outputMessage: "I could not create that group. Please confirm your permissions and try again with the group title."
|
|
380
210
|
};
|
|
381
211
|
}
|
|
382
|
-
const
|
|
212
|
+
const u = i.id;
|
|
383
213
|
try {
|
|
384
|
-
const
|
|
385
|
-
promptText:
|
|
386
|
-
schema:
|
|
214
|
+
const l = (await b({
|
|
215
|
+
promptText: it,
|
|
216
|
+
schema: ut,
|
|
387
217
|
modelTier: "fast",
|
|
388
218
|
inputVariables: {
|
|
389
|
-
groupTitle:
|
|
219
|
+
groupTitle: a
|
|
390
220
|
}
|
|
391
221
|
})).successMessage.trim();
|
|
392
|
-
if (
|
|
222
|
+
if (l)
|
|
393
223
|
return {
|
|
394
224
|
status: "success",
|
|
395
|
-
outputMessage:
|
|
396
|
-
sharedStatePatch: { createdGroupId: { value:
|
|
397
|
-
createdGroupId:
|
|
225
|
+
outputMessage: l,
|
|
226
|
+
sharedStatePatch: { createdGroupId: { value: u } },
|
|
227
|
+
createdGroupId: u
|
|
398
228
|
};
|
|
399
|
-
} catch (
|
|
400
|
-
console.error("Error generating create-group success message:",
|
|
229
|
+
} catch (d) {
|
|
230
|
+
console.error("Error generating create-group success message:", d);
|
|
401
231
|
}
|
|
402
232
|
return {};
|
|
403
|
-
},
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
- Keep it to 1-2 short sentences.
|
|
419
|
-
- Use plain text only.
|
|
420
|
-
- Mention that group creation failed.
|
|
421
|
-
- Include the failure reason in user-friendly language.
|
|
422
|
-
- End with a clear next step the user can try.
|
|
423
|
-
|
|
424
|
-
Group title:
|
|
425
|
-
{groupTitle}
|
|
426
|
-
|
|
427
|
-
Failure reason:
|
|
428
|
-
{failureReason}
|
|
429
|
-
`, Dt = n.object({
|
|
430
|
-
intent: n.enum(["clarify", "create", "addMembers"]).default("clarify"),
|
|
431
|
-
title: n.string().default(""),
|
|
432
|
-
memberIdentifiers: n.array(n.string()).default([]),
|
|
433
|
-
clarifyMessage: n.string().default("")
|
|
434
|
-
}), Rt = async (s, t) => {
|
|
435
|
-
await g({ text: "Thinking about groups...", agentName: "group-creation" }, t);
|
|
436
|
-
const e = x(s.agentExecutionContext.messages).trim(), a = await b({
|
|
437
|
-
promptText: Ut,
|
|
438
|
-
schema: Dt,
|
|
439
|
-
modelTier: "default",
|
|
440
|
-
inputVariables: { userMessage: e }
|
|
441
|
-
}), r = a.title.trim(), l = a.memberIdentifiers.filter(Boolean), c = a.clarifyMessage.trim(), i = a.intent === "create" && !!r, o = a.intent === "addMembers" && l.length > 0;
|
|
442
|
-
return {
|
|
443
|
-
intentParams: i ? { intent: "create", title: r } : o ? { intent: "addMembers", memberInfo: { memberIdentifiers: l } } : { intent: "clarify" },
|
|
444
|
-
status: "success",
|
|
445
|
-
outputMessage: !i && !o ? c : ""
|
|
446
|
-
};
|
|
447
|
-
}, Ut = `
|
|
233
|
+
}, I = (e) => {
|
|
234
|
+
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
235
|
+
const a = e[t];
|
|
236
|
+
if (a.type !== "human")
|
|
237
|
+
continue;
|
|
238
|
+
const n = a.content;
|
|
239
|
+
if (typeof n == "string")
|
|
240
|
+
return n;
|
|
241
|
+
if (Array.isArray(n))
|
|
242
|
+
return n.map(
|
|
243
|
+
(o) => typeof o == "string" ? o : "text" in o && typeof o.text == "string" ? o.text : ""
|
|
244
|
+
).join(" ").trim();
|
|
245
|
+
}
|
|
246
|
+
return "";
|
|
247
|
+
}, pt = `
|
|
448
248
|
You classify whether a user is asking to create a new ArcGIS Portal group or add members to an existing group.
|
|
449
249
|
|
|
450
250
|
Rules:
|
|
@@ -470,385 +270,1912 @@ Examples:
|
|
|
470
270
|
|
|
471
271
|
User message:
|
|
472
272
|
{userMessage}
|
|
473
|
-
`,
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
})
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
273
|
+
`, mt = s.object({
|
|
274
|
+
intent: s.enum(["clarify", "create", "addMembers"]).default("clarify"),
|
|
275
|
+
title: s.string().default(""),
|
|
276
|
+
memberIdentifiers: s.array(s.string()).default([]),
|
|
277
|
+
clarifyMessage: s.string().default("")
|
|
278
|
+
}), gt = async (e, t) => {
|
|
279
|
+
await g({ text: "Thinking about groups...", agentName: "group-creation" }, t);
|
|
280
|
+
const a = I(e.agentExecutionContext.messages).trim(), n = await b({
|
|
281
|
+
promptText: pt,
|
|
282
|
+
schema: mt,
|
|
283
|
+
modelTier: "default",
|
|
284
|
+
inputVariables: { userMessage: a }
|
|
285
|
+
}), o = n.title.trim(), r = n.memberIdentifiers.filter(Boolean), i = n.clarifyMessage.trim(), c = n.intent === "create" && !!o, u = n.intent === "addMembers" && r.length > 0;
|
|
286
|
+
return {
|
|
287
|
+
intentParams: c ? { intent: "create", title: o } : u ? { intent: "addMembers", memberInfo: { memberIdentifiers: r } } : { intent: "clarify" },
|
|
288
|
+
status: "success",
|
|
289
|
+
outputMessage: !c && !u ? i : ""
|
|
290
|
+
};
|
|
291
|
+
}, ht = [
|
|
292
|
+
"general",
|
|
293
|
+
"about",
|
|
294
|
+
"homePage",
|
|
295
|
+
"gallery",
|
|
296
|
+
"aiAssistants",
|
|
297
|
+
"map",
|
|
298
|
+
"items",
|
|
299
|
+
"groups",
|
|
300
|
+
"webhooks",
|
|
301
|
+
"utilityServices",
|
|
302
|
+
"agol",
|
|
303
|
+
"esriContent",
|
|
304
|
+
"livingAtlas",
|
|
305
|
+
"servers",
|
|
306
|
+
"memberRoles",
|
|
307
|
+
"newMemberDefaults",
|
|
308
|
+
"marketplace",
|
|
309
|
+
"collaborations",
|
|
310
|
+
"credits",
|
|
311
|
+
"security",
|
|
312
|
+
"openData",
|
|
313
|
+
"hub",
|
|
314
|
+
"orgExtensions"
|
|
315
|
+
], ft = ["newItem", "createLayer", "developerCredentials"], yt = ["favorites", "group", "living-atlas", "org"], wt = ["featured", "my", "organization"], vt = ["licenses", "members", "overview", "reports", "settings", "status"], bt = s.object({
|
|
316
|
+
destinationType: s.literal("portal-content"),
|
|
317
|
+
hash: s.enum(yt).optional(),
|
|
318
|
+
queryParams: s.object({
|
|
319
|
+
newItem: s.enum(ft).optional()
|
|
320
|
+
}).optional()
|
|
321
|
+
}), It = s.object({
|
|
322
|
+
destinationType: s.literal("portal-groups"),
|
|
323
|
+
hash: s.enum(wt).optional()
|
|
324
|
+
}), St = s.object({
|
|
325
|
+
destinationType: s.literal("portal-org"),
|
|
326
|
+
hash: s.enum(vt).optional(),
|
|
327
|
+
queryParams: s.object({
|
|
328
|
+
tab: s.enum(ht).optional(),
|
|
329
|
+
section: s.string().optional(),
|
|
330
|
+
subsection: s.string().optional(),
|
|
331
|
+
period: s.string().optional(),
|
|
332
|
+
startTime: s.string().optional(),
|
|
333
|
+
endTime: s.string().optional()
|
|
334
|
+
}).optional()
|
|
335
|
+
}), xt = s.object({
|
|
336
|
+
destinationType: s.literal("portal-item"),
|
|
337
|
+
itemId: s.string().trim().min(1)
|
|
338
|
+
}), Tt = s.object({
|
|
339
|
+
destinationType: s.literal("portal-group"),
|
|
340
|
+
groupId: s.string().trim().min(1)
|
|
341
|
+
}), Mt = s.object({
|
|
342
|
+
destinationType: s.union([
|
|
343
|
+
s.literal("portal-gallery"),
|
|
344
|
+
s.literal("portal-map-viewer"),
|
|
345
|
+
s.literal("portal-notebooks"),
|
|
346
|
+
s.literal("portal-scene-viewer")
|
|
347
|
+
])
|
|
348
|
+
}), Ct = s.union([
|
|
349
|
+
bt,
|
|
350
|
+
It,
|
|
351
|
+
St,
|
|
352
|
+
xt,
|
|
353
|
+
Tt,
|
|
354
|
+
Mt
|
|
355
|
+
]), Se = "portal-navigation", F = async (e, t) => {
|
|
356
|
+
const a = t?.configurable?.context;
|
|
357
|
+
!Ie(a) || !a.navigationTargetMap?.[e.destinationType] || await J({ type: Se, data: { ...e } }, t);
|
|
358
|
+
}, At = async (e, t) => {
|
|
359
|
+
const a = e.createdGroupId ?? e.agentExecutionContext.sharedState.createdGroupId?.value;
|
|
360
|
+
return a ? (await g({ text: "Preparing navigation...", agentName: "group-creation" }, t), await F({ destinationType: "portal-group", groupId: a }, t), {}) : {};
|
|
361
|
+
}, re = (e, t) => t ?? e, xe = h.Root({
|
|
362
|
+
...P(),
|
|
500
363
|
// * Shared state between nodes (but not persisted to the agent execution context)
|
|
501
364
|
/** Parameters related to the user's intent for group creation actions */
|
|
502
|
-
intentParams: h({ reducer:
|
|
365
|
+
intentParams: h({ reducer: re, default: () => ({ intent: "clarify" }) }),
|
|
503
366
|
/** The ID of the group that was created
|
|
504
367
|
* even though we already have this in the shared state
|
|
505
368
|
* we still need it here to also share between nodes
|
|
506
369
|
*/
|
|
507
|
-
createdGroupId: h({ reducer:
|
|
508
|
-
}),
|
|
370
|
+
createdGroupId: h({ reducer: re, default: () => "" })
|
|
371
|
+
}), Nt = () => new N(xe).addNode("detectGroupCreationIntent", gt).addNode("createPortalGroup", dt).addNode("addMembersToPortalGroup", st).addNode("suggestCreatedGroupNavigation", At).addEdge(G, "detectGroupCreationIntent").addConditionalEdges("detectGroupCreationIntent", (t) => {
|
|
509
372
|
switch (t.intentParams.intent) {
|
|
510
373
|
case "create":
|
|
511
374
|
return "createPortalGroup";
|
|
512
375
|
case "addMembers":
|
|
513
376
|
return "addMembersToPortalGroup";
|
|
514
377
|
default:
|
|
515
|
-
return
|
|
378
|
+
return w;
|
|
516
379
|
}
|
|
517
|
-
}).addEdge("createPortalGroup", "suggestCreatedGroupNavigation").addEdge("addMembersToPortalGroup", "suggestCreatedGroupNavigation").addEdge("suggestCreatedGroupNavigation",
|
|
380
|
+
}).addEdge("createPortalGroup", "suggestCreatedGroupNavigation").addEdge("addMembersToPortalGroup", "suggestCreatedGroupNavigation").addEdge("suggestCreatedGroupNavigation", w), Gt = String.raw`- **portal-group-creation** - Portal group creation assistant:
|
|
518
381
|
- creates a new ArcGIS Portal group for the signed-in user
|
|
519
382
|
- adds users to the newly created group using @mention usernames
|
|
520
|
-
`,
|
|
383
|
+
`, Pt = {
|
|
521
384
|
id: "portal-group-creation",
|
|
522
385
|
name: "Portal Group Creation",
|
|
523
|
-
description:
|
|
524
|
-
createGraph:
|
|
525
|
-
workspace:
|
|
526
|
-
},
|
|
527
|
-
const t =
|
|
386
|
+
description: Gt,
|
|
387
|
+
createGraph: Nt,
|
|
388
|
+
workspace: xe
|
|
389
|
+
}, Te = "portalDocAssistantMemory", qt = () => ({ conversationId: "" }), Et = (e) => {
|
|
390
|
+
const t = e?.[Te]?.value;
|
|
528
391
|
if (!t || typeof t != "object")
|
|
529
|
-
return
|
|
530
|
-
const
|
|
392
|
+
return qt();
|
|
393
|
+
const a = t;
|
|
394
|
+
return {
|
|
395
|
+
conversationId: typeof a.conversationId == "string" ? a.conversationId : ""
|
|
396
|
+
};
|
|
397
|
+
}, kt = (e) => ({
|
|
398
|
+
[Te]: { value: e }
|
|
399
|
+
}), zt = {
|
|
400
|
+
pipeline: {
|
|
401
|
+
follow_up: { allow: !1 }
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
function $t(e) {
|
|
531
405
|
return {
|
|
532
|
-
|
|
406
|
+
kind: "DocAIAssistantRequest",
|
|
407
|
+
filters: {
|
|
408
|
+
...zt,
|
|
409
|
+
persona: { persona: e }
|
|
410
|
+
}
|
|
533
411
|
};
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
portal: s,
|
|
412
|
+
}
|
|
413
|
+
const Dt = "https://www.arcgis.com/sharing/rest";
|
|
414
|
+
async function Rt({
|
|
415
|
+
portal: e,
|
|
539
416
|
question: t,
|
|
540
|
-
persona:
|
|
541
|
-
previousConversationId:
|
|
417
|
+
persona: a,
|
|
418
|
+
previousConversationId: n,
|
|
419
|
+
useProdDocAssistant: o,
|
|
542
420
|
signal: r,
|
|
543
|
-
skillId:
|
|
421
|
+
skillId: i
|
|
544
422
|
}) {
|
|
545
|
-
|
|
546
|
-
const
|
|
547
|
-
portal:
|
|
548
|
-
skillId:
|
|
423
|
+
i ??= "doc_ai_assistant";
|
|
424
|
+
const c = $t(a), u = await Ut({
|
|
425
|
+
portal: e,
|
|
426
|
+
skillId: i,
|
|
549
427
|
message: t,
|
|
550
|
-
options: { context:
|
|
551
|
-
kind: "DocAIAssistantRequest",
|
|
552
|
-
filters: { persona: { persona: e } }
|
|
553
|
-
}, previousConversationId: a, signal: r }
|
|
428
|
+
options: { context: c, previousConversationId: n, useProdDocAssistant: o, signal: r }
|
|
554
429
|
});
|
|
555
430
|
return {
|
|
556
|
-
reply:
|
|
557
|
-
conversationId:
|
|
431
|
+
reply: Ft(u, i),
|
|
432
|
+
conversationId: u[0]?.conversationId ?? ""
|
|
558
433
|
};
|
|
559
434
|
}
|
|
560
|
-
async function
|
|
561
|
-
portal:
|
|
435
|
+
async function Ut({
|
|
436
|
+
portal: e,
|
|
562
437
|
skillId: t,
|
|
563
|
-
message:
|
|
564
|
-
options:
|
|
438
|
+
message: a,
|
|
439
|
+
options: n
|
|
565
440
|
}) {
|
|
566
|
-
const
|
|
441
|
+
const o = e.helperServices.aiAssistantServices.url, i = `${n.useProdDocAssistant ? "https://aiservices-beta.arcgis.com" : o}/skills/${t}/chat`, u = {
|
|
567
442
|
"Content-Type": "application/json",
|
|
568
|
-
token:
|
|
569
|
-
},
|
|
443
|
+
token: n.useProdDocAssistant ? (await Z.getCredential(Dt, { oAuthPopupConfirmation: !1 })).token : Z.findCredential(e.url)?.token ?? ""
|
|
444
|
+
}, d = await ee(i, {
|
|
570
445
|
method: "post",
|
|
571
446
|
body: JSON.stringify({
|
|
572
|
-
message:
|
|
573
|
-
context:
|
|
574
|
-
conversationId:
|
|
447
|
+
message: a,
|
|
448
|
+
context: n.context,
|
|
449
|
+
conversationId: n.previousConversationId
|
|
575
450
|
}),
|
|
576
|
-
headers:
|
|
577
|
-
signal:
|
|
451
|
+
headers: u,
|
|
452
|
+
signal: n.signal
|
|
578
453
|
});
|
|
579
|
-
if (
|
|
580
|
-
throw new Error(`Doc assistant chat failed (${
|
|
581
|
-
cause:
|
|
454
|
+
if (d.httpStatus !== 200)
|
|
455
|
+
throw new Error(`Doc assistant chat failed (${d.httpStatus})`, {
|
|
456
|
+
cause: d.data
|
|
582
457
|
});
|
|
583
|
-
const
|
|
584
|
-
if (!
|
|
458
|
+
const l = d.data, p = [l], { conversationId: m, inquiryId: f } = l, y = async (M, q) => {
|
|
459
|
+
if (!q)
|
|
585
460
|
return;
|
|
586
|
-
await
|
|
587
|
-
const
|
|
461
|
+
await Je(500);
|
|
462
|
+
const T = await ee(i, {
|
|
588
463
|
method: "post",
|
|
589
|
-
body: JSON.stringify({ conversationId:
|
|
590
|
-
headers:
|
|
591
|
-
signal:
|
|
464
|
+
body: JSON.stringify({ conversationId: m, inquiryId: f, ackSequenceNumber: M }),
|
|
465
|
+
headers: u,
|
|
466
|
+
signal: n.signal
|
|
592
467
|
});
|
|
593
|
-
if (
|
|
594
|
-
throw new Error(`Doc assistant poll failed (${
|
|
595
|
-
cause:
|
|
468
|
+
if (T.httpStatus !== 200)
|
|
469
|
+
throw new Error(`Doc assistant poll failed (${T.httpStatus})`, {
|
|
470
|
+
cause: T.data
|
|
596
471
|
});
|
|
597
|
-
const
|
|
598
|
-
|
|
472
|
+
const C = T.data;
|
|
473
|
+
p.push(C), await y(C.sequenceNumber, C.hasMore);
|
|
599
474
|
};
|
|
600
|
-
return
|
|
475
|
+
return l.hasMore && await y(l.sequenceNumber, l.hasMore), p;
|
|
601
476
|
}
|
|
602
|
-
function
|
|
477
|
+
function Ft(e, t) {
|
|
603
478
|
switch (t) {
|
|
604
479
|
case "doc_chat":
|
|
605
|
-
return
|
|
480
|
+
return e.find((a) => a.message != null)?.message ?? "";
|
|
606
481
|
case "doc_ai_assistant":
|
|
607
|
-
for (let
|
|
608
|
-
const
|
|
609
|
-
if (
|
|
610
|
-
const
|
|
611
|
-
if (
|
|
612
|
-
return
|
|
482
|
+
for (let a = e.length - 1; a >= 0; a -= 1) {
|
|
483
|
+
const n = e[a];
|
|
484
|
+
if (n.context?.kind === "DocAIAssistantContext") {
|
|
485
|
+
const o = n.context.results?.[0]?.reply;
|
|
486
|
+
if (o)
|
|
487
|
+
return o;
|
|
613
488
|
}
|
|
614
489
|
}
|
|
615
490
|
return "";
|
|
616
491
|
default:
|
|
617
|
-
return
|
|
492
|
+
return U(t);
|
|
618
493
|
}
|
|
619
494
|
}
|
|
620
|
-
const
|
|
495
|
+
const Ot = async (e, t) => {
|
|
621
496
|
await g({ text: "Asking documentation assistant...", agentName: "doc-assistant" }, t);
|
|
622
|
-
const
|
|
623
|
-
if (!
|
|
497
|
+
const a = I(e.agentExecutionContext.messages).trim();
|
|
498
|
+
if (!a)
|
|
624
499
|
return {
|
|
625
500
|
status: "success",
|
|
626
501
|
outputMessage: "Please share your question and I can help with ArcGIS and Portal documentation."
|
|
627
502
|
};
|
|
628
|
-
const
|
|
629
|
-
|
|
630
|
-
const
|
|
631
|
-
portal:
|
|
632
|
-
question:
|
|
633
|
-
previousConversationId:
|
|
503
|
+
const n = t?.configurable?.context;
|
|
504
|
+
x(n);
|
|
505
|
+
const o = Et(e.agentExecutionContext.sharedState), { reply: r, conversationId: i } = await Rt({
|
|
506
|
+
portal: n.portal,
|
|
507
|
+
question: a,
|
|
508
|
+
previousConversationId: o.conversationId || void 0,
|
|
634
509
|
skillId: "doc_ai_assistant",
|
|
635
|
-
persona: "
|
|
510
|
+
persona: "doc-online",
|
|
511
|
+
useProdDocAssistant: n.useProdDocAssistant
|
|
636
512
|
});
|
|
637
513
|
return {
|
|
638
514
|
status: "success",
|
|
639
|
-
outputMessage:
|
|
640
|
-
sharedStatePatch:
|
|
641
|
-
conversationId:
|
|
515
|
+
outputMessage: r.trim() || "I could not retrieve a response from the documentation assistant.",
|
|
516
|
+
sharedStatePatch: kt({
|
|
517
|
+
conversationId: i || o.conversationId
|
|
642
518
|
})
|
|
643
519
|
};
|
|
644
|
-
},
|
|
645
|
-
async ({ groupTitle:
|
|
646
|
-
const
|
|
647
|
-
if (!
|
|
520
|
+
}, Me = be(
|
|
521
|
+
async ({ groupTitle: e }, t) => {
|
|
522
|
+
const a = e.trim();
|
|
523
|
+
if (!a)
|
|
648
524
|
return null;
|
|
649
|
-
const
|
|
650
|
-
|
|
525
|
+
const n = t?.configurable?.context;
|
|
526
|
+
x(n);
|
|
651
527
|
try {
|
|
652
|
-
return (await
|
|
653
|
-
} catch (
|
|
654
|
-
return console.error("Error searching for portal group by title:",
|
|
528
|
+
return (await We(n.portal, { query: `title:${a}`, num: 1 }))?.results[0]?.id || null;
|
|
529
|
+
} catch (o) {
|
|
530
|
+
return console.error("Error searching for portal group by title:", o), null;
|
|
655
531
|
}
|
|
656
532
|
},
|
|
657
533
|
{
|
|
658
534
|
name: "resolvePortalGroupIdByTitle",
|
|
659
535
|
description: "Resolves an ArcGIS Portal group title to the best-match group id. Use this when a user references a group by title instead of an explicit group id.",
|
|
660
|
-
schema:
|
|
661
|
-
groupTitle:
|
|
536
|
+
schema: s.object({
|
|
537
|
+
groupTitle: s.string().describe("The portal group title to resolve to a group id.")
|
|
662
538
|
})
|
|
663
539
|
}
|
|
664
|
-
),
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
groupId: n.string().default("")
|
|
669
|
-
}), Xt = async (s, t) => {
|
|
670
|
-
await g({ text: "Extracting navigation intent...", agentName: "doc-assistant" }, t);
|
|
671
|
-
const e = s.outputMessage.trim();
|
|
672
|
-
if (!e)
|
|
673
|
-
return {};
|
|
674
|
-
const a = x(s.agentExecutionContext.messages).trim(), r = await L.fromTemplate(te).format({
|
|
675
|
-
question: a,
|
|
676
|
-
response: e
|
|
677
|
-
}), c = await Q({
|
|
678
|
-
model: await F({ modelTier: "default" }),
|
|
679
|
-
tools: [W, Ht],
|
|
680
|
-
systemPrompt: r,
|
|
681
|
-
responseFormat: j,
|
|
682
|
-
checkpointer: !0
|
|
683
|
-
}).invoke({ messages: s.agentExecutionContext.messages }, t), i = j.parse(c.structuredResponse ?? {});
|
|
684
|
-
if (!i.shouldSuggestNavigation || i.destinationType === "none")
|
|
685
|
-
return {};
|
|
686
|
-
const o = Zt(i);
|
|
687
|
-
return o ? (await J(o, t), {}) : {};
|
|
688
|
-
};
|
|
689
|
-
function Zt({
|
|
690
|
-
destinationType: s,
|
|
691
|
-
itemId: t,
|
|
692
|
-
groupId: e
|
|
693
|
-
}) {
|
|
694
|
-
switch (s) {
|
|
695
|
-
case "portal-content":
|
|
696
|
-
return { destinationType: "portal-content" };
|
|
697
|
-
case "portal-groups":
|
|
698
|
-
return { destinationType: "portal-groups" };
|
|
699
|
-
case "portal-item":
|
|
700
|
-
return t ? { destinationType: "portal-item", itemId: t } : null;
|
|
701
|
-
case "portal-group":
|
|
702
|
-
return e ? { destinationType: "portal-group", groupId: e } : null;
|
|
703
|
-
case "none":
|
|
540
|
+
), Ce = be(
|
|
541
|
+
async ({ itemTitle: e }, t) => {
|
|
542
|
+
const a = e.trim();
|
|
543
|
+
if (!a)
|
|
704
544
|
return null;
|
|
705
|
-
|
|
706
|
-
|
|
545
|
+
const n = t?.configurable?.context;
|
|
546
|
+
x(n);
|
|
547
|
+
const { result: o, error: r } = await _e(n.portal, a, { num: 1 });
|
|
548
|
+
return r && console.error("Error searching for portal item by title:", r), o?.results[0]?.id || null;
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
name: "resolvePortalItemIdByTitle",
|
|
552
|
+
description: 'Resolves an ArcGIS Portal item title to the best-match item id. Use this when a user references an item by title (including hash mentions like #title or #"title with spaces") instead of an explicit item id.',
|
|
553
|
+
schema: s.object({
|
|
554
|
+
itemTitle: s.string().describe("The portal item title to resolve to an item id.")
|
|
555
|
+
})
|
|
707
556
|
}
|
|
557
|
+
);
|
|
558
|
+
function A(e, t = "#") {
|
|
559
|
+
const a = e.match(new RegExp(`\\${t}"([^"]+)"`, "u"));
|
|
560
|
+
if (a?.[1])
|
|
561
|
+
return a[1].trim();
|
|
562
|
+
const n = e.match(new RegExp(`\\${t}([^\\s"']+)`, "u"));
|
|
563
|
+
return n?.[1] ? n[1].trim() : null;
|
|
708
564
|
}
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
{
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
},
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
565
|
+
function Lt(e) {
|
|
566
|
+
const t = Q(e).flatMap((a) => {
|
|
567
|
+
const n = a, o = e[a], r = [
|
|
568
|
+
n,
|
|
569
|
+
{
|
|
570
|
+
description: o.description,
|
|
571
|
+
hints: o.hints
|
|
572
|
+
}
|
|
573
|
+
], i = o.sections ? Q(o.sections).map((c) => {
|
|
574
|
+
const u = o.sections?.[c];
|
|
575
|
+
return [`${n}-${c}`, u];
|
|
576
|
+
}) : [];
|
|
577
|
+
return [r, ...i];
|
|
578
|
+
});
|
|
579
|
+
return Object.fromEntries(t);
|
|
580
|
+
}
|
|
581
|
+
function jt(e) {
|
|
582
|
+
return Object.entries(e).map(([t, { description: a, hints: n }]) => ` - ${t}: ${a} (hints: ${n.join(", ")})`).join(`
|
|
583
|
+
`);
|
|
584
|
+
}
|
|
585
|
+
const Vt = {
|
|
586
|
+
// Example prompt: "Take me to my content"
|
|
587
|
+
"portal-content": {
|
|
588
|
+
description: "The main content page of the portal.",
|
|
589
|
+
hints: ["My content", "Content"]
|
|
590
|
+
},
|
|
591
|
+
// Example prompt: "Show my content favorites"
|
|
592
|
+
"portal-content-favorites": {
|
|
593
|
+
description: "The Favorites view under Content in the portal.",
|
|
594
|
+
hints: ["My favorites", "Favorites", "Content favorites"]
|
|
595
|
+
},
|
|
596
|
+
// Example prompt: "Open group content"
|
|
597
|
+
"portal-content-group": {
|
|
598
|
+
description: "The Groups view under Content in the portal.",
|
|
599
|
+
hints: ["Content groups", "Group content", "My groups content"]
|
|
600
|
+
},
|
|
601
|
+
// Example prompt: "Browse Living Atlas content"
|
|
602
|
+
"portal-content-living-atlas": {
|
|
603
|
+
description: "The Living Atlas view under Content in the portal.",
|
|
604
|
+
hints: ["Living Atlas", "Content living atlas"]
|
|
605
|
+
},
|
|
606
|
+
// Example prompt: "Show my organization's content"
|
|
607
|
+
"portal-content-organization": {
|
|
608
|
+
description: "The Organization view under Content in the portal.",
|
|
609
|
+
hints: ["Organization content", "Content organization", "My organization content"]
|
|
610
|
+
},
|
|
611
|
+
// Example prompt: "Open the gallery"
|
|
612
|
+
"portal-gallery": {
|
|
613
|
+
description: "The gallery page of the portal.",
|
|
614
|
+
hints: ["Gallery", "Featured content", "Maps and apps"]
|
|
615
|
+
},
|
|
616
|
+
// Example prompt: "Go to the group called #Urban Planning"
|
|
617
|
+
"portal-group": {
|
|
618
|
+
description: "A specific group page in the portal.",
|
|
619
|
+
hints: ["Group", "group page"]
|
|
620
|
+
},
|
|
621
|
+
// Example prompt: "Browse groups"
|
|
622
|
+
"portal-groups": {
|
|
623
|
+
description: "The groups listing page of the portal.",
|
|
624
|
+
hints: ["Groups", "Browse groups"]
|
|
625
|
+
},
|
|
626
|
+
// Example prompt: "Show featured groups"
|
|
627
|
+
"portal-groups-featured": {
|
|
628
|
+
description: "The Featured groups view under Groups in the portal.",
|
|
629
|
+
hints: ["Featured groups", "Groups featured"]
|
|
630
|
+
},
|
|
631
|
+
// Example prompt: "Show my groups"
|
|
632
|
+
"portal-groups-my": {
|
|
633
|
+
description: "The My groups view under Groups in the portal.",
|
|
634
|
+
hints: ["My groups", "Groups my"]
|
|
635
|
+
},
|
|
636
|
+
// Example prompt: "Show organization groups"
|
|
637
|
+
"portal-groups-organization": {
|
|
638
|
+
description: "The Organization groups view under Groups in the portal.",
|
|
639
|
+
hints: ["Organization groups", "Groups organization", "My organization groups"]
|
|
640
|
+
},
|
|
641
|
+
// Example prompt: "Open item #Road Closures Map"
|
|
642
|
+
"portal-item": {
|
|
643
|
+
description: "A specific item page in the portal.",
|
|
644
|
+
hints: ["Item", "item page"]
|
|
645
|
+
},
|
|
646
|
+
// Example prompt: "Open Map Viewer"
|
|
647
|
+
"portal-map-viewer": {
|
|
648
|
+
description: "The Map Viewer app of the portal.",
|
|
649
|
+
hints: ["Map Viewer", "Map", "Open map"]
|
|
650
|
+
},
|
|
651
|
+
// Example prompt: "Take me to notebooks"
|
|
652
|
+
"portal-notebooks": {
|
|
653
|
+
description: "The Notebooks home page of the portal.",
|
|
654
|
+
hints: ["Notebooks", "Notebook home", "My notebooks"]
|
|
655
|
+
},
|
|
656
|
+
// Example prompt: "Open Scene Viewer"
|
|
657
|
+
"portal-scene-viewer": {
|
|
658
|
+
description: "The Scene Viewer app of the portal.",
|
|
659
|
+
hints: ["Scene Viewer", "Scene", "3D scene"]
|
|
660
|
+
},
|
|
661
|
+
// Example prompt: "Open organization security settings"
|
|
662
|
+
"portal-org-security": {
|
|
663
|
+
description: "The Organization > Settings > Security page of the portal.",
|
|
664
|
+
hints: ["Organization settings", "Security", "Organization > Settings > Security"],
|
|
665
|
+
sections: {
|
|
666
|
+
// Example prompt: "How do I set up custom sign in?"
|
|
667
|
+
"custom-sign-in": {
|
|
668
|
+
description: "The Organization > Settings > Security > Custom Sign In section of the portal.",
|
|
669
|
+
hints: ["Custom Sign In", "Organization > Settings > Security > Custom Sign In"]
|
|
670
|
+
},
|
|
671
|
+
// Example prompt: "How do I configure login options?"
|
|
672
|
+
logins: {
|
|
673
|
+
description: "The Organization > Settings > Security > Logins section of the portal.",
|
|
674
|
+
hints: ["Logins", "Organization > Settings > Security > Logins"]
|
|
675
|
+
},
|
|
676
|
+
// Example prompt: "How do I change our login provider?"
|
|
677
|
+
"change-login-provider": {
|
|
678
|
+
description: "The Organization > Settings > Security > Change Login Provider section of the portal.",
|
|
679
|
+
hints: ["Change Login Provider", "Organization > Settings > Security > Change Login Provider"]
|
|
680
|
+
},
|
|
681
|
+
// Example prompt: "How do I configure MFA?"
|
|
682
|
+
"multifactor-auth": {
|
|
683
|
+
description: "The Organization > Settings > Security > Multifactor Authentication section of the portal.",
|
|
684
|
+
hints: ["MFA", "Multifactor Authentication", "Organization > Settings > Security > MFA"]
|
|
685
|
+
},
|
|
686
|
+
// Example prompt: "How do I configure Enforce MFA?"
|
|
687
|
+
"multifactor-enforcement": {
|
|
688
|
+
description: "The Organization > Settings > Security > Enforce MFA section of the portal.",
|
|
689
|
+
hints: ["Enforce MFA", "MFA enforcement", "Organization > Settings > Security > Enforce MFA"]
|
|
690
|
+
},
|
|
691
|
+
// Example prompt: "How do I set designated admins for MFA?"
|
|
692
|
+
"multifactor-designated-admins": {
|
|
693
|
+
description: "The Organization > Settings > Security > Designated Admins section of the portal.",
|
|
694
|
+
hints: ["Designated admins", "MFA designated admins", "Organization > Settings > Security > Designated Admins"]
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
},
|
|
698
|
+
// Example prompt: "I want to add a new item"
|
|
699
|
+
"portal-content-new-item": {
|
|
700
|
+
description: "The Content page with the New Item flow opened.",
|
|
701
|
+
hints: ["New item", "Create new item", "Content > My Content > New Item"],
|
|
702
|
+
sections: {
|
|
703
|
+
// Example prompt: "Create a new feature layer"
|
|
704
|
+
"feature-layer": {
|
|
705
|
+
description: "The Content page with New Item flow set to Feature Layer as the starting step.",
|
|
706
|
+
hints: ["Feature Layer", "New Feature Layer", "Content > My Content > New Item > Feature Layer"]
|
|
707
|
+
},
|
|
708
|
+
// Example prompt: "Create developer credentials"
|
|
709
|
+
"developer-credentials": {
|
|
710
|
+
description: "The Content page with New Item flow set to Developer Credentials as the starting step.",
|
|
711
|
+
hints: [
|
|
712
|
+
"Developer Credentials",
|
|
713
|
+
"New developer credentials",
|
|
714
|
+
"Content > My Content > New Item > Developer Credentials"
|
|
715
|
+
]
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
}, Ae = Lt(Vt), Bt = Q(Ae), Kt = jt(Ae), Qt = `
|
|
720
|
+
You decide whether the assistant response should include a navigation action to ArcGIS Portal.
|
|
721
|
+
|
|
722
|
+
Given the user question and assistant response:
|
|
723
|
+
- Decide if a navigation action would help the user complete the task.
|
|
724
|
+
- If yes, choose one destinationType:
|
|
725
|
+
${Kt}
|
|
726
|
+
|
|
727
|
+
Rules:
|
|
728
|
+
- Only suggest navigation when you are highly confident the destination will help complete the user's task.
|
|
729
|
+
- If confidence is below 0.85, set shouldSuggestNavigation=false and destinationType=none.
|
|
730
|
+
- If there is no clear destination from the allowed types, set shouldSuggestNavigation=false and destinationType=none.
|
|
731
|
+
- If no navigation is useful, set shouldSuggestNavigation=false and destinationType=none.
|
|
732
|
+
- Prefer the most specific destination that is clearly supported by the question and response.
|
|
733
|
+
- Use entity-level destinations over collection/root destinations when both could apply and the entity target is explicit.
|
|
734
|
+
- Use collection/root destinations only for generic browsing intent with no specific entity target.
|
|
735
|
+
- If a chosen destination requires parameters, include all required parameters.
|
|
736
|
+
- If required parameters are missing or uncertain, set shouldSuggestNavigation=false and destinationType=none.
|
|
737
|
+
- Do not invent required parameters.
|
|
738
|
+
- Always include a confidence score from 0 to 1 in the output.
|
|
739
|
+
- Confidence means confidence that a navigation suggestion should be shown to the user.
|
|
740
|
+
- If shouldSuggestNavigation=false or destinationType=none, confidence must be <= 0.5.
|
|
741
|
+
- Use confidence >= 0.85 only when shouldSuggestNavigation=true and destinationType is not none.
|
|
742
|
+
|
|
743
|
+
User question:
|
|
744
|
+
{question}
|
|
745
|
+
|
|
746
|
+
Assistant response:
|
|
747
|
+
{response}
|
|
748
|
+
`, se = s.object({
|
|
749
|
+
shouldSuggestNavigation: s.boolean().default(!1),
|
|
750
|
+
destinationType: s.enum(["none", ...Bt]).default("none"),
|
|
751
|
+
itemId: s.string().default(""),
|
|
752
|
+
groupId: s.string().default(""),
|
|
753
|
+
confidence: s.number().min(0).max(1).default(0)
|
|
754
|
+
}), Wt = async (e, t) => {
|
|
755
|
+
await g({ text: "Extracting navigation intent...", agentName: "doc-assistant" }, t);
|
|
756
|
+
const a = e.outputMessage.trim();
|
|
757
|
+
if (!a)
|
|
758
|
+
return {};
|
|
759
|
+
const n = I(e.agentExecutionContext.messages).trim(), o = await Y.fromTemplate(Qt).format({
|
|
760
|
+
question: n,
|
|
761
|
+
response: a
|
|
762
|
+
}), i = (await _({ modelTier: "fast" })).withStructuredOutput(se), c = se.parse(await i.invoke(o));
|
|
763
|
+
if (!c.shouldSuggestNavigation || c.destinationType === "none")
|
|
764
|
+
return {};
|
|
765
|
+
if (c.destinationType === "portal-item" && !c.itemId) {
|
|
766
|
+
const d = A(n, "#");
|
|
767
|
+
d && (c.itemId = await Ce.invoke({ itemTitle: d }, t) ?? "");
|
|
768
|
+
}
|
|
769
|
+
if (c.destinationType === "portal-group" && !c.groupId) {
|
|
770
|
+
const d = A(n, "$") ?? A(n, "#");
|
|
771
|
+
d && (c.groupId = await Me.invoke({ groupTitle: d }, t) ?? "");
|
|
772
|
+
}
|
|
773
|
+
const u = Jt(c);
|
|
774
|
+
return u ? (await F(u, t), {}) : {};
|
|
775
|
+
};
|
|
776
|
+
function Jt({
|
|
777
|
+
destinationType: e,
|
|
778
|
+
itemId: t,
|
|
779
|
+
groupId: a
|
|
780
|
+
}) {
|
|
781
|
+
switch (e) {
|
|
782
|
+
case "portal-content":
|
|
783
|
+
case "portal-gallery":
|
|
784
|
+
case "portal-groups":
|
|
785
|
+
case "portal-map-viewer":
|
|
786
|
+
case "portal-notebooks":
|
|
787
|
+
case "portal-scene-viewer":
|
|
788
|
+
return { destinationType: e };
|
|
789
|
+
case "portal-org-security":
|
|
790
|
+
return {
|
|
791
|
+
destinationType: "portal-org",
|
|
792
|
+
hash: "settings",
|
|
793
|
+
queryParams: {
|
|
794
|
+
tab: "security"
|
|
795
|
+
}
|
|
796
|
+
};
|
|
797
|
+
case "portal-content-new-item":
|
|
798
|
+
case "portal-content-new-item-feature-layer":
|
|
799
|
+
case "portal-content-new-item-developer-credentials":
|
|
800
|
+
return {
|
|
801
|
+
queryParams: {
|
|
802
|
+
newItem: _t[e]
|
|
803
|
+
},
|
|
804
|
+
destinationType: "portal-content"
|
|
805
|
+
};
|
|
806
|
+
case "portal-content-favorites":
|
|
807
|
+
case "portal-content-group":
|
|
808
|
+
case "portal-content-living-atlas":
|
|
809
|
+
case "portal-content-organization":
|
|
810
|
+
return { destinationType: "portal-content", hash: Yt[e] };
|
|
811
|
+
case "portal-groups-featured":
|
|
812
|
+
case "portal-groups-my":
|
|
813
|
+
case "portal-groups-organization":
|
|
814
|
+
return { destinationType: "portal-groups", hash: Ht[e] };
|
|
815
|
+
case "portal-org-security-custom-sign-in":
|
|
816
|
+
case "portal-org-security-logins":
|
|
817
|
+
case "portal-org-security-change-login-provider":
|
|
818
|
+
case "portal-org-security-multifactor-auth":
|
|
819
|
+
case "portal-org-security-multifactor-enforcement":
|
|
820
|
+
case "portal-org-security-multifactor-designated-admins":
|
|
821
|
+
return {
|
|
822
|
+
destinationType: "portal-org",
|
|
823
|
+
hash: "settings",
|
|
824
|
+
queryParams: {
|
|
825
|
+
tab: "security",
|
|
826
|
+
subsection: Xt[e]
|
|
827
|
+
}
|
|
828
|
+
};
|
|
829
|
+
case "portal-item":
|
|
830
|
+
return t ? { destinationType: e, itemId: t } : null;
|
|
831
|
+
case "portal-group":
|
|
832
|
+
return a ? { destinationType: e, groupId: a } : null;
|
|
833
|
+
case "none":
|
|
834
|
+
return null;
|
|
835
|
+
default:
|
|
836
|
+
return U(e);
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
const _t = {
|
|
840
|
+
"portal-content-new-item": "newItem",
|
|
841
|
+
"portal-content-new-item-feature-layer": "createLayer",
|
|
842
|
+
"portal-content-new-item-developer-credentials": "developerCredentials"
|
|
843
|
+
}, Yt = {
|
|
844
|
+
"portal-content-favorites": "favorites",
|
|
845
|
+
"portal-content-group": "group",
|
|
846
|
+
"portal-content-living-atlas": "living-atlas",
|
|
847
|
+
"portal-content-organization": "org"
|
|
848
|
+
}, Ht = {
|
|
849
|
+
"portal-groups-featured": "featured",
|
|
850
|
+
"portal-groups-my": "my",
|
|
851
|
+
"portal-groups-organization": "organization"
|
|
852
|
+
}, Xt = {
|
|
853
|
+
"portal-org-security-custom-sign-in": "customSignInSection",
|
|
854
|
+
"portal-org-security-logins": "loginsSection",
|
|
855
|
+
"portal-org-security-change-login-provider": "changeLoginProviderSection",
|
|
856
|
+
"portal-org-security-multifactor-auth": "multiFactorAuthSection",
|
|
857
|
+
"portal-org-security-multifactor-enforcement": "multifactorEnforcementSection",
|
|
858
|
+
"portal-org-security-multifactor-designated-admins": "multifactorDesignatedAdminsSection"
|
|
859
|
+
}, Ne = h.Root({
|
|
860
|
+
...P()
|
|
861
|
+
}), Zt = () => new N(Ne).addNode("answerDocQuestion", Ot).addNode("extractNavigationIntent", Wt).addEdge(G, "answerDocQuestion").addEdge("answerDocQuestion", "extractNavigationIntent").addEdge("extractNavigationIntent", w), ea = String.raw`- **portal-doc-assistant** - General ArcGIS documentation and Portal help assistant:
|
|
862
|
+
- answers general ArcGIS, Portal, Enterprise, and JavaScript SDK questions
|
|
863
|
+
- acts as a fallback when specialized agents are not applicable
|
|
864
|
+
`, ta = {
|
|
865
|
+
id: "portal-doc-assistant",
|
|
866
|
+
name: "Portal Doc Assistant",
|
|
867
|
+
description: ea,
|
|
868
|
+
createGraph: Zt,
|
|
869
|
+
workspace: Ne
|
|
870
|
+
}, aa = () => ({ latestGroupId: null, memory: {} }), O = (e) => {
|
|
871
|
+
const t = e?.agentExecutionContext.sharedState.portalGroupSummaryMemory?.value;
|
|
872
|
+
return t ? { latestGroupId: t.latestGroupId, memory: t.memory } : aa();
|
|
873
|
+
}, Ge = `
|
|
874
|
+
Shared markdown formatting rules:
|
|
875
|
+
- Use clear markdown headings (##) to separate sections.
|
|
876
|
+
- Use concise bullet points for lists of facts, counts, or signals.
|
|
877
|
+
- Emphasize key metrics with bold labels (for example: **Recent items:** 4).
|
|
878
|
+
- Keep wording direct and analytical; avoid filler language but make sure the language is friendly.
|
|
879
|
+
- Do not include raw internal IDs unless explicitly requested.
|
|
880
|
+
`, na = `
|
|
881
|
+
You answer follow-up questions about ArcGIS group analytics.
|
|
882
|
+
|
|
883
|
+
${Ge}
|
|
884
|
+
|
|
885
|
+
Ground your answer in the provided group analytics summary and context.
|
|
886
|
+
If the answer is not available from the provided context, state that clearly and suggest what to check next.
|
|
887
|
+
|
|
888
|
+
Response rules:
|
|
889
|
+
- Reply in concise markdown with this section structure:
|
|
890
|
+
1) ## Answer
|
|
891
|
+
2) ## Evidence
|
|
892
|
+
3) ## Gaps (only when data is missing)
|
|
893
|
+
- Keep the answer focused on the follow-up question.
|
|
894
|
+
- Do not include internal identifiers.
|
|
895
|
+
- Mark isRelevant=false when the question is not about this group or cannot be grounded in this group context.
|
|
896
|
+
|
|
897
|
+
Group analytics summary:
|
|
898
|
+
{summary}
|
|
899
|
+
|
|
900
|
+
Group full context:
|
|
901
|
+
{fullContext}
|
|
902
|
+
|
|
903
|
+
Question:
|
|
904
|
+
{question}
|
|
905
|
+
`, oa = async (e, t) => {
|
|
906
|
+
await g({ text: "Answering group follow-up...", agentName: "group-analytics" }, t);
|
|
907
|
+
const a = O(e), n = e.groupSummaryGroupId ?? a.latestGroupId, o = n ? a.memory[n] : void 0, r = e.groupSummaryQuestion || I(e.agentExecutionContext.messages);
|
|
908
|
+
return o ? {
|
|
909
|
+
status: "success",
|
|
910
|
+
outputMessage: (await b({
|
|
911
|
+
promptText: na,
|
|
912
|
+
schema: ra,
|
|
913
|
+
modelTier: "default",
|
|
914
|
+
inputVariables: {
|
|
915
|
+
summary: o.summary,
|
|
916
|
+
question: r,
|
|
917
|
+
fullContext: JSON.stringify(o.fullContext)
|
|
918
|
+
}
|
|
919
|
+
})).answer
|
|
920
|
+
} : {
|
|
921
|
+
status: "success",
|
|
922
|
+
outputMessage: "I do not have group analytics context yet. Ask me to analyze a group first with analyze group <group id>."
|
|
923
|
+
};
|
|
924
|
+
}, ra = s.object({
|
|
925
|
+
answer: s.string(),
|
|
926
|
+
isRelevant: s.boolean()
|
|
927
|
+
}), sa = `
|
|
928
|
+
Classify the user's request for ArcGIS Portal group analytics.
|
|
929
|
+
|
|
930
|
+
Rules:
|
|
931
|
+
- intent="summarize" only when the user explicitly asks to summarize, analyze, overview, or recap a group.
|
|
932
|
+
- intent="followUp" for follow-up questions about a previously analyzed group.
|
|
933
|
+
- intent="navigation" when the user asks to open, go to, navigate to, or view the group page.
|
|
934
|
+
- intent="clarify" when intent or required group target is missing.
|
|
935
|
+
- groupId must be the final resolved group id.
|
|
936
|
+
- If request has explicit group id, set groupId directly.
|
|
937
|
+
- If request references group title (for example $title, $"title with spaces", or plain quoted group title), call resolvePortalGroupIdByTitle and set groupId to the tool result.
|
|
938
|
+
- Never return group titles in output fields.
|
|
939
|
+
- If intent is "followUp", set question to the user's full question/request text.
|
|
940
|
+
- If intent is "navigation", set question="".
|
|
941
|
+
- If intent is "summarize", set question="".
|
|
942
|
+
- If intent is "navigation" and no group is specified, leave groupId empty so the system can navigate to the groups listing page.
|
|
943
|
+
- If hasAnalyticsContext is true and the user asks about the same group context without an explicit summarize/analyze command, prefer "followUp".
|
|
944
|
+
|
|
945
|
+
Examples:
|
|
946
|
+
- "Analyze group 0123456789abcdef0123456789abcdef" => summarize, groupId="0123456789abcdef0123456789abcdef"
|
|
947
|
+
- "Analyze group $living atlas" => summarize, call resolvePortalGroupIdByTitle("living atlas") and set groupId to tool result
|
|
948
|
+
- "Analyze group $"living atlas basemaps"" => summarize, call resolvePortalGroupIdByTitle("living atlas basemaps") and set groupId to tool result
|
|
949
|
+
- "Is this group active?" with hasAnalyticsContext=true => followUp
|
|
950
|
+
|
|
951
|
+
hasAnalyticsContext:
|
|
952
|
+
{hasAnalyticsContext}
|
|
953
|
+
|
|
954
|
+
User message:
|
|
955
|
+
{userMessage}
|
|
956
|
+
`, ia = async (e, t) => {
|
|
957
|
+
await g({ text: "Analyzing group-analytics intent...", agentName: "group-analytics" }, t);
|
|
958
|
+
const a = I(e.agentExecutionContext.messages), n = !!O(e).latestGroupId, o = await Y.fromTemplate(sa).format({
|
|
959
|
+
userMessage: a,
|
|
960
|
+
hasAnalyticsContext: String(n)
|
|
961
|
+
}), i = (await _({ modelTier: "fast" })).withStructuredOutput(ie), c = ie.parse(await i.invoke(o));
|
|
962
|
+
let u = c.groupId;
|
|
963
|
+
if ((c.intent === "summarize" || c.intent === "navigation") && !u) {
|
|
964
|
+
const y = A(a, "$");
|
|
965
|
+
y && (u = await Me.invoke({ groupTitle: y }, t) ?? "");
|
|
966
|
+
}
|
|
967
|
+
const { intent: d, question: l } = c, p = d === "summarize" && !u, m = d === "followUp" && !(l ?? "").trim(), f = d === "clarify" || p || m;
|
|
968
|
+
return {
|
|
969
|
+
groupSummaryIntent: f ? "clarify" : d,
|
|
970
|
+
groupSummaryGroupId: u || null,
|
|
971
|
+
groupSummaryQuestion: l || "",
|
|
972
|
+
status: "success",
|
|
973
|
+
outputMessage: f ? "Please clarify with a group id or title" : ""
|
|
974
|
+
};
|
|
975
|
+
}, ie = s.object({
|
|
976
|
+
intent: s.enum(["summarize", "followUp", "navigation", "clarify"]),
|
|
977
|
+
groupId: s.string().default(""),
|
|
978
|
+
question: s.string().default("")
|
|
979
|
+
}), ca = async (e, t) => {
|
|
980
|
+
const a = O(e), n = e.groupSummaryGroupId ?? a.latestGroupId;
|
|
981
|
+
return await g({ text: "Preparing navigation...", agentName: "group-analytics" }, t), await F(
|
|
982
|
+
n ? { destinationType: "portal-group", groupId: n } : { destinationType: "portal-groups" },
|
|
983
|
+
t
|
|
984
|
+
), { status: "success" };
|
|
985
|
+
};
|
|
986
|
+
function Pe({ timestamp: e, now: t, windowMs: a }) {
|
|
987
|
+
return e ? t - e <= a : !1;
|
|
988
|
+
}
|
|
989
|
+
const ua = 720 * 60 * 60 * 1e3;
|
|
990
|
+
function la(e) {
|
|
991
|
+
const t = He(e);
|
|
992
|
+
return {
|
|
993
|
+
id: e.id ?? "",
|
|
994
|
+
title: e.title ?? "",
|
|
995
|
+
description: e.description ?? "",
|
|
996
|
+
snippet: e.snippet ?? "",
|
|
997
|
+
access: e.access ?? null,
|
|
998
|
+
owner: e.owner ?? "",
|
|
999
|
+
tags: e.tags ?? [],
|
|
1000
|
+
created: e.created?.getTime(),
|
|
1001
|
+
modified: e.modified?.getTime(),
|
|
1002
|
+
isInvitationOnly: e.isInvitationOnly,
|
|
1003
|
+
sourceSignals: {
|
|
1004
|
+
capabilities: tt(e),
|
|
1005
|
+
membershipAccess: et(e),
|
|
1006
|
+
isOpenData: Ze(e),
|
|
1007
|
+
isDistributedCollaborationGroup: Xe(e),
|
|
1008
|
+
orgId: t.orgId,
|
|
1009
|
+
hiddenMembers: t.hiddenMembers,
|
|
1010
|
+
isViewOnly: t.isViewOnly,
|
|
1011
|
+
isReadOnly: t.isReadOnly,
|
|
1012
|
+
leavingDisallowed: t.leavingDisallowed
|
|
1013
|
+
}
|
|
1014
|
+
};
|
|
1015
|
+
}
|
|
1016
|
+
async function da(e) {
|
|
1017
|
+
const t = { owner: e.owner ?? "", admins: [], users: [] };
|
|
1018
|
+
try {
|
|
1019
|
+
return await e.fetchMembers();
|
|
1020
|
+
} catch (a) {
|
|
1021
|
+
return console.warn("Unable to fetch group members for analytics context", a), t;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
function pa(e) {
|
|
1025
|
+
return e.map((t) => ({
|
|
1026
|
+
id: t.id ?? "",
|
|
1027
|
+
title: t.title ?? "Untitled",
|
|
1028
|
+
type: t.type ?? "Unknown",
|
|
1029
|
+
owner: t.owner ?? "",
|
|
1030
|
+
created: t.created?.getTime(),
|
|
1031
|
+
modified: t.modified?.getTime()
|
|
1032
|
+
}));
|
|
1033
|
+
}
|
|
1034
|
+
function ma(e, t) {
|
|
1035
|
+
return e.filter(
|
|
1036
|
+
(a) => a.modified ? Pe({ timestamp: a.modified, now: t, windowMs: ua }) : !1
|
|
1037
|
+
);
|
|
1038
|
+
}
|
|
1039
|
+
function ga(e) {
|
|
1040
|
+
const t = /* @__PURE__ */ new Map();
|
|
1041
|
+
for (const a of e)
|
|
1042
|
+
t.set(a.type, (t.get(a.type) ?? 0) + 1);
|
|
1043
|
+
return [...t.entries()].sort((a, n) => n[1] - a[1] || a[0].localeCompare(n[0])).slice(0, 6).map(([a, n]) => ({ type: a, count: n }));
|
|
1044
|
+
}
|
|
1045
|
+
async function ha(e) {
|
|
1046
|
+
const t = await e.queryItems({ num: 20, sortField: "modified", sortOrder: "desc" }), a = pa(t.results), n = Date.now();
|
|
1047
|
+
return {
|
|
1048
|
+
total: t.total,
|
|
1049
|
+
topItems: a,
|
|
1050
|
+
recentlyModifiedItems: ma(a, n),
|
|
1051
|
+
topItemTypes: ga(a)
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1054
|
+
async function fa(e, t) {
|
|
1055
|
+
if (!t)
|
|
1056
|
+
return { error: { code: "missingGroupId", message: "Group id is required." } };
|
|
1057
|
+
try {
|
|
1058
|
+
const n = (await e.queryGroups({ query: `id:${t}`, num: 1 })).results[0];
|
|
1059
|
+
if (!n)
|
|
1060
|
+
return { error: { code: "groupNotFound", message: `No group found for id: ${t}` } };
|
|
1061
|
+
const o = la(n), r = await da(n), i = await ha(n);
|
|
1062
|
+
return { result: { group: o, members: r, items: i } };
|
|
1063
|
+
} catch (a) {
|
|
1064
|
+
return console.error("Error fetching portal group analytics context:", a), { error: { code: "unhandledError" } };
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
const ya = `
|
|
1068
|
+
You summarize ArcGIS Portal groups based on structured context and deterministic activity signals.
|
|
1069
|
+
|
|
1070
|
+
${Ge}
|
|
1071
|
+
|
|
1072
|
+
Output format requirements:
|
|
1073
|
+
- Return concise markdown with clear sections in this order:
|
|
1074
|
+
1) Overview
|
|
1075
|
+
2) Activity
|
|
1076
|
+
3) Members
|
|
1077
|
+
4) Content Theme
|
|
1078
|
+
5) Contribution Model
|
|
1079
|
+
6) Unknowns / Data Gaps
|
|
1080
|
+
- Keep total response about 180-280 words unless the user asked for extra detail.
|
|
1081
|
+
- Avoid internal-only implementation details and do not expose raw IDs unless user explicitly asks.
|
|
1082
|
+
|
|
1083
|
+
Reasoning rules:
|
|
1084
|
+
- Use deterministicSignals as the source of truth for active/recent status.
|
|
1085
|
+
- If group description/snippet are empty, infer purpose from tags, item title patterns, and item type distribution.
|
|
1086
|
+
- For members, report owner/admin/user counts when available; if unavailable due to permission scope, explicitly say so.
|
|
1087
|
+
- For contribution model, use membershipAccess, capabilities, and sourceJSON flags to characterize collaboration vs distribution behavior.
|
|
1088
|
+
- Be explicit when signals are heuristic or unavailable.
|
|
1089
|
+
|
|
1090
|
+
Follow-up prompt rules:
|
|
1091
|
+
- Generate exactly 3 follow-up prompts.
|
|
1092
|
+
- Write them as direct first-person user chat prompts that can be clicked and sent as-is.
|
|
1093
|
+
- Do not write meta-questions such as "Would you like..." or "Do you want me to...".
|
|
1094
|
+
- Keep each prompt short, specific, and actionable.
|
|
1095
|
+
- Every prompt must be answerable using only the provided group context and deterministic signals.
|
|
1096
|
+
- Do not require external data, navigation, or additional fetches.
|
|
1097
|
+
- Tailor each prompt to this specific group's available signals (content mix, activity, members, and contribution model).
|
|
1098
|
+
- Avoid repeating phrasing from prior prompts or using generic template wording.
|
|
1099
|
+
- If a signal is unavailable (for example members), do not ask follow-ups that depend on that missing signal.
|
|
1100
|
+
|
|
1101
|
+
Group context:
|
|
1102
|
+
{context}
|
|
1103
|
+
|
|
1104
|
+
Deterministic signals:
|
|
1105
|
+
{deterministicSignals}
|
|
1106
|
+
`, wa = 2160 * 60 * 60 * 1e3, va = async (e, t) => {
|
|
1107
|
+
const a = e.groupSummaryGroupId;
|
|
1108
|
+
if (!a)
|
|
1109
|
+
return {
|
|
1110
|
+
status: "success",
|
|
1111
|
+
outputMessage: 'Please clarify with analyze group <group id>, analyze group $<title>, or analyze group $"<title with spaces>".'
|
|
1112
|
+
};
|
|
1113
|
+
await g({ text: `Analyzing group ${a}...`, agentName: "group-analytics" }, t);
|
|
1114
|
+
const n = t?.configurable?.context;
|
|
1115
|
+
x(n);
|
|
1116
|
+
const { result: o, error: r } = await fa(n.portal, a);
|
|
1117
|
+
if (r || !o)
|
|
1118
|
+
return await g({ text: "Failed to fetch group context", agentName: "group-analytics" }, t), {
|
|
1119
|
+
status: "success",
|
|
1120
|
+
outputMessage: "Unable to retrieve group context for analytics."
|
|
1121
|
+
};
|
|
1122
|
+
const { group: i, items: c } = o, u = Date.now(), d = i.modified, l = d ? Pe({ timestamp: d, now: u, windowMs: wa }) : !1, p = c.recentlyModifiedItems.length, m = p > 0, f = l || m, y = await b({
|
|
1123
|
+
promptText: ya,
|
|
1124
|
+
schema: ba,
|
|
1125
|
+
modelTier: "default",
|
|
1126
|
+
inputVariables: {
|
|
1127
|
+
context: JSON.stringify(o),
|
|
1128
|
+
deterministicSignals: JSON.stringify({
|
|
1129
|
+
isGroupActive: f,
|
|
1130
|
+
isGroupRecentlyModified: l,
|
|
1131
|
+
hasRecentlyAddedOrUpdatedContent: m,
|
|
1132
|
+
recentItemCount: p
|
|
1133
|
+
})
|
|
1134
|
+
}
|
|
1135
|
+
}), { followUpQuestions: M, summary: q } = y, T = O(e), C = {
|
|
1136
|
+
latestGroupId: a,
|
|
1137
|
+
memory: {
|
|
1138
|
+
...T.memory,
|
|
1139
|
+
[a]: { summary: q, followUpQuestions: M, fullContext: o }
|
|
1140
|
+
}
|
|
1141
|
+
};
|
|
1142
|
+
return M.length && await J({ type: "suggested-prompts", data: { prompts: M } }, t), {
|
|
1143
|
+
status: "success",
|
|
1144
|
+
outputMessage: q,
|
|
1145
|
+
sharedStatePatch: { portalGroupSummaryMemory: { value: C } }
|
|
1146
|
+
};
|
|
1147
|
+
}, ba = s.object({
|
|
1148
|
+
summary: s.string(),
|
|
1149
|
+
followUpQuestions: s.array(s.string()).default([])
|
|
1150
|
+
}), L = (e, t) => t ?? e, qe = h.Root({
|
|
1151
|
+
...P(),
|
|
1152
|
+
groupSummaryIntent: h({
|
|
1153
|
+
reducer: L,
|
|
1154
|
+
default: () => "clarify"
|
|
1155
|
+
}),
|
|
1156
|
+
groupSummaryGroupId: h({
|
|
1157
|
+
reducer: L,
|
|
1158
|
+
default: () => null
|
|
1159
|
+
}),
|
|
1160
|
+
groupSummaryQuestion: h({
|
|
1161
|
+
reducer: L,
|
|
1162
|
+
default: () => ""
|
|
1163
|
+
})
|
|
1164
|
+
}), Ia = () => new N(qe).addNode("detectGroupSummaryIntent", ia).addNode("summarizePortalGroup", va).addNode("answerGroupSummaryFollowUp", oa).addNode("suggestGroupSummaryNavigation", ca).addEdge(G, "detectGroupSummaryIntent").addConditionalEdges("detectGroupSummaryIntent", (t) => t.groupSummaryIntent === "summarize" ? "summarizePortalGroup" : t.groupSummaryIntent === "followUp" ? "answerGroupSummaryFollowUp" : t.groupSummaryIntent === "navigation" ? "suggestGroupSummaryNavigation" : w).addEdge("summarizePortalGroup", w).addEdge("answerGroupSummaryFollowUp", w).addEdge("suggestGroupSummaryNavigation", w), Sa = String.raw`- **portal-group-analytics** - Portal group analytics assistant:
|
|
1165
|
+
- summarizes ArcGIS portal groups from group context and sourceJSON details
|
|
1166
|
+
- answers follow-up questions grounded in the summarized group
|
|
1167
|
+
- suggests navigation to groups when relevant
|
|
1168
|
+
`, xa = {
|
|
1169
|
+
id: "portal-group-analytics",
|
|
1170
|
+
name: "Portal Group Analytics",
|
|
1171
|
+
description: Sa,
|
|
1172
|
+
createGraph: Ia,
|
|
1173
|
+
workspace: qe
|
|
1174
|
+
}, Ta = () => ({ latestItemId: null, memory: {} }), H = (e) => {
|
|
1175
|
+
const t = e?.agentExecutionContext.sharedState.portalItemAnalyticsSummaryMemory?.value;
|
|
1176
|
+
return t ? { latestItemId: t.latestItemId, memory: t.memory } : Ta();
|
|
1177
|
+
}, ce = s.object({
|
|
1178
|
+
intent: s.enum(["summarize", "followUp", "clarify"]),
|
|
1179
|
+
itemId: s.string().default(""),
|
|
1180
|
+
question: s.string().default("")
|
|
1181
|
+
}), Ma = s.object({ summary: s.string(), followUpQuestions: s.array(s.string()).default([]) }), Ca = s.object({ answer: s.string(), isRelevant: s.boolean() }), Aa = `
|
|
1182
|
+
You answer follow-up questions about an ArcGIS item.
|
|
1183
|
+
|
|
1184
|
+
Ground your answer in the provided item context.
|
|
1185
|
+
If the answer is not available from the provided context, state that clearly and suggest what to check next.
|
|
1186
|
+
|
|
1187
|
+
Response rules:
|
|
1188
|
+
- Reply in concise markdown.
|
|
1189
|
+
- Keep the answer focused on the follow-up question.
|
|
1190
|
+
- Do not include internal identifiers.
|
|
1191
|
+
- Mark isRelevant=false when the question is not about this item or cannot be grounded in this item context.
|
|
1192
|
+
|
|
1193
|
+
Item summary:
|
|
1194
|
+
{summary}
|
|
1195
|
+
|
|
1196
|
+
Item full context
|
|
1197
|
+
{fullContext}
|
|
1198
|
+
|
|
1199
|
+
Question:
|
|
1200
|
+
{question}
|
|
1201
|
+
`, Na = async (e, t) => {
|
|
1202
|
+
await g({ text: "Answering follow-up...", agentName: "analytics" }, t);
|
|
1203
|
+
const a = H(e), n = e.analyticsItemId ?? a.latestItemId, o = n ? a.memory[n] : void 0, r = e.analyticsQuestion || I(e.agentExecutionContext.messages);
|
|
1204
|
+
return o ? {
|
|
1205
|
+
status: "success",
|
|
1206
|
+
outputMessage: (await b({
|
|
1207
|
+
promptText: Aa,
|
|
1208
|
+
schema: Ca,
|
|
1209
|
+
modelTier: "default",
|
|
1210
|
+
inputVariables: {
|
|
1211
|
+
summary: o.summary,
|
|
1212
|
+
question: r,
|
|
1213
|
+
fullContext: JSON.stringify(o.fullContext)
|
|
1214
|
+
}
|
|
1215
|
+
})).answer
|
|
1216
|
+
} : {
|
|
1217
|
+
status: "success",
|
|
1218
|
+
outputMessage: "I don't have enough information yet. Please ask me to summarize the item first using summarize item <item id>."
|
|
1219
|
+
};
|
|
1220
|
+
}, Ga = `
|
|
1221
|
+
Classify the user analytics request.
|
|
1222
|
+
|
|
1223
|
+
Rules:
|
|
1224
|
+
- intent="summarize" only when the user explicitly asks to summarize/overview/recap an item.
|
|
1225
|
+
- intent="followUp" for analytical questions about item details, including schema/fields/attributes/layers.
|
|
1226
|
+
- intent="clarify" when neither summarize nor follow-up intent is clear.
|
|
1227
|
+
- itemId must be the final resolved item id.
|
|
1228
|
+
- If request has explicit item id, set itemId directly.
|
|
1229
|
+
- If request references item title (for example #title, #"title with spaces", or plain quoted title), call resolvePortalItemIdByTitle and set itemId to the returned value.
|
|
1230
|
+
- Never return item titles in output fields.
|
|
1231
|
+
- If intent is "followUp", set question to the user's full question/request text.
|
|
1232
|
+
- If intent is "summarize", set question="".
|
|
1233
|
+
- When user asks to show/list/explain fields, schema, attributes, columns, or layer details, classify as "followUp" unless they explicitly request a summary.
|
|
1234
|
+
- If hasSummaryContext is true, prefer "followUp" for detail-oriented requests that do not explicitly ask to summarize.
|
|
1235
|
+
|
|
1236
|
+
Examples:
|
|
1237
|
+
- "Summarize item 0123456789abcdef0123456789abcdef" => summarize, itemId="0123456789abcdef0123456789abcdef"
|
|
1238
|
+
- "Summarize item #california" => summarize, call resolvePortalItemIdByTitle("california") and set itemId to tool result
|
|
1239
|
+
- "Summarize item #"california farmland"" => summarize, call resolvePortalItemIdByTitle("california farmland") and set itemId to tool result
|
|
1240
|
+
- "Show the layer's available fields" => followUp
|
|
1241
|
+
- "List attributes and explain what status means" => followUp
|
|
1242
|
+
- "What fields are available?" with hasSummaryContext=true => followUp
|
|
1243
|
+
- "Give me an overview of item 0123456789abcdef0123456789abcdef" => summarize
|
|
1244
|
+
|
|
1245
|
+
hasSummaryContext:
|
|
1246
|
+
{hasSummaryContext}
|
|
1247
|
+
|
|
1248
|
+
User message:
|
|
1249
|
+
{userMessage}
|
|
1250
|
+
`, Pa = async (e, t) => {
|
|
1251
|
+
await g({ text: "Analyzing intent...", agentName: "analytics" }, t);
|
|
1252
|
+
const a = I(e.agentExecutionContext.messages), n = !!H(e).latestItemId, o = await Y.fromTemplate(Ga).format({
|
|
1253
|
+
userMessage: a,
|
|
1254
|
+
hasSummaryContext: String(n)
|
|
1255
|
+
}), i = (await _({ modelTier: "fast" })).withStructuredOutput(ce), c = ce.parse(await i.invoke(o));
|
|
1256
|
+
let u = c.itemId;
|
|
1257
|
+
if (c.intent === "summarize" && !u) {
|
|
1258
|
+
const y = A(a, "#");
|
|
1259
|
+
y && (u = await Ce.invoke({ itemTitle: y }, t) ?? "");
|
|
1260
|
+
}
|
|
1261
|
+
const { intent: d, question: l } = c, f = d === "clarify" || d === "summarize" && !u || d === "followUp" && !l;
|
|
1262
|
+
return {
|
|
1263
|
+
agentExecutionContext: { ...e.agentExecutionContext },
|
|
1264
|
+
analyticsIntent: f ? "clarify" : d,
|
|
1265
|
+
analyticsItemId: u || null,
|
|
1266
|
+
analyticsQuestion: l || "",
|
|
1267
|
+
status: "success",
|
|
1268
|
+
outputMessage: f ? 'Please clarify with summarize item <item id>, summarize item #<title>, or summarize item #"<title with spaces>".' : ""
|
|
1269
|
+
};
|
|
1270
|
+
}, qa = `
|
|
1271
|
+
You are a item summary tool for ArcGIS. Your job is to summarize an item's info based on the provided context.
|
|
1272
|
+
Summary rules:
|
|
1273
|
+
- The summary should be concise markdown, make sure to format the output nicely so it's easy to read.
|
|
1274
|
+
- Target length: 80-150 words.
|
|
1275
|
+
- Provide one short descriptive paragraph.
|
|
1276
|
+
- Also propose 3 concise follow-up questions grounded in the item summary.
|
|
1277
|
+
- Keep follow-up questions specific and actionable.
|
|
1278
|
+
Follow-up questions rules:
|
|
1279
|
+
- These questions should be in the format of a prompt that the user can click on.
|
|
1280
|
+
- Make sure the questions are relevant to the item summary and that you can answer based solely on the provided context.
|
|
1281
|
+
Do not include internal identifiers.
|
|
1282
|
+
If the user asks for a detailed summary, you may expand the response up to 300 words.
|
|
1283
|
+
Item context:
|
|
1284
|
+
{context}
|
|
1285
|
+
`, Ea = async (e, t) => {
|
|
1286
|
+
const a = e.analyticsItemId;
|
|
1287
|
+
if (!a)
|
|
1288
|
+
return {
|
|
1289
|
+
status: "success",
|
|
1290
|
+
outputMessage: 'Please clarify with summarize item <item id>, summarize item #<title>, or summarize item #"<title with spaces>".'
|
|
1291
|
+
};
|
|
1292
|
+
await g({ text: `Summarizing item ${a}...`, agentName: "analytics" }, t);
|
|
1293
|
+
const n = t?.configurable?.context;
|
|
1294
|
+
x(n);
|
|
1295
|
+
const { portal: o, user: r } = n, { result: i, error: c } = await Ye(r, o, a);
|
|
1296
|
+
if (c || !i)
|
|
1297
|
+
return await g({ text: "Failed to get item context for summarization", agentName: "analytics" }, t), {
|
|
1298
|
+
status: "success",
|
|
1299
|
+
outputMessage: "Unable to retrieve item context for summarization."
|
|
1300
|
+
};
|
|
1301
|
+
const { context: u } = i, d = await b({
|
|
1302
|
+
promptText: qa,
|
|
1303
|
+
schema: Ma,
|
|
1304
|
+
modelTier: "default",
|
|
1305
|
+
inputVariables: { context: JSON.stringify(u) }
|
|
1306
|
+
}), { followUpQuestions: l, summary: p } = d, m = H(e), f = {
|
|
1307
|
+
latestItemId: a,
|
|
1308
|
+
memory: {
|
|
1309
|
+
...m.memory,
|
|
1310
|
+
[a]: { summary: p, followUpQuestions: l, fullContext: u }
|
|
1311
|
+
}
|
|
1312
|
+
};
|
|
1313
|
+
return l.length && await J({ type: "suggested-prompts", data: { prompts: l } }, t), {
|
|
1314
|
+
status: "success",
|
|
1315
|
+
outputMessage: p,
|
|
1316
|
+
sharedStatePatch: { portalItemAnalyticsSummaryMemory: { value: f } }
|
|
1317
|
+
};
|
|
1318
|
+
}, j = (e, t) => t ?? e, Ee = h.Root({
|
|
1319
|
+
...P(),
|
|
1320
|
+
// States shared only across nodes in the graph, not between invocations
|
|
1321
|
+
analyticsIntent: h({
|
|
1322
|
+
reducer: j,
|
|
1323
|
+
default: () => "clarify"
|
|
1324
|
+
}),
|
|
1325
|
+
analyticsItemId: h({
|
|
1326
|
+
reducer: j,
|
|
1327
|
+
default: () => null
|
|
1328
|
+
}),
|
|
1329
|
+
analyticsQuestion: h({
|
|
1330
|
+
reducer: j,
|
|
1331
|
+
default: () => ""
|
|
1332
|
+
})
|
|
1333
|
+
}), ka = () => new N(Ee).addNode("detectAnalyticsIntent", Pa).addNode("summarizePortalItem", Ea).addNode("answerAnalyticsFollowUp", Na).addEdge(G, "detectAnalyticsIntent").addConditionalEdges("detectAnalyticsIntent", (t) => t.analyticsIntent === "summarize" ? "summarizePortalItem" : t.analyticsIntent === "followUp" ? "answerAnalyticsFollowUp" : w).addEdge("summarizePortalItem", w).addEdge("answerAnalyticsFollowUp", w), za = String.raw`- **portal-item-analytics** - Portal item analytics assistant:
|
|
1334
|
+
- answers questions about one specific ArcGIS portal item when item context is present
|
|
1335
|
+
- summarizes item details, metadata, and context grounded in that item
|
|
1336
|
+
- suggests follow-up prompts grounded in the same item
|
|
1337
|
+
- use for item-specific requests, not for gallery browsing, featured content, or opening Map Viewer
|
|
1338
|
+
`, $a = {
|
|
1339
|
+
id: "portal-item-analytics",
|
|
1340
|
+
name: "Portal Item Analytics",
|
|
1341
|
+
description: za,
|
|
1342
|
+
createGraph: ka,
|
|
1343
|
+
workspace: Ee
|
|
1344
|
+
}, Da = {
|
|
1345
|
+
schemaVersion: "1.0",
|
|
1346
|
+
capabilities: [
|
|
1347
|
+
{
|
|
1348
|
+
id: "my-content",
|
|
1349
|
+
title: "My content",
|
|
1350
|
+
description: "Browse, discover, search, and filter ArcGIS content—including maps, apps, datasets, and other items—that you own or can access.",
|
|
1351
|
+
hints: ["view my content", "show my content", "my content"],
|
|
1352
|
+
platforms: ["online", "enterprise"],
|
|
1353
|
+
resolutions: {
|
|
1354
|
+
navigate: {
|
|
1355
|
+
routeKey: "content"
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
},
|
|
1359
|
+
{
|
|
1360
|
+
id: "create-feature-layer",
|
|
1361
|
+
title: "Create feature layer",
|
|
1362
|
+
description: "Generate an editable feature layer by copying fields from templates or existing layers.",
|
|
1363
|
+
hints: ["add a feature layer", "make a feature layer", "generate a feature layer"],
|
|
1364
|
+
platforms: ["online", "enterprise"],
|
|
1365
|
+
resolutions: {
|
|
1366
|
+
navigate: {
|
|
1367
|
+
routeKey: "content"
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
},
|
|
1371
|
+
{
|
|
1372
|
+
id: "create-folder",
|
|
1373
|
+
title: "Create folder",
|
|
1374
|
+
description: "Create a new folder in your ArcGIS content to organize your items.",
|
|
1375
|
+
hints: ["create a folder", "make a folder", "set up a folder", "new folder"],
|
|
1376
|
+
platforms: ["online", "enterprise"],
|
|
1377
|
+
resolutions: {
|
|
1378
|
+
navigate: {
|
|
1379
|
+
routeKey: "content"
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
]
|
|
1384
|
+
}, Ra = {
|
|
1385
|
+
schemaVersion: "1.0",
|
|
1386
|
+
capabilities: [
|
|
1387
|
+
{
|
|
1388
|
+
id: "my groups",
|
|
1389
|
+
title: "My groups",
|
|
1390
|
+
description: "Browse, discover, search, and filter ArcGIS content collections—including maps, apps, datasets, and other items—that you own, belong to, or can access.",
|
|
1391
|
+
hints: ["view my groups", "show my groups", "my groups"],
|
|
1392
|
+
platforms: ["online", "enterprise"],
|
|
1393
|
+
resolutions: {
|
|
1394
|
+
navigate: {
|
|
1395
|
+
routeKey: "groups"
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
},
|
|
1399
|
+
{
|
|
1400
|
+
id: "create-group",
|
|
1401
|
+
title: "Create group",
|
|
1402
|
+
description: "Create a new ArcGIS Portal group owned by the signed-in user.",
|
|
1403
|
+
hints: ["create a group", "make a group", "set up a group", "new group"],
|
|
1404
|
+
platforms: ["online", "enterprise"],
|
|
1405
|
+
resolutions: {
|
|
1406
|
+
navigate: {
|
|
1407
|
+
routeKey: "groups"
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
},
|
|
1411
|
+
{
|
|
1412
|
+
id: "featured-groups",
|
|
1413
|
+
title: "Featured groups",
|
|
1414
|
+
description: "Browse, discover, search, and filter ArcGIS content collections—including maps, apps, datasets, and other items—that organization administrators choose to highlight in ArcGIS.",
|
|
1415
|
+
hints: ["view featured groups", "show featured groups", "highlighted groups", "top groups"],
|
|
1416
|
+
platforms: ["online", "enterprise"],
|
|
1417
|
+
resolutions: {
|
|
1418
|
+
navigate: {
|
|
1419
|
+
routeKey: "groups",
|
|
1420
|
+
hash: "featured"
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
},
|
|
1424
|
+
{
|
|
1425
|
+
id: "organization-groups",
|
|
1426
|
+
title: "Organization groups",
|
|
1427
|
+
description: "Browse, discover, search, and filter ArcGIS content collections—including maps, apps, datasets, and other items—that are specific to your organization in ArcGIS.",
|
|
1428
|
+
hints: ["view organization groups", "show organization groups"],
|
|
1429
|
+
platforms: ["online", "enterprise"],
|
|
1430
|
+
resolutions: {
|
|
1431
|
+
navigate: {
|
|
1432
|
+
routeKey: "groups",
|
|
1433
|
+
hash: "organization"
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
]
|
|
1438
|
+
}, Ua = {
|
|
1439
|
+
schemaVersion: "1.0",
|
|
1440
|
+
capabilities: [
|
|
1441
|
+
{
|
|
1442
|
+
id: "org-config-mfa",
|
|
1443
|
+
title: "Multifactor Authentication (MFA)",
|
|
1444
|
+
description: "Configure organization-level multifactor authentication (MFA) settings. Administrators can enable MFA for ArcGIS logins, allow recovery codes for members, view MFA adoption status, enforce MFA requirements for all members, manage the MFA exemption list, and designate administrators who can troubleshoot MFA issues.",
|
|
1445
|
+
hints: ["config MFA", "set up MFA"],
|
|
1446
|
+
platforms: ["online", "enterprise"],
|
|
1447
|
+
resolutions: {
|
|
1448
|
+
navigate: {
|
|
1449
|
+
routeKey: "organization",
|
|
1450
|
+
queryParams: {
|
|
1451
|
+
tab: "security"
|
|
1452
|
+
},
|
|
1453
|
+
hash: "settings"
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
]
|
|
1458
|
+
}, Fa = {
|
|
1459
|
+
"contentRouteRegistry.ts": Da,
|
|
1460
|
+
"groupsRouteRegistry.ts": Ra,
|
|
1461
|
+
"orgSettingsRouteRegistry.ts": Ua
|
|
1462
|
+
};
|
|
1463
|
+
function ue(e) {
|
|
1464
|
+
const t = [], a = /* @__PURE__ */ new Set();
|
|
1465
|
+
for (const [n, o] of Object.entries(e))
|
|
1466
|
+
for (const r of o.capabilities) {
|
|
1467
|
+
if (a.has(r.id))
|
|
1468
|
+
throw new Error(`${n}: duplicate capability id "${r.id}" across registries`);
|
|
1469
|
+
a.add(r.id), t.push(r);
|
|
1470
|
+
}
|
|
1471
|
+
return t;
|
|
1472
|
+
}
|
|
1473
|
+
let z;
|
|
1474
|
+
function S(e) {
|
|
1475
|
+
return e ? z = ue({ customCapabilities: e }) : z || (z = ue(Fa)), z;
|
|
1476
|
+
}
|
|
1477
|
+
const Oa = /^(?:take me to|navigate to|go to|show me|open)\s+(?:the\s+)?/u;
|
|
1478
|
+
function R(e) {
|
|
1479
|
+
return e.toLowerCase().replace(/[^a-z0-9]+/gu, " ").trim().replace(Oa, "").trim();
|
|
1480
|
+
}
|
|
1481
|
+
const La = s.object({
|
|
1482
|
+
capabilityIds: s.array(s.string()).default([]),
|
|
1483
|
+
confidence: s.number().min(0).max(1).default(0),
|
|
1484
|
+
reason: s.string().default("")
|
|
1485
|
+
}), le = 0.8, ja = String.raw`You select Portal navigation capabilities for a user's request.
|
|
1486
|
+
|
|
1487
|
+
Select only capability IDs from the supplied candidates. Return an empty array when none fit.
|
|
1488
|
+
A named surface is required: do not select a capability on another Portal surface.
|
|
1489
|
+
Retrieval scores are hints only, not ground truth.
|
|
1490
|
+
|
|
1491
|
+
User request:
|
|
1492
|
+
{userRequest}
|
|
1493
|
+
|
|
1494
|
+
Candidates:
|
|
1495
|
+
{candidates}`, Va = async (e, t) => {
|
|
1496
|
+
if (e.outputMessage || e.targets.length === 0)
|
|
1497
|
+
return {};
|
|
1498
|
+
const a = I(e.agentExecutionContext.messages).trim(), n = Ba(a, e);
|
|
1499
|
+
if (n.length === 1)
|
|
1500
|
+
return console.info("[arcgis-portal-ai-assistant] navigation capability selection:", {
|
|
1501
|
+
method: "exact-match",
|
|
1502
|
+
request: a,
|
|
1503
|
+
selectedCapabilityIds: n
|
|
1504
|
+
}), { chosenCapabilityIds: n };
|
|
1505
|
+
await g({ text: "Choosing a navigation destination...", agentName: "navigation" }, t);
|
|
1506
|
+
const o = JSON.stringify(
|
|
1507
|
+
e.targets.map(({ capability: r, keywordScore: i, semanticScore: c }) => ({
|
|
1508
|
+
id: r.id,
|
|
1509
|
+
title: r.title,
|
|
1510
|
+
description: r.description,
|
|
1511
|
+
route: r.resolutions.navigate,
|
|
1512
|
+
keywordScore: i,
|
|
1513
|
+
semanticScore: c
|
|
1514
|
+
}))
|
|
1515
|
+
);
|
|
1516
|
+
try {
|
|
1517
|
+
const r = await b({
|
|
1518
|
+
promptText: ja,
|
|
1519
|
+
schema: La,
|
|
1520
|
+
modelTier: "fast",
|
|
1521
|
+
inputVariables: { candidates: o, userRequest: a }
|
|
1522
|
+
}), i = new Set(e.targets.map(({ capability: u }) => u.id)), c = r.capabilityIds.filter((u) => i.has(u));
|
|
1523
|
+
return console.info("[arcgis-portal-ai-assistant] navigation capability selection:", {
|
|
1524
|
+
confidence: r.confidence,
|
|
1525
|
+
method: "structured-model",
|
|
1526
|
+
reason: r.reason,
|
|
1527
|
+
request: a,
|
|
1528
|
+
selectedCapabilityIds: c
|
|
1529
|
+
}), r.confidence < le ? {
|
|
1530
|
+
chosenCapabilityIds: [],
|
|
1531
|
+
status: "failed",
|
|
1532
|
+
summary: `Navigation selection confidence ${r.confidence} is below the required ${le}; defer to the Portal Doc Assistant.`
|
|
1533
|
+
} : { chosenCapabilityIds: c };
|
|
1534
|
+
} catch {
|
|
1535
|
+
return console.info("[arcgis-portal-ai-assistant] navigation capability selection:", {
|
|
1536
|
+
method: "structured-model-unavailable",
|
|
1537
|
+
request: a,
|
|
1538
|
+
selectedCapabilityIds: []
|
|
1539
|
+
}), { chosenCapabilityIds: [] };
|
|
1540
|
+
}
|
|
758
1541
|
};
|
|
759
|
-
|
|
1542
|
+
function Ba(e, t) {
|
|
1543
|
+
const a = R(e);
|
|
1544
|
+
return t.targets.filter(
|
|
1545
|
+
({ capability: n }) => [n.title, ...n.hints].some(
|
|
1546
|
+
(o) => R(o) === a
|
|
1547
|
+
)
|
|
1548
|
+
).map(({ capability: n }) => n.id);
|
|
1549
|
+
}
|
|
1550
|
+
const ke = /* @__PURE__ */ new Set(["1d", "7d", "14d", "30d", "3m", "6m"]), Ka = s.object({
|
|
1551
|
+
period: s.string(),
|
|
1552
|
+
startTime: s.string(),
|
|
1553
|
+
endTime: s.string()
|
|
1554
|
+
}), Qa = String.raw`Extract temporal filters for an ArcGIS storage-credits query.
|
|
1555
|
+
|
|
1556
|
+
Return JSON only with these optional string fields:
|
|
1557
|
+
- period
|
|
1558
|
+
- startTime
|
|
1559
|
+
- endTime
|
|
1560
|
+
|
|
1561
|
+
Rules:
|
|
1562
|
+
- period must use <integer><unit> with unit in d,w,m (examples: 7d, 2w, 3m).
|
|
1563
|
+
- If the request is a relative range and period can be determined, always include period.
|
|
1564
|
+
- For "last quarter" or "previous quarter", use calendar-quarter boundaries and include period as 3m with both startTime and endTime.
|
|
1565
|
+
- For "last quarter" or "previous quarter", endTime must be the UTC end of the previous quarter, not "now".
|
|
1566
|
+
- If period matches one of these supported periods and the range ends today, period alone is sufficient:
|
|
1567
|
+
1d, 7d, 14d, 30d, 3m, 6m.
|
|
1568
|
+
- If the request implies a range not supported as period (for example 2m or 10d), include startTime and endTime.
|
|
1569
|
+
- For custom date ranges (for example "last december"), provide startTime and endTime.
|
|
1570
|
+
- startTime and endTime must be epoch milliseconds as strings.
|
|
1571
|
+
- If the end of range is "now", set endTime to {nowEpochMs}.
|
|
1572
|
+
- If temporal intent is unclear, return empty strings for all fields.
|
|
1573
|
+
|
|
1574
|
+
Now UTC:
|
|
1575
|
+
- ISO: {nowIso}
|
|
1576
|
+
- Epoch ms: {nowEpochMs}
|
|
1577
|
+
|
|
1578
|
+
User request:
|
|
1579
|
+
{userRequest}`;
|
|
1580
|
+
async function Wa(e, t = /* @__PURE__ */ new Date()) {
|
|
1581
|
+
const a = e.trim();
|
|
1582
|
+
if (!a)
|
|
1583
|
+
return {};
|
|
1584
|
+
try {
|
|
1585
|
+
const n = await b({
|
|
1586
|
+
promptText: Qa,
|
|
1587
|
+
schema: Ka,
|
|
1588
|
+
modelTier: "fast",
|
|
1589
|
+
inputVariables: {
|
|
1590
|
+
nowEpochMs: String(t.getTime()),
|
|
1591
|
+
nowIso: t.toISOString(),
|
|
1592
|
+
userRequest: a
|
|
1593
|
+
}
|
|
1594
|
+
});
|
|
1595
|
+
return Ja(n, t);
|
|
1596
|
+
} catch (n) {
|
|
1597
|
+
return console.error(n), {};
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
function Ja(e, t = /* @__PURE__ */ new Date()) {
|
|
1601
|
+
const a = de(e.startTime), n = de(e.endTime), o = _a(e.period);
|
|
1602
|
+
if (o) {
|
|
1603
|
+
if (a !== void 0 && n !== void 0 && a < n)
|
|
1604
|
+
return { period: o, startTime: String(a), endTime: String(n) };
|
|
1605
|
+
const r = ke.has(o);
|
|
1606
|
+
if (!r || n !== void 0 && !Ha(n, t.getTime())) {
|
|
1607
|
+
const c = n ?? t.getTime(), u = Ya(o, new Date(c));
|
|
1608
|
+
if (u !== void 0)
|
|
1609
|
+
return {
|
|
1610
|
+
period: o,
|
|
1611
|
+
startTime: String(u),
|
|
1612
|
+
endTime: String(c)
|
|
1613
|
+
};
|
|
1614
|
+
}
|
|
1615
|
+
return r ? {
|
|
1616
|
+
period: o,
|
|
1617
|
+
...a !== void 0 ? { startTime: String(a) } : {},
|
|
1618
|
+
...n !== void 0 ? { endTime: String(n) } : {}
|
|
1619
|
+
} : { period: o };
|
|
1620
|
+
}
|
|
1621
|
+
return a !== void 0 && n !== void 0 && a < n ? { startTime: String(a), endTime: String(n) } : a !== void 0 ? { startTime: String(a), endTime: String(t.getTime()) } : {};
|
|
1622
|
+
}
|
|
1623
|
+
function _a(e) {
|
|
1624
|
+
const t = e?.trim().match(/^(\d+)\s*([dwm])$/iu);
|
|
1625
|
+
if (!t)
|
|
1626
|
+
return;
|
|
1627
|
+
const a = Number.parseInt(t[1], 10);
|
|
1628
|
+
if (!Number.isFinite(a) || a <= 0)
|
|
1629
|
+
return;
|
|
1630
|
+
const n = t[2].toLowerCase();
|
|
1631
|
+
if (n === "w") {
|
|
1632
|
+
const o = a * 7;
|
|
1633
|
+
if (ke.has(`${o}d`))
|
|
1634
|
+
return `${o}d`;
|
|
1635
|
+
}
|
|
1636
|
+
return `${a}${n}`;
|
|
1637
|
+
}
|
|
1638
|
+
function Ya(e, t) {
|
|
1639
|
+
const a = e.match(/^(\d+)([dwm])$/u);
|
|
1640
|
+
if (!a)
|
|
1641
|
+
return;
|
|
1642
|
+
const n = Number.parseInt(a[1], 10);
|
|
1643
|
+
if (!Number.isFinite(n) || n <= 0)
|
|
1644
|
+
return;
|
|
1645
|
+
const o = a[2];
|
|
1646
|
+
if (o === "d")
|
|
1647
|
+
return t.getTime() - n * 24 * 60 * 60 * 1e3;
|
|
1648
|
+
if (o === "w")
|
|
1649
|
+
return t.getTime() - n * 7 * 24 * 60 * 60 * 1e3;
|
|
1650
|
+
const r = new Date(t.getTime());
|
|
1651
|
+
return r.setUTCMonth(r.getUTCMonth() - n), r.getTime();
|
|
1652
|
+
}
|
|
1653
|
+
function de(e) {
|
|
1654
|
+
if (!e)
|
|
1655
|
+
return;
|
|
1656
|
+
const t = Number.parseInt(e, 10);
|
|
1657
|
+
if (!(!Number.isFinite(t) || t <= 0))
|
|
1658
|
+
return t;
|
|
1659
|
+
}
|
|
1660
|
+
function Ha(e, t) {
|
|
1661
|
+
const a = new Date(e), n = new Date(t);
|
|
1662
|
+
return a.getUTCFullYear() === n.getUTCFullYear() && a.getUTCMonth() === n.getUTCMonth() && a.getUTCDate() === n.getUTCDate();
|
|
1663
|
+
}
|
|
1664
|
+
async function Xa(e, t, a) {
|
|
1665
|
+
const n = S().find((r) => r.id === e);
|
|
1666
|
+
if (!n)
|
|
1667
|
+
return;
|
|
1668
|
+
const o = await en(Za(n), a);
|
|
1669
|
+
return o && an(o, t) ? { capability: n, target: o } : void 0;
|
|
1670
|
+
}
|
|
1671
|
+
function Za(e) {
|
|
1672
|
+
const { hash: t, queryParams: a, routeKey: n } = e.resolutions.navigate;
|
|
1673
|
+
switch (n) {
|
|
1674
|
+
case "content":
|
|
1675
|
+
switch (e.id) {
|
|
1676
|
+
case "my-content":
|
|
1677
|
+
return { destinationType: "portal-content" };
|
|
1678
|
+
case "create-feature-layer":
|
|
1679
|
+
return { destinationType: "portal-content" };
|
|
1680
|
+
case "create-folder":
|
|
1681
|
+
return { destinationType: "portal-content" };
|
|
1682
|
+
default:
|
|
1683
|
+
return { destinationType: "portal-content" };
|
|
1684
|
+
}
|
|
1685
|
+
case "groups":
|
|
1686
|
+
if (t === "featured")
|
|
1687
|
+
return { destinationType: "portal-groups", hash: "featured" };
|
|
1688
|
+
if (t === "organization")
|
|
1689
|
+
return { destinationType: "portal-groups", hash: "organization" };
|
|
1690
|
+
switch (e.id) {
|
|
1691
|
+
case "my groups":
|
|
1692
|
+
return { destinationType: "portal-groups", hash: "my" };
|
|
1693
|
+
case "create-group":
|
|
1694
|
+
return { destinationType: "portal-groups" };
|
|
1695
|
+
default:
|
|
1696
|
+
return { destinationType: "portal-groups" };
|
|
1697
|
+
}
|
|
1698
|
+
case "organization":
|
|
1699
|
+
return {
|
|
1700
|
+
destinationType: "portal-org",
|
|
1701
|
+
hash: t,
|
|
1702
|
+
queryParams: a,
|
|
1703
|
+
buttonLabel: e.buttonLabel
|
|
1704
|
+
};
|
|
1705
|
+
default:
|
|
1706
|
+
return;
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
async function en(e, t) {
|
|
1710
|
+
if (!e || !t || !tn(e))
|
|
1711
|
+
return e;
|
|
1712
|
+
const a = await Wa(t);
|
|
1713
|
+
if (!a.period && !a.startTime && !a.endTime)
|
|
1714
|
+
return e;
|
|
1715
|
+
const n = {
|
|
1716
|
+
...e.queryParams ?? {},
|
|
1717
|
+
...a.period ? { period: a.period } : {},
|
|
1718
|
+
...a.startTime ? { startTime: a.startTime } : {},
|
|
1719
|
+
...a.endTime ? { endTime: a.endTime } : {}
|
|
1720
|
+
};
|
|
1721
|
+
return { ...e, queryParams: n };
|
|
1722
|
+
}
|
|
1723
|
+
function tn(e) {
|
|
1724
|
+
return e.destinationType === "portal-org" && e.hash === "status";
|
|
1725
|
+
}
|
|
1726
|
+
function an(e, t) {
|
|
1727
|
+
return !t || !!t[e.destinationType];
|
|
1728
|
+
}
|
|
1729
|
+
const nn = async (e, t) => {
|
|
1730
|
+
if (e.outputMessage || e.status === "failed")
|
|
1731
|
+
return {};
|
|
1732
|
+
const a = e.targets.find(({ capability: r }) => e.chosenCapabilityIds.includes(r.id)) ?? e.targets[0];
|
|
1733
|
+
if (!a)
|
|
1734
|
+
return {
|
|
1735
|
+
outputMessage: "I couldn't find a matching Portal page. Try asking to open your content, groups, or organization settings.",
|
|
1736
|
+
sharedStatePatch: { navLastAnsweredRequest: { value: pe(e) } },
|
|
1737
|
+
status: "success",
|
|
1738
|
+
summary: "Navigation could not find a matching capability; route another agent if appropriate."
|
|
1739
|
+
};
|
|
1740
|
+
const n = pe(e), o = await Xa(a.capability.id, void 0, n);
|
|
1741
|
+
return o ? (await g({ text: "Preparing navigation...", agentName: "navigation" }, t), await F(o.target, t), {
|
|
1742
|
+
outputMessage: e.chosenCapabilityIds.length ? a.capability.description : `The closest place to start is ${a.capability.title}. Click the button below to open it.`,
|
|
1743
|
+
status: "success",
|
|
1744
|
+
summary: `Navigation suggested ${a.capability.id}${e.retrievalDegraded ? " using keyword-only retrieval" : ""}.`,
|
|
1745
|
+
sharedStatePatch: { navLastAnsweredRequest: { value: n } }
|
|
1746
|
+
}) : (console.warn(`Navigation capability ${a.capability.id} was not found in the resolver.`), {
|
|
1747
|
+
outputMessage: "I found a possible destination, but couldn't resolve a valid Portal navigation target. Try asking to open your content, groups, or organization settings.",
|
|
1748
|
+
status: "success",
|
|
1749
|
+
summary: `Navigation resolver could not map ${a.capability.id}.`,
|
|
1750
|
+
sharedStatePatch: { navLastAnsweredRequest: { value: n } }
|
|
1751
|
+
});
|
|
1752
|
+
};
|
|
1753
|
+
function pe(e) {
|
|
1754
|
+
return I(e.agentExecutionContext.messages) || e.agentExecutionContext.userRequest;
|
|
1755
|
+
}
|
|
1756
|
+
async function ze(e) {
|
|
1757
|
+
return e.length === 0 ? [] : (await at.getDefault().load(), await Be(e));
|
|
1758
|
+
}
|
|
1759
|
+
const on = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1760
|
+
__proto__: null,
|
|
1761
|
+
generateEmbeddings: ze
|
|
1762
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1763
|
+
function rn(e) {
|
|
1764
|
+
const t = [], a = `${e.title}. ${e.description}`;
|
|
1765
|
+
a.trim().length > 0 && t.push({ field: "summary", text: a });
|
|
1766
|
+
const n = e.hints;
|
|
1767
|
+
if (Array.isArray(n))
|
|
1768
|
+
for (const o of n)
|
|
1769
|
+
typeof o == "string" && o.trim().length > 0 && t.push({ field: "hint", text: o });
|
|
1770
|
+
return t;
|
|
1771
|
+
}
|
|
1772
|
+
let $, X, D = 0;
|
|
1773
|
+
async function sn(e = {}) {
|
|
1774
|
+
const t = D;
|
|
1775
|
+
return $ ??= un(e.embed ?? ln).then((a) => (t === D && (X = a), a)).catch((a) => {
|
|
1776
|
+
throw t === D && ($ = void 0), a;
|
|
1777
|
+
}), await $;
|
|
1778
|
+
}
|
|
1779
|
+
function cn() {
|
|
1780
|
+
return X;
|
|
1781
|
+
}
|
|
1782
|
+
function me() {
|
|
1783
|
+
D += 1, X = void 0, $ = void 0;
|
|
1784
|
+
}
|
|
1785
|
+
async function un(e) {
|
|
1786
|
+
const t = dn(), a = await e(t.map((n) => n.text));
|
|
1787
|
+
if (a.length !== t.length)
|
|
1788
|
+
throw new Error(`Expected ${t.length} vectors, got ${a.length}`);
|
|
1789
|
+
return t.map((n, o) => ({
|
|
1790
|
+
...n,
|
|
1791
|
+
vector: a[o]
|
|
1792
|
+
}));
|
|
1793
|
+
}
|
|
1794
|
+
async function ln(e) {
|
|
1795
|
+
const { generateEmbeddings: t } = await Promise.resolve().then(() => on);
|
|
1796
|
+
return await t(e);
|
|
1797
|
+
}
|
|
1798
|
+
function dn() {
|
|
1799
|
+
return S().flatMap(
|
|
1800
|
+
(e) => rn(e).map(({ field: t, text: a }) => ({
|
|
1801
|
+
capabilityId: e.id,
|
|
1802
|
+
field: t,
|
|
1803
|
+
text: a
|
|
1804
|
+
}))
|
|
1805
|
+
);
|
|
1806
|
+
}
|
|
1807
|
+
const ge = 1.2, he = 0.75, pn = 60, mn = 0.65, V = {
|
|
1808
|
+
description: 1,
|
|
1809
|
+
hint: 2,
|
|
1810
|
+
title: 3
|
|
1811
|
+
};
|
|
1812
|
+
let W;
|
|
1813
|
+
function gn() {
|
|
1814
|
+
W = void 0;
|
|
1815
|
+
}
|
|
1816
|
+
async function hn(e, t = {}) {
|
|
1817
|
+
const a = vn($e(e));
|
|
1818
|
+
let n = [], o = !1, r;
|
|
1819
|
+
if (e.trim()) {
|
|
1820
|
+
const i = t.loadEmbeddings, c = cn();
|
|
1821
|
+
if (!i && !c)
|
|
1822
|
+
o = !0, r = "Capability embeddings are still loading.";
|
|
1823
|
+
else
|
|
1824
|
+
try {
|
|
1825
|
+
if (i) {
|
|
1826
|
+
const [u, d] = await Promise.all([
|
|
1827
|
+
(t.embedQuery ?? ye)(e),
|
|
1828
|
+
i()
|
|
1829
|
+
]);
|
|
1830
|
+
n = fe(u, d);
|
|
1831
|
+
} else if (c) {
|
|
1832
|
+
const u = await (t.embedQuery ?? ye)(e);
|
|
1833
|
+
n = fe(u, c);
|
|
1834
|
+
}
|
|
1835
|
+
} catch {
|
|
1836
|
+
o = !0, r = "Semantic search is unavailable.";
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
return {
|
|
1840
|
+
degraded: o,
|
|
1841
|
+
...r ? { degradedReason: r } : {},
|
|
1842
|
+
// RRF combines ranks rather than raw scores because BM25 and cosine
|
|
1843
|
+
// similarity are on different scales.
|
|
1844
|
+
matches: In(a, n, t.topN ?? 5)
|
|
1845
|
+
};
|
|
1846
|
+
}
|
|
1847
|
+
function fn() {
|
|
1848
|
+
return W ??= yn(S()), W;
|
|
1849
|
+
}
|
|
1850
|
+
function yn(e) {
|
|
1851
|
+
const t = /* @__PURE__ */ new Map(), a = e.map((n) => {
|
|
1852
|
+
const o = /* @__PURE__ */ new Map();
|
|
1853
|
+
B(o, n.title, V.title), B(o, n.description, V.description);
|
|
1854
|
+
for (const r of n.hints)
|
|
1855
|
+
B(o, r, V.hint);
|
|
1856
|
+
for (const r of o.keys())
|
|
1857
|
+
t.set(r, (t.get(r) ?? 0) + 1);
|
|
1858
|
+
return {
|
|
1859
|
+
capability: n,
|
|
1860
|
+
length: wn(o),
|
|
1861
|
+
termFrequencies: o
|
|
1862
|
+
};
|
|
1863
|
+
});
|
|
1864
|
+
return {
|
|
1865
|
+
averageDocumentLength: a.length ? a.reduce((n, o) => n + o.length, 0) / a.length : 0,
|
|
1866
|
+
documentFrequency: t,
|
|
1867
|
+
documents: a
|
|
1868
|
+
};
|
|
1869
|
+
}
|
|
1870
|
+
function B(e, t, a) {
|
|
1871
|
+
for (const n of $e(t))
|
|
1872
|
+
e.set(n, (e.get(n) ?? 0) + a);
|
|
1873
|
+
}
|
|
1874
|
+
function wn(e) {
|
|
1875
|
+
return [...e.values()].reduce((t, a) => t + a, 0);
|
|
1876
|
+
}
|
|
1877
|
+
function $e(e) {
|
|
1878
|
+
return e.toLowerCase().split(/[^a-z0-9]+/u).filter(Boolean);
|
|
1879
|
+
}
|
|
1880
|
+
function vn(e) {
|
|
1881
|
+
const t = fn(), a = new Set(e), n = t.documents.length;
|
|
1882
|
+
return t.documents.map(({ capability: o, length: r, termFrequencies: i }) => {
|
|
1883
|
+
let c = 0;
|
|
1884
|
+
for (const u of a) {
|
|
1885
|
+
const d = i.get(u), l = t.documentFrequency.get(u);
|
|
1886
|
+
if (!d || !l)
|
|
1887
|
+
continue;
|
|
1888
|
+
const p = Math.log(1 + (n - l + 0.5) / (l + 0.5)), m = ge * (1 - he + he * (r / t.averageDocumentLength));
|
|
1889
|
+
c += p * (d * (ge + 1) / (d + m));
|
|
1890
|
+
}
|
|
1891
|
+
return { capability: o, score: c };
|
|
1892
|
+
}).filter(({ score: o }) => o > 0).sort(De);
|
|
1893
|
+
}
|
|
1894
|
+
function fe(e, t) {
|
|
1895
|
+
const a = /* @__PURE__ */ new Map();
|
|
1896
|
+
for (const o of t) {
|
|
1897
|
+
const r = bn(e, o.vector);
|
|
1898
|
+
if (r === void 0)
|
|
1899
|
+
continue;
|
|
1900
|
+
const i = a.get(o.capabilityId);
|
|
1901
|
+
(i === void 0 || r > i) && a.set(o.capabilityId, r);
|
|
1902
|
+
}
|
|
1903
|
+
const n = new Map(S().map((o) => [o.id, o]));
|
|
1904
|
+
return [...a.entries()].flatMap(([o, r]) => {
|
|
1905
|
+
const i = n.get(o);
|
|
1906
|
+
return i && r >= mn ? [{ capability: i, score: r }] : [];
|
|
1907
|
+
}).sort(De);
|
|
1908
|
+
}
|
|
1909
|
+
function bn(e, t) {
|
|
1910
|
+
if (e.length === 0 || e.length !== t.length)
|
|
1911
|
+
return;
|
|
1912
|
+
let a = 0, n = 0, o = 0;
|
|
1913
|
+
for (let i = 0; i < e.length; i += 1)
|
|
1914
|
+
a += e[i] * t[i], n += e[i] ** 2, o += t[i] ** 2;
|
|
1915
|
+
const r = Math.sqrt(n) * Math.sqrt(o);
|
|
1916
|
+
return r === 0 ? void 0 : a / r;
|
|
1917
|
+
}
|
|
1918
|
+
async function ye(e) {
|
|
1919
|
+
const [t] = await ze([e]);
|
|
1920
|
+
if (!t)
|
|
1921
|
+
throw new Error("Expected one query embedding.");
|
|
1922
|
+
return t;
|
|
1923
|
+
}
|
|
1924
|
+
function In(e, t, a) {
|
|
1925
|
+
const n = /* @__PURE__ */ new Map();
|
|
1926
|
+
return we(n, e, "keyword"), we(n, t, "semantic"), [...n.values()].sort((o, r) => r.score !== o.score ? r.score - o.score : (r.semanticScore ?? 0) !== (o.semanticScore ?? 0) ? (r.semanticScore ?? 0) - (o.semanticScore ?? 0) : (r.keywordScore ?? 0) !== (o.keywordScore ?? 0) ? (r.keywordScore ?? 0) - (o.keywordScore ?? 0) : o.capability.id.localeCompare(r.capability.id)).slice(0, Math.max(0, a));
|
|
1927
|
+
}
|
|
1928
|
+
function we(e, t, a) {
|
|
1929
|
+
for (const [n, { capability: o, score: r }] of t.entries()) {
|
|
1930
|
+
const i = n + 1, c = e.get(o.id) ?? { capability: o, score: 0 };
|
|
1931
|
+
c.score += 1 / (pn + i), a === "keyword" ? (c.keywordRank = i, c.keywordScore = r) : (c.semanticRank = i, c.semanticScore = r), e.set(o.id, c);
|
|
1932
|
+
}
|
|
1933
|
+
}
|
|
1934
|
+
function De(e, t) {
|
|
1935
|
+
return t.score - e.score || e.capability.id.localeCompare(t.capability.id);
|
|
1936
|
+
}
|
|
1937
|
+
const Sn = async (e, t) => {
|
|
1938
|
+
await g({ text: "Finding a place to navigate...", agentName: "navigation" }, t);
|
|
1939
|
+
const a = I(e.agentExecutionContext.messages).trim();
|
|
1940
|
+
try {
|
|
1941
|
+
const n = await hn(a, { topN: 5 });
|
|
1942
|
+
return console.table(
|
|
1943
|
+
n.matches.map(({ capability: o, keywordRank: r, keywordScore: i, semanticRank: c, semanticScore: u, score: d }) => ({
|
|
1944
|
+
capability: o.title,
|
|
1945
|
+
fusedScore: d,
|
|
1946
|
+
keywordRank: r,
|
|
1947
|
+
keywordScore: i,
|
|
1948
|
+
semanticRank: c,
|
|
1949
|
+
semanticScore: u
|
|
1950
|
+
}))
|
|
1951
|
+
), n.degradedReason && console.info("[arcgis-portal-ai-assistant] navigation semantic search:", n.degradedReason), {
|
|
1952
|
+
chosenCapabilityIds: [],
|
|
1953
|
+
retrievalDegraded: n.degradedReason ?? "",
|
|
1954
|
+
targets: xn(a, n.matches)
|
|
1955
|
+
};
|
|
1956
|
+
} catch {
|
|
1957
|
+
return {
|
|
1958
|
+
chosenCapabilityIds: [],
|
|
1959
|
+
outputMessage: "I couldn't look up a Portal page right now. Please try again.",
|
|
1960
|
+
status: "failed",
|
|
1961
|
+
targets: []
|
|
1962
|
+
};
|
|
1963
|
+
}
|
|
1964
|
+
};
|
|
1965
|
+
function xn(e, t) {
|
|
1966
|
+
const a = R(e), n = t.filter(
|
|
1967
|
+
({ capability: r }) => [r.title, ...r.hints].some(
|
|
1968
|
+
(i) => R(i) === a
|
|
1969
|
+
)
|
|
1970
|
+
);
|
|
1971
|
+
if (n.length !== 1)
|
|
1972
|
+
return t;
|
|
1973
|
+
const [o] = n;
|
|
1974
|
+
return [o, ...t.filter((r) => r !== o)];
|
|
1975
|
+
}
|
|
1976
|
+
const K = (e, t) => t ?? e, Re = h.Root({
|
|
1977
|
+
...P(),
|
|
1978
|
+
chosenCapabilityIds: h({ reducer: K, default: () => [] }),
|
|
1979
|
+
// Empty when hybrid keyword-and-semantic retrieval succeeds; otherwise
|
|
1980
|
+
// contains the semantic-search failure reason for response diagnostics.
|
|
1981
|
+
retrievalDegraded: h({ reducer: K, default: () => "" }),
|
|
1982
|
+
targets: h({ reducer: K, default: () => [] })
|
|
1983
|
+
}), Tn = () => new N(Re).addNode("retrieveNavigationTargets", Sn).addNode("chooseNavigationTargets", Va).addNode("respondWithNavigation", nn).addEdge(G, "retrieveNavigationTargets").addEdge("retrieveNavigationTargets", "chooseNavigationTargets").addEdge("chooseNavigationTargets", "respondWithNavigation").addEdge("respondWithNavigation", w);
|
|
1984
|
+
function Mn() {
|
|
1985
|
+
const e = S().map(({ hints: t, title: a }) => t[0] ?? a).join(", ");
|
|
1986
|
+
return String.raw`- **portal-navigation** - Portal page navigation assistant:
|
|
1987
|
+
- routes requests to open, show, or navigate to a Portal page, including creation-flow pages
|
|
1988
|
+
- falls back to the closest Portal page where a workflow starts when another agent cannot perform the action
|
|
1989
|
+
- handles short navigation follow-ups after asking the user to open a page
|
|
1990
|
+
- capability examples: ${e}
|
|
1991
|
+
- do not use for general "how do I" questions unless the user explicitly asks to reach a page
|
|
1992
|
+
`;
|
|
1993
|
+
}
|
|
1994
|
+
const Cn = {
|
|
1995
|
+
id: "navigation",
|
|
1996
|
+
name: "Portal Navigation",
|
|
1997
|
+
get description() {
|
|
1998
|
+
return Mn();
|
|
1999
|
+
},
|
|
2000
|
+
createGraph: Tn,
|
|
2001
|
+
workspace: Re
|
|
2002
|
+
}, An = Le`:host{height:100%;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);display:block;width:100%;--tw-shadow: 0 1px 6px -1px rgba(0, 0, 0, .16), 0 1px 2px -1px rgba(0, 0, 0, .08);--tw-shadow-colored: 0 1px 6px -1px var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.chat-entry{display:flex;flex-direction:column;gap:.75rem;width:100%}.chat-actions{display:flex;justify-content:flex-end;gap:.5rem}.header-actions{display:flex;gap:.5rem;padding-inline-start:.75rem}.navigation-block{display:flex;flex-direction:column;align-items:stretch;gap:.35rem;margin-top:.5rem}.navigation-button{width:100%;margin-block:.25rem}.navigation-block-description{font-size:.75rem;color:var(--calcite-color-text-3)}`;
|
|
2003
|
+
function Nn(e, t) {
|
|
2004
|
+
if (!t)
|
|
2005
|
+
return;
|
|
2006
|
+
const { destinationType: a } = e;
|
|
2007
|
+
switch (a) {
|
|
2008
|
+
case "portal-content":
|
|
2009
|
+
return t[a]?.(e.hash, e.queryParams);
|
|
2010
|
+
case "portal-groups":
|
|
2011
|
+
return t[a]?.(e.hash);
|
|
2012
|
+
case "portal-org":
|
|
2013
|
+
return t[a]?.(e.hash, e.queryParams);
|
|
2014
|
+
case "portal-gallery":
|
|
2015
|
+
return t[a];
|
|
2016
|
+
case "portal-map-viewer":
|
|
2017
|
+
case "portal-notebooks":
|
|
2018
|
+
case "portal-scene-viewer":
|
|
2019
|
+
return t[a];
|
|
2020
|
+
case "portal-item":
|
|
2021
|
+
return t[a]?.(e.itemId);
|
|
2022
|
+
case "portal-group":
|
|
2023
|
+
return t[a]?.(e.groupId);
|
|
2024
|
+
default:
|
|
2025
|
+
return U(a);
|
|
2026
|
+
}
|
|
2027
|
+
}
|
|
2028
|
+
function Gn(e) {
|
|
2029
|
+
const t = Ct.safeParse(e);
|
|
2030
|
+
return t.success ? t.data : void 0;
|
|
2031
|
+
}
|
|
2032
|
+
function Pn(e, t) {
|
|
2033
|
+
const a = t.navigation;
|
|
2034
|
+
switch (e.destinationType) {
|
|
2035
|
+
case "portal-content":
|
|
2036
|
+
switch (e.hash) {
|
|
2037
|
+
case "favorites":
|
|
2038
|
+
return a.openContentFavorites;
|
|
2039
|
+
case "group":
|
|
2040
|
+
return a.openContentGroup;
|
|
2041
|
+
case "living-atlas":
|
|
2042
|
+
return a.openContentLivingAtlas;
|
|
2043
|
+
case "org":
|
|
2044
|
+
return a.openContentOrganization;
|
|
2045
|
+
default:
|
|
2046
|
+
return a.openContent;
|
|
2047
|
+
}
|
|
2048
|
+
case "portal-gallery":
|
|
2049
|
+
return a.openGallery;
|
|
2050
|
+
case "portal-groups":
|
|
2051
|
+
switch (e.hash) {
|
|
2052
|
+
case "featured":
|
|
2053
|
+
return a.openGroupsFeatured;
|
|
2054
|
+
case "my":
|
|
2055
|
+
return a.openGroupsMy;
|
|
2056
|
+
case "organization":
|
|
2057
|
+
return a.openGroupsOrganization;
|
|
2058
|
+
default:
|
|
2059
|
+
return a.openGroups;
|
|
2060
|
+
}
|
|
2061
|
+
case "portal-map-viewer":
|
|
2062
|
+
return a.openMapViewer;
|
|
2063
|
+
case "portal-notebooks":
|
|
2064
|
+
return a.openNotebooks;
|
|
2065
|
+
case "portal-scene-viewer":
|
|
2066
|
+
return a.openSceneViewer;
|
|
2067
|
+
case "portal-org":
|
|
2068
|
+
return a.openOrgSettings;
|
|
2069
|
+
case "portal-item":
|
|
2070
|
+
return a.openItem;
|
|
2071
|
+
case "portal-group":
|
|
2072
|
+
return a.openGroup;
|
|
2073
|
+
default:
|
|
2074
|
+
return U(e);
|
|
2075
|
+
}
|
|
2076
|
+
}
|
|
2077
|
+
class qn extends Fe {
|
|
760
2078
|
constructor() {
|
|
761
|
-
super(
|
|
762
|
-
const
|
|
763
|
-
if (!
|
|
2079
|
+
super(), this.t9n = Ve({ blocking: !0 }), this.assistantEl = E(), this.formEl = E(), this.voiceInputEl = E(), this.inputEl = E(), this.navigationSlotElements = /* @__PURE__ */ new Map(), this.handleSlottableRequest = (t) => {
|
|
2080
|
+
const a = t.detail, n = a.data?.block;
|
|
2081
|
+
if (!n)
|
|
764
2082
|
return;
|
|
765
|
-
const
|
|
766
|
-
|
|
767
|
-
}, this.inputText = "", this.showVoiceInput = !0, this.isListening = !1, this.isVoiceInputDisabled = !1, this.interrupt = null, this.autoDestroyDisabled = !1, this.defaultClosed = !1, this.arcgisPortalNavigationRequest =
|
|
2083
|
+
const o = this.getNavigationAction(n);
|
|
2084
|
+
o && this.upsertNavigationSlotElement(a.slotName, o);
|
|
2085
|
+
}, this.inputText = "", this.showVoiceInput = !0, this.isListening = !1, this.isVoiceInputDisabled = !1, this.interrupt = null, this.autoDestroyDisabled = !1, this.defaultClosed = !1, this.useProdDocAssistant = !1, this.arcgisPortalNavigationRequest = Oe(), S();
|
|
768
2086
|
}
|
|
769
2087
|
static {
|
|
770
|
-
this.properties = { inputText: 16, showVoiceInput: 16, isListening: 16, isVoiceInputDisabled: 16, interrupt: 16, autoDestroyDisabled: 5, portal: 0, user: 0, config: 0, defaultClosed: 5 };
|
|
2088
|
+
this.properties = { inputText: 16, showVoiceInput: 16, isListening: 16, isVoiceInputDisabled: 16, interrupt: 16, autoDestroyDisabled: 5, portal: 0, user: 0, config: 0, navigationTargetMap: 0, disabledAgents: 0, defaultClosed: 5, navigationCapabilities: 0, useProdDocAssistant: 5 };
|
|
771
2089
|
}
|
|
772
2090
|
static {
|
|
773
|
-
this.styles =
|
|
2091
|
+
this.styles = An;
|
|
2092
|
+
}
|
|
2093
|
+
async load() {
|
|
2094
|
+
await this.refreshCapabilityEmbeddings();
|
|
2095
|
+
}
|
|
2096
|
+
willUpdate(t) {
|
|
2097
|
+
!this.hasUpdated || !t.has("navigationCapabilities") || this.refreshCapabilityEmbeddings();
|
|
2098
|
+
}
|
|
2099
|
+
async clearEmbeddingsCache() {
|
|
2100
|
+
me();
|
|
2101
|
+
}
|
|
2102
|
+
isAgentEnabled(t) {
|
|
2103
|
+
return !this.disabledAgents?.[t];
|
|
2104
|
+
}
|
|
2105
|
+
async refreshCapabilityEmbeddings() {
|
|
2106
|
+
try {
|
|
2107
|
+
S(this.navigationCapabilities), gn(), me(), await sn();
|
|
2108
|
+
} catch (t) {
|
|
2109
|
+
console.warn("[arcgis-portal-ai-assistant] embeddings warm-up failed:", t);
|
|
2110
|
+
}
|
|
774
2111
|
}
|
|
775
2112
|
getNavigationAction(t) {
|
|
776
|
-
if (t?.type !==
|
|
2113
|
+
if (t?.type !== Se)
|
|
777
2114
|
return;
|
|
778
|
-
const
|
|
779
|
-
if (!
|
|
2115
|
+
const a = t.data, n = Gn(a);
|
|
2116
|
+
if (!n)
|
|
780
2117
|
return;
|
|
781
|
-
const
|
|
782
|
-
if (
|
|
783
|
-
return {
|
|
2118
|
+
const o = Nn(a, this.navigationTargetMap);
|
|
2119
|
+
if (o)
|
|
2120
|
+
return {
|
|
2121
|
+
href: o,
|
|
2122
|
+
targetDetail: a,
|
|
2123
|
+
label: a?.buttonLabel || Pn(n, this.t9n)
|
|
2124
|
+
};
|
|
784
2125
|
}
|
|
785
|
-
upsertNavigationSlotElement(t,
|
|
786
|
-
const
|
|
787
|
-
if (!
|
|
2126
|
+
upsertNavigationSlotElement(t, a) {
|
|
2127
|
+
const n = this.assistantEl.value;
|
|
2128
|
+
if (!n)
|
|
788
2129
|
return;
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
2130
|
+
const o = `navigation:${t}`;
|
|
2131
|
+
let r = this.navigationSlotElements.get(o);
|
|
2132
|
+
r || (r = document.createElement("div"), r.slot = t, this.navigationSlotElements.set(o, r), n.append(r)), je(v`<div><calcite-button class="navigation-button" appearance=outline width=full .href=${a.href} icon-end=launch @click=${(i) => {
|
|
2133
|
+
i.preventDefault(), this.arcgisPortalNavigationRequest.emit({
|
|
2134
|
+
href: a.href,
|
|
2135
|
+
targetDetail: a.targetDetail
|
|
794
2136
|
});
|
|
795
|
-
}}>${
|
|
796
|
-
}
|
|
797
|
-
getNavigationText(t) {
|
|
798
|
-
const e = this.t9n.navigation;
|
|
799
|
-
switch (t) {
|
|
800
|
-
case "portal-content":
|
|
801
|
-
return e.openContent;
|
|
802
|
-
case "portal-groups":
|
|
803
|
-
return e.openGroups;
|
|
804
|
-
case "portal-item":
|
|
805
|
-
return e.openItem;
|
|
806
|
-
case "portal-group":
|
|
807
|
-
return e.openGroup;
|
|
808
|
-
default:
|
|
809
|
-
return P(t);
|
|
810
|
-
}
|
|
2137
|
+
}}>${a.label}</calcite-button>${a.description ? v`<div class="navigation-block-description">${a.description}</div>` : null}</div>`, r);
|
|
811
2138
|
}
|
|
812
2139
|
render() {
|
|
813
|
-
const { t9n: t, inputText:
|
|
814
|
-
return
|
|
815
|
-
this.interrupt =
|
|
2140
|
+
const { t9n: t, inputText: a, portal: n, user: o, navigationTargetMap: r, showVoiceInput: i, isListening: c, isVoiceInputDisabled: u, useProdDocAssistant: d } = this;
|
|
2141
|
+
return v`<arcgis-assistant log-enabled keep-suggested-prompts .heading=${t.heading} .entryMessage=${t.entryMessage} @arcgisSlottableRequest=${this.handleSlottableRequest} @arcgisInterrupt=${({ detail: l }) => {
|
|
2142
|
+
this.interrupt = l;
|
|
816
2143
|
}} @arcgisInterruptCancel=${() => {
|
|
817
2144
|
this.interrupt = null;
|
|
818
2145
|
}} @arcgisInterruptSubmit=${() => {
|
|
819
2146
|
this.interrupt = null;
|
|
820
|
-
}} @arcgisPromptSelect=${({ detail:
|
|
821
|
-
this.inputText =
|
|
2147
|
+
}} @arcgisPromptSelect=${({ detail: l }) => {
|
|
2148
|
+
this.inputText = l.prompt, requestAnimationFrame(() => {
|
|
822
2149
|
this.inputEl.value?.focusTextArea();
|
|
823
2150
|
});
|
|
824
|
-
}} ${
|
|
825
|
-
|
|
826
|
-
const
|
|
827
|
-
|
|
828
|
-
}} ${
|
|
829
|
-
|
|
830
|
-
}} @arcgisUserMentionableTextAreaChange=${({ detail:
|
|
831
|
-
this.inputText =
|
|
832
|
-
}} ${
|
|
2151
|
+
}} ${k(this.assistantEl)}><div slot=header-actions-start class="header-actions"><calcite-icon icon=effects></calcite-icon></div><form slot=chat-entry class="chat-entry" @submit=${(l) => {
|
|
2152
|
+
l.preventDefault();
|
|
2153
|
+
const p = a.trim();
|
|
2154
|
+
p && (this.assistantEl.value?.submitMessage(p), this.inputText = "");
|
|
2155
|
+
}} ${k(this.formEl)}><arcgis-portal-mentionable-text-area .portal=${n} .user=${o} rows=3 .popoverListLabel=${t.mentionEntities} .placeholder=${t.placeholder} .value=${a} @arcgisUserMentionableTextAreaKeyDown=${({ detail: l }) => {
|
|
2156
|
+
l.key === "Enter" && !l.shiftKey && (l.preventDefault(), this.formEl.value?.requestSubmit());
|
|
2157
|
+
}} @arcgisUserMentionableTextAreaChange=${({ detail: l }) => {
|
|
2158
|
+
this.inputText = l ?? "";
|
|
2159
|
+
}} ${k(this.inputEl)}></arcgis-portal-mentionable-text-area><div class="chat-actions"><arcgis-portal-voice-input @arcgisVoiceInputStart=${() => {
|
|
833
2160
|
this.isListening = !0, this.isVoiceInputDisabled = !1;
|
|
834
2161
|
}} @arcgisVoiceInputStop=${() => {
|
|
835
2162
|
this.isListening = !1, this.isVoiceInputDisabled = !1;
|
|
836
|
-
}} @arcgisVoiceInputError=${(
|
|
837
|
-
|
|
838
|
-
}} @arcgisVoiceInputInterimTranscription=${(
|
|
839
|
-
this.inputText =
|
|
840
|
-
}} ${
|
|
2163
|
+
}} @arcgisVoiceInputError=${(l) => {
|
|
2164
|
+
l.detail.errorCode === "not-supported" && (this.showVoiceInput = !1);
|
|
2165
|
+
}} @arcgisVoiceInputInterimTranscription=${(l) => {
|
|
2166
|
+
this.inputText = l.detail.text;
|
|
2167
|
+
}} ${k(this.voiceInputEl)}></arcgis-portal-voice-input>${i && v`<calcite-button icon-start=microphone .label=${t.voiceInput} round .disabled=${u} .appearance=${c ? "solid" : "outline-fill"} @click=${async () => {
|
|
841
2168
|
this.isVoiceInputDisabled = !0;
|
|
842
|
-
const
|
|
843
|
-
c ? await
|
|
844
|
-
}}></calcite-button>` || ""}<calcite-button type=submit icon-start=send round .disabled=${!
|
|
845
|
-
this.assistantEl.value?.submitInterrupt(
|
|
2169
|
+
const l = this.voiceInputEl.value;
|
|
2170
|
+
c ? await l?.stopListening() : await l?.startListening();
|
|
2171
|
+
}}></calcite-button>` || ""}<calcite-button type=submit icon-start=send round .disabled=${!a.trim()} .label=${t.send}>${t.send}</calcite-button></div></form>${this.isAgentEnabled("itemAnalytics") && v`<arcgis-assistant-agent .agent=${$a} .context=${{ portal: n, user: o, navigationTargetMap: r }}></arcgis-assistant-agent>` || ""}${this.isAgentEnabled("groupCreation") && v`<arcgis-assistant-agent .agent=${Pt} .context=${{ portal: n, user: o, navigationTargetMap: r }}></arcgis-assistant-agent>` || ""}${this.isAgentEnabled("docAssistant") && v`<arcgis-assistant-agent .agent=${ta} .context=${{ portal: n, user: o, navigationTargetMap: r, useProdDocAssistant: d }}></arcgis-assistant-agent>` || ""}${this.isAgentEnabled("groupAnalytics") && v`<arcgis-assistant-agent .agent=${xa} .context=${{ portal: n, user: o, navigationTargetMap: r }}></arcgis-assistant-agent>` || ""}${this.isAgentEnabled("navigation") && v`<arcgis-assistant-agent .agent=${Cn} .context=${{ portal: n, user: o, navigationTargetMap: r }}></arcgis-assistant-agent>` || ""}${this.interrupt && v`<arcgis-portal-ai-assistant-interrupt slot=interrupt .type=${this.interrupt.type} .message=${this.interrupt.message} .options=${this.interrupt.options} @arcgisSubmit=${({ detail: l }) => {
|
|
2172
|
+
this.assistantEl.value?.submitInterrupt(l);
|
|
846
2173
|
}} @arcgisCancel=${() => {
|
|
847
2174
|
this.assistantEl.value?.cancelInterrupt();
|
|
848
2175
|
}}></arcgis-portal-ai-assistant-interrupt>` || ""}</arcgis-assistant>`;
|
|
849
2176
|
}
|
|
850
2177
|
}
|
|
851
|
-
|
|
2178
|
+
Ue("arcgis-portal-ai-assistant", qn);
|
|
852
2179
|
export {
|
|
853
|
-
|
|
2180
|
+
qn as ArcgisPortalAiAssistant
|
|
854
2181
|
};
|