diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa831546385..fb74dd7a9b9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,7 +67,9 @@ jobs: uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version-file: .nvmrc - cache: npm + + - name: Setup pnpm + uses: ./.github/actions/setup-pnpm - name: Install build dependencies (Linux) if: inputs.platform == 'linux' @@ -79,11 +81,11 @@ jobs: env: ELECTRON_SKIP_BINARY_DOWNLOAD: '1' PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' - run: npm ci + run: pnpm install --frozen-lockfile # core-ci 负责编译源码并生成 out-vscode-min 等打包产物 - name: Compile - run: npm run gulp core-ci + run: pnpm run gulp core-ci # ---------------------------------------------------------------- Linux # 非 -ci 任务会编译内置扩展(含 copilot)并打包;-ci 仅打包,不包含 @@ -94,18 +96,18 @@ jobs: set -euo pipefail mkdir -p artifacts - npm run gulp vscode-linux-x64-min + pnpm run gulp vscode-linux-x64-min tar -czf "artifacts/BlockIDE-linux-x64-${VERSION}.tar.gz" \ -C "$(dirname "$GITHUB_WORKSPACE")" VSCode-linux-x64 - npm run gulp vscode-linux-x64-prepare-deb - npm run gulp vscode-linux-x64-build-deb + pnpm run gulp vscode-linux-x64-prepare-deb + pnpm run gulp vscode-linux-x64-build-deb DEB_PATH="$(find .build/linux/deb -name '*.deb' -print -quit)" cp "$DEB_PATH" "artifacts/BlockIDE-linux-x64-${VERSION}.deb" - npm run gulp vscode-linux-x64-prepare-rpm - npm run gulp vscode-linux-x64-build-rpm + pnpm run gulp vscode-linux-x64-prepare-rpm + pnpm run gulp vscode-linux-x64-build-rpm RPM_PATH="$(find .build/linux/rpm -name '*.rpm' -print -quit)" cp "$RPM_PATH" "artifacts/BlockIDE-linux-x64-${VERSION}.rpm" @@ -115,7 +117,7 @@ jobs: shell: bash run: | set -euo pipefail - npm run gulp vscode-linux-${VSCODE_ARCH}-prepare-snap + pnpm run gulp vscode-linux-${VSCODE_ARCH}-prepare-snap SNAP_DIR="$(find ".build/linux/snap/${VSCODE_ARCH}" -maxdepth 1 -mindepth 1 -type d -name 'blockide-*' -print -quit)" tar -czf snap-src.tar.gz -C "$(dirname "$SNAP_DIR")" "$(basename "$SNAP_DIR")" @@ -147,10 +149,10 @@ jobs: run: | $ErrorActionPreference = 'Stop' # $ErrorActionPreference 只对 cmdlet 生效,原生进程的非零退出码不会中断脚本, - # 因此每个 npm 调用都要显式检查 $LASTEXITCODE。 - npm run gulp vscode-win32-x64-min + # 因此每个 pnpm 调用都要显式检查 $LASTEXITCODE。 + pnpm run gulp vscode-win32-x64-min if ($LASTEXITCODE -ne 0) { throw "gulp vscode-win32-x64-min failed with exit code $LASTEXITCODE" } - npm run gulp vscode-win32-x64-inno-updater + pnpm run gulp vscode-win32-x64-inno-updater if ($LASTEXITCODE -ne 0) { throw "gulp vscode-win32-x64-inno-updater failed with exit code $LASTEXITCODE" } # 私钥来自 secrets.SIGNATURE_KEYS,证书来自 vars.SIGNATURE_CRT,合成 PFX 后 @@ -196,10 +198,10 @@ jobs: $ErrorActionPreference = 'Stop' New-Item -ItemType Directory -Path artifacts -Force | Out-Null - # $ErrorActionPreference 只对 cmdlet 生效;npm/gulp 这类原生进程失败时脚本会继续往下跑, + # $ErrorActionPreference 只对 cmdlet 生效;pnpm/gulp 这类原生进程失败时脚本会继续往下跑, # v1.0.2 的 MSIX 就是这样在失败后被静默跳过、只发布了 3 个安装包的。 function Invoke-Gulp([string]$name) { - npm run gulp $name + pnpm run gulp $name if ($LASTEXITCODE -ne 0) { throw "gulp $name failed with exit code $LASTEXITCODE" } } @@ -254,7 +256,7 @@ jobs: if: inputs.platform == 'darwin' run: | set -euo pipefail - npm run gulp vscode-darwin-arm64-min + pnpm run gulp vscode-darwin-arm64-min # 临时钥匙串路径必须是 $AGENT_TEMPDIRECTORY/buildagent.keychain,build/darwin/sign.ts 依赖它 - name: Prepare signing certificate (macOS) @@ -549,17 +551,19 @@ jobs: with: fetch-depth: 1 # build/npm/dirs.ts 里包含子模块 extensions/minecraft-workbench, - # node_modules 缓存键要读它的 package-lock.json + # node_modules 缓存键要读它的 pnpm-lock.yaml submodules: recursive - name: Setup Node.js uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version-file: .nvmrc - cache: npm + + - name: Setup pnpm + uses: ./.github/actions/setup-pnpm # 本 job 只需要运行 gulp 打包任务,不需要编译产物(out/),也不该重付一次 - # 约 11 分钟的 npm ci。先复用仓库已有的 node_modules 缓存(PR / main 的 + # 约 11 分钟的 pnpm install。先复用仓库已有的 node_modules 缓存(PR / main 的 # pr-node-modules 会预热),命中时直接解包;未命中才安装并把结果存回缓存。 - name: Restore node_modules cache id: node-modules-cache @@ -573,7 +577,7 @@ jobs: env: ELECTRON_SKIP_BINARY_DOWNLOAD: '1' PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' - run: npm ci + run: pnpm install --frozen-lockfile - name: Save node_modules cache if: steps.node-modules-cache.outputs.cache-hit != 'true' @@ -628,10 +632,10 @@ jobs: $arch = $env:VSCODE_ARCH $version = $env:VERSION - # $ErrorActionPreference 只对 cmdlet 生效;npm/gulp 这类原生进程失败时脚本会继续往下跑, + # $ErrorActionPreference 只对 cmdlet 生效;pnpm/gulp 这类原生进程失败时脚本会继续往下跑, # v1.0.2 的 MSIX 就是这样在失败后被静默跳过、只发布了 3 个安装包的。 function Invoke-Gulp([string]$name) { - npm run gulp $name + pnpm run gulp $name if ($LASTEXITCODE -ne 0) { throw "gulp $name failed with exit code $LASTEXITCODE" } } diff --git a/build/gulpfile.vscode.win32.ts b/build/gulpfile.vscode.win32.ts index 1885b0f9b3e..611b082f438 100644 --- a/build/gulpfile.vscode.win32.ts +++ b/build/gulpfile.vscode.win32.ts @@ -166,6 +166,15 @@ task.task(task.define('vscode-win32-x64-inno-updater', task.series(copyInnoUpdat task.task(task.define('vscode-win32-arm64-inno-updater', task.series(copyInnoUpdater('arm64'), updateIcon(path.join(buildPath('arm64'), 'tools', 'inno_updater.exe'))))); const managedPackageDir = (arch: string, kind: 'msi' | 'msix') => path.join(repoPath, '.build', `win32-${arch}`, kind); + +/** + * WiX 3 links every staged file through the classic Win32 APIs, which stop at MAX_PATH. The + * payload mirrors the whole client, and a pnpm-installed node_modules nests deeply enough that + * `/.build/win32-//payload/...` exceeds 260 characters, where light.exe then + * fails with LGHT0103 for a file that exists. Stage next to the repository instead: the shorter + * prefix keeps every file under the limit. + */ +const managedPayloadDir = (arch: string, kind: 'msi' | 'msix') => path.join(path.dirname(repoPath), `bld-${arch}-${kind}`); const iconPath = path.join(repoPath, 'resources', 'win32', 'code.ico'); const aboutUrl = 'https://github.com/zitzhen/BlockIDE'; @@ -258,7 +267,7 @@ function buildWin32Msi(arch: string): task.CallbackTask { } const outputPath = managedPackageDir(arch, 'msi'); - const payloadPath = path.join(outputPath, 'payload'); + const payloadPath = managedPayloadDir(arch, 'msi'); fs.mkdirSync(outputPath, { recursive: true }); prepareManagedPayload(sourcePath, payloadPath, getVersionedResourcesFolder()); @@ -324,7 +333,7 @@ function buildWin32Msix(arch: string): task.CallbackTask { } const outputPath = managedPackageDir(arch, 'msix'); - const payloadPath = path.join(outputPath, 'payload'); + const payloadPath = managedPayloadDir(arch, 'msix'); fs.mkdirSync(outputPath, { recursive: true }); prepareManagedPayload(sourcePath, payloadPath, getVersionedResourcesFolder()); diff --git a/extensions/minecraft-workbench b/extensions/minecraft-workbench index 63335c58cb4..373f89c1c9b 160000 --- a/extensions/minecraft-workbench +++ b/extensions/minecraft-workbench @@ -1 +1 @@ -Subproject commit 63335c58cb4236cd4a3276971aa38c2af2dcf853 +Subproject commit 373f89c1c9b42df81e7c7dd958227a3c2ffa2515 diff --git a/extensions/pnpm-lock.yaml b/extensions/pnpm-lock.yaml index a0809bac3cf..8227fe225bd 100644 --- a/extensions/pnpm-lock.yaml +++ b/extensions/pnpm-lock.yaml @@ -5,6 +5,7 @@ settings: excludeLinksFromLockfile: false overrides: + '@xmcl/yauzl': 2.10.0 serialize-javascript: ^7.0.3 vscode-css-languageservice>vscode-languageserver-types: 3.18.3 lodash-es: 4.18.1 @@ -55,41 +56,6 @@ importers: specifier: ^10.8.2 version: 10.8.2 - css-language-features: - dependencies: - vscode-languageclient: - specifier: ^10.1.1 - version: 10.1.1 - vscode-uri: - specifier: ^3.2.0 - version: 3.2.0 - devDependencies: - '@types/node': - specifier: 24.x - version: 24.12.4 - - css-language-features/server: - dependencies: - '@vscode/l10n': - specifier: ^0.0.18 - version: 0.0.18 - vscode-css-languageservice: - specifier: ^7.0.0-next.2 - version: 7.0.0-next.2 - vscode-languageserver: - specifier: ^10.1.1 - version: 10.1.1 - vscode-uri: - specifier: ^3.2.0 - version: 3.2.0 - devDependencies: - '@types/node': - specifier: 24.x - version: 24.12.4 - glob: - specifier: ^5.0.13 - version: 5.0.15 - debug-auto-launch: devDependencies: '@types/node': @@ -433,8 +399,8 @@ importers: specifier: ^0.9.8 version: 0.9.8(tslib@2.8.1) '@vscode/markdown-editor': - specifier: 0.0.2-153 - version: 0.0.2-153 + specifier: 0.0.2-181 + version: 0.0.2-181 '@vscode/observables': specifier: ^0.1.1-0 version: 0.1.1-0 @@ -646,6 +612,67 @@ importers: specifier: ^2.6.3 version: 2.8.1 + minecraft-workbench: + dependencies: + '@modelcontextprotocol/sdk': + specifier: ^1.32.2 + version: 1.32.2(zod@4.6.7) + '@xmcl/core': + specifier: 2.16.2 + version: 2.16.2 + '@xmcl/installer': + specifier: 6.3.6 + version: 6.3.6 + adm-zip: + specifier: 0.6.1 + version: 0.6.1 + semver: + specifier: ^7.8.5 + version: 7.8.5 + socks: + specifier: ^2.8.7 + version: 2.8.10 + tar: + specifier: ^7.5.0 + version: 7.5.22 + undici: + specifier: ^7.29.0 + version: 7.29.1 + zod: + specifier: ^4.6.7 + version: 4.6.7 + devDependencies: + '@types/adm-zip': + specifier: ^0.5.7 + version: 0.5.8 + '@types/node': + specifier: ^22.14.0 + version: 22.20.5 + '@types/semver': + specifier: ^7.8.0 + version: 7.8.0 + '@types/vscode': + specifier: 1.96.0 + version: 1.96.0 + '@vscode/test-electron': + specifier: ^2.5.2 + version: 2.5.2 + '@vscode/vsce': + specifier: ^3.6.0 + version: 3.9.2 + esbuild: + specifier: ^0.25.0 + version: 0.25.12 + prettier: + specifier: 3.6.2 + version: 3.6.2 + tsx: + specifier: ^4.19.0 + version: 4.23.15 + typescript: + specifier: ^5.8.0 + version: 5.9.3 + notebook-renderers: devDependencies: '@types/jsdom': @@ -667,80 +694,6 @@ importers: specifier: ^10.8.2 version: 10.8.2 - npm: - dependencies: - find-up: - specifier: ^5.0.0 - version: 5.0.0 - find-yarn-workspace-root: - specifier: ^2.0.0 - version: 2.0.0 - jsonc-parser: - specifier: ^3.2.0 - version: 3.2.0 - minimatch: - specifier: ^5.1.8 - version: 5.1.8 - request-light: - specifier: ^0.7.0 - version: 0.7.0 - vscode-uri: - specifier: ^3.0.8 - version: 3.0.8 - which: - specifier: ^4.0.0 - version: 4.0.0 - which-pm: - specifier: ^2.1.1 - version: 2.2.0 - devDependencies: - '@types/minimatch': - specifier: ^5.1.2 - version: 5.1.2 - '@types/mocha': - specifier: ^10.0.10 - version: 10.0.10 - '@types/node': - specifier: 24.x - version: 24.12.4 - '@types/sinon': - specifier: ^10.0.2 - version: 10.0.2 - '@types/which': - specifier: ^3.0.0 - version: 3.0.0 - mocha: - specifier: ^10.8.2 - version: 10.8.2 - sinon: - specifier: ^12.0.1 - version: 12.0.1 - - php-language-features: - dependencies: - which: - specifier: ^2.0.2 - version: 2.0.2 - devDependencies: - '@types/mocha': - specifier: ^10.0.10 - version: 10.0.10 - '@types/node': - specifier: 24.x - version: 24.12.4 - '@types/sinon': - specifier: ^10.0.2 - version: 10.0.2 - '@types/which': - specifier: ^2.0.0 - version: 2.0.0 - mocha: - specifier: ^10.8.2 - version: 10.8.2 - sinon: - specifier: ^12.0.1 - version: 12.0.1 - references-view: devDependencies: '@types/node': @@ -908,14 +861,64 @@ packages: '@asamuzakjp/nwsapi@2.3.9': resolution: {integrity: sha512-n8GuYSrI9bF7FFZ/SjhwevlHc8xaVlb/7HmHelnc/PZXBD2ZR49NnN9sMMuDdEGPeeRQ5d0hqlSlEpgCX3Wl0Q==} + '@azu/format-text@1.0.2': + resolution: {integrity: sha512-Swi4N7Edy1Eqq82GxgEECXSSLyn6GOb5htRFPzBDdUkECGXtlf12ynO5oJSpWKPwCaUssOu7NfhDcCWpIC6Ywg==} + + '@azu/style-format@1.0.1': + resolution: {integrity: sha512-AHcTojlNBdD/3/KxIKlg8sxIWHfOtQszLvOpagLTO+bjC3u7SAszu1lf//u7JJC50aUSH+BVWDD/KvaA6Gfn5g==} + + '@azure/abort-controller@2.2.0': + resolution: {integrity: sha512-fNAjWnA/nZ2jz31kxR/AqRaUT8ewHBw/WuBIosK0moMy1C9e5ValbDfFdIxJzVOOYaYkV/b2F1S4H/aHiqfVQg==} + engines: {node: '>=22.0.0'} + + '@azure/core-auth@1.11.0': + resolution: {integrity: sha512-IUZydyTUkDnYdstOW9pFOOUQlBjAepK5teihDE3x6yxsPJs/hsAaaYpeGxdxrgtOiJbBKSjKW7MDk7AEhb4LRg==} + engines: {node: '>=22.0.0'} + + '@azure/core-client@1.11.2': + resolution: {integrity: sha512-ajuIU1aMoTs/ERYrKnIqQrV5Vz3RL8mwDC5RdedIXUvR7pi6cWzeYmt0LfNz6+W91CuCO4WJG0zA6+PhU1X+hw==} + engines: {node: '>=22.0.0'} + + '@azure/core-process@1.0.0': + resolution: {integrity: sha512-/shnJ+ooO8WPxDhPEeI/2oRQuubn16gZ6CvlbpWbEswZfzwI9tI/sMAHmF3x1LuQ9yZYXfLW3TjzGMLEC5blKg==} + engines: {node: '>=22.0.0'} + + '@azure/core-rest-pipeline@1.25.0': + resolution: {integrity: sha512-bMs8ekJLjX8wPV+9IPBges1SLPyuDtE9g5gLDWOpxzKcoOFQnpLGkbcT1tdw3FaAmDS1gnPmMmJ6y/T5B96kIA==} + engines: {node: '>=22.0.0'} + + '@azure/core-tracing@1.4.0': + resolution: {integrity: sha512-eGwxD0AtncrxeBM4tG8R55Pc3rdX1hNW2WibJAgYpCVA6E93mvvVH+LcssoVjOBrSKWS55yEIHsk0X8ctHmfOQ==} + engines: {node: '>=22.0.0'} + + '@azure/core-util@1.14.0': + resolution: {integrity: sha512-9n2pWK61veAuN0V20t9lOuoV4CFMdyAZ1ygZzvBGk/pBBJRib/PjL9PLXa/aI2CcPpyHfqVsxxqLCYl6uZlfDw==} + engines: {node: '>=22.0.0'} + + '@azure/identity@4.14.1': + resolution: {integrity: sha512-HHuuFrmN1uuF9D5A6aAo5eHzNFNX4Q+P4SksZqDKse5YaJFFy/zDLG3wXHEV2FVGgetZ3QM8jGURNBtnQYf1NQ==} + engines: {node: '>=22.0.0'} + + '@azure/logger@1.4.0': + resolution: {integrity: sha512-rbAE25KUfjU/s3XHUdJgceoCP5dEOpMx85J04kF+QMdta73XkuG9JGHHinch+XIoKpBdqljin+KqURpJriSzLA==} + engines: {node: '>=22.0.0'} + '@azure/ms-rest-azure-env@2.0.0': resolution: {integrity: sha512-dG76W7ElfLi+fbTjnZVGj+M9e0BIEJmRxU6fHaUQ12bZBe8EJKYb2GV50YWNaP2uJiVQ5+7nXEVj1VN1UQtaEw==} deprecated: This package has been deprecated. new Azure Management SDK package from [Azure SDK for JavaScript](https://github.com/azure/azure-sdk-for-js) now have the cloud settings built-in, [for example](https://github.com/Azure/azure-sdk-for-js/blob/dc5f9743b05ea78f938eba31cbe704150889490c/sdk/sql/arm-sql/src/static-helpers/cloudSettingHelpers.ts). + '@azure/msal-browser@5.29.0': + resolution: {integrity: sha512-Ko/Ovw6h+Gu33mp8f0FUyddr/KDWzbGzcgR8HKZaT4wgTYljLPKJP1rcDu0RHj7pkd4CR2hCHK51XFzgvq/Q5Q==} + engines: {node: '>=0.8.0'} + '@azure/msal-common@16.11.1': resolution: {integrity: sha512-yPohvMwWLv1XnaWnIUyKUh8CvcVChCGqG/VluGwfGmaAfrZTNt5yQ+sIs462Sgw6+e2K83KGmMJ860p73ZSCrw==} engines: {node: '>=0.8.0'} + '@azure/msal-common@16.16.1': + resolution: {integrity: sha512-dSKdL9h/iercb4GumsKFh+wVvLe1ohuDPiviklgnQVHnY2FYNUlbQJ3E1Qd37vkof9CfraK9BQpCW1hoOg0znQ==} + engines: {node: '>=0.8.0'} + '@azure/msal-node-extensions@5.3.2': resolution: {integrity: sha512-cVfVJ55aACkzFe3+ol72W8iEtGVODcSIeBEQM9qFSz0bqbN6B/JyNcbNgFXmuVg8dZCCN3ARkvTyikESMetA+A==} engines: {node: '>=20'} @@ -927,6 +930,18 @@ packages: resolution: {integrity: sha512-6EZEParwHRlnSSIikw8FNAnAzwmh71uhveUXdPNFeZFviJ9SH+rwFiurhjzXqICYTrpm3E+dj693QOwfPbJXAQ==} engines: {node: '>=20'} + '@azure/msal-node@7.2.1': + resolution: {integrity: sha512-6mntsfCNq7H1eAPSZik74jT3C5at4nRqiVk7OC+D5Hy3Pe3s76uwE4+J0xvDvlVPmoX2kasf3mSwUmzeq9rW/A==} + engines: {node: '>=20'} + + '@babel/code-frame@7.29.7': + resolution: {integrity: sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.29.7': + resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} + engines: {node: '>=6.9.0'} + '@borewit/text-codec@0.2.1': resolution: {integrity: sha512-k7vvKPbf7J2fZ5klGRD9AeKfUvojuZIQ3BT5u7Jfv+puwXkUBUT5PVyMDfJZpy30CBDXGMgw7fguK/lpOMBvgw==} @@ -1010,6 +1025,12 @@ packages: '@enonic/fnv-plus@1.3.0': resolution: {integrity: sha512-BCN9uNWH8AmiP7BXBJqEinUY9KXalmRzo+L0cB/mQsmFfzODxwQrbvxCHXUNH2iP+qKkWYtB4vyy8N62PViMFw==} + '@esbuild/aix-ppc64@0.25.12': + resolution: {integrity: sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + '@esbuild/aix-ppc64@0.27.2': resolution: {integrity: sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==} engines: {node: '>=18'} @@ -1022,6 +1043,12 @@ packages: cpu: [ppc64] os: [aix] + '@esbuild/android-arm64@0.25.12': + resolution: {integrity: sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + '@esbuild/android-arm64@0.27.2': resolution: {integrity: sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==} engines: {node: '>=18'} @@ -1034,6 +1061,12 @@ packages: cpu: [arm64] os: [android] + '@esbuild/android-arm@0.25.12': + resolution: {integrity: sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + '@esbuild/android-arm@0.27.2': resolution: {integrity: sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==} engines: {node: '>=18'} @@ -1046,6 +1079,12 @@ packages: cpu: [arm] os: [android] + '@esbuild/android-x64@0.25.12': + resolution: {integrity: sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + '@esbuild/android-x64@0.27.2': resolution: {integrity: sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==} engines: {node: '>=18'} @@ -1058,6 +1097,12 @@ packages: cpu: [x64] os: [android] + '@esbuild/darwin-arm64@0.25.12': + resolution: {integrity: sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + '@esbuild/darwin-arm64@0.27.2': resolution: {integrity: sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==} engines: {node: '>=18'} @@ -1070,6 +1115,12 @@ packages: cpu: [arm64] os: [darwin] + '@esbuild/darwin-x64@0.25.12': + resolution: {integrity: sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + '@esbuild/darwin-x64@0.27.2': resolution: {integrity: sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==} engines: {node: '>=18'} @@ -1082,6 +1133,12 @@ packages: cpu: [x64] os: [darwin] + '@esbuild/freebsd-arm64@0.25.12': + resolution: {integrity: sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + '@esbuild/freebsd-arm64@0.27.2': resolution: {integrity: sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==} engines: {node: '>=18'} @@ -1094,6 +1151,12 @@ packages: cpu: [arm64] os: [freebsd] + '@esbuild/freebsd-x64@0.25.12': + resolution: {integrity: sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + '@esbuild/freebsd-x64@0.27.2': resolution: {integrity: sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==} engines: {node: '>=18'} @@ -1106,6 +1169,12 @@ packages: cpu: [x64] os: [freebsd] + '@esbuild/linux-arm64@0.25.12': + resolution: {integrity: sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + '@esbuild/linux-arm64@0.27.2': resolution: {integrity: sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==} engines: {node: '>=18'} @@ -1118,6 +1187,12 @@ packages: cpu: [arm64] os: [linux] + '@esbuild/linux-arm@0.25.12': + resolution: {integrity: sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + '@esbuild/linux-arm@0.27.2': resolution: {integrity: sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==} engines: {node: '>=18'} @@ -1130,6 +1205,12 @@ packages: cpu: [arm] os: [linux] + '@esbuild/linux-ia32@0.25.12': + resolution: {integrity: sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + '@esbuild/linux-ia32@0.27.2': resolution: {integrity: sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==} engines: {node: '>=18'} @@ -1142,6 +1223,12 @@ packages: cpu: [ia32] os: [linux] + '@esbuild/linux-loong64@0.25.12': + resolution: {integrity: sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + '@esbuild/linux-loong64@0.27.2': resolution: {integrity: sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==} engines: {node: '>=18'} @@ -1154,6 +1241,12 @@ packages: cpu: [loong64] os: [linux] + '@esbuild/linux-mips64el@0.25.12': + resolution: {integrity: sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + '@esbuild/linux-mips64el@0.27.2': resolution: {integrity: sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==} engines: {node: '>=18'} @@ -1166,6 +1259,12 @@ packages: cpu: [mips64el] os: [linux] + '@esbuild/linux-ppc64@0.25.12': + resolution: {integrity: sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + '@esbuild/linux-ppc64@0.27.2': resolution: {integrity: sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==} engines: {node: '>=18'} @@ -1178,6 +1277,12 @@ packages: cpu: [ppc64] os: [linux] + '@esbuild/linux-riscv64@0.25.12': + resolution: {integrity: sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + '@esbuild/linux-riscv64@0.27.2': resolution: {integrity: sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==} engines: {node: '>=18'} @@ -1190,6 +1295,12 @@ packages: cpu: [riscv64] os: [linux] + '@esbuild/linux-s390x@0.25.12': + resolution: {integrity: sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + '@esbuild/linux-s390x@0.27.2': resolution: {integrity: sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==} engines: {node: '>=18'} @@ -1202,6 +1313,12 @@ packages: cpu: [s390x] os: [linux] + '@esbuild/linux-x64@0.25.12': + resolution: {integrity: sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + '@esbuild/linux-x64@0.27.2': resolution: {integrity: sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==} engines: {node: '>=18'} @@ -1214,6 +1331,12 @@ packages: cpu: [x64] os: [linux] + '@esbuild/netbsd-arm64@0.25.12': + resolution: {integrity: sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + '@esbuild/netbsd-arm64@0.27.2': resolution: {integrity: sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==} engines: {node: '>=18'} @@ -1226,6 +1349,12 @@ packages: cpu: [arm64] os: [netbsd] + '@esbuild/netbsd-x64@0.25.12': + resolution: {integrity: sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + '@esbuild/netbsd-x64@0.27.2': resolution: {integrity: sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==} engines: {node: '>=18'} @@ -1238,6 +1367,12 @@ packages: cpu: [x64] os: [netbsd] + '@esbuild/openbsd-arm64@0.25.12': + resolution: {integrity: sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + '@esbuild/openbsd-arm64@0.27.2': resolution: {integrity: sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==} engines: {node: '>=18'} @@ -1250,6 +1385,12 @@ packages: cpu: [arm64] os: [openbsd] + '@esbuild/openbsd-x64@0.25.12': + resolution: {integrity: sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + '@esbuild/openbsd-x64@0.27.2': resolution: {integrity: sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==} engines: {node: '>=18'} @@ -1262,6 +1403,12 @@ packages: cpu: [x64] os: [openbsd] + '@esbuild/openharmony-arm64@0.25.12': + resolution: {integrity: sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openharmony] + '@esbuild/openharmony-arm64@0.27.2': resolution: {integrity: sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==} engines: {node: '>=18'} @@ -1274,6 +1421,12 @@ packages: cpu: [arm64] os: [openharmony] + '@esbuild/sunos-x64@0.25.12': + resolution: {integrity: sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + '@esbuild/sunos-x64@0.27.2': resolution: {integrity: sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==} engines: {node: '>=18'} @@ -1286,6 +1439,12 @@ packages: cpu: [x64] os: [sunos] + '@esbuild/win32-arm64@0.25.12': + resolution: {integrity: sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + '@esbuild/win32-arm64@0.27.2': resolution: {integrity: sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==} engines: {node: '>=18'} @@ -1298,6 +1457,12 @@ packages: cpu: [arm64] os: [win32] + '@esbuild/win32-ia32@0.25.12': + resolution: {integrity: sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + '@esbuild/win32-ia32@0.27.2': resolution: {integrity: sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==} engines: {node: '>=18'} @@ -1310,6 +1475,12 @@ packages: cpu: [ia32] os: [win32] + '@esbuild/win32-x64@0.25.12': + resolution: {integrity: sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + '@esbuild/win32-x64@0.27.2': resolution: {integrity: sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==} engines: {node: '>=18'} @@ -1371,6 +1542,12 @@ packages: peerDependencies: tailwindcss: ^3.0 || ^4.0 + '@hono/node-server@2.1.6': + resolution: {integrity: sha512-p/KH9MnfNcsm3sR6x4lNgm5j+QN4Et8srKredl9DZfXiyZ1UQ3aQ2YVpFLbqktYN5JI+DB+VZFKM2PqE5hLKjQ==} + engines: {node: '>=20'} + peerDependencies: + hono: ^4 || ^5.0.0-0 + '@hpke/common@1.10.1': resolution: {integrity: sha512-moJwhmtLtuxiUzzNp1jpfBfx8yefKoO9D/RCR9dmwrnc7qjJqId1rEtQz+lSlU5cabX8daToMSx/7HayXOiaFw==} engines: {node: '>=16.0.0'} @@ -1400,6 +1577,10 @@ packages: '@internationalized/string@3.2.8': resolution: {integrity: sha512-NdbMQUSfXLYIQol5VyMtinm9pZDciiMfN7RtmSuSB78io1hqwJ0naYfxyW6vgxWBkzWymQa/3uLDlbfmshtCaA==} + '@isaacs/fs-minipass@4.0.1': + resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==} + engines: {node: '>=18.0.0'} + '@joaomoreno/unique-names-generator@5.2.0': resolution: {integrity: sha512-JEh3qZ85Z6syFvQlhRGRyTPI1M5VticiiP8Xl8EV0XfyfI4Mwzd6Zw28BBrEgUJCYv/cpKCQClVj3J8Tn0KFiA==} engines: {node: '>=8'} @@ -1460,6 +1641,16 @@ packages: '@microsoft/dynamicproto-js@2.0.3': resolution: {integrity: sha512-JTWTU80rMy3mdxOjjpaiDQsTLZ6YSGGqsjURsY6AUQtIj0udlF/jYmhdLZu8693ZIC0T1IwYnFa0+QeiMnziBA==} + '@modelcontextprotocol/sdk@1.32.2': + resolution: {integrity: sha512-SWsVtH/0vULSQStoZ6xxH2K09Li8fXYTMC64ZeogCdpZ3XSi1eCPOByV1OpuJxuI3OcmHhosDWYyii07tpPsLw==} + engines: {node: '>=18'} + peerDependencies: + '@cfworker/json-schema': ^4.1.1 + zod: ^3.25 || ^4.0 + peerDependenciesMeta: + '@cfworker/json-schema': + optional: true + '@napi-rs/canvas-android-arm64@0.1.100': resolution: {integrity: sha512-hjhCKhntPv9+t4ckHymdx0phYNcVW+GKQR6Lzw2zE+pOVjOplSmtx9nNNknTjbEDLcuLZqA1y8ufKg1XfgftzQ==} engines: {node: '>= 10'} @@ -1541,6 +1732,18 @@ packages: '@nevware21/ts-utils@0.14.0': resolution: {integrity: sha512-WoeqTIXQ8WPhl+lD2NbMHoAQ4sJl0n7EoRoDmVJui//Usg512enl9q1fdbVobuZt3omnxnmVsDrNIvPBvFgddQ==} + '@nodelib/fs.scandir@2.1.5': + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + + '@nodelib/fs.stat@2.0.5': + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + + '@nodelib/fs.walk@1.2.8': + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + '@octokit/auth-token@5.1.2': resolution: {integrity: sha512-JcQDsBdg49Yky2w2ld20IHAlwr8d/d8N6NiOXbtuoPCqzbsiJgF633mVUw3x4mo0H5ypataQIX7SFu3yy44Mpw==} engines: {node: '>= 18'} @@ -1627,17 +1830,67 @@ packages: peerDependencies: react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 - '@sinonjs/commons@1.8.3': - resolution: {integrity: sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==} + '@secretlint/config-creator@10.2.2': + resolution: {integrity: sha512-BynOBe7Hn3LJjb3CqCHZjeNB09s/vgf0baBaHVw67w7gHF0d25c3ZsZ5+vv8TgwSchRdUCRrbbcq5i2B1fJ2QQ==} + engines: {node: '>=20.0.0'} - '@sinonjs/fake-timers@7.1.2': - resolution: {integrity: sha512-iQADsW4LBMISqZ6Ci1dupJL9pprqwcVFTcOsEmQOEhW+KLCVn/Y4Jrvg2k19fIHCp+iFprriYPTdRcQR8NbUPg==} + '@secretlint/config-loader@10.2.2': + resolution: {integrity: sha512-ndjjQNgLg4DIcMJp4iaRD6xb9ijWQZVbd9694Ol2IszBIbGPPkwZHzJYKICbTBmh6AH/pLr0CiCaWdGJU7RbpQ==} + engines: {node: '>=20.0.0'} - '@sinonjs/fake-timers@8.1.0': - resolution: {integrity: sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg==} + '@secretlint/core@10.2.2': + resolution: {integrity: sha512-6rdwBwLP9+TO3rRjMVW1tX+lQeo5gBbxl1I5F8nh8bgGtKwdlCMhMKsBWzWg1ostxx/tIG7OjZI0/BxsP8bUgw==} + engines: {node: '>=20.0.0'} - '@sinonjs/samsam@6.0.2': - resolution: {integrity: sha512-jxPRPp9n93ci7b8hMfJOFDPRLFYadN6FSpeROFTR4UNF4i5b+EK6m4QXPO46BDhFgRy1JuS87zAnFOzCUwMJcQ==} + '@secretlint/formatter@10.2.2': + resolution: {integrity: sha512-10f/eKV+8YdGKNQmoDUD1QnYL7TzhI2kzyx95vsJKbEa8akzLAR5ZrWIZ3LbcMmBLzxlSQMMccRmi05yDQ5YDA==} + engines: {node: '>=20.0.0'} + + '@secretlint/node@10.2.2': + resolution: {integrity: sha512-eZGJQgcg/3WRBwX1bRnss7RmHHK/YlP/l7zOQsrjexYt6l+JJa5YhUmHbuGXS94yW0++3YkEJp0kQGYhiw1DMQ==} + engines: {node: '>=20.0.0'} + + '@secretlint/profiler@10.2.2': + resolution: {integrity: sha512-qm9rWfkh/o8OvzMIfY8a5bCmgIniSpltbVlUVl983zDG1bUuQNd1/5lUEeWx5o/WJ99bXxS7yNI4/KIXfHexig==} + + '@secretlint/resolver@10.2.2': + resolution: {integrity: sha512-3md0cp12e+Ae5V+crPQYGd6aaO7ahw95s28OlULGyclyyUtf861UoRGS2prnUrKh7MZb23kdDOyGCYb9br5e4w==} + + '@secretlint/secretlint-formatter-sarif@10.2.2': + resolution: {integrity: sha512-ojiF9TGRKJJw308DnYBucHxkpNovDNu1XvPh7IfUp0A12gzTtxuWDqdpuVezL7/IP8Ua7mp5/VkDMN9OLp1doQ==} + + '@secretlint/secretlint-rule-no-dotenv@10.2.2': + resolution: {integrity: sha512-KJRbIShA9DVc5Va3yArtJ6QDzGjg3PRa1uYp9As4RsyKtKSSZjI64jVca57FZ8gbuk4em0/0Jq+uy6485wxIdg==} + engines: {node: '>=20.0.0'} + + '@secretlint/secretlint-rule-preset-recommend@10.2.2': + resolution: {integrity: sha512-K3jPqjva8bQndDKJqctnGfwuAxU2n9XNCPtbXVI5JvC7FnQiNg/yWlQPbMUlBXtBoBGFYp08A94m6fvtc9v+zA==} + engines: {node: '>=20.0.0'} + deprecated: Built into secretlint v14 and later. Remove this package; the rule id still works. https://github.com/secretlint/secretlint/blob/HEAD/docs/rules/preset-recommend.md + + '@secretlint/source-creator@10.2.2': + resolution: {integrity: sha512-h6I87xJfwfUTgQ7irWq7UTdq/Bm1RuQ/fYhA3dtTIAop5BwSFmZyrchph4WcoEvbN460BWKmk4RYSvPElIIvxw==} + engines: {node: '>=20.0.0'} + + '@secretlint/types@10.2.2': + resolution: {integrity: sha512-Nqc90v4lWCXyakD6xNyNACBJNJ0tNCwj2WNk/7ivyacYHxiITVgmLUFXTBOeCdy79iz6HtN9Y31uw/jbLrdOAg==} + engines: {node: '>=20.0.0'} + + '@sindresorhus/merge-streams@2.3.0': + resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==} + engines: {node: '>=18'} + + '@sinonjs/commons@1.8.3': + resolution: {integrity: sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==} + + '@sinonjs/fake-timers@7.1.2': + resolution: {integrity: sha512-iQADsW4LBMISqZ6Ci1dupJL9pprqwcVFTcOsEmQOEhW+KLCVn/Y4Jrvg2k19fIHCp+iFprriYPTdRcQR8NbUPg==} + + '@sinonjs/fake-timers@8.1.0': + resolution: {integrity: sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg==} + + '@sinonjs/samsam@6.0.2': + resolution: {integrity: sha512-jxPRPp9n93ci7b8hMfJOFDPRLFYadN6FSpeROFTR4UNF4i5b+EK6m4QXPO46BDhFgRy1JuS87zAnFOzCUwMJcQ==} '@sinonjs/text-encoding@0.7.1': resolution: {integrity: sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==} @@ -1657,6 +1910,22 @@ packages: '@tanstack/virtual-core@3.14.0': resolution: {integrity: sha512-JLANqGy/D6k4Ujmh8Tr25lGimuOXNiaVyXaCAZS0W+1390sADdGnyUdSWNIfd49gebtIxGMij4IktRVzrdr12Q==} + '@textlint/ast-node-types@15.8.0': + resolution: {integrity: sha512-5CiH9COYmovWmExQgs7763DzX6Gy9zjkjJ7JxCC95wyTcjwQn/8poNF6fv3qzRlmx8CRRde8DHr9FcgAAiPzgw==} + + '@textlint/linter-formatter@15.8.0': + resolution: {integrity: sha512-+oU3A235NATv6Lzi4xa4kJ65PuNJlIxesaO4AvDhDWA9FWm7y4XKWaoQCW1esgaQQ6dwnUiFKArQ8TcJ86mC4w==} + engines: {node: '>=20.18.0'} + + '@textlint/module-interop@15.8.0': + resolution: {integrity: sha512-rt+OR1WYGoLOY8HkA/aBPrqufF6yUUEsKEAh7XohTsT3lp9IyZFT6zOIbjul9P4FAzsmSPkcrYjVx3Bz/IUfkg==} + + '@textlint/resolver@15.8.0': + resolution: {integrity: sha512-E88tzfX3K8Jykk+38aJ9cy8RquD8ABVOPTO2rFEESq0wcg8x6/ypdAS8ZgR7OKiGqlRF0hkO/m5PbQwVfKM3VA==} + + '@textlint/types@15.8.0': + resolution: {integrity: sha512-Anhc6y5736YIsvqae0U6k0YmB2M/QVHkEeOv2aydAn/WIkdI69dCOiDbe3/+RagS3qstFTSFWJzNRA2lUjv19w==} + '@tokenizer/inflate@0.4.1': resolution: {integrity: sha512-2mAv+8pkG6GIZiF1kNg1jAjh27IDxEPKwdGul3snfztFerfPGI1LjDezZp3i7BElXompqEtPmoPx6c2wgtWsOA==} engines: {node: '>=18'} @@ -1664,6 +1933,9 @@ packages: '@tokenizer/token@0.3.0': resolution: {integrity: sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==} + '@types/adm-zip@0.5.8': + resolution: {integrity: sha512-RVVH7QvZYbN+ihqZ4kX/dMiowf6o+Jk1fNwiSdx0NahBJLU787zkULhGhJM8mf/obmLGmgdMM0bXsQTmyfbR7Q==} + '@types/byline@4.2.32': resolution: {integrity: sha512-qtlm/J6XOO9p+Ep/ZB5+mCFEDhzWDDHWU4a1eReN7lkPZXW9rkloq2jcAhvKKmlO5tL2GSvKROb+PTsNVhBiyQ==} @@ -1808,9 +2080,6 @@ packages: '@types/minimatch@3.0.3': resolution: {integrity: sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==} - '@types/minimatch@5.1.2': - resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} - '@types/mocha@10.0.10': resolution: {integrity: sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==} @@ -1820,18 +2089,30 @@ packages: '@types/node-forge@1.3.11': resolution: {integrity: sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==} + '@types/node@22.20.5': + resolution: {integrity: sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==} + '@types/node@24.12.4': resolution: {integrity: sha512-GUUEShf+PBCGW2KaXwcIt3Yk+e3pkKwWKb9GSyM9WQVE+ep2jzmHdGsHzu4wgcZy5fN9FBdVzjpBQsYlpfpgLA==} '@types/node@6.0.78': resolution: {integrity: sha512-+vD6E8ixntRzzZukoF3uP1iV+ZjVN3koTcaeK+BEoc/kSfGbLDIGC7RmCaUgVpUfN6cWvfczFRERCyKM9mkvXg==} + '@types/normalize-package-data@2.4.4': + resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} + '@types/picomatch@2.3.0': resolution: {integrity: sha512-O397rnSS9iQI4OirieAtsDqvCj4+3eY1J+EPdNTKuHuRWIfUoGyzX294o8C4KJYaLqgSrd2o60c5EqCU8Zv02g==} + '@types/sarif@2.1.7': + resolution: {integrity: sha512-kRz0VEkJqWLf1LLVN4pT1cg1Z9wAuvI6L97V3m2f5B76Tg8d413ddvLBPTEHAZJlnn4XSvu0FkZtViCQGVyrXQ==} + '@types/semver@5.5.0': resolution: {integrity: sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ==} + '@types/semver@7.8.0': + resolution: {integrity: sha512-1mAINjtQCXXeLkJ9ehXkwOcBpqtLxiVtKhpUf83DdRNdQKV0iXZpaHYqRr7nj+wvxuJzoAmAwXI+sCNMv1CzLQ==} + '@types/sinon@10.0.2': resolution: {integrity: sha512-BHn8Bpkapj8Wdfxvh2jWIUoaYB/9/XhsL0oOvBfRagJtKlSl9NWPcFOz2lRukI9szwGxFtYZCTejJSqsGDbdmw==} @@ -1853,12 +2134,16 @@ packages: '@types/vscode-webview@1.57.0': resolution: {integrity: sha512-x3Cb/SMa1IwRHfSvKaZDZOTh4cNoG505c3NjTqGlMC082m++x/ETUmtYniDsw6SSmYzZXO8KBNhYxR0+VqymqA==} - '@types/which@2.0.0': - resolution: {integrity: sha512-JHTNOEpZnACQdsTojWggn+SQ8IucfqEhtz7g8Z0G67WdSj4x3F0X5I2c/CVcl8z/QukGrIHeQ/N49v1au74XFQ==} + '@types/vscode@1.96.0': + resolution: {integrity: sha512-qvZbSZo+K4ZYmmDuaodMbAa67Pl6VDQzLKFka6rq+3WUTY4Kro7Bwoi0CuZLO/wema0ygcmpwow7zZfPJTs5jg==} '@types/which@3.0.0': resolution: {integrity: sha512-ASCxdbsrwNfSMXALlC3Decif9rwDMu+80KGp5zI2RLRotfMsTv7fHL8W8VDp24wymzDyIFudhUeSCugrgRFfHQ==} + '@typespec/ts-http-runtime@0.3.10': + resolution: {integrity: sha512-vddvvtZ7sejSlCv+OIkn2ztjB1O31Fc2JsxI/YK725r3elXXlF/J3o3lbXJFRhoeWRWK1tjdZ+GTi6Fdtrp+EA==} + engines: {node: '>=22.0.0'} + '@upsetjs/venn.js@2.0.0': resolution: {integrity: sha512-WbBhLrooyePuQ1VZxrJjtLvTc4NVfpOyKx0sKqioq9bX1C1m7Jgykkn8gLrtwumBioXIqam8DLxp88Adbue6Hw==} @@ -1911,8 +2196,8 @@ packages: '@vscode/l10n@0.0.18': resolution: {integrity: sha512-KYSIHVmslkaCDyw013pphY+d7x1qV8IZupYfeIfzNA+nsaWHbn5uPuQRvdRFsa9zFzGeudPuoGoZ1Op4jrJXIQ==} - '@vscode/markdown-editor@0.0.2-153': - resolution: {integrity: sha512-m2mkimOsOgHPMjxNKH1Hf4Q2jz+b9jGqS0nTmCEYZT0bhb13Na5t/wQWABjQMZ6+DkB4pdSBdNvW4hYLKo0lfw==} + '@vscode/markdown-editor@0.0.2-181': + resolution: {integrity: sha512-3bO9jI9cr6hHu0A8Obnqxm8+zRZ5gvBrZkCmxXTj+ORmH+9QOUsI0ClXoVxeGBgTeNTcxMbTE6n/XqgOwim7MA==} '@vscode/markdown-it-katex@1.1.1': resolution: {integrity: sha512-3KTlbsRBPJQLE2YmLL7K6nunTlU+W9T5+FjfNdWuIUKgxSS6HWLQHaO3L4MkJi7z7MpIPpY+g4N+cWNBPE/MSA==} @@ -1935,9 +2220,66 @@ packages: resolution: {integrity: sha512-m2AmmfG4uzfjLMgWRHQ3xnBkdwCiUTO68vdw1XuzMsOb39Jwm9xr5bVVxwOFR9lPC0FfO1H6FUxBhZQvg7itPA==} engines: {node: '>=16.15.1', vscode: ^1.67.0} + '@vscode/test-electron@2.5.2': + resolution: {integrity: sha512-8ukpxv4wYe0iWMRQU18jhzJOHkeGKbnw7xWRX3Zw1WJA4cEKbHcmmLPdPrPtL6rhDcrlCZN+xKRpv09n4gRHYg==} + engines: {node: '>=16'} + '@vscode/ts-package-manager@0.0.2': resolution: {integrity: sha512-cXPxGbPVTkEQI8mUiWYUwB6j3ga6M9i7yubUOCrjgZ01GeZPMSnaWRprfJ09uuy81wJjY2gfHgLsOgwrGvUBTw==} + '@vscode/vsce-sign-alpine-arm64@2.0.8': + resolution: {integrity: sha512-3HSEDf4R2zhI3/eckZPWBoeFUiLpnG9O0/NBW8xCM3j+Ri0uhmOPvCDuCYsUmIsFVUJETaMu+JMY2DF8v8hNPg==} + cpu: [arm64] + os: [alpine] + + '@vscode/vsce-sign-alpine-x64@2.0.8': + resolution: {integrity: sha512-rHbdV7+esCVn/t8KnbSN9CyMGImAmGnxFb1K9d2uSrt0WNPYfL12FGFekhz2yI8sFhIhyxD+vIKTSp9+kLx+5A==} + cpu: [x64] + os: [alpine] + + '@vscode/vsce-sign-darwin-arm64@2.0.8': + resolution: {integrity: sha512-/JSzSLCbXSlc+X7PfmHWnXczFHRmKURCwN1MGmJXjUJlWHgTDpaqjaJNMnBNqruyrbb6LRE/DMXTfRY9iwr4jA==} + cpu: [arm64] + os: [darwin] + + '@vscode/vsce-sign-darwin-x64@2.0.8': + resolution: {integrity: sha512-iowH17iKIaAiC6TNGIksLmwtcKOHh/HT/pwKHwPZnuTLvdKWZ/8VOT+MphEt71EcWttohqUXx41SjdiCfUPBiA==} + cpu: [x64] + os: [darwin] + + '@vscode/vsce-sign-linux-arm64@2.0.8': + resolution: {integrity: sha512-94aBLOVdO6eAOylUsyJ40/BdHtRrHuKAa/29KNOci2QtwUBAH9jTWJLpn1Yv+xjlUOaSjQC8UlAUtjqz/g6FPA==} + cpu: [arm64] + os: [linux] + + '@vscode/vsce-sign-linux-arm@2.0.8': + resolution: {integrity: sha512-SVzcxe2fx+1meLyO745eUiywrRDQIXwK/oZcwTrzYEkoVh4Val4/8CtDHIc5Z3EhHnwVBnqGqsbNwkR44k7rXA==} + cpu: [arm] + os: [linux] + + '@vscode/vsce-sign-linux-x64@2.0.8': + resolution: {integrity: sha512-i55pKFRMF1nR94CMcFHbr3VQz7rQ8DFURvUd2Jymcbtv8qzhPX2otIHWzkcmAVr4dQApbYYCvRPjbP+i12ImQQ==} + cpu: [x64] + os: [linux] + + '@vscode/vsce-sign-win32-arm64@2.0.8': + resolution: {integrity: sha512-2CoVlRNow2XkNboxlfx8hGdKLR2hvyBRg1O8gafx8I4F+scm1MLHdGcYV3+u3jXDsJaiSyDshTO5vPcLjQpVug==} + cpu: [arm64] + os: [win32] + + '@vscode/vsce-sign-win32-x64@2.0.8': + resolution: {integrity: sha512-93c+KXIvOsLlNLMEPtQBgJJgn2eaypv3G3+4O9RailUQTh9zL3ul/Fhnqf0O+NKOGKky9d/v+GYWhBwsAjZaww==} + cpu: [x64] + os: [win32] + + '@vscode/vsce-sign@2.1.1': + resolution: {integrity: sha512-Fm9SrvxonXpmzN0eKHKS/AHb/3Gc19c7SkGfSnhYOGPiLy2o8hJlIzx314IVSH//uEiKaAbE40P47wwFtyDByg==} + + '@vscode/vsce@3.9.2': + resolution: {integrity: sha512-XSxMosEEDO6vLxELAHVkwmhC0qe0ijZni2jB9Rcs8kQsW4lhTDQ/wMzmwFs/buotAWSnpmUp/dRWD2ufG3UYKA==} + engines: {node: '>= 20'} + hasBin: true + '@vscode/web-editors@0.0.2-104': resolution: {integrity: sha512-4RKc3aJV8IifzWbllCWFEEpRDD/qnPV6TprMB3mNcfxti9oNri51TL/HrouZsxVut35hEK/5hkEX0mLoDmgUiQ==} @@ -1947,6 +2289,36 @@ packages: '@vscode/web-editors@0.0.2-76': resolution: {integrity: sha512-XqJJeYLr9QrpnuPDAYQFpYLLehXEzsI+hiaXIvTBV5ByJwwIPhUAqL1DFUdYJ7e86hzMG0vreg6x5P35mwkSaQ==} + '@xmcl/asm@1.0.1': + resolution: {integrity: sha512-7vCVgm1E1IZ2cujiitFk9550Vgu2XAOn1ff90di638fMmTK0XkFMXKsSR/nGZmYKt+XiTMI/0B3TvreqbVjOug==} + engines: {node: '>=16'} + + '@xmcl/core@2.16.2': + resolution: {integrity: sha512-znYPXBeahDS+gWYGOt2gfHQbMLJf6foDuA0eheKGDVY5S15SxS1j8+IBzEdlFI46iVwOnWyN5pwIEaAbkYmfqg==} + engines: {node: '>=20'} + + '@xmcl/file-transfer@2.1.4': + resolution: {integrity: sha512-XnujVvlS1UH+5XohLaqyiGnHf3Zmu3O0kDtTmBF+cq6atK1j9lUYrqYwJMNJjuAhllHbbLIO+Wex4lWD6sp56w==} + engines: {node: '>=20'} + + '@xmcl/forge-site-parser@2.0.9': + resolution: {integrity: sha512-OHKG2KYE+F6TSeOQmymuGoqEifxbJb3w3X/hmxMNeqtewiYukJldPmKO559ZFnZnOuMQEnr+X0dMbTQwWs5dFg==} + engines: {node: '>=16'} + + '@xmcl/installer@6.3.6': + resolution: {integrity: sha512-R4zSryMkzDwOWNMWnRbX9WOvMKdlYMUQ2TLWSge5CAUEqHlGf1RxvCxpXr7Q/uk+pnfj5gZ/oxJyw49zwpN57w==} + engines: {node: '>=20'} + + '@xmcl/unzip@2.2.0': + resolution: {integrity: sha512-W2Uw1OHtEqnCmxeZXgF+QO+2GKSy4upX+IXXUrNDVnW8a6SkiQV6z5q3fGIM5I9ry3TMP1STZ60mnovhz69uxg==} + engines: {node: '>=20'} + peerDependencies: + '@xmcl/yauzl': 2.10.0 + + '@xmcl/yauzl@2.10.0': + resolution: {integrity: sha512-gdbCj64NQnDiInFw7WOvvaLusT5KxT/9SXSKJB6NFLMmU8xtC4bv7gXtD6a1YCiKKBH8bTWjT4gxEvDOCAYJ9Q==} + engines: {node: '>=20'} + '@zenuml/core@3.50.1': resolution: {integrity: sha512-Q18BXvIfhRuGw0JfO4e+pltG04Phhv2E7n35EWTNSZKKH/HEkyE4Sh7KERb9dqaOfjOdRdKvLG0YekjK3fcDXw==} engines: {node: '>=20'} @@ -1957,23 +2329,54 @@ packages: playwright-core: optional: true + accepts@2.0.0: + resolution: {integrity: sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==} + engines: {node: '>= 0.6'} + acorn@8.16.0: resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} engines: {node: '>=0.4.0'} hasBin: true + adm-zip@0.6.1: + resolution: {integrity: sha512-Xwrja8nx9e5o2N1my4DsKCeKpdrnACyr1wtbPxBDgGzKzKyE9kRtBFA8mWldI+RVlD7CBZNWY/wQ2+ydwOR6kQ==} + engines: {node: '>=14.0'} + agent-base@7.1.4: resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==} engines: {node: '>= 14'} + agent-base@9.0.0: + resolution: {integrity: sha512-TQf59BsZnytt8GdJKLPfUZ54g/iaUL2OWDSFCCvMOhsHduDQxO8xC4PNeyIkVcA5KwL2phPSv0douC0fgWzmnA==} + engines: {node: '>= 20'} + + ajv-formats@3.0.1: + resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} + peerDependencies: + ajv: ^8.0.0 + peerDependenciesMeta: + ajv: + optional: true + + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} + ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} + ansi-escapes@7.3.0: + resolution: {integrity: sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==} + engines: {node: '>=18'} + ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} + ansi-regex@6.6.0: + resolution: {integrity: sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==} + engines: {node: '>=12'} + ansi-styles@4.2.1: resolution: {integrity: sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==} engines: {node: '>=8'} @@ -1986,9 +2389,6 @@ packages: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} - argparse@1.0.10: - resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} - argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -1996,10 +2396,28 @@ packages: resolution: {integrity: sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA==} engines: {node: '>=10'} + astral-regex@2.0.0: + resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} + engines: {node: '>=8'} + + asynckit@0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + available-typed-arrays@1.0.7: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} + azure-devops-node-api@12.5.0: + resolution: {integrity: sha512-R5eFskGvOm3U/GzeAuxRkUsAl0hrAwGgWn6zAd2KrZmrEhWZVqLew4OOupbQlXUuojUzpGtq62SmdhJ06N88og==} + + b4a@1.9.0: + resolution: {integrity: sha512-dpfcF9fDNR6++cthXR67iyhgqWy9CBouAvIWhIntzBG6cvK/cnIPiZQjBwi/ZqjjBEDGfoNDtmB0kTjroOJ3pQ==} + peerDependencies: + react-native-b4a: '*' + peerDependenciesMeta: + react-native-b4a: + optional: true + balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -2007,6 +2425,50 @@ packages: resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} engines: {node: 18 || 20 || >=22} + bare-buffer@3.7.1: + resolution: {integrity: sha512-cIjZnSO+y89ykVX9x96OVnA6tGORBn7vGJ/e3PCbBHMEyfMNG/ixzOS0lLa6saMlWcs69bSKjxFyDwjK152OMg==} + engines: {bare: '>=1.20.0'} + + bare-events@2.9.2: + resolution: {integrity: sha512-AIPKioV7/Y/8KfZ3AAhjPJxLLbY49S64Ym5DakZlUg75qQiTgUq9hEJoEwa4eUezPUlXRy/i5NpsKvo9jgKmoA==} + peerDependencies: + bare-abort-controller: '*' + peerDependenciesMeta: + bare-abort-controller: + optional: true + + bare-fs@4.8.4: + resolution: {integrity: sha512-MPC2eyrpbk3A873sK4y6rk+Iv4o2enxTjHZ8zH3HO0mjrpm5XjnguY2XmfidIsDV6vnjpbMBKUAJpV0ISD2SsQ==} + engines: {bare: '>=1.28.0'} + peerDependencies: + bare-buffer: '*' + peerDependenciesMeta: + bare-buffer: + optional: true + + bare-path@3.1.2: + resolution: {integrity: sha512-ZyKbsuuqK6Ag0K8pX6V5Txq6XeJRvY+wXucnFGRjiyVYP9YWDpIQugk/b+enRYrEYBJaqLzghRQpXPMR7341Nw==} + + bare-stream@2.13.4: + resolution: {integrity: sha512-PcrQ8lVLbiJscNm1Kez+Yp4Gy4AHGcN1lzwjvf5NybWen7VvEgUfyfnXYJ2zNqWnzOfCb1Abq6lH8ti0syQszA==} + peerDependencies: + bare-abort-controller: '*' + bare-buffer: '*' + bare-events: '*' + peerDependenciesMeta: + bare-abort-controller: + optional: true + bare-buffer: + optional: true + bare-events: + optional: true + + bare-url@2.5.6: + resolution: {integrity: sha512-iqkXHkW65De+BT14nHLiBFbNuJ/DdMrZaVNJ1IXPctpK6b1olUJ5Qmy8QBvwROajTiGztso2n82kFEvCsNG7Rg==} + + base64-js@1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + before-after-hook@3.0.2: resolution: {integrity: sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A==} @@ -2017,9 +2479,23 @@ packages: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} + binaryextensions@6.11.0: + resolution: {integrity: sha512-sXnYK/Ij80TO3lcqZVV2YgfKN5QjUWIRk/XSm2J/4bd/lPko3lvk0O4ZppH6m+6hB2/GTu+ptNwVFe1xh+QLQw==} + engines: {node: '>=4'} + + bl@4.1.0: + resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} + + body-parser@2.4.0: + resolution: {integrity: sha512-Ifk1KcLrxaGt1occQagQNFNNOqRt1LFuehEnHHzB8Z6cRgIxRU1TBaiIsUiCdA+gy5PL7Y1IX31DNKkRmxtXjQ==} + engines: {node: '>=18'} + boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} + boundary@2.0.0: + resolution: {integrity: sha512-rJKn5ooC9u8q13IMCrW0RSp31pxBCHE3y9V/tp3TdWSLf8Em3p6Di4NBpfzbJge9YjjFEsD0RtFEjtvHL5VyEA==} + brace-expansion@1.1.21: resolution: {integrity: sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==} @@ -2037,13 +2513,27 @@ packages: browser-stdout@1.3.1: resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} + buffer-crc32@0.2.13: + resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==} + buffer-equal-constant-time@1.0.1: resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==} + buffer@5.7.1: + resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} + + bundle-name@4.1.1: + resolution: {integrity: sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==} + engines: {node: '>=18'} + byline@5.0.0: resolution: {integrity: sha512-s6webAy+R4SR8XVuJWt2V2rGvhnrhxN+9S15GNuTK3wKPOXFF6RNc+8ug2XhH+2s4f+uudG4kUVYmYOQWL2g0Q==} engines: {node: '>=0.10.0'} + bytes@3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + call-bind-apply-helpers@1.0.2: resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} engines: {node: '>= 0.4'} @@ -2064,9 +2554,20 @@ packages: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + character-entities@2.0.2: resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} + cheerio-select@2.1.0: + resolution: {integrity: sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==} + + cheerio@1.2.0: + resolution: {integrity: sha512-WDrybc/gKFpTYQutKIK6UvfcuxijIZfMfXaYm8NMsPQxSYvf+13fXUJ4rztGGbJcBQ/GF55gvrZ0Bc0bj/mqvg==} + engines: {node: '>=20.18.1'} + chevrotain@13.2.0: resolution: {integrity: sha512-GTouk5YzgBxlTPCaDn5q0q2EJKkrYmnPF+HmF8v0Qo4r3iyPG7HJivkN1wthCXZcm3sIcZFpGTRovLPNdJNRCA==} engines: {node: '>=22.0.0'} @@ -2075,9 +2576,24 @@ packages: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} engines: {node: '>= 8.10.0'} + chownr@1.1.4: + resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} + + chownr@3.0.0: + resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} + engines: {node: '>=18'} + class-variance-authority@0.7.1: resolution: {integrity: sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==} + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + + cli-spinners@2.9.2: + resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} + engines: {node: '>=6'} + cliui@7.0.4: resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} @@ -2089,6 +2605,10 @@ packages: resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} engines: {node: '>=6'} + cockatiel@3.2.1: + resolution: {integrity: sha512-gfrHV6ZPkquExvMh9IOkKsBzNDk6sDuZ6DdBGUBkvFnTCqCxzpuq48RySgP0AnaqQkw2zynOFj9yly6T1Q2G5Q==} + engines: {node: '>=16'} + coffeescript@1.12.7: resolution: {integrity: sha512-pLXHFxQMPklVoEekowk8b3erNynC+DVJzChxS/LCBBgR6/8AJkHivkm//zbowcfc7BTCAjryuhx6gPqPRfsFoA==} engines: {node: '>=0.8.0'} @@ -2109,6 +2629,14 @@ packages: resolution: {integrity: sha512-Bb6Cq8oq0IjDOe8wJmi4JeNn763Xs9cfrBcaylK1tPypWzyoy2G3l90v9k64kjphl/ZJjPIShFztenRomi8WTg==} engines: {node: '>=18'} + combined-stream@1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + + commander@12.1.0: + resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} + engines: {node: '>=18'} + commander@15.0.0: resolution: {integrity: sha512-z67u4ZhzCL/Tydu1lJARtEZYWbWaN7oYLHbsuzocr6y4N6WZAagG3RQ4FW61V1/0+jImpj293XfrcYnd1qxtPg==} engines: {node: '>=22.12.0'} @@ -2127,12 +2655,43 @@ packages: confbox@0.1.8: resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} + content-disposition@2.0.1: + resolution: {integrity: sha512-e+H0ZXHSWYrENhQzw1LPuP4oF5MzVKmDU6d3hxlvaPEYLLg62MxtQNPRx4SYSuYJSBUgnQIG4HIN2tEtNv7Dog==} + engines: {node: '>=18'} + + content-type@1.0.5: + resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} + engines: {node: '>= 0.6'} + + content-type@2.1.0: + resolution: {integrity: sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==} + engines: {node: '>=18'} + + cookie-signature@1.2.2: + resolution: {integrity: sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==} + engines: {node: '>=6.6.0'} + + cookie@0.7.2: + resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==} + engines: {node: '>= 0.6'} + + core-util-is@1.0.3: + resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} + + cors@2.8.6: + resolution: {integrity: sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==} + engines: {node: '>= 0.10'} + cose-base@1.0.3: resolution: {integrity: sha512-s9whTXInMSgAp/NVXVNuVxVKzGH2qck3aQlVHxDCdAEPgtMKwc4Wq6/QKhgdEdgbLSi9rBTAcPoRa6JpiG4ksg==} cose-base@2.2.0: resolution: {integrity: sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g==} + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} + cson-parser@4.0.9: resolution: {integrity: sha512-I79SAcCYquWnEfXYj8hBqOOWKj6eH6zX1hhX3yqmS4K3bYp7jME3UFpHPzu3rUew0oyfc0s8T6IlWGXRAheHag==} engines: {node: '>=10.13'} @@ -2343,13 +2902,41 @@ packages: decode-named-character-reference@1.3.0: resolution: {integrity: sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==} + decompress-response@6.0.0: + resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} + engines: {node: '>=10'} + + deep-extend@0.6.0: + resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} + engines: {node: '>=4.0.0'} + + default-browser-id@5.0.1: + resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==} + engines: {node: '>=18'} + + default-browser@5.5.1: + resolution: {integrity: sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==} + engines: {node: '>=18'} + define-data-property@1.1.4: resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} engines: {node: '>= 0.4'} + define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + delaunator@5.1.0: resolution: {integrity: sha512-AGrQ4QSgssa1NGmWmLPqN5NY2KajF5MqxetNEO+o0n3ZwZZeTmt7bBnvzHWrmkZFxGgr4HdyFgelzgi06otLuQ==} + delayed-stream@1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + + depd@2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + dequal@2.0.3: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} @@ -2395,15 +2982,35 @@ packages: ecdsa-sig-formatter@1.0.11: resolution: {integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==} + editions@6.22.0: + resolution: {integrity: sha512-UgGlf8IW75je7HZjNDpJdCv4cGJWIi6yumFdZ0R7A8/CIhQiWUjyGLCxdHpd8bmyD1gnkfUNK0oeOXqUS2cpfQ==} + engines: {ecmascript: '>= es5', node: '>=4'} + + ee-first@1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + elkjs@0.9.3: resolution: {integrity: sha512-f/ZeWvW/BCXbhGEf1Ujp29EASo/lk1FDnETgNKwJrsVvGZhUWCZyg3xLJjAsxfOmt8KjswHmI5EwCQcPMpOYhQ==} emmet@2.4.11: resolution: {integrity: sha512-23QPJB3moh/U9sT4rQzGgeyyGIrcM+GH5uVYg2C6wZIxAIJq7Ng3QLT79tl8FUwDXhyq9SusfknOrofAKqvgyQ==} + emoji-regex@10.6.0: + resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==} + emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + encodeurl@2.0.1: + resolution: {integrity: sha512-Ev/hIyePLZtpL98x562lvPtenrUfGr0lfaf44HFZ+hDEwso7ccV9QAZrEVLg0hxNAzygaAFxy2dYaAKKM0G06A==} + engines: {node: '>= 0.8'} + + encoding-sniffer@0.2.1: + resolution: {integrity: sha512-5gvq20T6vfpekVtqrYQsSCFZ1wEg5+wW0/QaZMWkFr6BqD3NfKs0rLCx4rrVlSWJeZb5NBJgVLswK/w2MWU+Gw==} + + end-of-stream@1.4.5: + resolution: {integrity: sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==} + entities@4.4.0: resolution: {integrity: sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==} engines: {node: '>=0.12'} @@ -2416,6 +3023,14 @@ packages: resolution: {integrity: sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==} engines: {node: '>=0.12'} + entities@7.0.1: + resolution: {integrity: sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==} + engines: {node: '>=0.12'} + + environment@1.1.0: + resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} + engines: {node: '>=18'} + es-define-property@1.0.1: resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} engines: {node: '>= 0.4'} @@ -2428,9 +3043,18 @@ packages: resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} engines: {node: '>= 0.4'} + es-set-tostringtag@2.1.0: + resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} + engines: {node: '>= 0.4'} + es-toolkit@1.46.1: resolution: {integrity: sha512-5eNtXOs3tbfxXOj04tjjseeWkRWaoCjdEI+96DgwzZoe6c9juL49pXlzAFTI72aWC9Y8p7168g6XIKjh7k6pyQ==} + esbuild@0.25.12: + resolution: {integrity: sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==} + engines: {node: '>=18'} + hasBin: true + esbuild@0.27.2: resolution: {integrity: sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==} engines: {node: '>=18'} @@ -2445,24 +3069,70 @@ packages: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} + escape-html@1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true + etag@1.8.1: + resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} + engines: {node: '>= 0.6'} + + events-universal@1.0.1: + resolution: {integrity: sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==} + + eventsource-parser@3.1.1: + resolution: {integrity: sha512-EKN1vKAMcZ8MlYMpaNuxN6R9yakzH6uajHcHVTqWJzvu5pWw9DyhbP35HH8MVBQ+dZjAfDxk+A8NiR9KWaXiyQ==} + engines: {node: '>=18.0.0'} + + eventsource@3.0.7: + resolution: {integrity: sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==} + engines: {node: '>=18.0.0'} + + expand-template@2.0.3: + resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} + engines: {node: '>=6'} + + express-rate-limit@8.7.3: + resolution: {integrity: sha512-zPLqDI2f0gV2WmGnacLf9XSSqn4VldRyP5LCzOwx0BKH40mO6+2PCFkoSsRO2jePx87/Kf6NUF6P2QOTKXHbQA==} + engines: {node: '>= 16'} + peerDependencies: + express: '>= 4.11' + + express@5.3.0: + resolution: {integrity: sha512-qCqy1xSoaugxOD4IVHb1ZWdkvCF2W3aE2okKouWj8VwJ+ztskSiXoBnCSJqfKT+cVPJhuJqe9YLbY425+Zh00g==} + engines: {node: '>= 18'} fast-content-type-parse@2.0.1: resolution: {integrity: sha512-nGqtvLrj5w0naR6tDPfB4cUmYCqouzyQiz6C5y/LtcDllJdrcc6WaWW6iXyIIOErTa/XRybj28aasdn4LkVk6Q==} + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-fifo@1.3.2: + resolution: {integrity: sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==} + + fast-glob@3.3.3: + resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} + engines: {node: '>=8.6.0'} + fast-plist@0.1.2: resolution: {integrity: sha512-2HxzrqJhmMoxVzARjYFvkzkL2dCBB8sogU5sD8gqcZWv5UCivK9/cXM9KIPDRwU+eD3mbRDN/GhW8bO/4dtMfg==} + fast-uri@3.1.9: + resolution: {integrity: sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==} + + fastq@1.20.3: + resolution: {integrity: sha512-XKv5nnLs6nLF71NgiKJLIZFLkPyIEuOselLG7ujZnGrRfQK8HpvY+WqKhAJUAdLomwVHErVS4LfxFlPq0/FTAw==} + fault@2.0.1: resolution: {integrity: sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==} + fd-slicer@1.1.0: + resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} + file-type@21.3.2: resolution: {integrity: sha512-DLkUvGwep3poOV2wpzbHCOnSKGk1LzyXTv+aHFgN2VFl96wnp8YA9YjO2qPzg5PuL8q/SW9Pdi6WTkYOIh995w==} engines: {node: '>=20'} @@ -2471,13 +3141,14 @@ packages: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} + finalhandler@2.1.1: + resolution: {integrity: sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==} + engines: {node: '>= 18.0.0'} + find-up@5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} - find-yarn-workspace-root@2.0.0: - resolution: {integrity: sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==} - flat@5.0.2: resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} hasBin: true @@ -2486,10 +3157,29 @@ packages: resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==} engines: {node: '>= 0.4'} + form-data@4.0.6: + resolution: {integrity: sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==} + engines: {node: '>= 6'} + format@0.2.2: resolution: {integrity: sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==} engines: {node: '>=0.4.x'} + forwarded@0.2.0: + resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} + engines: {node: '>= 0.6'} + + fresh@2.0.0: + resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==} + engines: {node: '>= 0.8'} + + fs-constants@1.0.0: + resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} + + fs-extra@11.4.1: + resolution: {integrity: sha512-KYAb4c9BJQI6QqGKthV68OHe0badztdXJWKo0WtBA9IuCFPTKvE5ZdUBglP833aMjhaSPNO4A5j/EkzZtGlKjA==} + engines: {node: '>=14.14'} + fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} @@ -2498,6 +3188,11 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} @@ -2509,6 +3204,10 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} + get-east-asian-width@1.7.0: + resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==} + engines: {node: '>=18'} + get-intrinsic@1.3.0: resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} engines: {node: '>= 0.4'} @@ -2517,10 +3216,17 @@ packages: resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} engines: {node: '>= 0.4'} + github-from-package@0.0.0: + resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} + glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} + glob@13.0.7: + resolution: {integrity: sha512-wfsFgXQ8A3SEI9XGf7Nl3Y9l7ffSrGh7SUCT7vU/2CzYPep9kjxAn1S40F9OPKxAMGCVl7HtNlJhrCJUeUq83g==} + engines: {node: 18 || 20 || >=22} + glob@5.0.15: resolution: {integrity: sha512-c9IPMazfRITpmAAKi22dK1VKxGDX9ehhqfABDriL/lzO92xcUKEJPQHrVA/2YHSNFB4iFlykVmWvwo48nr3OxA==} deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me @@ -2530,6 +3236,10 @@ packages: engines: {node: '>=12'} deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me + globby@14.1.0: + resolution: {integrity: sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==} + engines: {node: '>=18'} + gopd@1.2.0: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} @@ -2581,6 +3291,18 @@ packages: resolution: {integrity: sha512-MedQhoqVdr0U6SSnWPzfiadUcDHfN/Wzq25AkXiQv9oiOO/sG0S7XkvpFIqWBl9Yq1UYyYOOVORs5UW2XlPyzg==} engines: {node: '>=12.0.0'} + hono@4.13.17: + resolution: {integrity: sha512-vZIcbkvjOR5hHRWERbGkr8fGfF0GGM1ooYkuH448iO3b2AdVEr3AXZSw4Z3Kn+1L5z0CVoVeyV29VGYmFh05kQ==} + engines: {node: '>=16.9.0'} + + hosted-git-info@4.1.0: + resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==} + engines: {node: '>=10'} + + hosted-git-info@7.0.2: + resolution: {integrity: sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==} + engines: {node: ^16.14.0 || >=18.0.0} + html-encoding-sniffer@6.0.0: resolution: {integrity: sha512-CV9TW3Y3f8/wT0BRFc1/KAVQ3TUHiXmaAb6VW9vtiMFf7SLoMd1PdAc4W3KFOFETBJUb90KatHqlsZMWV+R9Gg==} engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} @@ -2588,26 +3310,56 @@ packages: html-to-image@1.11.13: resolution: {integrity: sha512-cuOPoI7WApyhBElTTb9oqsawRvZ0rHhaHwghRLlTuffoD1B2aDemlCruLeZrUIIdvG7gs9xeELEPm6PhuASqrg==} + htmlparser2@10.1.0: + resolution: {integrity: sha512-VTZkM9GWRAtEpveh7MSF6SjjrpNVNNVJfFup7xTY3UpFtm67foy9HDVXneLtFVt4pMz5kZtgNcvCniNFb1hlEQ==} + + http-errors@2.0.1: + resolution: {integrity: sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==} + engines: {node: '>= 0.8'} + http-proxy-agent@7.0.2: resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} engines: {node: '>= 14'} + http-proxy-agent@9.1.0: + resolution: {integrity: sha512-2NxoveTT58mjYT4n3RPTEfCZGLMbidoO8XEieXfpSYxu+PQJ1qpx4ypwH6N+uF9twBPIvRRgvkvW5HUTYWENig==} + engines: {node: '>= 20'} + https-proxy-agent@7.0.6: resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} engines: {node: '>= 14'} + https-proxy-agent@9.1.0: + resolution: {integrity: sha512-ag87y7cJJ9/3+GxFr8Oy4O5faDsGRGnBGsJj/YjOSsSx/5eadKLYTMPlzuR6obgoCDDm0abAAZitXXQkMOPSpA==} + engines: {node: '>= 20'} + iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} + iconv-lite@0.7.3: + resolution: {integrity: sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==} + engines: {node: '>=0.10.0'} + ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + ignore@7.0.14: + resolution: {integrity: sha512-wCBiZ77u1tuWde6G/nfOtLaCTYcFDU5yCzARzK10y+rLhzYoL7a7yEemcopcc2Mzow7gZOIjnV2ym1NYmdiJOQ==} + engines: {node: '>= 4'} + image-size@1.0.2: resolution: {integrity: sha512-xfOoWjceHntRb3qFCrh5ZFORYH8XCdYpASltMhZ/Q0KZiOwjdE/Yl2QCiWdwD+lygV5bMCvauzgu5PxBX/Yerg==} engines: {node: '>=14.0.0'} hasBin: true + immediate@3.0.6: + resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==} + + index-to-position@1.2.0: + resolution: {integrity: sha512-Yg7+ztRkqslMAS2iFaU+Oa4KTSidr63OsFGlOrJoW981kIYO3CGCS3wA95P1mUi/IVSJkn0D479KTJpVpvFNuw==} + engines: {node: '>=18'} + inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. @@ -2615,6 +3367,9 @@ packages: inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + ini@1.3.8: + resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + internmap@1.0.1: resolution: {integrity: sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==} @@ -2622,6 +3377,14 @@ packages: resolution: {integrity: sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==} engines: {node: '>=12'} + ip-address@10.7.6: + resolution: {integrity: sha512-00LYkM6byILa9eQIx6qoaXCM40xTLd56AZ4vyaPW3YTyb49VZYPo5xsiAq4tuQ54GH4R7gVdYScJ1B7B77PuTg==} + engines: {node: '>= 12'} + + ipaddr.js@1.9.1: + resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} + engines: {node: '>= 0.10'} + is-arguments@1.1.1: resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} engines: {node: '>= 0.4'} @@ -2634,6 +3397,11 @@ packages: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} + is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} @@ -2650,17 +3418,33 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} - is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} + is-in-ssh@1.0.0: + resolution: {integrity: sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==} + engines: {node: '>=20'} - is-plain-obj@2.1.0: + is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + + is-interactive@2.0.0: + resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} + engines: {node: '>=12'} + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-plain-obj@2.1.0: resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} engines: {node: '>=8'} is-potential-custom-element-name@1.0.1: resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} + is-promise@4.0.0: + resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} + is-regex@1.2.1: resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==} engines: {node: '>= 0.4'} @@ -2673,9 +3457,24 @@ packages: resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} engines: {node: '>=10'} + is-unicode-supported@1.3.0: + resolution: {integrity: sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==} + engines: {node: '>=12'} + + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} + + is-wsl@3.1.1: + resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} + engines: {node: '>=16'} + isarray@0.0.1: resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==} + isarray@1.0.0: + resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} + isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -2683,6 +3482,13 @@ packages: resolution: {integrity: sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==} engines: {node: '>=16'} + istextorbinary@9.5.0: + resolution: {integrity: sha512-5mbUj3SiZXCuRf9fT3ibzbSSEWiy63gFfksmGfdOzujPjW3k+z8WvIBxcJHBoQNlaZaiyB25deviif2+osLmLw==} + engines: {node: '>=4'} + + jose@6.2.15: + resolution: {integrity: sha512-qdF6ewcZARtef63fJ9AKKZPgxw+t7USH6HLXYcD4CrdmSvDp79rpJSPFEKc90QBeGS63u1KQtN2MZQHC0yDIzA==} + jotai@2.20.0: resolution: {integrity: sha512-b5GAqgmXmXzB4WPaTH26ppk9Sl7AA9WSQX7yfdM+gJ1rFROiWcVbi97gFuN/yVCojOcbcvop2sfLL+fjxW0JVg==} engines: {node: '>=12.20.0'} @@ -2701,9 +3507,8 @@ packages: react: optional: true - js-yaml@3.15.2: - resolution: {integrity: sha512-6EuL879VkRA+1Cz578mKMiKvjPNEuk6+r1JaFzoSWejZmtf7xWbIyw1e3KkxlkzTIt9Taw6JBhEppG7utc1P+w==} - hasBin: true + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} js-yaml@4.3.2: resolution: {integrity: sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==} @@ -2718,6 +3523,12 @@ packages: canvas: optional: true + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + json-schema-typed@8.0.2: + resolution: {integrity: sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==} + json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} @@ -2732,10 +3543,16 @@ packages: jsonc-parser@4.0.0-next.1: resolution: {integrity: sha512-hHbZBY6wf/jvnF9bGTJ0VN3c73ch4VEHalHBPlKVnga5hnYOPNz8RDGS2lLivA8a0HAlfCJiJ9NEbbpKz6+zgg==} + jsonfile@6.2.1: + resolution: {integrity: sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==} + jsonwebtoken@9.0.2: resolution: {integrity: sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==} engines: {node: '>=12', npm: '>=6'} + jszip@3.10.2: + resolution: {integrity: sha512-3l+rb15IOWtUhU0H5MFqES/T6Kh7abYwjosBey/vD6hDt8zoEffkSC5Ws5SGtgVw3gBx2NEbhTeSW1+kWkpyTQ==} + just-extend@4.2.1: resolution: {integrity: sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==} @@ -2757,6 +3574,9 @@ packages: resolution: {integrity: sha512-/B6p9eY9DX7aHBfpkHdpirDTZ5QH9xTwL9y837PWuzuv41O5jFdqNQwVQEQsimY0/iVNkwBY4+4hMfhQ7d4Dbw==} hasBin: true + keytar@7.9.0: + resolution: {integrity: sha512-VPD8mtVtm5JNtA2AErl6Chp06JBfy7diFQ7TQQhdpWOl6MrCRB+eRbvAZUsbGQS9kiMq0coJsy0W0vHpDCkWsQ==} + keytar@file:microsoft-authentication/packageMocks/keytar: resolution: {directory: microsoft-authentication/packageMocks/keytar, type: directory} @@ -2769,13 +3589,16 @@ packages: layout-base@2.0.1: resolution: {integrity: sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg==} + leven@3.1.0: + resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} + engines: {node: '>=6'} + + lie@3.3.0: + resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==} + linkify-it@5.0.2: resolution: {integrity: sha512-ONTm2jCMAVZjgQa/Fy1kScXsuOoF5NPTsoFBdE1KVIZ2vAh/r9+Bqo+0jINCBYnavTPQZz38QzFTme79ENoN3Q==} - load-yaml-file@0.2.0: - resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==} - engines: {node: '>=6'} - locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} @@ -2811,10 +3634,20 @@ packages: lodash.throttle@4.1.1: resolution: {integrity: sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==} + lodash@4.18.1: + resolution: {integrity: sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==} + log-symbols@4.1.0: resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} engines: {node: '>=10'} + log-symbols@6.0.0: + resolution: {integrity: sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==} + engines: {node: '>=18'} + + lru-cache@10.4.3: + resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + lru-cache@11.2.6: resolution: {integrity: sha512-ESL2CrkS/2wTPfuend7Zhkzo2u0daGJ/A2VucJOgQ/C48S/zB8MMeMHSGKYpXhIjbPxfuezITkaBH1wqv00DDQ==} engines: {node: 20 || >=22} @@ -2851,6 +3684,18 @@ packages: mdurl@2.0.0: resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==} + media-typer@1.1.1: + resolution: {integrity: sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ==} + engines: {node: '>= 0.8'} + + merge-descriptors@2.0.0: + resolution: {integrity: sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==} + engines: {node: '>=18'} + + merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + mermaid@12.2.0: resolution: {integrity: sha512-w7nr/SFrLO7BaVTs3dQTvYSV6nYSBj0Yy9DjBhsIJtAcHqRzXSq4Pg32ujHZ/AdWsAMNEvvhbm5dt9E2tOiHzw==} engines: {node: '>=22.12.0'} @@ -2949,6 +3794,35 @@ packages: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} + mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + + mime-db@1.54.0: + resolution: {integrity: sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==} + engines: {node: '>= 0.6'} + + mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + + mime-types@3.0.2: + resolution: {integrity: sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==} + engines: {node: '>=18'} + + mime@1.6.0: + resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} + engines: {node: '>=4'} + hasBin: true + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + + mimic-response@3.1.0: + resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} + engines: {node: '>=10'} + minimatch@10.2.6: resolution: {integrity: sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==} engines: {node: 18 || 20 || >=22} @@ -2956,14 +3830,24 @@ packages: minimatch@3.1.5: resolution: {integrity: sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==} - minimatch@5.1.8: - resolution: {integrity: sha512-7RN35vit8DeBclkofOVmBY0eDAZZQd1HzmukRdSyz95CRh8FT54eqnbj0krQr3mrHR6sfRyYkyhwBWjoV5uqlQ==} - engines: {node: '>=10'} - minimatch@5.1.9: resolution: {integrity: sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==} engines: {node: '>=10'} + minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + + minizlib@3.1.0: + resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} + engines: {node: '>= 18'} + + mkdirp-classic@0.5.3: + resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} + mlly@1.8.2: resolution: {integrity: sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==} @@ -2981,9 +3865,26 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + mute-stream@0.0.8: + resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==} + + napi-build-utils@2.0.0: + resolution: {integrity: sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==} + + negotiator@1.1.0: + resolution: {integrity: sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==} + engines: {node: '>=18'} + nise@5.1.0: resolution: {integrity: sha512-W5WlHu+wvo3PaKLsJJkgPup2LrsXCcm7AWwyNZkUnn5rwPkuPBi3Iwk5SQtN0mv+K65k7nKKjwNQ30wg3wLAQQ==} + node-abi@3.101.0: + resolution: {integrity: sha512-bkb/RkuWCE64eWu1PCh3Fu2pGc9mKRs+kOE+FU2bGHRYlQa86/D321DSATV54AsCQMKz3/xSt9sRgraZTpqdhQ==} + engines: {node: '>=10'} + + node-addon-api@4.3.0: + resolution: {integrity: sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==} + node-addon-api@7.1.1: resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==} @@ -2994,6 +3895,14 @@ packages: node-html-parser@6.1.13: resolution: {integrity: sha512-qIsTMOY4C/dAa5Q5vsobRpOOvPfC4pB61UVW2uSwZNUp0QU/jCekTal1vMmbO0DgdHeLUJpv/ARmDqErVxA3Sg==} + node-sarif-builder@3.4.0: + resolution: {integrity: sha512-tGnJW6OKRii9u/b2WiUViTJS+h7Apxx17qsMUjsUeNDiMMX5ZFf8F8Fcz7PAQ6omvOxHZtvDTmOYKJQwmfpjeg==} + engines: {node: '>=20'} + + normalize-package-data@6.0.2: + resolution: {integrity: sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g==} + engines: {node: ^16.14.0 || >=18.0.0} + normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} @@ -3001,9 +3910,33 @@ packages: nth-check@2.0.1: resolution: {integrity: sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w==} + object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + + object-inspect@1.13.4: + resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==} + engines: {node: '>= 0.4'} + + on-finished@2.4.2: + resolution: {integrity: sha512-ATWUv387i+nLD49EiDoOft5scf32Vsdz3ktrQJG9bi7jRFmaXTssvyvj1EmeKVVgvesbqUtvQQvaS2TpTukAZQ==} + engines: {node: '>= 0.8'} + once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + + open@11.0.4: + resolution: {integrity: sha512-++Zlftm0kVLPmzC06t6epuWmcRMDbI4z5P3NNX979WA/k23+NtSOynEGzsVfZwguKw2mi5umVgnBlJQMwRz4Pg==} + engines: {node: '>=20'} + + ora@8.2.0: + resolution: {integrity: sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==} + engines: {node: '>=18'} + p-limit@3.1.0: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} @@ -3012,18 +3945,45 @@ packages: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} + p-map@7.1.1: + resolution: {integrity: sha512-6Lh3jQPLthYujSrlw6ccWXBGZTkoTCz27Hd92g79LH/kjAbgoEu0t442cCCNbegPSJsA0lwDX8z0bcKtkpA32g==} + engines: {node: '>=18'} + package-manager-detector@1.6.0: resolution: {integrity: sha512-61A5ThoTiDG/C8s8UMZwSorAGwMJ0ERVGj2OjoW5pAalsNOg15+iQiPzrLJ4jhZ1HJzmC2PIHT2oEiH3R5fzNA==} + pako@1.0.11: + resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} + + parse-json@8.3.0: + resolution: {integrity: sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==} + engines: {node: '>=18'} + + parse-semver@1.1.1: + resolution: {integrity: sha512-Eg1OuNntBMH0ojvEKSrvDSnwLmvVuUOSdylH/pSCPNMIspLlweJyIWXCE+k/5hm3cj/EBUYwmWkjhBALNP4LXQ==} + + parse5-htmlparser2-tree-adapter@7.1.0: + resolution: {integrity: sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==} + + parse5-parser-stream@7.1.2: + resolution: {integrity: sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==} + parse5@3.0.2: resolution: {integrity: sha512-yQW05f47bKFJa0WdnyzP7vh7+B+w8jhVsFBBiaEbIfNDSSt8GADBhcQgsdYxatQ7rVs1nU9cmsYXURGWBH3Siw==} parse5@7.1.2: resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} + parse5@7.3.0: + resolution: {integrity: sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==} + parse5@8.0.0: resolution: {integrity: sha512-9m4m5GSgXjL4AjumKzq1Fgfp3Z8rsvjRNbnkVwfu2ImRqE5D0LnY2QfDen18FSY9C573YU5XxSapdHZTZ2WolA==} + parseurl@1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + path-browserify@1.0.1: resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} @@ -3038,12 +3998,33 @@ packages: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + path-scurry@2.0.2: + resolution: {integrity: sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==} + engines: {node: 18 || 20 || >=22} + path-to-regexp@1.9.0: resolution: {integrity: sha512-xIp7/apCFJuUHdDLWe8O1HIkb0kQrOMb/0u6FXQjemHn/ii5LrIzU6bdECnsiTF/GjZkMEKg1xdiZwNqDYlZ6g==} + path-to-regexp@8.4.2: + resolution: {integrity: sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==} + + path-type@6.0.0: + resolution: {integrity: sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==} + engines: {node: '>=18'} + pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + pend@1.2.0: + resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + picomatch@2.3.2: resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==} engines: {node: '>=8.6'} @@ -3052,9 +4033,9 @@ packages: resolution: {integrity: sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==} engines: {node: '>=12'} - pify@4.0.1: - resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} - engines: {node: '>=6'} + pkce-challenge@5.0.1: + resolution: {integrity: sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==} + engines: {node: '>=16.20.0'} pkg-types@1.3.1: resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} @@ -3069,6 +4050,13 @@ packages: engines: {node: '>=18'} hasBin: true + pluralize@2.0.0: + resolution: {integrity: sha512-TqNZzQCD4S42De9IfnnBvILN7HAW7riLqsCyp8lgjXeysyPlX5HhqKAcJHHHb9XskE4/a+7VGC9zzx8Ls0jOAw==} + + pluralize@8.0.0: + resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} + engines: {node: '>=4'} + points-on-curve@0.2.0: resolution: {integrity: sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A==} @@ -3079,6 +4067,40 @@ packages: resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} engines: {node: '>= 0.4'} + powershell-utils@0.2.1: + resolution: {integrity: sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==} + engines: {node: '>=20'} + + prebuild-install@7.1.3: + resolution: {integrity: sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==} + engines: {node: '>=10'} + deprecated: No longer maintained. Please contact the author of the relevant native addon; alternatives are available. + hasBin: true + + prettier@3.6.2: + resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==} + engines: {node: '>=14'} + hasBin: true + + process-nextick-args@2.0.1: + resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + + proxy-addr@2.0.8: + resolution: {integrity: sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==} + engines: {node: '>= 0.10'} + + proxy-agent-negotiate@1.1.0: + resolution: {integrity: sha512-N8IBcM3UgCVzz2L2Lqv8DVntDnnC8/hiV4nEDUPkqq72TPUgYWjQc+bdZlBPZK9LzPAvOY//gAt0S0DApoOXWQ==} + engines: {node: '>= 20'} + peerDependencies: + kerberos: ^2.0.0 + peerDependenciesMeta: + kerberos: + optional: true + + pump@3.0.4: + resolution: {integrity: sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==} + punycode.js@2.3.1: resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==} engines: {node: '>=6'} @@ -3087,9 +4109,31 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + qs@6.17.1: + resolution: {integrity: sha512-jd3COkaKVgGUW+ZHyEHCG9bH7RoaaiWuMgzsIBjUMVjLAaWGWpoUAVwljVvBHxRu/2qEHnadLGZrkutYUBPQJA==} + engines: {node: '>=0.6'} + + queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + queue@6.0.2: resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==} + range-parser@1.3.0: + resolution: {integrity: sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==} + engines: {node: '>= 0.6'} + + raw-body@3.0.2: + resolution: {integrity: sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==} + engines: {node: '>= 0.10'} + + rc-config-loader@4.1.4: + resolution: {integrity: sha512-3GiwEzklkbXTDp52UR5nT8iXgYAx1V9ZG/kDZT7p60u2GCv2XTwQq4NzinMoMpNtXhmt3WkhYXcj6HH8HdwCEQ==} + + rc@1.2.8: + resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} + hasBin: true + react-aria@3.48.0: resolution: {integrity: sha512-jQjd4rBEIMqecBaAKYJbVGK6EqIHLa5znVQ7jwFyK5vCyljoj6KhgtiahmcIPsG5vG5vEDLw+ba+bEWn6A2P4w==} peerDependencies: @@ -3110,13 +4154,25 @@ packages: resolution: {integrity: sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q==} engines: {node: '>=0.10.0'} + read-pkg@9.0.1: + resolution: {integrity: sha512-9viLL4/n1BJUCT1NXVTdS1jtm80yDEgR5T4yCelII49Mbj0v1rZdKqj7zCiYdbB0CuCgdrvHcNogAKTFPBocFA==} + engines: {node: '>=18'} + + read@1.0.7: + resolution: {integrity: sha512-rSOKNYUmaxy0om1BNjMN4ezNT6VKK+2xF4GBhc81mkH7L60i6dp8qPYrkndNLT3QPphoII3maL9PVC9XmhHwVQ==} + engines: {node: '>=0.8'} + + readable-stream@2.3.8: + resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} + + readable-stream@3.6.2: + resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} + engines: {node: '>= 6'} + readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} - request-light@0.7.0: - resolution: {integrity: sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q==} - request-light@0.8.0: resolution: {integrity: sha512-bH6E4PMmsEXYrLX6Kr1vu+xI3HproB1vECAwaPSJeroLE1kpWE3HR27uB4icx+6YORu1ajqBJXxuedv8ZQg5Lw==} @@ -3128,15 +4184,37 @@ packages: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + + reusify@1.1.0: + resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + robust-predicates@3.0.3: resolution: {integrity: sha512-NS3levdsRIUOmiJ8FZWCP7LG3QpJyrs/TE0Zpf1yvZu8cAJJ6QMW92H1c7kWpdIHo8RvmLxN/o2JXTKHp74lUA==} roughjs@4.6.6: resolution: {integrity: sha512-ZUz/69+SYpFN/g/lUlo2FXcIjRkSu3nDarreVdGGndHEBJ6cXPdKguS8JGxwj5HA5xIbVKSmLgr5b3AWxtRfvQ==} + router@2.2.0: + resolution: {integrity: sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==} + engines: {node: '>= 18'} + + run-applescript@7.1.0: + resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==} + engines: {node: '>=18'} + + run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + rw@1.3.3: resolution: {integrity: sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==} + safe-buffer@5.1.2: + resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} + safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} @@ -3147,6 +4225,10 @@ packages: safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + sax@1.6.1: + resolution: {integrity: sha512-42tBVwLWnaQvW5zc4HbZrTuWccECCZfBi92FDuwtqxasH+JbPB3/FOKb1m222K42R4WxuxzzMsTswfzgtSu64Q==} + engines: {node: '>=11.0.0'} + saxes@6.0.0: resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} engines: {node: '>=v12.22.7'} @@ -3154,18 +4236,17 @@ packages: scheduler@0.27.0: resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==} - semver@7.5.2: - resolution: {integrity: sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==} - engines: {node: '>=10'} + secretlint@10.2.2: + resolution: {integrity: sha512-xVpkeHV/aoWe4vP4TansF622nBEImzCY73y/0042DuJ29iKIaqgoJ8fGxre3rVSHHbxar4FdJobmTnLp9AU0eg==} + engines: {node: '>=20.0.0'} hasBin: true - semver@7.5.4: - resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} - engines: {node: '>=10'} + semver@5.7.3: + resolution: {integrity: sha512-kM18BPOqTi0+TB68703/GJRpAML5Me+IDQsR1J26YB3EFKKNEyHIVZuWDX7+WKQB3tHwDwgk24BfhdpWUbytvQ==} hasBin: true - semver@7.6.2: - resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} + semver@7.5.2: + resolution: {integrity: sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==} engines: {node: '>=10'} hasBin: true @@ -3174,41 +4255,139 @@ packages: engines: {node: '>=10'} hasBin: true + send@1.2.1: + resolution: {integrity: sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==} + engines: {node: '>= 18'} + serialize-javascript@7.0.5: resolution: {integrity: sha512-F4LcB0UqUl1zErq+1nYEEzSHJnIwb3AF2XWB94b+afhrekOUijwooAYqFyRbjYkm2PAKBabx6oYv/xDxNi8IBw==} engines: {node: '>=20.0.0'} + serve-static@2.2.1: + resolution: {integrity: sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==} + engines: {node: '>= 18'} + set-function-length@1.2.2: resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} engines: {node: '>= 0.4'} + setimmediate@1.0.5: + resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==} + + setprototypeof@1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + side-channel-list@1.0.1: + resolution: {integrity: sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==} + engines: {node: '>= 0.4'} + + side-channel-map@1.0.1: + resolution: {integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==} + engines: {node: '>= 0.4'} + + side-channel-weakmap@1.0.2: + resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==} + engines: {node: '>= 0.4'} + + side-channel@1.1.1: + resolution: {integrity: sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==} + engines: {node: '>= 0.4'} + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + simple-concat@1.0.1: + resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} + + simple-get@4.0.1: + resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==} + sinon@12.0.1: resolution: {integrity: sha512-iGu29Xhym33ydkAT+aNQFBINakjq69kKO6ByPvTsm3yyIACfyQttRTP03aBP/I8GfhFmLzrnKwNNkr0ORb1udg==} deprecated: 16.1.1 + slash@5.1.0: + resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} + engines: {node: '>=14.16'} + + slice-ansi@4.0.0: + resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} + engines: {node: '>=10'} + + smart-buffer@4.2.0: + resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} + engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} + + socks@2.8.10: + resolution: {integrity: sha512-e0VyvkVTwVYViNovRkZ9aodhxVlyoMn7eJhVUPxZ+eK9P/7CBkxvvsBOHqFPEH416726W8tLXXXjKwqgTErrCQ==} + engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} + source-map-js@1.2.2: resolution: {integrity: sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==} engines: {node: '>=0.10.0'} - sprintf-js@1.0.3: - resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + spdx-correct@3.2.0: + resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} + + spdx-exceptions@2.5.0: + resolution: {integrity: sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==} + + spdx-expression-parse@3.0.1: + resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} + + spdx-license-ids@3.0.24: + resolution: {integrity: sha512-cLS9TtWkIQFyLkJ3/5aFQAOHOSKTlOs/7WDut/XPSdjom1fJhUdkepeJAKXa9Y05+FabHd0sti+Et559vDtkpQ==} + + statuses@2.0.2: + resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} + engines: {node: '>= 0.8'} + + stdin-discarder@0.2.2: + resolution: {integrity: sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==} + engines: {node: '>=18'} straightforward@4.2.2: resolution: {integrity: sha512-MxfuNnyTP4RPjadI3DkYIcNIp0DMXeDmAXY4/6QivU8lLIPGUqaS5VsEkaQ2QC+FICzc7QTb/lJPRIhGRKVuMA==} engines: {node: '>=16'} hasBin: true + streamx@2.28.1: + resolution: {integrity: sha512-zEzXb0s5Cds7tqMH6rhZ05lcJydCWiQPEwiNngVqzsxCc962vLY4Uw+mW7od8kDH258k2Uz/JrOkdIAAhSh9VA==} + string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} + string-width@7.2.0: + resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} + engines: {node: '>=18'} + + string_decoder@1.1.1: + resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} + + string_decoder@1.3.0: + resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} - strip-bom@3.0.0: - resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} - engines: {node: '>=4'} + strip-ansi@7.2.0: + resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} + engines: {node: '>=12'} + + strip-json-comments@2.0.1: + resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} + engines: {node: '>=0.10.0'} strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} @@ -3218,6 +4397,9 @@ packages: resolution: {integrity: sha512-KIy5nylvC5le1OdaaoCJ07L+8iQzJHGH6pWDuzS+d07Cu7n1MZ2x26P8ZKIWfbK02+XIL8Mp4RkWeqdUCrDMfg==} engines: {node: '>=18'} + structured-source@4.0.0: + resolution: {integrity: sha512-qGzRFNJDjFieQkl/sVOI2dUjHKRyL9dAJi2gCPGJLbJHBIkyOHxjuocpIEfbLioX+qSJpvbYdT49/YCdMznKxA==} + stylis@4.3.6: resolution: {integrity: sha512-yQ3rwFWRfwNUY7H5vpU0wfdkNSnvnJinhF9830Swlaxl03zsOjCfmX0ugac+3LtK0lYSgwL/KXc8oYL3mG4YFQ==} @@ -3229,18 +4411,57 @@ packages: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} engines: {node: '>=10'} + supports-hyperlinks@3.2.0: + resolution: {integrity: sha512-zFObLMyZeEwzAoKCyu1B91U79K2t7ApXuQfo8OuxwXLDgcKxuwM+YvcbIhm6QWqz7mHUH1TVytR1PwVVjEuMig==} + engines: {node: '>=14.18'} + symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} tabbable@6.4.0: resolution: {integrity: sha512-05PUHKSNE8ou2dwIxTngl4EzcnsCDZGJ/iCLtDflR/SHB/ny14rXc+qU5P4mG9JkusiV7EivzY9Mhm55AzAvCg==} + table@6.10.1: + resolution: {integrity: sha512-f05boz6UD5S70AJiUxqKOnDuE45mBIVagX490oQmcW38+Lq/H1s7CjIpFgJjR/kpV87L4lw/AN+14D2PktQJsQ==} + engines: {node: '>=10.0.0'} + tailwind-merge@3.6.0: resolution: {integrity: sha512-uxL7qAVQriqRQPAyK3pj66VqskWqoZ37PW94jwOTwNfq/z9oyu1V+eqrZqtR2+fCiXdYOZe/Modt8GtvqNzu+w==} + tar-fs@2.1.5: + resolution: {integrity: sha512-OboTd8mmMhZDNPV+UjQcK9yKAatXu2aJ+r1w4im1Otd4M4fl2hwvdoXUxIYHFTHWK/3y3FarBP70v3vwmGlOxw==} + + tar-stream@2.2.0: + resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} + engines: {node: '>=6'} + + tar-stream@3.2.2: + resolution: {integrity: sha512-+8NeqHRjQWH9nYlwo2gamAMImZCVzI4UoEgDpWorBt9OEfppiZn+uSkskzQKPWIZyji/C8fpWO7u69G0DX0tbg==} + + tar@7.5.22: + resolution: {integrity: sha512-MFO/QzvtAOmJbkhOaCTvbGcFN9L9b+JunIsDwaKljSOdcLMea3NJ1k9Usz/rjdfSXTq4dfzfeS7W4p4YOAAHeA==} + engines: {node: '>=18'} + tas-client@0.2.33: resolution: {integrity: sha512-V+uqV66BOQnWxvI6HjDnE4VkInmYZUQ4dgB7gzaDyFyFSK1i1nF/j7DpS9UbQAgV9NaF1XpcyuavnM1qOeiEIg==} + teex@1.0.1: + resolution: {integrity: sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==} + + terminal-link@4.0.0: + resolution: {integrity: sha512-lk+vH+MccxNqgVqSnkMVKx4VLJfnLjDBGzH16JVZjKE2DoxP57s6/vt6JmXV5I3jBcfGrxNrYtC+mPtU7WJztA==} + engines: {node: '>=18'} + + text-decoder@1.2.7: + resolution: {integrity: sha512-vlLytXkeP4xvEq2otHeJfSQIRyWxo/oZGEbXrtEEF9Hnmrdly59sUbzZ/QgyWuLYHctCHxFF4tRQZNQ9k60ExQ==} + + text-table@0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + + textextensions@6.11.0: + resolution: {integrity: sha512-tXJwSr9355kFJI3lbCkPpUH5cP8/M0GGy2xLO34aZCjMXBaK3SoPnZwr/oWmo1FdCnELcs4npdCIOFtq9W3ruQ==} + engines: {node: '>=4'} + tinyexec@1.0.4: resolution: {integrity: sha512-u9r3uZC0bdpGOXtlxUIdwf9pkmvhqJdrVCH9fapQtgy/OeTTMZ1nqH7agtvEfmGui6e1XxjcdrlxvxJvc3sMqw==} engines: {node: '>=18'} @@ -3252,10 +4473,18 @@ packages: resolution: {integrity: sha512-1r6vQTTt1rUiJkI5vX7KG8PR342Ru/5Oh13kEQP2SMbRSZpOey9SrBe27IDxkoWulx8ShWu4K6C0BkctP8Z1bQ==} hasBin: true + tmp@0.2.7: + resolution: {integrity: sha512-e0votIpp4Uo2AJYSzVHV6xCcawuiez3DzqDAbrTc3YxBkplN6e+dM13ZeIcZnDg/QpSuU2zfZ3rzwY8ukEnaXw==} + engines: {node: '>=14.14'} + to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} + toidentifier@1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + token-types@6.1.2: resolution: {integrity: sha512-dRXchy+C0IgK8WPC6xvCHFRIWYUbqqdEIKPaKo/AcTUNzwLTK6AH7RjdLWsEZcAN/TBdtfUw3PYEgPr5VPr6ww==} engines: {node: '>=14.16'} @@ -3275,6 +4504,14 @@ packages: tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + tsx@4.23.15: + resolution: {integrity: sha512-Yiex1Ovn8z2xPpOWckIiysV1SSyRMY9BkLF++q0yKiDxCqRhosKfMg3janKkiLBwZ5c/YryloKwGZcrEmtwxKw==} + engines: {node: '>=18.0.0'} + hasBin: true + + tunnel-agent@0.6.0: + resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} + tunnel@0.0.6: resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==} engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'} @@ -3283,6 +4520,22 @@ packages: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} + type-fest@4.41.0: + resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} + engines: {node: '>=16'} + + type-is@2.1.0: + resolution: {integrity: sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==} + engines: {node: '>= 18'} + + typed-rest-client@1.8.11: + resolution: {integrity: sha512-5UvfMpd1oelmUPRbbaVnq+rHP7ng2cE4qoQkQeAqxRL6PklkxsM0g32/HL0yfvruK6ojQ5x8EE+HF4YV6DtuCA==} + + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + typescript@6.0.3: resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} engines: {node: '>=14.17'} @@ -3298,6 +4551,12 @@ packages: resolution: {integrity: sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==} engines: {node: '>=18'} + underscore@1.13.8: + resolution: {integrity: sha512-DXtD3ZtEQzc7M8m4cXotyHR+FAS18C64asBYY5vqZexfYryNNnDc02W4hKg3rdQuqOYas1jkseX0+nZXjTXnvQ==} + + undici-types@6.21.0: + resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} + undici-types@7.16.0: resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} @@ -3305,14 +4564,36 @@ packages: resolution: {integrity: sha512-RYONW2MeafgYlkVOKYKkA/Ag7BmXqgIWCa8t1m0JcxrQg9pI9lEqRhAOruOBCbAohOa/gkCF+iPi9hrgvTzu6Q==} engines: {node: '>=20.18.1'} + unicorn-magic@0.1.0: + resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} + engines: {node: '>=18'} + + unicorn-magic@0.3.0: + resolution: {integrity: sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==} + engines: {node: '>=18'} + universal-user-agent@7.0.2: resolution: {integrity: sha512-0JCqzSKnStlRRQfCdowvqy3cy0Dvtlb8xecj/H8JFZuCze4rwjPZQOgvFvn0Ws/usCHQFGpyr+pB9adaGwXn4Q==} + universalify@2.0.1: + resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} + engines: {node: '>= 10.0.0'} + + unpipe@1.0.0: + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} + engines: {node: '>= 0.8'} + + url-join@4.0.1: + resolution: {integrity: sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==} + use-sync-external-store@1.6.0: resolution: {integrity: sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==} peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + util-deprecate@1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + util@0.12.5: resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} @@ -3320,6 +4601,17 @@ packages: resolution: {integrity: sha512-vIYxrBCC/N/K+Js3qSN88go7kIfNPssr/hHCesKCQNAjmgvYS2oqr69kIufEG+O4+PfezOH4EbIeHCfFov8ZgQ==} hasBin: true + validate-npm-package-license@3.0.4: + resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} + + vary@1.1.2: + resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} + engines: {node: '>= 0.8'} + + version-range@4.15.0: + resolution: {integrity: sha512-Ck0EJbAGxHwprkzFO966t4/5QkRuzh+/I1RxhLgUKKwEn+Cd8NwM60mE3AqBZg5gYODoXW0EFsQvbZjRlvdqbg==} + engines: {node: '>=4'} + vscode-css-languageservice@7.0.0-next.2: resolution: {integrity: sha512-fC+0QQhQInm8UWBRN6LVhQ7C6eb+bpvdyMGsj2fOzIh4YatGjwS/GaAP3NHz9HKiZH3IltfWv6shRQriqDEDJg==} @@ -3407,6 +4699,15 @@ packages: resolution: {integrity: sha512-BMhLD/Sw+GbJC21C/UgyaZX41nPt8bUTg+jWyDeg7e7YN4xOM05YPSIXceACnXVtqyEw/LMClUQMtMZ+PGGpqQ==} engines: {node: '>=20'} + whatwg-encoding@3.1.1: + resolution: {integrity: sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==} + engines: {node: '>=18'} + deprecated: Use @exodus/bytes instead for a more spec-conformant and faster implementation + + whatwg-mimetype@4.0.0: + resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==} + engines: {node: '>=18'} + whatwg-mimetype@5.0.0: resolution: {integrity: sha512-sXcNcHOC51uPGF0P/D4NVtrkjSU2fNsm9iog4ZvZJsL3rjoDAzXZhkm2MWt1y+PUdggKAYVoMAIYcs78wJ51Cw==} engines: {node: '>=20'} @@ -3415,10 +4716,6 @@ packages: resolution: {integrity: sha512-1to4zXBxmXHV3IiSSEInrreIlu02vUOvrhxJJH5vcxYTBDAx51cqZiKdyTxlecdKNSjj8EcxGBxNf6Vg+945gw==} engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} - which-pm@2.2.0: - resolution: {integrity: sha512-MOiaDbA5ZZgUjkeMWM5EkJp4loW5ZRoa5bc3/aeMox/PJelMhE6t7S/mLuiY43DBupyxH+S0U1bTui9kWUlmsw==} - engines: {node: '>=8.15'} - which-typed-array@1.1.20: resolution: {integrity: sha512-LYfpUkmqwl0h9A2HL09Mms427Q1RZWuOHsukfVcKRq9q95iQxdw0ix1JQrqbcDR9PH1QDwf5Qo8OZb5lksZ8Xg==} engines: {node: '>= 0.4'} @@ -3467,10 +4764,22 @@ packages: utf-8-validate: optional: true + wsl-utils@1.0.1: + resolution: {integrity: sha512-c16PKLIRxBYpR3jSWsdS7SFp0COm5SOQdiFjY818dYFHJbMGuLBszpF07LBWmOS1uzrHa9VGdynsEgoeKy0oOQ==} + engines: {node: '>=20'} + xml-name-validator@5.0.0: resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==} engines: {node: '>=18'} + xml2js@0.5.0: + resolution: {integrity: sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==} + engines: {node: '>=4.0.0'} + + xmlbuilder@11.0.1: + resolution: {integrity: sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==} + engines: {node: '>=4.0'} + xmlchars@2.2.0: resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} @@ -3481,6 +4790,10 @@ packages: yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + yallist@5.0.0: + resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} + engines: {node: '>=18'} + yaml@2.9.0: resolution: {integrity: sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==} engines: {node: '>= 14.6'} @@ -3506,10 +4819,22 @@ packages: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} engines: {node: '>=12'} + yauzl@3.4.0: + resolution: {integrity: sha512-jIH9yLR9wqr0wOS0TpBvo/g/2UgZH5qePVbjgRliiF0BYvOZyaBknKsF+x9Iht0O6sqgnB93rCICdOZFecJuDw==} + engines: {node: '>=12'} + + yazl@2.5.1: + resolution: {integrity: sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw==} + yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + zod-to-json-schema@3.25.2: + resolution: {integrity: sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==} + peerDependencies: + zod: ^3.25.28 || ^4 + zod@4.4.3: resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} @@ -3546,10 +4871,102 @@ snapshots: '@asamuzakjp/nwsapi@2.3.9': {} - '@azure/ms-rest-azure-env@2.0.0': {} + '@azu/format-text@1.0.2': {} + + '@azu/style-format@1.0.1': + dependencies: + '@azu/format-text': 1.0.2 + + '@azure/abort-controller@2.2.0': + dependencies: + tslib: 2.8.1 + + '@azure/core-auth@1.11.0': + dependencies: + '@azure/abort-controller': 2.2.0 + '@azure/core-util': 1.14.0 + tslib: 2.8.1 + transitivePeerDependencies: + - kerberos + - supports-color + + '@azure/core-client@1.11.2': + dependencies: + '@azure/abort-controller': 2.2.0 + '@azure/core-auth': 1.11.0 + '@azure/core-rest-pipeline': 1.25.0 + '@azure/core-tracing': 1.4.0 + '@azure/core-util': 1.14.0 + '@azure/logger': 1.4.0 + tslib: 2.8.1 + transitivePeerDependencies: + - kerberos + - supports-color + + '@azure/core-process@1.0.0': {} + + '@azure/core-rest-pipeline@1.25.0': + dependencies: + '@azure/abort-controller': 2.2.0 + '@azure/core-auth': 1.11.0 + '@azure/core-tracing': 1.4.0 + '@azure/core-util': 1.14.0 + '@azure/logger': 1.4.0 + '@typespec/ts-http-runtime': 0.3.10 + tslib: 2.8.1 + transitivePeerDependencies: + - kerberos + - supports-color + + '@azure/core-tracing@1.4.0': + dependencies: + tslib: 2.8.1 + + '@azure/core-util@1.14.0': + dependencies: + '@azure/abort-controller': 2.2.0 + '@typespec/ts-http-runtime': 0.3.10 + tslib: 2.8.1 + transitivePeerDependencies: + - kerberos + - supports-color + + '@azure/identity@4.14.1': + dependencies: + '@azure/abort-controller': 2.2.0 + '@azure/core-auth': 1.11.0 + '@azure/core-client': 1.11.2 + '@azure/core-process': 1.0.0 + '@azure/core-rest-pipeline': 1.25.0 + '@azure/core-tracing': 1.4.0 + '@azure/core-util': 1.14.0 + '@azure/logger': 1.4.0 + '@azure/msal-browser': 5.29.0 + '@azure/msal-node': 7.2.1 + open: 11.0.4 + tslib: 2.8.1 + transitivePeerDependencies: + - kerberos + - supports-color + + '@azure/logger@1.4.0': + dependencies: + '@typespec/ts-http-runtime': 0.3.10 + tslib: 2.8.1 + transitivePeerDependencies: + - kerberos + - supports-color + + '@azure/ms-rest-azure-env@2.0.0': {} + + '@azure/msal-browser@5.29.0': + dependencies: + '@azure/msal-common': 16.16.1 '@azure/msal-common@16.11.1': {} + '@azure/msal-common@16.16.1': {} + '@azure/msal-node-extensions@5.3.2': dependencies: '@azure/msal-common': 16.11.1 @@ -3563,6 +4980,19 @@ snapshots: '@azure/msal-common': 16.11.1 jsonwebtoken: 9.0.2 + '@azure/msal-node@7.2.1': + dependencies: + '@azure/msal-common': 16.16.1 + jsonwebtoken: 9.0.2 + + '@babel/code-frame@7.29.7': + dependencies: + '@babel/helper-validator-identifier': 7.29.7 + js-tokens: 4.0.0 + picocolors: 1.1.1 + + '@babel/helper-validator-identifier@7.29.7': {} + '@borewit/text-codec@0.2.1': {} '@braintree/sanitize-url@7.1.2': {} @@ -3638,156 +5068,234 @@ snapshots: '@enonic/fnv-plus@1.3.0': {} + '@esbuild/aix-ppc64@0.25.12': + optional: true + '@esbuild/aix-ppc64@0.27.2': optional: true '@esbuild/aix-ppc64@0.28.1': optional: true + '@esbuild/android-arm64@0.25.12': + optional: true + '@esbuild/android-arm64@0.27.2': optional: true '@esbuild/android-arm64@0.28.1': optional: true + '@esbuild/android-arm@0.25.12': + optional: true + '@esbuild/android-arm@0.27.2': optional: true '@esbuild/android-arm@0.28.1': optional: true + '@esbuild/android-x64@0.25.12': + optional: true + '@esbuild/android-x64@0.27.2': optional: true '@esbuild/android-x64@0.28.1': optional: true + '@esbuild/darwin-arm64@0.25.12': + optional: true + '@esbuild/darwin-arm64@0.27.2': optional: true '@esbuild/darwin-arm64@0.28.1': optional: true + '@esbuild/darwin-x64@0.25.12': + optional: true + '@esbuild/darwin-x64@0.27.2': optional: true '@esbuild/darwin-x64@0.28.1': optional: true + '@esbuild/freebsd-arm64@0.25.12': + optional: true + '@esbuild/freebsd-arm64@0.27.2': optional: true '@esbuild/freebsd-arm64@0.28.1': optional: true + '@esbuild/freebsd-x64@0.25.12': + optional: true + '@esbuild/freebsd-x64@0.27.2': optional: true '@esbuild/freebsd-x64@0.28.1': optional: true + '@esbuild/linux-arm64@0.25.12': + optional: true + '@esbuild/linux-arm64@0.27.2': optional: true '@esbuild/linux-arm64@0.28.1': optional: true + '@esbuild/linux-arm@0.25.12': + optional: true + '@esbuild/linux-arm@0.27.2': optional: true '@esbuild/linux-arm@0.28.1': optional: true + '@esbuild/linux-ia32@0.25.12': + optional: true + '@esbuild/linux-ia32@0.27.2': optional: true '@esbuild/linux-ia32@0.28.1': optional: true + '@esbuild/linux-loong64@0.25.12': + optional: true + '@esbuild/linux-loong64@0.27.2': optional: true '@esbuild/linux-loong64@0.28.1': optional: true + '@esbuild/linux-mips64el@0.25.12': + optional: true + '@esbuild/linux-mips64el@0.27.2': optional: true '@esbuild/linux-mips64el@0.28.1': optional: true + '@esbuild/linux-ppc64@0.25.12': + optional: true + '@esbuild/linux-ppc64@0.27.2': optional: true '@esbuild/linux-ppc64@0.28.1': optional: true + '@esbuild/linux-riscv64@0.25.12': + optional: true + '@esbuild/linux-riscv64@0.27.2': optional: true '@esbuild/linux-riscv64@0.28.1': optional: true + '@esbuild/linux-s390x@0.25.12': + optional: true + '@esbuild/linux-s390x@0.27.2': optional: true '@esbuild/linux-s390x@0.28.1': optional: true + '@esbuild/linux-x64@0.25.12': + optional: true + '@esbuild/linux-x64@0.27.2': optional: true '@esbuild/linux-x64@0.28.1': optional: true + '@esbuild/netbsd-arm64@0.25.12': + optional: true + '@esbuild/netbsd-arm64@0.27.2': optional: true '@esbuild/netbsd-arm64@0.28.1': optional: true + '@esbuild/netbsd-x64@0.25.12': + optional: true + '@esbuild/netbsd-x64@0.27.2': optional: true '@esbuild/netbsd-x64@0.28.1': optional: true + '@esbuild/openbsd-arm64@0.25.12': + optional: true + '@esbuild/openbsd-arm64@0.27.2': optional: true '@esbuild/openbsd-arm64@0.28.1': optional: true + '@esbuild/openbsd-x64@0.25.12': + optional: true + '@esbuild/openbsd-x64@0.27.2': optional: true '@esbuild/openbsd-x64@0.28.1': optional: true + '@esbuild/openharmony-arm64@0.25.12': + optional: true + '@esbuild/openharmony-arm64@0.27.2': optional: true '@esbuild/openharmony-arm64@0.28.1': optional: true + '@esbuild/sunos-x64@0.25.12': + optional: true + '@esbuild/sunos-x64@0.27.2': optional: true '@esbuild/sunos-x64@0.28.1': optional: true + '@esbuild/win32-arm64@0.25.12': + optional: true + '@esbuild/win32-arm64@0.27.2': optional: true '@esbuild/win32-arm64@0.28.1': optional: true + '@esbuild/win32-ia32@0.25.12': + optional: true + '@esbuild/win32-ia32@0.27.2': optional: true '@esbuild/win32-ia32@0.28.1': optional: true + '@esbuild/win32-x64@0.25.12': + optional: true + '@esbuild/win32-x64@0.27.2': optional: true @@ -3841,6 +5349,10 @@ snapshots: '@headlessui/tailwindcss@0.2.2': {} + '@hono/node-server@2.1.6(hono@4.13.17)': + dependencies: + hono: 4.13.17 + '@hpke/common@1.10.1': {} '@hpke/core@1.9.0': @@ -3875,6 +5387,10 @@ snapshots: dependencies: '@swc/helpers': 0.5.21 + '@isaacs/fs-minipass@4.0.1': + dependencies: + minipass: 7.1.3 + '@joaomoreno/unique-names-generator@5.2.0': {} '@jupyterlab/nbformat@3.4.3': @@ -3970,6 +5486,28 @@ snapshots: dependencies: '@nevware21/ts-utils': 0.14.0 + '@modelcontextprotocol/sdk@1.32.2(zod@4.6.7)': + dependencies: + '@hono/node-server': 2.1.6(hono@4.13.17) + ajv: 8.20.0 + ajv-formats: 3.0.1 + content-type: 1.0.5 + cors: 2.8.6 + cross-spawn: 7.0.6 + eventsource: 3.0.7 + eventsource-parser: 3.1.1 + express: 5.3.0 + express-rate-limit: 8.7.3(express@5.3.0) + hono: 4.13.17 + jose: 6.2.15 + json-schema-typed: 8.0.2 + pkce-challenge: 5.0.1 + raw-body: 3.0.2 + zod: 4.6.7 + zod-to-json-schema: 3.25.2(zod@4.6.7) + transitivePeerDependencies: + - supports-color + '@napi-rs/canvas-android-arm64@0.1.100': optional: true @@ -4024,6 +5562,18 @@ snapshots: '@nevware21/ts-utils@0.14.0': {} + '@nodelib/fs.scandir@2.1.5': + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + + '@nodelib/fs.stat@2.0.5': {} + + '@nodelib/fs.walk@1.2.8': + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.20.3 + '@octokit/auth-token@5.1.2': {} '@octokit/core@6.1.5': @@ -4129,6 +5679,82 @@ snapshots: dependencies: react: 19.2.6 + '@secretlint/config-creator@10.2.2': + dependencies: + '@secretlint/types': 10.2.2 + + '@secretlint/config-loader@10.2.2': + dependencies: + '@secretlint/profiler': 10.2.2 + '@secretlint/resolver': 10.2.2 + '@secretlint/types': 10.2.2 + ajv: 8.20.0 + debug: 4.4.3 + rc-config-loader: 4.1.4 + transitivePeerDependencies: + - supports-color + + '@secretlint/core@10.2.2': + dependencies: + '@secretlint/profiler': 10.2.2 + '@secretlint/types': 10.2.2 + debug: 4.4.3 + structured-source: 4.0.0 + transitivePeerDependencies: + - supports-color + + '@secretlint/formatter@10.2.2': + dependencies: + '@secretlint/resolver': 10.2.2 + '@secretlint/types': 10.2.2 + '@textlint/linter-formatter': 15.8.0 + '@textlint/module-interop': 15.8.0 + '@textlint/types': 15.8.0 + chalk: 5.6.2 + debug: 4.4.3 + pluralize: 8.0.0 + strip-ansi: 7.2.0 + table: 6.10.1 + terminal-link: 4.0.0 + transitivePeerDependencies: + - supports-color + + '@secretlint/node@10.2.2': + dependencies: + '@secretlint/config-loader': 10.2.2 + '@secretlint/core': 10.2.2 + '@secretlint/formatter': 10.2.2 + '@secretlint/profiler': 10.2.2 + '@secretlint/source-creator': 10.2.2 + '@secretlint/types': 10.2.2 + debug: 4.4.3 + p-map: 7.1.1 + transitivePeerDependencies: + - supports-color + + '@secretlint/profiler@10.2.2': {} + + '@secretlint/resolver@10.2.2': {} + + '@secretlint/secretlint-formatter-sarif@10.2.2': + dependencies: + node-sarif-builder: 3.4.0 + + '@secretlint/secretlint-rule-no-dotenv@10.2.2': + dependencies: + '@secretlint/types': 10.2.2 + + '@secretlint/secretlint-rule-preset-recommend@10.2.2': {} + + '@secretlint/source-creator@10.2.2': + dependencies: + '@secretlint/types': 10.2.2 + istextorbinary: 9.5.0 + + '@secretlint/types@10.2.2': {} + + '@sindresorhus/merge-streams@2.3.0': {} + '@sinonjs/commons@1.8.3': dependencies: type-detect: 4.0.8 @@ -4161,6 +5787,34 @@ snapshots: '@tanstack/virtual-core@3.14.0': {} + '@textlint/ast-node-types@15.8.0': {} + + '@textlint/linter-formatter@15.8.0': + dependencies: + '@azu/format-text': 1.0.2 + '@azu/style-format': 1.0.1 + '@textlint/module-interop': 15.8.0 + '@textlint/resolver': 15.8.0 + '@textlint/types': 15.8.0 + debug: 4.4.3 + js-yaml: 4.3.2 + lodash: 4.18.1 + pluralize: 2.0.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + table: 6.10.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + + '@textlint/module-interop@15.8.0': {} + + '@textlint/resolver@15.8.0': {} + + '@textlint/types@15.8.0': + dependencies: + '@textlint/ast-node-types': 15.8.0 + '@tokenizer/inflate@0.4.1': dependencies: debug: 4.4.3 @@ -4170,6 +5824,10 @@ snapshots: '@tokenizer/token@0.3.0': {} + '@types/adm-zip@0.5.8': + dependencies: + '@types/node': 22.20.5 + '@types/byline@4.2.32': dependencies: '@types/node': 24.12.4 @@ -4340,8 +5998,6 @@ snapshots: '@types/minimatch@3.0.3': {} - '@types/minimatch@5.1.2': {} - '@types/mocha@10.0.10': {} '@types/ms@2.1.0': {} @@ -4350,16 +6006,26 @@ snapshots: dependencies: '@types/node': 24.12.4 + '@types/node@22.20.5': + dependencies: + undici-types: 6.21.0 + '@types/node@24.12.4': dependencies: undici-types: 7.16.0 '@types/node@6.0.78': {} + '@types/normalize-package-data@2.4.4': {} + '@types/picomatch@2.3.0': {} + '@types/sarif@2.1.7': {} + '@types/semver@5.5.0': {} + '@types/semver@7.8.0': {} + '@types/sinon@10.0.2': dependencies: '@sinonjs/fake-timers': 7.1.2 @@ -4377,10 +6043,19 @@ snapshots: '@types/vscode-webview@1.57.0': {} - '@types/which@2.0.0': {} + '@types/vscode@1.96.0': {} '@types/which@3.0.0': {} + '@typespec/ts-http-runtime@0.3.10': + dependencies: + http-proxy-agent: 9.1.0 + https-proxy-agent: 9.1.0 + tslib: 2.8.1 + transitivePeerDependencies: + - kerberos + - supports-color + '@upsetjs/venn.js@2.0.0': optionalDependencies: d3-selection: 3.0.0 @@ -4459,7 +6134,7 @@ snapshots: '@vscode/l10n@0.0.18': {} - '@vscode/markdown-editor@0.0.2-153': + '@vscode/markdown-editor@0.0.2-181': dependencies: '@vscode/codicons': 0.0.46-36 '@vscode/diff': 0.0.2-0 @@ -4500,8 +6175,94 @@ snapshots: '@vscode/sync-api-common': 0.7.2 vscode-uri: 3.0.3 + '@vscode/test-electron@2.5.2': + dependencies: + http-proxy-agent: 7.0.2 + https-proxy-agent: 7.0.6 + jszip: 3.10.2 + ora: 8.2.0 + semver: 7.8.5 + transitivePeerDependencies: + - supports-color + '@vscode/ts-package-manager@0.0.2': {} + '@vscode/vsce-sign-alpine-arm64@2.0.8': + optional: true + + '@vscode/vsce-sign-alpine-x64@2.0.8': + optional: true + + '@vscode/vsce-sign-darwin-arm64@2.0.8': + optional: true + + '@vscode/vsce-sign-darwin-x64@2.0.8': + optional: true + + '@vscode/vsce-sign-linux-arm64@2.0.8': + optional: true + + '@vscode/vsce-sign-linux-arm@2.0.8': + optional: true + + '@vscode/vsce-sign-linux-x64@2.0.8': + optional: true + + '@vscode/vsce-sign-win32-arm64@2.0.8': + optional: true + + '@vscode/vsce-sign-win32-x64@2.0.8': + optional: true + + '@vscode/vsce-sign@2.1.1': + optionalDependencies: + '@vscode/vsce-sign-alpine-arm64': 2.0.8 + '@vscode/vsce-sign-alpine-x64': 2.0.8 + '@vscode/vsce-sign-darwin-arm64': 2.0.8 + '@vscode/vsce-sign-darwin-x64': 2.0.8 + '@vscode/vsce-sign-linux-arm': 2.0.8 + '@vscode/vsce-sign-linux-arm64': 2.0.8 + '@vscode/vsce-sign-linux-x64': 2.0.8 + '@vscode/vsce-sign-win32-arm64': 2.0.8 + '@vscode/vsce-sign-win32-x64': 2.0.8 + + '@vscode/vsce@3.9.2': + dependencies: + '@azure/identity': 4.14.1 + '@secretlint/node': 10.2.2 + '@secretlint/secretlint-formatter-sarif': 10.2.2 + '@secretlint/secretlint-rule-no-dotenv': 10.2.2 + '@secretlint/secretlint-rule-preset-recommend': 10.2.2 + '@vscode/vsce-sign': 2.1.1 + azure-devops-node-api: 12.5.0 + chalk: 4.1.2 + cheerio: 1.2.0 + cockatiel: 3.2.1 + commander: 12.1.0 + form-data: 4.0.6 + glob: 13.0.7 + hosted-git-info: 4.1.0 + jsonc-parser: 3.2.0 + leven: 3.1.0 + markdown-it: 14.3.3 + mime: 1.6.0 + minimatch: 10.2.6 + parse-semver: 1.1.1 + read: 1.0.7 + secretlint: 10.2.2 + semver: 7.8.5 + tmp: 0.2.7 + typed-rest-client: 1.8.11 + url-join: 4.0.1 + xml2js: 0.5.0 + yauzl: 3.4.0 + yazl: 2.5.1 + optionalDependencies: + keytar: 7.9.0 + transitivePeerDependencies: + - kerberos + - supports-color + '@vscode/web-editors@0.0.2-104(zod@4.4.3)': dependencies: '@vscode/hubrpc': 0.0.2-54(zod@4.4.3) @@ -4526,6 +6287,45 @@ snapshots: - utf-8-validate - zod + '@xmcl/asm@1.0.1': {} + + '@xmcl/core@2.16.2': + dependencies: + '@xmcl/unzip': 2.2.0 + + '@xmcl/file-transfer@2.1.4': + dependencies: + undici: 7.29.1 + + '@xmcl/forge-site-parser@2.0.9': + dependencies: + node-html-parser: 6.1.13 + + '@xmcl/installer@6.3.6': + dependencies: + '@xmcl/asm': 1.0.1 + '@xmcl/core': 2.16.2 + '@xmcl/file-transfer': 2.1.4 + '@xmcl/forge-site-parser': 2.0.9 + '@xmcl/unzip': 2.2.0 + '@xmcl/yauzl': 2.10.0 + tar-stream: 3.2.2 + undici: 7.29.1 + yazl: 2.5.1 + transitivePeerDependencies: + - bare-abort-controller + - bare-buffer + - react-native-b4a + + '@xmcl/unzip@2.2.0': + dependencies: + '@xmcl/yauzl': 2.10.0 + + '@xmcl/yauzl@2.10.0': + dependencies: + buffer-crc32: 0.2.13 + fd-slicer: 1.1.0 + '@zenuml/core@3.50.1': dependencies: '@floating-ui/react': 0.27.19(react-dom@19.2.6(react@19.2.6))(react@19.2.6) @@ -4551,14 +6351,40 @@ snapshots: - '@types/react' - tailwindcss + accepts@2.0.0: + dependencies: + mime-types: 3.0.2 + negotiator: 1.1.0 + acorn@8.16.0: {} + adm-zip@0.6.1: {} + agent-base@7.1.4: {} + agent-base@9.0.0: {} + + ajv-formats@3.0.1: + dependencies: + ajv: 8.20.0 + + ajv@8.20.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.9 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + ansi-colors@4.1.3: {} + ansi-escapes@7.3.0: + dependencies: + environment: 1.1.0 + ansi-regex@5.0.1: {} + ansi-regex@6.6.0: {} + ansi-styles@4.2.1: dependencies: '@types/color-name': 1.1.1 @@ -4571,24 +6397,66 @@ snapshots: normalize-path: 3.0.0 picomatch: 2.3.2 - argparse@1.0.10: - dependencies: - sprintf-js: 1.0.3 - argparse@2.0.1: {} aria-hidden@1.2.6: dependencies: tslib: 2.8.1 + astral-regex@2.0.0: {} + + asynckit@0.4.0: {} + available-typed-arrays@1.0.7: dependencies: possible-typed-array-names: 1.1.0 + azure-devops-node-api@12.5.0: + dependencies: + tunnel: 0.0.6 + typed-rest-client: 1.8.11 + + b4a@1.9.0: {} + balanced-match@1.0.2: {} balanced-match@4.0.4: {} + bare-buffer@3.7.1: {} + + bare-events@2.9.2: {} + + bare-fs@4.8.4: + dependencies: + bare-events: 2.9.2 + bare-path: 3.1.2 + bare-stream: 2.13.4(bare-events@2.9.2) + bare-url: 2.5.6 + fast-fifo: 1.3.2 + transitivePeerDependencies: + - bare-abort-controller + - react-native-b4a + + bare-path@3.1.2: {} + + bare-stream@2.13.4(bare-events@2.9.2): + dependencies: + b4a: 1.9.0 + streamx: 2.28.1 + teex: 1.0.1 + optionalDependencies: + bare-events: 2.9.2 + transitivePeerDependencies: + - react-native-b4a + + bare-url@2.5.6: + dependencies: + bare-buffer: 3.7.1 + bare-path: 3.1.2 + + base64-js@1.5.1: + optional: true + before-after-hook@3.0.2: {} bidi-js@1.0.3: @@ -4597,8 +6465,35 @@ snapshots: binary-extensions@2.2.0: {} + binaryextensions@6.11.0: + dependencies: + editions: 6.22.0 + + bl@4.1.0: + dependencies: + buffer: 5.7.1 + inherits: 2.0.4 + readable-stream: 3.6.2 + optional: true + + body-parser@2.4.0: + dependencies: + bytes: 3.1.2 + content-type: 2.1.0 + debug: 4.4.3 + http-errors: 2.0.1 + iconv-lite: 0.7.3 + on-finished: 2.4.2 + qs: 6.17.1 + raw-body: 3.0.2 + type-is: 2.1.0 + transitivePeerDependencies: + - supports-color + boolbase@1.0.0: {} + boundary@2.0.0: {} + brace-expansion@1.1.21: dependencies: balanced-match: 1.0.2 @@ -4618,10 +6513,24 @@ snapshots: browser-stdout@1.3.1: {} + buffer-crc32@0.2.13: {} + buffer-equal-constant-time@1.0.1: {} + buffer@5.7.1: + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + optional: true + + bundle-name@4.1.1: + dependencies: + run-applescript: 7.1.0 + byline@5.0.0: {} + bytes@3.1.2: {} + call-bind-apply-helpers@1.0.2: dependencies: es-errors: 1.3.0 @@ -4646,8 +6555,33 @@ snapshots: ansi-styles: 4.2.1 supports-color: 7.2.0 + chalk@5.6.2: {} + character-entities@2.0.2: {} + cheerio-select@2.1.0: + dependencies: + boolbase: 1.0.0 + css-select: 5.1.0 + css-what: 6.1.0 + domelementtype: 2.3.0 + domhandler: 5.0.3 + domutils: 3.2.2 + + cheerio@1.2.0: + dependencies: + cheerio-select: 2.1.0 + dom-serializer: 2.0.0 + domhandler: 5.0.3 + domutils: 3.2.2 + encoding-sniffer: 0.2.1 + htmlparser2: 10.1.0 + parse5: 7.3.0 + parse5-htmlparser2-tree-adapter: 7.1.0 + parse5-parser-stream: 7.1.2 + undici: 7.29.1 + whatwg-mimetype: 4.0.0 + chevrotain@13.2.0: dependencies: '@chevrotain/cst-dts-gen': 13.2.0 @@ -4668,10 +6602,21 @@ snapshots: optionalDependencies: fsevents: 2.3.2 + chownr@1.1.4: + optional: true + + chownr@3.0.0: {} + class-variance-authority@0.7.1: dependencies: clsx: 2.1.1 + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + + cli-spinners@2.9.2: {} + cliui@7.0.4: dependencies: string-width: 4.2.3 @@ -4686,6 +6631,8 @@ snapshots: clsx@2.1.1: {} + cockatiel@3.2.1: {} + coffeescript@1.12.7: {} color-convert@2.0.1: @@ -4700,6 +6647,12 @@ snapshots: dependencies: color-name: 2.1.0 + combined-stream@1.0.8: + dependencies: + delayed-stream: 1.0.0 + + commander@12.1.0: {} + commander@15.0.0: {} commander@7.2.0: {} @@ -4710,6 +6663,23 @@ snapshots: confbox@0.1.8: {} + content-disposition@2.0.1: {} + + content-type@1.0.5: {} + + content-type@2.1.0: {} + + cookie-signature@1.2.2: {} + + cookie@0.7.2: {} + + core-util-is@1.0.3: {} + + cors@2.8.6: + dependencies: + object-assign: 4.1.1 + vary: 1.1.2 + cose-base@1.0.3: dependencies: layout-base: 1.0.2 @@ -4718,6 +6688,12 @@ snapshots: dependencies: layout-base: 2.0.1 + cross-spawn@7.0.6: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + cson-parser@4.0.9: dependencies: coffeescript: 1.12.7 @@ -4959,16 +6935,37 @@ snapshots: dependencies: character-entities: 2.0.2 + decompress-response@6.0.0: + dependencies: + mimic-response: 3.1.0 + optional: true + + deep-extend@0.6.0: + optional: true + + default-browser-id@5.0.1: {} + + default-browser@5.5.1: + dependencies: + bundle-name: 4.1.1 + default-browser-id: 5.0.1 + define-data-property@1.1.4: dependencies: es-define-property: 1.0.1 es-errors: 1.3.0 gopd: 1.2.0 + define-lazy-prop@3.0.0: {} + delaunator@5.1.0: dependencies: robust-predicates: 3.0.3 + delayed-stream@1.0.0: {} + + depd@2.0.0: {} + dequal@2.0.3: {} detect-indent@6.1.0: {} @@ -5017,6 +7014,12 @@ snapshots: dependencies: safe-buffer: 5.2.1 + editions@6.22.0: + dependencies: + version-range: 4.15.0 + + ee-first@1.1.1: {} + elkjs@0.9.3: {} emmet@2.4.11: @@ -5024,14 +7027,32 @@ snapshots: '@emmetio/abbreviation': 2.3.3 '@emmetio/css-abbreviation': 2.1.8 + emoji-regex@10.6.0: {} + emoji-regex@8.0.0: {} + encodeurl@2.0.1: {} + + encoding-sniffer@0.2.1: + dependencies: + iconv-lite: 0.6.3 + whatwg-encoding: 3.1.1 + + end-of-stream@1.4.5: + dependencies: + once: 1.4.0 + optional: true + entities@4.4.0: {} entities@4.5.0: {} entities@6.0.1: {} + entities@7.0.1: {} + + environment@1.1.0: {} + es-define-property@1.0.1: {} es-errors@1.3.0: {} @@ -5040,8 +7061,44 @@ snapshots: dependencies: es-errors: 1.3.0 + es-set-tostringtag@2.1.0: + dependencies: + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + has-tostringtag: 1.0.2 + hasown: 2.0.4 + es-toolkit@1.46.1: {} + esbuild@0.25.12: + optionalDependencies: + '@esbuild/aix-ppc64': 0.25.12 + '@esbuild/android-arm': 0.25.12 + '@esbuild/android-arm64': 0.25.12 + '@esbuild/android-x64': 0.25.12 + '@esbuild/darwin-arm64': 0.25.12 + '@esbuild/darwin-x64': 0.25.12 + '@esbuild/freebsd-arm64': 0.25.12 + '@esbuild/freebsd-x64': 0.25.12 + '@esbuild/linux-arm': 0.25.12 + '@esbuild/linux-arm64': 0.25.12 + '@esbuild/linux-ia32': 0.25.12 + '@esbuild/linux-loong64': 0.25.12 + '@esbuild/linux-mips64el': 0.25.12 + '@esbuild/linux-ppc64': 0.25.12 + '@esbuild/linux-riscv64': 0.25.12 + '@esbuild/linux-s390x': 0.25.12 + '@esbuild/linux-x64': 0.25.12 + '@esbuild/netbsd-arm64': 0.25.12 + '@esbuild/netbsd-x64': 0.25.12 + '@esbuild/openbsd-arm64': 0.25.12 + '@esbuild/openbsd-x64': 0.25.12 + '@esbuild/openharmony-arm64': 0.25.12 + '@esbuild/sunos-x64': 0.25.12 + '@esbuild/win32-arm64': 0.25.12 + '@esbuild/win32-ia32': 0.25.12 + '@esbuild/win32-x64': 0.25.12 + esbuild@0.27.2: optionalDependencies: '@esbuild/aix-ppc64': 0.27.2 @@ -5102,18 +7159,98 @@ snapshots: escalade@3.2.0: {} + escape-html@1.0.3: {} + escape-string-regexp@4.0.0: {} - esprima@4.0.1: {} + etag@1.8.1: {} + + events-universal@1.0.1: + dependencies: + bare-events: 2.9.2 + transitivePeerDependencies: + - bare-abort-controller + + eventsource-parser@3.1.1: {} + + eventsource@3.0.7: + dependencies: + eventsource-parser: 3.1.1 + + expand-template@2.0.3: + optional: true + + express-rate-limit@8.7.3(express@5.3.0): + dependencies: + debug: 4.4.3 + express: 5.3.0 + ip-address: 10.7.6 + transitivePeerDependencies: + - supports-color + + express@5.3.0: + dependencies: + accepts: 2.0.0 + body-parser: 2.4.0 + content-disposition: 2.0.1 + content-type: 2.1.0 + cookie: 0.7.2 + cookie-signature: 1.2.2 + debug: 4.4.3 + depd: 2.0.0 + encodeurl: 2.0.1 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 2.1.1 + fresh: 2.0.0 + http-errors: 2.0.1 + merge-descriptors: 2.0.0 + mime-types: 3.0.2 + on-finished: 2.4.2 + once: 1.4.0 + parseurl: 1.3.3 + proxy-addr: 2.0.8 + qs: 6.17.1 + range-parser: 1.3.0 + router: 2.2.0 + send: 1.2.1 + serve-static: 2.2.1 + statuses: 2.0.2 + type-is: 2.1.0 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color fast-content-type-parse@2.0.1: {} + fast-deep-equal@3.1.3: {} + + fast-fifo@1.3.2: {} + + fast-glob@3.3.3: + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.8 + fast-plist@0.1.2: {} + fast-uri@3.1.9: {} + + fastq@1.20.3: + dependencies: + reusify: 1.1.0 + fault@2.0.1: dependencies: format: 0.2.2 + fd-slicer@1.1.0: + dependencies: + pend: 1.2.0 + file-type@21.3.2: dependencies: '@tokenizer/inflate': 0.4.1 @@ -5127,34 +7264,67 @@ snapshots: dependencies: to-regex-range: 5.0.1 + finalhandler@2.1.1: + dependencies: + debug: 4.4.3 + encodeurl: 2.0.1 + escape-html: 1.0.3 + on-finished: 2.4.2 + parseurl: 1.3.3 + statuses: 2.0.2 + transitivePeerDependencies: + - supports-color + find-up@5.0.0: dependencies: locate-path: 6.0.0 path-exists: 4.0.0 - find-yarn-workspace-root@2.0.0: - dependencies: - micromatch: 4.0.8 - flat@5.0.2: {} for-each@0.3.5: dependencies: is-callable: 1.2.7 + form-data@4.0.6: + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + es-set-tostringtag: 2.1.0 + hasown: 2.0.4 + mime-types: 2.1.35 + format@0.2.2: {} + forwarded@0.2.0: {} + + fresh@2.0.0: {} + + fs-constants@1.0.0: + optional: true + + fs-extra@11.4.1: + dependencies: + graceful-fs: 4.2.11 + jsonfile: 6.2.1 + universalify: 2.0.1 + fs.realpath@1.0.0: {} fsevents@2.3.2: optional: true + fsevents@2.3.3: + optional: true + function-bind@1.1.2: {} generator-function@2.0.1: {} get-caller-file@2.0.5: {} + get-east-asian-width@1.7.0: {} + get-intrinsic@1.3.0: dependencies: call-bind-apply-helpers: 1.0.2 @@ -5173,10 +7343,19 @@ snapshots: dunder-proto: 1.0.1 es-object-atoms: 1.1.1 + github-from-package@0.0.0: + optional: true + glob-parent@5.1.2: dependencies: is-glob: 4.0.3 + glob@13.0.7: + dependencies: + minimatch: 10.2.6 + minipass: 7.1.3 + path-scurry: 2.0.2 + glob@5.0.15: dependencies: inflight: 1.0.6 @@ -5193,6 +7372,15 @@ snapshots: minimatch: 5.1.9 once: 1.4.0 + globby@14.1.0: + dependencies: + '@sindresorhus/merge-streams': 2.3.0 + fast-glob: 3.3.3 + ignore: 7.0.14 + path-type: 6.0.0 + slash: 5.1.0 + unicorn-magic: 0.3.0 + gopd@1.2.0: {} graceful-fs@4.2.11: {} @@ -5228,6 +7416,16 @@ snapshots: highlight.js@11.8.0: {} + hono@4.13.17: {} + + hosted-git-info@4.1.0: + dependencies: + lru-cache: 6.0.0 + + hosted-git-info@7.0.2: + dependencies: + lru-cache: 10.4.3 + html-encoding-sniffer@6.0.0: dependencies: '@exodus/bytes': 1.15.0 @@ -5236,6 +7434,21 @@ snapshots: html-to-image@1.11.13: {} + htmlparser2@10.1.0: + dependencies: + domelementtype: 2.3.0 + domhandler: 5.0.3 + domutils: 3.2.2 + entities: 7.0.1 + + http-errors@2.0.1: + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.2 + toidentifier: 1.0.1 + http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.4 @@ -5243,6 +7456,15 @@ snapshots: transitivePeerDependencies: - supports-color + http-proxy-agent@9.1.0: + dependencies: + agent-base: 9.0.0 + debug: 4.4.3 + proxy-agent-negotiate: 1.1.0 + transitivePeerDependencies: + - kerberos + - supports-color + https-proxy-agent@7.0.6: dependencies: agent-base: 7.1.4 @@ -5250,16 +7472,35 @@ snapshots: transitivePeerDependencies: - supports-color + https-proxy-agent@9.1.0: + dependencies: + agent-base: 9.0.0 + debug: 4.4.3 + proxy-agent-negotiate: 1.1.0 + transitivePeerDependencies: + - kerberos + - supports-color + iconv-lite@0.6.3: dependencies: safer-buffer: 2.1.2 + iconv-lite@0.7.3: + dependencies: + safer-buffer: 2.1.2 + ieee754@1.2.1: {} + ignore@7.0.14: {} + image-size@1.0.2: dependencies: queue: 6.0.2 + immediate@3.0.6: {} + + index-to-position@1.2.0: {} + inflight@1.0.6: dependencies: once: 1.4.0 @@ -5267,10 +7508,17 @@ snapshots: inherits@2.0.4: {} + ini@1.3.8: + optional: true + internmap@1.0.1: {} internmap@2.0.3: {} + ip-address@10.7.6: {} + + ipaddr.js@1.9.1: {} + is-arguments@1.1.1: dependencies: call-bind: 1.0.9 @@ -5282,6 +7530,8 @@ snapshots: is-callable@1.2.7: {} + is-docker@3.0.0: {} + is-extglob@2.1.1: {} is-fullwidth-code-point@3.0.0: {} @@ -5298,12 +7548,22 @@ snapshots: dependencies: is-extglob: 2.1.1 + is-in-ssh@1.0.0: {} + + is-inside-container@1.0.0: + dependencies: + is-docker: 3.0.0 + + is-interactive@2.0.0: {} + is-number@7.0.0: {} is-plain-obj@2.1.0: {} is-potential-custom-element-name@1.0.1: {} + is-promise@4.0.0: {} + is-regex@1.2.1: dependencies: call-bound: 1.0.4 @@ -5317,20 +7577,35 @@ snapshots: is-unicode-supported@0.1.0: {} + is-unicode-supported@1.3.0: {} + + is-unicode-supported@2.1.0: {} + + is-wsl@3.1.1: + dependencies: + is-inside-container: 1.0.0 + isarray@0.0.1: {} + isarray@1.0.0: {} + isexe@2.0.0: {} isexe@3.1.1: {} + istextorbinary@9.5.0: + dependencies: + binaryextensions: 6.11.0 + editions: 6.22.0 + textextensions: 6.11.0 + + jose@6.2.15: {} + jotai@2.20.0(react@19.2.6): optionalDependencies: react: 19.2.6 - js-yaml@3.15.2: - dependencies: - argparse: 1.0.10 - esprima: 4.0.1 + js-tokens@4.0.0: {} js-yaml@4.3.2: dependencies: @@ -5363,6 +7638,10 @@ snapshots: - '@noble/hashes' - supports-color + json-schema-traverse@1.0.0: {} + + json-schema-typed@8.0.2: {} + json5@2.2.3: {} jsonc-parser@2.3.1: {} @@ -5371,6 +7650,12 @@ snapshots: jsonc-parser@4.0.0-next.1: {} + jsonfile@6.2.1: + dependencies: + universalify: 2.0.1 + optionalDependencies: + graceful-fs: 4.2.11 + jsonwebtoken@9.0.2: dependencies: jws: 3.2.3 @@ -5382,7 +7667,14 @@ snapshots: lodash.isstring: 4.0.1 lodash.once: 4.1.1 ms: 2.1.3 - semver: 7.6.2 + semver: 7.8.5 + + jszip@3.10.2: + dependencies: + lie: 3.3.0 + pako: 1.0.11 + readable-stream: 2.3.8 + setimmediate: 1.0.5 just-extend@4.2.1: {} @@ -5409,6 +7701,12 @@ snapshots: dependencies: commander: 15.0.0 + keytar@7.9.0: + dependencies: + node-addon-api: 4.3.0 + prebuild-install: 7.1.3 + optional: true + keytar@file:microsoft-authentication/packageMocks/keytar: {} khroma@2.1.0: {} @@ -5417,16 +7715,15 @@ snapshots: layout-base@2.0.1: {} - linkify-it@5.0.2: + leven@3.1.0: {} + + lie@3.3.0: dependencies: - uc.micro: 2.1.0 + immediate: 3.0.6 - load-yaml-file@0.2.0: + linkify-it@5.0.2: dependencies: - graceful-fs: 4.2.11 - js-yaml: 3.15.2 - pify: 4.0.1 - strip-bom: 3.0.0 + uc.micro: 2.1.0 locate-path@6.0.0: dependencies: @@ -5452,11 +7749,20 @@ snapshots: lodash.throttle@4.1.1: {} + lodash@4.18.1: {} + log-symbols@4.1.0: dependencies: chalk: 4.1.2 is-unicode-supported: 0.1.0 + log-symbols@6.0.0: + dependencies: + chalk: 5.6.2 + is-unicode-supported: 1.3.0 + + lru-cache@10.4.3: {} + lru-cache@11.2.6: {} lru-cache@6.0.0: @@ -5491,6 +7797,12 @@ snapshots: mdurl@2.0.0: {} + media-typer@1.1.1: {} + + merge-descriptors@2.0.0: {} + + merge2@1.4.1: {} + mermaid@12.2.0: dependencies: '@braintree/sanitize-url': 7.1.2 @@ -5730,6 +8042,25 @@ snapshots: braces: 3.0.3 picomatch: 2.3.2 + mime-db@1.52.0: {} + + mime-db@1.54.0: {} + + mime-types@2.1.35: + dependencies: + mime-db: 1.52.0 + + mime-types@3.0.2: + dependencies: + mime-db: 1.54.0 + + mime@1.6.0: {} + + mimic-function@5.0.1: {} + + mimic-response@3.1.0: + optional: true + minimatch@10.2.6: dependencies: brace-expansion: 5.0.12 @@ -5738,13 +8069,21 @@ snapshots: dependencies: brace-expansion: 1.1.21 - minimatch@5.1.8: + minimatch@5.1.9: dependencies: brace-expansion: 2.1.7 - minimatch@5.1.9: + minimist@1.2.8: + optional: true + + minipass@7.1.3: {} + + minizlib@3.1.0: dependencies: - brace-expansion: 2.1.7 + minipass: 7.1.3 + + mkdirp-classic@0.5.3: + optional: true mlly@1.8.2: dependencies: @@ -5782,6 +8121,15 @@ snapshots: ms@2.1.3: {} + mute-stream@0.0.8: {} + + napi-build-utils@2.0.0: + optional: true + + negotiator@1.1.0: + dependencies: + content-type: 2.1.0 + nise@5.1.0: dependencies: '@sinonjs/commons': 1.8.3 @@ -5790,6 +8138,14 @@ snapshots: just-extend: 4.2.1 path-to-regexp: 1.9.0 + node-abi@3.101.0: + dependencies: + semver: 7.8.5 + optional: true + + node-addon-api@4.3.0: + optional: true + node-addon-api@7.1.1: {} node-forge@1.4.0: {} @@ -5799,16 +8155,60 @@ snapshots: css-select: 5.1.0 he: 1.2.0 + node-sarif-builder@3.4.0: + dependencies: + '@types/sarif': 2.1.7 + fs-extra: 11.4.1 + + normalize-package-data@6.0.2: + dependencies: + hosted-git-info: 7.0.2 + semver: 7.8.5 + validate-npm-package-license: 3.0.4 + normalize-path@3.0.0: {} nth-check@2.0.1: dependencies: boolbase: 1.0.0 + object-assign@4.1.1: {} + + object-inspect@1.13.4: {} + + on-finished@2.4.2: + dependencies: + ee-first: 1.1.1 + once@1.4.0: dependencies: wrappy: 1.0.2 + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + + open@11.0.4: + dependencies: + default-browser: 5.5.1 + define-lazy-prop: 3.0.0 + is-in-ssh: 1.0.0 + is-inside-container: 1.0.0 + powershell-utils: 0.2.1 + wsl-utils: 1.0.1 + + ora@8.2.0: + dependencies: + chalk: 5.6.2 + cli-cursor: 5.0.0 + cli-spinners: 2.9.2 + is-interactive: 2.0.0 + is-unicode-supported: 2.1.0 + log-symbols: 6.0.0 + stdin-discarder: 0.2.2 + string-width: 7.2.0 + strip-ansi: 7.2.0 + p-limit@3.1.0: dependencies: yocto-queue: 0.1.0 @@ -5817,8 +8217,31 @@ snapshots: dependencies: p-limit: 3.1.0 + p-map@7.1.1: {} + package-manager-detector@1.6.0: {} + pako@1.0.11: {} + + parse-json@8.3.0: + dependencies: + '@babel/code-frame': 7.29.7 + index-to-position: 1.2.0 + type-fest: 4.41.0 + + parse-semver@1.1.1: + dependencies: + semver: 5.7.3 + + parse5-htmlparser2-tree-adapter@7.1.0: + dependencies: + domhandler: 5.0.3 + parse5: 7.3.0 + + parse5-parser-stream@7.1.2: + dependencies: + parse5: 7.3.0 + parse5@3.0.2: dependencies: '@types/node': 6.0.78 @@ -5827,10 +8250,16 @@ snapshots: dependencies: entities: 4.4.0 + parse5@7.3.0: + dependencies: + entities: 6.0.1 + parse5@8.0.0: dependencies: entities: 6.0.1 + parseurl@1.3.3: {} + path-browserify@1.0.1: {} path-data-parser@0.1.0: {} @@ -5839,17 +8268,32 @@ snapshots: path-is-absolute@1.0.1: {} + path-key@3.1.1: {} + + path-scurry@2.0.2: + dependencies: + lru-cache: 11.2.6 + minipass: 7.1.3 + path-to-regexp@1.9.0: dependencies: isarray: 0.0.1 + path-to-regexp@8.4.2: {} + + path-type@6.0.0: {} + pathe@2.0.3: {} + pend@1.2.0: {} + + picocolors@1.1.1: {} + picomatch@2.3.2: {} picomatch@4.0.5: {} - pify@4.0.1: {} + pkce-challenge@5.0.1: {} pkg-types@1.3.1: dependencies: @@ -5865,6 +8309,10 @@ snapshots: optionalDependencies: fsevents: 2.3.2 + pluralize@2.0.0: {} + + pluralize@8.0.0: {} + points-on-curve@0.2.0: {} points-on-path@0.2.1: @@ -5874,14 +8322,82 @@ snapshots: possible-typed-array-names@1.1.0: {} + powershell-utils@0.2.1: {} + + prebuild-install@7.1.3: + dependencies: + detect-libc: 2.1.2 + expand-template: 2.0.3 + github-from-package: 0.0.0 + minimist: 1.2.8 + mkdirp-classic: 0.5.3 + napi-build-utils: 2.0.0 + node-abi: 3.101.0 + pump: 3.0.4 + rc: 1.2.8 + simple-get: 4.0.1 + tar-fs: 2.1.5 + tunnel-agent: 0.6.0 + optional: true + + prettier@3.6.2: {} + + process-nextick-args@2.0.1: {} + + proxy-addr@2.0.8: + dependencies: + forwarded: 0.2.0 + ipaddr.js: 1.9.1 + + proxy-agent-negotiate@1.1.0: {} + + pump@3.0.4: + dependencies: + end-of-stream: 1.4.5 + once: 1.4.0 + optional: true + punycode.js@2.3.1: {} punycode@2.3.1: {} + qs@6.17.1: + dependencies: + es-define-property: 1.0.1 + side-channel: 1.1.1 + + queue-microtask@1.2.3: {} + queue@6.0.2: dependencies: inherits: 2.0.4 + range-parser@1.3.0: {} + + raw-body@3.0.2: + dependencies: + bytes: 3.1.2 + http-errors: 2.0.1 + iconv-lite: 0.7.3 + unpipe: 1.0.0 + + rc-config-loader@4.1.4: + dependencies: + debug: 4.4.3 + js-yaml: 4.3.2 + json5: 2.2.3 + require-from-string: 2.0.2 + transitivePeerDependencies: + - supports-color + + rc@1.2.8: + dependencies: + deep-extend: 0.6.0 + ini: 1.3.8 + minimist: 1.2.8 + strip-json-comments: 2.0.1 + optional: true + react-aria@3.48.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6): dependencies: '@internationalized/date': 3.12.1 @@ -5913,18 +8429,52 @@ snapshots: react@19.2.6: {} + read-pkg@9.0.1: + dependencies: + '@types/normalize-package-data': 2.4.4 + normalize-package-data: 6.0.2 + parse-json: 8.3.0 + type-fest: 4.41.0 + unicorn-magic: 0.1.0 + + read@1.0.7: + dependencies: + mute-stream: 0.0.8 + + readable-stream@2.3.8: + dependencies: + core-util-is: 1.0.3 + inherits: 2.0.4 + isarray: 1.0.0 + process-nextick-args: 2.0.1 + safe-buffer: 5.1.2 + string_decoder: 1.1.1 + util-deprecate: 1.0.2 + + readable-stream@3.6.2: + dependencies: + inherits: 2.0.4 + string_decoder: 1.3.0 + util-deprecate: 1.0.2 + optional: true + readdirp@3.6.0: dependencies: picomatch: 2.3.2 - request-light@0.7.0: {} - request-light@0.8.0: {} require-directory@2.1.1: {} require-from-string@2.0.2: {} + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + + reusify@1.1.0: {} + robust-predicates@3.0.3: {} roughjs@4.6.6: @@ -5934,8 +8484,26 @@ snapshots: points-on-curve: 0.2.0 points-on-path: 0.2.1 + router@2.2.0: + dependencies: + debug: 4.4.3 + depd: 2.0.0 + is-promise: 4.0.0 + parseurl: 1.3.3 + path-to-regexp: 8.4.2 + transitivePeerDependencies: + - supports-color + + run-applescript@7.1.0: {} + + run-parallel@1.2.0: + dependencies: + queue-microtask: 1.2.3 + rw@1.3.3: {} + safe-buffer@5.1.2: {} + safe-buffer@5.2.1: {} safe-regex-test@1.1.0: @@ -5946,26 +8514,61 @@ snapshots: safer-buffer@2.1.2: {} + sax@1.6.1: {} + saxes@6.0.0: dependencies: xmlchars: 2.2.0 scheduler@0.27.0: {} - semver@7.5.2: + secretlint@10.2.2: dependencies: - lru-cache: 6.0.0 + '@secretlint/config-creator': 10.2.2 + '@secretlint/formatter': 10.2.2 + '@secretlint/node': 10.2.2 + '@secretlint/profiler': 10.2.2 + debug: 4.4.3 + globby: 14.1.0 + read-pkg: 9.0.1 + transitivePeerDependencies: + - supports-color - semver@7.5.4: + semver@5.7.3: {} + + semver@7.5.2: dependencies: lru-cache: 6.0.0 - semver@7.6.2: {} - semver@7.8.5: {} + send@1.2.1: + dependencies: + debug: 4.4.3 + encodeurl: 2.0.1 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 2.0.0 + http-errors: 2.0.1 + mime-types: 3.0.2 + ms: 2.1.3 + on-finished: 2.4.2 + range-parser: 1.3.0 + statuses: 2.0.2 + transitivePeerDependencies: + - supports-color + serialize-javascript@7.0.5: {} + serve-static@2.2.1: + dependencies: + encodeurl: 2.0.1 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 1.2.1 + transitivePeerDependencies: + - supports-color + set-function-length@1.2.2: dependencies: define-data-property: 1.1.4 @@ -5975,6 +8578,56 @@ snapshots: gopd: 1.2.0 has-property-descriptors: 1.0.2 + setimmediate@1.0.5: {} + + setprototypeof@1.2.0: {} + + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + + shebang-regex@3.0.0: {} + + side-channel-list@1.0.1: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + + side-channel-map@1.0.1: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + + side-channel-weakmap@1.0.2: + dependencies: + call-bound: 1.0.4 + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + object-inspect: 1.13.4 + side-channel-map: 1.0.1 + + side-channel@1.1.1: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.4 + side-channel-list: 1.0.1 + side-channel-map: 1.0.1 + side-channel-weakmap: 1.0.2 + + signal-exit@4.1.0: {} + + simple-concat@1.0.1: + optional: true + + simple-get@4.0.1: + dependencies: + decompress-response: 6.0.0 + once: 1.4.0 + simple-concat: 1.0.1 + optional: true + sinon@12.0.1: dependencies: '@sinonjs/commons': 1.8.3 @@ -5984,9 +8637,40 @@ snapshots: nise: 5.1.0 supports-color: 7.2.0 + slash@5.1.0: {} + + slice-ansi@4.0.0: + dependencies: + ansi-styles: 4.2.1 + astral-regex: 2.0.0 + is-fullwidth-code-point: 3.0.0 + + smart-buffer@4.2.0: {} + + socks@2.8.10: + dependencies: + ip-address: 10.7.6 + smart-buffer: 4.2.0 + source-map-js@1.2.2: {} - sprintf-js@1.0.3: {} + spdx-correct@3.2.0: + dependencies: + spdx-expression-parse: 3.0.1 + spdx-license-ids: 3.0.24 + + spdx-exceptions@2.5.0: {} + + spdx-expression-parse@3.0.1: + dependencies: + spdx-exceptions: 2.5.0 + spdx-license-ids: 3.0.24 + + spdx-license-ids@3.0.24: {} + + statuses@2.0.2: {} + + stdin-discarder@0.2.2: {} straightforward@4.2.2: dependencies: @@ -5995,17 +8679,46 @@ snapshots: transitivePeerDependencies: - supports-color + streamx@2.28.1: + dependencies: + events-universal: 1.0.1 + fast-fifo: 1.3.2 + text-decoder: 1.2.7 + transitivePeerDependencies: + - bare-abort-controller + - react-native-b4a + string-width@4.2.3: dependencies: emoji-regex: 8.0.0 is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 + string-width@7.2.0: + dependencies: + emoji-regex: 10.6.0 + get-east-asian-width: 1.7.0 + strip-ansi: 7.2.0 + + string_decoder@1.1.1: + dependencies: + safe-buffer: 5.1.2 + + string_decoder@1.3.0: + dependencies: + safe-buffer: 5.2.1 + optional: true + strip-ansi@6.0.1: dependencies: ansi-regex: 5.0.1 - strip-bom@3.0.0: {} + strip-ansi@7.2.0: + dependencies: + ansi-regex: 6.6.0 + + strip-json-comments@2.0.1: + optional: true strip-json-comments@3.1.1: {} @@ -6013,6 +8726,10 @@ snapshots: dependencies: '@tokenizer/token': 0.3.0 + structured-source@4.0.0: + dependencies: + boundary: 2.0.0 + stylis@4.3.6: {} supports-color@7.2.0: @@ -6023,14 +8740,86 @@ snapshots: dependencies: has-flag: 4.0.0 + supports-hyperlinks@3.2.0: + dependencies: + has-flag: 4.0.0 + supports-color: 7.2.0 + symbol-tree@3.2.4: {} tabbable@6.4.0: {} + table@6.10.1: + dependencies: + ajv: 8.20.0 + slice-ansi: 4.0.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + tailwind-merge@3.6.0: {} + tar-fs@2.1.5: + dependencies: + chownr: 1.1.4 + mkdirp-classic: 0.5.3 + pump: 3.0.4 + tar-stream: 2.2.0 + optional: true + + tar-stream@2.2.0: + dependencies: + bl: 4.1.0 + end-of-stream: 1.4.5 + fs-constants: 1.0.0 + inherits: 2.0.4 + readable-stream: 3.6.2 + optional: true + + tar-stream@3.2.2: + dependencies: + b4a: 1.9.0 + bare-fs: 4.8.4 + fast-fifo: 1.3.2 + streamx: 2.28.1 + transitivePeerDependencies: + - bare-abort-controller + - bare-buffer + - react-native-b4a + + tar@7.5.22: + dependencies: + '@isaacs/fs-minipass': 4.0.1 + chownr: 3.0.0 + minipass: 7.1.3 + minizlib: 3.1.0 + yallist: 5.0.0 + tas-client@0.2.33: {} + teex@1.0.1: + dependencies: + streamx: 2.28.1 + transitivePeerDependencies: + - bare-abort-controller + - react-native-b4a + + terminal-link@4.0.0: + dependencies: + ansi-escapes: 7.3.0 + supports-hyperlinks: 3.2.0 + + text-decoder@1.2.7: + dependencies: + b4a: 1.9.0 + transitivePeerDependencies: + - react-native-b4a + + text-table@0.2.0: {} + + textextensions@6.11.0: + dependencies: + editions: 6.22.0 + tinyexec@1.0.4: {} tldts-core@7.0.24: {} @@ -6039,10 +8828,14 @@ snapshots: dependencies: tldts-core: 7.0.24 + tmp@0.2.7: {} + to-regex-range@5.0.1: dependencies: is-number: 7.0.0 + toidentifier@1.0.1: {} + token-types@6.1.2: dependencies: '@borewit/text-codec': 0.2.1 @@ -6061,10 +8854,37 @@ snapshots: tslib@2.8.1: {} + tsx@4.23.15: + dependencies: + esbuild: 0.28.1 + optionalDependencies: + fsevents: 2.3.3 + + tunnel-agent@0.6.0: + dependencies: + safe-buffer: 5.2.1 + optional: true + tunnel@0.0.6: {} type-detect@4.0.8: {} + type-fest@4.41.0: {} + + type-is@2.1.0: + dependencies: + content-type: 2.1.0 + media-typer: 1.1.1 + mime-types: 3.0.2 + + typed-rest-client@1.8.11: + dependencies: + qs: 6.17.1 + tunnel: 0.0.6 + underscore: 1.13.8 + + typescript@5.9.3: {} + typescript@6.0.3: {} uc.micro@2.1.0: {} @@ -6073,16 +8893,32 @@ snapshots: uint8array-extras@1.5.0: {} + underscore@1.13.8: {} + + undici-types@6.21.0: {} + undici-types@7.16.0: {} undici@7.29.1: {} + unicorn-magic@0.1.0: {} + + unicorn-magic@0.3.0: {} + universal-user-agent@7.0.2: {} + universalify@2.0.1: {} + + unpipe@1.0.0: {} + + url-join@4.0.1: {} + use-sync-external-store@1.6.0(react@19.2.6): dependencies: react: 19.2.6 + util-deprecate@1.0.2: {} + util@0.12.5: dependencies: inherits: 2.0.4 @@ -6093,10 +8929,19 @@ snapshots: uuid@11.1.1: {} + validate-npm-package-license@3.0.4: + dependencies: + spdx-correct: 3.2.0 + spdx-expression-parse: 3.0.1 + + vary@1.1.2: {} + + version-range@4.15.0: {} + vscode-css-languageservice@7.0.0-next.2: dependencies: '@vscode/l10n': 0.0.18 - vscode-languageserver-textdocument: 1.0.12 + vscode-languageserver-textdocument: 1.0.14 vscode-languageserver-types: 3.18.3 vscode-uri: 3.2.0 @@ -6134,7 +8979,7 @@ snapshots: vscode-languageclient@9.0.1: dependencies: minimatch: 5.1.9 - semver: 7.5.4 + semver: 7.8.5 vscode-languageserver-protocol: 3.17.5 vscode-languageserver-protocol@3.17.5: @@ -6199,6 +9044,12 @@ snapshots: webidl-conversions@8.0.1: {} + whatwg-encoding@3.1.1: + dependencies: + iconv-lite: 0.6.3 + + whatwg-mimetype@4.0.0: {} + whatwg-mimetype@5.0.0: {} whatwg-url@16.0.1: @@ -6209,11 +9060,6 @@ snapshots: transitivePeerDependencies: - '@noble/hashes' - which-pm@2.2.0: - dependencies: - load-yaml-file: 0.2.0 - path-exists: 4.0.0 - which-typed-array@1.1.20: dependencies: available-typed-arrays: 1.0.7 @@ -6246,14 +9092,28 @@ snapshots: ws@8.22.0: {} + wsl-utils@1.0.1: + dependencies: + is-wsl: 3.1.1 + powershell-utils: 0.2.1 + xml-name-validator@5.0.0: {} + xml2js@0.5.0: + dependencies: + sax: 1.6.1 + xmlbuilder: 11.0.1 + + xmlbuilder@11.0.1: {} + xmlchars@2.2.0: {} y18n@5.0.8: {} yallist@4.0.0: {} + yallist@5.0.0: {} + yaml@2.9.0: {} yargs-parser@20.2.9: {} @@ -6287,8 +9147,20 @@ snapshots: y18n: 5.0.8 yargs-parser: 21.1.1 + yauzl@3.4.0: + dependencies: + pend: 1.2.0 + + yazl@2.5.1: + dependencies: + buffer-crc32: 0.2.13 + yocto-queue@0.1.0: {} + zod-to-json-schema@3.25.2(zod@4.6.7): + dependencies: + zod: 4.6.7 + zod@4.4.3: {} zod@4.6.7: {} diff --git a/extensions/pnpm-workspace.yaml b/extensions/pnpm-workspace.yaml index 66327a905cd..80d150aabb0 100644 --- a/extensions/pnpm-workspace.yaml +++ b/extensions/pnpm-workspace.yaml @@ -65,10 +65,17 @@ allowBuilds: '@azure/msal-node-runtime@0.20.1': true '@parcel/watcher@2.5.6': true '@vscode/fs-copyfile@2.0.0': true + # minecraft-workbench (vendored submodule) toolchain; its scripts need + # libsecret-1 and vsce signing tools, neither of which the IDE build uses. + '@vscode/vsce-sign@2.1.1': false + esbuild@0.25.12: false + keytar@7.9.0: false esbuild@0.27.2: true esbuild@0.28.1: true fsevents@2.3.2: true overrides: + # @xmcl/unzip publishes an unresolvable "workspace:^*" spec for @xmcl/yauzl + '@xmcl/yauzl': 2.10.0 serialize-javascript: ^7.0.3 vscode-css-languageservice>vscode-languageserver-types: 3.18.3 lodash-es: 4.18.1 diff --git a/extensions/tsconfig.base.json b/extensions/tsconfig.base.json index db32799b3ba..ad5d11142c1 100644 --- a/extensions/tsconfig.base.json +++ b/extensions/tsconfig.base.json @@ -16,6 +16,9 @@ "noUnusedLocals": true, "noUnusedParameters": true, "forceConsistentCasingInFileNames": true, - "experimentalDecorators": true + "experimentalDecorators": true, + "paths": { + "vscode": ["../src/vscode-dts/vscode.d.ts"] + } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4fe502ac5fc..307f26ea1ce 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -245,10 +245,10 @@ importers: specifier: 0.163.0 version: 0.163.0 '@playwright/cli': - specifier: ^0.1.22 + specifier: ^0.1.9 version: 0.1.22 '@playwright/test': - specifier: ^1.61.1 + specifier: 1.61.1 version: 1.61.1 '@stylistic/eslint-plugin': specifier: ^5.10.0 @@ -275,7 +275,7 @@ importers: specifier: 24.x version: 24.12.4 '@types/sinon': - specifier: ^10.0.2 + specifier: 10.0.2 version: 10.0.2 '@types/sinon-test': specifier: ^2.4.2 @@ -314,10 +314,10 @@ importers: specifier: npm:typescript@^7.0.2 version: typescript@7.0.2 '@vscode/component-explorer': - specifier: ^0.2.1-161 + specifier: 0.2.1-161 version: 0.2.1-161 '@vscode/component-explorer-cli': - specifier: ^0.2.1-163 + specifier: 0.2.1-163 version: 0.2.1-163(playwright@1.61.1)(typanion@3.14.0) '@vscode/gulp-electron': specifier: ^1.43.0 @@ -425,7 +425,7 @@ importers: specifier: ^1.2.0 version: 1.2.0 gulp-rename: - specifier: ^1.2.0 + specifier: 1.2.2 version: 1.2.2 gulp-replace: specifier: ^0.5.4 @@ -470,7 +470,7 @@ importers: specifier: ^1.0.1 version: 1.0.1 playwright: - specifier: ^1.61.1 + specifier: 1.61.1 version: 1.61.1 rcedit: specifier: ^1.1.0 diff --git a/src/vs/platform/agentHost/node/agentHostWorktreeCleanupService.ts b/src/vs/platform/agentHost/node/agentHostWorktreeCleanupService.ts index 0d27e5d0fe0..c347901485c 100644 --- a/src/vs/platform/agentHost/node/agentHostWorktreeCleanupService.ts +++ b/src/vs/platform/agentHost/node/agentHostWorktreeCleanupService.ts @@ -6,9 +6,10 @@ import * as fs from 'fs/promises'; import { Limiter, RunOnceScheduler } from '../../../base/common/async.js'; import { Disposable, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; -import { isEqual, isEqualOrParent } from '../../../base/common/resources.js'; +import { isEqual, isEqualOrParent, joinPath, relativePath } from '../../../base/common/resources.js'; import { URI } from '../../../base/common/uri.js'; import { hasKey } from '../../../base/common/types.js'; +import { localize } from '../../../nls.js'; import { createDecorator } from '../../instantiation/common/instantiation.js'; import { ILogService } from '../../log/common/log.js'; import { AgentSession } from '../common/agent.js'; @@ -44,6 +45,7 @@ export interface IAgentHostWorktreeCleanupService { requestSessionWorktreeRemoval(session: URI, mode: Extract): Promise; /** Retries archived session worktrees; explicit force discards changes and overrides other usage references. */ sessionWorktreeCleanup(session: URI, retry: boolean, force?: boolean): Promise; + /** Includes registered managed worktrees and existing residue covered by durable removal requests. */ listManagedWorktrees(repositories: readonly URI[]): Promise; cleanupManagedWorktree(repository: URI, worktree: URI, branch: string, force?: boolean): Promise; /** Unarchive: drops the session's pending removal and recreates its folder when missing. */ @@ -134,6 +136,7 @@ export class AgentHostWorktreeCleanupService extends Disposable implements IAgen async listManagedWorktrees(repositories: readonly URI[]): Promise { const result: IAgentHostManagedWorktree[] = []; const detachedPaths = await this._worktree.getDetachedWorktreePaths(); + const removals = await this._database.listPendingWorktreeRemovals(); const seen = new Set(); const limiter = new Limiter(2); try { @@ -151,11 +154,25 @@ export class AgentHostWorktreeCleanupService extends Disposable implements IAgen continue; } seen.add(primary.toString()); - await Promise.all(entries.slice(1).map(({ path: worktree, branchName: branch }) => limiter.queue(async () => { + const candidates: { worktree: URI; branch: string | undefined; removal?: IPendingWorktreeRemoval }[] = entries.slice(1).map(entry => ({ worktree: entry.path, branch: entry.branchName })); + for (const removal of removals) { + const worktree = URI.parse(removal.worktreePath); + if (isEqual(URI.parse(removal.repositoryRoot), primary) && !candidates.some(candidate => isEqual(candidate.worktree, worktree))) { + candidates.push({ worktree, branch: removal.branch, removal }); + } + } + await Promise.all(candidates.map(({ worktree, branch, removal }) => limiter.queue(async () => { if (!branch || !isAgentWorktreeBranch(branch, worktree, primary) || !await this._isManagedWorktree(primary, worktree)) { return; } - const pending = await this._database.readPendingWorktreeRemoval('detached', this._managedRemovalOwner(worktree)); + if (removal) { + try { + await this._assertManagedWorktree(primary, worktree, branch, false, false, removal); + } catch { + return; + } + } + const pending = removal ?? await this._database.readPendingWorktreeRemoval('detached', this._managedRemovalOwner(worktree)); const known = pending && this._removalStatuses.get(this._removalKey(pending)); const cleanupStatus: IAgentHostWorktreeCleanupStatus = detachedPaths.some(path => isEqual(path, worktree)) || await this._database.isWorktreeInUse(worktree.toString(), undefined) ? { state: 'inUse' } @@ -173,25 +190,29 @@ export class AgentHostWorktreeCleanupService extends Disposable implements IAgen } async cleanupManagedWorktree(repository: URI, worktree: URI, branch: string, force = false): Promise { - await this._worktree.runExclusive(worktree.toString(), async () => { - const currentBranch = await this._assertManagedWorktree(repository, worktree, branch, false, force); + const removal = await this._worktree.runExclusive(worktree.toString(), async () => { + const owner = this._managedRemovalOwner(worktree); + const pending = await this._database.readPendingWorktreeRemoval('detached', owner) + ?? (await this._database.listPendingWorktreeRemovals()).find(removal => + isEqual(URI.parse(removal.repositoryRoot), repository) && isEqual(URI.parse(removal.worktreePath), worktree) && removal.branch === branch); + const currentBranch = await this._assertManagedWorktree(repository, worktree, branch, false, force, pending); if (!force && await this._isManagedWorktreeInUse(worktree)) { throw new Error('A session, chat, or detached worktree record is still using this worktree.'); } // Explicit ownerless cleanup uses the durable detached-removal queue, not a fabricated session owner. - const owner = this._managedRemovalOwner(worktree); - await this._database.upsertPendingWorktreeRemoval(this._request('detached', owner, undefined, { repositoryRoot: repository, worktree, branchName: currentBranch }, 'commit', false)); - this._removalStatuses.delete(`detached:${owner}`); + if (!force || !pending || !isEqual(URI.parse(pending.repositoryRoot), repository) || pending.branch !== currentBranch) { + await this._database.upsertPendingWorktreeRemoval(this._request('detached', owner, undefined, { repositoryRoot: repository, worktree, branchName: currentBranch }, 'commit', false)); + this._removalStatuses.delete(`detached:${owner}`); + return this._database.readPendingWorktreeRemoval('detached', owner); + } + return pending; }); this.schedule(); - if (force) { - const removal = await this._database.readPendingWorktreeRemoval('detached', this._managedRemovalOwner(worktree)); - if (removal) { - await this._process(removal, this._now(), true); - const remaining = await this._database.readPendingWorktreeRemoval(removal.kind, removal.owner); - if (remaining) { - throw new Error(remaining.lastAttempt?.message ?? 'The worktree could not be forcibly removed.'); - } + if (force && removal) { + await this._process(removal, this._now(), true); + const remaining = await this._database.readPendingWorktreeRemoval(removal.kind, removal.owner); + if (remaining) { + throw new Error(remaining.lastAttempt?.message ?? 'The worktree could not be forcibly removed.'); } } } @@ -205,7 +226,7 @@ export class AgentHostWorktreeCleanupService extends Disposable implements IAgen || (await this._worktree.getDetachedWorktreePaths()).some(path => isEqual(path, worktree)); } - private async _assertManagedWorktree(repository: URI, worktree: URI, branch: string, allowMissing = false, allowBranchChange = false): Promise { + private async _assertManagedWorktree(repository: URI, worktree: URI, branch: string, allowMissing = false, allowBranchChange = false, removal?: IPendingWorktreeRemoval): Promise { const entries = await this._gitService.getWorktrees(repository); if (!entries[0] || !isEqual(entries[0].path, repository) || !await this._isManagedWorktree(repository, worktree, allowMissing)) { throw new Error('The worktree is no longer registered in the managed worktree directory.'); @@ -214,7 +235,7 @@ export class AgentHostWorktreeCleanupService extends Disposable implements IAgen const currentBranch = allowBranchChange && registered ? registered.branchName : branch; if (!currentBranch || !isAgentWorktreeBranch(currentBranch, worktree, repository) || (registered && (!registered.branchName || !isAgentWorktreeBranch(registered.branchName, worktree, repository)))) { - throw new Error('Only worktrees on agent-managed branches can be cleaned up.'); + throw new Error(localize('worktreeCleanup.branchNamespace', "Only worktrees on agent-managed branches can be cleaned up.")); } if (allowMissing) { try { @@ -227,14 +248,36 @@ export class AgentHostWorktreeCleanupService extends Disposable implements IAgen } } if (!registered) { - throw new Error('The worktree registration changed. Refresh the worktree inventory before cleanup.'); + const current = removal && await this._database.readPendingWorktreeRemoval(removal.kind, removal.owner); + if (!removal || !current || current.requestedAt !== removal.requestedAt || current.mode !== removal.mode + || !isEqual(URI.parse(current.repositoryRoot), repository) || !isEqual(URI.parse(current.worktreePath), worktree) || current.branch !== branch) { + throw new Error('The worktree registration changed. Refresh the worktree inventory before cleanup.'); + } } - if (!allowBranchChange && registered.branchName !== branch) { + if (!allowBranchChange && registered && registered.branchName !== branch) { throw new Error('The worktree branch changed. Refresh the worktree inventory before cleanup.'); } - if (entries.some(entry => !isEqual(entry.path, worktree) && isEqualOrParent(entry.path, worktree))) { + const canonicalWorktree = URI.file(await fs.realpath(worktree.fsPath)); + const otherEntries = entries.slice(1).filter(entry => !isEqual(entry.path, worktree)); + const otherRegistrations = [ + ...otherEntries.map(entry => entry.path), + ...await Promise.all(otherEntries.map(async entry => { + try { + return URI.file(await fs.realpath(entry.path.fsPath)); + } catch (error) { + if (typeof error === 'object' && error !== null && hasKey(error, { code: true }) && error.code === 'ENOENT') { + return entry.path; + } + throw error; + } + })), + ]; + if (otherRegistrations.some(path => isEqualOrParent(path, worktree) || isEqualOrParent(path, canonicalWorktree))) { throw new Error('This worktree contains another registered worktree. Clean up the nested worktree first.'); } + if (otherRegistrations.some(path => isEqualOrParent(worktree, path) || isEqualOrParent(canonicalWorktree, path))) { + throw new Error(localize('worktreeCleanup.conflictingRegistration', "This worktree is inside another registered worktree.")); + } return currentBranch; } @@ -253,7 +296,9 @@ export class AgentHostWorktreeCleanupService extends Disposable implements IAgen return false; } const stat = await fs.lstat(worktree.fsPath); - return stat.isDirectory() && !stat.isSymbolicLink() && isWorktreeUnderRepository(URI.file(await fs.realpath(worktree.fsPath)), primary); + const path = relativePath(getWorktreesRoot(repository), worktree); + return stat.isDirectory() && !stat.isSymbolicLink() && path !== undefined + && isEqual(URI.file(await fs.realpath(worktree.fsPath)), joinPath(root, path)); } catch (error) { if (typeof error === 'object' && error !== null && hasKey(error, { code: true }) && error.code === 'ENOENT') { return allowMissing; @@ -599,7 +644,7 @@ export class AgentHostWorktreeCleanupService extends Disposable implements IAgen return false; } if (validateManaged) { - await this._assertManagedWorktree(URI.parse(removal.repositoryRoot), URI.parse(removal.worktreePath), removal.branch ?? '', true, force); + await this._assertManagedWorktree(URI.parse(removal.repositoryRoot), URI.parse(removal.worktreePath), removal.branch ?? '', true, force, removal); } return force || !await isInUse(); }; @@ -618,7 +663,7 @@ export class AgentHostWorktreeCleanupService extends Disposable implements IAgen const mode = removal.mode === 'delete' && coOwners.length > 0 ? 'commit' : removal.mode; try { if (validateManaged) { - const currentBranch = await this._assertManagedWorktree(worktree.repositoryRoot, worktree.worktree, worktree.branchName, true, force); + const currentBranch = await this._assertManagedWorktree(worktree.repositoryRoot, worktree.worktree, worktree.branchName, true, force, removal); worktree = { ...worktree, branchName: currentBranch }; } this._setRemovalStatus(removal, { state: 'running' }); diff --git a/src/vs/platform/agentHost/node/agentService.ts b/src/vs/platform/agentHost/node/agentService.ts index b444088b770..9fd43bab59e 100644 --- a/src/vs/platform/agentHost/node/agentService.ts +++ b/src/vs/platform/agentHost/node/agentService.ts @@ -30,8 +30,7 @@ import { IInstantiationService } from '../../instantiation/common/instantiation. import { ILogService } from '../../log/common/log.js'; import type { IMcpServerConfiguration } from '../../mcp/common/mcpPlatformTypes.js'; import { chatUriFormatOf, createChatUriError, mintDefaultChatUri, subagentChatUri } from '../common/agentHostChatMinting.js'; -import { AgentChatMigrationDeferred, type AgentCanvasDefinitionSnapshot, type AgentChatReleaseReason, AgentProvider, AgentSession, AgentSignal, CODEX_AGENT_PROVIDER_ID, COPILOT_CLI_AGENT_PROVIDER_ID, getChatSurfaceOptions, IAgent, type IAgentAdoptedWorktree, type IAgentCanvasCloseRequest, type IAgentCanvasOpenRequest, IAgentChatContext, IAgentChatDataChange, IAgentChatMetadata, IAgentCreateChatOptions, IAgentCreateChatRequestOptions, IAgentCreateChatResult, IAgentCreateChatSideChatSelection, IAgentCreateChatSideChatSource, type IAgentCreateChatWorkspace, IAgentCreateSessionConfig, IAgentCreateSessionResult, IAgentCustomizationInstallation, IAgentCustomizationInstallationApplyResult, IAgentCustomizationInstallationPreparation, IAgentCustomizationInstallationRequest, IAgentCustomizationInstallationReview, IAgentCustomizationMarketplaceSearchRequest, IAgentCustomizationMarketplaceSearchResult, IAgentDiscoveredChat, type IAgentExtensionInventory, IAgentLegacyChat, type IAgentManagedPluginRetryEntry, IAgentMaterializeChatEvent, IAgentModelInfo, type IAgentPluginInstallRequest, type IAgentPluginUninstallRequest, IAgentResolveSessionConfigParams, IAgentChatAdoptionResult, type AgentChatAdoptionReason, IAgentSessionConfigCompletionsParams, type IAgentSessionChatMetadata, IAgentSessionMetadata, IAgentSpawnChatEvent, AuthenticateParams, AuthenticateResult, SubagentChatSignal, subagentChatTitle, type IAgentImportedChat } from '../common/agent.js'; -import { AgentChatMigrationDeferred, type AgentCanvasDefinitionSnapshot, AgentProvider, AgentSession, AgentSignal, CODEX_AGENT_PROVIDER_ID, COPILOT_CLI_AGENT_PROVIDER_ID, getChatSurfaceOptions, IAgent, type IAgentAdoptedWorktree, type IAgentCanvasCloseRequest, type IAgentCanvasOpenRequest, IAgentChatContext, IAgentChatDataChange, IAgentChatMetadata, IAgentCreateChatOptions, IAgentCreateChatRequestOptions, IAgentCreateChatResult, IAgentCreateChatSideChatSelection, IAgentCreateChatSideChatSource, type IAgentCreateChatWorkspace, IAgentCreateSessionConfig, IAgentCreateSessionResult, IAgentCustomizationInstallation, IAgentCustomizationInstallationApplyRequest, IAgentCustomizationInstallationApplyResult, IAgentCustomizationInstallationPreparation, IAgentCustomizationInstallationRequest, IAgentCustomizationMarketplaceSearchRequest, IAgentCustomizationMarketplaceSearchResult, IAgentDiscoveredChat, type IAgentExtensionInventory, IAgentLegacyChat, type IAgentManagedPluginRetryEntry, IAgentMaterializeChatEvent, IAgentModelInfo, type IAgentPluginInstallRequest, type IAgentPluginUninstallRequest, IAgentResolveSessionConfigParams, IAgentChatAdoptionResult, type AgentChatAdoptionReason, IAgentSessionConfigCompletionsParams, type IAgentSessionChatMetadata, IAgentSessionMetadata, IAgentSpawnChatEvent, AuthenticateParams, AuthenticateResult, SubagentChatSignal, subagentChatTitle, type IAgentImportedChat } from '../common/agent.js'; +import { AgentChatMigrationDeferred, type AgentCanvasDefinitionSnapshot, type AgentChatReleaseReason, AgentProvider, AgentSession, AgentSignal, CODEX_AGENT_PROVIDER_ID, COPILOT_CLI_AGENT_PROVIDER_ID, getChatSurfaceOptions, IAgent, type IAgentAdoptedWorktree, type IAgentCanvasCloseRequest, type IAgentCanvasOpenRequest, IAgentChatContext, IAgentChatDataChange, IAgentChatMetadata, IAgentCreateChatOptions, IAgentCreateChatRequestOptions, IAgentCreateChatResult, IAgentCreateChatSideChatSelection, IAgentCreateChatSideChatSource, type IAgentCreateChatWorkspace, IAgentCreateSessionConfig, IAgentCreateSessionResult, IAgentCustomizationInstallation, IAgentCustomizationInstallationApplyRequest, IAgentCustomizationInstallationApplyResult, IAgentCustomizationInstallationPreparation, IAgentCustomizationInstallationRequest, IAgentCustomizationMarketplaceSearchRequest, IAgentCustomizationMarketplaceSearchResult, IAgentDiscoveredChat, type IAgentExtensionInventory, IAgentLegacyChat, type IAgentManagedPluginRetryEntry, IAgentMaterializeChatEvent, IAgentModelInfo, type IAgentPluginInstallRequest, type IAgentPluginUninstallRequest, IAgentResolveSessionConfigParams, IAgentChatAdoptionResult, type AgentChatAdoptionReason, IAgentSessionConfigCompletionsParams, type IAgentSessionChatMetadata, IAgentSessionMetadata, IAgentSpawnChatEvent, AuthenticateParams, AuthenticateResult, SubagentChatSignal, subagentChatTitle, type IAgentImportedChat } from '../common/agent.js'; import { getPendingSteeringMessages } from '../common/agentSessionMessage.js'; import { type AgentHostDebugLogsArtifactKind, type IAgentCreateChatInitialMessageContext, type IAgentHostDebugLogsArtifact, type IAgentHostDebugLogsChunk, IAgentHostManagedSettingsDiagnostics, IAgentHostNetworkDiagnosticsInfo, IAgentHostNetworkFetchResult, IAgentService, type IAgentServiceCreateSessionConfig, type IAgentImportSessionOptions } from '../common/agentService.js'; import { ISessionDatabase, ISessionDataService, ISessionStorageAccessCounts, SESSION_ATTACHMENTS_DIRNAME } from '../common/sessionDataService.js'; diff --git a/src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts b/src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts index 90fbf00c615..869d5038daf 100644 --- a/src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts +++ b/src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts @@ -10,6 +10,7 @@ import type { AttributedPermissionResult, CopilotClient, CopilotSession, Current import { attributePermissionResult, isPermissionDeniedKind, permissionResultToConfirmKind } from './copilotPermissionAttribution.js'; import { McpSkillCacheWriter } from '../shared/mcpSkillCache.js'; import { parseCopilotMcpSkillConsentRequest, type ICopilotMcpSkillConsentRequest } from './copilotMcpSkillConsent.js'; +import { createHash } from 'crypto'; import { realpath as fsRealpath } from 'fs'; import { cp, rm } from 'fs/promises'; import { promisify } from 'util'; @@ -25,8 +26,8 @@ import { Schemas } from '../../../../base/common/network.js'; import { isAuthorizationProtectedResourceMetadata } from '../../../../base/common/oauth.js'; import { equals, safeStringify } from '../../../../base/common/objects.js'; import { waitForState } from '../../../../base/common/observable.js'; -import { isAbsolute, join } from '../../../../base/common/path.js'; -import { extUriBiasedIgnorePathCase, isEqual, normalizePath } from '../../../../base/common/resources.js'; +import { isAbsolute } from '../../../../base/common/path.js'; +import { basename, extUriBiasedIgnorePathCase, isEqual, normalizePath } from '../../../../base/common/resources.js'; import { StopWatch } from '../../../../base/common/stopwatch.js'; import { splitLinesIncludeSeparators } from '../../../../base/common/strings.js'; import { hasKey, isDefined, isObject, isString, type Mutable } from '../../../../base/common/types.js'; @@ -112,9 +113,12 @@ import { GITHUB_MCP_SERVER_NAME } from '../shared/githubMcpServer.js'; import { AgentHostComputerUseEnabledSettingId, AgentHostGitHubMcpServerEnabledSettingId } from '../../common/agentService.js'; import { COMPUTER_USE_PLUGIN_NAME } from './copilotComputerUsePlugin.js'; import { CopilotComputerUseActivation } from './copilotComputerUseActivationTool.js'; +import { reportComputerUseActivation, reportComputerUseState } from './copilotComputerUseTelemetry.js'; import { classifyComputerUsePrompt, type CopilotComputerUsePermissionSetup, type ICopilotComputerUseSetupChat, type IComputerUsePermissionPrompt } from './copilotComputerUsePermissionSetup.js'; import { CopilotToolName, getEditFilePaths, getInvocationMessage, getPastTenseMessage, getPermissionDisplay, getSandboxPathGrantConfirmation, getSdkImageGenerationMetadata, getToolIntention, getShellLanguage, getStreamingInvocationMessage, getSubagentMetadata, getPhaseTaskCompleteMarkdown, getTaskCompleteMarkdown, getToolDisplayName, getToolInputString, getToolKind, getToolSummaryInputContract, isAgentCoordinationTool, isCopilotSdkToolOutputFile, isEditTool, isHiddenTool, isShellHelperTool, isShellTool, isTaskCompleteTool, parseCopilotStreamingToolInput, synthesizeSkillToolCall, tryStringify, getAssistedApprovalNotice, type TaskCompletionReview } from './copilotToolDisplay.js'; import { imageGenerationToolMetaKey } from '../../common/meta/agentImageGenerationMeta.js'; +import { COPILOT_VIRTUAL_SESSION_STATE_PATH, copilotSdkPathToUri, createCopilotSdkPathMapper, resolveCopilotSdkPath, toCopilotWorkspace, type ICopilotSdkPathMapper } from './copilotWorkspace.js'; +import { toAgentClientUri } from '../../common/agentClientUri.js'; import { FileEditTracker } from '../shared/fileEditTracker.js'; import { ICopilotApiService, type IRestrictedTelemetryContext } from '../shared/copilotApiService.js'; import type { IAgentHostRestrictedTelemetryContext } from '../agentHostRestrictedTelemetry.js'; @@ -687,6 +691,7 @@ export interface ICopilotAgentSessionOptions { readonly shellManager: ShellManager | undefined; /** Working directory associated with the session, used to strip redundant `cd` prefixes from shell commands. */ readonly workingDirectory?: URI; + readonly pathMapper: ICopilotSdkPathMapper; /** Directory used to resolve workspace-scoped customizations for this session. */ readonly customizationDirectory?: URI; /** Snapshot of the active client's tools and plugins at session creation time. */ @@ -777,6 +782,7 @@ interface ICopilotCanvasProjection { /** Canvases a configuration refresh carries from a chat's previous runtime to its replacement. */ export interface ICopilotCanvasHandoff { readonly projections: readonly ICopilotCanvasProjection[]; + pendingCloseInstanceIds?: Set; } /** A projected canvas; `handedOver` marks one seeded from a handoff that the replacement runtime has not reported since. */ @@ -2047,6 +2053,9 @@ export class CopilotAgentSession extends Disposable { private readonly _canvasCloses = new Map>(); /** Closed events still expected, by instance ID, for closes applied when the runtime acknowledged them first. */ private readonly _expectedCanvasClosedEvents = new Map(); + private readonly _deferredCanvasCloseInstanceIds = new Set(); + private readonly _settledDeferredCanvasCloseInstanceIds = new Set(); + private _deferredCanvasCloseFlush: Promise | undefined; private _canvasExtensions: SessionEventPayload<'session.extensions_loaded'>['data']['extensions'] | undefined; private _canvasRegistryGeneration = 0; private _canvasRegistrySettlementPending = false; @@ -2068,6 +2077,7 @@ export class CopilotAgentSession extends Disposable { /** Streams runtime-executed shell output into output-only (non-pty) terminal channels. */ private readonly _nonPtyShellTerminals: NonPtyShellTerminalStreams; private _workingDirectory: URI | undefined; + private _pathMapper: ICopilotSdkPathMapper; private _customizationDirectory: URI | undefined; private readonly _serverToolHost: IAgentServerToolHost | undefined; private readonly _mcpSkillCacheWriter: McpSkillCacheWriter; @@ -2240,6 +2250,9 @@ export class CopilotAgentSession extends Disposable { ); this._onDidSessionProgress = options.onDidSessionProgress; this._pendingCanvasHandoff = options.canvasHandoff; + for (const instanceId of options.canvasHandoff?.pendingCloseInstanceIds ?? []) { + this._deferredCanvasCloseInstanceIds.add(instanceId); + } for (const projection of options.canvasHandoff?.projections ?? []) { this._canvasByInstanceId.set(projection.canvas.instanceId, { ...projection, handedOver: true }); // Withdraws any source published by a replacement the refresh discarded. @@ -2273,7 +2286,7 @@ export class CopilotAgentSession extends Disposable { removeCertificate: async (scopeId, validate) => { await options.sandboxCertificate.remove(this._launchPlan.client.rpc.sandbox.proxyCa, scopeId, validate); }, getShellInitDirectory: () => this._shellInitScriptMaterialized ? this._shellInitScriptDirectory() : undefined, getAppliedPluginDirectories: () => this._appliedPluginDirectories, - getWorkingDirectory: () => this._workingDirectory, + getWorkingDirectory: () => this._workingDirectory?.scheme === Schemas.file ? this._workingDirectory : undefined, getAdditionalWorkingDirectories: () => this._appliedAdditionalDirectories, shellManager: options.shellManager, onDidChangeRuntimeConfig: () => this._recordRuntimeMutation('sandboxUpdate'), @@ -2289,17 +2302,25 @@ export class CopilotAgentSession extends Disposable { completeInput: (requestId, response) => this._emitAction({ type: ActionType.ChatInputCompleted, requestId, response }), }; const getInstalledPlugins = options.getInstalledPlugins; + const computerUseCorrelation = () => createCopilotFailureCorrelation(this.resourceUri, this._chatChannelUri, this._turnId, this.sessionId, this.currentTurnClientContext); this._computerUseActivation = new CopilotComputerUseActivation({ // Only VS Code's setting registers the built-in plugin, and only in the shared runtime. Chats with their own GitHub credentials run without it. - listPlugins: async () => getInstalledPlugins && !this.usesScopedGitHubCredentials && this._configurationService.getRootValue(platformRootSchema, AgentHostComputerUseEnabledConfigKey) === true ? await getInstalledPlugins() : [], + listPlugins: async () => getInstalledPlugins && !this.usesScopedGitHubCredentials && this._configurationService.getRootValue(platformRootSchema, AgentHostComputerUseEnabledConfigKey) === true ? await getInstalledPlugins() : undefined, enablePlugin: async () => { await this._wrapper.session.rpc.plugins.enable({ names: [COMPUTER_USE_PLUGIN_NAME] }); }, // A card shows only in a running turn. A background subagent can call after the turn ended, or the turn can stop while the plugin is checked. canAskUser: () => this.hasActiveTurn && !this._abortToken.isCancellationRequested && !this._isAutopilotMode() && !this._isAutoReplyEnabled(), requestInput: request => this._emitAction({ type: ActionType.ChatInputRequested, request }), + reportLaunchState: state => reportComputerUseState(this._telemetryService, state, computerUseCorrelation()), + startActivationReport: () => { + // Read now: a turn that ends clears its context before it cancels the request. + const correlation = computerUseCorrelation(); + return report => reportComputerUseActivation(this._telemetryService, report, correlation); + }, }, `[Copilot:${this.sessionId}]`, this._logService); this._shellManager = options.shellManager; this._nonPtyShellTerminals = this._register(this._instantiationService.createInstance(NonPtyShellTerminalStreams, options.owner, this._storageUri, options.chatChannelUri)); this._workingDirectory = options.workingDirectory; + this._pathMapper = options.pathMapper; this._customizationDirectory = options.customizationDirectory; this._serverToolHost = options.serverToolHost; this._mcpToolRoutingCache = new CopilotMcpToolRoutingCache(storageService, this._logService); @@ -2355,6 +2376,7 @@ export class CopilotAgentSession extends Disposable { this._storageUri.toString(), () => this._ownerSessionUri.toString(), COPILOT_CLI_AGENT_PROVIDER_ID, + { toUri: path => copilotSdkPathToUri(this._pathMapper, path), toFileServiceUri: path => this._sdkFileServiceUri(path) }, )); // The edit tool calls wait for the host's changes of their files (see `_handlePreToolUse`), // so the user can undo changes while the agent works, and the agent is told. @@ -3435,7 +3457,7 @@ export class CopilotAgentSession extends Disposable { return { parameters, meta: this._createToolCallMeta(toolName, parameters), - invocationMessage: getStreamingInvocationMessage(toolName, getToolDisplayName(toolName), partialInput, path => this._resolveEditFilePath(path), this._resolveAgentName), + invocationMessage: getStreamingInvocationMessage(toolName, getToolDisplayName(toolName), partialInput, path => this._resolveDisplayFilePath(path), this._resolveAgentName), }; } @@ -3591,7 +3613,7 @@ export class CopilotAgentSession extends Disposable { toolCallId, ...(toolCall.contributor ? { contributor: toolCall.contributor } : {}), ...(toolCall.intention !== undefined ? { intention: toolCall.intention } : {}), - invocationMessage: getInvocationMessage(toolCall.toolName, toolCall.displayName, toolCall.parameters, path => this._resolveEditFilePath(path), this._resolveAgentName), + invocationMessage: getInvocationMessage(toolCall.toolName, toolCall.displayName, toolCall.parameters, path => this._resolveDisplayFilePath(path), this._resolveAgentName), toolInput: getToolInputString(toolCall.toolName, toolCall.parameters, tryStringify(toolCall.parameters)), confirmed: ToolCallConfirmationReason.NotNeeded, _meta: toolCall.meta && toToolCallMeta(toolCall.meta), @@ -3925,10 +3947,23 @@ export class CopilotAgentSession extends Disposable { } private _resolveEditFilePath(path: string): string { - if (isAbsolute(path) || !this._workingDirectory || this._workingDirectory.scheme !== Schemas.file) { - return path; + return this._workingDirectory ? resolveCopilotSdkPath(this._pathMapper, path) : path; + } + + private _resolveDisplayFilePath(path: string): URI { + return copilotSdkPathToUri(this._pathMapper, this._resolveEditFilePath(path)); + } + + private _sdkFileServiceUri(path: string): URI { + const uri = copilotSdkPathToUri(this._pathMapper, path); + if (uri.scheme === Schemas.file) { + return uri; + } + const clientId = this._launchPlan.virtualWorkspaceClientId?.(); + if (!clientId) { + throw new Error(localize('copilot.virtualWorkspaceDisconnected', "The window that owns the virtual workspace is not connected.")); } - return join(this._workingDirectory.fsPath, path); + return toAgentClientUri(uri, clientId); } /** @@ -4533,7 +4568,7 @@ export class CopilotAgentSession extends Disposable { toolCallId, ...(tracked.contributor ? { contributor: tracked.contributor } : {}), ...(tracked.intention !== undefined ? { intention: tracked.intention } : {}), - invocationMessage: getInvocationMessage(tracked.toolName, tracked.displayName, tracked.parameters, path => this._resolveEditFilePath(path), this._resolveAgentName), + invocationMessage: getInvocationMessage(tracked.toolName, tracked.displayName, tracked.parameters, path => this._resolveDisplayFilePath(path), this._resolveAgentName), toolInput: getToolInputString(tracked.toolName, tracked.parameters, tracked.parameters ? tryStringify(tracked.parameters) : undefined), confirmed: ToolCallConfirmationReason.NotNeeded, _meta: toToolCallMeta({ ...(tracked.meta ?? {}), toolSearchCandidates: candidates }), @@ -4935,11 +4970,22 @@ export class CopilotAgentSession extends Disposable { this._registeredShellInitScriptPath = undefined; } - /** Persists the host-owned catalog title through the runtime's naming API. */ + /** Synchronizes the host-owned catalog title without rewriting an unchanged runtime name. */ async synchronizeTitle(title: string): Promise { const name = Array.from(title.trim()).slice(0, 100).join(''); if (name && !this._store.isDisposed) { - const completed = await raceTimeout(this._wrapper.session.rpc.name.set({ name }).then(() => true), this._controlPlaneRpcTimeoutMs); + const wrapper = this._wrapper; + const current = await raceTimeout(wrapper.session.rpc.name.get(), this._controlPlaneRpcTimeoutMs); + if (!current) { + throw new Error('Mission Control title synchronization timed out'); + } + if (this._store.isDisposed || this._wrapper !== wrapper) { + throw new CancellationError(); + } + if (current.name === name) { + return; + } + const completed = await raceTimeout(wrapper.session.rpc.name.set({ name }).then(() => true), this._controlPlaneRpcTimeoutMs); if (!completed) { throw new Error('Mission Control title synchronization timed out'); } @@ -4949,6 +4995,19 @@ export class CopilotAgentSession extends Disposable { /** Refreshes inventory observers after registration without changing projected canvas membership. */ publishCanvases(): void { if (this._wrapper.canvasRuntimeEnabled && this._canvasPhase === 'live') { + this._publishCanvasProjectionStates(); + this._publishCanvases(); + } + } + + republishCanvasProjection(published: readonly string[] | undefined): void { + if (!this._wrapper.canvasRuntimeEnabled || this._canvasPhase !== 'live' || this._pendingCanvasHandoff) { + return; + } + this._publishCanvasProjectionStates(); + const resources = [...this._canvasByInstanceId.values()].map(projection => projection.resource.toString()); + const current = published ?? []; + if (resources.length !== current.length || resources.some((resource, index) => resource !== current[index])) { this._publishCanvases(); } } @@ -5016,6 +5075,9 @@ export class CopilotAgentSession extends Disposable { } async openCanvas(request: IAgentCanvasOpenRequest): Promise { + if (this._deferredCanvasCloseInstanceIds.has(request.instanceId)) { + await this._deferredCanvasCloseFlush; + } const wrapper = this._wrapper; if (!wrapper.canvasRuntimeEnabled) { throw new Error('Canvases are disabled for this session.'); @@ -5031,6 +5093,8 @@ export class CopilotAgentSession extends Disposable { }) : undefined; try { const canvas = await this._awaitControlPlaneRpc('rpc.canvas.open', wrapper.session.rpc.canvas.open(request)); + this._deferredCanvasCloseInstanceIds.delete(request.instanceId); + this._settledDeferredCanvasCloseInstanceIds.delete(request.instanceId); if (!wasIgnored || this._wrapper !== wrapper || this._store.isDisposed || this._canvasPhase !== 'live' || this._canvasByInstanceId.has(request.instanceId)) { return; @@ -5047,28 +5111,62 @@ export class CopilotAgentSession extends Disposable { /** Releases this session's canvases and hands them over without sources, so a replacement runtime can keep their channels. */ takeCanvasProjection(): ICopilotCanvasHandoff | undefined { - const projections = [...this._canvasByInstanceId.values()].map(({ resource, canvas: { url: _url, ...canvas } }) => ({ resource, canvas })); + const projections = [...this._canvasByInstanceId.values()].map(({ resource, canvas: { url: _url, ...canvas } }) => ({ + resource, + canvas, + })); + const pendingCloseInstanceIds = new Set(this._deferredCanvasCloseInstanceIds); this._releaseCanvasRegistrySnapshot(); this._canvasPhase = 'released'; this._canvasByInstanceId.clear(); this._ignoredRestoredCanvasInstanceIds.clear(); this._expectedCanvasClosedEvents.clear(); - if (projections.length === 0) { + this._deferredCanvasCloseInstanceIds.clear(); + this._settledDeferredCanvasCloseInstanceIds.clear(); + if (projections.length === 0 && pendingCloseInstanceIds.size === 0) { return undefined; } for (const projection of projections) { this._publishCanvasState(projection); } - return { projections }; + return { projections, pendingCloseInstanceIds }; } /** Takes ownership of canvases handed to this session once its refresh keeps it, publishing membership changes made meanwhile. */ adoptCanvasHandoff(handoff: ICopilotCanvasHandoff): boolean { + if (this._store.isDisposed || this._pendingCanvasHandoff !== handoff) { + return false; + } + for (const instanceId of handoff.pendingCloseInstanceIds ?? []) { + this._canvasByInstanceId.delete(instanceId); + this._ignoredRestoredCanvasInstanceIds.add(instanceId); + if (!this._settledDeferredCanvasCloseInstanceIds.delete(instanceId)) { + this._deferredCanvasCloseInstanceIds.add(instanceId); + } + } + this._pendingCanvasHandoff = undefined; + this._publishAuthoritativeCanvasRegistry(); + void this._flushDeferredCanvasCloses(this._wrapper); + return true; + } + + discardCanvasHandoff(handoff: ICopilotCanvasHandoff): boolean { if (this._store.isDisposed || this._pendingCanvasHandoff !== handoff) { return false; } this._pendingCanvasHandoff = undefined; + for (const instanceId of new Set([ + ...handoff.projections.map(projection => projection.canvas.instanceId), + ...(handoff.pendingCloseInstanceIds ?? []), + ])) { + this._canvasByInstanceId.delete(instanceId); + this._ignoredRestoredCanvasInstanceIds.add(instanceId); + this._expectedCanvasClosedEvents.delete(instanceId); + this._deferredCanvasCloseInstanceIds.add(instanceId); + this._settledDeferredCanvasCloseInstanceIds.delete(instanceId); + } this._publishAuthoritativeCanvasRegistry(); + void this._flushDeferredCanvasCloses(this._wrapper); return true; } @@ -5110,6 +5208,13 @@ export class CopilotAgentSession extends Disposable { /** Handles the runtime's closed event for an instance whose projection may belong to a later lifetime than the event. */ private _handleCanvasClosed(wrapper: CopilotSessionWrapper, instanceId: string): void { + if (this._settleDeferredCanvasClose(instanceId)) { + const projection = this._canvasByInstanceId.get(instanceId); + if (projection) { + void this._removeCanvasUnlessOpen(wrapper, projection); + } + return; + } const expected = this._expectedCanvasClosedEvents.get(instanceId); if (!expected) { if (this._canvasByInstanceId.delete(instanceId)) { @@ -5236,6 +5341,12 @@ export class CopilotAgentSession extends Disposable { }); } + private _publishCanvasProjectionStates(): void { + for (const projection of this._canvasByInstanceId.values()) { + this._publishCanvasState(projection); + } + } + private _invalidateCanvasRegistrySnapshot(): void { this._canvasRegistryGeneration++; } @@ -5261,9 +5372,11 @@ export class CopilotAgentSession extends Disposable { this._publishAuthoritativeCanvasRegistry(); } - /** Reopens handed-over canvases the runtime restored and drops the ones it no longer has open. */ + /** Reconciles handed-over canvases with the instances the resumed runtime restored. */ private async _reconcileCanvasHandoff(wrapper: CopilotSessionWrapper): Promise { - if (!wrapper.canvasRuntimeEnabled || ![...this._canvasByInstanceId.values()].some(projection => projection.handedOver)) { + const handoff = this._pendingCanvasHandoff; + const pendingCloseInstanceIds = handoff?.pendingCloseInstanceIds; + if (!wrapper.canvasRuntimeEnabled || (!pendingCloseInstanceIds?.size && ![...this._canvasByInstanceId.values()].some(projection => projection.handedOver))) { return; } let openCanvases: CopilotSession['openCanvases']; @@ -5277,20 +5390,87 @@ export class CopilotAgentSession extends Disposable { return; } const openByInstanceId = new Map(openCanvases.map(canvas => [canvas.instanceId, canvas])); + try { + await this._applyDeferredCanvasCloses(wrapper, openByInstanceId); + } catch (error) { + // Unapplied closes stay deferred and are retried after adoption; they must not fail the resume. + this._logService.warn(`[Copilot:${this.sessionId}] Failed to apply deferred canvas closes during reconciliation: ${getErrorMessage(error)}`); + } + if (this._store.isDisposed) { + return; + } // Canvases the runtime reported while the request was pending are no longer marked, so they keep that newer state. for (const projection of [...this._canvasByInstanceId.values()]) { if (!projection.handedOver) { continue; } - const open = openByInstanceId.get(projection.canvas.instanceId); + const instanceId = projection.canvas.instanceId; + const open = this._deferredCanvasCloseInstanceIds.has(instanceId) ? undefined : openByInstanceId.get(instanceId); if (open) { this._projectOpenedCanvas(open); } else { - this._canvasByInstanceId.delete(projection.canvas.instanceId); + this._canvasByInstanceId.delete(instanceId); + } + } + } + + private _flushDeferredCanvasCloses(wrapper: CopilotSessionWrapper): Promise { + const flush = this._doFlushDeferredCanvasCloses(wrapper); + this._deferredCanvasCloseFlush = flush; + return flush.finally(() => { + if (this._deferredCanvasCloseFlush === flush) { + this._deferredCanvasCloseFlush = undefined; + } + }); + } + + private async _doFlushDeferredCanvasCloses(wrapper: CopilotSessionWrapper): Promise { + if (this._deferredCanvasCloseInstanceIds.size === 0 || this._store.isDisposed) { + return; + } + let openCanvases: CopilotSession['openCanvases']; + try { + ({ openCanvases } = await this._awaitControlPlaneRpc('rpc.canvas.listOpen', wrapper.session.rpc.canvas.listOpen())); + } catch (error) { + this._logService.warn(`[Copilot:${this.sessionId}] Failed to reconcile deferred canvas closes: ${getErrorMessage(error)}`); + return; + } + try { + await this._applyDeferredCanvasCloses(wrapper, new Map(openCanvases.map(canvas => [canvas.instanceId, canvas]))); + } catch (error) { + this._logService.warn(`[Copilot:${this.sessionId}] Failed to apply deferred canvas closes: ${getErrorMessage(error)}`); + } finally { + if (!this._pendingCanvasHandoff) { + this._settledDeferredCanvasCloseInstanceIds.clear(); } } } + private async _applyDeferredCanvasCloses(wrapper: CopilotSessionWrapper, openByInstanceId: Map): Promise { + for (const instanceId of [...this._deferredCanvasCloseInstanceIds]) { + if (!openByInstanceId.has(instanceId)) { + this._settleDeferredCanvasClose(instanceId); + continue; + } + await this._awaitControlPlaneRpc('rpc.canvas.close', wrapper.session.rpc.canvas.close({ instanceId })); + openByInstanceId.delete(instanceId); + if (this._settleDeferredCanvasClose(instanceId)) { + this._expectedCanvasClosedEvents.set(instanceId, (this._expectedCanvasClosedEvents.get(instanceId) ?? 0) + 1); + } + if (this._store.isDisposed) { + return; + } + } + } + + private _settleDeferredCanvasClose(instanceId: string): boolean { + if (!this._deferredCanvasCloseInstanceIds.delete(instanceId)) { + return false; + } + this._settledDeferredCanvasCloseInstanceIds.add(instanceId); + return true; + } + private _publishCanvasState(projection: ICopilotCanvasProjection): void { this._onDidSessionProgress.fire({ kind: 'canvas', @@ -5332,6 +5512,10 @@ export class CopilotAgentSession extends Disposable { this._logService.warn(`[Copilot:${this.sessionId}] Evicted oldest projected canvas after reaching the ${MAX_PROJECTED_CANVASES}-canvas limit`); } } + if (!existing) { + this._deferredCanvasCloseInstanceIds.delete(data.instanceId); + this._settledDeferredCanvasCloseInstanceIds.delete(data.instanceId); + } const canvas: CanvasState = { instanceId: data.instanceId, extensionId: data.extensionId, @@ -5362,6 +5546,8 @@ export class CopilotAgentSession extends Disposable { this._canvasByInstanceId.clear(); this._ignoredRestoredCanvasInstanceIds.clear(); this._expectedCanvasClosedEvents.clear(); + this._deferredCanvasCloseInstanceIds.clear(); + this._settledDeferredCanvasCloseInstanceIds.clear(); if (hadCanvases) { this._publishCanvases(); } @@ -6086,6 +6272,7 @@ export class CopilotAgentSession extends Disposable { shellAlignmentError = `failed to align the local shell working directory: ${getErrorMessage(error)}`; } finally { this._workingDirectory = workingDirectory; + this._pathMapper = createCopilotSdkPathMapper(toCopilotWorkspace(workingDirectory)); this._customizationDirectory = workingDirectory; this._requiresRestartAfterWorkingDirectoryChange = true; } @@ -6104,6 +6291,7 @@ export class CopilotAgentSession extends Disposable { alignmentErrors.push(`failed to align the local shell working directory: ${getErrorMessage(shellError)}`); } finally { this._workingDirectory = actualUri; + this._pathMapper = createCopilotSdkPathMapper(toCopilotWorkspace(actualUri)); this._customizationDirectory = actualUri; this._requiresRestartAfterWorkingDirectoryChange = true; } @@ -6253,7 +6441,7 @@ export class CopilotAgentSession extends Disposable { continue; } const uri = URI.parse(attachment.uri); - paths.push(uri.scheme === 'file' ? uri.fsPath : uri.toString()); + paths.push(this._sdkAttachmentPath(uri)); } if (paths.length === 0) { return undefined; @@ -6901,6 +7089,16 @@ export class CopilotAgentSession extends Disposable { } } + private _sdkAttachmentPath(uri: URI): string { + const path = uri.scheme === Schemas.file || uri.scheme === this._workingDirectory?.scheme + ? this._pathMapper.toSdkPath(uri) : uri.toString(); + if (this._launchPlan.workspace?.kind !== 'virtual' || uri.scheme !== Schemas.file || path.startsWith(`${COPILOT_VIRTUAL_SESSION_STATE_PATH}/`)) { + return path; + } + const id = createHash('sha256').update(uri.toString()).digest('hex'); + return `${COPILOT_VIRTUAL_SESSION_STATE_PATH}/files/attachments/${id}/${basename(uri)}`; + } + /** * Translate a protocol {@link MessageAttachment} into the Copilot CLI SDK's `attachments` payload shape. Resource * attachments map to the SDK's reference-style `file`/`directory`/`selection` variants (the @@ -6947,7 +7145,16 @@ export class CopilotAgentSession extends Disposable { return undefined; } const uri = URI.parse(attachment.uri); - const path = uri.scheme === 'file' ? uri.fsPath : uri.toString(); + const path = this._sdkAttachmentPath(uri); + if (this._launchPlan.virtualSessionFs && uri.scheme === Schemas.file && path !== this._pathMapper.toSdkPath(uri)) { + // Host snapshots must live in the provider's state namespace for the virtual runtime to read them. + if ((await this._fileService.stat(uri)).isDirectory) { + // Host folders are not copied there, so the virtual runtime cannot list them. + this._logService.warn(`[Copilot:${this.sessionId}] Skipping host folder attachment in a virtual workspace: ${uri.toString()}`); + return undefined; + } + await this._launchPlan.virtualSessionFs.writeFileBytes(path, (await this._fileService.readFile(uri)).value.buffer); + } const displayName = attachment.label ?? path; // A host-created snapshot (pasted content, unsaved editor, git: diff, …) is shaped like any other // resource here (file or selection). Its read-only signal is carried separately on the prompt — via @@ -6972,7 +7179,9 @@ export class CopilotAgentSession extends Disposable { } private async _readSelectedText(uri: URI, range: { readonly start: { readonly line: number; readonly character: number }; readonly end: { readonly line: number; readonly character: number } }): Promise { - const content = await this._fileService.readFile(uri); + const resource = uri.scheme === this._workingDirectory?.scheme && uri.scheme !== Schemas.file + ? this._sdkFileServiceUri(this._pathMapper.toSdkPath(uri)) : uri; + const content = await this._fileService.readFile(resource); const text = content.value.toString(); // AHP carries the resource range; the public SDK can carry the selected text too. // This reads the resource URI, so unsaved editor changes are not included. @@ -7175,7 +7384,7 @@ export class CopilotAgentSession extends Disposable { this._seedSubagentDisplayNames(events); this._logService.trace(`[Copilot:${this.sessionId}] Read ${events.length} persisted event(s); reconstructing turns`); return this._withDatabase(async db => { - const result = await mapSessionEvents(this._storageUri, db, events, this._chatChannelUri, this._ownerSessionUri, { + const result = await mapSessionEvents(this._storageUri, db, events, this._chatChannelUri, this._ownerSessionUri, this._pathMapper, { logService: this._logService, workingDirectory: this._workingDirectory, clientToolNames: this._clientToolNames, @@ -8123,7 +8332,7 @@ export class CopilotAgentSession extends Disposable { toolCallId, toolName: request.toolName, displayName, - invocationMessage: getInvocationMessage(request.toolName, displayName, parameters, path => this._resolveEditFilePath(path), this._resolveAgentName), + invocationMessage: getInvocationMessage(request.toolName, displayName, parameters, path => this._resolveDisplayFilePath(path), this._resolveAgentName), toolInput: getToolInputString(request.toolName, parameters, tryStringify(parameters)), riskAssessment: judgeRationale ? { @@ -8293,7 +8502,7 @@ export class CopilotAgentSession extends Disposable { const isNewFile = edits?.items.some(edit => !edit.before && !!edit.after); const trackedToolCall = this._activeToolCalls.get(toolCallId); - const permissionDisplay = getPermissionDisplay(request, this._workingDirectory, isNewFile, this._appliedAdditionalDirectories, trackedToolCall?.parameters); + const permissionDisplay = getPermissionDisplay(request, this._workingDirectory, isNewFile, this._appliedAdditionalDirectories, trackedToolCall?.parameters, path => this._resolveDisplayFilePath(path)); // A server tool's confirmation as its group builds it with the host's state (e.g. linking only known sessions). const serverConfirmation = serverToolName && request.kind === 'custom-tool' ? serverToolHost?.getConfirmationDisplay(serverToolName, request.args) : undefined; const { permissionKind, permissionPath, permissionUrl, shellCommand } = permissionDisplay; @@ -8355,6 +8564,7 @@ export class CopilotAgentSession extends Disposable { }, permissionKind, permissionPath, + permissionResource: permissionPath ? copilotSdkPathToUri(this._pathMapper, permissionPath) : undefined, permissionUrl, managedApprovalRequired, ...(requiresUserConfirmation ? { requiresUserConfirmation: true } : {}), @@ -8419,7 +8629,7 @@ export class CopilotAgentSession extends Disposable { return undefined; } - const permissionUri = normalizePath(URI.file(permissionPath)); + const permissionUri = normalizePath(copilotSdkPathToUri(this._pathMapper, permissionPath)); return extUriBiasedIgnorePathCase.isEqualOrParent(permissionUri, sessionDir) ? permissionPath : undefined; } @@ -8627,7 +8837,7 @@ export class CopilotAgentSession extends Disposable { */ private async _applyAssistedApprovalRepositoryContext(wrapper: CopilotSessionWrapper): Promise { const workingDirectory = this._workingDirectory; - if (!workingDirectory) { + if (!workingDirectory || workingDirectory.scheme !== Schemas.file) { return; } try { @@ -8692,7 +8902,7 @@ export class CopilotAgentSession extends Disposable { } private _syncShellInitScript(recorder?: IAgentProviderSendStageRecorder): Promise { - if (this._shellInitScriptDisposing || this._isInactiveForBackgroundConfigSync()) { + if (this._launchPlan.workspace?.kind === 'virtual' || this._shellInitScriptDisposing || this._isInactiveForBackgroundConfigSync()) { return Promise.resolve(); } return measureAgentProviderOperation(recorder, 'shell', () => this._applyEffectiveShellInitScripts(recorder), this._shellInitScriptSequencer); @@ -8959,12 +9169,12 @@ export class CopilotAgentSession extends Disposable { return undefined; } - const fileUri = URI.file(filePath); + const fileUri = copilotSdkPathToUri(this._pathMapper, this._resolveEditFilePath(filePath)); const fileUriStr = fileUri.toString(); let beforeExists = false; try { - beforeExists = await this._fileService.exists(fileUri); + beforeExists = await this._fileService.exists(this._sdkFileServiceUri(this._resolveEditFilePath(filePath))); } catch (err) { this._logService.warn(`[Copilot:${this.sessionId}] Failed to check file for edit preview: ${filePath}`, err); } @@ -10344,7 +10554,7 @@ export class CopilotAgentSession extends Disposable { toolCallId: e.data.toolCallId, ...(contributor ? { contributor } : {}), ...(intention !== undefined ? { intention } : {}), - invocationMessage: getInvocationMessage(e.data.toolName, displayName, parameters, path => this._resolveEditFilePath(path), this._resolveAgentName), + invocationMessage: getInvocationMessage(e.data.toolName, displayName, parameters, path => this._resolveDisplayFilePath(path), this._resolveAgentName), toolInput: getToolInputString(e.data.toolName, parameters, toolArgs), confirmed: ToolCallConfirmationReason.NotNeeded, _meta: toToolCallMeta(meta), @@ -10387,7 +10597,7 @@ export class CopilotAgentSession extends Disposable { toolCallId: e.data.toolCallId, ...(contributor ? { contributor } : {}), ...(intention !== undefined ? { intention } : {}), - invocationMessage: getInvocationMessage(e.data.toolName, displayName, parameters, path => this._resolveEditFilePath(path), this._resolveAgentName), + invocationMessage: getInvocationMessage(e.data.toolName, displayName, parameters, path => this._resolveDisplayFilePath(path), this._resolveAgentName), toolInput: getToolInputString(e.data.toolName, parameters, toolArgs), confirmed: ToolCallConfirmationReason.NotNeeded, _meta: toToolCallMeta(clientToolAutoApproved ? { ...meta, autoApproveBySetting: true } : meta), @@ -10589,7 +10799,7 @@ export class CopilotAgentSession extends Disposable { const complete = (authoritativeOutput?: string) => { const result: ToolCallResult = { success: e.data.success, - pastTenseMessage: getPastTenseMessage(tracked.toolName, displayName, tracked.parameters, e.data.success, e.data.success ? toolOutput : undefined, path => this._resolveEditFilePath(path), this._resolveAgentName, tracked.meta?.[imageGenerationToolMetaKey]), + pastTenseMessage: getPastTenseMessage(tracked.toolName, displayName, tracked.parameters, e.data.success, e.data.success ? toolOutput : undefined, path => this._resolveDisplayFilePath(path), this._resolveAgentName, tracked.meta?.[imageGenerationToolMetaKey]), content: content.length > 0 ? content : undefined, structuredContent: e.data.result?.structuredContent as Record | undefined, resultMetadata: getSdkMcpResultMeta(e.data.result), @@ -12261,7 +12471,7 @@ export class CopilotAgentSession extends Disposable { actions, canProvideFeedback: true, answerQuestionId: questionId, - ...(planPath ? { planUri: URI.file(planPath).toString() } : {}), + ...(planPath ? { planUri: copilotSdkPathToUri(this._pathMapper, planPath).toString() } : {}), }, questions: [{ kind: ChatInputQuestionKind.SingleSelect, @@ -12962,7 +13172,9 @@ export class CopilotAgentSession extends Disposable { return; } const projected = this._canvasByInstanceId.has(e.data.instanceId); - if (!projected && (this._canvasPhase !== 'live' || this._ignoredRestoredCanvasInstanceIds.has(e.data.instanceId))) { + if (!projected && (this._canvasPhase !== 'live' + || this._ignoredRestoredCanvasInstanceIds.has(e.data.instanceId) + || this._deferredCanvasCloseInstanceIds.has(e.data.instanceId))) { return; } this._projectOpenedCanvas(e.data); diff --git a/src/vs/platform/agentHost/test/node/agentHostWorktreeCleanupService.test.ts b/src/vs/platform/agentHost/test/node/agentHostWorktreeCleanupService.test.ts index 0197477c937..52f21cd12fa 100644 --- a/src/vs/platform/agentHost/test/node/agentHostWorktreeCleanupService.test.ts +++ b/src/vs/platform/agentHost/test/node/agentHostWorktreeCleanupService.test.ts @@ -42,6 +42,7 @@ class RecordingWorktreeIsolation extends NullAgentHostWorktreeIsolation { failures = 0; outcome: WorktreeRemovalOutcome = 'removed'; removal: DeferredPromise | undefined; + onRemove: ((worktree: IRecordedWorktree, discardChanges: boolean) => Promise) | undefined; /** Completes when the first removal starts. */ readonly removalStarted = new DeferredPromise(); /** Completes with the key of the first task queued while another task holds that key's lock. */ @@ -77,6 +78,7 @@ class RecordingWorktreeIsolation extends NullAgentHostWorktreeIsolation { this.calls.push(`inUse:${key}`); return 'inUse'; } + await this.onRemove?.(worktree, discardChanges); if (discardChanges) { this.forcedRemovals.push(worktree.worktree.toString()); } @@ -339,6 +341,27 @@ suite('AgentHostWorktreeCleanupService', () => { assert.deepStrictEqual({ forced: worktree.forcedRemovals, pending: (await pending(database)).length }, { forced: [], pending: 1 }); }); + for (const branch of ['agents/default', 'users/alice/agents/recovered', 'team/subteam/agents/recovered']) { + for (const force of [false, true]) { + test(`inventories and cleans up ${branch} with force=${force}`, async () => { + const { database, cleanup, worktree, repository, managed, head } = await createManagedInventory(); + head.branch = branch; + const inventory = await cleanup.listManagedWorktrees([repository]); + await cleanup.cleanupManagedWorktree(repository, managed, branch, force); + await cleanup.runPass(); + assert.deepStrictEqual({ + inventory: inventory.map(row => ({ branch: row.branch, worktree: row.worktree })), + calls: worktree.calls, + pending: await pending(database), + }, { + inventory: [{ branch, worktree: managed.toString() }], + calls: [`remove:${managed.toString()}:commit:${branch}${force ? ':force' : ''}`], + pending: [], + }); + }); + } + } + for (const staleBranch of ['agents/stale', 'component-explorer-1']) { test(`confirmed force ignores stale branch ${staleBranch} and usage references`, async () => { const { database, cleanup, worktree, repository, managed, head } = await createManagedInventory(); @@ -401,6 +424,154 @@ suite('AgentHostWorktreeCleanupService', () => { ]); }); + test('accepts serialized worktree URIs alongside original Git repository paths', async () => { + const { database, cleanup, worktree, repository, managed } = await createManagedInventory(); + await cleanup.cleanupManagedWorktree(repository, URI.parse(managed.toString()), 'agents/recovered'); + await cleanup.runPass(); + assert.deepStrictEqual({ + calls: worktree.calls, + pending: await pending(database), + }, { + calls: [`remove:${managed.toString()}:commit:agents/recovered`], + pending: [], + }); + }); + + test('keeps a durably recorded unregistered residue visible after restart and force retries its removal', async () => { + const { database, cleanup, worktree, repository, managed, roots, gitService } = await createManagedInventory(); + worktree.onRemove = async () => { + roots.splice(roots.indexOf(managed), 1); + throw new Error('Directory is locked'); + }; + await cleanup.cleanupManagedWorktree(repository, managed, 'agents/recovered'); + await cleanup.runPass(); + const beforeRestart = await cleanup.listManagedWorktrees([repository]); + cleanup.dispose(); + const restartedWorktree = new RecordingWorktreeIsolation(); + restartedWorktree.onRemove = async recorded => fs.rm(recorded.worktree.fsPath, { recursive: true }); + const restarted = disposables.add(new AgentHostWorktreeCleanupService(undefined, database, restartedWorktree, new NullLogService(), gitService)); + const afterRestart = await restarted.listManagedWorktrees([repository]); + await assert.rejects(restarted.cleanupManagedWorktree(repository, managed, 'agents/different', true), /registration changed/); + await restarted.cleanupManagedWorktree(repository, managed, 'agents/recovered', true); + assert.deepStrictEqual({ + inventory: [beforeRestart, afterRestart], + forced: restartedWorktree.forcedRemovals, + pending: await pending(database), + remaining: await restarted.listManagedWorktrees([repository]), + exists: await fs.stat(managed.fsPath).then(() => true, () => false), + }, { + inventory: [0, 1].map(() => [{ + repository: repository.toString(), worktree: managed.toString(), branch: 'agents/recovered', + cleanupStatus: { state: 'failed', message: 'Directory is locked' }, + }]), + forced: [managed.toString()], pending: [], remaining: [], exists: false, + }); + }); + + test('a normal explicit retry resets backoff without inheriting force semantics', async () => { + const { database, cleanup, worktree, repository, managed } = await createManagedInventory(); + worktree.failures = 1; + await cleanup.cleanupManagedWorktree(repository, managed, 'agents/recovered'); + await cleanup.runPass(); + await cleanup.cleanupManagedWorktree(repository, managed, 'agents/recovered'); + await cleanup.runPass(); + assert.deepStrictEqual({ calls: worktree.calls, pending: await pending(database) }, { + calls: [0, 1].map(() => `remove:${managed.toString()}:commit:agents/recovered`), pending: [], + }); + }); + + test('rejects unregistered directories without a durable removal record even with force', async () => { + const { database, cleanup, worktree, repository, managed, roots } = await createManagedInventory(); + roots.splice(roots.indexOf(managed), 1); + for (const force of [false, true]) { + await assert.rejects(cleanup.cleanupManagedWorktree(repository, managed, 'agents/recovered', force), /registration changed/); + } + assert.deepStrictEqual({ + inventory: await cleanup.listManagedWorktrees([repository]), calls: worktree.calls, pending: await pending(database), + }, { inventory: [], calls: [], pending: [] }); + }); + + for (const replacement of ['symlink', 'nested registration', 'containing registration', 'aliased registration', 'foreign branch']) { + test(`rejects recorded residue with a ${replacement} before force removal`, async () => { + const { database, cleanup, worktree, repository, managed, external, roots, head } = await createManagedInventory(); + worktree.onRemove = async () => { + roots.splice(roots.indexOf(managed), 1); + throw new Error('Directory is locked'); + }; + await cleanup.cleanupManagedWorktree(repository, managed, 'agents/recovered'); + await cleanup.runPass(); + if (replacement === 'symlink') { + await fs.rm(managed.fsPath, { recursive: true }); + await fs.symlink(external.fsPath, managed.fsPath, 'junction'); + } else if (replacement === 'foreign branch') { + head.branch = 'feature/unrelated'; + roots.push(managed); + } else if (replacement === 'aliased registration') { + const alias = URI.joinPath(external, 'alias'); + await fs.symlink(managed.fsPath, alias.fsPath, 'junction'); + roots.push(alias); + } else { + roots.push(replacement === 'nested registration' ? URI.joinPath(managed, 'nested') : URI.joinPath(managed, '..')); + } + await assert.rejects(cleanup.cleanupManagedWorktree(repository, managed, 'agents/recovered', true), /no longer registered|registered worktree|agent-managed branches/); + assert.deepStrictEqual({ + forced: worktree.forcedRemovals, pending: await pending(database), + externalExists: (await fs.stat(external.fsPath)).isDirectory(), + }, { forced: [], pending: ['detached:commit:1'], externalExists: true }); + }); + } + + test('revalidates recorded residue immediately before forced removal', async () => { + const { database, cleanup, worktree, repository, managed, external, roots } = await createManagedInventory(); + await cleanup.cleanupManagedWorktree(repository, managed, 'agents/recovered'); + roots.splice(roots.indexOf(managed), 1); + worktree.removal = new DeferredPromise(); + const removal = cleanup.cleanupManagedWorktree(repository, managed, 'agents/recovered', true); + await worktree.removalStarted.p; + await fs.rm(managed.fsPath, { recursive: true }); + await fs.symlink(external.fsPath, managed.fsPath, 'junction'); + await worktree.removal.complete(); + await assert.rejects(removal, /no longer registered/); + assert.deepStrictEqual({ forced: worktree.forcedRemovals, pending: await pending(database) }, { + forced: [], pending: ['detached:commit:1'], + }); + }); + + for (const deleted of [false, true]) { + test(`force retry removes recorded session residue with deleted=${deleted} without changing session history`, async () => { + const { database, cleanup, worktree, repository, managed, roots } = await createManagedInventory(); + const recorded = { repositoryRoot: repository, worktree: managed, branchName: 'agents/recovered' }; + worktree.sessions.set(SESSION.toString(), recorded); + await useWorktree(database, SESSION, recorded, true); + worktree.onRemove = async () => { + roots.splice(roots.indexOf(managed), 1); + throw new Error('Directory is locked'); + }; + if (deleted) { + await database.tombstoneAndUnregisterSession(SESSION.toString(), await cleanup.prepareSessionDeletion(SESSION, [], 'delete')); + } else { + await cleanup.requestSessionWorktreeRemoval(SESSION, 'commit'); + } + await cleanup.runPass(); + const inventory = await cleanup.listManagedWorktrees([repository]); + worktree.onRemove = async recorded => fs.rm(recorded.worktree.fsPath, { recursive: true }); + if (deleted) { + await cleanup.cleanupManagedWorktree(repository, managed, 'agents/recovered', true); + } else { + await cleanup.sessionWorktreeCleanup(SESSION, true, true); + } + assert.deepStrictEqual({ + inventory: inventory.map(row => ({ worktree: row.worktree, status: row.cleanupStatus.state })), + forced: worktree.forcedRemovals, pending: await pending(database), + live: await database.isSessionLive(SESSION.toString()), + exists: await fs.stat(managed.fsPath).then(() => true, () => false), + }, { + inventory: [{ worktree: managed.toString(), status: 'failed' }], + forced: [managed.toString()], pending: [], live: !deleted, exists: false, + }); + }); + } + test('force removal discards changes for a verified managed worktree', async () => { const { database, cleanup, worktree, repository, managed } = await createManagedInventory(); await cleanup.cleanupManagedWorktree(repository, managed, 'agents/recovered', true); diff --git a/src/vs/platform/files/common/diskFileSystemProviderClient.ts b/src/vs/platform/files/common/diskFileSystemProviderClient.ts index 3f88083adf6..1179b0455af 100644 --- a/src/vs/platform/files/common/diskFileSystemProviderClient.ts +++ b/src/vs/platform/files/common/diskFileSystemProviderClient.ts @@ -13,8 +13,7 @@ import { newWriteableStream, ReadableStreamEventPayload, ReadableStreamEvents } import { URI } from '../../../base/common/uri.js'; import { generateUuid } from '../../../base/common/uuid.js'; import { IChannel } from '../../../base/parts/ipc/common/ipc.js'; -import { createFileSystemProviderError, FileSystemProviderCapabilities, FileSystemProviderErrorCode, FileType, IFileAtomicReadOptions, IFileChange, IFileDeleteOptions, IFileOpenOptions, IFileOverwriteOptions, IFileReadStreamOptions, IFileRealpathOptions, IFileSystemProviderError, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileCloneCapability, IFileSystemProviderWithFileFolderCopyCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileWriteOptions, IStat, IWatchOptions, IFileSystemProviderWithFileAtomicRenameCapability } from './files.js'; -import { createFileSystemProviderError, FileSystemProviderCapabilities, FileSystemProviderErrorCode, FileType, IFileAtomicReadOptions, IFileChange, IFileDeleteOptions, IFileOpenOptions, IFileOverwriteOptions, IFileReadStreamOptions, IFileRealpathOptions, IFileSystemProviderError, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileCloneCapability, IFileSystemProviderWithFileFolderCopyCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileWriteOptions, IStat, IWatchOptions } from './files.js'; +import { createFileSystemProviderError, FileSystemProviderCapabilities, FileSystemProviderErrorCode, FileType, IFileAtomicReadOptions, IFileChange, IFileDeleteOptions, IFileOpenOptions, IFileOverwriteOptions, IFileReadStreamOptions, IFileSystemProviderError, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileCloneCapability, IFileSystemProviderWithFileFolderCopyCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileWriteOptions, IStat, IWatchOptions, IFileSystemProviderWithFileAtomicRenameCapability, IFileRealpathOptions } from './files.js'; import { reviveFileChanges } from './watcher.js'; export const LOCAL_FILE_SYSTEM_CHANNEL_NAME = 'localFilesystem'; diff --git a/src/vs/platform/files/node/diskFileSystemProvider.ts b/src/vs/platform/files/node/diskFileSystemProvider.ts index 7ef41ebfb15..ebaf58caa88 100644 --- a/src/vs/platform/files/node/diskFileSystemProvider.ts +++ b/src/vs/platform/files/node/diskFileSystemProvider.ts @@ -18,8 +18,7 @@ import { newWriteableStream, ReadableStreamEvents } from '../../../base/common/s import { URI } from '../../../base/common/uri.js'; import { IDirent, Promises, RimRafMode, SymlinkSupport } from '../../../base/node/pfs.js'; import { localize } from '../../../nls.js'; -import { createFileSystemProviderError, IFileAtomicReadOptions, IFileDeleteOptions, IFileOpenOptions, IFileOverwriteOptions, IFileReadStreamOptions, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileType, IFileWriteOptions, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileCloneCapability, IFileSystemProviderWithFileFolderCopyCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, isFileOpenForWriteOptions, IStat, FilePermission, IFileSystemProviderWithFileAtomicWriteCapability, IFileSystemProviderWithFileAtomicDeleteCapability, IFileChange, IFileRealpathOptions, IFileSystemProviderWithFileRealpathCapability, IFileSystemProviderWithFileAtomicRenameCapability, toFileSystemProviderErrorCode } from '../common/files.js'; -import { createFileSystemProviderError, IFileAtomicReadOptions, IFileDeleteOptions, IFileOpenOptions, IFileOverwriteOptions, IFileReadStreamOptions, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileType, IFileWriteOptions, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileCloneCapability, IFileSystemProviderWithFileFolderCopyCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, isFileOpenForWriteOptions, IStat, FilePermission, IFileSystemProviderWithFileAtomicWriteCapability, IFileSystemProviderWithFileAtomicDeleteCapability, IFileChange, IFileRealpathOptions, IFileSystemProviderWithFileRealpathCapability } from '../common/files.js'; +import { createFileSystemProviderError, IFileAtomicReadOptions, IFileDeleteOptions, IFileOpenOptions, IFileOverwriteOptions, IFileReadStreamOptions, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileType, IFileWriteOptions, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileCloneCapability, IFileSystemProviderWithFileFolderCopyCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, isFileOpenForWriteOptions, IStat, FilePermission, IFileSystemProviderWithFileAtomicWriteCapability, IFileSystemProviderWithFileAtomicDeleteCapability, IFileChange, IFileSystemProviderWithFileRealpathCapability, IFileSystemProviderWithFileAtomicRenameCapability, toFileSystemProviderErrorCode, IFileRealpathOptions } from '../common/files.js'; import { readFileIntoStream } from '../common/io.js'; import { AbstractNonRecursiveWatcherClient, AbstractUniversalWatcherClient, ILogMessage } from '../common/watcher.js'; import { AbstractDiskFileSystemProvider } from '../common/diskFileSystemProvider.js'; diff --git a/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackItemsBackend.ts b/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackItemsBackend.ts index 83eb1be213c..5830b3b5e5a 100644 --- a/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackItemsBackend.ts +++ b/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackItemsBackend.ts @@ -5,7 +5,7 @@ import { Emitter, Event } from '../../../../base/common/event.js'; import { Disposable, DisposableMap, DisposableStore } from '../../../../base/common/lifecycle.js'; -import { autorun } from '../../../../base/common/observable.js'; +import { autorun, derived, IObservable, observableSignalFromEvent } from '../../../../base/common/observable.js'; import { getComparisonKey } from '../../../../base/common/resources.js'; import { URI } from '../../../../base/common/uri.js'; import { IRange } from '../../../../editor/common/core/range.js'; @@ -424,6 +424,31 @@ export class AnnotationsAgentFeedbackItemsBackend extends Disposable implements return []; } + /** Observes annotations only while subscribed, without retaining a session in the backend cache. */ + getItemsObservable(sessionResource: URI): IObservable { + const sessionsChanged = observableSignalFromEvent(this, this._sessionsManagementService.onDidChangeSessions); + const channel = derived(this, reader => { + sessionsChanged.read(reader); + const session = this._sessionsManagementService.getSession(sessionResource); + const provider = session && this._sessionsProvidersService.getProvider(session.providerId); + const resolved = session && provider?.getFeedbackAnnotationsChannel?.(session.sessionId); + if (!resolved) { + return undefined; + } + const ref = reader.delayedStore.add(resolved.connection.getSubscription(StateComponents.Annotations, resolved.annotationsUri, AnnotationsAgentFeedbackItemsBackend.OWNER)); + return { + connection: resolved.connection, + subscription: ref.object, + changed: observableSignalFromEvent(this, ref.object.onDidChange), + }; + }); + return derived(this, reader => { + const current = channel.read(reader); + current?.changed.read(reader); + return current ? orderFeedbackItems(this._decode(current, sessionResource)) : []; + }); + } + hasLoaded(sessionResource: URI): boolean { // Only authoritative once the session's annotations snapshot has been // received; until then `getItems` falls back to the (possibly empty) @@ -504,7 +529,7 @@ export class AnnotationsAgentFeedbackItemsBackend extends Disposable implements return value !== undefined && !(value instanceof Error); } - private _decode(channel: ITrackedChannel, sessionResource: URI): IAgentFeedback[] { + private _decode(channel: Pick, sessionResource: URI): IAgentFeedback[] { const value = channel.subscription.value; if (!value || value instanceof Error) { return []; diff --git a/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackService.ts b/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackService.ts index a6432ece806..cf21f0319ec 100644 --- a/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackService.ts +++ b/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackService.ts @@ -8,8 +8,9 @@ import { DeferredPromise } from '../../../../base/common/async.js'; import { createSingleCallFunction } from '../../../../base/common/functional.js'; import { Disposable, IDisposable } from '../../../../base/common/lifecycle.js'; import { ResourceMap } from '../../../../base/common/map.js'; -import { derived, IObservable, runOnChange } from '../../../../base/common/observable.js'; +import { derived, IObservable, observableFromEvent, runOnChange } from '../../../../base/common/observable.js'; import { URI } from '../../../../base/common/uri.js'; +import { localize } from '../../../../nls.js'; import { IRange } from '../../../../editor/common/core/range.js'; import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; import { generateUuid } from '../../../../base/common/uuid.js'; @@ -479,6 +480,12 @@ export class AgentFeedbackService extends Disposable implements IAgentFeedbackSe return this._backendForSession(sessionResource).getItems(sessionResource); } + getFeedbackObservable(sessionResource: URI): IObservable { + return this.isAgentHostSession(sessionResource) + ? this._getAnnotationsBackend().getItemsObservable(sessionResource) + : observableFromEvent(this, this.onDidChangeFeedback, () => this._inMemoryBackend.getItems(sessionResource)); + } + showFeedbackInEditor(sessionResource: URI, feedbackIds: readonly string[]): void { const resolvedFeedbackIds = new Set( this.getFeedback(sessionResource) @@ -732,6 +739,29 @@ export class AgentFeedbackService extends Disposable implements IAgentFeedbackSe } async submitFeedback(sessionResource: URI, options?: ISubmitFeedbackOptions): Promise { + if (options?.background) { + const session = this._sessionsManagementService.getSession(sessionResource); + const chat = session?.chats.get().find(chat => isEqual(chat.resource, options.targetChat)); + if (!session || !chat) { + throw new Error(localize('agentFeedback.targetUnavailable', "The target session or chat is no longer available.")); + } + const agentHost = this.isAgentHostSession(sessionResource); + const feedbackIds = agentHost ? options.feedbackIds : undefined; + const acceptedItems = this.getFeedback(sessionResource).filter(item => + item.state === AgentFeedbackState.Accepted && (!feedbackIds || feedbackIds.includes(item.id))); + if (!acceptedItems.length) { + throw new Error(localize('agentFeedback.commentsUnavailable', "The selected comments are no longer available.")); + } + const annotationsResource = agentHost ? this._getAnnotationsBackend().getAnnotationsChannelResource(sessionResource) : undefined; + await this._sessionsManagementService.sendRequestInBackground(session, chat, { + query: options.query ?? '/act-on-feedback', + attachedContext: [createAgentFeedbackVariableEntry(sessionResource, acceptedItems, annotationsResource)], + }); + this.markFeedbackSubmitted(sessionResource, feedbackIds); + options.onRequestAccepted?.(); + return true; + } + if (isEqual(sessionResource, AGENT_FEEDBACK_NEW_SESSION_RESOURCE)) { if (!this.getFeedback(sessionResource).some(item => item.state === AgentFeedbackState.Accepted)) { return false; diff --git a/src/vs/sessions/contrib/agentFeedback/test/browser/agentFeedbackItemsBackend.test.ts b/src/vs/sessions/contrib/agentFeedback/test/browser/agentFeedbackItemsBackend.test.ts index f4be0a7813b..4e73d6055e1 100644 --- a/src/vs/sessions/contrib/agentFeedback/test/browser/agentFeedbackItemsBackend.test.ts +++ b/src/vs/sessions/contrib/agentFeedback/test/browser/agentFeedbackItemsBackend.test.ts @@ -7,7 +7,7 @@ import assert from 'assert'; import { timeout } from '../../../../../base/common/async.js'; import { Emitter, Event } from '../../../../../base/common/event.js'; import { IReference } from '../../../../../base/common/lifecycle.js'; -import { constObservable, IObservable, observableValue, transaction } from '../../../../../base/common/observable.js'; +import { constObservable, IObservable, observableValue, transaction, autorun } from '../../../../../base/common/observable.js'; import { URI } from '../../../../../base/common/uri.js'; import { mock } from '../../../../../base/test/common/mock.js'; import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../base/test/common/utils.js'; @@ -150,6 +150,49 @@ suite('AnnotationsAgentFeedbackItemsBackend', () => { }); return { backend, host, sessions, showPanes, feedback }; } + test('scoped observation shares and releases annotations without populating the persistent cache', async () => { + const sessionResource = URI.parse('agent-host-claude:/saved'); + const annotationsUri = URI.parse('claude:/saved/annotations'); + const operations: string[] = []; + const state: AnnotationsState = { annotations: [] }; + let seq = 0; + const manager = store.add(new AgentSubscriptionManager('test', () => ++seq, () => { }, async resource => { + operations.push('subscribe'); + return { resource: resource.toString(), state, fromSeq: 0 }; + }, () => operations.push('unsubscribe'))); + const connection = new class extends mock() { + override readonly resourceUris = createAgentHostResourceUriMapper('test'); + override getSubscription(kind: T, resource: URI, owner: string): IReference> { + return manager.getSubscription(kind, resource, owner); + } + }(); + const provider = new class extends mock() { + override getFeedbackAnnotationsChannel() { return { connection, annotationsUri }; } + }(); + const session = new class extends mock() { + override readonly providerId = 'agenthost-test'; + override readonly sessionId = 'saved'; + }(); + const instantiationService = store.add(new TestInstantiationService()); + instantiationService.stub(ISessionsManagementService, { + onDidDeleteSession: Event.None, onDidChangeSessions: Event.None, getSession: () => session, + }); + instantiationService.stub(ISessionsProvidersService, new class extends mock() { }(), 'getProvider', () => provider); + stubVisibleSessions(instantiationService, constObservable([])); + const backend = store.add(instantiationService.createInstance(AnnotationsAgentFeedbackItemsBackend)); + const feedback = backend.getItemsObservable(sessionResource); + assert.deepStrictEqual(operations, []); + const first = store.add(autorun(reader => feedback.read(reader))); + const second = store.add(autorun(reader => feedback.read(reader))); + await timeout(0); + first.dispose(); + const whileObserved = [...operations]; + second.dispose(); + await timeout(0); + assert.deepStrictEqual({ whileObserved, afterDisposal: operations, cachedSessions: backend.getSessionsWithItems() }, { + whileObserved: ['subscribe'], afterDisposal: ['subscribe', 'unsubscribe'], cachedSessions: [], + }); + }); for (const initiallyAvailable of [false, true]) { test(`suspends unavailable annotations without discarding cached feedback (cold=${!initiallyAvailable})`, async () => { diff --git a/src/vs/sessions/contrib/agentFeedback/test/browser/agentFeedbackService.test.ts b/src/vs/sessions/contrib/agentFeedback/test/browser/agentFeedbackService.test.ts index 6345a5c331f..93845daf4ce 100644 --- a/src/vs/sessions/contrib/agentFeedback/test/browser/agentFeedbackService.test.ts +++ b/src/vs/sessions/contrib/agentFeedback/test/browser/agentFeedbackService.test.ts @@ -29,7 +29,7 @@ import { ISessionGridPane } from '../../../../../workbench/services/sessions/bro import { whenChatWidgetForSession } from '../../../../../workbench/contrib/sessions/browser/chat/chatWidgetUtils.js'; import { IChat, ISession, ISessionFileChange, SessionStatus } from '../../../../../workbench/services/sessions/common/session.js'; import { ISessionsProvidersChangeEvent, ISessionsProvidersService } from '../../../../../workbench/contrib/sessions/browser/sessionsProvidersService.js'; -import { ISessionsProvider } from '../../../../../workbench/contrib/sessions/common/sessionsProvider.js'; +import { ISessionsProvider, ISendRequestOptions } from '../../../../../workbench/contrib/sessions/common/sessionsProvider.js'; import { LOCAL_AGENT_HOST_PROVIDER_ID } from '../../../../../workbench/contrib/sessions/common/agentHostSessionsProvider.js'; import { ITestSessionWithChat, stubFocusedSessionHostFromSessionsService } from '../../../../../workbench/contrib/sessions/test/browser/sessionHostTestUtils.js'; @@ -972,11 +972,19 @@ suite('AgentFeedbackService - Submit (agent host)', () => { let loadSession: () => void; /** The resources a chat widget was looked up for. */ let widgetLookups: string[]; + let backgroundChat: IChat; + let backgroundCalls: { chat: IChat; options: ISendRequestOptions }[]; + let backgroundAcceptance: DeferredPromise; setup(() => { widgetOps = []; addedEntries = []; widgetLookups = []; + backgroundCalls = []; + backgroundAcceptance = new DeferredPromise(); + backgroundChat = new class extends mock() { + override readonly resource = URI.parse('test:/session/1/peer'); + }(); acceptInputSent = new DeferredPromise(); acceptsRequest = true; providerId = LOCAL_AGENT_HOST_PROVIDER_ID; @@ -996,7 +1004,11 @@ suite('AgentFeedbackService - Submit (agent host)', () => { override onDidDeleteSession = Event.None; override onDidChangeSessions = Event.None; override getSession(_resource: URI) { - return { providerId, sessionId: 'session-1' } as unknown as ISession; + return { providerId, sessionId: 'session-1', chats: observableValue('chats', [backgroundChat]) } as unknown as ISession; + } + override async sendRequestInBackground(_session: ISession, chat: IChat, options: ISendRequestOptions): Promise { + backgroundCalls.push({ chat, options }); + await backgroundAcceptance.p; } }); instantiationService.stub(ISessionsService, { activeSession: observableValue('activeSession', undefined), visibleSessionPanes: observableValue('visibleSessionPanes', []), panes: observableValue('panes', []) } as unknown as ISessionsService); @@ -1041,6 +1053,55 @@ suite('AgentFeedbackService - Submit (agent host)', () => { fileA = URI.parse('file:///a.ts'); }); + for (const agentHost of [true, false]) { + test(`background feedback preserves attachment scope and waits for acceptance without a widget (agentHost=${agentHost})`, async () => { + if (!agentHost) { + providerId = 'legacy'; + } + sessionLoaded = false; + const first = service.addFeedback(session, fileA, r(1), 'Selected'); + const other = service.addFeedback(session, fileA, r(2), 'Other'); + let accepted = false; + const pending = service.submitFeedback(session, { + targetChat: backgroundChat.resource, background: true, feedbackIds: [first.id], onRequestAccepted: () => { accepted = true; }, + }); + const before = service.getFeedback(session).map(item => item.state); + assert.strictEqual(accepted, false); + await backgroundAcceptance.complete(); + await pending; + const attachment = backgroundCalls[0].options.attachedContext?.[0]; + assert.deepStrictEqual({ + target: backgroundCalls[0].chat, + query: backgroundCalls[0].options.query, + ids: attachment?.kind === 'agentFeedback' ? attachment.feedbackItems.map(item => item.id) : [], + before, + after: service.getFeedback(session).map(item => item.state), + accepted, + widgetLookups, + }, { + target: backgroundChat, query: '/act-on-feedback', + ids: agentHost ? [first.id] : [first.id, other.id], + before: [AgentFeedbackState.Accepted, AgentFeedbackState.Accepted], + after: agentHost ? [AgentFeedbackState.Submitted, AgentFeedbackState.Accepted] : [AgentFeedbackState.Resolved, AgentFeedbackState.Resolved], + accepted: true, widgetLookups: [], + }); + }); + } + + test('rejected background feedback is not marked submitted or acknowledged', async () => { + const item = service.addFeedback(session, fileA, r(1), 'Selected'); + let accepted = false; + const pending = service.submitFeedback(session, { + targetChat: backgroundChat.resource, background: true, feedbackIds: [item.id], onRequestAccepted: () => { accepted = true; }, + }); + const rejection = assert.rejects(pending, /Rejected/); + await backgroundAcceptance.error(new Error('Rejected')); + await rejection; + assert.deepStrictEqual({ states: service.getFeedback(session).map(item => item.state), accepted, widgetLookups }, { + states: [AgentFeedbackState.Accepted], accepted: false, widgetLookups: [], + }); + }); + test('attaches the just-submitted feedback to the request and clears the attachment afterwards', async () => { service.addFeedback(session, fileA, r(10), 'Please simplify'); diff --git a/src/vs/sessions/contrib/chat/browser/chat.contribution.ts b/src/vs/sessions/contrib/chat/browser/chat.contribution.ts index 0d503a440b4..e8cfc6e3919 100644 --- a/src/vs/sessions/contrib/chat/browser/chat.contribution.ts +++ b/src/vs/sessions/contrib/chat/browser/chat.contribution.ts @@ -788,6 +788,13 @@ Registry.as(ConfigurationExtensions.Configuration).regis tags: ['experimental'], experiment: { mode: 'auto' }, }, + [COMPARE_AGENTS_SHOW_SPOTLIGHT_SETTING]: { + type: 'boolean', + default: false, + scope: ConfigurationScope.APPLICATION, + markdownDescription: localize('sessions.chat.compareAgents.showSpotlight', "Show a one-time spotlight on Compare Models when an eligible model picker opens, introducing parallel models and agent harnesses, with an optional judge and synthesis where available. Does not appear if comparison setup has already been opened. Requires `#sessions.chat.compareAgents.enabled#` and `#onboarding.enabled#`."), + tags: ['experimental'], + }, [COMPARE_AGENTS_OPEN_IN_GRID_SETTING]: { type: 'boolean', default: true, diff --git a/src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.ts b/src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.ts index 85d0a4a9872..36d4879a41b 100644 --- a/src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.ts +++ b/src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.ts @@ -19,7 +19,7 @@ import { SESSIONS_LIST_PROMOTE_NEW_CHAT_ACTION_DEFAULT, SessionsListPromoteNewCh import { CustomViewVisibleContext } from '../../../common/agentsWindowContextKeys.js'; import { localize } from '../../../../nls.js'; import { FOCUS_AI_CUSTOMIZATION_VIEW_ID } from '../../aiCustomizationTreeView/browser/aiCustomizationTreeView.js'; -import { ISessionsPartService } from '../../../../workbench/contrib/sessions/browser/sessionsPartService.js'; +import { ISessionsPartService } from '../../../../workbench/services/sessions/browser/sessionsPartService.js'; import { ISessionsService } from '../../../../workbench/contrib/sessions/browser/sessionsService.js'; import { REPLACE_PROMPT_TEMPLATE_PLACEHOLDER_COMMAND_ID } from '../../../../workbench/contrib/sessions/browser/chat/promptTemplatePlaceholder.js'; import { ARCHIVE_SESSION_COMMAND_ID, FOCUS_ACTIVE_SESSION_COMMAND_ID, FOCUS_NEW_SESSION_HARNESS_PICKER_COMMAND_ID, FOCUS_NEW_SESSION_WORKSPACE_PICKER_COMMAND_ID, FOCUS_NEXT_CHAT_GROUP_COMMAND_ID, FOCUS_PREVIOUS_CHAT_GROUP_COMMAND_ID, MARK_SESSION_READ_COMMAND_ID, MARK_SESSION_UNREAD_COMMAND_ID, MOVE_CHAT_TO_NEXT_GROUP_COMMAND_ID, MOVE_CHAT_TO_PREVIOUS_GROUP_COMMAND_ID, RENAME_CHAT_COMMAND_ID, RENAME_SESSION_COMMAND_ID, SEND_IN_BACKGROUND_COMMAND_ID, SESSION_GRID_FOCUS_COMMANDS, SPLIT_CHAT_GROUP_DOWN_COMMAND_ID, SPLIT_CHAT_GROUP_RIGHT_COMMAND_ID } from '../../../../workbench/contrib/sessions/common/sessionCommands.js'; @@ -32,12 +32,12 @@ import { getWorktreeSuggestionAccessibilityHelp } from '../../../../workbench/co import { AGENT_SESSIONS_STORAGE_CLEANUP_SUGGESTION_SETTING } from '../../../../workbench/contrib/sessions/browser/sessionInputBanners/sessionWorktreeCleanupService.js'; import { IWorkbenchLayoutService } from '../../../../workbench/services/layout/browser/layoutService.js'; import { NAVIGATE_VIEW_COMMANDS } from '../../../../workbench/browser/actions/navigationActions.js'; -import { isPhoneLayout } from '../../../../workbench/contrib/sessions/browser/mobileLayout.js'; -import { AgentWorkbenchLayout, ISessionsHostLayoutService } from '../../../../workbench/contrib/sessions/browser/sessionsHostLayoutService.js'; +import { isPhoneLayout } from '../../../../workbench/browser/parts/sessions/mobileLayout.js'; +import { AgentWorkbenchLayout, ISessionsHostLayoutService } from '../../../../workbench/services/sessions/browser/sessionsHostLayoutService.js'; import { ISessionComparisonService } from '../../../../workbench/contrib/sessions/common/sessionComparison.js'; import { CHAT_WINDOWS_ENABLED_SETTING } from '../../chatWindow/common/chatWindows.js'; import { buildSessionComparisonAccessibleContent, isJudgeSession, SessionComparisonResultFocused } from '../../../../workbench/contrib/sessions/browser/chat/sessionComparisonResult.js'; -import { SESSION_ACTIVITY_BAR_SETTING, SESSIONS_CHAT_TABS_DEFAULT, SESSIONS_CHAT_TABS_SETTING, SESSIONS_LIST_GROUP_EXTERNAL_SESSIONS_SETTING, SESSIONS_LIST_INBOX_ENABLED_SETTING, SESSIONS_LIST_SHOW_AUTOMATION_SESSIONS_SETTING, SessionsChatTabsMode } from '../../../../workbench/contrib/sessions/common/sessionConfig.js'; +import { SESSION_ACTIVITY_BAR_SETTING, SESSIONS_CHAT_TABS_DEFAULT, SESSIONS_CHAT_TABS_SETTING, SESSIONS_LIST_GROUP_EXTERNAL_SESSIONS_SETTING, SESSIONS_LIST_INBOX_ENABLED_SETTING, SESSIONS_LIST_SHOW_AUTOMATION_SESSIONS_SETTING, SessionsChatTabsMode, SESSIONS_LIST_INLINE_ACTIONS_SETTING } from '../../../../workbench/contrib/sessions/common/sessionConfig.js'; import { CHAT_AUTOMATIONS_ENABLED_SETTING } from '../../../../workbench/contrib/chat/common/automations/automationsEnabled.js'; import { AGENT_SESSIONS_APPEARANCE_TOOLS_ENABLED_SETTING, AGENT_SESSIONS_RESPONSE_SELECTION_MENU_SETTING, AGENTS_PICKER_IN_ATTACH_CONTEXT_MENU_SETTING, COMPARE_AGENTS_ENABLED_SETTING, COMPARE_AGENTS_TOOLS_ENABLED_SETTING, ENVIRONMENT_PICKER_MANAGE_REMOTES_SETTING, ENVIRONMENT_PICKER_SETTING, NEW_SESSION_CONNECTOR_RECOMMENDATIONS_SETTING, NEW_SESSION_WELCOME_PHRASES_SETTING, WORKSPACE_OPT_OUT_SETTING } from '../../../../workbench/contrib/sessions/common/chatConstants.js'; import { logSettingExperimentTrigger } from '../../../../platform/telemetry/common/experimentTrigger.js'; @@ -48,7 +48,7 @@ import { RemoteAgentHostAutoConnectSettingId, RemoteAgentHostsEnabledSettingId } import { IChatEntitlementService } from '../../../../workbench/services/chat/common/chatEntitlementService.js'; import { areDevContainerSamplesEnabled } from '../../../../workbench/contrib/sessions/common/devContainerAgentHostService.js'; import { CustomizationMarketplaceConfiguration } from '../../../../platform/customizationMarketplace/common/customizationMarketplaceSources.js'; -import { readPaneSessions } from '../../../../workbench/contrib/sessions/browser/sessionGridPane.js'; +import { readPaneSessions } from '../../../../workbench/services/sessions/browser/sessionGridPane.js'; export class SessionsChatAccessibilityHelp implements IAccessibleViewImplementation { readonly priority = 120; readonly name = 'sessionsChat'; @@ -306,6 +306,9 @@ export class SessionsChatAccessibilityHelp implements IAccessibleViewImplementat content.push(localize('sessionsChat.newChatAgentPicker', "When a session offers more than one harness for its chats, the New Nested Session composer shows the Harness for New Chat picker in its session options, where New Session shows its harness picker, listing those harnesses. When the session options are collapsed, use the session options toggle to show them. Use Tab to reach the picker and Enter or Space to open it, then the arrow keys and Enter to choose the harness for the new chat; a harness that is not available is disabled and describes why. Choosing another harness replaces the unsent new chat. A chat keeps its harness; forks and side chats use the harness of the chat they come from. A chat tab whose harness differs from the session's names that harness, and a Sessions list row whose chats use different harnesses says so.")); } const promoteNewChatAction = SessionsListPromoteNewChatActionContext.getValue(accessor.get(IContextKeyService)) ?? SESSIONS_LIST_PROMOTE_NEW_CHAT_ACTION_DEFAULT; + if (configurationService.getValue(SESSIONS_LIST_INLINE_ACTIONS_SETTING) && !configurationService.getValue('chat.disableAIFeatures')) { + content.push(localize('sessionsChat.sessionsListInlineActions', "With sessions.list.inlineActions enabled, eligible rows show Fix Checks, Address Comments, or Fix Checks & Address Comments below the metadata. Use Tab or Shift+Tab to reach the button, and Enter or Space to activate it. The request runs in the background without opening the chat. A session row acts on its main chat; a nested chat row acts on that chat, even when multiple sessions are selected. Enabling this setting does not enable Agent Merge or change permissions.")); + } content.push(promoteNewChatAction ? archiveActionWording === ChatSessionArchiveActionWording.MarkAsDone ? localize('sessionsChat.sessionsListPromotedNewChatDoneActions', "For non-cloud sessions that support multiple chats, the session row toolbar offers New Nested Session before Mark as Done. Open the session's context menu to pin or unpin it.") diff --git a/src/vs/sessions/contrib/chat/test/browser/sessionsChatAccessibilityHelp.test.ts b/src/vs/sessions/contrib/chat/test/browser/sessionsChatAccessibilityHelp.test.ts index be9a673867a..771c7115fde 100644 --- a/src/vs/sessions/contrib/chat/test/browser/sessionsChatAccessibilityHelp.test.ts +++ b/src/vs/sessions/contrib/chat/test/browser/sessionsChatAccessibilityHelp.test.ts @@ -36,7 +36,7 @@ import { SESSION_ARCHIVE_NUDGE_SETTING } from '../../../../../workbench/contrib/ import { SessionComparisonAccessibleView, SessionsChatAccessibilityHelp } from '../../browser/sessionsChatAccessibilityHelp.js'; import { CustomizationMarketplaceConfiguration } from '../../../../../platform/customizationMarketplace/common/customizationMarketplaceSources.js'; import { SESSIONS_LIST_PROMOTE_NEW_CHAT_ACTION_DEFAULT, SessionsListPromoteNewChatActionContext } from '../../../../../workbench/contrib/sessions/common/contextkeys.js'; -import { SESSION_ACTIVITY_BAR_SETTING, SESSIONS_CHAT_TABS_SETTING, SESSIONS_LIST_GROUP_EXTERNAL_SESSIONS_SETTING, SESSIONS_LIST_SHOW_AUTOMATION_SESSIONS_SETTING, SessionsChatTabsMode } from '../../../../../workbench/contrib/sessions/common/sessionConfig.js'; +import { SESSION_ACTIVITY_BAR_SETTING, SESSIONS_CHAT_TABS_SETTING, SESSIONS_LIST_GROUP_EXTERNAL_SESSIONS_SETTING, SESSIONS_LIST_SHOW_AUTOMATION_SESSIONS_SETTING, SessionsChatTabsMode, SESSIONS_LIST_INLINE_ACTIONS_SETTING } from '../../../../../workbench/contrib/sessions/common/sessionConfig.js'; import { CHAT_AUTOMATIONS_ENABLED_SETTING } from '../../../../../workbench/contrib/chat/common/automations/automationsEnabled.js'; import { IAgentWorkbenchLayoutService } from '../../../../browser/workbench.js'; import { AgentWorkbenchLayout, ISessionsHostLayoutService } from '../../../../../workbench/services/sessions/browser/sessionsHostLayoutService.js'; @@ -49,6 +49,27 @@ import { ITestSessionWithChat, testGridPane } from '../../../../../workbench/con suite('SessionsChatAccessibilityHelp', () => { const store = ensureNoDisposablesAreLeakedInTestSuite(); + test('documents inline row actions only when enabled and AI is visible', () => { + const results = [[false, false], [true, false], [true, true]].map(([enabled, aiDisabled]) => { + const instantiationService = store.add(new TestInstantiationService()); + const configuration = new TestConfigurationService({ + [SESSIONS_LIST_INLINE_ACTIONS_SETTING]: enabled, + 'chat.disableAIFeatures': aiDisabled, + }); + store.add(configuration.onDidChangeConfigurationEmitter); + instantiationService.stub(IConfigurationService, configuration); + stubContextKeyService(instantiationService, configuration); + instantiationService.stub(ISessionsPartService, new class extends mock() { }()); + instantiationService.stub(ISessionsService, new class extends mock() { }()); + instantiationService.stub(IAgentHostFilterService, { selectedHost: undefined }); + instantiationService.stub(IWorkbenchLayoutService, { mainContainer: mainWindow.document.createElement('div') }); + instantiationService.stub(ISessionsHostLayoutService, {}); + return store.add(new SessionsChatAccessibilityHelp().getProvider(instantiationService)).provideContent() + .includes('With sessions.list.inlineActions enabled, eligible rows show Fix Checks, Address Comments, or Fix Checks & Address Comments below the metadata.'); + }); + assert.deepStrictEqual(results, [false, true, false]); + }); + test('documents comment card previews, secondary actions and review states', () => { const instantiation = store.add(new TestInstantiationService()); const configuration = new TestConfigurationService(); diff --git a/src/vs/sessions/contrib/inboxOne/browser/inboxNotificationsAccessibility.ts b/src/vs/sessions/contrib/inboxOne/browser/inboxNotificationsAccessibility.ts index 535fa02a37a..5c49ff4e218 100644 --- a/src/vs/sessions/contrib/inboxOne/browser/inboxNotificationsAccessibility.ts +++ b/src/vs/sessions/contrib/inboxOne/browser/inboxNotificationsAccessibility.ts @@ -28,20 +28,20 @@ class InboxNotificationsAccessibilityHelp implements IAccessibleViewImplementati getProvider(accessor: ServicesAccessor): AccessibleContentProvider { const restoreFocus = createFocusRestorer(accessor.get(IWorkbenchLayoutService)); const content = [ - localize('inboxNotifications.help.overview', "You are in the Inbox canvas tab. Each row combines a session's notifications. Its icon identifies the event, such as a question, approval, CI result, review comment, merge, or completion. Hover the icon to read its event label; screen readers include the event in the row label. A generated title describes the current action or latest completed work, with the work or session title below it. A Visual indicator means image evidence is available. The timestamp is at the far right. Switching sessions keeps this canvas available."), + localize('inboxNotifications.help.overview', "You are in the Inbox canvas tab. Each row combines a session's notifications. Its icon identifies the event, such as a question, approval, CI result, review comment, merge, or completion. In narrow lists, the duplicate visible event label is omitted to leave more room for titles; hover the icon to read the event label. Screen readers include the event in the row label. A generated title describes the current action or latest completed work, with the work or session title below it. A Visual indicator means image evidence is available. The timestamp is at the far right. Switching sessions keeps this canvas available."), localize('inboxNotifications.help.evidence', "Selecting a row opens evidence to the side without marking the session as read. Marking a session as Done, answering a question, or handling a confirmation marks only the associated conversation as read, unless newer activity has arrived. Questions and confirmation controls appear only in evidence. Recorded images, artifacts, references, and pull request states remain inspectable. When available, agent interpretation appears before notification details, including questions and confirmations. It is a generated summary, not proof of correctness. Inspect image opens the image carousel."), localize('inboxNotifications.help.canvases', "Extension canvases lists only canvases already opened in the selected conversation, not available extension suggestions. Choose one to interact with it in the detail pane. Hide canvas releases its Inbox presentation without closing the provider's canvas. Read canvas opens a plain-text accessible snapshot. Within a canvas, Tab moves through page controls; use to leave the page."), localize('inboxNotifications.help.repository', "Repository and pull request details are available in evidence rather than on the session row."), localize('inboxNotifications.help.pullRequestStates', "Pull request notifications show links with pull request icons so you can quickly scan checks, comments, and merge readiness. Multiple pull requests appear in a list. When there are more than three, activate the pull request count to expand or collapse the list. Tab through the links and activate one to open that pull request."), - localize('inboxNotifications.help.navigation', "Use Left and Right Arrow, Home, and End in the tab list. Use Up and Down Arrow between session rows. Enter or Space selects a row and focuses evidence. Tab reaches row actions, evidence controls, and the composer. Escape outside an input closes evidence and returns focus to the row, or to the new-session composer if the row is filtered out."), + localize('inboxNotifications.help.navigation', "Use Left and Right Arrow, Home, and End in the tab list. At narrow widths, the tabs scroll horizontally and the focused tab is brought into view. Use Up and Down Arrow between session rows. Enter or Space selects a row and focuses evidence. Tab reaches row actions, evidence controls, and the composer. Escape outside an input closes evidence and returns focus to the row, or to the new-session composer if the row is filtered out."), localize('inboxNotifications.help.history', "Go Back{0} and Go Forward{1} navigate between Inbox, sessions, and other visited views without resetting your Inbox selection, filters, or drafts.", '', ''), - localize('inboxNotifications.help.chat', "The reply composer sits below the selected evidence, outside its scrolling area. Its label identifies the selected conversation. Working sessions show their latest response live in evidence; Show chat response expands and reveals other responses. More agent context expands supporting interpretation without hiding approval inputs. Standard Chat shortcuts and accessibility help apply inside the composer. Escape there retains its normal Chat behavior."), - localize('inboxNotifications.help.newSession', "While Inbox is active, the sidebar New Session button and the New Session command or keybinding open and focus the bottom new-session composer. Deselecting a row or closing evidence also returns the composer to new-session mode. Paste images into the focused composer or drag files and images onto it to attach them. Drafts are preserved when changing targets. Sending from this composer starts a new session in the background without leaving Inbox. Selecting an existing session opens it outside Inbox."), + localize('inboxNotifications.help.chat', "The reply composer sits below the selected evidence, outside its scrolling area. Its label identifies the selected conversation. Working sessions show their latest response live in evidence, including queued and steering messages; Show chat response expands the latest exchange. More agent context expands supporting interpretation without hiding approval inputs. Standard Chat shortcuts and accessibility help apply inside the composer. Escape there retains its normal Chat behavior."), + localize('inboxNotifications.help.newSession', "While Inbox is active, the sidebar New Session button and the New Session command or keybinding open, highlight, and focus the bottom new-session composer. Deselecting a row or closing evidence also returns the composer to new-session mode. Paste images into the focused composer or drag files and images onto it to attach them. Drafts are preserved when changing targets. Sending from this composer starts a new session in the background without leaving Inbox. A Message sent confirmation is announced and offers an Open Session link for eight seconds or until you start typing again. The timeout pauses while the confirmation is hovered or focused. Selecting an existing session opens it outside Inbox."), localize('inboxNotifications.help.tabs', "Ready for you contains outstanding asks and completed work until you explicitly mark it as Done. Selecting completed work shows its generated response summary without moving it to Done. Reading the full session does not move it to Done either. Working contains active sessions without outstanding asks. Ready to merge requires passing CI on an open, non-draft pull request. On hold contains sessions you explicitly held until you resume them, even across reloads. Done contains explicitly completed, archived, or merged sessions. Tab counts count combined session rows. The Inbox badge counts Ready for you rows, independent of search and filters."), localize('inboxNotifications.help.sorting', "Use the Priority and Recent toggle buttons to switch sorting order. Priority is the default; the pressed button is the active sort."), localize('inboxNotifications.help.filter', "Search and the priority filter apply within the selected tab without changing its count."), - localize('inboxNotifications.help.feedback', "Use Send Positive Feedback at the top right, alongside the search, sorting, and filter controls, to send quick positive feedback. The button confirms when feedback is sent."), - localize('inboxNotifications.help.actions', "Supported CI, review, and merge actions appear directly on each session row. When CI failures and review comments both need attention, Fix CI & Address Reviews sends one request to handle both. Tab to these buttons and press Enter or Space to run an action without opening evidence. Hold or Resume and Mark Session as Done replace the timestamp when hovering or focusing a row. These actions are keyboard accessible. Hold changes Inbox organization; it does not stop the agent. Mark Session as Done is also available in the evidence header and moves the selected session to Done without archiving it. Evidence offers cleanup actions."), + localize('inboxNotifications.help.feedback', "Use Send Feedback at the top right, alongside the search, sorting, and filter controls, to open the issue reporter and describe what is or is not working in Inbox."), + localize('inboxNotifications.help.actions', "Supported CI, review, and merge actions appear directly on each session row without being repeated in the evidence header. When CI failures and review comments both need attention, Fix CI & Address Reviews sends one request to handle both. Tab to these buttons and press Enter or Space to run an action without opening evidence. After a successful action, Action taken is announced and the row remains briefly visible before updating. Hold or Resume and Mark Session as Done replace the timestamp when hovering or focusing a row. These actions are keyboard accessible. Hold changes Inbox organization; it does not stop the agent. Mark Session as Done is also available in the evidence header and moves the selected session to Done without archiving it. Evidence offers cleanup actions."), localize('inboxNotifications.help.completion', "Opening the full session dismisses its completion notification, but does not answer questions, approve requests, or dismiss CI and review issues. Failed or canceled actions remain pending. If an action moves your selected session to another tab, evidence closes and the composer returns to New Session. A completed background action never clears a newer selection."), localize('inboxNotifications.help.liveUpdates', "While evidence is selected or focus is in the list, passive updates preserve the reading order. Titles and current approval state update without a refresh notice. Agent interpretation refreshes when a response in the selected conversation completes, without changing your reply draft. Sessions normally move to their current workflow tab. If a session moves while its reply composer is focused, its row and conversation stay in place with a label showing the current workflow tab until you select another conversation, change tabs or filters, or choose Show Inbox Updates. Tab counts continue to reflect the current workflow state. If new sessions arrive outside the current reading list, Show Inbox Updates reveals them. Explicit Hold and Done actions still apply immediately, and removed sessions are not retained."), localize('inboxNotifications.help.toolApprovals', "Approvals in evidence use the same cards as chat and show the terminal command or read-only tool input and any disclaimer. Use the approval or skip buttons to respond; additional approval scopes are in the adjacent dropdown. When available, Explain opens a side chat without approving the command. Tool results and requests requiring editable inputs or richer confirmation controls must be reviewed using Open Session."), diff --git a/src/vs/sessions/contrib/inboxOne/browser/inboxNotificationsView.ts b/src/vs/sessions/contrib/inboxOne/browser/inboxNotificationsView.ts index a7c8374bbf8..2ad65b70bd5 100644 --- a/src/vs/sessions/contrib/inboxOne/browser/inboxNotificationsView.ts +++ b/src/vs/sessions/contrib/inboxOne/browser/inboxNotificationsView.ts @@ -20,7 +20,7 @@ import { equals } from '../../../../base/common/arrays.js'; import { disposableTimeout, raceCancellation, raceTimeout, RunOnceScheduler } from '../../../../base/common/async.js'; import { clamp } from '../../../../base/common/numbers.js'; import { isEqual } from '../../../../base/common/resources.js'; -import { Disposable, DisposableStore, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +import { Disposable, DisposableMap, DisposableStore, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; import { autorun, constObservable, IObservable, IReader, observableFromEvent, observableValue, runOnChange, waitForState } from '../../../../base/common/observable.js'; import { ScrollbarVisibility } from '../../../../base/common/scrollable.js'; import { onUnexpectedError } from '../../../../base/common/errors.js'; @@ -395,6 +395,9 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas private readonly visibleCardIds = new Set(); private renderedCards: HTMLElement[] = []; private renderedItems: readonly IInboxNotificationItem[] = []; + private latestItems: readonly IInboxNotificationItem[] = []; + private readonly rowActions = new Map(); + private readonly rowActionTimeouts = this._register(new DisposableMap()); private readonly cardRenderings = new Map(); private readonly carouselModels = new Map(); private readonly focusOutTimeout = this._register(new MutableDisposable()); @@ -418,6 +421,7 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas private observedComposerContent: HTMLElement | undefined; private composerInitialization: Promise | undefined; private selectedRowTab: InboxTab | undefined; + private retainedReplyRowId: string | undefined; private readonly newSessionElement = $('div.inbox-notifications-new-session'); private readonly newSessionDisposables = this._register(new DisposableStore()); /** @@ -820,6 +824,7 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas this.clearSelectedItem('tabChanged'); this.selectedTab.set(tabValues[next], undefined); tabButtons[next].focus(); + tabButtons[next].element.scrollIntoView({ block: 'nearest', inline: 'nearest' }); })); const search = this._register(new InputBox(toolbar, undefined, { inputBoxStyles: defaultInputBoxStyles, @@ -924,7 +929,11 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas })); showNewNotificationsButton.label = localize('inboxNotifications.showNewNotifications', "Show Inbox Updates"); this._register(showNewNotificationsButton.onDidClick(() => { - if (this.applyDeferredUpdates(true)) { + const retainedReply = !!this.retainedReplyRowId; + if (retainedReply) { + this.clearSelectedItem('updatesShown'); + } + if (this.applyDeferredUpdates(true) || retainedReply) { this.logInboxInteraction('deferredUpdates.showNewNotifications', 'banner'); } })); @@ -967,21 +976,30 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas const tab = this.selectedTab.read(reader); const query = this.searchText.read(reader).toLocaleLowerCase().trim(); const rows = this.inboxNotificationsService.sessionRows.read(reader); + const categories = this.visibleCategories.read(reader); + const sortMode = this.inboxNotificationsService.sortMode.read(reader); + const queryKey = JSON.stringify([tab, query, sortMode, [...categories]]); + const queryChanged = queryKey !== this.listQueryKey; const selectedId = this.selectedItemId.read(reader); const selected = rows.find(row => row.id === selectedId); - if (selectedId && (!selected || selected.tab !== tab)) { + const retainReply = !!selected && selected.tab !== tab && !queryChanged + && (this.retainedReplyRowId === selectedId || this.isReplyComposerFocused()); + // Once retained, incidental blur must not interrupt the same draft on the next update. + this.retainedReplyRowId = retainReply ? selectedId : undefined; + if (selectedId && (!selected || selected.tab !== tab && !retainReply)) { // Selection cleanup must not apply a deferred snapshot from before the tab change. this.deferredItems = undefined; this.clearSelectedItem(selected ? 'tabChanged' : 'itemRemoved'); } const previews = this.inboxNotificationsService.previews.read(reader); - const items = rows.filter(row => row.tab === tab && (!query || [ + const items = rows.filter(row => (row.tab === tab || retainReply && row.id === selectedId) && (!query || [ row.title, row.workTitle, row.sessionTitle, row.repositoryLabel, row.previewSignature && previews.get(row.previewSignature), ].filter(Boolean).join(' ').toLocaleLowerCase().includes(query))); - const categories = this.visibleCategories.read(reader); - const sortMode = this.inboxNotificationsService.sortMode.read(reader); - const queryKey = JSON.stringify([tab, query, sortMode, [...categories]]); - const queryChanged = queryKey !== this.listQueryKey; + if (queryChanged) { + for (const action of this.rowActions.values()) { + action.queryKey = undefined; + } + } this.listQueryKey = queryKey; this.handleNotificationListUpdate(items, queryChanged); })); @@ -1003,6 +1021,23 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas } private handleNotificationListUpdate(items: readonly IInboxNotificationItem[], force = false): void { + this.latestItems = items; + if (this.rowActions.size) { + const retained = [...items]; + for (const [id, action] of this.rowActions) { + if (action.queryKey !== this.listQueryKey) { + continue; + } + const index = retained.findIndex(item => item.id === id); + if (index >= 0) { + retained[index] = action.item; + } else { + const previousIndex = this.renderedItems.findIndex(item => item.id === id); + retained.splice(Math.max(0, Math.min(previousIndex, retained.length)), 0, action.item); + } + } + items = retained; + } if (!this.hasReceivedInitialListUpdate) { this.hasReceivedInitialListUpdate = true; this.updateToolbarLoadingSpinner(); @@ -1101,6 +1136,11 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas && !!activeElement.closest('.inbox-notifications-chat-part-host'); } + private isReplyComposerFocused(): boolean { + const activeElement = getActiveElement(); + return !!activeElement && this.detailChatElement.contains(activeElement); + } + private renderList(items: readonly IInboxNotificationItem[]): void { const list = this.listContainer.get(); if (!list || this._store.isDisposed) { @@ -1181,7 +1221,8 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas } private renderCard(item: IInboxNotificationItem): HTMLElement { - const signature = safeStringify(item); + const action = this.rowActions.get(item.id); + const signature = `${safeStringify(item)}|${this.selectedTab.get()}|${action ? action.succeeded ? 'succeeded' : 'running' : ''}`; let rendering = this.cardRenderings.get(item.id); if (!rendering || rendering.signature !== signature) { rendering?.store.dispose(); @@ -1289,6 +1330,9 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas card.setAttribute('role', 'listitem'); card.dataset.notificationId = item.id; card.setAttribute('aria-label', this.getCardAriaLabel(item)); + const rowAction = this.rowActions.get(item.id); + card.classList.toggle('action-succeeded', rowAction?.succeeded === true); + card.setAttribute('aria-busy', String(!!rowAction && !rowAction.succeeded)); if (this.selectedItemId.get() === item.id) { card.classList.add('selected'); } @@ -1339,6 +1383,16 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas ].filter(Boolean).join('. ')); })); const metadata = content.appendChild($('.inbox-notifications-row-metadata')); + if (row && row.tab !== this.selectedTab.get()) { + metadata.appendChild($('span.inbox-notifications-row-workflow-status', undefined, getInboxTabLabel(row.tab))); + } + if (rowAction) { + const feedback = metadata.appendChild($('.inbox-notifications-row-action-status')); + feedback.appendChild(renderIcon(rowAction.succeeded ? Codicon.check : Codicon.loading)).setAttribute('aria-hidden', 'true'); + feedback.appendChild($('span', undefined, rowAction.succeeded + ? localize('inboxNotifications.action.taken', "Action taken") + : localize('inboxNotifications.action.running', "Taking action…"))); + } if (row?.hasImages) { const visual = metadata.appendChild($('.inbox-notifications-visual')); visual.appendChild(renderIcon(Codicon.fileMedia)).setAttribute('aria-hidden', 'true'); @@ -1382,7 +1436,14 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas ariaLabel: row.tab === InboxTab.OnHold ? localize('inbox.resume', "Resume") : localize('inbox.hold', "Put on Hold") })); hold.label = row.tab === InboxTab.OnHold ? '$(play)' : '$(history)'; - store.add(hold.onDidClick(() => this.setSessionOnHold(row))); + hold.enabled = !rowAction; + store.add(hold.onDidClick(event => { + event.stopPropagation(); + void this.runRowAction(row.id, async () => { + this.setSessionOnHold(row); + return 'success'; + }).catch(onUnexpectedError); + })); this.renderActionButton(actions, row, { id: 'done', label: '$(check)', ariaLabel: localize('inbox.done', "Mark Session as Done"), kind: InboxNotificationActionKind.MarkDone }, store); } if (row) { @@ -1416,26 +1477,7 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas if (item.title !== sessionTitle) { titleGroup.appendChild($('.inbox-notifications-item-title', undefined, item.title)); } - const primaryActions = item.actions.filter(action => - action.kind !== InboxNotificationActionKind.OpenSession - && action.kind !== InboxNotificationActionKind.MarkDone - && action.kind !== InboxNotificationActionKind.Dismiss - && !isInboxPullRequestActionKind(action.kind)); - const headerActions: IInboxNotificationAction[] = []; - let footerActions: HTMLElement | undefined; - if (primaryActions.length || headerActions.length) { - const actionContainer = item.kind === InboxNotificationKind.PullRequestMerged - ? footerActions = $('.inbox-notifications-item-actions.inbox-notifications-item-footer-actions') - : heading.appendChild($('.inbox-notifications-item-actions.inbox-notifications-item-header-actions')); - for (const action of [...primaryActions, ...headerActions]) { - const button = this.renderActionButton(actionContainer, item, action, store); - if (action.kind === InboxNotificationActionKind.MarkDone) { - button.element.classList.add('inbox-notifications-item-action-done'); - } - } - } - - if (!titleGroup.childElementCount && !primaryActions.length) { + if (!titleGroup.childElementCount) { heading.remove(); } const badges = card.appendChild($('.inbox-notifications-item-badges')); @@ -1502,7 +1544,7 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas descriptionEl.hidden = !descriptionEl.textContent; card.setAttribute('aria-label', this.getCardAriaLabel(item, descriptionEl.textContent)); this.renderNeedsInputPart(card, item, store); - const hasContent = !!(titleGroup.childElementCount || primaryActions.length || item.repositoryLabel + const hasContent = !!(titleGroup.childElementCount || item.repositoryLabel || item.pullRequestStates?.length || descriptionEl.textContent || item.needsInputPart); card.hidden = !hasContent; const session = item.sessionResource ? this.sessionsManagementService.getSession(item.sessionResource) : undefined; @@ -1520,9 +1562,6 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas })); } - if (footerActions) { - card.appendChild(footerActions); - } return card; } @@ -2141,7 +2180,7 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas this.applyDeferredUpdates(true); } - private async runAction(item: IInboxNotificationItem, action: IInboxNotificationAction, sourceElement?: HTMLElement, enableAlways = false): Promise { + private async runAction(item: IInboxNotificationItem, action: IInboxNotificationAction, sourceElement?: HTMLElement, enableAlways = false): Promise { const startTime = Date.now(); const commandId = action.commandId ?? 'none'; const logResult = (result: InboxInteractionResult): void => { @@ -2160,7 +2199,7 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas case InboxNotificationActionKind.OpenSession: { if (!item.sessionResource) { logResult('skipped'); - return; + return 'skipped'; } await this.sessionsService.openSession(item.sessionResource, { source: 'inbox' }); result = 'success'; @@ -2219,10 +2258,42 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas } } logResult(result); + return result; } catch (error) { logResult('failure'); onUnexpectedError(error); this.notificationService.error(localize('inboxNotifications.actionError', "Unable to run inbox action.")); + return 'failure'; + } + } + + private async runRowAction(rowId: string | undefined, run: () => Promise): Promise { + if (this._store.isDisposed || rowId && this.rowActions.has(rowId)) { + return; + } + const row = rowId ? this.renderedItems.find(item => item.id === rowId) : undefined; + const rowAction = row ? { item: row, queryKey: this.listQueryKey, succeeded: false } : undefined; + if (row && rowAction) { + this.rowActions.set(row.id, rowAction); + } + let result: InboxInteractionResult = 'failure'; + try { + result = await run(); + } finally { + if (row && rowAction && !this._store.isDisposed && this.rowActions.get(row.id) === rowAction) { + if (result === 'success') { + rowAction.succeeded = true; + status(localize('inboxNotifications.action.taken', "Action taken")); + this.rowActionTimeouts.set(row.id, disposableTimeout(() => { + this.rowActions.delete(row.id); + this.rowActionTimeouts.deleteAndDispose(row.id); + this.handleNotificationListUpdate(this.latestItems); + }, 1500)); + } else { + this.rowActions.delete(row.id); + } + this.handleNotificationListUpdate(this.latestItems); + } } } @@ -2259,25 +2330,27 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas })) : store.add(new Button(container, baseOptions)); button.label = action.label; + const card = container.closest('.inbox-notifications-item'); + const rowId = card?.dataset.notificationId; + button.enabled = !rowId || !this.rowActions.has(rowId); if (openSessionIsSecondary) { this.setupSessionPreviewHover(button.element, item, store); } if (button instanceof ButtonWithDropdown) { button.dropdownButton.setAriaLabel(localize('inboxNotifications.action.moreActions', "More Actions for {0}", action.label)); } - store.add(button.onDidClick(async () => { - this.logInboxInteraction('runAction', 'actionButton', item, action.kind, { commandId: action.commandId ?? 'none' }); - if (!showsSpinnerWhileRunning) { - void this.runAction(item, action, button.element); + store.add(button.onDidClick(async event => { + event?.stopPropagation(); + if (rowId && this.rowActions.has(rowId)) { return; } - // The action submits a request to the session in the background, which - // can take a moment; show an inline spinner so the click clearly - // registers instead of looking like nothing happened. + this.logInboxInteraction('runAction', 'actionButton', item, action.kind, { commandId: action.commandId ?? 'none' }); button.enabled = false; - button.label = `$(loading~spin) ${action.label}`; + if (showsSpinnerWhileRunning) { + button.label = `$(loading~spin) ${action.label}`; + } try { - await this.runAction(item, action, button.element); + await this.runRowAction(openSessionIsSecondary ? undefined : rowId, () => this.runAction(item, action, button.element)); } finally { button.label = action.label; button.enabled = true; @@ -2743,6 +2816,7 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas this.detailSash.state = sideBySide ? SashState.Enabled : SashState.Disabled; } this.listPaneElement.style.width = sideBySide ? `${this.clampListPaneWidth(this.listPaneWidth)}px` : ''; + this.listPaneElement.classList.toggle('compact', this.listPaneElement.clientWidth < 560); this.detailSash?.layout(); this.scrollableElement.scanDomNode(); this.detailScrollableElement.scanDomNode(); @@ -2781,6 +2855,7 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas } this.endSelectionTelemetry('selectionChanged'); + this.retainedReplyRowId = undefined; this.selectedRowTab = this.getRow(id)?.tab; this.selectedChatResource = undefined; this.detailExchangeExpanded = this.selectedRowTab === InboxTab.Working; @@ -2838,6 +2913,7 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas const restoreComposerFocus = !!focused && (this.detailPaneElement.contains(focused) || this.detailChatElement.contains(focused)); this.endSelectionTelemetry(trigger); this.selectedRowTab = undefined; + this.retainedReplyRowId = undefined; this.selectedChatResource = undefined; this.selectedItemId.set(undefined, undefined); for (const rendering of this.cardRenderings.values()) { @@ -3052,6 +3128,16 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas this.detailContentElement.setAttribute('aria-label', localize('inboxNotifications.detail.ariaLabel.item', "Notification details for {0}.", heading.textContent)); })); const headerActions = header.appendChild($('.inbox-notifications-evidence-actions')); + for (const notification of row?.notifications ?? [item]) { + for (const action of notification.actions) { + if (action.kind !== InboxNotificationActionKind.OpenSession + && action.kind !== InboxNotificationActionKind.MarkDone + && action.kind !== InboxNotificationActionKind.Dismiss + && !isInboxPullRequestActionKind(action.kind)) { + this.renderActionButton(headerActions, notification, action, this.detailDisposables); + } + } + } if (item.sessionResource) { this.renderActionButton(headerActions, item, { id: 'open', label: localize('inbox.openSession', "Open Session"), kind: InboxNotificationActionKind.OpenSession }, this.detailDisposables); } @@ -3436,6 +3522,7 @@ export class InboxNotificationsView extends Disposable implements IWindowCanvas layout(width: number, _height: number): void { this.layoutWidth = width; + this.container?.classList.toggle('compact', width < 600); if (!this.hasCustomListPaneWidth) { this.listPaneWidth = this.getDefaultListPaneWidth(); } diff --git a/src/vs/sessions/contrib/inboxOne/browser/media/inboxNotificationsView.css b/src/vs/sessions/contrib/inboxOne/browser/media/inboxNotificationsView.css index 07a9127d59c..4f7569b49ad 100644 --- a/src/vs/sessions/contrib/inboxOne/browser/media/inboxNotificationsView.css +++ b/src/vs/sessions/contrib/inboxOne/browser/media/inboxNotificationsView.css @@ -833,6 +833,10 @@ grid-area: 1 / 1; } +.inbox-notifications-list-pane.compact .inbox-notifications-row-content { + display: contents; +} + .inbox-notifications-list-pane.compact .inbox-notifications-row-titles { grid-area: 1 / 2; } diff --git a/src/vs/sessions/contrib/inboxOne/test/browser/inboxNotificationsView.test.ts b/src/vs/sessions/contrib/inboxOne/test/browser/inboxNotificationsView.test.ts index cc9493f7a8d..a7601adb882 100644 --- a/src/vs/sessions/contrib/inboxOne/test/browser/inboxNotificationsView.test.ts +++ b/src/vs/sessions/contrib/inboxOne/test/browser/inboxNotificationsView.test.ts @@ -164,7 +164,7 @@ suite('InboxNotificationsView', () => { submitPlanReviewPart(item: IInboxNotificationItem, part: IInboxNotificationPlanReviewPart, review: ChatPlanReviewData, result: IChatPlanReviewResult): void; classifyCarouselAnswers(answers: Map): { answerKind: string; answerCharCount: number }; runMergedSessionCleanupAction(item: IInboxNotificationItem, kind: InboxNotificationActionKind.ArchiveSession | InboxNotificationActionKind.DeleteSession, enableAlways: boolean): Promise; - runAction(item: IInboxNotificationItem, action: IInboxNotificationItem['actions'][number], sourceElement?: HTMLElement, enableAlways?: boolean): Promise; + runAction(item: IInboxNotificationItem, action: IInboxNotificationItem['actions'][number], sourceElement?: HTMLElement, enableAlways?: boolean): Promise; getSessionChatModel(item: IInboxNotificationItem): IChatModel | undefined; setCategoryVisible(category: 'now' | 'next' | 'later', visible: boolean): void; runInboxPullRequestAction(item: IInboxNotificationItem, kind: InboxNotificationActionKind.AgentMergeFixCI | InboxNotificationActionKind.AgentMergeAddressReviews | InboxNotificationActionKind.AgentMergeMergePullRequest): Promise; @@ -291,6 +291,51 @@ suite('InboxNotificationsView', () => { return { view, container, instantiationService, chatViews, chatOptions, newChatViews, newChatOptions, hovers, navigationRequest, sessionsVisible: () => sessionsVisible }; } + test('rotates personalized empty messages on visits but not passive updates', () => { + const name = observableValue('name', 'Megan'); + const rows = observableValue('rows', []); + const { view, container } = createView(constObservable([]), { rows, welcomeName: name }); + view.render(container); + const messages = [view.getEmptyAccessibleContent()]; + rows.set([], undefined); + messages.push(view.getEmptyAccessibleContent()); + name.set(undefined, undefined); + messages.push(view.getEmptyAccessibleContent()); + for (let i = 0; i < 3; i++) { + view.setVisible(false); + view.setVisible(true); + messages.push(view.getEmptyAccessibleContent()); + } + assert.deepStrictEqual(messages, [ + 'All caught up, Megan. Enjoy a little breathing room.', + 'All caught up, Megan. Enjoy a little breathing room.', + 'All caught up. Enjoy a little breathing room.', + 'Nothing needs your attention. Take a moment for yourself.', + 'You\'re in a good place. We\'ll be here when you\'re ready.', + 'All caught up. Enjoy a little breathing room.', + ]); + }); + + test('mentions working agents only when there are working sessions and preserves filtered copy', () => { + const working = { + id: 'working', tab: InboxTab.Working, kind: InboxNotificationKind.Completed, priority: InboxNotificationPriority.Later, + title: 'Working', sessionTitle: 'Working', occurrence: 'working', notifications: [], hasImages: false, + description: '', timestamp: 1, actions: [], + }; + const rows = observableValue('rows', [working]); + const { view, container } = createView(constObservable([]), { rows, welcomeName: constObservable('Megan') }); + view.render(container); + const messages = [view.getEmptyAccessibleContent()]; + const search = container.querySelector('.inbox-notifications-search input')!; + search.value = 'missing'; + search.dispatchEvent(new mainWindow.Event('input', { bubbles: true })); + messages.push(view.getEmptyAccessibleContent()); + assert.deepStrictEqual(messages, [ + 'All caught up, Megan. Your agents are working.', + 'No notifications match the current filter.', + ]); + }); + for (const { hour, before, after } of [ { hour: 11, before: 'Good morning', after: 'Good afternoon' }, { hour: 17, before: 'Good afternoon', after: 'Good evening' }, @@ -383,51 +428,6 @@ suite('InboxNotificationsView', () => { }); } - test('rotates personalized empty messages on visits but not passive updates', () => { - const name = observableValue('name', 'Megan'); - const rows = observableValue('rows', []); - const { view, container } = createView(constObservable([]), { rows, welcomeName: name }); - view.render(container); - const messages = [view.getEmptyAccessibleContent()]; - rows.set([], undefined); - messages.push(view.getEmptyAccessibleContent()); - name.set(undefined, undefined); - messages.push(view.getEmptyAccessibleContent()); - for (let i = 0; i < 3; i++) { - view.setVisible(false); - view.setVisible(true); - messages.push(view.getEmptyAccessibleContent()); - } - assert.deepStrictEqual(messages, [ - 'All caught up, Megan. Enjoy a little breathing room.', - 'All caught up, Megan. Enjoy a little breathing room.', - 'All caught up. Enjoy a little breathing room.', - 'Nothing needs your attention. Take a moment for yourself.', - 'You\'re in a good place. We\'ll be here when you\'re ready.', - 'All caught up. Enjoy a little breathing room.', - ]); - }); - - test('mentions working agents only when there are working sessions and preserves filtered copy', () => { - const working = { - id: 'working', tab: InboxTab.Working, kind: InboxNotificationKind.Completed, priority: InboxNotificationPriority.Later, - title: 'Working', sessionTitle: 'Working', occurrence: 'working', notifications: [], hasImages: false, - description: '', timestamp: 1, actions: [], - }; - const rows = observableValue('rows', [working]); - const { view, container } = createView(constObservable([]), { rows, welcomeName: constObservable('Megan') }); - view.render(container); - const messages = [view.getEmptyAccessibleContent()]; - const search = container.querySelector('.inbox-notifications-search input')!; - search.value = 'missing'; - search.dispatchEvent(new mainWindow.Event('input', { bubbles: true })); - messages.push(view.getEmptyAccessibleContent()); - assert.deepStrictEqual(messages, [ - 'All caught up, Megan. Your agents are working.', - 'No notifications match the current filter.', - ]); - }); - for (const { categories, expected } of [ { categories: ['completed'], expected: ['now', 'next', 'later'] }, { categories: ['completed', 'unsupported'], expected: ['now', 'next', 'later'] }, @@ -639,6 +639,7 @@ suite('InboxNotificationsView', () => { }])); container.style.setProperty('--vscode-spacing-size100', '10px'); container.style.setProperty('--vscode-spacing-size80', '8px'); + container.style.width = '1500px'; view.render(container); const card = container.querySelector('.inbox-notifications-item')!; card.click(); @@ -793,7 +794,66 @@ suite('InboxNotificationsView', () => { }); } - test('merged session cleanup actions wrap below the content without overflowing or competing with the title', () => { + for (const [kind, label] of [ + [InboxNotificationActionKind.AgentMergeAddressReviews, 'Address Reviews'], + [InboxNotificationActionKind.AgentMergeFixCI, 'Fix CI Failures'], + [InboxNotificationActionKind.AgentMergeMergePullRequest, 'Merge Pull Request'], + [InboxNotificationActionKind.Command, 'Extension Action'], + ] as const) { + test(`${label} is not duplicated in evidence when offered inline`, () => { + const { view, container } = createView(constObservable([{ + id: 'item', kind: InboxNotificationKind.ReviewComments, priority: InboxNotificationPriority.Next, + title: 'Review comments', description: '', timestamp: 1, sessionResource: URI.parse('test:///session'), + actions: [ + { id: 'open', label: 'Open Session', kind: InboxNotificationActionKind.OpenSession }, + { id: 'action', label, kind }, + { id: 'done', label: 'Done', kind: InboxNotificationActionKind.MarkDone }, + { id: 'dismiss', label: 'Dismiss', kind: InboxNotificationActionKind.Dismiss }, + ], + }])); + view.render(container); + container.querySelector('.inbox-notifications-item')!.click(); + assert.deepStrictEqual({ + labels: [...container.querySelectorAll('.inbox-notifications-evidence-actions > .monaco-button')].map(button => button.textContent), + notificationActions: container.querySelectorAll('.inbox-notifications-notification .inbox-notifications-item-actions').length, + }, { + labels: [...(kind === InboxNotificationActionKind.Command ? [label] : []), 'Open Session', 'Mark Session as Done', ''], + notificationActions: 0, + }); + }); + } + + test('evidence header actions retain their originating notification in a combined row', async () => { + const items: IInboxNotificationItem[] = ['first', 'second'].map(id => ({ + id, kind: InboxNotificationKind.External, priority: InboxNotificationPriority.Next, + title: id, description: '', timestamp: 1, sessionResource: URI.parse('test:///session'), + actions: [{ id: 'command', label: id, kind: InboxNotificationActionKind.Command, commandId: `test.${id}` }], + })); + const row: IInboxSessionRow = { + ...items[0], tab: InboxTab.ReadyForYou, sessionTitle: 'Session', occurrence: 'row', notifications: items, hasImages: false, + }; + const { view, container, instantiationService } = createView(constObservable(items), { rows: constObservable([row]) }); + const execute = spy(async () => undefined); + const dismiss = spy(); + instantiationService.stub(ICommandService, 'executeCommand', execute); + instantiationService.stub(IInboxNotificationsService, 'dismissNotification', dismiss); + view.render(container); + container.querySelector('.inbox-notifications-item')!.click(); + const buttons = [...container.querySelectorAll('.inbox-notifications-evidence-actions > .monaco-button')]; + buttons[1].click(); + await timeout(0); + assert.deepStrictEqual({ + labels: buttons.map(button => button.textContent), + commands: execute.args, + dismissed: dismiss.args, + }, { + labels: ['first', 'second', 'Open Session', 'Mark Session as Done', ''], + commands: [['test.second']], + dismissed: [['second', items[1]]], + }); + }); + + test('merged session cleanup actions precede Open Session and wrap without overflowing', () => { const session = upcastPartial({ providerId: 'local-agent-host', mainChat: constObservable(upcastPartial({ resource: URI.parse('test:///chat') })), chats: constObservable([]) }); const { view, container, instantiationService } = createView(constObservable([{ id: 'merged', kind: InboxNotificationKind.PullRequestMerged, priority: InboxNotificationPriority.Later, @@ -813,22 +873,21 @@ suite('InboxNotificationsView', () => { container.style.width = `${width}px`; view.layout(width, 400); const card = container.querySelector('.inbox-notifications-notification')!; - const footer = card.querySelector('.inbox-notifications-item-footer-actions')!; - const bounds = footer.getBoundingClientRect(); - const description = card.querySelector('.inbox-notifications-item-description')!.getBoundingClientRect(); + const actions = container.querySelector('.inbox-notifications-evidence-actions')!; + const bounds = actions.getBoundingClientRect(); return { - belowContent: bounds.top >= description.bottom, - last: card.lastElementChild === footer, - headerActions: card.querySelector('.inbox-notifications-item-header-actions'), - noOverflow: [...footer.querySelectorAll('.monaco-button')].every(button => { + labels: [...actions.children].map(element => element.textContent), + notificationActions: card.querySelector('.inbox-notifications-item-actions'), + noOverflow: [...actions.querySelectorAll('.monaco-button')].every(button => { const rect = button.getBoundingClientRect(); return rect.left >= bounds.left - 1 && rect.right <= bounds.right + 1 && rect.bottom <= bounds.bottom + 1; }), - dropdowns: footer.querySelectorAll('.monaco-button-dropdown').length, + dropdowns: actions.querySelectorAll('.monaco-button-dropdown').length, }; }); assert.deepStrictEqual(layouts, Array.from({ length: 4 }, () => ({ - belowContent: true, last: true, headerActions: null, noOverflow: true, dropdowns: 2, + labels: ['Archive Session', 'Delete Session', 'Open Session', 'Mark Session as Done', ''], + notificationActions: null, noOverflow: true, dropdowns: 2, }))); }); @@ -879,7 +938,7 @@ suite('InboxNotificationsView', () => { tab: InboxTab.ReadyForYou, notifications: items, hasImages: false, actions: [], })); const { view, container } = createView(constObservable([...notifications, merged]), { rows: constObservable(rows) }); - const pending = new DeferredPromise(); + const pending = new DeferredPromise(); const run = stub(accessView(view), 'runAction').returns(pending.p); view.render(container); const firstCard = container.querySelector('.inbox-notifications-item')!; @@ -895,7 +954,7 @@ suite('InboxNotificationsView', () => { selected: firstCard.classList.contains('selected'), disabled: buttons[0].getAttribute('aria-disabled'), spinning: !!buttons[0].querySelector('.codicon-modifier-spin'), }; - await pending.complete(); + await pending.complete('skipped'); await timeout(0); firstCard.click(); assert.deepStrictEqual({ @@ -941,6 +1000,85 @@ suite('InboxNotificationsView', () => { }); }); + test('clicking an inline action label does not open evidence and retains success feedback before removal', () => runWithFakedTimers({ useFakeTimers: true }, async () => { + const item: IInboxNotificationItem = { + id: 'fix', kind: InboxNotificationKind.FailingCI, priority: InboxNotificationPriority.Now, + title: 'CI failed', description: '', timestamp: 1, + actions: [{ id: 'fix', label: 'Fix CI', kind: InboxNotificationActionKind.AgentMergeFixCI }], + }; + const items = observableValue('items', [item]); + const { view, container } = createView(items); + const pending = new DeferredPromise(); + stub(accessView(view), 'runInboxPullRequestAction').returns(pending.p); + view.render(container); + container.querySelector('.inbox-notifications-row-inline-actions .monaco-button > span')!.click(); + const expandedOnClick = !!container.querySelector('.inbox-notifications-item.selected'); + items.set([], undefined); + const retainedWhileRunning = !!container.querySelector('.inbox-notifications-item'); + await pending.complete('success'); + await timeout(0); + const feedback = container.querySelector('.inbox-notifications-row-action-status')?.textContent; + await timeout(1499); + const retainedBeforeTimeout = !!container.querySelector('.inbox-notifications-item'); + await timeout(1); + const afterTimeout = container.querySelector('.inbox-notifications-item'); + view.dispose(); + assert.deepStrictEqual({ expandedOnClick, retainedWhileRunning, feedback, retainedBeforeTimeout, afterTimeout }, { + expandedOnClick: false, retainedWhileRunning: true, feedback: 'Action taken', retainedBeforeTimeout: true, afterTimeout: null, + }); + })); + + test('failed inline actions restore the button without showing success feedback or opening evidence', async () => { + const item: IInboxNotificationItem = { + id: 'fix', kind: InboxNotificationKind.FailingCI, priority: InboxNotificationPriority.Now, + title: 'CI failed', description: '', timestamp: 1, + actions: [{ id: 'fix', label: 'Fix CI', kind: InboxNotificationActionKind.AgentMergeFixCI }], + }; + const { view, container, instantiationService } = createView(constObservable([item])); + stub(accessView(view), 'runInboxPullRequestAction').resolves('failure'); + instantiationService.stub(INotificationService, 'error', () => { }); + view.render(container); + container.querySelector('.inbox-notifications-row-inline-actions .monaco-button > span')!.click(); + await timeout(0); + const button = container.querySelector('.inbox-notifications-row-inline-actions .monaco-button'); + assert.deepStrictEqual({ + expanded: !!container.querySelector('.inbox-notifications-item.selected'), + feedback: container.querySelector('.inbox-notifications-row-action-status'), + label: button?.textContent, disabled: button?.getAttribute('aria-disabled'), + }, { expanded: false, feedback: null, label: 'Fix CI', disabled: 'false' }); + }); + + test('action feedback follows a session without retaining it in a different workflow tab', () => runWithFakedTimers({ useFakeTimers: true }, async () => { + const item: IInboxNotificationItem = { + id: 'fix', kind: InboxNotificationKind.FailingCI, priority: InboxNotificationPriority.Now, + title: 'CI failed', description: '', timestamp: 1, + actions: [{ id: 'fix', label: 'Fix CI', kind: InboxNotificationActionKind.AgentMergeFixCI }], + }; + const row: IInboxSessionRow = { ...item, tab: InboxTab.ReadyForYou, sessionTitle: 'Session', occurrence: 'ci', hasImages: false, notifications: [item] }; + const rows = observableValue('rows', [row]); + const { view, container } = createView(constObservable([]), { rows }); + const pending = new DeferredPromise(); + stub(accessView(view), 'runInboxPullRequestAction').returns(pending.p); + view.render(container); + container.querySelector('.inbox-notifications-row-inline-actions .monaco-button > span')!.click(); + rows.set([{ ...row, tab: InboxTab.Working, notifications: [], actions: [] }], undefined); + const tabs = container.querySelectorAll('[role="tab"]'); + tabs[1].click(); + tabs[0].click(); + await pending.complete('success'); + await timeout(0); + const readyCount = container.querySelectorAll('.inbox-notifications-item').length; + tabs[1].click(); + const workingFeedback = container.querySelector('.inbox-notifications-row-action-status')?.textContent; + await timeout(1500); + const workingCount = container.querySelectorAll('.inbox-notifications-item').length; + const expiredFeedback = container.querySelector('.inbox-notifications-row-action-status'); + view.dispose(); + assert.deepStrictEqual({ readyCount, workingFeedback, workingCount, expiredFeedback }, { + readyCount: 0, workingFeedback: 'Action taken', workingCount: 1, expiredFeedback: null, + }); + })); + test('Working and Done rows without notifications retain repository metadata in evidence', () => { const results = [InboxTab.Working, InboxTab.Done].map(tab => { const row: IInboxSessionRow = { @@ -2530,6 +2668,78 @@ suite('InboxNotificationsView', () => { }); }); + for (const width of [280, 360, 560, 900]) { + test(`workflow navigation stays on one line and reveals keyboard-selected tabs at width ${width}`, () => { + const { view, container } = createView(constObservable([])); + container.style.width = `${width}px`; + view.render(container); + view.layout(width, 600); + const tablist = container.querySelector('[role="tablist"]')!; + const tabs = [...tablist.querySelectorAll('[role="tab"]')]; + const top = tabs[0].getBoundingClientRect().top; + tabs[0].focus(); + tabs[0].dispatchEvent(new KeyboardEvent('keydown', { key: 'End', bubbles: true })); + const last = tabs[4].getBoundingClientRect(); + const bounds = tablist.getBoundingClientRect(); + const lastVisible = last.left >= bounds.left - 1 && last.right <= bounds.right + 1; + tabs[4].dispatchEvent(new KeyboardEvent('keydown', { key: 'Home', bubbles: true })); + const first = tabs[0].getBoundingClientRect(); + assert.deepStrictEqual({ + oneLine: tabs.every(tab => Math.abs(tab.getBoundingClientRect().top - top) <= 1), + contained: bounds.left >= container.getBoundingClientRect().left && bounds.right <= container.getBoundingClientRect().right, + lastVisible, + firstVisible: first.left >= bounds.left - 1 && first.right <= bounds.right + 1, + focused: document.activeElement === tabs[0], + }, { oneLine: true, contained: true, lastVisible: true, firstVisible: true, focused: true }); + }); + } + + test('narrow lists prioritize readable titles and retain notification metadata and row actions', () => { + const item: IInboxNotificationItem = { + id: 'item', kind: InboxNotificationKind.Completed, priority: InboxNotificationPriority.Later, + title: 'Review changes to the responsive sidebar layout', description: '', timestamp: Date.now(), + repositoryLabel: 'owner/repository', actions: [], + }; + const row: IInboxSessionRow = { + ...item, tab: InboxTab.ReadyForYou, sessionTitle: item.title, occurrence: item.id, + notifications: [item], hasImages: true, + }; + const { view, container, instantiationService } = createView(constObservable([item]), { rows: constObservable([row]) }); + for (const size of [2, 6, 8, 10, 12, 24]) { + container.style.setProperty(`--vscode-spacing-size${size * 10}`, `${size}px`); + } + const done = spy(); + instantiationService.stub(IInboxNotificationsService, 'markSessionDone', done); + view.render(container); + const card = container.querySelector('.inbox-notifications-item')!; + const layouts = [280, 360, 560, 900].map(width => { + container.style.width = `${width}px`; + view.layout(width, 600); + const bounds = card.getBoundingClientRect(); + const titles = card.querySelector('.inbox-notifications-row-titles')!.getBoundingClientRect(); + const metadata = card.querySelector('.inbox-notifications-row-metadata')!.getBoundingClientRect(); + return { + width, + titlesLead: titles.width >= bounds.width * 0.6, + stateAbsent: !card.querySelector('.inbox-notifications-item-kind-label'), + metadataBelow: metadata.top >= titles.bottom, + accessibleState: card.getAttribute('aria-label')?.includes('Completed'), + noOverflow: card.scrollWidth <= card.clientWidth, + }; + }); + container.style.width = '900px'; + card.click(); + view.layout(900, 600); + card.querySelector('.inbox-notifications-row-actions .monaco-button:last-child')!.click(); + assert.deepStrictEqual({ layouts, done: done.callCount }, { + layouts: [280, 360, 560, 900].map(width => ({ + width, + titlesLead: true, stateAbsent: true, metadataBelow: width < 600, accessibleState: true, noOverflow: true, + })), + done: 1, + }); + }); + test('workflow tabs expose exclusive counts, keyboard navigation, and reset selection', async () => { const items: IInboxNotificationItem[] = [InboxNotificationPriority.Now, InboxNotificationPriority.Next].map((priority, index) => ({ id: `item-${index}`, kind: InboxNotificationKind.External, priority, title: 'Task', description: '', timestamp: 1, actions: [], @@ -3312,7 +3522,7 @@ suite('InboxNotificationsView', () => { instantiationService.stub(IInboxNotificationsService, 'dismissNotification', dismiss); view.render(container); container.querySelector('.inbox-notifications-item')!.click(); - const button = container.querySelector('.inbox-notifications-item-footer-actions .monaco-button')!; + const button = container.querySelector('.inbox-notifications-evidence-actions .monaco-button')!; button.style.cssText = 'position: fixed; left: 120px; top: 80px; width: 48px; height: 24px; box-sizing: border-box;'; const previousHandler = errorHandler.getUnexpectedErrorHandler(); const errors: Error[] = []; @@ -3381,7 +3591,7 @@ suite('InboxNotificationsView', () => { instantiationService.stub(IContextMenuService, 'showContextMenu', (delegate: Parameters[0]) => { menuAction = delegate.getActions?.()[0]; }); view.render(container); container.querySelector('.inbox-notifications-item')!.click(); - container.querySelector('.inbox-notifications-item-footer-actions .monaco-dropdown-button')!.click(); + container.querySelector('.inbox-notifications-evidence-actions .monaco-dropdown-button')!.click(); assert.ok(menuAction); await menuAction.run(); const overlay = container.querySelector('.animation-overlay'); diff --git a/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupAccessibilityHelp.ts b/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupAccessibilityHelp.ts index 2f209387c4b..d9cd3b06794 100644 --- a/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupAccessibilityHelp.ts +++ b/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupAccessibilityHelp.ts @@ -25,20 +25,19 @@ export class SessionWorktreeCleanupAccessibilityHelp implements IAccessibleViewI getProvider(_accessor: ServicesAccessor) { const previouslyFocused = getActiveElement(); const content: string[] = [ - localize('sessionWorktreeCleanupHelp.allWorktreesOverview', "You are in the Worktree Cleanup editor. It lists all agent session worktrees, including recent and protected sessions. Normal cleanup commits uncommitted changes before removing a worktree. Force Remove is different: after a separate confirmation, it permanently discards uncommitted changes and ignored or untracked files. Cleaning up a session marks it as done; you can restore the session later to recreate its worktree from committed changes."), + localize('sessionWorktreeCleanupHelp.allWorktreesOverview', "You are in the Worktree Cleanup editor. It lists local agent session worktrees with an available cleanup action, plus worktrees being measured or cleaned up and confirmed removals from this editor. Remote worktrees and other worktrees that cannot currently be cleaned up are hidden. Normal cleanup commits uncommitted changes before removing a worktree. Cleaning up a session marks it as done; you can restore the session later to recreate its worktree from committed changes."), localize('sessionWorktreeCleanupHelp.workspaceAndAgeFilters', "Use the Untouched For selector to filter by inactivity starting at one day, or choose Any time to include sessions used today. When worktrees belong to multiple workspaces, use the Workspace selector to show one workspace or All workspaces. Filters limit both the table and cleanup selection. Changing workspace clears the selection."), localize('sessionWorktreeCleanupHelp.activeMeasurementProgress', "A status line above the results reports the number of worktrees processed out of the scan total, independently of the filters. Sessions marked as done are not measured and are excluded from the scan total. Failed measurements count as processed. The final count remains visible when the scan completes."), localize('sessionWorktreeCleanupHelp.cachedActiveSizes', "Supported hosts save worktree sizes in the session database. Opening or refreshing cleanup reuses unchanged idle sizes and measures new, changed, or active worktrees. Done sessions are excluded from disk scans; their cleanup status can still be refreshed. Automatic storage hint checks use the same saved sizes and are limited to once an hour through existing triggers, without a recurring timer."), - localize('sessionWorktreeCleanupHelp.diskUsageSummary', "A summary line above the table reports how many matching worktrees can be cleaned up. The summary and cleanup controls are hidden when all matching worktrees are in Progress and results. Disk usage estimates describe allocated file storage, not guaranteed freed space. Shared filesystem data and snapshots can reduce the space actually freed. Sessions marked as done show a dash instead of a size. Totals are omitted when they include a done session. A nearby info button explains eligibility. When no worktrees match the filters, an informational message replaces the summary, action, and table."), - localize('sessionWorktreeCleanupHelp.workspaceAndProtectedRows', "Three tables separate Available for cleanup, Progress and results, and Needs attention. Progress includes worktrees whose storage is being measured, cleanup that is queued or running, and confirmed results from your cleanup batch. Needs attention contains failed, deferred, and protected worktrees with explanations. It opens automatically for removal issues; use Tab to focus its heading and Enter or Space to expand or collapse it. Active sessions and sessions waiting for input have unchecked checkboxes for manual selection. Session title links open their sessions. The Select All checkbox in the first column header of Available for cleanup and Needs attention toggles only that table's selectable worktrees in the current filter, including off-screen rows. It is unchecked when none are selected, mixed when some are selected, and checked when all are selected. Use Tab to focus it and Space to select all or clear the selection."), - localize('sessionWorktreeCleanupHelp.sorting', "Use Sort by to order each table by Size, largest first, or Session Recency, newest first. Worktrees without a known size or session date sort last. Sorting preserves your checkbox choices and does not rescan storage."), - localize('sessionWorktreeCleanupHelp.forceRemoval', "On supported hosts, failed, deferred, or in-use worktrees that are verified to exist have initially unchecked checkboxes in Needs attention. Select individual rows with Space, or use this category's Select All to select or clear all worktrees eligible for forced removal. This selection is separate from normal cleanup. Activate Force Remove Worktrees to remove the selected worktrees after one confirmation warning that all their uncommitted changes and ignored or untracked files will be permanently lost. Forced removal overrides references from other sessions or chats, which may stop working when their worktree is deleted. Canceling preserves the selection and leaves the worktrees untouched. Hosts still validate managed worktree paths and branches; normal and automatic cleanup still respect usage references."), - localize('sessionWorktreeCleanupHelp.unlinkedWorktrees', "Worktrees on known branches outside agents/ are excluded from all tables and selections. Worktrees no longer listed by their host are not offered for cleanup. Worktrees whose cleanup reports exit code 128 are also excluded, regardless of the command or reason. Other cleanup errors remain visible. Verification results for cleanup you scheduled are retained without claiming removal until it is confirmed. Worktrees with no matching session are selected by default when they can be cleaned up, even if their disk usage is unknown. With an Untouched for filter, their age is unknown, so they remain unchecked unless you select them manually. Uncheck a row to keep its worktree, or use Select All to select or clear all worktrees that can be cleaned up in the current filter. Explicit checkbox choices are preserved across scan updates and age filter changes."), - localize('sessionWorktreeCleanupHelp.virtualizedTables', "Each table scrolls independently below its column headers. Columns can be resized, and narrow windows allow horizontal scrolling of the headers and rows together. Only rows near the visible area are rendered. Use {0} and {1} to navigate rows, {2} and {3} to navigate pages, and {4} and {5} to reach the first and last rows. Use {6} to open the focused session and Space to toggle its cleanup checkbox when available. Tab moves into the focused row's checkbox or session link. Row announcements include position, session title, workspace, last used time, storage, and cleanup status. Select All and the selected count and estimated size include matching off-screen worktrees.", '', '', '', '', '', '', ''), + localize('sessionWorktreeCleanupHelp.storageStates', "Disk usage shows an estimate, Measuring, Not measured, or Measurement failed. Done sessions and worktrees without a listed session are intentionally not measured. Mixed selections report known storage and the number of unmeasured worktrees, not a complete estimate. Disk usage is not guaranteed freed space."), + localize('sessionWorktreeCleanupHelp.inventory', "One table lists actionable worktrees, pending cleanup, and confirmed removals. Each row has a title or branch, workspace, last session activity, disk usage, and status. Checkout paths are available in title tooltips and row announcements. Nothing is selected automatically. Select rows using their checkboxes, then activate Clean Up Worktrees to clean up the selection. Worktrees without a listed session have no session activity date. The Select All checkbox in the first column header includes every matching selectable worktree, including off-screen rows. It is mixed when some worktrees are selected. Use Tab to focus it and Space to select all or clear the selection."), + localize('sessionWorktreeCleanupHelp.sorting', "The table defaults to Session Recency, oldest first, with worktrees without a session date last. Use Sort by to choose Session Recency, oldest or newest first, Size, largest first, or Status. Status orders sessions marked as done with a remaining worktree first, then worktrees without a matching session, other sessions with a worktree, and confirmed removed worktrees last. Within each status group, larger known sizes come first. Done sessions are labeled Session marked as done, alongside any cleanup progress. Sorting preserves your checkbox choices and does not rescan storage. Rows stay in place while a cleanup batch runs so you can track its progress."), + localize('sessionWorktreeCleanupHelp.managedWorktrees', "Only managed agent worktrees are eligible, including agent branches created with a configured prefix. Failed and blocked worktrees are hidden, and failure counts are not shown. Errors are still reported through notifications and logs. Hiding a worktree does not confirm its files were removed. The host retains its background cleanup records and safety checks. All worktrees require explicit selection, including worktrees without a listed session. Explicit checkbox choices survive updates and age-filter changes."), + localize('sessionWorktreeCleanupHelp.inventoryNavigation', "The inventory has one vertical scroll area. Columns can be resized; headers and rows scroll horizontally together in narrow windows. Only nearby rows are rendered. Use {0} and {1} for rows, {2} and {3} for pages, and {4} and {5} for the first and last rows. Use {6} to open the focused session and Space to toggle its checkbox. Tab reaches the focused row's checkbox and session link. Row announcements include position, checkout path, activity, storage, and cleanup status.", '', '', '', '', '', '', ''), localize('sessionWorktreeCleanupHelp.cleanupDiskUsage', "Activate Clean Up Worktrees to schedule removal of the selected sessions' worktrees and mark those sessions as done after confirmation. It is disabled until at least one session is selected. Its label reports the selected worktree count and, when every selected session has a size estimate, their estimated disk usage."), - localize('sessionWorktreeCleanupHelp.verifiedBatchResults', "After confirmation, selected rows move to Progress and results and show Queued for cleanup. A spinner replaces their checkboxes while cleanup is queued, pending, or running. Waiting for cleanup means the host has not confirmed progress yet, not that removal succeeded. Cleanup cannot be submitted again while requests are being scheduled. Other selections are preserved. A persistent status line reports removed, pending, failed, and unresolved worktrees, independently of the filters, including cleanup already pending or running when this editor opens. Status checks retry after temporary request errors. Confirmed removals stay in Progress and results with Worktree removed and zero disk usage. They cannot be selected again, but their session links remain available. Reopening this editor omits confirmed removals. A scheduling failure does not stop remaining requests. On supported hosts, failed scheduling also offers forced removal checkboxes and Force Remove Failed Worktrees for failed rows in the current filter. This requires a destructive confirmation and uses the current branch even if it changed since the worktree was listed; host-managed path and branch requirements still apply. Other hosts offer non-destructive Retry Failed Worktrees. The retry action is disabled when none can be retried."), - localize('sessionWorktreeCleanupHelp.checkedRetry', "Sessions already marked as done can still have worktrees. Their host checks whether the worktree paths exist without scanning their contents. Remaining worktrees show a dash for unmeasured disk usage, and are selected by default when their host supports retrying cleanup, unless removal failed or was deferred. Activate Clean Up Worktrees to retry available worktrees without deleting session history or waiting for the automatic retry. Failed or deferred worktrees appear in Needs attention with a separate opt-in forced removal selection on supported hosts. Scheduled and running cleanup is not selectable. An explanation below each session title reports blocked, deferred, or failed cleanup, including the error when available. Supported hosts preserve failed and deferred cleanup outcomes across restarts. An unavailable or failed existence check never means zero disk usage or confirmed removal."), - localize('sessionWorktreeCleanupHelp.automatic', "Changes in the Cleanup Settings section are saved immediately. Background cleanup evaluates existing and future sessions after confirming their eligibility. Use the checkboxes to enable automatic completion or deletion of merged pull request sessions, then adjust the number of days in the adjacent input. Another checkbox turns the storage cleanup suggestion on or off."), + localize('sessionWorktreeCleanupHelp.batchLifecycle', "Confirmed cleanup continues when this editor closes. Reopening reconnects to queued and pending requests without showing failed requests. Closing does not cancel accepted host removals. Pending work cannot be submitted twice, and one scheduling failure does not stop the rest of the batch. The batch summary reports only pending work and confirmed removals, independently of filters. Rows update in place as cleanup progresses. Confirmed removals remain visible with zero disk usage, no checkbox or cleanup action, and usable session links until this editor closes."), + localize('sessionWorktreeCleanupHelp.failedCleanup', "Failed worktrees do not reappear with repeated Retry or Force Remove actions. Refresh inventory to check current host state. A failed or unavailable existence check is not confirmed removal."), + localize('sessionWorktreeCleanupHelp.collapsedSettings', "Automatic Cleanup is collapsed above the inventory. Focus its gear-labeled heading and press Enter or Space to expand it. In short windows, the controls and settings scroll separately above the inventory, without scrolling the inventory inside either area. Changes are saved immediately. Checkboxes enable automatic completion or deletion of merged pull request sessions; adjacent inputs set retention days. Another checkbox controls storage cleanup suggestions."), localize('sessionWorktreeCleanupHelp.reopen', "Return to this editor any time by running Open Worktree Cleanup from the Command Palette or the Sessions More Actions menu."), localize('sessionWorktreeCleanupHelp.close', "Use {0} to close the Worktree Cleanup modal. Focus returns to the previous editor or control.", ''), ]; diff --git a/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupEditor.ts b/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupEditor.ts index 0ee1d04fa4c..8da5fec8a67 100644 --- a/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupEditor.ts +++ b/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupEditor.ts @@ -18,12 +18,12 @@ import { fromNow } from '../../../../base/common/date.js'; import { getErrorMessage, isCancellationError } from '../../../../base/common/errors.js'; import { KeyCode } from '../../../../base/common/keyCodes.js'; import { DisposableStore, toDisposable } from '../../../../base/common/lifecycle.js'; +import { autorun } from '../../../../base/common/observable.js'; import { basename, extUri } from '../../../../base/common/resources.js'; import { URI } from '../../../../base/common/uri.js'; import { ScrollbarVisibility } from '../../../../base/common/scrollable.js'; import { ThemeIcon } from '../../../../base/common/themables.js'; import { generateUuid } from '../../../../base/common/uuid.js'; -import { isUnprefixedAgentWorktreeBranch } from '../../../../platform/agentHost/common/worktreePaths.js'; import { ByteSize } from '../../../../platform/files/common/files.js'; import { ConfigurationTarget, IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js'; @@ -48,11 +48,45 @@ import { SessionWorktreeCleanupEditorInput } from './sessionWorktreeCleanupEdito import './media/sessionWorktreeCleanupEditor.css'; const MINIMUM_AGE_OPTIONS = [0, 1, 3, 7, 15, 30, 60, 90]; -const WORKTREE_ROW_HEIGHT = 44; +const WORKTREE_ROW_HEIGHT = 60; const WORKTREE_HEADER_HEIGHT = 36; -const WORKTREE_TABLE_MIN_WIDTH = 480; +const WORKTREE_TABLE_MIN_WIDTH = 900; -type WorktreeColumn = 'selection' | 'title' | 'workspace' | 'lastUsed' | 'storage'; +type WorktreeColumn = 'selection' | 'title' | 'workspace' | 'lastUsed' | 'storage' | 'status'; + +function getWorktreeStatusOrder(worktree: ISessionWorktree): number { + if (worktree.worktreeExists === false) { + return 3; + } + if (worktree.session && (worktree.session.isArchived.get() || worktree.cleanupState === 'archived')) { + return 0; + } + return worktree.unlinkedWorktree ? 1 : 2; +} + +function getWorktreeSessionLabel(worktree: ISessionWorktree): string { + return worktree.session + ? worktree.session.isArchived.get() || worktree.cleanupState === 'archived' + ? localize('sessionWorktreeCleanup.sessionMarkedAsDone', "Session marked as done") + : localize('sessionWorktreeCleanup.hasSession', "Has session") + : localize('sessionWorktreeCleanup.noMatchingSession', "No matching session"); +} + +function getWorktreePath(worktree: ISessionWorktree): string { + return worktree.unlinkedWorktree ? URI.parse(worktree.unlinkedWorktree.worktree).path + : worktree.session.workspace.get()?.folders.flatMap(folder => folder.gitRepository?.workTreeUri?.path ?? []).join(', ') + || localize('sessionWorktreeCleanup.pathUnavailable', "Checkout path unavailable"); +} + +function getPartialStorageLabel(worktrees: readonly ISessionWorktreeCleanupCandidate[]): string | undefined { + const unmeasured = worktrees.filter(worktree => worktree.sizeBytes === undefined || worktree.session?.isArchived.get()); + if (unmeasured.length === 0 || unmeasured.length === worktrees.length) { + return undefined; + } + const bytes = worktrees.reduce((total, worktree) => total + (worktree.session?.isArchived.get() ? 0 : worktree.sizeBytes ?? 0), 0); + const count = unmeasured.reduce((total, worktree) => total + worktree.worktreeCount, 0); + return localize('sessionWorktreeCleanup.partialStorage', "{0} known, {1} unmeasured", ByteSize.formatSize(bytes), count); +} function getWorktreeWorkspace(worktree: ISessionWorktree): { uri: URI; label: string; description?: string } | undefined { if (worktree.session) { @@ -86,27 +120,16 @@ export class SessionWorktreeCleanupEditor extends EditorPane { private readonly renderedCells = new Map>(); private displayWorktreesById = new Map(); private mainWorktreeTable: WorkbenchTable | undefined; - private unavailableWorktreeTable: WorkbenchTable | undefined; - private progressWorktreeTable: WorkbenchTable | undefined; - private progressSection: HTMLElement | undefined; - private progressHeading: HTMLElement | undefined; - private availableHeading: HTMLElement | undefined; - private sortOrder: 'size' | 'recent' = 'size'; + private sortOrder: 'size' | 'oldest' | 'recent' | 'status' = 'oldest'; private readonly tableDimensions = new WeakMap, dom.Dimension>(); private readonly tableFocusElements = new WeakMap, HTMLElement>(); private readonly tableScrollables = new Map, DomScrollableElement>(); + private readonly controlsScrollables: { element: HTMLElement; scrollable: DomScrollableElement }[] = []; private readonly cellHoverOptions = { groupId: generateUuid() }; private selectAllCheckbox: TriStateCheckbox | undefined; - private forceSelectAllCheckbox: TriStateCheckbox | undefined; - private forceSelectionRow: HTMLElement | undefined; - private forceCleanupButton: Button | undefined; - private readonly selectedForceSessionIds = new Set(); private workspaceOptionsSignature = ''; private container: HTMLElement | undefined; private list: HTMLElement | undefined; - private unavailableSection: HTMLDetailsElement | undefined; - private unavailableSummary: HTMLElement | undefined; - private unavailableList: HTMLElement | undefined; private summary: HTMLElement | undefined; private summaryMessage: HTMLElement | undefined; private summaryRow: HTMLElement | undefined; @@ -116,15 +139,15 @@ export class SessionWorktreeCleanupEditor extends EditorPane { private cleanupButton: Button | undefined; private batchSummaryRow: HTMLElement | undefined; private batchSummary: HTMLElement | undefined; - private retryButton: Button | undefined; private readonly cleanupBatch = new Map(); + private readonly restoredCleanupIds = new Set(); + private observedCleanupIds = new Set(); + private refreshRestoredCleanup = false; private isSchedulingCleanup = false; private cleanupGeneration = 0; - private hasCleanupFailures = false; private ageSelect: HTMLSelectElement | undefined; private workspaceSelect: HTMLSelectElement | undefined; private selectedWorkspace = ''; - private scrollableElement: DomScrollableElement | undefined; private layoutDimension: dom.Dimension | undefined; private minimumAgeDays = 0; private worktrees: readonly ISessionWorktree[] = []; @@ -138,7 +161,14 @@ export class SessionWorktreeCleanupEditor extends EditorPane { private updateMeasuredWorktrees: ((worktrees: readonly ISessionWorktree[]) => void) | undefined; private pendingCleanupDelay = 2_000; private readonly pendingCleanupScheduler = this._register(new RunOnceScheduler(() => void this.refreshPendingCleanup(), 2_000)); - private readonly cleanupRenderScheduler = this._register(new RunOnceScheduler(() => this.renderRows(), 100)); + private readonly cleanupRenderScheduler = this._register(new RunOnceScheduler(() => { + if (this.refreshRestoredCleanup) { + this.refreshRestoredCleanup = false; + void this.load(false, true); + } else { + this.renderRows(); + } + }, 100)); private automaticCleanupInput: Checkbox | undefined; constructor( @@ -159,6 +189,40 @@ export class SessionWorktreeCleanupEditor extends EditorPane { this.renderedCells.clear(); this.tableScrollables.clear(); })); + if (this.cleanupService.cleanupOperations && this.cleanupService.isSchedulingCleanup) { + this._register(autorun(reader => { + const operations = this.cleanupService.cleanupOperations.read(reader); + const scheduling = this.cleanupService.isSchedulingCleanup.read(reader); + const operationIds = new Set(operations.map(operation => getWorktreeCleanupId(operation.candidate))); + if (!this.input) { + this.observedCleanupIds = operationIds; + return; + } + for (const id of this.observedCleanupIds) { + const entry = this.cleanupBatch.get(id); + if (!operationIds.has(id) && entry?.candidate.session && !entry.candidate.session.isArchived.read(undefined)) { + this.cleanupBatch.delete(id); + this.restoredCleanupIds.delete(id); + this.cleaningSessionIds.delete(id); + this.refreshRestoredCleanup = true; + } + } + this.observedCleanupIds = operationIds; + for (const operation of operations) { + const id = getWorktreeCleanupId(operation.candidate); + if (this.cleanupBatch.get(id)?.state !== 'removed') { + this.cleanupBatch.set(id, { candidate: operation.candidate, state: operation.state, schedulingError: operation.message }); + } + } + if (this.isSchedulingCleanup && !scheduling && this.restoredCleanupIds.size > 0) { + this.refreshRestoredCleanup = true; + } + this.isSchedulingCleanup = scheduling; + if (!this.cleanupRenderScheduler.isScheduled()) { + this.cleanupRenderScheduler.schedule(); + } + })); + } } protected override createEditor(parent: HTMLElement): void { @@ -169,22 +233,15 @@ export class SessionWorktreeCleanupEditor extends EditorPane { this.editorDisposables.add(focusTracker.onDidFocus(() => focusedContext.set(true))); this.editorDisposables.add(focusTracker.onDidBlur(() => focusedContext.set(false))); this.editorDisposables.add(toDisposable(() => focusedContext.reset())); - this.scrollableElement = this._register(new DomScrollableElement(this.container, { - horizontal: ScrollbarVisibility.Hidden, - vertical: ScrollbarVisibility.Auto, - useShadows: true, - })); - parent.appendChild(this.scrollableElement.getDomNode()); + parent.appendChild(this.container); const content = dom.append(this.container, dom.$('.session-worktree-cleanup-content')); + const controlsContent = this.createControlsScrollable(content); - dom.append(content, dom.$('p.session-worktree-cleanup-intro', undefined, - localize('sessionWorktreeCleanup.filteredIntro', "Clean up worktrees to free disk space. Normal cleanup commits uncommitted changes and marks sessions as done; restore a session to recreate its worktree. Managed worktrees with no matching session can also be selected; their branches are kept. Force Remove permanently discards uncommitted changes and overrides usage by other sessions or chats after a separate confirmation."))); - dom.append(content, dom.$('p', undefined, - dom.$('strong', undefined, localize('sessionWorktreeCleanup.reopen', "You can return to this editor at any time by running Open Worktree Cleanup from the Command Palette.")))); + const intro = dom.append(controlsContent, dom.$('.session-worktree-cleanup-intro')); + dom.append(intro, dom.$('h2', undefined, localize('sessionWorktreeCleanup.introHeading', "Free up local disk space"))); + dom.append(intro, dom.$('p', undefined, localize('sessionWorktreeCleanup.introSelection', "Select sessions to clean up their worktrees."))); - this.renderAutomaticCleanup(content); - - const controls = dom.append(content, dom.$('.session-worktree-cleanup-controls')); + const controls = dom.append(controlsContent, dom.$('.session-worktree-cleanup-controls')); const ageLabel = dom.append(controls, dom.$('label', undefined, localize('sessionWorktreeCleanup.ageLabel', "Untouched for"))); const ageSelect = dom.append(ageLabel, dom.$('select.session-worktree-cleanup-age')) as HTMLSelectElement; this.ageSelect = ageSelect; @@ -208,27 +265,23 @@ export class SessionWorktreeCleanupEditor extends EditorPane { this.editorDisposables.add(dom.addDisposableListener(this.workspaceSelect, dom.EventType.CHANGE, () => { this.selectedWorkspace = this.workspaceSelect!.value; this.selectedSessionIds.clear(); - this.selectedForceSessionIds.clear(); this.renderRows(); })); const sortLabel = dom.append(controls, dom.$('label', undefined, localize('sessionWorktreeCleanup.sortBy', "Sort by"))); const sortSelect = dom.append(sortLabel, dom.$('select.session-worktree-cleanup-sort')); dom.append(sortSelect, dom.$('option', { value: 'size' }, localize('sessionWorktreeCleanup.largestFirst', "Size (Largest First)"))); + dom.append(sortSelect, dom.$('option', { value: 'oldest' }, localize('sessionWorktreeCleanup.oldestFirst', "Session Recency (Oldest First)"))); dom.append(sortSelect, dom.$('option', { value: 'recent' }, localize('sessionWorktreeCleanup.recentFirst', "Session Recency (Newest First)"))); + dom.append(sortSelect, dom.$('option', { value: 'status' }, localize('sessionWorktreeCleanup.sortByStatus', "Status"))); + sortSelect.value = this.sortOrder; this.editorDisposables.add(dom.addDisposableListener(sortSelect, dom.EventType.CHANGE, () => { - this.sortOrder = sortSelect.value === 'recent' ? 'recent' : 'size'; + this.sortOrder = sortSelect.value === 'status' ? 'status' : sortSelect.value === 'recent' ? 'recent' : sortSelect.value === 'oldest' ? 'oldest' : 'size'; this.pinnedDisplayOrder = undefined; this.renderRows(); })); - - this.measurementProgress = dom.append(content, dom.$('p.session-worktree-cleanup-measurement-progress', { role: 'status', 'aria-live': 'polite' })); + this.measurementProgress = dom.append(controlsContent, dom.$('p.session-worktree-cleanup-measurement-progress', { role: 'status', 'aria-live': 'polite' })); dom.hide(this.measurementProgress); - this.progressSection = dom.append(content, dom.$('.session-worktree-cleanup-progress.hidden')); - this.progressHeading = dom.append(this.progressSection, dom.$('h2')); - const progressList = dom.append(this.progressSection, dom.$('.session-worktree-cleanup-list')); - this.progressWorktreeTable = this.createWorktreeTable(progressList, localize('sessionWorktreeCleanup.progressTable', "Worktrees in progress")); - this.availableHeading = dom.append(content, dom.$('h2.session-worktree-cleanup-available-heading')); - const summaryRow = this.summaryRow = dom.append(content, dom.$('.session-worktree-cleanup-summary-row')); + const summaryRow = this.summaryRow = dom.append(controlsContent, dom.$('.session-worktree-cleanup-summary-row')); this.summary = dom.append(summaryRow, dom.$('.session-worktree-cleanup-summary')); this.summaryMessage = dom.append(this.summary, dom.$('span', { role: 'status', 'aria-live': 'polite' })); const eligibilityInfo = dom.append(this.summary, dom.$('button.session-worktree-cleanup-info', { @@ -237,8 +290,8 @@ export class SessionWorktreeCleanupEditor extends EditorPane { })); eligibilityInfo.appendChild(renderIcon(Codicon.info)); const eligibilityHover = this.editorDisposables.add(this.hoverService.setupManagedHover(getDefaultHoverDelegate('element'), eligibilityInfo, localize( - 'sessionWorktreeCleanup.unmeasuredEligibilityDescription', - "Active sessions and sessions waiting for input can be selected manually but are not selected by default. Worktrees with no matching session are selected by default when they can be cleaned up, even if their disk usage is unknown, except those with a branch prefix, which must be selected manually because agent ownership cannot be verified. With an Untouched for filter, their age is unknown, so they must be selected manually. Sessions already marked as done are selected by default when their host supports retrying cleanup, unless removal failed or was deferred. Their disk usage is not measured and is shown as a dash. Needs attention has a separate, initially unchecked selection for forced removal on supported hosts. Scheduled or running cleanup cannot be selected again. Running, pinned, untitled, and error sessions cannot be selected. Other sessions require a successful disk usage measurement. The filters limit the table and cleanup selection. Estimated disk usage is not guaranteed freed space.", + 'sessionWorktreeCleanup.eligibilityDetails', + "Select worktrees, then use Clean Up Worktrees to clean up the selection. Nothing is selected automatically. Failed worktrees and worktrees without an available cleanup action are hidden. Hiding a worktree does not confirm its files were removed. Pending cleanup and completed results remain available for tracking. Done sessions and worktrees without a listed session are not measured. Disk usage is an estimate, not guaranteed freed space.", ))); this.editorDisposables.add(dom.addDisposableListener(eligibilityInfo, dom.EventType.CLICK, () => eligibilityHover.show(true))); this.cleanupButton = this.editorDisposables.add(new Button(summaryRow, defaultButtonStyles)); @@ -247,15 +300,8 @@ export class SessionWorktreeCleanupEditor extends EditorPane { this.cleanupButton.enabled = false; this.editorDisposables.add(this.cleanupButton.onDidClick(() => void this.cleanupSelected())); - this.batchSummaryRow = dom.append(content, dom.$('.session-worktree-cleanup-summary-row.session-worktree-cleanup-batch.hidden')); + this.batchSummaryRow = dom.append(controlsContent, dom.$('.session-worktree-cleanup-summary-row.session-worktree-cleanup-batch.hidden')); this.batchSummary = dom.append(this.batchSummaryRow, dom.$('span.session-worktree-cleanup-summary', { role: 'status', 'aria-live': 'polite', 'aria-atomic': 'true' })); - this.retryButton = this.editorDisposables.add(new Button(this.batchSummaryRow, { ...defaultButtonStyles, secondary: true })); - this.retryButton.label = localize('sessionWorktreeCleanup.retryFailed', "Retry Failed Worktrees"); - this.retryButton.element.classList.add('session-worktree-cleanup-action', 'session-worktree-cleanup-retry'); - this.editorDisposables.add(this.retryButton.onDidClick(() => { - const candidates = this.getRetryCandidates(); - void this.cleanupSelected(candidates, candidates.some(worktree => this.canForceCleanup(worktree)) ? candidates : undefined); - })); const selectAll = this.selectAllCheckbox = this.editorDisposables.add(new TriStateCheckbox( localize('sessionWorktreeCleanup.selectAll', "Select all worktrees that can be cleaned up"), @@ -271,42 +317,9 @@ export class SessionWorktreeCleanupEditor extends EditorPane { this.selectedSessionIds = checked ? new Set(selectable.map(worktree => getWorktreeCleanupId(worktree))) : new Set(); this.renderRows(); })); + this.renderAutomaticCleanup(this.createControlsScrollable(content)); this.list = dom.append(content, dom.$('.session-worktree-cleanup-list')); this.mainWorktreeTable = this.createWorktreeTable(this.list, localize('sessionWorktreeCleanup.tableLabel', "Agent session worktrees"), selectAll); - if (this.progressSection) { - this.list.after(this.progressSection); - } - this.unavailableSection = dom.append(content, dom.$('details.session-worktree-cleanup-unavailable.hidden')); - this.unavailableSummary = dom.append(this.unavailableSection, dom.$('summary')); - this.forceSelectionRow = dom.append(this.unavailableSection, dom.$('.session-worktree-cleanup-summary-row')); - const forceSelectAll = this.forceSelectAllCheckbox = this.editorDisposables.add(new TriStateCheckbox( - localize('sessionWorktreeCleanup.forceSelectAll', "Select all worktrees that can be forcibly removed in Needs attention"), - false, - defaultCheckboxStyles, - )); - this.editorDisposables.add(forceSelectAll.onChange(() => { - for (const worktree of this.getVisibleWorktrees().filter(worktree => this.canForceCleanup(worktree))) { - const id = getWorktreeCleanupId(worktree); - if (forceSelectAll.checked === true) { - this.selectedForceSessionIds.add(id); - } else { - this.selectedForceSessionIds.delete(id); - } - } - this.renderRows(); - })); - this.forceCleanupButton = this.editorDisposables.add(new Button(this.forceSelectionRow, { ...defaultButtonStyles, secondary: true })); - this.forceCleanupButton.element.classList.add('session-worktree-cleanup-force-remove'); - this.editorDisposables.add(this.forceCleanupButton.onDidClick(() => { - const selected = this.getSelectedForForceCleanup(); - void this.cleanupSelected(selected, selected); - })); - this.editorDisposables.add(dom.addDisposableListener(this.unavailableSection, 'toggle', () => { - this.layoutWorktreeTables(); - this.updateScrollDimensions(); - })); - this.unavailableList = dom.append(this.unavailableSection, dom.$('.session-worktree-cleanup-list.session-worktree-cleanup-unavailable-list')); - this.unavailableWorktreeTable = this.createWorktreeTable(this.unavailableList, localize('sessionWorktreeCleanup.unavailableTableLabel', "Worktrees needing attention"), forceSelectAll); this.emptyState = dom.append(content, dom.$('.session-worktree-cleanup-empty', { role: 'status' })); const emptyStateIcon = dom.append(this.emptyState, renderIcon(Codicon.info)); emptyStateIcon.setAttribute('aria-hidden', 'true'); @@ -314,10 +327,24 @@ export class SessionWorktreeCleanupEditor extends EditorPane { this.emptyState.classList.add('hidden'); } + private createControlsScrollable(content: HTMLElement): HTMLElement { + const element = dom.$('.session-worktree-cleanup-controls-content'); + const scrollable = this.editorDisposables.add(new DomScrollableElement(element, { + horizontal: ScrollbarVisibility.Hidden, + vertical: ScrollbarVisibility.Auto, + alwaysConsumeMouseWheel: false, + })); + content.appendChild(scrollable.getDomNode()); + this.editorDisposables.add(dom.addDisposableListener(element, dom.EventType.SCROLL, () => scrollable.scanDomNode())); + this.controlsScrollables.push({ element, scrollable }); + return element; + } + override async setInput(input: SessionWorktreeCleanupEditorInput, options: IEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise { await super.setInput(input, options, context, token); this.explicitSelections.clear(); - this.selectedForceSessionIds.clear(); + this.selectedSessionIds.clear(); + this.restoreCleanupOperations(); void this.load(true); } @@ -327,7 +354,9 @@ export class SessionWorktreeCleanupEditor extends EditorPane { } focusAutomaticCleanup(): void { + this.automaticCleanupInput?.domNode.closest('details')?.setAttribute('open', ''); this.automaticCleanupInput?.focus(); + this.updateScrollDimensions(); } showAllWorktrees(): void { @@ -340,25 +369,25 @@ export class SessionWorktreeCleanupEditor extends EditorPane { override layout(dimension: dom.Dimension): void { this.layoutDimension = dimension; - if (this.scrollableElement) { - const scrollableNode = this.scrollableElement.getDomNode(); - scrollableNode.style.width = `${dimension.width}px`; - scrollableNode.style.height = `${dimension.height}px`; + if (this.container) { + this.container.style.width = `${dimension.width}px`; + this.container.style.height = `${dimension.height}px`; this.layoutWorktreeTables(); this.updateScrollDimensions(); } } private updateScrollDimensions(): void { - if (!this.container || !this.scrollableElement || !this.layoutDimension) { - return; + this.layoutWorktreeTables(); + } + + private restoreCleanupOperations(): void { + for (const operation of this.cleanupService.cleanupOperations?.get() ?? []) { + const id = getWorktreeCleanupId(operation.candidate); + this.restoredCleanupIds.add(id); + this.cleanupBatch.set(id, { candidate: operation.candidate, state: operation.state, schedulingError: operation.message }); } - this.scrollableElement.setScrollDimensions({ - width: this.layoutDimension.width, - height: this.layoutDimension.height, - scrollWidth: this.container.scrollWidth, - scrollHeight: this.container.scrollHeight, - }); + this.isSchedulingCleanup = this.cleanupService.isSchedulingCleanup?.get() ?? false; } override clearInput(): void { @@ -366,8 +395,9 @@ export class SessionWorktreeCleanupEditor extends EditorPane { this.cleanupGeneration++; this.isSchedulingCleanup = false; this.cleanupBatch.clear(); + this.restoredCleanupIds.clear(); + this.refreshRestoredCleanup = false; this.explicitSelections.clear(); - this.hasCleanupFailures = false; this.renderBatchSummary(); this.pendingCleanupScheduler.cancel(); this.cleanupRenderScheduler.cancel(); @@ -410,9 +440,7 @@ export class SessionWorktreeCleanupEditor extends EditorPane { this.renderWorkspaceOptions(); for (const worktree of this.getVisibleWorktrees()) { const sessionId = getWorktreeCleanupId(worktree); - const selectByDefault = worktree.cleanupState === 'eligible' || worktree.cleanupState === 'archived' - || (worktree.unlinkedWorktree && this.minimumAgeDays === 0 && isUnprefixedAgentWorktreeBranch(worktree.unlinkedWorktree.branch)); - const selected = this.explicitSelections.get(sessionId) ?? selectByDefault; + const selected = this.explicitSelections.get(sessionId) ?? false; if (selected && this.isManuallySelectable(worktree) && !this.cleanupBatch.has(sessionId)) { this.selectedSessionIds.add(sessionId); } else { @@ -465,9 +493,7 @@ export class SessionWorktreeCleanupEditor extends EditorPane { this.summaryRow?.classList.remove('hidden'); this.list?.classList.remove('hidden'); if (!preserveDisplayOrder) { - this.unavailableSection?.classList.add('hidden'); this.clearRenderedRows(); - this.selectedSessionIds.clear(); this.emptyState?.classList.add('hidden'); if (this.measurementProgress) { dom.hide(this.measurementProgress); @@ -560,10 +586,11 @@ export class SessionWorktreeCleanupEditor extends EditorPane { private createWorktreeTable(container: HTMLElement, label: string, selectAll?: TriStateCheckbox): WorkbenchTable { const columns: (ITableColumn & { templateId: WorktreeColumn })[] = [ { label: '', weight: 0, minimumWidth: 40, maximumWidth: 40, templateId: 'selection', project: sessionId => sessionId }, - { label: localize('sessionWorktreeCleanup.sessionColumn', "Session"), weight: 0.4, minimumWidth: 140, templateId: 'title', project: sessionId => sessionId }, - { label: localize('sessionWorktreeCleanup.workspaceColumn', "Workspace"), weight: 0.2, minimumWidth: 100, templateId: 'workspace', project: sessionId => sessionId }, - { label: localize('sessionWorktreeCleanup.lastUsedColumn', "Last Used"), weight: 0.2, minimumWidth: 100, templateId: 'lastUsed', project: sessionId => sessionId }, - { label: localize('sessionWorktreeCleanup.diskUsageColumn', "Disk Usage"), weight: 0.2, minimumWidth: 100, templateId: 'storage', project: sessionId => sessionId }, + { label: localize('sessionWorktreeCleanup.sessionColumn', "Session"), weight: 0.6, minimumWidth: 260, templateId: 'title', project: sessionId => sessionId }, + { label: localize('sessionWorktreeCleanup.workspaceColumn', "Workspace"), weight: 0.15, minimumWidth: 100, templateId: 'workspace', project: sessionId => sessionId }, + { label: localize('sessionWorktreeCleanup.activityColumn', "Last Session Activity"), weight: 0.15, minimumWidth: 120, templateId: 'lastUsed', project: sessionId => sessionId }, + { label: localize('sessionWorktreeCleanup.diskUsageColumn', "Disk Usage"), weight: 0.15, minimumWidth: 100, templateId: 'storage', project: sessionId => sessionId }, + { label: localize('sessionWorktreeCleanup.statusColumn', "Status"), weight: 0.25, minimumWidth: 160, templateId: 'status', project: sessionId => sessionId }, ]; const body = dom.$('.session-worktree-cleanup-table-body'); const scrollable = this.editorDisposables.add(new DomScrollableElement(body, { @@ -659,30 +686,41 @@ export class SessionWorktreeCleanupEditor extends EditorPane { } private getWorktreeAriaLabel(worktree: ISessionWorktree): string { - return localize('sessionWorktreeCleanup.rowDiskUsageLabel', "{0}, workspace {1}, last used {2}, disk usage {3}. {4} {5}", - worktree.unlinkedWorktree - ? localize('sessionWorktreeCleanup.titleAndPath', "{0}, worktree path {1}", getWorktreeCleanupTitle(worktree), URI.parse(worktree.unlinkedWorktree.worktree).path) - : getWorktreeCleanupTitle(worktree), + return localize('sessionWorktreeCleanup.rowDiskUsageAndSessionLabel', "{0}, workspace {1}, last used {2}, disk usage {3}. {4}. {5} {6}", + localize('sessionWorktreeCleanup.titleAndPath', "{0}, worktree path {1}", getWorktreeCleanupTitle(worktree), getWorktreePath(worktree)), getWorktreeWorkspace(worktree)?.label ?? localize('sessionWorktreeCleanup.unknownWorkspace', "Unknown workspace"), - worktree.session ? fromNow(worktree.session.updatedAt.get(), true, true) : localize('sessionWorktreeCleanup.unknownLastUsed', "Unknown"), + worktree.session ? fromNow(worktree.session.updatedAt.get(), true, true) : localize('sessionWorktreeCleanup.noActivity', "No session activity available"), this.getWorktreeStorageLabel(worktree, true), + getWorktreeSessionLabel(worktree), this.getWorktreeCleanupLabel(worktree, this.isWorktreeCleaning(worktree)) ?? '', - this.canForceCleanup(worktree) - ? this.selectedForceSessionIds.has(getWorktreeCleanupId(worktree)) - ? localize('sessionWorktreeCleanup.selectedForForceRemoval', "Selected for forced removal.") - : localize('sessionWorktreeCleanup.notSelectedForForceRemoval', "Not selected for forced removal.") - : this.isManuallySelectable(worktree) - ? this.selectedSessionIds.has(getWorktreeCleanupId(worktree)) - ? localize('sessionWorktreeCleanup.selected', "Selected for cleanup.") - : localize('sessionWorktreeCleanup.notSelected', "Not selected for cleanup.") - : '', + this.isManuallySelectable(worktree) + ? this.selectedSessionIds.has(getWorktreeCleanupId(worktree)) + ? localize('sessionWorktreeCleanup.selected', "Selected for cleanup.") + : localize('sessionWorktreeCleanup.notSelected', "Not selected for cleanup.") + : '', ); } private layoutWorktreeTables(): void { - const width = Math.max(WORKTREE_TABLE_MIN_WIDTH, this.list?.clientWidth || this.unavailableList?.clientWidth || this.layoutDimension?.width || 960); + if (this.container && this.controlsScrollables.length > 0) { + const availableHeight = Math.max(0, this.container.clientHeight - 32); + const inventoryHeight = Math.min(WORKTREE_HEADER_HEIGHT + WORKTREE_ROW_HEIGHT + 12, availableHeight / 3); + const heights = this.controlsScrollables.map(({ element }) => { + element.style.height = 'auto'; + return element.scrollHeight; + }); + const totalHeight = heights.reduce((total, height) => total + height, 0); + const scale = totalHeight > 0 ? Math.min(1, (availableHeight - inventoryHeight) / totalHeight) : 1; + this.controlsScrollables.forEach(({ element, scrollable }, index) => { + const height = Math.floor(heights[index] * scale); + element.style.height = `${height}px`; + scrollable.getDomNode().style.height = `${height}px`; + scrollable.scanDomNode(); + }); + } + const width = Math.max(WORKTREE_TABLE_MIN_WIDTH, this.list?.clientWidth || this.layoutDimension?.width || 960); for (const [table, scrollable] of this.tableScrollables) { - const height = WORKTREE_HEADER_HEIGHT + Math.min(table.length * WORKTREE_ROW_HEIGHT, Math.max(WORKTREE_ROW_HEIGHT * 3, Math.floor((this.layoutDimension?.height ?? 600) / 2))); + const height = Math.max(0, (this.list?.clientHeight ?? 300) - 12); const previousDimension = this.tableDimensions.get(table); if (previousDimension?.height !== height || previousDimension.width !== width) { table.getHTMLElement().style.width = `${width}px`; @@ -751,12 +789,7 @@ export class SessionWorktreeCleanupEditor extends EditorPane { worktrees.set(sessionId, { ...entry.candidate, sizeBytes: entry.state === 'removed' ? 0 : undefined, worktreeExists: entry.state === 'removed' ? false : undefined, cleanupState: 'archived' }); } } - return [...worktrees.values()].filter(worktree => (worktree.isListedByHost !== false || worktree.worktreeExists === false) && !this.hasCleanupExitCode128(worktree)); - } - - private hasCleanupExitCode128(worktree: ISessionWorktree): boolean { - const message = this.withSchedulingFailure(worktree).cleanupStatus?.message; - return !!message && /\bexited with code 128\b/.test(message); + return [...worktrees.values()]; } private getMatchingWorktrees(): readonly ISessionWorktree[] { @@ -769,11 +802,11 @@ export class SessionWorktreeCleanupEditor extends EditorPane { } private getVisibleWorktrees(): readonly ISessionWorktree[] { - return this.getMatchingWorktrees().filter(worktree => worktree.unlinkedWorktree || worktree.cleanupState === 'archived' || worktree.isMeasuring || worktree.measurementFailed || worktree.sizeBytes !== undefined || this.cleanupBatch.has(getWorktreeCleanupId(worktree))); + return this.getMatchingWorktrees().filter(worktree => !this.hasRemovalIssue(worktree) && (worktree.isMeasuring || this.isWorktreeInProgress(worktree) || this.canScheduleCleanup(worktree))); } private renderRows(): void { - if (!this.list || !this.summaryMessage || !this.selectAllCheckbox || !this.mainWorktreeTable || !this.unavailableWorktreeTable || !this.progressWorktreeTable || !this.unavailableSection || !this.unavailableSummary || !this.unavailableList) { + if (!this.list || !this.summaryMessage || !this.selectAllCheckbox || !this.mainWorktreeTable) { return; } for (const [id, entry] of this.cleanupBatch) { @@ -782,55 +815,34 @@ export class SessionWorktreeCleanupEditor extends EditorPane { } } const activeElement = dom.getActiveElement(); - const focusedTable = [this.mainWorktreeTable, this.unavailableWorktreeTable, this.progressWorktreeTable].find(table => this.tableFocusElements.get(table) === activeElement); + const focusedTable = this.tableFocusElements.get(this.mainWorktreeTable) === activeElement ? this.mainWorktreeTable : undefined; const focusedRow = [...this.renderedCells].find(([, cells]) => [...cells.values()].some(cell => cell.container.contains(activeElement))); const focusedSessionId = focusedTable?.getFocusedElements()[0] ?? focusedRow?.[0]; + const focusedIndex = focusedSessionId ? this.displayedSessionIds.indexOf(focusedSessionId) : -1; const focusedCheckbox = focusedRow?.[1].get('selection')?.container.contains(activeElement); this.updateCleanupBatch(); this.renderWorkspaceOptions(); const visible = this.getVisibleWorktrees(); const selectable = visible.filter(worktree => this.isManuallySelectable(worktree)); - const isInProgress = (worktree: ISessionWorktree) => this.isWorktreeInProgress(worktree); - const isInMainList = (worktree: ISessionWorktree) => !isInProgress(worktree) && !this.hasRemovalIssue(worktree) && this.isManuallySelectable(worktree); - const unavailable = visible.filter(worktree => !isInProgress(worktree) && !isInMainList(worktree)); - const forceEligibleIds = new Set(this.worktrees.filter(worktree => this.canForceCleanup(worktree)).map(getWorktreeCleanupId)); - for (const id of this.selectedForceSessionIds) { - if (!forceEligibleIds.has(id)) { - this.selectedForceSessionIds.delete(id); - } - } - if (this.progressSection && this.progressHeading) { - this.progressSection.classList.toggle('hidden', !visible.some(isInProgress)); - this.progressHeading.textContent = localize('sessionWorktreeCleanup.inProgressHeading', "Progress and results ({0})", visible.filter(isInProgress).reduce((total, worktree) => total + worktree.worktreeCount, 0)); - } - if (this.availableHeading) { - this.availableHeading.classList.toggle('hidden', !visible.some(isInMainList)); - this.availableHeading.textContent = localize('sessionWorktreeCleanup.availableHeading', "Available for cleanup ({0})", visible.filter(isInMainList).reduce((total, worktree) => total + worktree.worktreeCount, 0)); - } const estimatedBytes = getWorktreeCleanupDiskUsage(selectable); const selectableWorktrees = selectable.reduce((total, worktree) => total + worktree.worktreeCount, 0); const totalWorktrees = visible.reduce((total, worktree) => total + (this.cleanupBatch.get(getWorktreeCleanupId(worktree))?.state === 'removed' ? 0 : worktree.worktreeCount), 0); const isEmpty = visible.length === 0; - this.summaryRow?.classList.toggle('hidden', isEmpty || visible.every(isInProgress)); - this.list.classList.toggle('hidden', !visible.some(isInMainList)); - this.unavailableSection.classList.toggle('hidden', unavailable.length === 0); - if (unavailable.some(worktree => this.hasRemovalIssue(worktree))) { - this.unavailableSection.open = true; - } - this.unavailableSummary.textContent = localize('sessionWorktreeCleanup.unavailableSection', "Needs attention ({0})", unavailable.reduce((total, worktree) => total + worktree.worktreeCount, 0)); + this.summaryRow?.classList.toggle('hidden', totalWorktrees === 0); + this.list.classList.toggle('hidden', isEmpty); this.emptyState?.classList.toggle('hidden', !isEmpty); if (this.emptyStateMessage) { - this.emptyStateMessage.textContent = this.getMatchingWorktrees().length > 0 - ? localize('sessionWorktreeCleanup.noMeasuredStorage', "No worktrees with available storage measurements.") - : this.minimumAgeDays === 0 && !this.selectedWorkspace - ? localize('sessionWorktreeCleanup.noWorktrees', "No worktrees to clean up.") - : localize('sessionWorktreeCleanup.noMatchingWorktrees', "No worktrees match the selected filters."); + this.emptyStateMessage.textContent = this.minimumAgeDays === 0 && !this.selectedWorkspace + ? localize('sessionWorktreeCleanup.noWorktrees', "No worktrees to clean up.") + : localize('sessionWorktreeCleanup.noMatchingWorktrees', "No worktrees match the selected filters."); } const summary = estimatedBytes !== undefined && estimatedBytes > 0 ? localize('sessionWorktreeCleanup.matchingWorktreeDiskUsageSummary', "{0} of {1} matching worktrees can be cleaned up. Estimated disk usage: {2}.", selectableWorktrees, totalWorktrees, ByteSize.formatSize(estimatedBytes)) : localize('sessionWorktreeCleanup.matchingWorktreeSummaryNoStorage', "{0} of {1} matching worktrees can be cleaned up.", selectableWorktrees, totalWorktrees); - if (this.summaryMessage.textContent !== summary) { - this.summaryMessage.textContent = summary; + const partialStorage = getPartialStorageLabel(selectable); + const summaryWithStorage = partialStorage ? localize('sessionWorktreeCleanup.partialStorageSummary', "{0} Estimated disk usage: {1}.", summary, partialStorage) : summary; + if (this.summaryMessage.textContent !== summaryWithStorage) { + this.summaryMessage.textContent = summaryWithStorage; } if (selectable.length === 0) { this.selectAllCheckbox.disable(); @@ -853,39 +865,44 @@ export class SessionWorktreeCleanupEditor extends EditorPane { if (this.sortOrder === 'recent') { return (b.session?.updatedAt.get().getTime() ?? -1) - (a.session?.updatedAt.get().getTime() ?? -1); } + if (this.sortOrder === 'oldest') { + return (a.session?.updatedAt.get().getTime() ?? Number.MAX_SAFE_INTEGER) - (b.session?.updatedAt.get().getTime() ?? Number.MAX_SAFE_INTEGER); + } + if (this.sortOrder === 'status') { + const statusOrder = getWorktreeStatusOrder(a) - getWorktreeStatusOrder(b); + if (statusOrder !== 0) { + return statusOrder; + } + } return (b.cleanupState === 'archived' ? -1 : b.sizeBytes ?? -1) - (a.cleanupState === 'archived' ? -1 : a.sizeBytes ?? -1); }); - const ordered = [...sortedVisible.filter(isInMainList), ...sortedVisible.filter(isInProgress), ...sortedVisible.filter(worktree => !isInProgress(worktree) && !isInMainList(worktree))]; - this.displayedSessionIds = ordered.map(worktree => getWorktreeCleanupId(worktree)); + this.displayedSessionIds = sortedVisible.map(getWorktreeCleanupId); const nextWorktrees = new Map(visible.map(worktree => [getWorktreeCleanupId(worktree), worktree])); for (const [sessionId, worktree] of nextWorktrees) { this.displayWorktreesById.set(sessionId, worktree); } - this.updateWorktreeTable(this.mainWorktreeTable, sortedVisible.filter(isInMainList).map(worktree => getWorktreeCleanupId(worktree))); - this.updateWorktreeTable(this.progressWorktreeTable, sortedVisible.filter(isInProgress).map(worktree => getWorktreeCleanupId(worktree))); - this.updateWorktreeTable(this.unavailableWorktreeTable, sortedVisible.filter(worktree => !isInProgress(worktree) && !isInMainList(worktree)).map(worktree => getWorktreeCleanupId(worktree))); + this.updateWorktreeTable(this.mainWorktreeTable, this.displayedSessionIds); this.displayWorktreesById = nextWorktrees; this.layoutWorktreeTables(); for (const sessionId of this.renderedCells.keys()) { this.renderWorktreeCells(this.displayWorktreesById.get(sessionId)!); } if (focusedSessionId) { - const worktree = nextWorktrees.get(focusedSessionId); - if (worktree) { - const table = isInProgress(worktree) ? this.progressWorktreeTable : isInMainList(worktree) ? this.mainWorktreeTable : this.unavailableWorktreeTable; - if (table === this.unavailableWorktreeTable) { - this.unavailableSection.open = true; - } - const index = table.indexOf(focusedSessionId); + const nextFocusedId = nextWorktrees.has(focusedSessionId) ? focusedSessionId : this.displayedSessionIds[Math.min(Math.max(0, focusedIndex), this.displayedSessionIds.length - 1)]; + if (nextFocusedId) { + const table = this.mainWorktreeTable; + const index = table.indexOf(nextFocusedId); table.setFocus([index]); table.reveal(index); if (focusedTable) { table.domFocus(); } else { - const cells = this.renderedCells.get(focusedSessionId); + const cells = this.renderedCells.get(nextFocusedId); const checkbox = focusedCheckbox ? cells?.get('selection')?.focusTarget : undefined; (checkbox?.isConnected ? checkbox : cells?.get('title')?.focusTarget)?.focus(); } + } else { + this.ageSelect?.focus(); } } this.updateCleanupButton(); @@ -908,11 +925,9 @@ export class SessionWorktreeCleanupEditor extends EditorPane { disposables.add(checkbox.onChange(() => this.setWorktreeSelected(template.worktree!, checkbox.checked))); render = worktree => { const title = getWorktreeCleanupTitle(worktree); - checkbox.setTitle(this.canForceCleanup(worktree) - ? localize('sessionWorktreeCleanup.selectForceRemoval', "Select {0} for forced removal", title) - : localize('sessionWorktreeCleanup.selectSession', "Select {0}", title)); + checkbox.setTitle(localize('sessionWorktreeCleanup.selectSession', "Select {0}", title)); checkbox.checked = this.isWorktreeSelected(worktree); - if (this.isManuallySelectable(worktree) || this.canForceCleanup(worktree)) { + if (this.isManuallySelectable(worktree)) { checkbox.enable(); checkbox.domNode.removeAttribute('aria-disabled'); if (!container.contains(checkbox.domNode)) { @@ -939,7 +954,6 @@ export class SessionWorktreeCleanupEditor extends EditorPane { } else if (column === 'title') { const titleLink = dom.append(container, dom.$('a.session-worktree-cleanup-session-link', { role: 'link', tabIndex: 0 })); focusTarget = titleLink; - let reason: HTMLElement | undefined; const openSession = () => { const session = template.worktree?.session; if (session) { @@ -962,20 +976,10 @@ export class SessionWorktreeCleanupEditor extends EditorPane { const title = getWorktreeCleanupTitle(worktree); titleLink.textContent = title; titleLink.setAttribute('role', worktree.session ? 'link' : 'button'); - dynamicDisposables.add(this.hoverService.setupDelayedHoverAtMouse(titleLink, { content: worktree.unlinkedWorktree ? URI.parse(worktree.unlinkedWorktree.worktree).path : localize('sessionWorktreeCleanup.openSession', "Open {0}", title) }, this.cellHoverOptions)); - reason?.remove(); - reason = undefined; - const cleanupLabel = this.getWorktreeCleanupLabel(worktree, this.isWorktreeCleaning(worktree)); - const label = worktree.unlinkedWorktree - ? localize('sessionWorktreeCleanup.reasonAndPath', "{0} - {1}", cleanupLabel ?? '', URI.parse(worktree.unlinkedWorktree.worktree).path) - : cleanupLabel; - if (label) { - reason = dom.append(container, dom.$('span.session-worktree-cleanup-reason', undefined, label)); - dynamicDisposables.add(this.hoverService.setupDelayedHoverAtMouse(reason, { content: label }, this.cellHoverOptions)); - titleLink.setAttribute('aria-description', label); - } else { - titleLink.removeAttribute('aria-description'); - } + const path = getWorktreePath(worktree); + const hoverTitle = worktree.session ? localize('sessionWorktreeCleanup.openSession', "Open {0}", title) : title; + dynamicDisposables.add(this.hoverService.setupDelayedHoverAtMouse(titleLink, { content: `${hoverTitle}\n${path}` }, this.cellHoverOptions)); + titleLink.setAttribute('aria-description', path); }; } else { render = worktree => { @@ -988,10 +992,15 @@ export class SessionWorktreeCleanupEditor extends EditorPane { } } else if (column === 'lastUsed') { const updatedAt = worktree.session?.updatedAt.get(); - container.textContent = updatedAt ? fromNow(updatedAt, true, true) : localize('sessionWorktreeCleanup.unknownLastUsed', "Unknown"); + container.textContent = updatedAt ? fromNow(updatedAt, true, true) : localize('sessionWorktreeCleanup.noSessionActivity', "No session activity"); if (updatedAt) { dynamicDisposables.add(this.hoverService.setupDelayedHoverAtMouse(container, { content: updatedAt.toLocaleString() }, this.cellHoverOptions)); } + } else if (column === 'status') { + const ownership = getWorktreeSessionLabel(worktree); + const state = this.getWorktreeCleanupLabel(worktree, this.isWorktreeCleaning(worktree)); + container.textContent = state && state !== ownership ? localize('sessionWorktreeCleanup.ownershipAndState', "{0}: {1}", ownership, state) : ownership; + dynamicDisposables.add(this.hoverService.setupDelayedHoverAtMouse(container, { content: container.textContent }, this.cellHoverOptions)); } else { const storage = this.getWorktreeStorageLabel(worktree); container.textContent = storage; @@ -1004,15 +1013,12 @@ export class SessionWorktreeCleanupEditor extends EditorPane { } private setWorktreeSelected(worktree: ISessionWorktree, selected: boolean): void { - const force = this.canForceCleanup(worktree); - if (!force && !this.isManuallySelectable(worktree)) { + if (!this.isManuallySelectable(worktree)) { return; } const sessionId = getWorktreeCleanupId(worktree); - if (!force) { - this.explicitSelections.set(sessionId, selected); - } - const selection = force ? this.selectedForceSessionIds : this.selectedSessionIds; + this.explicitSelections.set(sessionId, selected); + const selection = this.selectedSessionIds; if (selected) { selection.add(sessionId); } else { @@ -1025,7 +1031,7 @@ export class SessionWorktreeCleanupEditor extends EditorPane { } private isWorktreeSelected(worktree: ISessionWorktree): boolean { - return (this.canForceCleanup(worktree) ? this.selectedForceSessionIds : this.selectedSessionIds).has(getWorktreeCleanupId(worktree)); + return this.selectedSessionIds.has(getWorktreeCleanupId(worktree)); } private renderWorktreeCells(worktree: ISessionWorktree): void { @@ -1064,12 +1070,12 @@ export class SessionWorktreeCleanupEditor extends EditorPane { if (worktree.worktreeExists === false) { return ByteSize.formatSize(0); } - return worktree.cleanupState === 'archived' || worktree.session?.isArchived.get() - ? accessible ? localize('sessionWorktreeCleanup.doneStorage', "not measured for done sessions") : '—' + return worktree.cleanupState === 'archived' || worktree.session?.isArchived.get() || worktree.unlinkedWorktree + ? accessible ? worktree.unlinkedWorktree ? localize('sessionWorktreeCleanup.unlinkedStorage', "Not measured for worktrees without a listed session") : localize('sessionWorktreeCleanup.doneStorage', "Not measured for done sessions") : localize('sessionWorktreeCleanup.notMeasured', "Not measured") : worktree.isMeasuring ? localize('sessionWorktreeCleanup.calculatingStorage', "Calculating…") : worktree.sizeBytes === undefined - ? localize('sessionWorktreeCleanup.unknownStorage', "Unknown") + ? worktree.measurementFailed ? localize('sessionWorktreeCleanup.measurementFailed', "Measurement failed") : localize('sessionWorktreeCleanup.notMeasured', "Not measured") : ByteSize.formatSize(worktree.sizeBytes); } @@ -1085,14 +1091,13 @@ export class SessionWorktreeCleanupEditor extends EditorPane { worktree.sizeBytes === undefined, worktree.worktreeCount, worktree.cleanupState, + worktree.session?.isArchived.get(), worktree.isMeasuring, worktree.cleanupStatus?.state, worktree.cleanupStatus?.message, worktree.cleanupStatusError, worktree.worktreeExists, worktree.worktreeCheckError, - this.canForceCleanup(worktree), - this.isSchedulingCleanup, batch?.state, batch?.schedulingError, this.isWorktreeSelected(worktree), @@ -1102,8 +1107,6 @@ export class SessionWorktreeCleanupEditor extends EditorPane { private clearRenderedRows(): void { this.mainWorktreeTable?.splice(0, this.mainWorktreeTable.length); - this.unavailableWorktreeTable?.splice(0, this.unavailableWorktreeTable.length); - this.progressWorktreeTable?.splice(0, this.progressWorktreeTable.length); this.renderedCells.clear(); this.displayedSessionIds = []; } @@ -1148,22 +1151,15 @@ export class SessionWorktreeCleanupEditor extends EditorPane { return batch ? localize('sessionWorktreeCleanup.unverifiedCleanup', "Cleanup has not been confirmed.") : undefined; } - private requiresSessionRearchive(worktree: ISessionWorktree): boolean { - return worktree.session?.isArchived.get() === true && worktree.cleanupStatus?.state === 'failed' - && /\bgit add exited with code 128\b/.test(worktree.cleanupStatus.message ?? ''); - } - private getArchivedCleanupLabel(worktree: ISessionWorktree): string { switch (worktree.cleanupStatus?.state) { case 'pending': return localize('sessionWorktreeCleanup.scheduled', "Cleanup scheduled…"); case 'running': return localize('sessionWorktreeCleanup.cleaning', "Cleaning up…"); case 'inUse': return localize('sessionWorktreeCleanup.inUse', "Cleanup blocked: another session or chat uses this worktree."); case 'skipped': return localize('sessionWorktreeCleanup.doneSkipped', "Cleanup deferred: the worktree could not be safely removed."); - case 'failed': return this.requiresSessionRearchive(worktree) - ? localize('sessionWorktreeCleanup.rearchiveRequired', "Unarchive and archive the session to remove this worktree.") - : worktree.cleanupStatus.message - ? localize('sessionWorktreeCleanup.failedRetryReason', "Cleanup failed; retry scheduled: {0}", worktree.cleanupStatus.message) - : localize('sessionWorktreeCleanup.failedRetry', "Cleanup failed; retry scheduled."); + case 'failed': return worktree.cleanupStatus.message + ? localize('sessionWorktreeCleanup.failedRetryReason', "Cleanup failed; retry scheduled: {0}", worktree.cleanupStatus.message) + : localize('sessionWorktreeCleanup.failedRetry', "Cleanup failed; retry scheduled."); default: return worktree.worktreeExists === true ? localize('sessionWorktreeCleanup.existsRetry', "Worktree still exists. Select to retry cleanup.") : localize('sessionWorktreeCleanup.unverifiedRetry', "Worktree removal has not been confirmed. Select to retry cleanup."); @@ -1196,39 +1192,13 @@ export class SessionWorktreeCleanupEditor extends EditorPane { if (this.selectAllCheckbox) { this.updateSelectAllCheckbox(this.selectAllCheckbox, this.getVisibleWorktrees().filter(worktree => this.isManuallySelectable(worktree)), this.selectedSessionIds); } - if (this.forceCleanupButton && this.forceSelectAllCheckbox) { - const selectable = this.getVisibleWorktrees().filter(worktree => this.canForceCleanup(worktree)); - const selected = this.getSelectedForForceCleanup(); - const count = selected.reduce((total, worktree) => total + worktree.worktreeCount, 0); - this.forceCleanupButton.label = count === 0 - ? localize('sessionWorktreeCleanup.forceRemoveWorktrees', "Force Remove Worktrees") - : count === 1 - ? localize('sessionWorktreeCleanup.forceRemoveOne', "Force Remove 1 Worktree") - : localize('sessionWorktreeCleanup.forceRemoveMany', "Force Remove {0} Worktrees", count); - this.forceCleanupButton.enabled = !this.isSchedulingCleanup && count > 0; - this.updateSelectAllCheckbox(this.forceSelectAllCheckbox, selectable, this.selectedForceSessionIds); - if (selectable.length === 0 || this.isSchedulingCleanup) { - this.forceSelectAllCheckbox.disable(); - } else { - this.forceSelectAllCheckbox.enable(); - } - if (this.forceSelectionRow) { - if (selectable.length > 0) { - if (this.forceSelectionRow.previousElementSibling !== this.unavailableSummary) { - this.unavailableSummary?.after(this.forceSelectionRow); - } - } else { - this.forceSelectionRow.remove(); - } - } - } if (!this.cleanupButton) { return; } const selected = this.getSelected(); const selectedWorktrees = selected.reduce((total, candidate) => total + candidate.worktreeCount, 0); const selectedBytes = getWorktreeCleanupDiskUsage(selected); - const selectedSize = selectedBytes === undefined ? undefined : ByteSize.formatSize(selectedBytes); + const selectedSize = selectedBytes === undefined ? getPartialStorageLabel(selected) : ByteSize.formatSize(selectedBytes); this.cleanupButton.label = selected.length === 0 ? localize('sessionWorktreeCleanup.cleanupButton', "Clean Up Worktrees") : selectedSize === undefined @@ -1258,13 +1228,9 @@ export class SessionWorktreeCleanupEditor extends EditorPane { return !worktree.isMeasuring && !this.hasRemovalIssue(worktree) && this.canScheduleCleanup(worktree); } - private getSelectedForForceCleanup(): ISessionWorktree[] { - return this.getVisibleWorktrees().filter(worktree => this.canForceCleanup(worktree) && this.selectedForceSessionIds.has(getWorktreeCleanupId(worktree))); - } - private canScheduleCleanup(worktree: ISessionWorktree): boolean { const batch = this.cleanupBatch.get(getWorktreeCleanupId(worktree)); - return worktree.worktreeExists !== false && !this.requiresSessionRearchive(worktree) && batch?.state !== 'queued' && batch?.state !== 'pending' && batch?.state !== 'removed' + return worktree.isListedByHost !== false && worktree.worktreeExists !== false && batch?.state !== 'queued' && batch?.state !== 'pending' && batch?.state !== 'removed' && (worktree.unlinkedWorktree ? !!worktree.unlinkedWorktree.branch && !worktree.cleanupStatusError && !worktree.worktreeCheckError && worktree.cleanupStatus?.state !== 'inUse' && !this.hasPendingCleanup(worktree) : worktree.cleanupState === 'archived' @@ -1279,20 +1245,14 @@ export class SessionWorktreeCleanupEditor extends EditorPane { private hasRemovalIssue(worktree: ISessionWorktree): boolean { const batch = this.cleanupBatch.get(getWorktreeCleanupId(worktree)); + if (worktree.worktreeExists === false || batch?.state === 'removed') { + return false; + } return worktree.cleanupStatus?.state === 'failed' || worktree.cleanupStatus?.state === 'skipped' || worktree.cleanupStatus?.state === 'inUse' - || !!worktree.worktreeCheckError || !!worktree.cleanupStatusError || worktree.measurementFailed === true + || worktree.isListedByHost === false || !!worktree.worktreeCheckError || !!worktree.cleanupStatusError || worktree.measurementFailed === true || batch?.state === 'failed' || batch?.state === 'attention'; } - private canForceCleanup(worktree: ISessionWorktree): boolean { - return !this.isWorktreeInProgress(worktree) && this.hasRemovalIssue(worktree) && this.cleanupService.canForceCleanup?.(this.withSchedulingFailure(worktree)) === true; - } - - private withSchedulingFailure(worktree: ISessionWorktree): ISessionWorktree { - const message = this.cleanupBatch.get(getWorktreeCleanupId(worktree))?.schedulingError; - return message ? { ...worktree, cleanupStatus: { state: 'failed', message } } : worktree; - } - private updateCleanupBatch(): void { if (this.isSchedulingCleanup) { return; @@ -1306,6 +1266,10 @@ export class SessionWorktreeCleanupEditor extends EditorPane { const worktrees = new Map(this.worktrees.map(worktree => [getWorktreeCleanupId(worktree), worktree])); for (let [sessionId, entry] of this.cleanupBatch) { const worktree = worktrees.get(sessionId); + if (worktree && this.restoredCleanupIds.delete(sessionId) && worktree.worktreeExists === false) { + this.cleanupBatch.delete(sessionId); + continue; + } if (worktree && worktree.isListedByHost !== entry.candidate.isListedByHost) { entry = { ...entry, candidate: { ...entry.candidate, isListedByHost: worktree.isListedByHost } }; this.cleanupBatch.set(sessionId, entry); @@ -1322,6 +1286,9 @@ export class SessionWorktreeCleanupEditor extends EditorPane { entry.state = 'attention'; } } else if (!worktree.isMeasuring) { + if (entry.state === 'pending' && worktree.cleanupStatus?.state === 'failed') { + this.notificationService.error(worktree.cleanupStatus.message ?? localize('sessionWorktreeCleanup.hostCleanupFailed', "Worktree cleanup failed. See the Agent Host log for details.")); + } entry.state = worktree.worktreeExists === false ? 'removed' : worktree.cleanupStatus?.state === 'failed' ? 'failed' : this.hasPendingCleanup(worktree) ? 'pending' @@ -1330,53 +1297,34 @@ export class SessionWorktreeCleanupEditor extends EditorPane { } } - private getRetryCandidates(): ISessionWorktree[] { - const failed = this.getVisibleWorktrees().filter(worktree => this.cleanupBatch.get(getWorktreeCleanupId(worktree))?.state === 'failed'); - const force = failed.filter(worktree => this.canForceCleanup(worktree)); - return force.length > 0 ? force : failed.filter(worktree => this.canScheduleCleanup(worktree)); - } - private renderBatchSummary(): void { - if (!this.batchSummaryRow || !this.batchSummary || !this.retryButton) { + if (!this.batchSummaryRow || !this.batchSummary) { return; } - this.batchSummaryRow.classList.toggle('hidden', this.cleanupBatch.size === 0); - let total = 0; let done = 0; let pending = 0; - let failed = 0; - let attention = 0; for (const entry of this.cleanupBatch.values()) { const count = entry.candidate.worktreeCount; - total += count; switch (entry.state) { case 'removed': done += count; break; case 'queued': case 'pending': pending += count; break; - case 'failed': failed += count; break; - case 'attention': attention += count; break; } } + const total = done + pending; + this.batchSummaryRow.classList.toggle('hidden', total === 0); const message = pending > 0 - ? localize('sessionWorktreeCleanup.batchProgress', "Cleanup: {0} of {1} worktrees removed, {2} pending, {3} failed, {4} need attention.", done, total, pending, failed, attention) - : done === total - ? done === 1 - ? localize('sessionWorktreeCleanup.batchCompleteOne', "Cleanup complete: 1 worktree removed.") - : localize('sessionWorktreeCleanup.batchComplete', "Cleanup complete: {0} worktrees removed.", done) - : localize('sessionWorktreeCleanup.batchResults', "Cleanup results: {0} of {1} worktrees removed, {2} failed, {3} need attention.", done, total, failed, attention); + ? localize('sessionWorktreeCleanup.batchProgress', "Cleanup: {0} of {1} worktrees removed, {2} pending.", done, total, pending) + : done === 1 + ? localize('sessionWorktreeCleanup.batchRemovedOne', "Cleanup: 1 worktree removed.") + : localize('sessionWorktreeCleanup.batchRemoved', "Cleanup: {0} worktrees removed.", done); if (this.batchSummary.textContent !== message) { this.batchSummary.textContent = message; } - this.hasCleanupFailures ||= failed > 0; - dom.setVisibility(this.hasCleanupFailures, this.retryButton.element); - const retryCandidates = this.getRetryCandidates(); - this.retryButton.label = retryCandidates.some(worktree => this.canForceCleanup(worktree)) - ? localize('sessionWorktreeCleanup.forceRetryFailed', "Force Remove Failed Worktrees") - : localize('sessionWorktreeCleanup.retryFailed', "Retry Failed Worktrees"); - this.retryButton.enabled = !this.isSchedulingCleanup && retryCandidates.length > 0; } - private async cleanupSelected(selected = this.getSelected(), forceWorktrees?: readonly ISessionWorktree[]): Promise { + private async cleanupSelected(): Promise { + const selected = this.getSelected(); if (this.isSchedulingCleanup || selected.length === 0) { return; } @@ -1391,7 +1339,6 @@ export class SessionWorktreeCleanupEditor extends EditorPane { this.pinnedDisplayOrder = new Map(this.displayedSessionIds.map((sessionId, index) => [sessionId, index])); for (const candidate of selected) { this.selectedSessionIds.delete(getWorktreeCleanupId(candidate)); - this.selectedForceSessionIds.delete(getWorktreeCleanupId(candidate)); this.cleanupBatch.set(getWorktreeCleanupId(candidate), { candidate, state: 'queued' }); } this.renderRows(); @@ -1414,11 +1361,7 @@ export class SessionWorktreeCleanupEditor extends EditorPane { } } }; - if (forceWorktrees) { - await this.cleanupService.forceCleanupWorktrees(forceWorktrees.map(worktree => this.withSchedulingFailure(worktree)), onProgress); - } else { - await this.cleanupService.cleanupWorktrees(selected, onProgress); - } + await this.cleanupService.cleanupWorktrees(selected, onProgress); } catch (error) { if (generation === this.cleanupGeneration) { for (const entry of this.cleanupBatch.values()) { @@ -1432,6 +1375,7 @@ export class SessionWorktreeCleanupEditor extends EditorPane { } finally { if (generation === this.cleanupGeneration && !this._store.isDisposed) { this.cleanupRenderScheduler.cancel(); + this.refreshRestoredCleanup = false; for (const candidate of selected) { if (this.cleanupBatch.get(getWorktreeCleanupId(candidate))?.state === 'pending') { this.cleaningSessionIds.set(getWorktreeCleanupId(candidate), Date.now()); @@ -1450,9 +1394,12 @@ export class SessionWorktreeCleanupEditor extends EditorPane { } private renderAutomaticCleanup(content: HTMLElement): void { - const section = dom.append(content, dom.$('.session-worktree-cleanup-automatic')); - dom.append(section, dom.$('h2', undefined, localize('sessionWorktreeCleanup.automaticHeading', "Cleanup Settings"))); - dom.append(section, dom.$('p', undefined, localize('sessionWorktreeCleanup.automaticDescription', "Changes to these settings are saved immediately. Background cleanup evaluates existing and future sessions after confirming their eligibility. For merged pull requests, inactive sessions are marked as done first, then optionally deleted after an additional retention period."))); + const section = dom.append(content, dom.$('details.session-worktree-cleanup-automatic')); + const summary = dom.append(section, dom.$('summary')); + const icon = dom.append(summary, renderIcon(Codicon.settingsGear)); + icon.setAttribute('aria-hidden', 'true'); + dom.append(summary, dom.$('span', undefined, localize('sessionWorktreeCleanup.automaticHeading', "Automatic Cleanup"))); + this.editorDisposables.add(dom.addDisposableListener(section, 'toggle', () => this.updateScrollDimensions())); this.renderAutomaticSetting(section, ChatConfiguration.AutoMarkAsDoneMergedSessionsAfterDays, localize('sessionWorktreeCleanup.autoMark', "Mark merged sessions as done after"), localize('sessionWorktreeCleanup.autoMarkAria', "Automatically mark merged sessions as done")); diff --git a/src/vs/sessions/contrib/sessionInputBanners/test/browser/sessionWorktreeCleanupEditor.test.ts b/src/vs/sessions/contrib/sessionInputBanners/test/browser/sessionWorktreeCleanupEditor.test.ts index 8a103beba33..1ca11b7239e 100644 --- a/src/vs/sessions/contrib/sessionInputBanners/test/browser/sessionWorktreeCleanupEditor.test.ts +++ b/src/vs/sessions/contrib/sessionInputBanners/test/browser/sessionWorktreeCleanupEditor.test.ts @@ -12,7 +12,7 @@ import { CancellationToken } from '../../../../../base/common/cancellation.js'; import { Codicon } from '../../../../../base/common/codicons.js'; import { getErrorMessage } from '../../../../../base/common/errors.js'; import { toDisposable } from '../../../../../base/common/lifecycle.js'; -import { constObservable } from '../../../../../base/common/observable.js'; +import { constObservable, observableValue, transaction } from '../../../../../base/common/observable.js'; import { URI } from '../../../../../base/common/uri.js'; import { upcastPartial } from '../../../../../base/test/common/mock.js'; import { runWithFakedTimers } from '../../../../../base/test/common/virtualScheduling/index.js'; @@ -32,7 +32,7 @@ import { ISessionsService } from '../../../../../workbench/contrib/sessions/brow import { ISession } from '../../../../../workbench/services/sessions/common/session.js'; import { SessionWorktreeCleanupEditor } from '../../browser/sessionWorktreeCleanupEditor.js'; import { SessionWorktreeCleanupEditorInput } from '../../browser/sessionWorktreeCleanupEditorInput.js'; -import { AGENT_SESSIONS_STORAGE_CLEANUP_SUGGESTION_SETTING, getWorktreeCleanupId, ISessionWorktree, ISessionWorktreeCleanupCandidate, ISessionWorktreeCleanupService, ISessionWorktreeMeasurementProgress, SessionWorktreeCleanupProgress } from '../../browser/sessionWorktreeCleanupService.js'; +import { AGENT_SESSIONS_STORAGE_CLEANUP_SUGGESTION_SETTING, getWorktreeCleanupId, ISessionWorktree, ISessionWorktreeCleanupCandidate, ISessionWorktreeCleanupOperation, ISessionWorktreeCleanupService, ISessionWorktreeMeasurementProgress, SessionWorktreeCleanupProgress } from '../../../../../workbench/contrib/sessions/browser/sessionInputBanners/sessionWorktreeCleanupService.js'; import '../../../../../workbench/browser/actions/listCommands.js'; suite('SessionWorktreeCleanupEditor', () => { @@ -53,7 +53,12 @@ suite('SessionWorktreeCleanupEditor', () => { const updateValue = stub(configuration, 'updateValue').callsFake((key, value) => configuration.setUserConfiguration(key, value)); disposables.add({ dispose: () => updateValue.restore() }); instantiationService.stub(IConfigurationService, configuration); - instantiationService.stub(ISessionWorktreeCleanupService, upcastPartial({ refresh: async () => { }, ...cleanupService })); + instantiationService.stub(ISessionWorktreeCleanupService, upcastPartial({ + refresh: async () => { }, + cleanupOperations: constObservable([]), + isSchedulingCleanup: constObservable(false), + ...cleanupService, + })); const opened: string[] = []; instantiationService.stub(ISessionsService, upcastPartial({ openSession: async resource => { opened.push(resource.toString()); return undefined; } })); const errors: string[] = []; @@ -62,6 +67,7 @@ suite('SessionWorktreeCleanupEditor', () => { const container = dom.append(mainWindow.document.body, dom.$('div')); disposables.add(toDisposable(() => container.remove())); editor.create(container); + editor.layout(new dom.Dimension(1200, 1000)); return { editor, container, configuration, updateValue, errors, opened, instantiationService }; } @@ -79,8 +85,371 @@ suite('SessionWorktreeCleanupEditor', () => { if (!mainWindow.document.hasFocus()) { element.dispatchEvent(new mainWindow.FocusEvent('focus')); } + + } + + function rowStatus(row: ParentNode): string | undefined { + return row.querySelector('.status')?.textContent?.replace(/^(?:Has session|Session marked as done|No matching session): /, ''); + } + + function selectAllWorktrees(container: HTMLElement): void { + container.querySelector('.session-worktree-cleanup-select-all [role="checkbox"]')!.click(); + } + + function sortWorktrees(container: HTMLElement, order: string): void { + const sort = container.querySelector('.session-worktree-cleanup-sort')!; + sort.value = order; + sort.dispatchEvent(new mainWindow.Event('change')); } + test('shows ownership once for idle worktrees and hides failed worktrees without hiding progress', async () => { + const { container } = await openEditor([ + createWorktree('ready', '/repos/app'), + createUnlinkedWorktree('unlinked'), + { ...createWorktree('failed', '/repos/app', 'archived'), cleanupStatus: { state: 'failed', message: 'locked directory' } }, + { ...createUnlinkedWorktree('failed-unlinked'), cleanupStatus: { state: 'failed', message: 'locked directory' } }, + { ...createWorktree('pending', '/repos/app', 'archived'), cleanupStatus: { state: 'pending' } }, + ]); + assert.deepStrictEqual(Object.fromEntries([...container.querySelectorAll('.session-worktree-cleanup-row')].map(row => [ + row.querySelector('.session-worktree-cleanup-session-link')?.textContent, + row.querySelector('.status')?.textContent, + ])), { + ready: 'Has session', + 'agents/unlinked': 'No matching session', + pending: 'Session marked as done: Cleanup scheduled…', + }); + }); + + test('hides protected, failed, unverified, and blocked rows even when the host advertises forced cleanup', async () => { + const unavailable: ISessionWorktree[] = [ + ...(['running', 'pinned', 'recent', 'untitled', 'error', 'unavailable'] as const).map(state => createWorktree(state, '/repos/app', state)), + ...(['failed', 'skipped', 'inUse'] as const).flatMap(state => [ + { ...createWorktree(state, '/repos/app', 'archived'), cleanupStatus: { state } }, + { ...createUnlinkedWorktree(state), cleanupStatus: { state } }, + ]), + { ...createWorktree('unmeasured', '/repos/app'), sizeBytes: undefined, measurementFailed: true }, + { ...createUnlinkedWorktree('unlisted'), isListedByHost: false }, + { ...createWorktree('status-error', '/repos/app', 'archived'), cleanupStatusError: 'disconnected' }, + { ...createUnlinkedWorktree('existence-error'), worktreeCheckError: 'denied' }, + ]; + const { editor, container } = createEditor({ + getWorktrees: async () => [createWorktree('eligible', '/repos/app'), ...unavailable], + canForceCleanup: () => true, + }); + await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); + await timeout(0); + assert.deepStrictEqual({ + titles: [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent), + recoveryControls: container.querySelectorAll('.session-worktree-cleanup-retry, .session-worktree-cleanup-force-remove, .session-worktree-cleanup-view').length, + summary: container.querySelector('.session-worktree-cleanup-summary')?.textContent, + }, { titles: ['eligible'], recoveryControls: 0, summary: '1 of 1 matching worktrees can be cleaned up. Estimated disk usage: 100B.' }); + }); + + test('shows an honest empty state and keeps settings when nothing can be cleaned up', async () => { + const { container } = await openEditor([createWorktree('pinned', '/repos/app', 'pinned'), { + ...createWorktree('locked', '/repos/app', 'archived'), cleanupStatus: { state: 'failed', message: 'initializing lock' }, + }]); + assert.deepStrictEqual({ + rows: container.querySelectorAll('.session-worktree-cleanup-row').length, + empty: container.querySelector('.session-worktree-cleanup-empty')?.classList.contains('hidden'), + message: container.querySelector('.session-worktree-cleanup-empty')?.textContent, + batchHidden: container.querySelector('.session-worktree-cleanup-batch')?.classList.contains('hidden'), + settings: container.querySelector('summary')?.textContent, + }, { rows: 0, empty: false, message: 'No worktrees to clean up.', batchHidden: true, settings: 'Automatic Cleanup' }); + }); + + test('a scheduling failure stays hidden after refresh and reopening without retry controls or failure counters', async () => { + const worktree = createWorktree('failed', '/repos/app'); + const operations = observableValue('operations', []); + let requests = 0; + const { editor, container, errors } = createEditor({ + cleanupOperations: operations, + getWorktrees: async () => [worktree], + cleanupWorktrees: async ([candidate], onProgress) => { + requests++; + onProgress?.({ state: 'started' }); + operations.set([{ candidate, state: 'failed', message: 'index.lock exists' }], undefined); + onProgress?.({ state: 'failed', candidate, message: 'index.lock exists' }); + throw new Error('index.lock exists'); + }, + }); + await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); + await timeout(0); + selectAllWorktrees(container); + container.querySelector('.session-worktree-cleanup-action')!.click(); + await timeout(0); + const afterFailure = { + rows: container.querySelectorAll('.session-worktree-cleanup-row').length, + batchHidden: container.querySelector('.session-worktree-cleanup-batch')?.classList.contains('hidden'), + }; + editor.clearInput(); + await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); + await timeout(0); + assert.deepStrictEqual({ + requests, errors, afterFailure, + reopenedRows: container.querySelectorAll('.session-worktree-cleanup-row').length, + reopenedBatchHidden: container.querySelector('.session-worktree-cleanup-batch')?.classList.contains('hidden'), + }, { requests: 1, errors: ['index.lock exists'], afterFailure: { rows: 0, batchHidden: true }, reopenedRows: 0, reopenedBatchHidden: true }); + }); + + test('a host failure is notified once and hidden without claiming removal or losing pending work', () => runWithFakedTimers({ useFakeTimers: true }, async () => { + const first = createWorktree('failed', '/repos/app', 'archived'); + const second = createWorktree('pending', '/repos/app', 'archived'); + const pending = [first, second].map(worktree => ({ ...worktree, cleanupStatus: { state: 'pending' as const } })); + let checks = 0; + const { editor, container, errors } = createEditor({ + getWorktrees: async () => pending, + refreshPendingCleanup: async () => { + checks++; + return [{ ...first, cleanupStatus: { state: 'failed', message: 'index.lock exists' } }, pending[1]]; + }, + }); + await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); + await timeout(6_100); + assert.deepStrictEqual({ + errors, checks, + titles: [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent), + summary: container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent, + failureCount: /\d+ failed|need attention/.test(container.textContent ?? ''), + }, { errors: ['index.lock exists'], checks: 2, titles: ['pending'], summary: 'Cleanup: 0 of 1 worktrees removed, 1 pending.', failureCount: false }); + })); + + test('a failed scheduling attempt does not hide unrelated unchecked rows or count failed work as removed', async () => { + const first = createWorktree('first', '/repos/app'); + const failed = createWorktree('failed', '/repos/app'); + const remaining = createWorktree('remaining', '/repos/app'); + let scheduled = false; + const { editor, container, errors } = createEditor({ + getWorktrees: async () => [scheduled ? removedWorktree(first) : first, failed, remaining], + cleanupWorktrees: async (candidates, onProgress) => { + onProgress?.({ state: 'started' }); + for (const candidate of candidates) { + onProgress?.(getWorktreeCleanupId(candidate) === 'first' + ? { state: 'scheduled', candidate } + : { state: 'failed', candidate, message: 'locked' }); + } + scheduled = true; + throw new Error('locked'); + }, + }); + await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); + await timeout(0); + selectAllWorktrees(container); + container.querySelectorAll('.session-worktree-cleanup-row [role="checkbox"]')[2].click(); + container.querySelector('.session-worktree-cleanup-action')!.click(); + await timeout(0); + assert.deepStrictEqual({ + errors, + titles: [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent), + summary: container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent, + unchecked: container.querySelector('.session-worktree-cleanup-row [role="checkbox"]')?.getAttribute('aria-checked'), + }, { errors: ['locked'], titles: ['first', 'remaining'], summary: 'Cleanup: 1 worktree removed.', unchecked: 'false' }); + }); + + test('keeps focus reachable when the last focused row becomes unavailable', () => runWithFakedTimers({ useFakeTimers: true }, async () => { + const worktree = createWorktree('last', '/repos/app'); + let publish: ((worktrees: readonly ISessionWorktree[]) => void) | undefined; + const { editor, container } = createEditor({ + getWorktrees: async (_age, update) => { publish = update; return [worktree]; }, + }); + await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); + await timeout(0); + focusElement(container.querySelector('.session-worktree-cleanup-session-link')!); + publish?.([{ ...worktree, cleanupState: 'pinned' }]); + await timeout(100); + assert.deepStrictEqual({ + rows: container.querySelectorAll('.session-worktree-cleanup-row').length, + focusedAgeFilter: dom.getActiveElement() === container.querySelector('.session-worktree-cleanup-age'), + }, { rows: 0, focusedAgeFilter: true }); + })); + + test('cleans up one checked worktree without per-row actions', async () => { + const worktrees = [createWorktree('selected', '/repos/app'), createWorktree('unchecked', '/repos/app'), createWorktree('active', '/repos/app', 'active')]; + const { container, cleaned } = await openEditor(worktrees); + const checkboxes = container.querySelectorAll('.session-worktree-cleanup-row [role="checkbox"]'); + checkboxes[2].click(); + container.querySelector('.session-worktree-cleanup-action')!.click(); + await timeout(0); + assert.deepStrictEqual({ + cleaned, + checked: [...container.querySelectorAll('.session-worktree-cleanup-row [role="checkbox"]')].map(checkbox => checkbox.getAttribute('aria-checked')), + rowActions: container.querySelectorAll('.session-worktree-cleanup-row .actions, .session-worktree-cleanup-row .monaco-toolbar').length, + }, { cleaned: [['active']], checked: ['false', 'false', 'true'], rowActions: 0 }); + }); + + test('has one virtualized table and no outer vertical scroll container', async () => { + const { editor, container } = await openEditor(Array.from({ length: 2000 }, (_, index) => createWorktree(`worktree-${index}`, '/repos/app'))); + editor.layout(new dom.Dimension(960, 600)); + const root = container.querySelector('.session-worktree-cleanup-editor')!; + const content = container.querySelector('.session-worktree-cleanup-content')!; + const body = container.querySelector('.session-worktree-cleanup-table-body')!; + assert.deepStrictEqual({ + tables: container.querySelectorAll('.monaco-table').length, + lists: container.querySelectorAll('.monaco-list').length, + virtualized: container.querySelectorAll('.session-worktree-cleanup-row').length < 20, + rootOverflow: mainWindow.getComputedStyle(root).overflowY, + contentOverflow: mainWindow.getComputedStyle(content).overflowY, + wrappedByOuterScroller: !!content.parentElement?.closest('.monaco-scrollable-element'), + horizontalScrollerInsideInventory: !!body.closest('.session-worktree-cleanup-list'), + }, { tables: 1, lists: 1, virtualized: true, rootOverflow: 'hidden', contentOverflow: 'visible', wrappedByOuterScroller: false, horizontalScrollerInsideInventory: true }); + }); + + test('rehydrates service-owned cleanup operations after closing and reopening without duplicate submission', () => runWithFakedTimers({ useFakeTimers: true }, async () => { + const worktree = createWorktree('first', '/repos/app'); + const operations = observableValue('operations', []); + const scheduling = observableValue('scheduling', false); + const completion = new DeferredPromise(); + let requests = 0; + const { editor, container } = createEditor({ + cleanupOperations: operations, + isSchedulingCleanup: scheduling, + getWorktrees: async () => [worktree], + cleanupWorktrees: async ([candidate], onProgress) => { + requests++; + transaction(tx => { + operations.set([{ candidate, state: 'queued' }], tx); + scheduling.set(true, tx); + }); + onProgress?.({ state: 'started' }); + await completion.p; + transaction(tx => { + operations.set([{ candidate, state: 'failed', message: 'host disconnected' }], tx); + scheduling.set(false, tx); + }); + return true; + }, + }); + await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); + await timeout(0); + selectAllWorktrees(container); + container.querySelector('.session-worktree-cleanup-action')!.click(); + editor.clearInput(); + await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); + await timeout(100); + container.querySelector('.session-worktree-cleanup-action')!.click(); + const reopened = { + reason: rowStatus(container), + busy: container.querySelector('.session-worktree-cleanup-row')?.getAttribute('aria-busy'), + checkboxes: container.querySelectorAll('.session-worktree-cleanup-row [role="checkbox"]').length, + }; + await completion.complete(); + await timeout(100); + assert.deepStrictEqual({ + requests, reopened, + reason: rowStatus(container), + rows: container.querySelectorAll('.session-worktree-cleanup-row').length, + batchHidden: container.querySelector('.session-worktree-cleanup-batch')?.classList.contains('hidden'), + }, { requests: 1, reopened: { reason: 'Queued for cleanup…', busy: 'true', checkboxes: 0 }, reason: undefined, rows: 0, batchHidden: true }); + })); + + test('refreshes restored submissions on completion and observes successful removal after reopening', () => runWithFakedTimers({ useFakeTimers: true }, async () => { + const archived = observableValue('archived', false); + const initial = createWorktree('first', '/repos/app'); + const worktree: ISessionWorktree = { ...initial, session: upcastPartial({ ...initial.session, isArchived: archived }) }; + const operations = observableValue('operations', []); + const scheduling = observableValue('scheduling', false); + const completion = new DeferredPromise(); + let requests = 0; + let loads = 0; + let checks = 0; + const { editor, container } = createEditor({ + cleanupOperations: operations, + isSchedulingCleanup: scheduling, + getWorktrees: async () => { + loads++; + return [archived.get() ? { ...worktree, cleanupState: 'archived', cleanupStatus: { state: 'pending' } } : worktree]; + }, + refreshPendingCleanup: async () => { checks++; return [removedWorktree(worktree)]; }, + cleanupWorktrees: async ([candidate], onProgress) => { + requests++; + transaction(tx => { + operations.set([{ candidate, state: 'queued' }], tx); + scheduling.set(true, tx); + }); + onProgress?.({ state: 'started' }); + await completion.p; + transaction(tx => { + archived.set(true, tx); + operations.set([{ candidate, state: 'pending' }], tx); + scheduling.set(false, tx); + }); + return true; + }, + }); + await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); + await timeout(0); + selectAllWorktrees(container); + container.querySelector('.session-worktree-cleanup-action')!.click(); + editor.clearInput(); + await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); + await timeout(100); + const beforeCompletion = loads; + await completion.complete(); + await timeout(2_200); + assert.deepStrictEqual({ beforeCompletion, loads, requests, checks, summary: container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent }, { + beforeCompletion: 2, loads: 3, requests: 1, checks: 1, summary: 'Cleanup: 1 worktree removed.', + }); + })); + + test('restoration clears the local pending batch so its row can be cleaned up again', () => runWithFakedTimers({ useFakeTimers: true }, async () => { + const archived = observableValue('archived', false); + const initial = createWorktree('restored', '/repos/app'); + const worktree: ISessionWorktree = { ...initial, session: upcastPartial({ ...initial.session, isArchived: archived }) }; + const operations = observableValue('operations', []); + let requests = 0; + const { editor, container } = createEditor({ + cleanupOperations: operations, + getWorktrees: async () => [worktree], + cleanupWorktrees: async ([candidate], onProgress) => { + requests++; + operations.set([{ candidate, state: 'pending' }], undefined); + return scheduleCleanup([candidate], onProgress); + }, + }); + await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); + await timeout(0); + selectAllWorktrees(container); + container.querySelector('.session-worktree-cleanup-action')!.click(); + await timeout(100); + operations.set([], undefined); + await timeout(100); + const checkbox = container.querySelector('.session-worktree-cleanup-row [role="checkbox"]')!; + if (checkbox.getAttribute('aria-checked') !== 'true') { + checkbox.click(); + } + container.querySelector('.session-worktree-cleanup-action')!.click(); + await timeout(0); + assert.deepStrictEqual({ requests, selectableRows: container.querySelectorAll('.session-worktree-cleanup-row [role="checkbox"]').length }, { requests: 2, selectableRows: 0 }); + })); + + test('expanded settings and controls remain reachable beside a virtualized inventory in a short narrow editor', async () => { + const { editor, container } = await openEditor(Array.from({ length: 2000 }, (_, index) => createWorktree(`worktree-${index}`, '/repos/app'))); + const settings = container.querySelector('details')!; + settings.open = true; + settings.dispatchEvent(new mainWindow.Event('toggle')); + editor.layout(new dom.Dimension(420, 320)); + const root = container.querySelector('.session-worktree-cleanup-editor')!; + const inventory = container.querySelector('.session-worktree-cleanup-list')!; + const regions = [...container.querySelectorAll('.session-worktree-cleanup-controls-content')]; + const regionBounds = regions.map(region => { + region.scrollTop = region.scrollHeight; + const last = region.lastElementChild!.getBoundingClientRect(); + const bounds = region.getBoundingClientRect(); + return { scrollable: region.scrollHeight > region.clientHeight, lastControlReachable: last.bottom <= bounds.bottom + 1 }; + }); + assert.deepStrictEqual({ + regionBounds, + settingsVisible: settings.getBoundingClientRect().bottom <= root.getBoundingClientRect().bottom, + settingsAboveInventory: settings.getBoundingClientRect().bottom <= inventory.getBoundingClientRect().top, + inventoryVisible: inventory.clientHeight >= 80, + inventoryOutsideControls: !inventory.closest('.session-worktree-cleanup-controls-content'), + virtualized: container.querySelectorAll('.session-worktree-cleanup-row').length < 20, + }, { + regionBounds: [{ scrollable: true, lastControlReachable: true }, { scrollable: true, lastControlReachable: true }], + settingsVisible: true, settingsAboveInventory: true, inventoryVisible: true, inventoryOutsideControls: true, virtualized: true, + }); + }); + for (const result of ['empty', 'populated'] as const) { test(`focus enters the cleanup editor while loading and after ${result} results`, async () => { const finished = new DeferredPromise(); @@ -110,7 +479,7 @@ suite('SessionWorktreeCleanupEditor', () => { }); } - test('preselects unlinked worktrees with unknown size and allows cleanup', async () => { + test('leaves unlinked worktrees with unknown size unchecked and allows explicit cleanup', async () => { const unlinked: ISessionWorktree = { unlinkedWorktree: { providerId: 'test', repository: URI.file('/repos/app').toString(), worktree: URI.file('/repos/app.worktrees/recovered').toString(), branch: 'agents/recovered', cleanupStatus: { state: 'unknown' } }, sizeBytes: undefined, worktreeCount: 1, cleanupState: 'unlinked', worktreeExists: true, cleanupStatus: { state: 'unknown' }, @@ -143,11 +512,12 @@ suite('SessionWorktreeCleanupEditor', () => { announcesPath: title.closest('.monaco-list-row')?.getAttribute('aria-label')?.includes('/repos/app.worktrees/recovered'), inspectedPaths: showHover.args.map(([options, focus]) => ({ content: options.content, focus })), }, { - title: 'agents/recoveredNo matching session - /repos/app.worktrees/recovered', - storage: 'Unknown', lastUsed: 'Unknown', selected: 'true', selectable: null, + title: 'agents/recovered', + storage: 'Not measured', lastUsed: 'No session activity', selected: 'false', selectable: null, titleRole: 'button', titleTabIndex: 0, announcesPath: true, inspectedPaths: Array.from({ length: 2 }, () => ({ content: '/repos/app.worktrees/recovered', focus: true })), }); + checkbox.click(); container.querySelector('.session-worktree-cleanup-action')!.click(); await timeout(0); assert.deepStrictEqual({ requests: requests.map(candidates => candidates.map(getWorktreeCleanupId)), opened }, { @@ -189,6 +559,7 @@ suite('SessionWorktreeCleanupEditor', () => { unlinkedWorktree: { ...worktree.unlinkedWorktree!, worktree: URI.file(`/repos/app.worktrees/unavailable-${index}`).toString() }, })); const { container, cleaned } = await openEditor([unlinked, createWorktree('active', '/repos/app', 'active'), ...unavailable]); + sortWorktrees(container, 'status'); const selectAll = container.querySelector('.session-worktree-cleanup-select-all [role="checkbox"]')!; const selection = () => ({ all: selectAll.getAttribute('aria-checked'), @@ -205,7 +576,7 @@ suite('SessionWorktreeCleanupEditor', () => { await timeout(0); assert.deepStrictEqual({ states, cleaned }, { states: [ - { all: 'mixed', rows: ['false', 'true'] }, + { all: 'false', rows: ['false', 'false'] }, { all: 'true', rows: ['true', 'true'] }, { all: 'false', rows: ['false', 'false'] }, { all: 'true', rows: ['true', 'true'] }, @@ -214,64 +585,58 @@ suite('SessionWorktreeCleanupEditor', () => { }); }); - for (const force of [false, true]) { - test(`${force ? 'forced removal' : 'cleanup'} header checkbox reflects partial selection and supports keyboard toggling`, async () => { - const worktrees = ['first', 'second'].map(id => ({ - ...createWorktree(id, '/repos/app', force ? 'archived' : 'active'), - ...(force ? { cleanupStatus: { state: 'failed' as const } } : {}), - })); - const { editor, container } = createEditor({ - getWorktrees: async () => worktrees, - canForceCleanup: () => force, - }); - await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); - await timeout(0); - const table = container.querySelector(force ? '.session-worktree-cleanup-unavailable-list' : '.session-worktree-cleanup-content > .session-worktree-cleanup-list')!; - const selectAll = table.querySelector('.monaco-table-th[data-col-index="0"] [role="checkbox"]')!; - const rows = [...table.querySelectorAll('.session-worktree-cleanup-row [role="checkbox"]')]; - const selection = () => ({ - all: selectAll.getAttribute('aria-checked'), - dash: selectAll.classList.contains('codicon-dash'), - rows: rows.map(checkbox => checkbox.getAttribute('aria-checked')), - }); - const pressSpace = () => { - focusElement(selectAll); - selectAll.dispatchEvent(new mainWindow.KeyboardEvent('keydown', { key: ' ', keyCode: 32, bubbles: true })); - }; - const states = [selection()]; - rows[0].click(); - states.push(selection()); - pressSpace(); - states.push(selection()); - rows[1].click(); - states.push(selection()); - selectAll.click(); - states.push(selection()); - pressSpace(); - states.push(selection()); + test('cleanup header checkbox reflects partial selection and supports keyboard toggling', async () => { + const worktrees = ['first', 'second'].map(id => createWorktree(id, '/repos/app', 'active')); + const { editor, container } = createEditor({ + getWorktrees: async () => worktrees, + }); + await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); + await timeout(0); + const table = container.querySelector('.session-worktree-cleanup-content > .session-worktree-cleanup-list')!; + const selectAll = table.querySelector('.monaco-table-th[data-col-index="0"] [role="checkbox"]')!; + const rows = [...table.querySelectorAll('.session-worktree-cleanup-row [role="checkbox"]')]; + const selection = () => ({ + all: selectAll.getAttribute('aria-checked'), + dash: selectAll.classList.contains('codicon-dash'), + rows: rows.map(checkbox => checkbox.getAttribute('aria-checked')), + }); + const pressSpace = () => { + focusElement(selectAll); + selectAll.dispatchEvent(new mainWindow.KeyboardEvent('keydown', { key: ' ', keyCode: 32, bubbles: true })); + }; + const states = [selection()]; + rows[0].click(); + states.push(selection()); + pressSpace(); + states.push(selection()); + rows[1].click(); + states.push(selection()); + selectAll.click(); + states.push(selection()); + pressSpace(); + states.push(selection()); - assert.deepStrictEqual({ - states, - focused: dom.getActiveElement() === selectAll, - outsideHeaders: container.querySelectorAll('.session-worktree-cleanup-summary-row [role="checkbox"]').length, - progressHeaderCheckboxes: container.querySelectorAll('.session-worktree-cleanup-progress .monaco-table-th [role="checkbox"]').length, - }, { - states: [ - { all: 'false', dash: false, rows: ['false', 'false'] }, - { all: 'mixed', dash: true, rows: ['true', 'false'] }, - { all: 'true', dash: false, rows: ['true', 'true'] }, - { all: 'mixed', dash: true, rows: ['true', 'false'] }, - { all: 'true', dash: false, rows: ['true', 'true'] }, - { all: 'false', dash: false, rows: ['false', 'false'] }, - ], - focused: true, - outsideHeaders: 0, - progressHeaderCheckboxes: 0, - }); + assert.deepStrictEqual({ + states, + focused: dom.getActiveElement() === selectAll, + outsideHeaders: container.querySelectorAll('.session-worktree-cleanup-summary-row [role="checkbox"]').length, + progressHeaderCheckboxes: container.querySelectorAll('.session-worktree-cleanup-progress .monaco-table-th [role="checkbox"]').length, + }, { + states: [ + { all: 'false', dash: false, rows: ['false', 'false'] }, + { all: 'mixed', dash: true, rows: ['true', 'false'] }, + { all: 'true', dash: false, rows: ['true', 'true'] }, + { all: 'mixed', dash: true, rows: ['true', 'false'] }, + { all: 'true', dash: false, rows: ['true', 'true'] }, + { all: 'false', dash: false, rows: ['false', 'false'] }, + ], + focused: true, + outsideHeaders: 0, + progressHeaderCheckboxes: 0, }); - } + }); - test('excludes non-agent branches from every cleanup table and selection', async () => { + test('excludes non-agent and failed branches from cleanup', async () => { const eligible = createUnlinkedWorktree('eligible'); const foreign = (['unknown', 'failed', 'inUse'] as const).map((state, index): ISessionWorktree => { const worktree = createUnlinkedWorktree(`foreign-${index}`); @@ -290,13 +655,14 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + selectAllWorktrees(container); container.querySelector('.session-worktree-cleanup-action')!.click(); await timeout(0); assert.deepStrictEqual({ titles: [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent), requests, - forceRows: container.querySelectorAll('.session-worktree-cleanup-unavailable .session-worktree-cleanup-row [role="checkbox"]').length, - }, { titles: ['agents/eligible'], requests: [[getWorktreeCleanupId(eligible)]], forceRows: 0 }); + selectableRows: container.querySelectorAll('.session-worktree-cleanup-row [role="checkbox"]').length, + }, { titles: ['agents/eligible'], requests: [[getWorktreeCleanupId(eligible)]], selectableRows: 1 }); }); test('does not resurrect a failed batch row after its branch becomes unsupported', async () => { @@ -315,6 +681,7 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + selectAllWorktrees(container); container.querySelector('.session-worktree-cleanup-action')!.click(); await timeout(0); const before = [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent); @@ -324,32 +691,7 @@ suite('SessionWorktreeCleanupEditor', () => { assert.deepStrictEqual({ before, after: [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent), batchHidden: container.querySelector('.session-worktree-cleanup-batch')?.classList.contains('hidden'), - }, { before: ['agents/eligible'], after: [], batchHidden: true }); - }); - - test('hides unlisted candidates while keeping listed failures force-selectable', async () => { - const stale: ISessionWorktree = { - ...createUnlinkedWorktree('stale'), - isListedByHost: false, - worktreeExists: undefined, - cleanupStatusError: 'This worktree is no longer listed by its host.', - }; - const failed: ISessionWorktree = { ...createUnlinkedWorktree('failed'), cleanupStatus: { state: 'failed' } }; - const requests: string[][] = []; - const { editor, container } = createEditor({ - getWorktrees: async () => [stale, { ...createUnlinkedWorktree('stale-existing'), isListedByHost: false, worktreeExists: true }, failed], - canForceCleanup: () => true, - forceCleanupWorktrees: async candidates => { requests.push(candidates.map(getWorktreeCleanupId)); return false; }, - }); - await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); - await timeout(0); - container.querySelector('.session-worktree-cleanup-unavailable .session-worktree-cleanup-select-all [role="checkbox"]')!.click(); - container.querySelector('.session-worktree-cleanup-force-remove')!.click(); - await timeout(0); - assert.deepStrictEqual({ - titles: [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent), - requests, - }, { titles: ['agents/failed'], requests: [[getWorktreeCleanupId(failed)]] }); + }, { before: [], after: [], batchHidden: true }); }); test('retains a verified unlinked cleanup result after it leaves the host inventory', () => runWithFakedTimers({ useFakeTimers: true }, async () => { @@ -362,125 +704,62 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + selectAllWorktrees(container); container.querySelector('.session-worktree-cleanup-action')!.click(); await timeout(2_100); - assert.deepStrictEqual([...container.querySelectorAll('.session-worktree-cleanup-progress .session-worktree-cleanup-row:not(.header)')].map(row => ({ - title: row.querySelector('.session-worktree-cleanup-session-link')?.textContent, - reason: row.querySelector('.session-worktree-cleanup-reason')?.textContent, - })), [{ title: 'agents/removed', reason: 'Worktree removed - /repos/app.worktrees/removed' }]); + assert.deepStrictEqual({ + rows: [...container.querySelectorAll('.session-worktree-cleanup-row:not(.header)')].map(row => ({ + title: row.querySelector('.session-worktree-cleanup-session-link')?.textContent, + reason: rowStatus(row), + path: row.querySelector('.session-worktree-cleanup-session-link')?.getAttribute('aria-description'), + storage: row.querySelector('.storage')?.textContent, + checkbox: row.querySelector('[role="checkbox"]'), + })) + }, { rows: [{ title: 'agents/removed', reason: 'Worktree removed', path: '/repos/app.worktrees/removed', storage: '0B', checkbox: null }] }); })); - test('does not resurrect a failed batch row after the host stops listing it, including later empty snapshots', async () => { - const worktree = createUnlinkedWorktree('eligible'); + test('live results preserve selection and show verified removals despite stale host errors without showing failures', () => runWithFakedTimers({ useFakeTimers: true }, async () => { + const completedSession = createWorktree('completed-session', '/repos/app', 'archived'); + const completedUnlinked = createUnlinkedWorktree('completed-unlinked'); + const failed: ISessionWorktree = { ...createUnlinkedWorktree('failed'), cleanupStatus: { state: 'failed', message: 'locked' } }; + const pending: ISessionWorktree = { ...createUnlinkedWorktree('pending'), cleanupStatus: { state: 'pending' } }; + const remaining = createWorktree('remaining', '/repos/app'); + let worktrees: readonly ISessionWorktree[] = [ + ...[completedSession, completedUnlinked].map(worktree => ({ ...worktree, cleanupStatus: { state: 'pending' as const } })), + failed, pending, remaining, + ]; let publish: ((worktrees: readonly ISessionWorktree[]) => void) | undefined; const { editor, container } = createEditor({ - getWorktrees: async (_age, onUpdate) => { publish = onUpdate; return [worktree]; }, - canForceCleanup: () => true, - cleanupWorktrees: async (candidates, onProgress) => { - onProgress?.({ state: 'started' }); - onProgress?.({ state: 'failed', candidate: candidates[0], message: 'not listed' }); - throw new Error('Scheduling failed'); - }, + getWorktrees: async (_age, onUpdate) => { publish = onUpdate; return worktrees; }, + refreshPendingCleanup: async () => worktrees, }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); - container.querySelector('.session-worktree-cleanup-action')!.click(); - await timeout(0); - const before = [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent); - publish?.([{ ...worktree, isListedByHost: false, worktreeExists: undefined }]); - await timeout(100); - publish?.([]); + selectAllWorktrees(container); + worktrees = [ + { ...removedWorktree(completedSession), cleanupStatus: { state: 'failed', message: 'old error' } }, + { ...removedWorktree(completedUnlinked), isListedByHost: false, cleanupStatusError: 'No longer listed' }, + failed, pending, remaining, + ]; + publish?.(worktrees); await timeout(100); - assert.deepStrictEqual({ - before, - after: [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent), - }, { before: ['agents/eligible'], after: [] }); - }); - - test('separates cleanup tables and scopes force selection to Needs attention', async () => { - const failed: ISessionWorktree = { ...createWorktree('failed', '/repos/app', 'archived'), cleanupStatus: { state: 'failed', message: 'permission denied' } }; - const deferred: ISessionWorktree = { ...createWorktree('deferred', '/repos/app', 'archived'), cleanupStatus: { state: 'skipped' } }; - const inUse: ISessionWorktree = { ...createUnlinkedWorktree('in-use'), cleanupStatus: { state: 'inUse' } }; - const requests: string[] = []; - const { editor, container } = createEditor({ - getWorktrees: async () => [ - { ...createWorktree('measuring', '/repos/app'), sizeBytes: undefined, isMeasuring: true }, - { ...createWorktree('pending', '/repos/app', 'archived'), cleanupStatus: { state: 'pending' } }, - createWorktree('available', '/repos/app'), - failed, - deferred, - inUse, - createWorktree('protected', '/repos/app', 'pinned'), - ], - canForceCleanup: worktree => worktree === failed || worktree === deferred || worktree === inUse, - forceCleanupWorktrees: async worktrees => { requests.push(...worktrees.map(getWorktreeCleanupId)); return false; }, - }); - await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); - await timeout(0); - const titles = (selector: string) => [...container.querySelectorAll(`${selector} .session-worktree-cleanup-session-link`)].map(link => link.textContent); - const button = container.querySelector('.session-worktree-cleanup-force-remove')!; - const section = container.querySelector('details')!; - const selectAll = section.querySelector('.session-worktree-cleanup-select-all [role="checkbox"]')!; - const initial = [...section.querySelectorAll('.session-worktree-cleanup-row [role="checkbox"]')].map(checkbox => checkbox.getAttribute('aria-checked')); - selectAll.click(); - selectAll.click(); - const deselected = button.getAttribute('aria-disabled'); - focusElement(selectAll); - selectAll.click(); - const selectionFocused = dom.getActiveElement() === selectAll; - button.click(); - await timeout(0); - assert.deepStrictEqual({ - tables: container.querySelectorAll('.monaco-table').length, - progress: titles('.session-worktree-cleanup-progress'), - available: titles('.session-worktree-cleanup-content > .session-worktree-cleanup-list'), - issues: titles('.session-worktree-cleanup-unavailable'), - initial, deselected, selectionFocused, - buttonLabel: button.textContent, - availableSelected: container.querySelector('.session-worktree-cleanup-content > .session-worktree-cleanup-list [role="checkbox"]')?.getAttribute('aria-checked'), - rowButtons: section.querySelectorAll('.session-worktree-cleanup-row .monaco-button').length, - forceSelected: selectAll.getAttribute('aria-checked'), - requests, - }, { - tables: 3, progress: ['measuring', 'pending'], available: ['available'], - issues: ['protected', 'failed', 'deferred', 'agents/in-use'], initial: ['false', 'false', 'false'], deselected: 'true', selectionFocused: true, - buttonLabel: 'Force Remove 3 Worktrees', availableSelected: 'true', rowButtons: 0, - forceSelected: 'true', requests: ['failed', 'deferred', getWorktreeCleanupId(inUse)], + const snapshot = () => ({ + titles: [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent).sort(), + selected: [...container.querySelectorAll('.session-worktree-cleanup-row [aria-checked="true"]')].length, + batch: container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent, }); - }); - - test('Needs attention Select All includes off-screen rows but excludes filtered and protected worktrees', async () => { - const failed = Array.from({ length: 60 }, (_, index): ISessionWorktree => ({ - ...createWorktree(`failed-${index}`, index < 40 ? '/repos/first' : '/repos/second', 'archived'), - cleanupStatus: { state: 'failed' }, - })); - const requests: string[][] = []; - const { editor, container } = createEditor({ - getWorktrees: async () => [...failed, createWorktree('protected', '/repos/first', 'pinned')], - canForceCleanup: worktree => worktree.cleanupStatus?.state === 'failed', - forceCleanupWorktrees: async worktrees => { requests.push(worktrees.map(getWorktreeCleanupId)); return false; }, + const completed = snapshot(); + publish?.(worktrees); + await timeout(100); + const batch = 'Cleanup: 2 of 3 worktrees removed, 1 pending.'; + assert.deepStrictEqual({ completed, refreshed: snapshot(), resultsControls: container.querySelectorAll('.session-worktree-cleanup-batch .monaco-button').length }, { + completed: { titles: ['agents/completed-unlinked', 'agents/pending', 'completed-session', 'remaining'], selected: 1, batch }, + refreshed: { titles: ['agents/completed-unlinked', 'agents/pending', 'completed-session', 'remaining'], selected: 1, batch }, + resultsControls: 0, }); - await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); - await timeout(0); - const workspace = container.querySelector('.session-worktree-cleanup-workspace')!; - workspace.value = URI.file('/repos/first').toString(); - workspace.dispatchEvent(new mainWindow.Event('change')); - const section = container.querySelector('details')!; - section.querySelector('.session-worktree-cleanup-select-all [role="checkbox"]')!.click(); - const button = section.querySelector('.session-worktree-cleanup-force-remove')!; - const label = button.textContent; - const rendered = section.querySelectorAll('.session-worktree-cleanup-row').length; - button.click(); - await timeout(0); - workspace.value = URI.file('/repos/second').toString(); - workspace.dispatchEvent(new mainWindow.Event('change')); - assert.deepStrictEqual({ - label, virtualized: rendered < 40, requests, - filteredSelection: container.querySelector('.session-worktree-cleanup-force-remove')?.getAttribute('aria-disabled'), - }, { label: 'Force Remove 40 Worktrees', virtualized: true, requests: [failed.slice(0, 40).map(getWorktreeCleanupId)], filteredSelection: 'true' }); - }); + })); - test('sorts by size or session recency without changing checkbox choices', async () => { + test('defaults to oldest first with nothing selected and preserves choices when sorting', async () => { const { container } = await openEditor([ { ...createWorktree('older-large', '/repos/app', 'eligible', 30), sizeBytes: 300 }, { ...createWorktree('newer-small', '/repos/app'), sizeBytes: 100 }, @@ -490,103 +769,105 @@ suite('SessionWorktreeCleanupEditor', () => { title: row.querySelector('a')?.textContent, checked: row.querySelector('[role="checkbox"]')?.getAttribute('aria-checked'), })); - container.querySelector('.session-worktree-cleanup-row [role="checkbox"]')!.click(); - const states = [rows()]; const sort = container.querySelector('.session-worktree-cleanup-sort')!; + const defaultSort = sort.value; + const states = [rows()]; + sort.value = 'size'; + sort.dispatchEvent(new mainWindow.Event('change')); + container.querySelector('.session-worktree-cleanup-row [role="checkbox"]')!.click(); + states.push(rows()); sort.value = 'recent'; sort.dispatchEvent(new mainWindow.Event('change')); states.push(rows()); sort.value = 'size'; sort.dispatchEvent(new mainWindow.Event('change')); states.push(rows()); - assert.deepStrictEqual(states, [ - [{ title: 'older-large', checked: 'false' }, { title: 'newer-small', checked: 'true' }, { title: 'agents/unknown-age', checked: 'true' }], - [{ title: 'newer-small', checked: 'true' }, { title: 'older-large', checked: 'false' }, { title: 'agents/unknown-age', checked: 'true' }], - [{ title: 'older-large', checked: 'false' }, { title: 'newer-small', checked: 'true' }, { title: 'agents/unknown-age', checked: 'true' }], - ]); + assert.deepStrictEqual({ defaultSort, states }, { + defaultSort: 'oldest', states: [ + [{ title: 'older-large', checked: 'false' }, { title: 'newer-small', checked: 'false' }, { title: 'agents/unknown-age', checked: 'false' }], + [{ title: 'older-large', checked: 'true' }, { title: 'newer-small', checked: 'false' }, { title: 'agents/unknown-age', checked: 'false' }], + [{ title: 'newer-small', checked: 'false' }, { title: 'older-large', checked: 'true' }, { title: 'agents/unknown-age', checked: 'false' }], + [{ title: 'older-large', checked: 'true' }, { title: 'newer-small', checked: 'false' }, { title: 'agents/unknown-age', checked: 'false' }], + ] + }); }); - test('moves measured worktrees from progress to available without rescanning', async () => { - const worktree = createWorktree('measuring', '/repos/app'); + test('sorts by status with removed worktrees last without rescanning', () => runWithFakedTimers({ useFakeTimers: true }, async () => { + const removedSession = createWorktree('removed-session', '/repos/app', 'archived'); + const removedUnlinked = createUnlinkedWorktree('removed-unlinked'); + const done = { ...createWorktree('done', '/repos/app', 'archived'), cleanupStatus: { state: 'unknown' as const } }; + let worktrees: readonly ISessionWorktree[] = [ + { ...createWorktree('small', '/repos/app'), sizeBytes: 100 }, + createUnlinkedWorktree('unmatched'), + { ...removedSession, cleanupStatus: { state: 'pending' } }, + { ...createWorktree('large', '/repos/app'), sizeBytes: 300 }, + { ...removedUnlinked, cleanupStatus: { state: 'pending' } }, + done, + { ...createWorktree('pending', '/repos/app', 'archived'), cleanupStatus: { state: 'pending' } }, + createWorktree('active', '/repos/app', 'active'), + createWorktree('needs-input', '/repos/app', 'needsInput'), + ]; let publish: ((worktrees: readonly ISessionWorktree[]) => void) | undefined; let scans = 0; const { editor, container } = createEditor({ - getWorktrees: async (_age, onUpdate) => { - scans++; - publish = onUpdate; - return [{ ...worktree, sizeBytes: undefined, isMeasuring: true }]; - }, + getWorktrees: async (_age, update) => { scans++; publish = update; return worktrees; }, + refreshPendingCleanup: async () => worktrees, }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); - const measuring = container.querySelector('.session-worktree-cleanup-progress .session-worktree-cleanup-session-link')?.textContent; - publish?.([worktree]); + worktrees = worktrees.map(worktree => getWorktreeCleanupId(worktree) === 'removed-session' || getWorktreeCleanupId(worktree) === getWorktreeCleanupId(removedUnlinked) + ? removedWorktree(worktree) : worktree); + publish?.(worktrees); await timeout(100); + const selectedIds = () => [...container.querySelectorAll('.session-worktree-cleanup-row')] + .filter(row => row.querySelector('[aria-checked="true"]')) + .map(row => row.querySelector('a')?.textContent).sort(); + const selectedBefore = selectedIds(); + const sort = container.querySelector('.session-worktree-cleanup-sort')!; + sort.value = 'status'; + sort.dispatchEvent(new mainWindow.Event('change')); assert.deepStrictEqual({ - measuring, scans, - progressHidden: container.querySelector('.session-worktree-cleanup-progress')?.classList.contains('hidden'), - available: container.querySelector('.session-worktree-cleanup-list .session-worktree-cleanup-session-link')?.textContent, - checked: container.querySelector('.session-worktree-cleanup-list [role="checkbox"]')?.getAttribute('aria-checked'), - }, { measuring: 'measuring', scans: 1, progressHidden: true, available: 'measuring', checked: 'true' }); - }); + scans, + titles: [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent), + doneStatus: [...container.querySelectorAll('.session-worktree-cleanup-row')].find(row => row.querySelector('a')?.textContent === 'done')?.querySelector('.status')?.textContent, + pendingStatus: [...container.querySelectorAll('.session-worktree-cleanup-row')].find(row => row.querySelector('a')?.textContent === 'pending')?.querySelector('.status')?.textContent, + accessibleDone: container.querySelector('.session-worktree-cleanup-row')?.parentElement?.getAttribute('aria-label')?.includes('Session marked as done'), + selected: selectedIds(), + }, { + scans: 1, + titles: ['done', 'pending', 'agents/unmatched', 'large', 'small', 'active', 'needs-input', 'removed-session', 'agents/removed-unlinked'], + doneStatus: 'Session marked as done: Worktree still exists. Select to retry cleanup.', + pendingStatus: 'Session marked as done: Cleanup scheduled…', + accessibleDone: true, + selected: selectedBefore, + }); + })); - test('supports keyboard force removal and moves failed attempts back to needs attention', async () => { - const failed: ISessionWorktree = { ...createWorktree('failed', '/repos/app', 'archived'), cleanupStatus: { state: 'failed' } }; - const removal = new DeferredPromise(); - const { editor, container, errors } = createEditor({ - getWorktrees: async () => [failed], - canForceCleanup: () => true, - forceCleanupWorktrees: async ([candidate], onProgress) => { - onProgress?.({ state: 'started' }); - await removal.p; - onProgress?.({ state: 'failed', candidate, message: 'permission denied' }); - throw new Error('permission denied'); + test('moves measured worktrees from progress to available without rescanning', async () => { + const worktree = createWorktree('measuring', '/repos/app'); + let publish: ((worktrees: readonly ISessionWorktree[]) => void) | undefined; + let scans = 0; + const { editor, container } = createEditor({ + getWorktrees: async (_age, onUpdate) => { + scans++; + publish = onUpdate; + return [{ ...worktree, sizeBytes: undefined, isMeasuring: true }]; }, }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); - const checkbox = container.querySelector('.session-worktree-cleanup-unavailable .session-worktree-cleanup-row [role="checkbox"]')!; - focusElement(checkbox); - checkbox.dispatchEvent(new mainWindow.KeyboardEvent('keydown', { key: ' ', keyCode: 32, bubbles: true })); - const button = container.querySelector('.session-worktree-cleanup-force-remove')!; - focusElement(button); - button.dispatchEvent(new mainWindow.KeyboardEvent('keydown', { key: 'Enter', keyCode: 13, bubbles: true })); - const during = { - progress: container.querySelector('.session-worktree-cleanup-progress .session-worktree-cleanup-session-link')?.textContent, - reason: container.querySelector('.session-worktree-cleanup-reason')?.textContent, - }; - await removal.complete(); - await timeout(0); - assert.deepStrictEqual({ - during, - issue: container.querySelector('.session-worktree-cleanup-unavailable .session-worktree-cleanup-session-link')?.textContent, - forceEnabled: container.querySelector('.session-worktree-cleanup-force-remove')?.getAttribute('aria-disabled'), - errors, - }, { during: { progress: 'failed', reason: 'Queued for cleanup…' }, issue: 'failed', forceEnabled: 'true', errors: ['permission denied'] }); - }); - - test('keeps an unlinked worktree unavailable when its existence check fails', async () => { - const { container } = await openEditor([{ - unlinkedWorktree: { providerId: 'test', repository: URI.file('/repos/app').toString(), worktree: URI.file('/repos/app.worktrees/unlinked').toString(), branch: 'agents/unlinked', cleanupStatus: { state: 'unknown' } }, - sizeBytes: undefined, worktreeCount: 1, cleanupState: 'unlinked', worktreeCheckError: 'Host disconnected', - }]); - const section = container.querySelector('details')!; - section.open = true; - section.dispatchEvent(new mainWindow.Event('toggle')); + const measuring = container.querySelector('.session-worktree-cleanup-session-link')?.textContent; + publish?.([worktree]); + await timeout(100); assert.deepStrictEqual({ - unavailable: section.querySelector('summary')?.textContent, - reason: section.querySelector('.session-worktree-cleanup-reason')?.textContent, - selectable: section.querySelectorAll('.session-worktree-cleanup-row [role="checkbox"]').length, - selectAllDisabled: section.querySelector('.monaco-table-th [role="checkbox"]')?.getAttribute('aria-disabled'), - }, { - unavailable: 'Needs attention (1)', - reason: 'Couldn\'t check whether the worktree still exists: Host disconnected - /repos/app.worktrees/unlinked', - selectable: 0, - selectAllDisabled: 'true', - }); + measuring, scans, + status: rowStatus(container), + available: container.querySelector('.session-worktree-cleanup-list .session-worktree-cleanup-session-link')?.textContent, + checked: container.querySelector('.session-worktree-cleanup-list [role="checkbox"]')?.getAttribute('aria-checked'), + }, { measuring: 'measuring', scans: 1, status: 'Has session', available: 'measuring', checked: 'false' }); }); - test('preselects an unlinked worktree that becomes available during cleanup refresh', () => runWithFakedTimers({ useFakeTimers: true }, async () => { + test('leaves a newly available unlinked worktree unchecked during cleanup refresh', () => runWithFakedTimers({ useFakeTimers: true }, async () => { const first = createWorktree('first', '/repos/app'); const unlinked = createUnlinkedWorktree('leftover'); let scheduled = false; @@ -601,10 +882,11 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + selectAllWorktrees(container); container.querySelector('.session-worktree-cleanup-action')!.click(); await timeout(0); const row = [...container.querySelectorAll('.session-worktree-cleanup-row')].find(row => row.querySelector('a')?.textContent === 'agents/leftover')!; - assert.strictEqual(row.querySelector('[role="checkbox"]')?.getAttribute('aria-checked'), 'true'); + assert.strictEqual(row.querySelector('[role="checkbox"]')?.getAttribute('aria-checked'), 'false'); })); for (const selection of ['row', 'select all'] as const) { @@ -677,70 +959,11 @@ suite('SessionWorktreeCleanupEditor', () => { container.querySelector('.session-worktree-cleanup-action')!.click(); await timeout(0); assert.deepStrictEqual({ states, cleaned }, { - states: ['true', 'false', 'true'], + states: ['false', 'false', 'true'], cleaned: [[getWorktreeCleanupId(unlinked)]], }); }); - test('keeps archived cleanup failures in Needs attention without normal cleanup selection', async () => { - const unlinked: ISessionWorktree = { - unlinkedWorktree: { providerId: 'test', repository: URI.file('/repos/app').toString(), worktree: URI.file('/repos/app.worktrees/unlinked').toString(), branch: 'agents/unlinked', cleanupStatus: { state: 'failed', message: 'git add exited with code 128' } }, - sizeBytes: undefined, worktreeCount: 1, cleanupState: 'unlinked', cleanupStatus: { state: 'failed', message: 'git add exited with code 128' }, worktreeExists: true, - }; - const { container, cleaned } = await openEditor([ - { ...createWorktree('blocked', '/repos/app', 'archived'), cleanupStatus: { state: 'failed', message: 'git add exited with code 128: remove the file manually to continue.' } }, - { ...createWorktree('retryable', '/repos/app', 'archived'), cleanupStatus: { state: 'failed', message: 'git timed out' } }, - unlinked, - ]); - const section = container.querySelector('details')!; - section.open = true; - section.dispatchEvent(new mainWindow.Event('toggle')); - assert.deepStrictEqual({ - unavailable: section.querySelector('summary')?.textContent, - titles: [...section.querySelectorAll('.session-worktree-cleanup-session-link')].map(element => element.textContent), - reason: section.querySelector('.session-worktree-cleanup-reason')?.textContent, - selectable: section.querySelectorAll('.session-worktree-cleanup-row [role="checkbox"]').length, - selectAllDisabled: section.querySelector('.monaco-table-th [role="checkbox"]')?.getAttribute('aria-disabled'), - sessionlessReason: [...container.querySelectorAll('.session-worktree-cleanup-reason')].some(element => element.textContent?.startsWith('Cleanup failed; retry scheduled: git add exited with code 128')), - }, { - unavailable: 'Needs attention (1)', - titles: ['retryable'], - reason: 'Cleanup failed; retry scheduled: git timed out', - selectable: 0, - selectAllDisabled: 'true', - sessionlessReason: false, - }); - container.querySelector('.session-worktree-cleanup-action')!.click(); - await timeout(0); - assert.deepStrictEqual(cleaned, []); - }); - - test('hides a git-add exit-128 failure detected after scheduling cleanup', () => runWithFakedTimers({ useFakeTimers: true }, async () => { - const worktree = { ...createWorktree('blocked', '/repos/app', 'archived'), cleanupStatus: { state: 'unknown' as const } }; - const failed = { ...worktree, cleanupStatus: { state: 'failed' as const, message: 'git add exited with code 128' } }; - const { editor, container } = createEditor({ - getWorktrees: async () => [worktree], - cleanupWorktrees: async (candidates, onProgress) => scheduleCleanup(candidates, onProgress), - refreshPendingCleanup: async () => [failed], - }); - await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); - await timeout(0); - container.querySelector('.session-worktree-cleanup-action')!.click(); - await timeout(2_100); - const section = container.querySelector('details')!; - section.open = true; - section.dispatchEvent(new mainWindow.Event('toggle')); - assert.deepStrictEqual({ - unavailable: section.querySelector('summary')?.textContent, - reason: section.querySelector('.session-worktree-cleanup-reason')?.textContent, - retryDisabled: container.querySelector('.session-worktree-cleanup-retry')?.getAttribute('aria-disabled'), - }, { - unavailable: 'Needs attention (0)', - reason: undefined, - retryDisabled: 'true', - }); - })); - test('finishes opening before worktree sessions load and then updates the results', async () => { const worktrees = new DeferredPromise(); const { editor, container } = createEditor({ getWorktrees: () => worktrees.p }); @@ -751,12 +974,12 @@ suite('SessionWorktreeCleanupEditor', () => { await timeout(0); assert.deepStrictEqual({ opened, - heading: container.querySelector('h2')?.textContent, + heading: container.querySelector('details > summary')?.textContent, loading: container.querySelector('.session-worktree-cleanup-summary')?.textContent, pickerDisabled: container.querySelector('select')?.disabled, }, { opened: true, - heading: 'Cleanup Settings', + heading: 'Automatic Cleanup', loading: 'Measuring worktree storage...', pickerDisabled: true, }); @@ -787,10 +1010,12 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + sortWorktrees(container, 'size'); + selectAllWorktrees(container); const rows = () => [...container.querySelectorAll('.session-worktree-cleanup-row:not(.header)')]; try { assert.deepStrictEqual(rows().map(row => ({ - storage: row.lastElementChild?.textContent, + storage: row.querySelector('.storage')?.textContent, disabled: row.querySelector('[role="checkbox"]')?.getAttribute('aria-disabled'), })), [ { storage: '100B', disabled: null }, @@ -798,20 +1023,19 @@ suite('SessionWorktreeCleanupEditor', () => { ]); const initialRows = rows(); initialRows[0].querySelector('[role="checkbox"]')!.click(); - container.querySelector('details')!.open = true; focusElement(initialRows[1].querySelector('a')!); publish?.([first, measuredSecond]); await timeout(100); assert.deepStrictEqual({ reordered: rows().map(row => row.querySelector('a')?.textContent), focused: mainWindow.document.activeElement?.textContent, - storage: rows().map(row => row.lastElementChild?.textContent), + storage: rows().map(row => row.querySelector('.storage')?.textContent), checked: rows().map(row => row.querySelector('[role="checkbox"]')?.getAttribute('aria-checked')), }, { reordered: ['second', 'first'], focused: 'second', storage: ['200B', '100B'], - checked: ['true', 'false'], + checked: ['false', 'false'], }); } finally { await finished.complete([first, measuredSecond]); @@ -838,7 +1062,7 @@ suite('SessionWorktreeCleanupEditor', () => { } assert.strictEqual(container.querySelector('.session-worktree-cleanup-session-link'), initialRow); await timeout(100); - assert.strictEqual(container.querySelector('.session-worktree-cleanup-row:not(.header)')?.lastElementChild?.textContent, '100B'); + assert.strictEqual(container.querySelector('.session-worktree-cleanup-row:not(.header) .storage')?.textContent, '100B'); editor.clearInput(); assert.strictEqual(scanToken.isCancellationRequested, true); await finished.complete([worktree]); @@ -875,7 +1099,7 @@ suite('SessionWorktreeCleanupEditor', () => { const firstChecked = container.querySelector('.session-worktree-cleanup-row:not(.header) [role="checkbox"]')?.getAttribute('aria-checked'); let peakRows = initialCount; for (const index of [500, 1000, 1500, 0]) { - list.scrollTop = index * 44; + list.scrollTop = index * 60; peakRows = Math.max(peakRows, renderedCount()); } container.querySelector('.session-worktree-cleanup-select-all [role="checkbox"]')!.click(); @@ -901,8 +1125,8 @@ suite('SessionWorktreeCleanupEditor', () => { measurements: 1, position: '2000', total: '2000', - firstChecked: 'false', - lastChecked: 'false', + firstChecked: 'true', + lastChecked: 'true', opened: ['test:/worktree-1999'], requests: [ { count: 2000, first: 'worktree-0', last: 'worktree-1999' }, @@ -934,7 +1158,7 @@ suite('SessionWorktreeCleanupEditor', () => { await timeout(100); const visibleUpdate = { changes: records.length, - onlyStorageChanged: records.every(record => record.target === first.lastElementChild), + onlyStorageChanged: records.every(record => record.target === first.querySelector('.storage')), sameHeader: table.querySelector('.monaco-table-th') === header, sameLink: first.querySelector('a') === firstLink, }; @@ -946,12 +1170,12 @@ suite('SessionWorktreeCleanupEditor', () => { focusElement(table.querySelector('.monaco-list')!); const list = instantiationService.get(IListService).lastFocusedList; assert.ok(list instanceof WorkbenchTable); - list.reveal(999); + list.reveal(900); const last = [...table.querySelectorAll('.session-worktree-cleanup-row:not(.header)')].find(row => row.querySelector('a')?.textContent === 'worktree-900'); assert.deepStrictEqual({ visibleUpdate, offscreenChanges, - scrolledStorage: last?.lastElementChild?.textContent, + scrolledStorage: last?.querySelector('.storage')?.textContent, }, { visibleUpdate: { changes: 1, onlyStorageChanged: true, sameHeader: true, sameLink: true }, offscreenChanges: 0, @@ -963,28 +1187,6 @@ suite('SessionWorktreeCleanupEditor', () => { } })); - test('virtualizes protected worktrees without making them selectable', async () => { - const { editor, container } = await openEditor(Array.from({ length: 2000 }, (_, index) => createWorktree(`pinned-${index}`, '/repos/app', 'pinned'))); - editor.layout(new dom.Dimension(480, 600)); - const section = container.querySelector('details')!; - section.open = true; - section.dispatchEvent(new mainWindow.Event('toggle')); - const count = section.querySelectorAll('.session-worktree-cleanup-row:not(.header)').length; - assert.deepStrictEqual({ - bounded: count > 0 && count <= 20, - summary: section.querySelector('summary')?.textContent, - selectable: section.querySelectorAll('.session-worktree-cleanup-row [role="checkbox"]').length, - selectAllDisabled: section.querySelector('.monaco-table-th [role="checkbox"]')?.getAttribute('aria-disabled'), - cleanupDisabled: container.querySelector('.session-worktree-cleanup-action')?.getAttribute('aria-disabled'), - }, { - bounded: true, - summary: 'Needs attention (2000)', - selectable: 0, - selectAllDisabled: 'true', - cleanupDisabled: 'true', - }); - }); - test('uses native table columns that stay aligned after resizing and horizontal scrolling', async () => { const { editor, container, instantiationService } = createEditor({ getWorktrees: async () => [createWorktree('first', '/repos/app'), createWorktree('second', '/repos/app')], @@ -997,8 +1199,9 @@ suite('SessionWorktreeCleanupEditor', () => { assert.ok(table instanceof WorkbenchTable); const tableNode = table.getHTMLElement(); const headers = [...tableNode.querySelectorAll('.monaco-table-th')]; - const cells = [...tableNode.querySelectorAll('.session-worktree-cleanup-row:first-child .monaco-table-td')].slice(0, 5); - const aligned = () => headers.length === 5 && cells.length === 5 && headers.every((header, index) => { + const row = tableNode.querySelector('.session-worktree-cleanup-row')!; + const cells = [...row.querySelectorAll('.monaco-table-td')]; + const aligned = () => headers.length === 6 && cells.length === 6 && headers.every((header, index) => { const heading = header.getBoundingClientRect(); const cell = cells[index].getBoundingClientRect(); return heading.width > 0 && Math.abs(heading.width - cell.width) < 1 && Math.abs(heading.left - cell.left) < 1; @@ -1023,7 +1226,7 @@ suite('SessionWorktreeCleanupEditor', () => { narrow, wideAligned: aligned(), }, { - columns: ['', 'Session', 'Workspace', 'Last Used', 'Disk Usage'], + columns: ['', 'Session', 'Workspace', 'Last Session Activity', 'Disk Usage', 'Status'], resized: true, narrow: { overflows: true, scrolled: true, aligned: true, sameCell: true }, wideAligned: true, @@ -1036,6 +1239,7 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + selectAllWorktrees(container); const listNode = container.querySelector('.monaco-list')!; focusElement(listNode); const table = instantiationService.get(IListService).lastFocusedList; @@ -1063,7 +1267,7 @@ suite('SessionWorktreeCleanupEditor', () => { initialFocus, focusedRow: table.getFocusedElements(), activeDescendant: listNode.getAttribute('aria-activedescendant') === rowNode.id, - label: rowNode.getAttribute('aria-label')?.match(/second, workspace app, last used .+, disk usage 100B\. .*Selected for cleanup\./)?.length === 1, + label: rowNode.getAttribute('aria-label')?.match(/second, worktree path .+, workspace app, last used .+, disk usage 100B\. .*Selected for cleanup\./)?.length === 1, position: rowNode.getAttribute('aria-posinset'), total: rowNode.getAttribute('aria-setsize'), unchecked, @@ -1091,15 +1295,12 @@ suite('SessionWorktreeCleanupEditor', () => { const { editor, container, instantiationService } = createEditor({ getWorktrees: async () => [ createWorktree('available', '/repos/app', 'active'), - { ...createWorktree('failed', '/repos/app', 'archived'), cleanupStatus: { state: 'failed' } }, ], - canForceCleanup: worktree => worktree.cleanupStatus?.state === 'failed', }, contextKeyService); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); const tables = [ container.querySelector('.session-worktree-cleanup-content > .session-worktree-cleanup-list')!, - container.querySelector('.session-worktree-cleanup-unavailable-list')!, ]; const navigationRules = KeybindingsRegistry.getDefaultKeybindings().filter(rule => rule.command !== null && ['list.focusDown', 'list.focusUp', 'list.focusPageDown', 'list.focusPageUp', 'list.focusFirst', 'list.focusLast'].includes(rule.command) @@ -1107,8 +1308,8 @@ suite('SessionWorktreeCleanupEditor', () => { assert.ok(navigationRules.length > 0); const navigationEnabled = (element: HTMLElement) => navigationRules.some(rule => rule.when!.evaluate(contextKeyService.getContext(element))); const states = []; - for (const [index, table] of tables.entries()) { - const previousList = tables[1 - index].querySelector('.monaco-list')!; + for (const table of tables) { + const previousList = table.querySelector('.monaco-list')!; focusElement(previousList); const lastFocusedList = instantiationService.get(IListService).lastFocusedList; const checkbox = table.querySelector('.monaco-table-th [role="checkbox"]')!; @@ -1124,11 +1325,10 @@ suite('SessionWorktreeCleanupEditor', () => { } assert.deepStrictEqual(states, [ { bodyNavigation: true, headerNavigation: false, headerFocused: true, previousListUnchanged: true, selected: 'true' }, - { bodyNavigation: true, headerNavigation: false, headerFocused: true, previousListUnchanged: true, selected: 'true' }, ]); }); - test('preserves logical table focus through reordering and moves to the unavailable table', () => runWithFakedTimers({ useFakeTimers: true }, async () => { + test('preserves table focus through reordering and moves to an actionable row when the focused row becomes protected', () => runWithFakedTimers({ useFakeTimers: true }, async () => { const first = createWorktree('first', '/repos/app'); const second = createWorktree('second', '/repos/app'); const finished = new DeferredPromise(); @@ -1137,6 +1337,7 @@ suite('SessionWorktreeCleanupEditor', () => { getWorktrees: async (_age, onUpdate) => { publish = onUpdate; onUpdate?.([first, second]); return finished.p; }, }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); + sortWorktrees(container, 'size'); const listNode = container.querySelector('.monaco-list')!; focusElement(listNode); const table = instantiationService.get(IListService).lastFocusedList; @@ -1151,32 +1352,31 @@ suite('SessionWorktreeCleanupEditor', () => { }; publish?.([{ ...first, cleanupState: 'pinned' }, second]); await timeout(100); - const unavailable = container.querySelector('details')!; - const unavailableList = unavailable.querySelector('.monaco-list')!; - const row = unavailable.querySelector('.session-worktree-cleanup-row')!; + const unavailableList = listNode; + const row = [...container.querySelectorAll('.session-worktree-cleanup-row')].find(row => row.querySelector('a')?.textContent === 'second')!; const moved = { - expanded: unavailable.open, + sameTable: container.querySelectorAll('.monaco-table').length === 1, focused: dom.getActiveElement() === unavailableList, activeDescendant: unavailableList.getAttribute('aria-activedescendant') === row.parentElement?.id, - explanation: row.parentElement?.getAttribute('aria-label')?.includes('Pinned'), + titles: [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent), }; unavailableList.dispatchEvent(new mainWindow.KeyboardEvent('keydown', { key: ' ', keyCode: 32, bubbles: true })); unavailableList.dispatchEvent(new mainWindow.KeyboardEvent('keydown', { key: 'Tab', keyCode: 9, bubbles: true, cancelable: true })); const link = row.querySelector('a')!; - const tabFocus = dom.getActiveElement() === link; + const tabFocus = dom.getActiveElement() === row.querySelector('[role="checkbox"]'); link.dispatchEvent(new mainWindow.KeyboardEvent('keydown', { key: 'Enter', keyCode: 13, bubbles: true })); assert.deepStrictEqual({ reordered, moved, - checkbox: row.querySelector('[role="checkbox"]'), + checkbox: !!row.querySelector('[role="checkbox"]'), tabFocus, opened, }, { reordered: { focused: true, session: ['first'], index: [1] }, - moved: { expanded: true, focused: true, activeDescendant: true, explanation: true }, - checkbox: null, + moved: { sameTable: true, focused: true, activeDescendant: true, titles: ['second'] }, + checkbox: true, tabFocus: true, - opened: ['test:/first'], + opened: ['test:/second'], }); } finally { await finished.complete([{ ...first, cleanupState: 'pinned' }, second]); @@ -1198,14 +1398,16 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + selectAllWorktrees(container); const listNode = container.querySelector('.monaco-list')!; focusElement(listNode); container.querySelector('.session-worktree-cleanup-action')!.click(); const row = container.querySelector('.session-worktree-cleanup-row')!; - const progressListNode = container.querySelector('.session-worktree-cleanup-progress .monaco-list')!; + const progressListNode = listNode; const queued = { busy: row.getAttribute('aria-busy'), checkbox: row.querySelector('[role="checkbox"]'), spinning: !!row.querySelector('.codicon-loading.codicon-modifier-spin') }; await scheduling.complete(); await timeout(100); + focusElement(progressListNode); progressListNode.dispatchEvent(new mainWindow.KeyboardEvent('keydown', { key: ' ', keyCode: 32, bubbles: true })); const retainedFocus = dom.getActiveElement() === progressListNode; progressListNode.dispatchEvent(new mainWindow.KeyboardEvent('keydown', { key: 'Tab', keyCode: 9, bubbles: true, cancelable: true })); @@ -1282,18 +1484,6 @@ suite('SessionWorktreeCleanupEditor', () => { }); })); - test('keeps calculating rows visible and moves failed measurements to needs attention', async () => { - const { container } = await openEditor([ - createWorktree('unavailable', '/repos/app', 'unavailable'), - { ...createWorktree('failed', '/repos/app', 'unavailable'), measurementFailed: true }, - { ...createWorktree('pending', '/repos/app', 'unavailable'), isMeasuring: true }, - ]); - assert.deepStrictEqual([...container.querySelectorAll('.session-worktree-cleanup-row:not(.header)')].map(row => ({ - title: row.querySelector('a')?.textContent, - storage: row.lastElementChild?.textContent, - })), [{ title: 'pending', storage: 'Calculating…' }, { title: 'failed', storage: 'Unknown' }]); - }); - test('requests fresh measurements on opening without a refresh button', async () => { const calls: string[] = []; const { editor, container } = createEditor({ @@ -1308,7 +1498,7 @@ suite('SessionWorktreeCleanupEditor', () => { }, { calls: ['fresh load'], buttons: [] }); }); - test('retains verified removed rows, session links, and focus after pending cleanup ends', () => runWithFakedTimers({ useFakeTimers: true }, async () => { + test('updates cleanup rows in place through confirmed removal while preserving session links and focus', () => runWithFakedTimers({ useFakeTimers: true }, async () => { const first = createWorktree('first', '/repos/app'); const second = createWorktree('second', '/repos/app'); const existing = createWorktree('existing', '/repos/app', 'archived'); @@ -1321,6 +1511,7 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + selectAllWorktrees(container); container.querySelector('.session-worktree-cleanup-action')!.click(); await timeout(0); const initialRows = [...container.querySelectorAll('.session-worktree-cleanup-row:not(.header)')]; @@ -1328,13 +1519,13 @@ suite('SessionWorktreeCleanupEditor', () => { focusElement(firstLink); assert.deepStrictEqual([...container.querySelectorAll('.session-worktree-cleanup-row:not(.header)')].map(row => ({ title: row.querySelector('a')?.textContent, - progress: row.querySelector('.session-worktree-cleanup-reason')?.textContent, - })), [{ title: 'first', progress: 'Cleanup scheduled…' }, { title: 'second', progress: 'Cleanup scheduled…' }, { title: 'existing', progress: 'Done' }]); + progress: rowStatus(row), + })), [{ title: 'first', progress: 'Cleanup scheduled…' }, { title: 'second', progress: 'Cleanup scheduled…' }]); await timeout(2_100); assert.deepStrictEqual({ checked, rows: [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent), - }, { checked: [['first', 'second']], rows: ['first', 'second', 'existing'] }); + }, { checked: [['first', 'second']], rows: ['first', 'second'] }); await timeout(4_100); firstLink.click(); assert.deepStrictEqual({ @@ -1342,8 +1533,8 @@ suite('SessionWorktreeCleanupEditor', () => { rows: [...container.querySelectorAll('.session-worktree-cleanup-row:not(.header)')].map((row, index) => ({ sameRow: row === initialRows[index], title: row.querySelector('a')?.textContent, - reason: row.querySelector('a')?.getAttribute('aria-description'), - storage: row.lastElementChild?.textContent, + reason: rowStatus(row), + storage: row.querySelector('.storage')?.textContent, selectable: !!row.querySelector('[role="checkbox"]'), busy: row.hasAttribute('aria-busy'), })), @@ -1355,7 +1546,6 @@ suite('SessionWorktreeCleanupEditor', () => { rows: [ { sameRow: true, title: 'first', reason: 'Worktree removed', storage: '0B', selectable: false, busy: false }, { sameRow: true, title: 'second', reason: 'Worktree removed', storage: '0B', selectable: false, busy: false }, - { sameRow: true, title: 'existing', reason: 'Done', storage: '—', selectable: false, busy: false }, ], focused: true, opened: ['test:/first'], @@ -1363,7 +1553,7 @@ suite('SessionWorktreeCleanupEditor', () => { }); })); - test('retains completed workspace filters until reopening and keeps archived cleanup failures in Needs attention', () => runWithFakedTimers({ useFakeTimers: true }, async () => { + test('retains completed workspace filters until reopening without showing archived cleanup failures', () => runWithFakedTimers({ useFakeTimers: true }, async () => { const first = createWorktree('first', '/repos/app'); const failed: ISessionWorktree = { ...createWorktree('old-timeout', '/other/app', 'archived'), cleanupStatus: { state: 'failed', message: 'git timed out' } }; let scheduled = false; @@ -1393,12 +1583,12 @@ suite('SessionWorktreeCleanupEditor', () => { const completed = { workspace: picker.value, rows: [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent), - reason: container.querySelector('.session-worktree-cleanup-reason')?.textContent, + reason: rowStatus(container), }; selectWorkspace('/other/app'); - const failure = container.querySelector('.session-worktree-cleanup-reason')?.textContent; + const failure = rowStatus(container); selectWorkspace('/repos/app'); - const restoredFilter = container.querySelector('.session-worktree-cleanup-reason')?.textContent; + const restoredFilter = rowStatus(container); editor.clearInput(); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); @@ -1410,7 +1600,7 @@ suite('SessionWorktreeCleanupEditor', () => { restoredFilter, reopened: [...container.querySelectorAll('.session-worktree-cleanup-row:not(.header)')].map(row => ({ title: row.querySelector('a')?.textContent, - reason: row.querySelector('.session-worktree-cleanup-reason')?.textContent, + reason: rowStatus(row), disabled: row.querySelector('[role="checkbox"]')?.getAttribute('aria-disabled'), checked: row.querySelector('[role="checkbox"]')?.getAttribute('aria-checked'), })), @@ -1418,9 +1608,9 @@ suite('SessionWorktreeCleanupEditor', () => { requests: [['first']], checked: [['first']], completed: { workspace: URI.file('/repos/app').toString(), rows: ['first'], reason: 'Worktree removed' }, - failure: 'Cleanup failed; retry scheduled: git timed out', + failure: undefined, restoredFilter: 'Worktree removed', - reopened: [{ title: 'old-timeout', reason: 'Cleanup failed; retry scheduled: git timed out', disabled: undefined, checked: undefined }], + reopened: [], }); })); @@ -1441,6 +1631,7 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + selectAllWorktrees(container); container.querySelector('.session-worktree-cleanup-action')!.click(); await timeout(2_100); const rowsAfterShrink = [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent); @@ -1449,12 +1640,12 @@ suite('SessionWorktreeCleanupEditor', () => { rowsAfterShrink, rowsAfterRemoval: [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent), }, { - rowsAfterShrink: ['first', 'second', 'existing'], - rowsAfterRemoval: ['first', 'second', 'existing'], + rowsAfterShrink: ['first', 'second'], + rowsAfterRemoval: ['first', 'second'], }); })); - test('limits existence polling and reports unverified removal when the host has no cleanup status support', () => runWithFakedTimers({ useFakeTimers: true }, async () => { + test('limits existence polling without claiming removal when the host has no cleanup status support', () => runWithFakedTimers({ useFakeTimers: true }, async () => { const worktree = createWorktree('first', '/repos/app'); let archived = false; let checks = 0; @@ -1465,13 +1656,14 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + selectAllWorktrees(container); container.querySelector('.session-worktree-cleanup-action')!.click(); await timeout(30_001); assert.deepStrictEqual({ checks, spinning: !!container.querySelector('.codicon-loading.codicon-modifier-spin'), - reason: container.querySelector('.session-worktree-cleanup-reason')?.textContent, - }, { checks: 3, spinning: false, reason: 'Couldn\'t verify whether the worktree still exists.' }); + reason: rowStatus(container), + }, { checks: 3, spinning: false, reason: undefined }); })); for (const cleanupStatus of [undefined, { state: 'unknown' as const }]) { @@ -1486,28 +1678,24 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + selectAllWorktrees(container); container.querySelector('.session-worktree-cleanup-action')!.click(); await timeout(0); const row = container.querySelector('.session-worktree-cleanup-row')!; const pending = { - reason: row.querySelector('.session-worktree-cleanup-reason')?.textContent, - accessibleReason: row.querySelector('a')?.getAttribute('aria-description'), + reason: rowStatus(row), + accessibleReason: row.parentElement?.getAttribute('aria-label')?.includes('Waiting for cleanup…'), busy: row.getAttribute('aria-busy'), spinning: !!row.querySelector('.codicon-loading.codicon-modifier-spin'), selectable: !!row.querySelector('[role="checkbox"]'), }; await timeout(30_001); - const finishedRow = container.querySelector('.session-worktree-cleanup-row')!; assert.deepStrictEqual({ pending, - finished: { - busy: finishedRow.getAttribute('aria-busy'), - spinning: !!finishedRow.querySelector('.codicon-loading.codicon-modifier-spin'), - selectable: !!finishedRow.querySelector('[role="checkbox"]'), - }, + finishedRows: container.querySelectorAll('.session-worktree-cleanup-row').length, }, { - pending: { reason: 'Waiting for cleanup…', accessibleReason: 'Waiting for cleanup…', busy: 'true', spinning: true, selectable: false }, - finished: { busy: null, spinning: false, selectable: false }, + pending: { reason: 'Waiting for cleanup…', accessibleReason: true, busy: 'true', spinning: true, selectable: false }, + finishedRows: 0, }); })); } @@ -1538,6 +1726,7 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + selectAllWorktrees(container); const rows = () => [...container.querySelectorAll('.session-worktree-cleanup-row:not(.header)')]; const remainingRow = rows()[2]; remainingRow.querySelector('[role="checkbox"]')!.click(); @@ -1547,14 +1736,14 @@ suite('SessionWorktreeCleanupEditor', () => { const queued = { requests, disabled: cleanup.getAttribute('aria-disabled'), - reasons: rows().map(row => row.querySelector('.session-worktree-cleanup-reason')?.textContent), + reasons: rows().map(row => rowStatus(row)), summary: container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent, }; await finished.complete(); await timeout(0); const afterScheduling = { - sameRemainingRow: rows()[0] === remainingRow, - checked: rows()[0].querySelector('[role="checkbox"]')?.getAttribute('aria-checked'), + sameRemainingRow: rows().find(row => row.querySelector('a')?.textContent === 'remaining') === remainingRow, + checked: remainingRow.querySelector('[role="checkbox"]')?.getAttribute('aria-checked'), }; await timeout(2_100); const partial = container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent; @@ -1564,19 +1753,19 @@ suite('SessionWorktreeCleanupEditor', () => { afterScheduling, partial, complete: container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent, - remaining: rows().map(row => row.querySelector('a')?.textContent), - checked: rows()[0].querySelector('[role="checkbox"]')?.getAttribute('aria-checked'), + rows: rows().map(row => row.querySelector('a')?.textContent), + checked: remainingRow.querySelector('[role="checkbox"]')?.getAttribute('aria-checked'), }, { queued: { requests: 1, disabled: 'true', - reasons: [undefined, 'Queued for cleanup…', 'Queued for cleanup…'], - summary: 'Cleanup: 0 of 3 worktrees removed, 3 pending, 0 failed, 0 need attention.', + reasons: ['Queued for cleanup…', 'Queued for cleanup…', 'Has session'], + summary: 'Cleanup: 0 of 3 worktrees removed, 3 pending.', }, afterScheduling: { sameRemainingRow: true, checked: 'false' }, - partial: 'Cleanup: 2 of 3 worktrees removed, 1 pending, 0 failed, 0 need attention.', - complete: 'Cleanup complete: 3 worktrees removed.', - remaining: ['remaining', 'first', 'second'], + partial: 'Cleanup: 2 of 3 worktrees removed, 1 pending.', + complete: 'Cleanup: 3 worktrees removed.', + rows: ['first', 'second', 'remaining'], checked: 'false', }); })); @@ -1590,6 +1779,7 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + selectAllWorktrees(container); const cleanup = container.querySelector('.session-worktree-cleanup-action')!; cleanup.click(); cleanup.click(); @@ -1622,6 +1812,7 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + selectAllWorktrees(container); /* eslint-disable local/code-no-bracket-notation-for-identifiers -- Count actual renders without exposing a test-only API. */ const originalRenderRows = editor['renderRows']; const renderRows = spy(originalRenderRows); @@ -1629,13 +1820,13 @@ suite('SessionWorktreeCleanupEditor', () => { disposables.add(toDisposable(() => { editor['renderRows'] = originalRenderRows; })); /* eslint-enable local/code-no-bracket-notation-for-identifiers */ container.querySelector('.session-worktree-cleanup-action')!.click(); - const queued = container.querySelector('.session-worktree-cleanup-reason')?.textContent; + const queued = rowStatus(container); const renderCounts = [renderRows.callCount]; await timeout(99); renderCounts.push(renderRows.callCount); await timeout(1); renderCounts.push(renderRows.callCount); - const intervalFlushed = container.querySelector('.session-worktree-cleanup-reason')?.textContent !== queued; + const intervalFlushed = rowStatus(container) !== queued; await scheduling.complete(); await timeout(0); renderCounts.push(renderRows.callCount); @@ -1649,7 +1840,7 @@ suite('SessionWorktreeCleanupEditor', () => { queued: 'Queued for cleanup…', renderCounts: [1, 1, 2, 3], intervalFlushed: true, - summary: 'Cleanup: 0 of 50 worktrees removed, 49 pending, 1 failed, 0 need attention.', + summary: 'Cleanup: 0 of 49 worktrees removed, 49 pending.', }); } finally { editor.clearInput(); @@ -1676,6 +1867,7 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + selectAllWorktrees(container); container.querySelector('.session-worktree-cleanup-action')!.click(); await timeout(31_001); const pending = container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent; @@ -1685,188 +1877,9 @@ suite('SessionWorktreeCleanupEditor', () => { checked, summary: container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent, }, { - pending: 'Cleanup: 0 of 2 worktrees removed, 2 pending, 0 failed, 0 need attention.', + pending: 'Cleanup: 0 of 2 worktrees removed, 2 pending.', checked: [['first', 'second']], - summary: 'Cleanup complete: 2 worktrees removed.', - }); - })); - - test('reconciles partial scheduling failures and retries only failed rows without losing completed counts', () => runWithFakedTimers({ useFakeTimers: true }, async () => { - const first = createWorktree('first', '/repos/app'); - const second = createWorktree('second', '/repos/app'); - const remaining = createWorktree('remaining', '/repos/app'); - const requests: string[][] = []; - let firstRemoved = false; - let secondRemoved = false; - const getWorktrees = (): ISessionWorktree[] => [ - firstRemoved ? removedWorktree(first) : requests.length ? { ...first, cleanupState: 'archived' } : first, - secondRemoved ? removedWorktree(second) : requests.length > 1 ? { ...second, cleanupState: 'archived' } : second, - remaining, - ]; - const { editor, container, errors } = createEditor({ - getWorktrees: async () => getWorktrees(), - cleanupWorktrees: async (candidates, onProgress) => { - requests.push(candidates.map(candidate => getWorktreeCleanupId(candidate))); - onProgress?.({ state: 'started' }); - for (const candidate of candidates) { - onProgress?.(getWorktreeCleanupId(candidate) === 'second' && requests.length === 1 - ? { state: 'failed', candidate, message: 'host disconnected' } - : { state: 'scheduled', candidate }); - } - if (requests.length === 1) { - throw new Error('Some cleanup requests failed'); - } - return true; - }, - refreshPendingCleanup: async () => { - firstRemoved = true; - secondRemoved = requests.length > 1; - return getWorktrees(); - }, - }); - await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); - await timeout(0); - const row = (title: string) => [...container.querySelectorAll('.session-worktree-cleanup-row:not(.header)')].find(row => row.querySelector('a')?.textContent === title)!; - row('remaining').querySelector('[role="checkbox"]')!.click(); - container.querySelector('.session-worktree-cleanup-action')!.click(); - await timeout(2_100); - const failed = { - reason: row('second').querySelector('.session-worktree-cleanup-reason')?.textContent, - checked: row('second').querySelector('[role="checkbox"]')?.getAttribute('aria-checked'), - summary: container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent, - }; - row('remaining').querySelector('[role="checkbox"]')!.click(); - container.querySelector('.session-worktree-cleanup-retry')!.click(); - await timeout(2_100); - assert.deepStrictEqual({ - requests, - errors, - failed, - summary: container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent, - remainingChecked: row('remaining').querySelector('[role="checkbox"]')?.getAttribute('aria-checked'), - cleanupLabel: container.querySelector('.session-worktree-cleanup-action')?.textContent, - retryDisabled: container.querySelector('.session-worktree-cleanup-retry')?.getAttribute('aria-disabled'), - }, { - requests: [['first', 'second'], ['second']], - errors: ['Some cleanup requests failed'], - failed: { - reason: 'Couldn\'t schedule cleanup: host disconnected', - checked: undefined, - summary: 'Cleanup results: 1 of 2 worktrees removed, 1 failed, 0 need attention.', - }, - summary: 'Cleanup complete: 2 worktrees removed.', - remainingChecked: 'true', - cleanupLabel: 'Clean Up 1 Worktree (~100B)', - retryDisabled: 'true', - }); - })); - - test('failed scheduling enables force selection and confirmed retry without repeating ordinary cleanup', async () => { - const worktrees = [createUnlinkedWorktree('agents/in-use'), createUnlinkedWorktree('agents/stale-branch')]; - const ordinary: string[][] = []; - const forced: { id: string; state: string | undefined }[][] = []; - const { editor, container, errors } = createEditor({ - getWorktrees: async () => worktrees, - canForceCleanup: worktree => worktree.worktreeExists === true && worktree.cleanupStatus?.state === 'failed', - cleanupWorktrees: async (candidates, onProgress) => { - ordinary.push(candidates.map(getWorktreeCleanupId)); - onProgress?.({ state: 'started' }); - for (const candidate of candidates) { - onProgress?.({ state: 'failed', candidate, message: 'A session is using this worktree or its branch changed' }); - } - throw new Error('Some cleanup requests failed'); - }, - // Cancellation leaves the failed batch available for another confirmed attempt. - forceCleanupWorktrees: async candidates => { - forced.push(candidates.map(candidate => ({ id: getWorktreeCleanupId(candidate), state: candidate.cleanupStatus?.state }))); - return false; - }, - }); - await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); - await timeout(0); - container.querySelector('.session-worktree-cleanup-action')!.click(); - await timeout(0); - const retry = container.querySelector('.session-worktree-cleanup-retry')!; - const section = container.querySelector('details')!; - const initial = [...section.querySelectorAll('.session-worktree-cleanup-row [role="checkbox"]')].map(checkbox => checkbox.getAttribute('aria-checked')); - retry.click(); - await timeout(0); - section.querySelector('.session-worktree-cleanup-select-all [role="checkbox"]')!.click(); - container.querySelector('.session-worktree-cleanup-force-remove')!.click(); - await timeout(0); - const expectedForced = worktrees.map(worktree => ({ id: getWorktreeCleanupId(worktree), state: 'failed' })); - assert.deepStrictEqual({ - ordinary, forced, initial, errors, - retry: { label: retry.textContent, disabled: retry.getAttribute('aria-disabled') }, - selected: [...section.querySelectorAll('.session-worktree-cleanup-row [role="checkbox"]')].map(checkbox => checkbox.getAttribute('aria-checked')), - }, { - ordinary: [worktrees.map(getWorktreeCleanupId)], - forced: [expectedForced, expectedForced], - initial: ['false', 'false'], - errors: ['Some cleanup requests failed'], - retry: { label: 'Force Remove Failed Worktrees', disabled: 'false' }, - selected: ['true', 'true'], - }); - }); - - test('keeps batch counts across filters and restricts retry to visible failed worktrees', async () => { - const worktrees = [createWorktree('first', '/repos/app'), createWorktree('second', '/other/app')]; - const requests: string[][] = []; - const { editor, container } = createEditor({ - getWorktrees: async () => worktrees, - cleanupWorktrees: async (candidates, onProgress) => { - requests.push(candidates.map(candidate => getWorktreeCleanupId(candidate))); - onProgress?.({ state: 'started' }); - for (const candidate of candidates) { - onProgress?.({ state: 'failed', candidate, message: 'host disconnected' }); - } - throw new Error('Some cleanup requests failed'); - }, - }); - await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); - await timeout(0); - container.querySelector('.session-worktree-cleanup-action')!.click(); - await timeout(0); - const picker = container.querySelector('.session-worktree-cleanup-workspace')!; - picker.value = URI.file('/repos/app').toString(); - picker.dispatchEvent(new Event(dom.EventType.CHANGE)); - container.querySelector('.session-worktree-cleanup-retry')!.click(); - await timeout(0); - assert.deepStrictEqual({ - requests, - summary: container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent, - rows: [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent), - }, { - requests: [['first', 'second'], ['first']], - summary: 'Cleanup results: 0 of 2 worktrees removed, 2 failed, 0 need attention.', - rows: ['first'], - }); - }); - - test('does not claim cleanup succeeded when the session is not done and storage cannot be measured', () => runWithFakedTimers({ useFakeTimers: true }, async () => { - const worktree = createWorktree('first', '/repos/app'); - let submitted = false; - const { editor, container } = createEditor({ - getWorktrees: async () => [submitted ? { ...worktree, sizeBytes: undefined, cleanupState: 'unavailable', measurementFailed: true } : worktree], - cleanupWorktrees: async (candidates, onProgress) => { submitted = true; return scheduleCleanup(candidates, onProgress); }, - refreshPendingCleanup: async () => [{ ...worktree, sizeBytes: undefined, cleanupState: 'unavailable', measurementFailed: true }], - }); - await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); - await timeout(0); - container.querySelector('.session-worktree-cleanup-action')!.click(); - await timeout(2_100); - const pending = container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent; - await timeout(30_000); - assert.deepStrictEqual({ - rows: [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent), - reason: container.querySelector('.session-worktree-cleanup-reason')?.textContent, - summary: container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent, - pending, - }, { - rows: ['first'], - reason: 'Couldn\'t measure storage. Cleanup has not been confirmed.', - summary: 'Cleanup results: 0 of 1 worktrees removed, 0 failed, 1 need attention.', - pending: 'Cleanup: 0 of 1 worktrees removed, 1 pending, 0 failed, 0 need attention.', + summary: 'Cleanup: 2 worktrees removed.', }); })); @@ -1886,6 +1899,7 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + selectAllWorktrees(container); container.querySelector('.session-worktree-cleanup-action')!.click(); editor.clearInput(); await finished.complete(); @@ -1908,6 +1922,7 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + selectAllWorktrees(container); container.querySelector('.session-worktree-cleanup-action')!.click(); await timeout(0); if (dispose) { @@ -1924,26 +1939,36 @@ suite('SessionWorktreeCleanupEditor', () => { }); } - test('distinguishes missing storage measurements from an age filter mismatch', async () => { - const { container } = await openEditor([createWorktree('unavailable', '/repos/app', 'unavailable')]); - assert.strictEqual(container.querySelector('.session-worktree-cleanup-empty span:last-child')?.textContent, 'No worktrees with available storage measurements.'); - }); - - test('shows a text-only settings heading and no configure actions', () => { + test('shows a gear-labeled automatic cleanup disclosure without separate configure actions', () => { const { container } = createEditor(); - + const section = container.querySelector('details')!; + const summary = section.querySelector('summary')!; + const states = [section.open]; + focusElement(summary); + summary.click(); + states.push(section.open); + summary.click(); + states.push(section.open); assert.deepStrictEqual({ - heading: container.querySelector('h2')?.textContent, + heading: summary.textContent, headingIcons: container.querySelectorAll('h2 .codicon').length, gears: container.querySelectorAll('.codicon-settings-gear').length, + decorativeIcon: summary.querySelector('.codicon-settings-gear')?.getAttribute('aria-hidden'), + display: mainWindow.getComputedStyle(summary).display, + states, + focused: dom.getActiveElement() === summary, configureActions: container.querySelectorAll('.session-worktree-cleanup-configure').length, - intro: container.querySelector('.session-worktree-cleanup-intro')?.textContent, + intro: container.querySelector('.session-worktree-cleanup-intro h2')?.textContent, }, { - heading: 'Cleanup Settings', + heading: 'Automatic Cleanup', headingIcons: 0, - gears: 0, + gears: 1, + decorativeIcon: 'true', + display: 'flex', + states: [false, true, false], + focused: true, configureActions: 0, - intro: 'Clean up worktrees to free disk space. Normal cleanup commits uncommitted changes and marks sessions as done; restore a session to recreate its worktree. Managed worktrees with no matching session can also be selected; their branches are kept. Force Remove permanently discards uncommitted changes and overrides usage by other sessions or chats after a separate confirmation.', + intro: 'Free up local disk space', }); }); @@ -1958,7 +1983,7 @@ suite('SessionWorktreeCleanupEditor', () => { }; } - function createWorktree(id: string, workspacePath: string, cleanupState: ISessionWorktree['cleanupState'] = 'eligible', ageDays = 0): ISessionWorktree { + function createWorktree(id: string, workspacePath: string, cleanupState: ISessionWorktree['cleanupState'] = 'eligible', ageDays = 0): Extract { return { session: upcastPartial({ sessionId: id, @@ -1999,6 +2024,7 @@ suite('SessionWorktreeCleanupEditor', () => { { ...createWorktree('first', '/repos/app'), sizeBytes: 300, worktreeCount: 2 }, { ...createWorktree('second', '/other/app'), sizeBytes: 100 }, ]); + selectAllWorktrees(container); const button = container.querySelector('.session-worktree-cleanup-action')!; const selectionState = () => ({ label: button.textContent, accessibleLabel: button.getAttribute('aria-label'), disabled: button.getAttribute('aria-disabled') }); const states = [selectionState()]; @@ -2018,36 +2044,38 @@ suite('SessionWorktreeCleanupEditor', () => { ]); }); - test('hides archived sizes and mixed totals while keeping unmeasured retries preselected', async () => { + test('hides archived sizes and reports mixed totals for explicitly selected retries', async () => { const { container, cleaned } = await openEditor([ { ...createWorktree('active', '/repos/app'), sizeBytes: 1024 ** 3 }, { ...createWorktree('archived', '/repos/app', 'archived'), sizeBytes: 134 * 1024 ** 3, cleanupStatus: { state: 'unknown' } }, ]); + sortWorktrees(container, 'status'); + selectAllWorktrees(container); const button = container.querySelector('.session-worktree-cleanup-action')!; const rows = [...container.querySelectorAll('.session-worktree-cleanup-row:not(.header)')]; const initial = { - storage: rows.map(row => row.lastElementChild?.textContent), + storage: rows.map(row => row.querySelector('.storage')?.textContent), checked: rows.map(row => row.querySelector('[role="checkbox"]')?.getAttribute('aria-checked')), - archivedLabel: rows[1].parentElement?.getAttribute('aria-label')?.includes('disk usage not measured for done sessions'), + archivedLabel: rows[0].parentElement?.getAttribute('aria-label')?.includes('disk usage Not measured for done sessions'), summary: container.querySelector('.session-worktree-cleanup-summary')?.textContent, button: button.textContent, accessibleButton: button.getAttribute('aria-label'), }; - rows[1].querySelector('[role="checkbox"]')!.click(); + rows[0].querySelector('[role="checkbox"]')!.click(); const activeOnly = button.textContent; - rows[1].querySelector('[role="checkbox"]')!.click(); rows[0].querySelector('[role="checkbox"]')!.click(); + rows[1].querySelector('[role="checkbox"]')!.click(); const archivedOnly = button.textContent; button.click(); await timeout(0); assert.deepStrictEqual({ initial, activeOnly, archivedOnly, cleaned }, { initial: { - storage: ['1.00GB', '—'], + storage: ['Not measured', '1.00GB'], checked: ['true', 'true'], archivedLabel: true, - summary: '2 of 2 matching worktrees can be cleaned up.', - button: 'Clean Up 2 Worktrees', - accessibleButton: 'Clean Up 2 Worktrees', + summary: '2 of 2 matching worktrees can be cleaned up. Estimated disk usage: 1.00GB known, 1 unmeasured.', + button: 'Clean Up 2 Worktrees (~1.00GB known, 1 unmeasured)', + accessibleButton: 'Clean Up 2 Worktrees, estimated disk usage 1.00GB known, 1 unmeasured', }, activeOnly: 'Clean Up 1 Worktree (~1.00GB)', archivedOnly: 'Clean Up 1 Worktree', @@ -2055,7 +2083,7 @@ suite('SessionWorktreeCleanupEditor', () => { }); }); - test('preselects available archived worktrees but keeps removal issues out of normal cleanup', async () => { + test('allows selecting available archived worktrees but keeps removal issues out of normal cleanup', async () => { const { container, cleaned } = await openEditor([ { ...createWorktree('unknown', '/repos/app', 'archived'), cleanupStatus: { state: 'unknown' } }, { ...createWorktree('failed', '/repos/app', 'archived'), cleanupStatus: { state: 'failed', message: 'permission denied' } }, @@ -2065,12 +2093,13 @@ suite('SessionWorktreeCleanupEditor', () => { { ...createWorktree('running', '/repos/app', 'archived'), cleanupStatus: { state: 'running' } }, createWorktree('unsupported', '/repos/app', 'archived'), ]); + selectAllWorktrees(container); const rows = [...container.querySelectorAll('.session-worktree-cleanup-row:not(.header)')]; const states = rows.map(row => ({ disabled: row.querySelector('[role="checkbox"]')?.getAttribute('aria-disabled'), checked: row.querySelector('[role="checkbox"]')?.getAttribute('aria-checked'), - reason: row.querySelector('.session-worktree-cleanup-reason')?.textContent, - accessibleReason: row.querySelector('a')?.getAttribute('aria-description'), + reason: rowStatus(row), + accessibleReason: row.parentElement?.getAttribute('aria-label')?.includes(rowStatus(row)!), })); container.querySelector('.session-worktree-cleanup-action')!.click(); await timeout(0); @@ -2078,18 +2107,14 @@ suite('SessionWorktreeCleanupEditor', () => { 'Worktree still exists. Select to retry cleanup.', 'Cleanup scheduled…', 'Cleaning up…', - 'Cleanup failed; retry scheduled: permission denied', - 'Cleanup blocked: another session or chat uses this worktree.', - 'Cleanup deferred: the worktree could not be safely removed.', - 'Done', ]; assert.deepStrictEqual({ states, cleaned }, { - states: labels.map((reason, index) => ({ disabled: index === 0 ? null : undefined, checked: index === 0 ? 'true' : undefined, reason, accessibleReason: reason })), + states: labels.map((reason, index) => ({ disabled: index === 0 ? null : undefined, checked: index === 0 ? 'true' : undefined, reason, accessibleReason: true })), cleaned: [['unknown']], }); }); - test('omits confirmed absent archived worktrees and preselects actual leftovers on every opening', async () => { + test('omits confirmed absent archived worktrees and leaves actual leftovers unchecked on every opening', async () => { const worktrees: ISessionWorktree[] = [ removedWorktree(createWorktree('removed', '/repos/app', 'archived')), { ...createWorktree('leftover', '/repos/app', 'archived'), cleanupStatus: { state: 'unknown' } }, @@ -2102,13 +2127,13 @@ suite('SessionWorktreeCleanupEditor', () => { openings.push([...container.querySelectorAll('.session-worktree-cleanup-row')].map(row => ({ title: row.querySelector('a')?.textContent, checked: row.querySelector('[role="checkbox"]')?.getAttribute('aria-checked'), - storage: row.lastElementChild?.textContent, + storage: row.querySelector('.storage')?.textContent, }))); editor.clearInput(); } assert.deepStrictEqual(openings, [ - [{ title: 'leftover', checked: 'true', storage: '—' }], - [{ title: 'leftover', checked: 'true', storage: '—' }], + [{ title: 'leftover', checked: 'false', storage: 'Not measured' }], + [{ title: 'leftover', checked: 'false', storage: 'Not measured' }], ]); }); @@ -2136,6 +2161,7 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + selectAllWorktrees(container); const leftoverRow = () => [...container.querySelectorAll('.session-worktree-cleanup-row')].find(row => row.querySelector('a')?.textContent === (cleanupState === 'unlinked' ? 'agents/leftover' : 'leftover'))!; leftoverRow().querySelector('[role="checkbox"]')!.click(); container.querySelector('.session-worktree-cleanup-action')!.click(); @@ -2144,7 +2170,7 @@ suite('SessionWorktreeCleanupEditor', () => { checked, leftoverSelected: leftoverRow().querySelector('[role="checkbox"]')?.getAttribute('aria-checked'), summary: container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent, - }, { checked: [['first']], leftoverSelected: 'false', summary: 'Cleanup complete: 1 worktree removed.' }); + }, { checked: [['first']], leftoverSelected: 'false', summary: 'Cleanup: 1 worktree removed.' }); })); } @@ -2163,22 +2189,22 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + selectAllWorktrees(container); container.querySelector('.session-worktree-cleanup-action')!.click(); await timeout(30_001); - const row = container.querySelector('.session-worktree-cleanup-row')!; assert.deepStrictEqual({ - storage: row.lastElementChild?.textContent, - reason: row.querySelector('a')?.getAttribute('aria-description'), + rows: container.querySelectorAll('.session-worktree-cleanup-row').length, + batchHidden: container.querySelector('.session-worktree-cleanup-batch')?.classList.contains('hidden'), summary: container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent, }, { - storage: '—', - reason: verification === 'failed' ? 'Couldn\'t check whether the worktree still exists: Host disconnected' : 'Couldn\'t verify whether the worktree still exists.', - summary: 'Cleanup results: 0 of 1 worktrees removed, 0 failed, 1 need attention.', + rows: 0, + batchHidden: true, + summary: 'Cleanup: 0 worktrees removed.', }); })); } - test('preselects archived worktrees without measurement and preserves manual deselection during updates', () => runWithFakedTimers({ useFakeTimers: true }, async () => { + test('leaves archived worktrees unchecked without measurement and preserves explicit selection during updates', () => runWithFakedTimers({ useFakeTimers: true }, async () => { const finished = new DeferredPromise(); let publish: ((worktrees: readonly ISessionWorktree[]) => void) | undefined; const worktree: ISessionWorktree = { ...createWorktree('archived', '/repos/app', 'archived'), cleanupStatus: { state: 'unknown' } }; @@ -2205,10 +2231,10 @@ suite('SessionWorktreeCleanupEditor', () => { await timeout(0); } states.push(checkbox().getAttribute('aria-checked')); - assert.deepStrictEqual(states, ['true', 'true', 'false', 'false']); + assert.deepStrictEqual(states, ['false', 'false', 'true', 'true']); })); - test('keeps polling host-confirmed cleanup beyond thirty seconds and shows an actual failure', () => runWithFakedTimers({ useFakeTimers: true }, async () => { + test('keeps polling host-confirmed cleanup beyond thirty seconds and hides an actual failure', () => runWithFakedTimers({ useFakeTimers: true }, async () => { const worktree = createWorktree('pending', '/repos/app', 'archived'); let failed = false; const { editor, container } = createEditor({ @@ -2217,60 +2243,18 @@ suite('SessionWorktreeCleanupEditor', () => { }); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(31_000); - const pending = container.querySelector('.session-worktree-cleanup-reason')?.textContent; + const pending = rowStatus(container); failed = true; await timeout(30_100); assert.deepStrictEqual({ pending, - failed: container.querySelector('.session-worktree-cleanup-reason')?.textContent, + failed: rowStatus(container), disabled: container.querySelector('.session-worktree-cleanup-row:not(.header) [role="checkbox"]')?.getAttribute('aria-disabled'), checked: container.querySelector('.session-worktree-cleanup-row:not(.header) [role="checkbox"]')?.getAttribute('aria-checked'), spinning: !!container.querySelector('.codicon-modifier-spin'), - }, { pending: 'Cleanup scheduled…', failed: 'Cleanup failed; retry scheduled: worktree is locked', disabled: undefined, checked: undefined, spinning: false }); + }, { pending: 'Cleanup scheduled…', failed: undefined, disabled: undefined, checked: undefined, spinning: false }); })); - test('explains status request errors without claiming removal failed or retry is unsupported', async () => { - const { container } = await openEditor([{ ...createWorktree('unavailable', '/repos/app', 'archived'), cleanupStatusError: 'host disconnected' }]); - assert.strictEqual(container.querySelector('.session-worktree-cleanup-reason')?.textContent, 'Couldn\'t read cleanup status: host disconnected'); - }); - - test('omits all cleanup exit code 128 errors but preserves other exit codes and locks', async () => { - const initializingError = 'Error: git worktree exited with code 128: fatal: cannot remove a locked working tree, lock reason: initializing\n at cleanup'; - const { container } = await openEditor([ - { ...createWorktree('initializing', '/repos/app', 'archived'), cleanupStatus: { state: 'failed', message: initializingError } }, - { ...createUnlinkedWorktree('initializing'), cleanupStatus: { state: 'failed', message: initializingError } }, - { ...createWorktree('locked', '/repos/app', 'archived'), cleanupStatus: { state: 'failed', message: initializingError.replace('lock reason: initializing', 'lock reason: user locked') } }, - { ...createWorktree('other-error', '/repos/app', 'archived'), cleanupStatus: { state: 'failed', message: 'git worktree exited with code 128: fatal: permission denied' } }, - { ...createWorktree('git-add', '/repos/app', 'archived'), cleanupStatus: { state: 'failed', message: 'git add exited with code 128: fatal: not a git repository' } }, - { ...createWorktree('different-code', '/repos/app', 'archived'), cleanupStatus: { state: 'failed', message: 'git worktree exited with code 129: invalid option' } }, - { ...createWorktree('code-prefix', '/repos/app', 'archived'), cleanupStatus: { state: 'failed', message: 'git worktree exited with code 1280' } }, - { ...createWorktree('lock-without-code', '/repos/app', 'archived'), cleanupStatus: { state: 'failed', message: 'cannot remove a locked working tree' } }, - ]); - assert.deepStrictEqual([...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent), ['different-code', 'code-prefix', 'lock-without-code']); - }); - - test('hides exit code 128 reported while scheduling without offering retries', async () => { - const worktree = createWorktree('failed', '/repos/app'); - const message = 'git worktree exited with code 128: fatal: permission denied'; - const { editor, container, errors } = createEditor({ - getWorktrees: async () => [worktree], - cleanupWorktrees: async ([candidate], onProgress) => { - onProgress?.({ state: 'started' }); - onProgress?.({ state: 'failed', candidate, message }); - throw new Error(message); - }, - }); - await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); - await timeout(0); - container.querySelector('.session-worktree-cleanup-action')!.click(); - await timeout(0); - assert.deepStrictEqual({ - rows: container.querySelectorAll('.session-worktree-cleanup-row').length, - retryDisabled: container.querySelector('.session-worktree-cleanup-retry')?.getAttribute('aria-disabled'), - errors, - }, { rows: 0, retryDisabled: 'true', errors: [message] }); - }); - test('updates cleanup counts for worktrees already pending or running when opened', () => runWithFakedTimers({ useFakeTimers: true }, async () => { const worktrees: ISessionWorktree[] = [ { ...createWorktree('pending', '/repos/app', 'archived'), cleanupStatus: { state: 'pending' } }, @@ -2294,7 +2278,7 @@ suite('SessionWorktreeCleanupEditor', () => { const snapshot = () => ({ summary: container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent, controlsHidden: container.querySelector('.session-worktree-cleanup-summary-row')?.classList.contains('hidden'), - removed: [...container.querySelectorAll('.session-worktree-cleanup-reason')].filter(reason => reason.textContent?.startsWith('Worktree removed')).length, + removed: [...container.querySelectorAll('.status')].filter(reason => reason.textContent?.includes('Worktree removed')).length, }); const states = [snapshot()]; await timeout(2_100); @@ -2302,9 +2286,9 @@ suite('SessionWorktreeCleanupEditor', () => { await timeout(4_100); states.push(snapshot()); assert.deepStrictEqual(states, [ - { summary: 'Cleanup: 0 of 4 worktrees removed, 4 pending, 0 failed, 0 need attention.', controlsHidden: true, removed: 0 }, - { summary: 'Cleanup: 1 of 4 worktrees removed, 3 pending, 0 failed, 0 need attention.', controlsHidden: true, removed: 1 }, - { summary: 'Cleanup complete: 4 worktrees removed.', controlsHidden: false, removed: 4 }, + { summary: 'Cleanup: 0 of 4 worktrees removed, 4 pending.', controlsHidden: false, removed: 0 }, + { summary: 'Cleanup: 1 of 4 worktrees removed, 3 pending.', controlsHidden: false, removed: 1 }, + { summary: 'Cleanup: 4 worktrees removed.', controlsHidden: false, removed: 4 }, ]); })); @@ -2325,11 +2309,11 @@ suite('SessionWorktreeCleanupEditor', () => { assert.deepStrictEqual({ checks, errors, summary: container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent, - reason: container.querySelector('.session-worktree-cleanup-reason')?.textContent, + reason: rowStatus(container), controlsHidden: container.querySelector('.session-worktree-cleanup-summary-row')?.classList.contains('hidden'), }, { checks: 2, errors: ['Host disconnected'], - summary: 'Cleanup complete: 1 worktree removed.', + summary: 'Cleanup: 1 worktree removed.', reason: 'Worktree removed', controlsHidden: true, }); @@ -2372,6 +2356,8 @@ suite('SessionWorktreeCleanupEditor', () => { editor.layout(new dom.Dimension(960, 600)); await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(0); + sortWorktrees(container, 'size'); + selectAllWorktrees(container); const initiallyRendered = [...container.querySelectorAll('.session-worktree-cleanup-session-link')].some(link => link.textContent === 'worktree-0'); const button = container.querySelector('.session-worktree-cleanup-action')!; focusElement(button); @@ -2381,9 +2367,9 @@ suite('SessionWorktreeCleanupEditor', () => { assert.deepStrictEqual({ initiallyRendered, controlsHidden: container.querySelector('.session-worktree-cleanup-summary-row')?.classList.contains('hidden'), - focusedInResults: !!focused && !!container.querySelector('.session-worktree-cleanup-progress')?.contains(focused), - firstRendered: [...container.querySelectorAll('.session-worktree-cleanup-progress .session-worktree-cleanup-session-link')].some(link => link.textContent === 'worktree-0'), - }, { initiallyRendered: count === 1, controlsHidden: true, focusedInResults: false, firstRendered: count === 1 }); + focusedInResults: !!focused && !!container.querySelector('.session-worktree-cleanup-list')?.contains(focused), + firstRendered: [...container.querySelectorAll('.session-worktree-cleanup-list .session-worktree-cleanup-session-link')].some(link => link.textContent === 'worktree-0'), + }, { initiallyRendered: count === 1, controlsHidden: false, focusedInResults: false, firstRendered: count === 1 }); }); } @@ -2401,7 +2387,7 @@ suite('SessionWorktreeCleanupEditor', () => { await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); await timeout(31_000); const duringError = { - reason: container.querySelector('.session-worktree-cleanup-reason')?.textContent, + reason: rowStatus(container), disabled: container.querySelector('.session-worktree-cleanup-row:not(.header) [role="checkbox"]')?.getAttribute('aria-disabled'), }; const previousChecks = checks; @@ -2413,40 +2399,13 @@ suite('SessionWorktreeCleanupEditor', () => { rows: container.querySelectorAll('.session-worktree-cleanup-row:not(.header)').length, summary: container.querySelector('.session-worktree-cleanup-batch [role="status"]')?.textContent, }, { - duringError: { reason: 'Couldn\'t read cleanup status: host disconnected', disabled: undefined }, + duringError: { reason: undefined, disabled: undefined }, resumedPolling: true, - rows: 1, - summary: 'Cleanup results: 0 of 1 worktrees removed, 0 failed, 1 need attention.', + rows: 0, + summary: 'Cleanup: 0 worktrees removed.', }); })); - test('shows recent and protected worktrees with workspace names and eligibility reasons', async () => { - const { container, ages } = await openEditor([ - createWorktree('recent', '/repos/app'), - createWorktree('active', '/repos/app', 'active'), - createWorktree('running', '/repos/other', 'running'), - createWorktree('unmeasured', '/repos/other', 'unavailable'), - ]); - - assert.deepStrictEqual({ - ages, - rows: [...container.querySelectorAll('.session-worktree-cleanup-row:not(.header)')].map(row => ({ - title: row.querySelector('a')?.textContent, - workspace: row.querySelector('.workspace')?.textContent, - disabled: row.querySelector('[role="checkbox"]')?.getAttribute('aria-disabled'), - reason: row.querySelector('.session-worktree-cleanup-reason')?.textContent ?? '', - storage: row.lastElementChild?.textContent, - })), - }, { - ages: [0], - rows: [ - { title: 'recent', workspace: 'app', disabled: null, reason: '', storage: '100B' }, - { title: 'active', workspace: 'app', disabled: null, reason: 'Active session', storage: '100B' }, - { title: 'running', workspace: 'other', disabled: undefined, reason: 'Running', storage: '100B' }, - ], - }); - }); - test('workspace filtering disambiguates names and restricts select all and cleanup to visible rows', async () => { const { container, cleaned } = await openEditor([ createWorktree('first', '/repos/app'), @@ -2524,30 +2483,7 @@ suite('SessionWorktreeCleanupEditor', () => { assert.deepStrictEqual({ ages, states }, { ages: [0, 7, 60, 0], - states: [['recent', 'old'], ['old'], [], ['recent', 'old']], - }); - }); - - test('shows only the collapsed unavailable section when protected worktrees match', async () => { - const { container } = await openEditor([createWorktree('pinned', '/repos/app', 'pinned')]); - assert.deepStrictEqual({ - tableHidden: container.querySelector('.session-worktree-cleanup-list')?.classList.contains('hidden'), - emptyHidden: container.querySelector('.session-worktree-cleanup-empty')?.classList.contains('hidden'), - summary: container.querySelector('.session-worktree-cleanup-summary')?.textContent, - unavailable: container.querySelector('summary')?.textContent, - expanded: container.querySelector('details')?.open, - unavailableCheckboxes: container.querySelectorAll('details .session-worktree-cleanup-row [role="checkbox"]').length, - selectAllDisabled: container.querySelector('details .monaco-table-th [role="checkbox"]')?.getAttribute('aria-disabled'), - cleanupDisabled: container.querySelector('.session-worktree-cleanup-action')?.getAttribute('aria-disabled'), - }, { - tableHidden: true, - emptyHidden: true, - summary: '0 of 1 matching worktrees can be cleaned up.', - unavailable: 'Needs attention (1)', - expanded: false, - unavailableCheckboxes: 0, - selectAllDisabled: 'true', - cleanupDisabled: 'true', + states: [['old', 'recent'], ['old'], [], ['old', 'recent']], }); }); @@ -2572,80 +2508,16 @@ suite('SessionWorktreeCleanupEditor', () => { checked: rows.map(row => row.querySelector('[role="checkbox"]')?.getAttribute('aria-checked')), cleaned, }, { - summary: '2 of 3 matching worktrees can be cleaned up. Estimated disk usage: 200B.', + summary: '2 of 2 matching worktrees can be cleaned up. Estimated disk usage: 200B.', selectAllDisabled: 'false', - initialChecked: ['false', 'false', undefined], - disabled: [null, null, undefined], - checked: ['true', 'true', undefined], + initialChecked: ['false', 'false'], + disabled: [null, null], + checked: ['true', 'true'], cleaned: [['active', 'needsInput']], }); }); - test('groups protected cleanup states without checkboxes and never includes them in cleanup', async () => { - const states: ISessionWorktree['cleanupState'][] = ['running', 'pinned', 'recent', 'archived', 'untitled', 'error']; - const { container, cleaned } = await openEditor([ - createWorktree('eligible', '/repos/app'), - ...states.map(state => createWorktree(state, '/repos/app', state)), - ]); - const protectedRows = [...container.querySelectorAll('.session-worktree-cleanup-row:not(.header)')].slice(1); - container.querySelector('.session-worktree-cleanup-action')!.click(); - await timeout(0); - assert.deepStrictEqual({ - inUnavailableSection: protectedRows.map(row => !!row.closest('details')), - checkboxes: protectedRows.map(row => row.querySelectorAll('[role="checkbox"]').length), - cleaned, - }, { inUnavailableSection: states.map(() => true), checkboxes: states.map(() => 0), cleaned: [['eligible']] }); - }); - - test('keeps unavailable details expanded and focused during measurement updates and filters both groups', () => runWithFakedTimers({ useFakeTimers: true }, async () => { - const finished = new DeferredPromise(); - let publish: ((worktrees: readonly ISessionWorktree[]) => void) | undefined; - const worktrees = [ - createWorktree('pinned', '/repos/app', 'pinned'), - createWorktree('eligible', '/repos/other'), - { ...createWorktree('pending', '/repos/other', 'archived'), worktreeCount: 2, cleanupStatus: { state: 'pending' as const } }, - ]; - const { editor, container } = createEditor({ - getWorktrees: async (_age, onUpdate) => { - publish = onUpdate; - onUpdate?.(worktrees); - return finished.p; - }, - }); - await editor.setInput(disposables.add(new SessionWorktreeCleanupEditorInput()), undefined, {}, CancellationToken.None); - const section = container.querySelector('details')!; - const summary = section.querySelector('summary')!; - const titles = (parent: Element) => [...parent.querySelectorAll('a')].map(link => link.textContent); - const initial = { - main: titles(container.querySelector('.session-worktree-cleanup-list')!), - unavailable: titles(section), - count: summary.textContent, - expanded: section.open, - }; - try { - section.open = true; - summary.focus(); - publish?.(worktrees.map(worktree => ({ ...worktree, sizeBytes: 200 }))); - await timeout(100); - const afterUpdate = { expanded: section.open, focused: dom.getActiveElement() === summary }; - const picker = container.querySelector('.session-worktree-cleanup-workspace')!; - picker.value = URI.file('/repos/app').toString(); - picker.dispatchEvent(new Event(dom.EventType.CHANGE)); - assert.deepStrictEqual({ - initial, - afterUpdate, - filtered: { mainHidden: container.querySelector('.session-worktree-cleanup-list')?.classList.contains('hidden'), unavailable: titles(section), count: summary.textContent }, - }, { - initial: { main: ['eligible'], unavailable: ['pinned'], count: 'Needs attention (1)', expanded: false }, - afterUpdate: { expanded: true, focused: true }, - filtered: { mainHidden: true, unavailable: ['pinned'], count: 'Needs attention (1)' }, - }); - } finally { - await finished.complete(worktrees); - } - })); - - test('keeps requested retries in the progress table after confirmed removal', () => runWithFakedTimers({ useFakeTimers: true }, async () => { + test('keeps requested cleanup in inventory through running and confirmed removal', () => runWithFakedTimers({ useFakeTimers: true }, async () => { const retry: ISessionWorktree = { ...createWorktree('retry', '/repos/app', 'archived'), cleanupStatus: { state: 'unknown' } }; const queued: ISessionWorktree = { ...createWorktree('queued', '/repos/app', 'archived'), cleanupStatus: { state: 'pending' } }; let requested = false; @@ -2659,21 +2531,25 @@ suite('SessionWorktreeCleanupEditor', () => { await timeout(0); container.querySelector('.session-worktree-cleanup-action')!.click(); await timeout(31_000); - const main = container.querySelector('.session-worktree-cleanup-progress')!; + const main = container.querySelector('.session-worktree-cleanup-list')!; const duringCleanup = { title: main.querySelector('a')?.textContent, - reason: main.querySelector('.session-worktree-cleanup-reason')?.textContent, + reason: rowStatus(main), checkboxes: main.querySelectorAll('.session-worktree-cleanup-row:not(.header) [role="checkbox"]').length, - unavailable: [...container.querySelectorAll('details a')].map(link => link.textContent), + tables: container.querySelectorAll('.monaco-table').length, }; removed = true; await timeout(30_100); assert.deepStrictEqual({ duringCleanup, - afterCleanup: { mainHidden: main.classList.contains('hidden'), rows: [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent) }, + afterCleanup: { + mainHidden: main.classList.contains('hidden'), + rows: [...container.querySelectorAll('.session-worktree-cleanup-session-link')].map(link => link.textContent), + reason: rowStatus(main), + }, }, { - duringCleanup: { title: 'retry', reason: 'Cleaning up…', checkboxes: 0, unavailable: [] }, - afterCleanup: { mainHidden: false, rows: ['retry', 'queued'] }, + duringCleanup: { title: 'retry', reason: 'Cleaning up…', checkboxes: 0, tables: 1 }, + afterCleanup: { mainHidden: false, rows: ['retry', 'queued'], reason: 'Worktree removed' }, }); })); @@ -2722,16 +2598,50 @@ suite('SessionWorktreeCleanupEditor', () => { }); }); - test('shows the Command Palette command in a bold second paragraph', () => { + test('groups cleanup guidance under a heading and keeps collapsed settings above inventory', () => { const { container } = createEditor(); - const paragraph = container.querySelector('.session-worktree-cleanup-content > p:nth-child(2)')!; + const settings = container.querySelector('details')!; + const inventory = container.querySelector('.session-worktree-cleanup-list')!; + + assert.deepStrictEqual({ + introParagraphs: container.querySelectorAll('.session-worktree-cleanup-intro').length, + heading: container.querySelector('.session-worktree-cleanup-intro h2')?.textContent, + instructions: [...container.querySelectorAll('.session-worktree-cleanup-intro p')].map(item => item.textContent), + settingsCollapsed: !settings.open, + settingsBeforeInventory: !!(settings.compareDocumentPosition(inventory) & mainWindow.Node.DOCUMENT_POSITION_FOLLOWING), + }, { + introParagraphs: 1, + heading: 'Free up local disk space', + instructions: [ + 'Select sessions to clean up their worktrees.', + ], + settingsCollapsed: true, + settingsBeforeInventory: true, + }); + }); + test('gives long session titles two lines and keeps checkout paths out of the visible row', async () => { + const title = 'Investigate the worktree cleanup layout and preserve long session titles when the cleanup editor is narrow'; + const { editor, container } = await openEditor([createWorktree(title, '/repos/app')]); + editor.layout(new dom.Dimension(960, 600)); + const row = container.querySelector('.session-worktree-cleanup-row')!; + const link = row.querySelector('.session-worktree-cleanup-session-link')!; + const titleCell = row.querySelector('.title')!; + const lineHeight = parseFloat(mainWindow.getComputedStyle(link).lineHeight); assert.deepStrictEqual({ - text: paragraph.textContent, - boldText: paragraph.querySelector('strong')?.textContent, + title: link.textContent, + titleWidth: titleCell.clientWidth >= 260, + twoLines: Math.abs(link.getBoundingClientRect().height - lineHeight * 2) < 1, + breathingRoom: row.getBoundingClientRect().height - link.getBoundingClientRect().height >= 12, + visiblePath: !!row.querySelector('.session-worktree-cleanup-reason'), + accessiblePath: link.getAttribute('aria-description'), }, { - text: 'You can return to this editor at any time by running Open Worktree Cleanup from the Command Palette.', - boldText: 'You can return to this editor at any time by running Open Worktree Cleanup from the Command Palette.', + title, + titleWidth: true, + twoLines: true, + breathingRoom: true, + visiblePath: false, + accessiblePath: 'Checkout path unavailable', }); }); diff --git a/src/vs/sessions/contrib/sessions/browser/sessions.contribution.ts b/src/vs/sessions/contrib/sessions/browser/sessions.contribution.ts index 89539c58108..d87af2ed15e 100644 --- a/src/vs/sessions/contrib/sessions/browser/sessions.contribution.ts +++ b/src/vs/sessions/contrib/sessions/browser/sessions.contribution.ts @@ -29,7 +29,7 @@ import { SESSIONS_MARK_AS_DONE_CONFETTI_SETTING } from '../../../../platform/cha import { SessionsWindowNotifier } from './sessionsWindowNotifier.js'; import { AutomationSessionsListingContribution } from './automationSessionsListing.js'; import { SessionsUnattendedRestartParticipant } from './sessionsUnattendedRestart.js'; -import { AutomationSessionsListMode, ExternalSessionApplicationBadgeMode, SESSIONS_CHAT_TABS_DEFAULT, SESSIONS_CHAT_TABS_SETTING, SESSIONS_LIST_AGENT_TOOLS_SETTING, SESSIONS_LIST_EXTERNAL_APPLICATION_BADGE_SETTING, SESSIONS_LIST_EXTERNAL_APPLICATION_BADGE_SHOW_FROM_SETTING, SESSIONS_LIST_GROUP_EXTERNAL_SESSIONS_SETTING, SESSIONS_LIST_INBOX_ENABLED_SETTING, SESSIONS_LIST_SHOW_AUTOMATION_SESSIONS_SETTING, SESSIONS_SIDEBAR_SEPARATE_NAVIGATION_SETTING, SESSIONS_LIST_REARRANGE_TREATMENT, SessionsChatTabsMode, USE_WORKTREE_SETTING } from '../../../../workbench/contrib/sessions/common/sessionConfig.js'; +import { AutomationSessionsListMode, ExternalSessionApplicationBadgeMode, SESSIONS_CHAT_TABS_DEFAULT, SESSIONS_CHAT_TABS_SETTING, SESSIONS_LIST_AGENT_TOOLS_SETTING, SESSIONS_LIST_EXTERNAL_APPLICATION_BADGE_SETTING, SESSIONS_LIST_EXTERNAL_APPLICATION_BADGE_SHOW_FROM_SETTING, SESSIONS_LIST_GROUP_EXTERNAL_SESSIONS_SETTING, SESSIONS_LIST_INBOX_ENABLED_SETTING, SESSIONS_LIST_SHOW_AUTOMATION_SESSIONS_SETTING, SESSIONS_SIDEBAR_SEPARATE_NAVIGATION_SETTING, SESSIONS_LIST_REARRANGE_TREATMENT, SessionsChatTabsMode, USE_WORKTREE_SETTING, SESSIONS_LIST_INLINE_ACTIONS_SETTING } from '../../../../workbench/contrib/sessions/common/sessionConfig.js'; const agentSessionsViewIcon = registerIcon('chat-sessions-icon', Codicon.commentDiscussionSparkle, localize('agentSessionsViewIcon', 'Icon for Agent Sessions View')); const AGENT_SESSIONS_VIEW_TITLE = localize2('agentSessions.view.label', "Sessions"); @@ -70,6 +70,13 @@ Registry.as(ViewContainerExtensions.ViewsRegistry).registerViews export const sessionsConfiguration = { id: 'sessions', properties: { + [SESSIONS_LIST_INLINE_ACTIONS_SETTING]: { + type: 'boolean', + tags: ['experimental'], + description: localize('sessions.list.inlineActions', "Show Fix Checks, Address Comments, or their combined action below eligible sessions and chats in the Sessions list. Actions run in the background. This does not enable Agent Merge or change action permissions."), + default: false, + scope: ConfigurationScope.APPLICATION, + }, [SESSIONS_SIDEBAR_SEPARATE_NAVIGATION_SETTING]: { type: 'boolean', tags: ['experimental'], diff --git a/src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.ts b/src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.ts index 1ce2a0c9b47..c138ef72fe8 100644 --- a/src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.ts +++ b/src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.ts @@ -29,10 +29,10 @@ import { IViewsService } from '../../../../../workbench/services/views/common/vi import { CLOSE_MOBILE_SIDEBAR_DRAWER_COMMAND_ID } from '../../../../browser/workbench.js'; import { EditorsVisibleContext, EditorAreaFocusContext, FocusedViewContext, IsSessionsWindowContext } from '../../../../../workbench/common/contextkeys.js'; import { SessionsCategories } from '../../../../../workbench/contrib/sessions/common/categories.js'; -import { SESSIONS_LIST_GROUP_EXTERNAL_SESSIONS_SETTING } from '../../../../../workbench/contrib/sessions/common/sessionConfig.js'; +import { SESSIONS_LIST_GROUP_EXTERNAL_SESSIONS_SETTING, SESSIONS_LIST_INBOX_ENABLED_SETTING } from '../../../../../workbench/contrib/sessions/common/sessionConfig.js'; import { ARCHIVE_CHAT_COMMAND_ID, ARCHIVE_SESSION_COMMAND_ID, ARCHIVE_SESSION_GROUP_COMMAND_ID, ARCHIVE_SESSIONS_WITH_UNDO_COMMAND_ID, DELETE_SESSION_GROUP_WITH_UNDO_COMMAND_ID, HIDE_AUTOMATION_SESSION_FROM_LIST_COMMAND_ID, MARK_SESSION_READ_COMMAND_ID, MARK_SESSION_UNREAD_COMMAND_ID, RENAME_SESSION_COMMAND_ID, SHOW_AUTOMATION_SESSION_IN_LIST_COMMAND_ID, SHOW_SESSION_APPLICATION_FILTERS_COMMAND_ID, UNARCHIVE_CHAT_COMMAND_ID, UNARCHIVE_SESSION_COMMAND_ID } from '../../../../../workbench/contrib/sessions/common/sessionCommands.js'; import { IsPhoneLayoutContext, SessionSupportsDeleteContext, SessionSupportsRenameContext, IsNewChatSessionContext, SessionActiveChatCanArchiveContext, SessionActiveChatIsUntitledContext, SessionHeaderTargetsChatContext, SessionIsArchivedContext, SessionIsCreatedContext, SessionIsReadContext, SessionItemIsMultiSelectionContext, SessionsListPromoteNewChatActionContext } from '../../../../../workbench/contrib/sessions/common/contextkeys.js'; -import { canStartNewSessionLike, getNewSessionSources, getSessionListChats, isAutomationSession, SessionItemCanImportContext, SessionItemContextMenuId, SessionItemIsAutomationContext, SessionItemIsInSessionsListContext, SessionItemOrganizeMenuGroup, SessionItemHasUnreadNestedSessionsContext, SessionSectionToolbarMenuId, SessionGroupToolbarMenuId, SessionSectionTypeContext, SessionSectionHasNonCloudRepositoryContext, SessionGroupHasVisibleSessionsContext, SessionGroupIsEmptyContext, SessionGroupIsComparisonContext, IsSessionPinnedContext, SessionsGrouping, SessionsSorting, ISessionSection, ISessionGroupItem, NEW_SESSION_FOR_WORKSPACE_ACTION_ID, NEW_SESSION_IN_ENVIRONMENT_ACTION_ID, ISessionChatItem, SessionChatItemCanArchiveContext, SessionChatItemCanMoveDownContext, SessionChatItemCanMoveUpContext, SessionChatItemCanSetReadStateContext, SessionChatItemIsArchivedContext, SessionChatItemIsReadContext, SessionChatItemIsStandaloneContext, SessionChatItemIsUntitledContext, SessionsListFocusedChatItemContext, SessionsListSearchOpenContext } from '../../../../../workbench/contrib/sessions/browser/views/sessionsList.js'; +import { canStartNewSessionLike, getNewSessionSources, getSessionListChats, isAutomationSession, SessionItemInboxStateContext, SessionItemCanImportContext, SessionItemContextMenuId, SessionItemIsAutomationContext, SessionItemIsInSessionsListContext, SessionItemOrganizeMenuGroup, SessionItemHasUnreadNestedSessionsContext, SessionSectionToolbarMenuId, SessionGroupToolbarMenuId, SessionSectionTypeContext, SessionSectionHasNonCloudRepositoryContext, SessionGroupHasVisibleSessionsContext, SessionGroupIsEmptyContext, SessionGroupIsComparisonContext, IsSessionPinnedContext, SessionsGrouping, SessionsSorting, ISessionSection, ISessionGroupItem, NEW_SESSION_FOR_WORKSPACE_ACTION_ID, NEW_SESSION_IN_ENVIRONMENT_ACTION_ID, ISessionChatItem, SessionChatItemCanArchiveContext, SessionChatItemCanMoveDownContext, SessionChatItemCanMoveUpContext, SessionChatItemCanSetReadStateContext, SessionChatItemIsArchivedContext, SessionChatItemIsReadContext, SessionChatItemIsStandaloneContext, SessionChatItemIsUntitledContext, SessionsListFocusedChatItemContext, SessionsListSearchOpenContext } from '../../../../../workbench/contrib/sessions/browser/views/sessionsList.js'; import { getChatCapabilities, IChat, ISession, SessionStatus } from '../../../../../workbench/services/sessions/common/session.js'; import { ISessionGroupsService } from '../../../../../workbench/contrib/sessions/browser/sessionGroupsService.js'; import { ISessionsListModelService } from '../../../../../workbench/contrib/sessions/browser/sessionsListModelService.js'; @@ -60,6 +60,7 @@ import { WorkspaceSelectionOrigin } from '../../../../../workbench/services/sess import { AccessibleViewType } from '../../../../../platform/accessibility/browser/accessibleView.js'; import { AccessibleViewRegistry } from '../../../../../platform/accessibility/browser/accessibleViewRegistry.js'; import { SessionsListNotificationFocused } from '../../../../../workbench/contrib/sessions/browser/views/sessionsListNotification.js'; +import { SessionInboxAction } from '../../../../../workbench/contrib/sessions/common/sessionInbox.js'; AccessibleViewRegistry.register({ name: 'sessions-list-notification', @@ -475,6 +476,26 @@ MenuRegistry.appendMenuItem(Menus.SessionSectionContext, { // Sort / Group Actions +const InboxModeContext = SessionsViewGroupingContext.isEqualTo(SessionsGrouping.Inbox); +const InboxModeEnabledContext = ContextKeyExpr.equals(`config.${SESSIONS_LIST_INBOX_ENABLED_SETTING}`, true); + +registerAction2(class InboxModeAction extends Action2 { + constructor() { + super({ + id: 'sessionsViewPane.inboxMode', + title: localize2('inboxMode', "Inbox Mode"), + category: SessionsCategories.Sessions, + f1: true, + precondition: ContextKeyExpr.and(IsSessionsWindowContext, ChatContextKeys.enabled, InboxModeEnabledContext), + toggled: InboxModeContext, + menu: [{ id: Menus.SessionsViewGrouping, group: '1_group', order: 4, when: ContextKeyExpr.and(ChatContextKeys.enabled, InboxModeEnabledContext) }], + }); + } + run(accessor: ServicesAccessor): void { + accessor.get(IViewsService).getViewWithId(SessionsViewId)?.setGrouping(SessionsGrouping.Inbox); + } +}); + registerAction2(class SortByCreatedAction extends Action2 { constructor() { super({ @@ -896,6 +917,7 @@ abstract class BaseArchiveSectionAction extends Action2 { // Not on Done itself, and not on the "Chats" (quick chats) section. // Also not on Automations. when: ContextKeyExpr.and( + InboxModeContext.negate(), ContextKeyExpr.notEquals(SessionSectionTypeContext.key, 'archived'), ContextKeyExpr.notEquals(SessionSectionTypeContext.key, 'quickchats'), ContextKeyExpr.notEquals(SessionSectionTypeContext.key, 'automations'), @@ -978,7 +1000,7 @@ abstract class BaseArchiveSessionsInGroupAction extends Action2 { id, group: id === SessionGroupToolbarMenuId ? 'navigation' : '1_state', order: 2, - when: SessionGroupHasVisibleSessionsContext, + when: ContextKeyExpr.and(SessionGroupHasVisibleSessionsContext, InboxModeContext.negate()), })) }); } @@ -1203,6 +1225,148 @@ function getFocusedSessionListTargets(accessor: ServicesAccessor): readonly ISes return accessor.get(IViewsService).getViewWithId(SessionsViewId)?.sessionsControl?.getFocusedSessions(); } +function triageSessions(modelService: ISessionsListModelService, viewsService: IViewsService, sessions: readonly ISession[], action: SessionInboxAction): void { + const targets = sessions.filter(session => !session.isArchived.get()); + if (!targets.length) { + return; + } + const undo = modelService.setInboxState(targets, action); + const message = action === 'done' ? localize('inboxDismissed', "{0} dismissed from inbox", targets.length) + : action === undefined ? localize('inboxResumed', "{0} returned to inbox", targets.length) + : action === 'hold' ? localize('inboxHeld', "{0} put on hold", targets.length) + : localize('inboxSnoozed', "{0} snoozed", targets.length); + viewsService.getViewWithId(SessionsViewId)?.listNotification?.show({ + message, + help: localize('inboxTriageHelp', "This changes only Inbox mode. It does not stop or archive sessions. Undo restores the previous triage state unless it has changed since."), + showCountdown: action !== 'done', + undo: async () => { undo(); status(localize('inboxTriageUndone', "Inbox change undone.")); }, + }); +} + +registerAction2(class DismissInboxSessionAction extends Action2 { + constructor() { + super({ + id: 'sessionsViewPane.inboxDone', + title: localize2('inboxDismiss', "Dismiss from Inbox"), + icon: Codicon.close, + precondition: ContextKeyExpr.and(ChatContextKeys.enabled, InboxModeContext), + menu: [Menus.SessionItemToolbar, SessionItemContextMenuId].map(id => ({ + id, + group: id === Menus.SessionItemToolbar ? 'navigation' : '1_state', + order: id === Menus.SessionItemToolbar ? 4 : 2, + when: ContextKeyExpr.and(ChatContextKeys.enabled, InboxModeContext, SessionIsArchivedContext.negate(), SessionItemInboxStateContext.notEqualsTo('done')), + })), + keybinding: { + primary: KeyCode.Delete, + mac: { primary: KeyMod.CtrlCmd | KeyCode.Backspace }, + weight: KeybindingWeight.SessionsContrib, + when: ContextKeyExpr.and(IsSessionsWindowContext, FocusedViewContext.isEqualTo(SessionsViewId), WorkbenchListFocusContextKey), + }, + }); + } + run(accessor: ServicesAccessor, context?: ISession | ISession[]): void { + triageSessions(accessor.get(ISessionsListModelService), accessor.get(IViewsService), getSessionActionTargets(accessor, context), 'done'); + } +}); + +registerAction2(class ResumeInboxSessionAction extends Action2 { + constructor() { + super({ + id: 'sessionsViewPane.inboxResume', + title: localize2('inboxResume', "Return to Inbox"), + icon: Codicon.discard, + precondition: ContextKeyExpr.and(ChatContextKeys.enabled, InboxModeContext), + menu: [Menus.SessionItemToolbar, SessionItemContextMenuId].map(id => ({ + id, + group: id === Menus.SessionItemToolbar ? 'navigation' : '1_state', + order: 1, + when: ContextKeyExpr.and(ChatContextKeys.enabled, InboxModeContext, SessionIsArchivedContext.negate(), SessionItemInboxStateContext.notEqualsTo('')), + })), + }); + } + run(accessor: ServicesAccessor, context?: ISession | ISession[]): void { + triageSessions(accessor.get(ISessionsListModelService), accessor.get(IViewsService), getSessionActionTargets(accessor, context), undefined); + } +}); + +registerAction2(class SnoozeInboxSessionAction extends Action2 { + constructor() { + super({ + id: 'sessionsViewPane.inboxSnooze', + title: localize2('inboxSnooze', "Snooze..."), + icon: Codicon.history, + precondition: ContextKeyExpr.and(ChatContextKeys.enabled, InboxModeContext), + menu: [{ + id: SessionItemContextMenuId, + group: '1_state', + order: 1.5, + when: ContextKeyExpr.and(ChatContextKeys.enabled, InboxModeContext, SessionIsArchivedContext.negate()), + }], + }); + } + async run(accessor: ServicesAccessor, context?: ISession | ISession[]): Promise { + const sessions = getSessionActionTargets(accessor, context); + const quickInput = accessor.get(IQuickInputService); + const modelService = accessor.get(ISessionsListModelService); + const viewsService = accessor.get(IViewsService); + const now = new Date(); + const morning = (days: number) => new Date(now.getFullYear(), now.getMonth(), now.getDate() + days, 9).getTime(); + const picked = await quickInput.pick([ + { label: localize('snoozeHour', "In One Hour"), value: now.getTime() + 60 * 60 * 1000 }, + { label: localize('snoozeTomorrow', "Tomorrow Morning"), value: morning(1) }, + { label: localize('snoozeWeek', "In One Week"), value: morning(7) }, + { label: localize('snoozeActivity', "Until New Activity"), value: 'untilActivity' as const }, + { label: localize('snoozeDate', "Pick a Date and Time..."), value: 'custom' as const }, + ], { placeHolder: localize('snoozePlaceholder', "When should these sessions return?") }); + if (!picked) { + return; + } + let action: SessionInboxAction; + if (picked.value === 'custom') { + const parse = (value: string): number => { + if (!/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(value)) { + return NaN; + } + const date = new Date(value.replace(' ', 'T')); + const formatted = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')} ${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`; + return formatted === value ? date.getTime() : NaN; + }; + const value = await quickInput.input({ + prompt: localize('snoozeDatePrompt', "Enter a future local date and time (YYYY-MM-DD HH:mm)"), + validateInput: async value => Number.isFinite(parse(value)) && parse(value) > Date.now() + ? undefined : localize('snoozeInvalidDate', "Enter a valid future date and time in YYYY-MM-DD HH:mm format."), + }); + if (value === undefined) { + return; + } + action = parse(value); + } else { + action = picked.value; + } + triageSessions(modelService, viewsService, sessions, action); + } +}); + +registerAction2(class HoldInboxSessionAction extends Action2 { + constructor() { + super({ + id: 'sessionsViewPane.inboxHold', + title: localize2('inboxHold', "Put on Hold"), + icon: Codicon.history, + precondition: ContextKeyExpr.and(ChatContextKeys.enabled, InboxModeContext), + menu: [{ + id: SessionItemContextMenuId, + group: '1_state', + order: 1.25, + when: ContextKeyExpr.and(ChatContextKeys.enabled, InboxModeContext, SessionIsArchivedContext.negate(), SessionItemInboxStateContext.notEqualsTo('hold')), + }], + }); + } + run(accessor: ServicesAccessor, context?: ISession | ISession[]): void { + triageSessions(accessor.get(ISessionsListModelService), accessor.get(IViewsService), getSessionActionTargets(accessor, context), 'hold'); + } +}); + registerAction2(class ShowAutomationSessionInListAction extends Action2 { constructor() { super({ @@ -1271,6 +1435,7 @@ KeybindingsRegistry.registerKeybindingRule({ IsSessionsWindowContext, FocusedViewContext.isEqualTo(SessionsViewId), WorkbenchListFocusContextKey, + InboxModeContext.negate(), ), primary: KeyCode.Delete, mac: { primary: KeyMod.CtrlCmd | KeyCode.Backspace }, @@ -1307,6 +1472,19 @@ registerAction2(class ImportSessionAction extends Action2 { } }); +for (const id of [Menus.SessionItemToolbar, SessionItemContextMenuId]) { + MenuRegistry.appendMenuItem(id, { + command: { + id: ARCHIVE_SESSION_COMMAND_ID, + title: localize2('inboxMarkSessionDone', "Mark Session as Done"), + icon: Codicon.check, + }, + group: id === Menus.SessionItemToolbar ? 'navigation' : '4_manage', + order: id === Menus.SessionItemToolbar ? 3 : 2.5, + when: ContextKeyExpr.and(ChatContextKeys.enabled, InboxModeContext, SessionIsArchivedContext.negate()), + }); +} + abstract class BaseArchiveSessionAction extends Action2 { constructor(wording: ChatSessionArchiveActionWording) { const action = getChatSessionArchiveActionPresentation(wording).archive; @@ -1318,12 +1496,12 @@ abstract class BaseArchiveSessionAction extends Action2 { id: Menus.SessionItemToolbar, group: 'navigation', order: 2, - when: ContextKeyExpr.equals(SessionIsArchivedContext.key, false), + when: ContextKeyExpr.and(InboxModeContext.negate(), SessionIsArchivedContext.negate()), }, { id: SessionItemContextMenuId, group: '1_state', order: 3, - when: ContextKeyExpr.equals(SessionIsArchivedContext.key, false), + when: ContextKeyExpr.and(InboxModeContext.negate(), SessionIsArchivedContext.negate()), }, ...SessionHeaderMenus.map(id => ({ id, group: 'secondary/1_state', diff --git a/src/vs/sessions/contrib/sessions/test/browser/sessionsList.fixture.ts b/src/vs/sessions/contrib/sessions/test/browser/sessionsList.fixture.ts index 07bba58af0a..a22c8bf9525 100644 --- a/src/vs/sessions/contrib/sessions/test/browser/sessionsList.fixture.ts +++ b/src/vs/sessions/contrib/sessions/test/browser/sessionsList.fixture.ts @@ -7,13 +7,15 @@ import { ChatSessionArchiveActionWording, ChatSessionArchiveActionWordingSetting import { ONBOARDING_TARGET_ATTR } from '../../../../../workbench/contrib/onboarding/browser/spotlight/onboardingTarget.js'; import { SpotlightOverlay } from '../../../../../workbench/contrib/onboarding/browser/spotlight/spotlightOverlay.js'; import { ComponentFixtureContext, defineThemedFixtureGroup } from '../../../../../workbench/test/browser/componentFixtures/fixtureUtils.js'; -import { ExternalSessionApplicationBadgeMode, SESSIONS_LIST_EXTERNAL_APPLICATION_BADGE_SETTING, SESSIONS_LIST_EXTERNAL_APPLICATION_BADGE_SHOW_FROM_SETTING, SESSIONS_LIST_GROUP_EXTERNAL_SESSIONS_SETTING, SESSIONS_LIST_INLINE_ACTIONS_SETTING } from '../../../../../workbench/contrib/sessions/common/sessionConfig.js'; +import { ExternalSessionApplicationBadgeMode, SESSIONS_LIST_EXTERNAL_APPLICATION_BADGE_SETTING, SESSIONS_LIST_EXTERNAL_APPLICATION_BADGE_SHOW_FROM_SETTING, SESSIONS_LIST_GROUP_EXTERNAL_SESSIONS_SETTING, SESSIONS_LIST_INBOX_ENABLED_SETTING, SESSIONS_LIST_INLINE_ACTIONS_SETTING } from '../../../../../workbench/contrib/sessions/common/sessionConfig.js'; import { ISessionEnvironment, SessionStatus } from '../../../../../workbench/services/sessions/common/session.js'; import { ISessionComparison, SessionComparisonParticipantRole } from '../../../../../workbench/contrib/sessions/common/sessionComparison.js'; import { getTestSessionResource } from '../../../../../workbench/contrib/sessions/test/common/testSessionBuilder.js'; import { createSessionArchiveTour } from '../../../../../workbench/contrib/sessions/browser/tours/sessionArchiveTour.js'; import { SESSIONS_LIST_INDENT_ITEMS_SETTING, SESSIONS_LIST_SHOW_UNREAD_IN_COLLAPSED_SECTIONS_SETTING, SessionsGrouping } from '../../../../../workbench/contrib/sessions/browser/views/sessionsList.js'; import { defineSessionsListFixture, ISessionsListFixture, ISessionsListFixtureGroup, ISessionsListFixtureSession } from './sessionsListFixtureUtils.js'; +import { InboxNotificationPriority, InboxTab } from '../../../../../workbench/contrib/sessions/common/inboxNotificationsService.js'; +import { SessionInboxSection } from '../../../../../workbench/contrib/sessions/common/sessionInbox.js'; //#region Data @@ -304,6 +306,42 @@ const INLINE_ACTION_SESSIONS: readonly ISessionsListFixtureSession[] = [ //#endregion export default defineThemedFixtureGroup({ path: 'sessions/' }, { + SessionsList_Inbox: defineSessionsListFixture({ + header: { navigationShortcuts: true }, + settings: { [SESSIONS_LIST_INBOX_ENABLED_SETTING]: true }, + sessions: [ + { id: 'pinned', title: 'Pinned investigation', workspace: 'vscode', pinned: true, status: SessionStatus.InProgress }, + { id: 'input', title: 'Approve the test run', workspace: 'vscode', status: SessionStatus.NeedsInput, minutesAgo: 15 }, + { id: 'completed', title: 'Review the navigation fix', workspace: 'vscode-tools', minutesAgo: 2 }, + { id: 'ci', title: 'Fix failing CI checks', workspace: 'vscode', minutesAgo: 20, inboxAttention: { tab: InboxTab.ReadyForYou, priority: InboxNotificationPriority.Now } }, + { id: 'merge', title: 'Merge the search improvements', workspace: 'vscode-tools', minutesAgo: 10, inboxAttention: { tab: InboxTab.ReadyToMerge, priority: InboxNotificationPriority.Next } }, + { id: 'working', title: 'Add regression tests', workspace: 'vscode', status: SessionStatus.InProgress }, + { id: 'snoozed', title: 'Waiting for more context', workspace: 'vscode-tools', inboxState: 'untilActivity', minutesAgo: 30 }, + { id: 'held', title: 'Paused for a decision', workspace: 'vscode', inboxState: 'hold', minutesAgo: 40 }, + { id: 'done', title: 'Update the documentation', workspace: 'vscode', inboxState: 'done', minutesAgo: 60 }, + ], + view: { grouping: SessionsGrouping.Inbox, height: 800 }, + interaction: { hovered: { session: 'completed' } }, + }, { additionalThemes: ['darkHighContrast', 'lightHighContrast'] }), + SessionsList_Inbox_Empty: defineSessionsListFixture({ + header: { automationsEnabled: true }, + sessions: [], + view: { grouping: SessionsGrouping.Inbox, height: 360 }, + }, { additionalThemes: ['darkHighContrast', 'lightHighContrast'] }), + SessionsList_Inbox_Expanded: defineSessionsListFixture({ + header: { automationsEnabled: true }, + sessions: [ + { id: 'ready', title: 'Review the navigation fix', workspace: 'vscode' }, + { id: 'held', title: 'Waiting for more context', workspace: 'vscode', inboxState: 'hold' }, + ...Array.from({ length: 20 }, (_, i) => ({ id: `working-${i}`, title: `Background task ${i + 1}`, workspace: 'vscode', status: SessionStatus.InProgress })), + ], + view: { grouping: SessionsGrouping.Inbox, height: 420, expanded: [{ section: SessionInboxSection.Working }, { section: SessionInboxSection.OnHold }] }, + }, { additionalThemes: ['darkHighContrast', 'lightHighContrast'] }), + SessionsList_Inbox_Long: defineSessionsListFixture({ + header: { navigationShortcuts: true }, + sessions: Array.from({ length: 25 }, (_, i) => ({ id: `ready-${i}`, title: `Review completed task ${i + 1}`, workspace: 'vscode', minutesAgo: i })), + view: { grouping: SessionsGrouping.Inbox, height: 420 }, + }, { additionalThemes: ['darkHighContrast', 'lightHighContrast'] }), SessionsList_Bakeoff: defineSessionsListFixture({ sessions: BAKEOFF_SESSIONS, groups: [{ id: 'bakeoff', name: BAKEOFF_COMPARISON.title, sessions: BAKEOFF_SESSIONS.map(session => session.id) }], diff --git a/src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts b/src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts index 436e9a1d01f..bd52c12f8ae 100644 --- a/src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts +++ b/src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts @@ -3,6 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { IGitHubService } from '../../../../../workbench/contrib/sessions/browser/github/githubService.js'; +import { AgentFeedbackKind, AgentFeedbackState } from '../../../../../workbench/contrib/sessions/browser/agentFeedbackModel.js'; +import { IAgentFeedbackService } from '../../../../../workbench/contrib/sessions/browser/agentFeedback.js'; import assert from 'assert'; import sinon from 'sinon'; import { $, append, scheduleAtNextAnimationFrame } from '../../../../../base/browser/dom.js'; @@ -73,17 +76,17 @@ import { AgentMergeSessionState } from '../../../../../platform/agentHost/common import { getSessionChatDragData, isSessionChatDrag, SessionsDataTransfers } from '../../../../../workbench/contrib/sessions/browser/dnd.js'; import { IsPhoneLayoutContext, SessionIsArchivedContext, SessionSupportsMultipleChatsContext } from '../../../../../workbench/contrib/sessions/common/contextkeys.js'; import { ARCHIVE_CHAT_COMMAND_ID, ARCHIVE_SESSION_COMMAND_ID, ARCHIVE_SESSION_GROUP_COMMAND_ID, ARCHIVE_SESSIONS_WITH_UNDO_COMMAND_ID, SHOW_SESSION_APPLICATION_FILTERS_COMMAND_ID, UNARCHIVE_CHAT_COMMAND_ID } from '../../../../../workbench/contrib/sessions/common/sessionCommands.js'; -import { getSessionApplication } from '../../../../../workbench/contrib/sessions/common/sessionApplication.js'; -import { ExternalSessionApplicationBadgeMode, SESSIONS_LIST_EXTERNAL_APPLICATION_BADGE_SETTING, SESSIONS_LIST_EXTERNAL_APPLICATION_BADGE_SHOW_FROM_SETTING, SESSIONS_LIST_GROUP_EXTERNAL_SESSIONS_SETTING } from '../../../../../workbench/contrib/sessions/common/sessionConfig.js'; +import { getSessionApplication } from '../../../../../workbench/services/sessions/common/sessionApplication.js'; +import { ExternalSessionApplicationBadgeMode, SESSIONS_LIST_EXTERNAL_APPLICATION_BADGE_SETTING, SESSIONS_LIST_EXTERNAL_APPLICATION_BADGE_SHOW_FROM_SETTING, SESSIONS_LIST_GROUP_EXTERNAL_SESSIONS_SETTING, SESSIONS_LIST_INLINE_ACTIONS_SETTING } from '../../../../../workbench/contrib/sessions/common/sessionConfig.js'; import { IAgentHostSessionsProvider, LOCAL_AGENT_HOST_PROVIDER_ID } from '../../../../../workbench/contrib/sessions/common/agentHostSessionsProvider.js'; import { IAgentHostFilterService } from '../../../../../workbench/contrib/sessions/common/agentHostFilter.js'; import { ICustomViewService, type ICustomViewDescriptor } from '../../../../../workbench/contrib/sessions/browser/customView.js'; import { IPinnedCanvas, IPinnedCanvasService, PINNED_CANVAS_PAGE_ID, PinnedCanvasState } from '../../../../../workbench/contrib/sessions/browser/pinnedCanvases.js'; import { ISessionsListModelService, SessionsListModelService } from '../../../../../workbench/contrib/sessions/browser/sessionsListModelService.js'; import { ISessionGroup, ISessionGroupsChangeEvent, ISessionGroupsService, SessionGroupsService, SessionGroupTree } from '../../../../../workbench/contrib/sessions/browser/sessionGroupsService.js'; -import { ISessionSectionOrderService, SessionSectionOrderService } from '../../../../../workbench/contrib/sessions/browser/sessionSectionOrderService.js'; +import { ISessionSectionOrderService, SessionSectionOrderService } from '../../../../../workbench/services/sessions/browser/sessionSectionOrderService.js'; import { ISessionsService } from '../../../../../workbench/contrib/sessions/browser/sessionsService.js'; -import { BRANCH_CHANGES_CHANGESET_ID, ChatInteractivity, ChatOriginKind, IChat, ISession, ISessionChangeset, ISessionChangesSummary, ISessionFileChange, ISessionFolder, ISessionType, SessionArtifactKind, SessionStatus, SessionTypeAuthRequirement } from '../../../../../workbench/contrib/sessions/common/session.js'; +import { BRANCH_CHANGES_CHANGESET_ID, ChatInteractivity, ChatOriginKind, IChat, ISession, ISessionChangeset, ISessionChangesSummary, ISessionFileChange, ISessionFolder, ISessionType, SessionArtifactKind, SessionStatus, SessionTypeAuthRequirement } from '../../../../../workbench/services/sessions/common/session.js'; import { ICreateNewSessionOptions, ISessionsManagementService } from '../../../../../workbench/contrib/sessions/common/sessionsManagement.js'; import { ISessionChangeEvent, ISessionsProvider } from '../../../../../workbench/contrib/sessions/common/sessionsProvider.js'; import { ISessionComparison, ISessionComparisonService, SessionComparisonParticipantRole } from '../../../../../workbench/contrib/sessions/common/sessionComparison.js'; @@ -450,6 +453,78 @@ suite('Sessions - SessionsList', () => { }); }); + suite('inline feedback actions', () => { + for (const grouping of [SessionsGrouping.Workspace, SessionsGrouping.Date, SessionsGrouping.Inbox]) { + test(`observes only enabled visible rows and targets one peer under multiselection (${grouping})`, async () => { + const a = buildTestSession({ id: 'a', title: 'Main', workspace: 'project', chats: [{ id: 'peer', title: 'Peer' }] }); + const b = buildTestSession({ id: 'b', title: 'Pinned', workspace: 'project' }); + const harness = createListHarness(disposables, [a.session, b.session], { pinnedSessionIds: new Set(['b']) }); + if (grouping === SessionsGrouping.Inbox) { + const model = disposables.add(harness.instantiationService.createInstance(SessionsListModelService)); + harness.instantiationService.stub(ISessionsListModelService, model); + model.pinSession(b.session); + model.setInboxState([a.session], 'done'); + } + const configuration = harness.instantiationService.get(IConfigurationService) as TestConfigurationService; + let observers = 0; + let opened = 0; + const submitted: string[] = []; + harness.instantiationService.stub(IGitHubService, new class extends mock() { }()); + harness.instantiationService.stub(IAgentFeedbackService, { + onDidChangeFeedback: Event.None, + getFeedbackObservable: resource => derived(reader => { + observers++; + reader.store.add(toDisposable(() => observers--)); + return [{ + id: 'review', text: 'Simplify this', sessionResource: resource, resourceUri: URI.file('/project/main.ts'), + range: { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 1 }, + kind: AgentFeedbackKind.AgentReview, state: AgentFeedbackState.Created, + }]; + }), + acceptFeedback: () => { }, + submitFeedback: async (_resource, options) => { submitted.push(options!.targetChat!.toString()); return true; }, + }); + const container = harness.createContainer(340, 650); + const list = harness.store.add(harness.instantiationService.createInstance(TestSessionsList, container, { + grouping: () => grouping, sorting: () => SessionsSorting.Created, onSessionOpen: () => { opened++; }, + })); + list.layout(340, 650); + list.setItemCollapsed({ section: 'pinned' }, false); + if (grouping === SessionsGrouping.Inbox) { + list.setItemCollapsed({ section: SessionInboxSection.Done }, false); + } + list.setItemCollapsed({ session: a.session.resource }, false); + const initial = { buttons: container.querySelectorAll('.session-inline-actions').length, observers }; + const peer = a.chats.get('peer')!.chat; + const peerRow = () => list.getItemRow({ session: a.session.resource, chat: peer.resource })!; + const initialHeight = peerRow().getBoundingClientRect().height; + await configuration.setUserConfiguration(SESSIONS_LIST_INLINE_ACTIONS_SETTING, true); + configuration.onDidChangeConfigurationEmitter.fire(upcastPartial({ affectsConfiguration: key => key === SESSIONS_LIST_INLINE_ACTIONS_SETTING })); + await timeout(50); + list.setSelectedItems([{ session: a.session.resource }, { session: b.session.resource }]); + const button = list.getItemRow({ session: a.session.resource, chat: peer.resource })?.querySelector('.session-inline-actions .monaco-button'); + assert.ok(button); + const heightIncrease = peerRow().getBoundingClientRect().height - initialHeight; + button.focus(); + button.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', keyCode: 27, bubbles: true })); + const footerFocused = !!mainWindow.document.activeElement?.closest('.sessions-list-inbox-footer'); + button.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', keyCode: 13, bubbles: true })); + await timeout(0); + const activeObservers = observers; + await configuration.setUserConfiguration(SESSIONS_LIST_INLINE_ACTIONS_SETTING, false); + configuration.onDidChangeConfigurationEmitter.fire(upcastPartial({ affectsConfiguration: key => key === SESSIONS_LIST_INLINE_ACTIONS_SETTING })); + const disabledObservers = observers; + await configuration.setUserConfiguration(SESSIONS_LIST_INLINE_ACTIONS_SETTING, true); + configuration.onDidChangeConfigurationEmitter.fire(upcastPartial({ affectsConfiguration: key => key === SESSIONS_LIST_INLINE_ACTIONS_SETTING })); + list.setVisible(false); + assert.deepStrictEqual({ initial, submitted, opened, activeObservers, disabledObservers, remainingObservers: observers, heightIncrease, footerFocused }, { + initial: { buttons: 0, observers: 0 }, submitted: [peer.resource.toString()], opened: 0, activeObservers: 3, disabledObservers: 0, remainingObservers: 0, + heightIncrease: 32, footerFocused: grouping === SessionsGrouping.Inbox, + }); + }); + } + }); + suite('SessionSectionRenderer', () => { test('selects the rendered section before the toolbar handles its context menu', () => { diff --git a/src/vs/sessions/contrib/sessions/test/browser/sessionsListTools.test.ts b/src/vs/sessions/contrib/sessions/test/browser/sessionsListTools.test.ts index 01d20414741..192a8eb031c 100644 --- a/src/vs/sessions/contrib/sessions/test/browser/sessionsListTools.test.ts +++ b/src/vs/sessions/contrib/sessions/test/browser/sessionsListTools.test.ts @@ -14,8 +14,9 @@ import { TestConfigurationService } from '../../../../../platform/configuration/ import { IStorageService, StorageScope, StorageTarget } from '../../../../../platform/storage/common/storage.js'; import { IToolImpl, IToolResult } from '../../../../../workbench/contrib/chat/common/tools/languageModelToolsService.js'; import { IViewsService } from '../../../../../workbench/services/views/common/viewsService.js'; -import { SESSIONS_LIST_AGENT_TOOLS_SETTING } from '../../../../../workbench/contrib/sessions/common/sessionConfig.js'; +import { SESSIONS_LIST_AGENT_TOOLS_SETTING, SESSIONS_LIST_INBOX_ENABLED_SETTING } from '../../../../../workbench/contrib/sessions/common/sessionConfig.js'; import { ISessionGroup, ISessionGroupsService, SessionGroupsService } from '../../../../../workbench/contrib/sessions/browser/sessionGroupsService.js'; +import { ISessionsListModelService, SessionsListModelService } from '../../../../../workbench/contrib/sessions/browser/sessionsListModelService.js'; import { ISessionSectionOrderService, SessionSectionOrderService } from '../../../../../workbench/services/sessions/browser/sessionSectionOrderService.js'; import { ISession } from '../../../../../workbench/services/sessions/common/session.js'; import { ISessionsManagementService } from '../../../../../workbench/contrib/sessions/common/sessionsManagement.js'; @@ -51,8 +52,11 @@ function parse(result: IToolResult): { readonly view: Record; r suite('Sessions - Sessions list tools', () => { const disposables = ensureNoDisposablesAreLeakedInTestSuite(); - function setup(sessions: ISession[], options: { readonly groups?: readonly ISessionGroup[]; readonly memberships?: Record; readonly pinnedSessionIds?: ReadonlySet } = {}) { + function setup(sessions: ISession[], options: { readonly groups?: readonly ISessionGroup[]; readonly memberships?: Record; readonly pinnedSessionIds?: ReadonlySet; readonly realListModel?: boolean } = {}) { const harness = createListHarness(disposables, sessions, { liveListModel: true, pinnedSessionIds: options.pinnedSessionIds }); + if (options.realListModel) { + harness.instantiationService.stub(ISessionsListModelService, harness.store.add(harness.instantiationService.createInstance(SessionsListModelService))); + } const configurationService = harness.instantiationService.get(IConfigurationService) as TestConfigurationService; void configurationService.setUserConfiguration(SESSIONS_LIST_AGENT_TOOLS_SETTING, true); const storageService = harness.instantiationService.get(IStorageService); @@ -216,6 +220,21 @@ suite('Sessions - Sessions list tools', () => { }); }); + test('rejects disabled inbox grouping before changing filters and allows it after opt-in', async () => { + const { organize, read, list, configurationService } = setup([session('Alpha', 1)], { realListModel: true }); + list.filters.setExcluded({ kind: 'harness', id: 'claude' }, true); + const rejected = await organize({ action: 'setView', grouping: 'inbox', resetFilters: true }); + const unchanged = { grouping: (await read()).view.grouping, excluded: list.filters.isExcluded({ kind: 'harness', id: 'claude' }) }; + await configurationService.setUserConfiguration(SESSIONS_LIST_INBOX_ENABLED_SETTING, true); + const accepted = await organize({ action: 'setView', grouping: 'inbox' }); + assert.deepStrictEqual({ rejected: rejected.results, unchanged, accepted: accepted.results, grouping: (await read()).view.grouping }, { + rejected: [{ action: 'setView', ok: false, error: 'Inbox Mode requires "sessions.list.inboxEnabled" to be enabled.' }], + unchanged: { grouping: 'workspace', excluded: true }, + accepted: [{ action: 'setView', ok: true }], + grouping: 'inbox', + }); + }); + test('refuses to read or change the list while the setting is off', async () => { const { invokeRaw, configurationService, harness } = setup([session('Alpha', 1)]); await configurationService.setUserConfiguration(SESSIONS_LIST_AGENT_TOOLS_SETTING, false); diff --git a/src/vs/sessions/contrib/sessions/test/browser/sessionsViewMenu.test.ts b/src/vs/sessions/contrib/sessions/test/browser/sessionsViewMenu.test.ts index 82ee047fcfa..570ef2aa10d 100644 --- a/src/vs/sessions/contrib/sessions/test/browser/sessionsViewMenu.test.ts +++ b/src/vs/sessions/contrib/sessions/test/browser/sessionsViewMenu.test.ts @@ -30,21 +30,24 @@ import { TestInstantiationService } from '../../../../../platform/instantiation/ import { MockKeybindingService } from '../../../../../platform/keybinding/test/common/mockKeybindingService.js'; import { NullLogService } from '../../../../../platform/log/common/log.js'; import { TestNotificationService } from '../../../../../platform/notification/test/common/testNotificationService.js'; +import { IInputOptions, IQuickInputService, IQuickPickItem } from '../../../../../platform/quickinput/common/quickInput.js'; import { InMemoryStorageService } from '../../../../../platform/storage/common/storage.js'; import { NullTelemetryService } from '../../../../../platform/telemetry/common/telemetryUtils.js'; import { ChatConfiguration } from '../../../../../workbench/contrib/chat/common/constants.js'; import { ChatContextKeys } from '../../../../../workbench/contrib/chat/common/actions/chatContextKeys.js'; import { IViewsService } from '../../../../../workbench/services/views/common/viewsService.js'; import { Menus } from '../../../../../workbench/contrib/sessions/browser/menus.js'; -import { IsPhoneLayoutContext } from '../../../../../workbench/contrib/sessions/common/contextkeys.js'; -import { SHOW_SESSION_APPLICATION_FILTERS_COMMAND_ID } from '../../../../../workbench/contrib/sessions/common/sessionCommands.js'; +import { IsPhoneLayoutContext, SessionIsArchivedContext } from '../../../../../workbench/contrib/sessions/common/contextkeys.js'; +import { ARCHIVE_SESSION_COMMAND_ID, SHOW_SESSION_APPLICATION_FILTERS_COMMAND_ID } from '../../../../../workbench/contrib/sessions/common/sessionCommands.js'; +import { SESSIONS_LIST_INBOX_ENABLED_SETTING } from '../../../../../workbench/contrib/sessions/common/sessionConfig.js'; import { ISession, ISessionEnvironment } from '../../../../../workbench/services/sessions/common/session.js'; import { buildTestSession } from '../../../../../workbench/contrib/sessions/test/common/testSessionBuilder.js'; -import { SessionsGrouping, SessionsList, SessionsSorting } from '../../../../../workbench/contrib/sessions/browser/views/sessionsList.js'; +import { SessionItemContextMenuId, SessionItemInboxStateContext, SessionsGrouping, SessionsList, SessionsSorting } from '../../../../../workbench/contrib/sessions/browser/views/sessionsList.js'; +import { ISessionsListModelService, SessionsListModelService } from '../../../../../workbench/contrib/sessions/browser/sessionsListModelService.js'; import { SessionsListFilters } from '../../../../../workbench/contrib/sessions/browser/views/sessionsListFilters.js'; import { ISessionsListNotice, SessionsListNotification } from '../../../../../workbench/contrib/sessions/browser/views/sessionsListNotification.js'; import { IsWorkspaceGroupCappedContext, SessionsView, SessionsViewCompactContext, SessionsViewGroupingContext, SessionsViewSortingContext } from '../../../../../workbench/contrib/sessions/browser/views/sessionsView.js'; -import { TestCommandService } from './sessionsListTestUtils.js'; +import { createListHarness, TestCommandService } from './sessionsListTestUtils.js'; import '../../browser/views/sessionsViewActions.js'; suite('Sessions - View Menu', () => { @@ -151,7 +154,7 @@ suite('Sessions - View Menu', () => { await instantiationService.invokeFunction(accessor => command.handler(accessor)); }; return { - snapshot, sorting, grouping, capped, compact, contextKeyService, filters, run, sessionsControl, notices, + snapshot, sorting, grouping, capped, compact, contextKeyService, configurationService, filters, run, sessionsControl, notices, /** Chooses Show: All, as its action does. */ showAll: () => { sessionsControl.setWorkspaceGroupCapped(false); @@ -181,6 +184,138 @@ suite('Sessions - View Menu', () => { }); }); + test('inbox mode is offered only when the experimental setting and AI are enabled', async () => { + const { snapshot, configurationService, contextKeyService } = createMenu(); + const offered = () => snapshot(Menus.SessionsViewGrouping).some(item => item.title === 'Inbox Mode'); + const initial = offered(); + await configurationService.updateValue(SESSIONS_LIST_INBOX_ENABLED_SETTING, true); + const enabled = offered(); + ChatContextKeys.enabled.bindTo(contextKeyService).set(false); + const hiddenAI = offered(); + ChatContextKeys.enabled.bindTo(contextKeyService).set(true); + await configurationService.updateValue(SESSIONS_LIST_INBOX_ENABLED_SETTING, false); + assert.deepStrictEqual({ initial, enabled, hiddenAI, disabled: offered() }, { + initial: false, enabled: true, hiddenAI: false, disabled: false, + }); + }); + + test('inbox triage menu respects the mode, triage state, and disabled AI', () => { + const { snapshot, grouping, contextKeyService } = createMenu(); + const state = SessionItemInboxStateContext.bindTo(contextKeyService); + const actions = () => snapshot(SessionItemContextMenuId).filter(item => ['Dismiss from Inbox', 'Return to Inbox', 'Put on Hold', 'Snooze...', 'Mark Session as Done'].includes(item.title)).map(item => item.title); + const archiveFilter = () => snapshot(Menus.SessionsViewFilter).filter(item => ['Show Done', 'Show Archived'].includes(item.title)).map(item => item.title); + const ordinary = actions(); + const ordinaryFilter = archiveFilter(); + grouping.set(SessionsGrouping.Inbox); + const active = actions(); + state.set('done'); + const done = actions(); + state.set('hold'); + const held = actions(); + ChatContextKeys.enabled.bindTo(contextKeyService).set(false); + assert.deepStrictEqual({ ordinary, ordinaryFilter, active, done, held, hidden: actions(), inboxFilter: archiveFilter() }, { + ordinary: [], ordinaryFilter: ['Show Done'], active: ['Put on Hold', 'Snooze...', 'Dismiss from Inbox', 'Mark Session as Done'], done: ['Return to Inbox', 'Put on Hold', 'Snooze...', 'Mark Session as Done'], + held: ['Return to Inbox', 'Snooze...', 'Dismiss from Inbox', 'Mark Session as Done'], hidden: [], inboxFilter: ['Show Archived'], + }); + }); + + test('inbox rows have distinct dismiss and archive actions in the toolbar and context menu', () => { + const { grouping, contextKeyService } = createMenu(); + const actions = (menu: MenuId) => MenuRegistry.getMenuItems(menu) + .filter(isIMenuItem) + .filter(item => ['sessionsViewPane.inboxDone', ARCHIVE_SESSION_COMMAND_ID].includes(item.command.id) && contextKeyService.contextMatchesRules(item.when)) + .sort((a, b) => (a.group ?? '').localeCompare(b.group ?? '') || (a.order ?? 0) - (b.order ?? 0)) + .map(item => [item.command.id, typeof item.command.title === 'string' ? item.command.title : item.command.title.value, item.command.icon]); + const snapshot = () => ({ toolbar: actions(Menus.SessionItemToolbar), contextMenu: actions(SessionItemContextMenuId) }); + const ordinary = snapshot(); + grouping.set(SessionsGrouping.Inbox); + const active = snapshot(); + SessionItemInboxStateContext.bindTo(contextKeyService).set('done'); + const dismissed = snapshot(); + const archivedContext = SessionIsArchivedContext.bindTo(contextKeyService); + archivedContext.set(true); + const archived = snapshot(); + archivedContext.set(false); + ChatContextKeys.enabled.bindTo(contextKeyService).set(false); + const dismissAction = ['sessionsViewPane.inboxDone', 'Dismiss from Inbox', Codicon.close]; + const archiveAction = [ARCHIVE_SESSION_COMMAND_ID, 'Mark Session as Done', Codicon.check]; + assert.deepStrictEqual({ ordinary, active, dismissed, archived, hidden: snapshot() }, { + ordinary: { toolbar: [], contextMenu: [] }, + active: { toolbar: [archiveAction, dismissAction], contextMenu: [dismissAction, archiveAction] }, + dismissed: { toolbar: [archiveAction], contextMenu: [archiveAction] }, + archived: { toolbar: [], contextMenu: [] }, + hidden: { toolbar: [], contextMenu: [] }, + }); + }); + + test('bulk inbox actions are undoable and never archive sessions', async () => { + const sessions = ['first', 'second', 'archived'].map(id => buildTestSession({ id, title: id, isArchived: id === 'archived' }).session); + const harness = createListHarness(store, sessions); + const model = store.add(harness.instantiationService.createInstance(SessionsListModelService)); + harness.instantiationService.stub(ISessionsListModelService, model); + const notices: ISessionsListNotice[] = []; + harness.instantiationService.stub(IViewsService, upcastPartial({}), 'getViewWithId', () => + upcastPartial({ listNotification: upcastPartial({ show: notice => notices.push(notice) }) })); + const run = (id: string) => CommandsRegistry.getCommand(id)!.handler(harness.instantiationService, sessions); + const states = () => sessions.map(session => model.getInboxState(session)?.kind); + model.setInboxState([sessions[0]], 'untilActivity'); + await run('sessionsViewPane.inboxDone'); + const done = states(); + await notices[0].undo!(); + const undone = states(); + await run('sessionsViewPane.inboxResume'); + const resumed = states(); + await notices[1].undo!(); + const restored = states(); + await run('sessionsViewPane.inboxHold'); + const held = states(); + await notices[2].undo!(); + assert.deepStrictEqual({ done, undone, resumed, restored, held, holdUndone: states(), archived: sessions.map(session => session.isArchived.get()), countdowns: notices.map(notice => notice.showCountdown) }, { + done: ['done', 'done', undefined], undone: ['untilActivity', undefined, undefined], + resumed: [undefined, undefined, undefined], restored: ['untilActivity', undefined, undefined], + held: ['hold', 'hold', undefined], holdUndone: ['untilActivity', undefined, undefined], archived: [false, false, true], + countdowns: [false, true, true], + }); + }); + + test('inbox snooze handles cancellation, timed presets, and validated custom dates', async () => { + const session = buildTestSession({ id: 'first', title: 'First' }).session; + const harness = createListHarness(store, [session]); + const model = store.add(harness.instantiationService.createInstance(SessionsListModelService)); + harness.instantiationService.stub(ISessionsListModelService, model); + harness.instantiationService.stub(IViewsService, upcastPartial({}), 'getViewWithId', () => undefined); + let choice: number | undefined; + let input: string | undefined = undefined; + const validation: (string | undefined | null)[] = []; + harness.instantiationService.stub(IQuickInputService, upcastPartial({}), 'pick', async (items: IQuickPickItem[]) => choice === undefined ? undefined : items[choice]); + harness.instantiationService.stub(IQuickInputService, 'input', async (options: IInputOptions) => { + for (const value of ['not a date', '2000-01-01 09:00', '2099-02-30 09:00', '2099-12-01 09:00']) { + const result = await options.validateInput!(value); + validation.push(typeof result === 'object' && result ? result.content : result); + } + return input; + }); + const run = () => CommandsRegistry.getCommand('sessionsViewPane.inboxSnooze')!.handler(harness.instantiationService, session); + await run(); + const cancelled = model.getInboxState(session); + choice = 1; + const now = new Date(); + await run(); + const timed = model.getInboxState(session); + choice = 4; + await run(); + const cancelledCustom = model.getInboxState(session); + input = '2099-12-01 09:00'; + await run(); + assert.deepStrictEqual({ cancelled, timed, cancelledCustom, custom: model.getInboxState(session), validation: validation.map(Boolean), archived: session.isArchived.get() }, { + cancelled: undefined, + timed: { kind: 'snoozed', until: new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1, 9).getTime() }, + cancelledCustom: timed, + custom: { kind: 'snoozed', until: new Date(2099, 11, 1, 9).getTime() }, + validation: [true, true, true, false, true, true, true, false], archived: false, + }); + }); + test('application filter command opens the Sessions view before showing its filter menu', async () => { const instantiationService = store.add(new TestInstantiationService()); const calls: string[] = []; diff --git a/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.ts b/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.ts index 09780b1dd49..b1f831108ef 100644 --- a/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.ts +++ b/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.ts @@ -39,7 +39,7 @@ import { getChatSessionType } from '../../../common/model/chatUri.js'; import { ChatModeKind } from '../../../common/constants.js'; import { localize } from '../../../../../../nls.js'; import { getAgentHostPluginEnablementActions } from '../../agentPluginActions.js'; -import type { ICustomizationSkillItem } from '../../aiCustomization/aiCustomizationItemSource.js'; +import type { ICustomizationHookItem, ICustomizationSkillItem } from '../../aiCustomization/aiCustomizationItemSource.js'; import { getMcpCustomizationSource } from '../../aiCustomization/mcpCustomizationSource.js'; @@ -166,7 +166,7 @@ export class AgentCustomizationItemProvider extends Disposable implements ICusto return items; } - private toDirectoryChildItem(child: ChildCustomization, source: AICustomizationSource, scope: AICustomizationScope | undefined, isRemote: boolean): ICustomizationItem | undefined { + private toDirectoryChildItem(child: ChildCustomization, source: AICustomizationSource, scope: AICustomizationScope | undefined, isRemote: boolean): ICustomizationHookItem | undefined { const type = toPromptsType(child.type); if (!type) { return undefined; @@ -201,16 +201,22 @@ export class AgentCustomizationItemProvider extends Disposable implements ICusto } } + const uri = this.toRemoteUri(child.uri); + let description = getChildDescription(child); + if (discovery?.hookType) { + description = hasReadableCustomizationContent(uri) ? discovery.sourceLabel + : discovery.sourceLabel + ? localize('discoveredHookSource', "{0} — Source file unavailable", discovery.sourceLabel) + : localize('discoveredHookSourceUnavailable', "Source file unavailable"); + } + return { itemKey: child.id, - uri: this.toRemoteUri(child.uri), + uri, type, name: hookMetadata?.label ?? child.name, - description: discovery?.hookType - ? discovery.sourceLabel - ? localize('discoveredHookSource', "{0} — Source file unavailable", discovery.sourceLabel) - : localize('discoveredHookSourceUnavailable', "Source file unavailable") - : getChildDescription(child), + description, + ...(child.type === CustomizationType.Hook && discovery?.hookType ? { isHookAction: true } : {}), enabled: child.type === CustomizationType.McpServer ? isCustomizationEnabled(child) : child.enabled, source, scope, diff --git a/src/vs/workbench/contrib/chat/test/browser/agentSessions/agentCustomizationItemProvider.test.ts b/src/vs/workbench/contrib/chat/test/browser/agentSessions/agentCustomizationItemProvider.test.ts index aac39b72e08..6e9ab850a09 100644 --- a/src/vs/workbench/contrib/chat/test/browser/agentSessions/agentCustomizationItemProvider.test.ts +++ b/src/vs/workbench/contrib/chat/test/browser/agentSessions/agentCustomizationItemProvider.test.ts @@ -17,12 +17,13 @@ import { URI } from '../../../../../../base/common/uri.js'; import { isEqual } from '../../../../../../base/common/resources.js'; import { upcastPartial } from '../../../../../../base/test/common/mock.js'; import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../../base/test/common/utils.js'; -import { IFileService } from '../../../../../../platform/files/common/files.js'; +import { IFileContent, IFileService } from '../../../../../../platform/files/common/files.js'; import { createInMemoryFileService } from '../../../../../../platform/files/test/common/inMemoryFileService.js'; import { NullLogService } from '../../../../../../platform/log/common/log.js'; import { ILabelService } from '../../../../../../platform/label/common/label.js'; +import { IProductService } from '../../../../../../platform/product/common/productService.js'; import { ExtensionIdentifier, IExtensionDescription } from '../../../../../../platform/extensions/common/extensions.js'; -import { CustomizationLoadStatus, CustomizationType, type AgentCustomization, type ClientPluginCustomization, type Customization, type McpServerCustomization, type PluginCustomization, type SkillCustomization } from '../../../../../../platform/agentHost/common/state/sessionState.js'; +import { CustomizationLoadStatus, CustomizationType, type AgentCustomization, type ClientPluginCustomization, type Customization, type HookCustomization, type McpServerCustomization, type PluginCustomization, type SkillCustomization } from '../../../../../../platform/agentHost/common/state/sessionState.js'; import { createAgentHostResourceUriMapper, toAgentHostUri } from '../../../../../../platform/agentHost/common/agentHostUri.js'; import { CustomizationEnablementKind, McpServerStatus } from '../../../../../../platform/agentHost/common/state/protocol/state.js'; import { AgentCustomizationItemProvider } from '../../../browser/agentSessions/agentHost/agentCustomizationItemProvider.js'; @@ -34,7 +35,7 @@ import { IExtensionPromptPath, IPromptPath, IPromptsService, PromptsStorage } fr import { SYNCED_CUSTOMIZATION_SCHEME } from '../../../../../../workbench/services/agentHost/common/agentHostFileSystemService.js'; import { withCustomizationDiscoveryMeta } from '../../../../../../platform/agentHost/common/meta/customizationDiscoveryMeta.js'; import { AGENT_BUILTIN_CUSTOMIZATION_SCHEME, hasReadableCustomizationContent } from '../../../../../../platform/agentHost/common/agentHostCustomizationUri.js'; -import { expandHookFileItems, ICustomizationSkillItem } from '../../../browser/aiCustomization/aiCustomizationItemSource.js'; +import { AICustomizationItemNormalizer, expandHookFileItems, ICustomizationSkillItem, ItemProviderItemSource } from '../../../browser/aiCustomization/aiCustomizationItemSource.js'; import { buildMcpResourceUri } from '../../../../../../platform/agentHost/common/mcpResourceUri.js'; import { withMcpServerDisplayNameMeta, withMcpServerSourceMeta } from '../../../../../../platform/agentHost/common/meta/mcpCustomizationMeta.js'; import { TestPathService } from '../../../../../test/browser/workbenchTestServices.js'; @@ -248,6 +249,69 @@ suite('AgentCustomizationItemProvider', () => { }); }); + for (const kind of agentHostConnectionKinds) { + for (const origin of ['repository', 'user'] as const) { + test(`keeps readable SDK ${origin} hook actions distinct while expanding hook-file records (${kind.name})`, async () => { + const session = URI.parse('other-session:/opaque'); + const definition = URI.file('/host/settings.json'); + const hookFile = URI.file('/host/hooks/legacy.json'); + const readRequests: string[] = []; + const fileService = upcastPartial({ + readFile: async uri => { + readRequests.push(uri.toString()); + return upcastPartial({ + value: VSBuffer.fromString(JSON.stringify({ + version: 1, + hooks: { sessionStart: ['first', 'second'].map(name => ({ type: 'command', bash: `echo ${name}`, powershell: `echo ${name}` })) }, + })) + }); + }, + }); + class TestCustomizationService extends NullAgentHostCustomizationService { + override getCustomizations(): readonly Customization[] { + return [{ + type: CustomizationType.Directory, id: 'hooks', uri: 'agent-discovery://other-host/hooks', + name: 'Hooks', contents: CustomizationType.Hook, enabled: true, writable: false, + children: [ + ...[true, false].map((enabled, index) => ({ + type: CustomizationType.Hook, id: `opaque-action-${index}`, uri: definition.toString(), + name: 'sessionStart', enabled, + _meta: withCustomizationDiscoveryMeta(undefined, { source: origin, sourceLabel: 'settings.json', hookType: 'sessionStart' }), + })), + { type: CustomizationType.Hook, id: 'hook-file', uri: hookFile.toString(), name: 'legacy.json' }, + ], + }]; + } + } + const provider = disposables.add(new AgentCustomizationItemProvider( + { clientId: 'vscode', resourceUris: kind.resourceUris }, undefined, undefined, fileService, + new NullLogService(), new TestCustomizationService(), makePromptsService(), labelService, + )); + const source = disposables.add(new ItemProviderItemSource( + session, provider, makePromptsService(), upcastPartial({ getActiveProjectRoot: () => undefined }), + fileService, new TestPathService(URI.file('/client-home')), new AICustomizationItemNormalizer(labelService, upcastPartial({})), + )); + const items = await source.fetchAICustomizationItems(PromptsType.hook); + const definitionUri = kind.toClient(definition).toString(); + const hookFileUri = kind.toClient(hookFile).toString(); + assert.deepStrictEqual({ + readRequests, + items: items.map(item => ({ id: item.id, uri: item.uri.toString(), description: item.description, disabled: item.disabled })), + actionSources: items.filter(item => item.id.startsWith('opaque-action-')).map(item => item.source), + }, { + readRequests: [hookFileUri], + items: [ + { id: 'opaque-action-0', uri: definitionUri, description: 'settings.json', disabled: false }, + { id: 'opaque-action-1', uri: definitionUri, description: 'settings.json', disabled: true }, + { id: hookFileUri, uri: hookFileUri, description: 'echo first', disabled: false }, + { id: `${hookFileUri}#1`, uri: hookFileUri, description: 'echo second', disabled: false }, + ], + actionSources: [origin === 'repository' ? AICustomizationSources.local : AICustomizationSources.user, origin === 'repository' ? AICustomizationSources.local : AICustomizationSources.user], + }); + }); + } + } + test('preserves provider metadata when expanding readable hook files', async () => { const fileService = createInMemoryFileService(disposables, Schemas.file); const uri = URI.file('/workspace/.github/hooks/hooks.json'); diff --git a/src/vs/workbench/contrib/chat/test/common/promptSyntax/hookCompatibility.test.ts b/src/vs/workbench/contrib/chat/test/common/promptSyntax/hookCompatibility.test.ts index 8e5e00c31d4..8a013418bcd 100644 --- a/src/vs/workbench/contrib/chat/test/common/promptSyntax/hookCompatibility.test.ts +++ b/src/vs/workbench/contrib/chat/test/common/promptSyntax/hookCompatibility.test.ts @@ -13,25 +13,12 @@ import { URI } from '../../../../../../base/common/uri.js'; suite('HookCompatibility', () => { ensureNoDisposablesAreLeakedInTestSuite(); - test('recognizes userPromptTransformed for Copilot without advertising it for other harnesses', () => { - assert.deepStrictEqual({ - copilot: HOOKS_BY_TARGET[Target.GitHubCopilot].userPromptTransformed, - alias: getCanonicalAgentHookName(Target.GitHubCopilot, 'UserPromptTransformed'), - vscode: getCanonicalAgentHookName(Target.VSCode, 'UserPromptTransformed'), - claude: getCanonicalAgentHookName(Target.Claude, 'UserPromptTransformed'), - }, { - copilot: HookType.UserPromptTransformed, - alias: 'userPromptTransformed', - vscode: undefined, - claude: undefined, - }); - }); - suite('buildNewHookFile', () => { const copilotHookNames: [HookType, string][] = [ [HookType.SessionStart, 'sessionStart'], [HookType.SessionEnd, 'sessionEnd'], [HookType.UserPromptSubmit, 'userPromptSubmitted'], + [HookType.UserPromptTransformed, 'userPromptTransformed'], [HookType.PreToolUse, 'preToolUse'], [HookType.PostToolUse, 'postToolUse'], [HookType.PreCompact, 'preCompact'], @@ -71,6 +58,20 @@ suite('HookCompatibility', () => { }); }); + test('recognizes userPromptTransformed for Copilot without advertising it for other harnesses', () => { + assert.deepStrictEqual({ + copilot: HOOKS_BY_TARGET[Target.GitHubCopilot].userPromptTransformed, + alias: getCanonicalAgentHookName(Target.GitHubCopilot, 'UserPromptTransformed'), + vscode: getCanonicalAgentHookName(Target.VSCode, 'UserPromptTransformed'), + claude: getCanonicalAgentHookName(Target.Claude, 'UserPromptTransformed'), + }, { + copilot: HookType.UserPromptTransformed, + alias: 'userPromptTransformed', + vscode: undefined, + claude: undefined, + }); + }); + suite('parseCopilotHooks', () => { const workspaceRoot = URI.file('/workspace'); const userHome = '/home/user'; diff --git a/src/vs/workbench/contrib/chat/test/common/requestParser/chatRequestParser.test.ts b/src/vs/workbench/contrib/chat/test/common/requestParser/chatRequestParser.test.ts index 2317f868484..fadb0bc8cfe 100644 --- a/src/vs/workbench/contrib/chat/test/common/requestParser/chatRequestParser.test.ts +++ b/src/vs/workbench/contrib/chat/test/common/requestParser/chatRequestParser.test.ts @@ -24,7 +24,7 @@ import { IChatService } from '../../../common/chatService/chatService.js'; import { IChatSlashCommandService } from '../../../common/participants/chatSlashCommands.js'; import { LocalChatSessionUri } from '../../../common/model/chatUri.js'; import { IChatVariablesService } from '../../../common/attachments/chatVariables.js'; -import { AgentHostCompletionReferenceKind, chatReferenceVariableEntryId, toAgentHostCompletionVariableEntry, toChatReferenceDynamicVariableValue } from '../../../common/attachments/chatVariableEntries.js'; +import { AgentHostCompletionReferenceKind, ChatSessionReferenceVariableId, chatReferenceVariableEntryId, toAgentHostCompletionVariableEntry, toChatReferenceDynamicVariableValue } from '../../../common/attachments/chatVariableEntries.js'; import { ChatAgentLocation, ChatModeKind } from '../../../common/constants.js'; import { IToolData, ToolAndToolSetEnablementMap, ToolDataSource, ToolSet } from '../../../common/tools/languageModelToolsService.js'; import { IPromptsService } from '../../../common/promptSyntax/service/promptsService.js'; @@ -63,6 +63,23 @@ suite('ChatRequestParser', () => { await assertSnapshot(result); }); + test('inline session references become session attachments while unrelated URI variables remain generic', () => { + const target = URI.parse('opaque-host-session:/target'); + const text = 'Compare #session:Target #custom:Target'; + variableService.setDynamicVariables(testSessionUri, [ + { id: ChatSessionReferenceVariableId, fullName: 'Target', range: new Range(1, 9, 1, 24), data: target }, + { id: 'custom', range: new Range(1, 25, 1, 39), data: target }, + ]); + parser = instantiationService.createInstance(ChatRequestParser); + const entries = parser.parseChatRequest(testSessionUri, text).parts + .filter((part): part is ChatRequestDynamicVariablePart => part instanceof ChatRequestDynamicVariablePart) + .map(part => part.toVariableEntry()); + assert.deepStrictEqual(entries.map(entry => ({ kind: entry.kind, id: entry.id, name: entry.name, value: entry.value })), [ + { kind: 'sessionReference', id: target.toString(), name: 'Target', value: target }, + { kind: 'generic', id: 'custom', name: 'custom:Target', value: target }, + ]); + }); + test('plain text with newlines', async () => { parser = instantiationService.createInstance(ChatRequestParser); const text = 'line 1\nline 2\r\nline 3'; diff --git a/src/vs/workbench/contrib/sessions/browser/agentFeedback.ts b/src/vs/workbench/contrib/sessions/browser/agentFeedback.ts index d3816424386..f488126baef 100644 --- a/src/vs/workbench/contrib/sessions/browser/agentFeedback.ts +++ b/src/vs/workbench/contrib/sessions/browser/agentFeedback.ts @@ -98,6 +98,8 @@ export interface ISubmitFeedbackOptions { * request goes to this chat. */ readonly targetChat?: URI; + /** Sends to the explicit target chat without opening a widget; rejects on failure. */ + readonly background?: boolean; /** Submit Agent Host feedback without requiring or focusing a chat widget. */ readonly backgroundSubmit?: (query: string, attachment: IAgentFeedbackVariableEntry) => Promise; readonly onRequestAccepted?: () => void; @@ -185,6 +187,8 @@ export interface IAgentFeedbackService { * Get all feedback items for a session. */ getFeedback(sessionResource: URI): readonly IAgentFeedback[]; + /** Observes existing feedback without keeping unopened sessions subscribed after the observer is disposed. */ + getFeedbackObservable(sessionResource: URI): IObservable; /** Whether feedback for this session is owned by an Agent Host annotations channel. */ isAgentHostSession(sessionResource: URI): boolean; diff --git a/src/vs/workbench/contrib/sessions/browser/chat/newChatWidget.ts b/src/vs/workbench/contrib/sessions/browser/chat/newChatWidget.ts index 3e74b405876..2acb515751b 100644 --- a/src/vs/workbench/contrib/sessions/browser/chat/newChatWidget.ts +++ b/src/vs/workbench/contrib/sessions/browser/chat/newChatWidget.ts @@ -32,12 +32,13 @@ import { RemoteAgentHostConnectionStatus } from '../../../../../platform/agentHo import { getSessionWorkspaceProperties } from '../../../../../platform/agentHost/common/sessionConfigProperties.js'; import { localize } from '../../../../../nls.js'; import { ICreateNewSessionOptions, INewSessionDraftSlot, ISendRequestOptions, ISessionsManagementService, trackNewSessionRequestEnd, WorkspaceNotTrustedError } from '../../common/sessionsManagement.js'; +import { ChatModelSource, GITHUB_REMOTE_FILE_SCHEME, ISession, ISessionWorkspace, isSessionCreated, SESSION_WORKSPACE_GROUP_GITHUB } from '../../../../services/sessions/common/session.js'; import { IOpenNewSessionResult, ISessionsService } from '../sessionsService.js'; -import { getMainWindowHost, ISessionHostService } from '../sessionHost.js'; +import { getMainWindowHost, ISessionHostService } from '../../../../services/sessions/browser/sessionHost.js'; import { ISessionsProvidersService } from '../sessionsProvidersService.js'; import { ISessionsProvider } from '../../common/sessionsProvider.js'; import { getNoWorkspaceDescription, getQuickChatProviderLabel, getRemoteQuickChatSelectedLabel } from './noWorkspaceChoice.js'; -import { shouldShowGitHubWorkspaceGroupSignIn } from '../sessionsAuthGate.js'; +import { shouldShowGitHubWorkspaceGroupSignIn } from '../../../../services/sessions/browser/sessionsAuthGate.js'; import { AGENTIC_SIGN_IN_COMMAND_ID, FOCUS_NEW_SESSION_ENVIRONMENT_PICKER_COMMAND_ID, FOCUS_NEW_SESSION_HARNESS_PICKER_COMMAND_ID, FOCUS_NEW_SESSION_WORKSPACE_PICKER_COMMAND_ID } from '../../common/sessionCommands.js'; import { IAgentHostSessionsProvider, isAgentHostEnvironmentAvailable, isAgentHostProvider, LOCAL_AGENT_HOST_PROVIDER_ID } from '../../common/agentHostSessionsProvider.js'; import { NewSessionComposerFocusContext, NewSessionCreationProviderIdContext } from '../../common/contextkeys.js'; @@ -55,7 +56,7 @@ import { IChatRequestVariableEntry } from '../../../chat/common/attachments/chat import { IAgentHostFilterService } from '../../common/agentHostFilter.js'; import { IChatViewOptions, INewSessionDraftHost, INewSessionTarget } from '../parts/chatView.js'; import { NewChatUserInteraction } from './newChatUserInteraction.js'; -import { WorkspaceSelectionOrigin, ISelectNoWorkspaceOptions, ISelectWorkspaceOptions, WorkspaceSelectionResult } from '../../common/workspaceSelection.js'; +import { WorkspaceSelectionOrigin, ISelectNoWorkspaceOptions, ISelectWorkspaceOptions, WorkspaceSelectionResult } from '../../../../services/sessions/common/workspaceSelection.js'; import { ISessionPickerFocusOptions, ISessionPickerVisibility, noSessionPickerVisibility } from '../../common/sessionPickerVisibility.js'; import { AGENT_FEEDBACK_NEW_SESSION_RESOURCE, IAgentFeedbackService } from '../agentFeedback.js'; import { AgentFeedbackState, IAgentFeedback } from '../agentFeedbackModel.js'; @@ -458,11 +459,15 @@ export class NewChatWidget extends Disposable { session?.workspace.read(reader); session?.loading.read(reader); session?.isQuickChat?.read(reader); - return this._shouldShowComparisonAction(); + return this._shouldShowComparisonAction(reader); }), modelId => this.languageModelsService.lookupLanguageModel(modelId)?.name, constObservable(true), observableFromEvent(this, Event.filter(this.configurationService.onDidChangeConfiguration, event => event.affectsConfiguration(COMPARE_AGENTS_SHOW_PICKER_HINT_SETTING)), - () => this.configurationService.getValue(COMPARE_AGENTS_SHOW_PICKER_HINT_SETTING)))); + () => this.configurationService.getValue(COMPARE_AGENTS_SHOW_PICKER_HINT_SETTING)), + derived(this, reader => { + const session = this._session.read(reader); + return !session || session.loading.read(reader) || comparisonConfigResolving.read(reader); + }))); const canSendRequest = derived(reader => { const session = this._session.read(reader); if (!session) { @@ -2077,8 +2082,14 @@ export class NewChatWidget extends Disposable { } } - private _getComparisonBranch(session = this._session.get()): string | undefined { + private _getComparisonBranch(session = this._session.get(), reader?: IReader): string | undefined { const selectedFolderUri = this._workspacePicker.selectedFolderUri; + const sessionRepository = getComparisonSessionFolder(session, selectedFolderUri)?.gitRepository; + const selectedWorkspaceRepository = getComparisonSelectedWorkspaceFolder(this._workspacePicker.selectedResolved?.workspace, selectedFolderUri)?.gitRepository; + const repository = sessionRepository ?? selectedWorkspaceRepository; + if (repository?.isRepository?.read(reader) === false) { + return undefined; + } const provider = session ? this.sessionsProvidersService.getProvider(session.providerId, session.sessionId) : undefined; const matchesSelectedFolder = !selectedFolderUri || !!session?.workspace.get()?.folders.some(folder => isEqual(folder.root, selectedFolderUri)); if (session && provider && isAgentHostProvider(provider) && matchesSelectedFolder) { @@ -2090,12 +2101,10 @@ export class NewChatWidget extends Disposable { return branch; } } - const selectedWorkspaceRepository = getComparisonSelectedWorkspaceFolder(this._workspacePicker.selectedResolved?.workspace, selectedFolderUri)?.gitRepository; const selectedWorkspaceBranch = selectedWorkspaceRepository?.branchName?.trim() || selectedWorkspaceRepository?.baseBranchName?.trim(); if (selectedWorkspaceBranch) { return selectedWorkspaceBranch; } - const sessionRepository = getComparisonSessionFolder(session, selectedFolderUri)?.gitRepository; const workspaceBranch = sessionRepository?.branchName?.trim() || sessionRepository?.baseBranchName?.trim(); if (workspaceBranch) { return workspaceBranch; @@ -2114,7 +2123,6 @@ export class NewChatWidget extends Disposable { if (this._draftHost) { return false; } - const session = this._session.get(); const provider = session ? this.sessionsProvidersService.getProvider(session.providerId, session.sessionId) : undefined; const selectedFolderUri = this._workspacePicker.selectedFolderUri; @@ -2130,7 +2138,7 @@ export class NewChatWidget extends Disposable { if (!sessionMatchesSelectedFolder) { return false; } - if (this._getComparisonBranch(session) === undefined) { + if (this._getComparisonBranch(session, reader) === undefined) { return false; } const sessionConfig = session && providerIsAgentHost && !resolvingConfig ? provider.getSessionConfig(session.sessionId, session.mainChat.get().resource) : undefined; diff --git a/src/vs/workbench/contrib/sessions/browser/sessionInputBanners/sessionWorktreeCleanupService.ts b/src/vs/workbench/contrib/sessions/browser/sessionInputBanners/sessionWorktreeCleanupService.ts index 73d485d3697..ab9ad390293 100644 --- a/src/vs/workbench/contrib/sessions/browser/sessionInputBanners/sessionWorktreeCleanupService.ts +++ b/src/vs/workbench/contrib/sessions/browser/sessionInputBanners/sessionWorktreeCleanupService.ts @@ -85,6 +85,12 @@ export type SessionWorktreeCleanupProgress = | { readonly state: 'scheduled'; readonly candidate: ISessionWorktreeCleanupCandidate } | { readonly state: 'failed'; readonly candidate: ISessionWorktreeCleanupCandidate; readonly message: string }; +export interface ISessionWorktreeCleanupOperation { + readonly candidate: ISessionWorktreeCleanupCandidate; + readonly state: 'queued' | 'pending' | 'failed'; + readonly message?: string; +} + export interface ISessionWorktreeCleanupSuggestion { readonly description: string; manage(): Promise; @@ -120,6 +126,8 @@ export const ISessionWorktreeCleanupService = createDecorator; + readonly cleanupOperations: IObservable; + readonly isSchedulingCleanup: IObservable; activate(): Promise; refresh(): Promise; suppressForWindow(): void; @@ -162,6 +170,10 @@ export class SessionWorktreeCleanupService extends Disposable implements ISessio private _availableDiskSpace: number | undefined; private readonly _suggestion = observableValue(this, undefined); readonly suggestion: IObservable = this._suggestion; + private readonly _cleanupOperations = observableValue(this, []); + readonly cleanupOperations = this._cleanupOperations; + private readonly _isSchedulingCleanup = observableValue(this, false); + readonly isSchedulingCleanup = this._isSchedulingCleanup; constructor( @ISessionsManagementService private readonly sessionsManagementService: ISessionsManagementService, @@ -192,6 +204,12 @@ export class SessionWorktreeCleanupService extends Disposable implements ISessio this._register(this.sessionsManagementService.onDidArchiveSession(() => { this._updateSuggestion(); })); + this._register(this.sessionsManagementService.onDidUnarchiveSession(session => { + this._cleanupOperations.set(this._cleanupOperations.get().filter(operation => operation.candidate.session?.sessionId !== session.sessionId), undefined); + this._lastMeasuredWorktrees = undefined; + this._lastScanAt = -Infinity; + this._updateSuggestion(); + })); this._register(this.sessionsManagementService.onDidChangeSessions(() => { this._updateSuggestion(); this._refreshScheduler.schedule(); @@ -449,7 +467,25 @@ export class SessionWorktreeCleanupService extends Disposable implements ISessio } private _withUnlinkedWorktrees(worktrees: readonly ISessionWorktree[]): readonly ISessionWorktree[] { - return [...worktrees, ...this._unlinkedWorktrees].filter(isWorktreeCleanupBranchSupported); + const combined = [...worktrees, ...this._unlinkedWorktrees].filter(isWorktreeCleanupBranchSupported); + if (!this._isSchedulingCleanup.get()) { + const byId = new Map(combined.map(worktree => [getWorktreeCleanupId(worktree), worktree])); + const operations = this._cleanupOperations.get(); + const next = operations.flatMap(operation => { + const worktree = byId.get(getWorktreeCleanupId(operation.candidate)); + if (worktree?.worktreeExists === false) { + return []; + } + if (operation.state === 'pending' && (worktree?.cleanupStatus?.state === 'failed' || worktree?.cleanupStatus?.state === 'skipped' || worktree?.cleanupStatus?.state === 'inUse')) { + return [{ ...operation, state: 'failed' as const, message: undefined }]; + } + return [operation]; + }); + if (next.length !== operations.length || next.some((operation, index) => operation !== operations[index])) { + this._cleanupOperations.set(next, undefined); + } + } + return combined; } /** Counts the distinct worktree checkouts a session owns so the threshold measures worktrees, not sessions. */ @@ -705,15 +741,28 @@ export class SessionWorktreeCleanupService extends Disposable implements ISessio } async cleanupWorktrees(selected: readonly ISessionWorktreeCleanupCandidate[], onProgress?: (progress: SessionWorktreeCleanupProgress) => void, force = false): Promise { - if (selected.length === 0) { + if (selected.length === 0 || this._isSchedulingCleanup.get()) { return false; } + this._isSchedulingCleanup.set(true, undefined); + try { + return await this._cleanupWorktrees(selected, onProgress, force); + } finally { + this._isSchedulingCleanup.set(false, undefined); + } + } + + private async _cleanupWorktrees(selected: readonly ISessionWorktreeCleanupCandidate[], onProgress: ((progress: SessionWorktreeCleanupProgress) => void) | undefined, force: boolean): Promise { if (selected.some(candidate => !isWorktreeCleanupBranchSupported(candidate))) { throw new Error(localize('worktreeCleanup.branchUnavailable', "Only worktrees on agent-managed branches can be cleaned up.")); } if (selected.some(candidate => candidate.isListedByHost === false)) { throw new Error(localize('worktreeCleanup.notListed', "This worktree is no longer listed by its host. Refresh the worktree inventory before cleanup.")); } + const pending = new Set(this._cleanupOperations.get().filter(operation => operation.state !== 'failed').map(operation => getWorktreeCleanupId(operation.candidate))); + if (selected.some(candidate => pending.has(getWorktreeCleanupId(candidate)))) { + throw new Error(localize('worktreeCleanup.alreadyScheduled', "Cleanup is already scheduled for a selected worktree. Refresh its status before trying again.")); + } const selectedBytes = getWorktreeCleanupDiskUsage(selected); const worktreeCount = selected.reduce((total, candidate) => total + candidate.worktreeCount, 0); @@ -738,6 +787,11 @@ export class SessionWorktreeCleanupService extends Disposable implements ISessio return false; } + const selectedIds = new Set(selected.map(getWorktreeCleanupId)); + this._cleanupOperations.set([ + ...this._cleanupOperations.get().filter(operation => !selectedIds.has(getWorktreeCleanupId(operation.candidate))), + ...selected.map(candidate => ({ candidate, state: 'queued' as const })), + ], undefined); onProgress?.({ state: 'started' }); const failures: string[] = []; let failedWorktrees = 0; @@ -749,6 +803,11 @@ export class SessionWorktreeCleanupService extends Disposable implements ISessio }, async progress => { let completedWorktrees = 0; for (const candidate of selected) { + const id = getWorktreeCleanupId(candidate); + const isCancelled = () => !this._cleanupOperations.get().some(operation => getWorktreeCleanupId(operation.candidate) === id); + if (isCancelled()) { + continue; + } try { if (force && candidate.session && !candidate.session.isArchived.get()) { throw new Error(localize('worktreeCleanup.forceNotArchived', "Only sessions marked as done can have their worktrees forcibly removed.")); @@ -775,11 +834,19 @@ export class SessionWorktreeCleanupService extends Disposable implements ISessio } catch (error) { const message = getErrorMessage(error); this.logService.warn('[SessionWorktreeCleanupService] Failed to schedule worktree cleanup', error); + if (isCancelled()) { + continue; + } failures.push(localize('worktreeCleanup.sessionFailure', "{0}: {1}", getWorktreeCleanupTitle(candidate), message)); failedWorktrees += candidate.worktreeCount; + this._updateCleanupOperation(candidate, 'failed', message); onProgress?.({ state: 'failed', candidate, message }); continue; } + if (isCancelled()) { + continue; + } + this._updateCleanupOperation(candidate, 'pending'); onProgress?.({ state: 'scheduled', candidate }); completedWorktrees += candidate.worktreeCount; progress.report({ @@ -801,6 +868,12 @@ export class SessionWorktreeCleanupService extends Disposable implements ISessio return true; } + private _updateCleanupOperation(candidate: ISessionWorktreeCleanupCandidate, state: ISessionWorktreeCleanupOperation['state'], message?: string): void { + const id = getWorktreeCleanupId(candidate); + this._cleanupOperations.set(this._cleanupOperations.get().map(operation => getWorktreeCleanupId(operation.candidate) === id + ? { candidate, state, message } : operation), undefined); + } + private _isEnabled(): boolean { return this.configurationService.getValue(AGENT_SESSIONS_STORAGE_CLEANUP_SUGGESTION_SETTING) === true; } diff --git a/src/vs/workbench/contrib/sessions/browser/sessionsManagementService.ts b/src/vs/workbench/contrib/sessions/browser/sessionsManagementService.ts index 05d66a59044..fd3dc1399e2 100644 --- a/src/vs/workbench/contrib/sessions/browser/sessionsManagementService.ts +++ b/src/vs/workbench/contrib/sessions/browser/sessionsManagementService.ts @@ -17,18 +17,13 @@ import { URI } from '../../../../base/common/uri.js'; import { hasKey } from '../../../../base/common/types.js'; import { ILogService } from '../../../../platform/log/common/log.js'; import { INotificationService } from '../../../../platform/notification/common/notification.js'; -import { agentHostAuthority } from '../../../../platform/agentHost/common/agentHostUri.js'; -import { IRemoteAgentHostService } from '../../../../platform/agentHost/common/remoteAgentHostService.js'; import { IChatService } from '../../chat/common/chatService/chatService.js'; import { IChatSessionsService } from '../../chat/common/chatSessionsService.js'; import { ChatAgentLocation } from '../../chat/common/constants.js'; import { IChatWidgetHistoryService } from '../../chat/common/widget/chatWidgetHistoryService.js'; -import { buildHostLocalEventsPath, dedupeMigratedCopilotCliSessions, getCopilotCliSessionRawId } from '../../chat/browser/copilotCliEventsUri.js'; -import { IChatRequestVariableEntry } from '../../chat/common/attachments/chatVariableEntries.js'; -import { ICopilotHomeService } from '../../../services/environment/common/copilotHomeService.js'; +import { dedupeMigratedCopilotCliSessions } from '../../chat/browser/copilotCliEventsUri.js'; import { IUriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentity.js'; -import { getSessionReferenceResource } from './sessionReference.js'; -import { IChatDeletedEvent, ISessionCanvasClosedEvent, ISessionChatMoveTarget, ICreateNewChatInSessionOptions, ICreateNewSessionOptions, IDeferredNewSessionRequestOptions, IManagedSessionWorktree, IMarkSessionReadOptions, IProviderSessionType, ISendRequestOptions, ISendRequestSentEvent, ISessionsChangeEvent, ISessionsManagementService, NewSessionRequestOptions, WorkspaceNotTrustedError } from '../common/sessionsManagement.js'; +import { IChatDeletedEvent, ISessionCanvasClosedEvent, ISessionChatMoveTarget, ICreateNewChatInSessionOptions, ICreateNewSessionOptions, ICreateNewSessionSlotOptions, IDeferredNewSessionRequestOptions, INewSessionDraftSlot, INewSessionRequestAcceptedEvent, INewSessionRequestEndedEvent, IManagedSessionWorktree, IMarkSessionReadOptions, IProviderSessionType, ISendRequestOptions, ISendRequestSentEvent, ISessionsChangeEvent, ISessionsManagementService, NewSessionRequestOptions, WorkspaceNotTrustedError } from '../common/sessionsManagement.js'; import { ISessionsProvidersChangeEvent, ISessionsProvidersService } from './sessionsProvidersService.js'; import { IChatMovedEvent, IDeleteChatOptions, type IForkChatOptions, type INestedChatWorkspace, IPreparedNewSession, NestedChatWorkspaceError, SessionMoveRefusedError, ISessionChangeEvent, ISessionChangesetOperationInvokedEvent, ISessionCreationTarget, ISessionsProvider, type ISessionsProviderCreateSessionOptions, type SessionResourceResolveReason } from '../common/sessionsProvider.js'; import { ChatModelSource, IChat, ISession, ISessionCanvas, ISessionCanvasDefinition, ISessionWorkspace, ISideChatSelection, isActiveSessionStatus, SESSION_WORKSPACE_GROUP_REMOTE, SessionStatus, ISessionType, type SessionCanvasDefinitionSnapshot, getChatHarness } from '../../../services/sessions/common/session.js'; @@ -186,8 +181,6 @@ export class SessionsManagementService extends Disposable implements ISessionsMa @IChatService private readonly chatService: IChatService, @IChatWidgetHistoryService private readonly chatWidgetHistoryService: IChatWidgetHistoryService, @IStorageService private readonly storageService: IStorageService, - @ICopilotHomeService private readonly copilotHomeService: ICopilotHomeService, - @IRemoteAgentHostService private readonly remoteAgentHostService: IRemoteAgentHostService, @IWorkspaceTrustManagementService private readonly workspaceTrustManagementService: IWorkspaceTrustManagementService, @INotificationService private readonly notificationService: INotificationService, @IChatSessionsService private readonly chatSessionsService: IChatSessionsService, @@ -923,63 +916,6 @@ export class SessionsManagementService extends Disposable implements ISessionsMa return provider.createSideChat(session.sessionId, sourceChat, turnId, selection, includeSourceContext); } - /** - * For a `/troubleshoot` request, strip any `#session` marker attachments and - * append a `Session log:` line with the resolved host-local `events.jsonl` - * path(s) — the referenced sessions if present, otherwise the current one. - * Returns `options` unchanged when there is nothing to do. - */ - private _augmentOptionsForTroubleshoot(session: ISession, options: ISendRequestOptions): ISendRequestOptions { - // Separate any `#session` reference attachments from the real context. - const referencedResources: URI[] = []; - let remainingAttachments: IChatRequestVariableEntry[] | undefined; - if (options.attachedContext?.length) { - const remaining: IChatRequestVariableEntry[] = []; - for (const entry of options.attachedContext) { - const referenced = getSessionReferenceResource(entry); - if (referenced) { - referencedResources.push(referenced); - } else { - remaining.push(entry); - } - } - if (referencedResources.length) { - remainingAttachments = remaining; - } - } - - const isTroubleshoot = /^\s*\/troubleshoot(?=\s|$)/.test(options.query); - if (!isTroubleshoot && referencedResources.length === 0) { - return options; - } - - // Drop the reference attachments (only meaningful to us, not the model). - let result = options; - if (remainingAttachments) { - result = { ...result, attachedContext: remainingAttachments.length ? remainingAttachments : undefined }; - } - if (!isTroubleshoot) { - return result; - } - - // Resolve the target session(s): referenced ones if present, else the - // current session. - const targets = referencedResources.length - ? referencedResources - : (getCopilotCliSessionRawId(session.resource) ? [session.resource] : []); - const copilotHome = this.copilotHomeService.home; - const getConnection = (authority: string) => this.remoteAgentHostService.connections.find(c => agentHostAuthority(c.address) === authority); - const eventPaths = Array.from(new Set( - targets - .map(resource => buildHostLocalEventsPath(resource, copilotHome, getConnection)) - .filter((path): path is string => !!path) - )); - if (eventPaths.length === 0) { - return result; - } - return { ...result, query: `${result.query}\n\nSession log: ${eventPaths.join(', ')}` }; - } - async sendNewChatRequest(session: ISession, options: ISendRequestOptions): Promise { let provider = this._getProvider(session); if (!provider) { @@ -1040,12 +976,11 @@ export class SessionsManagementService extends Disposable implements ISessionsMa // Ask the provider to create the new chat, then send the request. const chat = await provider.createNewChat(session.sessionId, options.query); - const sendOptions = this._augmentOptionsForTroubleshoot(session, options); const chatResourceKey = chat.resource.toString(); this._pendingSendChatResources.add(chatResourceKey); let updatedSession: ISession; try { - updatedSession = await provider.sendRequest(session.sessionId, chat.resource, sendOptions); + updatedSession = await provider.sendRequest(session.sessionId, chat.resource, options); } finally { this._pendingSendChatResources.delete(chatResourceKey); } @@ -1446,7 +1381,6 @@ export class SessionsManagementService extends Disposable implements ISessionsMa // Suppress the `chatService.onDidSubmitRequest` mirror for this send so // `_onDidSendRequest` is not fired twice for providers that dispatch // through `chatService.sendRequest` (see the mirror in the constructor). - const sendOptions = this._augmentOptionsForTroubleshoot(session, options); const chatResourceKey = chat.resource.toString(); this._pendingSendChatResources.add(chatResourceKey); const cancellationListener = token.onCancellationRequested(() => { @@ -1456,7 +1390,7 @@ export class SessionsManagementService extends Disposable implements ISessionsMa }); let updatedSession: ISession; try { - updatedSession = await provider.sendRequest(session.sessionId, chat.resource, sendOptions); + updatedSession = await provider.sendRequest(session.sessionId, chat.resource, options); } finally { cancellationListener.dispose(); this._pendingSendChatResources.delete(chatResourceKey); @@ -1498,12 +1432,11 @@ export class SessionsManagementService extends Disposable implements ISessionsMa // send pair to keep the sent chat active in the visible slot. this._onWillSendRequest.fire(session); - const sendOptions = this._augmentOptionsForTroubleshoot(session, options); const chatResourceKey = chat.resource.toString(); this._pendingSendChatResources.add(chatResourceKey); let updatedSession: ISession; try { - updatedSession = await provider.sendRequest(session.sessionId, chat.resource, sendOptions); + updatedSession = await provider.sendRequest(session.sessionId, chat.resource, options); } finally { this._pendingSendChatResources.delete(chatResourceKey); } @@ -1529,21 +1462,12 @@ export class SessionsManagementService extends Disposable implements ISessionsMa * {@link _onWillSendRequest}, so the view's send-follow never navigates the * visible slot into the sent chat. Errors are propagated to the caller. */ - async sendRequestInBackground(session: ISession, chat: IChat, options: ISendRequestOptions): Promise { - const provider = this._getProvider(session); - if (!provider || this.getSession(session.resource) !== session || !session.chats.get().includes(chat)) { - throw new Error(localize('sessions.backgroundTargetUnavailable', "The target session or chat is no longer available.")); - } - await this._sendRequestInBackground(provider, session, chat, { ...options, background: true }); - } - private async _sendRequestInBackground(provider: ISessionsProvider, session: ISession, chat: IChat, options: ISendRequestOptions): Promise { - const sendOptions = this._augmentOptionsForTroubleshoot(session, options); const chatResourceKey = chat.resource.toString(); this._pendingSendChatResources.add(chatResourceKey); let updatedSession: ISession; try { - updatedSession = await provider.sendRequest(session.sessionId, chat.resource, sendOptions); + updatedSession = await provider.sendRequest(session.sessionId, chat.resource, options); } finally { this._pendingSendChatResources.delete(chatResourceKey); } diff --git a/src/vs/workbench/contrib/sessions/browser/views/sessionsList.ts b/src/vs/workbench/contrib/sessions/browser/views/sessionsList.ts index 8b1a0e26ce5..ec4b8ce5e00 100644 --- a/src/vs/workbench/contrib/sessions/browser/views/sessionsList.ts +++ b/src/vs/workbench/contrib/sessions/browser/views/sessionsList.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { SessionInlineActions } from './sessionInlineActions.js'; import '../media/sessionsList.css'; import { SessionGroupAppearancePicker } from './sessionGroupAppearancePicker.js'; import { findSearchWords, getSessionSearchHint, ISessionSearchDocument, ISessionSearchField, ISessionSearchHint, ISessionSearchMatch, ISessionsListSearchResults, matchSessionSearch, SessionsListFindController, SessionsListSearchQuery, SessionsListSearchTelemetry, SessionSearchFieldKind, toSearchFilterData } from './sessionsListSearch.js'; @@ -41,8 +42,8 @@ import { ContextKeyValue, IContextKey, IContextKeyService, RawContextKey } from import { MarshalledId } from '../../../../../base/common/marshallingIds.js'; import { SessionProviderIdContext, SessionSupportsDeleteContext, SessionSupportsMultipleChatsContext, SessionSupportsRenameContext, SessionTypeContext, IsPhoneLayoutContext, IsQuickChatSessionContext, SessionIsArchivedContext, SessionIsReadContext, SessionHasPullRequestContext, SessionItemIsMultiSelectionContext } from '../../common/contextkeys.js'; import { ARCHIVE_SESSION_COMMAND_ID, ARCHIVE_SESSIONS_WITH_UNDO_COMMAND_ID, DELETE_SESSION_GROUP_WITH_UNDO_COMMAND_ID, RENAME_CHAT_COMMAND_ID, RENAME_SESSION_COMMAND_ID } from '../../common/sessionCommands.js'; -import { ExternalSessionApplicationBadgeMode, SESSIONS_LIST_EXTERNAL_APPLICATION_BADGE_SETTING, SESSIONS_LIST_EXTERNAL_APPLICATION_BADGE_SHOW_FROM_SETTING, SESSIONS_LIST_GROUP_EXTERNAL_SESSIONS_SETTING } from '../../common/sessionConfig.js'; -import { UNKNOWN_SESSION_APPLICATION_ID } from '../../common/sessionApplication.js'; +import { ExternalSessionApplicationBadgeMode, SESSIONS_LIST_EXTERNAL_APPLICATION_BADGE_SETTING, SESSIONS_LIST_EXTERNAL_APPLICATION_BADGE_SHOW_FROM_SETTING, SESSIONS_LIST_GROUP_EXTERNAL_SESSIONS_SETTING, SESSIONS_LIST_INLINE_ACTIONS_SETTING } from '../../common/sessionConfig.js'; +import { UNKNOWN_SESSION_APPLICATION_ID } from '../../../../services/sessions/common/sessionApplication.js'; import { IContextMenuService, IContextViewService } from '../../../../../platform/contextview/browser/contextView.js'; import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; import { IKeybindingService } from '../../../../../platform/keybinding/common/keybinding.js'; @@ -64,8 +65,8 @@ import { IOpenerService } from '../../../../../platform/opener/common/opener.js' import { ISessionsListPresentation } from '../sessionsListPresentation.js'; import { ILabelService } from '../../../../../platform/label/common/label.js'; import { ChatSessionArchiveActionWording, ChatSessionArchiveActionWordingSettingId, getChatSessionArchivedSectionLabel, getChatSessionArchiveActionWording } from '../../../../../platform/chat/common/sessionArchiveActions.js'; -import { BRANCH_CHANGES_CHANGESET_ID, ChatInteractivity, ChatOriginKind, getChatCapabilities, getGitHubPullRequestRefs, getGitHubRepositoryOfRemoteFile, getGitHubRepositoryOfUrl, getHighestPriorityPullRequestIcon, getSessionFolderGitHubRepository, getSessionPresentationWorkspace, getSessionStatusMessage, getSessionWorkspaceKind, getUntitledSessionTitle, GITHUB_REMOTE_FILE_SCHEME, IChat, isActiveSessionStatus, ISession, ISessionEnvironment, ISessionWorkspace, SessionArtifactKind, SessionStatus, SessionWorkspaceKind, hasMixedChatHarnesses } from '../../common/session.js'; -import { ISessionChangesStats, readChatChangesStats } from '../../common/sessionChangesStatsCache.js'; +import { BRANCH_CHANGES_CHANGESET_ID, ChatInteractivity, ChatOriginKind, getChatCapabilities, getGitHubPullRequestRefs, getGitHubRepositoryOfRemoteFile, getGitHubRepositoryOfUrl, getHighestPriorityPullRequestIcon, getSessionFolderGitHubRepository, getSessionPresentationWorkspace, getSessionStatusMessage, getSessionWorkspaceKind, getUntitledSessionTitle, GITHUB_REMOTE_FILE_SCHEME, IChat, isActiveSessionStatus, ISession, ISessionEnvironment, ISessionWorkspace, SessionArtifactKind, SessionStatus, SessionWorkspaceKind, hasMixedChatHarnesses } from '../../../../services/sessions/common/session.js'; +import { ISessionChangesStats, readChatChangesStats } from '../../../../services/sessions/common/sessionChangesStatsCache.js'; import { AgentSessionApprovalModel, agentSessionApprovalId, IAgentSessionApprovalInfo } from '../../../chat/browser/agentSessions/agentSessionApprovalModel.js'; import { IVoicePlaybackService } from '../../../chat/common/voicePlaybackService.js'; import { ChatContextKeys } from '../../../chat/common/actions/chatContextKeys.js'; @@ -79,13 +80,13 @@ import { createSessionActionViewItemProvider, getSessionArchiveActionViewItemOpt import { HoverStyle, IDelayedHoverOptions } from '../../../../../base/browser/ui/hover/hover.js'; import { HoverPosition } from '../../../../../base/browser/ui/hover/hoverWidget.js'; import { getDefaultHoverDelegate } from '../../../../../base/browser/ui/hover/hoverDelegateFactory.js'; -import { inheritableSessionTarget, ISessionsManagementService, IShownChat } from '../../common/sessionsManagement.js'; -import { getMainWindowHost, ISessionHostService, shownChatOf } from '../sessionHost.js'; +import { inheritableSessionTarget, ISessionsManagementService } from '../../common/sessionsManagement.js'; +import { getMainWindowHost, ISessionHostService, shownChatOf } from '../../../../services/sessions/browser/sessionHost.js'; import { getSessionComparisonChat, getSessionComparisonHarnessLabel, getSessionComparisonParticipantsInDisplayOrder, ISessionComparison, ISessionComparisonService, SessionComparisonParticipantRole } from '../../common/sessionComparison.js'; import { ISessionsService } from '../sessionsService.js'; import { ISessionListModelChangeEvent, ISessionsListModelService, SessionListModelChangeKind, SessionSortEntry, SessionSortMode } from '../sessionsListModelService.js'; import { getSessionGroupIdOfSection, getSessionGroupSectionId, ISessionGroup, ISessionGroupAppearance, ISessionGroupPlacement, ISessionGroupsService } from '../sessionGroupsService.js'; -import { ISessionSectionOrderService } from '../sessionSectionOrderService.js'; +import { ISessionSectionOrderService } from '../../../../services/sessions/browser/sessionSectionOrderService.js'; import { IInputOptions, InputBox, MessageType } from '../../../../../base/browser/ui/inputbox/inputBox.js'; import { IWorkbenchAssignmentService } from '../../../../services/assignment/common/assignmentService.js'; import { IOnboardingFocusTarget, markOnboardingTarget } from '../../../onboarding/browser/spotlight/onboardingTarget.js'; @@ -139,7 +140,8 @@ import { KeybindingLabel } from '../../../../../base/browser/ui/keybindingLabel/ import { IPinnedCanvas, IPinnedCanvasService, PINNED_CANVAS_PAGE_ID, PinnedCanvasConnectedContext, PinnedCanvasState } from '../pinnedCanvases.js'; import { logSessionsInteraction } from '../../common/sessionsTelemetry.js'; import { getSessionInboxPriority, getSessionInboxSection, SessionInboxSection, sessionInboxSections } from '../../common/sessionInbox.js'; -import { ISessionGridPane } from '../sessionGridPane.js'; +import { ISessionGridPane } from '../../../../services/sessions/browser/sessionGridPane.js'; +import { IShownChat } from '../../../../services/sessions/common/sessionPane.js'; const $ = DOM.$; @@ -771,6 +773,7 @@ class SessionsTreeDelegate implements IListVirtualDelegate { private readonly _isComparisonAttempt: (session: ISession) => boolean = () => false, private readonly _sectionRowHeight?: number, private readonly _isInbox: () => boolean = () => false, + private readonly _inlineActionsHeight: (element: SessionListItem) => number = () => 0, ) { } private withInsetRowSpacing(height: number): number { @@ -779,7 +782,7 @@ class SessionsTreeDelegate implements IListVirtualDelegate { getHeight(element: SessionListItem): number { if (isSessionChatItem(element)) { - return this.withInsetRowSpacing(this.withChatApprovalHeight(element, this.getChatBaseHeight())); + return this.getHeightWithoutChatWorkspace(element); } if (isSessionGroupItem(element) && element.comparison) { return SessionsTreeDelegate.COMPARISON_SECTION_HEIGHT; @@ -831,11 +834,11 @@ class SessionsTreeDelegate implements IListVirtualDelegate { if (this._ciFixModel && this._ciFixModel.getCIFix(element as ISession).get()) { height += SessionItemRenderer.CI_ROW_HEIGHT; } - return this.withInsetRowSpacing(height); + return this.withInsetRowSpacing(height + this._inlineActionsHeight(element)); } getHeightWithoutChatWorkspace(element: ISessionChatItem): number { - return this.withInsetRowSpacing(this.withChatApprovalHeight(element, this.getChatBaseHeight())); + return this.withInsetRowSpacing(this.withChatApprovalHeight(element, this.getChatBaseHeight()) + this._inlineActionsHeight(element)); } private getChatBaseHeight(): number { @@ -998,6 +1001,7 @@ class SessionChatItemRenderer implements ITreeRenderer ISessionSearchHint | undefined = () => undefined, private readonly getComparisonAttemptLabel: (session: ISession, chat: IChat) => string | undefined = () => undefined, + private readonly renderInlineActions?: (element: ISessionChatItem, before: HTMLElement) => IDisposable, ) { } renderTemplate(container: HTMLElement): ISessionChatItemTemplate { @@ -1057,6 +1061,9 @@ class SessionChatItemRenderer implements ITreeRenderer template.container.classList.remove('renaming'))); @@ -1700,6 +1707,7 @@ class SessionItemRenderer implements ITreeRenderer void; /** While searching, the field a session matched in that neither its row, through `shownTexts`, nor its section headers show. */ getSearchHint?: (session: ISession, shownTexts: readonly string[]) => ISessionSearchHint | undefined; + renderInlineActions?: (session: ISession, before: HTMLElement) => IDisposable; }, private readonly approvalModel: AgentSessionApprovalModel | undefined, private readonly ciFixModel: ISessionCIFixModel | undefined, @@ -1856,6 +1864,9 @@ class SessionItemRenderer implements ITreeRenderer { @@ -4547,6 +4558,8 @@ function resettableValue(read: () => T, write: (value: T) => void, defaultVal export class SessionsList extends Disposable implements ISessionsList { private readonly archiveDemand = this._register(new MutableDisposable()); + private readonly inlineActionsVisible = observableValue(this, true); + private static readonly SECTION_COLLAPSE_STATE_KEY = 'sessionsListControl.sectionCollapseState'; private static readonly SESSION_COLLAPSE_STATE_KEY = 'sessionsListControl.sessionCollapseState'; private static readonly EXCLUDED_TYPES_KEY = 'sessionsListControl.excludedSessionTypes'; @@ -4919,6 +4932,24 @@ export class SessionsList extends Disposable implements ISessionsList { const reportExternalApplicationBadgeShowFromExperimentTrigger = () => logDefaultSettingExperimentTrigger(this.configurationService, this.telemetryService, SESSIONS_LIST_EXTERNAL_APPLICATION_BADGE_SHOW_FROM_SETTING); this.searchFilter = new SessionsListSearchFilter(session => this.getSessionSearchDocument(session)); const getSearchHint = (element: ISession | ISessionChatItem, shownTexts: readonly string[]) => this.getSearchHint(element, shownTexts); + const inlineActionsHeights = new WeakMap(); + const renderInlineActions = (element: ISession | ISessionChatItem, before: HTMLElement) => instantiationService.createInstance( + SessionInlineActions, + isSessionChatItem(element) ? element.session : element, + isSessionChatItem(element) ? element.chat : undefined, + before, + this.inlineActionsVisible, + height => { + if ((inlineActionsHeights.get(element) ?? 0) !== height) { + inlineActionsHeights.set(element, height); + const tree = this.getTree(element); + if (tree.hasElement(element)) { + tree.updateElementHeight(element, delegate.getHeight(element)); + } + } + }, + () => this.getTree(element).domFocus(), + ); const sessionRenderer = new SessionItemRenderer( { grouping: this.options.grouping, @@ -4955,6 +4986,7 @@ export class SessionsList extends Disposable implements ISessionsList { onboardingTarget: this.onboardingTarget, getGroupDepth: session => this.getRowGroupDepth(session), getSearchHint, + renderInlineActions, }, approvalModel, undefined, @@ -5008,6 +5040,7 @@ export class SessionsList extends Disposable implements ISessionsList { item => getSessionAgentMergeConfigurationObservable(item.session, sessionsProvidersService, this.configurationService, item.chat), getSearchHint, (session, chat) => this.getComparisonAttemptLabel(session, chat), + renderInlineActions, ); this._chatRenderer = chatRenderer; const selectHeader = (element: ISessionSection | ISessionGroupItem, event: MouseEvent) => { @@ -5111,6 +5144,7 @@ export class SessionsList extends Disposable implements ISessionsList { session => this.getComparisonAttemptLabel(session) !== undefined, this.options.sectionRowHeight, () => this.isInboxLayout(), + element => this.configurationService.getValue(SESSIONS_LIST_INLINE_ACTIONS_SETTING) ? inlineActionsHeights.get(element) ?? 0 : 0, ); this._delegate = delegate; @@ -6916,6 +6950,7 @@ export class SessionsList extends Disposable implements ISessionsList { this.visible = visible; this.updateArchiveDemand(); this.updateInboxDemand(); + this.inlineActionsVisible.set(visible, undefined); if (this.visible) { this.refresh(); } else { diff --git a/src/vs/workbench/contrib/sessions/common/sessionConfig.ts b/src/vs/workbench/contrib/sessions/common/sessionConfig.ts index 955fa707e26..c4e7184db87 100644 --- a/src/vs/workbench/contrib/sessions/common/sessionConfig.ts +++ b/src/vs/workbench/contrib/sessions/common/sessionConfig.ts @@ -42,6 +42,7 @@ export const enum AutomationSessionsListMode { /** Whether agents get tools to read and organize the Agents window Sessions list. */ export const SESSIONS_LIST_AGENT_TOOLS_SETTING = 'sessions.list.agentTools.enabled'; +export const SESSIONS_LIST_INLINE_ACTIONS_SETTING = 'sessions.list.inlineActions'; export const SESSIONS_LIST_EXTERNAL_APPLICATION_BADGE_SETTING = 'sessions.list.externalApplicationBadge'; diff --git a/src/vs/workbench/contrib/sessions/common/sessionInbox.ts b/src/vs/workbench/contrib/sessions/common/sessionInbox.ts index 7e60943a4eb..934c9484a15 100644 --- a/src/vs/workbench/contrib/sessions/common/sessionInbox.ts +++ b/src/vs/workbench/contrib/sessions/common/sessionInbox.ts @@ -5,7 +5,7 @@ import { IReader } from '../../../../base/common/observable.js'; import { IInboxSessionAttention, InboxNotificationPriority, InboxTab } from './inboxNotificationsService.js'; -import { ISession, SessionStatus } from './session.js'; +import { ISession, SessionStatus } from '../../../services/sessions/common/session.js'; export type SessionInboxState = | { readonly kind: 'done' | 'untilActivity'; readonly activity: string; readonly notificationIds?: readonly string[] } diff --git a/src/vs/workbench/contrib/sessions/test/browser/sessionInputBanners/sessionInputBanners.test.ts b/src/vs/workbench/contrib/sessions/test/browser/sessionInputBanners/sessionInputBanners.test.ts index b5f9fcd9173..aef265c02f8 100644 --- a/src/vs/workbench/contrib/sessions/test/browser/sessionInputBanners/sessionInputBanners.test.ts +++ b/src/vs/workbench/contrib/sessions/test/browser/sessionInputBanners/sessionInputBanners.test.ts @@ -3,10 +3,18 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { buildTestSession } from '../../common/testSessionBuilder.js'; +import { SESSIONS_LIST_INLINE_ACTIONS_SETTING } from '../../../common/sessionConfig.js'; +import { SessionInlineActions } from '../../../browser/views/sessionInlineActions.js'; +import { ISessionsManagementService } from '../../../common/sessionsManagement.js'; +import { IChatEntitlementService } from '../../../../../services/chat/common/chatEntitlementService.js'; +import { INotificationService } from '../../../../../../platform/notification/common/notification.js'; +import { ContextKeyService } from '../../../../../../platform/contextkey/browser/contextKeyService.js'; +import { mainWindow } from '../../../../../../base/browser/window.js'; import assert from 'assert'; import { IManagedHover } from '../../../../../../base/browser/ui/hover/hover.js'; import { IAction } from '../../../../../../base/common/actions.js'; -import { timeout } from '../../../../../../base/common/async.js'; +import { timeout, DeferredPromise } from '../../../../../../base/common/async.js'; import { Codicon } from '../../../../../../base/common/codicons.js'; import { Event, Emitter } from '../../../../../../base/common/event.js'; import { Disposable, ImmortalReference, IDisposable, IReference } from '../../../../../../base/common/lifecycle.js'; @@ -54,6 +62,88 @@ suite('SessionInputBanners', () => { test(`groups actionable ${isDraft ? 'draft' : 'ready'} PRs, hides merged PR comments, scopes the combined request, and dismisses one carousel item`, () => testActionablePullRequests(isDraft)); } + test('inline actions prefer combined requests, target a peer in the background, and preserve pending state across recycling', async () => { + const built = buildTestSession({ id: 'inline', title: 'Main', chats: [{ id: 'peer', title: 'Peer' }] }); + const mainChat = { ...built.mainChat.chat, workspace: constObservable(workspaceWithPullRequests('/main', [pullRequest(42), pullRequest(41)])) }; + const peer = { ...built.chats.get('peer')!.chat, workspace: constObservable(workspaceWithPullRequests('/peer', [pullRequest(43)])) }; + const session = { ...built.session, mainChat: constObservable(mainChat), chats: observableValue('chats', [mainChat, peer]) }; + const feedback = observableValue('feedback', [prFeedback('combined', session.resource, 41)]); + const ci = ciModel([failedCheck(1)]); + const calls: string[] = []; + const instantiationService = store.add(new TestInstantiationService()); + const configuration = new TestConfigurationService({ [SESSIONS_LIST_INLINE_ACTIONS_SETTING]: true }); + store.add(configuration.onDidChangeConfigurationEmitter); + instantiationService.stub(IConfigurationService, configuration); + instantiationService.stub(IContextKeyService, store.add(new ContextKeyService(configuration))); + instantiationService.stub(ISessionHost, new class extends mock() { }()); + instantiationService.stub(ISessionsProvidersService, { onDidChangeProviders: Event.None, getProvider: () => undefined }); + instantiationService.stub(ICommandService, new class extends mock() { }()); + instantiationService.stub(IStorageService, store.add(new TestStorageService())); + instantiationService.stub(ILogService, new NullLogService()); + instantiationService.stub(IChatWidgetService, { getWidgetBySessionResource: () => { throw new Error('Must not open or use a widget'); } }); + instantiationService.stub(IGitHubService, { + createPullRequestModelReference: (_owner: string, _repo: string, number: number) => new ImmortalReference(pullRequestModel(number, 'PR', false)), + createPullRequestCIModelReference: () => new ImmortalReference(ci), + }); + instantiationService.stub(IAgentFeedbackService, { + onDidChangeFeedback: Event.None, + getFeedbackObservable: () => feedback, + }); + let reject = false; + const accepted = new DeferredPromise(); + instantiationService.stub(ISessionsManagementService, { + getSession: () => session, + sendRequestInBackground: async (_session, chat) => { + calls.push(chat.resource.toString()); + if (reject) { + throw new Error('Rejected'); + } + await accepted.p; + }, + }); + const errors: string[] = []; + instantiationService.stub(INotificationService, { error: error => errors.push(String(error)) }); + instantiationService.stub(IChatEntitlementService, { onDidChangeSentiment: Event.None, sentiment: {} }); + const visible = observableValue('visible', true); + const host = mainWindow.document.createElement('div'); + const mainBefore = host.appendChild(mainWindow.document.createElement('div')); + const peerBefore = host.appendChild(mainWindow.document.createElement('div')); + const main = store.add(instantiationService.createInstance(SessionInlineActions, session, undefined, mainBefore, visible, () => { }, () => { })); + const row = store.add(instantiationService.createInstance(SessionInlineActions, session, peer, peerBefore, visible, () => { }, () => { })); + const buttons = () => [...host.querySelectorAll('.session-inline-actions:not([hidden]) .monaco-button')]; + assert.deepStrictEqual({ labels: buttons().map(button => button.textContent), dropdowns: host.querySelectorAll('.monaco-button-dropdown').length }, { + labels: ['Fix Checks & Address Comments', 'Fix Checks'], dropdowns: 0, + }); + buttons()[1].click(); + buttons()[1].click(); + await timeout(0); + row.dispose(); + store.add(instantiationService.createInstance(SessionInlineActions, session, peer, peerBefore, visible, () => { }, () => { })); + buttons()[1].click(); + assert.deepStrictEqual({ calls, label: buttons()[1].textContent?.trim(), disabled: buttons()[1].getAttribute('aria-disabled') }, { + calls: [peer.resource.toString()], label: 'Sending...', disabled: 'true', + }); + await accepted.complete(); + await timeout(0); + assert.deepStrictEqual({ peerHidden: host.querySelectorAll('.session-inline-actions')[1].hidden, errors }, { + peerHidden: true, errors: [], + }); + ci.fixRequested.set(false, undefined); + reject = true; + buttons()[1].click(); + await timeout(0); + assert.deepStrictEqual({ disabled: buttons()[1].getAttribute('aria-disabled'), errors }, { disabled: 'false', errors: ['Error: Rejected'] }); + session.chats.set([mainChat], undefined); + buttons()[1].click(); + await timeout(0); + assert.deepStrictEqual({ calls: calls.length, lastError: errors.at(-1) }, { + calls: 2, lastError: 'Error: This action is no longer available for this chat.', + }); + visible.set(false, undefined); + assert.strictEqual(host.querySelectorAll('.session-inline-actions').length, 0); + main.dispose(); + }); + test('shows the pull requests of the session of its window, not of the globally active session', () => { // One failing check per pull request: each session's pull request has its own number of failing checks. const sessionOf = (id: string, prNumber: number) => { diff --git a/src/vs/workbench/contrib/sessions/test/browser/sessionInputBanners/sessionWorktreeCleanupService.test.ts b/src/vs/workbench/contrib/sessions/test/browser/sessionInputBanners/sessionWorktreeCleanupService.test.ts index 61000bffc0e..1488a0d2f27 100644 --- a/src/vs/workbench/contrib/sessions/test/browser/sessionInputBanners/sessionWorktreeCleanupService.test.ts +++ b/src/vs/workbench/contrib/sessions/test/browser/sessionInputBanners/sessionWorktreeCleanupService.test.ts @@ -105,7 +105,7 @@ suite('SessionWorktreeCleanupService', () => { test('excludes non-agent branches from inventory, refreshes, force eligibility, and scheduling', async () => { const eligible = managedWorktree(); - const excluded = ['component-explorer-1', 'main', 'agents-other', 'custom/agents/task', ''].map((branch, index) => ({ + const excluded = ['component-explorer-1', 'main', 'agents-other', 'custom/agents-other/task', ''].map((branch, index) => ({ ...managedWorktree(`/repo.worktrees/foreign-${index}`), branch, })); let inventory = [eligible, ...excluded]; @@ -173,7 +173,7 @@ suite('SessionWorktreeCleanupService', () => { for (const prefix of ['user/', 'team/user/', 'user-']) { test(`includes, refreshes, and forcibly removes an unlinked ${prefix} prefixed worktree`, async () => { - const unlinked = { ...managedWorktree(), branch: `${prefix}agents/unlinked` }; + let unlinked: IManagedSessionWorktree = { ...managedWorktree(), branch: `${prefix}agents/unlinked` }; const cleaned: { branch: string; force: boolean | undefined }[] = []; const service = disposables.add(createService([], true, () => undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, { @@ -186,6 +186,9 @@ suite('SessionWorktreeCleanupService', () => { const refreshed = await service.refreshPendingCleanup(initial.map(getWorktreeCleanupId), 0); const failed: ISessionWorktree = { ...refreshed[0], worktreeExists: true, cleanupStatus: { state: 'failed' } }; await service.cleanupWorktrees(refreshed, () => { }); + await assert.rejects(service.forceCleanupWorktrees([failed], () => { }), /already scheduled/); + unlinked = { ...unlinked, cleanupStatus: { state: 'failed' } }; + await service.refreshPendingCleanup(initial.map(getWorktreeCleanupId), 0); await service.forceCleanupWorktrees([failed], () => { }); assert.deepStrictEqual({ rows: [initial, refreshed].map(rows => rows.map(getWorktreeCleanupId)), @@ -1476,6 +1479,186 @@ suite('SessionWorktreeCleanupService', () => { assert.deepStrictEqual({ result, updates, archived }, { result: false, updates: [], archived: false }); }); + test('owns confirmed batch progress without an editor and prevents duplicate scheduling', async () => { + const first = createSession('first', oldDate()); + const second = createSession('second', oldDate()); + const entered = new DeferredPromise(); + const release = new DeferredPromise(); + const archived: string[] = []; + const service = disposables.add(createService([first, second], true, () => 100, undefined, undefined, undefined, undefined, undefined, undefined, Event.None, { + dialogService: upcastPartial({ confirm: async () => ({ confirmed: true }) }), + onArchive: async session => { + archived.push(session.sessionId); + if (session === first) { + await entered.complete(); + await release.p; + } + }, + })); + const candidates = [first, second].map(session => ({ session, sizeBytes: 100, worktreeCount: 1 })); + const scheduled = service.cleanupWorktrees(candidates); + await entered.p; + const during = service.cleanupOperations.get().map(operation => [getWorktreeCleanupId(operation.candidate), operation.state]); + const duplicateWhileScheduling = await service.cleanupWorktrees(candidates); + await release.complete(); + await scheduled; + await assert.rejects(service.cleanupWorktrees(candidates), /already scheduled/); + assert.deepStrictEqual({ + during, + duplicateWhileScheduling, + archived, + scheduling: service.isSchedulingCleanup.get(), + after: service.cleanupOperations.get().map(operation => [getWorktreeCleanupId(operation.candidate), operation.state]), + }, { + during: [['first', 'queued'], ['second', 'queued']], + duplicateWhileScheduling: false, + archived: ['first', 'second'], + scheduling: false, + after: [['first', 'pending'], ['second', 'pending']], + }); + }); + + test('serializes confirmation and cancellation leaves no retained operations', async () => { + const session = createSession('first', oldDate()); + const confirmation = new DeferredPromise<{ confirmed: boolean }>(); + let confirmations = 0; + const service = disposables.add(createService([session], true, () => 100, undefined, undefined, undefined, undefined, undefined, undefined, Event.None, { + dialogService: upcastPartial({ confirm: async () => { confirmations++; return confirmation.p; } }), + })); + const candidates = [{ session, sizeBytes: 100, worktreeCount: 1 }]; + const first = service.cleanupWorktrees(candidates); + const second = await service.cleanupWorktrees(candidates); + await confirmation.complete({ confirmed: false }); + const result = await first; + assert.deepStrictEqual({ confirmations, second, result, operations: service.cleanupOperations.get(), scheduling: service.isSchedulingCleanup.get() }, { + confirmations: 1, second: false, result: false, operations: [], scheduling: false, + }); + }); + + test('only confirmed restoration cancels retained cleanup and allows cleanup again', async () => { + const archived = observableValue('archived', false); + const session = createSession('restored', oldDate(), SessionStatus.Completed, false, true, 1, archived); + const onDidUnarchiveSession = disposables.add(new Emitter()); + let submissions = 0; + const service = disposables.add(createService([session], true, () => 100, undefined, undefined, undefined, undefined, undefined, undefined, Event.None, { + dialogService: upcastPartial({ confirm: async () => ({ confirmed: true }) }), + onDidUnarchiveSession: onDidUnarchiveSession.event, + onArchive: async () => { submissions++; }, + })); + const candidates = [{ session, sizeBytes: 100, worktreeCount: 1 }]; + await service.cleanupWorktrees(candidates); + await service.getWorktrees(0, () => { }); + const staleSnapshot = service.cleanupOperations.get().map(operation => operation.state); + await assert.rejects(service.cleanupWorktrees(candidates), /already scheduled/); + onDidUnarchiveSession.fire(session); + const restored = service.cleanupOperations.get(); + await service.cleanupWorktrees(candidates); + assert.deepStrictEqual({ staleSnapshot, restored, submissions, operations: service.cleanupOperations.get().map(operation => operation.state) }, { + staleSnapshot: ['pending'], restored: [], submissions: 2, operations: ['pending'], + }); + }); + + for (const archiveFails of [false, true]) { + test(`restoration during an outstanding archive does not recreate its cancelled operation when archive ${archiveFails ? 'fails' : 'succeeds'}`, async () => { + const session = createSession('restored', oldDate()); + const onDidUnarchiveSession = disposables.add(new Emitter()); + const entered = new DeferredPromise(); + const release = new DeferredPromise(); + const updates: SessionWorktreeCleanupProgress[] = []; + const service = disposables.add(createService([session], true, () => 100, undefined, undefined, undefined, undefined, undefined, undefined, Event.None, { + dialogService: upcastPartial({ confirm: async () => ({ confirmed: true }) }), + onDidUnarchiveSession: onDidUnarchiveSession.event, + onArchive: async () => { + await entered.complete(); + await release.p; + if (archiveFails) { + throw new Error('archive cancelled'); + } + }, + })); + const cleanup = service.cleanupWorktrees([{ session, sizeBytes: 100, worktreeCount: 1 }], update => updates.push(update)); + await entered.p; + onDidUnarchiveSession.fire(session); + await release.complete(); + await cleanup; + assert.deepStrictEqual({ operations: service.cleanupOperations.get(), progress: updates.map(update => update.state), scheduling: service.isSchedulingCleanup.get() }, { + operations: [], progress: ['started'], scheduling: false, + }); + }); + } + + test('a restored queued session is not archived when the batch reaches it', async () => { + const first = createSession('first', oldDate()); + const restored = createSession('restored', oldDate()); + const onDidUnarchiveSession = disposables.add(new Emitter()); + const entered = new DeferredPromise(); + const release = new DeferredPromise(); + const archived: string[] = []; + const service = disposables.add(createService([first, restored], true, () => 100, undefined, undefined, undefined, undefined, undefined, undefined, Event.None, { + dialogService: upcastPartial({ confirm: async () => ({ confirmed: true }) }), + onDidUnarchiveSession: onDidUnarchiveSession.event, + onArchive: async session => { + archived.push(session.sessionId); + await entered.complete(); + await release.p; + }, + })); + const cleanup = service.cleanupWorktrees([first, restored].map(session => ({ session, sizeBytes: 100, worktreeCount: 1 }))); + await entered.p; + onDidUnarchiveSession.fire(restored); + await release.complete(); + await cleanup; + assert.deepStrictEqual({ archived, operations: service.cleanupOperations.get().map(operation => getWorktreeCleanupId(operation.candidate)) }, { + archived: ['first'], operations: ['first'], + }); + }); + + test('accepts prefixed agent worktrees without measuring sessionless storage', async () => { + const unlinked = { ...managedWorktree('/repo.worktrees/task'), branch: 'users/alice/agents/task' }; + const requests: IManagedSessionWorktree[] = []; + const service = disposables.add(createService([], true, () => { throw new Error('Must not measure sessionless storage'); }, + undefined, undefined, undefined, undefined, undefined, undefined, undefined, { + listManagedWorktrees: async () => [unlinked], + cleanupManagedWorktree: async worktree => { requests.push(worktree); }, + dialogService: upcastPartial({ confirm: async () => ({ confirmed: true }) }), + })); + const worktrees = await service.getWorktrees(0, () => { }); + await service.cleanupWorktrees(worktrees); + assert.deepStrictEqual({ branches: worktrees.map(worktree => worktree.unlinkedWorktree?.branch), requests }, { + branches: ['users/alice/agents/task'], requests: [unlinked], + }); + }); + + test('reconciles outstanding operations with host failures and confirmed absence', async () => { + const session = createSession('archived', oldDate(), SessionStatus.Completed, true); + let cleanupStatus: IAgentHostWorktreeCleanupStatus = { state: 'pending' }; + let exists = true; + let retries = 0; + const service = disposables.add(createService([session], true, () => { throw new Error('Must not measure done sessions'); }, + undefined, undefined, undefined, undefined, undefined, undefined, undefined, { + dialogService: upcastPartial({ confirm: async () => ({ confirmed: true }) }), + onCleanup: async (_session, retry) => { + if (retry) { + retries++; + return { state: 'pending' }; + } + return cleanupStatus; + }, + onExists: async () => exists, + })); + const worktrees = await service.getWorktrees(0, () => { }); + await service.cleanupWorktrees(worktrees); + cleanupStatus = { state: 'failed', message: 'locked directory' }; + const failedWorktrees = await service.refreshPendingCleanup([session.sessionId], 0); + const failed = service.cleanupOperations.get().map(operation => ({ state: operation.state, message: operation.message })); + await service.cleanupWorktrees(worktrees); + exists = false; + await service.refreshPendingCleanup([session.sessionId], 0); + assert.deepStrictEqual({ failed, failure: failedWorktrees[0].cleanupStatus, retries, outstanding: service.cleanupOperations.get() }, { + failed: [{ state: 'failed', message: undefined }], failure: { state: 'failed', message: 'locked directory' }, retries: 2, outstanding: [], + }); + }); + test('refreshes the measurement snapshot after cleanup without rescanning archived worktrees', async () => { const archived = observableValue('archived', false); const onDidArchiveSession = disposables.add(new Emitter()); @@ -1776,6 +1959,7 @@ function createService( readonly canForceWorktreeCleanup?: ISessionsManagementService['canForceWorktreeCleanup']; readonly onExists?: ISessionsManagementService['sessionWorktreeExists']; readonly onDidArchiveSession?: Event; + readonly onDidUnarchiveSession?: Event; readonly listManagedWorktrees?: ISessionsManagementService['listManagedWorktrees']; readonly cleanupManagedWorktree?: ISessionsManagementService['cleanupManagedWorktree']; readonly managedWorktreeExists?: ISessionsManagementService['managedWorktreeExists']; @@ -1790,6 +1974,7 @@ function createService( canForceWorktreeCleanup: overrides.canForceWorktreeCleanup, sessionWorktreeExists: overrides.onExists ?? (async () => true), onDidArchiveSession: overrides.onDidArchiveSession ?? Event.None, + onDidUnarchiveSession: overrides.onDidUnarchiveSession ?? Event.None, onDidChangeSessions, listManagedWorktrees: overrides.listManagedWorktrees, cleanupManagedWorktree: overrides.cleanupManagedWorktree, diff --git a/src/vs/workbench/services/files/electron-browser/diskFileSystemProvider.ts b/src/vs/workbench/services/files/electron-browser/diskFileSystemProvider.ts index adfab2b0dab..1fb4e21b728 100644 --- a/src/vs/workbench/services/files/electron-browser/diskFileSystemProvider.ts +++ b/src/vs/workbench/services/files/electron-browser/diskFileSystemProvider.ts @@ -6,8 +6,7 @@ import { localize } from '../../../../nls.js'; import { Event } from '../../../../base/common/event.js'; import { isLinux } from '../../../../base/common/platform.js'; -import { FileSystemProviderCapabilities, IFileDeleteOptions, IStat, FileType, IFileReadStreamOptions, IFileWriteOptions, IFileOpenOptions, IFileOverwriteOptions, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileFolderCopyCapability, IFileSystemProviderWithFileAtomicReadCapability, IFileAtomicReadOptions, IFileSystemProviderWithFileCloneCapability, IFileChange, IFileRealpathOptions, IFileSystemProviderWithFileAtomicRenameCapability } from '../../../../platform/files/common/files.js'; -import { FileSystemProviderCapabilities, IFileDeleteOptions, IStat, FileType, IFileReadStreamOptions, IFileWriteOptions, IFileOpenOptions, IFileOverwriteOptions, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileFolderCopyCapability, IFileSystemProviderWithFileAtomicReadCapability, IFileAtomicReadOptions, IFileSystemProviderWithFileCloneCapability, IFileChange, IFileRealpathOptions } from '../../../../platform/files/common/files.js'; +import { FileSystemProviderCapabilities, IFileDeleteOptions, IStat, FileType, IFileReadStreamOptions, IFileWriteOptions, IFileOpenOptions, IFileOverwriteOptions, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileSystemProviderWithFileReadStreamCapability, IFileSystemProviderWithFileFolderCopyCapability, IFileSystemProviderWithFileAtomicReadCapability, IFileAtomicReadOptions, IFileSystemProviderWithFileCloneCapability, IFileChange, IFileSystemProviderWithFileAtomicRenameCapability, IFileRealpathOptions } from '../../../../platform/files/common/files.js'; import { AbstractDiskFileSystemProvider } from '../../../../platform/files/common/diskFileSystemProvider.js'; import { IMainProcessService } from '../../../../platform/ipc/common/mainProcessService.js'; import { CancellationToken } from '../../../../base/common/cancellation.js';