aicodeman 1.50.1 → 1.51.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 (249) hide show
  1. package/README.md +11 -9
  2. package/dist/config/attachment-guard.d.ts +5 -1
  3. package/dist/config/attachment-guard.d.ts.map +1 -1
  4. package/dist/config/attachment-guard.js +4 -2
  5. package/dist/config/attachment-guard.js.map +1 -1
  6. package/dist/config/cli-registry/schema.d.ts +2 -0
  7. package/dist/config/cli-registry/schema.d.ts.map +1 -1
  8. package/dist/config/cli-registry/schema.js +11 -0
  9. package/dist/config/cli-registry/schema.js.map +1 -1
  10. package/dist/config/cli-registry/stock.d.ts.map +1 -1
  11. package/dist/config/cli-registry/stock.js +155 -4
  12. package/dist/config/cli-registry/stock.js.map +1 -1
  13. package/dist/config/cli-registry/types.d.ts +33 -2
  14. package/dist/config/cli-registry/types.d.ts.map +1 -1
  15. package/dist/config/file-editing.d.ts +7 -3
  16. package/dist/config/file-editing.d.ts.map +1 -1
  17. package/dist/config/file-editing.js +12 -3
  18. package/dist/config/file-editing.js.map +1 -1
  19. package/dist/config/local-model-catalog.d.ts +95 -20
  20. package/dist/config/local-model-catalog.d.ts.map +1 -1
  21. package/dist/config/local-model-catalog.js +172 -37
  22. package/dist/config/local-model-catalog.js.map +1 -1
  23. package/dist/custom-model-injection.d.ts.map +1 -1
  24. package/dist/custom-model-injection.js +22 -14
  25. package/dist/custom-model-injection.js.map +1 -1
  26. package/dist/hooks-config.d.ts +62 -0
  27. package/dist/hooks-config.d.ts.map +1 -1
  28. package/dist/hooks-config.js +156 -0
  29. package/dist/hooks-config.js.map +1 -1
  30. package/dist/local-model/connect.d.ts +16 -2
  31. package/dist/local-model/connect.d.ts.map +1 -1
  32. package/dist/local-model/connect.js +17 -3
  33. package/dist/local-model/connect.js.map +1 -1
  34. package/dist/local-model/harness-facts.d.ts +8 -4
  35. package/dist/local-model/harness-facts.d.ts.map +1 -1
  36. package/dist/local-model/harness-facts.js +13 -5
  37. package/dist/local-model/harness-facts.js.map +1 -1
  38. package/dist/local-model/install-job.d.ts +208 -28
  39. package/dist/local-model/install-job.d.ts.map +1 -1
  40. package/dist/local-model/install-job.js +846 -92
  41. package/dist/local-model/install-job.js.map +1 -1
  42. package/dist/local-model/recommend.d.ts +11 -5
  43. package/dist/local-model/recommend.d.ts.map +1 -1
  44. package/dist/local-model/recommend.js +11 -5
  45. package/dist/local-model/recommend.js.map +1 -1
  46. package/dist/local-model/runtime.d.ts +12 -0
  47. package/dist/local-model/runtime.d.ts.map +1 -1
  48. package/dist/local-model/runtime.js +42 -0
  49. package/dist/local-model/runtime.js.map +1 -1
  50. package/dist/local-model/state-store.d.ts.map +1 -1
  51. package/dist/local-model/state-store.js +40 -0
  52. package/dist/local-model/state-store.js.map +1 -1
  53. package/dist/mux-interface.d.ts +3 -1
  54. package/dist/mux-interface.d.ts.map +1 -1
  55. package/dist/proc-tree.d.ts +23 -0
  56. package/dist/proc-tree.d.ts.map +1 -1
  57. package/dist/proc-tree.js +28 -0
  58. package/dist/proc-tree.js.map +1 -1
  59. package/dist/session-auto-ops.d.ts +95 -8
  60. package/dist/session-auto-ops.d.ts.map +1 -1
  61. package/dist/session-auto-ops.js +146 -32
  62. package/dist/session-auto-ops.js.map +1 -1
  63. package/dist/session-cli-registry-bridge.d.ts +2 -1
  64. package/dist/session-cli-registry-bridge.d.ts.map +1 -1
  65. package/dist/session-cli-registry-bridge.js.map +1 -1
  66. package/dist/session.d.ts +16 -1
  67. package/dist/session.d.ts.map +1 -1
  68. package/dist/session.js +29 -5
  69. package/dist/session.js.map +1 -1
  70. package/dist/tmux-manager.d.ts +10 -1
  71. package/dist/tmux-manager.d.ts.map +1 -1
  72. package/dist/tmux-manager.js +45 -6
  73. package/dist/tmux-manager.js.map +1 -1
  74. package/dist/tui/tui-app.d.ts.map +1 -1
  75. package/dist/tui/tui-app.js +1 -0
  76. package/dist/tui/tui-app.js.map +1 -1
  77. package/dist/tui/tui-client.d.ts +1 -1
  78. package/dist/tui/tui-client.d.ts.map +1 -1
  79. package/dist/types/local-model-install.d.ts +202 -15
  80. package/dist/types/local-model-install.d.ts.map +1 -1
  81. package/dist/types/local-model-install.js +21 -4
  82. package/dist/types/local-model-install.js.map +1 -1
  83. package/dist/types/local-model.d.ts +32 -6
  84. package/dist/types/local-model.d.ts.map +1 -1
  85. package/dist/types/local-model.js.map +1 -1
  86. package/dist/types/session.d.ts +26 -4
  87. package/dist/types/session.d.ts.map +1 -1
  88. package/dist/types/session.js +2 -1
  89. package/dist/types/session.js.map +1 -1
  90. package/dist/usage-telemetry.d.ts +3 -0
  91. package/dist/usage-telemetry.d.ts.map +1 -1
  92. package/dist/usage-telemetry.js +4 -0
  93. package/dist/usage-telemetry.js.map +1 -1
  94. package/dist/utils/token-validation.d.ts +3 -3
  95. package/dist/utils/token-validation.d.ts.map +1 -1
  96. package/dist/utils/token-validation.js +3 -3
  97. package/dist/utils/token-validation.js.map +1 -1
  98. package/dist/web/public/admin-ui.js.gz +0 -0
  99. package/dist/web/public/api-client.c9b1cddc.js.gz +0 -0
  100. package/dist/web/public/{app.07398d90.js → app.bddc2382.js} +9 -7
  101. package/dist/web/public/app.bddc2382.js.br +0 -0
  102. package/dist/web/public/app.bddc2382.js.gz +0 -0
  103. package/dist/web/public/approvals-ui.js.gz +0 -0
  104. package/dist/web/public/constants.782170e1.js.gz +0 -0
  105. package/dist/web/public/cron-ui.js.gz +0 -0
  106. package/dist/web/public/edit-history-ui.js.gz +0 -0
  107. package/dist/web/public/entrance-animations.js.gz +0 -0
  108. package/dist/web/public/foreign-sessions.js.gz +0 -0
  109. package/dist/web/public/git-status-ui.js.gz +0 -0
  110. package/dist/web/public/header-divider.eb2d2463.js.gz +0 -0
  111. package/dist/web/public/home-sessions.js.gz +0 -0
  112. package/dist/web/public/host-wake-ui.js.gz +0 -0
  113. package/dist/web/public/i18n.2e0cdcee.js +2 -0
  114. package/dist/web/public/i18n.2e0cdcee.js.br +0 -0
  115. package/dist/web/public/i18n.2e0cdcee.js.gz +0 -0
  116. package/dist/web/public/{image-input.a5d0f8f3.js → image-input.b75c41ca.js} +17 -1
  117. package/dist/web/public/image-input.b75c41ca.js.br +0 -0
  118. package/dist/web/public/image-input.b75c41ca.js.gz +0 -0
  119. package/dist/web/public/index.html +15 -12
  120. package/dist/web/public/index.html.br +0 -0
  121. package/dist/web/public/index.html.gz +0 -0
  122. package/dist/web/public/input-cjk.8bc46081.js.gz +0 -0
  123. package/dist/web/public/keyboard-accessory.0800fc44.js.gz +0 -0
  124. package/dist/web/public/local-model-ui.js +618 -32
  125. package/dist/web/public/local-model-ui.js.br +0 -0
  126. package/dist/web/public/local-model-ui.js.gz +0 -0
  127. package/dist/web/public/mobile-handlers.f7c3f692.js.gz +0 -0
  128. package/dist/web/public/mobile-ime-preview.2dbaf262.js.gz +0 -0
  129. package/dist/web/public/mobile-overview.js +1 -0
  130. package/dist/web/public/mobile-overview.js.br +0 -0
  131. package/dist/web/public/mobile-overview.js.gz +0 -0
  132. package/dist/web/public/mobile.984e9058.css +1 -0
  133. package/dist/web/public/mobile.984e9058.css.br +0 -0
  134. package/dist/web/public/mobile.984e9058.css.gz +0 -0
  135. package/dist/web/public/notification-manager.feb82c04.js.gz +0 -0
  136. package/dist/web/public/orchestrator-panel.js.gz +0 -0
  137. package/dist/web/public/{panels-ui.9ba2683e.js → panels-ui.ee2330a4.js} +1 -1
  138. package/dist/web/public/panels-ui.ee2330a4.js.br +0 -0
  139. package/dist/web/public/panels-ui.ee2330a4.js.gz +0 -0
  140. package/dist/web/public/ralph-panel.b350e2ef.js.gz +0 -0
  141. package/dist/web/public/ralph-wizard.b6c0dd19.js.gz +0 -0
  142. package/dist/web/public/readmymind-ui.js.gz +0 -0
  143. package/dist/web/public/reboot-restore-ui.js.gz +0 -0
  144. package/dist/web/public/respawn-ui.304ba0d4.js.gz +0 -0
  145. package/dist/web/public/sanitize-html.e7147e76.js.gz +0 -0
  146. package/dist/web/public/session-lineage.js.gz +0 -0
  147. package/dist/web/public/{session-ui.8f300b14.js → session-ui.4273cbc5.js} +7 -7
  148. package/dist/web/public/session-ui.4273cbc5.js.br +0 -0
  149. package/dist/web/public/session-ui.4273cbc5.js.gz +0 -0
  150. package/dist/web/public/settings-ui.8b37cf07.js.gz +0 -0
  151. package/dist/web/public/spreadsheet-preview-worker.js.gz +0 -0
  152. package/dist/web/public/spreadsheet-preview.75c751de.js.gz +0 -0
  153. package/dist/web/public/spreadsheet-xlsx-core.js.gz +0 -0
  154. package/dist/web/public/styles.81d95f50.css +1 -0
  155. package/dist/web/public/styles.81d95f50.css.br +0 -0
  156. package/dist/web/public/styles.81d95f50.css.gz +0 -0
  157. package/dist/web/public/subagent-windows.07277a58.js.gz +0 -0
  158. package/dist/web/public/sw.js +2 -2
  159. package/dist/web/public/sw.js.br +0 -0
  160. package/dist/web/public/sw.js.gz +0 -0
  161. package/dist/web/public/tab-layout-browser.2d6189f7.js.gz +0 -0
  162. package/dist/web/public/tab-rail-resize.b5cdceaf.js.gz +0 -0
  163. package/dist/web/public/terminal-keycode229-recovery.98843069.js.gz +0 -0
  164. package/dist/web/public/terminal-split.js.gz +0 -0
  165. package/dist/web/public/terminal-tile.js +1 -1
  166. package/dist/web/public/terminal-tile.js.br +0 -0
  167. package/dist/web/public/terminal-tile.js.gz +0 -0
  168. package/dist/web/public/{terminal-ui.f92eae28.js → terminal-ui.8e4c2017.js} +1 -1
  169. package/dist/web/public/terminal-ui.8e4c2017.js.br +0 -0
  170. package/dist/web/public/terminal-ui.8e4c2017.js.gz +0 -0
  171. package/dist/web/public/tile-grid.js.gz +0 -0
  172. package/dist/web/public/ultracode-panel.js.gz +0 -0
  173. package/dist/web/public/ultracode-windows.js.gz +0 -0
  174. package/dist/web/public/vendor/dompurify.min.js.gz +0 -0
  175. package/dist/web/public/vendor/exceljs.min.js.gz +0 -0
  176. package/dist/web/public/vendor/fflate.min.js.gz +0 -0
  177. package/dist/web/public/vendor/marked.min.js.gz +0 -0
  178. package/dist/web/public/vendor/xterm-addon-fit.min.js.gz +0 -0
  179. package/dist/web/public/vendor/xterm-addon-serialize.min.js.gz +0 -0
  180. package/dist/web/public/vendor/xterm-addon-unicode11.min.js.gz +0 -0
  181. package/dist/web/public/vendor/xterm-addon-webgl.min.js.gz +0 -0
  182. package/dist/web/public/vendor/xterm-predictive-echo.276b11d9.js.gz +0 -0
  183. package/dist/web/public/vendor/xterm-zerolag-input.1be42307.js.gz +0 -0
  184. package/dist/web/public/vendor/xterm.css.gz +0 -0
  185. package/dist/web/public/vendor/xterm.min.js.gz +0 -0
  186. package/dist/web/public/voice-input.d0580528.js.gz +0 -0
  187. package/dist/web/public/voice-pcm-worklet.js.gz +0 -0
  188. package/dist/web/public/webview-tabs.js.gz +0 -0
  189. package/dist/web/public/whats-new.json +9 -9
  190. package/dist/web/routes/file-routes.d.ts.map +1 -1
  191. package/dist/web/routes/file-routes.js +20 -4
  192. package/dist/web/routes/file-routes.js.map +1 -1
  193. package/dist/web/routes/hook-event-routes.d.ts.map +1 -1
  194. package/dist/web/routes/hook-event-routes.js +45 -16
  195. package/dist/web/routes/hook-event-routes.js.map +1 -1
  196. package/dist/web/routes/local-model-routes.d.ts +18 -6
  197. package/dist/web/routes/local-model-routes.d.ts.map +1 -1
  198. package/dist/web/routes/local-model-routes.js +47 -10
  199. package/dist/web/routes/local-model-routes.js.map +1 -1
  200. package/dist/web/routes/session-routes.d.ts.map +1 -1
  201. package/dist/web/routes/session-routes.js +52 -4
  202. package/dist/web/routes/session-routes.js.map +1 -1
  203. package/dist/web/routes/status-telemetry-routes.d.ts.map +1 -1
  204. package/dist/web/routes/status-telemetry-routes.js +6 -0
  205. package/dist/web/routes/status-telemetry-routes.js.map +1 -1
  206. package/dist/web/routes/system-routes.d.ts.map +1 -1
  207. package/dist/web/routes/system-routes.js +12 -0
  208. package/dist/web/routes/system-routes.js.map +1 -1
  209. package/dist/web/schemas.d.ts +23 -0
  210. package/dist/web/schemas.d.ts.map +1 -1
  211. package/dist/web/schemas.js +42 -4
  212. package/dist/web/schemas.js.map +1 -1
  213. package/dist/web/sensitive-path.d.ts +8 -1
  214. package/dist/web/sensitive-path.d.ts.map +1 -1
  215. package/dist/web/sensitive-path.js +23 -4
  216. package/dist/web/sensitive-path.js.map +1 -1
  217. package/dist/web/server.d.ts.map +1 -1
  218. package/dist/web/server.js +1 -0
  219. package/dist/web/server.js.map +1 -1
  220. package/dist/web/session-wait-registry.d.ts +19 -4
  221. package/dist/web/session-wait-registry.d.ts.map +1 -1
  222. package/dist/web/session-wait-registry.js +26 -5
  223. package/dist/web/session-wait-registry.js.map +1 -1
  224. package/package.json +1 -1
  225. package/skills/codeman/SKILL.md +147 -42
  226. package/skills/codeman/preamble.sh +102 -26
  227. package/skills/codeman/reference/endpoints.md +13 -9
  228. package/skills/codeman/reference/messaging.md +2 -2
  229. package/skills/codeman/reference/recipes.md +2 -2
  230. package/skills/codeman/reference/verbs.md +46 -15
  231. package/dist/web/public/app.07398d90.js.br +0 -0
  232. package/dist/web/public/app.07398d90.js.gz +0 -0
  233. package/dist/web/public/i18n.519d025e.js +0 -2
  234. package/dist/web/public/i18n.519d025e.js.br +0 -0
  235. package/dist/web/public/i18n.519d025e.js.gz +0 -0
  236. package/dist/web/public/image-input.a5d0f8f3.js.br +0 -0
  237. package/dist/web/public/image-input.a5d0f8f3.js.gz +0 -0
  238. package/dist/web/public/mobile.4dfd5c55.css +0 -1
  239. package/dist/web/public/mobile.4dfd5c55.css.br +0 -0
  240. package/dist/web/public/mobile.4dfd5c55.css.gz +0 -0
  241. package/dist/web/public/panels-ui.9ba2683e.js.br +0 -0
  242. package/dist/web/public/panels-ui.9ba2683e.js.gz +0 -0
  243. package/dist/web/public/session-ui.8f300b14.js.br +0 -0
  244. package/dist/web/public/session-ui.8f300b14.js.gz +0 -0
  245. package/dist/web/public/styles.21b93520.css +0 -1
  246. package/dist/web/public/styles.21b93520.css.br +0 -0
  247. package/dist/web/public/styles.21b93520.css.gz +0 -0
  248. package/dist/web/public/terminal-ui.f92eae28.js.br +0 -0
  249. package/dist/web/public/terminal-ui.f92eae28.js.gz +0 -0
@@ -1,4 +1,4 @@
1
- # ---- Codeman agent preamble 1.50.0 (seeded by Codeman at session spawn; the SKILL.md §0 bootstrap rewrites it when missing or stale) ----
1
+ # ---- Codeman agent preamble 1.51.0 (seeded by Codeman at session spawn; the SKILL.md §0 bootstrap rewrites it when missing or stale) ----
2
2
  # Positional parameters are always written with braces, ${1} and never a bare dollar-digit: Claude Code
3
3
  # replaces a bare one in a skill body with the matching word of the skill's arguments, and §0 is pasted
4
4
  # from that body (test/agent-skill.test.ts pins it).
@@ -59,6 +59,17 @@ _dsh_up() { # <sid> <timeoutMs> -> "true"/"false". The DeepSeek Harness T
59
59
  # composer glyph. Override with DSH_READY_MARK for a profile that draws another one.
60
60
  _mark_up "${1}" "${DSH_READY_MARK:-❯}" "${2}"
61
61
  }
62
+ _dsh_guide() { # <sid> -> 0 when the pane shows dsh-TUI's first-run SETUP GUIDE, not a composer.
63
+ # dsh-TUI 0.19.0 opens a guide ("Welcome to dsh-TUI Step 1 of 4") in every session until a
64
+ # person has finished it once, and the guide's own cursor is `❯`: the readiness mark matches
65
+ # on it (measured, 2 of 2 launches), and an Enter there acts on the highlighted step, which
66
+ # is a sign-in. So a worker whose mark matched is still checked for the guide, on the
67
+ # RENDERED pane with its whitespace removed, and never handed back while it shows.
68
+ "${CURL[@]}" -G "$API/api/v1/sessions/${1}/terminal" --data-urlencode 'full=1' \
69
+ | jq -r '.data.terminalBuffer // empty' \
70
+ | sed -e "s/$(printf '\033')\[[0-9;?]*[a-zA-Z]//g" -e "s/$(printf '\033')[()][AB0]//g" \
71
+ | tr -d ' \t' | grep -qi 'Step[0-9]of[0-9]'
72
+ }
62
73
  # ---- the workspace-trust dialog: READ the screen, never press Enter blind ----
63
74
  # Claude Code 2.1.252 dropped the option numbers, REVERSED them, and highlights
64
75
  # "No, exit" by default:
@@ -121,9 +132,18 @@ _accept_trust() { # <sid> -> 0 once it has answered the dialog, 1 if it could n
121
132
  # local_model -> ONE compact JSON object on stdout. rc 0 only when a `local` worker can be
122
133
  # spawned now (`running:true`) or once spawn_worker has started the runtime (`running:false`):
123
134
  # {"spawnable":true,"state":"installed","running":true,"cli":"opencode","cliLabel":"OpenCode",
124
- # "endpointId":"local-ollama","modelId":"<id>","modelLabel":"<label>"}
135
+ # "endpointId":"local-ollama","modelId":"<id>","modelLabel":"<label>",
136
+ # "agents":[{"cli":"opencode","cliLabel":"OpenCode","status":"ready","default":true,"readyMark":"┃"},
137
+ # {"cli":"pi","cliLabel":"Pi","status":"installable","default":false}],
138
+ # "models":[{"id":"<id>","label":"<label>","active":true,"status":"ready","sizeGb":"23.1"}]}
139
+ # `cli` is the DEFAULT coding agent, the one `spawn_worker <name> local` starts. `agents` is
140
+ # every agent the model can be run with: `local:<cli>` starts one whose status is `ready`
141
+ # (`installable`, `installing` and `setup-needed` are a person's to resolve in the window).
142
+ # `models` is what is on this Mac; only the `active` one runs, and switching is a person's
143
+ # decision too. A Codeman older than 1.51 sends neither list: only `local` works there.
125
144
  # Otherwise rc 1 and {"spawnable":false,"reason":"<reason>","message":"<why>",...}, the reason
126
- # one of: not-mac, not-installed, install-unfinished, blocked (installed, but the server
145
+ # one of: not-mac, not-installed, install-unfinished, no-agent (installed, but no coding agent
146
+ # that can run the model is on this Mac), blocked (installed, but the server
127
147
  # refuses a session now: the model changed on disk, another program holds the port, the
128
148
  # runtime does not start), admin-only (multi-user mode, 403), unsupported (a Codeman without
129
149
  # local models, 404), unauthorized (401, §6), unreachable, error.
@@ -139,12 +159,23 @@ local_model() {
139
159
  | reduce ((.vars // {}) | to_entries[]) as $e ($t; gsub("\\{" + $e.key + "\\}"; $e.value));
140
160
  .data as $d | ($d.install // {}) as $i | ($i.actions // []) as $a
141
161
  | {state:$i.state, running:($i.running == true), cli:$i.cli, cliLabel:$i.cliLabel,
142
- endpointId:$i.endpointId, modelId:$i.model.id, modelLabel:$i.model.label} as $base
162
+ endpointId:$i.endpointId, modelId:$i.model.id, modelLabel:$i.model.label,
163
+ agents:(if ($i.harnesses | type) == "array"
164
+ then [$i.harnesses[] | {cli, cliLabel, status, default, readyMark} | with_entries(select(.value != null))]
165
+ else null end),
166
+ models:(if ($i.library | type) == "array" and ($i.library | length) > 0
167
+ then [$i.library[] | {id, label, active, status, sizeGb} | with_entries(select(.value != null))]
168
+ else null end)} as $base
143
169
  | if ($d | type) != "object" then {spawnable:false, reason:"error", message:"no data in the answer"}
144
170
  elif $i.state == "installed" then
171
+ # With the agents listed and none of them startable there is nothing to spawn,
172
+ # running or not: say that, not "blocked".
173
+ if $i.error == null and $base.agents != null and ([$base.agents[] | select(.status == "ready")] | length) == 0
174
+ then {spawnable:false, reason:"no-agent",
175
+ message:"The model is installed, but no coding agent that can run it is on this Mac. A person installs one in the Run a local model window."} + $base
145
176
  # `start` alone over-promises: it is offered too while another program holds the
146
177
  # port. Only an error-free start is a runtime spawn_worker can bring up.
147
- if ($i.cli and $i.endpointId and $i.model.id)
178
+ elif ($i.cli and $i.endpointId and $i.model.id)
148
179
  and (($a | index("start-session")) != null or (($a | index("start")) != null and $i.error == null))
149
180
  then {spawnable:true} + $base
150
181
  else {spawnable:false, reason:"blocked", errorCode:$i.error.code,
@@ -207,31 +238,55 @@ _local_ready_model() {
207
238
  # rather than handed back, because a worker that never drew its composer would eat the
208
239
  # task prompt with its trust dialog. There is deliberately no pid poll: wait-output
209
240
  # already blocks until the composer draws, and pid!=null proved startup, never readiness.
210
- # mode `local` is the model Codeman installed on this Mac (local_model), run by the coding
211
- # agent it was installed with. The worker's mode becomes that agent, and the endpoint and
212
- # model ride the quick-start as `customModel`: the launch the window's "Start a session"
213
- # makes. A stopped runtime is started first. Any answer that wants a person to confirm
214
- # something (a context below the agent's safe floor, a model swap) fails the spawn: this
215
- # never confirms on anyone's behalf.
241
+ # mode `local` is the model Codeman installed on this Mac (local_model), run by its default
242
+ # coding agent; `local:<cli>` (`local:pi`, `local:deepseek`, `local:opencode`, `local:claude`)
243
+ # picks another one of local_model's `agents`, which must be `ready`. The worker's mode
244
+ # becomes that agent, and the endpoint and model ride the quick-start as `customModel`: the
245
+ # launch the window's "Start a session" makes. A stopped runtime is started first. Any answer
246
+ # that wants a person to confirm something (a context below the agent's safe floor, a model
247
+ # swap) fails the spawn: this never confirms on anyone's behalf, and it never installs an
248
+ # agent. All local workers share ONE model that answers one request at a time.
216
249
  # CODEMAN_WORKER_ADVISOR=opus (or fable / sonnet) gives every CLAUDE worker spawned while
217
250
  # it is set Claude Code's advisor tool: a stronger model the worker consults before
218
251
  # committing to an approach, on a recurring error and before declaring the task done.
219
252
  # Other modes ignore it. A value the server refuses fails the spawn (INVALID_INPUT); an
220
253
  # advisor that ranks below the worker's model is accepted but never attached by claude.
221
254
  spawn_worker() {
222
- local name="${1:?spawn_worker needs a case name}" mode="${2:-claude}" q sid cp r lm cm='' mark=''
255
+ local name="${1:?spawn_worker needs a case name}" mode="${2:-claude}" q sid cp r lm cm='' mark='' want=''
256
+ case "$mode" in local:*) want=${mode#local:}; mode=local ;; esac
223
257
  if [ "$mode" = local ]; then
224
258
  lm=$(_local_ready_model) || return 1
225
- mode=$(jq -r .cli <<<"$lm")
259
+ if [ -n "$want" ]; then
260
+ # Only an agent the server lists as startable. A Codeman that lists none (older than
261
+ # 1.51) knows one agent, its `cli`: naming that one is fine, any other is not.
262
+ r=$(jq -r --arg w "$want" 'if (.agents | type) == "array" then ([.agents[] | select(.cli == $w) | .status][0] // "absent")
263
+ elif .cli == $w then "ready" else "unlisted" end' <<<"$lm")
264
+ case "$r" in
265
+ ready) ;;
266
+ unlisted) echo "this Codeman lists one coding agent for the local model, $(jq -r .cli <<<"$lm"): use plain \`local\`, or update Codeman to choose another" >&2; return 1 ;;
267
+ absent) echo "the local model cannot be run with '$want' here. Startable: $(jq -r '[.agents[] | select(.status == "ready") | .cli] | join(", ")' <<<"$lm")" >&2; return 1 ;;
268
+ *) echo "the coding agent '$want' is not startable on this Mac ($r): a person installs or sets it up in the Run a local model window. Startable now: $(jq -r '[.agents[] | select(.status == "ready") | .cli] | join(", ")' <<<"$lm")" >&2; return 1 ;;
269
+ esac
270
+ mode=$want
271
+ else
272
+ mode=$(jq -r .cli <<<"$lm")
273
+ fi
226
274
  cm=$(jq -c '{endpointId, modelId}' <<<"$lm")
227
- # Readiness is a token the agent's composer draws. The registry's composer data never
228
- # reaches the API, so it is named per agent here. opencode: `┃`, its `workDetect.promptGlyph`.
229
- # That field is no readiness mark in general (the registry keeps `composerReadyMark` for
230
- # that, and declares none for opencode), but at boot only the composer draws it: measured
231
- # on opencode 1.3.0 on Linux, fresh home, custom provider, the first `┃` came with the composer,
232
- # and a prompt pasted with its Enter at that moment was submitted. claude takes the claude
233
- # path below. Any other agent needs LOCAL_READY_MARK rather than a worker handed back on a guess.
234
- [ "$mode" = opencode ] && mark='┃'
275
+ # Readiness is a token the agent's composer draws once it takes input. The server names
276
+ # the measured one per agent (`readyMark`: opencode `┃`, deepseek `❯`, claude `shift+tab`).
277
+ # For a server that sends none, the two this skill measured itself:
278
+ # - opencode `┃`: at boot only the composer draws it (1.3.0 and 1.19.5, a prompt pasted
279
+ # at the mark was submitted every time).
280
+ # - pi `extended-keys`: pi paints its composer rules in its FIRST frame and ignores Enter
281
+ # until startup has finished, so its rule is no mark (a prompt sent at it stayed
282
+ # unsent, 2 of 2). The last line of its startup is a warning that tmux's
283
+ # `extended-keys` option is off, which it is on Codeman's socket: a prompt sent once
284
+ # that word showed was submitted, 4 of 4 on pi 1.5.2. It is a side effect, not a
285
+ # contract, so a pi that stops printing it fails the spawn (the worker is deleted, never
286
+ # handed back on a guess) until LOCAL_READY_MARK names what it draws instead.
287
+ # claude takes the claude path below.
288
+ mark=$(jq -r --arg m "$mode" '[(.agents // [])[] | select(.cli == $m) | .readyMark // empty][0] // empty' <<<"$lm")
289
+ [ -n "$mark" ] || case "$mode" in opencode) mark='┃' ;; pi) mark='extended-keys' ;; esac
235
290
  mark=${LOCAL_READY_MARK:-$mark}
236
291
  [ "$mode" = claude ] || [ -n "$mark" ] || {
237
292
  echo "the local model runs through $mode, and this skill knows no composer mark for it: set LOCAL_READY_MARK to a space-free token its composer draws" >&2
@@ -246,11 +301,16 @@ spawn_worker() {
246
301
  # server clamps this back to `workspace-write` for an owner without the grant.
247
302
  # Spawn by hand (§5.1) when you want a worker that asks. The advisor is a cloud model,
248
303
  # so a claude worker on the local model never gets one.
304
+ # pi on the local model: a custom model session gives pi a home of its own, so it would
305
+ # ask "Trust project folder?" in EVERY session whose parent folders hold agent skills, with
306
+ # Trust preselected, and the task prompt's Enter would answer it. `approveProjectTrust:
307
+ # false` starts it with --no-approve: no dialog, and no project code is trusted for anyone.
249
308
  q=$("${CURL[@]}" -X POST "$API/api/v1/quick-start" -H 'Content-Type: application/json' \
250
309
  -d "$(jq -nc --arg n "$name" --arg m "$mode" --arg p "$SELF" --arg a "${CODEMAN_WORKER_ADVISOR:-}" --arg cm "$cm" \
251
310
  '{caseName:$n,mode:$m,parentSessionId:$p}
252
311
  + (if $m == "deepseek" then {deepSeekConfig:{permissionMode:"danger-full-access"}} else {} end)
253
312
  + (if $m == "claude" and $a != "" and $cm == "" then {advisorModel:$a} else {} end)
313
+ + (if $m == "pi" and $cm != "" then {piConfig:{approveProjectTrust:false}} else {} end)
254
314
  + (if $cm != "" then {customModel:($cm | fromjson)} else {} end)')")
255
315
  # The answers that want a PERSON to decide come back as success with no session id.
256
316
  if jq -e '(.data // .) | (.requiresContextWarning or .requiresConfirmation)' <<<"$q" >/dev/null 2>&1; then
@@ -267,11 +327,18 @@ spawn_worker() {
267
327
  echo "worker $sid: this Codeman server ignored CODEMAN_WORKER_ADVISOR (no advisor support); it runs without one" >&2
268
328
  fi
269
329
  if [ -n "$cm" ] && [ "$mode" != claude ]; then
270
- # No trust dialog and no hook file to vet: the agent has no hooks, which is exactly
271
- # why sendwait refuses it (400) and sendmark drives it.
330
+ # No trust dialog and no hook file to vet. opencode and pi have no end-of-turn signal,
331
+ # which is exactly why sendwait refuses them (400) and sendmark drives them. A deepseek
332
+ # worker reports the end of a turn on the local model too, but sendmark is still the way
333
+ # to get its ANSWER: dsh 0.2.2 renamed its transcript file, and until Codeman reads the
334
+ # new one `last-response` comes back empty for it.
272
335
  r=$(_mark_up "$sid" "$mark" 45000)
273
336
  [ "$r" = true ] || { echo "local worker $sid ($mode) never drew '$mark' within 45 s; deleted it. Look at GET /api/v1/local-model and the pane of a hand-made session before retrying" >&2
274
337
  delete_session "$sid" >/dev/null; return 1; }
338
+ if [ "$mode" = deepseek ] && _dsh_guide "$sid"; then
339
+ echo "dsh worker $sid opened DeepSeek Harness's setup guide instead of a composer; deleted it. A person finishes that guide once (start a DeepSeek session from the Run menu), then spawn again" >&2
340
+ delete_session "$sid" >/dev/null; return 1
341
+ fi
275
342
  printf '%s\n' "$sid"; return 0
276
343
  fi
277
344
  if [ "$mode" = deepseek ]; then
@@ -287,6 +354,10 @@ spawn_worker() {
287
354
  r=$(_dsh_up "$sid" 45000)
288
355
  [ "$r" = true ] || { echo "dsh worker $sid never drew a composer: no pane-capable profile, a profile whose composer is not '${DSH_READY_MARK:-❯}' (set DSH_READY_MARK), or a harness that failed to boot -- check GET /api/v1/deepseek/status. Deleted it" >&2
289
356
  delete_session "$sid" >/dev/null; return 1; }
357
+ if _dsh_guide "$sid"; then
358
+ echo "dsh worker $sid opened DeepSeek Harness's setup guide instead of a composer; deleted it. A person finishes that guide once (start a DeepSeek session from the Run menu), then spawn again" >&2
359
+ delete_session "$sid" >/dev/null; return 1
360
+ fi
290
361
  printf '%s\n' "$sid"; return 0
291
362
  fi
292
363
  [ "$mode" = claude ] || { printf '%s\n' "$sid"; return 0; } # no other mode draws a composer to wait on
@@ -434,7 +505,7 @@ sendwait() {
434
505
  # complete answer to codeman-answer-<token>.md in the working directory, and only then end
435
506
  # the reply with the word DONE immediately followed by _<token>. The marker is split in what
436
507
  # is typed, so the prompt echoing into the pane never matches it, and the token is new for
437
- # every call (§5.5). The send is sendwait's exactly-once body (per-worker clientId,
508
+ # every call and every worker (§5.5). The send is sendwait's exactly-once body (per-worker clientId,
438
509
  # epoch-second seq) with a one-second `exit` wait, so `delivered` says the pane took it.
439
510
  # ⚠️ A marker proves that the model printed the token. Not that it did the work, not that
440
511
  # it did it right, not even that the turn is over: a reasoning model can restate the
@@ -458,7 +529,12 @@ sendmark() {
458
529
  p=$(printf '%s\n' "$p" | tr '\r' '\n' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' -e '/^$/d' | paste -sd ' ' -) ;;
459
530
  esac
460
531
  [ -n "$p" ] || { echo "sendmark: empty prompt" >&2; return 1; }
461
- tok=$(printf 'm%x%04x' "$(date +%s)" "$RANDOM"); mark="DONE_$tok"
532
+ # The token carries six characters of the WORKER's id on top of the second and $RANDOM.
533
+ # Those two repeat: in zsh (the shell Claude Code runs on a Mac) every subshell draws the
534
+ # SAME $RANDOM until the parent shell reads it, and this line is a subshell. Two sendmark
535
+ # calls started in one second for two workers in ONE folder shared a token, and one
536
+ # worker's answer file replaced the other's (seen on a Mac, 2026-11-12).
537
+ tok=$(printf 'm%x%04x%s' "$(date +%s)" "$RANDOM" "$(printf '%s' "$sid" | tr -cd 'a-f0-9' | cut -c1-6)"); mark="DONE_$tok"
462
538
  if [ "${SENDMARK_ANSWER_FILE:-1}" != 0 ]; then
463
539
  wd=$("${CURL[@]}" "$API/api/v1/sessions/$sid" | jq -r '.data.workingDir // empty' 2>/dev/null)
464
540
  [ -n "$wd" ] || { echo "sendmark: could not read the working directory of worker $sid" >&2; return 1; }
@@ -545,4 +621,4 @@ last_text() {
545
621
  # The stamp is the LAST line on purpose (a truncated write leaves it unset) and is kept
546
622
  # bare on purpose: the write condition above anchors on it with $, so an inline comment
547
623
  # here would fail that match and rewrite this file on every single bootstrap.
548
- CODEMAN_PREAMBLE=1.50.0
624
+ CODEMAN_PREAMBLE=1.51.0
@@ -216,7 +216,10 @@ you typed matches the moment it is typed.
216
216
  generic marker (`BUILD OK`) matched against stale text, either from `from=buffer`
217
217
  scanning an earlier run or from tmux replaying old screen content as fresh output on an
218
218
  attach/resize/redraw. A unique-per-call token (`DONE_$RANDOM`) makes both `from` modes
219
- safe.
219
+ safe. ⚠️ In a fan-out put something of the WORKER into it too (its id, the loop index): zsh,
220
+ the shell Claude Code runs on a Mac, hands every subshell the same `$RANDOM` until the
221
+ parent shell reads it, so `( … $RANDOM … ) &` twice draws one number. `sendmark` adds six
222
+ characters of the worker's id for that reason.
220
223
 
221
224
  ### 6. `jq` parse error instead of an `errorCode`
222
225
 
@@ -242,7 +245,7 @@ minutes, never retry the credential.
242
245
  flushed slightly *after* the `stop` hook fires, so a read taken the instant the wait
243
246
  returns is too early (verified live: empty on the first call, full prose seconds later).
244
247
  It is also `""` before the worker's first completed turn, and permanently `""` for
245
- `shell`, `opencode`, `gemini`, `antigravity`, `pi`, `grok`, `omp` and `copilot`, which write no transcript at
248
+ `shell`, `opencode`, `gemini`, `antigravity`, `pi`, `grok`, `omp`, `copilot` and `jcode`, which write no transcript at
246
249
  all. `deepseek` is NOT one of those — it is read from `$DSH_HOME/sessions/**` and lags
247
250
  for the same reason claude does (the harness finalizes the assistant message just after
248
251
  it reports `idle`), so poll it the same way.
@@ -346,7 +349,7 @@ ESC=$(printf '\033')
346
349
 
347
350
  `POST /api/v1/quick-start` body (all optional):
348
351
  `{"caseName":"worker-1","mode":"claude","sessionName":"auth-worker","effort":"high"}`
349
- , `mode` ∈ `claude|shell|opencode|codex|gemini|antigravity|pi|grok|deepseek|omp|copilot`; response is
352
+ , `mode` ∈ `claude|shell|opencode|codex|gemini|antigravity|pi|grok|deepseek|omp|copilot|jcode`; response is
350
353
  `.data.{sessionId, caseName, casePath}`. Creates the case directory (a real directory
351
354
  on the user's disk) if missing, do not retry it in a loop, and remember the name.
352
355
 
@@ -361,9 +364,10 @@ a soft default the worker can change with `/advisor`. Remote and docker cases re
361
364
  `OPERATION_FAILED`; it never falls back to claude. Probe first whenever you did not pick
362
365
  the mode yourself: `GET /api/v1/claude/status`, `GET /api/v1/opencode/status`,
363
366
  `GET /api/v1/codex/status`, `GET /api/v1/gemini/status`, `GET /api/v1/antigravity/status`, `GET /api/v1/grok/status`, `GET /api/v1/deepseek/status`,
364
- `GET /api/v1/pi/status`, `GET /api/v1/omp/status` and `GET /api/v1/copilot/status` each return `.data.{available, path}` (no session needed).
365
- Pi's, grok's, OMP's and Copilot's also carry `.data.version`, because `pi` is a short generic name,
366
- `grok` is a name with npm squatters, and `omp` is a similarly short name, and `copilot` is a generic one, so an unrelated
367
+ `GET /api/v1/pi/status`, `GET /api/v1/omp/status`, `GET /api/v1/copilot/status` and `GET /api/v1/jcode/status` each return `.data.{available, path}` (no session needed).
368
+ Pi's, grok's, OMP's, Copilot's and jcode's also carry `.data.version`, because `pi` is a short generic name,
369
+ `grok` is a name with npm squatters, `omp` is a similarly short name, `copilot` is a generic one, and an
370
+ unrelated npm package is also called `jcode`, so an unrelated
367
371
  binary on `$PATH` can shadow any of them: the resolver rejects one whose `--version` is
368
372
  not version-shaped, so `available:false` there can mean "a different program of the same
369
373
  name is in front" rather than "nothing is installed". `shell` has no CLI to probe.
@@ -492,8 +496,8 @@ Quirks that will bite you:
492
496
  - ⚠️ **`active-tools` proves presence, never absence.** It is fed by the BashToolParser,
493
497
  which reads Claude's rendered `● Bash(…)` lines, and `_processExpensiveParsers`
494
498
  returns early for every external CLI mode (`session.ts:~2225`), so it is permanently
495
- `[]` on `opencode`/`codex`/`gemini`/`antigravity`/`pi`/`grok`/`deepseek`/`omp`/`copilot`. ⚠️ **`shell` is NOT one of those**
496
- (`isExternalCliMode`, `session.ts:176-187`, lists only those seven), so the parser does
499
+ `[]` on `opencode`/`codex`/`gemini`/`antigravity`/`pi`/`grok`/`deepseek`/`omp`/`copilot`/`jcode`. ⚠️ **`shell` is NOT one of those**
500
+ (`isExternalCliMode` covers only those external CLIs), so the parser does
497
501
  run on a shell worker, and `TEXT_COMMAND_PATTERN` (`bash-tool-parser.ts:89`) matches
498
502
  bare `tail|cat|head|less|grep|watch|multitail <path>` lines with no `● Bash(` wrapper:
499
503
  a shell worker running `cat build.log` really does populate this. In practice it stays
@@ -657,7 +661,7 @@ Three bounded long-polls. Shared semantics:
657
661
  | `idle` | output stabilized + prompt detected, heuristic, can flap mid-turn | every mode |
658
662
  | `working` | session started producing output | every mode |
659
663
  | `stop` | Claude Code `stop` hook, the definitive end-of-turn | `claude`; also `deepseek`, whose harness reports its own end of turn while its status bridge is on |
660
- | `blocked` | `permission_prompt` / `elicitation_dialog` hook, the worker needs an answer | `claude`; also `deepseek` (its harness reports its dialogs, same condition), and `codex`, whose approval, question and trust dialogs Codeman reads off its screen (answer both in the terminal, never through the inbox) |
664
+ | `blocked` | `permission_prompt` / `elicitation_dialog` hook, the worker needs an answer | `claude`; also `deepseek` (its harness reports its dialogs, same condition), `codex`, whose approval, question and trust dialogs Codeman reads off its screen, and a local `omp` session, whose tool approval dialogs a hook module in its workspace reports (answer all three in the terminal, never through the inbox) |
661
665
  | `exit` | PTY exited or session deleted | every mode |
662
666
 
663
667
  ⚠️ **`claude` mode is necessary for `stop`/`blocked`, not sufficient. The real
@@ -56,7 +56,7 @@ own head: the worker enforcing the cap is the one who has to be told about it.
56
56
  | synchronize on end of turn | HTTP `wait until=stop` (fires for message-initiated turns too, verified live) |
57
57
  | liveness / death check | HTTP `wait?until=exit` |
58
58
  | interrupt a running turn (break-glass) | HTTP input, a bare `\x1b` with no `\r` |
59
- | non-claude modes (`shell`/`opencode`/`codex`/`gemini`/`antigravity`/`pi`/`grok`/`deepseek`/`omp`/`copilot`) | HTTP only (no other CLI has messaging) |
59
+ | non-claude modes (`shell`/`opencode`/`codex`/`gemini`/`antigravity`/`pi`/`grok`/`deepseek`/`omp`/`copilot`/`jcode`) | HTTP only (no other CLI has messaging) |
60
60
  | delete | HTTP, via SKILL.md's `delete_session` guard |
61
61
 
62
62
  ## Availability: probe, never assume
@@ -352,7 +352,7 @@ Without a break-glass, a pair with a bad brief is a token bonfire with no off sw
352
352
 
353
353
  ### Mixed fleets: the pairing matrix
354
354
 
355
- Non-claude workers (`shell`, `opencode`, `codex`, `gemini`, `antigravity`, `pi`, `grok`, `deepseek`, `omp`, `copilot`) cannot be peers
355
+ Non-claude workers (`shell`, `opencode`, `codex`, `gemini`, `antigravity`, `pi`, `grok`, `deepseek`, `omp`, `copilot`, `jcode`) cannot be peers
356
356
  at all; no other CLI has this feature. Their tasks route over HTTP, and you never mention
357
357
  messaging in their briefs. The claude half of the fleet can use messaging among itself,
358
358
  subject to the namespace rule: **messaging works between two sessions that share one
@@ -21,7 +21,7 @@ by sourcing the preamble file the §0 bootstrap wrote, and checking its version
21
21
 
22
22
  ```bash
23
23
  . "${XDG_CACHE_HOME:-$HOME/.cache}/codeman-agent-$CODEMAN_SESSION_ID.sh" 2>/dev/null
24
- [ "${CODEMAN_PREAMBLE:-}" = 1.50.0 ] || { echo "preamble missing or stale; re-run the §0 bootstrap"; exit 1; }
24
+ [ "${CODEMAN_PREAMBLE:-}" = 1.51.0 ] || { echo "preamble missing or stale; re-run the §0 bootstrap"; exit 1; }
25
25
  ```
26
26
 
27
27
  Do **not** re-paste the preamble body into each call. Sourcing it is what retires the
@@ -188,7 +188,7 @@ for _ in $(seq 1 10); do
188
188
  done
189
189
  printf '%s\n' "$TXT"
190
190
  # (.data is {text,timestamp}; text is also "" before the first completed turn and
191
- # always "" for shell/opencode/gemini/antigravity/pi/grok/omp/copilot, which have no transcript, use
191
+ # always "" for shell/opencode/gemini/antigravity/pi/grok/omp/copilot/jcode, which have no transcript, use
192
192
  # the terminal tail there, and here only to diagnose an unsubmitted prompt.)
193
193
 
194
194
  # 6. clean up: exact id, own list only, through the fail-closed preamble helper
@@ -383,12 +383,17 @@ recovered by submitting it with `{"input":"\r"}`.
383
383
  only when the workspace actually has them, see [§5.1](#51-where-to-spawn)) **and for
384
384
  `deepseek`** — the one external CLI that reports its own lifecycle, so its `stop` is a
385
385
  real end-of-turn signal rather than a guess. On
386
- `shell`/`opencode`/`codex`/`gemini`/`antigravity`/`pi`/`grok`/`omp`/`copilot`, requesting them explicitly is a
386
+ `shell`/`opencode`/`codex`/`gemini`/`antigravity`/`pi`/`grok`/`omp`/`copilot`/`jcode`, requesting them explicitly is a
387
387
  400 (except `blocked` on `codex`, which Codeman reads off its screen when an approval,
388
- question or trust dialog is up; a wait for it answers at once if one already is), and
388
+ question or trust dialog is up; a wait for it answers at once if one already is; and
389
+ `blocked` on a local `omp` session, next paragraph), and
389
390
  lifecycle transitions there are coarse (a short shell command may emit **no**
390
391
  `idle` transition at all, verified live), so synchronize those with markers.
391
392
 
393
+ `blocked` also works on a local `omp` session: Codeman installs a hook module into its
394
+ workspace that reports omp's approval dialogs (the inbox item is alert-only, so answer in
395
+ the pane). `stop` stays a 400 there, so wait on `idle` or a marker for end-of-turn.
396
+
392
397
  ⚠️ A dsh session can still refuse them for a per-SESSION reason: `statusReporting:
393
398
  false` at create time disarms the bridge, and an explicit `until=stop` is then a 400
394
399
  naming that setting. And a `stop` that is *accepted* is not proof it will ever fire —
@@ -437,7 +442,7 @@ from the transcript file, which is flushed slightly *after* the `stop` hook fire
437
442
  single read taken the instant send-and-wait returns comes back `""` even though the
438
443
  turn finished (verified live: empty on the first call, full text seconds later). `text`
439
444
  is also `""` before the worker's first completed turn, and always `""` for modes with
440
- no transcript (`shell`, `opencode`, `gemini`, `antigravity`, `pi`, `grok`, `omp`, `copilot`; the first four
445
+ no transcript (`shell`, `opencode`, `gemini`, `antigravity`, `pi`, `grok`, `omp`, `copilot`, `jcode`; the first four
441
446
  verified live, pi from the same source path), which is
442
447
  why the loop above is bounded rather than open-ended. A dsh worker lags too, for its own
443
448
  reason: the harness finalizes the assistant message just after it reports `idle`. Fall back to the terminal buffer
@@ -526,7 +531,7 @@ turn), and both better than diffing terminal samples:
526
531
  ```
527
532
 
528
533
  ⚠️ `active-tools` is parsed out of Claude's own output format, so it is **empty for
529
- `opencode`/`codex`/`gemini`/`antigravity`/`pi`/`grok`/`deepseek`/`omp`/`copilot`** (those parsers are skipped wholesale) and
534
+ `opencode`/`codex`/`gemini`/`antigravity`/`pi`/`grok`/`deepseek`/`omp`/`copilot`/`jcode`** (those parsers are skipped wholesale) and
530
535
  in practice empty for `shell`. Source-verified, not measured live.
531
536
 
532
537
  Only if neither helps: sample `terminal?tail=` twice a few seconds apart. A changing
@@ -831,9 +836,19 @@ can be spawned now (`running: true`) or once `spawn_worker` has started the runt
831
836
 
832
837
  ```json
833
838
  {"spawnable":true,"state":"installed","running":true,"cli":"opencode","cliLabel":"OpenCode",
834
- "endpointId":"local-ollama","modelId":"qwen3.6:35b-a3b","modelLabel":"Qwen3.6 35B-A3B"}
839
+ "endpointId":"local-ollama","modelId":"qwen3.6:35b-a3b","modelLabel":"Qwen3.6 35B-A3B",
840
+ "agents":[{"cli":"opencode","cliLabel":"OpenCode","status":"ready","default":true,"readyMark":"┃"},
841
+ {"cli":"pi","cliLabel":"Pi","status":"installable","default":false}],
842
+ "models":[{"id":"qwen3.6:35b-a3b","label":"Qwen3.6 35B-A3B","active":true,"status":"ready","sizeGb":"23.1"}]}
835
843
  ```
836
844
 
845
+ `cli` is the default coding agent. `agents` is every agent the model can be run with
846
+ (`install.harnesses` of the route): `ready` can be started, `installable` and `installing`
847
+ are an install a person makes or made in the window, `setup-needed` is an agent with a setup
848
+ of its own (DeepSeek Harness without a terminal profile). `models` is what is on the Mac
849
+ (`install.library`); only the `active` one runs. A Codeman older than 1.51 sends neither
850
+ list, and both keys are then absent.
851
+
837
852
  Exit 1 carries `reason` and `message` (the server's own sentence where it has one):
838
853
 
839
854
  | `reason` | What it means | What to tell the user |
@@ -841,6 +856,7 @@ Exit 1 carries `reason` and `message` (the server's own sentence where it has on
841
856
  | `not-mac` | the server is not on macOS | local models need a Mac with Apple silicon |
842
857
  | `not-installed` | nothing installed; on a Mac where no model fits, `message` says why | install one with **Run a local model** on the welcome screen |
843
858
  | `install-unfinished` | a job is installing, paused or failed (`state`, `step`, `errorCode`) | finish it in that window; nothing here continues it |
859
+ | `no-agent` | installed, and `agents` holds none that is `ready` | install a coding agent in that window (a chip that says "Not installed") |
844
860
  | `blocked` | installed, but the server refuses a session now (`errorCode`: `model-changed`, `port-in-use`, `runtime-start-failed`, `runtime-stopped`) | the window shows the one button that helps |
845
861
  | `admin-only` | multi-user mode, and you are not an admin (403) | ask an admin |
846
862
  | `unsupported` | the server has no local model routes (404) | it predates the feature |
@@ -849,29 +865,44 @@ Exit 1 carries `reason` and `message` (the server's own sentence where it has on
849
865
  It never downloads, installs or starts anything. Installing is many gigabytes the person
850
866
  confirms in the window, and no route this skill calls can do it.
851
867
 
852
- **`spawn_worker <name> local`** (also `name:local` in `spawn_workers`), in order:
868
+ **`spawn_worker <name> local`** (also `name:local` in `spawn_workers`), and
869
+ **`spawn_worker <name> local:<cli>`** to choose the coding agent, in order:
853
870
 
854
- 1. `local_model`; anything but exit 0 fails the spawn with that reason.
871
+ 1. `local_model`; anything but exit 0 fails the spawn with that reason. With `local:<cli>`
872
+ the agent must be a row of `agents` whose status is `ready`; any other status, or an
873
+ agent the model cannot be run with, fails the spawn with the ones that are startable.
874
+ On a Codeman that lists no agents only its one `cli` can be named. No agent is ever
875
+ installed from here.
855
876
  2. Runtime stopped: `POST /api/v1/local-model/runtime {"action":"start"}`, what the
856
877
  window's Start button sends, then `local_model` again until it reports `running`
857
878
  (about 30 s at most). This undoes a Stop the person made. Concurrent spawns may both
858
879
  send it; the server runs one runtime verb at a time and keeps a runtime that runs.
859
880
  3. `POST /api/v1/quick-start {"caseName":…,"mode":"<cli>","parentSessionId":…,
860
881
  "customModel":{"endpointId":…,"modelId":…}}`: the launch of the window's "Start a
861
- session", with the installed agent as the mode. No advisor, which is a cloud model.
882
+ session", with the chosen agent as the mode. No advisor, which is a cloud model. A Pi
883
+ worker also carries `"piConfig":{"approveProjectTrust":false}` (`--no-approve`): on a
884
+ custom model Pi keeps no home, so it would ask to trust the folder in every session with
885
+ Trust preselected, and the task prompt's Enter would answer it.
862
886
  The server checks again that its own runtime runs and that the model on disk is the one
863
887
  it installed, and refuses otherwise (`OPERATION_FAILED`, with the reason).
864
888
  4. An answer of `requiresContextWarning` or `requiresConfirmation` is a question for a
865
889
  person (a context below the agent's safe floor, a model swap that would evict another
866
890
  session's model). It fails the spawn with the answer on stderr and nothing on stdout,
867
891
  and no `confirmed*` flag is ever sent.
868
- 5. Readiness: OpenCode's composer bar `┃` (its registry `promptGlyph`) through
869
- `wait-output`, 45 s, and the session deleted on a miss. Measured on OpenCode 1.3.0 on
870
- Linux (not yet on a Mac) with a fresh home and a custom provider: nothing draws `┃` before the composer, there was no
871
- first-run screen, and a prompt pasted with its Enter at the first `┃` was submitted. A
872
- claude agent takes the claude path instead (hooks vetted, `shift+tab`, the trust
873
- dialog). Any other agent needs `LOCAL_READY_MARK` set to a space-free token its
874
- composer draws, or the spawn is refused before a session exists.
892
+ 5. Readiness: a token the agent's composer draws once it takes input, through
893
+ `wait-output`, 45 s, and the session deleted on a miss. The token is the agent's
894
+ `readyMark` from `local_model` when the server sends one, else the one measured for this
895
+ skill, and `LOCAL_READY_MARK` overrides both. All of it was measured on Linux through a
896
+ custom model launch, none of it on a Mac yet:
897
+
898
+ | Agent | Token | What was measured |
899
+ |-------|-------|-------------------|
900
+ | OpenCode | `┃` | 1.3.0 and 1.19.5: nothing draws it before the composer, no first-run screen, and a prompt pasted at the first `┃` was submitted (2 of 2 on 1.19.5) |
901
+ | DeepSeek Harness | `❯`, then a look at the pane | 0.1.1-rc.2 with dsh-TUI 0.10.0-beta.1: splash, composer and status line arrive in one frame; a prompt sent at the mark was submitted (2 of 2). The harness reports idle about 150 ms BEFORE that frame, so `stop` is no readiness signal. 0.2.2-rc.1 with dsh-TUI 0.19.0: a setup guide ("Step 1 of 4") opens in every session until a person has finished it once, and its cursor is `❯` too (the mark matched on it, 2 of 2), so after the mark the rendered pane is read and a worker that shows the guide is deleted, never handed back; with the guide finished, a prompt sent at the mark was submitted |
902
+ | Pi | `extended-keys` | 1.5.2: Pi paints its composer rules in its first frame and ignores Enter until startup has finished, so the rule `─` is NOT a mark (a prompt sent at it stayed in the composer, 2 of 2). The last line of its startup is a warning that tmux's `extended-keys` option is off, which it is on Codeman's socket; a prompt sent once that word showed was submitted (4 of 4). A side effect, not a contract: a Pi that stops printing it fails the spawn until `LOCAL_READY_MARK` names what it draws instead |
903
+
904
+ A claude agent takes the claude path instead (hooks vetted, `shift+tab`, the trust
905
+ dialog). An agent with no token at all is refused before a session exists.
875
906
 
876
907
  **`sendmark <sid> <prompt> [timeoutSec]`** drives it, and any other agent worker without
877
908
  an end-of-turn signal ([§5.5](#55-markers-for-hook-less-workers)):
Binary file
Binary file