@myrialabs/clopen 0.4.49 → 0.4.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/backend/chat/attachments.test.ts +106 -17
- package/backend/chat/attachments.ts +131 -34
- package/backend/chat/background-wait.test.ts +28 -0
- package/backend/chat/engine-handoff.ts +42 -6
- package/backend/chat/message-pages.test.ts +17 -0
- package/backend/chat/message-pages.ts +6 -2
- package/backend/chat/stream-manager.ts +114 -19
- package/backend/containers/actions.ts +22 -0
- package/backend/control/actions/projects.ts +93 -37
- package/backend/control/folders.test.ts +27 -2
- package/backend/control/index.ts +2 -1
- package/backend/database/migrations/056_support_mssql_driver.ts +7 -0
- package/backend/database/migrations/077_create_integration_db_links.ts +7 -0
- package/backend/database/migrations/086_single_owner.ts +66 -73
- package/backend/database/migrations/088_create_messages_fts_map.ts +52 -0
- package/backend/database/migrations/089_add_memory_layout_tiles.ts +58 -0
- package/backend/database/migrations/090_create_storage_tables.ts +83 -0
- package/backend/database/migrations/index.ts +25 -2
- package/backend/database/queries/graph-queries.ts +392 -135
- package/backend/database/queries/integration-queries.ts +10 -0
- package/backend/database/queries/memory-queue-queries.ts +11 -0
- package/backend/database/queries/message-fts.test.ts +120 -0
- package/backend/database/queries/message-queries.ts +45 -9
- package/backend/database/queries/project-queries.ts +6 -0
- package/backend/database/queries/session-queries.ts +6 -2
- package/backend/database/queries/utils-queries.ts +3 -0
- package/backend/database/utils/migration-runner.test.ts +196 -0
- package/backend/database/utils/migration-runner.ts +61 -16
- package/backend/database/utils/seeder-runner.ts +22 -16
- package/backend/engine/adapters/claude/environment.ts +4 -0
- package/backend/engine/adapters/claude/input-gate.test.ts +59 -0
- package/backend/engine/adapters/claude/input-gate.ts +74 -0
- package/backend/engine/adapters/claude/message-converter.test.ts +16 -0
- package/backend/engine/adapters/claude/message-converter.ts +8 -0
- package/backend/engine/adapters/claude/stream.ts +20 -0
- package/backend/engine/adapters/cursor/environment.ts +1 -1
- package/backend/engine/adapters/qwen/session-store.ts +10 -1
- package/backend/engine/types.ts +7 -0
- package/backend/git/identity/cli.ts +35 -0
- package/backend/git/identity/env.test.ts +52 -1
- package/backend/git/identity/env.ts +69 -10
- package/backend/git/identity/index.ts +25 -6
- package/backend/git/identity/resolve.ts +2 -1
- package/backend/git/identity/scope-config.test.ts +7 -4
- package/backend/git/identity/scope-config.ts +13 -7
- package/backend/git-hosts/accounts.ts +106 -0
- package/backend/git-hosts/auth/client-ids.ts +34 -0
- package/backend/git-hosts/auth/connect.ts +110 -0
- package/backend/git-hosts/auth/endpoints.ts +130 -0
- package/backend/git-hosts/auth/flows.ts +355 -0
- package/backend/git-hosts/auth/local.ts +152 -0
- package/backend/git-hosts/ci.ts +18 -0
- package/backend/git-hosts/cli.test.ts +82 -0
- package/backend/git-hosts/cli.ts +342 -0
- package/backend/git-hosts/credentials.ts +173 -0
- package/backend/git-hosts/git-credential.ts +30 -0
- package/backend/git-hosts/health.ts +39 -0
- package/backend/git-hosts/http.ts +174 -0
- package/backend/git-hosts/index.ts +34 -0
- package/backend/git-hosts/providers/bitbucket.ts +186 -0
- package/backend/git-hosts/providers/gitea.ts +208 -0
- package/backend/git-hosts/providers/github.ts +270 -0
- package/backend/git-hosts/providers/gitlab-client.ts +70 -0
- package/backend/git-hosts/providers/gitlab.ts +285 -0
- package/backend/git-hosts/providers/locators.test.ts +68 -0
- package/backend/git-hosts/registry.ts +50 -0
- package/backend/git-hosts/service.ts +432 -0
- package/backend/git-hosts/types.ts +82 -0
- package/backend/git-hosts/urls.test.ts +42 -0
- package/backend/git-hosts/urls.ts +69 -0
- package/backend/index.ts +84 -17
- package/backend/integrations/accounts.ts +50 -3
- package/backend/integrations/registry/define.ts +9 -0
- package/backend/integrations/registry/index.ts +11 -0
- package/backend/integrations/registry/providers/bitbucket.ts +51 -0
- package/backend/integrations/registry/providers/gitea.ts +53 -0
- package/backend/integrations/registry/providers/github.ts +24 -7
- package/backend/integrations/registry/providers/gitlab.ts +57 -0
- package/backend/integrations/registry/types.ts +13 -1
- package/backend/mcp/internal/servers/browser-automation/actions/inspect.ts +115 -31
- package/backend/mcp/internal/servers/browser-automation/description.ts +5 -0
- package/backend/memory/README.md +7 -4
- package/backend/memory/layout.test.ts +377 -0
- package/backend/memory/layout.ts +1029 -265
- package/backend/memory/view.ts +257 -386
- package/backend/mentions/diff.ts +63 -0
- package/backend/mentions/index.ts +109 -0
- package/backend/mentions/mentions.test.ts +27 -0
- package/backend/mentions/shared.ts +82 -0
- package/backend/mentions/sources/ai-changes.ts +140 -0
- package/backend/mentions/sources/chats.ts +122 -0
- package/backend/mentions/sources/database.ts +211 -0
- package/backend/mentions/sources/files.ts +240 -0
- package/backend/mentions/sources/git.ts +308 -0
- package/backend/mentions/sources/notes-memory.ts +121 -0
- package/backend/mentions/sources/ops.ts +125 -0
- package/backend/mentions/sources/preview.ts +153 -0
- package/backend/mentions/sources/projects.ts +114 -0
- package/backend/mentions/sources/system.ts +135 -0
- package/backend/mentions/sources/terminal.ts +50 -0
- package/backend/mentions/types.ts +75 -0
- package/backend/preview/browser/bot-check-frames.test.ts +49 -0
- package/backend/preview/browser/bot-check-frames.ts +66 -0
- package/backend/preview/browser/browser-dialog-handler.ts +6 -5
- package/backend/preview/browser/browser-host-bridge.ts +4 -2
- package/backend/preview/browser/browser-native-ui-handler.ts +21 -0
- package/backend/preview/browser/browser-pool.ts +26 -17
- package/backend/preview/browser/browser-preview-service.ts +164 -2
- package/backend/preview/browser/browser-screenshot.test.ts +113 -0
- package/backend/preview/browser/browser-screenshot.ts +396 -0
- package/backend/preview/browser/browser-tab-manager.ts +35 -186
- package/backend/preview/browser/browser-video-capture.ts +12 -17
- package/backend/preview/browser/element-describe.ts +125 -0
- package/backend/preview/browser/page-binding.ts +141 -0
- package/backend/preview/browser/screenshot-files.test.ts +117 -0
- package/backend/preview/browser/screenshot-files.ts +134 -0
- package/backend/preview/browser/user-agent.test.ts +25 -0
- package/backend/preview/browser/user-agent.ts +100 -0
- package/backend/project/status-manager.ts +4 -2
- package/backend/projects/engine-transcripts.ts +153 -0
- package/backend/projects/folder-guard.ts +55 -0
- package/backend/projects/move.test.ts +208 -0
- package/backend/projects/move.ts +277 -0
- package/backend/projects/project-cleanup.integration.test.ts +3 -1
- package/backend/projects/project-cleanup.ts +10 -0
- package/backend/storage/actions.ts +260 -0
- package/backend/storage/chats.test.ts +57 -0
- package/backend/storage/chats.ts +170 -0
- package/backend/storage/database.ts +105 -0
- package/backend/storage/engine-homes.ts +145 -0
- package/backend/storage/fs-size.ts +111 -0
- package/backend/storage/history.ts +39 -0
- package/backend/storage/policy.ts +156 -0
- package/backend/storage/preview-profiles.ts +169 -0
- package/backend/storage/purge.ts +158 -0
- package/backend/storage/scanner.ts +339 -0
- package/backend/storage/session-index.ts +208 -0
- package/backend/storage/snapshots.ts +99 -0
- package/backend/storage/storage-flow.test.ts +137 -0
- package/backend/storage/transcripts/aliases.ts +75 -0
- package/backend/storage/transcripts/claude-dedupe.test.ts +101 -0
- package/backend/storage/transcripts/claude-dedupe.ts +152 -0
- package/backend/storage/transcripts/claude.ts +155 -0
- package/backend/storage/transcripts/cursor.ts +165 -0
- package/backend/storage/transcripts/file-stores.ts +224 -0
- package/backend/storage/transcripts/index.ts +207 -0
- package/backend/storage/transcripts/opencode.ts +124 -0
- package/backend/storage/transcripts/references.ts +42 -0
- package/backend/storage/transcripts/types.ts +58 -0
- package/backend/storage/worktrees.ts +114 -0
- package/backend/terminal/ptykit.ts +25 -0
- package/backend/update/registry.ts +24 -0
- package/backend/update/release-notes.test.ts +110 -0
- package/backend/update/release-notes.ts +132 -0
- package/backend/update/restart.ts +159 -0
- package/backend/utils/env.test.ts +64 -0
- package/backend/utils/env.ts +23 -55
- package/backend/utils/port-utils.ts +13 -0
- package/backend/work/index.ts +13 -2
- package/backend/work/providers/github/actions-logs.ts +1 -1
- package/backend/work/providers/github/adapter.ts +32 -1
- package/backend/work/providers/github/client.ts +7 -3
- package/backend/work/providers/gitlab/adapter.ts +770 -0
- package/backend/work/providers/gitlab/system-notes.test.ts +24 -0
- package/backend/work/service.ts +60 -36
- package/backend/work/start-work.ts +1 -1
- package/backend/work/types.ts +4 -0
- package/backend/worktrees/index.ts +1 -0
- package/backend/worktrees/service.ts +23 -2
- package/backend/ws/chat/composer.ts +47 -6
- package/backend/ws/chat/stream.ts +19 -10
- package/backend/ws/files/search.ts +1 -1
- package/backend/ws/files/write.ts +27 -0
- package/backend/ws/hosting/index.ts +231 -0
- package/backend/ws/index.ts +12 -2
- package/backend/ws/integrations/crud.ts +31 -5
- package/backend/ws/integrations/hosting-auth.ts +227 -0
- package/backend/ws/integrations/index.ts +2 -0
- package/backend/ws/memory/crud.ts +118 -81
- package/backend/ws/mentions/index.ts +81 -0
- package/backend/ws/messages/crud.ts +3 -1
- package/backend/ws/preview/browser/screenshot.ts +184 -0
- package/backend/ws/preview/index.ts +23 -0
- package/backend/ws/projects/crud.ts +66 -58
- package/backend/ws/sessions/crud.ts +7 -95
- package/backend/ws/snapshot/changes.ts +3 -3
- package/backend/ws/storage/index.ts +102 -0
- package/backend/ws/system/index.ts +7 -0
- package/backend/ws/system/operations.ts +125 -69
- package/backend/ws/work/context.ts +3 -4
- package/backend/ws/work/crud.ts +33 -0
- package/backend/ws/work/schemas.ts +4 -1
- package/bin/clopen.ts +18 -18
- package/dist/assets/{index-DD0-3EWg.js → index-B9rHDvjg.js} +1 -1
- package/dist/assets/index-B9rHDvjg.js.br +0 -0
- package/dist/assets/index-B9rHDvjg.js.gz +0 -0
- package/dist/assets/{index-CrVWZH_D.js → index-DFlwOd7k.js} +1 -1
- package/dist/assets/index-DFlwOd7k.js.br +0 -0
- package/dist/assets/index-DFlwOd7k.js.gz +0 -0
- package/dist/assets/main-Bz_brxxS.css +1 -0
- package/dist/assets/main-Bz_brxxS.css.br +0 -0
- package/dist/assets/main-Bz_brxxS.css.gz +0 -0
- package/dist/assets/main-DRcX9SHx.js +1273 -0
- package/dist/assets/main-DRcX9SHx.js.br +0 -0
- package/dist/assets/main-DRcX9SHx.js.gz +0 -0
- package/dist/assets/pdf-DfwfQPLy.js +57 -0
- package/dist/assets/pdf-DfwfQPLy.js.br +0 -0
- package/dist/assets/pdf-DfwfQPLy.js.gz +0 -0
- package/dist/assets/pdf.worker.min-B5Yc7dP4.mjs +27 -0
- package/dist/assets/pdf.worker.min-B5Yc7dP4.mjs.br +0 -0
- package/dist/assets/pdf.worker.min-B5Yc7dP4.mjs.gz +0 -0
- package/dist/assets/pdf.worker.min-BOrSNwfp.js +1 -0
- package/dist/index.html +2 -2
- package/dist/index.html.br +0 -0
- package/dist/index.html.gz +0 -0
- package/dist/vendor/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/78-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/78-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Add-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Add-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/B5-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/B5pc-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/B5pc-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/CNS1-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/CNS1-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/CNS2-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/CNS2-V.bcmap +3 -0
- package/dist/vendor/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
- package/dist/vendor/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Ext-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Ext-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GB-H.bcmap +6 -0
- package/dist/vendor/pdfjs/cmaps/GB-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBT-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBT-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Hankaku.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Hiragana.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Katakana.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/LICENSE +36 -0
- package/dist/vendor/pdfjs/cmaps/NWP-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/NWP-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/Roman.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/V.bcmap +0 -0
- package/dist/vendor/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
- package/dist/vendor/pdfjs/iccs/CGATS001Compat-v2-micro.icc +0 -0
- package/dist/vendor/pdfjs/iccs/LICENSE +116 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
- package/dist/vendor/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
- package/dist/vendor/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
- package/dist/vendor/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
- package/dist/vendor/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/dist/vendor/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
- package/dist/vendor/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
- package/dist/vendor/pdfjs/wasm/LICENSE_JBIG2 +196 -0
- package/dist/vendor/pdfjs/wasm/LICENSE_OPENJPEG +39 -0
- package/dist/vendor/pdfjs/wasm/LICENSE_PDFJS_JBIG2 +13 -0
- package/dist/vendor/pdfjs/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
- package/dist/vendor/pdfjs/wasm/LICENSE_PDFJS_QCMS +19 -0
- package/dist/vendor/pdfjs/wasm/LICENSE_PDFJS_QUICKJS +21 -0
- package/dist/vendor/pdfjs/wasm/LICENSE_QCMS +21 -0
- package/dist/vendor/pdfjs/wasm/LICENSE_QUICKJS +22 -0
- package/dist/vendor/pdfjs/wasm/jbig2.wasm +0 -0
- package/dist/vendor/pdfjs/wasm/jbig2.wasm.br +0 -0
- package/dist/vendor/pdfjs/wasm/jbig2.wasm.gz +0 -0
- package/dist/vendor/pdfjs/wasm/jbig2_nowasm_fallback.js +2 -0
- package/dist/vendor/pdfjs/wasm/jbig2_nowasm_fallback.js.br +0 -0
- package/dist/vendor/pdfjs/wasm/jbig2_nowasm_fallback.js.gz +0 -0
- package/dist/vendor/pdfjs/wasm/openjpeg.wasm +0 -0
- package/dist/vendor/pdfjs/wasm/openjpeg.wasm.br +0 -0
- package/dist/vendor/pdfjs/wasm/openjpeg.wasm.gz +0 -0
- package/dist/vendor/pdfjs/wasm/openjpeg_nowasm_fallback.js +2 -0
- package/dist/vendor/pdfjs/wasm/openjpeg_nowasm_fallback.js.br +0 -0
- package/dist/vendor/pdfjs/wasm/openjpeg_nowasm_fallback.js.gz +0 -0
- package/dist/vendor/pdfjs/wasm/qcms_bg.wasm +0 -0
- package/dist/vendor/pdfjs/wasm/qcms_bg.wasm.br +0 -0
- package/dist/vendor/pdfjs/wasm/qcms_bg.wasm.gz +0 -0
- package/dist/vendor/pdfjs/wasm/quickjs-eval.js +16 -0
- package/dist/vendor/pdfjs/wasm/quickjs-eval.js.br +0 -0
- package/dist/vendor/pdfjs/wasm/quickjs-eval.js.gz +0 -0
- package/dist/vendor/pdfjs/wasm/quickjs-eval.wasm +0 -0
- package/dist/vendor/pdfjs/wasm/quickjs-eval.wasm.br +0 -0
- package/dist/vendor/pdfjs/wasm/quickjs-eval.wasm.gz +0 -0
- package/package.json +8 -9
- package/scripts/start.ts +21 -4
- package/shared/constants/binary-extensions.ts +20 -4
- package/shared/constants/support.test.ts +27 -0
- package/shared/constants/support.ts +79 -0
- package/shared/constants/tool-icons.ts +7 -1
- package/shared/types/database/schema.ts +6 -0
- package/shared/types/git-hosting.ts +241 -0
- package/shared/types/integrations.ts +51 -1
- package/shared/types/memory.ts +96 -73
- package/shared/types/mentions.ts +96 -0
- package/shared/types/release-notes.ts +31 -0
- package/shared/types/storage.ts +175 -0
- package/shared/types/stores/settings.ts +16 -0
- package/shared/types/unified/index.ts +2 -0
- package/shared/types/unified/message.ts +26 -1
- package/shared/types/unified/stream.ts +22 -1
- package/shared/types/unified/tool.ts +4 -0
- package/shared/types/work.ts +6 -0
- package/shared/utils/attachment-mentions.test.ts +39 -0
- package/shared/utils/attachment-mentions.ts +100 -0
- package/shared/utils/context-document.test.ts +53 -0
- package/shared/utils/context-document.ts +226 -0
- package/shared/utils/device-frame.test.ts +73 -0
- package/shared/utils/device-frame.ts +320 -0
- package/shared/utils/fuzzy.ts +79 -0
- package/shared/utils/launcher-fingerprint.test.ts +73 -0
- package/shared/utils/launcher-fingerprint.ts +108 -0
- package/shared/utils/logger.ts +2 -0
- package/shared/utils/page-colors.test.ts +17 -0
- package/shared/utils/page-colors.ts +24 -0
- package/shared/utils/process-supervisor.test.ts +88 -1
- package/shared/utils/process-supervisor.ts +123 -29
- package/shared/utils/process-tree.ts +99 -0
- package/shared/utils/restart-intent.test.ts +57 -0
- package/shared/utils/restart-intent.ts +80 -0
- package/shared/utils/semver.test.ts +33 -0
- package/shared/utils/semver.ts +35 -0
- package/shared/utils/supervised-child.ts +44 -0
- package/shared/utils/supervisor-protocol.ts +20 -0
- package/.env.example +0 -9
- package/dist/assets/graph-layout.worker-CRFqN7ZQ.js +0 -1
- package/dist/assets/graph-layout.worker-CRFqN7ZQ.js.br +0 -0
- package/dist/assets/graph-layout.worker-CRFqN7ZQ.js.gz +0 -0
- package/dist/assets/index-CrVWZH_D.js.br +0 -0
- package/dist/assets/index-CrVWZH_D.js.gz +0 -0
- package/dist/assets/index-DD0-3EWg.js.br +0 -0
- package/dist/assets/index-DD0-3EWg.js.gz +0 -0
- package/dist/assets/main-D2_TmcwQ.js +0 -1240
- package/dist/assets/main-D2_TmcwQ.js.br +0 -0
- package/dist/assets/main-D2_TmcwQ.js.gz +0 -0
- package/dist/assets/main-Yucigcmf.css +0 -1
- package/dist/assets/main-Yucigcmf.css.br +0 -0
- package/dist/assets/main-Yucigcmf.css.gz +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test';
|
|
2
|
+
import { systemNoteToEvent } from './adapter';
|
|
3
|
+
|
|
4
|
+
const note = (body: string) => ({ id: 1, body, author: { id: 1, username: 'octocat' }, created_at: '2026-01-01T00:00:00Z' });
|
|
5
|
+
|
|
6
|
+
describe('systemNoteToEvent', () => {
|
|
7
|
+
test('labels, assignments and renames become events with their subject', () => {
|
|
8
|
+
expect(systemNoteToEvent(note('added ~bug label'))).toMatchObject({ kind: 'labeled', subject: 'bug' });
|
|
9
|
+
expect(systemNoteToEvent(note('added ~"needs review" label'))).toMatchObject({ kind: 'labeled', subject: 'needs review' });
|
|
10
|
+
expect(systemNoteToEvent(note('assigned to @mona'))).toMatchObject({ kind: 'assigned', subject: 'mona' });
|
|
11
|
+
expect(systemNoteToEvent(note('changed title from **old** to **New title**'))).toMatchObject({ kind: 'renamed', subject: 'New title' });
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test('state changes', () => {
|
|
15
|
+
expect(systemNoteToEvent(note('closed'))?.kind).toBe('closed');
|
|
16
|
+
expect(systemNoteToEvent(note('reopened'))?.kind).toBe('reopened');
|
|
17
|
+
expect(systemNoteToEvent(note('merged'))?.kind).toBe('merged');
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test('bookkeeping notes are dropped rather than drawn vaguely', () => {
|
|
21
|
+
expect(systemNoteToEvent(note('changed the description'))).toBeNull();
|
|
22
|
+
expect(systemNoteToEvent(note('added 3 commits'))).toBeNull();
|
|
23
|
+
});
|
|
24
|
+
});
|
package/backend/work/service.ts
CHANGED
|
@@ -42,6 +42,7 @@ import type {
|
|
|
42
42
|
import { getWorkAdapter } from './registry';
|
|
43
43
|
import { readBinding, resolveBinding, suggestLocators, toBindingInfo } from './bindings';
|
|
44
44
|
import type { WorkContext, WorkProviderAdapter } from './types';
|
|
45
|
+
import { credentialsForUse } from '$backend/git-hosts/credentials';
|
|
45
46
|
import { debug } from '$shared/utils/logger';
|
|
46
47
|
|
|
47
48
|
/**
|
|
@@ -66,15 +67,19 @@ function accountsFor(projectId: string): { account: IntegrationAccountRow; adapt
|
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
|
|
70
|
+
/**
|
|
71
|
+
* The adapter context, with a credential that is current — re-read from a
|
|
72
|
+
* linked CLI, or refreshed when an OAuth token is about to expire.
|
|
73
|
+
*/
|
|
74
|
+
async function contextOf(
|
|
70
75
|
account: IntegrationAccountRow,
|
|
71
76
|
projectId: string,
|
|
72
77
|
binding: NonNullable<ReturnType<typeof readBinding>>
|
|
73
|
-
): WorkContext {
|
|
78
|
+
): Promise<WorkContext> {
|
|
74
79
|
return {
|
|
75
80
|
projectId,
|
|
76
81
|
account,
|
|
77
|
-
credentials:
|
|
82
|
+
credentials: await credentialsForUse(account),
|
|
78
83
|
binding
|
|
79
84
|
};
|
|
80
85
|
}
|
|
@@ -93,7 +98,7 @@ export const workService = {
|
|
|
93
98
|
|
|
94
99
|
for (const { account, adapter } of accountsFor(projectId)) {
|
|
95
100
|
const provider = getProvider(account.provider);
|
|
96
|
-
const credentials = integrationAccountQueries.credentialsOf(account);
|
|
101
|
+
const credentials = await credentialsForUse(account).catch(() => integrationAccountQueries.credentialsOf(account));
|
|
97
102
|
|
|
98
103
|
let binding = readBinding(projectId, account.id);
|
|
99
104
|
if (!binding) {
|
|
@@ -132,7 +137,7 @@ export const workService = {
|
|
|
132
137
|
* "Not bound" is separated from "not connected" because they need different
|
|
133
138
|
* answers: one is a repository picker, the other is a connect dialog.
|
|
134
139
|
*/
|
|
135
|
-
require(projectId: string, accountId: string): { adapter: WorkProviderAdapter; context: WorkContext } {
|
|
140
|
+
async require(projectId: string, accountId: string): Promise<{ adapter: WorkProviderAdapter; context: WorkContext }> {
|
|
136
141
|
const account = integrationAccountQueries.getById(accountId);
|
|
137
142
|
if (!account) throw new Error('That integration account is no longer connected');
|
|
138
143
|
if (account.is_enabled !== 1) throw new Error(`${account.label} is switched off in Settings → Integrations`);
|
|
@@ -143,7 +148,7 @@ export const workService = {
|
|
|
143
148
|
const binding = readBinding(projectId, account.id);
|
|
144
149
|
if (!binding) throw new Error('This project is not pointed at a repository yet');
|
|
145
150
|
|
|
146
|
-
return { adapter, context: contextOf(account, projectId, binding) };
|
|
151
|
+
return { adapter, context: await contextOf(account, projectId, binding) };
|
|
147
152
|
},
|
|
148
153
|
|
|
149
154
|
/** How to print the bound remote project, for prompts and headings. */
|
|
@@ -156,17 +161,17 @@ export const workService = {
|
|
|
156
161
|
},
|
|
157
162
|
|
|
158
163
|
async list(projectId: string, accountId: string, query: WorkItemQuery): Promise<WorkItemPage> {
|
|
159
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
164
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
160
165
|
return adapter.list(context, query);
|
|
161
166
|
},
|
|
162
167
|
|
|
163
168
|
async get(projectId: string, accountId: string, kind: WorkItemKind, id: string): Promise<WorkItemDetail> {
|
|
164
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
169
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
165
170
|
return adapter.get(context, kind, id);
|
|
166
171
|
},
|
|
167
172
|
|
|
168
173
|
async listStates(projectId: string, accountId: string, kind: WorkItemKind): Promise<WorkItemStateOption[]> {
|
|
169
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
174
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
170
175
|
return adapter.listStates(context, kind);
|
|
171
176
|
},
|
|
172
177
|
|
|
@@ -177,7 +182,7 @@ export const workService = {
|
|
|
177
182
|
id: string,
|
|
178
183
|
body: string
|
|
179
184
|
): Promise<WorkItemComment> {
|
|
180
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
185
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
181
186
|
if (!adapter.capabilities.comments) throw new Error('This provider does not accept comments');
|
|
182
187
|
return adapter.comment(context, kind, id, body);
|
|
183
188
|
},
|
|
@@ -189,19 +194,19 @@ export const workService = {
|
|
|
189
194
|
id: string,
|
|
190
195
|
state: string
|
|
191
196
|
): Promise<void> {
|
|
192
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
197
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
193
198
|
if (!adapter.capabilities.transitions) throw new Error('This provider does not support state changes');
|
|
194
199
|
await adapter.transition(context, kind, id, state);
|
|
195
200
|
},
|
|
196
201
|
|
|
197
202
|
async listChecks(projectId: string, accountId: string, branch: string): Promise<CheckRun[]> {
|
|
198
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
203
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
199
204
|
if (!adapter.listChecks) return [];
|
|
200
205
|
return adapter.listChecks(context, branch);
|
|
201
206
|
},
|
|
202
207
|
|
|
203
208
|
async fetchCheckLogs(projectId: string, accountId: string, runId: string): Promise<CheckLogBundle> {
|
|
204
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
209
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
205
210
|
if (!adapter.fetchCheckLogs) throw new Error('This provider does not expose CI logs');
|
|
206
211
|
return adapter.fetchCheckLogs(context, runId);
|
|
207
212
|
},
|
|
@@ -213,13 +218,13 @@ export const workService = {
|
|
|
213
218
|
id: string,
|
|
214
219
|
patch: { title?: string; body?: string }
|
|
215
220
|
): Promise<void> {
|
|
216
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
221
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
217
222
|
if (!adapter.updateItem) throw new Error('This provider cannot edit items');
|
|
218
223
|
await adapter.updateItem(context, kind, id, patch);
|
|
219
224
|
},
|
|
220
225
|
|
|
221
226
|
async listLabels(projectId: string, accountId: string): Promise<string[]> {
|
|
222
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
227
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
223
228
|
if (!adapter.listLabels) return [];
|
|
224
229
|
return adapter.listLabels(context);
|
|
225
230
|
},
|
|
@@ -230,7 +235,7 @@ export const workService = {
|
|
|
230
235
|
comment: { id: string; source: CommentSource },
|
|
231
236
|
body: string
|
|
232
237
|
): Promise<WorkItemComment> {
|
|
233
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
238
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
234
239
|
if (!adapter.updateComment) throw new Error('This provider cannot edit comments');
|
|
235
240
|
return adapter.updateComment(context, comment, body);
|
|
236
241
|
},
|
|
@@ -240,7 +245,7 @@ export const workService = {
|
|
|
240
245
|
accountId: string,
|
|
241
246
|
comment: { id: string; source: CommentSource }
|
|
242
247
|
): Promise<void> {
|
|
243
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
248
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
244
249
|
if (!adapter.deleteComment) throw new Error('This provider cannot delete comments');
|
|
245
250
|
await adapter.deleteComment(context, comment);
|
|
246
251
|
},
|
|
@@ -251,25 +256,25 @@ export const workService = {
|
|
|
251
256
|
id: string,
|
|
252
257
|
options: { method: MergeMethod; title?: string; message?: string }
|
|
253
258
|
): Promise<void> {
|
|
254
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
259
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
255
260
|
if (!adapter.mergePullRequest) throw new Error('This provider cannot merge pull requests');
|
|
256
261
|
await adapter.mergePullRequest(context, id, options);
|
|
257
262
|
},
|
|
258
263
|
|
|
259
264
|
async listCommits(projectId: string, accountId: string, id: string): Promise<CommitRef[]> {
|
|
260
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
265
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
261
266
|
if (!adapter.listCommits) return [];
|
|
262
267
|
return adapter.listCommits(context, id);
|
|
263
268
|
},
|
|
264
269
|
|
|
265
270
|
async listFiles(projectId: string, accountId: string, id: string): Promise<FileChange[]> {
|
|
266
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
271
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
267
272
|
if (!adapter.listFiles) return [];
|
|
268
273
|
return adapter.listFiles(context, id);
|
|
269
274
|
},
|
|
270
275
|
|
|
271
276
|
async commitDetail(projectId: string, accountId: string, sha: string): Promise<CommitDetail> {
|
|
272
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
277
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
273
278
|
if (!adapter.commitDetail) throw new Error('This provider cannot open a commit');
|
|
274
279
|
return adapter.commitDetail(context, sha);
|
|
275
280
|
},
|
|
@@ -281,13 +286,13 @@ export const workService = {
|
|
|
281
286
|
ref: string,
|
|
282
287
|
blobSha?: string
|
|
283
288
|
): Promise<FileContent> {
|
|
284
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
289
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
285
290
|
if (!adapter.fetchFileContent) throw new Error('This provider cannot read file contents');
|
|
286
291
|
return adapter.fetchFileContent(context, path, ref, blobSha);
|
|
287
292
|
},
|
|
288
293
|
|
|
289
294
|
async listAssignees(projectId: string, accountId: string): Promise<string[]> {
|
|
290
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
295
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
291
296
|
if (!adapter.listAssignees) return [];
|
|
292
297
|
return adapter.listAssignees(context);
|
|
293
298
|
},
|
|
@@ -299,17 +304,35 @@ export const workService = {
|
|
|
299
304
|
id: string,
|
|
300
305
|
logins: string[]
|
|
301
306
|
): Promise<void> {
|
|
302
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
307
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
303
308
|
if (!adapter.setAssignees) throw new Error('This provider cannot change assignees');
|
|
304
309
|
await adapter.setAssignees(context, kind, id, logins);
|
|
305
310
|
},
|
|
306
311
|
|
|
312
|
+
async setLabels(
|
|
313
|
+
projectId: string,
|
|
314
|
+
accountId: string,
|
|
315
|
+
kind: WorkItemKind,
|
|
316
|
+
id: string,
|
|
317
|
+
labels: string[]
|
|
318
|
+
): Promise<void> {
|
|
319
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
320
|
+
if (!adapter.setLabels) throw new Error('This provider cannot change labels');
|
|
321
|
+
await adapter.setLabels(context, kind, id, labels);
|
|
322
|
+
},
|
|
323
|
+
|
|
324
|
+
async setReviewers(projectId: string, accountId: string, id: string, logins: string[]): Promise<void> {
|
|
325
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
326
|
+
if (!adapter.setReviewers) throw new Error('This provider cannot request reviewers');
|
|
327
|
+
await adapter.setReviewers(context, id, logins);
|
|
328
|
+
},
|
|
329
|
+
|
|
307
330
|
async createIssue(
|
|
308
331
|
projectId: string,
|
|
309
332
|
accountId: string,
|
|
310
333
|
draft: { title: string; body: string; assignees: string[]; labels: string[] }
|
|
311
334
|
): Promise<WorkItem> {
|
|
312
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
335
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
313
336
|
if (!adapter.createIssue) throw new Error('This provider cannot create issues');
|
|
314
337
|
return adapter.createIssue(context, draft);
|
|
315
338
|
},
|
|
@@ -319,7 +342,7 @@ export const workService = {
|
|
|
319
342
|
accountId: string,
|
|
320
343
|
draft: PullRequestDraft
|
|
321
344
|
): Promise<WorkItem> {
|
|
322
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
345
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
323
346
|
if (!adapter.createPullRequest) throw new Error('This provider cannot open pull requests');
|
|
324
347
|
|
|
325
348
|
const created = await adapter.createPullRequest(context, draft);
|
|
@@ -344,7 +367,7 @@ export const workService = {
|
|
|
344
367
|
accountId: string,
|
|
345
368
|
branch: string
|
|
346
369
|
): Promise<WorkItem | null> {
|
|
347
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
370
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
348
371
|
if (!adapter.findPullRequestForBranch) return null;
|
|
349
372
|
return adapter.findPullRequestForBranch(context, branch);
|
|
350
373
|
},
|
|
@@ -358,7 +381,7 @@ export const workService = {
|
|
|
358
381
|
* rate limit.
|
|
359
382
|
*/
|
|
360
383
|
async defaultBranch(projectId: string, accountId: string): Promise<string> {
|
|
361
|
-
const { adapter, context } = this.require(projectId, accountId);
|
|
384
|
+
const { adapter, context } = await this.require(projectId, accountId);
|
|
362
385
|
if (context.binding.defaultBranch) return context.binding.defaultBranch;
|
|
363
386
|
|
|
364
387
|
const branch = await adapter.defaultBranch(context);
|
|
@@ -424,13 +447,14 @@ export const workService = {
|
|
|
424
447
|
// An account bound to a project probes against that project's repository;
|
|
425
448
|
// an unbound one can only prove the credential itself is good.
|
|
426
449
|
const binding = projectId ? readBinding(projectId, accountId) : null;
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
450
|
+
let credentials: Record<string, string>;
|
|
451
|
+
try {
|
|
452
|
+
credentials = await credentialsForUse(account);
|
|
453
|
+
} catch (error) {
|
|
454
|
+
// A linked CLI that logged out, or an OAuth token that could not be
|
|
455
|
+
// renewed, is exactly a sign-in problem — say so, not "error".
|
|
456
|
+
return { status: 'needs_auth', detail: error instanceof Error ? error.message : String(error) };
|
|
457
|
+
}
|
|
458
|
+
return adapter.probe({ projectId: projectId ?? '', account, credentials }, binding);
|
|
435
459
|
}
|
|
436
460
|
};
|
|
@@ -84,7 +84,7 @@ export async function startWork(input: {
|
|
|
84
84
|
engine: EngineType;
|
|
85
85
|
userId: string;
|
|
86
86
|
}): Promise<StartWorkResult> {
|
|
87
|
-
const { adapter, context } = workService.require(input.projectId, input.accountId);
|
|
87
|
+
const { adapter, context } = await workService.require(input.projectId, input.accountId);
|
|
88
88
|
|
|
89
89
|
const item: WorkItemDetail = await adapter.get(context, input.kind, input.itemId);
|
|
90
90
|
|
package/backend/work/types.ts
CHANGED
|
@@ -172,6 +172,10 @@ export interface WorkProviderAdapter {
|
|
|
172
172
|
/** People this item can be assigned to. */
|
|
173
173
|
listAssignees?(context: WorkContext): Promise<string[]>;
|
|
174
174
|
setAssignees?(context: WorkContext, kind: WorkItemKind, id: string, logins: string[]): Promise<void>;
|
|
175
|
+
/** Replace an item's labels with exactly these. */
|
|
176
|
+
setLabels?(context: WorkContext, kind: WorkItemKind, id: string, labels: string[]): Promise<void>;
|
|
177
|
+
/** Make these exactly the pull request's requested reviewers. Candidates come from `listAssignees`. */
|
|
178
|
+
setReviewers?(context: WorkContext, id: string, logins: string[]): Promise<void>;
|
|
175
179
|
|
|
176
180
|
createIssue?(
|
|
177
181
|
context: WorkContext,
|
|
@@ -11,7 +11,7 @@ import { projectQueries, worktreeQueries } from '../database/queries';
|
|
|
11
11
|
import { fileWatcher } from '../files/file-watcher';
|
|
12
12
|
import { debug } from '$shared/utils/logger';
|
|
13
13
|
import { cleanupWorktreeSessions } from '../terminal/ptykit';
|
|
14
|
-
import { browserPreviewServiceManager } from '../preview';
|
|
14
|
+
import { browserPool, browserPreviewServiceManager } from '../preview';
|
|
15
15
|
import { makeScopeKey } from '$shared/utils/workspace-scope';
|
|
16
16
|
import { cloneTree } from './clone';
|
|
17
17
|
import {
|
|
@@ -189,7 +189,12 @@ function releaseWorkspaceScope(projectId: string, worktreeId: string): void {
|
|
|
189
189
|
const scopeKey = makeScopeKey(projectId, worktreeId);
|
|
190
190
|
try {
|
|
191
191
|
cleanupWorktreeSessions(projectId, worktreeId);
|
|
192
|
-
|
|
192
|
+
// Tabs first, then the profile: a worktree's Chrome profile (cookies,
|
|
193
|
+
// storage, cache) belongs to the worktree and would otherwise stay on
|
|
194
|
+
// disk forever under a name nothing can reach again.
|
|
195
|
+
void browserPreviewServiceManager.removeService(scopeKey)
|
|
196
|
+
.catch(() => {})
|
|
197
|
+
.finally(() => browserPool.clearBrowsingData(scopeKey).catch(() => false));
|
|
193
198
|
fileWatcher.releaseProject(scopeKey);
|
|
194
199
|
} catch (error) {
|
|
195
200
|
debug.warn('worktree', `Scope cleanup failed for ${scopeKey}: ${error}`);
|
|
@@ -328,6 +333,22 @@ export async function countPendingChanges(worktreeId: string): Promise<number> {
|
|
|
328
333
|
}
|
|
329
334
|
}
|
|
330
335
|
|
|
336
|
+
/**
|
|
337
|
+
* Like `countPendingChanges`, but null when the count cannot be taken. For
|
|
338
|
+
* callers deciding whether a worktree may be removed, where "could not tell"
|
|
339
|
+
* must never read as "nothing to lose".
|
|
340
|
+
*/
|
|
341
|
+
export async function pendingChangeCountOrNull(worktreeId: string): Promise<number | null> {
|
|
342
|
+
const worktree = worktreeQueries.getById(worktreeId);
|
|
343
|
+
if (!worktree) return null;
|
|
344
|
+
try {
|
|
345
|
+
const { plan } = await buildPlan(worktree, 'apply');
|
|
346
|
+
return plan.entries.length;
|
|
347
|
+
} catch {
|
|
348
|
+
return null;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
331
352
|
function requireWorktree(worktreeId: string): Worktree {
|
|
332
353
|
const worktree = worktreeQueries.getById(worktreeId);
|
|
333
354
|
if (!worktree) throw new Error('Worktree not found');
|
|
@@ -67,6 +67,14 @@ interface QueuedMessage {
|
|
|
67
67
|
|
|
68
68
|
/** chatSessionId → its draft. */
|
|
69
69
|
const drafts = new Map<string, Draft>();
|
|
70
|
+
/**
|
|
71
|
+
* chatSessionId → attachment id → its bytes. A save sends the bytes of a file
|
|
72
|
+
* once, then names it by id; the draft is rebuilt from here. Kept a moment
|
|
73
|
+
* past the draft that dropped them, because another tab's write that lost the
|
|
74
|
+
* revision race may still be followed by one that names them.
|
|
75
|
+
*/
|
|
76
|
+
const draftBytes = new Map<string, Map<string, { base64: string; receivedAt: number }>>();
|
|
77
|
+
const DRAFT_BYTES_GRACE_MS = 60_000;
|
|
70
78
|
/** chatSessionId → the message being edited. */
|
|
71
79
|
const edits = new Map<string, EditState>();
|
|
72
80
|
/** chatSessionId → messages waiting for the current turn to finish, in order. */
|
|
@@ -244,6 +252,7 @@ streamManager.on('session:turn-started', (chatSessionId: string) => {
|
|
|
244
252
|
// Deleting a session drops everything its composer was holding.
|
|
245
253
|
streamManager.on('session:cleanup', (chatSessionId: string) => {
|
|
246
254
|
drafts.delete(chatSessionId);
|
|
255
|
+
draftBytes.delete(chatSessionId);
|
|
247
256
|
edits.delete(chatSessionId);
|
|
248
257
|
queues.delete(chatSessionId);
|
|
249
258
|
});
|
|
@@ -260,6 +269,15 @@ const attachmentSchema = t.Object({
|
|
|
260
269
|
base64: t.String()
|
|
261
270
|
});
|
|
262
271
|
|
|
272
|
+
/** An attachment in a save: its bytes the first time, its id alone after that. */
|
|
273
|
+
const savedAttachmentSchema = t.Object({
|
|
274
|
+
id: t.String(),
|
|
275
|
+
fileName: t.String(),
|
|
276
|
+
type: t.String(),
|
|
277
|
+
mediaType: t.String(),
|
|
278
|
+
base64: t.Optional(t.String())
|
|
279
|
+
});
|
|
280
|
+
|
|
263
281
|
const engineSchema = t.Object({
|
|
264
282
|
type: t.Union([t.Literal('claude-code'), t.Literal('opencode'), t.Literal('copilot'), t.Literal('codex'), t.Literal('qwen'), t.Literal('pi'), t.Literal('cline'), t.Literal('cursor')]),
|
|
265
283
|
provider: t.String(),
|
|
@@ -317,14 +335,15 @@ export const composerHandler = createRouter()
|
|
|
317
335
|
})
|
|
318
336
|
|
|
319
337
|
// Save the draft. Omitted fields are left as they are, so typing
|
|
320
|
-
// sends text only and attachments travel only when they change
|
|
321
|
-
// only
|
|
338
|
+
// sends text only and attachments travel only when they change — and then
|
|
339
|
+
// only the bytes of files the server hasn't had yet. A part is only
|
|
340
|
+
// replaced by a write newer than the one it holds.
|
|
322
341
|
.on('chat:draft-save', {
|
|
323
342
|
data: t.Object({
|
|
324
343
|
chatSessionId: t.String(),
|
|
325
344
|
revision: t.Number(),
|
|
326
345
|
text: t.Optional(t.String()),
|
|
327
|
-
attachments: t.Optional(t.Array(
|
|
346
|
+
attachments: t.Optional(t.Array(savedAttachmentSchema))
|
|
328
347
|
})
|
|
329
348
|
}, ({ data }) => {
|
|
330
349
|
requireSessionAccess(data.chatSessionId);
|
|
@@ -333,9 +352,31 @@ export const composerHandler = createRouter()
|
|
|
333
352
|
draft.text = data.text;
|
|
334
353
|
draft.textRevision = data.revision;
|
|
335
354
|
}
|
|
336
|
-
if (data.attachments !== undefined
|
|
337
|
-
|
|
338
|
-
|
|
355
|
+
if (data.attachments !== undefined) {
|
|
356
|
+
const bytes = draftBytes.get(data.chatSessionId) ?? new Map<string, { base64: string; receivedAt: number }>();
|
|
357
|
+
const now = Date.now();
|
|
358
|
+
for (const attachment of data.attachments) {
|
|
359
|
+
if (attachment.base64 !== undefined) bytes.set(attachment.id, { base64: attachment.base64, receivedAt: now });
|
|
360
|
+
}
|
|
361
|
+
if (data.revision > draft.attachmentsRevision) {
|
|
362
|
+
const attachments: DraftAttachment[] = [];
|
|
363
|
+
for (const attachment of data.attachments) {
|
|
364
|
+
const base64 = attachment.base64 ?? bytes.get(attachment.id)?.base64;
|
|
365
|
+
if (base64 === undefined) {
|
|
366
|
+
debug.warn('chat', `Draft attachment ${attachment.id} was named before its bytes arrived; left out`);
|
|
367
|
+
continue;
|
|
368
|
+
}
|
|
369
|
+
attachments.push({ ...attachment, base64 });
|
|
370
|
+
}
|
|
371
|
+
draft.attachments = attachments;
|
|
372
|
+
draft.attachmentsRevision = data.revision;
|
|
373
|
+
const kept = new Set(attachments.map((attachment) => attachment.id));
|
|
374
|
+
for (const [id, entry] of bytes) {
|
|
375
|
+
if (!kept.has(id) && now - entry.receivedAt > DRAFT_BYTES_GRACE_MS) bytes.delete(id);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
if (bytes.size > 0) draftBytes.set(data.chatSessionId, bytes);
|
|
379
|
+
else draftBytes.delete(data.chatSessionId);
|
|
339
380
|
}
|
|
340
381
|
drafts.set(data.chatSessionId, draft);
|
|
341
382
|
})
|
|
@@ -123,6 +123,14 @@ function handleWaitingInputChange(
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
// A stream started or stopped waiting on background work between turns: every
|
|
127
|
+
// device's indicator follows presence (see waitingOnBackground).
|
|
128
|
+
streamManager.on('stream:background', () => {
|
|
129
|
+
broadcastPresence().catch((err) => {
|
|
130
|
+
debug.warn('chat', 'Presence broadcast error on background-work change:', err);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
|
|
126
134
|
streamManager.on('stream:message', (payload: { event: StreamEvent; chatSessionId: string; projectId?: string }) => {
|
|
127
135
|
try {
|
|
128
136
|
handleWaitingInputChange(payload.event, payload.chatSessionId, payload.projectId);
|
|
@@ -636,7 +644,11 @@ export const streamHandler = createRouter()
|
|
|
636
644
|
t.Literal('cancelled')
|
|
637
645
|
]),
|
|
638
646
|
processId: t.String(),
|
|
639
|
-
|
|
647
|
+
/**
|
|
648
|
+
* The stream's event sequence when this snapshot was taken. A client
|
|
649
|
+
* that already applied a newer event treats the snapshot as stale.
|
|
650
|
+
*/
|
|
651
|
+
seq: t.Optional(t.Number()),
|
|
640
652
|
currentPartialText: t.Optional(t.String()),
|
|
641
653
|
currentReasoningText: t.Optional(t.String()),
|
|
642
654
|
/** The blocks those two texts belong to (see `chat:partial`). */
|
|
@@ -664,7 +676,6 @@ export const streamHandler = createRouter()
|
|
|
664
676
|
streamId: data.chatSessionId || '',
|
|
665
677
|
status: 'completed' as const,
|
|
666
678
|
processId: '',
|
|
667
|
-
messages: [],
|
|
668
679
|
currentPartialText: undefined,
|
|
669
680
|
currentReasoningText: undefined,
|
|
670
681
|
error: undefined,
|
|
@@ -677,14 +688,12 @@ export const streamHandler = createRouter()
|
|
|
677
688
|
streamId: streamState.streamId,
|
|
678
689
|
status: streamState.status,
|
|
679
690
|
processId: streamState.processId,
|
|
680
|
-
//
|
|
681
|
-
//
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
: entry;
|
|
687
|
-
}),
|
|
691
|
+
// No message history here: the transcript is loaded through
|
|
692
|
+
// messages:list-page, and a long turn's history (screenshots
|
|
693
|
+
// included) made this reply megabytes — sent in chunks that newer
|
|
694
|
+
// live events overtook, so the snapshot landed after the messages
|
|
695
|
+
// it predated.
|
|
696
|
+
seq: streamState.eventSeq,
|
|
688
697
|
currentPartialText: streamState.currentPartialText,
|
|
689
698
|
currentReasoningText: streamState.currentReasoningText,
|
|
690
699
|
partialBlock: streamState.partialBlock,
|
|
@@ -55,7 +55,7 @@ export function createSafeRegex(pattern: string, flags: string): RegExp | null {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
// Directories to skip during search
|
|
58
|
-
const SKIP_DIRS = new Set([
|
|
58
|
+
export const SKIP_DIRS = new Set([
|
|
59
59
|
'node_modules', '.git', '.svelte-kit', 'build', 'dist', 'coverage',
|
|
60
60
|
'.next', '.nuxt', 'target', '.cache', '.output', '__pycache__',
|
|
61
61
|
'.venv', 'venv', '.tox', '.eggs', '.mypy_cache', 'vendor',
|
|
@@ -25,6 +25,9 @@ import {
|
|
|
25
25
|
import { createArchiveOperation, extractArchiveOperation } from '../../files/file-archive';
|
|
26
26
|
import { stat as fsStat, readdir as fsReaddir, rename as fsRename } from 'node:fs/promises';
|
|
27
27
|
import { resolveFilePath } from './path-access';
|
|
28
|
+
import { projectAtFolder, protectedFolderReason } from '../../projects/folder-guard';
|
|
29
|
+
import { moveProject } from '../../projects/move';
|
|
30
|
+
import { basename, dirname } from 'node:path';
|
|
28
31
|
|
|
29
32
|
export const writeHandler = createRouter()
|
|
30
33
|
// Write file operation
|
|
@@ -218,6 +221,8 @@ export const writeHandler = createRouter()
|
|
|
218
221
|
if (!stats.isDirectory()) {
|
|
219
222
|
throw new Error('Path is not a directory');
|
|
220
223
|
}
|
|
224
|
+
const reason = protectedFolderReason(dirPath);
|
|
225
|
+
if (reason) throw new Error(`This folder cannot be deleted: ${reason}.`);
|
|
221
226
|
const entries = await fsReaddir(dirPath);
|
|
222
227
|
if (entries.length > 0) {
|
|
223
228
|
throw new Error('Directory is not empty');
|
|
@@ -231,6 +236,11 @@ export const writeHandler = createRouter()
|
|
|
231
236
|
// fs.rename directly
|
|
232
237
|
// because Bun.file(...).exists() returns false for directories, which
|
|
233
238
|
// makes the generic renameOperation unusable here.
|
|
239
|
+
//
|
|
240
|
+
// A folder that is a project moves WITH its project (the picker sends a
|
|
241
|
+
// listed project through projects:rename; one removed from the list but
|
|
242
|
+
// kept for restoring lands here). A folder holding a project, the home
|
|
243
|
+
// folder and Clopen's data never move.
|
|
234
244
|
.http('files:rename-directory', {
|
|
235
245
|
data: t.Object({
|
|
236
246
|
oldPath: t.String(),
|
|
@@ -256,6 +266,23 @@ export const writeHandler = createRouter()
|
|
|
256
266
|
throw new Error('Source path is not a directory');
|
|
257
267
|
}
|
|
258
268
|
|
|
269
|
+
const project = projectAtFolder(oldPath);
|
|
270
|
+
if (project) {
|
|
271
|
+
if (dirname(newPath) !== dirname(oldPath)) throw new Error('A project folder can only be renamed in place.');
|
|
272
|
+
const outcome = await moveProject(project.id, { kind: 'rename', name: basename(newPath) });
|
|
273
|
+
if (outcome.status === 'busy') {
|
|
274
|
+
throw new Error('This folder is a project with chats or terminals still running. Stop them and try again.');
|
|
275
|
+
}
|
|
276
|
+
return {
|
|
277
|
+
message: 'Directory renamed successfully',
|
|
278
|
+
oldPath,
|
|
279
|
+
newPath: outcome.project.path,
|
|
280
|
+
modified: (await fsStat(outcome.project.path)).mtime.toISOString()
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
const reason = protectedFolderReason(oldPath);
|
|
284
|
+
if (reason) throw new Error(`This folder cannot be renamed: ${reason}.`);
|
|
285
|
+
|
|
259
286
|
// Reject only when the destination is a genuinely different entry. On
|
|
260
287
|
// case-insensitive filesystems (default on macOS and Windows) a
|
|
261
288
|
// case-only rename like "Foo" -> "foo" makes the destination resolve to
|