@rosenfan/matrix 0.1.0 → 0.1.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/package.json +1 -1
- package/src/catalog.js +1 -1
- package/src/matt.js +14 -3
package/package.json
CHANGED
package/src/catalog.js
CHANGED
|
@@ -11,7 +11,7 @@ export const MATRIX_SKILLS = [
|
|
|
11
11
|
"matrix-archive", "matrix-hotfix", "matrix-tweak", "matrix-status", "matrix-claude"
|
|
12
12
|
];
|
|
13
13
|
export const MATT_SKILLS = [
|
|
14
|
-
"grill-with-docs", "domain-modeling", "research", "wayfinder", "prototype",
|
|
14
|
+
"grill-with-docs", "grilling", "domain-modeling", "research", "wayfinder", "prototype",
|
|
15
15
|
"codebase-design", "implement", "tdd", "code-review", "diagnosing-bugs",
|
|
16
16
|
"resolving-merge-conflicts", "improve-codebase-architecture"
|
|
17
17
|
];
|
package/src/matt.js
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
import { execFileSync } from "node:child_process";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
2
4
|
import { PLATFORMS, MATT_SKILLS } from "./catalog.js";
|
|
3
5
|
|
|
6
|
+
export function buildProcessInvocation({ command, args, platform = process.platform, nodeExecutable = process.execPath, npmCliPath }) {
|
|
7
|
+
if (platform !== "win32" || command !== "npx") return { executable: command, args, shell: false };
|
|
8
|
+
const candidates = [npmCliPath, process.env.npm_execpath, path.join(path.dirname(nodeExecutable), "node_modules", "npm", "bin", "npm-cli.js")].filter(Boolean);
|
|
9
|
+
const cli = candidates.find((candidate) => npmCliPath || fs.existsSync(candidate));
|
|
10
|
+
if (!cli) throw new Error("npm CLI was not found beside the Node runtime.");
|
|
11
|
+
const [yes, packageSpec, ...commandArgs] = args;
|
|
12
|
+
if (yes !== "--yes" || !packageSpec) throw new Error("Windows npx invocation must use fixed npm exec arguments.");
|
|
13
|
+
return { executable: nodeExecutable, args: [cli, "exec", yes, packageSpec, "--", ...commandArgs], shell: false };
|
|
14
|
+
}
|
|
15
|
+
|
|
4
16
|
export function defaultProcessRunner({ command, args, cwd, timeout }) {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
return execFileSync(executable, args, { cwd, stdio: "inherit", timeout, shell: process.platform === "win32" && command === "npx" });
|
|
17
|
+
const invocation = buildProcessInvocation({ command, args });
|
|
18
|
+
return execFileSync(invocation.executable, invocation.args, { cwd, stdio: "inherit", timeout, shell: invocation.shell });
|
|
8
19
|
}
|
|
9
20
|
|
|
10
21
|
export function createMattAdapter({ run = defaultProcessRunner } = {}) {
|