@minhpnq1807/contextos 0.5.29 → 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,13 @@
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
+
7
+ ## 0.5.30
8
+
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.
10
+
3
11
  ## 0.5.29
4
12
 
5
13
  - **Fix Windows skillshare install `iex` not recognized:** The PowerShell pipe `irm ... | iex` was being intercepted by `cmd.exe` (the outer shell via `shell: true`) instead of PowerShell. Switched to `execSync` with properly double-quoted `-Command` argument so the pipe stays inside PowerShell's scope.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minhpnq1807/contextos",
3
- "version": "0.5.29",
3
+ "version": "0.5.31",
4
4
  "description": "Task-aware AGENTS.md context injection and compliance reporting for Codex, Claude Code, and Antigravity.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ctx",
3
- "version": "0.1.6",
3
+ "version": "0.5.31",
4
4
  "description": "Inject task-relevant AGENTS.md rules into Codex through plugin hooks.",
5
5
  "author": {
6
6
  "name": "ContextOS"
@@ -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: "inherit", dryRun });
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: "inherit", dryRun });
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: "inherit", dryRun });
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 = "inherit", dryRun = false } = {}) {
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,9 +120,16 @@ 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: "inherit", dryRun });
123
+ runShellCommand(`powershell -NoProfile -ExecutionPolicy Bypass -Command "irm ${INSTALL_PS_URL} | iex"`, { stdio: "pipe", dryRun });
124
+ // The installer adds to the system PATH, but the current Node process
125
+ // still has the old PATH. Inject the known install dir so subsequent
126
+ // skillshare calls in this session can resolve the binary.
127
+ const winInstallDir = path.join(os.homedir(), "AppData", "Local", "Programs", "skillshare");
128
+ if (!dryRun && !process.env.PATH.includes(winInstallDir)) {
129
+ process.env.PATH = `${winInstallDir}${path.delimiter}${process.env.PATH}`;
130
+ }
124
131
  } else {
125
- runShellCommand(`curl -fsSL ${INSTALL_SH_URL} | sh`, { stdio: "inherit", dryRun });
132
+ runShellCommand(`curl -fsSL ${INSTALL_SH_URL} | sh`, { stdio: "pipe", dryRun });
126
133
  }
127
134
 
128
135
  const check = checkSkillshareInstalled({ run });
@@ -345,13 +352,13 @@ export async function syncSkills({
345
352
  logger("[ctx] No existing skills found.");
346
353
  }
347
354
 
348
- run("skillshare", ["init"], { cwd, stdio: "inherit", dryRun: options.dryRun });
355
+ run("skillshare", ["init"], { cwd, stdio: "pipe", dryRun: options.dryRun });
349
356
  logger(statusLine("Initializing skillshare...", options.dryRun ? "dry-run" : "✓ initialized"));
350
357
 
351
358
  if (existing.length && !options.noCollect) {
352
- run("skillshare", ["backup"], { cwd, stdio: "inherit", dryRun: options.dryRun });
359
+ run("skillshare", ["backup"], { cwd, stdio: "pipe", dryRun: options.dryRun });
353
360
  logger(statusLine("Backing up...", options.dryRun ? "dry-run" : "✓ backup created"));
354
- run("skillshare", ["collect", "--all"], { cwd, stdio: "inherit", dryRun: options.dryRun });
361
+ run("skillshare", ["collect", "--all"], { cwd, stdio: "pipe", dryRun: options.dryRun });
355
362
  const collected = countSkillFiles(skillshareSourceDir({ home }));
356
363
  logger(statusLine("Collecting from all agents...", options.dryRun ? "dry-run" : `✓ ${collected} skills collected`));
357
364
  }