sisyphi 1.2.17 → 1.2.19

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.
Files changed (37) hide show
  1. package/dist/cli.js +165 -158
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +32 -0
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/templates/agent-plugin/agents/CLAUDE.md +1 -1
  6. package/dist/templates/agent-plugin/agents/operator.md +9 -1
  7. package/dist/templates/agent-plugin/agents/review/CLAUDE.md +0 -1
  8. package/dist/templates/agent-plugin/agents/review/compliance.md +4 -0
  9. package/dist/templates/agent-plugin/agents/review/efficiency.md +4 -0
  10. package/dist/templates/agent-plugin/agents/review/quality.md +4 -0
  11. package/dist/templates/agent-plugin/agents/review/reuse.md +4 -0
  12. package/dist/templates/agent-plugin/agents/review/security.md +4 -0
  13. package/dist/templates/agent-plugin/agents/review/tests.md +4 -0
  14. package/dist/templates/agent-plugin/agents/review.md +8 -6
  15. package/dist/templates/agent-suffix.md +9 -1
  16. package/dist/templates/orchestrator-base.md +14 -1
  17. package/dist/templates/orchestrator-plugin/hooks/goal-length-guard.sh +60 -0
  18. package/dist/templates/orchestrator-plugin/hooks/goal-read-advisory.sh +54 -0
  19. package/dist/templates/orchestrator-plugin/hooks/hooks.json +20 -0
  20. package/dist/templates/orchestrator-validation.md +10 -0
  21. package/package.json +1 -1
  22. package/templates/agent-plugin/agents/CLAUDE.md +1 -1
  23. package/templates/agent-plugin/agents/operator.md +9 -1
  24. package/templates/agent-plugin/agents/review/CLAUDE.md +0 -1
  25. package/templates/agent-plugin/agents/review/compliance.md +4 -0
  26. package/templates/agent-plugin/agents/review/efficiency.md +4 -0
  27. package/templates/agent-plugin/agents/review/quality.md +4 -0
  28. package/templates/agent-plugin/agents/review/reuse.md +4 -0
  29. package/templates/agent-plugin/agents/review/security.md +4 -0
  30. package/templates/agent-plugin/agents/review/tests.md +4 -0
  31. package/templates/agent-plugin/agents/review.md +8 -6
  32. package/templates/agent-suffix.md +9 -1
  33. package/templates/orchestrator-base.md +14 -1
  34. package/templates/orchestrator-plugin/hooks/goal-length-guard.sh +60 -0
  35. package/templates/orchestrator-plugin/hooks/goal-read-advisory.sh +54 -0
  36. package/templates/orchestrator-plugin/hooks/hooks.json +20 -0
  37. package/templates/orchestrator-validation.md +10 -0
package/dist/cli.js CHANGED
@@ -3135,12 +3135,175 @@ var init_spawn_helpers = __esm({
3135
3135
  }
3136
3136
  });
3137
3137
 
3138
+ // src/cli/help-rubric.ts
3139
+ function commandPath(cmd) {
3140
+ const parts = [];
3141
+ let cur = cmd;
3142
+ while (cur !== null) {
3143
+ parts.push(cur.name());
3144
+ cur = cur.parent;
3145
+ }
3146
+ parts.reverse();
3147
+ parts.shift();
3148
+ return parts.join(" ");
3149
+ }
3150
+ function subcommandRubric(cmd) {
3151
+ if (cmd.name() === "help") {
3152
+ return cmd.summary() || cmd.description();
3153
+ }
3154
+ const p = commandPath(cmd);
3155
+ let key = p;
3156
+ const deployProviderMatch = p.match(/^deploy (hetzner|aws) (.+)$/);
3157
+ if (deployProviderMatch) {
3158
+ key = `deploy * ${deployProviderMatch[2]}`;
3159
+ }
3160
+ const r = RUBRICS[key];
3161
+ if (r) {
3162
+ return `${r.short} | use when ${r.useWhen}`;
3163
+ }
3164
+ return cmd.summary() || cmd.description();
3165
+ }
3166
+ var RUBRICS, CONCEPTS_BLOCK, ROOT_AFTER_HELP;
3167
+ var init_help_rubric = __esm({
3168
+ "src/cli/help-rubric.ts"() {
3169
+ "use strict";
3170
+ RUBRICS = {
3171
+ "session": { short: "Manage tracked orchestration sessions", useWhen: "acting on a unit of orchestrated work" },
3172
+ "agent": { short: "Operate on worker agents", useWhen: "directing or reading a spawned agent" },
3173
+ "orch": { short: "Talk to / steer the orchestrator", useWhen: "guiding the session's orchestrator" },
3174
+ "ask": { short: "Human-in-the-loop question I/O", useWhen: "answering or polling a blocking ask" },
3175
+ "ui": { short: "Interactive surfaces", useWhen: "a human wants the dashboard, guide, or scratch" },
3176
+ "segment": { short: "Status-line segment registration", useWhen: "wiring tmux status indicators" },
3177
+ "admin": { short: "Install, verify, and report", useWhen: "setting up or diagnosing the install" },
3178
+ "companion": { short: "Companion-pane helper", useWhen: "driving the companion Claude pane" },
3179
+ "deploy": { short: "Provision cloud boxes (Terraform)", useWhen: "standing up or tearing down infra" },
3180
+ "cloud": { short: "Per-repo workflow on a deployed box", useWhen: "syncing work to/from the box" },
3181
+ "feedback": { short: "Report a problem with sisyphus itself", useWhen: "the user complains about the tool or workflow" },
3182
+ "session lifecycle": { short: "Start/stop/advance a session", useWhen: "changing whether a session runs" },
3183
+ "session inspect": { short: "Read session state", useWhen: "you need status/history/context without mutating" },
3184
+ "session config": { short: "Change a session's settings", useWhen: "adjusting task, effort, or dangerous mode" },
3185
+ "session recover": { short: "Repair or relocate a session", useWhen: "a session is stuck, lost, or needs rollback" },
3186
+ "session scratch": { short: "Open a standalone (non-sisyphus) Claude", useWhen: "you want a throwaway Claude in this repo" },
3187
+ "session lifecycle start": { short: "Start a new session", useWhen: "beginning work on a new task" },
3188
+ "session lifecycle complete": { short: "Mark the current cycle complete", useWhen: "the orchestrator finished its work" },
3189
+ "session lifecycle continue": { short: "Continue past completion into a new cycle", useWhen: "more work follows completion" },
3190
+ "session lifecycle resume": { short: "Resume a paused/handed-off session", useWhen: "bringing a stopped session back" },
3191
+ "session lifecycle kill": { short: "Stop a session, keep its state", useWhen: "halting work but preserving the record" },
3192
+ "session lifecycle delete": { short: "Remove a session and its state", useWhen: "discarding a session permanently" },
3193
+ "session inspect status": { short: "Show live session status", useWhen: "checking what is running now" },
3194
+ "session inspect list": { short: "List sessions", useWhen: "enumerating sessions in this repo" },
3195
+ "session inspect history": { short: "Show past sessions/cycles", useWhen: "reviewing prior runs" },
3196
+ "session inspect context": { short: "Print the orchestrator's context", useWhen: "auditing what the orchestrator sees" },
3197
+ "session inspect export": { short: "Export session transcript/state", useWhen: "archiving or sharing a session" },
3198
+ "session inspect requirements": { short: "Show/export the session requirements", useWhen: "reviewing the locked requirements doc" },
3199
+ "session config task": { short: "Set the session's task text", useWhen: "retargeting what the session works on" },
3200
+ "session config effort": { short: "Set the effort tier", useWhen: "tuning model effort for a session" },
3201
+ "session config dangerous": { short: "Toggle dangerous (skip-permissions) mode", useWhen: "allowing unattended tool use" },
3202
+ "session recover rollback": { short: "Roll back to an earlier cycle", useWhen: "a cycle went wrong" },
3203
+ "session recover reconnect": { short: "Reattach the daemon to a live session", useWhen: "the tmux/daemon link dropped" },
3204
+ "session recover quiesce": { short: "Pause a session at the next safe point", useWhen: "you need it to stop cleanly" },
3205
+ "session recover clone": { short: "Clone a session toward a new goal", useWhen: "forking work from an existing session" },
3206
+ "agent spawn": { short: "Spawn a worker agent", useWhen: "delegating a scoped sub-task" },
3207
+ "agent submit": { short: "Submit this agent's result upstream", useWhen: "from inside an agent, its work is done" },
3208
+ "agent report": { short: "Post a progress report", useWhen: "from inside an agent, updating mid-task" },
3209
+ "agent await": { short: "Block until a spawned agent submits", useWhen: "you need an agent's result before continuing" },
3210
+ "agent ctl": { short: "Agent process control", useWhen: "killing or restarting an agent process" },
3211
+ "agent io": { short: "Agent message I/O", useWhen: "sending text to or reading an agent" },
3212
+ "agent ctl kill": { short: "Kill an agent", useWhen: "an agent must stop immediately" },
3213
+ "agent ctl restart": { short: "Restart an agent", useWhen: "an agent is wedged and should start over" },
3214
+ "agent io tell": { short: "Send text to an agent", useWhen: "injecting instructions into a running agent" },
3215
+ "agent io read": { short: "Read an agent's transcript", useWhen: "inspecting what an agent produced" },
3216
+ "orch yield": { short: "Yield control back to the human/parent", useWhen: "the orchestrator is done or blocked" },
3217
+ "orch tell": { short: "Send text to the orchestrator", useWhen: "injecting guidance into the orchestrator" },
3218
+ "orch message": { short: "Queue a message for the orchestrator", useWhen: "leaving async input for the next turn" },
3219
+ "orch read": { short: "Read the orchestrator's transcript", useWhen: "inspecting orchestrator output" },
3220
+ "ask submit": { short: "Submit an ask deck for a human", useWhen: "an agent needs a human decision" },
3221
+ "ask poll": { short: "Block until an ask is answered", useWhen: "you need the human's answer before continuing" },
3222
+ "ask peek": { short: "Read an ask's state without blocking", useWhen: "checking ask status non-blocking" },
3223
+ "ui dashboard": { short: "Open the TUI dashboard", useWhen: "a human wants the monitoring UI" },
3224
+ "ui guide": { short: "Print the full usage guide", useWhen: "a human needs end-to-end docs" },
3225
+ "segment register": { short: "Register a status-line segment", useWhen: "adding a tmux status indicator" },
3226
+ "segment unregister": { short: "Remove a status-line segment", useWhen: "tearing one down" },
3227
+ "admin install": { short: "Install / uninstall sisyphus bits", useWhen: "first setup or removal" },
3228
+ "admin check": { short: "Verify the installation", useWhen: "diagnosing a broken or partial install" },
3229
+ "admin report": { short: "Diagnostics & telemetry", useWhen: "filing a bug or uploading session data" },
3230
+ "admin install setup": { short: "Run first-time setup", useWhen: "installing sisyphus on this machine" },
3231
+ "admin install setup-keybind": { short: "Install the tmux keybind", useWhen: "wiring the dashboard hotkey" },
3232
+ "admin install init": { short: "Initialize repo-local config", useWhen: "onboarding a new repo" },
3233
+ "admin install uninstall": { short: "Remove sisyphus", useWhen: "fully removing the install" },
3234
+ "admin check doctor": { short: "Run install diagnostics", useWhen: "something is not working and you want a health check" },
3235
+ "admin check check-keybinds": { short: "Verify tmux keybinds", useWhen: "the dashboard hotkey does not fire" },
3236
+ "admin check check-statusbar": { short: "Verify status-line wiring", useWhen: "status segments do not render" },
3237
+ "admin report bug": { short: "File a bug report", useWhen: "reporting a defect with context" },
3238
+ "admin report upload": { short: "Upload session data", useWhen: "sharing a session for support" },
3239
+ "admin report configure-upload": { short: "Configure the upload target", useWhen: "setting where uploads go" },
3240
+ "admin clean-zombies": { short: "Sweep stale zombie processes", useWhen: "cleaning up after a crashed daemon or hung agent" },
3241
+ "cloud box": { short: "Provision / operate the box for this repo", useWhen: "working with the box-side environment" },
3242
+ "cloud handoff": { short: "Move a session between local and box", useWhen: "relocating in-flight work" },
3243
+ "cloud box sync": { short: "Rsync this repo to the box", useWhen: "pushing local code to the box" },
3244
+ "cloud box install": { short: "Run the package install on the box", useWhen: "box deps are missing/stale" },
3245
+ "cloud box session": { short: "Create/refresh the box tmux home", useWhen: "the box-side session is absent" },
3246
+ "cloud box attach": { short: "Attach to the box session", useWhen: "you want to work on the box interactively" },
3247
+ "cloud box status": { short: "Print box-side status", useWhen: "checking box state for this repo" },
3248
+ "cloud box login": { short: "Run claude auth login on the box", useWhen: "the box needs Claude credentials" },
3249
+ "cloud box up": { short: "Sync+install+session in one shot", useWhen: "bringing the box up from cold" },
3250
+ "cloud handoff push": { short: "Hand a live session off to the box", useWhen: "moving local work to the cloud" },
3251
+ "cloud handoff pull": { short: "Reclaim a handed-off session locally", useWhen: "bringing cloud work back home" },
3252
+ "agent types": { short: "Agent-type catalog", useWhen: "discovering installable agent types" },
3253
+ "agent types list": { short: "List agent types", useWhen: "enumerating spawnable agent types" },
3254
+ "deploy list": { short: "List deploy providers", useWhen: "discovering supported providers" },
3255
+ "companion profile": { short: "Print companion profile", useWhen: "reading the combined memory + context + badges blob" },
3256
+ "companion memory": { short: "Show accumulated companion observations", useWhen: "reviewing what the companion noticed" },
3257
+ "companion context": { short: "Emit per-prompt companion context", useWhen: "the companion plugin hook needs context" },
3258
+ "companion pane": { short: "Open/focus the side claude pane", useWhen: "you want the companion pane by the dashboard" },
3259
+ "companion popup-test": { short: "Show a test commentary popup", useWhen: "validating feedback-key handling" },
3260
+ "deploy auth": { short: "Configure provider auth", useWhen: "setting up Tailscale/provider credentials" },
3261
+ "deploy hetzner": { short: "Hetzner box lifecycle", useWhen: "targeting Hetzner" },
3262
+ "deploy aws": { short: "AWS box lifecycle", useWhen: "targeting AWS" },
3263
+ "deploy auth tailscale": { short: "Configure Tailscale OAuth", useWhen: "joining the box to your tailnet" },
3264
+ "deploy * up": { short: "Provision the box", useWhen: "standing the box up" },
3265
+ "deploy * down": { short: "Destroy the box", useWhen: "tearing the box down" },
3266
+ "deploy * status": { short: "Print box outputs", useWhen: "checking IP/cost/instance" },
3267
+ "deploy * ssh": { short: "SSH/mosh into the box", useWhen: "getting a shell on the box" },
3268
+ "deploy * logs": { short: "Tail cloud-init + daemon logs", useWhen: "diagnosing a box-side failure" },
3269
+ "deploy * update": { short: "Upgrade sisyphus on the box", useWhen: "pulling the latest daemon onto the box" }
3270
+ };
3271
+ CONCEPTS_BLOCK = `
3272
+ Concepts
3273
+ session a tracked unit of orchestrated work on one task
3274
+ agent a worker Claude spawned to execute a scoped sub-task
3275
+ orchestrator the Claude that owns a session: decomposes, spawns, advances
3276
+ cycle one discovery\u2192plan\u2192implement\u2192validate iteration; the rollback unit
3277
+ ask a blocking question surfaced for a human to answer
3278
+ mode the session's current phase, driving orchestrator behavior
3279
+ `;
3280
+ ROOT_AFTER_HELP = `
3281
+ I/O contract: flags and positional args on input, JSON on stdout (JSONL for streams).
3282
+
3283
+ Exit codes:
3284
+ 0 success
3285
+ 1 permanent error (fallback)
3286
+ 2 usage error (bad args/shape)
3287
+ 3 not found
3288
+ 4 ambiguous (multiple matches \u2014 see error.candidates)
3289
+ 5 conflict (already-exists, wrong-state)
3290
+ 60 transient (retry-safe: daemon down, timeout, lock contention)
3291
+
3292
+ Errors:
3293
+ {"ok": false,
3294
+ "error": {"code": "<stable-enum>", "kind": "<usage|not_found|ambiguous|conflict|transient|permanent>",
3295
+ "message": "...", "received"?: ..., "expected"?: ..., "next"?: "...", "candidates"?: [...]}}
3296
+ `;
3297
+ }
3298
+ });
3299
+
3138
3300
  // src/daemon/help-inject.ts
3139
3301
  import { execSync as execSync19 } from "child_process";
3140
3302
  var init_help_inject = __esm({
3141
3303
  "src/daemon/help-inject.ts"() {
3142
3304
  "use strict";
3143
3305
  init_spawn_helpers();
3306
+ init_help_rubric();
3144
3307
  }
3145
3308
  });
3146
3309
 
@@ -13638,147 +13801,7 @@ Exit codes: 0 ok`
13638
13801
 
13639
13802
  // src/cli/index.ts
13640
13803
  init_paths();
13641
-
13642
- // src/cli/help-rubric.ts
13643
- function commandPath(cmd) {
13644
- const parts = [];
13645
- let cur = cmd;
13646
- while (cur !== null) {
13647
- parts.push(cur.name());
13648
- cur = cur.parent;
13649
- }
13650
- parts.reverse();
13651
- parts.shift();
13652
- return parts.join(" ");
13653
- }
13654
- var RUBRICS = {
13655
- "session": { short: "Manage tracked orchestration sessions", useWhen: "acting on a unit of orchestrated work" },
13656
- "agent": { short: "Operate on worker agents", useWhen: "directing or reading a spawned agent" },
13657
- "orch": { short: "Talk to / steer the orchestrator", useWhen: "guiding the session's orchestrator" },
13658
- "ask": { short: "Human-in-the-loop question I/O", useWhen: "answering or polling a blocking ask" },
13659
- "ui": { short: "Interactive surfaces", useWhen: "a human wants the dashboard, guide, or scratch" },
13660
- "segment": { short: "Status-line segment registration", useWhen: "wiring tmux status indicators" },
13661
- "admin": { short: "Install, verify, and report", useWhen: "setting up or diagnosing the install" },
13662
- "companion": { short: "Companion-pane helper", useWhen: "driving the companion Claude pane" },
13663
- "deploy": { short: "Provision cloud boxes (Terraform)", useWhen: "standing up or tearing down infra" },
13664
- "cloud": { short: "Per-repo workflow on a deployed box", useWhen: "syncing work to/from the box" },
13665
- "feedback": { short: "Report a problem with sisyphus itself", useWhen: "the user complains about the tool or workflow" },
13666
- "session lifecycle": { short: "Start/stop/advance a session", useWhen: "changing whether a session runs" },
13667
- "session inspect": { short: "Read session state", useWhen: "you need status/history/context without mutating" },
13668
- "session config": { short: "Change a session's settings", useWhen: "adjusting task, effort, or dangerous mode" },
13669
- "session recover": { short: "Repair or relocate a session", useWhen: "a session is stuck, lost, or needs rollback" },
13670
- "session scratch": { short: "Open a standalone (non-sisyphus) Claude", useWhen: "you want a throwaway Claude in this repo" },
13671
- "session lifecycle start": { short: "Start a new session", useWhen: "beginning work on a new task" },
13672
- "session lifecycle complete": { short: "Mark the current cycle complete", useWhen: "the orchestrator finished its work" },
13673
- "session lifecycle continue": { short: "Continue past completion into a new cycle", useWhen: "more work follows completion" },
13674
- "session lifecycle resume": { short: "Resume a paused/handed-off session", useWhen: "bringing a stopped session back" },
13675
- "session lifecycle kill": { short: "Stop a session, keep its state", useWhen: "halting work but preserving the record" },
13676
- "session lifecycle delete": { short: "Remove a session and its state", useWhen: "discarding a session permanently" },
13677
- "session inspect status": { short: "Show live session status", useWhen: "checking what is running now" },
13678
- "session inspect list": { short: "List sessions", useWhen: "enumerating sessions in this repo" },
13679
- "session inspect history": { short: "Show past sessions/cycles", useWhen: "reviewing prior runs" },
13680
- "session inspect context": { short: "Print the orchestrator's context", useWhen: "auditing what the orchestrator sees" },
13681
- "session inspect export": { short: "Export session transcript/state", useWhen: "archiving or sharing a session" },
13682
- "session inspect requirements": { short: "Show/export the session requirements", useWhen: "reviewing the locked requirements doc" },
13683
- "session config task": { short: "Set the session's task text", useWhen: "retargeting what the session works on" },
13684
- "session config effort": { short: "Set the effort tier", useWhen: "tuning model effort for a session" },
13685
- "session config dangerous": { short: "Toggle dangerous (skip-permissions) mode", useWhen: "allowing unattended tool use" },
13686
- "session recover rollback": { short: "Roll back to an earlier cycle", useWhen: "a cycle went wrong" },
13687
- "session recover reconnect": { short: "Reattach the daemon to a live session", useWhen: "the tmux/daemon link dropped" },
13688
- "session recover quiesce": { short: "Pause a session at the next safe point", useWhen: "you need it to stop cleanly" },
13689
- "session recover clone": { short: "Clone a session toward a new goal", useWhen: "forking work from an existing session" },
13690
- "agent spawn": { short: "Spawn a worker agent", useWhen: "delegating a scoped sub-task" },
13691
- "agent submit": { short: "Submit this agent's result upstream", useWhen: "from inside an agent, its work is done" },
13692
- "agent report": { short: "Post a progress report", useWhen: "from inside an agent, updating mid-task" },
13693
- "agent await": { short: "Block until a spawned agent submits", useWhen: "you need an agent's result before continuing" },
13694
- "agent ctl": { short: "Agent process control", useWhen: "killing or restarting an agent process" },
13695
- "agent io": { short: "Agent message I/O", useWhen: "sending text to or reading an agent" },
13696
- "agent ctl kill": { short: "Kill an agent", useWhen: "an agent must stop immediately" },
13697
- "agent ctl restart": { short: "Restart an agent", useWhen: "an agent is wedged and should start over" },
13698
- "agent io tell": { short: "Send text to an agent", useWhen: "injecting instructions into a running agent" },
13699
- "agent io read": { short: "Read an agent's transcript", useWhen: "inspecting what an agent produced" },
13700
- "orch yield": { short: "Yield control back to the human/parent", useWhen: "the orchestrator is done or blocked" },
13701
- "orch tell": { short: "Send text to the orchestrator", useWhen: "injecting guidance into the orchestrator" },
13702
- "orch message": { short: "Queue a message for the orchestrator", useWhen: "leaving async input for the next turn" },
13703
- "orch read": { short: "Read the orchestrator's transcript", useWhen: "inspecting orchestrator output" },
13704
- "ask submit": { short: "Submit an ask deck for a human", useWhen: "an agent needs a human decision" },
13705
- "ask poll": { short: "Block until an ask is answered", useWhen: "you need the human's answer before continuing" },
13706
- "ask peek": { short: "Read an ask's state without blocking", useWhen: "checking ask status non-blocking" },
13707
- "ui dashboard": { short: "Open the TUI dashboard", useWhen: "a human wants the monitoring UI" },
13708
- "ui guide": { short: "Print the full usage guide", useWhen: "a human needs end-to-end docs" },
13709
- "segment register": { short: "Register a status-line segment", useWhen: "adding a tmux status indicator" },
13710
- "segment unregister": { short: "Remove a status-line segment", useWhen: "tearing one down" },
13711
- "admin install": { short: "Install / uninstall sisyphus bits", useWhen: "first setup or removal" },
13712
- "admin check": { short: "Verify the installation", useWhen: "diagnosing a broken or partial install" },
13713
- "admin report": { short: "Diagnostics & telemetry", useWhen: "filing a bug or uploading session data" },
13714
- "admin install setup": { short: "Run first-time setup", useWhen: "installing sisyphus on this machine" },
13715
- "admin install setup-keybind": { short: "Install the tmux keybind", useWhen: "wiring the dashboard hotkey" },
13716
- "admin install init": { short: "Initialize repo-local config", useWhen: "onboarding a new repo" },
13717
- "admin install uninstall": { short: "Remove sisyphus", useWhen: "fully removing the install" },
13718
- "admin check doctor": { short: "Run install diagnostics", useWhen: "something is not working and you want a health check" },
13719
- "admin check check-keybinds": { short: "Verify tmux keybinds", useWhen: "the dashboard hotkey does not fire" },
13720
- "admin check check-statusbar": { short: "Verify status-line wiring", useWhen: "status segments do not render" },
13721
- "admin report bug": { short: "File a bug report", useWhen: "reporting a defect with context" },
13722
- "admin report upload": { short: "Upload session data", useWhen: "sharing a session for support" },
13723
- "admin report configure-upload": { short: "Configure the upload target", useWhen: "setting where uploads go" },
13724
- "admin clean-zombies": { short: "Sweep stale zombie processes", useWhen: "cleaning up after a crashed daemon or hung agent" },
13725
- "cloud box": { short: "Provision / operate the box for this repo", useWhen: "working with the box-side environment" },
13726
- "cloud handoff": { short: "Move a session between local and box", useWhen: "relocating in-flight work" },
13727
- "cloud box sync": { short: "Rsync this repo to the box", useWhen: "pushing local code to the box" },
13728
- "cloud box install": { short: "Run the package install on the box", useWhen: "box deps are missing/stale" },
13729
- "cloud box session": { short: "Create/refresh the box tmux home", useWhen: "the box-side session is absent" },
13730
- "cloud box attach": { short: "Attach to the box session", useWhen: "you want to work on the box interactively" },
13731
- "cloud box status": { short: "Print box-side status", useWhen: "checking box state for this repo" },
13732
- "cloud box login": { short: "Run claude auth login on the box", useWhen: "the box needs Claude credentials" },
13733
- "cloud box up": { short: "Sync+install+session in one shot", useWhen: "bringing the box up from cold" },
13734
- "cloud handoff push": { short: "Hand a live session off to the box", useWhen: "moving local work to the cloud" },
13735
- "cloud handoff pull": { short: "Reclaim a handed-off session locally", useWhen: "bringing cloud work back home" },
13736
- "agent types": { short: "Agent-type catalog", useWhen: "discovering installable agent types" },
13737
- "agent types list": { short: "List agent types", useWhen: "enumerating spawnable agent types" },
13738
- "deploy list": { short: "List deploy providers", useWhen: "discovering supported providers" },
13739
- "companion profile": { short: "Print companion profile", useWhen: "reading the combined memory + context + badges blob" },
13740
- "companion memory": { short: "Show accumulated companion observations", useWhen: "reviewing what the companion noticed" },
13741
- "companion context": { short: "Emit per-prompt companion context", useWhen: "the companion plugin hook needs context" },
13742
- "companion pane": { short: "Open/focus the side claude pane", useWhen: "you want the companion pane by the dashboard" },
13743
- "companion popup-test": { short: "Show a test commentary popup", useWhen: "validating feedback-key handling" },
13744
- "deploy auth": { short: "Configure provider auth", useWhen: "setting up Tailscale/provider credentials" },
13745
- "deploy hetzner": { short: "Hetzner box lifecycle", useWhen: "targeting Hetzner" },
13746
- "deploy aws": { short: "AWS box lifecycle", useWhen: "targeting AWS" },
13747
- "deploy auth tailscale": { short: "Configure Tailscale OAuth", useWhen: "joining the box to your tailnet" },
13748
- "deploy * up": { short: "Provision the box", useWhen: "standing the box up" },
13749
- "deploy * down": { short: "Destroy the box", useWhen: "tearing the box down" },
13750
- "deploy * status": { short: "Print box outputs", useWhen: "checking IP/cost/instance" },
13751
- "deploy * ssh": { short: "SSH/mosh into the box", useWhen: "getting a shell on the box" },
13752
- "deploy * logs": { short: "Tail cloud-init + daemon logs", useWhen: "diagnosing a box-side failure" },
13753
- "deploy * update": { short: "Upgrade sisyphus on the box", useWhen: "pulling the latest daemon onto the box" }
13754
- };
13755
- function subcommandRubric(cmd) {
13756
- if (cmd.name() === "help") {
13757
- return cmd.summary() || cmd.description();
13758
- }
13759
- const p = commandPath(cmd);
13760
- let key = p;
13761
- const deployProviderMatch = p.match(/^deploy (hetzner|aws) (.+)$/);
13762
- if (deployProviderMatch) {
13763
- key = `deploy * ${deployProviderMatch[2]}`;
13764
- }
13765
- const r = RUBRICS[key];
13766
- if (r) {
13767
- return `${r.short} | use when ${r.useWhen}`;
13768
- }
13769
- return cmd.summary() || cmd.description();
13770
- }
13771
- var CONCEPTS_BLOCK = `
13772
- Concepts
13773
- session a tracked unit of orchestrated work on one task
13774
- agent a worker Claude spawned to execute a scoped sub-task
13775
- orchestrator the Claude that owns a session: decomposes, spawns, advances
13776
- cycle one discovery\u2192plan\u2192implement\u2192validate iteration; the rollback unit
13777
- ask a blocking question surfaced for a human to answer
13778
- mode the session's current phase, driving orchestrator behavior
13779
- `;
13780
-
13781
- // src/cli/index.ts
13804
+ init_help_rubric();
13782
13805
  var nodeVersion = parseInt(process.versions.node.split(".")[0], 10);
13783
13806
  if (nodeVersion < 22) {
13784
13807
  console.error(`Sisyphus requires Node.js v22+ (current: v${process.versions.node})`);
@@ -13811,23 +13834,7 @@ program.configureHelp({
13811
13834
  subcommandDescription: (cmd) => subcommandRubric(cmd)
13812
13835
  });
13813
13836
  program.addHelpText("before", CONCEPTS_BLOCK);
13814
- program.addHelpText("after", `
13815
- I/O contract: flags and positional args on input, JSON on stdout (JSONL for streams).
13816
-
13817
- Exit codes:
13818
- 0 success
13819
- 1 permanent error (fallback)
13820
- 2 usage error (bad args/shape)
13821
- 3 not found
13822
- 4 ambiguous (multiple matches \u2014 see error.candidates)
13823
- 5 conflict (already-exists, wrong-state)
13824
- 60 transient (retry-safe: daemon down, timeout, lock contention)
13825
-
13826
- Errors:
13827
- {"ok": false,
13828
- "error": {"code": "<stable-enum>", "kind": "<usage|not_found|ambiguous|conflict|transient|permanent>",
13829
- "message": "...", "received"?: ..., "expected"?: ..., "next"?: "...", "candidates"?: [...]}}
13830
- `);
13837
+ program.addHelpText("after", ROOT_AFTER_HELP);
13831
13838
  if ((process.argv.includes("--help") || process.argv.includes("-h")) && process.argv.some((a) => a === "session")) {
13832
13839
  try {
13833
13840
  const resp = await rawSend2({ type: "list", cwd: process.cwd(), all: true }, 250);