role-os 2.3.1 → 2.6.0

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/bin/roleos.mjs CHANGED
@@ -1,225 +1,230 @@
1
- #!/usr/bin/env node
2
-
3
- import { readFileSync } from "node:fs";
4
- import { join, dirname } from "node:path";
5
- import { fileURLToPath } from "node:url";
6
- import { initCommand } from "../src/init.mjs";
7
- import { packetCommand } from "../src/packet.mjs";
8
- import { routeCommand } from "../src/route.mjs";
9
- import { reviewCommand } from "../src/review.mjs";
10
- import { statusCommand } from "../src/status.mjs";
11
- import { packsCommand } from "../src/packs-cmd.mjs";
12
- import { scaffoldClaude, doctor, formatDoctor } from "../src/session.mjs";
13
- import { artifactsCommand } from "../src/artifacts-cmd.mjs";
14
- import { missionCommand } from "../src/mission-cmd.mjs";
15
- import { auditCommand } from "../src/audit-cmd.mjs";
16
- import { swarmCommand } from "../src/swarm-cmd.mjs";
17
- import { startCommand } from "../src/entry-cmd.mjs";
18
- import {
19
- runCommand, resumeCommand, nextCommand, explainCommand,
20
- completeCommand, failCommand, retryCommand, rerouteCommand,
21
- escalateCommand, blockCommand, reopenCommand, reportCommand,
22
- frictionCommand,
23
- } from "../src/run-cmd.mjs";
24
-
25
- const __dirname = dirname(fileURLToPath(import.meta.url));
26
- const VERSION = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8")).version;
27
-
28
- function printHelp() {
29
- console.log(`
30
- roleos v${VERSION} — Role OS bootstrap CLI
31
-
32
- Usage:
33
- roleos start <task> Decide entry path: mission, pack, or free routing
34
- roleos run "<task>" Create and start a persistent run
35
- roleos run list List all runs
36
- roleos run show <id> Show run detail
37
- roleos resume [id] Resume an interrupted run
38
- roleos next Start the next step (or show what's next)
39
- roleos explain [id] Explain current run state
40
- roleos complete <artifact> [note] Complete the active step
41
- roleos fail <partial|failed> <reason> Fail the active step
42
- roleos retry <step-index> Retry a failed step
43
- roleos reroute <step> <role> <reason> Reroute a step to a different role
44
- roleos escalate <from> <to> <trigger> <action> Escalate between roles
45
- roleos block <step-index> <reason> Block a step
46
- roleos reopen <step-index> <reason> Reopen a completed step
47
- roleos report [id] Generate completion report
48
- roleos friction [id] Measure operator friction
49
- roleos init Scaffold Role OS into .claude/
50
- roleos init --force Update canonical files (protects context/)
51
- roleos packet new <type> Create a new packet (feature|integration|identity)
52
- roleos route <packet-file> [--verbose] Recommend the smallest valid chain
53
- roleos review <packet-file> <verdict> Record a review verdict
54
- roleos status Show active work, verdicts, and health
55
- roleos status --write Write .claude/status/index.md
56
- roleos status --json Output as JSON
57
- roleos packs list List all available team packs
58
- roleos packs suggest <packet-file> Suggest a pack for a packet
59
- roleos packs show <pack-key> Show full detail for a named pack
60
- roleos artifacts List all role artifact contracts
61
- roleos artifacts show <role> Show artifact contract for a role
62
- roleos artifacts validate <role> <file> Validate a file against a contract
63
- roleos artifacts chain <pack> Show pack handoff flow
64
- roleos audit Start a deep audit on the current repo
65
- roleos audit manifest Show the audit manifest
66
- roleos audit manifest --generate Generate a skeleton manifest from src/
67
- roleos audit status Show audit run progress
68
- roleos audit verify Verify manifest and audit outputs
69
- roleos swarm Start a dogfood swarm on the current repo
70
- roleos swarm manifest Show the swarm manifest
71
- roleos swarm manifest --generate Auto-detect domains and generate manifest
72
- roleos swarm status Show swarm run progress
73
- roleos swarm findings List findings by severity
74
- roleos swarm approve Approve the current feature gate
75
- roleos swarm verify Verify manifest and run state
76
- roleos mission list List all missions
77
- roleos mission show <key> Show full mission detail
78
- roleos mission suggest <text> Suggest a mission for a task
79
- roleos mission validate [key] Validate mission wiring
80
- roleos doctor Verify repo is wired for Role OS sessions
81
- roleos help Show this help
82
-
83
- Verdicts: accept | accept-with-notes | reject | blocked
84
- `);
85
- }
86
-
87
- /**
88
- * Structured error output. Matches shipcheck error shape:
89
- * code, message, hint, cause?, retryable?
90
- */
91
- function handleError(err) {
92
- const isUserError = err.exitCode === 1;
93
- const code = isUserError ? "USER_ERROR" : "RUNTIME_ERROR";
94
- const exitCode = isUserError ? 1 : 2;
95
-
96
- if (process.argv.includes("--debug")) {
97
- console.error(err.stack || err);
98
- } else {
99
- console.error(JSON.stringify({
100
- code,
101
- message: err.message,
102
- hint: err.hint || null,
103
- retryable: false,
104
- }));
105
- }
106
-
107
- process.exit(exitCode);
108
- }
109
-
110
- const command = process.argv[2] || "help";
111
- const args = process.argv.slice(3);
112
-
113
- try {
114
- switch (command) {
115
- case "start":
116
- await startCommand(args);
117
- break;
118
- case "init":
119
- if (args[0] === "claude") {
120
- const force = args.includes("--force");
121
- const result = scaffoldClaude(process.cwd(), { force });
122
- if (result.created.length > 0) {
123
- console.log(`Created:`);
124
- result.created.forEach(f => console.log(` + ${f}`));
125
- }
126
- if (result.skipped.length > 0) {
127
- console.log(`Skipped:`);
128
- result.skipped.forEach(f => console.log(` ~ ${f}`));
129
- }
130
- console.log(`\nDone. Claude Code will now use Role OS for routing.\nRun: roleos doctor to verify.`);
131
- } else {
132
- await initCommand(args);
133
- }
134
- break;
135
- case "doctor": {
136
- const result = doctor(process.cwd());
137
- console.log(formatDoctor(result));
138
- if (!result.healthy) process.exit(1);
139
- break;
140
- }
141
- case "packet":
142
- await packetCommand(args);
143
- break;
144
- case "route":
145
- await routeCommand(args);
146
- break;
147
- case "review":
148
- await reviewCommand(args);
149
- break;
150
- case "status":
151
- await statusCommand(args);
152
- break;
153
- case "packs":
154
- await packsCommand(args);
155
- break;
156
- case "artifacts":
157
- await artifactsCommand(args);
158
- break;
159
- case "run":
160
- await runCommand(args);
161
- break;
162
- case "resume":
163
- await resumeCommand(args);
164
- break;
165
- case "next":
166
- await nextCommand(args);
167
- break;
168
- case "explain":
169
- await explainCommand(args);
170
- break;
171
- case "complete":
172
- await completeCommand(args);
173
- break;
174
- case "fail":
175
- await failCommand(args);
176
- break;
177
- case "retry":
178
- await retryCommand(args);
179
- break;
180
- case "reroute":
181
- await rerouteCommand(args);
182
- break;
183
- case "escalate":
184
- await escalateCommand(args);
185
- break;
186
- case "block":
187
- await blockCommand(args);
188
- break;
189
- case "reopen":
190
- await reopenCommand(args);
191
- break;
192
- case "report":
193
- await reportCommand(args);
194
- break;
195
- case "friction":
196
- await frictionCommand(args);
197
- break;
198
- case "audit":
199
- await auditCommand(args);
200
- break;
201
- case "swarm":
202
- await swarmCommand(args);
203
- break;
204
- case "mission":
205
- await missionCommand(args);
206
- break;
207
- case "help":
208
- case "--help":
209
- case "-h":
210
- printHelp();
211
- break;
212
- case "--version":
213
- case "-v":
214
- console.log(`roleos v${VERSION}`);
215
- break;
216
- default: {
217
- const err = new Error(`Unknown command: ${command}`);
218
- err.exitCode = 1;
219
- err.hint = "Run 'roleos help' for usage.";
220
- throw err;
221
- }
222
- }
223
- } catch (err) {
224
- handleError(err);
225
- }
1
+ #!/usr/bin/env node
2
+
3
+ import { readFileSync } from "node:fs";
4
+ import { join, dirname } from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+ import { initCommand } from "../src/init.mjs";
7
+ import { packetCommand } from "../src/packet.mjs";
8
+ import { routeCommand } from "../src/route.mjs";
9
+ import { reviewCommand } from "../src/review.mjs";
10
+ import { statusCommand } from "../src/status.mjs";
11
+ import { packsCommand } from "../src/packs-cmd.mjs";
12
+ import { scaffoldClaude, doctor, formatDoctor } from "../src/session.mjs";
13
+ import { artifactsCommand } from "../src/artifacts-cmd.mjs";
14
+ import { missionCommand } from "../src/mission-cmd.mjs";
15
+ import { auditCommand } from "../src/audit-cmd.mjs";
16
+ import { swarmCommand } from "../src/swarm-cmd.mjs";
17
+ import { startCommand } from "../src/entry-cmd.mjs";
18
+ import { verifyCitationsCommand } from "../src/verify-citations-cmd.mjs";
19
+ import {
20
+ runCommand, resumeCommand, nextCommand, explainCommand,
21
+ completeCommand, failCommand, retryCommand, rerouteCommand,
22
+ escalateCommand, blockCommand, reopenCommand, reportCommand,
23
+ frictionCommand,
24
+ } from "../src/run-cmd.mjs";
25
+
26
+ const __dirname = dirname(fileURLToPath(import.meta.url));
27
+ const VERSION = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8")).version;
28
+
29
+ function printHelp() {
30
+ console.log(`
31
+ roleos v${VERSION} — Role OS bootstrap CLI
32
+
33
+ Usage:
34
+ roleos start <task> Decide entry path: mission, pack, or free routing
35
+ roleos run "<task>" Create and start a persistent run
36
+ roleos run list List all runs
37
+ roleos run show <id> Show run detail
38
+ roleos resume [id] Resume an interrupted run
39
+ roleos next Start the next step (or show what's next)
40
+ roleos explain [id] Explain current run state
41
+ roleos complete <artifact> [note] Complete the active step
42
+ roleos fail <partial|failed> <reason> Fail the active step
43
+ roleos retry <step-index> Retry a failed step
44
+ roleos reroute <step> <role> <reason> Reroute a step to a different role
45
+ roleos escalate <from> <to> <trigger> <action> Escalate between roles
46
+ roleos block <step-index> <reason> Block a step
47
+ roleos reopen <step-index> <reason> Reopen a completed step
48
+ roleos report [id] Generate completion report
49
+ roleos friction [id] Measure operator friction
50
+ roleos init Scaffold Role OS into .claude/
51
+ roleos init --force Update canonical files (protects context/)
52
+ roleos packet new <type> Create a new packet (feature|integration|identity)
53
+ roleos route <packet-file> [--verbose] Recommend the smallest valid chain
54
+ roleos review <packet-file> <verdict> Record a review verdict
55
+ roleos status Show active work, verdicts, and health
56
+ roleos status --write Write .claude/status/index.md
57
+ roleos status --json Output as JSON
58
+ roleos packs list List all available team packs
59
+ roleos packs suggest <packet-file> Suggest a pack for a packet
60
+ roleos packs show <pack-key> Show full detail for a named pack
61
+ roleos artifacts List all role artifact contracts
62
+ roleos artifacts show <role> Show artifact contract for a role
63
+ roleos artifacts validate <role> <file> Validate a file against a contract
64
+ roleos artifacts chain <pack> Show pack handoff flow
65
+ roleos audit Start a deep audit on the current repo
66
+ roleos audit manifest Show the audit manifest
67
+ roleos audit manifest --generate Generate a skeleton manifest from src/
68
+ roleos audit status Show audit run progress
69
+ roleos audit verify Verify manifest and audit outputs
70
+ roleos swarm Start a dogfood swarm on the current repo
71
+ roleos swarm manifest Show the swarm manifest
72
+ roleos swarm manifest --generate Auto-detect domains and generate manifest
73
+ roleos swarm status Show swarm run progress
74
+ roleos swarm findings List findings by severity
75
+ roleos swarm approve Approve the current feature gate
76
+ roleos swarm verify Verify manifest and run state
77
+ roleos verify-citations <dispatch> Verify a research dispatch's citations via prism (gate)
78
+ roleos mission list List all missions
79
+ roleos mission show <key> Show full mission detail
80
+ roleos mission suggest <text> Suggest a mission for a task
81
+ roleos mission validate [key] Validate mission wiring
82
+ roleos doctor Verify repo is wired for Role OS sessions
83
+ roleos help Show this help
84
+
85
+ Verdicts: accept | accept-with-notes | reject | blocked
86
+ `);
87
+ }
88
+
89
+ /**
90
+ * Structured error output. Matches shipcheck error shape:
91
+ * code, message, hint, cause?, retryable?
92
+ */
93
+ function handleError(err) {
94
+ const isUserError = err.exitCode === 1;
95
+ const code = isUserError ? "USER_ERROR" : "RUNTIME_ERROR";
96
+ const exitCode = isUserError ? 1 : 2;
97
+
98
+ if (process.argv.includes("--debug")) {
99
+ console.error(err.stack || err);
100
+ } else {
101
+ console.error(JSON.stringify({
102
+ code,
103
+ message: err.message,
104
+ hint: err.hint || null,
105
+ retryable: false,
106
+ }));
107
+ }
108
+
109
+ process.exit(exitCode);
110
+ }
111
+
112
+ const command = process.argv[2] || "help";
113
+ const args = process.argv.slice(3);
114
+
115
+ try {
116
+ switch (command) {
117
+ case "start":
118
+ await startCommand(args);
119
+ break;
120
+ case "init":
121
+ if (args[0] === "claude") {
122
+ const force = args.includes("--force");
123
+ const result = scaffoldClaude(process.cwd(), { force });
124
+ if (result.created.length > 0) {
125
+ console.log(`Created:`);
126
+ result.created.forEach(f => console.log(` + ${f}`));
127
+ }
128
+ if (result.skipped.length > 0) {
129
+ console.log(`Skipped:`);
130
+ result.skipped.forEach(f => console.log(` ~ ${f}`));
131
+ }
132
+ console.log(`\nDone. Claude Code will now use Role OS for routing.\nRun: roleos doctor to verify.`);
133
+ } else {
134
+ await initCommand(args);
135
+ }
136
+ break;
137
+ case "doctor": {
138
+ const result = doctor(process.cwd());
139
+ console.log(formatDoctor(result));
140
+ if (!result.healthy) process.exit(1);
141
+ break;
142
+ }
143
+ case "packet":
144
+ await packetCommand(args);
145
+ break;
146
+ case "route":
147
+ await routeCommand(args);
148
+ break;
149
+ case "review":
150
+ await reviewCommand(args);
151
+ break;
152
+ case "status":
153
+ await statusCommand(args);
154
+ break;
155
+ case "packs":
156
+ await packsCommand(args);
157
+ break;
158
+ case "artifacts":
159
+ await artifactsCommand(args);
160
+ break;
161
+ case "run":
162
+ await runCommand(args);
163
+ break;
164
+ case "resume":
165
+ await resumeCommand(args);
166
+ break;
167
+ case "next":
168
+ await nextCommand(args);
169
+ break;
170
+ case "explain":
171
+ await explainCommand(args);
172
+ break;
173
+ case "complete":
174
+ await completeCommand(args);
175
+ break;
176
+ case "fail":
177
+ await failCommand(args);
178
+ break;
179
+ case "retry":
180
+ await retryCommand(args);
181
+ break;
182
+ case "reroute":
183
+ await rerouteCommand(args);
184
+ break;
185
+ case "escalate":
186
+ await escalateCommand(args);
187
+ break;
188
+ case "block":
189
+ await blockCommand(args);
190
+ break;
191
+ case "reopen":
192
+ await reopenCommand(args);
193
+ break;
194
+ case "report":
195
+ await reportCommand(args);
196
+ break;
197
+ case "friction":
198
+ await frictionCommand(args);
199
+ break;
200
+ case "audit":
201
+ await auditCommand(args);
202
+ break;
203
+ case "swarm":
204
+ await swarmCommand(args);
205
+ break;
206
+ case "verify-citations":
207
+ await verifyCitationsCommand(args);
208
+ break;
209
+ case "mission":
210
+ await missionCommand(args);
211
+ break;
212
+ case "help":
213
+ case "--help":
214
+ case "-h":
215
+ printHelp();
216
+ break;
217
+ case "--version":
218
+ case "-v":
219
+ console.log(`roleos v${VERSION}`);
220
+ break;
221
+ default: {
222
+ const err = new Error(`Unknown command: ${command}`);
223
+ err.exitCode = 1;
224
+ err.hint = "Run 'roleos help' for usage.";
225
+ throw err;
226
+ }
227
+ }
228
+ } catch (err) {
229
+ handleError(err);
230
+ }
package/package.json CHANGED
@@ -1,51 +1,51 @@
1
- {
2
- "name": "role-os",
3
- "version": "2.3.1",
4
- "description": "Role OS — a multi-Claude operating system where 61 specialized roles execute work through contracts, conflict detection, escalation, and structured evidence. 10 team packs, 9 missions including dogfood swarm (multi-pass convergence), deep audit with manifest-scaled dynamic dispatch, and brainstorm with traceable disagreement.",
5
- "homepage": "https://mcp-tool-shop-org.github.io/role-os/",
6
- "bugs": {
7
- "url": "https://github.com/mcp-tool-shop-org/role-os/issues"
8
- },
9
- "type": "module",
10
- "bin": {
11
- "roleos": "bin/roleos.mjs"
12
- },
13
- "files": [
14
- "bin",
15
- "src",
16
- "starter-pack",
17
- "README.md",
18
- "CHANGELOG.md",
19
- "LICENSE"
20
- ],
21
- "scripts": {
22
- "test": "node --test test/*.test.mjs",
23
- "verify": "node --test test/*.test.mjs && node bin/roleos.mjs help && echo '✓ verify passed'"
24
- },
25
- "engines": {
26
- "node": ">=18.0.0"
27
- },
28
- "author": "mcp-tool-shop <64996768+mcp-tool-shop@users.noreply.github.com>",
29
- "license": "MIT",
30
- "repository": {
31
- "type": "git",
32
- "url": "https://github.com/mcp-tool-shop-org/role-os.git"
33
- },
34
- "keywords": [
35
- "role-os",
36
- "agents",
37
- "contracts",
38
- "handoffs",
39
- "review",
40
- "workflow",
41
- "multi-agent",
42
- "ai-workflow",
43
- "developer-tools",
44
- "role-contracts",
45
- "claude",
46
- "multi-claude"
47
- ],
48
- "publishConfig": {
49
- "registry": "https://registry.npmjs.org"
50
- }
51
- }
1
+ {
2
+ "name": "role-os",
3
+ "version": "2.6.0",
4
+ "description": "Role OS — a multi-Claude operating system where 61 specialized roles execute work through contracts, conflict detection, escalation, and structured evidence. 10 team packs, 9 missions including dogfood swarm (multi-pass convergence), deep audit with manifest-scaled dynamic dispatch, and brainstorm with traceable disagreement.",
5
+ "homepage": "https://mcp-tool-shop-org.github.io/role-os/",
6
+ "bugs": {
7
+ "url": "https://github.com/mcp-tool-shop-org/role-os/issues"
8
+ },
9
+ "type": "module",
10
+ "bin": {
11
+ "roleos": "bin/roleos.mjs"
12
+ },
13
+ "files": [
14
+ "bin",
15
+ "src",
16
+ "starter-pack",
17
+ "README.md",
18
+ "CHANGELOG.md",
19
+ "LICENSE"
20
+ ],
21
+ "scripts": {
22
+ "test": "node --test test/*.test.mjs",
23
+ "verify": "node --test test/*.test.mjs && node bin/roleos.mjs help && echo '✓ verify passed'"
24
+ },
25
+ "engines": {
26
+ "node": ">=18.0.0"
27
+ },
28
+ "author": "mcp-tool-shop <64996768+mcp-tool-shop@users.noreply.github.com>",
29
+ "license": "MIT",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://github.com/mcp-tool-shop-org/role-os.git"
33
+ },
34
+ "keywords": [
35
+ "role-os",
36
+ "agents",
37
+ "contracts",
38
+ "handoffs",
39
+ "review",
40
+ "workflow",
41
+ "multi-agent",
42
+ "ai-workflow",
43
+ "developer-tools",
44
+ "role-contracts",
45
+ "claude",
46
+ "multi-claude"
47
+ ],
48
+ "publishConfig": {
49
+ "registry": "https://registry.npmjs.org"
50
+ }
51
+ }