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