paseo-room 0.1.0-alpha.2 → 0.1.0-alpha.3

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 CHANGED
@@ -7,7 +7,7 @@ It does three things:
7
7
 
8
8
  1. Reads your existing Codex / Claude Code configuration.
9
9
  2. Writes one isolated role home per seat under `~/.paseo-room`, sharing your login, skills and plugins by symlink.
10
- 3. Registers those role homes with your running Paseo daemon as providers — room tools on for Supervisor and Lead, off for Peer.
10
+ 3. Registers those role homes with your running Paseo daemon as providers — room tools on for Supervisor and Lead, off for Peer — and adds one agent profile per seat so opening one is a single pick.
11
11
 
12
12
  Everything it creates lives in `$HOME`, under one directory it owns outright. It reads
13
13
  `~/.codex` and `~/.claude`; it never writes to them.
@@ -108,6 +108,22 @@ agent's own configuration:
108
108
  | `disallowedTools: ["Task"]` | Claude | Claude's own subagents would be a second control plane. This is the counterpart of Codex's `[agents].enabled = false`. |
109
109
  | `paseoTools: {enabled}` | both | Room tools for Supervisor and Lead, never for Peer. |
110
110
 
111
+ It also saves one **agent profile** per seat, which is what the Paseo picker lists under
112
+ Profiles. A profile is a preset, not a constraint: it decides where a seat *starts*.
113
+
114
+ | Profile field | Value | Owned by |
115
+ |---|---|---|
116
+ | `provider` | that seat's provider | the room — repaired on every `setup --apply` |
117
+ | `name` | e.g. `Codex Lead` | the room |
118
+ | `notes` | who may open this seat, shown to orchestrating agents by Paseo's `list_profiles` | the room |
119
+ | `thinkingOptionId` | `low` for Supervisor, `high` for Lead and Peer | seeded once, then yours |
120
+ | `model`, `modeId`, `icon`, `color` | never written | yours |
121
+
122
+ Supervisor starts low because it routes rather than reasons. Neither seat starts on the top
123
+ option — Codex's `ultra` and Claude's `ultracode` advertise automatic task delegation, which
124
+ is a second control plane. Retune any seat in Paseo and `setup` will leave your choice alone;
125
+ profiles you created yourself are never touched.
126
+
111
127
  The Claude permission mode is deliberately **not** set here. Paseo passes `--permission-mode`
112
128
  per agent (`plan`, `default`, `acceptEdits`, `auto`, `bypassPermissions`; default `auto`), and
113
129
  a command-line flag beats anything in `settings.json`. Choose the mode in Paseo.
@@ -142,6 +158,12 @@ In short:
142
158
 
143
159
  Human keeps product goals, priority, material cost, external effects and irreversible risk.
144
160
 
161
+ One rule has no enforcement behind it and so is stated in the contract instead: **Lead opens
162
+ Peer seats only, and Supervisor opens Lead seats.** Paseo takes the seat to open as a plain
163
+ provider id, so nothing below the contract stops a Lead from opening a second Lead. If you
164
+ ever see two Leads on one project, stop — that is two orchestrators, and the ownership rules
165
+ stop holding.
166
+
145
167
  Every seat also carries a **default workspace protocol** — topology by difficulty,
146
168
  verification, review, repository conventions — so a project has that layer without doing
147
169
  anything. Each seat gets the sections that bear on its own work; topology goes to Lead and
@@ -150,6 +172,39 @@ Supervisor, not to Peer. A repository that needs different rules writes
150
172
  wherever it is silent. `~/.paseo-room/room/WORKSPACE_PROTOCOL.md` is the whole default as
151
173
  one file, so you can read what is in force and start from it.
152
174
 
175
+ ## Working the room
176
+
177
+ The whole point is that you do not orchestrate. Say the outcome and the boundaries; let Lead
178
+ decide the route.
179
+
180
+ 1. **Talk to one seat.** Six providers is not six windows. One project: open **Lead**. Several
181
+ projects at once, or you want an audit trail of directives: open **Supervisor** only, and
182
+ let it open the Leads. Opening both and then talking to Lead makes Supervisor an expensive
183
+ ornament with an incomplete record.
184
+ 2. **Say the outcome, not the plan.** You may direct the technical route, but every time you
185
+ do you take the acceptance risk back from Lead — and an orchestrator who has already solved
186
+ the problem leaves the worker able to be right about only one thing.
187
+ 3. **Interrupt at four boundaries only:** product goals and priority, material cost, external
188
+ effects, irreversible risk. Technical route and ownership are Lead's.
189
+ 4. **Read anything, direct one thing.** Reading a Peer's timeline is how you get evidence
190
+ without becoming a second channel; stopping a seat is yours by right. But answering a
191
+ Peer's `REOPEN_REQUEST` yourself means Lead never learns its premise was wrong and writes
192
+ the same premise into the next brief. If you do override a Peer, tell Lead — it waits on
193
+ events, so it will wait a long time.
194
+ 5. **Accept the product, not the diff.** Ask for the candidate and the gate result. "It's
195
+ done" is not evidence.
196
+ 6. **When the room gets confusing, throw it away.** `remove --apply`, then `setup --apply`.
197
+ Role homes are generated; do not debug them.
198
+
199
+ Using one Peer directly, with no Lead at all, is fine for small single-scope work — that is
200
+ not breaking the room, it is not using it. Just be clear that you are then the Lead: the brief
201
+ and the technical acceptance are yours.
202
+
203
+ With both Codex and Claude seated, the highest-value use of the second family is not splitting
204
+ work at random — it is **independent review**. A read-only Peer from a different model family
205
+ reading a candidate is more independent than a fresh session of the family that wrote it. Run
206
+ one project on one family and keep the other for the review seat.
207
+
153
208
  ## Documentation
154
209
 
155
210
  - [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.2",
18
+ version: "0.1.0-alpha.3",
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",
@@ -293,6 +293,9 @@ var init_clauses = __esm({
293
293
  Supervisor has Paseo tools enabled solely within its authority. Use the smallest Paseo
294
294
  room/session lifecycle action needed for an explicit Human request or bounded room
295
295
  recovery; preserve current ownership and inform Lead of every change.
296
+
297
+ Of the seats available, Supervisor opens Lead seats, and one Lead per project. Opening
298
+ Peer seats is Lead's; opening another Supervisor is Human's.
296
299
  `),
297
300
  "RC-104": clause(`
298
301
  Supervisor sends technical questions and evidence to Lead. Escalate product, priority,
@@ -339,6 +342,15 @@ var init_clauses = __esm({
339
342
  When material uncertainty warrants independent review, Lead may dispatch a fresh
340
343
  read-only Peer with an exact stable candidate and a bounded question. Review is
341
344
  optional: do not introduce a dedicated reviewer role or a fixed reviewer count.
345
+ `),
346
+ "RC-207": clause(`
347
+ Lead opens Peer seats and no others. A seat list may offer Lead and Supervisor seats;
348
+ opening one creates a second orchestrator or inverts the Human-facing seat, so Lead
349
+ must not, whatever the tool permits.
350
+
351
+ Open each Peer on the same agent implementation as this seat unless the workspace
352
+ protocol routes that kind of work elsewhere. A Peer belongs to one brief: close it when
353
+ the brief closes rather than holding a standing pool.
342
354
  `),
343
355
  "RC-301": clause(`
344
356
  Peer owns exactly one Lead-delegated bounded outcome and proportionate evidence. Do
@@ -384,6 +396,11 @@ var init_workspace = __esm({
384
396
 
385
397
  When the route itself is uncertain, spend a read-only Peer on the question before
386
398
  spending a writable Peer on the answer.
399
+
400
+ When seats from more than one agent implementation are available, a second
401
+ implementation is worth most as an independent reader of a candidate the first one
402
+ wrote. Absent a repository rule assigning work by kind, keep a task on the
403
+ implementation of the seat that opened it.
387
404
  `),
388
405
  "WP-02 Verification": clause(`
389
406
  The repository's own gate is the evidence. Lead names the exact command in the brief;
@@ -441,7 +458,7 @@ var init_instructions = __esm({
441
458
  init_workspace();
442
459
  ROLE_IDS = {
443
460
  supervisor: ["RC-101", "RC-102", "RC-103", "RC-104"],
444
- lead: ["RC-201", "RC-202", "RC-203", "RC-204", "RC-205", "RC-206"],
461
+ lead: ["RC-201", "RC-202", "RC-203", "RC-204", "RC-205", "RC-206", "RC-207"],
445
462
  // Peer needs the challenge protocol as well as its own numbered obligations.
446
463
  peer: ["RC-204", "RC-301", "RC-302", "RC-303", "RC-304", "RC-305"]
447
464
  };
@@ -754,6 +771,13 @@ async function withSession(daemon, run2, options = {}) {
754
771
  async removeProviders(ids) {
755
772
  await client.config.patch({ removeProviders: [...ids] });
756
773
  },
774
+ async readProfiles() {
775
+ const response = configSchema.parse(await client.config.get());
776
+ return response.config.agentProfiles ?? [];
777
+ },
778
+ async writeProfiles(profiles) {
779
+ await client.config.patch({ agentProfiles: [...profiles] });
780
+ },
757
781
  async refresh(ids) {
758
782
  await client.providers.refresh({ providers: [...ids] });
759
783
  }
@@ -771,6 +795,23 @@ function providerMatches(desired, live) {
771
795
  return entry.extends === desired.extends && same(entry.command, desired.command) && env !== null && typeof env === "object" && Object.entries(desired.env).every(([key, value]) => env[key] === value) && tools !== null && typeof tools === "object" && tools.enabled === desired.paseoTools.enabled && // Pins are the room's guarantee: drifting them silently re-enables what they block.
772
796
  same(entry.params, desired.params) && same(entry.disallowedTools, desired.disallowedTools);
773
797
  }
798
+ function profileMatches(desired, live) {
799
+ if (live === null || typeof live !== "object") return false;
800
+ const entry = live;
801
+ return entry.name === desired.name && entry.provider === desired.provider && entry.notes === desired.notes;
802
+ }
803
+ function mergeProfiles(live, desired, drop) {
804
+ const dropped = new Set(drop);
805
+ const wanted = new Map(desired.map((profile) => [profile.id, profile]));
806
+ const seen = /* @__PURE__ */ new Set();
807
+ const kept = live.filter((entry) => !dropped.has(String(entry.id))).map((entry) => {
808
+ const profile = wanted.get(String(entry.id));
809
+ if (!profile) return entry;
810
+ seen.add(profile.id);
811
+ return { ...entry, name: profile.name, provider: profile.provider, notes: profile.notes };
812
+ });
813
+ return [...kept, ...desired.filter((profile) => !seen.has(profile.id)).map((profile) => ({ ...profile }))];
814
+ }
774
815
  var MINIMUM_VERSION, statusSchema, configSchema;
775
816
  var init_paseo = __esm({
776
817
  "src/paseo.ts"() {
@@ -784,7 +825,13 @@ var init_paseo = __esm({
784
825
  cliVersion: z.string(),
785
826
  daemonVersion: z.string().nullable()
786
827
  });
787
- configSchema = z.object({ config: z.object({ providers: z.record(z.string(), z.unknown()).optional() }) });
828
+ configSchema = z.object({
829
+ config: z.object({
830
+ providers: z.record(z.string(), z.unknown()).optional(),
831
+ // Read loosely: entries carry operator fields the room neither knows nor touches.
832
+ agentProfiles: z.array(z.record(z.string(), z.unknown())).optional()
833
+ })
834
+ });
788
835
  }
789
836
  });
790
837
 
@@ -792,17 +839,26 @@ var init_paseo = __esm({
792
839
  function providerId(agent, role) {
793
840
  return `${agent}-${role}`;
794
841
  }
842
+ function profileId(agent, role) {
843
+ return `room-${agent}-${role}`;
844
+ }
795
845
  function providerLabel(agent, role) {
796
846
  const title = (value) => value.charAt(0).toUpperCase() + value.slice(1);
797
847
  return `${title(agent)} ${title(role)}`;
798
848
  }
799
- var ROLES, AGENT_IDS, ROLE_PASEO_TOOLS;
849
+ var ROLES, AGENT_IDS, ROLE_PASEO_TOOLS, ROLE_THINKING, ROLE_NOTES;
800
850
  var init_roles = __esm({
801
851
  "src/roles.ts"() {
802
852
  "use strict";
803
853
  ROLES = ["supervisor", "lead", "peer"];
804
854
  AGENT_IDS = ["codex", "claude"];
805
855
  ROLE_PASEO_TOOLS = { supervisor: true, lead: true, peer: false };
856
+ ROLE_THINKING = { supervisor: "low", lead: "high", peer: "high" };
857
+ ROLE_NOTES = {
858
+ supervisor: "Human-facing routing seat. Opened by Human, never by another agent.",
859
+ lead: "Project technical owner. Opened by Human or Supervisor. Creates Peer seats only.",
860
+ peer: "Runs one Lead brief, writing or read-only. Created by Lead, one per brief, closed with it."
861
+ };
806
862
  }
807
863
  });
808
864
 
@@ -853,6 +909,15 @@ function roleProviders(layout, agent, binary, roles) {
853
909
  ...agent.pins
854
910
  }]));
855
911
  }
912
+ function roleProfiles(agent, roles) {
913
+ return roles.map((role) => ({
914
+ id: profileId(agent.id, role),
915
+ name: providerLabel(agent.id, role),
916
+ provider: providerId(agent.id, role),
917
+ thinkingOptionId: ROLE_THINKING[role],
918
+ notes: ROLE_NOTES[role]
919
+ }));
920
+ }
856
921
  async function buildDesired(layout, agents, roles) {
857
922
  const entries = [
858
923
  { kind: "dir", path: layout.roomHome },
@@ -860,44 +925,60 @@ async function buildDesired(layout, agents, roles) {
860
925
  { kind: "file", path: join7(sharedRoom(layout), "WORKSPACE_PROTOCOL.md"), content: renderInstructions("workspace") }
861
926
  ];
862
927
  const providers = {};
928
+ const profiles = [];
863
929
  const checks = [];
864
930
  for (const id of agents) {
865
931
  const agent = AGENTS[id];
866
932
  const plan = await agent.build(layout, roles);
867
933
  entries.push(...plan.entries);
868
934
  checks.push(...plan.checks);
869
- if (plan.binary !== void 0) Object.assign(providers, roleProviders(layout, agent, plan.binary, roles));
935
+ if (plan.binary === void 0) continue;
936
+ Object.assign(providers, roleProviders(layout, agent, plan.binary, roles));
937
+ profiles.push(...roleProfiles(agent, roles));
870
938
  }
871
939
  entries.push({ kind: "file", path: join7(layout.roomHome, MARKER), content: renderMarker(package_default.version, agents, roles) });
872
- return { entries, providers, checks };
940
+ return { entries, providers, profiles, checks };
873
941
  }
874
942
  async function staleFrom(layout, previous, agents, roles) {
875
943
  if (!previous) return NOTHING_STALE;
876
944
  const kept = new Set(agents.flatMap((agent) => roles.map((role) => providerId(agent, role))));
877
945
  const providerIds = [];
946
+ const profileIds = [];
878
947
  const directories = [];
879
948
  for (const agent of previous.agents) {
880
949
  for (const role of previous.roles) {
881
950
  if (kept.has(providerId(agent, role))) continue;
882
951
  providerIds.push(providerId(agent, role));
952
+ profileIds.push(profileId(agent, role));
883
953
  const path = roleHome(layout, agent, role);
884
954
  if (await exists(path)) directories.push(path);
885
955
  }
886
956
  }
887
- return { providerIds, directories };
957
+ return { providerIds, profileIds, directories };
888
958
  }
889
959
  async function planRoom(session, desired, stale) {
890
960
  const live = await session.readProviders();
891
- return [
892
- ...await planEntries(desired.entries),
893
- ...Object.entries(desired.providers).map(([id, provider]) => ({
894
- action: !(id in live) ? "create" : providerMatches(provider, live[id]) ? "noop" : "update",
895
- kind: "provider",
896
- target: id
897
- })),
898
- ...stale.providerIds.filter((id) => id in live).map((id) => ({ action: "remove", kind: "provider", target: id })),
899
- ...stale.directories.map((path) => ({ action: "remove", kind: "dir", target: path }))
900
- ];
961
+ const liveProfiles = await session.readProfiles();
962
+ const byId = new Map(liveProfiles.map((entry) => [String(entry.id), entry]));
963
+ return {
964
+ liveProfiles,
965
+ operations: [
966
+ ...await planEntries(desired.entries),
967
+ ...Object.entries(desired.providers).map(([id, provider]) => ({
968
+ action: !(id in live) ? "create" : providerMatches(provider, live[id]) ? "noop" : "update",
969
+ kind: "provider",
970
+ target: id
971
+ })),
972
+ ...desired.profiles.map((profile) => ({
973
+ action: !byId.has(profile.id) ? "create" : profileMatches(profile, byId.get(profile.id)) ? "noop" : "update",
974
+ kind: "profile",
975
+ target: profile.id
976
+ })),
977
+ ...stale.providerIds.filter((id) => id in live).map((id) => ({ action: "remove", kind: "provider", target: id })),
978
+ ...stale.profileIds.filter((id) => byId.has(id)).map((id) => ({ action: "remove", kind: "profile", target: id })),
979
+ ...stale.directories.map((path) => ({ action: "remove", kind: "dir", target: path }))
980
+ ]
981
+ };
901
982
  }
902
983
  async function setup(options = {}) {
903
984
  const layout = resolveLayout(options, options.env);
@@ -911,7 +992,7 @@ async function setup(options = {}) {
911
992
  if (hasFailure(checks)) return failed("setup", checks);
912
993
  const stale = await staleFrom(layout, await readMarker(layout), agents, ROLES);
913
994
  return withSession(daemon.daemon, async (session) => {
914
- const operations = await planRoom(session, desired, stale);
995
+ const { operations, liveProfiles } = await planRoom(session, desired, stale);
915
996
  const pending = operations.filter((operation) => operation.action !== "noop");
916
997
  if (!options.apply) {
917
998
  return {
@@ -927,6 +1008,9 @@ async function setup(options = {}) {
927
1008
  const ids = Object.keys(desired.providers);
928
1009
  await session.writeProviders(desired.providers);
929
1010
  if (stale.providerIds.length > 0) await session.removeProviders(stale.providerIds);
1011
+ if (pending.some((operation) => operation.kind === "profile")) {
1012
+ await session.writeProfiles(mergeProfiles(liveProfiles, desired.profiles, stale.profileIds));
1013
+ }
930
1014
  await session.refresh(ids);
931
1015
  return {
932
1016
  command: "setup",
@@ -951,14 +1035,17 @@ async function verify(options = {}) {
951
1035
  const checks = [...daemon.checks, ...desired.checks];
952
1036
  if (hasFailure(checks)) return failed("verify", checks);
953
1037
  return withSession(daemon.daemon, async (session) => {
954
- const operations = await planRoom(session, desired, NOTHING_STALE);
1038
+ const { operations } = await planRoom(session, desired, NOTHING_STALE);
955
1039
  const drifted = operations.filter((operation) => operation.action !== "noop");
956
- const providers = drifted.filter((operation) => operation.kind === "provider").length;
957
- const files = drifted.length - providers;
1040
+ const count = (kind) => drifted.filter((operation) => operation.kind === kind).length;
1041
+ const providers = count("provider");
1042
+ const profiles = count("profile");
1043
+ const files = drifted.length - providers - profiles;
958
1044
  const all = [
959
1045
  ...checks,
960
1046
  files === 0 ? pass("room.files", "Every managed role file matches the current definition.") : fail("room.files", `${String(files)} managed role files are missing or outdated.`, "Run: paseo-room setup --apply"),
961
- providers === 0 ? pass("room.providers", `All ${String(Object.keys(desired.providers).length)} Paseo providers are registered as expected.`) : fail("room.providers", `${String(providers)} Paseo providers are missing or differ.`, "Run: paseo-room setup --apply")
1047
+ providers === 0 ? pass("room.providers", `All ${String(Object.keys(desired.providers).length)} Paseo providers are registered as expected.`) : fail("room.providers", `${String(providers)} Paseo providers are missing or differ.`, "Run: paseo-room setup --apply"),
1048
+ profiles === 0 ? pass("room.profiles", `All ${String(desired.profiles.length)} Paseo agent profiles are registered as expected.`) : fail("room.profiles", `${String(profiles)} Paseo agent profiles are missing or differ.`, "Run: paseo-room setup --apply")
962
1049
  ];
963
1050
  return {
964
1051
  command: "verify",
@@ -978,8 +1065,10 @@ async function remove(options = {}) {
978
1065
  const invalid = layoutChecks(layout, marker.agents);
979
1066
  if (invalid.length > 0) return failed("remove", invalid);
980
1067
  const ids = marker.agents.flatMap((agent) => marker.roles.map((role) => providerId(agent, role)));
1068
+ const profiles = new Set(marker.agents.flatMap((agent) => marker.roles.map((role) => profileId(agent, role))));
981
1069
  const operations = [
982
1070
  ...ids.map((id) => ({ action: "remove", kind: "provider", target: id })),
1071
+ ...[...profiles].map((id) => ({ action: "remove", kind: "profile", target: id })),
983
1072
  { action: "remove", kind: "dir", target: layout.roomHome }
984
1073
  ];
985
1074
  if (!options.apply) {
@@ -988,10 +1077,15 @@ async function remove(options = {}) {
988
1077
  const daemon = await checkDaemon(layout, options.env);
989
1078
  const checks = [];
990
1079
  if (daemon.daemon) {
991
- await withSession(daemon.daemon, (session) => session.removeProviders(ids), sessionOptions(options));
992
- checks.push(pass("room.providers", `Removed ${String(ids.length)} Paseo providers.`));
1080
+ await withSession(daemon.daemon, async (session) => {
1081
+ await session.removeProviders(ids);
1082
+ const live = await session.readProfiles();
1083
+ const kept = live.filter((entry) => !profiles.has(String(entry.id)));
1084
+ if (kept.length !== live.length) await session.writeProfiles(kept);
1085
+ }, sessionOptions(options));
1086
+ checks.push(pass("room.providers", `Removed ${String(ids.length)} Paseo providers and their agent profiles.`));
993
1087
  } else {
994
- 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." });
1088
+ checks.push({ id: "room.providers", status: "warn", message: "Paseo is unreachable; provider and profile entries were left in place.", fix: "Start Paseo and run remove again to clear them." });
995
1089
  }
996
1090
  await rm2(layout.roomHome, { recursive: true, force: true });
997
1091
  checks.push(pass("room.files", `Deleted ${layout.roomHome}.`));
@@ -1012,7 +1106,7 @@ var init_commands = __esm({
1012
1106
  init_room();
1013
1107
  init_roles();
1014
1108
  AGENTS = { codex: codexAgent, claude: claudeAgent };
1015
- NOTHING_STALE = { providerIds: [], directories: [] };
1109
+ NOTHING_STALE = { providerIds: [], profileIds: [], directories: [] };
1016
1110
  }
1017
1111
  });
1018
1112
 
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/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,M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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.3\",\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' | 'profile';\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 Of the seats available, Supervisor opens Lead seats, and one Lead per project. Opening\n Peer seats is Lead's; opening another Supervisor is Human's.\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-207': clause(`\n Lead opens Peer seats and no others. A seat list may offer Lead and Supervisor seats;\n opening one creates a second orchestrator or inverts the Human-facing seat, so Lead\n must not, whatever the tool permits.\n\n Open each Peer on the same agent implementation as this seat unless the workspace\n protocol routes that kind of work elsewhere. A Peer belongs to one brief: close it when\n the brief closes rather than holding a standing pool.\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 When seats from more than one agent implementation are available, a second\n implementation is worth most as an independent reader of a candidate the first one\n wrote. Absent a repository rule assigning work by kind, keep a task on the\n implementation of the seat that opened it.\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', 'RC-207'],\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 { Profile, 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({\n config: z.object({\n providers: z.record(z.string(), z.unknown()).optional(),\n // Read loosely: entries carry operator fields the room neither knows nor touches.\n agentProfiles: z.array(z.record(z.string(), z.unknown())).optional(),\n }),\n});\nexport type LiveProfile = Record<string, unknown>;\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 readProfiles(): Promise<readonly LiveProfile[]>;\n /** Paseo has no remove-one call for profiles, so this replaces the whole array. */\n writeProfiles(profiles: readonly LiveProfile[]): 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 readProfiles() {\n const response = configSchema.parse(await client.config.get());\n return response.config.agentProfiles ?? [];\n },\n async writeProfiles(profiles) {\n await client.config.patch({ agentProfiles: [...profiles] } as unknown as Parameters<PaseoClient['config']['patch']>[0]);\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\n/** Compare only the fields the room writes on an update; the rest are the operator's. */\nexport function profileMatches(desired: Profile, live: unknown): boolean {\n if (live === null || typeof live !== 'object') return false;\n const entry = live as Record<string, unknown>;\n return entry.name === desired.name && entry.provider === desired.provider && entry.notes === desired.notes;\n}\n\n/**\n * Paseo stores every profile in one host-wide array, so the room rewrites that array\n * rather than patching an entry. Operator profiles pass through untouched, and so does\n * every field of a room profile that the room does not own.\n */\nexport function mergeProfiles(\n live: readonly LiveProfile[],\n desired: readonly Profile[],\n drop: readonly string[],\n): LiveProfile[] {\n const dropped = new Set(drop);\n const wanted = new Map(desired.map(profile => [profile.id, profile]));\n const seen = new Set<string>();\n const kept = live\n .filter(entry => !dropped.has(String(entry.id)))\n .map(entry => {\n const profile = wanted.get(String(entry.id));\n if (!profile) return entry;\n seen.add(profile.id);\n // thinkingOptionId is seeded on create only, so a retuned seat survives setup.\n return { ...entry, name: profile.name, provider: profile.provider, notes: profile.notes };\n });\n return [...kept, ...desired.filter(profile => !seen.has(profile.id)).map(profile => ({ ...profile }))];\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\n/**\n * Reasoning effort a seat starts at: Supervisor routes, Lead judges, Peer implements.\n * Deliberately short of the top option on either agent — `ultra` and `ultracode`\n * advertise automatic task delegation, which is a second control plane.\n */\nexport const ROLE_THINKING: Record<Role, string> = { supervisor: 'low', lead: 'high', peer: 'high' };\n\n/** Paseo shows these to orchestrating agents, so each one says who may open the seat. */\nexport const ROLE_NOTES: Record<Role, string> = {\n supervisor: 'Human-facing routing seat. Opened by Human, never by another agent.',\n lead: 'Project technical owner. Opened by Human or Supervisor. Creates Peer seats only.',\n peer: 'Runs one Lead brief, writing or read-only. Created by Lead, one per brief, closed with it.',\n};\n\nexport function providerId(agent: AgentId, role: Role): string {\n return `${agent}-${role}`;\n}\n/** Distinct from the provider id: a host may already have a profile by that name. */\nexport function profileId(agent: AgentId, role: Role): string {\n return `room-${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, Profile, 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, mergeProfiles, profileMatches, providerMatches, withSession, type ClientFactory, type LiveProfile, 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 { profileId, providerId, providerLabel, ROLES, ROLE_NOTES, ROLE_PASEO_TOOLS, ROLE_THINKING, 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\n/** The picker preset that points at a provider, so a seat is one click rather than four. */\nfunction roleProfiles(agent: Agent, roles: readonly Role[]): Profile[] {\n return roles.map(role => ({\n id: profileId(agent.id, role),\n name: providerLabel(agent.id, role),\n provider: providerId(agent.id, role),\n thinkingOptionId: ROLE_THINKING[role],\n notes: ROLE_NOTES[role],\n }));\n}\n\ninterface Desired {\n readonly entries: readonly Entry[];\n readonly providers: Readonly<Record<string, Provider>>;\n readonly profiles: readonly Profile[];\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 profiles: Profile[] = [];\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) continue;\n Object.assign(providers, roleProviders(layout, agent, plan.binary, roles));\n profiles.push(...roleProfiles(agent, roles));\n }\n entries.push({ kind: 'file', path: join(layout.roomHome, MARKER), content: renderMarker(metadata.version, agents, roles) });\n return { entries, providers, profiles, checks };\n}\n\ninterface Stale {\n readonly providerIds: readonly string[];\n readonly profileIds: readonly string[];\n readonly directories: readonly string[];\n}\nconst NOTHING_STALE: Stale = { providerIds: [], profileIds: [], 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 profileIds: 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 profileIds.push(profileId(agent, role));\n const path = roleHome(layout, agent, role);\n if (await exists(path)) directories.push(path);\n }\n }\n return { providerIds, profileIds, directories };\n}\n\ninterface Plan {\n readonly operations: readonly Operation[];\n /** Carried out of the plan so apply rewrites the array it actually compared against. */\n readonly liveProfiles: readonly LiveProfile[];\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<Plan> {\n const live = await session.readProviders();\n const liveProfiles = await session.readProfiles();\n const byId = new Map(liveProfiles.map(entry => [String(entry.id), entry]));\n return {\n liveProfiles,\n operations: [\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 ...desired.profiles.map(profile => ({\n action: !byId.has(profile.id) ? 'create' : profileMatches(profile, byId.get(profile.id)) ? 'noop' : 'update',\n kind: 'profile',\n target: profile.id,\n }) satisfies Operation),\n ...stale.providerIds.filter(id => id in live).map(id => ({ action: 'remove', kind: 'provider', target: id }) satisfies Operation),\n ...stale.profileIds.filter(id => byId.has(id)).map(id => ({ action: 'remove', kind: 'profile', target: id }) satisfies Operation),\n ...stale.directories.map(path => ({ action: 'remove', kind: 'dir', target: path }) satisfies Operation),\n ],\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, liveProfiles } = 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 // Profiles point at providers, so they are written once the providers exist — and\n // only when something changed, since one write replaces the host's whole array.\n if (pending.some(operation => operation.kind === 'profile')) {\n await session.writeProfiles(mergeProfiles(liveProfiles, desired.profiles, stale.profileIds));\n }\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 count = (kind: Operation['kind']): number => drifted.filter(operation => operation.kind === kind).length;\n const providers = count('provider');\n const profiles = count('profile');\n const files = drifted.length - providers - profiles;\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 profiles === 0\n ? pass('room.profiles', `All ${String(desired.profiles.length)} Paseo agent profiles are registered as expected.`)\n : fail('room.profiles', `${String(profiles)} Paseo agent profiles 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 profiles = new Set(marker.agents.flatMap(agent => marker.roles.map(role => profileId(agent, role))));\n const operations: Operation[] = [\n ...ids.map(id => ({ action: 'remove', kind: 'provider', target: id }) satisfies Operation),\n ...[...profiles].map(id => ({ action: 'remove', kind: 'profile', 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, async session => {\n await session.removeProviders(ids);\n const live = await session.readProfiles();\n const kept = live.filter(entry => !profiles.has(String(entry.id)));\n if (kept.length !== live.length) await session.writeProfiles(kept);\n }, sessionOptions(options));\n checks.push(pass('room.providers', `Removed ${String(ids.length)} Paseo providers and their agent profiles.`));\n } else {\n checks.push({ id: 'room.providers', status: 'warn', message: 'Paseo is unreachable; provider and profile 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,SAAiB,QAAkC;AACxE,SAAO,EAAE,SAAS,SAA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AAA,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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paseo-room",
3
- "version": "0.1.0-alpha.2",
3
+ "version": "0.1.0-alpha.3",
4
4
  "description": "One CLI that configures Codex/Claude role homes in $HOME and registers them with your local Paseo daemon.",
5
5
  "keywords": [
6
6
  "paseo",