@deepseek-ai/dsh-tool-pwsh 0.2.2-rc.1 → 0.2.2-rc.2
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 +2 -2
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/lib/index.js +48 -18
- package/lib/types/background.d.ts +14 -2
- package/lib/types/background.d.ts.map +1 -0
- package/lib/types/background.js.map +1 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/render.d.ts.map +1 -0
- package/lib/types/render.js.map +1 -0
- package/package.json +41 -36
- package/src/background.ts +147 -0
- package/src/index.ts +643 -0
- package/src/render.ts +139 -0
package/README.i18n.yaml
CHANGED
|
@@ -108,8 +108,8 @@
|
|
|
108
108
|
en: 2d4f2c8605eccab3
|
|
109
109
|
zh: 67f1f0218f73c6bf
|
|
110
110
|
/deepseek-ai-dsh-tool-pwsh/model-experience/tool-errors/what-the-model-sees:
|
|
111
|
-
en:
|
|
112
|
-
zh:
|
|
111
|
+
en: c71e7f547de19d3d
|
|
112
|
+
zh: a9d9c3a84e1618b9
|
|
113
113
|
/deepseek-ai-dsh-tool-pwsh/model-experience/tool-errors/token-effect:
|
|
114
114
|
en: 243bad012dd99c7f
|
|
115
115
|
zh: 5ee74905020bd49a
|
package/README.md
CHANGED
|
@@ -188,7 +188,7 @@ Append-only; newly visible content follows the reusable request prefix and does
|
|
|
188
188
|
|
|
189
189
|
#### What the model sees
|
|
190
190
|
|
|
191
|
-
Validation and infrastructure failures are normalized as `Error: <message>`. This package's stable messages are `invalid command: expected a non-empty string`, `invalid description: expected a non-empty string`, `invalid timeoutMs: expected a positive number, got <value>`, the escalation pairing failures, `sandbox_permissions is not available in this composition (no sandboxing executor to escalate)`, the shared escalation failures (not strictly wider / no approval service / no agent to route / no approval channel / user rejected / was cancelled), `run_in_background is disabled for this deployment (enableRunInBackground: false)`, `background jobs unavailable: load @deepseek-ai/dsh-jobs and @deepseek-ai/dsh-tool-jobs`, and `tool call aborted`.
|
|
191
|
+
Validation and infrastructure failures are normalized as `Error: <message>`. This package's stable messages are `invalid arguments: invalid command: expected a non-empty string`, `invalid arguments: invalid description: expected a non-empty string`, `invalid arguments: invalid timeoutMs: expected a positive number, got <value>`, the escalation pairing failures, `sandbox_permissions is not available in this composition (no sandboxing executor to escalate)`, the shared escalation failures (not strictly wider / no approval service / no agent to route / no approval channel / user rejected / was cancelled), `run_in_background is disabled for this deployment (enableRunInBackground: false)`, `background jobs unavailable: load @deepseek-ai/dsh-jobs and @deepseek-ai/dsh-tool-jobs`, and `tool call aborted`. Each failure also records `error.name` and `error.code` on `tool/result`: argument violations are `ToolArgsError` (`INVALID_ARGS`, message prefix `invalid arguments: `), escalation failures are `SandboxEscalationError` (`SANDBOX_ESCALATION_INVALID_ARGUMENT`, `_UNAVAILABLE`, `_REJECTED`, `_CANCELLED`), a disabled background call is `JobError` (`JOB_BACKGROUND_DISABLED`), a missing job runtime is `ToolContextUnavailableError` (`TOOL_CONTEXT_UNAVAILABLE`), and cancellation is `AbortError` (`ABORTED`). A launch or preparation failure keeps the class and code it was thrown with, such as `SandboxUnavailableError` or `SandboxPreparationError`, whether the call waited on a job or not; a platform spawn error, recognized by its errno `code`, becomes `SubprocessError` (`SUBPROCESS_SPAWN_NOT_FOUND` for `ENOENT`, otherwise `SUBPROCESS_SPAWN_FAILED`), even when it settles after the call was cancelled.
|
|
192
192
|
|
|
193
193
|
#### Token effect
|
|
194
194
|
|
package/README.zh.md
CHANGED
|
@@ -188,7 +188,7 @@ Non-zero exits are reported as `[exit code: N]` markers; investigate failures be
|
|
|
188
188
|
|
|
189
189
|
#### 模型看到什么
|
|
190
190
|
|
|
191
|
-
验证与基础设施失败统一为 `Error: <message>`。本包的稳定消息包括 `invalid command: expected a non-empty string`、`invalid description: expected a non-empty string`、`invalid timeoutMs: expected a positive number, got <value>`、升权配对失败、`sandbox_permissions is not available in this composition (no sandboxing executor to escalate)`、共享升权失败(未严格加宽/无审批服务/无 agent 可路由/无审批通道/用户拒绝/已取消)、`run_in_background is disabled for this deployment (enableRunInBackground: false)`、`background jobs unavailable: load @deepseek-ai/dsh-jobs and @deepseek-ai/dsh-tool-jobs`,以及 `tool call aborted
|
|
191
|
+
验证与基础设施失败统一为 `Error: <message>`。本包的稳定消息包括 `invalid arguments: invalid command: expected a non-empty string`、`invalid arguments: invalid description: expected a non-empty string`、`invalid arguments: invalid timeoutMs: expected a positive number, got <value>`、升权配对失败、`sandbox_permissions is not available in this composition (no sandboxing executor to escalate)`、共享升权失败(未严格加宽/无审批服务/无 agent 可路由/无审批通道/用户拒绝/已取消)、`run_in_background is disabled for this deployment (enableRunInBackground: false)`、`background jobs unavailable: load @deepseek-ai/dsh-jobs and @deepseek-ai/dsh-tool-jobs`,以及 `tool call aborted`。每个失败还会在 `tool/result` 上记录 `error.name` 与 `error.code`:参数违规为 `ToolArgsError`(`INVALID_ARGS`,消息前缀为 `invalid arguments: `),升权失败为 `SandboxEscalationError`(`SANDBOX_ESCALATION_INVALID_ARGUMENT`、`_UNAVAILABLE`、`_REJECTED`、`_CANCELLED`),被禁用的后台调用为 `JobError`(`JOB_BACKGROUND_DISABLED`),缺少任务运行时为 `ToolContextUnavailableError`(`TOOL_CONTEXT_UNAVAILABLE`),取消为 `AbortError`(`ABORTED`)。启动或准备阶段的失败保留其抛出时的类与 code(例如 `SandboxUnavailableError` 或 `SandboxPreparationError`),无论调用是否在 job 上等待;按 errno `code` 识别的平台 spawn 错误转为 `SubprocessError`(`ENOENT` 为 `SUBPROCESS_SPAWN_NOT_FOUND`,其余为 `SUBPROCESS_SPAWN_FAILED`),在调用取消后才出现时也是如此。
|
|
192
192
|
|
|
193
193
|
#### Token 影响
|
|
194
194
|
|
package/lib/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { isAbsolute, resolve } from "node:path";
|
|
2
2
|
import z from "@deepseek-ai/schemastery";
|
|
3
|
-
import { TOOL_ABORTED, defineTool } from "@deepseek-ai/dsh-tools";
|
|
3
|
+
import { TOOL_ABORTED, ToolArgsError, ToolContextUnavailableError, defineTool } from "@deepseek-ai/dsh-tools";
|
|
4
4
|
import { HarnessError } from "@deepseek-ai/dsh-llm";
|
|
5
|
-
import {
|
|
5
|
+
import { JobError } from "@deepseek-ai/dsh-jobs";
|
|
6
|
+
import { ESCALATION_TARGETS, SandboxEscalationError, approveEscalation, escalationHintMarker, sandboxDenialMarker, sandboxPermissionsDescription, validateEscalationArgs } from "@deepseek-ai/dsh-sandbox";
|
|
7
|
+
import { subprocessSpawnFailure } from "@deepseek-ai/dsh-subprocess";
|
|
6
8
|
import { parseExitStatus } from "@deepseek-ai/dsh-shell";
|
|
7
9
|
//#region lib/types/background.js
|
|
8
10
|
/**
|
|
@@ -95,11 +97,13 @@ function ringDelta(chunks) {
|
|
|
95
97
|
* Adapt asynchronous shell preparation after job admission without exposing a partial process.
|
|
96
98
|
* @param start - starts the process with job-owned cancellation.
|
|
97
99
|
* @param outcome - projects the settled process into the job outcome.
|
|
98
|
-
* @returns synchronous job hooks whose completion includes preparation and process settlement
|
|
100
|
+
* @returns synchronous job hooks whose completion includes preparation and process settlement,
|
|
101
|
+
* and the original error of a failed preparation for a caller that reports it.
|
|
99
102
|
*/
|
|
100
103
|
function processJob(start, outcome) {
|
|
101
104
|
const controller = new AbortController();
|
|
102
105
|
let process;
|
|
106
|
+
let failure;
|
|
103
107
|
return {
|
|
104
108
|
cancel: (reason) => {
|
|
105
109
|
if (controller.signal.aborted) return;
|
|
@@ -116,12 +120,15 @@ function processJob(start, outcome) {
|
|
|
116
120
|
}
|
|
117
121
|
return outcome(process);
|
|
118
122
|
} catch (error) {
|
|
123
|
+
const killed = controller.signal.aborted && process === void 0;
|
|
124
|
+
if (!killed) failure = { error };
|
|
119
125
|
return {
|
|
120
|
-
status:
|
|
126
|
+
status: killed ? "killed" : "failed",
|
|
121
127
|
detail: error instanceof Error ? error.message : String(error)
|
|
122
128
|
};
|
|
123
129
|
}
|
|
124
|
-
})()
|
|
130
|
+
})(),
|
|
131
|
+
failure: () => failure
|
|
125
132
|
};
|
|
126
133
|
}
|
|
127
134
|
//#endregion
|
|
@@ -247,9 +254,9 @@ const Config = z.object({
|
|
|
247
254
|
promoteOnTimeout: z.boolean().default(true)
|
|
248
255
|
});
|
|
249
256
|
function validatePwshArgs(args) {
|
|
250
|
-
if (args.command.trim().length === 0) throw new
|
|
251
|
-
if (args.description.trim().length === 0) throw new
|
|
252
|
-
if (args.timeoutMs !== void 0 && (!Number.isFinite(args.timeoutMs) || args.timeoutMs <= 0)) throw new
|
|
257
|
+
if (args.command.trim().length === 0) throw new ToolArgsError(["invalid command: expected a non-empty string"]);
|
|
258
|
+
if (args.description.trim().length === 0) throw new ToolArgsError(["invalid description: expected a non-empty string"]);
|
|
259
|
+
if (args.timeoutMs !== void 0 && (!Number.isFinite(args.timeoutMs) || args.timeoutMs <= 0)) throw new ToolArgsError([`invalid timeoutMs: expected a positive number, got ${JSON.stringify(args.timeoutMs)}`]);
|
|
253
260
|
validateEscalationArgs(args.sandbox_permissions, args.justification);
|
|
254
261
|
}
|
|
255
262
|
function pwshDescription(windowsSandbox) {
|
|
@@ -294,6 +301,16 @@ function toolAborted() {
|
|
|
294
301
|
error.name = "AbortError";
|
|
295
302
|
return error;
|
|
296
303
|
}
|
|
304
|
+
/**
|
|
305
|
+
* Report a launch or preparation rejection as this tool's failure. This
|
|
306
|
+
* call's cancellation reason stays as thrown so the registry records it as
|
|
307
|
+
* aborted; a platform spawn error is classified as a subprocess spawn failure
|
|
308
|
+
* with the original as `cause`; any other value, including a coded error,
|
|
309
|
+
* keeps its own identity.
|
|
310
|
+
*/
|
|
311
|
+
function launchFailure(error, signal) {
|
|
312
|
+
return signal.aborted && error === signal.reason ? error : subprocessSpawnFailure(error, "pwsh");
|
|
313
|
+
}
|
|
297
314
|
/** Canonical background-handle properties shared by the pwsh output union. */
|
|
298
315
|
const BACKGROUND_OUTPUT_PROPERTIES = {
|
|
299
316
|
kind: {
|
|
@@ -332,7 +349,7 @@ function apply(ctx, config = {}) {
|
|
|
332
349
|
* tool-plugin load.
|
|
333
350
|
*/
|
|
334
351
|
const approvePwshEscalation = (mode, justification, exec, standingPolicy) => {
|
|
335
|
-
if (escalationModes.length === 0) throw new
|
|
352
|
+
if (escalationModes.length === 0) throw new SandboxEscalationError("sandbox_permissions is not available in this composition (no sandboxing executor to escalate)", "SANDBOX_ESCALATION_UNAVAILABLE");
|
|
336
353
|
const effectiveMode = standingPolicy.mode;
|
|
337
354
|
return approveEscalation({
|
|
338
355
|
requestedMode: mode,
|
|
@@ -364,6 +381,7 @@ function apply(ctx, config = {}) {
|
|
|
364
381
|
const startJob = (registry, args, exec, spec) => {
|
|
365
382
|
let proc;
|
|
366
383
|
let stopped;
|
|
384
|
+
let hooks;
|
|
367
385
|
return {
|
|
368
386
|
id: registry.start({
|
|
369
387
|
kind: "pwsh",
|
|
@@ -375,24 +393,26 @@ function apply(ctx, config = {}) {
|
|
|
375
393
|
...exec.agent ? { owner: exec.agent.id } : {},
|
|
376
394
|
output: processSources(() => proc),
|
|
377
395
|
run: () => {
|
|
378
|
-
const
|
|
396
|
+
const job = processJob(async (signal) => {
|
|
379
397
|
proc = await ctx.shell.execute({
|
|
380
398
|
...spec,
|
|
381
399
|
signal
|
|
382
400
|
});
|
|
383
401
|
return proc;
|
|
384
402
|
}, (started) => processOutcome(started, escalationModes));
|
|
403
|
+
hooks = job;
|
|
385
404
|
return {
|
|
386
|
-
done:
|
|
405
|
+
done: job.done,
|
|
387
406
|
cancel: (reason) => {
|
|
388
407
|
stopped = reason;
|
|
389
|
-
|
|
408
|
+
job.cancel(reason);
|
|
390
409
|
}
|
|
391
410
|
};
|
|
392
411
|
}
|
|
393
412
|
}),
|
|
394
413
|
process: () => proc,
|
|
395
|
-
stopped: () => stopped
|
|
414
|
+
stopped: () => stopped,
|
|
415
|
+
failure: () => hooks?.failure()
|
|
396
416
|
};
|
|
397
417
|
};
|
|
398
418
|
/** Wait on a registered foreground command until it settles or the timeout passes. */
|
|
@@ -454,8 +474,13 @@ function apply(ctx, config = {}) {
|
|
|
454
474
|
}
|
|
455
475
|
registry.remove(attached.id, owner);
|
|
456
476
|
const process = attached.process();
|
|
457
|
-
if (process === void 0)
|
|
458
|
-
|
|
477
|
+
if (process === void 0) {
|
|
478
|
+
const failure = attached.failure();
|
|
479
|
+
throw failure === void 0 ? new Error(view.detail) : launchFailure(failure.error, exec.signal);
|
|
480
|
+
}
|
|
481
|
+
const result = await process.result().catch((error) => {
|
|
482
|
+
throw launchFailure(error, exec.signal);
|
|
483
|
+
});
|
|
459
484
|
const stopped = attached.stopped();
|
|
460
485
|
return {
|
|
461
486
|
...canonicalPwshResult(result, spec.workdir),
|
|
@@ -643,8 +668,8 @@ function apply(ctx, config = {}) {
|
|
|
643
668
|
...policy !== void 0 ? { sandboxPolicy: policy } : {}
|
|
644
669
|
};
|
|
645
670
|
if (args.run_in_background === true) {
|
|
646
|
-
if (!backgroundEnabled) throw new
|
|
647
|
-
if (jobs === void 0) throw new
|
|
671
|
+
if (!backgroundEnabled) throw new JobError("run_in_background is disabled for this deployment (enableRunInBackground: false)", "JOB_BACKGROUND_DISABLED");
|
|
672
|
+
if (jobs === void 0) throw new ToolContextUnavailableError("background jobs unavailable: load @deepseek-ai/dsh-jobs and @deepseek-ai/dsh-tool-jobs");
|
|
648
673
|
if (exec.signal.aborted) throw toolAborted();
|
|
649
674
|
const spec = ctx.shell.resolve({
|
|
650
675
|
...request,
|
|
@@ -673,7 +698,12 @@ function apply(ctx, config = {}) {
|
|
|
673
698
|
...request,
|
|
674
699
|
signal: exec.signal
|
|
675
700
|
});
|
|
676
|
-
|
|
701
|
+
let result;
|
|
702
|
+
try {
|
|
703
|
+
result = await (await ctx.shell.execute(spec)).result();
|
|
704
|
+
} catch (error) {
|
|
705
|
+
throw launchFailure(error, exec.signal);
|
|
706
|
+
}
|
|
677
707
|
if (result.aborted) throw toolAborted();
|
|
678
708
|
return canonicalPwshResult(result, spec.workdir);
|
|
679
709
|
},
|
|
@@ -8,6 +8,17 @@
|
|
|
8
8
|
import type { SandboxMode } from '@deepseek-ai/dsh-sandbox';
|
|
9
9
|
import type { ShellProcess } from '@deepseek-ai/dsh-shell';
|
|
10
10
|
import type { JobChunk, JobHooks, JobOutcome, JobOutputSource } from '@deepseek-ai/dsh-jobs';
|
|
11
|
+
/** Job hooks plus the original error of a job that failed before its process produced an outcome. */
|
|
12
|
+
export interface ProcessJobHooks extends JobHooks {
|
|
13
|
+
/**
|
|
14
|
+
* The error that ended a `failed` job, kept with its own class and code;
|
|
15
|
+
* undefined while the job runs and for a completed or killed job.
|
|
16
|
+
* @returns the original failure, boxed so any thrown value is preserved.
|
|
17
|
+
*/
|
|
18
|
+
failure(): {
|
|
19
|
+
error: unknown;
|
|
20
|
+
} | undefined;
|
|
21
|
+
}
|
|
11
22
|
/**
|
|
12
23
|
* Map a settled background process onto the generic job-outcome vocabulary:
|
|
13
24
|
* `killed` stays `killed` (detail: the signal when one is known), everything
|
|
@@ -44,7 +55,8 @@ export declare function ringDelta(chunks: readonly JobChunk[]): string;
|
|
|
44
55
|
* Adapt asynchronous shell preparation after job admission without exposing a partial process.
|
|
45
56
|
* @param start - starts the process with job-owned cancellation.
|
|
46
57
|
* @param outcome - projects the settled process into the job outcome.
|
|
47
|
-
* @returns synchronous job hooks whose completion includes preparation and process settlement
|
|
58
|
+
* @returns synchronous job hooks whose completion includes preparation and process settlement,
|
|
59
|
+
* and the original error of a failed preparation for a caller that reports it.
|
|
48
60
|
*/
|
|
49
|
-
export declare function processJob(start: (signal: AbortSignal) => Promise<ShellProcess>, outcome: (process: ShellProcess) => JobOutcome):
|
|
61
|
+
export declare function processJob(start: (signal: AbortSignal) => Promise<ShellProcess>, outcome: (process: ShellProcess) => JobOutcome): ProcessJobHooks;
|
|
50
62
|
//# sourceMappingURL=background.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"background.d.ts","sourceRoot":"","sources":["../../src/background.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAE3D,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,wBAAwB,CAAA;AAC5E,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAE5F,qGAAqG;AACrG,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C;;;;OAIG;IACH,OAAO,IAAI;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAA;CAC1C;AAuBD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,eAAe,GAAE,SAAS,WAAW,EAAO,GAAG,UAAU,CAW3G;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,GAAG,SAAS,GAAG,eAAe,EAAE,CASxG;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,GAAG,MAAM,CAK7D;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,YAAY,CAAC,EACrD,OAAO,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,UAAU,GAC7C,eAAe,CA+BjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"background.js","sourceRoot":"","sources":["../../src/background.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAcpF,wFAAwF;AAExF;;;;;;GAMG;AACH,SAAS,YAAY,CAAC,OAAqC,EAAE,eAAuC;IA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,OAAO,EAAE,IAAI,EAAE,CAAA;QACjB,CAAC;QACD,IAAI;QACJ,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO;KACvB,CAAA;AACH,CAAC;AACD,sBAAsB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAmBxC,OAAO,QAAQ,uBAAuB,CAAC;IACrC,UAAU,UAAU;QAClB,IAAI,EAAE,MAAM,CAAA;KACb;CACF;AAED,eAAO,MAAM,IAAI,cAAc,CAAA;AAC/B,eAAO,MAAM,MAAM,UAAqE,CAAA;AAGxF,uCAAuC;AACvC,MAAM,WAAW,MAAM;IACrB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,6DAA6D;AAC7D,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,MAAM,CAG3B,CAAA;AAqJF,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,MAAW,GAAG,IAAI,CA+Z7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAA;AAI9D,OAAO,CAAC,MAAM,0BAA0B,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAA;AAE7G,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAs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,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAA;AAChG,CAAC;AACD,sBAAsB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-tool-pwsh",
|
|
3
3
|
"description": "Model-facing pwsh tool over the bash executor seam",
|
|
4
|
-
"version": "0.2.2-rc.
|
|
4
|
+
"version": "0.2.2-rc.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -25,50 +25,55 @@
|
|
|
25
25
|
"files": [
|
|
26
26
|
"locale/*.json",
|
|
27
27
|
"lib/index.js",
|
|
28
|
-
"lib/types/**/*.d.ts"
|
|
28
|
+
"lib/types/**/*.d.ts",
|
|
29
|
+
"lib/types/**/*.d.ts.map",
|
|
30
|
+
"lib/**/*.js.map",
|
|
31
|
+
"src"
|
|
29
32
|
],
|
|
30
33
|
"license": "MIT",
|
|
31
34
|
"peerDependencies": {
|
|
32
35
|
"@deepseek-ai/cordis": "~4.1.0",
|
|
33
|
-
"@deepseek-ai/dsh-agent": "0.2.2-rc.
|
|
34
|
-
"@deepseek-ai/dsh-jobs": "0.2.2-rc.
|
|
35
|
-
"@deepseek-ai/dsh-llm": "0.2.2-rc.
|
|
36
|
-
"@deepseek-ai/dsh-sandbox": "0.2.2-rc.
|
|
37
|
-
"@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.
|
|
38
|
-
"@deepseek-ai/dsh-shell": "0.2.2-rc.
|
|
39
|
-
"@deepseek-ai/dsh-shell-env": "0.2.2-rc.
|
|
40
|
-
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.
|
|
41
|
-
"@deepseek-ai/dsh-tools": "0.2.2-rc.
|
|
42
|
-
"@deepseek-ai/dsh-user-approval": "0.2.2-rc.
|
|
43
|
-
"@deepseek-ai/dsh-working-directory": "0.2.2-rc.
|
|
36
|
+
"@deepseek-ai/dsh-agent": "0.2.2-rc.2",
|
|
37
|
+
"@deepseek-ai/dsh-jobs": "0.2.2-rc.2",
|
|
38
|
+
"@deepseek-ai/dsh-llm": "0.2.2-rc.2",
|
|
39
|
+
"@deepseek-ai/dsh-sandbox": "0.2.2-rc.2",
|
|
40
|
+
"@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.2",
|
|
41
|
+
"@deepseek-ai/dsh-shell": "0.2.2-rc.2",
|
|
42
|
+
"@deepseek-ai/dsh-shell-env": "0.2.2-rc.2",
|
|
43
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.2",
|
|
44
|
+
"@deepseek-ai/dsh-tools": "0.2.2-rc.2",
|
|
45
|
+
"@deepseek-ai/dsh-user-approval": "0.2.2-rc.2",
|
|
46
|
+
"@deepseek-ai/dsh-working-directory": "0.2.2-rc.2",
|
|
47
|
+
"@deepseek-ai/dsh-subprocess": "0.2.2-rc.2"
|
|
44
48
|
},
|
|
45
49
|
"dependencies": {
|
|
46
50
|
"@deepseek-ai/schemastery": "~3.19.0"
|
|
47
51
|
},
|
|
48
52
|
"devDependencies": {
|
|
49
53
|
"@deepseek-ai/cordis": "~4.1.0",
|
|
50
|
-
"@deepseek-ai/dsh-agent": "0.2.2-rc.
|
|
51
|
-
"@deepseek-ai/dsh-agent-loop": "0.2.2-rc.
|
|
52
|
-
"@deepseek-ai/dsh-agent-loop-testkit": "0.2.2-rc.
|
|
53
|
-
"@deepseek-ai/dsh-app-boot": "0.2.2-rc.
|
|
54
|
-
"@deepseek-ai/dsh-jobs": "0.2.2-rc.
|
|
55
|
-
"@deepseek-ai/dsh-jobs-local": "0.2.2-rc.
|
|
56
|
-
"@deepseek-ai/dsh-llm": "0.2.2-rc.
|
|
57
|
-
"@deepseek-ai/dsh-loader-smoke": "0.2.2-rc.
|
|
58
|
-
"@deepseek-ai/dsh-pwsh-local": "0.2.2-rc.
|
|
59
|
-
"@deepseek-ai/dsh-sandbox": "0.2.2-rc.
|
|
60
|
-
"@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.
|
|
61
|
-
"@deepseek-ai/dsh-session-projection": "0.2.2-rc.
|
|
62
|
-
"@deepseek-ai/dsh-shell": "0.2.2-rc.
|
|
63
|
-
"@deepseek-ai/dsh-shell-env": "0.2.2-rc.
|
|
64
|
-
"@deepseek-ai/dsh-subprocess-local": "0.2.2-rc.
|
|
65
|
-
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.
|
|
66
|
-
"@deepseek-ai/dsh-tool-executor-native": "0.2.2-rc.
|
|
67
|
-
"@deepseek-ai/dsh-tool-jobs": "0.2.2-rc.
|
|
68
|
-
"@deepseek-ai/dsh-tool-testkit": "0.2.2-rc.
|
|
69
|
-
"@deepseek-ai/dsh-tools": "0.2.2-rc.
|
|
70
|
-
"@deepseek-ai/dsh-user-approval": "0.2.2-rc.
|
|
71
|
-
"@deepseek-ai/dsh-working-directory": "0.2.2-rc.
|
|
72
|
-
"@deepseek-ai/dsh-fs-local": "0.2.2-rc.
|
|
54
|
+
"@deepseek-ai/dsh-agent": "0.2.2-rc.2",
|
|
55
|
+
"@deepseek-ai/dsh-agent-loop": "0.2.2-rc.2",
|
|
56
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "0.2.2-rc.2",
|
|
57
|
+
"@deepseek-ai/dsh-app-boot": "0.2.2-rc.2",
|
|
58
|
+
"@deepseek-ai/dsh-jobs": "0.2.2-rc.2",
|
|
59
|
+
"@deepseek-ai/dsh-jobs-local": "0.2.2-rc.2",
|
|
60
|
+
"@deepseek-ai/dsh-llm": "0.2.2-rc.2",
|
|
61
|
+
"@deepseek-ai/dsh-loader-smoke": "0.2.2-rc.2",
|
|
62
|
+
"@deepseek-ai/dsh-pwsh-local": "0.2.2-rc.2",
|
|
63
|
+
"@deepseek-ai/dsh-sandbox": "0.2.2-rc.2",
|
|
64
|
+
"@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.2",
|
|
65
|
+
"@deepseek-ai/dsh-session-projection": "0.2.2-rc.2",
|
|
66
|
+
"@deepseek-ai/dsh-shell": "0.2.2-rc.2",
|
|
67
|
+
"@deepseek-ai/dsh-shell-env": "0.2.2-rc.2",
|
|
68
|
+
"@deepseek-ai/dsh-subprocess-local": "0.2.2-rc.2",
|
|
69
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.2",
|
|
70
|
+
"@deepseek-ai/dsh-tool-executor-native": "0.2.2-rc.2",
|
|
71
|
+
"@deepseek-ai/dsh-tool-jobs": "0.2.2-rc.2",
|
|
72
|
+
"@deepseek-ai/dsh-tool-testkit": "0.2.2-rc.2",
|
|
73
|
+
"@deepseek-ai/dsh-tools": "0.2.2-rc.2",
|
|
74
|
+
"@deepseek-ai/dsh-user-approval": "0.2.2-rc.2",
|
|
75
|
+
"@deepseek-ai/dsh-working-directory": "0.2.2-rc.2",
|
|
76
|
+
"@deepseek-ai/dsh-fs-local": "0.2.2-rc.2",
|
|
77
|
+
"@deepseek-ai/dsh-subprocess": "0.2.2-rc.2"
|
|
73
78
|
}
|
|
74
79
|
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic-job adaptation for pwsh process handles — the shell-agnostic twin
|
|
3
|
+
* of `dsh-tool-bash`'s background adaptation: the terminal
|
|
4
|
+
* outcome the registry records and the pull sources it pumps.
|
|
5
|
+
*
|
|
6
|
+
* @module @deepseek-ai/dsh-tool-pwsh/background
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { SandboxMode } from '@deepseek-ai/dsh-sandbox'
|
|
10
|
+
import { escalationHintMarker, sandboxDenialMarker } from '@deepseek-ai/dsh-sandbox'
|
|
11
|
+
import type { ShellProcess, ShellSandboxInfo } from '@deepseek-ai/dsh-shell'
|
|
12
|
+
import type { JobChunk, JobHooks, JobOutcome, JobOutputSource } from '@deepseek-ai/dsh-jobs'
|
|
13
|
+
|
|
14
|
+
/** Job hooks plus the original error of a job that failed before its process produced an outcome. */
|
|
15
|
+
export interface ProcessJobHooks extends JobHooks {
|
|
16
|
+
/**
|
|
17
|
+
* The error that ended a `failed` job, kept with its own class and code;
|
|
18
|
+
* undefined while the job runs and for a completed or killed job.
|
|
19
|
+
* @returns the original failure, boxed so any thrown value is preserved.
|
|
20
|
+
*/
|
|
21
|
+
failure(): { error: unknown } | undefined
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* jscpd:ignore-start -- deliberate twin of dsh-tool-bash/background.ts (Agent Note). */
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Sandbox facts worth the terminal detail: a runner that never ran the
|
|
28
|
+
* command, or a denial (with the escalation hint this composition offers).
|
|
29
|
+
* @param sandbox - settled sandbox facts, when this was a confined process.
|
|
30
|
+
* @param escalationModes - escalation targets advertised by this composition.
|
|
31
|
+
* @returns the markers to append, oldest first.
|
|
32
|
+
*/
|
|
33
|
+
function sandboxNotes(sandbox: ShellSandboxInfo | undefined, escalationModes: readonly SandboxMode[]): string[] {
|
|
34
|
+
if (sandbox?.runnerFailed) {
|
|
35
|
+
return [`[sandbox: the sandbox runner itself failed under ${sandbox.mode} mode — the command did not run; this is a sandbox problem, not a command failure]`]
|
|
36
|
+
}
|
|
37
|
+
if (sandbox?.denied) {
|
|
38
|
+
const notes = [sandboxDenialMarker(sandbox.mode)]
|
|
39
|
+
if (escalationModes.length > 0) notes.push(escalationHintMarker('command'))
|
|
40
|
+
return notes
|
|
41
|
+
}
|
|
42
|
+
return []
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Map a settled background process onto the generic job-outcome vocabulary:
|
|
47
|
+
* `killed` stays `killed` (detail: the signal when one is known), everything
|
|
48
|
+
* else is `completed` with the exit code as detail. A nonzero command exit is
|
|
49
|
+
* reported, not failed, exactly like the foreground rendering. Sandbox facts
|
|
50
|
+
* join the detail, since a job's terminal reason is the one line every
|
|
51
|
+
* reader — the model's status line, the roster row — shows.
|
|
52
|
+
* @param proc - the settled process handle.
|
|
53
|
+
* @param escalationModes - escalation targets advertised by this composition.
|
|
54
|
+
* @returns the outcome for the `ctx.jobs` registration.
|
|
55
|
+
*/
|
|
56
|
+
export function processOutcome(proc: ShellProcess, escalationModes: readonly SandboxMode[] = []): JobOutcome {
|
|
57
|
+
// TODO(background-infrastructure-outcome): widen ShellProcess with an explicit
|
|
58
|
+
// infrastructure-failure outcome, then map spawn failures and
|
|
59
|
+
// sandbox.runnerFailed to job `failed`. The current contract aliases a spawn
|
|
60
|
+
// failure with a signal-less kill and a runner failure with an ordinary
|
|
61
|
+
// wrapper exit; real nonzero command exits must remain `completed`.
|
|
62
|
+
const base: JobOutcome = proc.status === 'killed'
|
|
63
|
+
? { status: 'killed', detail: proc.signal !== null ? `signal: ${proc.signal}` : 'killed before exit' }
|
|
64
|
+
: { status: 'completed', detail: `exit code: ${proc.exitCode ?? 0}` }
|
|
65
|
+
const notes = sandboxNotes(proc.sandbox, escalationModes)
|
|
66
|
+
return notes.length === 0 ? base : { ...base, detail: `${base.detail}; ${notes.join(' ')}` }
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The process's non-consuming stream readers as registry pull sources. They
|
|
71
|
+
* bind lazily because the process is spawned inside the starter, after the
|
|
72
|
+
* registry admitted the job; a read before the spawn yields nothing, and the
|
|
73
|
+
* pump keeps the model's consuming cursor untouched. A rejected spawn's
|
|
74
|
+
* stderr reader carries the provider's `subprocess failed before reporting an
|
|
75
|
+
* outcome: …` note.
|
|
76
|
+
* @param proc - the started process's observed streams, once the starter has spawned it.
|
|
77
|
+
* @returns one source per stream, stdout first.
|
|
78
|
+
*/
|
|
79
|
+
export function processSources(proc: () => Pick<ShellProcess, 'observed'> | undefined): JobOutputSource[] {
|
|
80
|
+
const source = (channel: 'stdout' | 'stderr'): JobOutputSource => ({
|
|
81
|
+
channel,
|
|
82
|
+
read: (fromByte) => {
|
|
83
|
+
const live = proc()
|
|
84
|
+
return live === undefined ? { text: '', nextOffset: fromByte, lossy: false } : live.observed[channel].readFrom(fromByte)
|
|
85
|
+
},
|
|
86
|
+
})
|
|
87
|
+
return [source('stdout'), source('stderr')]
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The ring chunks of one consuming registry read as the shell tools render a
|
|
92
|
+
* process read: stdout chunks in order, then every stderr chunk in one
|
|
93
|
+
* `[stderr]` section, so the output a foreground call hands over when it
|
|
94
|
+
* stops waiting reads exactly like the `job_output` reads that follow it.
|
|
95
|
+
* @param chunks - the chunks since the model cursor, in offset order.
|
|
96
|
+
* @returns the delta text, possibly empty.
|
|
97
|
+
*/
|
|
98
|
+
export function ringDelta(chunks: readonly JobChunk[]): string {
|
|
99
|
+
const out = chunks.filter(chunk => chunk.channel !== 'stderr').map(chunk => chunk.text).join('')
|
|
100
|
+
const err = chunks.filter(chunk => chunk.channel === 'stderr').map(chunk => chunk.text).join('')
|
|
101
|
+
const separator = out.length > 0 && !out.endsWith('\n') ? '\n' : ''
|
|
102
|
+
return out + (err.length > 0 ? `${separator}[stderr]\n${err}` : '')
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Adapt asynchronous shell preparation after job admission without exposing a partial process.
|
|
107
|
+
* @param start - starts the process with job-owned cancellation.
|
|
108
|
+
* @param outcome - projects the settled process into the job outcome.
|
|
109
|
+
* @returns synchronous job hooks whose completion includes preparation and process settlement,
|
|
110
|
+
* and the original error of a failed preparation for a caller that reports it.
|
|
111
|
+
*/
|
|
112
|
+
export function processJob(
|
|
113
|
+
start: (signal: AbortSignal) => Promise<ShellProcess>,
|
|
114
|
+
outcome: (process: ShellProcess) => JobOutcome,
|
|
115
|
+
): ProcessJobHooks {
|
|
116
|
+
const controller = new AbortController()
|
|
117
|
+
let process: ShellProcess | undefined
|
|
118
|
+
let failure: { error: unknown } | undefined
|
|
119
|
+
const done: Promise<JobOutcome> = (async () => {
|
|
120
|
+
try {
|
|
121
|
+
process = await start(controller.signal)
|
|
122
|
+
try {
|
|
123
|
+
if (controller.signal.aborted) process.kill()
|
|
124
|
+
} finally {
|
|
125
|
+
await process.done
|
|
126
|
+
}
|
|
127
|
+
return outcome(process)
|
|
128
|
+
} catch (error: unknown) {
|
|
129
|
+
const killed = controller.signal.aborted && process === undefined
|
|
130
|
+
if (!killed) failure = { error }
|
|
131
|
+
return {
|
|
132
|
+
status: killed ? 'killed' : 'failed',
|
|
133
|
+
detail: error instanceof Error ? error.message : String(error),
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
})()
|
|
137
|
+
return {
|
|
138
|
+
cancel: (reason) => {
|
|
139
|
+
if (controller.signal.aborted) return
|
|
140
|
+
controller.abort(reason)
|
|
141
|
+
process?.kill()
|
|
142
|
+
},
|
|
143
|
+
done,
|
|
144
|
+
failure: () => failure,
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/* jscpd:ignore-end */
|