paseo-room 0.1.0-alpha.0 → 0.1.0-alpha.2
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/README.md +9 -1
- package/dist/index.js +101 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ Exit codes: `0` success, `1` a check failed, `2` bad usage.
|
|
|
61
61
|
```text
|
|
62
62
|
~/.paseo-room/
|
|
63
63
|
room.json # what this CLI created; verify and remove read it
|
|
64
|
-
room/
|
|
64
|
+
room/WORKSPACE_PROTOCOL.md # the default protocol every seat carries, as one readable file
|
|
65
65
|
roles/codex/<role>/
|
|
66
66
|
config.toml # your config.toml + the room's overrides
|
|
67
67
|
role-instructions.md # readable copy of what this seat was told
|
|
@@ -142,6 +142,14 @@ In short:
|
|
|
142
142
|
|
|
143
143
|
Human keeps product goals, priority, material cost, external effects and irreversible risk.
|
|
144
144
|
|
|
145
|
+
Every seat also carries a **default workspace protocol** — topology by difficulty,
|
|
146
|
+
verification, review, repository conventions — so a project has that layer without doing
|
|
147
|
+
anything. Each seat gets the sections that bear on its own work; topology goes to Lead and
|
|
148
|
+
Supervisor, not to Peer. A repository that needs different rules writes
|
|
149
|
+
`docs/WORKSPACE_PROTOCOL.md`, which wins wherever it speaks while the default holds
|
|
150
|
+
wherever it is silent. `~/.paseo-room/room/WORKSPACE_PROTOCOL.md` is the whole default as
|
|
151
|
+
one file, so you can read what is in force and start from it.
|
|
152
|
+
|
|
145
153
|
## Documentation
|
|
146
154
|
|
|
147
155
|
- [docs/orchestration-model.md](docs/orchestration-model.md) — the reference model this
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var init_package = __esm({
|
|
|
15
15
|
"package.json"() {
|
|
16
16
|
package_default = {
|
|
17
17
|
name: "paseo-room",
|
|
18
|
-
version: "0.1.0-alpha.
|
|
18
|
+
version: "0.1.0-alpha.2",
|
|
19
19
|
description: "One CLI that configures Codex/Claude role homes in $HOME and registers them with your local Paseo daemon.",
|
|
20
20
|
keywords: [
|
|
21
21
|
"paseo",
|
|
@@ -116,7 +116,8 @@ function resolveLayout(options = {}, env = process.env) {
|
|
|
116
116
|
codex: pick(options.codexBin, env.CODEX_BIN, "codex"),
|
|
117
117
|
claude: pick(options.claudeBin, env.CLAUDE_BIN, "claude"),
|
|
118
118
|
paseo: pick(options.paseoBin, env.PASEO_BIN, "paseo")
|
|
119
|
-
}
|
|
119
|
+
},
|
|
120
|
+
searchPath: env.PATH ?? ""
|
|
120
121
|
};
|
|
121
122
|
}
|
|
122
123
|
function contains(root, path) {
|
|
@@ -250,12 +251,19 @@ var init_clauses = __esm({
|
|
|
250
251
|
an acceptance decision. Human does not normally operate the agent protocol.
|
|
251
252
|
`),
|
|
252
253
|
"RC-002": clause(`
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
A workspace protocol governs repository-local workflow: topology, verification
|
|
255
|
+
commands, review rhythm, escalation routes, and project conventions. The room ships a
|
|
256
|
+
default, and the part of it that bears on this role is reproduced at the end of this
|
|
257
|
+
document. That default is in force wherever the repository says nothing.
|
|
256
258
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
+
When the repository provides docs/WORKSPACE_PROTOCOL.md, read the parts that bear on
|
|
260
|
+
your own work and follow them wherever they speak to a point. A repository rule wins
|
|
261
|
+
over the default on that point; the default still holds everywhere the repository is
|
|
262
|
+
silent.
|
|
263
|
+
|
|
264
|
+
Neither the default nor a repository file can weaken this authority contract. No
|
|
265
|
+
protocol can give Peer orchestration, give Supervisor or Peer technical acceptance,
|
|
266
|
+
permit multiple writable Peers, or transfer Human decisions to an agent.
|
|
259
267
|
`),
|
|
260
268
|
"RC-003": clause(`
|
|
261
269
|
Use tests, artifacts, lifecycle states, and completion/error/attention events as
|
|
@@ -362,55 +370,116 @@ var init_clauses = __esm({
|
|
|
362
370
|
}
|
|
363
371
|
});
|
|
364
372
|
|
|
373
|
+
// src/room/workspace.ts
|
|
374
|
+
var DEFAULT_PROTOCOL;
|
|
375
|
+
var init_workspace = __esm({
|
|
376
|
+
"src/room/workspace.ts"() {
|
|
377
|
+
"use strict";
|
|
378
|
+
init_clauses();
|
|
379
|
+
DEFAULT_PROTOCOL = {
|
|
380
|
+
"WP-01 Topology": clause(`
|
|
381
|
+
Match the shape of the work to its difficulty. A change Lead can make correctly in one
|
|
382
|
+
sitting is made by Lead, without a Peer: delegation costs a brief, a handoff and a
|
|
383
|
+
review, and a trivial change does not repay them.
|
|
384
|
+
|
|
385
|
+
When the route itself is uncertain, spend a read-only Peer on the question before
|
|
386
|
+
spending a writable Peer on the answer.
|
|
387
|
+
`),
|
|
388
|
+
"WP-02 Verification": clause(`
|
|
389
|
+
The repository's own gate is the evidence. Lead names the exact command in the brief;
|
|
390
|
+
Peer runs it and reports the result as it came back, failures included. A candidate
|
|
391
|
+
whose gate was not run is not a candidate.
|
|
392
|
+
|
|
393
|
+
Do not report part of the gate as the whole of it, and do not report work as done while
|
|
394
|
+
any part of it is unrun.
|
|
395
|
+
`),
|
|
396
|
+
"WP-03 Review": clause(`
|
|
397
|
+
Review runs in a fresh session rather than a continuation of the writer's. A session
|
|
398
|
+
that produced the work cannot be surprised by it.
|
|
399
|
+
`),
|
|
400
|
+
"WP-04 Repository conventions": clause(`
|
|
401
|
+
Follow the conventions already visible in the files being changed rather than importing
|
|
402
|
+
a different house style alongside them.
|
|
403
|
+
|
|
404
|
+
Do not add top-level files, directories, dependencies or tooling the brief did not ask
|
|
405
|
+
for. A repository that wants them will say so in its own protocol.
|
|
406
|
+
`)
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
|
|
365
411
|
// src/room/instructions.ts
|
|
366
|
-
function instructionIds(
|
|
367
|
-
|
|
368
|
-
|
|
412
|
+
function instructionIds(role) {
|
|
413
|
+
return [...SHARED_IDS, ...ROLE_IDS[role]];
|
|
414
|
+
}
|
|
415
|
+
function protocolIds(role) {
|
|
416
|
+
return PROTOCOL_IDS[role];
|
|
417
|
+
}
|
|
418
|
+
function sections(ids, source) {
|
|
419
|
+
return ids.map((id) => `## ${id}
|
|
420
|
+
${(source[id] ?? []).map((statement) => `- ${statement}`).join("\n")}`);
|
|
421
|
+
}
|
|
422
|
+
function protocol(ids) {
|
|
423
|
+
return [`# ${PROTOCOL_TITLE}`, PROTOCOL_PREFACE, ...sections(ids, DEFAULT_PROTOCOL)];
|
|
369
424
|
}
|
|
370
425
|
function renderInstructions(kind) {
|
|
371
|
-
|
|
372
|
-
(
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
426
|
+
if (kind === "workspace") {
|
|
427
|
+
return protocol(Object.keys(DEFAULT_PROTOCOL)).join("\n\n") + "\n";
|
|
428
|
+
}
|
|
429
|
+
return [
|
|
430
|
+
`# ${TITLES[kind]}`,
|
|
431
|
+
PREFACES[kind],
|
|
432
|
+
...sections(instructionIds(kind), CLAUSES),
|
|
433
|
+
...protocol(protocolIds(kind))
|
|
434
|
+
].join("\n\n") + "\n";
|
|
376
435
|
}
|
|
377
|
-
var ROLE_IDS, TITLES,
|
|
436
|
+
var ROLE_IDS, PROTOCOL_IDS, PREFACES, TITLES, PROTOCOL_TITLE, PROTOCOL_PREFACE;
|
|
378
437
|
var init_instructions = __esm({
|
|
379
438
|
"src/room/instructions.ts"() {
|
|
380
439
|
"use strict";
|
|
381
440
|
init_clauses();
|
|
441
|
+
init_workspace();
|
|
382
442
|
ROLE_IDS = {
|
|
383
443
|
supervisor: ["RC-101", "RC-102", "RC-103", "RC-104"],
|
|
384
444
|
lead: ["RC-201", "RC-202", "RC-203", "RC-204", "RC-205", "RC-206"],
|
|
385
445
|
// Peer needs the challenge protocol as well as its own numbered obligations.
|
|
386
446
|
peer: ["RC-204", "RC-301", "RC-302", "RC-303", "RC-304", "RC-305"]
|
|
387
447
|
};
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
peer: "Peer role instructions"
|
|
448
|
+
PROTOCOL_IDS = {
|
|
449
|
+
supervisor: ["WP-01 Topology", "WP-02 Verification", "WP-03 Review", "WP-04 Repository conventions"],
|
|
450
|
+
lead: ["WP-01 Topology", "WP-02 Verification", "WP-03 Review", "WP-04 Repository conventions"],
|
|
451
|
+
peer: ["WP-02 Verification", "WP-03 Review", "WP-04 Repository conventions"]
|
|
393
452
|
};
|
|
394
453
|
PREFACES = {
|
|
395
|
-
workspace: "Operator reference: copy what you need into a workspace-local docs/WORKSPACE_PROTOCOL.md. Installation never creates or replaces that workspace file.",
|
|
396
454
|
supervisor: "You are Supervisor, the Human-facing routing seat, not the project Lead.",
|
|
397
455
|
lead: "You are Lead, the project technical owner under Human authority.",
|
|
398
456
|
peer: "You are Peer, executing one brief from Lead in writing or read-only review mode."
|
|
399
457
|
};
|
|
458
|
+
TITLES = {
|
|
459
|
+
supervisor: "Supervisor role instructions",
|
|
460
|
+
lead: "Lead role instructions",
|
|
461
|
+
peer: "Peer role instructions"
|
|
462
|
+
};
|
|
463
|
+
PROTOCOL_TITLE = "Workspace protocol";
|
|
464
|
+
PROTOCOL_PREFACE = [
|
|
465
|
+
"This is the room default, and it is in force now. A repository that needs different rules",
|
|
466
|
+
"provides `docs/WORKSPACE_PROTOCOL.md`: read it, follow it wherever it speaks to a point,",
|
|
467
|
+
"and keep what follows where it is silent."
|
|
468
|
+
].join("\n");
|
|
400
469
|
}
|
|
401
470
|
});
|
|
402
471
|
|
|
403
472
|
// src/which.ts
|
|
404
473
|
import { execFile } from "child_process";
|
|
405
|
-
import { access, constants
|
|
474
|
+
import { access, constants } from "fs/promises";
|
|
406
475
|
import { delimiter, isAbsolute, join as join3, resolve as resolve2 } from "path";
|
|
407
476
|
import { promisify } from "util";
|
|
408
|
-
async function which(command,
|
|
409
|
-
const candidates = isAbsolute(command) || command.includes("/") ? [resolve2(command)] :
|
|
477
|
+
async function which(command, searchPath) {
|
|
478
|
+
const candidates = isAbsolute(command) || command.includes("/") ? [resolve2(command)] : searchPath.split(delimiter).filter(Boolean).map((entry) => join3(entry, command));
|
|
410
479
|
for (const candidate of candidates) {
|
|
411
480
|
try {
|
|
412
481
|
await access(candidate, constants.X_OK);
|
|
413
|
-
return
|
|
482
|
+
return candidate;
|
|
414
483
|
} catch {
|
|
415
484
|
}
|
|
416
485
|
}
|
|
@@ -475,7 +544,7 @@ var init_claude = __esm({
|
|
|
475
544
|
pins: { disallowedTools: ["Task"] },
|
|
476
545
|
async build(layout, roles) {
|
|
477
546
|
const home = layout.agentHome.claude;
|
|
478
|
-
const binary = await which(layout.bin.claude);
|
|
547
|
+
const binary = await which(layout.bin.claude, layout.searchPath);
|
|
479
548
|
if (!binary) {
|
|
480
549
|
return { entries: [], checks: [fail("claude.bin", "Claude Code executable not found.", "Install Claude Code, or pass --claude-bin /path/to/claude.")] };
|
|
481
550
|
}
|
|
@@ -553,7 +622,7 @@ var init_codex = __esm({
|
|
|
553
622
|
async build(layout, roles) {
|
|
554
623
|
const checks = [];
|
|
555
624
|
const home = layout.agentHome.codex;
|
|
556
|
-
const binary = await which(layout.bin.codex);
|
|
625
|
+
const binary = await which(layout.bin.codex, layout.searchPath);
|
|
557
626
|
if (!binary) {
|
|
558
627
|
return { entries: [], checks: [fail("codex.bin", "Codex executable not found.", "Install Codex, or pass --codex-bin /path/to/codex.")] };
|
|
559
628
|
}
|
|
@@ -571,7 +640,7 @@ var init_codex = __esm({
|
|
|
571
640
|
checks.push(pass("codex.home", `Codex found at ${binary} using ${home}.`));
|
|
572
641
|
const entries = [];
|
|
573
642
|
let catalogSource;
|
|
574
|
-
const models = await probe(binary, ["debug", "models"], { HOME: layout.home, CODEX_HOME: home, PATH:
|
|
643
|
+
const models = await probe(binary, ["debug", "models"], { HOME: layout.home, CODEX_HOME: home, PATH: layout.searchPath });
|
|
575
644
|
if (models.ok) {
|
|
576
645
|
try {
|
|
577
646
|
catalogSource = renderCatalog(JSON.parse(models.stdout));
|
|
@@ -638,14 +707,14 @@ function assessStatus(raw) {
|
|
|
638
707
|
return { checks: [pass("paseo.version", `Paseo ${daemon} is running on ${url} (compatible, needs >= ${MINIMUM_VERSION}).`)], daemon: { url, version: daemon } };
|
|
639
708
|
}
|
|
640
709
|
async function checkDaemon(layout, env = process.env) {
|
|
641
|
-
const binary = await which(layout.bin.paseo,
|
|
710
|
+
const binary = await which(layout.bin.paseo, layout.searchPath);
|
|
642
711
|
if (!binary) {
|
|
643
712
|
return { checks: [fail("paseo.bin", "Paseo executable not found.", "Install Paseo, or pass --paseo-bin /path/to/paseo.")] };
|
|
644
713
|
}
|
|
645
714
|
const output = await probe(binary, ["daemon", "status", "--json"], {
|
|
646
715
|
HOME: layout.home,
|
|
647
716
|
PASEO_HOME: layout.paseoHome,
|
|
648
|
-
PATH:
|
|
717
|
+
PATH: layout.searchPath,
|
|
649
718
|
...env.PASEO_PASSWORD === void 0 ? {} : { PASEO_PASSWORD: env.PASEO_PASSWORD }
|
|
650
719
|
});
|
|
651
720
|
if (!output.ok) {
|
|
@@ -788,7 +857,7 @@ async function buildDesired(layout, agents, roles) {
|
|
|
788
857
|
const entries = [
|
|
789
858
|
{ kind: "dir", path: layout.roomHome },
|
|
790
859
|
{ kind: "dir", path: sharedRoom(layout) },
|
|
791
|
-
{ kind: "file", path: join7(sharedRoom(layout), "
|
|
860
|
+
{ kind: "file", path: join7(sharedRoom(layout), "WORKSPACE_PROTOCOL.md"), content: renderInstructions("workspace") }
|
|
792
861
|
];
|
|
793
862
|
const providers = {};
|
|
794
863
|
const checks = [];
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json","../src/result.ts","../src/layout.ts","../src/fsops.ts","../src/room/clauses.ts","../src/room/instructions.ts","../src/which.ts","../src/agents/claude.ts","../src/agents/codex.ts","../src/paseo.ts","../src/roles.ts","../src/room.ts","../src/commands.ts","../src/wizard.ts","../src/cli.ts","../src/render.ts","../src/index.ts"],"sourcesContent":["{\n \"name\": \"paseo-room\",\n \"version\": \"0.1.0-alpha.0\",\n \"description\": \"One CLI that configures Codex/Claude role homes in $HOME and registers them with your local Paseo daemon.\",\n \"keywords\": [\n \"paseo\",\n \"codex\",\n \"claude-code\",\n \"agent\",\n \"orchestration\",\n \"cli\"\n ],\n \"homepage\": \"https://github.com/cuongntr/paseo-room#readme\",\n \"bugs\": \"https://github.com/cuongntr/paseo-room/issues\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/cuongntr/paseo-room.git\"\n },\n \"license\": \"MIT\",\n \"author\": \"Invoker <cuongnt1987@gmail.com>\",\n \"type\": \"module\",\n \"engines\": {\n \"node\": \">=22\"\n },\n \"bin\": {\n \"paseo-room\": \"dist/index.js\"\n },\n \"files\": [\n \"dist/\"\n ],\n \"scripts\": {\n \"typecheck\": \"tsc --noEmit\",\n \"lint\": \"eslint . --max-warnings 0\",\n \"test\": \"vitest run\",\n \"build\": \"tsup\",\n \"prepack\": \"npm run build\",\n \"verify\": \"npm run typecheck && npm run lint && npm test && npm run build\"\n },\n \"dependencies\": {\n \"@clack/prompts\": \"^1.8.0\",\n \"@getpaseo/client\": \"0.8.0-beta.1\",\n \"commander\": \"^14.0.3\",\n \"semver\": \"^7.8.5\",\n \"smol-toml\": \"^1.8.0\",\n \"zod\": \"^4.5.4\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^10.0.1\",\n \"@types/node\": \"^22.0.0\",\n \"@types/semver\": \"^7.7.0\",\n \"eslint\": \"^10.10.0\",\n \"tsup\": \"^8.5.1\",\n \"typescript\": \"~5.9.3\",\n \"typescript-eslint\": \"^8.70.0\",\n \"vitest\": \"^4.1.11\"\n }\n}\n","export type Status = 'pass' | 'warn' | 'fail';\nexport interface Check {\n readonly id: string;\n readonly status: Status;\n readonly message: string;\n readonly fix?: string;\n}\nexport interface Operation {\n readonly action: 'create' | 'update' | 'remove' | 'noop';\n readonly kind: 'dir' | 'file' | 'link' | 'provider';\n readonly target: string;\n}\nexport type Outcome = 'ok' | 'changes-planned' | 'failed';\nexport interface Result {\n readonly command: string;\n readonly outcome: Outcome;\n readonly changed: boolean;\n readonly checks: readonly Check[];\n readonly operations: readonly Operation[];\n}\n\nexport function pass(id: string, message: string): Check {\n return { id, status: 'pass', message };\n}\nexport function fail(id: string, message: string, fix: string): Check {\n return { id, status: 'fail', message, fix };\n}\nexport function failed(command: string, checks: readonly Check[]): Result {\n return { command, outcome: 'failed', changed: false, checks, operations: [] };\n}\nexport function hasFailure(checks: readonly Check[]): boolean {\n return checks.some(check => check.status === 'fail');\n}\nexport function exitCode(result: Result): number {\n return result.outcome === 'failed' || hasFailure(result.checks) ? 1 : 0;\n}\n","import { homedir } from 'node:os';\nimport { join, resolve, sep } from 'node:path';\nimport { fail, type Check } from './result.js';\nimport type { AgentId, Role } from './roles.js';\n\nexport interface Options {\n readonly roomHome?: string;\n readonly codexHome?: string;\n readonly claudeHome?: string;\n readonly codexBin?: string;\n readonly claudeBin?: string;\n readonly paseoBin?: string;\n}\nexport interface Layout {\n readonly home: string;\n readonly roomHome: string;\n readonly paseoHome: string;\n readonly agentHome: Record<AgentId, string>;\n readonly bin: Record<AgentId | 'paseo', string>;\n}\n\nfunction pick(...candidates: readonly (string | undefined)[]): string {\n for (const candidate of candidates) if (candidate?.trim()) return candidate.trim();\n throw new Error('Could not determine HOME; pass explicit --room-home and --codex-home/--claude-home paths.');\n}\n\n/** Everything is derived from HOME; flags and environment only override defaults. */\nexport function resolveLayout(options: Options = {}, env: NodeJS.ProcessEnv = process.env): Layout {\n const home = pick(env.HOME, homedir());\n // Relative overrides resolve against the working directory, as a CLI flag should.\n return {\n home,\n roomHome: resolve(pick(options.roomHome, env.PASEO_ROOM_HOME, join(home, '.paseo-room'))),\n paseoHome: resolve(pick(env.PASEO_HOME, join(home, '.paseo'))),\n agentHome: {\n codex: resolve(pick(options.codexHome, env.CODEX_HOME, join(home, '.codex'))),\n claude: resolve(pick(options.claudeHome, env.CLAUDE_CONFIG_DIR, join(home, '.claude'))),\n },\n bin: {\n codex: pick(options.codexBin, env.CODEX_BIN, 'codex'),\n claude: pick(options.claudeBin, env.CLAUDE_BIN, 'claude'),\n paseo: pick(options.paseoBin, env.PASEO_BIN, 'paseo'),\n },\n };\n}\n\n/** True when `path` is the root itself or sits underneath it. */\nexport function contains(root: string, path: string): boolean {\n return path === root || path.startsWith(root.endsWith(sep) ? root : root + sep);\n}\n\n/** The room home must own its directory: no overlap with $HOME or a source agent home. */\nexport function layoutChecks(layout: Layout, agents: readonly AgentId[]): Check[] {\n const checks: Check[] = [];\n if (contains(layout.roomHome, layout.home)) {\n checks.push(fail('room.home', `Refusing to use ${layout.roomHome} as the room home: it contains your home directory.`,\n 'Point --room-home at a dedicated directory, by default ~/.paseo-room.'));\n }\n for (const id of agents) {\n const home = layout.agentHome[id];\n if (contains(layout.roomHome, home) || contains(home, layout.roomHome)) {\n checks.push(fail(`${id}.home`, `The ${id} home ${home} overlaps the room home ${layout.roomHome}.`,\n `Pass --${id}-home pointing at your own ${id} configuration (this happens when setup runs inside a room seat).`));\n }\n }\n return checks;\n}\n\nexport function roleHome(layout: Layout, agent: AgentId, role: Role): string {\n return join(layout.roomHome, 'roles', agent, role);\n}\nexport function sharedRoom(layout: Layout): string {\n return join(layout.roomHome, 'room');\n}\n","import { chmod, lstat, mkdir, readFile, readlink, rm, symlink, writeFile } from 'node:fs/promises';\nimport { dirname, join } from 'node:path';\nimport type { Operation } from './result.js';\n\nexport type Entry =\n | { readonly kind: 'dir'; readonly path: string }\n /** `once` writes the file only when absent: runtime state the agent owns after setup. */\n | { readonly kind: 'file'; readonly path: string; readonly content: string; readonly once?: true }\n | { readonly kind: 'link'; readonly path: string; readonly target: string };\n\nconst DIR_MODE = 0o700;\nconst FILE_MODE = 0o600;\n\nasync function current(entry: Entry): Promise<'absent' | 'same' | 'different'> {\n let stat;\n try { stat = await lstat(entry.path); } catch { return 'absent'; }\n if (entry.kind === 'dir') return stat.isDirectory() ? 'same' : 'different';\n if (entry.kind === 'link') {\n if (!stat.isSymbolicLink()) return 'different';\n return await readlink(entry.path) === entry.target ? 'same' : 'different';\n }\n if (!stat.isFile()) return 'different';\n if (entry.once) return 'same';\n return await readFile(entry.path, 'utf8') === entry.content ? 'same' : 'different';\n}\n\n/** Everything lives under the room home, which this CLI owns outright. */\nexport async function planEntries(entries: readonly Entry[]): Promise<Operation[]> {\n const operations: Operation[] = [];\n for (const entry of entries) {\n const state = await current(entry);\n operations.push({\n action: state === 'same' ? 'noop' : state === 'absent' ? 'create' : 'update',\n kind: entry.kind,\n target: entry.path,\n });\n }\n return operations;\n}\n\n/** Rewrites only what differs, so a repeat run costs stats rather than writes. */\nexport async function applyEntries(entries: readonly Entry[]): Promise<void> {\n for (const entry of entries) {\n if (await current(entry) === 'same') continue;\n if (entry.kind === 'dir') {\n await mkdir(entry.path, { recursive: true, mode: DIR_MODE });\n continue;\n }\n await mkdir(dirname(entry.path), { recursive: true, mode: DIR_MODE });\n await rm(entry.path, { force: true, recursive: true });\n if (entry.kind === 'link') await symlink(entry.target, entry.path);\n else {\n await writeFile(entry.path, entry.content, { mode: FILE_MODE });\n await chmod(entry.path, FILE_MODE);\n }\n }\n}\n\nexport async function exists(path: string): Promise<boolean> {\n try { await lstat(path); return true; } catch { return false; }\n}\n\n/** Which of `names` exist under `home`, probed once for all roles that share them. */\nexport async function existingPaths(home: string, names: readonly string[]): Promise<string[]> {\n const paths = names.map(name => join(home, name));\n const present = await Promise.all(paths.map(exists));\n return paths.filter((_, index) => present[index] === true);\n}\n\nexport async function readIfPresent(path: string): Promise<string | undefined> {\n try { return await readFile(path, 'utf8'); } catch { return undefined; }\n}\n","/**\n * The room's authority contract, in the wording the agents actually read.\n *\n * Write each statement as ordinary wrapped prose. Blank lines separate\n * statements; line breaks inside a statement are just there for reading and\n * collapse into single spaces when rendered.\n */\nfunction clause(source: string): readonly string[] {\n return source\n .trim()\n .split(/\\n\\s*\\n/)\n .map(statement => statement.split('\\n').map(line => line.trim()).join(' '));\n}\n\nexport const CLAUSES = {\n 'RC-001': clause(`\n Human owns product goals, priority, material-cost choices, external effects, and\n irreversible-risk decisions. No agent may take ownership of these decisions; obtain\n Human approval before crossing those boundaries.\n\n Human may direct the technical route, decomposition, and lifecycle, and may override\n an acceptance decision. Human does not normally operate the agent protocol.\n `),\n\n 'RC-002': clause(`\n Each role must read workspace-local docs/WORKSPACE_PROTOCOL.md when it exists.\n Repository conventions, narrower scopes, validation commands, and escalation details\n may refine workflow, but cannot weaken this authority contract.\n\n A local protocol cannot give Peer orchestration, give Supervisor or Peer technical\n acceptance, permit multiple writable Peers, or transfer Human decisions to an agent.\n `),\n\n 'RC-003': clause(`\n Use tests, artifacts, lifecycle states, and completion/error/attention events as\n evidence, not as automatic authorization or acceptance.\n\n Wait for state-changing events when progress depends on another actor. Do not\n repeatedly poll unchanged state; resume when new evidence or a relevant event arrives.\n `),\n\n 'RC-004': clause(`\n Preserve unrelated work. Stay within the granted repository scope and external-action\n authority; do not treat access to a tool as permission to expand either boundary.\n `),\n\n 'RC-101': clause(`\n Supervisor routes the Human directive to Lead without changing its outcome, requested\n output, constraints, or approval gates. Label added context separately; it must not\n rewrite the directive.\n `),\n\n 'RC-102': clause(`\n Supervisor observes technical work rather than choosing architecture, decomposing\n work, or moving write ownership. Prefer routing work through Lead.\n\n Supervisor must not edit project work, run project validation, or decide technical\n acceptance. Supervisor must not direct Peer while Lead is healthy; an unhealthy Lead\n calls for bounded recovery or escalation, not taking over Peer work.\n `),\n\n 'RC-103': clause(`\n Supervisor has Paseo tools enabled solely within its authority. Use the smallest Paseo\n room/session lifecycle action needed for an explicit Human request or bounded room\n recovery; preserve current ownership and inform Lead of every change.\n `),\n\n 'RC-104': clause(`\n Supervisor sends technical questions and evidence to Lead. Escalate product, priority,\n material-cost, external-effect, and irreversible-risk choices to Human rather than\n deciding them.\n `),\n\n 'RC-201': clause(`\n Lead owns project framing, architecture, dependencies, integration, verification, and\n technical acceptance within Human boundaries. Lead executes the Human outcome and\n constraints, escalating Human-owned choices to Human.\n\n Lead has Paseo tools enabled to manage project agents and direct Peer; this capability\n does not expand project or external-action authority.\n `),\n\n 'RC-202': clause(`\n Lead owns decomposition and moving write-scope assignment: give each moving scope\n exactly one owner, with at most one active writable Peer across the project at a time.\n Lead must not edit a scope concurrently with its writing Peer.\n\n Before transferring write ownership, stop the prior writer and establish a stable\n handoff. Read-only review does not create another writer.\n `),\n\n 'RC-203': clause(`\n Before delegation, Lead supplies a complete Peer brief: one bounded outcome,\n prerequisites, explicit write scope or read-only mode, stable contract and invariants,\n required acceptance evidence, and conditions that reopen the decision.\n `),\n\n 'RC-204': clause(`\n Lead permits independent Peer judgment: REOPEN_REQUEST challenges a premise;\n DEPENDENCY_REQUEST asks for an unowned prerequisite; BLOCKED reports that no safe\n progress is possible.\n\n For each signal, Peer provides evidence, consequence, and the needed decision or\n dependency. Lead resolves technical signals or escalates Human-owned choices; Peer\n must not seize unowned work while waiting.\n `),\n\n 'RC-205': clause(`\n Lead inspects the exact candidate or a deterministic snapshot and explicitly accepts\n or rejects it with a technical reason. Passing tests and completion reports are\n evidence, not acceptance. Among agents, Lead alone accepts; Human retains override\n authority.\n `),\n\n 'RC-206': clause(`\n When material uncertainty warrants independent review, Lead may dispatch a fresh\n read-only Peer with an exact stable candidate and a bounded question. Review is\n optional: do not introduce a dedicated reviewer role or a fixed reviewer count.\n `),\n\n 'RC-301': clause(`\n Peer owns exactly one Lead-delegated bounded outcome and proportionate evidence. Do\n not add adjacent tasks; send technical questions to Lead and escalate Human-owned\n choices through Lead.\n `),\n\n 'RC-302': clause(`\n A writing Peer owns only its assigned moving write scope. A review Peer stays\n read-only and inspects only the named candidate or snapshot, without changing project\n files or the candidate.\n `),\n\n 'RC-303': clause(`\n Peer must not spawn, manage, coordinate, or infer room topology, direct another Peer,\n or perform Paseo room/session lifecycle operations. Peer receives no Paseo tools;\n enabled is false. This capability boundary is not an operating-system sandbox.\n `),\n\n 'RC-304': clause(`\n Peer hands off a candidate by naming an immutable commit or deterministic snapshot,\n the original base, all changed paths, verification performed and its results, and\n residual risk. Make the candidate reproducible for Lead inspection.\n `),\n\n 'RC-305': clause(`\n Peer must not self-accept any work, including difficult work. Peer tests and\n completion are evidence only; Lead alone performs technical acceptance among agents,\n subject to Human override.\n `),\n};\n\nexport type RoleContractId = keyof typeof CLAUSES;\nexport const SHARED_IDS = ['RC-001', 'RC-002', 'RC-003', 'RC-004'] as const;\n","import type { Role } from '../roles.js';\nimport { CLAUSES, SHARED_IDS, type RoleContractId } from './clauses.js';\n\nexport type InstructionKind = Role | 'workspace';\n\nconst ROLE_IDS: Record<Role, readonly RoleContractId[]> = {\n supervisor: ['RC-101', 'RC-102', 'RC-103', 'RC-104'],\n lead: ['RC-201', 'RC-202', 'RC-203', 'RC-204', 'RC-205', 'RC-206'],\n // Peer needs the challenge protocol as well as its own numbered obligations.\n peer: ['RC-204', 'RC-301', 'RC-302', 'RC-303', 'RC-304', 'RC-305'],\n};\n\nconst TITLES: Record<InstructionKind, string> = {\n workspace: 'Paseo Room workspace protocol — operator reference/template',\n supervisor: 'Supervisor role instructions',\n lead: 'Lead role instructions',\n peer: 'Peer role instructions',\n};\n\nconst PREFACES: Record<InstructionKind, string> = {\n workspace: 'Operator reference: copy what you need into a workspace-local docs/WORKSPACE_PROTOCOL.md. Installation never creates or replaces that workspace file.',\n supervisor: 'You are Supervisor, the Human-facing routing seat, not the project Lead.',\n lead: 'You are Lead, the project technical owner under Human authority.',\n peer: 'You are Peer, executing one brief from Lead in writing or read-only review mode.',\n};\n\nexport function instructionIds(kind: InstructionKind): readonly RoleContractId[] {\n if (kind === 'workspace') return Object.keys(CLAUSES) as RoleContractId[];\n // Every role carries the shared authority contract plus its own obligations.\n return [...SHARED_IDS, ...ROLE_IDS[kind]];\n}\n\nexport function renderInstructions(kind: InstructionKind): string {\n const sections = instructionIds(kind).map(\n id => `## ${id}\\n${CLAUSES[id].map(statement => `- ${statement}`).join('\\n')}`,\n );\n return [`# ${TITLES[kind]}`, PREFACES[kind], ...sections].join('\\n\\n') + '\\n';\n}\n","import { execFile } from 'node:child_process';\nimport { access, constants, realpath } from 'node:fs/promises';\nimport { delimiter, isAbsolute, join, resolve } from 'node:path';\nimport { promisify } from 'node:util';\n\nconst run = promisify(execFile);\n\n/** Resolve a command to an absolute, executable, canonical path. */\nexport async function which(command: string, env: NodeJS.ProcessEnv = process.env): Promise<string | undefined> {\n const candidates = isAbsolute(command) || command.includes('/')\n ? [resolve(command)]\n : (env.PATH ?? '').split(delimiter).filter(Boolean).map(entry => join(entry, command));\n for (const candidate of candidates) {\n try {\n await access(candidate, constants.X_OK);\n return await realpath(candidate);\n } catch { /* try the next PATH entry */ }\n }\n return undefined;\n}\n\nexport interface CommandOutput {\n readonly ok: boolean;\n readonly stdout: string;\n}\n/** Bounded, shell-free probe. Failures are reported, never thrown. */\nexport async function probe(executable: string, args: readonly string[], env: NodeJS.ProcessEnv): Promise<CommandOutput> {\n try {\n const { stdout } = await run(executable, [...args], { env, timeout: 20_000, maxBuffer: 16 * 1024 * 1024, encoding: 'utf8' });\n return { ok: true, stdout };\n } catch {\n return { ok: false, stdout: '' };\n }\n}\n","import { basename, join } from 'node:path';\nimport type { Layout } from '../layout.js';\nimport { roleHome } from '../layout.js';\nimport type { Entry } from '../fsops.js';\nimport { existingPaths, exists, readIfPresent } from '../fsops.js';\nimport { fail, pass, type Check } from '../result.js';\nimport type { Role } from '../roles.js';\nimport { renderInstructions } from '../room/instructions.js';\nimport { which } from '../which.js';\nimport type { Agent, AgentPlan } from './types.js';\n\n/** Operator resources shared by reference; credentials stay where Claude put them. */\nconst SHARED = ['.credentials.json', 'skills', 'plugins', 'commands', 'hooks'] as const;\n/** Copied once so a fresh role home does not re-run interactive onboarding. */\nconst SEEDED_KEYS = ['hasCompletedOnboarding', 'theme', 'installMethod', 'userID', 'oauthAccount'] as const;\n\nfunction asObject(value: unknown): Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value) ? { ...value } : {};\n}\n/** Any unreadable or non-object source is simply an empty starting point. */\nfunction readObject(source: string | undefined): Record<string, unknown> {\n try { return asObject(source === undefined ? {} : JSON.parse(source)); } catch { return {}; }\n}\n\n/** Keep the operator's hooks and env (Paseo installs its own), override nothing else. */\nexport function renderRoleSettings(source: string | undefined, role: Role): string {\n const settings = readObject(source);\n settings.env = { ...asObject(settings.env), PASEO_ROOM_ROLE: role };\n return JSON.stringify(settings, null, 2) + '\\n';\n}\n\nexport function renderRoleState(source: string | undefined): string {\n const root = readObject(source);\n const state: Record<string, unknown> = { hasCompletedOnboarding: true };\n for (const key of SEEDED_KEYS) if (key in root) state[key] = root[key];\n return JSON.stringify(state, null, 2) + '\\n';\n}\n\nexport const claudeAgent: Agent = {\n id: 'claude',\n label: 'Claude Code',\n homeEnv: 'CLAUDE_CONFIG_DIR',\n // Claude's own subagents would be a second control plane; Paseo owns agent\n // lifecycle. This is the Claude counterpart of Codex's [agents] enabled = false.\n pins: { disallowedTools: ['Task'] },\n async build(layout: Layout, roles: readonly Role[]): Promise<AgentPlan> {\n const home = layout.agentHome.claude;\n const binary = await which(layout.bin.claude);\n if (!binary) {\n return { entries: [], checks: [fail('claude.bin', 'Claude Code executable not found.', 'Install Claude Code, or pass --claude-bin /path/to/claude.')] };\n }\n if (!(await exists(home))) {\n return { entries: [], checks: [fail('claude.home', `No Claude config directory at ${home}.`, 'Run claude once to initialise it, or pass --claude-home.')] };\n }\n const checks: Check[] = [pass('claude.home', `Claude Code found at ${binary} using ${home}.`)];\n\n const settingsSource = await readIfPresent(join(home, 'settings.json'));\n const stateSource = await readIfPresent(join(layout.home, '.claude.json'));\n const shared = await existingPaths(home, SHARED);\n const entries: Entry[] = [];\n for (const role of roles) {\n const target = roleHome(layout, 'claude', role);\n entries.push({ kind: 'dir', path: target });\n entries.push({ kind: 'file', path: join(target, 'CLAUDE.md'), content: renderInstructions(role) });\n entries.push({ kind: 'file', path: join(target, 'settings.json'), content: renderRoleSettings(settingsSource, role) });\n entries.push({ kind: 'file', path: join(target, '.claude.json'), content: renderRoleState(stateSource), once: true });\n for (const path of shared) entries.push({ kind: 'link', path: join(target, basename(path)), target: path });\n }\n return { entries, checks, binary };\n },\n};\n","import { basename, join } from 'node:path';\nimport { parse, stringify, type TomlTable } from 'smol-toml';\nimport type { Layout } from '../layout.js';\nimport { roleHome } from '../layout.js';\nimport type { Entry } from '../fsops.js';\nimport { existingPaths, readIfPresent } from '../fsops.js';\nimport { fail, pass, type Check } from '../result.js';\nimport type { Role } from '../roles.js';\nimport { renderInstructions } from '../room/instructions.js';\nimport { probe, which } from '../which.js';\nimport type { Agent, AgentPlan } from './types.js';\n\n/** Read-only operator resources every role shares by reference, never by copy. */\nconst SHARED = ['auth.json', 'AGENTS.md', 'skills', 'plugins', 'hooks.json'] as const;\nconst CATALOG = 'model-catalog.json';\n\nfunction table(parent: TomlTable, key: string): TomlTable {\n const value = parent[key];\n if (value === undefined || typeof value !== 'object' || Array.isArray(value) || value instanceof Date) {\n return (parent[key] = {});\n }\n return value;\n}\n\nexport interface RoleConfigInput {\n readonly roleDocument: string;\n readonly catalogPath?: string;\n}\n/**\n * Copy the operator's config, then override only the keys the room owns.\n *\n * `model_instructions_file` is deliberately untouched: it *replaces* Codex's base\n * prompt, so writing it would mean vendoring and maintaining a full copy of that\n * prompt. The room contract is additive and belongs in `developer_instructions`.\n */\nexport function renderRoleConfig(source: TomlTable, input: RoleConfigInput): string {\n const config = structuredClone(source);\n config.sandbox_mode = 'danger-full-access';\n config.approval_policy = 'never';\n // An active profile outranks the top-level keys, so the room's must land there too.\n if (typeof config.profile === 'string') {\n const profile = table(table(config, 'profiles'), config.profile);\n profile.sandbox_mode = 'danger-full-access';\n profile.approval_policy = 'never';\n }\n config.developer_instructions = input.roleDocument;\n if (input.catalogPath) config.model_catalog_json = input.catalogPath;\n // Codex's own multi-agent mode would compete with the room's role contract.\n table(config, 'agents').enabled = false;\n const features = table(config, 'features');\n features.multi_agent = false;\n // Newer configs represent v2 as a table; keep that shape rather than writing a\n // boolean at the same key, which would be a TOML conflict.\n if (typeof features.multi_agent_v2 === 'boolean' || features.multi_agent_v2 === undefined) features.multi_agent_v2 = false;\n else table(features, 'multi_agent_v2').enabled = false;\n return stringify(config) + '\\n';\n}\n\nexport function renderCatalog(catalog: unknown): string {\n return JSON.stringify(catalog, (key, value: unknown) => (key === 'multi_agent_version' ? null : value), 2) + '\\n';\n}\n\nexport const codexAgent: Agent = {\n id: 'codex',\n label: 'Codex',\n homeEnv: 'CODEX_HOME',\n // Without these, Paseo's own mode preset (default auto-review) is sent to the\n // app-server and outranks the sandbox/approval keys in the generated config.\n pins: { params: { sandbox_mode: 'danger-full-access', approval_policy: 'never' } },\n async build(layout: Layout, roles: readonly Role[]): Promise<AgentPlan> {\n const checks: Check[] = [];\n const home = layout.agentHome.codex;\n const binary = await which(layout.bin.codex);\n if (!binary) {\n return { entries: [], checks: [fail('codex.bin', 'Codex executable not found.', 'Install Codex, or pass --codex-bin /path/to/codex.')] };\n }\n const configPath = join(home, 'config.toml');\n const raw = await readIfPresent(configPath);\n if (raw === undefined) {\n return { entries: [], checks: [fail('codex.home', `No config.toml in ${home}.`, 'Run codex once to initialise it, or pass --codex-home.')] };\n }\n let source: TomlTable;\n try { source = parse(raw); } catch {\n return { entries: [], checks: [fail('codex.config', `Could not read ${configPath} as TOML.`, 'Fix the syntax in your Codex config, then run setup again.')] };\n }\n checks.push(pass('codex.home', `Codex found at ${binary} using ${home}.`));\n\n const entries: Entry[] = [];\n\n // The catalog is optional: an older Codex simply keeps its built-in models.\n let catalogSource: string | undefined;\n const models = await probe(binary, ['debug', 'models'], { HOME: layout.home, CODEX_HOME: home, PATH: process.env.PATH ?? '' });\n if (models.ok) {\n try { catalogSource = renderCatalog(JSON.parse(models.stdout)); } catch { catalogSource = undefined; }\n }\n if (!catalogSource) checks.push({ id: 'codex.catalog', status: 'warn', message: 'Codex model catalog unavailable; roles keep the default catalog.' });\n\n const shared = await existingPaths(home, SHARED);\n for (const role of roles) {\n const target = roleHome(layout, 'codex', role);\n const catalogPath = catalogSource ? join(target, CATALOG) : undefined;\n const roleDocument = renderInstructions(role);\n entries.push({ kind: 'dir', path: target });\n // Codex reads the brief from developer_instructions; this copy is for the operator.\n entries.push({ kind: 'file', path: join(target, 'role-instructions.md'), content: roleDocument });\n entries.push({\n kind: 'file',\n path: join(target, 'config.toml'),\n content: renderRoleConfig(source, { roleDocument, ...(catalogPath ? { catalogPath } : {}) }),\n });\n if (catalogSource && catalogPath) entries.push({ kind: 'file', path: catalogPath, content: catalogSource });\n for (const path of shared) entries.push({ kind: 'link', path: join(target, basename(path)), target: path });\n }\n return { entries, checks, binary };\n },\n};\n","import type { PaseoClient, PaseoClientConfig } from '@getpaseo/client';\nimport { gte, valid } from 'semver';\nimport { z } from 'zod';\nimport type { Layout } from './layout.js';\nimport { fail, pass, type Check } from './result.js';\nimport type { Provider } from './agents/types.js';\nimport { probe, which } from './which.js';\n\nexport const MINIMUM_VERSION = '0.8.0-beta.1';\n\nconst statusSchema = z.object({\n listen: z.string().min(1),\n localDaemon: z.enum(['running', 'stopped', 'stale_pid', 'unresponsive']),\n cliVersion: z.string(),\n daemonVersion: z.string().nullable(),\n});\n\nexport interface Daemon {\n readonly url: string;\n readonly version: string;\n}\nexport interface DaemonResult {\n readonly checks: readonly Check[];\n readonly daemon?: Daemon;\n}\n\nexport function normalizeUrl(listen: string): string | undefined {\n const match = /^(?:ws:\\/\\/)?([^:/]+|\\[[^\\]]+\\]):(\\d+)$/.exec(listen.trim());\n if (!match) return undefined;\n const [, host = '', port = ''] = match;\n const local = ['localhost', '127.0.0.1', '0.0.0.0', '[::1]', '[::]'].includes(host) ? '127.0.0.1' : host;\n return `ws://${local}:${port}`;\n}\n\n/** The whole compatibility story: is Paseo running, and is it new enough? */\nexport function assessStatus(raw: unknown): DaemonResult {\n const parsed = statusSchema.safeParse(raw);\n if (!parsed.success) {\n return { checks: [fail('paseo.status', 'Paseo status output was not understood.', 'Upgrade Paseo, then run: paseo daemon status --json')] };\n }\n const status = parsed.data;\n if (status.localDaemon !== 'running') {\n return { checks: [fail('paseo.daemon', `Paseo daemon is ${status.localDaemon}.`, 'Start it with: paseo daemon start')] };\n }\n const cli = valid(status.cliVersion);\n const daemon = status.daemonVersion === null ? null : valid(status.daemonVersion);\n if (!cli || !daemon) {\n return { checks: [fail('paseo.version', 'Paseo did not report a usable version.', 'Upgrade Paseo to a release that reports semver versions.')] };\n }\n if (cli !== daemon) {\n return { checks: [fail('paseo.version', `Paseo CLI is ${cli} but the running daemon is ${daemon}.`, 'Restart the daemon with: paseo daemon restart')] };\n }\n if (!gte(daemon, MINIMUM_VERSION)) {\n return { checks: [fail('paseo.version', `Paseo ${daemon} is older than the required ${MINIMUM_VERSION}.`, 'Upgrade Paseo, then run setup again.')] };\n }\n const url = normalizeUrl(status.listen);\n if (!url) {\n return { checks: [fail('paseo.listen', `Paseo listen address ${status.listen} was not understood.`, 'Use a host:port listen address in the Paseo config.')] };\n }\n return { checks: [pass('paseo.version', `Paseo ${daemon} is running on ${url} (compatible, needs >= ${MINIMUM_VERSION}).`)], daemon: { url, version: daemon } };\n}\n\nexport async function checkDaemon(layout: Layout, env: NodeJS.ProcessEnv = process.env): Promise<DaemonResult> {\n const binary = await which(layout.bin.paseo, env);\n if (!binary) {\n return { checks: [fail('paseo.bin', 'Paseo executable not found.', 'Install Paseo, or pass --paseo-bin /path/to/paseo.')] };\n }\n const output = await probe(binary, ['daemon', 'status', '--json'], {\n HOME: layout.home, PASEO_HOME: layout.paseoHome, PATH: env.PATH ?? '',\n ...(env.PASEO_PASSWORD === undefined ? {} : { PASEO_PASSWORD: env.PASEO_PASSWORD }),\n });\n if (!output.ok) {\n return { checks: [fail('paseo.status', 'Could not read Paseo daemon status.', 'Run: paseo daemon status --json')] };\n }\n try { return assessStatus(JSON.parse(output.stdout)); }\n catch { return assessStatus(undefined); }\n}\n\nconst configSchema = z.object({ config: z.object({ providers: z.record(z.string(), z.unknown()).optional() }) });\n\nexport interface Session {\n readProviders(): Promise<Record<string, unknown>>;\n writeProviders(providers: Readonly<Record<string, Provider>>): Promise<void>;\n removeProviders(ids: readonly string[]): Promise<void>;\n refresh(ids: readonly string[]): Promise<void>;\n}\nexport type ClientFactory = (config: PaseoClientConfig) => PaseoClient;\n\n/** One connection per command. No retries, no reconnects, no background state. */\nexport async function withSession<T>(\n daemon: Daemon,\n run: (session: Session) => Promise<T>,\n options: { readonly password?: string; readonly factory?: ClientFactory } = {},\n): Promise<T> {\n const quiet = { debug() { /* silent */ }, info() { /* silent */ }, warn() { /* silent */ }, error() { /* silent */ } };\n // Loaded here so the \"Paseo is not running\" path never pays for the SDK.\n const factory = options.factory ?? (await import('@getpaseo/client')).createPaseoClient;\n const client = factory({\n url: `${daemon.url}/ws`,\n ...(options.password === undefined ? {} : { password: options.password }),\n appVersion: MINIMUM_VERSION,\n connectTimeoutMs: 10_000,\n reconnect: { enabled: false },\n logger: quiet,\n });\n try {\n await client.connect();\n return await run({\n async readProviders() {\n const response = configSchema.parse(await client.config.get());\n return response.config.providers ?? {};\n },\n async writeProviders(providers) {\n await client.config.patch({ providers } as unknown as Parameters<PaseoClient['config']['patch']>[0]);\n },\n async removeProviders(ids) {\n await client.config.patch({ removeProviders: [...ids] });\n },\n async refresh(ids) {\n await client.providers.refresh({ providers: [...ids] });\n },\n });\n } finally {\n await client.close();\n }\n}\n\n/** Compare only the keys the room owns; unrelated fields stay the operator's. */\nexport function providerMatches(desired: Provider, live: unknown): boolean {\n if (live === null || typeof live !== 'object') return false;\n const entry = live as Record<string, unknown>;\n const env = entry.env;\n const tools = entry.paseoTools;\n const same = (left: unknown, right: unknown): boolean => JSON.stringify(left ?? null) === JSON.stringify(right ?? null);\n return entry.extends === desired.extends &&\n same(entry.command, desired.command) &&\n env !== null && typeof env === 'object' &&\n Object.entries(desired.env).every(([key, value]) => (env as Record<string, unknown>)[key] === value) &&\n tools !== null && typeof tools === 'object' &&\n (tools as { enabled?: unknown }).enabled === desired.paseoTools.enabled &&\n // Pins are the room's guarantee: drifting them silently re-enables what they block.\n same(entry.params, desired.params) &&\n same(entry.disallowedTools, desired.disallowedTools);\n}\n","export const ROLES = ['supervisor', 'lead', 'peer'] as const;\nexport type Role = (typeof ROLES)[number];\n\nexport const AGENT_IDS = ['codex', 'claude'] as const;\nexport type AgentId = (typeof AGENT_IDS)[number];\n\n/** Supervisor and Lead orchestrate; Peer executes one brief and gets no room tools. */\nexport const ROLE_PASEO_TOOLS: Record<Role, boolean> = { supervisor: true, lead: true, peer: false };\n\nexport function providerId(agent: AgentId, role: Role): string {\n return `${agent}-${role}`;\n}\nexport function providerLabel(agent: AgentId, role: Role): string {\n const title = (value: string): string => value.charAt(0).toUpperCase() + value.slice(1);\n return `${title(agent)} ${title(role)}`;\n}\n","import { join } from 'node:path';\nimport { z } from 'zod';\nimport { readIfPresent } from './fsops.js';\nimport type { Layout } from './layout.js';\nimport { AGENT_IDS, ROLES, type AgentId, type Role } from './roles.js';\n\nexport const MARKER = 'room.json';\n\nconst markerSchema = z.object({\n version: z.string(),\n agents: z.array(z.enum(AGENT_IDS)).min(1),\n roles: z.array(z.enum(ROLES)).min(1),\n});\nexport type Marker = z.infer<typeof markerSchema>;\n\n/** Deterministic on purpose: re-running setup must not show a phantom change. */\nexport function renderMarker(version: string, agents: readonly AgentId[], roles: readonly Role[]): string {\n return JSON.stringify({ version, agents: [...agents], roles: [...roles] } satisfies Marker, null, 2) + '\\n';\n}\n\n/** Records what setup created, so verify and remove touch nothing else. */\nexport async function readMarker(layout: Layout): Promise<Marker | undefined> {\n const source = await readIfPresent(join(layout.roomHome, MARKER));\n if (source === undefined) return undefined;\n try { return markerSchema.parse(JSON.parse(source)); } catch { return undefined; }\n}\n","import { join } from 'node:path';\nimport { rm } from 'node:fs/promises';\nimport metadata from '../package.json' with { type: 'json' };\nimport { claudeAgent } from './agents/claude.js';\nimport { codexAgent } from './agents/codex.js';\nimport type { Agent, Provider } from './agents/types.js';\nimport { applyEntries, exists, planEntries, type Entry } from './fsops.js';\nimport { layoutChecks, resolveLayout, roleHome, sharedRoom, type Layout, type Options } from './layout.js';\nimport { checkDaemon, providerMatches, withSession, type ClientFactory, type Session } from './paseo.js';\nimport { fail, failed, hasFailure, pass, type Check, type Operation, type Result } from './result.js';\nimport { renderInstructions } from './room/instructions.js';\nimport { MARKER, readMarker, renderMarker, type Marker } from './room.js';\nimport { providerId, providerLabel, ROLES, ROLE_PASEO_TOOLS, type AgentId, type Role } from './roles.js';\n\nexport const AGENTS: Record<AgentId, Agent> = { codex: codexAgent, claude: claudeAgent };\n\nexport interface RunOptions extends Options {\n readonly agents?: readonly AgentId[];\n readonly apply?: boolean;\n readonly env?: NodeJS.ProcessEnv;\n readonly factory?: ClientFactory;\n}\n\nfunction sessionOptions(options: RunOptions): { password?: string; factory?: ClientFactory } {\n const password = (options.env ?? process.env).PASEO_PASSWORD;\n return { ...(password === undefined ? {} : { password }), ...(options.factory ? { factory: options.factory } : {}) };\n}\n\n/** The only per-agent differences are the home variable and the provider pins. */\nfunction roleProviders(layout: Layout, agent: Agent, binary: string, roles: readonly Role[]): Record<string, Provider> {\n return Object.fromEntries(roles.map(role => [providerId(agent.id, role), {\n extends: agent.id,\n label: providerLabel(agent.id, role),\n command: [binary],\n env: { [agent.homeEnv]: roleHome(layout, agent.id, role) },\n paseoTools: { enabled: ROLE_PASEO_TOOLS[role] },\n ...agent.pins,\n }]));\n}\n\ninterface Desired {\n readonly entries: readonly Entry[];\n readonly providers: Readonly<Record<string, Provider>>;\n readonly checks: readonly Check[];\n}\nasync function buildDesired(layout: Layout, agents: readonly AgentId[], roles: readonly Role[]): Promise<Desired> {\n // Operator reference, not linked into any seat: each repo owns its own protocol.\n const entries: Entry[] = [\n { kind: 'dir', path: layout.roomHome },\n { kind: 'dir', path: sharedRoom(layout) },\n { kind: 'file', path: join(sharedRoom(layout), 'workspace-protocol.md'), content: renderInstructions('workspace') },\n ];\n const providers: Record<string, Provider> = {};\n const checks: Check[] = [];\n for (const id of agents) {\n const agent = AGENTS[id];\n const plan = await agent.build(layout, roles);\n entries.push(...plan.entries);\n checks.push(...plan.checks);\n if (plan.binary !== undefined) Object.assign(providers, roleProviders(layout, agent, plan.binary, roles));\n }\n entries.push({ kind: 'file', path: join(layout.roomHome, MARKER), content: renderMarker(metadata.version, agents, roles) });\n return { entries, providers, checks };\n}\n\ninterface Stale {\n readonly providerIds: readonly string[];\n readonly directories: readonly string[];\n}\nconst NOTHING_STALE: Stale = { providerIds: [], directories: [] };\n\n/** A previous setup may have seated agents or roles this one does not: drop those. */\nasync function staleFrom(layout: Layout, previous: Marker | undefined, agents: readonly AgentId[], roles: readonly Role[]): Promise<Stale> {\n if (!previous) return NOTHING_STALE;\n const kept = new Set(agents.flatMap(agent => roles.map(role => providerId(agent, role))));\n const providerIds: string[] = [];\n const directories: string[] = [];\n for (const agent of previous.agents) {\n for (const role of previous.roles) {\n if (kept.has(providerId(agent, role))) continue;\n providerIds.push(providerId(agent, role));\n const path = roleHome(layout, agent, role);\n if (await exists(path)) directories.push(path);\n }\n }\n return { providerIds, directories };\n}\n\n/** One definition of drift, shared by the command that fixes it and the one that reports it. */\nasync function planRoom(session: Session, desired: Desired, stale: Stale): Promise<Operation[]> {\n const live = await session.readProviders();\n return [\n ...await planEntries(desired.entries),\n ...Object.entries(desired.providers).map(([id, provider]) => ({\n action: !(id in live) ? 'create' : providerMatches(provider, live[id]) ? 'noop' : 'update',\n kind: 'provider',\n target: id,\n }) satisfies Operation),\n ...stale.providerIds.filter(id => id in live).map(id => ({ action: 'remove', kind: 'provider', target: id }) satisfies Operation),\n ...stale.directories.map(path => ({ action: 'remove', kind: 'dir', target: path }) satisfies Operation),\n ];\n}\n\n/** The whole product: write the role homes, then register them with Paseo. */\nexport async function setup(options: RunOptions = {}): Promise<Result> {\n const layout = resolveLayout(options, options.env);\n const agents = options.agents ?? ['codex'];\n const invalid = layoutChecks(layout, agents);\n if (invalid.length > 0) return failed('setup', invalid);\n const daemon = await checkDaemon(layout, options.env);\n if (!daemon.daemon) return failed('setup', daemon.checks);\n const desired = await buildDesired(layout, agents, ROLES);\n const checks = [...daemon.checks, ...desired.checks];\n if (hasFailure(checks)) return failed('setup', checks);\n const stale = await staleFrom(layout, await readMarker(layout), agents, ROLES);\n\n return withSession(daemon.daemon, async session => {\n const operations = await planRoom(session, desired, stale);\n const pending = operations.filter(operation => operation.action !== 'noop');\n if (!options.apply) {\n return {\n command: 'setup', outcome: pending.length > 0 ? 'changes-planned' : 'ok', changed: false, checks, operations,\n } satisfies Result;\n }\n await applyEntries(desired.entries);\n for (const path of stale.directories) await rm(path, { recursive: true, force: true });\n const ids = Object.keys(desired.providers);\n await session.writeProviders(desired.providers);\n if (stale.providerIds.length > 0) await session.removeProviders(stale.providerIds);\n await session.refresh(ids);\n return {\n command: 'setup', outcome: 'ok', changed: pending.length > 0,\n checks: [...checks, pass('room.applied', `Room ready at ${layout.roomHome} with ${String(ids.length)} Paseo providers.`)],\n operations,\n } satisfies Result;\n }, sessionOptions(options));\n}\n\nexport async function verify(options: RunOptions = {}): Promise<Result> {\n const layout = resolveLayout(options, options.env);\n const marker = await readMarker(layout);\n if (!marker) {\n return failed('verify', [fail('room.marker', `No room found at ${layout.roomHome}.`, 'Run: paseo-room setup --apply')]);\n }\n const invalid = layoutChecks(layout, marker.agents);\n if (invalid.length > 0) return failed('verify', invalid);\n const daemon = await checkDaemon(layout, options.env);\n if (!daemon.daemon) return failed('verify', daemon.checks);\n const desired = await buildDesired(layout, marker.agents, marker.roles);\n const checks = [...daemon.checks, ...desired.checks];\n if (hasFailure(checks)) return failed('verify', checks);\n\n return withSession(daemon.daemon, async session => {\n const operations = await planRoom(session, desired, NOTHING_STALE);\n const drifted = operations.filter(operation => operation.action !== 'noop');\n const providers = drifted.filter(operation => operation.kind === 'provider').length;\n const files = drifted.length - providers;\n const all: Check[] = [...checks,\n files === 0\n ? pass('room.files', 'Every managed role file matches the current definition.')\n : fail('room.files', `${String(files)} managed role files are missing or outdated.`, 'Run: paseo-room setup --apply'),\n providers === 0\n ? pass('room.providers', `All ${String(Object.keys(desired.providers).length)} Paseo providers are registered as expected.`)\n : fail('room.providers', `${String(providers)} Paseo providers are missing or differ.`, 'Run: paseo-room setup --apply'),\n ];\n return {\n command: 'verify', outcome: hasFailure(all) ? 'failed' : 'ok', changed: false, checks: all, operations,\n } satisfies Result;\n }, sessionOptions(options));\n}\n\nexport async function remove(options: RunOptions = {}): Promise<Result> {\n const layout = resolveLayout(options, options.env);\n const marker = await readMarker(layout);\n if (!marker) {\n return failed('remove', [fail('room.marker', `No room found at ${layout.roomHome}.`, 'Nothing to remove; the room home was never created here.')]);\n }\n // A recursive delete needs a floor, so the layout rules gate this command too.\n const invalid = layoutChecks(layout, marker.agents);\n if (invalid.length > 0) return failed('remove', invalid);\n const ids = marker.agents.flatMap(agent => marker.roles.map(role => providerId(agent, role)));\n const operations: Operation[] = [\n ...ids.map(id => ({ action: 'remove', kind: 'provider', target: id }) satisfies Operation),\n { action: 'remove', kind: 'dir', target: layout.roomHome },\n ];\n if (!options.apply) {\n return { command: 'remove', outcome: 'changes-planned', changed: false, checks: [], operations };\n }\n const daemon = await checkDaemon(layout, options.env);\n const checks: Check[] = [];\n if (daemon.daemon) {\n await withSession(daemon.daemon, session => session.removeProviders(ids), sessionOptions(options));\n checks.push(pass('room.providers', `Removed ${String(ids.length)} Paseo providers.`));\n } else {\n checks.push({ id: 'room.providers', status: 'warn', message: 'Paseo is unreachable; provider entries were left in place.', fix: 'Start Paseo and run remove again to clear them.' });\n }\n // Only the room home is deleted; agent homes were never written to.\n await rm(layout.roomHome, { recursive: true, force: true });\n checks.push(pass('room.files', `Deleted ${layout.roomHome}.`));\n return { command: 'remove', outcome: 'ok', changed: true, checks, operations };\n}\n","import * as clack from '@clack/prompts';\nimport { AGENTS, remove, setup, verify, type RunOptions } from './commands.js';\nimport type { Result } from './result.js';\nimport { AGENT_IDS, type AgentId } from './roles.js';\n\nexport interface Prompts {\n select(options: { readonly message: string; readonly options: readonly { readonly value: string; readonly label: string }[] }): Promise<string | symbol>;\n multiselect(options: { readonly message: string; readonly options: readonly { readonly value: AgentId; readonly label: string }[] }): Promise<AgentId[] | symbol>;\n confirm(options: { readonly message: string }): Promise<boolean | symbol>;\n}\nexport const terminalPrompts: Prompts = {\n select: options => clack.select({ message: options.message, options: [...options.options] }),\n multiselect: options => clack.multiselect({ message: options.message, options: [...options.options], required: true }),\n confirm: options => clack.confirm({ message: options.message, initialValue: false }),\n};\n\n/** Guided path over the same commands the flags use; nothing extra happens here. */\nexport async function runWizard(\n prompts: Prompts,\n emit: (result: Result) => number,\n write: (text: string) => void,\n options: RunOptions = {},\n): Promise<number> {\n const cancelled = (): number => { write('Cancelled; nothing was changed.\\n'); return 0; };\n const action = await prompts.select({\n message: 'What do you want to do?',\n options: [\n { value: 'setup', label: 'Set up / update the room' },\n { value: 'verify', label: 'Verify the current room' },\n { value: 'remove', label: 'Remove the room' },\n ],\n });\n if (typeof action === 'symbol') return cancelled();\n if (action === 'verify') return emit(await verify(options));\n if (action === 'remove') {\n const preview = await remove(options);\n const status = emit(preview);\n if (preview.outcome !== 'changes-planned') return status;\n const approved = await prompts.confirm({ message: 'Delete the room home and its Paseo providers?' });\n return approved === true ? emit(await remove({ ...options, apply: true })) : cancelled();\n }\n const agents = await prompts.multiselect({\n message: 'Which coding agents should the room use?',\n options: AGENT_IDS.map(value => ({ value, label: AGENTS[value].label })),\n });\n if (typeof agents === 'symbol' || agents.length === 0) return cancelled();\n const preview = await setup({ ...options, agents });\n const status = emit(preview);\n if (preview.outcome !== 'changes-planned') return status;\n const approved = await prompts.confirm({ message: 'Apply these changes?' });\n if (approved !== true) return cancelled();\n return emit(await setup({ ...options, agents, apply: true }));\n}\n","import { Command, CommanderError } from 'commander';\nimport metadata from '../package.json' with { type: 'json' };\nimport { remove, setup, verify, type RunOptions } from './commands.js';\nimport { renderHuman, renderJson } from './render.js';\nimport { exitCode, fail, failed, type Result } from './result.js';\nimport { AGENT_IDS, type AgentId } from './roles.js';\nimport type { Prompts } from './wizard.js';\n\nexport interface Output {\n readonly stdout: (text: string) => void;\n readonly stderr: (text: string) => void;\n}\nexport interface CliContext {\n readonly isTTY?: boolean;\n readonly prompts?: Prompts;\n readonly options?: RunOptions;\n}\n\n/** Commander passes no initial value, so the first call starts the list. */\nfunction collectAgent(value: string, previous: AgentId[] | undefined): AgentId[] {\n const agent = AGENT_IDS.find(id => id === value);\n if (!agent) throw new CommanderError(2, 'agent', `Unknown agent: ${value}`);\n const seated = previous ?? [];\n return seated.includes(agent) ? seated : [...seated, agent];\n}\n\nconst PATH_FLAGS = ['roomHome', 'codexHome', 'claudeHome', 'codexBin', 'claudeBin', 'paseoBin'] as const;\n\nfunction optionsFrom(raw: Record<string, unknown>, base: RunOptions): RunOptions {\n const paths: Record<string, string> = {};\n for (const flag of PATH_FLAGS) {\n const value = raw[flag];\n if (typeof value === 'string' && value.trim()) paths[flag] = value.trim();\n }\n const agents = Array.isArray(raw.agent) && raw.agent.length > 0 ? (raw.agent as AgentId[]) : undefined;\n return { ...base, ...paths, ...(agents ? { agents } : {}), ...(raw.apply === true ? { apply: true } : {}) };\n}\n\nexport async function runCli(argv: readonly string[], output: Output, context: CliContext = {}): Promise<number> {\n const password = (context.options?.env ?? process.env).PASEO_PASSWORD;\n const redact = (text: string): string => (password ? text.split(password).join('[redacted]') : text);\n // Set once the flags are parsed; the wizard path never sees flags, so text output is right there.\n let json = false;\n const emit = (result: Result): number => {\n output.stdout(redact(json ? renderJson(result) : renderHuman(result)));\n return exitCode(result);\n };\n const isTTY = context.isTTY ?? (process.stdin.isTTY && process.stdout.isTTY);\n const base = context.options ?? {};\n\n if (argv.length === 0) {\n if (!isTTY) {\n output.stderr('paseo-room: no command given. Try: paseo-room setup, verify, remove, or --help.\\n');\n return 2;\n }\n // @clack/prompts is only reachable here, so keep it off the scripted path.\n const { runWizard, terminalPrompts } = await import('./wizard.js');\n return runWizard(context.prompts ?? terminalPrompts, emit, text => { output.stdout(text); }, base);\n }\n\n const program = new Command()\n .name('paseo-room')\n .description('Configure Codex/Claude role homes in $HOME and register them with your local Paseo daemon.')\n .version(metadata.version)\n .argument('<command>', 'setup | verify | remove')\n .option('--agent <agent>', 'codex or claude; repeat for both (default: codex)', collectAgent)\n .option('--apply', 'actually make the changes (default: dry run)')\n .option('--json', 'machine-readable output')\n .option('--room-home <path>', 'where role homes are written (default: ~/.paseo-room)')\n .option('--codex-home <path>', 'source Codex config (default: ~/.codex)')\n .option('--claude-home <path>', 'source Claude Code config (default: ~/.claude)')\n .option('--codex-bin <path>', 'Codex executable (default: found on PATH)')\n .option('--claude-bin <path>', 'Claude Code executable (default: found on PATH)')\n .option('--paseo-bin <path>', 'Paseo executable (default: found on PATH)')\n .configureOutput({ writeOut: text => { output.stdout(text); }, writeErr: text => { output.stderr(text); } })\n .exitOverride();\n\n let command: string;\n let options: RunOptions;\n try {\n program.parse([...argv], { from: 'user' });\n const raw = program.opts<Record<string, unknown>>();\n json = raw.json === true;\n command = program.args[0] ?? '';\n options = optionsFrom(raw, base);\n } catch (error) {\n if (error instanceof CommanderError && error.exitCode === 0) return 0;\n return 2;\n }\n\n try {\n if (command === 'setup') return emit(await setup(options));\n if (command === 'verify') return emit(await verify(options));\n if (command === 'remove') return emit(await remove(options));\n } catch (error) {\n const detail = error instanceof Error ? error.message : 'unknown error';\n return emit(failed(command, [fail(`${command}.error`, redact(detail), 'Check that Paseo is running and reachable, then try again.')]));\n }\n output.stderr(`paseo-room: unknown command \"${command}\". Try: setup, verify, remove.\\n`);\n return 2;\n}\n","import type { Result } from './result.js';\n\nexport function renderJson(result: Result): string {\n return `${JSON.stringify({ schemaVersion: 2, ...result }, null, 2)}\\n`;\n}\n\nconst ICONS = { pass: '✓', warn: '!', fail: '✗' } as const;\n\nexport function renderHuman(result: Result): string {\n const lines: string[] = [];\n for (const check of result.checks) {\n lines.push(`${ICONS[check.status]} ${check.message}`);\n if (check.fix) lines.push(` → ${check.fix}`);\n }\n const changes = result.operations.filter(operation => operation.action !== 'noop');\n if (changes.length > 0) {\n lines.push('', result.changed ? 'Applied:' : 'Planned changes:');\n for (const operation of changes) lines.push(` ${operation.action} ${operation.kind} ${operation.target}`);\n const unchanged = result.operations.length - changes.length;\n if (unchanged > 0) lines.push(` (${String(unchanged)} already up to date)`);\n } else if (result.operations.length > 0) {\n lines.push('', 'Everything is already up to date.');\n }\n lines.push('', `${result.command}: ${result.outcome}`);\n return `${lines.join('\\n')}\\n`;\n}\n","#!/usr/bin/env node\nimport { runCli } from './cli.js';\n\nprocess.exitCode = await runCli(process.argv.slice(2), {\n stdout: text => { process.stdout.write(text); },\n stderr: text => { process.stderr.write(text); },\n});\n"],"mappings":";;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,MACX,aAAe;AAAA,MACf,UAAY;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,UAAY;AAAA,MACZ,MAAQ;AAAA,MACR,YAAc;AAAA,QACZ,MAAQ;AAAA,QACR,KAAO;AAAA,MACT;AAAA,MACA,SAAW;AAAA,MACX,QAAU;AAAA,MACV,MAAQ;AAAA,MACR,SAAW;AAAA,QACT,MAAQ;AAAA,MACV;AAAA,MACA,KAAO;AAAA,QACL,cAAc;AAAA,MAChB;AAAA,MACA,OAAS;AAAA,QACP;AAAA,MACF;AAAA,MACA,SAAW;AAAA,QACT,WAAa;AAAA,QACb,MAAQ;AAAA,QACR,MAAQ;AAAA,QACR,OAAS;AAAA,QACT,SAAW;AAAA,QACX,QAAU;AAAA,MACZ;AAAA,MACA,cAAgB;AAAA,QACd,kBAAkB;AAAA,QAClB,oBAAoB;AAAA,QACpB,WAAa;AAAA,QACb,QAAU;AAAA,QACV,aAAa;AAAA,QACb,KAAO;AAAA,MACT;AAAA,MACA,iBAAmB;AAAA,QACjB,cAAc;AAAA,QACd,eAAe;AAAA,QACf,iBAAiB;AAAA,QACjB,QAAU;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AI,GAAG,EAAE,MAAM,OAAO,CAAC;AACzC,UAAM,MAAM,QAAQ,KAA8B;AAClD,WAAO,IAAI,SAAS;AACpB,cAAU,QAAQ,KAAK,CAAC,KAAK;AAC7B,cAAU,YAAY,KAAK,IAAI;AAAA,EACjC,SAAS,OAAO;AACd,QAAI,iBAAiB,kBAAkB,MAAM,aAAa,EAAG,QAAO;AACpE,WAAO;AAAA,EACT;AAEA,MAAI;AACF,QAAI,YAAY,QAAS,QAAO,KAAK,MAAM,MAAM,OAAO,CAAC;AACzD,QAAI,YAAY,SAAU,QAAO,KAAK,MAAM,OAAO,OAAO,CAAC;AAC3D,QAAI,YAAY,SAAU,QAAO,KAAK,MAAM,OAAO,OAAO,CAAC;AAAA,EAC7D,SAAS,OAAO;AACd,UAAM,SAAS,iBAAiB,QAAQ,MAAM,UAAU;AACxD,WAAO,KAAK,OAAO,SAAS,CAAC,KAAK,GAAG,OAAO,UAAU,OAAO,MAAM,GAAG,4DAA4D,CAAC,CAAC,CAAC;AAAA,EACvI;AACA,SAAO,OAAO,gCAAgC,OAAO;AAAA,CAAkC;AACvF,SAAO;AACT;;;AEjGA,QAAQ,WAAW,MAAM,OAAO,QAAQ,KAAK,MAAM,CAAC,GAAG;AAAA,EACrD,QAAQ,UAAQ;AAAE,YAAQ,OAAO,MAAM,IAAI;AAAA,EAAG;AAAA,EAC9C,QAAQ,UAAQ;AAAE,YAAQ,OAAO,MAAM,IAAI;AAAA,EAAG;AAChD,CAAC;","names":["join","join","resolve","join","basename","join","SHARED","run","join","z","join","rm","preview","status","approved","runWizard","terminalPrompts"]}
|
|
1
|
+
{"version":3,"sources":["../package.json","../src/result.ts","../src/layout.ts","../src/fsops.ts","../src/room/clauses.ts","../src/room/workspace.ts","../src/room/instructions.ts","../src/which.ts","../src/agents/claude.ts","../src/agents/codex.ts","../src/paseo.ts","../src/roles.ts","../src/room.ts","../src/commands.ts","../src/wizard.ts","../src/cli.ts","../src/render.ts","../src/index.ts"],"sourcesContent":["{\n \"name\": \"paseo-room\",\n \"version\": \"0.1.0-alpha.2\",\n \"description\": \"One CLI that configures Codex/Claude role homes in $HOME and registers them with your local Paseo daemon.\",\n \"keywords\": [\n \"paseo\",\n \"codex\",\n \"claude-code\",\n \"agent\",\n \"orchestration\",\n \"cli\"\n ],\n \"homepage\": \"https://github.com/cuongntr/paseo-room#readme\",\n \"bugs\": \"https://github.com/cuongntr/paseo-room/issues\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/cuongntr/paseo-room.git\"\n },\n \"license\": \"MIT\",\n \"author\": \"Invoker <cuongnt1987@gmail.com>\",\n \"type\": \"module\",\n \"engines\": {\n \"node\": \">=22\"\n },\n \"bin\": {\n \"paseo-room\": \"dist/index.js\"\n },\n \"files\": [\n \"dist/\"\n ],\n \"scripts\": {\n \"typecheck\": \"tsc --noEmit\",\n \"lint\": \"eslint . --max-warnings 0\",\n \"test\": \"vitest run\",\n \"build\": \"tsup\",\n \"prepack\": \"npm run build\",\n \"verify\": \"npm run typecheck && npm run lint && npm test && npm run build\"\n },\n \"dependencies\": {\n \"@clack/prompts\": \"^1.8.0\",\n \"@getpaseo/client\": \"0.8.0-beta.1\",\n \"commander\": \"^14.0.3\",\n \"semver\": \"^7.8.5\",\n \"smol-toml\": \"^1.8.0\",\n \"zod\": \"^4.5.4\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^10.0.1\",\n \"@types/node\": \"^22.0.0\",\n \"@types/semver\": \"^7.7.0\",\n \"eslint\": \"^10.10.0\",\n \"tsup\": \"^8.5.1\",\n \"typescript\": \"~5.9.3\",\n \"typescript-eslint\": \"^8.70.0\",\n \"vitest\": \"^4.1.11\"\n }\n}\n","export type Status = 'pass' | 'warn' | 'fail';\nexport interface Check {\n readonly id: string;\n readonly status: Status;\n readonly message: string;\n readonly fix?: string;\n}\nexport interface Operation {\n readonly action: 'create' | 'update' | 'remove' | 'noop';\n readonly kind: 'dir' | 'file' | 'link' | 'provider';\n readonly target: string;\n}\nexport type Outcome = 'ok' | 'changes-planned' | 'failed';\nexport interface Result {\n readonly command: string;\n readonly outcome: Outcome;\n readonly changed: boolean;\n readonly checks: readonly Check[];\n readonly operations: readonly Operation[];\n}\n\nexport function pass(id: string, message: string): Check {\n return { id, status: 'pass', message };\n}\nexport function fail(id: string, message: string, fix: string): Check {\n return { id, status: 'fail', message, fix };\n}\nexport function failed(command: string, checks: readonly Check[]): Result {\n return { command, outcome: 'failed', changed: false, checks, operations: [] };\n}\nexport function hasFailure(checks: readonly Check[]): boolean {\n return checks.some(check => check.status === 'fail');\n}\nexport function exitCode(result: Result): number {\n return result.outcome === 'failed' || hasFailure(result.checks) ? 1 : 0;\n}\n","import { homedir } from 'node:os';\nimport { join, resolve, sep } from 'node:path';\nimport { fail, type Check } from './result.js';\nimport type { AgentId, Role } from './roles.js';\n\nexport interface Options {\n readonly roomHome?: string;\n readonly codexHome?: string;\n readonly claudeHome?: string;\n readonly codexBin?: string;\n readonly claudeBin?: string;\n readonly paseoBin?: string;\n}\nexport interface Layout {\n readonly home: string;\n readonly roomHome: string;\n readonly paseoHome: string;\n readonly agentHome: Record<AgentId, string>;\n readonly bin: Record<AgentId | 'paseo', string>;\n /** The PATH executables are looked up on. Resolved here so nothing reaches for process.env. */\n readonly searchPath: string;\n}\n\nfunction pick(...candidates: readonly (string | undefined)[]): string {\n for (const candidate of candidates) if (candidate?.trim()) return candidate.trim();\n throw new Error('Could not determine HOME; pass explicit --room-home and --codex-home/--claude-home paths.');\n}\n\n/** Everything is derived from HOME; flags and environment only override defaults. */\nexport function resolveLayout(options: Options = {}, env: NodeJS.ProcessEnv = process.env): Layout {\n const home = pick(env.HOME, homedir());\n // Relative overrides resolve against the working directory, as a CLI flag should.\n return {\n home,\n roomHome: resolve(pick(options.roomHome, env.PASEO_ROOM_HOME, join(home, '.paseo-room'))),\n paseoHome: resolve(pick(env.PASEO_HOME, join(home, '.paseo'))),\n agentHome: {\n codex: resolve(pick(options.codexHome, env.CODEX_HOME, join(home, '.codex'))),\n claude: resolve(pick(options.claudeHome, env.CLAUDE_CONFIG_DIR, join(home, '.claude'))),\n },\n bin: {\n codex: pick(options.codexBin, env.CODEX_BIN, 'codex'),\n claude: pick(options.claudeBin, env.CLAUDE_BIN, 'claude'),\n paseo: pick(options.paseoBin, env.PASEO_BIN, 'paseo'),\n },\n searchPath: env.PATH ?? '',\n };\n}\n\n/** True when `path` is the root itself or sits underneath it. */\nexport function contains(root: string, path: string): boolean {\n return path === root || path.startsWith(root.endsWith(sep) ? root : root + sep);\n}\n\n/** The room home must own its directory: no overlap with $HOME or a source agent home. */\nexport function layoutChecks(layout: Layout, agents: readonly AgentId[]): Check[] {\n const checks: Check[] = [];\n if (contains(layout.roomHome, layout.home)) {\n checks.push(fail('room.home', `Refusing to use ${layout.roomHome} as the room home: it contains your home directory.`,\n 'Point --room-home at a dedicated directory, by default ~/.paseo-room.'));\n }\n for (const id of agents) {\n const home = layout.agentHome[id];\n if (contains(layout.roomHome, home) || contains(home, layout.roomHome)) {\n checks.push(fail(`${id}.home`, `The ${id} home ${home} overlaps the room home ${layout.roomHome}.`,\n `Pass --${id}-home pointing at your own ${id} configuration (this happens when setup runs inside a room seat).`));\n }\n }\n return checks;\n}\n\nexport function roleHome(layout: Layout, agent: AgentId, role: Role): string {\n return join(layout.roomHome, 'roles', agent, role);\n}\nexport function sharedRoom(layout: Layout): string {\n return join(layout.roomHome, 'room');\n}\n","import { chmod, lstat, mkdir, readFile, readlink, rm, symlink, writeFile } from 'node:fs/promises';\nimport { dirname, join } from 'node:path';\nimport type { Operation } from './result.js';\n\nexport type Entry =\n | { readonly kind: 'dir'; readonly path: string }\n /** `once` writes the file only when absent: runtime state the agent owns after setup. */\n | { readonly kind: 'file'; readonly path: string; readonly content: string; readonly once?: true }\n | { readonly kind: 'link'; readonly path: string; readonly target: string };\n\nconst DIR_MODE = 0o700;\nconst FILE_MODE = 0o600;\n\nasync function current(entry: Entry): Promise<'absent' | 'same' | 'different'> {\n let stat;\n try { stat = await lstat(entry.path); } catch { return 'absent'; }\n if (entry.kind === 'dir') return stat.isDirectory() ? 'same' : 'different';\n if (entry.kind === 'link') {\n if (!stat.isSymbolicLink()) return 'different';\n return await readlink(entry.path) === entry.target ? 'same' : 'different';\n }\n if (!stat.isFile()) return 'different';\n if (entry.once) return 'same';\n return await readFile(entry.path, 'utf8') === entry.content ? 'same' : 'different';\n}\n\n/** Everything lives under the room home, which this CLI owns outright. */\nexport async function planEntries(entries: readonly Entry[]): Promise<Operation[]> {\n const operations: Operation[] = [];\n for (const entry of entries) {\n const state = await current(entry);\n operations.push({\n action: state === 'same' ? 'noop' : state === 'absent' ? 'create' : 'update',\n kind: entry.kind,\n target: entry.path,\n });\n }\n return operations;\n}\n\n/** Rewrites only what differs, so a repeat run costs stats rather than writes. */\nexport async function applyEntries(entries: readonly Entry[]): Promise<void> {\n for (const entry of entries) {\n if (await current(entry) === 'same') continue;\n if (entry.kind === 'dir') {\n await mkdir(entry.path, { recursive: true, mode: DIR_MODE });\n continue;\n }\n await mkdir(dirname(entry.path), { recursive: true, mode: DIR_MODE });\n await rm(entry.path, { force: true, recursive: true });\n if (entry.kind === 'link') await symlink(entry.target, entry.path);\n else {\n await writeFile(entry.path, entry.content, { mode: FILE_MODE });\n await chmod(entry.path, FILE_MODE);\n }\n }\n}\n\nexport async function exists(path: string): Promise<boolean> {\n try { await lstat(path); return true; } catch { return false; }\n}\n\n/** Which of `names` exist under `home`, probed once for all roles that share them. */\nexport async function existingPaths(home: string, names: readonly string[]): Promise<string[]> {\n const paths = names.map(name => join(home, name));\n const present = await Promise.all(paths.map(exists));\n return paths.filter((_, index) => present[index] === true);\n}\n\nexport async function readIfPresent(path: string): Promise<string | undefined> {\n try { return await readFile(path, 'utf8'); } catch { return undefined; }\n}\n","/**\n * The room's authority contract, in the wording the agents actually read.\n *\n * Write each statement as ordinary wrapped prose. Blank lines separate\n * statements; line breaks inside a statement are just there for reading and\n * collapse into single spaces when rendered.\n */\nexport function clause(source: string): readonly string[] {\n return source\n .trim()\n .split(/\\n\\s*\\n/)\n .map(statement => statement.split('\\n').map(line => line.trim()).join(' '));\n}\n\nexport const CLAUSES = {\n 'RC-001': clause(`\n Human owns product goals, priority, material-cost choices, external effects, and\n irreversible-risk decisions. No agent may take ownership of these decisions; obtain\n Human approval before crossing those boundaries.\n\n Human may direct the technical route, decomposition, and lifecycle, and may override\n an acceptance decision. Human does not normally operate the agent protocol.\n `),\n\n 'RC-002': clause(`\n A workspace protocol governs repository-local workflow: topology, verification\n commands, review rhythm, escalation routes, and project conventions. The room ships a\n default, and the part of it that bears on this role is reproduced at the end of this\n document. That default is in force wherever the repository says nothing.\n\n When the repository provides docs/WORKSPACE_PROTOCOL.md, read the parts that bear on\n your own work and follow them wherever they speak to a point. A repository rule wins\n over the default on that point; the default still holds everywhere the repository is\n silent.\n\n Neither the default nor a repository file can weaken this authority contract. No\n protocol can give Peer orchestration, give Supervisor or Peer technical acceptance,\n permit multiple writable Peers, or transfer Human decisions to an agent.\n `),\n\n 'RC-003': clause(`\n Use tests, artifacts, lifecycle states, and completion/error/attention events as\n evidence, not as automatic authorization or acceptance.\n\n Wait for state-changing events when progress depends on another actor. Do not\n repeatedly poll unchanged state; resume when new evidence or a relevant event arrives.\n `),\n\n 'RC-004': clause(`\n Preserve unrelated work. Stay within the granted repository scope and external-action\n authority; do not treat access to a tool as permission to expand either boundary.\n `),\n\n 'RC-101': clause(`\n Supervisor routes the Human directive to Lead without changing its outcome, requested\n output, constraints, or approval gates. Label added context separately; it must not\n rewrite the directive.\n `),\n\n 'RC-102': clause(`\n Supervisor observes technical work rather than choosing architecture, decomposing\n work, or moving write ownership. Prefer routing work through Lead.\n\n Supervisor must not edit project work, run project validation, or decide technical\n acceptance. Supervisor must not direct Peer while Lead is healthy; an unhealthy Lead\n calls for bounded recovery or escalation, not taking over Peer work.\n `),\n\n 'RC-103': clause(`\n Supervisor has Paseo tools enabled solely within its authority. Use the smallest Paseo\n room/session lifecycle action needed for an explicit Human request or bounded room\n recovery; preserve current ownership and inform Lead of every change.\n `),\n\n 'RC-104': clause(`\n Supervisor sends technical questions and evidence to Lead. Escalate product, priority,\n material-cost, external-effect, and irreversible-risk choices to Human rather than\n deciding them.\n `),\n\n 'RC-201': clause(`\n Lead owns project framing, architecture, dependencies, integration, verification, and\n technical acceptance within Human boundaries. Lead executes the Human outcome and\n constraints, escalating Human-owned choices to Human.\n\n Lead has Paseo tools enabled to manage project agents and direct Peer; this capability\n does not expand project or external-action authority.\n `),\n\n 'RC-202': clause(`\n Lead owns decomposition and moving write-scope assignment: give each moving scope\n exactly one owner, with at most one active writable Peer across the project at a time.\n Lead must not edit a scope concurrently with its writing Peer.\n\n Before transferring write ownership, stop the prior writer and establish a stable\n handoff. Read-only review does not create another writer.\n `),\n\n 'RC-203': clause(`\n Before delegation, Lead supplies a complete Peer brief: one bounded outcome,\n prerequisites, explicit write scope or read-only mode, stable contract and invariants,\n required acceptance evidence, and conditions that reopen the decision.\n `),\n\n 'RC-204': clause(`\n Lead permits independent Peer judgment: REOPEN_REQUEST challenges a premise;\n DEPENDENCY_REQUEST asks for an unowned prerequisite; BLOCKED reports that no safe\n progress is possible.\n\n For each signal, Peer provides evidence, consequence, and the needed decision or\n dependency. Lead resolves technical signals or escalates Human-owned choices; Peer\n must not seize unowned work while waiting.\n `),\n\n 'RC-205': clause(`\n Lead inspects the exact candidate or a deterministic snapshot and explicitly accepts\n or rejects it with a technical reason. Passing tests and completion reports are\n evidence, not acceptance. Among agents, Lead alone accepts; Human retains override\n authority.\n `),\n\n 'RC-206': clause(`\n When material uncertainty warrants independent review, Lead may dispatch a fresh\n read-only Peer with an exact stable candidate and a bounded question. Review is\n optional: do not introduce a dedicated reviewer role or a fixed reviewer count.\n `),\n\n 'RC-301': clause(`\n Peer owns exactly one Lead-delegated bounded outcome and proportionate evidence. Do\n not add adjacent tasks; send technical questions to Lead and escalate Human-owned\n choices through Lead.\n `),\n\n 'RC-302': clause(`\n A writing Peer owns only its assigned moving write scope. A review Peer stays\n read-only and inspects only the named candidate or snapshot, without changing project\n files or the candidate.\n `),\n\n 'RC-303': clause(`\n Peer must not spawn, manage, coordinate, or infer room topology, direct another Peer,\n or perform Paseo room/session lifecycle operations. Peer receives no Paseo tools;\n enabled is false. This capability boundary is not an operating-system sandbox.\n `),\n\n 'RC-304': clause(`\n Peer hands off a candidate by naming an immutable commit or deterministic snapshot,\n the original base, all changed paths, verification performed and its results, and\n residual risk. Make the candidate reproducible for Lead inspection.\n `),\n\n 'RC-305': clause(`\n Peer must not self-accept any work, including difficult work. Peer tests and\n completion are evidence only; Lead alone performs technical acceptance among agents,\n subject to Human override.\n `),\n};\n\nexport type RoleContractId = keyof typeof CLAUSES;\nexport const SHARED_IDS = ['RC-001', 'RC-002', 'RC-003', 'RC-004'] as const;\n","/**\n * The room's default workspace protocol: the repository-local layer of the model,\n * in the wording the seats actually read.\n *\n * It ships in force, not as something to copy. A repository that needs different\n * rules writes its own docs/WORKSPACE_PROTOCOL.md, which wins wherever it speaks\n * (RC-002).\n *\n * Keep every statement here workflow, and keep it new. Authority belongs in\n * clauses.ts: restating a clause here teaches the seat nothing and blurs the\n * boundary the two layers depend on. Anything true of only one project belongs in\n * that project's own file.\n */\nimport { clause } from './clauses.js';\n\nexport const DEFAULT_PROTOCOL = {\n 'WP-01 Topology': clause(`\n Match the shape of the work to its difficulty. A change Lead can make correctly in one\n sitting is made by Lead, without a Peer: delegation costs a brief, a handoff and a\n review, and a trivial change does not repay them.\n\n When the route itself is uncertain, spend a read-only Peer on the question before\n spending a writable Peer on the answer.\n `),\n\n 'WP-02 Verification': clause(`\n The repository's own gate is the evidence. Lead names the exact command in the brief;\n Peer runs it and reports the result as it came back, failures included. A candidate\n whose gate was not run is not a candidate.\n\n Do not report part of the gate as the whole of it, and do not report work as done while\n any part of it is unrun.\n `),\n\n 'WP-03 Review': clause(`\n Review runs in a fresh session rather than a continuation of the writer's. A session\n that produced the work cannot be surprised by it.\n `),\n\n 'WP-04 Repository conventions': clause(`\n Follow the conventions already visible in the files being changed rather than importing\n a different house style alongside them.\n\n Do not add top-level files, directories, dependencies or tooling the brief did not ask\n for. A repository that wants them will say so in its own protocol.\n `),\n};\n\nexport type ProtocolId = keyof typeof DEFAULT_PROTOCOL;\n","import type { Role } from '../roles.js';\nimport { CLAUSES, SHARED_IDS, type RoleContractId } from './clauses.js';\nimport { DEFAULT_PROTOCOL, type ProtocolId } from './workspace.js';\n\nexport type InstructionKind = Role | 'workspace';\n\nconst ROLE_IDS: Record<Role, readonly RoleContractId[]> = {\n supervisor: ['RC-101', 'RC-102', 'RC-103', 'RC-104'],\n lead: ['RC-201', 'RC-202', 'RC-203', 'RC-204', 'RC-205', 'RC-206'],\n // Peer needs the challenge protocol as well as its own numbered obligations.\n peer: ['RC-204', 'RC-301', 'RC-302', 'RC-303', 'RC-304', 'RC-305'],\n};\n\n// Topology is Lead's decision and Supervisor's to audit. RC-303 forbids Peer to\n// infer room topology, so handing Peer the topology rules would contradict its\n// own contract.\nconst PROTOCOL_IDS: Record<Role, readonly ProtocolId[]> = {\n supervisor: ['WP-01 Topology', 'WP-02 Verification', 'WP-03 Review', 'WP-04 Repository conventions'],\n lead: ['WP-01 Topology', 'WP-02 Verification', 'WP-03 Review', 'WP-04 Repository conventions'],\n peer: ['WP-02 Verification', 'WP-03 Review', 'WP-04 Repository conventions'],\n};\n\nconst PREFACES: Record<Role, string> = {\n supervisor: 'You are Supervisor, the Human-facing routing seat, not the project Lead.',\n lead: 'You are Lead, the project technical owner under Human authority.',\n peer: 'You are Peer, executing one brief from Lead in writing or read-only review mode.',\n};\n\nconst TITLES: Record<Role, string> = {\n supervisor: 'Supervisor role instructions',\n lead: 'Lead role instructions',\n peer: 'Peer role instructions',\n};\n\nconst PROTOCOL_TITLE = 'Workspace protocol';\n// Stated without a clause number, because this preface also heads the copy written\n// to the room home, where no clause is present to resolve the reference.\nconst PROTOCOL_PREFACE = [\n 'This is the room default, and it is in force now. A repository that needs different rules',\n 'provides `docs/WORKSPACE_PROTOCOL.md`: read it, follow it wherever it speaks to a point,',\n 'and keep what follows where it is silent.',\n].join('\\n');\n\nexport function instructionIds(role: Role): readonly RoleContractId[] {\n // Every role carries the shared authority contract plus its own obligations.\n return [...SHARED_IDS, ...ROLE_IDS[role]];\n}\n\nexport function protocolIds(role: Role): readonly ProtocolId[] {\n return PROTOCOL_IDS[role];\n}\n\nfunction sections(ids: readonly string[], source: Readonly<Record<string, readonly string[]>>): string[] {\n return ids.map(id => `## ${id}\\n${(source[id] ?? []).map(statement => `- ${statement}`).join('\\n')}`);\n}\n\n/** The protocol travels inside every role document, so no repository has to opt in. */\nfunction protocol(ids: readonly ProtocolId[]): string[] {\n return [`# ${PROTOCOL_TITLE}`, PROTOCOL_PREFACE, ...sections(ids, DEFAULT_PROTOCOL)];\n}\n\nexport function renderInstructions(kind: InstructionKind): string {\n if (kind === 'workspace') {\n return protocol(Object.keys(DEFAULT_PROTOCOL) as ProtocolId[]).join('\\n\\n') + '\\n';\n }\n return [\n `# ${TITLES[kind]}`,\n PREFACES[kind],\n ...sections(instructionIds(kind), CLAUSES),\n ...protocol(protocolIds(kind)),\n ].join('\\n\\n') + '\\n';\n}\n","import { execFile } from 'node:child_process';\nimport { access, constants } from 'node:fs/promises';\nimport { delimiter, isAbsolute, join, resolve } from 'node:path';\nimport { promisify } from 'node:util';\n\nconst run = promisify(execFile);\n\n/**\n * Resolve a command to an absolute executable path on `searchPath`.\n *\n * Deliberately not canonicalised. Version managers point a stable name at a\n * versioned file — `~/.local/bin/claude` at `versions/2.1.267`, mise's\n * `node/latest` at `node/24.15.0` — and the resolved target is deleted by the\n * next upgrade. Providers store this path, so following the link would pin every\n * seat to a binary that stops existing.\n */\nexport async function which(command: string, searchPath: string): Promise<string | undefined> {\n const candidates = isAbsolute(command) || command.includes('/')\n ? [resolve(command)]\n : searchPath.split(delimiter).filter(Boolean).map(entry => join(entry, command));\n for (const candidate of candidates) {\n try {\n await access(candidate, constants.X_OK);\n return candidate;\n } catch { /* try the next PATH entry */ }\n }\n return undefined;\n}\n\nexport interface CommandOutput {\n readonly ok: boolean;\n readonly stdout: string;\n}\n/** Bounded, shell-free probe. Failures are reported, never thrown. */\nexport async function probe(executable: string, args: readonly string[], env: NodeJS.ProcessEnv): Promise<CommandOutput> {\n try {\n const { stdout } = await run(executable, [...args], { env, timeout: 20_000, maxBuffer: 16 * 1024 * 1024, encoding: 'utf8' });\n return { ok: true, stdout };\n } catch {\n return { ok: false, stdout: '' };\n }\n}\n","import { basename, join } from 'node:path';\nimport type { Layout } from '../layout.js';\nimport { roleHome } from '../layout.js';\nimport type { Entry } from '../fsops.js';\nimport { existingPaths, exists, readIfPresent } from '../fsops.js';\nimport { fail, pass, type Check } from '../result.js';\nimport type { Role } from '../roles.js';\nimport { renderInstructions } from '../room/instructions.js';\nimport { which } from '../which.js';\nimport type { Agent, AgentPlan } from './types.js';\n\n/** Operator resources shared by reference; credentials stay where Claude put them. */\nconst SHARED = ['.credentials.json', 'skills', 'plugins', 'commands', 'hooks'] as const;\n/** Copied once so a fresh role home does not re-run interactive onboarding. */\nconst SEEDED_KEYS = ['hasCompletedOnboarding', 'theme', 'installMethod', 'userID', 'oauthAccount'] as const;\n\nfunction asObject(value: unknown): Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value) ? { ...value } : {};\n}\n/** Any unreadable or non-object source is simply an empty starting point. */\nfunction readObject(source: string | undefined): Record<string, unknown> {\n try { return asObject(source === undefined ? {} : JSON.parse(source)); } catch { return {}; }\n}\n\n/** Keep the operator's hooks and env (Paseo installs its own), override nothing else. */\nexport function renderRoleSettings(source: string | undefined, role: Role): string {\n const settings = readObject(source);\n settings.env = { ...asObject(settings.env), PASEO_ROOM_ROLE: role };\n return JSON.stringify(settings, null, 2) + '\\n';\n}\n\nexport function renderRoleState(source: string | undefined): string {\n const root = readObject(source);\n const state: Record<string, unknown> = { hasCompletedOnboarding: true };\n for (const key of SEEDED_KEYS) if (key in root) state[key] = root[key];\n return JSON.stringify(state, null, 2) + '\\n';\n}\n\nexport const claudeAgent: Agent = {\n id: 'claude',\n label: 'Claude Code',\n homeEnv: 'CLAUDE_CONFIG_DIR',\n // Claude's own subagents would be a second control plane; Paseo owns agent\n // lifecycle. This is the Claude counterpart of Codex's [agents] enabled = false.\n pins: { disallowedTools: ['Task'] },\n async build(layout: Layout, roles: readonly Role[]): Promise<AgentPlan> {\n const home = layout.agentHome.claude;\n const binary = await which(layout.bin.claude, layout.searchPath);\n if (!binary) {\n return { entries: [], checks: [fail('claude.bin', 'Claude Code executable not found.', 'Install Claude Code, or pass --claude-bin /path/to/claude.')] };\n }\n if (!(await exists(home))) {\n return { entries: [], checks: [fail('claude.home', `No Claude config directory at ${home}.`, 'Run claude once to initialise it, or pass --claude-home.')] };\n }\n const checks: Check[] = [pass('claude.home', `Claude Code found at ${binary} using ${home}.`)];\n\n const settingsSource = await readIfPresent(join(home, 'settings.json'));\n const stateSource = await readIfPresent(join(layout.home, '.claude.json'));\n const shared = await existingPaths(home, SHARED);\n const entries: Entry[] = [];\n for (const role of roles) {\n const target = roleHome(layout, 'claude', role);\n entries.push({ kind: 'dir', path: target });\n entries.push({ kind: 'file', path: join(target, 'CLAUDE.md'), content: renderInstructions(role) });\n entries.push({ kind: 'file', path: join(target, 'settings.json'), content: renderRoleSettings(settingsSource, role) });\n entries.push({ kind: 'file', path: join(target, '.claude.json'), content: renderRoleState(stateSource), once: true });\n for (const path of shared) entries.push({ kind: 'link', path: join(target, basename(path)), target: path });\n }\n return { entries, checks, binary };\n },\n};\n","import { basename, join } from 'node:path';\nimport { parse, stringify, type TomlTable } from 'smol-toml';\nimport type { Layout } from '../layout.js';\nimport { roleHome } from '../layout.js';\nimport type { Entry } from '../fsops.js';\nimport { existingPaths, readIfPresent } from '../fsops.js';\nimport { fail, pass, type Check } from '../result.js';\nimport type { Role } from '../roles.js';\nimport { renderInstructions } from '../room/instructions.js';\nimport { probe, which } from '../which.js';\nimport type { Agent, AgentPlan } from './types.js';\n\n/** Read-only operator resources every role shares by reference, never by copy. */\nconst SHARED = ['auth.json', 'AGENTS.md', 'skills', 'plugins', 'hooks.json'] as const;\nconst CATALOG = 'model-catalog.json';\n\nfunction table(parent: TomlTable, key: string): TomlTable {\n const value = parent[key];\n if (value === undefined || typeof value !== 'object' || Array.isArray(value) || value instanceof Date) {\n return (parent[key] = {});\n }\n return value;\n}\n\nexport interface RoleConfigInput {\n readonly roleDocument: string;\n readonly catalogPath?: string;\n}\n/**\n * Copy the operator's config, then override only the keys the room owns.\n *\n * `model_instructions_file` is deliberately untouched: it *replaces* Codex's base\n * prompt, so writing it would mean vendoring and maintaining a full copy of that\n * prompt. The room contract is additive and belongs in `developer_instructions`.\n */\nexport function renderRoleConfig(source: TomlTable, input: RoleConfigInput): string {\n const config = structuredClone(source);\n config.sandbox_mode = 'danger-full-access';\n config.approval_policy = 'never';\n // An active profile outranks the top-level keys, so the room's must land there too.\n if (typeof config.profile === 'string') {\n const profile = table(table(config, 'profiles'), config.profile);\n profile.sandbox_mode = 'danger-full-access';\n profile.approval_policy = 'never';\n }\n config.developer_instructions = input.roleDocument;\n if (input.catalogPath) config.model_catalog_json = input.catalogPath;\n // Codex's own multi-agent mode would compete with the room's role contract.\n table(config, 'agents').enabled = false;\n const features = table(config, 'features');\n features.multi_agent = false;\n // Newer configs represent v2 as a table; keep that shape rather than writing a\n // boolean at the same key, which would be a TOML conflict.\n if (typeof features.multi_agent_v2 === 'boolean' || features.multi_agent_v2 === undefined) features.multi_agent_v2 = false;\n else table(features, 'multi_agent_v2').enabled = false;\n return stringify(config) + '\\n';\n}\n\nexport function renderCatalog(catalog: unknown): string {\n return JSON.stringify(catalog, (key, value: unknown) => (key === 'multi_agent_version' ? null : value), 2) + '\\n';\n}\n\nexport const codexAgent: Agent = {\n id: 'codex',\n label: 'Codex',\n homeEnv: 'CODEX_HOME',\n // Without these, Paseo's own mode preset (default auto-review) is sent to the\n // app-server and outranks the sandbox/approval keys in the generated config.\n pins: { params: { sandbox_mode: 'danger-full-access', approval_policy: 'never' } },\n async build(layout: Layout, roles: readonly Role[]): Promise<AgentPlan> {\n const checks: Check[] = [];\n const home = layout.agentHome.codex;\n const binary = await which(layout.bin.codex, layout.searchPath);\n if (!binary) {\n return { entries: [], checks: [fail('codex.bin', 'Codex executable not found.', 'Install Codex, or pass --codex-bin /path/to/codex.')] };\n }\n const configPath = join(home, 'config.toml');\n const raw = await readIfPresent(configPath);\n if (raw === undefined) {\n return { entries: [], checks: [fail('codex.home', `No config.toml in ${home}.`, 'Run codex once to initialise it, or pass --codex-home.')] };\n }\n let source: TomlTable;\n try { source = parse(raw); } catch {\n return { entries: [], checks: [fail('codex.config', `Could not read ${configPath} as TOML.`, 'Fix the syntax in your Codex config, then run setup again.')] };\n }\n checks.push(pass('codex.home', `Codex found at ${binary} using ${home}.`));\n\n const entries: Entry[] = [];\n\n // The catalog is optional: an older Codex simply keeps its built-in models.\n let catalogSource: string | undefined;\n const models = await probe(binary, ['debug', 'models'], { HOME: layout.home, CODEX_HOME: home, PATH: layout.searchPath });\n if (models.ok) {\n try { catalogSource = renderCatalog(JSON.parse(models.stdout)); } catch { catalogSource = undefined; }\n }\n if (!catalogSource) checks.push({ id: 'codex.catalog', status: 'warn', message: 'Codex model catalog unavailable; roles keep the default catalog.' });\n\n const shared = await existingPaths(home, SHARED);\n for (const role of roles) {\n const target = roleHome(layout, 'codex', role);\n const catalogPath = catalogSource ? join(target, CATALOG) : undefined;\n const roleDocument = renderInstructions(role);\n entries.push({ kind: 'dir', path: target });\n // Codex reads the brief from developer_instructions; this copy is for the operator.\n entries.push({ kind: 'file', path: join(target, 'role-instructions.md'), content: roleDocument });\n entries.push({\n kind: 'file',\n path: join(target, 'config.toml'),\n content: renderRoleConfig(source, { roleDocument, ...(catalogPath ? { catalogPath } : {}) }),\n });\n if (catalogSource && catalogPath) entries.push({ kind: 'file', path: catalogPath, content: catalogSource });\n for (const path of shared) entries.push({ kind: 'link', path: join(target, basename(path)), target: path });\n }\n return { entries, checks, binary };\n },\n};\n","import type { PaseoClient, PaseoClientConfig } from '@getpaseo/client';\nimport { gte, valid } from 'semver';\nimport { z } from 'zod';\nimport type { Layout } from './layout.js';\nimport { fail, pass, type Check } from './result.js';\nimport type { Provider } from './agents/types.js';\nimport { probe, which } from './which.js';\n\nexport const MINIMUM_VERSION = '0.8.0-beta.1';\n\nconst statusSchema = z.object({\n listen: z.string().min(1),\n localDaemon: z.enum(['running', 'stopped', 'stale_pid', 'unresponsive']),\n cliVersion: z.string(),\n daemonVersion: z.string().nullable(),\n});\n\nexport interface Daemon {\n readonly url: string;\n readonly version: string;\n}\nexport interface DaemonResult {\n readonly checks: readonly Check[];\n readonly daemon?: Daemon;\n}\n\nexport function normalizeUrl(listen: string): string | undefined {\n const match = /^(?:ws:\\/\\/)?([^:/]+|\\[[^\\]]+\\]):(\\d+)$/.exec(listen.trim());\n if (!match) return undefined;\n const [, host = '', port = ''] = match;\n const local = ['localhost', '127.0.0.1', '0.0.0.0', '[::1]', '[::]'].includes(host) ? '127.0.0.1' : host;\n return `ws://${local}:${port}`;\n}\n\n/** The whole compatibility story: is Paseo running, and is it new enough? */\nexport function assessStatus(raw: unknown): DaemonResult {\n const parsed = statusSchema.safeParse(raw);\n if (!parsed.success) {\n return { checks: [fail('paseo.status', 'Paseo status output was not understood.', 'Upgrade Paseo, then run: paseo daemon status --json')] };\n }\n const status = parsed.data;\n if (status.localDaemon !== 'running') {\n return { checks: [fail('paseo.daemon', `Paseo daemon is ${status.localDaemon}.`, 'Start it with: paseo daemon start')] };\n }\n const cli = valid(status.cliVersion);\n const daemon = status.daemonVersion === null ? null : valid(status.daemonVersion);\n if (!cli || !daemon) {\n return { checks: [fail('paseo.version', 'Paseo did not report a usable version.', 'Upgrade Paseo to a release that reports semver versions.')] };\n }\n if (cli !== daemon) {\n return { checks: [fail('paseo.version', `Paseo CLI is ${cli} but the running daemon is ${daemon}.`, 'Restart the daemon with: paseo daemon restart')] };\n }\n if (!gte(daemon, MINIMUM_VERSION)) {\n return { checks: [fail('paseo.version', `Paseo ${daemon} is older than the required ${MINIMUM_VERSION}.`, 'Upgrade Paseo, then run setup again.')] };\n }\n const url = normalizeUrl(status.listen);\n if (!url) {\n return { checks: [fail('paseo.listen', `Paseo listen address ${status.listen} was not understood.`, 'Use a host:port listen address in the Paseo config.')] };\n }\n return { checks: [pass('paseo.version', `Paseo ${daemon} is running on ${url} (compatible, needs >= ${MINIMUM_VERSION}).`)], daemon: { url, version: daemon } };\n}\n\nexport async function checkDaemon(layout: Layout, env: NodeJS.ProcessEnv = process.env): Promise<DaemonResult> {\n const binary = await which(layout.bin.paseo, layout.searchPath);\n if (!binary) {\n return { checks: [fail('paseo.bin', 'Paseo executable not found.', 'Install Paseo, or pass --paseo-bin /path/to/paseo.')] };\n }\n const output = await probe(binary, ['daemon', 'status', '--json'], {\n HOME: layout.home, PASEO_HOME: layout.paseoHome, PATH: layout.searchPath,\n ...(env.PASEO_PASSWORD === undefined ? {} : { PASEO_PASSWORD: env.PASEO_PASSWORD }),\n });\n if (!output.ok) {\n return { checks: [fail('paseo.status', 'Could not read Paseo daemon status.', 'Run: paseo daemon status --json')] };\n }\n try { return assessStatus(JSON.parse(output.stdout)); }\n catch { return assessStatus(undefined); }\n}\n\nconst configSchema = z.object({ config: z.object({ providers: z.record(z.string(), z.unknown()).optional() }) });\n\nexport interface Session {\n readProviders(): Promise<Record<string, unknown>>;\n writeProviders(providers: Readonly<Record<string, Provider>>): Promise<void>;\n removeProviders(ids: readonly string[]): Promise<void>;\n refresh(ids: readonly string[]): Promise<void>;\n}\nexport type ClientFactory = (config: PaseoClientConfig) => PaseoClient;\n\n/** One connection per command. No retries, no reconnects, no background state. */\nexport async function withSession<T>(\n daemon: Daemon,\n run: (session: Session) => Promise<T>,\n options: { readonly password?: string; readonly factory?: ClientFactory } = {},\n): Promise<T> {\n const quiet = { debug() { /* silent */ }, info() { /* silent */ }, warn() { /* silent */ }, error() { /* silent */ } };\n // Loaded here so the \"Paseo is not running\" path never pays for the SDK.\n const factory = options.factory ?? (await import('@getpaseo/client')).createPaseoClient;\n const client = factory({\n url: `${daemon.url}/ws`,\n ...(options.password === undefined ? {} : { password: options.password }),\n appVersion: MINIMUM_VERSION,\n connectTimeoutMs: 10_000,\n reconnect: { enabled: false },\n logger: quiet,\n });\n try {\n await client.connect();\n return await run({\n async readProviders() {\n const response = configSchema.parse(await client.config.get());\n return response.config.providers ?? {};\n },\n async writeProviders(providers) {\n await client.config.patch({ providers } as unknown as Parameters<PaseoClient['config']['patch']>[0]);\n },\n async removeProviders(ids) {\n await client.config.patch({ removeProviders: [...ids] });\n },\n async refresh(ids) {\n await client.providers.refresh({ providers: [...ids] });\n },\n });\n } finally {\n await client.close();\n }\n}\n\n/** Compare only the keys the room owns; unrelated fields stay the operator's. */\nexport function providerMatches(desired: Provider, live: unknown): boolean {\n if (live === null || typeof live !== 'object') return false;\n const entry = live as Record<string, unknown>;\n const env = entry.env;\n const tools = entry.paseoTools;\n const same = (left: unknown, right: unknown): boolean => JSON.stringify(left ?? null) === JSON.stringify(right ?? null);\n return entry.extends === desired.extends &&\n same(entry.command, desired.command) &&\n env !== null && typeof env === 'object' &&\n Object.entries(desired.env).every(([key, value]) => (env as Record<string, unknown>)[key] === value) &&\n tools !== null && typeof tools === 'object' &&\n (tools as { enabled?: unknown }).enabled === desired.paseoTools.enabled &&\n // Pins are the room's guarantee: drifting them silently re-enables what they block.\n same(entry.params, desired.params) &&\n same(entry.disallowedTools, desired.disallowedTools);\n}\n","export const ROLES = ['supervisor', 'lead', 'peer'] as const;\nexport type Role = (typeof ROLES)[number];\n\nexport const AGENT_IDS = ['codex', 'claude'] as const;\nexport type AgentId = (typeof AGENT_IDS)[number];\n\n/** Supervisor and Lead orchestrate; Peer executes one brief and gets no room tools. */\nexport const ROLE_PASEO_TOOLS: Record<Role, boolean> = { supervisor: true, lead: true, peer: false };\n\nexport function providerId(agent: AgentId, role: Role): string {\n return `${agent}-${role}`;\n}\nexport function providerLabel(agent: AgentId, role: Role): string {\n const title = (value: string): string => value.charAt(0).toUpperCase() + value.slice(1);\n return `${title(agent)} ${title(role)}`;\n}\n","import { join } from 'node:path';\nimport { z } from 'zod';\nimport { readIfPresent } from './fsops.js';\nimport type { Layout } from './layout.js';\nimport { AGENT_IDS, ROLES, type AgentId, type Role } from './roles.js';\n\nexport const MARKER = 'room.json';\n\nconst markerSchema = z.object({\n version: z.string(),\n agents: z.array(z.enum(AGENT_IDS)).min(1),\n roles: z.array(z.enum(ROLES)).min(1),\n});\nexport type Marker = z.infer<typeof markerSchema>;\n\n/** Deterministic on purpose: re-running setup must not show a phantom change. */\nexport function renderMarker(version: string, agents: readonly AgentId[], roles: readonly Role[]): string {\n return JSON.stringify({ version, agents: [...agents], roles: [...roles] } satisfies Marker, null, 2) + '\\n';\n}\n\n/** Records what setup created, so verify and remove touch nothing else. */\nexport async function readMarker(layout: Layout): Promise<Marker | undefined> {\n const source = await readIfPresent(join(layout.roomHome, MARKER));\n if (source === undefined) return undefined;\n try { return markerSchema.parse(JSON.parse(source)); } catch { return undefined; }\n}\n","import { join } from 'node:path';\nimport { rm } from 'node:fs/promises';\nimport metadata from '../package.json' with { type: 'json' };\nimport { claudeAgent } from './agents/claude.js';\nimport { codexAgent } from './agents/codex.js';\nimport type { Agent, Provider } from './agents/types.js';\nimport { applyEntries, exists, planEntries, type Entry } from './fsops.js';\nimport { layoutChecks, resolveLayout, roleHome, sharedRoom, type Layout, type Options } from './layout.js';\nimport { checkDaemon, providerMatches, withSession, type ClientFactory, type Session } from './paseo.js';\nimport { fail, failed, hasFailure, pass, type Check, type Operation, type Result } from './result.js';\nimport { renderInstructions } from './room/instructions.js';\nimport { MARKER, readMarker, renderMarker, type Marker } from './room.js';\nimport { providerId, providerLabel, ROLES, ROLE_PASEO_TOOLS, type AgentId, type Role } from './roles.js';\n\nexport const AGENTS: Record<AgentId, Agent> = { codex: codexAgent, claude: claudeAgent };\n\nexport interface RunOptions extends Options {\n readonly agents?: readonly AgentId[];\n readonly apply?: boolean;\n readonly env?: NodeJS.ProcessEnv;\n readonly factory?: ClientFactory;\n}\n\nfunction sessionOptions(options: RunOptions): { password?: string; factory?: ClientFactory } {\n const password = (options.env ?? process.env).PASEO_PASSWORD;\n return { ...(password === undefined ? {} : { password }), ...(options.factory ? { factory: options.factory } : {}) };\n}\n\n/** The only per-agent differences are the home variable and the provider pins. */\nfunction roleProviders(layout: Layout, agent: Agent, binary: string, roles: readonly Role[]): Record<string, Provider> {\n return Object.fromEntries(roles.map(role => [providerId(agent.id, role), {\n extends: agent.id,\n label: providerLabel(agent.id, role),\n command: [binary],\n env: { [agent.homeEnv]: roleHome(layout, agent.id, role) },\n paseoTools: { enabled: ROLE_PASEO_TOOLS[role] },\n ...agent.pins,\n }]));\n}\n\ninterface Desired {\n readonly entries: readonly Entry[];\n readonly providers: Readonly<Record<string, Provider>>;\n readonly checks: readonly Check[];\n}\nasync function buildDesired(layout: Layout, agents: readonly AgentId[], roles: readonly Role[]): Promise<Desired> {\n // Template, not linked into any seat: each repo owns its own docs/WORKSPACE_PROTOCOL.md.\n // Named exactly as RC-002 names it, so a copy needs no rename.\n const entries: Entry[] = [\n { kind: 'dir', path: layout.roomHome },\n { kind: 'dir', path: sharedRoom(layout) },\n { kind: 'file', path: join(sharedRoom(layout), 'WORKSPACE_PROTOCOL.md'), content: renderInstructions('workspace') },\n ];\n const providers: Record<string, Provider> = {};\n const checks: Check[] = [];\n for (const id of agents) {\n const agent = AGENTS[id];\n const plan = await agent.build(layout, roles);\n entries.push(...plan.entries);\n checks.push(...plan.checks);\n if (plan.binary !== undefined) Object.assign(providers, roleProviders(layout, agent, plan.binary, roles));\n }\n entries.push({ kind: 'file', path: join(layout.roomHome, MARKER), content: renderMarker(metadata.version, agents, roles) });\n return { entries, providers, checks };\n}\n\ninterface Stale {\n readonly providerIds: readonly string[];\n readonly directories: readonly string[];\n}\nconst NOTHING_STALE: Stale = { providerIds: [], directories: [] };\n\n/** A previous setup may have seated agents or roles this one does not: drop those. */\nasync function staleFrom(layout: Layout, previous: Marker | undefined, agents: readonly AgentId[], roles: readonly Role[]): Promise<Stale> {\n if (!previous) return NOTHING_STALE;\n const kept = new Set(agents.flatMap(agent => roles.map(role => providerId(agent, role))));\n const providerIds: string[] = [];\n const directories: string[] = [];\n for (const agent of previous.agents) {\n for (const role of previous.roles) {\n if (kept.has(providerId(agent, role))) continue;\n providerIds.push(providerId(agent, role));\n const path = roleHome(layout, agent, role);\n if (await exists(path)) directories.push(path);\n }\n }\n return { providerIds, directories };\n}\n\n/** One definition of drift, shared by the command that fixes it and the one that reports it. */\nasync function planRoom(session: Session, desired: Desired, stale: Stale): Promise<Operation[]> {\n const live = await session.readProviders();\n return [\n ...await planEntries(desired.entries),\n ...Object.entries(desired.providers).map(([id, provider]) => ({\n action: !(id in live) ? 'create' : providerMatches(provider, live[id]) ? 'noop' : 'update',\n kind: 'provider',\n target: id,\n }) satisfies Operation),\n ...stale.providerIds.filter(id => id in live).map(id => ({ action: 'remove', kind: 'provider', target: id }) satisfies Operation),\n ...stale.directories.map(path => ({ action: 'remove', kind: 'dir', target: path }) satisfies Operation),\n ];\n}\n\n/** The whole product: write the role homes, then register them with Paseo. */\nexport async function setup(options: RunOptions = {}): Promise<Result> {\n const layout = resolveLayout(options, options.env);\n const agents = options.agents ?? ['codex'];\n const invalid = layoutChecks(layout, agents);\n if (invalid.length > 0) return failed('setup', invalid);\n const daemon = await checkDaemon(layout, options.env);\n if (!daemon.daemon) return failed('setup', daemon.checks);\n const desired = await buildDesired(layout, agents, ROLES);\n const checks = [...daemon.checks, ...desired.checks];\n if (hasFailure(checks)) return failed('setup', checks);\n const stale = await staleFrom(layout, await readMarker(layout), agents, ROLES);\n\n return withSession(daemon.daemon, async session => {\n const operations = await planRoom(session, desired, stale);\n const pending = operations.filter(operation => operation.action !== 'noop');\n if (!options.apply) {\n return {\n command: 'setup', outcome: pending.length > 0 ? 'changes-planned' : 'ok', changed: false, checks, operations,\n } satisfies Result;\n }\n await applyEntries(desired.entries);\n for (const path of stale.directories) await rm(path, { recursive: true, force: true });\n const ids = Object.keys(desired.providers);\n await session.writeProviders(desired.providers);\n if (stale.providerIds.length > 0) await session.removeProviders(stale.providerIds);\n await session.refresh(ids);\n return {\n command: 'setup', outcome: 'ok', changed: pending.length > 0,\n checks: [...checks, pass('room.applied', `Room ready at ${layout.roomHome} with ${String(ids.length)} Paseo providers.`)],\n operations,\n } satisfies Result;\n }, sessionOptions(options));\n}\n\nexport async function verify(options: RunOptions = {}): Promise<Result> {\n const layout = resolveLayout(options, options.env);\n const marker = await readMarker(layout);\n if (!marker) {\n return failed('verify', [fail('room.marker', `No room found at ${layout.roomHome}.`, 'Run: paseo-room setup --apply')]);\n }\n const invalid = layoutChecks(layout, marker.agents);\n if (invalid.length > 0) return failed('verify', invalid);\n const daemon = await checkDaemon(layout, options.env);\n if (!daemon.daemon) return failed('verify', daemon.checks);\n const desired = await buildDesired(layout, marker.agents, marker.roles);\n const checks = [...daemon.checks, ...desired.checks];\n if (hasFailure(checks)) return failed('verify', checks);\n\n return withSession(daemon.daemon, async session => {\n const operations = await planRoom(session, desired, NOTHING_STALE);\n const drifted = operations.filter(operation => operation.action !== 'noop');\n const providers = drifted.filter(operation => operation.kind === 'provider').length;\n const files = drifted.length - providers;\n const all: Check[] = [...checks,\n files === 0\n ? pass('room.files', 'Every managed role file matches the current definition.')\n : fail('room.files', `${String(files)} managed role files are missing or outdated.`, 'Run: paseo-room setup --apply'),\n providers === 0\n ? pass('room.providers', `All ${String(Object.keys(desired.providers).length)} Paseo providers are registered as expected.`)\n : fail('room.providers', `${String(providers)} Paseo providers are missing or differ.`, 'Run: paseo-room setup --apply'),\n ];\n return {\n command: 'verify', outcome: hasFailure(all) ? 'failed' : 'ok', changed: false, checks: all, operations,\n } satisfies Result;\n }, sessionOptions(options));\n}\n\nexport async function remove(options: RunOptions = {}): Promise<Result> {\n const layout = resolveLayout(options, options.env);\n const marker = await readMarker(layout);\n if (!marker) {\n return failed('remove', [fail('room.marker', `No room found at ${layout.roomHome}.`, 'Nothing to remove; the room home was never created here.')]);\n }\n // A recursive delete needs a floor, so the layout rules gate this command too.\n const invalid = layoutChecks(layout, marker.agents);\n if (invalid.length > 0) return failed('remove', invalid);\n const ids = marker.agents.flatMap(agent => marker.roles.map(role => providerId(agent, role)));\n const operations: Operation[] = [\n ...ids.map(id => ({ action: 'remove', kind: 'provider', target: id }) satisfies Operation),\n { action: 'remove', kind: 'dir', target: layout.roomHome },\n ];\n if (!options.apply) {\n return { command: 'remove', outcome: 'changes-planned', changed: false, checks: [], operations };\n }\n const daemon = await checkDaemon(layout, options.env);\n const checks: Check[] = [];\n if (daemon.daemon) {\n await withSession(daemon.daemon, session => session.removeProviders(ids), sessionOptions(options));\n checks.push(pass('room.providers', `Removed ${String(ids.length)} Paseo providers.`));\n } else {\n checks.push({ id: 'room.providers', status: 'warn', message: 'Paseo is unreachable; provider entries were left in place.', fix: 'Start Paseo and run remove again to clear them.' });\n }\n // Only the room home is deleted; agent homes were never written to.\n await rm(layout.roomHome, { recursive: true, force: true });\n checks.push(pass('room.files', `Deleted ${layout.roomHome}.`));\n return { command: 'remove', outcome: 'ok', changed: true, checks, operations };\n}\n","import * as clack from '@clack/prompts';\nimport { AGENTS, remove, setup, verify, type RunOptions } from './commands.js';\nimport type { Result } from './result.js';\nimport { AGENT_IDS, type AgentId } from './roles.js';\n\nexport interface Prompts {\n select(options: { readonly message: string; readonly options: readonly { readonly value: string; readonly label: string }[] }): Promise<string | symbol>;\n multiselect(options: { readonly message: string; readonly options: readonly { readonly value: AgentId; readonly label: string }[] }): Promise<AgentId[] | symbol>;\n confirm(options: { readonly message: string }): Promise<boolean | symbol>;\n}\nexport const terminalPrompts: Prompts = {\n select: options => clack.select({ message: options.message, options: [...options.options] }),\n multiselect: options => clack.multiselect({ message: options.message, options: [...options.options], required: true }),\n confirm: options => clack.confirm({ message: options.message, initialValue: false }),\n};\n\n/** Guided path over the same commands the flags use; nothing extra happens here. */\nexport async function runWizard(\n prompts: Prompts,\n emit: (result: Result) => number,\n write: (text: string) => void,\n options: RunOptions = {},\n): Promise<number> {\n const cancelled = (): number => { write('Cancelled; nothing was changed.\\n'); return 0; };\n const action = await prompts.select({\n message: 'What do you want to do?',\n options: [\n { value: 'setup', label: 'Set up / update the room' },\n { value: 'verify', label: 'Verify the current room' },\n { value: 'remove', label: 'Remove the room' },\n ],\n });\n if (typeof action === 'symbol') return cancelled();\n if (action === 'verify') return emit(await verify(options));\n if (action === 'remove') {\n const preview = await remove(options);\n const status = emit(preview);\n if (preview.outcome !== 'changes-planned') return status;\n const approved = await prompts.confirm({ message: 'Delete the room home and its Paseo providers?' });\n return approved === true ? emit(await remove({ ...options, apply: true })) : cancelled();\n }\n const agents = await prompts.multiselect({\n message: 'Which coding agents should the room use?',\n options: AGENT_IDS.map(value => ({ value, label: AGENTS[value].label })),\n });\n if (typeof agents === 'symbol' || agents.length === 0) return cancelled();\n const preview = await setup({ ...options, agents });\n const status = emit(preview);\n if (preview.outcome !== 'changes-planned') return status;\n const approved = await prompts.confirm({ message: 'Apply these changes?' });\n if (approved !== true) return cancelled();\n return emit(await setup({ ...options, agents, apply: true }));\n}\n","import { Command, CommanderError } from 'commander';\nimport metadata from '../package.json' with { type: 'json' };\nimport { remove, setup, verify, type RunOptions } from './commands.js';\nimport { renderHuman, renderJson } from './render.js';\nimport { exitCode, fail, failed, type Result } from './result.js';\nimport { AGENT_IDS, type AgentId } from './roles.js';\nimport type { Prompts } from './wizard.js';\n\nexport interface Output {\n readonly stdout: (text: string) => void;\n readonly stderr: (text: string) => void;\n}\nexport interface CliContext {\n readonly isTTY?: boolean;\n readonly prompts?: Prompts;\n readonly options?: RunOptions;\n}\n\n/** Commander passes no initial value, so the first call starts the list. */\nfunction collectAgent(value: string, previous: AgentId[] | undefined): AgentId[] {\n const agent = AGENT_IDS.find(id => id === value);\n if (!agent) throw new CommanderError(2, 'agent', `Unknown agent: ${value}`);\n const seated = previous ?? [];\n return seated.includes(agent) ? seated : [...seated, agent];\n}\n\nconst PATH_FLAGS = ['roomHome', 'codexHome', 'claudeHome', 'codexBin', 'claudeBin', 'paseoBin'] as const;\n\nfunction optionsFrom(raw: Record<string, unknown>, base: RunOptions): RunOptions {\n const paths: Record<string, string> = {};\n for (const flag of PATH_FLAGS) {\n const value = raw[flag];\n if (typeof value === 'string' && value.trim()) paths[flag] = value.trim();\n }\n const agents = Array.isArray(raw.agent) && raw.agent.length > 0 ? (raw.agent as AgentId[]) : undefined;\n return { ...base, ...paths, ...(agents ? { agents } : {}), ...(raw.apply === true ? { apply: true } : {}) };\n}\n\nexport async function runCli(argv: readonly string[], output: Output, context: CliContext = {}): Promise<number> {\n const password = (context.options?.env ?? process.env).PASEO_PASSWORD;\n const redact = (text: string): string => (password ? text.split(password).join('[redacted]') : text);\n // Set once the flags are parsed; the wizard path never sees flags, so text output is right there.\n let json = false;\n const emit = (result: Result): number => {\n output.stdout(redact(json ? renderJson(result) : renderHuman(result)));\n return exitCode(result);\n };\n const isTTY = context.isTTY ?? (process.stdin.isTTY && process.stdout.isTTY);\n const base = context.options ?? {};\n\n if (argv.length === 0) {\n if (!isTTY) {\n output.stderr('paseo-room: no command given. Try: paseo-room setup, verify, remove, or --help.\\n');\n return 2;\n }\n // @clack/prompts is only reachable here, so keep it off the scripted path.\n const { runWizard, terminalPrompts } = await import('./wizard.js');\n return runWizard(context.prompts ?? terminalPrompts, emit, text => { output.stdout(text); }, base);\n }\n\n const program = new Command()\n .name('paseo-room')\n .description('Configure Codex/Claude role homes in $HOME and register them with your local Paseo daemon.')\n .version(metadata.version)\n .argument('<command>', 'setup | verify | remove')\n .option('--agent <agent>', 'codex or claude; repeat for both (default: codex)', collectAgent)\n .option('--apply', 'actually make the changes (default: dry run)')\n .option('--json', 'machine-readable output')\n .option('--room-home <path>', 'where role homes are written (default: ~/.paseo-room)')\n .option('--codex-home <path>', 'source Codex config (default: ~/.codex)')\n .option('--claude-home <path>', 'source Claude Code config (default: ~/.claude)')\n .option('--codex-bin <path>', 'Codex executable (default: found on PATH)')\n .option('--claude-bin <path>', 'Claude Code executable (default: found on PATH)')\n .option('--paseo-bin <path>', 'Paseo executable (default: found on PATH)')\n .configureOutput({ writeOut: text => { output.stdout(text); }, writeErr: text => { output.stderr(text); } })\n .exitOverride();\n\n let command: string;\n let options: RunOptions;\n try {\n program.parse([...argv], { from: 'user' });\n const raw = program.opts<Record<string, unknown>>();\n json = raw.json === true;\n command = program.args[0] ?? '';\n options = optionsFrom(raw, base);\n } catch (error) {\n if (error instanceof CommanderError && error.exitCode === 0) return 0;\n return 2;\n }\n\n try {\n if (command === 'setup') return emit(await setup(options));\n if (command === 'verify') return emit(await verify(options));\n if (command === 'remove') return emit(await remove(options));\n } catch (error) {\n const detail = error instanceof Error ? error.message : 'unknown error';\n return emit(failed(command, [fail(`${command}.error`, redact(detail), 'Check that Paseo is running and reachable, then try again.')]));\n }\n output.stderr(`paseo-room: unknown command \"${command}\". Try: setup, verify, remove.\\n`);\n return 2;\n}\n","import type { Result } from './result.js';\n\nexport function renderJson(result: Result): string {\n return `${JSON.stringify({ schemaVersion: 2, ...result }, null, 2)}\\n`;\n}\n\nconst ICONS = { pass: '✓', warn: '!', fail: '✗' } as const;\n\nexport function renderHuman(result: Result): string {\n const lines: string[] = [];\n for (const check of result.checks) {\n lines.push(`${ICONS[check.status]} ${check.message}`);\n if (check.fix) lines.push(` → ${check.fix}`);\n }\n const changes = result.operations.filter(operation => operation.action !== 'noop');\n if (changes.length > 0) {\n lines.push('', result.changed ? 'Applied:' : 'Planned changes:');\n for (const operation of changes) lines.push(` ${operation.action} ${operation.kind} ${operation.target}`);\n const unchanged = result.operations.length - changes.length;\n if (unchanged > 0) lines.push(` (${String(unchanged)} already up to date)`);\n } else if (result.operations.length > 0) {\n lines.push('', 'Everything is already up to date.');\n }\n lines.push('', `${result.command}: ${result.outcome}`);\n return `${lines.join('\\n')}\\n`;\n}\n","#!/usr/bin/env node\nimport { runCli } from './cli.js';\n\nprocess.exitCode = await runCli(process.argv.slice(2), {\n stdout: text => { process.stdout.write(text); },\n stderr: text => { process.stderr.write(text); },\n});\n"],"mappings":";;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,MACX,aAAe;AAAA,MACf,UAAY;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,UAAY;AAAA,MACZ,MAAQ;AAAA,MACR,YAAc;AAAA,QACZ,MAAQ;AAAA,QACR,KAAO;AAAA,MACT;AAAA,MACA,SAAW;AAAA,MACX,QAAU;AAAA,MACV,MAAQ;AAAA,MACR,SAAW;AAAA,QACT,MAAQ;AAAA,MACV;AAAA,MACA,KAAO;AAAA,QACL,cAAc;AAAA,MAChB;AAAA,MACA,OAAS;AAAA,QACP;AAAA,MACF;AAAA,MACA,SAAW;AAAA,QACT,WAAa;AAAA,QACb,MAAQ;AAAA,QACR,MAAQ;AAAA,QACR,OAAS;AAAA,QACT,SAAW;AAAA,QACX,QAAU;AAAA,MACZ;AAAA,MACA,cAAgB;AAAA,QACd,kBAAkB;AAAA,QAClB,oBAAoB;AAAA,QACpB,WAAa;AAAA,QACb,QAAU;AAAA,QACV,aAAa;AAAA,QACb,KAAO;AAAA,MACT;AAAA,MACA,iBAAmB;AAAA,QACjB,cAAc;AAAA,QACd,eAAe;AAAA,QACf,iBAAiB;AAAA,QACjB,QAAU;AAAA,QACV,MAAQ;AAAA,QACR,YAAc;AAAA,QACd,qBAAqB;AAAA,QACrB,QAAU;AAAA,MACZ;AAAA,IACF;AAAA;AAAA;;;ACnCO,SAAS,KAAK,IAAY,SAAwB;AACvD,SAAO,EAAE,IAAI,QAAQ,QAAQ,QAAQ;AACvC;AACO,SAAS,KAAK,IAAY,SAAiB,KAAoB;AACpE,SAAO,EAAE,IAAI,QAAQ,QAAQ,SAAS,IAAI;AAC5C;AACO,SAAS,OAAO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AO,KAAK,OAAO,SAAS,CAAC,KAAK,GAAG,OAAO,UAAU,OAAO,MAAM,GAAG,4DAA4D,CAAC,CAAC,CAAC;AAAA,EACvI;AACA,SAAO,OAAO,gCAAgC,OAAO;AAAA,CAAkC;AACvF,SAAO;AACT;;;AEjGA,QAAQ,WAAW,MAAM,OAAO,QAAQ,KAAK,MAAM,CAAC,GAAG;AAAA,EACrD,QAAQ,UAAQ;AAAE,YAAQ,OAAO,MAAM,IAAI;AAAA,EAAG;AAAA,EAC9C,QAAQ,UAAQ;AAAE,YAAQ,OAAO,MAAM,IAAI;AAAA,EAAG;AAChD,CAAC;","names":["join","join","resolve","join","basename","join","SHARED","run","join","z","join","rm","preview","status","approved","runWizard","terminalPrompts"]}
|