@minhpnq1807/contextos 0.5.6 → 0.5.7
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 +5 -0
- package/README.md +16 -0
- package/bin/ctx.js +12 -0
- package/package.json +1 -1
- package/plugins/ctx/lib/passthrough.js +50 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.7
|
|
4
|
+
|
|
5
|
+
- Adds thin passthrough commands `ctx ruler -- <args>` and `ctx skillshare -- <args>` for upstream admin/debug workflows without reimplementing those CLIs.
|
|
6
|
+
- Preserves upstream output and exit status for passthrough commands, with install hints when the upstream binary is missing.
|
|
7
|
+
|
|
3
8
|
## 0.5.6
|
|
4
9
|
|
|
5
10
|
- Adds visible `ctx install` progress from 0-100 so long model/file/skill embedding warmups no longer look stalled.
|
package/README.md
CHANGED
|
@@ -269,6 +269,20 @@ ctx sync --rules --no-import-codex-mcp
|
|
|
269
269
|
|
|
270
270
|
`ctx sync --rules` is project-scoped. It writes `.ruler/ruler.toml` in the current project and lets Ruler generate agent files from that project source of truth. ContextOS runtime history still follows the project-path isolation model described below.
|
|
271
271
|
|
|
272
|
+
## Upstream Passthrough
|
|
273
|
+
|
|
274
|
+
ContextOS exposes thin passthrough commands for Ruler and skillshare admin/debug workflows:
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
ctx ruler -- apply --agents codex,claude,antigravity
|
|
278
|
+
ctx ruler -- init
|
|
279
|
+
ctx skillshare -- status
|
|
280
|
+
ctx skillshare -- target list
|
|
281
|
+
ctx skillshare -- doctor
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Everything after `--` is forwarded unchanged to the upstream CLI. ContextOS does not reinterpret those args, and it preserves the upstream output and exit status. Use `ctx sync --rules` and `ctx sync --skills` for ContextOS-managed workflows; use passthrough when you need a native Ruler or skillshare command.
|
|
285
|
+
|
|
272
286
|
## Troubleshooting
|
|
273
287
|
|
|
274
288
|
### `ctx-mcp bridge socket not found`
|
|
@@ -324,6 +338,8 @@ This warning comes from a transitive dependency in the local embedding/WASM stac
|
|
|
324
338
|
| `ctx sync --skills --dry-run` | Previews skillshare sync. | You want to inspect behavior before changing skill directories. | Runs `skillshare sync --dry-run` and skips embedding rebuild. |
|
|
325
339
|
| `ctx sync --skills --no-collect` | Skips collecting existing agent skills into skillshare. | You already manage `~/.config/skillshare/skills` and only want to push it out. | Initializes/syncs skillshare without running `skillshare backup` or `skillshare collect --all`. |
|
|
326
340
|
| `ctx embeddings warm -- "task"` | Prepares local semantic embedding caches. | First install, CI smoke checks, or after changing AGENTS.md/project files/skills. | Loads/downloads `Xenova/all-MiniLM-L6-v2` and writes rule, file-path, and skill vectors to `~/.ctx/contextos/embeddings.db`. |
|
|
341
|
+
| `ctx ruler -- <args>` | Forwards args to the installed `ruler` CLI. | You need native Ruler commands such as `init`, `apply`, or `revert`. | Preserves Ruler stdout/stderr and exit status. |
|
|
342
|
+
| `ctx skillshare -- <args>` | Forwards args to the installed `skillshare` CLI. | You need native skillshare commands such as `status`, `target list`, `doctor`, `push`, or `pull`. | Preserves skillshare stdout/stderr and exit status. |
|
|
327
343
|
| `ctx --version` | Prints the installed ContextOS CLI version. | You want to confirm which npm version is being executed. | Prints the version from package metadata. |
|
|
328
344
|
|
|
329
345
|
## Runtime Files
|
package/bin/ctx.js
CHANGED
|
@@ -24,6 +24,7 @@ import { installAntigravityMcp } from "../plugins/ctx/lib/antigravity-mcp.js";
|
|
|
24
24
|
import { syncRules } from "../plugins/ctx/lib/ruler-sync.js";
|
|
25
25
|
import { syncSkills } from "../plugins/ctx/lib/skillshare-sync.js";
|
|
26
26
|
import { scanSkills, warmSkillEmbeddings } from "../plugins/ctx/lib/skill-discoverer.js";
|
|
27
|
+
import { parsePassthroughArgs, runPassthrough } from "../plugins/ctx/lib/passthrough.js";
|
|
27
28
|
|
|
28
29
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
29
30
|
const rootDir = path.resolve(__dirname, "..");
|
|
@@ -55,6 +56,8 @@ Usage:
|
|
|
55
56
|
ctx sync --skills --no-collect
|
|
56
57
|
ctx sync --skills --agents codex,claude,antigravity
|
|
57
58
|
ctx embeddings warm -- "task"
|
|
59
|
+
ctx ruler -- <ruler args>
|
|
60
|
+
ctx skillshare -- <skillshare args>
|
|
58
61
|
ctx --version
|
|
59
62
|
`;
|
|
60
63
|
}
|
|
@@ -451,6 +454,15 @@ try {
|
|
|
451
454
|
} else {
|
|
452
455
|
await syncRules({ cwd: process.cwd(), rootDir, args: args.slice(1) });
|
|
453
456
|
}
|
|
457
|
+
} else if (command === "ruler" || command === "skillshare") {
|
|
458
|
+
const passthrough = parsePassthroughArgs(args);
|
|
459
|
+
const result = runPassthrough(passthrough);
|
|
460
|
+
if (result.signal) {
|
|
461
|
+
console.error(`${passthrough.command} terminated by signal ${result.signal}`);
|
|
462
|
+
process.exitCode = 1;
|
|
463
|
+
} else {
|
|
464
|
+
process.exitCode = result.status;
|
|
465
|
+
}
|
|
454
466
|
} else {
|
|
455
467
|
throw new Error(`Unknown command: ${command}\n\n${usage()}`);
|
|
456
468
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
|
|
3
|
+
const SUPPORTED_COMMANDS = new Set(["ruler", "skillshare"]);
|
|
4
|
+
|
|
5
|
+
export function parsePassthroughArgs(args = []) {
|
|
6
|
+
const command = args[0];
|
|
7
|
+
if (!SUPPORTED_COMMANDS.has(command)) {
|
|
8
|
+
throw new Error(`Unsupported passthrough command: ${command || ""}`);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const separator = args.indexOf("--");
|
|
12
|
+
if (separator < 0) {
|
|
13
|
+
throw new Error(`Usage: ctx ${command} -- <${command} args>`);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
command,
|
|
18
|
+
args: args.slice(separator + 1)
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function runPassthrough({
|
|
23
|
+
command,
|
|
24
|
+
args = [],
|
|
25
|
+
spawn = spawnSync,
|
|
26
|
+
cwd = process.cwd(),
|
|
27
|
+
env = process.env
|
|
28
|
+
} = {}) {
|
|
29
|
+
if (!SUPPORTED_COMMANDS.has(command)) {
|
|
30
|
+
throw new Error(`Unsupported passthrough command: ${command || ""}`);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const result = spawn(command, args, {
|
|
34
|
+
cwd,
|
|
35
|
+
env,
|
|
36
|
+
stdio: "inherit"
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
if (result.error) {
|
|
40
|
+
const hint = command === "ruler"
|
|
41
|
+
? "Install it with `npm install -g @intellectronica/ruler`."
|
|
42
|
+
: "Install it with `curl -fsSL https://raw.githubusercontent.com/runkids/skillshare/main/install.sh | sh`.";
|
|
43
|
+
throw new Error(`Failed to run ${command}: ${result.error.message}. ${hint}`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
status: typeof result.status === "number" ? result.status : 1,
|
|
48
|
+
signal: result.signal || null
|
|
49
|
+
};
|
|
50
|
+
}
|