samagotchi 0.152.0 → 0.154.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 (229) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +45 -1
  3. data/README.md +2 -3
  4. data/bin/chi +23 -24
  5. data/docs/architecture.md +30 -33
  6. data/docs/broadcast.md +5 -5
  7. data/docs/bundle-authoring.md +1 -1
  8. data/docs/bundles.md +93 -12
  9. data/docs/cli.md +83 -99
  10. data/docs/configuration.md +46 -40
  11. data/docs/context.md +3 -3
  12. data/docs/desktop.md +1 -1
  13. data/docs/guardrails.md +15 -15
  14. data/docs/hooks.md +13 -12
  15. data/docs/internals/anthropic.md +3 -3
  16. data/docs/internals/attached-context.md +5 -2
  17. data/docs/internals/background-tasks.md +3 -4
  18. data/docs/internals/block-renderers.md +4 -0
  19. data/docs/internals/bridge.md +3 -3
  20. data/docs/internals/context-telemetry.md +1 -1
  21. data/docs/internals/engine.md +42 -12
  22. data/docs/internals/objectives.md +6 -5
  23. data/docs/internals/participants.md +8 -8
  24. data/docs/internals/prompt-caching.md +8 -4
  25. data/docs/internals/remote-sessions.md +7 -7
  26. data/docs/internals/web-frontend.md +20 -17
  27. data/docs/internals/web-push.md +1 -1
  28. data/docs/memory.md +2 -2
  29. data/docs/plugins.md +52 -43
  30. data/docs/releasing.md +1 -1
  31. data/docs/sessions.md +25 -25
  32. data/docs/sub-agent.md +2 -2
  33. data/docs/system-one.md +1 -1
  34. data/docs/testing.md +18 -8
  35. data/lib/samagotchi/answer_text.rb +34 -0
  36. data/lib/samagotchi/bridge.rb +43 -32
  37. data/lib/samagotchi/bridge_client.rb +10 -9
  38. data/lib/samagotchi/broadcast/recipients.rb +2 -2
  39. data/lib/samagotchi/broadcast/triage.rb +1 -1
  40. data/lib/samagotchi/broadcast_command.rb +5 -5
  41. data/lib/samagotchi/bundle_command/try/command.rb +1 -1
  42. data/lib/samagotchi/bundle_command/try/run.rb +1 -1
  43. data/lib/samagotchi/bundle_command.rb +2 -2
  44. data/lib/samagotchi/bundles/decision-card/manifest.yml +4 -4
  45. data/lib/samagotchi/bundles/decision-card/plugin.rb +1 -9
  46. data/lib/samagotchi/bundles/dev/manifest.yml +2 -2
  47. data/lib/samagotchi/bundles/system/config_modification_protocol.md +3 -4
  48. data/lib/samagotchi/bundles/system/manifest.yml +3 -3
  49. data/lib/samagotchi/bundles/system/self_map.md +1 -1
  50. data/lib/samagotchi/bundles/web-search/manifest.yml +13 -0
  51. data/lib/samagotchi/bundles/web-search/plugin.rb +174 -0
  52. data/lib/samagotchi/child_move.rb +3 -3
  53. data/lib/samagotchi/commands/registry.rb +6 -6
  54. data/lib/samagotchi/composer_route.rb +4 -5
  55. data/lib/samagotchi/config.rb +14 -12
  56. data/lib/samagotchi/context_candidate_choice.rb +1 -1
  57. data/lib/samagotchi/context_candidates.rb +4 -3
  58. data/lib/samagotchi/continue_offer.rb +1 -1
  59. data/lib/samagotchi/debug_log.rb +1 -1
  60. data/lib/samagotchi/degrade.rb +75 -0
  61. data/lib/samagotchi/desktop/macos/ChiRunner.swift +2 -2
  62. data/lib/samagotchi/engine/cards.rb +87 -0
  63. data/lib/samagotchi/engine/context_judge.rb +138 -0
  64. data/lib/samagotchi/engine/events.rb +131 -0
  65. data/lib/samagotchi/engine/guardrails.rb +87 -0
  66. data/lib/samagotchi/engine/hooks.rb +119 -0
  67. data/lib/samagotchi/engine/messages.rb +124 -0
  68. data/lib/samagotchi/engine/model_settings.rb +127 -0
  69. data/lib/samagotchi/engine/models.rb +261 -0
  70. data/lib/samagotchi/engine/objectives.rb +116 -0
  71. data/lib/samagotchi/engine/participants.rb +86 -0
  72. data/lib/samagotchi/engine/plugins.rb +208 -0
  73. data/lib/samagotchi/engine/questions.rb +98 -0
  74. data/lib/samagotchi/engine/recap.rb +130 -0
  75. data/lib/samagotchi/engine/session.rb +131 -0
  76. data/lib/samagotchi/engine/side_requests.rb +135 -0
  77. data/lib/samagotchi/engine/steering.rb +134 -0
  78. data/lib/samagotchi/engine/toolkit.rb +269 -0
  79. data/lib/samagotchi/engine/turn_end.rb +180 -0
  80. data/lib/samagotchi/engine/turn_helpers.rb +160 -0
  81. data/lib/samagotchi/engine/verify.rb +153 -0
  82. data/lib/samagotchi/engine.rb +63 -2642
  83. data/lib/samagotchi/grants.rb +575 -0
  84. data/lib/samagotchi/guardrail_wiring.rb +2 -2
  85. data/lib/samagotchi/guardrails/context.rb +2 -3
  86. data/lib/samagotchi/guardrails/parent_approvals.rb +2 -2
  87. data/lib/samagotchi/guardrails/parent_policy.rb +2 -2
  88. data/lib/samagotchi/guardrails/review_boundary.rb +4 -3
  89. data/lib/samagotchi/hook_routes.rb +3 -3
  90. data/lib/samagotchi/idle_recap.rb +4 -5
  91. data/lib/samagotchi/idle_reminders.rb +3 -4
  92. data/lib/samagotchi/iteration_limit.rb +2 -2
  93. data/lib/samagotchi/kernel_loop.rb +10 -11
  94. data/lib/samagotchi/launch_mode.rb +13 -32
  95. data/lib/samagotchi/level_setting_command.rb +3 -2
  96. data/lib/samagotchi/llm_context_command.rb +3 -2
  97. data/lib/samagotchi/llm_context_stale.rb +2 -2
  98. data/lib/samagotchi/log.rb +7 -7
  99. data/lib/samagotchi/log_line.rb +1 -1
  100. data/lib/samagotchi/log_path.rb +1 -1
  101. data/lib/samagotchi/message_parts.rb +3 -2
  102. data/lib/samagotchi/note_command.rb +1 -1
  103. data/lib/samagotchi/note_delivery.rb +18 -8
  104. data/lib/samagotchi/objectives.rb +24 -3
  105. data/lib/samagotchi/objectives_check.rb +8 -27
  106. data/lib/samagotchi/objectives_command.rb +4 -69
  107. data/lib/samagotchi/objectives_edit.rb +87 -0
  108. data/lib/samagotchi/output_formatter.rb +7 -1
  109. data/lib/samagotchi/owner_lock.rb +7 -1
  110. data/lib/samagotchi/parent_answers_command.rb +5 -4
  111. data/lib/samagotchi/participant_exposure.rb +42 -0
  112. data/lib/samagotchi/participant_mode.rb +1 -1
  113. data/lib/samagotchi/participant_name.rb +1 -1
  114. data/lib/samagotchi/participants.rb +17 -17
  115. data/lib/samagotchi/participants_watch.rb +1 -1
  116. data/lib/samagotchi/pending_input_queue.rb +2 -2
  117. data/lib/samagotchi/plugin/api.rb +3 -2
  118. data/lib/samagotchi/plugin/context.rb +21 -7
  119. data/lib/samagotchi/plugin/peer.rb +2 -1
  120. data/lib/samagotchi/plugin/sessions.rb +6 -4
  121. data/lib/samagotchi/plugin_tasks.rb +1 -2
  122. data/lib/samagotchi/private_files.rb +29 -0
  123. data/lib/samagotchi/project_env.rb +2 -2
  124. data/lib/samagotchi/question_desk.rb +8 -7
  125. data/lib/samagotchi/recap_command.rb +2 -1
  126. data/lib/samagotchi/recap_setup.rb +1 -1
  127. data/lib/samagotchi/recap_store.rb +1 -1
  128. data/lib/samagotchi/redact.rb +86 -0
  129. data/lib/samagotchi/reminder_queue.rb +2 -2
  130. data/lib/samagotchi/remote_attach_command.rb +1 -1
  131. data/lib/samagotchi/reply_wait/poll.rb +2 -2
  132. data/lib/samagotchi/review_start.rb +1 -1
  133. data/lib/samagotchi/run_options.rb +6 -6
  134. data/lib/samagotchi/self_report.rb +42 -39
  135. data/lib/samagotchi/send_command/busy.rb +1 -1
  136. data/lib/samagotchi/send_command.rb +4 -1
  137. data/lib/samagotchi/session.rb +11 -2
  138. data/lib/samagotchi/session_access/contract.rb +3 -3
  139. data/lib/samagotchi/session_access/local.rb +9 -9
  140. data/lib/samagotchi/session_access/remote.rb +17 -7
  141. data/lib/samagotchi/session_access.rb +4 -4
  142. data/lib/samagotchi/session_archive_command.rb +2 -2
  143. data/lib/samagotchi/session_chain.rb +8 -6
  144. data/lib/samagotchi/session_commands.rb +45 -48
  145. data/lib/samagotchi/session_continue.rb +1 -1
  146. data/lib/samagotchi/session_delete_command.rb +4 -4
  147. data/lib/samagotchi/session_manager.rb +59 -36
  148. data/lib/samagotchi/session_metrics.rb +2 -2
  149. data/lib/samagotchi/session_model_settings.rb +3 -2
  150. data/lib/samagotchi/session_participants.rb +1 -1
  151. data/lib/samagotchi/session_retention.rb +3 -3
  152. data/lib/samagotchi/sessions_command.rb +4 -4
  153. data/lib/samagotchi/share_command.rb +10 -10
  154. data/lib/samagotchi/steer.rb +1 -1
  155. data/lib/samagotchi/system_prompt.rb +102 -109
  156. data/lib/samagotchi/task_watch.rb +1 -1
  157. data/lib/samagotchi/terminal_ui/attach_launcher.rb +72 -10
  158. data/lib/samagotchi/terminal_ui/attached_loop/composer.rb +12 -9
  159. data/lib/samagotchi/terminal_ui/attached_loop/exit_commands.rb +16 -0
  160. data/lib/samagotchi/terminal_ui/attached_loop/questions.rb +2 -3
  161. data/lib/samagotchi/terminal_ui/attached_loop.rb +17 -8
  162. data/lib/samagotchi/terminal_ui/attached_view.rb +2 -3
  163. data/lib/samagotchi/terminal_ui/event_renderer.rb +3 -5
  164. data/lib/samagotchi/terminal_ui/formatting.rb +7 -7
  165. data/lib/samagotchi/terminal_ui/input_support.rb +1 -7
  166. data/lib/samagotchi/terminal_ui/line_reader.rb +2 -2
  167. data/lib/samagotchi/terminal_ui/live_region.rb +2 -2
  168. data/lib/samagotchi/terminal_ui/log_tail.rb +135 -0
  169. data/lib/samagotchi/terminal_ui/one_shot_sink.rb +2 -2
  170. data/lib/samagotchi/terminal_ui/plain_surface.rb +1 -1
  171. data/lib/samagotchi/terminal_ui/question_prompt.rb +4 -5
  172. data/lib/samagotchi/terminal_ui/reline_seam.rb +3 -3
  173. data/lib/samagotchi/terminal_ui/status_row.rb +7 -8
  174. data/lib/samagotchi/terminal_ui.rb +142 -1387
  175. data/lib/samagotchi/title_command.rb +2 -2
  176. data/lib/samagotchi/tool_runner.rb +14 -16
  177. data/lib/samagotchi/toolkit.rb +8 -5
  178. data/lib/samagotchi/toolkit_binding.rb +30 -5
  179. data/lib/samagotchi/toolkit_command.rb +2 -1
  180. data/lib/samagotchi/toolkit_report_command.rb +9 -5
  181. data/lib/samagotchi/toolkit_suggest.rb +12 -6
  182. data/lib/samagotchi/tools/builtin_calls.rb +14 -10
  183. data/lib/samagotchi/tools/deferred_tools.rb +2 -2
  184. data/lib/samagotchi/tools/delegate.rb +3 -1
  185. data/lib/samagotchi/tools/delegate_cursor.rb +3 -3
  186. data/lib/samagotchi/tools/delegate_wait.rb +1 -1
  187. data/lib/samagotchi/tools/objectives_tool.rb +2 -2
  188. data/lib/samagotchi/tools/registry.rb +44 -20
  189. data/lib/samagotchi/tools/send_note.rb +2 -1
  190. data/lib/samagotchi/tools/tool_index.rb +27 -21
  191. data/lib/samagotchi/turn_endings.rb +2 -2
  192. data/lib/samagotchi/turn_flow.rb +4 -5
  193. data/lib/samagotchi/update_hint.rb +2 -2
  194. data/lib/samagotchi/version.rb +1 -1
  195. data/lib/samagotchi/web/app.rb +39 -50
  196. data/lib/samagotchi/web/participant_access.rb +2 -2
  197. data/lib/samagotchi/web/participant_review.rb +5 -5
  198. data/lib/samagotchi/web/participant_stream_filter.rb +8 -8
  199. data/lib/samagotchi/web/participant_view.rb +2 -82
  200. data/lib/samagotchi/web/participants_admin.rb +1 -1
  201. data/lib/samagotchi/web/public/app.js +61 -357
  202. data/lib/samagotchi/web/public/block_host.js +35 -8
  203. data/lib/samagotchi/web/public/block_renderers.css +9 -5
  204. data/lib/samagotchi/web/public/chains.js +2 -2
  205. data/lib/samagotchi/web/public/claim_link.js +4 -4
  206. data/lib/samagotchi/web/public/composer_mode.js +110 -0
  207. data/lib/samagotchi/web/public/format.js +3 -3
  208. data/lib/samagotchi/web/public/owner_claim.js +81 -0
  209. data/lib/samagotchi/web/public/owner_verify.js +112 -0
  210. data/lib/samagotchi/web/public/session_fields.js +3 -3
  211. data/lib/samagotchi/web/public/strip_grip.js +3 -3
  212. data/lib/samagotchi/web/public/strip_hidden.js +65 -0
  213. data/lib/samagotchi/web/public/version_notices.js +132 -0
  214. data/lib/samagotchi/web/push/store.rb +1 -1
  215. data/lib/samagotchi/web/session_access_routes.rb +5 -4
  216. data/lib/samagotchi/web/session_control.rb +12 -8
  217. data/lib/samagotchi/web/session_create.rb +1 -1
  218. data/lib/samagotchi/web/session_hub.rb +2 -2
  219. data/lib/samagotchi/web/session_show.rb +2 -2
  220. data/lib/samagotchi/web/session_summary.rb +1 -1
  221. data/lib/samagotchi/worker.rb +106 -9
  222. data/lib/samagotchi/worker_link.rb +3 -3
  223. data/lib/samagotchi/working_set_command.rb +3 -2
  224. metadata +36 -6
  225. data/lib/samagotchi/terminal_ui/between_turns.rb +0 -138
  226. data/lib/samagotchi/terminal_ui/repl_input.rb +0 -152
  227. data/lib/samagotchi/web/grants.rb +0 -575
  228. data/lib/samagotchi/web/participant_exposure.rb +0 -44
  229. data/lib/samagotchi/web/private_files.rb +0 -31
data/docs/bundles.md CHANGED
@@ -18,11 +18,8 @@ only against this API (`lib/samagotchi/bundles/btw/plugin.rb`).
18
18
  - The card's **Keep as session** runs `/btw keep <id>`. It forks the
19
19
  conversation, the question and the answer into an idle child session, and
20
20
  shows a card `kept as <id>`.
21
- - The last 10 answers can be kept, while the session's worker (or REPL)
22
- runs. After that, or after a restart, `keep` says expired.
23
- - In the REPL, a question asked during a turn is about the conversation
24
- before that turn, and the card says so. In a worker it includes the turn
25
- so far.
21
+ - The last 10 answers can be kept, while the session's worker runs. After that, or after a restart, `keep` says expired.
22
+ - A question asked during a turn includes the turn so far.
26
23
  - Settings: `bundles: btw: {max_tokens: 1024, timeout: 120}`.
27
24
  - It ships no memory, so it adds no line to the prompt's memory index. Its
28
25
  0.1.0 shipped `btw.md` as one, and `chi bundle upgrade btw` leaves that file
@@ -225,6 +222,90 @@ bundles:
225
222
  tools, or with different args, stay distinct, since the tool is in the
226
223
  args).
227
224
 
225
+ ## The web-search bundle
226
+
227
+ `chi bundle install web-search` installs the bundle shipped with chi (`lib/samagotchi/bundles/web-search/plugin.rb`).
228
+ No profile includes it, since it needs a running [SearXNG](https://docs.searxng.org), so `chi update` lists it as
229
+ not installed until you install it. It gives the model one tool, `web_search`, which asks your SearXNG through its
230
+ JSON API. `web_fetch` fetches a URL but can't find one; `web_search` finds them, and the model then reads the ones it
231
+ wants with `web_fetch`. It is an ordinary plugin tool, so it works on every host and loop.
232
+
233
+ - **The tool:** `web_search(query, time_range?, page?)`. `time_range` is `day`, `week`, `month` or `year`; `page`
234
+ starts at 1. It returns plain text: a header, the first answer SearXNG gives (if any), a numbered list of results
235
+ (title, URL, and a snippet of at most 300 characters), and SearXNG's suggestions:
236
+
237
+ ```
238
+ SearXNG results for "ruby prism parser" (page 1):
239
+ 1. Prism — Ruby parser
240
+ https://github.com/ruby/prism
241
+ A portable, error-tolerant Ruby parser…
242
+ Suggestions: ruby prism gem, prism vs parser
243
+ ```
244
+
245
+ With nothing found it says `No results for "<query>".` and names the engines that failed. A SearXNG that can't be
246
+ reached, a 403 (JSON not enabled), a 429 (its limiter) or an answer that isn't JSON each give an `Error:` line that
247
+ says what to fix.
248
+
249
+ ```yaml
250
+ # config.yml
251
+ bundles:
252
+ web-search:
253
+ url: http://127.0.0.1:8888 # the SearXNG root
254
+ max_results: 8 # results listed, 1..20
255
+ timeout: 10 # seconds per read
256
+ # optional, sent only when set:
257
+ language: en
258
+ safesearch: 0 # 0, 1 or 2
259
+ categories: general # comma-separated
260
+ engines: duckduckgo,brave # comma-separated
261
+ ```
262
+
263
+ | key | default | |
264
+ |---|---|---|
265
+ | `url` | `http://127.0.0.1:8888` | the SearXNG root, `http` or `https` with a host; a trailing `/` is fine |
266
+ | `max_results` | `8` | clamped to 1..20 |
267
+ | `timeout` | `10` | seconds; a value that isn't a positive number uses the default |
268
+ | `language` | unset | unset (the default): SearXNG picks the language from the query; set it (e.g. `en`) to force one; dates and some results may follow your region |
269
+ | `safesearch` | unset | `0`, `1` or `2` |
270
+ | `categories`, `engines` | unset | comma-separated. SearXNG silently drops names it doesn't know, so a typo gives its defaults |
271
+
272
+ - **Privacy:** the query goes to your SearXNG and on to the engines it is configured with. No guardrail rule asks
273
+ about it by default; add one (`tool: web_search`, `verdict: ask`) if you want to approve each search. A review
274
+ turn can't call it.
275
+ - **Toolkits:** the tool follows a kit's list like a built-in ([Toolkits](configuration.md#toolkits)). `full` (and
276
+ any kit on `base: full`) declares it (about 150 tokens per request); on `lean`, `child` and the kits built on them
277
+ it is reachable, not declared: the model finds it with `find_tools` (`chi/web_search`) and calls it with
278
+ `call_tool` (on `api: anthropic` it goes deferred and is called by name). To declare it on such a kit, `add:` it
279
+ (or `/toolkit add web_search` in a session); to keep it away entirely, `remove:` it (or `/toolkit remove
280
+ web_search`).
281
+
282
+ ```yaml
283
+ toolkit:
284
+ default: search
285
+ kits:
286
+ search: { base: lean, add: [web_search] }
287
+ quiet: { base: full, remove: [web_search] }
288
+ ```
289
+
290
+ ### Running SearXNG locally
291
+
292
+ ```sh
293
+ mkdir -p searxng
294
+ cat > searxng/settings.yml <<'YAML'
295
+ use_default_settings: true
296
+ server:
297
+ secret_key: "change-me-to-a-random-string" # openssl rand -hex 32
298
+ limiter: false # a local instance: no rate limiting (else 429s)
299
+ search:
300
+ formats: [html, json] # json is off by default (else 403)
301
+ YAML
302
+ docker run -d --name searxng -p 127.0.0.1:8888:8080 -v ./searxng:/etc/searxng searxng/searxng
303
+ ```
304
+
305
+ The port is bound to loopback, not the LAN. Under colima, run it from a folder in your home directory: colima
306
+ shares only that with its VM by default, and elsewhere SearXNG starts on its own default settings (JSON off).
307
+ `curl 'http://127.0.0.1:8888/search?q=ruby&format=json'` should answer JSON.
308
+
228
309
  ## The loop-guard bundle
229
310
 
230
311
  `chi bundle install loop-guard` installs the bundle shipped with chi (`chi
@@ -719,7 +800,7 @@ file; skills themselves work without it ([docs/memory.md](memory.md#skills)).
719
800
 
720
801
  | | |
721
802
  |---|---|
722
- | `/skill save [name] [--system]` | sends this session a request to save what was just done as `skill_<name>` (chi picks a name when none is given), project scope unless `--system`. The request holds the skill's shape, so the result is the same with a model that never read the memory guide. It runs as a turn; sent while a turn runs, it joins that turn at its next step (the request says to finish the task first). An existing skill is updated. In a `--no-shared` REPL, which takes no messages, the command shows the request to send yourself |
803
+ | `/skill save [name] [--system]` | sends this session a request to save what was just done as `skill_<name>` (chi picks a name when none is given), project scope unless `--system`. The request holds the skill's shape, so the result is the same with a model that never read the memory guide. It runs as a turn; sent while a turn runs, it joins that turn at its next step (the request says to finish the task first). An existing skill is updated. When the session can't take a message (a `--non-interactive` one-shot's), the command shows the request to send yourself |
723
804
  | `/skill list` | the `skill_*` memories of both scopes, with the date and description from the index |
724
805
  | `/skill show <name>` | one skill as saved (project first, as `memory_read` looks) |
725
806
  | `/skill diff <name> [N]` | the skill now against its N-th newest older version (default 1: before the last change), unified |
@@ -785,7 +866,7 @@ and a summary of what changed in counts, authors and states only; it wakes
785
866
  the session for a review requesting changes, checks turning red, or the PR
786
867
  merged or closed. In the web, a `path:line` in a worker's answer links to
787
868
  that line of the session's PR ([Line links](context.md#line-links); `line_links:
788
- always` for the REPL and `chi -p` too), and its ref menu offers the file
869
+ always` for a `chi -p … --non-interactive` one-shot too), and its ref menu offers the file
789
870
  here and a "PR diff" action (`event[:refs]`). `auto_attach: attach` attaches
790
871
  it at once (the old default), `off` does nothing ([Propose, attach or
791
872
  off](context.md#propose-attach-or-off)).
@@ -800,9 +881,9 @@ chi bundle install coordinator # in the dev profile
800
881
  chi as a coordinator of parallel work, the way you would run several agents
801
882
  yourself: split the work, one git worktree and child session per task, keep
802
883
  talking while they run, check each report, and merge only when you allow it. It
803
- works in a session with a worker (plain `chi`, the web). A `--no-shared` REPL
804
- or `-p` gets no delegate reports, so the children's replies wouldn't come back
805
- by themselves there.
884
+ works in a session with a worker (plain `chi`, `chi -p`, the web). A
885
+ `--non-interactive` one-shot gets no delegate reports, so the children's
886
+ replies wouldn't come back by themselves there.
806
887
 
807
888
  - **The skill.** `skill_coordinator` (system scope; its index line says what
808
889
  it is for, from the manifest's `description:`) holds the steps. The model
@@ -831,8 +912,8 @@ by themselves there.
831
912
  reads the open handoff, checks it against git and the session list (git
832
913
  wins; mismatches are reported) and goes on from the first open step.
833
914
  - **`/coordinate <goal>`** sends this session a turn asking the model to
834
- follow the skill for the goal (in a `--no-shared` REPL it shows the text to
835
- send yourself). Asking "do this in parallel" works too: the index line leads
915
+ follow the skill for the goal (when the session can't take a message, as
916
+ in a `--non-interactive` one-shot, it shows the text to send yourself). Asking "do this in parallel" works too: the index line leads
836
917
  the model to the skill. **`/coordinate resume`** asks it to resume this
837
918
  project's open handoff; with several open it shows a card with a Resume
838
919
  action each (`/coordinate resume <name>` picks one), with none it says so.
data/docs/cli.md CHANGED
@@ -1,4 +1,4 @@
1
- # CLI and REPL
1
+ # CLI and terminal
2
2
 
3
3
  ## Commands
4
4
 
@@ -7,8 +7,7 @@
7
7
  - `chi -p "your prompt"` — run a prompt, then stay attached
8
8
  - `chi -p "your prompt" --non-interactive` — run a prompt, print the answer, exit
9
9
  - `chi --resume <session-id>` — resume a prior session (in its worker)
10
- - `chi --no-shared [--resume <session-id>]` — the plain in-process REPL instead, for this run
11
- - `chi scratch [options]` — a one-time session in the plain in-process REPL, in this folder, that leaves nothing behind (see [Scratch sessions](#scratch-sessions))
10
+ - `chi scratch [options]` — a one-time session in this folder, attached like plain `chi`, that leaves nothing behind (see [Scratch sessions](#scratch-sessions))
12
11
  - `chi --attach <session-id>` — attach the terminal to a session's worker (e.g. one started from the Web UI), waking one if it has exited
13
12
  - A session id can be shortened to any unique prefix (like git): `chi --attach 2ea8`. `--resume`, `--attach`, `sessions stop`, `sessions archive` and `sessions delete` take one; an ambiguous prefix lists the sessions it matches.
14
13
  - `chi web [--port 4567] [--open] [--scope=all] [--start-dir DIR]` — start the Web UI (single localhost port session control plane) on this git project's sessions (`--scope=all`, or a folder in no repo: `/?scope=all`, every session); if a chi web already runs on the port, print (with `--open`, open) its page for this folder and exit. Something else on the port (an older chi web too) exits 1 with "port N is in use"
@@ -41,7 +40,7 @@
41
40
  - `chi guardrails replay [--dry-run] [--threshold T] [--model M]` — seed System 1's record from the approvals this machine's sessions already answered: each ask is judged by the configured model and written to `guardrails/judgments.jsonl` with the answer the user gave, then a per-rule table prints (asks, allowed, denied, would-be auto-allows, false allows, asks with no judgment). A parent agent's answer is not the user's: only its deny is replayed, and only where the parent could have allowed. `--dry-run` judges without writing, `--threshold` overrides `guardrails.system_one.threshold` for the table, `--model` the configured model for this run. Exit 2 when `guardrails.system_one.mode` is off or no `host` is set; a usage error exits 2 (see [System 1](guardrails.md#system-1-experimental))
42
41
  - `chi guardrails rule <id>` — print exactly `asks` when that rule is loaded, not disabled and votes `ask` in this `guardrails.mode` for every model; any other line says why not (no such rule, disabled, another mode, it denies, for some models only, rules that failed to load, `guardrails.enabled: false`). Exit 0 either way, 2 for a usage error. It reads config.yml and the installed bundles as a worker does (`GuardrailWiring#rules`) and takes the rule's id, never a command; the [coordinator skill](bundles.md#the-coordinator-bundle) reads it before it merges without asking
43
42
  - `chi judgments ls` / `chi judgments report NAME [--days N]` — what [System 1's saved runs](system-one.md) hold: each judgment's digests, runs, labels, failures, models and size; one judgment's counts, p histogram and labels by value. Reads only; local only; `--days` must be a positive whole number.
44
- - `chi toolkit report [--days N]` — grade toolkit suggestions: the kit on mode would have run (the suggested kit when it would have applied it, else the default; an on-mode line's `did` says what it ran) against the tools the session called from that turn on (only that turn when the toolkit was chosen since), `call_tool` targets included, for both the chat and the raw-prompt loop. Each is *covers*, *short of a tool* (naming the tools), *wider than needed* (a narrower kit offered in the same ask would also have covered) or *ungradable* (calls it can't read back); then a per-kit tally with what on mode would have done. Includes archived sessions and caps the report at 14 days and 500 sessions. Reads `toolkit_suggestions.jsonl` (each ask logs every offered kit's rules, expanded against the called tools here); it never runs the model or changes a session. Local only; `--days` must be a positive whole number.
43
+ - `chi toolkit report [--days N]` — grade toolkit suggestions: the kit on mode would have run (the suggested kit when it would have applied it, else the default; an on-mode line's `did` says what it ran) against the tools the session called from that turn on (only that turn when the toolkit was chosen since), `call_tool` targets included, for both the chat and the raw-prompt loop. Each is *covers*, *short of a tool* (naming the tools; a built-in or plugin tool the kit left reachable but didn't declare counts), *wider than needed* (a narrower kit offered in the same ask would also have covered) or *ungradable* (calls it can't read back); then a per-kit tally with what on mode would have done. Includes archived sessions and caps the report at 14 days and 500 sessions. Reads `toolkit_suggestions.jsonl` (each ask logs every offered kit's rules, expanded against the called tools here); it never runs the model or changes a session. Local only; `--days` must be a positive whole number.
45
44
 
46
45
  - `chi bundle try PATH -p TEXT [options]` — install a bundle in a temporary, filtered sandbox, run one real model turn,
47
46
  and print its trace (see [Trying a bundle](#trying-a-bundle)).
@@ -441,17 +440,15 @@ invalid option (exit 1).
441
440
 
442
441
  | Flag | Purpose |
443
442
  |------|---------|
444
- | `-p`, `--prompt TEXT` | Feed `TEXT` as the first turn (also prefill-equivalent; `-p` feeds **and** runs). |
445
- | `--non-interactive` | Run a single turn then exit the REPL (sets a high iteration cap; implies `--no-interrupt`). Harmless no-op when given without `-p`. |
443
+ | `-p`, `--prompt TEXT` | Run `TEXT` as the first turn, then stay attached to the session (`-p` feeds **and** runs); with `--non-interactive`, one turn and exit. |
444
+ | `--non-interactive` | Run the `-p` prompt as one turn in this process, then exit: no worker, no TUI (sets a high iteration cap; implies `--no-interrupt`). Harmless no-op when given without `-p`. |
446
445
  | `--resume SESSION_ID` | Load a prior session's history instead of creating a fresh one. |
447
- | `--shared` | Run the session (new, or `--resume`'s) in a background worker and attach to it: the default, and the way to get it when `session.shared` is off. See [Sharing a session](#sharing-a-session). |
448
- | `--no-shared` | Run the plain in-process REPL for this run. |
449
446
  | `--attach SESSION_ID` | Attach to a session's worker, waking one if it has exited. |
450
447
  | `--remote NAME` | Before a session command (`chi --remote studio send …`) or the run flags (`chi --remote studio --attach ID`, `--resume ID`, `--dir DIR -p TEXT`): run it against that remote's sessions, through its chi web; beats `CHI_REMOTE`. Commands and flags that run on this machine only exit 2. See [Remote sessions](#remote-sessions). |
451
448
  | `--dir DIR` | With `--remote`: a new session's folder on that machine, its absolute path (required for a new session there). Without `--remote` it exits 2: cd there instead. |
452
449
  | `--model NAME` | Use this model for the run (overrides the configured default and a resumed session's model). |
453
450
  | `--thinking LEVEL` | This session's own thinking level: `off`, `low`, `medium` or `high`, saved in the session and first in the order (`default` unsets it). On `--resume` or `--attach` it is set at once, through a `/thinking` on an attached worker. With `chi web` it is instead the default for the sessions its workers run, below a session's own (as env `SAMAGOTCHI_THINKING_LEVEL` is). See "Thinking" in configuration.md. |
454
- | `--toolkit NAME`, `--tool NAME`, `--no-tool NAME` | A new session's toolkit, the tools its prompts declare: `full` (every built-in), `lean`, `child`, one of config's `toolkit.kits` or a bundle's (without `--toolkit`: config's `toolkit.default`), with tools declared on top of it (`--tool`) or left out (`--no-tool`); both repeatable, a comma list too. Saved in the session as given; a respawned worker, a fork and a continue keep it. Ignored with `--attach`/`--resume` (one line, as `--memory`); `/toolkit` changes it. Not on `chi web` (config's `toolkit.default` covers its sessions). See [Toolkits](configuration.md#toolkits). |
451
+ | `--toolkit NAME`, `--tool NAME`, `--no-tool NAME` | A new session's toolkit, the tools its prompts declare: `full` (every built-in and plugin tool), `lean`, `child`, one of config's `toolkit.kits` or a bundle's (without `--toolkit`: config's `toolkit.default`), with tools declared on top of it (`--tool`) or left out (`--no-tool`); both repeatable, a comma list too. Saved in the session as given; a respawned worker, a fork and a continue keep it. Ignored with `--attach`/`--resume` (one line, as `--memory`); `/toolkit` changes it. Not on `chi web` (config's `toolkit.default` covers its sessions). See [Toolkits](configuration.md#toolkits). |
455
452
  | `--parent-answers LEVEL` | A new session's own `guardrails.parent_answers` (`hard`, `standard` or `soft`): what a parent agent may answer on its questions. It may only tighten config.yml's: the stricter of the two applies, and a looser one is saved as given with a warning (`--parent-answers soft is looser than config.yml's guardrails.parent_answers: standard; standard applies`). Saved in the session; a respawned worker, a fork and a continue keep it, a `delegate` child takes its parent's. Ignored with `--attach`/`--resume` (one line, as `--toolkit`); refused with `chi web`. Only you loosen it: `/parent-answers` in the terminal or the web. See [Guardrails](guardrails.md#answers-from-a-parent-agent). |
456
453
  | `--set KEY=VALUE` | A setting for a new session (repeatable; a later one of the same key wins). A core key a session may set (`recap.enabled`, `recap.sentences`) is typed by the key and goes first, over the CLI, env and config.yml: `--set recap.enabled=false` turns the idle recap off for this session; a value it doesn't take (`recap.enabled=maybe`) or a key no session sets (`guardrails.mode`) is an error, exit 2 (see [Per-session settings](configuration.md#per-session-settings)). Any other name is a bundle's `BUNDLE.KEY`, laid over config.yml's `bundles: <bundle>:` in what the bundle's plugin reads (`ctx.settings`): `--set cost-cap.cap=3`. The value is typed simply: an integer (`3`, `-1`) or a decimal (`2.5`, `.5`, `1e1`) is a number, `true`, `yes` and `on` are true, `false`, `no` and `off` are false (any case, as in config.yml), anything else stays the text as given (`010`, `0x10`, `3:30`, `y`, `null`), and so does every value of a key the manifest types `string`. For cost-cap, `0`, a negative number or `off` is no cap. Only a key the installed bundle's manifest lists in `session_settings:` is taken, with a value of the type it gives the key: a bundle that isn't installed (or whose plugin doesn't load), a key it doesn't list (a record installed before the bundle listed it says to run `chi update` or `chi bundle upgrade NAME`), a value of another type (`--set cost-cap.cap=five`), or another shape (`--set foo`, `--set a.b.c=1`) is an error naming what it takes, exit 2, nothing started. Saved in the session; a respawned worker, a fork and a continue keep it, a delegate child doesn't. Ignored with `--attach`/`--resume` (one line, as `--toolkit`); refused with `chi web`. See [Per-session settings](plugins.md#per-session-settings). |
457
454
  | `--profile NAME` | Prompt profile (`qwen36` or `gemma4`) for every model in this run, over config and the server's template (same as `--model-profile`, env `SAMAGOTCHI_MODEL_PROFILE`). See "Prompt profile" in configuration.md. |
@@ -462,8 +459,8 @@ invalid option (exit 1).
462
459
  | `--llm-context-apply RULE` | This session's own apply rule: `payoff`, `next_request` or `turn_end`. |
463
460
  | `--llm-context-budget TOKENS` | This session's own context budget: `64000`, `64k` (4k to 10M), or `off` (wins over the model's budget). |
464
461
  | `--no-interrupt` | Raise the tool-call limit to 1000 iterations for long tasks. |
465
- | `--no-default-input` | Skip prefilling the first REPL line from `SAMAGOTCHI_DEFAULT_INPUT`. |
466
- | `-v`, `--verbose` | Log at debug level (raw LLM responses, tool call/result payloads) and print every log record to stderr too. |
462
+ | `--no-default-input` | Skip the default input (`SAMAGOTCHI_DEFAULT_INPUT`) typed into a new session's first prompt. |
463
+ | `-v`, `--verbose` | Log at debug level (raw LLM responses, tool call/result payloads). Attached, the terminal shows this session's debug records above the prompt as they come, and a worker this chi starts logs at debug too; a worker that was already running keeps its own level (a one-line note says so). With `--non-interactive`, every log record goes to stderr too. This machine only (exit 2 with `--remote`). |
467
464
  | `--version` | Print `chi <version>` and exit (`chi self` shows it with the paths). |
468
465
 
469
466
  Every setting in the config registry (`lib/samagotchi/config.rb`) that exposes a CLI
@@ -486,13 +483,12 @@ as an unknown key).
486
483
  |---------|----------|
487
484
  | `chi` | Start a fresh session in a worker and attach to it. |
488
485
  | `chi -p "refactor this"` | Start a session in a worker, send the prompt, **stay attached**. |
489
- | `chi -p "refactor this" --non-interactive` | Run one turn in this process, save, **exit** (no REPL, no worker). |
486
+ | `chi -p "refactor this" --non-interactive` | Run one turn in this process, save, **exit** (no TUI, no worker). |
490
487
  | `chi --non-interactive` | Harmless no-op exit; no session created, no error. |
491
488
  | `chi --resume ID` | Resume session `ID` in a worker (or join the worker already running it) and attach. |
492
489
  | `chi --resume ID -p "next step" --non-interactive` | Resume `ID`, run the prompt, save, exit. |
493
490
  | `chi --resume ID -p "next step"` | Resume `ID`, send the prompt, **stay attached** to that session. |
494
- | `chi --no-shared [...]` | The same, in the plain in-process REPL. |
495
- | `chi scratch [-p ...] [--non-interactive]` | A new session in the plain REPL, deleted when it ends. |
491
+ | `chi scratch [-p ...] [--non-interactive]` | A new session, attached (or one turn with `--non-interactive`), deleted when it ends. |
496
492
 
497
493
  Notes:
498
494
 
@@ -507,14 +503,14 @@ Notes:
507
503
  script, `chi send --new --wait` is the better entry point: stdout holds the
508
504
  answer alone (see [Starting a session](sessions.md#starting-a-session)).
509
505
  - `-p` always feeds **and** runs the prompt; there is no feed-and-edit variant. To
510
- prefill (edit, not execute) the first REPL line, use the
506
+ prefill (edit, not execute) a new session's first prompt, use the
511
507
  `SAMAGOTCHI_DEFAULT_INPUT` environment variable instead.
512
508
  - Prompt history (↑) is one file shared by every session (see [Persistent Prompt
513
509
  History](#persistent-prompt-history)); `--resume` preserves the session's prior
514
510
  messages as turn context (a `-p` run on a resumed session never clobbers its
515
511
  conversation).
516
512
  - Non-interactive runs (`-p` with `--non-interactive`, or bare `--non-interactive`)
517
- print only the final result output on stdout — no spinner, status line, or REPL.
513
+ print only the final result output on stdout — no spinner, status line, or prompt.
518
514
  Everything else goes to stderr: the `Session: ID` line first, before the turn;
519
515
  retry lines and hooks' notices as they come, the after_turn hooks' ones
520
516
  (source-links' `sources:`) after the answer; and the error of a failed turn,
@@ -531,19 +527,28 @@ Notes:
531
527
 
532
528
  ### Scratch sessions
533
529
 
534
- `chi scratch` is `chi --no-shared` for a session you won't keep: a quick
535
- question, a try-out. It takes the run options (`-p`, `--non-interactive`,
536
- `--model`, `--profile`, `--memory`, `--mute`, `-v`, …); `--resume`, `--attach`
537
- and `--shared` are refused. Its first line says it is a scratch session.
538
-
539
- - The session is deleted however it ends: `/exit`, Ctrl-D, Ctrl-C at the
540
- prompt, an error, SIGTERM or SIGHUP. There is no recap, and the lines typed
541
- are not added to the prompt history.
542
- - It never shows in `chi web`. A process killed with `kill -9` leaves its
543
- session behind, marked `"scratch": true` in its session.json: `chi sessions
544
- list` shows it as `[scratch]`, and the next sweep or `chi sessions clean`
545
- deletes it. `chi --resume` and `--attach` refuse it (exit 1), so it never
546
- turns into a kept session.
530
+ `chi scratch` is plain `chi` for a session you won't keep: a quick question, a
531
+ try-out. It takes the run options (`-p`, `--non-interactive`, `--model`,
532
+ `--profile`, `--memory`, `--mute`, `-v`, …); `--resume` and `--attach` are
533
+ refused. Its first line says it is a scratch session.
534
+
535
+ - It runs attached, on a worker of its own. Ctrl-D, `/detach`, `/exit` and a
536
+ second Ctrl-C all end it: the terminal stops the worker and deletes the
537
+ session (`Scratch session deleted.`). `/archive` is refused. The lines typed
538
+ are not added to the prompt history. With `-p … --non-interactive` it is one
539
+ turn in this process, and the session is deleted as the run ends.
540
+ - The worker deletes the session too once its terminal is gone (no stream
541
+ left for about 25 s, twice the terminal's reconnect retries, so a dropped
542
+ stream that reconnects keeps it; or none came within 30 s), so a closed
543
+ terminal window or a `kill -9` of the terminal leaves nothing: a turn still
544
+ running then is cancelled first. It refuses `chi sessions restart`.
545
+ - It never shows in `chi web`, and only its terminal uses it: `chi send`, the
546
+ web's routes, `chi --resume` and `--attach` refuse it (exit 1), in one
547
+ wording: "that's a chi scratch session: only the terminal that started it
548
+ uses it (a leftover one is deleted at the next sweep: chi sessions clean)".
549
+ A session left behind when both died is marked `"scratch": true` in its
550
+ session.json: `chi sessions list` shows it as `[scratch]`, and the next
551
+ sweep or `chi sessions clean` deletes it.
547
552
  - Memories are read and preloaded as usual, but nothing is saved: `memory_write`
548
553
  answers "scratch session: nothing is saved", and `write`/`edit` into the
549
554
  memories folder are denied (a guardrail, rule `scratch-session`). `execute`
@@ -557,13 +562,13 @@ and `--shared` are refused. Its first line says it is a scratch session.
557
562
 
558
563
  ### Sharing a session
559
564
 
560
- Two different things share a session: `session.shared` is about UIs — several
561
- terminals and the Web UI attached to one worker — while `chi share` invites
562
- other people, participants with a link of their own (see
563
- [Participants](#participants)).
565
+ Two different things share a session: several terminals and the Web UI
566
+ attached to one worker, and `chi share`, which invites other people,
567
+ participants with a link of their own (see [Participants](#participants)).
568
+ This section is about the first.
564
569
 
565
570
  Plain `chi` runs the session in a background worker and attaches the terminal
566
- to it (`session.shared`, default `true`). A worker's session can have any number
571
+ to it; every interactive `chi` does (plain, `-p`, `--resume`, `--attach`). A worker's session can have any number
567
572
  of UIs at once: the Web UI and attached terminals (`chi`, `--resume`,
568
573
  `--attach`). They all see the same turns as they happen, and any of them can send
569
574
  a prompt, also while a turn runs (it merges into that turn as steering: the model
@@ -639,7 +644,7 @@ In an attached terminal:
639
644
  was started), whichever terminal you attach from.
640
645
  - `-p` sends its prompt once attached, `--model` switches the worker's model
641
646
  first, and `--no-interrupt` applies to each prompt this terminal sends.
642
- - History, completion and the idle status line work as in the REPL.
647
+ - Prompt history (↑), Tab completion and the idle status line work there.
643
648
  - The attached view needs reline 0.6.x to draw around the open prompt; with
644
649
  another version it prints plainly.
645
650
 
@@ -686,7 +691,7 @@ sessions restart ID`, the terminal with `/detach` and `chi --attach ID`), and
686
691
  the web's, `list_sessions`) and keeps them for good: the retention sweep never
687
692
  deletes an archived session, nor counts it. Its delegates go with it. A live
688
693
  worker is stopped first; a session running a turn (or with a delegate running
689
- one), open in a plain REPL, or a `chi scratch` one is refused. `chi sessions
694
+ one), one a `--non-interactive` run has, or a `chi scratch` one is refused. `chi sessions
690
695
  list --archived` shows them too, marked `[archived]` (`archived: true` in
691
696
  `--format json`); `chi sessions unarchive ID...` brings them back, and so does
692
697
  a message you send to one (the web, an attached terminal, `chi send`), but not
@@ -701,7 +706,8 @@ it). See
701
706
  session file and its whole directory (notes, images, queued input). Each id
702
707
  (or unique prefix) gets one line: `deleted`, or `refused` with the reason. A
703
708
  session whose worker runs is refused unless `--force` stops the worker first;
704
- one open in a plain REPL is always refused ("close it there first"). Exit
709
+ one a `--non-interactive` run has is always refused ("in use by a one-turn chi
710
+ --non-interactive run or an older chi's terminal; let it finish first"). Exit
705
711
  status: 0 when all are gone, 1 when any was refused or unknown, 2 on a usage
706
712
  error. The Web UI deletes too: `delete` in the info bar, or the ✕ on a card in
707
713
  All sessions; it asks first and stops a live worker.
@@ -718,18 +724,12 @@ object `{session_id, status, live, metrics, settings}` (`settings`: the session'
718
724
  exits 0. An unknown or ambiguous id exits 1 with `chi sessions stop`'s
719
725
  wording. See [Sessions](sessions.md#cli).
720
726
 
721
- **The plain REPL.** Some launches run the session in this process instead, with
722
- no worker:
723
-
724
- - `--no-shared`, for one run, or `session.shared: false` in the config
725
- (`SAMAGOTCHI_SESSION_SHARED=0`), for every run.
726
- - `--non-interactive`, a one-shot with no REPL.
727
- - `--verbose`, which attached mode can't honor (the worker prints nothing). It
728
- prints a one-line note, `(session.shared: --verbose runs in a plain REPL)`.
729
-
730
- A session the REPL has open can't be shared: `--resume` and `--attach` on it say
731
- "close it there first", and the Web UI shows it read-only. `--attach`/`--shared`
732
- can't be combined with `--non-interactive` or `--verbose`.
727
+ **One-turn runs.** `chi -p TEXT --non-interactive` (also with `--resume ID`)
728
+ runs its turn in this process, with no worker, and holds the session until it
729
+ ends. Meanwhile the session is "in use by a one-turn chi --non-interactive
730
+ run or an older chi's terminal": `--resume`, `--attach`, `chi send`, `chi note` and the Web UI's sends
731
+ refuse it, and the Web UI shows it read-only. `--attach` can't be combined with
732
+ `--non-interactive`.
733
733
 
734
734
  ### Muting a memory
735
735
 
@@ -741,8 +741,8 @@ file and index line stay as they are; only this session doesn't see it.
741
741
  - `--memory` and `--mute` are session fields (`preloaded_memory_names`,
742
742
  `muted_memory_names` in the session's JSON), written before the worker
743
743
  starts. A worker respawned by `--resume`, `--attach` or `chi send` builds
744
- the same prompt, and a REPL `--resume` of that session keeps the lists too
745
- (merged with the flags it is given).
744
+ the same prompt, and a `--resume ID --non-interactive` one-shot keeps the
745
+ lists too (merged with the flags it is given).
746
746
  - A mute wins: `--mute user_preferences` drops that config baseline entry for
747
747
  one session, and `--memory x --mute x` is a mute (one warning line).
748
748
  - Names are checked before the launch, warnings only: `Warning: --memory 'x'
@@ -888,7 +888,7 @@ line, the web in the session bar's ⚙ panel (`⚙ reasoning all` once the sessi
888
888
 
889
889
  `/toolkit` lists the tools the next turn declares (each with its estimated
890
890
  tokens), the session's toolkit and the tools it leaves out: `reachable
891
- (find_tools): …` (built-ins the model reaches with find_tools and call_tool)
891
+ (find_tools): …` (built-ins and plugin tools the model reaches with find_tools and call_tool)
892
892
  and `removed: …` (only `/toolkit add` brings one back), or `not loaded: …` when
893
893
  the toolkit removes call_tool, and its kit's prompt text when it has one (`prompt: <first line> (+N lines, ~T
894
894
  tokens)`). `/toolkit remove TOOL` is hard: a tool the
@@ -908,7 +908,7 @@ guardrails.parent_answers: soft)`). `/parent-answers hard|standard|soft` sets th
908
908
  session's own, `/parent-answers default` drops it; it is saved at once and
909
909
  holds from the next answer. It never goes looser than config.yml's (the reply
910
910
  says when config.yml's applies instead). Anyone may tighten it; only you loosen
911
- it, at the REPL, an attached terminal or the web: `chi send`, a piped or marked
911
+ it, at an attached terminal or the web: `chi send`, a piped or marked
912
912
  attach and `chi -p --non-interactive` are refused. `/parent-answers` alone answers
913
913
  mid-turn too; a change waits for the turn's end. No chip: its reply is where the
914
914
  web shows it. See [Guardrails](guardrails.md#answers-from-a-parent-agent).
@@ -937,21 +937,19 @@ the model's `objectives` tool); [Objectives](sessions.md#objectives) has what th
937
937
  `check: …` under the move. Information only: it edits nothing, and it is refused for an objective with no move or a dropped one, and during a participant's turn. See [Objectives](sessions.md#objectives).
938
938
 
939
939
  All of them run mid-turn too. An edit answers with the new list at once and goes into the conversation between turns.
940
- Refused in a chi REPL's session (`--no-shared`), as `chi note` is; `/objectives` alone still answers there.
940
+ Refused while a `--non-interactive` run has the session, as `chi note` is.
941
941
 
942
942
  A `/model`, `/llm-context`, `/thinking`, `/reasoning-history` or `/toolkit` change that restarts the prompt cache
943
943
  asks first: the reply says what it costs, changes nothing, and names the line
944
944
  that applies it (`/thinking low --yes`, `/model qwen --default --yes`). `--yes` (or `-y`) applies it at once.
945
945
  The terminal puts that line in the next input (Enter applies it); the web's
946
946
  reply has an Apply button. `chi send ID "/thinking low"`,
947
- `chi -p "/thinking low" --non-interactive` and lines piped into the REPL apply
948
- without asking (a plain `chi -p` opens the REPL, which asks). See "Changes that
947
+ and `chi -p "/thinking low" --non-interactive` apply without asking. See "Changes that
949
948
  restart the prompt cache" in [configuration.md](configuration.md).
950
949
 
951
950
  ### Typing during a turn
952
951
 
953
- The prompt stays open while a turn runs, in an attached terminal and in the plain
954
- REPL alike:
952
+ The prompt stays open while a turn runs in an attached terminal:
955
953
 
956
954
  - A line you submit merges into the running turn at its next step (after the
957
955
  current tool call or answer): `(goes in at the next step)` at once, then
@@ -968,7 +966,7 @@ REPL alike:
968
966
  off; goes in at the next step)` (`steer.cut_after` is 0, per host/model:
969
967
  `steer_cut_after`, or no generation to cut).
970
968
  - `/queue TEXT` runs TEXT as a turn of its own after this one, in an attached
971
- terminal, the plain REPL and the web composer alike: `(queued: runs after this
969
+ terminal and the web composer alike: `(queued: runs after this
972
970
  turn)` (the web draws it as a queued bubble until its turn starts). It never
973
971
  merges into the running turn, and a plain line sent after it still does.
974
972
  Several queued lines run one turn each, in the order sent; they still run
@@ -980,7 +978,7 @@ REPL alike:
980
978
  with images works the same way: it waits for the turn's end, and the lines
981
979
  sent after it still go in at the next step.
982
980
  At the open prompt (no turn running) `/cut TEXT` and `/queue TEXT` run TEXT
983
- as a normal prompt, and the terminals say so: `(nothing is running: sent now)`.
981
+ as a normal prompt, and the terminal says so: `(nothing is running: sent now)`.
984
982
  - `/unqueue` (attached terminal) takes back the newest line this terminal
985
983
  queued that hasn't started: `removed: <its first 60 characters>`, and its text
986
984
  goes back into the input to change and send again (not over typed text: then
@@ -991,8 +989,7 @@ REPL alike:
991
989
  `(not removed: it already started)` when its turn won the race, `(not removed:
992
990
  it is already gone)` when another client removed it. Other terminals that
993
991
  showed it say `(a queued message was removed)`; the web drops its bubble. A
994
- worker older than it is not asked: `(/unqueue needs a newer worker: …)`. In
995
- the plain REPL it answers with a note (its own queue is not touched), and the
992
+ worker older than it is not asked: `(/unqueue needs a newer worker: …)`. The
996
993
  web's composer points at the × on the bubble.
997
994
  - **The web composer** has a row above the text field in a session (always
998
995
  there, so the composer never changes height): the keys while idle, and while
@@ -1050,24 +1047,16 @@ REPL alike:
1050
1047
  typed comes back once it closes. The choices then go, and one line stays:
1051
1048
  `? Pick a fruit → Banana`.
1052
1049
  - Ctrl-C cancels the turn and keeps what you typed.
1053
- - In the plain REPL, Ctrl-D on an empty prompt (or `exit`, `/exit`, `/quit`) mid-turn
1054
- exits once the turn ends: `(exits after this turn; Ctrl-C cancels it)`
1055
- (`/exit --delete` deletes the session then too). In an
1056
- attached terminal it detaches at once and the turn goes on in the worker
1057
- (`/exit` then says the worker stays up: a turn is running).
1058
- - `/archive` mid-turn archives once the turn ends:
1059
- `(archives after this turn; Ctrl-C cancels it)` in the plain REPL,
1060
- `(archives after this turn)` in an attached terminal, which also waits for
1061
- the commands queued behind the turn.
1062
-
1063
- With stdin that isn't a terminal (a pipe), the REPL reads a line only between
1064
- turns.
1050
+ - Ctrl-D on an empty prompt mid-turn detaches at once and the turn goes on in
1051
+ the worker (`/exit` then says the worker stays up: a turn is running).
1052
+ - `/archive` mid-turn archives once the turn ends: `(archives after this
1053
+ turn)`; it also waits for the commands queued behind the turn.
1065
1054
 
1066
1055
  ### Images
1067
1056
 
1068
1057
  A model that can see images gets them these ways:
1069
1058
 
1070
- - **`@path` in a prompt** (REPL, attached terminal, `-p`): `what's wrong in
1059
+ - **`@path` in a prompt** (attached terminal, `-p`): `what's wrong in
1071
1060
  @shot.png?`, `@~/Desktop/a.jpg`, `@"my shot.png"`. Each `@` token that names an
1072
1061
  image file (png, jpeg, gif, webp; bmp, tiff and heic are converted) goes with
1073
1062
  the prompt, and a dim line shows it: `[image shot.png 1280×800 · ~1.3k tokens]`.
@@ -1583,7 +1572,7 @@ chi --remote studio --dir /Users/me/app -p "hi" # a new session there (--
1583
1572
  `--attach`/`--resume` they work as here (`--model`, `--thinking`,
1584
1573
  `--llm-context*` change the session; the others are named as ignored).
1585
1574
  `--non-interactive` (use `chi --remote studio send --new --dir D -m TEXT
1586
- --wait`), `--verbose`, `--no-shared`, `--memory`, `--mute` and
1575
+ --wait`), `--verbose`, `--memory`, `--mute` and
1587
1576
  `--append-system-prompt` run on this machine only (exit 2).
1588
1577
  - `@path` images are this machine's files (read and downscaled here, then
1589
1578
  uploaded); Tab completes `/` commands and `@path`, not memory names. The
@@ -1736,8 +1725,7 @@ chi share revoke --all # every link to every session
1736
1725
  `/share NAME [--agent] [--expires 3d] [--cap 2]` (the link and its QR code, once), `/participants` (the list),
1737
1726
  `/participants revoke [P]` (one participant, or everyone) and `/participants cap P DOLLARS`. They are `chi share`'s
1738
1727
  own, so under `chi --remote NAME` they reach that machine's chi web, as `chi --remote NAME share` does; an invite or
1739
- a revoke made with them isn't announced again by the `participants>` line. The REPL
1740
- (`--no-shared`) answers them with a note: a participant's turns run on the session's worker.
1728
+ a revoke made with them isn't announced again by the `participants>` line.
1741
1729
 
1742
1730
  #### Review sessions
1743
1731
 
@@ -1806,8 +1794,7 @@ A short recap of the session, for when you come back to it: what you were
1806
1794
  working on, what came of it and what is still open, not a turn-by-turn log.
1807
1795
 
1808
1796
  - It is written once the session has sat idle for `recap.inactivity` (180 s)
1809
- after at least `recap.min_user_turns` (2) prompts, and as a worker (or the
1810
- REPL) exits, when something new was said since the last one. Each one
1797
+ after at least `recap.min_user_turns` (2) prompts, and as a worker exits, when something new was said since the last one. Each one
1811
1798
  builds on the previous recap, so it only sends what is new.
1812
1799
  - It is saved with the session (`<session>/recap.json`) and shown as a dim
1813
1800
  `recap>` block when you attach or `--resume`, noting how many turns came
@@ -1835,8 +1822,8 @@ working on, what came of it and what is still open, not a turn-by-turn log.
1835
1822
 
1836
1823
  ## Time gaps (terminal)
1837
1824
 
1838
- Both terminals (attached and the REPL) show when things happened without a
1839
- time on every line:
1825
+ The attached terminal shows when things happened without a time on every
1826
+ line:
1840
1827
 
1841
1828
  - A dim divider marks a quiet gap of 10 minutes or more, before what comes
1842
1829
  next: `── 14:32 · 47 min later ──`, the date added when the day changed
@@ -1848,11 +1835,10 @@ time on every line:
1848
1835
  activity.
1849
1836
  - Attaching to a session whose last activity was 10 minutes ago or more
1850
1837
  says when, after the join block: `── last activity 14:32 · 47 min ago ──`
1851
- (from the newest timed message, else the saved recap's time). With
1852
- `--resume` the REPL marks the gap before the first prompt instead.
1838
+ (from the newest timed message, else the saved recap's time).
1853
1839
  - A recap names the local time it was written: `recap 14:32>`, `recap 14:32
1854
1840
  (before the last 2 turns)>`.
1855
- - Only live activity and the join: neither terminal replays the history, so
1841
+ - Only live activity and the join: the terminal doesn't replay the history, so
1856
1842
  older gaps aren't marked. `--non-interactive` prints none.
1857
1843
 
1858
1844
  ## Tool Activity Log
@@ -1872,14 +1858,15 @@ Parameter previews are normalized to one line and truncated to keep output conci
1872
1858
  This is separate from verbose mode:
1873
1859
 
1874
1860
  - Default output shows short activity status lines only.
1875
- - `-v/--verbose` prints the debug log's records (raw LLM responses and full
1876
- tool call/result payloads among them) to stderr as well; see
1861
+ - `-v/--verbose` shows the session's debug records (raw LLM responses and full
1862
+ tool call/result payloads among them): dim, above the prompt, in the
1863
+ attached terminal; on stderr with `--non-interactive`. See
1877
1864
  [Debug Log File](configuration.md#debug-log-file).
1878
1865
 
1879
1866
  ## Persistent Prompt History
1880
1867
 
1881
1868
  Assist mode keeps a persistent prompt history across restarts, one for every
1882
- chi prompt: the REPL, attached mode and the `chi web` composer (↑/↓ there)
1869
+ chi prompt: the attached terminal and the `chi web` composer (↑/↓ there)
1883
1870
  share it.
1884
1871
 
1885
1872
  - Default history file: `$XDG_STATE_HOME/samagotchi/history.json`
@@ -1895,7 +1882,7 @@ share it.
1895
1882
  Behavior details:
1896
1883
 
1897
1884
  - Prompt history is loaded on startup before the first `>` prompt.
1898
- - A running REPL or attached TUI picks up the lines other chi processes (the
1885
+ - A running attached TUI picks up the lines other chi processes (the
1899
1886
  web, another terminal) added: before each `>` prompt and on the first ↑ at
1900
1887
  an open one (Ctrl-P, vi `k` too), when the file changed, its new lines join
1901
1888
  the ↑ list after the ones already there, without a
@@ -1914,7 +1901,7 @@ Behavior details:
1914
1901
 
1915
1902
  ## Status Line
1916
1903
 
1917
- The REPL and attached mode show one status row under the prompt, drawn when what it says
1904
+ The attached terminal shows one status row under the prompt, drawn when what it says
1918
1905
  changes:
1919
1906
 
1920
1907
  ```
@@ -1932,11 +1919,11 @@ status> model=Qwen3.6-35B | ⑂ 2 running · 1 waiting | 2 participants | ctx=8.
1932
1919
  - `⑂ …`: this session's delegate children (forks aren't counted): how many run and how many wait
1933
1920
  for an answer; only the counts there are, nothing when none does (`/children` has the rest:
1934
1921
  done, failed, whether a reply was reported). The terminal reads them from the children's files
1935
- (the delegates in the session's `delegates.json`): an attached one when it joins, when a turn
1936
- ends and when a delegate's report merges into a turn, the REPL whenever it draws the row. A
1922
+ (the delegates in the session's `delegates.json`) when it joins, when a turn
1923
+ ends and when a delegate's report merges into a turn. A
1937
1924
  child that starts waiting on an approval (which doesn't wake the parent) shows at the next of
1938
1925
  those.
1939
- - `N participants`: who is in the session's review now ([Participants](#participants)), attached only.
1926
+ - `N participants`: who is in the session's review now ([Participants](#participants)).
1940
1927
  - `ctx=`: the kernel's context estimate and its bucket, updated during a turn (on hosts that
1941
1928
  report none, `api: openai`, at the turn's end).
1942
1929
  - `mem:`: the memories the session read, with its `--memory` list; `muted:` its `--mute` list.
@@ -1960,7 +1947,7 @@ It lists the top 3 tools by count (ties go to the tool used first), the failed c
1960
1947
  (a call a guardrail or an approval blocked counts as a call, not as failed) and the last
1961
1948
  call with its parameters, cut to the terminal width. It starts over with each turn.
1962
1949
 
1963
- - The REPL and attached mode: the second row of the activity slot, shown while the slot is (the
1950
+ - The terminal: the second row of the activity slot, shown while the slot is (the
1964
1951
  model generating or a tool running). Joining a turn mid-way seeds it from the turn so far.
1965
1952
  - The web: the activity panel's summary reads `activity · 12 tool calls (2 failed) · execute ×7 · …`
1966
1953
  (without `last:`: the rows show it).
@@ -1968,7 +1955,7 @@ call with its parameters, cut to the terminal width. It starts over with each tu
1968
1955
  ## Activity Row
1969
1956
 
1970
1957
  While a turn runs, one row above the prompt says what it is doing, the spinner frame first
1971
- (the REPL and attached mode alike):
1958
+ (in the attached terminal):
1972
1959
 
1973
1960
  - `| thinking…` while the model starts, then `| thinking · <sentence>`: the newest complete
1974
1961
  sentence of its thinking, or of its answer (`writing ·`), like the web's thinking ticker: the
@@ -2003,7 +1990,7 @@ Behavior notes:
2003
1990
  tool steps keeps them, as a cancel does, with the dim `partial progress kept; !rollback restores the pre-turn state`
2004
1991
  (the model reads a note saying how many steps ran and why it stopped; `chi send --wait` and a delegating parent
2005
1992
  read `the turn failed after N tool steps: <why>; its work so far stays`). The
2006
- REPL and attached mode say the same; the web ends a failed turn whose steps stayed with `✕ turn failed: <summary>;
1993
+ attached terminal says the same; the web ends a failed turn whose steps stayed with `✕ turn failed: <summary>;
2007
1994
  partial progress kept (!rollback restores the pre-turn state)`, after a reload too, and says `■ canceled (Ctrl-C)`
2008
1995
  (`stopped` for its Stop button, `by a hook` for a hook's). A turn a bundle's plugin stopped names it: `■ turn stopped by loop-guard` (the web:
2009
1996
  `■ stopped by loop-guard`).
@@ -2030,9 +2017,6 @@ Behavior notes:
2030
2017
  answers it too. If the worker exits (a stop, a crash), the offer goes with it.
2031
2018
  - In the attached terminal (`chi --attach`) the question's prompt reads the continue words: Enter alone, `yes`, `y`
2032
2019
  or `/continue` continue; `no` stops; `no, <reason>` stops and tells the model why; `1` and `2` pick the options.
2033
- - In the plain REPL (`--no-shared`) the CLI asks at the `? ` prompt, with the choices listed under it: `yes` (Enter
2034
- alone, or `/continue`) resumes, `no` stops, and `no, <explanation>` stops while keeping the reason in conversation
2035
- context. Once answered, one line stays: `? The turn ran out of iterations. Continue it? → no, too slow`.
2036
2020
  - Continue goes on with the same turn: the model keeps the reasoning (thinking) of the run it continues, on chat and
2037
2021
  native hosts, so a local server's prompt cache stays warm. Continue's text is a steer: on a chat host the reasoning
2038
2022
  starts again from it. See "Reasoning history" in [configuration.md](configuration.md).