@deepseek-ai/dsh-tool-bash-persistent 0.0.1-rc.2 → 0.0.1-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +3 -3
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/lib/index.js +9 -9
- package/package.json +19 -19
package/README.i18n.yaml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
|
-
# pnpm run verify-translation-pairing --write packages/
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
4
|
+
# pnpm run verify-translation-pairing --write packages/shell/tool-bash-persistent/README.md
|
|
5
|
+
README.md: 37c259443cba566350d8ec7963857d5f6ce7396c
|
|
6
|
+
README.zh.md: 8f3cf4e4d20aad1537b48644cee1a9d5706f4b3c
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
English | [中文](README.zh.md)
|
|
4
4
|
|
|
5
|
-
Model-facing `bash(command)` backed by one owner-scoped `ctx.
|
|
5
|
+
Model-facing `bash(command)` backed by one owner-scoped `ctx.terminals` shell. The package owns the tool contract and shell reuse; deployments select the PTY backend and sandbox policy.
|
|
6
6
|
|
|
7
7
|
## Config
|
|
8
8
|
|
package/README.zh.md
CHANGED
package/lib/index.js
CHANGED
|
@@ -132,7 +132,7 @@ function nextScrollbackOffset(page, offset) {
|
|
|
132
132
|
if (page.text.length === 0 || page.lineEnd <= offset) return void 0;
|
|
133
133
|
return page.lineEnd;
|
|
134
134
|
}
|
|
135
|
-
function retainedScrollback(ctx, owner, id, latest = ctx.
|
|
135
|
+
function retainedScrollback(ctx, owner, id, latest = ctx.terminals.read(owner, id, {
|
|
136
136
|
offset: 0,
|
|
137
137
|
count: SCROLLBACK_PAGE_LINES
|
|
138
138
|
})) {
|
|
@@ -141,7 +141,7 @@ function retainedScrollback(ctx, owner, id, latest = ctx.pty.read(owner, id, {
|
|
|
141
141
|
let truncated = latest.truncated;
|
|
142
142
|
while (true) {
|
|
143
143
|
if (offset >= latest.totalLines) break;
|
|
144
|
-
const page = ctx.
|
|
144
|
+
const page = ctx.terminals.read(owner, id, {
|
|
145
145
|
offset,
|
|
146
146
|
count: SCROLLBACK_PAGE_LINES
|
|
147
147
|
});
|
|
@@ -174,8 +174,8 @@ function persistentShells(ctx, config) {
|
|
|
174
174
|
const ownerCleanupInstalled = /* @__PURE__ */ new WeakSet();
|
|
175
175
|
const lifecycle = new AbortController();
|
|
176
176
|
const close = async (owner, id, reason) => {
|
|
177
|
-
if (!ctx.
|
|
178
|
-
await ctx.
|
|
177
|
+
if (!ctx.terminals.list(owner).some((snapshot) => snapshot.sessionId === id)) return;
|
|
178
|
+
await ctx.terminals.kill(owner, id, reason);
|
|
179
179
|
};
|
|
180
180
|
ctx.effect(() => async () => {
|
|
181
181
|
lifecycle.abort(/* @__PURE__ */ new Error("tool-bash-persistent disposed during shell creation"));
|
|
@@ -199,7 +199,7 @@ function persistentShells(ctx, config) {
|
|
|
199
199
|
const tracked = (async () => {
|
|
200
200
|
try {
|
|
201
201
|
const cwd = owner.session.header.cwd;
|
|
202
|
-
const spawned = await ctx.
|
|
202
|
+
const spawned = await ctx.terminals.spawn(owner, {
|
|
203
203
|
type: config.backendType,
|
|
204
204
|
...cwd === void 0 ? {} : { cwd }
|
|
205
205
|
}, combinedSignal);
|
|
@@ -211,7 +211,7 @@ function persistentShells(ctx, config) {
|
|
|
211
211
|
live.delete(owner);
|
|
212
212
|
}, "tool-bash-persistent owner cache cleanup");
|
|
213
213
|
}
|
|
214
|
-
const result = await ctx.
|
|
214
|
+
const result = await ctx.terminals.startSend(owner, spawned.sessionId, {
|
|
215
215
|
text: `stty -echo; PS1=${quoteForBash(SHELL_PROMPT)}`,
|
|
216
216
|
submit: true,
|
|
217
217
|
signal: combinedSignal
|
|
@@ -252,7 +252,7 @@ async function executeCommand(ctx, shells, owner, command, config, upstream) {
|
|
|
252
252
|
let operation;
|
|
253
253
|
let result;
|
|
254
254
|
try {
|
|
255
|
-
operation = ctx.
|
|
255
|
+
operation = ctx.terminals.startSend(owner, id, {
|
|
256
256
|
text: first ? wrapped : "",
|
|
257
257
|
submit: first,
|
|
258
258
|
signal: commandDeadline.signal
|
|
@@ -266,7 +266,7 @@ async function executeCommand(ctx, shells, owner, command, config, upstream) {
|
|
|
266
266
|
const incremental = operation.readOutput();
|
|
267
267
|
fallback = incremental.delta.length > 0 ? fallback + incremental.delta : result.viewport;
|
|
268
268
|
fallbackTruncated ||= incremental.truncated || result.truncated;
|
|
269
|
-
const latest = ctx.
|
|
269
|
+
const latest = ctx.terminals.read(owner, id, {
|
|
270
270
|
offset: 0,
|
|
271
271
|
count: SCROLLBACK_PAGE_LINES
|
|
272
272
|
});
|
|
@@ -352,7 +352,7 @@ function registerPersistentBash(ctx, config) {
|
|
|
352
352
|
}));
|
|
353
353
|
}
|
|
354
354
|
const name = "tool-bash-persistent";
|
|
355
|
-
const inject = ["tools", "
|
|
355
|
+
const inject = ["tools", "terminals"];
|
|
356
356
|
/** Runtime configuration schema for the persistent Bash tool. */
|
|
357
357
|
const Config = z.object({
|
|
358
358
|
backendType: z.string().default("shell"),
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-tool-bash-persistent",
|
|
3
3
|
"description": "Model-facing owner-scoped persistent Bash tool backed by the Harness PTY service",
|
|
4
|
-
"version": "0.0.1-rc.
|
|
4
|
+
"version": "0.0.1-rc.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "restricted"
|
|
7
7
|
},
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
11
|
-
"directory": "packages/
|
|
11
|
+
"directory": "packages/shell/tool-bash-persistent"
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
14
|
"main": "lib/index.js",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
],
|
|
32
32
|
"license": "BSD-3-Clause",
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@deepseek-ai/dsh-
|
|
35
|
-
"@deepseek-ai/dsh-
|
|
36
|
-
"@deepseek-ai/dsh-
|
|
37
|
-
"@deepseek-ai/dsh-tools": "^0.0.1-rc.
|
|
34
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
|
|
35
|
+
"@deepseek-ai/dsh-terminal": "^0.0.1-rc.3",
|
|
36
|
+
"@deepseek-ai/dsh-agent": "^0.0.1-rc.3",
|
|
37
|
+
"@deepseek-ai/dsh-tools": "^0.0.1-rc.3",
|
|
38
38
|
"@deepseek-ai/cordis": "^4.0.1-rc.1",
|
|
39
|
-
"@deepseek-ai/dsh-
|
|
39
|
+
"@deepseek-ai/dsh-timeout": "^0.0.1-rc.3"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@deepseek-ai/schemastery": "^3.18.1-rc.1"
|
|
@@ -44,18 +44,18 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@deepseek-ai/cordis-plugin-include": "^1.0.5-rc.1",
|
|
46
46
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.1-rc.1",
|
|
47
|
-
"@deepseek-ai/dsh-
|
|
48
|
-
"@deepseek-ai/dsh-
|
|
49
|
-
"@deepseek-ai/dsh-
|
|
50
|
-
"@deepseek-ai/dsh-
|
|
51
|
-
"@deepseek-ai/dsh-
|
|
52
|
-
"@deepseek-ai/dsh-sandbox": "^0.0.1-rc.
|
|
53
|
-
"@deepseek-ai/dsh-sandbox-policy": "^0.0.1-rc.
|
|
54
|
-
"@deepseek-ai/dsh-session": "^0.0.1-rc.
|
|
55
|
-
"@deepseek-ai/dsh-subprocess-local": "^0.0.1-rc.
|
|
56
|
-
"@deepseek-ai/dsh-system-prompt": "^0.0.1-rc.
|
|
57
|
-
"@deepseek-ai/dsh-timeout": "^0.0.1-rc.
|
|
58
|
-
"@deepseek-ai/dsh-tools": "^0.0.1-rc.
|
|
47
|
+
"@deepseek-ai/dsh-agent": "^0.0.1-rc.3",
|
|
48
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
|
|
49
|
+
"@deepseek-ai/dsh-llm": "^0.0.1-rc.3",
|
|
50
|
+
"@deepseek-ai/dsh-terminal": "^0.0.1-rc.3",
|
|
51
|
+
"@deepseek-ai/dsh-terminal-bash": "^0.0.1-rc.3",
|
|
52
|
+
"@deepseek-ai/dsh-sandbox": "^0.0.1-rc.3",
|
|
53
|
+
"@deepseek-ai/dsh-sandbox-policy": "^0.0.1-rc.3",
|
|
54
|
+
"@deepseek-ai/dsh-session": "^0.0.1-rc.3",
|
|
55
|
+
"@deepseek-ai/dsh-subprocess-local": "^0.0.1-rc.3",
|
|
56
|
+
"@deepseek-ai/dsh-system-prompt": "^0.0.1-rc.3",
|
|
57
|
+
"@deepseek-ai/dsh-timeout": "^0.0.1-rc.3",
|
|
58
|
+
"@deepseek-ai/dsh-tools": "^0.0.1-rc.3",
|
|
59
59
|
"@deepseek-ai/cordis": "^4.0.1-rc.1"
|
|
60
60
|
}
|
|
61
61
|
}
|