@minhpnq1807/contextos 0.5.30 → 0.5.31
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.31
|
|
4
|
+
|
|
5
|
+
- **Complete stdio audit — eliminate all output leakage:** Changed every remaining `stdio: "inherit"` in `skillshare-sync.js` and `ruler-sync.js` to `stdio: "pipe"`. When subprocess calls use `inherit`, child processes write directly to the parent's fd — bypassing both `console.log` and `process.stderr.write` interception in `captureSetupOutput`. With `pipe`, all subprocess output is captured as return values and re-emitted through `console.log`, ensuring the `◇`/`│` formatting is applied consistently. Also changed `runShell` default from `"inherit"` to `"pipe"` to prevent future regressions.
|
|
6
|
+
|
|
3
7
|
## 0.5.30
|
|
4
8
|
|
|
5
9
|
- **Fix Windows skillshare post-install hang:** After the PowerShell installer adds skillshare to PATH, the current Node.js process still has the old `process.env.PATH`. Now injects the known Windows install directory (`%LOCALAPPDATA%\\Programs\\skillshare`) into `process.env.PATH` immediately after install, so `skillshare --version`, `skillshare init`, and subsequent calls resolve without restarting the terminal.
|
package/package.json
CHANGED
|
@@ -94,13 +94,13 @@ export async function installRuler({ run = runCommand, yes = false, dryRun = fal
|
|
|
94
94
|
if (!accepted) {
|
|
95
95
|
throw new Error("Ruler is required for ctx sync --rules. Install it with `npm install -g @intellectronica/ruler` or rerun with --yes.");
|
|
96
96
|
}
|
|
97
|
-
run("npm", ["install", "-g", "@intellectronica/ruler"], { stdio: "
|
|
97
|
+
run("npm", ["install", "-g", "@intellectronica/ruler"], { stdio: "pipe", dryRun });
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
export function ensureRulerInit({ cwd = process.cwd(), run = runCommand, dryRun = false } = {}) {
|
|
101
101
|
const tomlPath = rulerTomlPath(cwd);
|
|
102
102
|
if (fs.existsSync(tomlPath)) return { created: false, tomlPath };
|
|
103
|
-
run("ruler", ["init"], { cwd, stdio: "
|
|
103
|
+
run("ruler", ["init"], { cwd, stdio: "pipe", dryRun });
|
|
104
104
|
return { created: true, tomlPath };
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -444,7 +444,7 @@ export function injectCtxMcp({ tomlPath, mcpServerPath, agents = DEFAULT_AGENTS,
|
|
|
444
444
|
}
|
|
445
445
|
|
|
446
446
|
export function runRulerApply({ agents = DEFAULT_AGENTS, cwd = process.cwd(), run = runCommand, dryRun = false } = {}) {
|
|
447
|
-
run("ruler", ["apply", "--agents", normalizeAgentList(agents).join(",")], { cwd, stdio: "
|
|
447
|
+
run("ruler", ["apply", "--agents", normalizeAgentList(agents).join(",")], { cwd, stdio: "pipe", dryRun });
|
|
448
448
|
}
|
|
449
449
|
|
|
450
450
|
function fileContains(filePath, pattern) {
|
|
@@ -25,7 +25,7 @@ function runCommand(command, args = [], { cwd = process.cwd(), stdio = "pipe", d
|
|
|
25
25
|
return { stdout: stdout || "" };
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function runShell(command, { cwd = process.cwd(), stdio = "
|
|
28
|
+
function runShell(command, { cwd = process.cwd(), stdio = "pipe", dryRun = false } = {}) {
|
|
29
29
|
if (dryRun) return { stdout: "", skipped: true };
|
|
30
30
|
const stdout = execSync(command, { cwd, stdio, encoding: "utf8" });
|
|
31
31
|
return { stdout: stdout || "" };
|
|
@@ -120,7 +120,7 @@ export async function installSkillshare({
|
|
|
120
120
|
|
|
121
121
|
const osName = detectOS(platform);
|
|
122
122
|
if (osName === "windows") {
|
|
123
|
-
runShellCommand(`powershell -NoProfile -ExecutionPolicy Bypass -Command "irm ${INSTALL_PS_URL} | iex"`, { stdio: "
|
|
123
|
+
runShellCommand(`powershell -NoProfile -ExecutionPolicy Bypass -Command "irm ${INSTALL_PS_URL} | iex"`, { stdio: "pipe", dryRun });
|
|
124
124
|
// The installer adds to the system PATH, but the current Node process
|
|
125
125
|
// still has the old PATH. Inject the known install dir so subsequent
|
|
126
126
|
// skillshare calls in this session can resolve the binary.
|
|
@@ -129,7 +129,7 @@ export async function installSkillshare({
|
|
|
129
129
|
process.env.PATH = `${winInstallDir}${path.delimiter}${process.env.PATH}`;
|
|
130
130
|
}
|
|
131
131
|
} else {
|
|
132
|
-
runShellCommand(`curl -fsSL ${INSTALL_SH_URL} | sh`, { stdio: "
|
|
132
|
+
runShellCommand(`curl -fsSL ${INSTALL_SH_URL} | sh`, { stdio: "pipe", dryRun });
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
const check = checkSkillshareInstalled({ run });
|
|
@@ -352,13 +352,13 @@ export async function syncSkills({
|
|
|
352
352
|
logger("[ctx] No existing skills found.");
|
|
353
353
|
}
|
|
354
354
|
|
|
355
|
-
run("skillshare", ["init"], { cwd, stdio: "
|
|
355
|
+
run("skillshare", ["init"], { cwd, stdio: "pipe", dryRun: options.dryRun });
|
|
356
356
|
logger(statusLine("Initializing skillshare...", options.dryRun ? "dry-run" : "✓ initialized"));
|
|
357
357
|
|
|
358
358
|
if (existing.length && !options.noCollect) {
|
|
359
|
-
run("skillshare", ["backup"], { cwd, stdio: "
|
|
359
|
+
run("skillshare", ["backup"], { cwd, stdio: "pipe", dryRun: options.dryRun });
|
|
360
360
|
logger(statusLine("Backing up...", options.dryRun ? "dry-run" : "✓ backup created"));
|
|
361
|
-
run("skillshare", ["collect", "--all"], { cwd, stdio: "
|
|
361
|
+
run("skillshare", ["collect", "--all"], { cwd, stdio: "pipe", dryRun: options.dryRun });
|
|
362
362
|
const collected = countSkillFiles(skillshareSourceDir({ home }));
|
|
363
363
|
logger(statusLine("Collecting from all agents...", options.dryRun ? "dry-run" : `✓ ${collected} skills collected`));
|
|
364
364
|
}
|