dsh-plugin-dev-kb 1.8.0 → 1.8.1
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 +186 -178
- package/README.en.md +172 -172
- package/README.md +183 -183
- package/kb/INDEX.md +236 -234
- package/kb/README.md +88 -88
- package/kb/extra/AGENTS.md +77 -77
- package/kb/extra/deepseek-llm-api-wire-extensions.md +162 -162
- package/kb/extra/deepseek-llm-api-wire-extensions.zh.md +162 -162
- package/kb/extra/defensive-patterns/package-surface.md +233 -232
- package/kb/extra/defensive-patterns/package-surface.zh.md +233 -232
- package/kb/extra/defensive-patterns/remote-and-api.md +117 -117
- package/kb/extra/defensive-patterns/remote-and-api.zh.md +117 -117
- package/kb/extra/development.md +221 -221
- package/kb/extra/development.zh.md +228 -228
- package/kb/extra/event-producer-consumer.md +133 -123
- package/kb/extra/event-producer-consumer.zh.md +135 -125
- package/kb/extra/module-graph.md +1961 -1888
- package/kb/extra/module-graph.zh.md +1963 -1890
- package/kb/extra/persistence-changes/2026-11-05-timeline-priority-notice.md +60 -0
- package/kb/extra/persistence-changes/2026-11-05-timeline-priority-notice.zh.md +60 -0
- package/kb/extra/persistence-changes/README.md +92 -92
- package/kb/extra/persistence-changes/README.zh.md +92 -92
- package/kb/extra/persistence-changes/historical-formats/README.md +75 -75
- package/kb/extra/persistence-changes/historical-formats/README.zh.md +75 -75
- package/kb/extra/persistence-changes/releases/README.md +103 -103
- package/kb/extra/persistence-changes/releases/README.zh.md +103 -103
- package/kb/extra/rescope.md +55 -55
- package/kb/extra/rescope.zh.md +55 -55
- package/kb/extra/subsystems/boot.md +631 -621
- package/kb/extra/subsystems/boot.zh.md +631 -621
- package/kb/extra/subsystems/computer-use.md +179 -137
- package/kb/extra/subsystems/computer-use.zh.md +179 -137
- package/kb/extra/subsystems/extensions.md +387 -384
- package/kb/extra/subsystems/extensions.zh.md +387 -384
- package/kb/extra/subsystems/feedback.md +418 -400
- package/kb/extra/subsystems/feedback.zh.md +418 -400
- package/kb/extra/subsystems/forge.md +2169 -1226
- package/kb/extra/subsystems/forge.zh.md +2171 -1226
- package/kb/extra/subsystems/liveshare.md +167 -158
- package/kb/extra/subsystems/liveshare.zh.md +167 -158
- package/kb/extra/subsystems/mcp.md +237 -234
- package/kb/extra/subsystems/mcp.zh.md +237 -234
- package/kb/extra/subsystems/office-kit.md +122 -0
- package/kb/extra/subsystems/office-kit.zh.md +122 -0
- package/kb/extra/subsystems/working-directory.md +95 -64
- package/kb/extra/subsystems/working-directory.zh.md +95 -64
- package/kb/extra/subsystems/worktrees.md +187 -127
- package/kb/extra/subsystems/worktrees.zh.md +187 -127
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-ptc-sandbox/guide.md +21 -21
- package/kb/extra/upgrade-guide/v0.2.1-alpha.1/python-ptc-sandbox/guide.zh.md +21 -21
- package/kb/extra/upgrade-guide/v0.2.1-rc.4/sandbox-unsupported-policy-error/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.1-rc.4/sandbox-unsupported-policy-error/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/llm-error-builtin-codes/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.2/llm-error-builtin-codes/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-kit-package/guide.md +34 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-kit-package/guide.zh.md +34 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-operation-tools/guide.md +49 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-operation-tools/guide.zh.md +49 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-skill-resources/guide.md +36 -0
- package/kb/extra/upgrade-guide/v0.2.2-alpha.3/office-skill-resources/guide.zh.md +36 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-notification-fields/guide.md +26 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-notification-fields/guide.zh.md +26 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-remote-provider/guide.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/account-remote-provider/guide.zh.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/archive-worktrees/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/attachment-error-codes/guide.md +23 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/attachment-error-codes/guide.zh.md +23 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-ax-read-limits/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-ax-read-limits/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-hover-ax-only/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-hover-ax-only/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-native-platform/guide.md +23 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/cua-native-platform/guide.zh.md +23 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/dsh-doc-skill/guide.md +35 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/dsh-doc-skill/guide.zh.md +35 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-change-request-overview/guide.md +26 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-change-request-overview/guide.zh.md +26 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-pinned-diff/guide.md +26 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-pinned-diff/guide.zh.md +26 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-review-reads/guide.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/forge-review-reads/guide.zh.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/package-export-cleanup/guide.md +26 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/package-export-cleanup/guide.zh.md +26 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/plugin-update-method/guide.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/plugin-update-method/guide.zh.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-bootstrap-protocol/guide.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-bootstrap-protocol/guide.zh.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-inspect-output/guide.md +48 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-inspect-output/guide.zh.md +48 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-scoped-repl-default/guide.md +45 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/ptc-scoped-repl-default/guide.zh.md +45 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/runtime-context-reminders/guide.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/runtime-context-reminders/guide.zh.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/session-append-overloads/guide.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/session-append-overloads/guide.zh.md +17 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/subagent-interrupt-default/guide.md +27 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/subagent-interrupt-default/guide.zh.md +27 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-backend-cleanup-error/guide.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-backend-cleanup-error/guide.zh.md +20 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-bundle-sidebar-backend/guide.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/terminal-bundle-sidebar-backend/guide.zh.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-fetch-transport-error-codes/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-fetch-transport-error-codes/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-search-billing/guide.md +41 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/web-search-billing/guide.zh.md +41 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.1/window-drag-regions/guide.zh.md +21 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/client-module-metadata/guide.md +29 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/client-module-metadata/guide.zh.md +29 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/connection-page-peer/guide.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/connection-page-peer/guide.zh.md +25 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/cordis-root-and-intercept-metadata/guide.md +31 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/cordis-root-and-intercept-metadata/guide.zh.md +31 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-agents-without-preset/guide.md +24 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-agents-without-preset/guide.zh.md +24 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-macos-provider/guide.md +24 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-macos-provider/guide.zh.md +24 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-partial-observations/guide.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/cua-partial-observations/guide.zh.md +19 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/deepseek-files-timeout/guide.md +15 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/deepseek-files-timeout/guide.zh.md +15 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/experimental-tool-error-codes/guide.md +28 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/experimental-tool-error-codes/guide.zh.md +28 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/package-export-cleanup/guide.md +36 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/package-export-cleanup/guide.zh.md +36 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/python-ptc-removal/guide.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/python-ptc-removal/guide.zh.md +22 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/session-status-package/guide.md +31 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/session-status-package/guide.zh.md +31 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/shared-search-filter/guide.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/shared-search-filter/guide.zh.md +18 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/shell-fs-tool-error-codes/guide.md +30 -0
- package/kb/extra/upgrade-guide/v0.2.2-rc.2/shell-fs-tool-error-codes/guide.zh.md +30 -0
- package/kb/extra/web-styling.md +57 -57
- package/kb/extra/web-styling.zh.md +57 -57
- package/kb/meta/search-index.json +4508 -3980
- package/kb/meta/source.json +18 -18
- package/kb/site/develop/practice/llm-adapter.md +192 -192
- package/kb/site/en/develop/practice/llm-adapter.md +192 -192
- package/kb/site/en/guide/desktop-uninstall-cleanup.md +63 -0
- package/kb/site/en/guide/plugin-market.md +153 -151
- package/kb/site/en/guide/providers.md +234 -234
- package/kb/site/en/guide/quickstart.md +35 -34
- package/kb/site/en/reference/capability-seams.md +789 -767
- package/kb/site/en/reference/config-catalog.md +5432 -5128
- package/kb/site/en/reference/cookbook/adding-a-package.md +175 -175
- package/kb/site/en/reference/cookbook/adding-a-tool.md +105 -104
- package/kb/site/en/reference/cookbook/extension-cookbook.md +178 -135
- package/kb/site/en/reference/cordis-api/context.md +373 -369
- package/kb/site/en/reference/cordis-api/fiber.md +457 -433
- package/kb/site/en/reference/cordis-api/inherited.md +44 -44
- package/kb/site/en/reference/cordis-api/service.md +118 -107
- package/kb/site/en/reference/experimental-persistence-catalog.md +36 -23
- package/kb/site/en/reference/index.md +174 -174
- package/kb/site/en/reference/persistence-catalog.md +9453 -9432
- package/kb/site/en/reference/subsystems/compaction.md +288 -288
- package/kb/site/en/reference/subsystems/core.md +1172 -1171
- package/kb/site/en/reference/subsystems/credentials.md +526 -497
- package/kb/site/en/reference/subsystems/filesystem.md +708 -708
- package/kb/site/en/reference/subsystems/index.md +82 -82
- package/kb/site/en/reference/subsystems/llm-streaming.md +1290 -1288
- package/kb/site/en/reference/subsystems/lsp.md +230 -206
- package/kb/site/en/reference/subsystems/persistence.md +451 -432
- package/kb/site/en/reference/subsystems/plan.md +91 -91
- package/kb/site/en/reference/subsystems/ptc-runtime.md +295 -261
- package/kb/site/en/reference/subsystems/sandbox.md +250 -232
- package/kb/site/en/reference/subsystems/session-query.md +525 -515
- package/kb/site/en/reference/subsystems/session-reference.md +231 -229
- package/kb/site/en/reference/subsystems/session.md +1478 -1431
- package/kb/site/en/reference/subsystems/sidebar-right.md +165 -165
- package/kb/site/en/reference/subsystems/skills.md +356 -356
- package/kb/site/en/reference/subsystems/slots.md +235 -231
- package/kb/site/en/reference/subsystems/terminal.md +188 -188
- package/kb/site/en/reference/subsystems/tools.md +902 -891
- package/kb/site/en/reference/subsystems/user-questions.md +330 -327
- package/kb/site/en/reference/subsystems/web-client.md +161 -104
- package/kb/site/en/reference/subsystems/web-server.md +434 -351
- package/kb/site/en/reference/subsystems/web.md +268 -268
- package/kb/site/en/reference/subsystems/workflow.md +287 -282
- package/kb/site/en/reference/subsystems/workspace.md +743 -651
- package/kb/site/en/reference/tool-catalog.md +2867 -2704
- package/kb/site/guide/desktop-uninstall-cleanup.md +63 -0
- package/kb/site/guide/plugin-market.md +153 -151
- package/kb/site/guide/providers.md +234 -234
- package/kb/site/guide/quickstart.md +35 -34
- package/kb/site/reference/capability-seams.md +789 -767
- package/kb/site/reference/config-catalog.md +5432 -5128
- package/kb/site/reference/cookbook/adding-a-package.md +175 -175
- package/kb/site/reference/cookbook/adding-a-tool.md +107 -106
- package/kb/site/reference/cookbook/extension-cookbook.md +182 -139
- package/kb/site/reference/cordis-api/context.md +373 -369
- package/kb/site/reference/cordis-api/fiber.md +459 -435
- package/kb/site/reference/cordis-api/inherited.md +44 -44
- package/kb/site/reference/cordis-api/service.md +118 -107
- package/kb/site/reference/experimental-persistence-catalog.md +36 -23
- package/kb/site/reference/index.md +178 -178
- package/kb/site/reference/persistence-catalog.md +9453 -9432
- package/kb/site/reference/subsystems/compaction.md +288 -288
- package/kb/site/reference/subsystems/core.md +1184 -1183
- package/kb/site/reference/subsystems/credentials.md +526 -497
- package/kb/site/reference/subsystems/filesystem.md +708 -708
- package/kb/site/reference/subsystems/index.md +82 -82
- package/kb/site/reference/subsystems/llm-streaming.md +1296 -1294
- package/kb/site/reference/subsystems/lsp.md +230 -206
- package/kb/site/reference/subsystems/persistence.md +451 -432
- package/kb/site/reference/subsystems/plan.md +91 -91
- package/kb/site/reference/subsystems/ptc-runtime.md +295 -261
- package/kb/site/reference/subsystems/sandbox.md +250 -232
- package/kb/site/reference/subsystems/session-query.md +525 -515
- package/kb/site/reference/subsystems/session-reference.md +231 -229
- package/kb/site/reference/subsystems/session.md +1482 -1435
- package/kb/site/reference/subsystems/sidebar-right.md +165 -165
- package/kb/site/reference/subsystems/skills.md +356 -356
- package/kb/site/reference/subsystems/slots.md +239 -235
- package/kb/site/reference/subsystems/terminal.md +188 -188
- package/kb/site/reference/subsystems/tools.md +902 -891
- package/kb/site/reference/subsystems/user-questions.md +330 -327
- package/kb/site/reference/subsystems/web-client.md +161 -104
- package/kb/site/reference/subsystems/web-server.md +434 -351
- package/kb/site/reference/subsystems/web.md +268 -268
- package/kb/site/reference/subsystems/workflow.md +287 -282
- package/kb/site/reference/subsystems/workspace.md +743 -651
- package/kb/site/reference/tool-catalog.md +2872 -2709
- package/lib/index.js +359 -359
- package/package.json +68 -68
- package/skills/dsh-plugin-dev-kb.md +71 -70
- package/kb/extra/subsystems/office-to-pdf.md +0 -87
- package/kb/extra/subsystems/office-to-pdf.zh.md +0 -87
|
@@ -1,127 +1,187 @@
|
|
|
1
|
-
# Git 工作树
|
|
2
|
-
|
|
3
|
-
[English](worktrees.md) | 中文
|
|
4
|
-
|
|
5
|
-
实验性的 [`dsh-experimental-worktree`](../../packages/experimental/worktree/README.zh.md) 服务提供 `ctx.worktrees`。其消费方 [`create_worktree`](../../packages/experimental/tool-worktree/README.zh.md) 创建新的 Git 分支与检出目录,再通过[工作目录服务](working-directory.zh.md)选中它。[变更请求与工作树组合包](../../packages/experimental/forge-bundle/README.zh.md#use-this-package)通过 GUI 插件管理器一起加载这两个包,随安装提供但默认关闭。其他 profile 可以选择[独立工作树组合包](../../packages/experimental/tool-worktree/README.zh.md#use-this-package),或显式挂载这两个包。
|
|
6
|
-
|
|
7
|
-
## 创建与保留
|
|
8
|
-
|
|
9
|
-
调用方 Session 的当前目录决定源仓库。创建操作在分配检出目录前,将请求的本地提交、分支或标签固定为具体提交;省略时选择 `HEAD`。每个名称必须对应新分支与未使用的检出路径。操作既不获取缺失对象,也不复制源检出目录中的暂存、未暂存、未跟踪或被忽略文件。
|
|
10
|
-
|
|
11
|
-
默认目标为 `<current checkout root>/.agents/worktrees/<name>`。`repositoryRoot` 是调用方当前检出目录的顶层目录;因此,链接检出目录会在自身内部保存工作树父目录。仅当服务的分配操作创建了配置指定的父目录时,服务才会写入内容为 `*` 加换行符的 `.gitignore`。已有文件与忽略规则保持不变。调用方 Session 的现有沙箱策略必须允许写入目标目录与共享 Git 管理目录。Git 初始化成功后才改变工作目录。
|
|
12
|
-
|
|
13
|
-
通过 `working_directory({ cd: path })`
|
|
14
|
-
|
|
15
|
-
## 请求与结果
|
|
16
|
-
|
|
17
|
-
请求只选择新名称与本地版本。结果标识创建的检出目录与确切提交;它不会改变 Session 的原始项目或写权限。可选的回调会在创建的每个阶段开始之前收到该阶段。恢复会在记录的目录重新检出已删除的检出目录:从它的分支检出;分支也已删除时,从它的基准提交检出。
|
|
18
|
-
|
|
19
|
-
```ts type-equiv
|
|
20
|
-
/** A new checkout from a locally available Git commit, branch, or tag. */
|
|
21
|
-
interface CreateWorktreeRequest {
|
|
22
|
-
/** New branch name, also used as the relative checkout directory; omission generates a name. */
|
|
23
|
-
name?: string
|
|
24
|
-
/** Local revision to resolve before creation; omission selects HEAD. */
|
|
25
|
-
from?: string
|
|
26
|
-
}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
```ts type-equiv
|
|
30
|
-
/** Committed Git baseline and the calling Session's resulting working directory. */
|
|
31
|
-
interface CreatedWorktree {
|
|
32
|
-
/** Canonical absolute checkout directory in the filesystem provider's execution world. */
|
|
33
|
-
path: string
|
|
34
|
-
/** Newly created branch name. */
|
|
35
|
-
branch: string
|
|
36
|
-
/** Resolved commit object name; repository-local replacement refs can change its checked-out content. */
|
|
37
|
-
baseCommit: string
|
|
38
|
-
/** Canonical root of the source checkout. */
|
|
39
|
-
repositoryRoot: string
|
|
40
|
-
}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
```ts type-equiv
|
|
44
|
-
/**
|
|
45
|
-
* Stage of one creation or restoration, reported before it begins: `prepare`
|
|
46
|
-
* validates the request, allocates the checkout directory, and creates the
|
|
47
|
-
* branch, which a restoration creates again only when it is gone; `checkout`
|
|
48
|
-
* writes the files and, for a creation, enters the checkout.
|
|
49
|
-
*/
|
|
50
|
-
type CreateWorktreePhase = 'prepare' | 'checkout'
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
```ts type-equiv
|
|
54
|
-
/** A removed checkout to check out again at its recorded directory. */
|
|
55
|
-
interface RestoreWorktreeRequest {
|
|
56
|
-
/** Canonical checkout directory the worktree had. */
|
|
57
|
-
path: string
|
|
58
|
-
/** Branch the worktree had checked out. */
|
|
59
|
-
branch: string
|
|
60
|
-
/** Commit the branch started from; a branch that no longer exists is created again here. */
|
|
61
|
-
baseCommit: string
|
|
62
|
-
/** Canonical root of the source checkout. */
|
|
63
|
-
repositoryRoot: string
|
|
64
|
-
}
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
```ts type-equiv
|
|
68
|
-
/** Outcome of one restoration. */
|
|
69
|
-
interface RestoredWorktree {
|
|
70
|
-
/** Checkout directory, present again. */
|
|
71
|
-
path: string
|
|
72
|
-
/** Whether the branch no longer existed and was created again at the base commit, without the commits it had gained. */
|
|
73
|
-
branchRecreated: boolean
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
1
|
+
# Git 工作树
|
|
2
|
+
|
|
3
|
+
[English](worktrees.md) | 中文
|
|
4
|
+
|
|
5
|
+
实验性的 [`dsh-experimental-worktree`](../../packages/experimental/worktree/README.zh.md) 服务提供 `ctx.worktrees`。其消费方 [`create_worktree`](../../packages/experimental/tool-worktree/README.zh.md) 创建新的 Git 分支与检出目录,再通过[工作目录服务](working-directory.zh.md)选中它。[变更请求与工作树组合包](../../packages/experimental/forge-bundle/README.zh.md#use-this-package)通过 GUI 插件管理器一起加载这两个包,随安装提供但默认关闭。其他 profile 可以选择[独立工作树组合包](../../packages/experimental/tool-worktree/README.zh.md#use-this-package),或显式挂载这两个包。
|
|
6
|
+
|
|
7
|
+
## 创建与保留
|
|
8
|
+
|
|
9
|
+
调用方 Session 的当前目录决定源仓库。创建操作在分配检出目录前,将请求的本地提交、分支或标签固定为具体提交;省略时选择 `HEAD`。每个名称必须对应新分支与未使用的检出路径。操作既不获取缺失对象,也不复制源检出目录中的暂存、未暂存、未跟踪或被忽略文件。
|
|
10
|
+
|
|
11
|
+
默认目标为 `<current checkout root>/.agents/worktrees/<name>`。`repositoryRoot` 是调用方当前检出目录的顶层目录;因此,链接检出目录会在自身内部保存工作树父目录。仅当服务的分配操作创建了配置指定的父目录时,服务才会写入内容为 `*` 加换行符的 `.gitignore`。已有文件与忽略规则保持不变。调用方 Session 的现有沙箱策略必须允许写入目标目录与共享 Git 管理目录。Git 初始化成功后才改变工作目录。
|
|
12
|
+
|
|
13
|
+
通过 `working_directory({ cd: path })` 离开时,会保留检出目录与分支。取消或失败也可能留下部分产物;错误会指出它们的位置。worktree 失败抛出带 `WORKTREE_*` code 的 `WorktreeError`;分配开始后的失败保留被包装错误的 `name` 与 `code`,调用方取消仍为 `AbortError`。服务销毁时会中止待完成操作并等待它们结束。[包 README](../../packages/experimental/worktree/README.zh.md)拥有配置与 Git 要求。
|
|
14
|
+
|
|
15
|
+
## 请求与结果
|
|
16
|
+
|
|
17
|
+
请求只选择新名称与本地版本。结果标识创建的检出目录与确切提交;它不会改变 Session 的原始项目或写权限。可选的回调会在创建的每个阶段开始之前收到该阶段。恢复会在记录的目录重新检出已删除的检出目录:从它的分支检出;分支也已删除时,从它的基准提交检出。
|
|
18
|
+
|
|
19
|
+
```ts type-equiv
|
|
20
|
+
/** A new checkout from a locally available Git commit, branch, or tag. */
|
|
21
|
+
interface CreateWorktreeRequest {
|
|
22
|
+
/** New branch name, also used as the relative checkout directory; omission generates a name. */
|
|
23
|
+
name?: string
|
|
24
|
+
/** Local revision to resolve before creation; omission selects HEAD. */
|
|
25
|
+
from?: string
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```ts type-equiv
|
|
30
|
+
/** Committed Git baseline and the calling Session's resulting working directory. */
|
|
31
|
+
interface CreatedWorktree {
|
|
32
|
+
/** Canonical absolute checkout directory in the filesystem provider's execution world. */
|
|
33
|
+
path: string
|
|
34
|
+
/** Newly created branch name. */
|
|
35
|
+
branch: string
|
|
36
|
+
/** Resolved commit object name; repository-local replacement refs can change its checked-out content. */
|
|
37
|
+
baseCommit: string
|
|
38
|
+
/** Canonical root of the source checkout. */
|
|
39
|
+
repositoryRoot: string
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```ts type-equiv
|
|
44
|
+
/**
|
|
45
|
+
* Stage of one creation or restoration, reported before it begins: `prepare`
|
|
46
|
+
* validates the request, allocates the checkout directory, and creates the
|
|
47
|
+
* branch, which a restoration creates again only when it is gone; `checkout`
|
|
48
|
+
* writes the files and, for a creation, enters the checkout.
|
|
49
|
+
*/
|
|
50
|
+
type CreateWorktreePhase = 'prepare' | 'checkout'
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```ts type-equiv
|
|
54
|
+
/** A removed checkout to check out again at its recorded directory. */
|
|
55
|
+
interface RestoreWorktreeRequest {
|
|
56
|
+
/** Canonical checkout directory the worktree had. */
|
|
57
|
+
path: string
|
|
58
|
+
/** Branch the worktree had checked out. */
|
|
59
|
+
branch: string
|
|
60
|
+
/** Commit the branch started from; a branch that no longer exists is created again here. */
|
|
61
|
+
baseCommit: string
|
|
62
|
+
/** Canonical root of the source checkout. */
|
|
63
|
+
repositoryRoot: string
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```ts type-equiv
|
|
68
|
+
/** Outcome of one restoration. */
|
|
69
|
+
interface RestoredWorktree {
|
|
70
|
+
/** Checkout directory, present again. */
|
|
71
|
+
path: string
|
|
72
|
+
/** Whether the branch no longer existed and was created again at the base commit, without the commits it had gained. */
|
|
73
|
+
branchRecreated: boolean
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```ts type-equiv
|
|
78
|
+
/** One checkout in a Session's log and whether that Session, rather than a fork ancestor, created it. */
|
|
79
|
+
interface WorktreeCreation {
|
|
80
|
+
readonly worktree: CreatedWorktree
|
|
81
|
+
/** False for a creation inside the fork-inherited prefix. */
|
|
82
|
+
readonly owned: boolean
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
```ts type-equiv
|
|
87
|
+
/** Process-local state of one archive-triggered cleanup of a checkout. */
|
|
88
|
+
interface WorktreeCleanup {
|
|
89
|
+
/** Monotonic attempt number within this Host lifetime; a Remote waits on a specific one. */
|
|
90
|
+
readonly revision: number
|
|
91
|
+
/**
|
|
92
|
+
* `scheduled` until the background inspection ends; `retained` when a use,
|
|
93
|
+
* policy, or Git state keeps the checkout; `removed` after `git worktree
|
|
94
|
+
* remove`; `failed` when removal threw and may have left a partial directory.
|
|
95
|
+
*/
|
|
96
|
+
readonly status: 'scheduled' | 'retained' | 'removed' | 'failed'
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
101
|
+
|
|
102
|
+
<a id="cordis-surface"></a>
|
|
103
|
+
|
|
104
|
+
## Cordis API
|
|
105
|
+
|
|
106
|
+
Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.zh.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
|
|
107
|
+
|
|
108
|
+
<a id="ctxworktrees--worktreeservice"></a>
|
|
109
|
+
|
|
110
|
+
### `ctx.worktrees` — `WorktreeService`
|
|
111
|
+
|
|
112
|
+
Creates retained Git worktrees under the mounted filesystem and sandbox providers, records each creation in the Session log, and reclaims a clean, unreferenced checkout when the Session that created it is archived.
|
|
113
|
+
|
|
114
|
+
```ts cordis-catalog
|
|
115
|
+
/**
|
|
116
|
+
* Create a fresh branch and checkout at a pinned local revision, then enter it.
|
|
117
|
+
* Existing branches or checkout paths fail. Uncommitted files stay in the source checkout.
|
|
118
|
+
* Checkout disables configured clean, smudge, and process filters without changing Git config.
|
|
119
|
+
* Repository-local replacement refs still apply; baseCommit reports the resolved object name.
|
|
120
|
+
* The new checkout becomes current only after Git setup succeeds. Failures may retain newly
|
|
121
|
+
* allocated Git/filesystem artifacts; no branch or checkout is removed automatically.
|
|
122
|
+
* @param agent - caller whose current directory selects the source repository and file policy.
|
|
123
|
+
* @param request - optional new name and local revision; defaults are generated name and HEAD.
|
|
124
|
+
* @param signal - cancellation of lookup, creation, and working-directory publication.
|
|
125
|
+
* @param onPhase - receives each stage before it begins; it must not throw.
|
|
126
|
+
* @returns canonical checkout path, branch name, pinned commit, and source repository root.
|
|
127
|
+
* @throws {WorktreeError} for an invalid request, an existing branch or path, or a failed, oversized, or timed-out
|
|
128
|
+
* command; a failure after allocation keeps its `name` and `code` and adds retained-artifact context.
|
|
129
|
+
*/
|
|
130
|
+
async create( agent: Agent, request: CreateWorktreeRequest = {}, signal?: AbortSignal, onPhase?: (phase: CreateWorktreePhase) => void, ): Promise<CreatedWorktree>
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Check out a removed worktree again at its recorded directory: its branch
|
|
134
|
+
* when the branch still exists, otherwise a new branch of the same name at
|
|
135
|
+
* `baseCommit`. Only the missing target's unlocked registration is removed, and an
|
|
136
|
+
* existing directory fails. Changes that were never committed are not
|
|
137
|
+
* recovered. Checkout disables configured clean, smudge, and process filters,
|
|
138
|
+
* as creation does. The calling Session's working directory does not change.
|
|
139
|
+
* Failures may retain newly allocated Git/filesystem artifacts.
|
|
140
|
+
* @param agent - caller whose sandbox policy confines the commands.
|
|
141
|
+
* @param request - recorded directory, branch, base commit, and source repository root.
|
|
142
|
+
* @param signal - cancellation of the restoration.
|
|
143
|
+
* @param onPhase - receives each stage before it begins; it must not throw.
|
|
144
|
+
* @returns the directory and whether the branch was created again.
|
|
145
|
+
* @throws {WorktreeError} for an invalid request, an existing path, a locked registration, or a failed, oversized,
|
|
146
|
+
* or timed-out command; a failure after allocation keeps its `name` and `code` and adds retained-artifact context.
|
|
147
|
+
*/
|
|
148
|
+
async restore( agent: Agent, request: RestoreWorktreeRequest, signal?: AbortSignal, onPhase?: (phase: CreateWorktreePhase) => void, ): Promise<RestoredWorktree>
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Read the archive cleanup of a Session's created checkout; waiting never
|
|
152
|
+
* starts one. Absent without the Workspace and query providers.
|
|
153
|
+
* @param session - archived Session whose cleanup is read.
|
|
154
|
+
* @param revision - null reads at once; a matching revision waits for that attempt to settle.
|
|
155
|
+
* @returns the attempt state, or null when none exists, the revision was superseded, or the service is stopping.
|
|
156
|
+
*/
|
|
157
|
+
async cleanupOf(session: Session, revision: number | null): Promise<WorktreeCleanup | null>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Types: [Agent](core.zh.md) · [Session](session.zh.md)
|
|
161
|
+
|
|
162
|
+
Source: [`packages/experimental/worktree/src/index.ts`](../../packages/experimental/worktree/src/index.ts)
|
|
163
|
+
|
|
164
|
+
<a id="worktree-events"></a>
|
|
165
|
+
|
|
166
|
+
### `worktree/*` events
|
|
167
|
+
|
|
168
|
+
<a id="worktreecleanup--emit"></a>
|
|
169
|
+
|
|
170
|
+
#### `worktree/cleanup` — emit
|
|
171
|
+
|
|
172
|
+
A cleanup attempt changed state. Fires once at admission with `scheduled` and once at settlement with the final status.
|
|
173
|
+
|
|
174
|
+
```ts cordis-catalog
|
|
175
|
+
/**
|
|
176
|
+
* A cleanup attempt changed state. Fires once at admission with
|
|
177
|
+
* `scheduled` and once at settlement with the final status.
|
|
178
|
+
* @param info - the archived Session, the checkout, and the attempt state.
|
|
179
|
+
* @mode emit
|
|
180
|
+
*/
|
|
181
|
+
'worktree/cleanup'(info: { sessionId: SessionId; path: string; cleanup: WorktreeCleanup }): void
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Types: [SessionId](core.zh.md)
|
|
185
|
+
|
|
186
|
+
Source: [`packages/experimental/worktree/src/archive.ts`](../../packages/experimental/worktree/src/archive.ts)
|
|
187
|
+
<!-- END GENERATED cordis-surface -->
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
---
|
|
2
|
-
kind: upgrade-guide
|
|
3
|
-
description: "Python PTC compositions require sandbox services, and direct Python file operations follow the resolved file policy."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Python PTC applies the shared file sandbox
|
|
7
|
-
|
|
8
|
-
English | [中文](guide.zh.md)
|
|
9
|
-
|
|
10
|
-
## Change
|
|
11
|
-
|
|
12
|
-
`@deepseek-ai/dsh-experimental-ptc-runtime-python` requires `sandbox` and `sandboxPolicy`. Previously, direct Python file operations ran without confinement and the provider rejected explicit `sandboxPolicy` inputs. It now applies the shared policy to each program and reports confinement in `PtcRunResult.sandbox`. A restricted run fails with `sandbox-unavailable` when confinement cannot be established.
|
|
13
|
-
|
|
14
|
-
This affects custom compositions that select the Python runtime. Shipped profiles continue to use the Node runtime. Python remains local to macOS or Linux; its configured resource budgets and unsupported per-call timeout overrides remain unchanged.
|
|
15
|
-
|
|
16
|
-
## Migration
|
|
17
|
-
|
|
18
|
-
1. In the `cordis.yml` or profile patch that selects the Python runtime, retain the existing shared sandbox services. If they are absent, mount `@deepseek-ai/dsh-sandbox-local` and `@deepseek-ai/dsh-sandbox-policy` with its required `@deepseek-ai/dsh-session-projection` service. See the
|
|
19
|
-
2. Set the shared `sandbox-policy` row's `mode` and `workspaceRoot` for agentless calls. Its default mode is `read-only`; `workspace-write` permits workspace writes. PTC tool calls use the Session's resolved policy and directory. Do not add a separate Python-only sandbox setting.
|
|
20
|
-
3. Direct service callers use `runtime.run(runtime.resolve(request))`; pass a trusted `sandboxPolicy` only when an explicit override is required. Model-facing `run_code` uses the existing approval flow for a one-call wider mode, without changing nested tools' permissions or replaying the program automatically.
|
|
21
|
-
4. Verify a program can write inside the intended workspace under `workspace-write`, fails to write outside it, and returns `result.sandbox.mode` and `result.sandbox.enforcement`. Under `read-only`, direct file writes fail. Inspect `sandbox-unavailable` separately from a denied file operation and repair the local sandbox installation before retrying.
|
|
1
|
+
---
|
|
2
|
+
kind: upgrade-guide
|
|
3
|
+
description: "Python PTC compositions require sandbox services, and direct Python file operations follow the resolved file policy."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Python PTC applies the shared file sandbox
|
|
7
|
+
|
|
8
|
+
English | [中文](guide.zh.md)
|
|
9
|
+
|
|
10
|
+
## Change
|
|
11
|
+
|
|
12
|
+
`@deepseek-ai/dsh-experimental-ptc-runtime-python` requires `sandbox` and `sandboxPolicy`. Previously, direct Python file operations ran without confinement and the provider rejected explicit `sandboxPolicy` inputs. It now applies the shared policy to each program and reports confinement in `PtcRunResult.sandbox`. A restricted run fails with `sandbox-unavailable` when confinement cannot be established.
|
|
13
|
+
|
|
14
|
+
This affects custom compositions that select the Python runtime. Shipped profiles continue to use the Node runtime. Python remains local to macOS or Linux; its configured resource budgets and unsupported per-call timeout overrides remain unchanged.
|
|
15
|
+
|
|
16
|
+
## Migration
|
|
17
|
+
|
|
18
|
+
1. In the `cordis.yml` or profile patch that selects the Python runtime, retain the existing shared sandbox services. If they are absent, mount `@deepseek-ai/dsh-sandbox-local` and `@deepseek-ai/dsh-sandbox-policy` with its required `@deepseek-ai/dsh-session-projection` service. See the Python runtime requirements ([English](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.1-alpha.2/packages/experimental/ptc-runtime-python/README.md#use-this-package), [中文](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.1-alpha.2/packages/experimental/ptc-runtime-python/README.zh.md#use-this-package)).
|
|
19
|
+
2. Set the shared `sandbox-policy` row's `mode` and `workspaceRoot` for agentless calls. Its default mode is `read-only`; `workspace-write` permits workspace writes. PTC tool calls use the Session's resolved policy and directory. Do not add a separate Python-only sandbox setting.
|
|
20
|
+
3. Direct service callers use `runtime.run(runtime.resolve(request))`; pass a trusted `sandboxPolicy` only when an explicit override is required. Model-facing `run_code` uses the existing approval flow for a one-call wider mode, without changing nested tools' permissions or replaying the program automatically.
|
|
21
|
+
4. Verify a program can write inside the intended workspace under `workspace-write`, fails to write outside it, and returns `result.sandbox.mode` and `result.sandbox.enforcement`. Under `read-only`, direct file writes fail. Inspect `sandbox-unavailable` separately from a denied file operation and repair the local sandbox installation before retrying.
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
---
|
|
2
|
-
kind: upgrade-guide
|
|
3
|
-
description: "Python PTC 组合需要沙箱服务,且直接 Python 文件操作遵循已解析文件策略。"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Python PTC 应用共享文件沙箱
|
|
7
|
-
|
|
8
|
-
[English](guide.md) | 中文
|
|
9
|
-
|
|
10
|
-
## 变更
|
|
11
|
-
|
|
12
|
-
`@deepseek-ai/dsh-experimental-ptc-runtime-python` 需要 `sandbox` 和 `sandboxPolicy`。此前,直接 Python 文件操作不受约束,提供方拒绝显式 `sandboxPolicy` 输入。现在,它为每个程序应用共享策略,并通过 `PtcRunResult.sandbox` 报告约束情况。无法建立约束时,受限运行以 `sandbox-unavailable` 失败。
|
|
13
|
-
|
|
14
|
-
这影响选择 Python 运行时的自定义组合。已发布 profile 继续使用 Node 运行时。Python 仍限于本地 macOS 或 Linux;其配置的资源预算保持不变,仍不支持单次 timeout 覆盖。
|
|
15
|
-
|
|
16
|
-
## 迁移
|
|
17
|
-
|
|
18
|
-
1. 在选择 Python 运行时的 `cordis.yml` 或 profile patch 中,保留已有共享沙箱服务。若尚未提供,挂载 `@deepseek-ai/dsh-sandbox-local` 和 `@deepseek-ai/dsh-sandbox-policy`,以及后者所需的 `@deepseek-ai/dsh-session-projection` 服务。参见
|
|
19
|
-
2. 为无 Agent 调用设置共享 `sandbox-policy` 行的 `mode` 和 `workspaceRoot`。默认模式是 `read-only`;`workspace-write` 允许工作区写入。PTC 工具调用使用 Session 的已解析策略和目录。不要新增 Python 专用沙箱设置。
|
|
20
|
-
3. 直接服务调用方使用 `runtime.run(runtime.resolve(request))`;仅在需要显式覆盖时传入可信 `sandboxPolicy`。面向模型的 `run_code` 通过现有审批流程为一次调用扩大权限,不改变嵌套工具的权限,也不自动重放程序。
|
|
21
|
-
4. 验证程序在 `workspace-write` 下可以写入预期工作区、写入工作区外时失败,并返回 `result.sandbox.mode` 和 `result.sandbox.enforcement`。在 `read-only` 下,直接文件写入失败。将 `sandbox-unavailable` 与文件操作被拒绝区分处理,修复本地沙箱安装后再重试。
|
|
1
|
+
---
|
|
2
|
+
kind: upgrade-guide
|
|
3
|
+
description: "Python PTC 组合需要沙箱服务,且直接 Python 文件操作遵循已解析文件策略。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Python PTC 应用共享文件沙箱
|
|
7
|
+
|
|
8
|
+
[English](guide.md) | 中文
|
|
9
|
+
|
|
10
|
+
## 变更
|
|
11
|
+
|
|
12
|
+
`@deepseek-ai/dsh-experimental-ptc-runtime-python` 需要 `sandbox` 和 `sandboxPolicy`。此前,直接 Python 文件操作不受约束,提供方拒绝显式 `sandboxPolicy` 输入。现在,它为每个程序应用共享策略,并通过 `PtcRunResult.sandbox` 报告约束情况。无法建立约束时,受限运行以 `sandbox-unavailable` 失败。
|
|
13
|
+
|
|
14
|
+
这影响选择 Python 运行时的自定义组合。已发布 profile 继续使用 Node 运行时。Python 仍限于本地 macOS 或 Linux;其配置的资源预算保持不变,仍不支持单次 timeout 覆盖。
|
|
15
|
+
|
|
16
|
+
## 迁移
|
|
17
|
+
|
|
18
|
+
1. 在选择 Python 运行时的 `cordis.yml` 或 profile patch 中,保留已有共享沙箱服务。若尚未提供,挂载 `@deepseek-ai/dsh-sandbox-local` 和 `@deepseek-ai/dsh-sandbox-policy`,以及后者所需的 `@deepseek-ai/dsh-session-projection` 服务。参见 Python 运行时要求([English](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.1-alpha.2/packages/experimental/ptc-runtime-python/README.md#use-this-package), [中文](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.1-alpha.2/packages/experimental/ptc-runtime-python/README.zh.md#use-this-package))。
|
|
19
|
+
2. 为无 Agent 调用设置共享 `sandbox-policy` 行的 `mode` 和 `workspaceRoot`。默认模式是 `read-only`;`workspace-write` 允许工作区写入。PTC 工具调用使用 Session 的已解析策略和目录。不要新增 Python 专用沙箱设置。
|
|
20
|
+
3. 直接服务调用方使用 `runtime.run(runtime.resolve(request))`;仅在需要显式覆盖时传入可信 `sandboxPolicy`。面向模型的 `run_code` 通过现有审批流程为一次调用扩大权限,不改变嵌套工具的权限,也不自动重放程序。
|
|
21
|
+
4. 验证程序在 `workspace-write` 下可以写入预期工作区、写入工作区外时失败,并返回 `result.sandbox.mode` 和 `result.sandbox.enforcement`。在 `read-only` 下,直接文件写入失败。将 `sandbox-unavailable` 与文件操作被拒绝区分处理,修复本地沙箱安装后再重试。
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
kind: upgrade-guide
|
|
3
|
+
description: "The sandbox package removes SandboxUnsupportedPolicyError; Windows processes ignore additional writable roots."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Remove SandboxUnsupportedPolicyError imports
|
|
7
|
+
|
|
8
|
+
English | [中文](guide.zh.md)
|
|
9
|
+
|
|
10
|
+
## Change
|
|
11
|
+
|
|
12
|
+
`@deepseek-ai/dsh-sandbox` no longer exports `SandboxUnsupportedPolicyError`. Windows subprocess confinement ignores additional writable directories instead of rejecting execution with `SANDBOX_UNSUPPORTED_POLICY`. The harness `write` and `edit` tools still honor those directories; Windows processes retain workspace and private-temp access under `workspace-write`.
|
|
13
|
+
|
|
14
|
+
## Migration
|
|
15
|
+
|
|
16
|
+
1. Remove imports and error handlers specific to `SandboxUnsupportedPolicyError` or `SANDBOX_UNSUPPORTED_POLICY`.
|
|
17
|
+
2. Use the harness file tools for writes to additional directories on Windows. Do not assume a successful process launch grants those directories.
|
|
18
|
+
3. Rebuild the consumer and verify that workspace commands run while extra directories remain accessible only through the file tools.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
kind: upgrade-guide
|
|
3
|
+
description: "sandbox 包移除 SandboxUnsupportedPolicyError;Windows 进程忽略额外可写根目录。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 移除 SandboxUnsupportedPolicyError 导入
|
|
7
|
+
|
|
8
|
+
[English](guide.md) | 中文
|
|
9
|
+
|
|
10
|
+
## 变更
|
|
11
|
+
|
|
12
|
+
`@deepseek-ai/dsh-sandbox` 不再导出 `SandboxUnsupportedPolicyError`。Windows 子进程隔离忽略额外可写目录,不再以 `SANDBOX_UNSUPPORTED_POLICY` 拒绝执行。Harness 的 `write` 与 `edit` 工具仍执行这些目录的授权;Windows 进程在 `workspace-write` 下保留工作区与私有临时目录访问权限。
|
|
13
|
+
|
|
14
|
+
## 迁移
|
|
15
|
+
|
|
16
|
+
1. 移除针对 `SandboxUnsupportedPolicyError` 或 `SANDBOX_UNSUPPORTED_POLICY` 的导入与错误处理。
|
|
17
|
+
2. 在 Windows 上使用 Harness 文件工具写入额外目录。不要假定进程启动成功就意味着这些目录已获授权。
|
|
18
|
+
3. 重新构建消费方,验证工作区命令可以运行,额外目录仍仅能通过文件工具访问。
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
kind: upgrade-guide
|
|
3
|
+
description: "`new LlmError` accepts only built-in failure codes; other codes go through `LlmError.fromFailure`."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# `new LlmError` accepts only built-in failure codes
|
|
7
|
+
|
|
8
|
+
English | [中文](guide.zh.md)
|
|
9
|
+
|
|
10
|
+
## Change
|
|
11
|
+
|
|
12
|
+
In `@deepseek-ai/dsh-llm`, the `code` parameter of the `LlmError` constructor was `string` and is now `BuiltinLlmFailureCode`: a key of `LLM_FAILURE_CODES` or `HTTP_<status>`. Runtime behavior and `LlmFailure.code` are unchanged. TypeScript code that constructs `LlmError` with any other code, such as an out-of-tree provider adapter or a test double, no longer compiles.
|
|
13
|
+
|
|
14
|
+
## Migration
|
|
15
|
+
|
|
16
|
+
1. Replace each `new LlmError(message, code, options)` whose `code` is not built-in with `LlmError.fromFailure({ message, code, ...facts }, { cause })`, where `facts` holds any `status`, `providerRetryAfterMs`, `requestId`, or `offloadImages`.
|
|
17
|
+
2. Re-raise a failure received from a stream with `LlmError.fromFailure(finish.failure)` instead of passing `finish.failure.code` to the constructor.
|
|
18
|
+
3. Confirm with `tsc` that no `LlmError` construction reports a code that is not assignable to `BuiltinLlmFailureCode`.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
kind: upgrade-guide
|
|
3
|
+
description: "`new LlmError` 只接受内置失败 code;其他 code 改用 `LlmError.fromFailure`。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# `new LlmError` 只接受内置失败 code
|
|
7
|
+
|
|
8
|
+
[English](guide.md) | 中文
|
|
9
|
+
|
|
10
|
+
## 变更
|
|
11
|
+
|
|
12
|
+
在 `@deepseek-ai/dsh-llm` 中,`LlmError` 构造函数的 `code` 参数原为 `string`,现为 `BuiltinLlmFailureCode`:`LLM_FAILURE_CODES` 的键或 `HTTP_<status>`。运行时行为和 `LlmFailure.code` 不变。用其他 code 构造 `LlmError` 的 TypeScript 代码(例如仓库外的提供方适配器或测试替身)将无法通过编译。
|
|
13
|
+
|
|
14
|
+
## 迁移
|
|
15
|
+
|
|
16
|
+
1. 把每个 `code` 不是内置值的 `new LlmError(message, code, options)` 改为 `LlmError.fromFailure({ message, code, ...facts }, { cause })`,其中 `facts` 包含需要的 `status`、`providerRetryAfterMs`、`requestId` 或 `offloadImages`。
|
|
17
|
+
2. 重新抛出从流中收到的失败时,使用 `LlmError.fromFailure(finish.failure)`,而不是把 `finish.failure.code` 传给构造函数。
|
|
18
|
+
3. 用 `tsc` 确认没有任何 `LlmError` 构造报告 code 不能赋值给 `BuiltinLlmFailureCode`。
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
kind: upgrade-guide
|
|
3
|
+
description: "`@deepseek-ai/dsh-office-kit` replaces `@deepseek-ai/dsh-office-to-pdf`, renaming its service, Remote methods, exported types, and configuration row."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# `@deepseek-ai/dsh-office-kit` replaces `@deepseek-ai/dsh-office-to-pdf`
|
|
7
|
+
|
|
8
|
+
English | [中文](guide.zh.md)
|
|
9
|
+
|
|
10
|
+
## Change
|
|
11
|
+
|
|
12
|
+
The Office conversion provider moved from `@deepseek-ai/dsh-office-to-pdf` to `@deepseek-ai/dsh-office-kit`. Compositions, plugins, and Clients that name the old package, service, Remote methods, or exported symbols are affected:
|
|
13
|
+
|
|
14
|
+
| Old | New |
|
|
15
|
+
|---|---|
|
|
16
|
+
| `cordis.yml` row `id: office-to-pdf`, `name: '@deepseek-ai/dsh-office-to-pdf'` | `id: office-kit`, `name: '@deepseek-ai/dsh-office-kit'`; configuration keys are unchanged |
|
|
17
|
+
| `ctx.officeToPdf` | `ctx.officeKit` |
|
|
18
|
+
| Remote `officeToPdf/render`, `officeToPdf/generation` | `officeKit/render`, `officeKit/generation` |
|
|
19
|
+
| `OfficeToPdf` | `OfficeKit` |
|
|
20
|
+
| `OfficeToPdfError`, `OfficeToPdfErrorCode` | `OfficeKitError`, `OfficeKitErrorCode` |
|
|
21
|
+
| `OfficeToPdfGeneration` | `OfficeKitGeneration` |
|
|
22
|
+
| `OfficeToPdfRequest`, `OfficeToPdfResult`, `OfficeToPdfPriority`, `OfficeToPdfKey` | `OfficeKitRequest`, `OfficeKitResult`, `OfficeKitPriority`, `OfficeKitKey` |
|
|
23
|
+
|
|
24
|
+
The `document-render/failed` Remote error, `RenderedDocumentBytes`, `OfficeSourceKey`, and `OfficeExtension` keep their names. The `/types` and `/remote` entries remain.
|
|
25
|
+
|
|
26
|
+
The provider previously failed to load when LibreOffice Kit was absent. It now registers without Kit; each conversion that needs a converter rejects with `OfficeKitError` code `unavailable` and locates Kit again, so installing Kit later takes effect without reloading the provider.
|
|
27
|
+
|
|
28
|
+
## Migration
|
|
29
|
+
|
|
30
|
+
1. In `cordis.yml`, patches, and overlays, change the row `id: office-to-pdf` to `id: office-kit` and its `name` to `'@deepseek-ai/dsh-office-kit'`. Keep its `config` block unchanged.
|
|
31
|
+
2. Replace the dependency `@deepseek-ai/dsh-office-to-pdf` with `@deepseek-ai/dsh-office-kit` in `package.json`, and update import specifiers, including `/types` and `/remote`.
|
|
32
|
+
3. Rename `ctx.officeToPdf`, Remote method names, and the exported symbols listed above.
|
|
33
|
+
4. Code that treated a load failure of the conversion row as "Kit absent" now checks for `OfficeKitError` with code `unavailable` from conversion instead.
|
|
34
|
+
5. Confirm the migration by searching the project for `office-to-pdf`, `officeToPdf`, and `OfficeToPdf`, then opening a DOCX file in the Web document preview.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
kind: upgrade-guide
|
|
3
|
+
description: "`@deepseek-ai/dsh-office-kit` 取代 `@deepseek-ai/dsh-office-to-pdf`,其服务、Remote 方法、导出类型和配置行随之改名。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# `@deepseek-ai/dsh-office-kit` 取代 `@deepseek-ai/dsh-office-to-pdf`
|
|
7
|
+
|
|
8
|
+
[English](guide.md) | 中文
|
|
9
|
+
|
|
10
|
+
## 变更
|
|
11
|
+
|
|
12
|
+
Office 转换提供方从 `@deepseek-ai/dsh-office-to-pdf` 移到 `@deepseek-ai/dsh-office-kit`。引用旧包、服务、Remote 方法或导出符号的组合、插件和 Client 受到影响:
|
|
13
|
+
|
|
14
|
+
| 旧名 | 新名 |
|
|
15
|
+
|---|---|
|
|
16
|
+
| `cordis.yml` 行 `id: office-to-pdf`、`name: '@deepseek-ai/dsh-office-to-pdf'` | `id: office-kit`、`name: '@deepseek-ai/dsh-office-kit'`;配置项不变 |
|
|
17
|
+
| `ctx.officeToPdf` | `ctx.officeKit` |
|
|
18
|
+
| Remote `officeToPdf/render`、`officeToPdf/generation` | `officeKit/render`、`officeKit/generation` |
|
|
19
|
+
| `OfficeToPdf` | `OfficeKit` |
|
|
20
|
+
| `OfficeToPdfError`、`OfficeToPdfErrorCode` | `OfficeKitError`、`OfficeKitErrorCode` |
|
|
21
|
+
| `OfficeToPdfGeneration` | `OfficeKitGeneration` |
|
|
22
|
+
| `OfficeToPdfRequest`、`OfficeToPdfResult`、`OfficeToPdfPriority`、`OfficeToPdfKey` | `OfficeKitRequest`、`OfficeKitResult`、`OfficeKitPriority`、`OfficeKitKey` |
|
|
23
|
+
|
|
24
|
+
Remote 错误 `document-render/failed`、`RenderedDocumentBytes`、`OfficeSourceKey` 和 `OfficeExtension` 保持原名。`/types` 和 `/remote` 入口仍然保留。
|
|
25
|
+
|
|
26
|
+
原先 LibreOffice Kit 缺失时提供方加载失败。现在没有 Kit 时提供方照常注册;每次需要转换器的转换都以代码为 `unavailable` 的 `OfficeKitError` 拒绝,并重新定位 Kit,因此之后安装的 Kit 无需重新加载提供方即可生效。
|
|
27
|
+
|
|
28
|
+
## 迁移
|
|
29
|
+
|
|
30
|
+
1. 在 `cordis.yml`、patch 和 overlay 中,把 `id: office-to-pdf` 行改为 `id: office-kit`,并把其 `name` 改为 `'@deepseek-ai/dsh-office-kit'`。`config` 块保持不变。
|
|
31
|
+
2. 在 `package.json` 中用 `@deepseek-ai/dsh-office-kit` 替换依赖 `@deepseek-ai/dsh-office-to-pdf`,并更新导入路径,包括 `/types` 和 `/remote`。
|
|
32
|
+
3. 按上表重命名 `ctx.officeToPdf`、Remote 方法名和导出符号。
|
|
33
|
+
4. 原先把转换行加载失败视为“Kit 缺失”的代码,改为检查转换返回的、代码为 `unavailable` 的 `OfficeKitError`。
|
|
34
|
+
5. 在项目中搜索 `office-to-pdf`、`officeToPdf` 和 `OfficeToPdf` 确认已无残留,然后在 Web 文档预览中打开一个 DOCX 文件,确认迁移完成。
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
kind: upgrade-guide
|
|
3
|
+
description: "The `office-render`, `office-recalculate`, and `office-export-pdf` skills, the skill-office `node` and `cli` keys, and two Office CLI environment variables are removed; Office operations use skill-activated tools."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Office operation skills are replaced by Office tools
|
|
7
|
+
|
|
8
|
+
English | [中文](guide.zh.md)
|
|
9
|
+
|
|
10
|
+
## Change
|
|
11
|
+
|
|
12
|
+
`@deepseek-ai/dsh-skill-office` no longer registers the `office-render`, `office-recalculate`, and `office-export-pdf` skills; it registers the `office` router and the `office-docx`, `office-pptx`, and `office-xlsx` authoring skills. After an Office skill loads, the model calls [`office_render`, `office_convert`, and `office_recalculate`](../../../../packages/document/tool-office/README.md) from the following step.
|
|
13
|
+
|
|
14
|
+
Configuration changes:
|
|
15
|
+
|
|
16
|
+
| Removed | Replacement |
|
|
17
|
+
|---|---|
|
|
18
|
+
| `skill-office` keys `node` and `cli` | None; Office tools convert in the Host |
|
|
19
|
+
| `DSH_BUNDLED_OFFICE_CLI` and `DSH_BUNDLED_OFFICE_NODE` | None; no component reads them |
|
|
20
|
+
| `DSH_BUNDLED_PRIMARY_RUNTIME` | `DSH_PRIMARY_RUNTIME` |
|
|
21
|
+
|
|
22
|
+
`skill-office` gains `pythonEnvironment`. Its default, `'workspace-dependencies'`, directs the Python skills to `load_workspace_dependencies`; a composition without `@deepseek-ai/dsh-tool-workspace-dependencies` must set `'user'`. [Office skill resources](../office-skill-resources/guide.md) covers the removal of `DSH_BUNDLED_OFFICE_SKILLS`.
|
|
23
|
+
|
|
24
|
+
The Office tools parse untrusted documents with the native LibreOffice Kit engine in the Host process, outside the shell sandbox and PTC permissions, with the Host user's permissions; the filesystem backend still authorizes inputs. The `office-kit` row gains `outputDirectory` (default `$DSH_HOME/office-kit/outputs`), `outputRetentionMs`, and `maxOutputStoreBytes`.
|
|
25
|
+
|
|
26
|
+
The Web profile, and the SDK profile without a primary runtime, list the Office skills in the first request context and `/` menu.
|
|
27
|
+
|
|
28
|
+
This affects users and prompts of the removed skills, compositions and launchers setting the removed keys or variables, `assetRoot` skill copies, saved `standard` or `ptc` presets, deployments relying on the shell sandbox for document parsing, and tests pinning the first request context or `/` menu.
|
|
29
|
+
|
|
30
|
+
## Migration
|
|
31
|
+
|
|
32
|
+
1. Replace each removed skill with loading `office` and calling the matching tool:
|
|
33
|
+
- `office-render`: `office_render`;
|
|
34
|
+
- `office-recalculate`: `office_recalculate` with `format: "xlsx"` or `"ods"`;
|
|
35
|
+
- `office-export-pdf`: `office_convert` with `format: "pdf"`.
|
|
36
|
+
2. Remove `node` and `cli` from every `skill-office` row in `cordis.yml`, patches, and overlays. Set `pythonEnvironment: user` unless the composition mounts `@deepseek-ai/dsh-tool-workspace-dependencies`.
|
|
37
|
+
3. Compositions that mount `@deepseek-ai/dsh-skill-office` without the shipped bundles also mount `@deepseek-ai/dsh-office-kit` and `@deepseek-ai/dsh-tool-office`.
|
|
38
|
+
4. In launchers, stop setting `DSH_BUNDLED_OFFICE_CLI` and `DSH_BUNDLED_OFFICE_NODE`, and rename `DSH_BUNDLED_PRIMARY_RUNTIME` to `DSH_PRIMARY_RUNTIME`. The Python SDK prefers a set or inherited `DSH_PRIMARY_RUNTIME`, even empty, over its download cache; unset it to use the cache.
|
|
39
|
+
5. In a copy referenced by `assetRoot`, replace the four remaining folders with the installed package's `assets/` and delete the three removed skill folders.
|
|
40
|
+
6. A `standard` or `ptc` preset saved from the Agent Preset editor replaces the shipped plugin list, so its Sessions lack the Office tools. Add this row to the saved list, or to `config.plugins` of the `preset-standard` or `preset-ptc` row in `$DSH_HOME/profiles/<profile>/cordis.patch.yml` (`<profile>`: `web` or `desktop`):
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
- id: tool-office
|
|
44
|
+
name: '@deepseek-ai/dsh-tool-office'
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
7. Deployments that require sandboxed document parsing omit `@deepseek-ai/dsh-tool-office`.
|
|
48
|
+
8. Update expected first request contexts and `/` menus with the Office skills.
|
|
49
|
+
9. Confirm: in a new `standard` or `ptc` Session, send `/office`, then a separate PDF export request; it produces an `office_convert` call that returns a temporary PDF path or the `unavailable` message.
|