witnora 0.13.1 → 0.13.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.
@@ -130,9 +130,10 @@ async function detectReleaseScript(repository) {
130
130
  }
131
131
  async function runNpmScript(input) {
132
132
  return new Promise((resolveRun, rejectRun) => {
133
- const child = spawn(process.platform === "win32" ? "npm.cmd" : "npm", ["run", input.script], {
133
+ const launch = buildReleaseEvaluationLaunch(input.script);
134
+ const child = spawn(launch.command, launch.arguments, {
134
135
  cwd: input.repository,
135
- detached: process.platform !== "win32",
136
+ detached: launch.detached,
136
137
  shell: false,
137
138
  windowsHide: true,
138
139
  stdio: ["ignore", "pipe", "pipe"],
@@ -175,6 +176,27 @@ async function runNpmScript(input) {
175
176
  });
176
177
  });
177
178
  }
179
+ export function buildReleaseEvaluationLaunch(script, platform = process.platform, env = process.env) {
180
+ if (!RELEASE_SCRIPT_CANDIDATES.includes(script)) {
181
+ throw new Error(`Unsupported release evaluation script: ${script}`);
182
+ }
183
+ if (platform === "win32") {
184
+ const command = env.ComSpec ?? env.COMSPEC;
185
+ if (!command) {
186
+ throw new Error("Windows command processor is unavailable because ComSpec is not set.");
187
+ }
188
+ return {
189
+ command,
190
+ arguments: ["/d", "/s", "/c", "npm.cmd", "run", script],
191
+ detached: false,
192
+ };
193
+ }
194
+ return {
195
+ command: "npm",
196
+ arguments: ["run", script],
197
+ detached: true,
198
+ };
199
+ }
178
200
  function terminateProcessTree(pid, force = false) {
179
201
  if (!pid)
180
202
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "witnora",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "Independent assurance for covered agent action paths across models and frameworks.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",