dsh-code-security 0.3.1 → 0.3.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/lib/runner.js +8 -9
- package/package.json +1 -1
package/lib/runner.js
CHANGED
|
@@ -10,26 +10,25 @@ export function createSubprocessRunner(spawn, graceMs, defaultTimeoutMs) {
|
|
|
10
10
|
const timeoutMs = options?.timeoutMs ?? defaultTimeoutMs;
|
|
11
11
|
const controller = new AbortController();
|
|
12
12
|
const timer = setTimeout(() => controller.abort(new Error('git diff timed out')), timeoutMs);
|
|
13
|
-
let handle;
|
|
14
13
|
try {
|
|
15
|
-
handle = spawn({
|
|
14
|
+
const handle = spawn({
|
|
16
15
|
argv,
|
|
17
16
|
cwd: process.cwd(),
|
|
18
17
|
stdio: { stdin: 'ignore', stdout: { maxBytes: COLLECT_BYTES }, stderr: { maxBytes: COLLECT_BYTES } },
|
|
19
18
|
graceMs,
|
|
20
19
|
signal: controller.signal,
|
|
21
20
|
});
|
|
21
|
+
const outcome = await handle.done;
|
|
22
|
+
return {
|
|
23
|
+
exitCode: outcome.exitCode,
|
|
24
|
+
signal: outcome.signal,
|
|
25
|
+
stdout: handle.collected.stdout?.readFrom(0).text ?? '',
|
|
26
|
+
stderr: handle.collected.stderr?.readFrom(0).text ?? '',
|
|
27
|
+
};
|
|
22
28
|
}
|
|
23
29
|
finally {
|
|
24
30
|
clearTimeout(timer);
|
|
25
31
|
}
|
|
26
|
-
const outcome = await handle.done;
|
|
27
|
-
return {
|
|
28
|
-
exitCode: outcome.exitCode,
|
|
29
|
-
signal: outcome.signal,
|
|
30
|
-
stdout: handle.collected.stdout?.readFrom(0).text ?? '',
|
|
31
|
-
stderr: handle.collected.stderr?.readFrom(0).text ?? '',
|
|
32
|
-
};
|
|
33
32
|
},
|
|
34
33
|
};
|
|
35
34
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-code-security",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "DSH AI 代码安全审查插件:secure_scan/secure_diff/secure_fix_verify/secure_report/secure_export/secure_baseline/secure_deps/secure_policy_show/secure_policy_set 九工具,40+ 确定性规则、密钥熵检测、git diff/staged 审查、SARIF 导出、基线接受与 SBOM-lite,零运行时依赖。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|