dsh-git-worktree 0.7.5 → 0.9.0
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/CHANGELOG.md +51 -0
- package/README.en.md +11 -5
- package/README.md +11 -5
- package/docs/i18n.md +63 -0
- package/lib/adapters/files.d.ts +0 -7
- package/lib/adapters/files.js +4 -3
- package/lib/adapters/files.js.map +1 -1
- package/lib/adapters/git.d.ts +0 -10
- package/lib/adapters/git.js +92 -18
- package/lib/adapters/git.js.map +1 -1
- package/lib/adapters/initial-commit.d.ts +16 -0
- package/lib/adapters/initial-commit.js +112 -0
- package/lib/adapters/initial-commit.js.map +1 -0
- package/lib/adapters/lookup.js +21 -0
- package/lib/adapters/lookup.js.map +1 -1
- package/lib/adapters/registry.d.ts +0 -7
- package/lib/adapters/registry.js +2 -1
- package/lib/adapters/registry.js.map +1 -1
- package/lib/adapters/safe-file.d.ts +0 -7
- package/lib/adapters/safe-file.js +5 -4
- package/lib/adapters/safe-file.js.map +1 -1
- package/lib/client/WorktreeCreateRow.js +5 -2
- package/lib/client/WorktreeCreateRow.js.map +1 -1
- package/lib/client/WorktreeReviewRow.d.ts +1 -1
- package/lib/client/WorktreeReviewRow.js +11 -9
- package/lib/client/WorktreeReviewRow.js.map +1 -1
- package/lib/client/actions.d.ts +4 -7
- package/lib/client/actions.js +17 -13
- package/lib/client/actions.js.map +1 -1
- package/lib/client/console-remote/adapter.d.ts +2 -1
- package/lib/client/console-remote/adapter.js +37 -32
- package/lib/client/console-remote/adapter.js.map +1 -1
- package/lib/client/console-remote/index.js +6 -2
- package/lib/client/console-remote/index.js.map +1 -1
- package/lib/client/i18n.d.ts +25 -0
- package/lib/client/i18n.js +43 -0
- package/lib/client/i18n.js.map +1 -0
- package/lib/client/index.d.ts +1 -1
- package/lib/client/index.js +17 -4
- package/lib/client/index.js.map +1 -1
- package/lib/client/model.d.ts +3 -2
- package/lib/client/model.js +8 -8
- package/lib/client/model.js.map +1 -1
- package/lib/client/pre-session/PreSessionWorktreeToggle.d.ts +2 -2
- package/lib/client/pre-session/PreSessionWorktreeToggle.js +95 -80
- package/lib/client/pre-session/PreSessionWorktreeToggle.js.map +1 -1
- package/lib/client/pre-session/controller.d.ts +3 -0
- package/lib/client/pre-session/controller.js +27 -13
- package/lib/client/pre-session/controller.js.map +1 -1
- package/lib/client/pre-session/harness-input.d.ts +13 -0
- package/lib/client/pre-session/harness-input.js +18 -0
- package/lib/client/pre-session/harness-input.js.map +1 -0
- package/lib/client/pre-session/index.d.ts +13 -2
- package/lib/client/pre-session/index.js +11 -2
- package/lib/client/pre-session/index.js.map +1 -1
- package/lib/client/review-console/DeliveryProof.js +15 -12
- package/lib/client/review-console/DeliveryProof.js.map +1 -1
- package/lib/client/review-console/PreflightStatus.js +15 -8
- package/lib/client/review-console/PreflightStatus.js.map +1 -1
- package/lib/client/review-console/ReviewActions.d.ts +4 -1
- package/lib/client/review-console/ReviewActions.js +139 -114
- package/lib/client/review-console/ReviewActions.js.map +1 -1
- package/lib/client/review-console/ReviewDetailsModal.d.ts +12 -0
- package/lib/client/review-console/ReviewDetailsModal.js +56 -0
- package/lib/client/review-console/ReviewDetailsModal.js.map +1 -0
- package/lib/client/review-console/ReviewIcon.d.ts +35 -0
- package/lib/client/review-console/ReviewIcon.js +14 -0
- package/lib/client/review-console/ReviewIcon.js.map +1 -0
- package/lib/client/review-console/WorktreeReviewPanel.d.ts +3 -7
- package/lib/client/review-console/WorktreeReviewPanel.js +20 -82
- package/lib/client/review-console/WorktreeReviewPanel.js.map +1 -1
- package/lib/client/review-console/recovery-continuation.d.ts +2 -1
- package/lib/client/review-console/recovery-continuation.js +12 -8
- package/lib/client/review-console/recovery-continuation.js.map +1 -1
- package/lib/client/review-console/review-console.styles.js +101 -23
- package/lib/client/review-console/review-console.styles.js.map +1 -1
- package/lib/client/styles.js +13 -10
- package/lib/client/styles.js.map +1 -1
- package/lib/client/target-console/TargetStatusAction.js +87 -65
- package/lib/client/target-console/TargetStatusAction.js.map +1 -1
- package/lib/client/target-console/WorktreeConsoleView.d.ts +2 -1
- package/lib/client/target-console/WorktreeConsoleView.js +42 -37
- package/lib/client/target-console/WorktreeConsoleView.js.map +1 -1
- package/lib/client/target-console/WorktreeManagerModal.js +3 -1
- package/lib/client/target-console/WorktreeManagerModal.js.map +1 -1
- package/lib/client/target-console/WorktreeReviewStatus.js +45 -88
- package/lib/client/target-console/WorktreeReviewStatus.js.map +1 -1
- package/lib/client/target-console/current-polling.d.ts +11 -0
- package/lib/client/target-console/current-polling.js +104 -0
- package/lib/client/target-console/current-polling.js.map +1 -0
- package/lib/client/target-console/target-console.styles.js +8 -0
- package/lib/client/target-console/target-console.styles.js.map +1 -1
- package/lib/client/workspace-sidebar/index.js +8 -3
- package/lib/client/workspace-sidebar/index.js.map +1 -1
- package/lib/client/workspace-sidebar/model.d.ts +5 -1
- package/lib/client/workspace-sidebar/model.js +97 -23
- package/lib/client/workspace-sidebar/model.js.map +1 -1
- package/lib/client.js +12228 -8928
- package/lib/commands.js +32 -35
- package/lib/commands.js.map +1 -1
- package/lib/console-contract.d.ts +20 -0
- package/lib/console-contract.js.map +1 -1
- package/lib/console-host/control-plane.d.ts +3 -1
- package/lib/console-host/control-plane.js +186 -95
- package/lib/console-host/control-plane.js.map +1 -1
- package/lib/console-host/errors.js +2 -1
- package/lib/console-host/errors.js.map +1 -1
- package/lib/console-host/projection.js +3 -1
- package/lib/console-host/projection.js.map +1 -1
- package/lib/console-host/review-diff.js +6 -5
- package/lib/console-host/review-diff.js.map +1 -1
- package/lib/console-host/service.d.ts +27 -23
- package/lib/console-host/service.js +66 -51
- package/lib/console-host/service.js.map +1 -1
- package/lib/console-remote/descriptors.js +4 -2
- package/lib/console-remote/descriptors.js.map +1 -1
- package/lib/console-remote/remote.d.ts +25 -22
- package/lib/console-remote/remote.js.map +1 -1
- package/lib/console-remote/schemas.d.ts +14 -2
- package/lib/console-remote/schemas.js +8 -0
- package/lib/console-remote/schemas.js.map +1 -1
- package/lib/i18n/client-messages.d.ts +1671 -0
- package/lib/i18n/client-messages.js +1468 -0
- package/lib/i18n/client-messages.js.map +1 -0
- package/lib/i18n/core.d.ts +12 -0
- package/lib/i18n/core.js +10 -0
- package/lib/i18n/core.js.map +1 -0
- package/lib/i18n/host-messages.d.ts +1495 -0
- package/lib/i18n/host-messages.js +1485 -0
- package/lib/i18n/host-messages.js.map +1 -0
- package/lib/i18n/host.d.ts +9 -0
- package/lib/i18n/host.js +34 -0
- package/lib/i18n/host.js.map +1 -0
- package/lib/i18n/transport-messages.d.ts +10 -0
- package/lib/i18n/transport-messages.js +11 -0
- package/lib/i18n/transport-messages.js.map +1 -0
- package/lib/ports.d.ts +15 -0
- package/lib/session-checkout-apply.js +93 -92
- package/lib/session-checkout-apply.js.map +1 -1
- package/lib/session-checkout-module.js +234 -229
- package/lib/session-checkout-module.js.map +1 -1
- package/lib/session-target-context.js +2 -1
- package/lib/session-target-context.js.map +1 -1
- package/lib/tools.d.ts +0 -8
- package/lib/tools.js +108 -96
- package/lib/tools.js.map +1 -1
- package/package.json +3 -1
- package/scripts/check-publish.mjs +1 -1
- package/scripts/dev-dsh-lib.mjs +1 -1
- package/scripts/workspace-sidebar-upstream.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,55 @@
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.9.0] - 2026-09-11
|
|
8
|
+
|
|
9
|
+
`0.9.0` 完善新会话创建、验收与项目导航体验:空仓库可在明确确认后安全建立首次提交;Worktree 入口恢复为与 DSH 工具栏协调的原生紧凑开关;验收区增加只读详情弹窗,并修复撤回预览、历史 Worktree 分组及慢请求轮询的状态问题。
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- 新会话目录入口支持无提交 Git 仓库:Host 先执行只读预检,再经用户明确确认创建空首次提交;不纳入用户文件或暂存内容,不改写 Git 身份,并在状态变化或失败后安全拒绝、允许重试。
|
|
14
|
+
- 验收条新增 Lucide 图标化只读详情弹窗,集中展示文件列表、验证记录和版本信息;操作仍留在验收条,历史卡保持结果导向的精简展示。
|
|
15
|
+
- Host 为历史 Managed Worktree 提供不含路径的导航归属投影,侧边栏可将过滤后的历史分组和未归组会话安全合并回原项目,同时保留歧义项与普通成员。
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- 新建 Session 的目录入口改为 Harness 原生紧凑菜单与 Worktree 开关,跟随真实状态恢复,并与 DSH 工具栏尺寸、主题反馈和图标体系保持一致。
|
|
20
|
+
- cleanup 后的“开始下一轮修改”移至 owner Session 顶部 Worktree 菜单;验收条聚焦当前摘要、文件数、验证状态与交付操作。
|
|
21
|
+
- 统一 Worktree 管理、Preview、详情和更多操作的 Lucide 图标与间距,减少重复标题、常驻外框和开发辅助文案。
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- 修复新版 Harness 中新会话 Worktree 开关点击后无响应:适配当前 `attachmentIds` 快照和源/目标 Session 输入操作,同时兼容旧版图片接口;草稿与附件可安全迁移到新 Session。
|
|
26
|
+
- 将输入快照创建纳入异常恢复,失败时释放忙碌锁、显示错误并允许重试,避免入口永久停留在准备状态。
|
|
27
|
+
- 撤回 Local Preview 后继续保留同一验收身份,避免旧异步结果覆盖;区分“撤回预览”和“继续修改”,并展示真实文件数、验证状态和 revision 防回退结果。
|
|
28
|
+
- 缓解 #6 的后台状态查询开销:状态按钮与验收栏共享按 Client adapter、会话及语言隔离的展示查询;慢请求完成后再调度,主动刷新合并并丢弃失效结果,避免重复轮询和未完成请求堆积。
|
|
29
|
+
- 展示查询在卸载时停止调度,重挂载不消费旧请求结果;创建、交付和清理的实时安全校验保持独立且不降级。
|
|
30
|
+
- 修正发布门禁的 Remote 方法清单,补入已存在且已有回归覆盖的 `preflightCreate` 与 `createWithInitialCommit`;不改变运行时协议。
|
|
31
|
+
|
|
32
|
+
### Documentation
|
|
33
|
+
|
|
34
|
+
- 增加新旧 Harness 兼容矩阵,区分开发基线、peer 声明、用户反馈、部分实测与未验证项;记录 `0.8.0` 对 `0.1.5-rc.1` 的隔离验证及端到端限制,不强制升级 Host,不扩大依赖声明。
|
|
35
|
+
- 清理过时 UI Skill 和并行开发交接稿,按当前实现更新 UI 维护指南、Console 模块职责与验证入口。
|
|
36
|
+
|
|
37
|
+
### Compatibility
|
|
38
|
+
|
|
39
|
+
- 开发与可重复构建基线仍为 DeepSeek Harness `0.1.2-rc.1`;`0.1.5-rc.1` 只有用户反馈和部分隔离验证,不扩大 peer 声明,也不要求现有用户升级 Host。
|
|
40
|
+
- 新增空仓库首次提交能力和历史导航投影,不迁移既有 Worktree registry、Review、Recovery 或 Session 数据。
|
|
41
|
+
|
|
42
|
+
## [0.8.0] - 2026-09-09
|
|
43
|
+
|
|
44
|
+
`0.8.0` 为插件增加 Client 与 Host 全链路中英文支持:界面、工具、命令和 Host 用户消息跟随 DSH 语言选择,并通过显式 Console 语言传递与异步上下文隔离保持并发会话正确;同时修复新建 Session 时 Worktree 入口因使用过期状态 seam 而崩溃的问题。
|
|
45
|
+
|
|
46
|
+
### Added
|
|
47
|
+
|
|
48
|
+
- 接入 DSH locale 与类型安全的中英文文案表,覆盖 Pre-session、Target/Review Console、ToolView、Workspace Sidebar、工具结果、命令回复和 Host 生命周期消息;插件不增加独立语言开关。
|
|
49
|
+
- Console contract 显式传递调用语言;Host 使用异步语言上下文隔离并发工具和命令,错误码、持久化判定及恢复协议继续保持语言无关。
|
|
50
|
+
- 新增语言标准化、中文回退、插值、运行时切换、并发隔离和 strict transport 回归,并将语言传递与翻译贡献规则收录到发布包的 `docs/i18n.md`。
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
|
|
54
|
+
- 新会话 Worktree 入口改用 DSH `0.1.2-rc.1` 标准 Session 与输入状态 hook,避免渲染期读取旧 store seam 导致崩溃;中英文环境下均覆盖确认、取消和会话状态变化。
|
|
55
|
+
|
|
7
56
|
## [0.7.5] - 2026-09-06
|
|
8
57
|
|
|
9
58
|
`0.7.5` 修复插件启停时官方 Workspace provider 与 Managed 聚合 provider 的生命周期协调:禁用插件后可靠恢复官方 `uiWorkspace`,启用时继续保留 Managed 会话聚合,不再因静态 bundle patch 残留导致 Web 会话阻塞。
|
|
@@ -285,6 +334,8 @@
|
|
|
285
334
|
|
|
286
335
|
- 发布初版生产级 Worktree 管理、基础 apply/finish/discard 生命周期和安全清理。
|
|
287
336
|
|
|
337
|
+
[0.9.0]: https://github.com/wloops/dsh-git-worktree/compare/v0.8.0...v0.9.0
|
|
338
|
+
[0.8.0]: https://github.com/wloops/dsh-git-worktree/compare/v0.7.5...v0.8.0
|
|
288
339
|
[0.7.5]: https://github.com/wloops/dsh-git-worktree/compare/v0.7.4...v0.7.5
|
|
289
340
|
[0.7.4]: https://github.com/wloops/dsh-git-worktree/compare/v0.7.3...v0.7.4
|
|
290
341
|
[0.7.3]: https://github.com/wloops/dsh-git-worktree/compare/v0.7.2...v0.7.3
|
package/README.en.md
CHANGED
|
@@ -31,7 +31,9 @@ When an agent edits the current project directly, its changes can mix with your
|
|
|
31
31
|
- **Save only this task**: confirmation commits only the current task instead of pulling unrelated changes into it.
|
|
32
32
|
- **Preserve progress on long tasks**: save the current stage and keep developing; the stages still become one final delivery.
|
|
33
33
|
- **Protect the working state**: branch changes, conflicts, and interrupted operations stop safely and leave the state available for recovery.
|
|
34
|
-
- **See related tasks together**:
|
|
34
|
+
- **See related tasks together**: current and historical Worktrees are grouped under their Host-provided project navigation owner; ambiguous tasks conservatively remain where they are.
|
|
35
|
+
- **Inspect review details in one place**: open a read-only view from the review bar for changed files, validation records, and version details without searching tool messages.
|
|
36
|
+
- **Start safely from an empty repository**: after explicit confirmation, an unborn repository can receive an empty initial commit that excludes user files before the isolated Worktree is created.
|
|
35
37
|
- **Continue in the same conversation**: after delivery, begin another task without opening a new conversation.
|
|
36
38
|
|
|
37
39
|
> The current version manages Git Worktrees within one project. It does not yet provide a global cross-project manager.
|
|
@@ -69,16 +71,16 @@ See the [full usage guide](docs/USAGE.en.md) for detailed actions, recovery scen
|
|
|
69
71
|
### Requirements
|
|
70
72
|
|
|
71
73
|
- Node.js `^22.19.0 || >=24.0.0`
|
|
72
|
-
- DeepSeek Harness `0.1.2-rc.1`
|
|
74
|
+
- DeepSeek Harness: `0.1.2-rc.1` is the development validation baseline; `0.1.5-rc.1` is user-reported working and partially verified in isolation. See the [compatibility matrix and limitations](docs/COMPATIBILITY.md#english); the newest Host is not mandatory.
|
|
73
75
|
- Harness Web Client
|
|
74
76
|
- A Git Workspace
|
|
75
77
|
|
|
76
78
|
Before upgrading an existing Harness installation, handle Host data migration: `0.1.2-rc.1` removes the optional SQLite Session backend, so use an older Harness version to export that data first. Code Mode is now named PTC mode, while existing conversation records remain readable. Launch applications and install this plugin through a `dsh` Profile.
|
|
77
79
|
|
|
78
|
-
After upgrading Harness from an earlier release, if the web UI shows **Failed to load plugins**,
|
|
80
|
+
After upgrading Harness from an earlier release, if the web UI shows **Failed to load plugins**, choose a fixed version from the [compatibility matrix](docs/COMPATIBILITY.md#english) and restart Harness; the example below uses the current `0.9.0`. Releases through `0.7.2` depend on the discontinued `dsh-client-runtime`; `0.7.3` can also form a `conversation` / `uiWorkspace` activation cycle in the rc.1 Web Client.
|
|
79
81
|
|
|
80
82
|
```bash
|
|
81
|
-
dsh plugin --profile web add dsh-git-worktree@0.
|
|
83
|
+
dsh plugin --profile web add dsh-git-worktree@0.9.0
|
|
82
84
|
```
|
|
83
85
|
|
|
84
86
|
### Install
|
|
@@ -90,7 +92,7 @@ dsh plugin --profile web add dsh-git-worktree
|
|
|
90
92
|
Or install a specific version:
|
|
91
93
|
|
|
92
94
|
```bash
|
|
93
|
-
dsh plugin --profile web add github:wloops/dsh-git-worktree#v0.
|
|
95
|
+
dsh plugin --profile web add github:wloops/dsh-git-worktree#v0.9.0
|
|
94
96
|
```
|
|
95
97
|
|
|
96
98
|
Open a Git Workspace and enable **Worktree** when creating a Session. An existing Local Session can also let the model call `worktree_create`.
|
|
@@ -160,3 +162,7 @@ See the [full usage guide](docs/USAGE.en.md#local-development) for more developm
|
|
|
160
162
|
## License
|
|
161
163
|
|
|
162
164
|
[MIT](LICENSE)
|
|
165
|
+
|
|
166
|
+
## Language
|
|
167
|
+
|
|
168
|
+
The plugin follows DSH’s language selection without a separate switch. Explicitly select English in DSH to use English in the UI, tools, and `/worktree` messages. If automatic browser detection has not produced a saved DSH preference, tools and commands fall back to Chinese. See [language transport and translation contributions](docs/i18n.md).
|
package/README.md
CHANGED
|
@@ -31,7 +31,9 @@
|
|
|
31
31
|
- **只保存本轮任务**:确认后只提交这个任务的修改,不把无关内容一起带入。
|
|
32
32
|
- **长任务可分阶段**:先保存当前阶段的进度,再继续开发;最终仍合并为一次交付。
|
|
33
33
|
- **出错时保护现场**:检测到分支变化、内容冲突或中断时停止操作,保留现场供你处理。
|
|
34
|
-
-
|
|
34
|
+
- **集中查看任务**:同一项目的当前及历史 Worktree 会按 Host 导航归属聚合到侧边栏,归属不明确时保守保留原位置。
|
|
35
|
+
- **验收详情集中查看**:从验收条打开只读详情,查看文件列表、验证记录与版本信息,不必翻找聊天工具记录。
|
|
36
|
+
- **空仓库安全起步**:无提交仓库可在明确确认后创建不包含用户文件的空首次提交,再建立隔离 Worktree。
|
|
35
37
|
- **原对话继续下一轮**:任务交付后,无需新开对话即可继续下一项修改。
|
|
36
38
|
|
|
37
39
|
> 当前版本管理单个项目中的 Git Worktree,暂不提供跨项目的全局管理界面。
|
|
@@ -69,16 +71,16 @@ flowchart LR
|
|
|
69
71
|
### 环境要求
|
|
70
72
|
|
|
71
73
|
- Node.js `^22.19.0 || >=24.0.0`
|
|
72
|
-
- DeepSeek Harness
|
|
74
|
+
- DeepSeek Harness:`0.1.2-rc.1` 为开发验证基线;`0.1.5-rc.1` 已有用户可用反馈并通过部分隔离验证,详见[兼容矩阵与限制](docs/COMPATIBILITY.md#中文)。并非只能使用最新版。
|
|
73
75
|
- Harness Web Client
|
|
74
76
|
- Git Workspace
|
|
75
77
|
|
|
76
78
|
从旧 Harness 升级时请先处理 Host 数据迁移:`0.1.2-rc.1` 已移除可选 SQLite Session 后端,旧数据需使用旧版 Harness 导出;Code Mode 已更名为 PTC mode,但现有会话记录仍可读取。应用和本插件统一通过 `dsh` Profile 启动与安装。
|
|
77
79
|
|
|
78
|
-
从旧版 Harness 升级后,如果 Web 界面提示 **Failed to load plugins
|
|
80
|
+
从旧版 Harness 升级后,如果 Web 界面提示 **Failed to load plugins**,请按[兼容矩阵](docs/COMPATIBILITY.md#中文)选择修复版本并重启 Harness;下方以当前 `0.9.0` 为例。`0.7.2` 及更早版本依赖已停止发布的 `dsh-client-runtime`;`0.7.3` 在 rc.1 Web Client 中还可能形成 `conversation` / `uiWorkspace` 循环等待。
|
|
79
81
|
|
|
80
82
|
```bash
|
|
81
|
-
dsh plugin --profile web add dsh-git-worktree@0.
|
|
83
|
+
dsh plugin --profile web add dsh-git-worktree@0.9.0
|
|
82
84
|
```
|
|
83
85
|
|
|
84
86
|
### 安装
|
|
@@ -90,7 +92,7 @@ dsh plugin --profile web add dsh-git-worktree
|
|
|
90
92
|
也可以安装指定版本:
|
|
91
93
|
|
|
92
94
|
```bash
|
|
93
|
-
dsh plugin --profile web add github:wloops/dsh-git-worktree#v0.
|
|
95
|
+
dsh plugin --profile web add github:wloops/dsh-git-worktree#v0.9.0
|
|
94
96
|
```
|
|
95
97
|
|
|
96
98
|
安装后打开 Git Workspace,在新建 Session 时启用 **Worktree**;已有 Local Session 也可以让模型调用 `worktree_create` 创建隔离 Session。
|
|
@@ -160,3 +162,7 @@ pnpm run dev:dsh
|
|
|
160
162
|
## 许可证
|
|
161
163
|
|
|
162
164
|
[MIT](LICENSE)
|
|
165
|
+
|
|
166
|
+
## 界面语言
|
|
167
|
+
|
|
168
|
+
插件跟随 DSH 的中英文选择,不提供独立语言开关。请在 DSH 中明确选择 English,以便界面、工具和 `/worktree` 消息都使用英文;自动浏览器语言尚未写入 DSH 偏好时,工具和命令会回退中文。详见 [语言传递与文案贡献说明](docs/i18n.md)。
|
package/docs/i18n.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# 中英文支持 / English support
|
|
2
|
+
|
|
3
|
+
This document describes the language contract for the maintained version of `dsh-git-worktree`. It is not a backport commitment for 0.4.0.
|
|
4
|
+
|
|
5
|
+
## Selecting a language
|
|
6
|
+
|
|
7
|
+
The plugin follows DSH's language selection; it does not add a separate language switch. Select **English** in DSH to use English across the plugin UI, Console operations, tools, and `/worktree` commands. Select Chinese to retain Chinese messages.
|
|
8
|
+
|
|
9
|
+
The Client reads and subscribes to the public `@deepseek-ai/dsh-client-locale` runtime. The official-derived Workspace UI keeps its upstream locale implementation; only plugin-owned additions use the plugin catalog. No generated dependency bundle is edited.
|
|
10
|
+
|
|
11
|
+
## Host language and compatibility
|
|
12
|
+
|
|
13
|
+
There are two request paths:
|
|
14
|
+
|
|
15
|
+
| Surface | Language source | Missing information |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| Client UI | DSH Client locale runtime | Chinese |
|
|
18
|
+
| Client → Worktree Console Remote | Active Client language, snapshotted into a trailing optional `locale` argument on each call | Host settings, then Chinese |
|
|
19
|
+
| Tools and `/worktree` commands | Public Host settings service: `get('locale').preference`, snapshotted for each invocation | Chinese |
|
|
20
|
+
|
|
21
|
+
The inspected DSH packages are version `0.1.2-rc.1`. The locale Host entry registers the `locale` settings namespace and its `preference` field. Tool and command invocation interfaces do not expose the browser's resolved locale. DSH's automatic browser-language resolution is a Client behavior and does not guarantee a saved Host preference.
|
|
22
|
+
|
|
23
|
+
**Limitation:** with automatic browser English and no saved DSH language preference, the UI and its Console requests can be English while tools and commands fall back to Chinese. Explicitly selecting English in DSH supplies the preference needed by all surfaces. The plugin does not guess from user text, machine locale, or the last browser request, and does not write a preference on the user's behalf.
|
|
24
|
+
|
|
25
|
+
Host language is scoped with `AsyncLocalStorage`, not a mutable process-wide language variable. Async operations retain their invocation's snapshot even if a concurrent request uses another language or the setting changes. An explicit Console request locale takes precedence over the Host setting. Old wire callers may omit locale; the new Client passes every positional slot required by the strict DSH Remote SDK. The additional field accepts only `zh`, `en`, or omission.
|
|
26
|
+
|
|
27
|
+
Tool/command registration descriptions, command hints, and generic tool presentation titles are shared, replayable metadata without an Agent context. They use static Chinese / English text rather than binding the shared registration to one user's preference. Dynamic execution results and command output use the invocation language.
|
|
28
|
+
|
|
29
|
+
Historical user-authored summaries and suggested commit messages remain stored content, not retranslated text. The existing cleanup recovery discriminants remain unchanged in storage; only a finite allowlist of known legacy system cleanup messages is localized at the public projection boundary. Unknown persisted or third-party errors pass through unchanged.
|
|
30
|
+
|
|
31
|
+
Error codes, result shapes, Git operations, review confirmation, cleanup decisions, and persisted schemas remain independent of translated text. Plugin-owned messages are translated at their source. Paths, branches, user-written titles and summaries, identifiers, and raw Git/filesystem/carrier error details are not translated.
|
|
32
|
+
|
|
33
|
+
## Catalogs and contributions
|
|
34
|
+
|
|
35
|
+
- `src/i18n/core.ts`: supported languages, normalization, typed keys and interpolation.
|
|
36
|
+
- `src/i18n/client-messages.ts`: plugin-owned Client messages.
|
|
37
|
+
- `src/i18n/host-messages.ts`: Host messages.
|
|
38
|
+
- `src/i18n/transport-messages.ts`: Client transport diagnostics.
|
|
39
|
+
- `src/client/i18n.tsx`: DSH Client locale bridge.
|
|
40
|
+
- `src/i18n/host.ts`: Host settings lookup and invocation scope.
|
|
41
|
+
|
|
42
|
+
Every entry has both `zh` and `en`. Preserve the meaning of existing Chinese copy and use matching named `{placeholder}` parameters in both languages. Insert dynamic values through parameters rather than constructing translation keys or translating user content. The typed translator checks keys and required parameters; tests verify language behavior and catalog agreement.
|
|
43
|
+
|
|
44
|
+
When adding a message, classify it first: plugin-owned UI (including accessibility text), official-derived UI, Host user message, model-facing instruction, or developer-only log. Keep the official UI's locale mechanism and source-version/hash validation intact. Comments, development logs, and machine-readable values are not UI translation targets.
|
|
45
|
+
|
|
46
|
+
## Source inventory
|
|
47
|
+
|
|
48
|
+
The initial extraction contains 380 Client entries, 364 Host entries, and 2 transport entries. Counts are informational, not stable identifiers.
|
|
49
|
+
|
|
50
|
+
| Category | Covered sources / handling |
|
|
51
|
+
| --- | --- |
|
|
52
|
+
| Plugin Client UI | Create/review tool rows, pre-session toggle, target status/actions, manager, review/preview/preflight/recovery panels, sidebar/task labels, tooltips, placeholders, accessibility labels, and operation feedback |
|
|
53
|
+
| Official-derived UI | Upstream Workspace locale remains in place; plugin augmentation is localized, source version and SHA-256 checks retained |
|
|
54
|
+
| Host user messages | Session checkout domain and Apply engine, Console control plane/projection/Diff/errors, Git/files/registry adapters, tools and `/worktree` output |
|
|
55
|
+
| Shared metadata | Bilingual tool/command registration and generic presentation titles; no request-local state stored in shared registrations |
|
|
56
|
+
| Non-translation data | User text, paths, branch/Session/Git IDs, error codes, persisted schemas, internal artifact labels and model protocol/context instruction text |
|
|
57
|
+
| Developer material | Code comments, maintenance scripts and raw process diagnostics are not end-user UI strings |
|
|
58
|
+
|
|
59
|
+
An AST scan after extraction finds six Chinese literal fragments outside the catalogs: five existing cleanup-reason discriminant fragments and one legacy transport codec-rejection marker. These are compatibility recognizers, not unlocalized UI output.
|
|
60
|
+
|
|
61
|
+
## Verification boundaries
|
|
62
|
+
|
|
63
|
+
Automated tests cover normalization, Chinese fallback, interpolation, Client language changes, Host async isolation, and strict Console transport compatibility, alongside existing Client and Host behavior. Type checking, build, upstream sidebar validation, and publish-integrity checks are separate gates. Mock and DOM-based component tests are not deployment or browser E2E evidence; actual Web/Docker validation, when performed, must be reported separately in the delivery report.
|
package/lib/adapters/files.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Node fs adapter for the session-checkout files port: directory identity
|
|
3
|
-
* (device/inode/birthtime) for quarantine CAS, empty-tree residue collection,
|
|
4
|
-
* symlink-guarded recursive removal, and byte measurement. Ported from Domi's
|
|
5
|
-
* production-adapters unchanged.
|
|
6
|
-
* @module dsh-git-worktree/adapters/files
|
|
7
|
-
*/
|
|
8
1
|
import type { SessionCheckoutFilesPort } from '../ports.js';
|
|
9
2
|
/** Build the node-fs-backed files port. */
|
|
10
3
|
export declare function createNodeFilesPort(): SessionCheckoutFilesPort;
|
package/lib/adapters/files.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hostMessage } from '../i18n/host.js';
|
|
1
2
|
/**
|
|
2
3
|
* Node fs adapter for the session-checkout files port: directory identity
|
|
3
4
|
* (device/inode/birthtime) for quarantine CAS, empty-tree residue collection,
|
|
@@ -57,7 +58,7 @@ async function quarantineDirectoryTree(path, expectedIdentity, quarantinePath) {
|
|
|
57
58
|
? sourceParent.toLowerCase() === quarantineParent.toLowerCase()
|
|
58
59
|
: sourceParent === quarantineParent;
|
|
59
60
|
if (!sameParent || existsSync(quarantinePath)) {
|
|
60
|
-
throw new SessionCheckoutError('checkout_mismatch', '
|
|
61
|
+
throw new SessionCheckoutError('checkout_mismatch', hostMessage('theWorktreeQuarantinePathIsInvalidOrAlreadyOccupied'));
|
|
61
62
|
}
|
|
62
63
|
await rename(path, quarantinePath);
|
|
63
64
|
const actualIdentity = await inspectDirectoryIdentity(quarantinePath);
|
|
@@ -69,14 +70,14 @@ async function quarantineDirectoryTree(path, expectedIdentity, quarantinePath) {
|
|
|
69
70
|
}
|
|
70
71
|
catch { /* Keep the quarantine; never delete an identity-mismatched object. */ }
|
|
71
72
|
}
|
|
72
|
-
throw new SessionCheckoutError('checkout_mismatch', '
|
|
73
|
+
throw new SessionCheckoutError('checkout_mismatch', hostMessage('theWorktreeDirectoryObjectWasReplacedRecursiveCleanupWas'));
|
|
73
74
|
}
|
|
74
75
|
async function removeDirectoryTree(path) {
|
|
75
76
|
if (!existsSync(path))
|
|
76
77
|
return;
|
|
77
78
|
const stat = await lstat(path);
|
|
78
79
|
if (!stat.isDirectory() || stat.isSymbolicLink()) {
|
|
79
|
-
throw new SessionCheckoutError('checkout_mismatch', '
|
|
80
|
+
throw new SessionCheckoutError('checkout_mismatch', hostMessage('refusingToDeleteWorktreeResidueThatIsNotA'));
|
|
80
81
|
}
|
|
81
82
|
await rm(path, {
|
|
82
83
|
recursive: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/adapters/files.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAClF,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAA;AACvE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,KAAK,UAAU,qBAAqB,CAAC,IAAY;IAC/C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,CAAC,CAAA;IAC/B,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,CAAA;IAC9B,IAAI,IAAI,CAAC,cAAc,EAAE;QAAE,OAAO,CAAC,CAAA;IACnC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;QAAE,OAAO,IAAI,CAAC,IAAI,CAAA;IACzC,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,KAAK,MAAM,KAAK,IAAI,MAAM,OAAO,CAAC,IAAI,CAAC;QAAE,KAAK,IAAI,MAAM,qBAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAA;IAChG,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,wBAAwB,CAAC,IAAY;IAC5C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IAClC,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI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,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,CAAA;IAC9B,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;QACjD,MAAM,IAAI,oBAAoB,CAAC,mBAAmB,EAAE,WAAW,CAAC,2CAA2C,CAAC,CAAC,CAAA;IAC/G,CAAC;IACD,MAAM,EAAE,CAAC,IAAI,EAAE;QACb,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,IAAI;QACX,UAAU,EAAE,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChD,UAAU,EAAE,GAAG;KAChB,CAAC,CAAA;AACJ,CAAC;AAED,2CAA2C;AAC3C,MAAM,UAAU,mBAAmB;IACjC,OAAO;QACL,MAAM,EAAE,UAAU;QAClB,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACrD,wBAAwB;QACxB,eAAe,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC/D,wBAAwB;QACxB,uBAAuB;QACvB,mBAAmB;QACnB,qBAAqB;KACtB,CAAA;AACH,CAAC"}
|
package/lib/adapters/git.d.ts
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DSH adapter for the session-checkout git port: runs git through
|
|
3
|
-
* `ctx.subprocess` (tree-scoped termination, bounded collected output,
|
|
4
|
-
* scrubbed ambient environment) with Domi's hardening preserved — disabled
|
|
5
|
-
* git hooks, no optional locks, no terminal prompts, C locale, and a 5-minute
|
|
6
|
-
* hard cap for worktree removal on Windows. Internal refs use the
|
|
7
|
-
* `refs/dsh-worktree/session-checkouts/<key>` namespace so plugin artifacts
|
|
8
|
-
* never collide with user refs.
|
|
9
|
-
* @module dsh-git-worktree/adapters/git
|
|
10
|
-
*/
|
|
11
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
12
2
|
import type { SessionCheckoutGitPort } from '../ports.js';
|
|
13
3
|
export interface GitPortOptions {
|
package/lib/adapters/git.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { initialCommitActions } from './initial-commit.js';
|
|
2
|
+
import { hostMessage } from '../i18n/host.js';
|
|
1
3
|
/**
|
|
2
4
|
* DSH adapter for the session-checkout git port: runs git through
|
|
3
5
|
* `ctx.subprocess` (tree-scoped termination, bounded collected output,
|
|
@@ -9,8 +11,8 @@
|
|
|
9
11
|
* @module dsh-git-worktree/adapters/git
|
|
10
12
|
*/
|
|
11
13
|
import { createHash } from 'node:crypto';
|
|
12
|
-
import { realpath } from 'node:fs/promises';
|
|
13
|
-
import { resolve } from 'node:path';
|
|
14
|
+
import { realpath, lstat } from 'node:fs/promises';
|
|
15
|
+
import { resolve, dirname, join } from 'node:path';
|
|
14
16
|
import { SessionCheckoutError } from '../index.js';
|
|
15
17
|
/** Ordinary git commands keep a 10s cap; worktree removal gets 5 minutes on Windows. */
|
|
16
18
|
const GIT_COMMAND_TIMEOUT_MS = 30_000;
|
|
@@ -27,7 +29,7 @@ function gitTimeoutMs(args) {
|
|
|
27
29
|
* the caller decides whether a non-zero exit is an error. Never
|
|
28
30
|
* shell-interpreted; argv passes verbatim.
|
|
29
31
|
*/
|
|
30
|
-
async function runGit(ctx, cwd, args, options) {
|
|
32
|
+
async function runGit(ctx, cwd, args, options, input) {
|
|
31
33
|
const graceMs = gitTimeoutMs(args);
|
|
32
34
|
const controller = new AbortController();
|
|
33
35
|
const timeout = setTimeout(() => controller.abort(), graceMs);
|
|
@@ -45,28 +47,64 @@ async function runGit(ctx, cwd, args, options) {
|
|
|
45
47
|
],
|
|
46
48
|
cwd,
|
|
47
49
|
stdio: {
|
|
48
|
-
stdin: 'ignore',
|
|
50
|
+
stdin: input === undefined ? 'ignore' : 'pipe',
|
|
49
51
|
stdout: { maxBytes: GIT_COLLECT_BYTES },
|
|
50
52
|
stderr: { maxBytes: GIT_COLLECT_BYTES },
|
|
51
53
|
},
|
|
52
54
|
graceMs: GIT_COMMAND_TIMEOUT_MS,
|
|
53
55
|
signal: controller.signal,
|
|
54
56
|
env: {
|
|
57
|
+
// Repository routing must come from the authorized cwd, never ambient Git
|
|
58
|
+
// overrides. Preserve identity variables and normal user configuration.
|
|
59
|
+
...Object.fromEntries(Object.keys(process.env).filter(key => /^(GIT_(DIR|WORK_TREE|COMMON_DIR|INDEX_FILE|OBJECT_DIRECTORY|ALTERNATE_OBJECT_DIRECTORIES|NAMESPACE|CEILING_DIRECTORIES|DISCOVERY_ACROSS_FILESYSTEM|CONFIG_PARAMETERS|CONFIG_COUNT|CONFIG_KEY_.*|CONFIG_VALUE_.*))$/i.test(key)).map(key => [key, undefined])),
|
|
55
60
|
GIT_OPTIONAL_LOCKS: '0',
|
|
56
61
|
GIT_TERMINAL_PROMPT: '0',
|
|
57
62
|
LC_ALL: 'C',
|
|
58
63
|
LANG: 'C',
|
|
59
64
|
},
|
|
60
65
|
});
|
|
66
|
+
if (input !== undefined) {
|
|
67
|
+
handle.stdin?.on('error', () => { });
|
|
68
|
+
if (typeof input === 'string')
|
|
69
|
+
handle.stdin?.end(input);
|
|
70
|
+
else {
|
|
71
|
+
handle.stdin?.write(input.prepare);
|
|
72
|
+
let exited = false;
|
|
73
|
+
void handle.done.then(() => { exited = true; });
|
|
74
|
+
while (!exited && !controller.signal.aborted && !handle.collected.stdout?.readFrom(0).text.includes('prepare: ok')) {
|
|
75
|
+
await new Promise(resolve => setTimeout(resolve, 5));
|
|
76
|
+
}
|
|
77
|
+
if (!exited && !controller.signal.aborted) {
|
|
78
|
+
try {
|
|
79
|
+
await input.beforeCommit();
|
|
80
|
+
handle.stdin?.end('commit\n');
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
handle.stdin?.end('abort\n');
|
|
84
|
+
await handle.done;
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
else
|
|
89
|
+
handle.stdin?.end();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
61
92
|
const outcome = await handle.done;
|
|
62
|
-
const
|
|
63
|
-
const
|
|
93
|
+
const stdoutRead = handle.collected.stdout?.readFrom(0);
|
|
94
|
+
const stderrRead = handle.collected.stderr?.readFrom(0);
|
|
95
|
+
const stdout = stdoutRead?.text ?? '';
|
|
96
|
+
const stderr = stderrRead?.text ?? '';
|
|
97
|
+
if (stdoutRead?.lossy || stderrRead?.lossy) {
|
|
98
|
+
return { code: -1, stdout: '', stderr: hostMessage('repositoryInspectionFailed') };
|
|
99
|
+
}
|
|
64
100
|
if (outcome.signal === 'SIGTERM' || outcome.signal === 'SIGKILL' || controller.signal.aborted) {
|
|
65
|
-
return { code: -1, stdout, stderr:
|
|
101
|
+
return { code: -1, stdout, stderr: hostMessage('gitTimedOutMsAndWasTerminated', { p0: args.join(' '), p1: graceMs }) };
|
|
66
102
|
}
|
|
67
103
|
return { code: outcome.exitCode ?? -1, stdout: stdout.trim(), stderr: stderr.trim() };
|
|
68
104
|
}
|
|
69
105
|
catch (error) {
|
|
106
|
+
if (error instanceof SessionCheckoutError)
|
|
107
|
+
throw error;
|
|
70
108
|
// Synchronous spawn failure (git missing from PATH): report as a failed command.
|
|
71
109
|
return { code: -1, stdout: '', stderr: error instanceof Error ? error.message : String(error) };
|
|
72
110
|
}
|
|
@@ -77,7 +115,7 @@ async function runGit(ctx, cwd, args, options) {
|
|
|
77
115
|
async function runGitChecked(ctx, cwd, args, options) {
|
|
78
116
|
const result = await runGit(ctx, cwd, args, options);
|
|
79
117
|
if (result.code !== 0) {
|
|
80
|
-
throw new SessionCheckoutError('git_operation_failed',
|
|
118
|
+
throw new SessionCheckoutError('git_operation_failed', hostMessage('gitOperationFailedGit', { p0: args.join(' '), p1: result.stderr ? `: ${result.stderr}` : '' }));
|
|
81
119
|
}
|
|
82
120
|
return result.stdout;
|
|
83
121
|
}
|
|
@@ -89,7 +127,7 @@ function assertArtifactName(artifactName) {
|
|
|
89
127
|
const segments = artifactName.split('/');
|
|
90
128
|
if (segments.length === 0
|
|
91
129
|
|| segments.some((segment) => !/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(segment))) {
|
|
92
|
-
throw new SessionCheckoutError('invalid_input', '
|
|
130
|
+
throw new SessionCheckoutError('invalid_input', hostMessage('invalidInternalGitArtifactName'));
|
|
93
131
|
}
|
|
94
132
|
}
|
|
95
133
|
function internalArtifactRef(checkoutId, artifactName) {
|
|
@@ -99,18 +137,50 @@ function internalArtifactRef(checkoutId, artifactName) {
|
|
|
99
137
|
function applyBaseRef(checkoutId) {
|
|
100
138
|
return internalArtifactRef(checkoutId, 'apply-base');
|
|
101
139
|
}
|
|
140
|
+
async function hasGitMetadata(root) {
|
|
141
|
+
let directory = resolve(root);
|
|
142
|
+
for (;;) {
|
|
143
|
+
try {
|
|
144
|
+
await lstat(join(directory, '.git'));
|
|
145
|
+
return true;
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
if (error.code !== 'ENOENT')
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
const parent = dirname(directory);
|
|
152
|
+
if (parent === directory)
|
|
153
|
+
return false;
|
|
154
|
+
directory = parent;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
102
157
|
/** Build the `ctx.subprocess`-backed git port. */
|
|
103
158
|
export function createDshGitPort(ctx, options) {
|
|
104
|
-
const runSessionGit = (cwd, args) => runGit(ctx, cwd, args, options);
|
|
159
|
+
const runSessionGit = (cwd, args, input) => runGit(ctx, cwd, args, options, input);
|
|
105
160
|
const runSessionGitChecked = (cwd, args) => runGitChecked(ctx, cwd, args, options);
|
|
106
|
-
|
|
161
|
+
const port = {
|
|
107
162
|
inspect: async (root) => {
|
|
108
163
|
const topLevel = await runSessionGit(root, ['rev-parse', '--show-toplevel']);
|
|
109
|
-
if (topLevel.code !== 0 || !topLevel.stdout)
|
|
110
|
-
|
|
164
|
+
if (topLevel.code !== 0 || !topLevel.stdout) {
|
|
165
|
+
if (topLevel.code === 128 && /^fatal: not a git repository/.test(topLevel.stderr) && !await hasGitMetadata(root))
|
|
166
|
+
return null;
|
|
167
|
+
throw new SessionCheckoutError('git_operation_failed', hostMessage('repositoryInspectionFailed'));
|
|
168
|
+
}
|
|
111
169
|
const commonDir = await runSessionGitChecked(root, ['rev-parse', '--path-format=absolute', '--git-common-dir']);
|
|
112
170
|
const gitDir = await runSessionGitChecked(root, ['rev-parse', '--path-format=absolute', '--absolute-git-dir']);
|
|
113
|
-
const
|
|
171
|
+
const head = await runSessionGit(root, ['rev-parse', '--verify', '--quiet', 'HEAD^{commit}']);
|
|
172
|
+
let headOid = head.stdout;
|
|
173
|
+
if (head.code !== 0) {
|
|
174
|
+
const symbolicHead = await runSessionGit(root, ['symbolic-ref', '--quiet', 'HEAD']);
|
|
175
|
+
const refs = await runSessionGit(root, ['show-ref']);
|
|
176
|
+
// A missing commit is unborn only with a valid symbolic HEAD and no refs.
|
|
177
|
+
// Broken refs, unreadable metadata, and missing objects remain Git errors.
|
|
178
|
+
if (head.code !== 1 || symbolicHead.code !== 0 || !symbolicHead.stdout.startsWith('refs/heads/')
|
|
179
|
+
|| refs.code !== 1 || refs.stdout || refs.stderr) {
|
|
180
|
+
throw new SessionCheckoutError('git_operation_failed', hostMessage('repositoryInspectionFailed'));
|
|
181
|
+
}
|
|
182
|
+
headOid = 'unborn';
|
|
183
|
+
}
|
|
114
184
|
const symbolic = await runSessionGit(root, ['symbolic-ref', '--quiet', 'HEAD']);
|
|
115
185
|
const headRef = symbolic.code === 0 && symbolic.stdout ? symbolic.stdout : 'HEAD';
|
|
116
186
|
const branch = headRef.startsWith('refs/heads/') ? headRef.slice('refs/heads/'.length) : null;
|
|
@@ -125,8 +195,11 @@ export function createDshGitPort(ctx, options) {
|
|
|
125
195
|
},
|
|
126
196
|
findContainingWorktreeRoot: async (root) => {
|
|
127
197
|
const topLevel = await runSessionGit(root, ['rev-parse', '--show-toplevel']);
|
|
128
|
-
if (topLevel.code !== 0 || !topLevel.stdout)
|
|
129
|
-
|
|
198
|
+
if (topLevel.code !== 0 || !topLevel.stdout) {
|
|
199
|
+
if (topLevel.code === 128 && /^fatal: not a git repository/.test(topLevel.stderr) && !await hasGitMetadata(root))
|
|
200
|
+
return null;
|
|
201
|
+
throw new SessionCheckoutError('git_operation_failed', hostMessage('repositoryInspectionFailed'));
|
|
202
|
+
}
|
|
130
203
|
return realpath(resolve(topLevel.stdout));
|
|
131
204
|
},
|
|
132
205
|
status: async (root) => {
|
|
@@ -156,7 +229,7 @@ export function createDshGitPort(ctx, options) {
|
|
|
156
229
|
return result.stdout;
|
|
157
230
|
if (result.code === 1)
|
|
158
231
|
return null;
|
|
159
|
-
throw new SessionCheckoutError('git_operation_failed', result.stderr || '
|
|
232
|
+
throw new SessionCheckoutError('git_operation_failed', result.stderr || hostMessage('cannotReadTheInternalGitArtifact'));
|
|
160
233
|
},
|
|
161
234
|
releaseInternalArtifacts: async (localRoot, checkoutId, artifactPrefix) => {
|
|
162
235
|
const prefix = artifactPrefix
|
|
@@ -173,8 +246,9 @@ export function createDshGitPort(ctx, options) {
|
|
|
173
246
|
return true;
|
|
174
247
|
if (result.code === 1)
|
|
175
248
|
return false;
|
|
176
|
-
throw new Error(result.stderr || '
|
|
249
|
+
throw new Error(result.stderr || hostMessage('cannotProveGitCommitAncestry'));
|
|
177
250
|
},
|
|
178
251
|
};
|
|
252
|
+
return Object.assign(port, initialCommitActions(port.inspect, runSessionGit));
|
|
179
253
|
}
|
|
180
254
|
//# sourceMappingURL=git.js.map
|
package/lib/adapters/git.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/adapters/git.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OA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AAK,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;YAC3E,KAAK,MAAM,GAAG,IAAI,IAAI;gBAAE,MAAM,oBAAoB,CAAC,SAAS,EAAE,CAAC,YAAY,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAA;QAC1F,CAAC;QACD,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE;YACrD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,IAAI,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC,CAAA;YACrG,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC;gBAAE,OAAO,IAAI,CAAA;YAClC,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC;gBAAE,OAAO,KAAK,CAAA;YACnC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,WAAW,CAAC,8BAA8B,CAAC,CAAC,CAAA;QAC/E,CAAC;KACF,CAAA;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAA;AAC/E,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { GitCheckoutSnapshot, InitialCommitPreflight } from '../ports.js';
|
|
2
|
+
export interface GitCommitProtocol {
|
|
3
|
+
prepare: string;
|
|
4
|
+
beforeCommit(): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
type Run = (root: string, args: string[], input?: string | GitCommitProtocol) => Promise<{
|
|
7
|
+
code: number;
|
|
8
|
+
stdout: string;
|
|
9
|
+
stderr: string;
|
|
10
|
+
}>;
|
|
11
|
+
/** Only the Console's confirmed host action calls initialize; normal Git inspection is read-only. */
|
|
12
|
+
export declare function initialCommitActions(inspect: (root: string) => Promise<GitCheckoutSnapshot | null>, run: Run): {
|
|
13
|
+
preflightInitialCommit: (root: string) => Promise<InitialCommitPreflight>;
|
|
14
|
+
initializeEmptyRepository: (root: string, fingerprint: string, assertAuthorized?: () => Promise<void>) => Promise<string>;
|
|
15
|
+
};
|
|
16
|
+
export {};
|