aicodeman 1.12.2 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/README.md +67 -13
  2. package/dist/config/agent-wait.d.ts +73 -0
  3. package/dist/config/agent-wait.d.ts.map +1 -0
  4. package/dist/config/agent-wait.js +99 -0
  5. package/dist/config/agent-wait.js.map +1 -0
  6. package/dist/hooks-config.d.ts +4 -2
  7. package/dist/hooks-config.d.ts.map +1 -1
  8. package/dist/hooks-config.js +14 -4
  9. package/dist/hooks-config.js.map +1 -1
  10. package/dist/session-cli-builder.d.ts.map +1 -1
  11. package/dist/session-cli-builder.js +6 -2
  12. package/dist/session-cli-builder.js.map +1 -1
  13. package/dist/tmux-manager.d.ts.map +1 -1
  14. package/dist/tmux-manager.js +5 -1
  15. package/dist/tmux-manager.js.map +1 -1
  16. package/dist/web/public/admin-ui.js.gz +0 -0
  17. package/dist/web/public/api-client.c9b1cddc.js.gz +0 -0
  18. package/dist/web/public/{app.2e9ffd31.js → app.b24f795e.js} +5 -7
  19. package/dist/web/public/app.b24f795e.js.br +0 -0
  20. package/dist/web/public/app.b24f795e.js.gz +0 -0
  21. package/dist/web/public/constants.e7175b95.js.gz +0 -0
  22. package/dist/web/public/cron-ui.js.gz +0 -0
  23. package/dist/web/public/entrance-animations.js.gz +0 -0
  24. package/dist/web/public/i18n.da34cfaf.js +1 -0
  25. package/dist/web/public/i18n.da34cfaf.js.br +0 -0
  26. package/dist/web/public/i18n.da34cfaf.js.gz +0 -0
  27. package/dist/web/public/image-input.ee16ad88.js.gz +0 -0
  28. package/dist/web/public/index.html +12 -5
  29. package/dist/web/public/index.html.br +0 -0
  30. package/dist/web/public/index.html.gz +0 -0
  31. package/dist/web/public/input-cjk.63794d0b.js.gz +0 -0
  32. package/dist/web/public/keyboard-accessory.9936227d.js.gz +0 -0
  33. package/dist/web/public/mobile-handlers.32fdd57f.js.gz +0 -0
  34. package/dist/web/public/mobile-overview.js.gz +0 -0
  35. package/dist/web/public/mobile.32cacde5.css.gz +0 -0
  36. package/dist/web/public/notification-manager.5d229063.js.gz +0 -0
  37. package/dist/web/public/orchestrator-panel.js.gz +0 -0
  38. package/dist/web/public/panels-ui.1d4203e0.js.gz +0 -0
  39. package/dist/web/public/ralph-panel.6de2d0f8.js.gz +0 -0
  40. package/dist/web/public/ralph-wizard.13a1831e.js.gz +0 -0
  41. package/dist/web/public/respawn-ui.ff0dae4c.js.gz +0 -0
  42. package/dist/web/public/sanitize-html.bc7078d6.js.gz +0 -0
  43. package/dist/web/public/session-ui.1356a4f4.js.gz +0 -0
  44. package/dist/web/public/settings-ui.ea63d5db.js +67 -0
  45. package/dist/web/public/settings-ui.ea63d5db.js.br +0 -0
  46. package/dist/web/public/settings-ui.ea63d5db.js.gz +0 -0
  47. package/dist/web/public/styles.b10e5edd.css +1 -0
  48. package/dist/web/public/styles.b10e5edd.css.br +0 -0
  49. package/dist/web/public/styles.b10e5edd.css.gz +0 -0
  50. package/dist/web/public/subagent-windows.4cc8b005.js.gz +0 -0
  51. package/dist/web/public/sw.js.gz +0 -0
  52. package/dist/web/public/terminal-ui.78c71f3a.js.gz +0 -0
  53. package/dist/web/public/ultracode-panel.js.gz +0 -0
  54. package/dist/web/public/ultracode-windows.js.gz +0 -0
  55. package/dist/web/public/upload.html.gz +0 -0
  56. package/dist/web/public/vendor/dompurify.min.js.gz +0 -0
  57. package/dist/web/public/vendor/marked.min.js.gz +0 -0
  58. package/dist/web/public/vendor/xterm-addon-fit.min.js.gz +0 -0
  59. package/dist/web/public/vendor/xterm-addon-serialize.min.js.gz +0 -0
  60. package/dist/web/public/vendor/xterm-addon-unicode11.min.js.gz +0 -0
  61. package/dist/web/public/vendor/xterm-addon-webgl.min.js.gz +0 -0
  62. package/dist/web/public/vendor/xterm-zerolag-input.137ad9f0.js.gz +0 -0
  63. package/dist/web/public/vendor/xterm.css.gz +0 -0
  64. package/dist/web/public/vendor/xterm.min.js.gz +0 -0
  65. package/dist/web/public/voice-input.085e9e73.js.gz +0 -0
  66. package/dist/web/public/webview-tabs.js +1 -2
  67. package/dist/web/public/webview-tabs.js.br +0 -0
  68. package/dist/web/public/webview-tabs.js.gz +0 -0
  69. package/dist/web/routes/hook-event-routes.d.ts.map +1 -1
  70. package/dist/web/routes/hook-event-routes.js +22 -0
  71. package/dist/web/routes/hook-event-routes.js.map +1 -1
  72. package/dist/web/routes/session-routes.d.ts +4 -0
  73. package/dist/web/routes/session-routes.d.ts.map +1 -1
  74. package/dist/web/routes/session-routes.js +499 -17
  75. package/dist/web/routes/session-routes.js.map +1 -1
  76. package/dist/web/schemas.d.ts +53 -0
  77. package/dist/web/schemas.d.ts.map +1 -1
  78. package/dist/web/schemas.js +59 -0
  79. package/dist/web/schemas.js.map +1 -1
  80. package/dist/web/server.d.ts.map +1 -1
  81. package/dist/web/server.js +14 -0
  82. package/dist/web/server.js.map +1 -1
  83. package/dist/web/session-listener-wiring.d.ts.map +1 -1
  84. package/dist/web/session-listener-wiring.js +28 -0
  85. package/dist/web/session-listener-wiring.js.map +1 -1
  86. package/dist/web/session-wait-registry.d.ts +407 -0
  87. package/dist/web/session-wait-registry.d.ts.map +1 -0
  88. package/dist/web/session-wait-registry.js +895 -0
  89. package/dist/web/session-wait-registry.js.map +1 -0
  90. package/package.json +2 -1
  91. package/skills/codeman/SKILL.md +274 -0
  92. package/skills/codeman/reference/endpoints.md +214 -0
  93. package/skills/codeman/reference/recipes.md +249 -0
  94. package/dist/web/public/app.2e9ffd31.js.br +0 -0
  95. package/dist/web/public/app.2e9ffd31.js.gz +0 -0
  96. package/dist/web/public/i18n.0fbea500.js +0 -1
  97. package/dist/web/public/i18n.0fbea500.js.br +0 -0
  98. package/dist/web/public/i18n.0fbea500.js.gz +0 -0
  99. package/dist/web/public/settings-ui.01a1ae7d.js +0 -67
  100. package/dist/web/public/settings-ui.01a1ae7d.js.br +0 -0
  101. package/dist/web/public/settings-ui.01a1ae7d.js.gz +0 -0
  102. package/dist/web/public/styles.50cd52bd.css +0 -1
  103. package/dist/web/public/styles.50cd52bd.css.br +0 -0
  104. package/dist/web/public/styles.50cd52bd.css.gz +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-wait-registry.js","sourceRoot":"","sources":["../../src/web/session-wait-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAQjC,kDAAkD;AAClD,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AAElG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEpF,MAAM,UAAU,GAAG,IAAI,GAAG,CAAS,YAAY,CAAC,CAAC;AAUjD;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAY;IAC3C,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,CAAC;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE,CAAC;YACxB,IAAI,OAAO,KAAK,KAAK,QAAQ;gBAAE,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAClE,CAAC;IACH,CAAC;IAED,MA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AC,CAAC;IACpC,IAAI,GAAG,KAAK,CAAC,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAElD,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,IAAI,CAAC,MAAM,GAAG,kBAAkB,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACzE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACpC,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,mBAAmB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aicodeman",
3
- "version": "1.12.2",
3
+ "version": "1.13.0",
4
4
  "description": "Mission control for AI coding agents - run 20 autonomous agents with real-time monitoring and session persistence",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -159,6 +159,7 @@
159
159
  "dist",
160
160
  "scripts/postinstall.js",
161
161
  "scripts/fix-node-pty.mjs",
162
+ "skills",
162
163
  "LICENSE",
163
164
  "README.md"
164
165
  ]
@@ -0,0 +1,274 @@
1
+ ---
2
+ name: codeman
3
+ description: >-
4
+ Drive Codeman, the session manager this agent is running inside, over its HTTP API:
5
+ list sessions, start worker sessions, send them prompts, block until they finish
6
+ (wait / wait-output / send-and-wait), read their output, and clean up. Use when asked
7
+ to orchestrate or parallelize work across Codeman sessions, watch another session, or
8
+ start and manage workers. Only usable inside a Codeman-managed session
9
+ (CODEMAN_MUX=1); refuse to act otherwise.
10
+ ---
11
+
12
+ # Driving Codeman from inside a session
13
+
14
+ You are an agent running inside a Codeman-managed terminal session. Codeman is the
15
+ server that spawned you; its HTTP API can start, prompt, watch, and delete other
16
+ sessions. Every recipe below was verified live. Full endpoint tables and
17
+ troubleshooting: [reference/endpoints.md](reference/endpoints.md). Worked multi-worker
18
+ flows: [reference/recipes.md](reference/recipes.md).
19
+
20
+ ## 0. Guard — run this before anything else
21
+
22
+ ```bash
23
+ test "${CODEMAN_MUX:-}" = 1 || { echo "Not inside a Codeman-managed session; refusing to act."; exit 1; }
24
+ API="${CODEMAN_API_URL:?CODEMAN_API_URL not set; refusing to guess}"
25
+ SELF="${CODEMAN_SESSION_ID:?CODEMAN_SESSION_ID not set}"
26
+ # Codeman does NOT hand a session the server password. If one is set, the two
27
+ # in-reach copies are the data dir's .env (the same fallback `codeman attach`
28
+ # uses — hand-authored; nothing ever writes it) and the supervisor definition
29
+ # that install.sh wrote the password into, which is where a stock
30
+ # password-protected install actually keeps it. The data dir is wherever the
31
+ # hook-secret file lives. Values may be quoted or `export`-prefixed.
32
+ ENV_FILE="${CODEMAN_HOOK_SECRET_FILE:+${CODEMAN_HOOK_SECRET_FILE%hook-secret}.env}"
33
+ envval() { sed -n "s/^\(export \)\{0,1\}$1=//p" "$ENV_FILE" | tail -1 | sed 's/^"\(.*\)"$/\1/; s/^'\''\(.*\)'\''$/\1/'; }
34
+ if [ -z "${CODEMAN_PASSWORD:-}" ] && [ -n "$ENV_FILE" ] && [ -f "$ENV_FILE" ]; then
35
+ CODEMAN_USERNAME=$(envval CODEMAN_USERNAME)
36
+ CODEMAN_PASSWORD=$(envval CODEMAN_PASSWORD)
37
+ fi
38
+ if [ -z "${CODEMAN_PASSWORD:-}" ]; then # stock installs: install.sh puts it in the service definition
39
+ UNIT="$HOME/.config/systemd/user/codeman-web.service"
40
+ PLIST="$HOME/Library/LaunchAgents/com.codeman.web.plist"
41
+ if [ -f "$UNIT" ]; then
42
+ CODEMAN_PASSWORD=$(sed -n 's/^Environment="CODEMAN_PASSWORD=\(.*\)"$/\1/p' "$UNIT" | head -1)
43
+ elif [ -f "$PLIST" ]; then
44
+ CODEMAN_PASSWORD=$(awk '/<key>CODEMAN_PASSWORD<\/key>/{getline; print}' "$PLIST" | sed -n 's/.*<string>\(.*\)<\/string>.*/\1/p')
45
+ fi
46
+ fi
47
+ AUTH=(); [ -n "${CODEMAN_PASSWORD:-}" ] && AUTH=(-u "${CODEMAN_USERNAME:-admin}:$CODEMAN_PASSWORD")
48
+ CURL=(curl -sk "${AUTH[@]}") # -k: harmless on http, required on https (self-signed cert)
49
+ ```
50
+
51
+ - If `CODEMAN_MUX` is not `1`, **stop and say so**. Do not guess an API URL; a server
52
+ you are not part of is not yours to drive.
53
+ - **A 401 is plain text, not the JSON envelope**, so on a password-protected server
54
+ every `jq` in these recipes dies with `jq: parse error` instead of showing
55
+ `UNAUTHORIZED`. If that happens, check the status with `-w '%{http_code}'`; if it
56
+ is 401 and neither fallback above found a credential, **stop and tell the user
57
+ you need credentials**. The hook-secret bypass covers only `/api/hook-event` and
58
+ `/api/status-telemetry`, never session control.
59
+ - These endpoints first ship in Codeman **1.13.0**, but do not gate on the version
60
+ number: a dev build can serve them while reporting an older version. Probe
61
+ instead: `GET .../wait` on a real session id answering 404 with an `.error`
62
+ starting `Route ` means the server predates the wait endpoints (fall back to
63
+ polling `GET .../terminal?tail=` and say so); `Session ... not found` means your
64
+ session id is wrong, not the server.
65
+
66
+ ## 1. Safety rules — read before any mutating call
67
+
68
+ You are yourself a session on this server, and the API has **no undo**.
69
+
70
+ - **Never act on your own session — and know that this check is the ONLY guard.**
71
+ The server has no self-protection: a session that DELETEs its own id succeeds and
72
+ dies silently (verified live). Session ids appear in both full and 8-character
73
+ forms (Docker cases export a truncated `$SELF`; mux names and UI surfaces carry
74
+ 8-char ids), so compare by prefix **in both directions**, never by equality:
75
+
76
+ ```bash
77
+ is_self() { case "$1" in "$SELF"*) return 0 ;; esac; case "$SELF" in "$1"*) return 0 ;; esac; return 1; }
78
+ ```
79
+
80
+ One-directional or equality checks each miss a real combination (full `$SELF` vs
81
+ a target you transcribed in 8-char form, or truncated `$SELF` vs a full target)
82
+ and the miss deletes you. Check `is_self` before every `DELETE`, kill, respawn,
83
+ or input call.
84
+ - **Mutating calls you may make unprompted** (this is an allowlist):
85
+ `POST /api/v1/quick-start`, `POST /api/v1/sessions/:id/input`, and
86
+ `DELETE /api/v1/sessions/:id` **only** for a session you created in this
87
+ conversation, by exact id. Keep a list of the ids you create. Everything else
88
+ mutating needs the user to have asked for it.
89
+ - **Never call these** unless the user explicitly asked, naming the target:
90
+ - `DELETE /api/cases/:name` — recursively **deletes a real directory of the user's
91
+ code** from disk. One wrong case name destroys work that was never yours.
92
+ - `DELETE /api/sessions` (no id) and `DELETE /api/subagents` (no id) — bulk kills.
93
+ - respawn / ralph / orchestrator / cron mutations — respawn runs `/clear` (wipes a
94
+ conversation), orchestrator state is a single global slot, cron jobs outlive you.
95
+ - `PUT /api/settings`, `POST /api/system/update` — global UI settings; server restart.
96
+ - Never `tmux kill-session`, `pkill tmux`, `pkill claude`. The API is the only interface.
97
+ - Sessions count against a 50-session cap and case creation is uncapped: clean up every
98
+ session you start, and don't retry `quick-start` in a loop.
99
+
100
+ ## 2. Rules of the road
101
+
102
+ - **End every input with `\r`** — literally the two characters `\r` inside the JSON
103
+ string. Codeman types the text and sends Enter **only when the input contains a
104
+ carriage return**; without it your command sits unsubmitted on the worker's prompt
105
+ and everything downstream times out. `{"input":"run the tests\r",...}`. No response
106
+ field catches this: `delivered:true` means "written to the pane", **not**
107
+ "submitted" — a `\r`-less send still reports `delivered:true` and then every wait
108
+ times out, which is why the loops below are bounded and check the terminal.
109
+ - **Single-line input only.** Newlines are stripped; one line per call.
110
+ - **Build request bodies with `jq -n` for any prompt you did not author as a
111
+ literal.** The inline `-d '{"input":"'"$P"'\r"}'` pattern breaks on the first
112
+ double quote, backslash, or `$` in a real prompt:
113
+
114
+ ```bash
115
+ BODY=$(jq -n --arg p "$PROMPT" '{input:($p+"\r"),useMux:true,clientId:"agent-1",seq:1,wait:true,waitTimeout:60000}')
116
+ "${CURL[@]}" -X POST "$API/api/v1/sessions/$SID/input" -H 'Content-Type: application/json' --data-binary "$BODY"
117
+ ```
118
+ - **Exactly-once delivery**: always send a stable `clientId` and a monotonic
119
+ per-session `seq` on `POST .../input`. A retry after a dropped connection then
120
+ cannot double-type the prompt. Increment `seq` for each NEW input; reuse the same
121
+ pair only to re-ask about the same delivery.
122
+ - **Envelope**: success is `{"success":true,"data":…}`, errors are
123
+ `{"success":false,"error","errorCode"}`. Read `.data`. Use `/api/v1/*` paths.
124
+ - **A wait timeout is HTTP 200**, `{wait:{timedOut:true,signal:null}}` — not an error.
125
+ Loop over short waits (60 s); proxies cut long-idle connections. Timeouts are
126
+ **clamped** (ceiling 600 s): read back `wait.timeoutMs` for what was applied.
127
+ - **`stop` and `blocked` fire for `claude` sessions only** (Claude Code hooks). On
128
+ `shell`/`opencode`/`codex`/`gemini`/`antigravity`, requesting them explicitly is a
129
+ 400 — and lifecycle transitions there are coarse (a short shell command may emit
130
+ **no** `idle` transition at all, verified live), so synchronize those modes with
131
+ output markers, not signals.
132
+ - **Your typed command echoes into the output stream**, so a marker that appears
133
+ verbatim in the input line matches **before the command runs**. Always split the
134
+ marker (recipe below), keep it unique per call, and use `from=buffer` so a marker
135
+ that printed before your wait landed is still found. Matching is literal — no regex.
136
+ - **Match single space-free tokens against TUI output.** A full-screen TUI (claude,
137
+ codex, …) positions text with cursor movements, not literal spaces, so the stripped
138
+ stream can read `Yes,Itrustthisfolder` and a multi-word match is unreliable there —
139
+ whether a phrase keeps its spaces depends on how the TUI happened to draw it
140
+ (observed live: some match, some never fire). Plain command output (shell workers,
141
+ `echo` lines) keeps real spaces.
142
+
143
+ ## 3. Recipes (each verified live)
144
+
145
+ **List sessions / find yourself** — metadata only, safe to poll:
146
+
147
+ ```bash
148
+ "${CURL[@]}" "$API/api/v1/sessions" | jq '.data[] | {id, name, mode, status}'
149
+ "${CURL[@]}" "$API/api/v1/sessions" | jq --arg s "$SELF" '.data[] | select(.id | startswith($s))'
150
+ ```
151
+
152
+ **Start a claude worker and wait until it is actually ready.** A new session reports
153
+ `idle` before its CLI has spawned, and a brand-new case shows a **trust dialog**
154
+ first, so neither "wait for idle" nor "wait for ❯" means ready (the trust dialog
155
+ contains `❯` too — observed live). Codeman *can* auto-accept that dialog itself, but
156
+ the accept rides a stream match that misses on some runs (both outcomes seen live),
157
+ so wait for the composer first and handle the dialog only as the bounded fallback —
158
+ never send a blind Enter up front (if auto-accept already fired, it lands in the
159
+ composer). Stage 1 is short on purpose: an already-trusted case matches `bypass` in
160
+ under a second, while a **virgin case can never pass stage 1** (the dialog is up, so
161
+ the composer is not) and always pays it in full before the fallback runs — the long
162
+ budget belongs to stage 3, after the dialog is answered:
163
+
164
+ ```bash
165
+ SID=$("${CURL[@]}" -X POST "$API/api/v1/quick-start" -H 'Content-Type: application/json' \
166
+ -d '{"caseName":"worker-1","mode":"claude"}' | jq -r '.data.sessionId')
167
+ for _ in $(seq 1 30); do # bounded: a bad SID would otherwise poll forever
168
+ [ "$("${CURL[@]}" "$API/api/v1/sessions/$SID" | jq '.data.pid')" != null ] && break; sleep 1
169
+ done
170
+ # ⚠️ pid != null proves STARTUP only, never life: a worker that later dies inside
171
+ # its pane keeps status "idle" and a pid (the local tmux attach client, not the
172
+ # worker). The death check is wait?until=exit, below.
173
+ CID="agent-$$"; SEQ=1
174
+ # the composer's status bar ("bypass permissions on") is the ready marker — Codeman
175
+ # spawns claude in bypass mode. Single-token matches only: TUI text is space-less.
176
+ R=$("${CURL[@]}" -G "$API/api/v1/sessions/$SID/wait-output" \
177
+ --data-urlencode 'match=bypass' --data-urlencode 'from=buffer' --data-urlencode 'timeout=5000')
178
+ if ! jq -e '.data.wait.matched' <<<"$R" >/dev/null; then
179
+ # composer never appeared → the trust dialog is probably still up; accept it once
180
+ T=$("${CURL[@]}" -G "$API/api/v1/sessions/$SID/wait-output" \
181
+ --data-urlencode 'match=trust' --data-urlencode 'from=buffer' --data-urlencode 'timeout=2000')
182
+ if jq -e '.data.wait.matched' <<<"$T" >/dev/null; then
183
+ "${CURL[@]}" -X POST "$API/api/v1/sessions/$SID/input" -H 'Content-Type: application/json' \
184
+ -d '{"input":"\r","useMux":true,"clientId":"'"$CID"'","seq":'$SEQ'}' >/dev/null
185
+ SEQ=$((SEQ+1))
186
+ fi
187
+ R=$("${CURL[@]}" -G "$API/api/v1/sessions/$SID/wait-output" \
188
+ --data-urlencode 'match=bypass' --data-urlencode 'from=buffer' --data-urlencode 'timeout=45000')
189
+ jq -e '.data.wait.matched' <<<"$R" >/dev/null || \
190
+ { echo "worker $SID never became ready; inspect terminal?tail="; }
191
+ fi
192
+ ```
193
+
194
+ **Send a prompt and wait for the turn to finish** (claude workers — the call to
195
+ prefer). It registers the waiter *before* typing, closing the race where a separate
196
+ wait sees the previous turn's idle state. Loop by resending the **identical** request:
197
+ the repeat is a tagged duplicate (same `clientId`+`seq`) that does not retype but
198
+ answers from the session's current state. Verified: the stop hook resolves this in
199
+ seconds; a duplicate resend answers in ~20 ms without retyping.
200
+
201
+ ```bash
202
+ for TRY in $(seq 1 10); do # BOUNDED: a \r-less send never produces a signal and resends are no-op duplicates
203
+ R=$("${CURL[@]}" -X POST "$API/api/v1/sessions/$SID/input" -H 'Content-Type: application/json' \
204
+ -d '{"input":"run the tests, then summarize in one line\r","useMux":true,"clientId":"'"$CID"'","seq":'$SEQ',"wait":true,"waitTimeout":60000}')
205
+ if jq -e '.data.wait.timedOut' <<<"$R" >/dev/null; then
206
+ [ "$TRY" = 2 ] && "${CURL[@]}" "$API/api/v1/sessions/$SID/terminal?tail=2000" \
207
+ | jq -r '.data.terminalBuffer' | tail -5 # two straight timeouts: prompt sitting unsubmitted?
208
+ continue
209
+ fi
210
+ # Resolved — but a duplicate answering immediately reports the session's CURRENT
211
+ # state ("it is idle now"), NOT that a new turn ran. A \r-less send lands exactly
212
+ # here on try 2 (verified live), so check the terminal before believing it:
213
+ if jq -e '.data.duplicate and .data.wait.immediate' <<<"$R" >/dev/null; then
214
+ "${CURL[@]}" "$API/api/v1/sessions/$SID/terminal?tail=2000" | jq -r '.data.terminalBuffer' | tail -5
215
+ # your prompt still on the ❯ composer line = never submitted (missing \r);
216
+ # submit it with {"input":"\r"} (the only recovery), then loop again
217
+ fi
218
+ break
219
+ done
220
+ SEQ=$((SEQ+1)); jq '.data.wait.signal, .data.status' <<<"$R"
221
+ ```
222
+
223
+ Read the outcome in this order: `wait.signal != null` → done (`stop` is definitive;
224
+ `idle` is heuristic) — **unless** it arrived as `duplicate:true` + `immediate:true`,
225
+ which only says the session is idle *now* and must be confirmed from the terminal
226
+ (above); `wait.timedOut` → loop again (bounded); `wait.ended` → session gone, stop.
227
+ If the loop exhausts its cap, do not keep looping: read the terminal, report what
228
+ you see, and remember that a still-typed-but-unsubmitted prompt (missing `\r`) can
229
+ only be recovered by submitting it with `{"input":"\r"}`.
230
+
231
+ **Shell worker + completion marker** — the pattern for `shell` mode (no hooks there).
232
+ The typed line must not contain the marker verbatim (the input echo would match
233
+ instantly — observed live), so build it with a variable the worker's shell expands:
234
+
235
+ ```bash
236
+ N="${RANDOM}_$$"; MARK="DONE_$N" # unique per call: tmux repaints replay old text
237
+ "${CURL[@]}" -X POST "$API/api/v1/sessions/$SID/input" -H 'Content-Type: application/json' \
238
+ -d '{"input":"M=DONE; npm run build; echo ${M}_'"$N"' rc=$?\r","useMux":true,"clientId":"'"$CID"'","seq":'$SEQ'}'
239
+ SEQ=$((SEQ+1))
240
+ "${CURL[@]}" -G "$API/api/v1/sessions/$SID/wait-output" \
241
+ --data-urlencode "match=$MARK" --data-urlencode 'from=buffer' --data-urlencode 'timeout=120000' \
242
+ | jq -r '.data.wait | {matched, snippet}'
243
+ ```
244
+
245
+ The typed line shows `${M}_…`, the real output shows `DONE_… rc=<exit code>`, and the
246
+ snippet carries the exit code back to you.
247
+
248
+ **Read a worker's output** — the terminal buffer, tail in **bytes** (`textOutput` in
249
+ `GET .../output` stays empty for interactive sessions; don't use it):
250
+
251
+ ```bash
252
+ "${CURL[@]}" "$API/api/v1/sessions/$SID/terminal?tail=3000" | jq -r '.data.terminalBuffer' \
253
+ | sed -e 's/\x1b\[[0-9;?]*[a-zA-Z]//g' -e 's/\x1b([B0]//g' | grep -v '^[[:space:]]*$' | tail -30
254
+ ```
255
+
256
+ Avoid `?full=1` (entire tmux scrollback, a context bomb) unless doing a post-mortem.
257
+
258
+ **Detect a dead worker cheaply**: `GET .../wait?until=exit&timeout=60000` answers
259
+ immediately (`signal:"exit"`, `immediate:true`) if the PTY is gone — including a
260
+ worker that exited *inside* its pane, which `GET .../sessions/:id` keeps reporting
261
+ as `status:"idle"` with a pid (that pid is the local tmux attach client, not the
262
+ worker). The wait routes are the only liveness check; a worker dying while a wait
263
+ is parked resolves it within ~3 s. A session deleted mid-wait resolves in ~1 s.
264
+
265
+ **Clean up** — only ids you created, `is_self`-checked, one at a time:
266
+
267
+ ```bash
268
+ is_self "$SID" || "${CURL[@]}" -X DELETE "$API/api/v1/sessions/$SID"
269
+ ```
270
+
271
+ Everything else (endpoint tables, per-mode signal table, error codes, capacity
272
+ limits, Docker/remote caveats): [reference/endpoints.md](reference/endpoints.md).
273
+ Fan-out orchestration and blocked-worker handling:
274
+ [reference/recipes.md](reference/recipes.md).
@@ -0,0 +1,214 @@
1
+ # Codeman API reference for agents
2
+
3
+ Loaded on demand from the `codeman` skill. Assumes the guard variables from SKILL.md
4
+ (`$API`, `$SELF`, `"${CURL[@]}"`). Canonical contract: `docs/api-reference.md` in the
5
+ Codeman repo; this file is the agent-relevant subset, verified live.
6
+
7
+ ## Envelope and errors
8
+
9
+ Every JSON response: `{"success":true,"data":…}` or
10
+ `{"success":false,"error":"…","errorCode":"…"}`. Branch on `errorCode`:
11
+
12
+ | `errorCode` | HTTP | Meaning |
13
+ |-------------|------|---------|
14
+ | `INVALID_INPUT` | 400 | malformed request; the message names the bad field |
15
+ | `UNAUTHORIZED` | 401 | auth required or failed (send `-u user:password`). ⚠️ The 401 body is plain text, NOT this envelope — `jq` dies with a parse error, see the guard in SKILL.md |
16
+ | `NOT_FOUND` | 404 | no such session, or one this caller does not own |
17
+ | `SESSION_BUSY` | 409 | this session's waiter cap (16, combined signal+output) is full |
18
+ | `CONFLICT` / `ALREADY_EXISTS` | 409 | conflicts with current state |
19
+ | `OPERATION_FAILED` | 422 | well-formed but could not be completed |
20
+ | `RATE_LIMITED` | 429 | per-owner or process-wide waiter pool is full — back off; switching sessions will not help |
21
+ | `INTERNAL_ERROR` | 500 | server bug |
22
+
23
+ `SESSION_BUSY` vs `RATE_LIMITED` on the wait endpoints is deliberate: the first means
24
+ "too many waiters on *this* session", the second means the *pool* is full.
25
+
26
+ ## Sessions
27
+
28
+ | Task | Call |
29
+ |------|------|
30
+ | list sessions (metadata only, ~1.5 KB each, safe to poll) | `GET /api/v1/sessions` |
31
+ | one session (has `.data.pid`, `null` until the PTY spawns) | `GET /api/v1/sessions/:id` — ⚠️ **not a liveness check**: a worker that dies inside its pane keeps `status:"idle"` and a pid (the tmux attach client); `wait?until=exit` is the death check |
32
+ | unified list incl. history | `GET /api/v1/sessions/unified` → `.data.sessions[]` (NOT `.data[]`), and it folds in transcript history from the whole machine — never use it to verify cleanup; `GET /api/v1/sessions` is the cleanup check |
33
+ | start case + session in one call | `POST /api/v1/quick-start` |
34
+ | send input | `POST /api/v1/sessions/:id/input` |
35
+ | read terminal (tail is in **BYTES**, raw ANSI) | `GET /api/v1/sessions/:id/terminal?tail=3000` → `.data.terminalBuffer` |
36
+ | full tmux scrollback (context bomb; post-mortems only) | `GET /api/v1/sessions/:id/terminal?full=1` |
37
+ | background agents of a session | `GET /api/v1/subagents` |
38
+ | server status / version | `GET /api/v1/status` → `.data.version` |
39
+ | delete one session (yours, `is_self`-checked) | `DELETE /api/v1/sessions/:id` |
40
+
41
+ ⚠️ `GET /api/v1/sessions/:id/output` → `.data.textOutput` looks like the obvious read
42
+ but stays **empty for interactive tmux-backed sessions** (it is fed only by the legacy
43
+ JSON-stream path). Verified empty on live claude and shell sessions. Read
44
+ `terminal?tail=` instead and strip ANSI:
45
+
46
+ ```bash
47
+ … | jq -r '.data.terminalBuffer' | sed -e 's/\x1b\[[0-9;?]*[a-zA-Z]//g' -e 's/\x1b([B0]//g'
48
+ ```
49
+
50
+ `POST /api/v1/quick-start` body (all optional):
51
+ `{"caseName":"worker-1","mode":"claude","sessionName":"w9-worker","effort":"high"}`
52
+ — `mode` ∈ `claude|shell|opencode|codex|gemini|antigravity`; response is
53
+ `.data.{sessionId, caseName, casePath}`. Creates the case directory (a real directory
54
+ on the user's disk) if missing — do not retry it in a loop, and remember the name.
55
+
56
+ `POST /api/v1/sessions/:id/input` body:
57
+ `{"input":"one line\r","useMux":true,"clientId":"agent-1","seq":1}` plus optionally
58
+ `"wait"` / `"waitTimeout"` (below).
59
+
60
+ - ⚠️ **The input must contain `\r`** (the JSON escape, i.e. a real carriage return)
61
+ **or Enter is never sent**: the text is typed onto the worker's prompt and sits
62
+ there unsubmitted. Verified live — this is the number-one silent failure, and no
63
+ response field catches it: `delivered:true` means "written to the pane", not
64
+ "submitted". A `\r`-less send with `wait` reports `delivered:true` and then every
65
+ wait on that turn times out. Without `wait`, fire-and-forget returns an **empty**
66
+ `{"success":true,"data":{}}` — no `delivered`, no `duplicate`; those fields exist
67
+ only on the `wait` variant, so a fire-and-forget flow gets no delivery
68
+ confirmation at all.
69
+ - `input` must be single-line (newlines are stripped). To send a bare Enter (confirm
70
+ a dialog), send `{"input":"\r"}`.
71
+ - `clientId`+`seq` give exactly-once delivery: the server applies each pair at most
72
+ once. Increment `seq` per new input.
73
+
74
+ ## The wait primitives
75
+
76
+ Three bounded long-polls. Shared semantics:
77
+
78
+ - **Timeout = HTTP 200** with `wait.timedOut:true`. Loop over short waits (60 s);
79
+ `tailscale serve` / cloudflared cut idle connections.
80
+ - Timeouts are **clamped** to `[1000, 600000]` ms (operator-tunable); the applied
81
+ value is echoed as `wait.timeoutMs` — read it back, never assume.
82
+ - All three nest the result under `.data.wait`, same shape, so one helper parses all.
83
+ - `.data.status` (post-wait `SessionStatus`) and `.data.limitPaused` ride along.
84
+ `limitPaused:true` means the session is paused on a usage limit and will emit
85
+ nothing until reset — a timeout is then *expected*; do not retry hard, and do not
86
+ kill the worker.
87
+
88
+ ### Signals by mode
89
+
90
+ | Signal | Meaning | Available for |
91
+ |--------|---------|---------------|
92
+ | `idle` | output stabilized + prompt detected — heuristic, can flap mid-turn | every mode |
93
+ | `working` | session started producing output | every mode |
94
+ | `stop` | Claude Code `stop` hook — the definitive end-of-turn | `claude` only |
95
+ | `blocked` | `permission_prompt` / `elicitation_dialog` hook — the worker needs an answer | `claude` only |
96
+ | `exit` | PTY exited or session deleted | every mode |
97
+
98
+ Default `until` set: `stop,idle,exit`. On non-claude modes the server silently drops
99
+ `stop`/`blocked` from the *default* set (echoed back as `wait.until`, e.g.
100
+ `["idle","exit"]` on shell); requesting them *explicitly* there is a 400 naming the
101
+ mode. ⚠️ On hook-less modes the lifecycle signals are also **coarse in practice**: a
102
+ short shell command produced **no** `idle` transition within 60 s (verified live), so
103
+ a `fresh=1` / fresh-delivery wait can burn its whole timeout while the work finished
104
+ long ago. Synchronize hook-less modes with `wait-output` markers instead.
105
+
106
+ Two more places hooks go missing even in claude mode: **Docker cases** need
107
+ `CODEMAN_DOCKER_BRIDGE_HOOKS=1` on the server (without it only `idle`/`working`/
108
+ `exit` arrive), and **remote-SSH cases** run the agent on another host whose hooks may
109
+ never reach this server. When unsure, ask for `stop,idle,exit`.
110
+
111
+ ⚠️ **Signals are edge-triggered with no history.** A signal that fires while no
112
+ waiter is registered is gone; no later wait can observe it (`until=stop` on a worker
113
+ whose turn already ended just times out, with or without `fresh` — verified live).
114
+ Register the waiter before the event can happen: send-and-wait does exactly that,
115
+ and `wait-output` markers with `from=buffer` are latched by construction. Never
116
+ fire-and-forget N prompts and then gather signal-waits worker by worker; every
117
+ worker that finishes before its gather is unobservable (see recipes.md Flow 3b).
118
+
119
+ ### `GET /api/v1/sessions/:id/wait`
120
+
121
+ | Param | Default | Notes |
122
+ |-------|---------|-------|
123
+ | `until` | `stop,idle,exit` | comma list; unknown token → 400 naming it |
124
+ | `timeout` | 60000 | ms, clamped; applied value echoed as `wait.timeoutMs` |
125
+ | `fresh` | `0` | `1` requires an actual *transition*, ignoring the state at call time |
126
+
127
+ ⚠️ A session whose PTY has not spawned (`pid:null`) or has exited counts as `exit`
128
+ **right now**: with the default set the call answers immediately
129
+ (`signal:"exit", immediate:true`). That is how you detect a dead worker cheaply — but
130
+ it also means "wait for my just-created session" needs the readiness recipe in
131
+ SKILL.md, not this endpoint.
132
+
133
+ ### `GET /api/v1/sessions/:id/wait-output`
134
+
135
+ | Param | Default | Notes |
136
+ |-------|---------|-------|
137
+ | `match` | required | literal substring, 1–200 chars, ANSI-stripped; chunk-straddling matches found; **no regex** — a `regex=` param is a 400 |
138
+ | `nocase` | `0` | case-insensitive compare; snippet keeps original casing |
139
+ | `from` | `now` | `buffer` scans the tail (~256 KB) of existing output first |
140
+ | `timeout` | 60000 | same clamp |
141
+
142
+ Four traps, all observed live:
143
+
144
+ 1. **The echo of your own typed command is output.** A marker appearing verbatim in
145
+ the input line matches the moment the text is typed, before the command runs.
146
+ Split the marker with a shell variable: send `M=DONE; …; echo ${M}_1234\r`, wait
147
+ on `DONE_1234`.
148
+ 2. **`from=now` misses text printed before the wait landed** — a marker echoed just
149
+ before the request registered timed out at full length. After sending a command,
150
+ always wait with `from=buffer`.
151
+ 3. **`from=now` can also match too much**: tmux repaints old screen content as
152
+ ordinary output on attach/resize/redraw, so a *generic* marker (`BUILD OK`)
153
+ matches stale text. Unique-per-call markers (`DONE_$RANDOM`) make both `from`
154
+ modes safe.
155
+ 4. **TUI output can be space-less in the stream.** Full-screen TUIs (claude, codex,
156
+ …) position words with cursor-movement escapes rather than literal spaces, so
157
+ the stripped stream can read `Yes,Itrustthisfolder` while the pane shows the
158
+ spaced phrase. Whether a given phrase keeps its spaces depends on how the TUI
159
+ drew it (observed live: some multi-word matches fire, some never do), so treat
160
+ multi-word matches against TUI screens as unreliable and match a **single
161
+ space-free token** (`trust`, `bypass`). Plain command output (shell workers,
162
+ `echo` lines) keeps real spaces and multi-word matches work there.
163
+
164
+ Build the query with `-G --data-urlencode` (a `+` in a hand-built query decodes to a
165
+ space). Result extras: `wait.matched`, `wait.match`, `wait.snippet` (bounded window
166
+ around the match, blank runs collapsed — the snippet is often all you need to read).
167
+
168
+ ### `POST /api/v1/sessions/:id/input` with `wait`
169
+
170
+ | Field | Notes |
171
+ |-------|-------|
172
+ | `wait` | `true` (default signal set) or the same comma grammar as `until`; absent = historical fire-and-forget |
173
+ | `waitTimeout` | ms, same clamp |
174
+
175
+ Registers the waiter **before** typing, which closes the race where send-then-wait
176
+ sees the previous turn's idle state and returns instantly. Response adds `delivered`
177
+ and `duplicate` beside the standard `wait` object.
178
+
179
+ A **tagged duplicate** (same `clientId`+`seq` already applied) does not retype but
180
+ still honors `wait`, answering from the session's *current* state instead of
181
+ requiring a new transition (`delivered:false, duplicate:true` — verified: ~20 ms,
182
+ command ran exactly once). That is what makes the resend-identical-request loop in
183
+ SKILL.md correct: iteration 1 delivers and needs a transition; later iterations
184
+ resolve immediately if the turn ended in between. ⚠️ The flip side: a duplicate's
185
+ `immediate:true` answer is the current state and nothing more — an idle worker
186
+ whose prompt was never submitted (missing `\r`) produces the same
187
+ `signal:"idle", immediate:true` as one that finished the turn. Confirm from
188
+ `terminal?tail=` before reporting success; SKILL.md's loop shows where.
189
+
190
+ ### Outcome parsing, in order
191
+
192
+ 1. `wait.signal != null` (or `wait.matched == true`) — the thing happened.
193
+ `wait.immediate:true` rides along and means the condition already held at call
194
+ time; if that is not what you meant, you wanted `fresh=1` or send-and-wait.
195
+ 2. `wait.timedOut` — poll boundary; loop again.
196
+ 3. `wait.ended` — session deleted/torn down mid-wait; stop looping.
197
+
198
+ ## Troubleshooting
199
+
200
+ | Symptom | Cause / fix |
201
+ |---------|-------------|
202
+ | every curl fails with a certificate error | you dropped `-k`; `CODEMAN_API_URL` is HTTPS with a self-signed cert |
203
+ | `jq: parse error` on every call | plain-text 401s: the server has a password. Check with `-w '%{http_code}'`, use the guard's `.env` fallback, and if no `.env` exists, stop and ask the user for credentials |
204
+ | input arrives but nothing happens; later waits all time out | the input had no `\r`, so Enter was never sent; the text is sitting on the worker's prompt. **Submitting it with `{"input":"\r"}` is the ONLY recovery** — Ctrl+U (0x15) and Esc do NOT clear the composer (verified live) — and the flush costs one turn in which the worker reasons about the junk; open the next real prompt with "ignore the garbled line above:" |
205
+ | `GET .../sessions/$CODEMAN_SESSION_ID` 404s | Docker case: the env id is truncated to 8 chars; find yourself with `startswith($SELF)`, and always self-compare by prefix, in both directions |
206
+ | `CODEMAN_MUX` unset but you seem to be in a session | remote-SSH case: the env vars are not exported there. Fail closed — refuse to act |
207
+ | connection refused from inside a container | a loopback-bound server is unreachable from a container, and `CODEMAN_DOCKER_BRIDGE_HOOKS=1` does **not** fix that: it opens a hooks-only listener, so hook events start flowing but `/api/v1/*` stays refused. Driving the API from inside a Docker case needs a reachable bind (an operator decision); report it, don't retry |
208
+ | wait routes 404 on a valid session id | read the `.error` text: a `Route ...` prefix means the server predates the wait endpoints (< 1.13.0; a dev build can serve them while reporting an older version, so probe, never version-compare) — poll `terminal?tail=` and say so. `Session ... not found` means your id is wrong, not the server |
209
+ | wait on `stop` never resolves | non-claude mode, or hooks not reaching the server (Docker/remote), or a case created by Codeman < 1.13.0 against an `--https` install (its hook curls lacked `-k` and TLS-failed silently; a 1.13.0+ server rewrites them the next time a session starts in that case). Use markers or `idle,exit` |
210
+ | new claude worker ignores its first prompt | it was showing the first-run trust dialog and Codeman's auto-accept missed; use the readiness recipe in SKILL.md (wait for `bypass` first, accept the dialog only as the bounded fallback) |
211
+ | `wait-output` times out although the pane shows the text | multi-word match against a TUI screen; the stream has no spaces there — match one token |
212
+ | `wait-output` matched instantly with stale text | generic marker + tmux repaint; use `DONE_$RANDOM` |
213
+ | 409 `SESSION_BUSY` on a wait | too many concurrent waiters on that session (cap 16 combined); reuse one wait per worker |
214
+ | 429 `RATE_LIMITED` on a wait | global/owner waiter pool full; back off, do not switch sessions |