samagotchi 0.2.0 → 0.4.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 (131) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +198 -1
  3. data/README.md +56 -4
  4. data/bin/chi +118 -50
  5. data/docs/cli.md +184 -9
  6. data/docs/configuration.md +333 -47
  7. data/docs/desktop.md +45 -4
  8. data/docs/guardrails.md +11 -0
  9. data/docs/hooks.md +208 -5
  10. data/docs/plugins.md +68 -2
  11. data/docs/releasing.md +23 -13
  12. data/docs/sessions.md +45 -17
  13. data/lib/samagotchi/answer_display.rb +95 -0
  14. data/lib/samagotchi/archive_store.rb +90 -0
  15. data/lib/samagotchi/bootstrap/config_writer.rb +342 -0
  16. data/lib/samagotchi/bootstrap/probe.rb +262 -0
  17. data/lib/samagotchi/bootstrap_command.rb +347 -0
  18. data/lib/samagotchi/bridge/pending_card.rb +89 -0
  19. data/lib/samagotchi/bridge/turn_accumulator.rb +15 -3
  20. data/lib/samagotchi/bridge.rb +13 -1
  21. data/lib/samagotchi/bridge_client.rb +6 -2
  22. data/lib/samagotchi/bundles/check-in/manifest.yml +10 -0
  23. data/lib/samagotchi/bundles/check-in/plugin.rb +244 -0
  24. data/lib/samagotchi/bundles/source-links/hooks/source_links.rb +531 -0
  25. data/lib/samagotchi/bundles/source-links/manifest.yml +14 -0
  26. data/lib/samagotchi/bundles/source-links/source_links.md +5 -0
  27. data/lib/samagotchi/bundles/system/config_modification_protocol.md +10 -6
  28. data/lib/samagotchi/bundles/system/delegated.md +6 -7
  29. data/lib/samagotchi/bundles/system/manifest.yml +4 -4
  30. data/lib/samagotchi/bundles/system/self_map.md +8 -2
  31. data/lib/samagotchi/client.rb +81 -19
  32. data/lib/samagotchi/commands/registry.rb +8 -0
  33. data/lib/samagotchi/config.rb +252 -48
  34. data/lib/samagotchi/desktop/macos/App.swift +12 -8
  35. data/lib/samagotchi/desktop/macos/ChiRunner.swift +17 -9
  36. data/lib/samagotchi/desktop/macos/Images.swift +113 -0
  37. data/lib/samagotchi/desktop/macos/Info.plist.erb +6 -0
  38. data/lib/samagotchi/desktop/macos/Panel.swift +180 -25
  39. data/lib/samagotchi/desktop/macos.rb +59 -8
  40. data/lib/samagotchi/desktop_command.rb +6 -3
  41. data/lib/samagotchi/edit_preview.rb +82 -0
  42. data/lib/samagotchi/empty_answer_retry.rb +43 -0
  43. data/lib/samagotchi/engine.rb +434 -140
  44. data/lib/samagotchi/gem_update.rb +89 -0
  45. data/lib/samagotchi/guardrails/approval.rb +35 -4
  46. data/lib/samagotchi/guardrails/load_failures.rb +9 -3
  47. data/lib/samagotchi/guardrails/scratch_writes.rb +40 -0
  48. data/lib/samagotchi/guardrails.rb +1 -0
  49. data/lib/samagotchi/hooks/registry.rb +24 -5
  50. data/lib/samagotchi/host_registry.rb +9 -12
  51. data/lib/samagotchi/idle_client.rb +24 -15
  52. data/lib/samagotchi/idle_recap.rb +5 -1
  53. data/lib/samagotchi/idle_reminders.rb +2 -2
  54. data/lib/samagotchi/image_store.rb +10 -6
  55. data/lib/samagotchi/kernel_loop.rb +73 -94
  56. data/lib/samagotchi/live_versions.rb +59 -0
  57. data/lib/samagotchi/llm/api_key.rb +41 -0
  58. data/lib/samagotchi/llm/chat_loop.rb +132 -29
  59. data/lib/samagotchi/llm/errors.rb +41 -9
  60. data/lib/samagotchi/llm/http.rb +57 -17
  61. data/lib/samagotchi/llm/openai_chat.rb +17 -30
  62. data/lib/samagotchi/log_subscriber.rb +18 -3
  63. data/lib/samagotchi/memory_bundle/installer.rb +65 -63
  64. data/lib/samagotchi/memory_bundle/provenance.rb +51 -12
  65. data/lib/samagotchi/memory_bundle/shipped_update.rb +157 -0
  66. data/lib/samagotchi/memory_bundle/status.rb +4 -1
  67. data/lib/samagotchi/memory_bundle/system_bundle.rb +81 -53
  68. data/lib/samagotchi/model_profile.rb +24 -1
  69. data/lib/samagotchi/plugin/context.rb +22 -1
  70. data/lib/samagotchi/plugin/sessions.rb +3 -1
  71. data/lib/samagotchi/prompt.rb +4 -2
  72. data/lib/samagotchi/reminder_store.rb +1 -9
  73. data/lib/samagotchi/reply_wait.rb +126 -0
  74. data/lib/samagotchi/sampling_settings.rb +58 -0
  75. data/lib/samagotchi/self_report.rb +18 -3
  76. data/lib/samagotchi/send_command.rb +252 -11
  77. data/lib/samagotchi/session.rb +52 -11
  78. data/lib/samagotchi/session_archive_command.rb +107 -0
  79. data/lib/samagotchi/session_commands.rb +46 -7
  80. data/lib/samagotchi/session_manager.rb +115 -25
  81. data/lib/samagotchi/session_metrics.rb +222 -106
  82. data/lib/samagotchi/steer.rb +72 -0
  83. data/lib/samagotchi/terminal_ui/attached_loop.rb +57 -28
  84. data/lib/samagotchi/terminal_ui/event_renderer.rb +21 -11
  85. data/lib/samagotchi/terminal_ui/formatting.rb +40 -8
  86. data/lib/samagotchi/terminal_ui/input_support.rb +7 -19
  87. data/lib/samagotchi/terminal_ui/question_prompt.rb +35 -0
  88. data/lib/samagotchi/terminal_ui.rb +134 -247
  89. data/lib/samagotchi/text_diff.rb +181 -0
  90. data/lib/samagotchi/thinking.rb +115 -0
  91. data/lib/samagotchi/tool_activity.rb +3 -1
  92. data/lib/samagotchi/tool_runner.rb +34 -1
  93. data/lib/samagotchi/tools/ask_user_question.rb +41 -33
  94. data/lib/samagotchi/tools/builtins.rb +15 -4
  95. data/lib/samagotchi/tools/delegate_wait.rb +26 -69
  96. data/lib/samagotchi/tools/edit.rb +23 -9
  97. data/lib/samagotchi/tools/execute.rb +52 -14
  98. data/lib/samagotchi/tools/task_runtime.rb +19 -0
  99. data/lib/samagotchi/tools/task_wait.rb +27 -3
  100. data/lib/samagotchi/tools/write.rb +4 -0
  101. data/lib/samagotchi/turn_flow.rb +12 -2
  102. data/lib/samagotchi/turn_note.rb +60 -6
  103. data/lib/samagotchi/update_command.rb +308 -0
  104. data/lib/samagotchi/update_hint.rb +59 -0
  105. data/lib/samagotchi/version.rb +1 -1
  106. data/lib/samagotchi/vision_support.rb +7 -9
  107. data/lib/samagotchi/web/app.rb +91 -7
  108. data/lib/samagotchi/web/message_parts.rb +8 -3
  109. data/lib/samagotchi/web/public/activity.js +13 -1
  110. data/lib/samagotchi/web/public/annotate_presets.js +26 -0
  111. data/lib/samagotchi/web/public/annotations.js +13 -0
  112. data/lib/samagotchi/web/public/app.js +472 -111
  113. data/lib/samagotchi/web/public/card.js +5 -3
  114. data/lib/samagotchi/web/public/chat_view.js +13 -1
  115. data/lib/samagotchi/web/public/copy.js +20 -4
  116. data/lib/samagotchi/web/public/ctx.js +15 -0
  117. data/lib/samagotchi/web/public/data.js +23 -6
  118. data/lib/samagotchi/web/public/diff_view.js +58 -0
  119. data/lib/samagotchi/web/public/format.js +9 -0
  120. data/lib/samagotchi/web/public/index.html +60 -3
  121. data/lib/samagotchi/web/public/notify.js +175 -0
  122. data/lib/samagotchi/web/public/question_card.js +5 -2
  123. data/lib/samagotchi/web/public/sessions_list.js +7 -0
  124. data/lib/samagotchi/web/public/timing.js +39 -14
  125. data/lib/samagotchi/web/public/turn_events.js +75 -5
  126. data/lib/samagotchi/web/public/turn_view.js +49 -8
  127. data/lib/samagotchi/web/server.rb +8 -4
  128. data/lib/samagotchi/web/session_hub.rb +2 -1
  129. data/lib/samagotchi/web/session_summary.rb +24 -1
  130. data/lib/samagotchi/worker.rb +16 -4
  131. metadata +31 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da62382ff837576724b356e7ac03ccb484c382628b4a3a7fcfaacf799de4cc92
4
- data.tar.gz: 2822682cf66025598dbb6effc4598f97b3658fec0153cfcfaf5088a7385764dd
3
+ metadata.gz: 63f5d3415cd7f3cfe7f2811ab19bcabca4eafe62e349fd9d0d28fcd157c38340
4
+ data.tar.gz: a2fea7402c8a1cba19e795320c134e12a5cf58b026934cc954c4ecd80e6d765c
5
5
  SHA512:
6
- metadata.gz: 860855c62b763f58c44d06e137f8f45abceb81e4e8169c5c46182b69ae00442cc44c285c056e79120ce2b5a6ef2516c3e7fb75739188b650fc6c918644f25796
7
- data.tar.gz: 429c0f7b9fc76def59cd87a9493bddaca7813d38f73f8ce974616f9f55af89767aca8b7f9b2cd629b8e0a7fe606e98eee05ee52199a74ec6d3d13c00f23c2e82
6
+ metadata.gz: b8c4eb982683f47f10b9f77af3bc0b32518b8707860fcb796377870bb838ba13d326ece7b2e28f675097507478ec3723206ecd654fe8720e8653bf9a234f6930
7
+ data.tar.gz: fd059521495cca9d033924c818c8b35da945e6354b7806acdf65af7f275e51f9b20f5b228ff00dd81c2f16d73abd8de881d505b7eb3620e0a70792e28f4d7965
data/CHANGELOG.md CHANGED
@@ -8,6 +8,201 @@ and commands may change between minor versions. How releases are made:
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.4.0] - 2026-09-30
12
+
13
+ ### Added
14
+
15
+ - `chi update`: brings an installed chi up to date in one command: the gem
16
+ from rubygems, then the system bundle, the shipped bundles you installed and
17
+ the desktop helper (rebuilt only when its sources changed), shown in one
18
+ table. Your edits to bundle files are kept and reported, running workers and
19
+ an old `chi web` are only reported, `--dry-run` shows the plan, and
20
+ `--no-gem` / `--no-bundles` / `--no-desktop` (or `update.*` in config.yml)
21
+ skip parts. The first start of a new chi version says in one line when
22
+ something can be updated.
23
+ - A thinking level per model, host or run: `thinking: off | low | medium |
24
+ high | default` (`models.<key>.thinking`, `hosts.<name>.thinking`,
25
+ `thinking.level`, `--thinking LEVEL`). Chat hosts get the matching request
26
+ fields; native Qwen and Gemma turn thinking off. chi says once when a level
27
+ can't work on a host, and a host that refuses the thinking fields (gpt-oss
28
+ on OpenRouter) is asked again without them. `/model` and `chi self` show
29
+ the level.
30
+ - Edit previews: an edit/write approval shows the diff it would make, in the
31
+ web card and in the terminal, and every edit/write row gets a
32
+ "diff +3 −1" that opens to the change (live, after a reload and on a join).
33
+ - `chi send --image PATH` (repeatable, up to 20): images go with the message
34
+ as attachments, the same as the web composer's chips; converted and
35
+ downscaled once, then copied into each session. Works with `--new` (the
36
+ session starts idle, then gets the message with its images) and `--wait`.
37
+ A missing file or a non-image stops the send before anything goes out.
38
+ - The desktop helper takes images: a clipboard screenshot, image files from
39
+ Finder's Send to chi, other apps' image data, or a drop on the panel; they
40
+ show as thumbnails and go with the message.
41
+ - source-links 0.3.0: `#12` links to the current project's repo (from its git
42
+ remote) and `owner/repo#12` to that repo; `url:` templates take `{1}`,
43
+ `{name}`, `{repo}` and `{host}`, with `remote:` and `remote_host:` per
44
+ source, and the note lists each link once.
45
+ - The web shows when the provider is asked again after an error ("↻ retrying
46
+ (503) in 3 s, 1/2") or a turn waits for a plugin's setup.
47
+
48
+ ### Changed
49
+
50
+ - A model named with a host that isn't configured (`nosuch:org/model`, or a
51
+ provider's name like `openrouter:x`) is an error that names the host and
52
+ lists the configured ones, in the CLI, `chi send --new`, the web and
53
+ `/model`, instead of going to the default host.
54
+ - The terminal no longer rewrites `#word` into a memory reference: "PR #1"
55
+ and "#ff0000" reach the model as typed (Tab still completes `#name`).
56
+ - A question you dismiss reaches the model as dismissed, not as a tool
57
+ error, so it keeps asking when it should.
58
+ - `/quit` works in the REPL like `/exit`, and the web answers it too;
59
+ `/stats` and `/recap` take trailing words in both terminals.
60
+ - A delegated session gets reworded rules: the answer first, then evidence,
61
+ then what's unverified; follow-up messages arrive as new turns.
62
+
63
+ ### Fixed
64
+
65
+ - A llama.cpp server started with `--api-key` works: the key in
66
+ `api_key_env` is sent on every request (it got 401). A 401/403 from any host
67
+ now says which variable to check or to set `api_key_env`.
68
+ - A bundle upgrade that keeps your edited file no longer disables the
69
+ bundle's plugin, and the system bundle stops warning about the same edit on
70
+ every start.
71
+ - One bundle with a broken manifest.json no longer stops the hooks of the
72
+ bundles after it from loading.
73
+ - A long-running worker picks up edited guardrail rules.
74
+ - `write` without content fails instead of emptying the file.
75
+ - Per-model `vision:` follows a model alias, like `profile:` and `sampling:`.
76
+ - A timeout of 0 in config means the default on llama.cpp hosts too (it was a
77
+ 0-second timeout).
78
+ - A reminder turn drops a pending continue offer, so a later "no" can't roll
79
+ the reminder back.
80
+ - More than 8 options in `ask_user_question` is always an error (one path
81
+ silently used the first 8).
82
+ - A memory read with a comma list counts each name in the REPL and the web.
83
+ - `/archive` or `/quit` typed during a REPL turn no longer goes to the model
84
+ as text; `EXIT --DELETE` works in any case in an attached terminal.
85
+ - `chi bundle status` finds index lines again (it said "no-index" for every
86
+ file).
87
+
88
+ Update with `chi update` (new in this version: from 0.3.0, run
89
+ `gem install samagotchi` once, then `chi update`). Bundle moved:
90
+ source-links 0.3.0.
91
+
92
+ ## [0.3.0] - 2026-09-29
93
+
94
+ ### Added
95
+
96
+ - `chi bootstrap [HOST[:PORT]|URL]`: the first setup in one command. It finds
97
+ out whether the server is llama.cpp or OpenAI-compatible (with no target, it
98
+ looks on localhost's usual ports), picks the model, sends a test request and
99
+ writes config.yml; an existing config gets a `hosts:` entry added after a
100
+ backup, its other lines untouched. `--key-env VAR` for a server that wants a
101
+ key, `--model`, `--name`, `--no-test`, `--dry-run`. The first-run "no model
102
+ configured" line points at it.
103
+ - Web notifications: a session that needs you (a question or approval, a
104
+ failed turn, a turn done after 10 s or more) while the tab is in the
105
+ background counts in the page title, `(N) Chi`, and with the new bell in the
106
+ top bar on, shows an OS notification that opens the session.
107
+ - `chi scratch`: a one-time session in the terminal that leaves nothing behind.
108
+ It is deleted however it ends, saves no memories and starts no other
109
+ sessions; one left by a killed process goes at the next sweep or
110
+ `chi sessions clean`.
111
+ - Archiving a session: `chi sessions archive ID`, `/archive` in a terminal or
112
+ `archive` in the web's info bar hides it (and its delegates) from every list
113
+ and keeps it for good; `chi sessions list --archived` and "include archived"
114
+ in the web's all sessions find it, and a message you send to it brings it
115
+ back.
116
+ - `chi send --new` starts a session with the message, the way the web does, so
117
+ it shows in the web at once (`--dir`, `--model`); `chi send --wait` (new or
118
+ one existing session) blocks and prints the answer, exit 3 when the turn
119
+ waits for your answer.
120
+ - The `check-in` bundle (`chi bundle install check-in`): after 50 tool calls
121
+ in one turn with no answer (then every 50 more) a card asks you to nudge
122
+ the model, let it keep going or stop the turn; `mode: nudge` nudges it by
123
+ itself. `/checkin` shows and changes it for the session.
124
+ - Plugins can steer the running turn: `ctx.steer(text)` and a hook's
125
+ `event[:steer]` put text into the turn as its own message at the loop's
126
+ next step, shown as `<bundle>> nudged: …`; `ctx.stop_turn(reason)` stops it.
127
+ - The `source-links` bundle (`chi bundle install source-links`): refs like
128
+ `JIRA-123` or `GH-45` in an answer become links in the web, and a one-line
129
+ `sources:` note follows the turn in the terminal. Sources are patterns in
130
+ `bundles: source-links:`.
131
+ - Plugins can change how an answer is shown without changing what the model
132
+ sees: an after_turn hook's `event[:present]` sets a display version of the
133
+ answer, which the web renders (and keeps after a reload).
134
+ - Annotate presets: selecting text in an answer offers quick replies next to
135
+ Annotate (default "Agreed" and "Could you please elaborate?"); a pill puts
136
+ the quote and the text in the composer without sending.
137
+ `web.annotate_presets` (`|`-separated or a YAML list; `""` turns them off).
138
+ - `sampling:` on a `hosts:` or `models:` entry (temperature, top_p, top_k,
139
+ min_p, penalties, …) is sent with every request to that host or model;
140
+ `temperature: null` sends none, so the provider's default applies.
141
+ - `retry.empty_answer` (default 1): when the model returns an empty answer
142
+ (or runs out of tokens while thinking), chi asks again once in the same
143
+ turn; the terminal and the web show "↻ empty answer, asking again".
144
+ - The context fill is saved with the session: `chi sessions list` and the web
145
+ list show it (`ctx 12%`), and `/stats`, the status line and the web meter
146
+ show it right after a restart or a reload. Token totals now cover the whole
147
+ session across worker restarts.
148
+ - `chi send --wait ID` with no message waits for the session's next reply
149
+ without sending anything (also on a running session), e.g. after `--wait`
150
+ exited 3 for a question.
151
+ - The desktop panel has a "New session in <folder>" row (⏎ starts a session
152
+ with the selection there).
153
+ - Web notifications also cover a check-in card waiting for you, and a chi tab
154
+ in front keeps the tabs behind it from notifying twice.
155
+
156
+ ### Changed
157
+
158
+ - Stop ends a turn that is waiting in `task_wait` or running `execute` within
159
+ about a second, and a Stop right after a turn starts ends it at once. A
160
+ background task keeps running: the model is told it's still running and how
161
+ to continue or stop it, and the cancel note lists the session's tasks still
162
+ running. A stopped wait shows as "stopped".
163
+ - config.yml: a nested key now wins over its legacy flat `SAMAGOTCHI_*` key
164
+ (one warning names both); an unknown key warns with a did-you-mean;
165
+ top-level keys like `max_tool_output_chars` no longer warn; `no_interrupt`
166
+ and `no_default_input` work from config and env.
167
+ - A refused connection to a host fails at once with "can't reach host … — is
168
+ the server running?" instead of retrying for half a minute.
169
+ - A host whose `/props` doesn't answer costs one probe per 30 s, not a wait
170
+ at every turn.
171
+ - `chi -p … --non-interactive` with an empty answer says so on stderr and
172
+ exits 1.
173
+ - docs/configuration.md uses nested keys throughout and lists every setting;
174
+ the README starts with `chi bootstrap`.
175
+
176
+ ### Removed
177
+
178
+ - The unused config keys `bridge.enable` and `thinking.preview_lines` (they
179
+ now warn as unknown).
180
+
181
+ ### Fixed
182
+
183
+ - The web keeps a failed turn's prompt and reason after a reload, and a failed
184
+ turn's prompt comes back to the composer, also for a first message from the
185
+ start page.
186
+ - Web answer links appear with the answer instead of being swapped in after it.
187
+ - The title badge clears when you switch to the tab in Safari, and drops a
188
+ question answered from another tab or client.
189
+ - `/archive` and `/exit` typed in the web composer get a short reply instead
190
+ of an error.
191
+ - An approval card for a tool without a command or path shows its arguments.
192
+ - A hook notice from before the turn stays in its step after a reload.
193
+ - Card actions (check-in's Nudge, …) no longer leave a command bubble or line.
194
+ - A 404 from a native (llama.cpp) host hints at `api: openai`.
195
+ - A config `memories:` entry that can't be loaded is no longer called `--memory`.
196
+ - `chi --resume`/`--attach` refuse a leftover scratch session.
197
+ - `chi sessions list --live/--cwd/--format` show `[scratch]` too.
198
+ - The legacy-key warning names the right nested key.
199
+
200
+ ### Bundles
201
+
202
+ - New: `check-in` 0.1.1 (`chi bundle install check-in`, needs chi 0.3.0) and
203
+ `source-links` 0.2.0 (`chi bundle install source-links`). No other bundle
204
+ changed since 0.2.0.
205
+
11
206
  ## [0.2.0] - 2026-09-27
12
207
 
13
208
  The first public release. chi is an agent harness for local models
@@ -39,5 +234,7 @@ and long-lived sessions.
39
234
  - A macOS desktop helper (`chi desktop install`): a "Send to chi" Service and a
40
235
  hotkey panel that send selected text or the clipboard to your sessions.
41
236
 
42
- [Unreleased]: https://github.com/dm1try/samagotchi/compare/v0.2.0...HEAD
237
+ [Unreleased]: https://github.com/dm1try/samagotchi/compare/v0.4.0...HEAD
238
+ [0.4.0]: https://github.com/dm1try/samagotchi/compare/v0.3.0...v0.4.0
239
+ [0.3.0]: https://github.com/dm1try/samagotchi/compare/v0.2.0...v0.3.0
43
240
  [0.2.0]: https://github.com/dm1try/samagotchi/releases/tag/v0.2.0
data/README.md CHANGED
@@ -32,9 +32,44 @@ bin/chi self
32
32
  `bin/chi` runs the checkout; `bundle exec rake gem:install` installs it as a
33
33
  local gem, which puts `chi` on your PATH.
34
34
 
35
+ ### Updating
36
+
37
+ ```sh
38
+ chi update --dry-run # what would change
39
+ chi update # the gem, then the bundles and the desktop helper
40
+ ```
41
+
42
+ `chi update` installs the newest samagotchi from rubygems.org (old versions
43
+ stay installed: running sessions still use them), then brings the rest up to
44
+ the new version: the system bundle, the bundles chi ships that you installed,
45
+ and the macOS helper (rebuilt only when its sources changed). Memory files you
46
+ edited are kept, and the table says which. Running sessions move to the new
47
+ chi when their worker idles out (30 min) or on `chi sessions stop ID`; a
48
+ running `chi web` needs a restart. From a checkout, `git pull` instead. See
49
+ [CLI: Updating](docs/cli.md#updating).
50
+
51
+ ## Set up
52
+
53
+ Point chi at your model server; it works out the rest and writes
54
+ `~/.config/samagotchi/config.yml`:
55
+
56
+ ```sh
57
+ chi bootstrap 192.168.1.29:8081 # llama.cpp on another machine
58
+ chi bootstrap localhost:11434 # Ollama (any OpenAI-compatible server)
59
+ chi bootstrap https://openrouter.ai/api/v1 --key-env OPENROUTER_API_KEY
60
+ chi bootstrap # look on this machine's usual ports
61
+ ```
62
+
63
+ It finds out whether the server is llama.cpp or OpenAI-compatible, picks the
64
+ model (or asks, when there are several), sends one test request and writes
65
+ the config. With a config already there, it adds a `hosts:` entry and keeps
66
+ the rest of the file. Edit the file later as in [Configure](#configure);
67
+ `chi bootstrap --help` has the options.
68
+
35
69
  ## Configure
36
70
 
37
- Create `~/.config/samagotchi/config.yml` (or `$XDG_CONFIG_HOME/samagotchi/config.yml`):
71
+ To write the config by hand instead, or to change it later: create
72
+ `~/.config/samagotchi/config.yml` (or `$XDG_CONFIG_HOME/samagotchi/config.yml`):
38
73
 
39
74
  ```yaml
40
75
  default:
@@ -44,7 +79,20 @@ server:
44
79
  port: 8080
45
80
  ```
46
81
 
47
- Other settings (multiple hosts, transports, timeouts, the idle recap) are in
82
+ `server:` is a llama.cpp `llama-server`. For any other OpenAI-compatible
83
+ server (vLLM, LM Studio, Ollama, a gateway), name it under `hosts:` with
84
+ `api: openai` instead:
85
+
86
+ ```yaml
87
+ default:
88
+ model: local:qwen3:8b # host:model; the ids are in GET <url>/models
89
+ hosts:
90
+ local:
91
+ url: http://localhost:11434/v1 # the API base, /v1 included
92
+ api: openai
93
+ ```
94
+
95
+ `chi self` shows the model and host chi will use. Other settings (multiple hosts, transports, timeouts, the idle recap) are in
48
96
  [Configuration](docs/configuration.md).
49
97
 
50
98
  ## Use
@@ -58,11 +106,12 @@ chi web --open # web UI: this project's sessions (--s
58
106
  chi sessions list # this project's saved sessions (--scope=all: every one)
59
107
  pbpaste | chi note --source slack <id> # background context for a session (no turn)
60
108
  pbpaste | chi send -m "same bug?" <id> # a message to a session, the clipboard quoted above it
109
+ chi send --new --wait -m "review feat/x" # a new session you can watch in the web; prints the answer
61
110
  ```
62
111
 
63
112
  `@shot.png` in a prompt (or a pasted/dropped image in the web UI) shows the model an image, when it can see them; see [Images](docs/cli.md#images).
64
113
 
65
- `/model` switches models, Ctrl-C cancels a turn, and Ctrl-D or `/detach` detaches (the session keeps running; `chi --attach ID` comes back). `/exit` detaches and stops the session's worker too, unless something still needs it (a running turn, another UI); `chi --resume ID` picks the conversation up again. `/exit --delete` also deletes the session once the worker has gone; `chi sessions delete ID` deletes one from the shell.
114
+ `/model` switches models, Ctrl-C cancels a turn, and Ctrl-D or `/detach` detaches (the session keeps running; `chi --attach ID` comes back). `/exit` detaches and stops the session's worker too, unless something still needs it (a running turn, another UI); `chi --resume ID` picks the conversation up again. `/exit --delete` also deletes the session once the worker has gone; `chi sessions delete ID` deletes one from the shell. `/archive` (or `chi sessions archive ID`) hides a session from every list and keeps it for good; `chi sessions list --archived` finds it again.
66
115
 
67
116
  ### Context notes
68
117
 
@@ -78,7 +127,9 @@ reply (a normal session: `chi --attach <id>` steers it).
78
127
 
79
128
  `chi send` is the other half: the text goes in as your message, the same as
80
129
  typing it in the attached terminal or the web composer, and a turn runs. Piped
81
- stdin plus `-m` puts the stdin above the message as a `>` quote.
130
+ stdin plus `-m` puts the stdin above the message as a `>` quote. `chi send --new`
131
+ starts a session with the message instead (it shows in the web at once), and
132
+ `--wait` blocks and prints the answer.
82
133
 
83
134
  ### Send to chi (macOS)
84
135
 
@@ -119,6 +170,7 @@ once, for the session, for the repo, or for the whole rule in the repo.
119
170
  ```sh
120
171
  bundle exec rspec # Ruby specs
121
172
  npm test # web frontend specs
173
+ npm run e2e # web UI happy paths in Chromium, fake model (once: npx playwright install chromium)
122
174
  ```
123
175
 
124
176
  ## License