@myrialabs/clopen 0.4.50 → 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/engine-handoff.ts +42 -6
- package/backend/chat/stream-manager.ts +41 -5
- 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/090_create_storage_tables.ts +83 -0
- package/backend/database/migrations/index.ts +11 -2
- package/backend/database/queries/integration-queries.ts +10 -0
- package/backend/database/queries/memory-queue-queries.ts +11 -0
- package/backend/database/queries/project-queries.ts +6 -0
- package/backend/database/queries/session-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/stream.ts +5 -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.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 +50 -10
- 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/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/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/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/mentions/index.ts +81 -0
- 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 +15 -16
- package/dist/assets/{index-By6KdSLT.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-DV4TiDn1.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 +6 -7
- 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/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 +1 -0
- package/shared/types/unified/message.ts +26 -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 +18 -1
- package/shared/utils/process-supervisor.ts +12 -23
- 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/index-By6KdSLT.js.br +0 -0
- package/dist/assets/index-By6KdSLT.js.gz +0 -0
- package/dist/assets/index-DV4TiDn1.js.br +0 -0
- package/dist/assets/index-DV4TiDn1.js.gz +0 -0
- package/dist/assets/main-DIESTGTD.css +0 -1
- package/dist/assets/main-DIESTGTD.css.br +0 -0
- package/dist/assets/main-DIESTGTD.css.gz +0 -0
- package/dist/assets/main-Da3JKoua.js +0 -1240
- package/dist/assets/main-Da3JKoua.js.br +0 -0
- package/dist/assets/main-Da3JKoua.js.gz +0 -0
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
export const INTEGRATION_CAPABILITIES = [
|
|
19
19
|
'agent-tools',
|
|
20
|
-
/** Issues, pull requests and CI — the
|
|
20
|
+
/** Issues, pull requests and CI — the hosting view of the Git panel. */
|
|
21
21
|
'work',
|
|
22
22
|
'deployments',
|
|
23
23
|
'database',
|
|
@@ -42,8 +42,52 @@ export type IntegrationAuthMethod =
|
|
|
42
42
|
| 'oauth-code'
|
|
43
43
|
| 'mcp-oauth'
|
|
44
44
|
| 'connection-string'
|
|
45
|
+
/** Borrowed from a CLI already signed in on this machine — `gh`, `glab`, `tea`, or git's own keychain. */
|
|
46
|
+
| 'cli'
|
|
45
47
|
| 'none';
|
|
46
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Sign-in facts for a provider that hosts git repositories.
|
|
51
|
+
*
|
|
52
|
+
* Declared per provider so the connect dialog can offer every method the
|
|
53
|
+
* service supports, in the order that costs the user least: a CLI that is
|
|
54
|
+
* already signed in, then a browser sign-in, then a pasted token.
|
|
55
|
+
*/
|
|
56
|
+
export interface IntegrationHostingInfo {
|
|
57
|
+
/** `github.com`, `gitlab.com` — null when the service is self-hosted only. */
|
|
58
|
+
defaultHost: string | null;
|
|
59
|
+
/** True when a server URL may (or must) be given. */
|
|
60
|
+
selfHosted: boolean;
|
|
61
|
+
/** True when the server URL is required — there is no cloud default. */
|
|
62
|
+
requiresServerUrl: boolean;
|
|
63
|
+
/** The CLI whose login can be borrowed, when there is one. */
|
|
64
|
+
cli: 'gh' | 'glab' | 'tea' | null;
|
|
65
|
+
/** OAuth device flow is available (a client id may still be needed). */
|
|
66
|
+
deviceFlow: boolean;
|
|
67
|
+
/** OAuth authorization-code + PKCE in the browser is available. */
|
|
68
|
+
browserFlow: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Whether Clopen ships a client id for the cloud host. Without one, OAuth
|
|
71
|
+
* needs the user's own app's client id — always true for a self-hosted
|
|
72
|
+
* server, which Clopen has no app on.
|
|
73
|
+
*/
|
|
74
|
+
hasBundledClientId: boolean;
|
|
75
|
+
/** Where to register an OAuth app on this service, for the "use your own" hint. */
|
|
76
|
+
oauthAppUrl: string | null;
|
|
77
|
+
/** Scopes Clopen asks for, shown before the user consents. */
|
|
78
|
+
scopes: string[];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Hosting facts about one connected account — never the credential. */
|
|
82
|
+
export interface IntegrationAccountHosting {
|
|
83
|
+
host: string;
|
|
84
|
+
login: string | null;
|
|
85
|
+
/** The CLI this account re-reads its token from on every use, when linked. */
|
|
86
|
+
linkedCli: 'gh' | 'glab' | 'tea' | null;
|
|
87
|
+
/** When an OAuth token stops working without a refresh. Null = no expiry. */
|
|
88
|
+
expiresAt: string | null;
|
|
89
|
+
}
|
|
90
|
+
|
|
47
91
|
/**
|
|
48
92
|
* Declared as a const array rather than a bare union so the WebSocket schema can
|
|
49
93
|
* be generated from it. A `t.String()` there would widen `category` back to
|
|
@@ -95,9 +139,13 @@ export interface IntegrationProviderInfo {
|
|
|
95
139
|
*/
|
|
96
140
|
consoleUrl?: string;
|
|
97
141
|
authMethod: IntegrationAuthMethod;
|
|
142
|
+
/** Every way this provider can be connected, preferred first. Always includes `authMethod`. */
|
|
143
|
+
authMethods: IntegrationAuthMethod[];
|
|
98
144
|
credentialFields: IntegrationCredentialField[];
|
|
99
145
|
capabilities: IntegrationCapability[];
|
|
100
146
|
defaultCapabilities: IntegrationCapability[];
|
|
147
|
+
/** Present for providers that host git repositories. */
|
|
148
|
+
hosting?: IntegrationHostingInfo;
|
|
101
149
|
/** True when connecting projects an MCP server row. */
|
|
102
150
|
providesAgentTools: boolean;
|
|
103
151
|
/** True when the provider can receive inbound webhooks. */
|
|
@@ -122,6 +170,8 @@ export interface IntegrationAccountInfo {
|
|
|
122
170
|
updatedAt: string;
|
|
123
171
|
/** Surfaces this account currently owns a row on. */
|
|
124
172
|
projections: IntegrationProjectionInfo[];
|
|
173
|
+
/** Present for accounts of a git hosting provider. */
|
|
174
|
+
hosting?: IntegrationAccountHosting;
|
|
125
175
|
}
|
|
126
176
|
|
|
127
177
|
export interface IntegrationProjectionInfo {
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@` mentions — everything a message can point at besides its own files.
|
|
3
|
+
*
|
|
4
|
+
* A mention becomes a numbered attachment of the message, like a dropped file:
|
|
5
|
+
* the same `@N`, the same card, the same renumbering. What the attachment holds
|
|
6
|
+
* is a snapshot taken at the moment it was mentioned — a terminal's output, a
|
|
7
|
+
* diff, a page element — written as a document whose first line says what it
|
|
8
|
+
* is (see `shared/utils/context-document.ts`). Every snapshot is saved into the
|
|
9
|
+
* session's folder and the engine is given its path, so a big one costs the
|
|
10
|
+
* model a read, not its context window.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { IconName } from './ui/icons';
|
|
14
|
+
|
|
15
|
+
/** What a mention is of. */
|
|
16
|
+
export type ContextKind =
|
|
17
|
+
| 'file'
|
|
18
|
+
| 'folder'
|
|
19
|
+
| 'code'
|
|
20
|
+
| 'terminal'
|
|
21
|
+
| 'terminal-selection'
|
|
22
|
+
| 'git-changes'
|
|
23
|
+
| 'git-staged'
|
|
24
|
+
| 'git-file'
|
|
25
|
+
| 'git-commit'
|
|
26
|
+
| 'git-branch'
|
|
27
|
+
| 'git-stash'
|
|
28
|
+
| 'git-conflicts'
|
|
29
|
+
| 'preview-tab'
|
|
30
|
+
| 'preview-element'
|
|
31
|
+
| 'preview-console'
|
|
32
|
+
| 'chat-session'
|
|
33
|
+
| 'chat-message'
|
|
34
|
+
| 'project'
|
|
35
|
+
| 'ai-changes'
|
|
36
|
+
| 'work-item'
|
|
37
|
+
| 'note'
|
|
38
|
+
| 'memory'
|
|
39
|
+
| 'db-connection'
|
|
40
|
+
| 'db-table'
|
|
41
|
+
| 'db-result'
|
|
42
|
+
| 'deployment'
|
|
43
|
+
| 'container'
|
|
44
|
+
| 'port'
|
|
45
|
+
| 'env-file';
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* What a context attachment is, read from its own first line. Carried on the
|
|
49
|
+
* saved message too (`FileBlock.source`), so the timeline can draw the card
|
|
50
|
+
* without reading the file.
|
|
51
|
+
*/
|
|
52
|
+
export interface ContextSource {
|
|
53
|
+
kind: ContextKind;
|
|
54
|
+
/** Short name: a tab title, a file path, a commit subject. */
|
|
55
|
+
label: string;
|
|
56
|
+
/** One line of extra detail: "1,240 lines", "src/app.ts · L10–24". */
|
|
57
|
+
detail?: string;
|
|
58
|
+
/**
|
|
59
|
+
* For a `file` mention, the file itself, relative to the workspace root:
|
|
60
|
+
* the engine is pointed at the real file rather than at a copy of it.
|
|
61
|
+
*/
|
|
62
|
+
path?: string;
|
|
63
|
+
/** ISO time the snapshot was taken. */
|
|
64
|
+
capturedAt: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Where a mentionable thing is looked up when it is picked. */
|
|
68
|
+
export type MentionRef = Record<string, string | number | boolean | null>;
|
|
69
|
+
|
|
70
|
+
/** One row of the `@` picker. */
|
|
71
|
+
export interface MentionCandidate {
|
|
72
|
+
/** Unique within one result list. */
|
|
73
|
+
key: string;
|
|
74
|
+
kind: ContextKind;
|
|
75
|
+
/** Heading the row is listed under. */
|
|
76
|
+
group: string;
|
|
77
|
+
label: string;
|
|
78
|
+
/** Every row has one, so the list reads evenly. */
|
|
79
|
+
detail: string;
|
|
80
|
+
icon: IconName;
|
|
81
|
+
/** Handed back to `mentions:capture` when the row is picked. */
|
|
82
|
+
ref: MentionRef;
|
|
83
|
+
/**
|
|
84
|
+
* Set on a row that opens a list rather than being picked — a category, a
|
|
85
|
+
* database to look into. The value is the category asked for next.
|
|
86
|
+
*/
|
|
87
|
+
browse?: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** A file a capture produced: a context document, or an image beside it. */
|
|
91
|
+
export interface CapturedAttachment {
|
|
92
|
+
fileName: string;
|
|
93
|
+
mediaType: string;
|
|
94
|
+
/** Base64 bytes. */
|
|
95
|
+
data: string;
|
|
96
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A GitHub release, read for the people who use Clopen rather than the people
|
|
3
|
+
* who build it: conventional-commit prefixes become a kind, author handles and
|
|
4
|
+
* pull-request URLs become a number. See backend/update/release-notes.ts.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export type ReleaseChangeKind = 'feature' | 'improvement' | 'fix' | 'other';
|
|
8
|
+
|
|
9
|
+
export interface ReleaseChange {
|
|
10
|
+
kind: ReleaseChangeKind;
|
|
11
|
+
/** The commit scope — `chat`, `git`, `server` — when the entry had one. */
|
|
12
|
+
scope?: string;
|
|
13
|
+
/** The entry itself, first letter capitalised, author and link removed. */
|
|
14
|
+
summary: string;
|
|
15
|
+
breaking: boolean;
|
|
16
|
+
pullNumber?: number;
|
|
17
|
+
pullUrl?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ReleaseNote {
|
|
21
|
+
/** `0.4.50`, no prefix. */
|
|
22
|
+
version: string;
|
|
23
|
+
tagName: string;
|
|
24
|
+
url: string;
|
|
25
|
+
publishedAt: string;
|
|
26
|
+
changes: ReleaseChange[];
|
|
27
|
+
/** GitHub handles from the "New Contributors" section. */
|
|
28
|
+
newContributors: string[];
|
|
29
|
+
/** Hand-written markdown that is not a change entry, if the release had any. */
|
|
30
|
+
notes: string;
|
|
31
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings → Storage: what Clopen keeps on disk, and what can be removed.
|
|
3
|
+
*
|
|
4
|
+
* One report answers both questions. The scanner measures every category once,
|
|
5
|
+
* attributes what it can to a project, and prices every cleanup at the same
|
|
6
|
+
* time, so the numbers a cleanup promises are the numbers the report shows.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { EngineType } from './unified';
|
|
10
|
+
|
|
11
|
+
export type StorageCategoryId =
|
|
12
|
+
| 'chats'
|
|
13
|
+
| 'engine-transcripts'
|
|
14
|
+
| 'engine-caches'
|
|
15
|
+
| 'snapshots'
|
|
16
|
+
| 'worktrees'
|
|
17
|
+
| 'preview-profiles'
|
|
18
|
+
| 'stack'
|
|
19
|
+
| 'other';
|
|
20
|
+
|
|
21
|
+
export interface StorageCategory {
|
|
22
|
+
id: StorageCategoryId;
|
|
23
|
+
bytes: number;
|
|
24
|
+
/** Bytes the safe cleanups would free from this category right now. */
|
|
25
|
+
reclaimableBytes: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Clopen data attributable to one project. */
|
|
29
|
+
export interface StorageProjectBreakdown {
|
|
30
|
+
chats: number;
|
|
31
|
+
engineTranscripts: number;
|
|
32
|
+
snapshots: number;
|
|
33
|
+
worktrees: number;
|
|
34
|
+
previewProfiles: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface StorageProjectEntry {
|
|
38
|
+
projectId: string;
|
|
39
|
+
name: string;
|
|
40
|
+
path: string;
|
|
41
|
+
/** Sum of `breakdown` — Clopen's data for this project, not the project folder. */
|
|
42
|
+
bytes: number;
|
|
43
|
+
breakdown: StorageProjectBreakdown;
|
|
44
|
+
sessionCount: number;
|
|
45
|
+
slimmedSessionCount: number;
|
|
46
|
+
worktreeCount: number;
|
|
47
|
+
lastActivityAt: string | null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface StorageEngineEntry {
|
|
51
|
+
engine: EngineType;
|
|
52
|
+
/** Session transcripts and stores. */
|
|
53
|
+
transcriptBytes: number;
|
|
54
|
+
transcriptCount: number;
|
|
55
|
+
/** Transcripts no chat in Clopen refers to any more. */
|
|
56
|
+
orphanBytes: number;
|
|
57
|
+
orphanCount: number;
|
|
58
|
+
/** Transcripts fully contained in a later one (Claude forks). */
|
|
59
|
+
redundantBytes: number;
|
|
60
|
+
redundantCount: number;
|
|
61
|
+
/** Everything else under the engine's home: tool caches, logs, plugins, config. */
|
|
62
|
+
otherBytes: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type CleanupActionId =
|
|
66
|
+
| 'orphan-transcripts'
|
|
67
|
+
| 'dedupe-transcripts'
|
|
68
|
+
| 'orphan-snapshots'
|
|
69
|
+
| 'orphan-profiles'
|
|
70
|
+
| 'orphan-worktree-dirs'
|
|
71
|
+
| 'legacy-engine-data'
|
|
72
|
+
| 'browser-cache'
|
|
73
|
+
| 'tool-caches'
|
|
74
|
+
| 'engine-logs'
|
|
75
|
+
| 'compact-database'
|
|
76
|
+
| 'stale-worktrees'
|
|
77
|
+
| 'project-profiles'
|
|
78
|
+
| 'slim-old-chats'
|
|
79
|
+
| 'delete-old-chats';
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* - `safe` — nothing anyone uses: leftovers, duplicates, caches.
|
|
83
|
+
* - `caution` — removes something in use that comes back on its own, at a
|
|
84
|
+
* cost (a sign-in, a download, a short pause).
|
|
85
|
+
* - `destructive` — removes something that does not come back.
|
|
86
|
+
*/
|
|
87
|
+
export type CleanupTier = 'safe' | 'caution' | 'destructive';
|
|
88
|
+
|
|
89
|
+
export interface CleanupActionMeta {
|
|
90
|
+
id: CleanupActionId;
|
|
91
|
+
tier: CleanupTier;
|
|
92
|
+
/** Takes an age threshold in days. */
|
|
93
|
+
usesAge: boolean;
|
|
94
|
+
/** Can be narrowed to one project. */
|
|
95
|
+
projectScoped: boolean;
|
|
96
|
+
/** Can run on a schedule. */
|
|
97
|
+
automatable: boolean;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface CleanupEstimate {
|
|
101
|
+
action: CleanupActionId;
|
|
102
|
+
bytes: number;
|
|
103
|
+
items: number;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface CleanupRequest {
|
|
107
|
+
action: CleanupActionId;
|
|
108
|
+
projectId?: string | null;
|
|
109
|
+
olderThanDays?: number;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface CleanupResult {
|
|
113
|
+
action: CleanupActionId;
|
|
114
|
+
freedBytes: number;
|
|
115
|
+
items: number;
|
|
116
|
+
errors: string[];
|
|
117
|
+
/** Set when the action did nothing because something was in use. */
|
|
118
|
+
skippedReason?: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface StorageReport {
|
|
122
|
+
generatedAt: string;
|
|
123
|
+
durationMs: number;
|
|
124
|
+
dataDir: string;
|
|
125
|
+
totalBytes: number;
|
|
126
|
+
/** The volume the data directory lives on. Null where it cannot be read. */
|
|
127
|
+
disk: { totalBytes: number; freeBytes: number } | null;
|
|
128
|
+
categories: StorageCategory[];
|
|
129
|
+
projects: StorageProjectEntry[];
|
|
130
|
+
/** Clopen data no project owns: caches, Stack, the database's own overhead. */
|
|
131
|
+
unattributedBytes: number;
|
|
132
|
+
engines: StorageEngineEntry[];
|
|
133
|
+
/** Priced at scan time for every action that needs no parameters. */
|
|
134
|
+
estimates: CleanupEstimate[];
|
|
135
|
+
database: {
|
|
136
|
+
fileBytes: number;
|
|
137
|
+
/** Pages SQLite holds free inside the file; VACUUM returns them to the disk. */
|
|
138
|
+
freeBytes: number;
|
|
139
|
+
incrementalVacuum: boolean;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface StorageScanStatus {
|
|
144
|
+
scanning: boolean;
|
|
145
|
+
phase: string | null;
|
|
146
|
+
/** 0..1, null when the phase cannot tell. */
|
|
147
|
+
progress: number | null;
|
|
148
|
+
startedAt: string | null;
|
|
149
|
+
error: string | null;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface StoragePolicyAction {
|
|
153
|
+
enabled: boolean;
|
|
154
|
+
olderThanDays?: number;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface StoragePolicy {
|
|
158
|
+
/** Master switch for scheduled cleanup. */
|
|
159
|
+
enabled: boolean;
|
|
160
|
+
/** Hours between scheduled runs. */
|
|
161
|
+
intervalHours: number;
|
|
162
|
+
actions: Partial<Record<CleanupActionId, StoragePolicyAction>>;
|
|
163
|
+
lastRunAt: string | null;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface StorageCleanupRun {
|
|
167
|
+
id: number;
|
|
168
|
+
action: CleanupActionId;
|
|
169
|
+
trigger: 'manual' | 'auto' | 'delete';
|
|
170
|
+
startedAt: string;
|
|
171
|
+
finishedAt: string | null;
|
|
172
|
+
freedBytes: number;
|
|
173
|
+
items: number;
|
|
174
|
+
error: string | null;
|
|
175
|
+
}
|
|
@@ -96,6 +96,22 @@ export interface AppSettings {
|
|
|
96
96
|
* level chosen per model. Absent key → use the engine/model default.
|
|
97
97
|
*/
|
|
98
98
|
reasoningDefaults: Record<string, string>;
|
|
99
|
+
/** How the preview browser's screenshot button captures and saves. */
|
|
100
|
+
previewScreenshot: PreviewScreenshotSettings;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Preview browser screenshot preferences, remembered per user. */
|
|
104
|
+
export interface PreviewScreenshotSettings {
|
|
105
|
+
/** Format for downloads and saves. Copies are always PNG — clipboards take nothing else. */
|
|
106
|
+
format: 'png' | 'jpeg';
|
|
107
|
+
/** JPEG quality, 1–100. */
|
|
108
|
+
quality: number;
|
|
109
|
+
/** Capture the whole scrollable page instead of what is on screen. */
|
|
110
|
+
fullPage: boolean;
|
|
111
|
+
/** Draw the device mockup around an on-screen capture. */
|
|
112
|
+
deviceFrame: boolean;
|
|
113
|
+
/** Workspace-relative folder that "Save to project" writes into. */
|
|
114
|
+
folder: string;
|
|
99
115
|
}
|
|
100
116
|
|
|
101
117
|
/** Authentication mode */
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import type { TokenUsage, StopReason } from './common';
|
|
9
9
|
import type { ToolUseBlock, ToolResult } from './tool';
|
|
10
|
+
import type { ContextSource } from '../mentions';
|
|
10
11
|
|
|
11
12
|
// ============================================================
|
|
12
13
|
// Message Base
|
|
@@ -71,6 +72,8 @@ export interface ImageBlock {
|
|
|
71
72
|
data: string;
|
|
72
73
|
/** Original file name, so the message (and editing it) shows what was attached. */
|
|
73
74
|
title?: string | null;
|
|
75
|
+
/** Attachment number within its message, from 1 — what `@1` in the text names. */
|
|
76
|
+
index?: number;
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
export interface DocumentBlock {
|
|
@@ -78,13 +81,35 @@ export interface DocumentBlock {
|
|
|
78
81
|
mediaType: string;
|
|
79
82
|
data: string;
|
|
80
83
|
title: string | null;
|
|
84
|
+
/** Attachment number within its message, from 1 — what `@1` in the text names. */
|
|
85
|
+
index?: number;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* An attachment the model does not read inline: saved into the session's
|
|
90
|
+
* working tree and named in the prompt instead (see backend/chat/attachments).
|
|
91
|
+
* The message keeps where it went, not its bytes.
|
|
92
|
+
*/
|
|
93
|
+
export interface FileBlock {
|
|
94
|
+
type: 'file';
|
|
95
|
+
mediaType: string;
|
|
96
|
+
title: string | null;
|
|
97
|
+
/** Size in bytes. */
|
|
98
|
+
size: number;
|
|
99
|
+
/** Absolute path of the saved copy — or of the file itself, for a mentioned project file. */
|
|
100
|
+
path: string;
|
|
101
|
+
/** Attachment number within its message, from 1 — what `@1` in the text names. */
|
|
102
|
+
index?: number;
|
|
103
|
+
/** What an `@` mention attached: read from the document's header when it was saved. */
|
|
104
|
+
source?: ContextSource;
|
|
81
105
|
}
|
|
82
106
|
|
|
83
107
|
export type UserContentBlock =
|
|
84
108
|
| TextBlock
|
|
85
109
|
| ToolResult
|
|
86
110
|
| ImageBlock
|
|
87
|
-
| DocumentBlock
|
|
111
|
+
| DocumentBlock
|
|
112
|
+
| FileBlock;
|
|
88
113
|
|
|
89
114
|
export type AssistantContentBlock =
|
|
90
115
|
| TextBlock
|
|
@@ -485,6 +485,7 @@ export interface ToolResult {
|
|
|
485
485
|
* ToolUseBlock is the unified type for tool invocations in assistant messages.
|
|
486
486
|
*
|
|
487
487
|
* It includes enrichment fields (result, subActivities, etc.) directly.
|
|
488
|
+
* `durationMs` (result time minus call time) exists only on display copies.
|
|
488
489
|
* These are null/empty when the message is first created from the engine,
|
|
489
490
|
* and get populated by the message grouper when preparing for display.
|
|
490
491
|
*
|
|
@@ -505,6 +506,7 @@ type KnownToolUseBlock = {
|
|
|
505
506
|
subActivities: SubAgentActivity[];
|
|
506
507
|
skillPrompt: string | null;
|
|
507
508
|
interrupted: boolean;
|
|
509
|
+
durationMs?: number;
|
|
508
510
|
};
|
|
509
511
|
}[KnownToolName];
|
|
510
512
|
|
|
@@ -517,6 +519,7 @@ export interface McpToolUseBlock {
|
|
|
517
519
|
subActivities: SubAgentActivity[];
|
|
518
520
|
skillPrompt: string | null;
|
|
519
521
|
interrupted: boolean;
|
|
522
|
+
durationMs?: number;
|
|
520
523
|
}
|
|
521
524
|
|
|
522
525
|
export interface UnknownToolUseBlock {
|
|
@@ -528,6 +531,7 @@ export interface UnknownToolUseBlock {
|
|
|
528
531
|
subActivities: SubAgentActivity[];
|
|
529
532
|
skillPrompt: string | null;
|
|
530
533
|
interrupted: boolean;
|
|
534
|
+
durationMs?: number;
|
|
531
535
|
}
|
|
532
536
|
|
|
533
537
|
export type ToolUseBlock = KnownToolUseBlock | McpToolUseBlock | UnknownToolUseBlock;
|
package/shared/types/work.ts
CHANGED
|
@@ -57,6 +57,8 @@ export interface WorkItem {
|
|
|
57
57
|
headSha?: string;
|
|
58
58
|
baseBranch?: string;
|
|
59
59
|
isDraft?: boolean;
|
|
60
|
+
/** Pull requests only: who has been asked to review. */
|
|
61
|
+
reviewers?: string[];
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
/**
|
|
@@ -269,6 +271,10 @@ export interface WorkProviderCapabilities {
|
|
|
269
271
|
createIssue: boolean;
|
|
270
272
|
merge: boolean;
|
|
271
273
|
assign: boolean;
|
|
274
|
+
/** Setting an item's labels. */
|
|
275
|
+
labels: boolean;
|
|
276
|
+
/** Requesting reviewers on a pull request. */
|
|
277
|
+
reviewers: boolean;
|
|
272
278
|
/** Commits and per-file diffs for a pull request. */
|
|
273
279
|
diff: boolean;
|
|
274
280
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test';
|
|
2
|
+
import { mentionedIndexes, removeAllMentions, removeMention, rewriteMentions, shiftMentions, splitMentions } from './attachment-mentions';
|
|
3
|
+
|
|
4
|
+
describe('attachment mentions', () => {
|
|
5
|
+
test('finds standalone tokens only', () => {
|
|
6
|
+
expect(mentionedIndexes('compare @1 with @3, then (@2) and "@1"')).toEqual([1, 3, 2]);
|
|
7
|
+
expect(mentionedIndexes('mail me@2x.com or use @2x assets')).toEqual([]);
|
|
8
|
+
expect(mentionedIndexes('@4 at the start')).toEqual([4]);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test('removing deletes the removed file’s tokens and renumbers the rest', () => {
|
|
12
|
+
expect(removeMention('compare @1 with @2 and @3', 2, 3)).toBe('compare @1 with and @2');
|
|
13
|
+
expect(removeMention('Lorem Ipsum @2', 2, 2)).toBe('Lorem Ipsum');
|
|
14
|
+
expect(removeMention('@1 fix this', 1, 1)).toBe('fix this');
|
|
15
|
+
expect(removeMention('look (@2) here\n@2\nnext', 2, 3)).toBe('look () here\n\nnext');
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('removing leaves numbers beyond the attachments alone', () => {
|
|
19
|
+
expect(removeMention('@1 and @9', 1, 2)).toBe('and @9');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('clearing deletes every attachment token', () => {
|
|
23
|
+
expect(removeAllMentions('see @1 and @2, not @7', 2)).toBe('see and, not @7');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('shifting moves only the appended message’s own numbers', () => {
|
|
27
|
+
expect(shiftMentions('@1 vs @2 vs @7', 3, 2)).toBe('@4 vs @5 vs @7');
|
|
28
|
+
expect(shiftMentions('@1', 0, 1)).toBe('@1');
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('rewrite can leave a token as it is', () => {
|
|
32
|
+
expect(rewriteMentions('@1 @2', (n) => (n === 1 ? null : 5))).toBe('@1 @5');
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test('split keeps the text around in-range tokens', () => {
|
|
36
|
+
expect(splitMentions('look at @2 and @5.', 3)).toEqual(['look at ', 2, ' and @5.']);
|
|
37
|
+
expect(splitMentions('@1', 1)).toEqual([1]);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@3` in a message names its third attachment.
|
|
3
|
+
*
|
|
4
|
+
* Attachments are numbered per message, from 1, in the order they were
|
|
5
|
+
* attached. The composer shows the numbers on its cards, the sent message shows
|
|
6
|
+
* them on its own, and the prompt labels every file with the same token — so
|
|
7
|
+
* "compare @1 with @3" means the same two files to the user and to the model.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A token stands on its own: at the start, or after whitespace or an opening
|
|
12
|
+
* bracket or quote (so `me@2x.com` is not one), and not running on into a
|
|
13
|
+
* word (so `@2x` is not one either).
|
|
14
|
+
*/
|
|
15
|
+
const MENTION = /(^|[\s([{"'“‘])@(\d{1,4})(?![\w@])/g;
|
|
16
|
+
|
|
17
|
+
export function mentionToken(index: number): string {
|
|
18
|
+
return `@${index}`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** The attachment numbers a text mentions, in order of first appearance. */
|
|
22
|
+
export function mentionedIndexes(text: string): number[] {
|
|
23
|
+
const seen = new Set<number>();
|
|
24
|
+
for (const match of text.matchAll(MENTION)) seen.add(Number(match[2]));
|
|
25
|
+
return [...seen];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Rewrite every token. `replace` returns the new number, a replacement text,
|
|
30
|
+
* or null to leave the token as it is.
|
|
31
|
+
*/
|
|
32
|
+
export function rewriteMentions(text: string, replace: (index: number) => number | string | null): string {
|
|
33
|
+
return text.replace(MENTION, (whole, lead: string, digits: string) => {
|
|
34
|
+
const next = replace(Number(digits));
|
|
35
|
+
if (next === null) return whole;
|
|
36
|
+
return lead + (typeof next === 'number' ? mentionToken(next) : next);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Stands in for a token being deleted, until the space around it is tidied. */
|
|
41
|
+
const DROPPED = '\u0000';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Rewrite tokens, deleting the ones `next` answers `false` for together with
|
|
45
|
+
* the space they leave: "compare @1 with @2" without @2 reads "compare @1
|
|
46
|
+
* with", not "compare @1 with ".
|
|
47
|
+
*/
|
|
48
|
+
function rewriteDropping(text: string, next: (index: number) => number | false | null): string {
|
|
49
|
+
const marked = rewriteMentions(text, (index) => {
|
|
50
|
+
const answer = next(index);
|
|
51
|
+
return answer === false ? DROPPED : answer;
|
|
52
|
+
});
|
|
53
|
+
if (!marked.includes(DROPPED)) return marked;
|
|
54
|
+
return marked.replace(/[ \t]*\u0000[ \t]*/g, (match: string, offset: number, whole: string) => {
|
|
55
|
+
const before = whole[offset - 1];
|
|
56
|
+
const after = whole[offset + match.length];
|
|
57
|
+
// Between two words one space stays; at the edge of a line, none.
|
|
58
|
+
const between = before !== undefined && before !== '\n' && after !== undefined && after !== '\n';
|
|
59
|
+
return between && /^[ \t]/.test(match) && /[ \t]$/.test(match) ? ' ' : '';
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The text after attachment `removed` (1-based) is taken out of `count`: its
|
|
65
|
+
* own tokens are deleted — the file is gone, and so is the reference — and
|
|
66
|
+
* later numbers move down one.
|
|
67
|
+
*/
|
|
68
|
+
export function removeMention(text: string, removed: number, count: number): string {
|
|
69
|
+
return rewriteDropping(text, (index) => {
|
|
70
|
+
if (index === removed) return false;
|
|
71
|
+
return index > removed && index <= count ? index - 1 : null;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Every token naming one of `count` attachments, deleted — they were all removed. */
|
|
76
|
+
export function removeAllMentions(text: string, count: number): string {
|
|
77
|
+
return rewriteDropping(text, (index) => (index >= 1 && index <= count ? false : null));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Text written against its own attachments, appended after `offset` others. */
|
|
81
|
+
export function shiftMentions(text: string, offset: number, count: number): string {
|
|
82
|
+
if (offset === 0) return text;
|
|
83
|
+
return rewriteMentions(text, (index) => (index >= 1 && index <= count ? index + offset : null));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Split a text around the tokens that name one of `count` attachments. */
|
|
87
|
+
export function splitMentions(text: string, count: number): Array<string | number> {
|
|
88
|
+
const parts: Array<string | number> = [];
|
|
89
|
+
let last = 0;
|
|
90
|
+
for (const match of text.matchAll(MENTION)) {
|
|
91
|
+
const index = Number(match[2]);
|
|
92
|
+
if (index < 1 || index > count) continue;
|
|
93
|
+
const start = (match.index ?? 0) + match[1].length;
|
|
94
|
+
if (start > last) parts.push(text.slice(last, start));
|
|
95
|
+
parts.push(index);
|
|
96
|
+
last = start + match[0].length - match[1].length;
|
|
97
|
+
}
|
|
98
|
+
if (last < text.length) parts.push(text.slice(last));
|
|
99
|
+
return parts;
|
|
100
|
+
}
|