@exagone313/dsh-podman 1.0.3 → 1.0.4
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/dist/generated/version.d.ts +2 -2
- package/dist/generated/version.js +2 -2
- package/docs/development.md +8 -4
- package/docs/development.zh.md +7 -4
- package/package.json +3 -1
- package/dist/approval-reasons.test.d.ts +0 -1
- package/dist/approval-reasons.test.js +0 -143
- package/dist/approval.test.d.ts +0 -1
- package/dist/approval.test.js +0 -593
- package/dist/card-route.test.d.ts +0 -1
- package/dist/card-route.test.js +0 -223
- package/dist/card-test-support.d.ts +0 -15
- package/dist/card-test-support.js +0 -133
- package/dist/container-env.test.d.ts +0 -1
- package/dist/container-env.test.js +0 -93
- package/dist/containers.test.d.ts +0 -1
- package/dist/containers.test.js +0 -621
- package/dist/daemons.test.d.ts +0 -1
- package/dist/daemons.test.js +0 -167
- package/dist/dsh-version.test.d.ts +0 -1
- package/dist/dsh-version.test.js +0 -25
- package/dist/env-rows.test.d.ts +0 -1
- package/dist/env-rows.test.js +0 -43
- package/dist/fs-provider.test.d.ts +0 -1
- package/dist/fs-provider.test.js +0 -301
- package/dist/guest-rpc.test.d.ts +0 -1
- package/dist/guest-rpc.test.js +0 -241
- package/dist/images.test.d.ts +0 -1
- package/dist/images.test.js +0 -86
- package/dist/locales.test.d.ts +0 -1
- package/dist/locales.test.js +0 -34
- package/dist/misc.test.d.ts +0 -1
- package/dist/misc.test.js +0 -169
- package/dist/mounts.test.d.ts +0 -1
- package/dist/mounts.test.js +0 -478
- package/dist/naming.test.d.ts +0 -1
- package/dist/naming.test.js +0 -28
- package/dist/package-deps.test.d.ts +0 -1
- package/dist/package-deps.test.js +0 -49
- package/dist/paths.test.d.ts +0 -1
- package/dist/paths.test.js +0 -76
- package/dist/plugin-meta.test.d.ts +0 -1
- package/dist/plugin-meta.test.js +0 -29
- package/dist/project-path.test.d.ts +0 -1
- package/dist/project-path.test.js +0 -66
- package/dist/read-only-shell.test.d.ts +0 -1
- package/dist/read-only-shell.test.js +0 -182
- package/dist/runtime-client.test.d.ts +0 -1
- package/dist/runtime-client.test.js +0 -53
- package/dist/secrets.test.d.ts +0 -1
- package/dist/secrets.test.js +0 -196
- package/dist/settings-commands.test.d.ts +0 -1
- package/dist/settings-commands.test.js +0 -596
- package/dist/settings-create.test.d.ts +0 -1
- package/dist/settings-create.test.js +0 -416
- package/dist/settings-default-env.test.d.ts +0 -1
- package/dist/settings-default-env.test.js +0 -175
- package/dist/settings-mounts.test.d.ts +0 -1
- package/dist/settings-mounts.test.js +0 -506
- package/dist/settings-paths.test.d.ts +0 -1
- package/dist/settings-paths.test.js +0 -65
- package/dist/settings-schema.test.d.ts +0 -1
- package/dist/settings-schema.test.js +0 -35
- package/dist/settings-workspaces.test.d.ts +0 -1
- package/dist/settings-workspaces.test.js +0 -240
- package/dist/spill-store.test.d.ts +0 -1
- package/dist/spill-store.test.js +0 -82
- package/dist/subprocess.test.d.ts +0 -1
- package/dist/subprocess.test.js +0 -344
- package/dist/terminal-preference.test.d.ts +0 -1
- package/dist/terminal-preference.test.js +0 -62
- package/dist/terminal-route.test.d.ts +0 -1
- package/dist/terminal-route.test.js +0 -265
- package/dist/terminal-tab.test.d.ts +0 -1
- package/dist/terminal-tab.test.js +0 -58
- package/dist/terminal-targets.test.d.ts +0 -1
- package/dist/terminal-targets.test.js +0 -43
- package/dist/terminal-titles.test.d.ts +0 -1
- package/dist/terminal-titles.test.js +0 -36
- package/dist/test-support.d.ts +0 -358
- package/dist/test-support.js +0 -499
- package/dist/version-compat.test.d.ts +0 -1
- package/dist/version-compat.test.js +0 -27
- package/dist/views.test.d.ts +0 -1
- package/dist/views.test.js +0 -23
- package/dist/volumes.test.d.ts +0 -1
- package/dist/volumes.test.js +0 -40
- package/dist/workspace-binding.test.d.ts +0 -1
- package/dist/workspace-binding.test.js +0 -523
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.0.
|
|
2
|
-
export declare const GIT_COMMIT = "
|
|
1
|
+
export declare const VERSION = "1.0.4";
|
|
2
|
+
export declare const GIT_COMMIT = "b454b64";
|
package/docs/development.md
CHANGED
|
@@ -41,6 +41,8 @@ make test-go # go test with the build tags
|
|
|
41
41
|
make test # test-go + pnpm test (JS tests, which run against dist/)
|
|
42
42
|
make fmt # gofmt -s + deno fmt (TypeScript and Markdown)
|
|
43
43
|
make fmt-check # verify the formatting without rewriting anything
|
|
44
|
+
make proto # regenerate the protobuf Go bindings with buf
|
|
45
|
+
make proto-check # buf lint + buf breaking + check the committed bindings are current
|
|
44
46
|
make download-licenses # generate third-party-licenses.pkg from the project and third-party Go licenses
|
|
45
47
|
make image # build the orchestrator, guest-agent and dsh container images
|
|
46
48
|
```
|
|
@@ -60,13 +62,15 @@ have run first (the `test` target handles this).
|
|
|
60
62
|
|
|
61
63
|
The `.proto` sources live in `proto/`; the generated Go bindings in
|
|
62
64
|
`internal/genproto/` are committed. After changing a `.proto`, regenerate them
|
|
63
|
-
with
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
with `make proto`, which runs `buf generate`; Buf must be installed separately —
|
|
66
|
+
pin it with `go install github.com/bufbuild/buf/cmd/buf@v1.73.0`. Commit the
|
|
67
|
+
`.proto` change together with the regenerated Go bindings.
|
|
66
68
|
|
|
67
69
|
The JS side loads the raw `.proto` files at runtime via `@grpc/proto-loader`
|
|
68
70
|
(copied to `dist/grpc/proto/` at build time); no TypeScript bindings are
|
|
69
|
-
generated.
|
|
71
|
+
generated. `make proto-check`, which CI runs, lints the schema, runs
|
|
72
|
+
`buf breaking` against the latest release tag, and fails when the committed
|
|
73
|
+
bindings differ from the regenerated ones.
|
|
70
74
|
|
|
71
75
|
## Naming
|
|
72
76
|
|
package/docs/development.zh.md
CHANGED
|
@@ -41,6 +41,8 @@ make test-go # go test with the build tags
|
|
|
41
41
|
make test # test-go + pnpm test (JS tests, which run against dist/)
|
|
42
42
|
make fmt # gofmt -s + deno fmt (TypeScript and Markdown)
|
|
43
43
|
make fmt-check # verify the formatting without rewriting anything
|
|
44
|
+
make proto # regenerate the protobuf Go bindings with buf
|
|
45
|
+
make proto-check # buf lint + buf breaking + check the committed bindings are current
|
|
44
46
|
make download-licenses # generate third-party-licenses.pkg from the project and third-party Go licenses
|
|
45
47
|
make image # build the orchestrator, guest-agent and dsh container images
|
|
46
48
|
```
|
|
@@ -59,14 +61,15 @@ orchestrator 和 guest-agent 镜像,位于
|
|
|
59
61
|
## Protobuf
|
|
60
62
|
|
|
61
63
|
`.proto` 源文件位于 `proto/`;生成的 Go 绑定位于
|
|
62
|
-
`internal/genproto/`,会被提交。修改 `.proto`
|
|
63
|
-
|
|
64
|
+
`internal/genproto/`,会被提交。修改 `.proto` 后,请用 `make proto`(即运行
|
|
65
|
+
`buf generate`)重新生成。Buf 需单独安装——请用
|
|
64
66
|
`go install github.com/bufbuild/buf/cmd/buf@v1.73.0` 固定版本。请将 `.proto`
|
|
65
67
|
改动与重新生成的 Go 绑定一起提交。
|
|
66
68
|
|
|
67
69
|
JS 端在运行时通过 `@grpc/proto-loader` 加载原始 `.proto` 文件(构建时复制到
|
|
68
|
-
`dist/grpc/proto/`);不生成 TypeScript
|
|
69
|
-
|
|
70
|
+
`dist/grpc/proto/`);不生成 TypeScript 绑定。CI 运行的 `make proto-check`
|
|
71
|
+
会校验 schema、针对最新发布标签运行
|
|
72
|
+
`buf breaking`,若已提交的绑定与重新生成的结果不一致则失败。
|
|
70
73
|
|
|
71
74
|
## 命名
|
|
72
75
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exagone313/dsh-podman",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Podman-backed execution for DeepSeek Harness (dsh).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -37,6 +37,8 @@
|
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"dist",
|
|
40
|
+
"!dist/**/*.test.*",
|
|
41
|
+
"!dist/**/*test-support.*",
|
|
40
42
|
"docs",
|
|
41
43
|
"locale/*.json",
|
|
42
44
|
"quadlet",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
// SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
|
|
2
|
-
//
|
|
3
|
-
// SPDX-License-Identifier: MIT
|
|
4
|
-
import test from "node:test";
|
|
5
|
-
import assert from "node:assert/strict";
|
|
6
|
-
import { reasonLocale, renderCacheCleanNotice, renderDefaultEnvSyncNotice, renderDenial, renderReason, resolveReasonLocale, } from "./approval-reasons.js";
|
|
7
|
-
import { preExecutePolicy, summarizeArgs } from "./index.js";
|
|
8
|
-
import { testReadSession } from "./test-support.js";
|
|
9
|
-
test("reasonLocale normalizes a locale id to a shipped language", () => {
|
|
10
|
-
assert.equal(reasonLocale("zh"), "zh");
|
|
11
|
-
assert.equal(reasonLocale("zh-Hans"), "zh");
|
|
12
|
-
assert.equal(reasonLocale("zh_CN"), "zh");
|
|
13
|
-
assert.equal(reasonLocale("ZH"), "zh");
|
|
14
|
-
assert.equal(reasonLocale("en-US"), "en");
|
|
15
|
-
assert.equal(reasonLocale("fr"), "en");
|
|
16
|
-
assert.equal(reasonLocale(undefined), "en");
|
|
17
|
-
assert.equal(reasonLocale(42), "en");
|
|
18
|
-
});
|
|
19
|
-
test("resolveReasonLocale reads the plugin's recorded locale", () => {
|
|
20
|
-
assert.equal(resolveReasonLocale(undefined), "en");
|
|
21
|
-
assert.equal(resolveReasonLocale(""), "en");
|
|
22
|
-
assert.equal(resolveReasonLocale("zh"), "zh");
|
|
23
|
-
assert.equal(resolveReasonLocale("zh-Hans"), "zh");
|
|
24
|
-
assert.equal(resolveReasonLocale("en"), "en");
|
|
25
|
-
assert.equal(resolveReasonLocale(42), "en");
|
|
26
|
-
});
|
|
27
|
-
test("summarizeArgs renders reasons in Chinese when asked", () => {
|
|
28
|
-
assert.equal(summarizeArgs("container_mount_add", {
|
|
29
|
-
container: "web",
|
|
30
|
-
kind: "volume",
|
|
31
|
-
volume: "valkey-data",
|
|
32
|
-
destination: "/data",
|
|
33
|
-
mode: "read_only",
|
|
34
|
-
}, undefined, "zh"), "在容器 “web” 中添加挂载:卷 “valkey-data” 挂载到 “/data”(只读)。");
|
|
35
|
-
assert.equal(summarizeArgs("container_start", {
|
|
36
|
-
container: "web",
|
|
37
|
-
image: "img",
|
|
38
|
-
mounts: [{ project: "team", mode: "read_only" }],
|
|
39
|
-
env: { A: "1" },
|
|
40
|
-
}, undefined, "zh"), "启动容器 “web”(镜像 “img”),挂载:项目 “team”(只读),环境变量:A。");
|
|
41
|
-
});
|
|
42
|
-
test("renderDenial renders both languages", () => {
|
|
43
|
-
assert.equal(renderDenial("en", { kind: "read_only", tool: "container_start" }), 'Denied: the session is read-only, but "container_start" needs write access.');
|
|
44
|
-
assert.equal(renderDenial("zh", { kind: "read_only", tool: "container_start" }), "已拒绝:当前会话为只读,而 “container_start” 需要写入权限。");
|
|
45
|
-
assert.equal(renderDenial("zh", {
|
|
46
|
-
kind: "project_destination",
|
|
47
|
-
source: "team/src",
|
|
48
|
-
mirror: "/projects/team/src",
|
|
49
|
-
}), "项目挂载不能指定目标路径;“team/src” 始终挂载到 “/projects/team/src”。");
|
|
50
|
-
assert.equal(renderDenial("zh", { kind: "project_destination" }), "项目挂载不能指定目标路径。");
|
|
51
|
-
assert.equal(renderDenial("en", { kind: "project_destination", mirror: "/projects" }), 'Project mounts cannot set a destination; the project always mounts at "/projects".');
|
|
52
|
-
assert.equal(renderDenial("zh", { kind: "project_destination", mirror: "/projects" }), "项目挂载不能指定目标路径;该项目 始终挂载到 “/projects”。");
|
|
53
|
-
});
|
|
54
|
-
test("renderReason covers the remaining reason kinds in both languages", () => {
|
|
55
|
-
assert.equal(renderReason("en", { kind: "image_rebuild_all" }), "Rebuild all images.");
|
|
56
|
-
assert.equal(renderReason("zh", { kind: "image_rebuild_all" }), "重建全部镜像。");
|
|
57
|
-
assert.equal(renderReason("zh", {
|
|
58
|
-
kind: "daemon_start",
|
|
59
|
-
container: "c",
|
|
60
|
-
argv: ["x"],
|
|
61
|
-
uid: 1,
|
|
62
|
-
}), "在容器 “c” 中启动守护进程:x(uid 1)");
|
|
63
|
-
assert.equal(renderReason("zh", {
|
|
64
|
-
kind: "container_bash",
|
|
65
|
-
container: "c",
|
|
66
|
-
command: "id",
|
|
67
|
-
uid: 1,
|
|
68
|
-
groups: [3, 4],
|
|
69
|
-
}), "在容器 “c” 中运行 shell 命令:id(uid 1、groups 3、4)");
|
|
70
|
-
assert.equal(renderReason("zh", {
|
|
71
|
-
kind: "container_secret_add",
|
|
72
|
-
container: "c",
|
|
73
|
-
secret: "s",
|
|
74
|
-
env: "E",
|
|
75
|
-
}), "将机密 “s” 作为 “E” 注入容器 “c”。");
|
|
76
|
-
assert.equal(renderReason("zh", {
|
|
77
|
-
kind: "container_mount_update",
|
|
78
|
-
container: "valkey-ctr",
|
|
79
|
-
mount: {
|
|
80
|
-
kind: "volume",
|
|
81
|
-
source: "valkey-data",
|
|
82
|
-
destination: "/data",
|
|
83
|
-
readOnly: false,
|
|
84
|
-
},
|
|
85
|
-
}), "更新容器 “valkey-ctr” 中的挂载:将卷 “valkey-data”(挂载到 “/data”)重新挂载为读写。");
|
|
86
|
-
assert.equal(renderReason("zh", {
|
|
87
|
-
kind: "container_mount_update",
|
|
88
|
-
container: "web",
|
|
89
|
-
mount: { kind: "project", source: "team", readOnly: true },
|
|
90
|
-
}), "更新容器 “web” 中的挂载:将项目 “team” 重新挂载为只读。");
|
|
91
|
-
});
|
|
92
|
-
test("renderCacheCleanNotice reports the removed file count", () => {
|
|
93
|
-
assert.equal(renderCacheCleanNotice("en", 1), "removed 1 cached file");
|
|
94
|
-
assert.equal(renderCacheCleanNotice("en", 3), "removed 3 cached files");
|
|
95
|
-
assert.equal(renderCacheCleanNotice("zh", 3), "已移除 3 个缓存文件");
|
|
96
|
-
});
|
|
97
|
-
test("renderReason renders the read-only remount plan", () => {
|
|
98
|
-
assert.equal(renderReason("en", {
|
|
99
|
-
kind: "read_only_remount",
|
|
100
|
-
tool: "bash",
|
|
101
|
-
remount: [
|
|
102
|
-
{ kind: "project", source: "team", readOnly: false },
|
|
103
|
-
{
|
|
104
|
-
kind: "volume",
|
|
105
|
-
source: "data",
|
|
106
|
-
destination: "/data",
|
|
107
|
-
readOnly: false,
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
keep: [{ kind: "tmpfs", source: "", destination: "/scratch" }],
|
|
111
|
-
}), 'Read-only mode blocks "bash" while a mount is read-write. Remount these mounts read-only to run it:\n\n- project "team" (read-write)\n- volume "data" at "/data" (read-write)\n\nKept as-is: tmpfs at "/scratch".');
|
|
112
|
-
assert.equal(renderReason("zh", {
|
|
113
|
-
kind: "read_only_remount",
|
|
114
|
-
tool: "bash",
|
|
115
|
-
remount: [{ kind: "project", source: "team", readOnly: false }],
|
|
116
|
-
keep: [],
|
|
117
|
-
}), "只读模式在存在读写挂载时会阻止 “bash”。将这些挂载重新挂载为只读即可运行:\n\n- 项目 “team”(读写)");
|
|
118
|
-
});
|
|
119
|
-
test("renderDenial renders the declined remount", () => {
|
|
120
|
-
assert.equal(renderDenial("en", { kind: "read_only_remount_declined", tool: "bash" }), 'Denied: read-only mode blocks "bash" and the mounts were not remounted.');
|
|
121
|
-
assert.equal(renderDenial("zh", { kind: "read_only_remount_declined", tool: "bash" }), "已拒绝:只读模式阻止 “bash”,且挂载未被重新挂载。");
|
|
122
|
-
});
|
|
123
|
-
test("renderDefaultEnvSyncNotice renders both languages", () => {
|
|
124
|
-
assert.equal(renderDefaultEnvSyncNotice("en", 2, 0), "applied the default environment to 2 containers");
|
|
125
|
-
assert.equal(renderDefaultEnvSyncNotice("en", 1, 2), "applied the default environment to 1 container; 2 containers stopped, to pick up on their next start");
|
|
126
|
-
assert.equal(renderDefaultEnvSyncNotice("en", 0, 1), "no running container needed the default environment; 1 container stopped");
|
|
127
|
-
assert.equal(renderDefaultEnvSyncNotice("en", 0, 0), "the default environment is already applied to every running container");
|
|
128
|
-
assert.equal(renderDefaultEnvSyncNotice("zh", 2, 0), "已将默认环境应用于 2 个容器");
|
|
129
|
-
assert.equal(renderDefaultEnvSyncNotice("zh", 0, 1), "没有运行中的容器需要默认环境;已跳过 1 个容器");
|
|
130
|
-
});
|
|
131
|
-
test("preExecutePolicy renders a localized deny reason", async () => {
|
|
132
|
-
const denied = (await preExecutePolicy({
|
|
133
|
-
name: "container_start",
|
|
134
|
-
agent: { session: { facts: { mode: "read-only" } } },
|
|
135
|
-
}, () => Promise.resolve({ kind: "allow" }), undefined, () => "zh", testReadSession));
|
|
136
|
-
assert.equal(denied.kind, "deny");
|
|
137
|
-
assert.equal(denied.reason, "已拒绝:当前会话为只读,而 “container_start” 需要写入权限。");
|
|
138
|
-
});
|
|
139
|
-
test("preExecutePolicy renders a localized deny reason for a built-in tool", async () => {
|
|
140
|
-
const denied = (await preExecutePolicy({ name: "bash", agent: { session: { facts: { mode: "read-only" } } } }, () => Promise.resolve({ kind: "allow" }), undefined, () => "zh", testReadSession));
|
|
141
|
-
assert.equal(denied.kind, "deny");
|
|
142
|
-
assert.equal(denied.reason, "已拒绝:当前会话为只读,而 “bash” 可能修改文件。");
|
|
143
|
-
});
|
package/dist/approval.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|