role-os 1.9.0 → 2.0.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/CHANGELOG.md +332 -297
- package/README.es.md +250 -160
- package/README.fr.md +250 -160
- package/README.hi.md +250 -160
- package/README.it.md +250 -160
- package/README.ja.md +250 -160
- package/README.md +287 -250
- package/README.pt-BR.md +250 -160
- package/README.zh.md +250 -160
- package/bin/roleos.mjs +205 -145
- package/package.json +51 -51
- package/src/run-cmd.mjs +405 -0
- package/src/run.mjs +949 -0
package/bin/roleos.mjs
CHANGED
|
@@ -1,145 +1,205 @@
|
|
|
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 { startCommand } from "../src/entry-cmd.mjs";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
roleos
|
|
32
|
-
roleos
|
|
33
|
-
roleos
|
|
34
|
-
roleos
|
|
35
|
-
roleos
|
|
36
|
-
roleos
|
|
37
|
-
roleos
|
|
38
|
-
roleos
|
|
39
|
-
roleos
|
|
40
|
-
roleos
|
|
41
|
-
roleos
|
|
42
|
-
roleos
|
|
43
|
-
roleos
|
|
44
|
-
roleos
|
|
45
|
-
roleos
|
|
46
|
-
roleos
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
break;
|
|
121
|
-
case "
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
case "
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
case "
|
|
134
|
-
|
|
135
|
-
break;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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 { startCommand } from "../src/entry-cmd.mjs";
|
|
16
|
+
import {
|
|
17
|
+
runCommand, resumeCommand, nextCommand, explainCommand,
|
|
18
|
+
completeCommand, failCommand, retryCommand, rerouteCommand,
|
|
19
|
+
escalateCommand, blockCommand, reopenCommand, reportCommand,
|
|
20
|
+
frictionCommand,
|
|
21
|
+
} from "../src/run-cmd.mjs";
|
|
22
|
+
|
|
23
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
24
|
+
const VERSION = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8")).version;
|
|
25
|
+
|
|
26
|
+
function printHelp() {
|
|
27
|
+
console.log(`
|
|
28
|
+
roleos v${VERSION} — Role OS bootstrap CLI
|
|
29
|
+
|
|
30
|
+
Usage:
|
|
31
|
+
roleos start <task> Decide entry path: mission, pack, or free routing
|
|
32
|
+
roleos run "<task>" Create and start a persistent run
|
|
33
|
+
roleos run list List all runs
|
|
34
|
+
roleos run show <id> Show run detail
|
|
35
|
+
roleos resume [id] Resume an interrupted run
|
|
36
|
+
roleos next Start the next step (or show what's next)
|
|
37
|
+
roleos explain [id] Explain current run state
|
|
38
|
+
roleos complete <artifact> [note] Complete the active step
|
|
39
|
+
roleos fail <partial|failed> <reason> Fail the active step
|
|
40
|
+
roleos retry <step-index> Retry a failed step
|
|
41
|
+
roleos reroute <step> <role> <reason> Reroute a step to a different role
|
|
42
|
+
roleos escalate <from> <to> <trigger> <action> Escalate between roles
|
|
43
|
+
roleos block <step-index> <reason> Block a step
|
|
44
|
+
roleos reopen <step-index> <reason> Reopen a completed step
|
|
45
|
+
roleos report [id] Generate completion report
|
|
46
|
+
roleos friction [id] Measure operator friction
|
|
47
|
+
roleos init Scaffold Role OS into .claude/
|
|
48
|
+
roleos init --force Update canonical files (protects context/)
|
|
49
|
+
roleos packet new <type> Create a new packet (feature|integration|identity)
|
|
50
|
+
roleos route <packet-file> [--verbose] Recommend the smallest valid chain
|
|
51
|
+
roleos review <packet-file> <verdict> Record a review verdict
|
|
52
|
+
roleos status Show active work, verdicts, and health
|
|
53
|
+
roleos status --write Write .claude/status/index.md
|
|
54
|
+
roleos status --json Output as JSON
|
|
55
|
+
roleos packs list List all available team packs
|
|
56
|
+
roleos packs suggest <packet-file> Suggest a pack for a packet
|
|
57
|
+
roleos packs show <pack-key> Show full detail for a named pack
|
|
58
|
+
roleos artifacts List all role artifact contracts
|
|
59
|
+
roleos artifacts show <role> Show artifact contract for a role
|
|
60
|
+
roleos artifacts validate <role> <file> Validate a file against a contract
|
|
61
|
+
roleos artifacts chain <pack> Show pack handoff flow
|
|
62
|
+
roleos mission list List all missions
|
|
63
|
+
roleos mission show <key> Show full mission detail
|
|
64
|
+
roleos mission suggest <text> Suggest a mission for a task
|
|
65
|
+
roleos mission validate [key] Validate mission wiring
|
|
66
|
+
roleos doctor Verify repo is wired for Role OS sessions
|
|
67
|
+
roleos help Show this help
|
|
68
|
+
|
|
69
|
+
Verdicts: accept | accept-with-notes | reject | blocked
|
|
70
|
+
`);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Structured error output. Matches shipcheck error shape:
|
|
75
|
+
* code, message, hint, cause?, retryable?
|
|
76
|
+
*/
|
|
77
|
+
function handleError(err) {
|
|
78
|
+
const isUserError = err.exitCode === 1;
|
|
79
|
+
const code = isUserError ? "USER_ERROR" : "RUNTIME_ERROR";
|
|
80
|
+
const exitCode = isUserError ? 1 : 2;
|
|
81
|
+
|
|
82
|
+
if (process.argv.includes("--debug")) {
|
|
83
|
+
console.error(err.stack || err);
|
|
84
|
+
} else {
|
|
85
|
+
console.error(JSON.stringify({
|
|
86
|
+
code,
|
|
87
|
+
message: err.message,
|
|
88
|
+
hint: err.hint || null,
|
|
89
|
+
retryable: false,
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
process.exit(exitCode);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const command = process.argv[2] || "help";
|
|
97
|
+
const args = process.argv.slice(3);
|
|
98
|
+
|
|
99
|
+
try {
|
|
100
|
+
switch (command) {
|
|
101
|
+
case "start":
|
|
102
|
+
await startCommand(args);
|
|
103
|
+
break;
|
|
104
|
+
case "init":
|
|
105
|
+
if (args[0] === "claude") {
|
|
106
|
+
const force = args.includes("--force");
|
|
107
|
+
const result = scaffoldClaude(process.cwd(), { force });
|
|
108
|
+
if (result.created.length > 0) {
|
|
109
|
+
console.log(`Created:`);
|
|
110
|
+
result.created.forEach(f => console.log(` + ${f}`));
|
|
111
|
+
}
|
|
112
|
+
if (result.skipped.length > 0) {
|
|
113
|
+
console.log(`Skipped:`);
|
|
114
|
+
result.skipped.forEach(f => console.log(` ~ ${f}`));
|
|
115
|
+
}
|
|
116
|
+
console.log(`\nDone. Claude Code will now use Role OS for routing.\nRun: roleos doctor to verify.`);
|
|
117
|
+
} else {
|
|
118
|
+
await initCommand(args);
|
|
119
|
+
}
|
|
120
|
+
break;
|
|
121
|
+
case "doctor": {
|
|
122
|
+
const result = doctor(process.cwd());
|
|
123
|
+
console.log(formatDoctor(result));
|
|
124
|
+
if (!result.healthy) process.exit(1);
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
case "packet":
|
|
128
|
+
await packetCommand(args);
|
|
129
|
+
break;
|
|
130
|
+
case "route":
|
|
131
|
+
await routeCommand(args);
|
|
132
|
+
break;
|
|
133
|
+
case "review":
|
|
134
|
+
await reviewCommand(args);
|
|
135
|
+
break;
|
|
136
|
+
case "status":
|
|
137
|
+
await statusCommand(args);
|
|
138
|
+
break;
|
|
139
|
+
case "packs":
|
|
140
|
+
await packsCommand(args);
|
|
141
|
+
break;
|
|
142
|
+
case "artifacts":
|
|
143
|
+
await artifactsCommand(args);
|
|
144
|
+
break;
|
|
145
|
+
case "run":
|
|
146
|
+
await runCommand(args);
|
|
147
|
+
break;
|
|
148
|
+
case "resume":
|
|
149
|
+
await resumeCommand(args);
|
|
150
|
+
break;
|
|
151
|
+
case "next":
|
|
152
|
+
await nextCommand(args);
|
|
153
|
+
break;
|
|
154
|
+
case "explain":
|
|
155
|
+
await explainCommand(args);
|
|
156
|
+
break;
|
|
157
|
+
case "complete":
|
|
158
|
+
await completeCommand(args);
|
|
159
|
+
break;
|
|
160
|
+
case "fail":
|
|
161
|
+
await failCommand(args);
|
|
162
|
+
break;
|
|
163
|
+
case "retry":
|
|
164
|
+
await retryCommand(args);
|
|
165
|
+
break;
|
|
166
|
+
case "reroute":
|
|
167
|
+
await rerouteCommand(args);
|
|
168
|
+
break;
|
|
169
|
+
case "escalate":
|
|
170
|
+
await escalateCommand(args);
|
|
171
|
+
break;
|
|
172
|
+
case "block":
|
|
173
|
+
await blockCommand(args);
|
|
174
|
+
break;
|
|
175
|
+
case "reopen":
|
|
176
|
+
await reopenCommand(args);
|
|
177
|
+
break;
|
|
178
|
+
case "report":
|
|
179
|
+
await reportCommand(args);
|
|
180
|
+
break;
|
|
181
|
+
case "friction":
|
|
182
|
+
await frictionCommand(args);
|
|
183
|
+
break;
|
|
184
|
+
case "mission":
|
|
185
|
+
await missionCommand(args);
|
|
186
|
+
break;
|
|
187
|
+
case "help":
|
|
188
|
+
case "--help":
|
|
189
|
+
case "-h":
|
|
190
|
+
printHelp();
|
|
191
|
+
break;
|
|
192
|
+
case "--version":
|
|
193
|
+
case "-v":
|
|
194
|
+
console.log(`roleos v${VERSION}`);
|
|
195
|
+
break;
|
|
196
|
+
default: {
|
|
197
|
+
const err = new Error(`Unknown command: ${command}`);
|
|
198
|
+
err.exitCode = 1;
|
|
199
|
+
err.hint = "Run 'roleos help' for usage.";
|
|
200
|
+
throw err;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
} catch (err) {
|
|
204
|
+
handleError(err);
|
|
205
|
+
}
|
package/package.json
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "role-os",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Role OS — a multi-Claude operating system where 31 specialized roles execute work through contracts, conflict detection, escalation, and structured evidence. 7 proven team packs for common task families.",
|
|
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.0.0",
|
|
4
|
+
"description": "Role OS — a multi-Claude operating system where 31 specialized roles execute work through contracts, conflict detection, escalation, and structured evidence. 7 proven team packs for common task families.",
|
|
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
|
+
}
|