samagotchi 0.5.0 → 0.6.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 (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +84 -1
  3. data/bin/chi +32 -891
  4. data/docs/architecture.md +8 -1
  5. data/docs/cli.md +12 -13
  6. data/docs/configuration.md +4 -1
  7. data/docs/desktop.md +3 -1
  8. data/docs/hooks.md +69 -4
  9. data/docs/plugins.md +98 -3
  10. data/docs/sessions.md +3 -3
  11. data/lib/samagotchi/bridge/card_store.rb +30 -5
  12. data/lib/samagotchi/bridge/turn_accumulator.rb +7 -4
  13. data/lib/samagotchi/bridge/turn_notice.rb +37 -0
  14. data/lib/samagotchi/bundle_command.rb +652 -0
  15. data/lib/samagotchi/bundles/loop-guard/manifest.yml +4 -4
  16. data/lib/samagotchi/bundles/loop-guard/plugin.rb +214 -2
  17. data/lib/samagotchi/bundles/system/config_modification_protocol.md +3 -0
  18. data/lib/samagotchi/bundles/system/manifest.yml +3 -3
  19. data/lib/samagotchi/bundles/system/self_map.md +2 -1
  20. data/lib/samagotchi/cancellation_controller.rb +42 -1
  21. data/lib/samagotchi/config.rb +2 -2
  22. data/lib/samagotchi/desktop/macos/ChiRunner.swift +20 -5
  23. data/lib/samagotchi/desktop/macos/Panel.swift +31 -3
  24. data/lib/samagotchi/engine.rb +138 -618
  25. data/lib/samagotchi/guardrail_wiring.rb +238 -0
  26. data/lib/samagotchi/hooks/registry.rb +11 -3
  27. data/lib/samagotchi/hooks/stream_watch.rb +93 -0
  28. data/lib/samagotchi/hooks.rb +3 -0
  29. data/lib/samagotchi/kernel_loop.rb +65 -6
  30. data/lib/samagotchi/llm/chat_loop.rb +73 -11
  31. data/lib/samagotchi/llm/openai_chat.rb +16 -4
  32. data/lib/samagotchi/log_subscriber.rb +10 -4
  33. data/lib/samagotchi/plugin/api.rb +8 -0
  34. data/lib/samagotchi/plugin/context.rb +12 -3
  35. data/lib/samagotchi/plugin_tasks.rb +229 -0
  36. data/lib/samagotchi/question_desk.rb +280 -0
  37. data/lib/samagotchi/recap_setup.rb +128 -0
  38. data/lib/samagotchi/reply_wait.rb +9 -0
  39. data/lib/samagotchi/send_command.rb +3 -6
  40. data/lib/samagotchi/session.rb +9 -1
  41. data/lib/samagotchi/sessions_command.rb +255 -0
  42. data/lib/samagotchi/steer.rb +19 -2
  43. data/lib/samagotchi/terminal_ui/attached_loop.rb +18 -5
  44. data/lib/samagotchi/terminal_ui/formatting.rb +4 -2
  45. data/lib/samagotchi/tool_declarations.rb +2 -2
  46. data/lib/samagotchi/tools/delegate.rb +6 -2
  47. data/lib/samagotchi/tools/delegate_wait.rb +26 -8
  48. data/lib/samagotchi/turn_note.rb +20 -1
  49. data/lib/samagotchi/version.rb +1 -1
  50. data/lib/samagotchi/web/app.rb +28 -10
  51. data/lib/samagotchi/web/public/app.js +94 -52
  52. data/lib/samagotchi/web/public/card.js +8 -1
  53. data/lib/samagotchi/web/public/format.js +1 -1
  54. data/lib/samagotchi/web/public/index.html +2 -5
  55. data/lib/samagotchi/web/public/stage_model.js +44 -0
  56. data/lib/samagotchi/web/public/stage_view.js +26 -17
  57. data/lib/samagotchi/web/public/timing.js +9 -3
  58. data/lib/samagotchi/web/public/turn_events.js +18 -5
  59. data/lib/samagotchi/web/public/turn_view.js +80 -16
  60. data/lib/samagotchi/web/server.rb +4 -3
  61. metadata +9 -2
  62. data/lib/samagotchi/web/public/chat_view.js +0 -376
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94cd11abcfad07ad2843b4e0fc2eea368d77ab6080403d308db906270a1832c6
4
- data.tar.gz: 21ac6e7093ee196d98e2ba50979cdbb28f1a3a10ab0e9cac9bad01c88a078daf
3
+ metadata.gz: 220ee751308788beff6b5185350bafe29023706f2e63daf45c8bffab023e173e
4
+ data.tar.gz: 184c4bc6f92476939901813d8a9b20353a73bb64eb5725d3564ca302bf27559e
5
5
  SHA512:
6
- metadata.gz: fa39259864928d70d8cf830d0c7cc15c6865cea75d383484979897800a9f79d6f9fa4d79df3700285d9871e8d0cf5420e9af7c0143ab08e71182befa287b52af
7
- data.tar.gz: 24f0fe6863767b628c1eec6957bf6cf33d8966b45f8b2cbdfd7ab268d6c323835dba8ff09fbdd9359775263693228a7a11f0d125cf0a38d7f044d6932ca7c4b9
6
+ metadata.gz: 7349948ddc41e8ccce71e742d4fc81f51f52290b56a2943efc690adc6e73e4c41fe37fa94dee41c50e20a0c910b3c66a55176955048bf3efa2003e9520c36642
7
+ data.tar.gz: a2059d2df83be31064bfb05f311c7088e777d2901fa00695f4f52208af3b21038471d7180ad26761b6f3f280a7b2f347f560ca39517e0bfcd52715247ba88477
data/CHANGELOG.md CHANGED
@@ -8,6 +8,87 @@ and commands may change between minor versions. How releases are made:
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.6.0] - 2026-09-30
12
+
13
+ ### Added
14
+
15
+ - Plugins can watch a response while it streams: the `:generation_progress`
16
+ hook gets the new thinking and text in batches (2000 chars or a second),
17
+ and `event[:stop_generation]` / `ctx.stop_generation` cut the generation
18
+ while the turn goes on: the model is asked again (`↻ cut by <bundle>,
19
+ asking again (1/1)`), using the `retry.empty_answer` budget. See
20
+ docs/hooks.md, "Watching the stream".
21
+ - loop-guard 0.2.0 watches the model's thinking while it streams: thinking
22
+ that goes round in the same few sentences is cut and the model asked
23
+ again; if the retry loops too, the turn stops with a card. On by default
24
+ (`bundles: loop-guard: thinking: watch: false` turns it off); upgrade the
25
+ bundle with `chi bundle upgrade loop-guard`.
26
+ - The desktop helper shows the model a new session will use, next to "New
27
+ session" (from the new `chi self --model`, which prints the resolved default
28
+ model).
29
+
30
+ ### Changed
31
+
32
+ - `chi web` draws turns with the stage view by default (`web.view: stage`:
33
+ the running turn pinned above the composer). `web.view: turn`
34
+ (`--web-view turn`, `?view=turn`) brings back one block per turn in the
35
+ history.
36
+ - In the stage view, a plugin card with buttons (check-in's Nudge / Keep going
37
+ / Stop) sets the status to "waiting for you" while it's unanswered, and the
38
+ headline shows plain text while the answer streams (no `|`, `**` or `#`).
39
+ - On a phone, the session footer hides the "copy chi --attach" chip.
40
+ - `delegate` and `delegate_result` with `timeout: 0` look once and return at
41
+ once (a negative timeout counts as 0) instead of waiting 600 s.
42
+
43
+ ### Removed
44
+
45
+ - The web chat view (`web.view: chat`, `--web-view chat`, `?view=chat`): the
46
+ stage and turn views draw every turn. A config that still says
47
+ `web.view: chat` warns about the invalid value and uses the default;
48
+ `?view=chat` in a page URL is ignored.
49
+
50
+ ### Fixed
51
+
52
+ - A reload of the web page, or joining a running turn, shows the turn's own
53
+ rows where they were live: the "↻ empty answer / cut by <bundle>, asking
54
+ again" row (also when `chi --attach` joins), an answered or dismissed
55
+ question card, and a line sent while the turn ran (a "steered" bubble in
56
+ that turn; it no longer splits the turn in two, which shifted the timing
57
+ lines of later turns). A guardrail or plugin load warning comes back above
58
+ the turns after it instead of at the end, and a canceled turn's timing
59
+ line says "· canceled" live too. Rows and cards of finished turns last as
60
+ long as the session's worker.
61
+ - A cancel racing a web page's refresh while a question was open could
62
+ freeze the session's worker (a lock-order deadlock).
63
+ - `chi bundle upgrade --dry-run` on a bundle that isn't installed wrote the
64
+ files anyway; it now writes nothing.
65
+ - `chi bundle install` / `upgrade` with a source that doesn't exist says
66
+ "Install failed: source does not exist: …" instead of a Ruby backtrace.
67
+ - `chi sessions prune --keep N` counts only the sessions that stay: a
68
+ leftover scratch session as the newest one no longer makes `--keep 1`
69
+ delete every session.
70
+
71
+ Update with `chi update` (loop-guard 0.2.0: the thinking watch).
72
+
73
+ ## [0.5.1] - 2026-09-30
74
+
75
+ ### Fixed
76
+
77
+ - `chi desktop install` / `upgrade` builds the helper again on Macs whose
78
+ Command Line Tools lack SwiftUI's macro plugin ("plugin for module
79
+ 'SwiftUIMacros' not found", since 0.5.0's image thumbnails).
80
+ - After updating chi and restarting `chi web`, the browser loads the new page
81
+ code on the next reload instead of running the old one for up to an hour.
82
+ - A plugin's warning card stays in sight when its step closes while the turn
83
+ goes on.
84
+ - Sessions on OpenAI-compatible hosts no longer fail to send a request when a
85
+ message with an image also carries text with broken UTF-8 bytes.
86
+ - `delegate` and `delegate_result` return as soon as a delegated session's
87
+ turn fails, instead of waiting out the 10-minute timeout when it failed
88
+ quickly.
89
+
90
+ Update with `chi update`. No bundle versions changed.
91
+
11
92
  ## [0.5.0] - 2026-09-30
12
93
 
13
94
  ### Security
@@ -312,7 +393,9 @@ and long-lived sessions.
312
393
  - A macOS desktop helper (`chi desktop install`): a "Send to chi" Service and a
313
394
  hotkey panel that send selected text or the clipboard to your sessions.
314
395
 
315
- [Unreleased]: https://github.com/dm1try/samagotchi/compare/v0.5.0...HEAD
396
+ [Unreleased]: https://github.com/dm1try/samagotchi/compare/v0.6.0...HEAD
397
+ [0.6.0]: https://github.com/dm1try/samagotchi/compare/v0.5.1...v0.6.0
398
+ [0.5.1]: https://github.com/dm1try/samagotchi/compare/v0.5.0...v0.5.1
316
399
  [0.5.0]: https://github.com/dm1try/samagotchi/compare/v0.4.0...v0.5.0
317
400
  [0.4.0]: https://github.com/dm1try/samagotchi/compare/v0.3.0...v0.4.0
318
401
  [0.3.0]: https://github.com/dm1try/samagotchi/compare/v0.2.0...v0.3.0