@deepseek-ai/dsh-ssh 0.1.6-alpha.1 → 0.1.7-alpha.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/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
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
4
  # pnpm run verify-translation-pairing --write packages/ssh/ssh/README.md
5
- README.md: 727ab6eefae6bf8361f41b2f1a4a7f85e7225226
6
- README.zh.md: 5548886d1c95e551330ecae9aaf24b4015cb3197
5
+ README.md: c978538491c3ce8045663b9e675d2141e541cacc
6
+ README.zh.md: 20c91b199aebdcf308d3e3f6c03f9188315e994a
package/README.md CHANGED
@@ -62,6 +62,8 @@ Connection disposal joins forwarding and cancellation subprocesses and partially
62
62
 
63
63
  Failed startup and process results release their reservations after native quiescence; the bounded completion cache preserves the original rejection for later result reads. Helper shutdown also joins endpoint and directory cleanup already in progress.
64
64
 
65
+ For terminals opting into shell activity observation, root exit retains the reservation and its remaining work. Activity RPC continues to reach the provider; explicit termination awaits quiescence before releasing endpoints and recording the completed result. Helper connection disposal and lease expiry retain their existing termination authority.
66
+
65
67
  The helper starts with `--disable-sigusr1`, so a same-user process signal cannot open its Node debugger.
66
68
 
67
69
  </details>
package/README.zh.md CHANGED
@@ -62,6 +62,8 @@ OpenSSH 主连接承载私有管理 RPC。每条程序流使用独立转发的 U
62
62
 
63
63
  启动或进程结果失败后,预留项在原生进程范围清空后释放;有界完成缓存保留原始拒绝结果,供后续读取。辅助程序关闭也会等待已在进行的端点与目录清理。
64
64
 
65
+ 终端启用 shell 活动观察时,根进程退出会保留 reservation 及其剩余工作。活动 RPC 继续访问 provider;明确终止时先等待进程范围完全停稳,再释放端点并记录完成结果。helper 连接卸载和租约到期仍保留原有的终止权限。
66
+
65
67
  辅助程序以 `--disable-sigusr1` 启动,因此同用户进程发送的信号无法开启其 Node 调试器。
66
68
 
67
69
  </details>
package/lib/helper.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as SshRpcPeer, t as RemoteOperationError } from "./protocol-C43fD--H.js";
2
- import { _ as remotePath, a as environmentSchema, b as targetSchema, d as outputSnapshotFrameLimit, g as processIdSchema, l as intentSchema, m as policySchema, r as editSchema, v as spawnSchema, x as textStreamIdSchema } from "./schemas-DBIgsx0q.js";
2
+ import { S as textStreamIdSchema, _ as remotePath, a as environmentSchema, b as targetSchema, d as outputSnapshotFrameLimit, g as processIdSchema, l as intentSchema, m as policySchema, r as editSchema, v as spawnSchema } from "./schemas-l5hGvwBb.js";
3
3
  import { t as SSH_STREAM_TLS_OPTIONS } from "./stream-security-DJlQsPG-.js";
4
4
  import { chmod, mkdir, mkdtemp, rm } from "node:fs/promises";
5
5
  import { join } from "node:path";
@@ -201,6 +201,10 @@ var RemoteProcesses = class {
201
201
  }));
202
202
  record.done = done;
203
203
  done.then(async () => {
204
+ if (request.terminal?.shellActivity === true) {
205
+ await output;
206
+ return;
207
+ }
204
208
  await terminal.terminate();
205
209
  await output;
206
210
  await this.rememberCompleted(id, record, done);
@@ -347,7 +351,10 @@ var RemoteProcesses = class {
347
351
  record.controller.abort(/* @__PURE__ */ new Error("SSH process termination requested"));
348
352
  record.ordinary?.terminate();
349
353
  if (record.ordinary !== void 0) await record.ordinary.waitForExit();
350
- if (record.terminal !== void 0) await record.terminal.terminate();
354
+ if (record.terminal !== void 0) {
355
+ await record.terminal.terminate();
356
+ if (record.request.terminal?.shellActivity === true && record.done !== void 0) await this.rememberCompleted(id, record, record.done);
357
+ }
351
358
  if (record.ordinary === void 0 && record.terminal === void 0) await this.release(id);
352
359
  }
353
360
  /**
@@ -365,6 +372,7 @@ var RemoteProcesses = class {
365
372
  return null;
366
373
  }
367
374
  if (operation === "inspect") return await terminal.inspectForeground() ?? null;
375
+ if (operation === "activity") return terminal.inspectActivity();
368
376
  return terminal.signalForeground(z.enum([
369
377
  "SIGINT",
370
378
  "SIGTERM",
@@ -641,12 +649,12 @@ async function runSshHelper(transport) {
641
649
  await processes.resizeTerminal(input.id, input.cols, input.rows);
642
650
  return null;
643
651
  }
644
- if (method === "terminal.write" || method === "terminal.inspect" || method === "terminal.signal") {
652
+ if (method === "terminal.write" || method === "terminal.inspect" || method === "terminal.activity" || method === "terminal.signal") {
645
653
  const input = z.object({
646
654
  id: processIdSchema,
647
655
  value: z.string().optional()
648
656
  }).strict().parse(raw);
649
- return processes.terminal(input.id, method === "terminal.write" ? "write" : method === "terminal.inspect" ? "inspect" : "signal", input.value);
657
+ return processes.terminal(input.id, method === "terminal.write" ? "write" : method === "terminal.inspect" ? "inspect" : method === "terminal.activity" ? "activity" : "signal", input.value);
650
658
  }
651
659
  if (method === "executable") {
652
660
  const input = z.object({
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as SshRpcPeer } from "./protocol-C43fD--H.js";
2
- import { s as helloSchema } from "./schemas-DBIgsx0q.js";
2
+ import { s as helloSchema } from "./schemas-l5hGvwBb.js";
3
3
  import { n as authenticateStream } from "./stream-security-DJlQsPG-.js";
4
4
  import { execFile, spawn } from "node:child_process";
5
5
  import { mkdtemp, rm } from "node:fs/promises";
@@ -108,7 +108,8 @@ const spawnSchema = z.object({
108
108
  terminal: z.object({
109
109
  terminalType: z.string().min(1),
110
110
  rows: z.number().int().positive(),
111
- cols: z.number().int().positive()
111
+ cols: z.number().int().positive(),
112
+ shellActivity: z.boolean().optional()
112
113
  }).strict().optional()
113
114
  }).strict().refine((value) => value.stdio === void 0 !== (value.terminal === void 0), "select ordinary or terminal execution");
114
115
  /** Connection handshake binds sockets and workspace to one helper process. */
@@ -173,5 +174,14 @@ const foregroundSchema = z.object({
173
174
  processGroupId: z.number().int().positive(),
174
175
  inputWaiting: z.boolean()
175
176
  }).strict().nullable();
177
+ /** Conservative shell lifecycle and process observation returned by the execution provider. */
178
+ const terminalActivitySchema = z.object({
179
+ state: z.enum([
180
+ "idle",
181
+ "busy",
182
+ "unknown"
183
+ ]),
184
+ revision: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)
185
+ }).strict();
176
186
  //#endregion
177
- export { writeResultSchema as S, remotePath as _, environmentSchema as a, targetSchema as b, infoSchema as c, outputSnapshotFrameLimit as d, outputSnapshotSchema as f, processIdSchema as g, preparedSchema as h, entriesSchema as i, intentSchema as l, policySchema as m, editResultSchema as n, foregroundSchema as o, pathInfoSchema as p, editSchema as r, helloSchema as s, doneSchema as t, outcomeSchema as u, spawnSchema as v, textStreamIdSchema as x, streamEndpointSchema as y };
187
+ export { writeResultSchema as C, textStreamIdSchema as S, remotePath as _, environmentSchema as a, targetSchema as b, infoSchema as c, outputSnapshotFrameLimit as d, outputSnapshotSchema as f, processIdSchema as g, preparedSchema as h, entriesSchema as i, intentSchema as l, policySchema as m, editResultSchema as n, foregroundSchema as o, pathInfoSchema as p, editSchema as r, helloSchema as s, doneSchema as t, outcomeSchema as u, spawnSchema as v, terminalActivitySchema as x, streamEndpointSchema as y };
package/lib/schemas.js CHANGED
@@ -1,2 +1,2 @@
1
- import { S as writeResultSchema, _ as remotePath, a as environmentSchema, b as targetSchema, c as infoSchema, d as outputSnapshotFrameLimit, f as outputSnapshotSchema, g as processIdSchema, h as preparedSchema, i as entriesSchema, l as intentSchema, m as policySchema, n as editResultSchema, o as foregroundSchema, p as pathInfoSchema, r as editSchema, s as helloSchema, t as doneSchema, u as outcomeSchema, v as spawnSchema, x as textStreamIdSchema, y as streamEndpointSchema } from "./schemas-DBIgsx0q.js";
2
- export { doneSchema, editResultSchema, editSchema, entriesSchema, environmentSchema, foregroundSchema, helloSchema, infoSchema, intentSchema, outcomeSchema, outputSnapshotFrameLimit, outputSnapshotSchema, pathInfoSchema, policySchema, preparedSchema, processIdSchema, remotePath, spawnSchema, streamEndpointSchema, targetSchema, textStreamIdSchema, writeResultSchema };
1
+ import { C as writeResultSchema, S as textStreamIdSchema, _ as remotePath, a as environmentSchema, b as targetSchema, c as infoSchema, d as outputSnapshotFrameLimit, f as outputSnapshotSchema, g as processIdSchema, h as preparedSchema, i as entriesSchema, l as intentSchema, m as policySchema, n as editResultSchema, o as foregroundSchema, p as pathInfoSchema, r as editSchema, s as helloSchema, t as doneSchema, u as outcomeSchema, v as spawnSchema, x as terminalActivitySchema, y as streamEndpointSchema } from "./schemas-l5hGvwBb.js";
2
+ export { doneSchema, editResultSchema, editSchema, entriesSchema, environmentSchema, foregroundSchema, helloSchema, infoSchema, intentSchema, outcomeSchema, outputSnapshotFrameLimit, outputSnapshotSchema, pathInfoSchema, policySchema, preparedSchema, processIdSchema, remotePath, spawnSchema, streamEndpointSchema, targetSchema, terminalActivitySchema, textStreamIdSchema, writeResultSchema };
@@ -57,7 +57,7 @@ export declare class RemoteProcesses {
57
57
  * @param value - input bytes as text or the signal name.
58
58
  * @returns the operation's wire result.
59
59
  */
60
- terminal(id: SshProcessId, operation: 'write' | 'inspect' | 'signal', value?: string): Promise<unknown>;
60
+ terminal(id: SshProcessId, operation: 'write' | 'inspect' | 'activity' | 'signal', value?: string): Promise<unknown>;
61
61
  /**
62
62
  * Resize an allocated terminal without replacing its process.
63
63
  * @param id - terminal reservation.
@@ -121,6 +121,7 @@ export declare const spawnSchema: z.ZodObject<{
121
121
  terminalType: z.ZodString;
122
122
  rows: z.ZodNumber;
123
123
  cols: z.ZodNumber;
124
+ shellActivity: z.ZodOptional<z.ZodBoolean>;
124
125
  }, z.core.$strict>>;
125
126
  }, z.core.$strict>;
126
127
  /** Connection handshake binds sockets and workspace to one helper process. */
@@ -200,4 +201,13 @@ export declare const foregroundSchema: z.ZodNullable<z.ZodObject<{
200
201
  processGroupId: z.ZodNumber;
201
202
  inputWaiting: z.ZodBoolean;
202
203
  }, z.core.$strict>>;
204
+ /** Conservative shell lifecycle and process observation returned by the execution provider. */
205
+ export declare const terminalActivitySchema: z.ZodObject<{
206
+ state: z.ZodEnum<{
207
+ unknown: "unknown";
208
+ idle: "idle";
209
+ busy: "busy";
210
+ }>;
211
+ revision: z.ZodNumber;
212
+ }, z.core.$strict>;
203
213
  //# sourceMappingURL=schemas.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-ssh",
3
3
  "description": "Shared OpenSSH connection and versioned POSIX remote helper",
4
- "version": "0.1.6-alpha.1",
4
+ "version": "0.1.7-alpha.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -45,39 +45,39 @@
45
45
  ],
46
46
  "license": "MIT",
47
47
  "peerDependencies": {
48
- "@deepseek-ai/cordis": "^4.0.2",
49
- "@deepseek-ai/dsh-fs": "^0.1.6-alpha.1",
50
- "@deepseek-ai/dsh-fs-local": "^0.1.6-alpha.1",
51
- "@deepseek-ai/dsh-fs-sandbox": "^0.1.6-alpha.1",
52
- "@deepseek-ai/dsh-subprocess": "^0.1.6-alpha.1",
53
- "@deepseek-ai/dsh-sandbox": "^0.1.6-alpha.1",
54
- "@deepseek-ai/dsh-subprocess-local": "^0.1.6-alpha.1",
55
- "@deepseek-ai/dsh-sandbox-local": "^0.1.6-alpha.1",
56
- "@deepseek-ai/dsh-sandbox-policy": "^0.1.6-alpha.1",
57
- "@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.1",
58
- "@deepseek-ai/dsh-brand": "^0.1.6-alpha.1"
48
+ "@deepseek-ai/cordis": "^4.0.3",
49
+ "@deepseek-ai/dsh-fs": "^0.1.7-alpha.1",
50
+ "@deepseek-ai/dsh-fs-local": "^0.1.7-alpha.1",
51
+ "@deepseek-ai/dsh-fs-sandbox": "^0.1.7-alpha.1",
52
+ "@deepseek-ai/dsh-subprocess": "^0.1.7-alpha.1",
53
+ "@deepseek-ai/dsh-subprocess-local": "^0.1.7-alpha.1",
54
+ "@deepseek-ai/dsh-sandbox": "^0.1.7-alpha.1",
55
+ "@deepseek-ai/dsh-sandbox-local": "^0.1.7-alpha.1",
56
+ "@deepseek-ai/dsh-session-projection": "^0.1.7-alpha.1",
57
+ "@deepseek-ai/dsh-brand": "^0.1.7-alpha.1",
58
+ "@deepseek-ai/dsh-sandbox-policy": "^0.1.7-alpha.1"
59
59
  },
60
60
  "dependencies": {
61
61
  "zod": "^4.4.3",
62
- "@deepseek-ai/schemastery": "^3.18.2"
62
+ "@deepseek-ai/schemastery": "^3.18.3"
63
63
  },
64
64
  "devDependencies": {
65
- "@deepseek-ai/cordis": "^4.0.2",
66
- "@deepseek-ai/dsh-fs-local": "^0.1.6-alpha.1",
67
- "@deepseek-ai/dsh-fs": "^0.1.6-alpha.1",
68
- "@deepseek-ai/dsh-fs-sandbox": "^0.1.6-alpha.1",
69
- "@deepseek-ai/dsh-subprocess": "^0.1.6-alpha.1",
70
- "@deepseek-ai/dsh-sandbox": "^0.1.6-alpha.1",
71
- "@deepseek-ai/dsh-sandbox-local": "^0.1.6-alpha.1",
72
- "@deepseek-ai/dsh-subprocess-local": "^0.1.6-alpha.1",
73
- "@deepseek-ai/dsh-sandbox-policy": "^0.1.6-alpha.1",
74
- "@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.1",
75
- "@deepseek-ai/dsh-fs-ssh": "^0.1.6-alpha.1",
76
- "@deepseek-ai/dsh-subprocess-ssh": "^0.1.6-alpha.1",
77
- "@deepseek-ai/dsh-lsp": "^0.1.6-alpha.1",
78
- "@deepseek-ai/dsh-brand": "^0.1.6-alpha.1",
79
- "@deepseek-ai/dsh-lsp-stdio": "^0.1.6-alpha.1",
80
- "@deepseek-ai/dsh-ptc-runtime-node": "^0.1.6-alpha.1",
81
- "@deepseek-ai/dsh-sandbox-ssh": "^0.1.6-alpha.1"
65
+ "@deepseek-ai/cordis": "^4.0.3",
66
+ "@deepseek-ai/dsh-fs": "^0.1.7-alpha.1",
67
+ "@deepseek-ai/dsh-fs-local": "^0.1.7-alpha.1",
68
+ "@deepseek-ai/dsh-fs-sandbox": "^0.1.7-alpha.1",
69
+ "@deepseek-ai/dsh-subprocess": "^0.1.7-alpha.1",
70
+ "@deepseek-ai/dsh-subprocess-local": "^0.1.7-alpha.1",
71
+ "@deepseek-ai/dsh-sandbox": "^0.1.7-alpha.1",
72
+ "@deepseek-ai/dsh-sandbox-policy": "^0.1.7-alpha.1",
73
+ "@deepseek-ai/dsh-session-projection": "^0.1.7-alpha.1",
74
+ "@deepseek-ai/dsh-fs-ssh": "^0.1.7-alpha.1",
75
+ "@deepseek-ai/dsh-subprocess-ssh": "^0.1.7-alpha.1",
76
+ "@deepseek-ai/dsh-sandbox-ssh": "^0.1.7-alpha.1",
77
+ "@deepseek-ai/dsh-lsp": "^0.1.7-alpha.1",
78
+ "@deepseek-ai/dsh-lsp-stdio": "^0.1.7-alpha.1",
79
+ "@deepseek-ai/dsh-sandbox-local": "^0.1.7-alpha.1",
80
+ "@deepseek-ai/dsh-ptc-runtime-node": "^0.1.7-alpha.1",
81
+ "@deepseek-ai/dsh-brand": "^0.1.7-alpha.1"
82
82
  }
83
83
  }