samagotchi 0.5.1 → 0.7.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 (66) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +77 -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 +24 -1
  7. data/docs/desktop.md +52 -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 +7 -2
  22. data/lib/samagotchi/desktop/macos/App.swift +5 -1
  23. data/lib/samagotchi/desktop/macos/ChiRunner.swift +27 -68
  24. data/lib/samagotchi/desktop/macos/Images.swift +38 -3
  25. data/lib/samagotchi/desktop/macos/Kitty.swift +346 -0
  26. data/lib/samagotchi/desktop/macos/Panel.swift +248 -55
  27. data/lib/samagotchi/desktop/macos/ProcessRunner.swift +74 -0
  28. data/lib/samagotchi/desktop/macos.rb +23 -8
  29. data/lib/samagotchi/desktop_command.rb +1 -1
  30. data/lib/samagotchi/engine.rb +138 -618
  31. data/lib/samagotchi/guardrail_wiring.rb +238 -0
  32. data/lib/samagotchi/hooks/registry.rb +11 -3
  33. data/lib/samagotchi/hooks/stream_watch.rb +93 -0
  34. data/lib/samagotchi/hooks.rb +3 -0
  35. data/lib/samagotchi/kernel_loop.rb +65 -6
  36. data/lib/samagotchi/llm/chat_loop.rb +73 -11
  37. data/lib/samagotchi/llm/openai_chat.rb +4 -2
  38. data/lib/samagotchi/log_subscriber.rb +10 -4
  39. data/lib/samagotchi/plugin/api.rb +8 -0
  40. data/lib/samagotchi/plugin/context.rb +12 -3
  41. data/lib/samagotchi/plugin_tasks.rb +229 -0
  42. data/lib/samagotchi/question_desk.rb +280 -0
  43. data/lib/samagotchi/recap_setup.rb +128 -0
  44. data/lib/samagotchi/session.rb +9 -1
  45. data/lib/samagotchi/sessions_command.rb +255 -0
  46. data/lib/samagotchi/steer.rb +19 -2
  47. data/lib/samagotchi/terminal_ui/attached_loop.rb +18 -5
  48. data/lib/samagotchi/terminal_ui/formatting.rb +4 -2
  49. data/lib/samagotchi/tool_declarations.rb +2 -2
  50. data/lib/samagotchi/tools/delegate.rb +4 -1
  51. data/lib/samagotchi/turn_note.rb +20 -1
  52. data/lib/samagotchi/update_command.rb +1 -1
  53. data/lib/samagotchi/version.rb +1 -1
  54. data/lib/samagotchi/web/app.rb +12 -8
  55. data/lib/samagotchi/web/public/app.js +94 -52
  56. data/lib/samagotchi/web/public/card.js +8 -1
  57. data/lib/samagotchi/web/public/format.js +1 -1
  58. data/lib/samagotchi/web/public/index.html +2 -5
  59. data/lib/samagotchi/web/public/stage_model.js +44 -0
  60. data/lib/samagotchi/web/public/stage_view.js +26 -17
  61. data/lib/samagotchi/web/public/timing.js +9 -3
  62. data/lib/samagotchi/web/public/turn_events.js +18 -5
  63. data/lib/samagotchi/web/public/turn_view.js +68 -16
  64. data/lib/samagotchi/web/server.rb +4 -3
  65. metadata +11 -2
  66. 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: 2992e0608fe9019274ad60016432c5d1a7cc6c3b6656b8f294adcfb30d93b843
4
- data.tar.gz: 94ba5cde3571e628cf79183bd905a0b16a408ab136120cb66557bb5b09ab8c3c
3
+ metadata.gz: ca1d3be1642f5b3a7eb95aad166a1d613e125d5f82d6c79e27f54860c676650f
4
+ data.tar.gz: 839db8c02d67e9dab21143e00d19aa04ff09eddf974598f24a5811719001c70d
5
5
  SHA512:
6
- metadata.gz: 0f8924a312d690bd366f793d0a13bd26f17ffd7db8dfe106b7edbab122348550cd221721225f1ee7db40b7a071dd1f162ad8d2bb6b637dec9f9607dcc09def86
7
- data.tar.gz: 7e5fd2d1d211f9da17621ff2dce4d99c1aa76656c6a37a2308ed3de6e7a4bcf8e1edf506c4ef02473e7391505b1671a6db4da9102231aa20881ed289dd303dab
6
+ metadata.gz: 06d07b5787fa0f5fdcc71c43ad19bbc22f36670030907d841c78ea5ad103569b514c356e493a55b8d669925a35b4ce63ccb6217dcb1209f3e54530477cc1de45
7
+ data.tar.gz: 36edb5314aba266d1724b270ccc6f1645372431b1db3a173519f71ca641b31636531a63fecad7f5ff3af6218fffbca9268a46d0d1d1eb4e030851e519c992ae9
data/CHANGELOG.md CHANGED
@@ -8,6 +8,80 @@ and commands may change between minor versions. How releases are made:
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.7.0] - 2026-09-30
12
+
13
+ ### Added
14
+
15
+ - The desktop helper also sends to agent CLIs (claude, codex, …) in kitty windows: with `kitty.listen_on` copied
16
+ from kitty.conf (and `chi desktop upgrade`), the panel lists them in a "kitty" group next to the sessions; ⏎
17
+ pastes the quote, message and image paths and presses Enter, the new ⌥⏎ only pastes (so several screenshots
18
+ can pile up), and one send can go to chi sessions and kitty windows together. ⌥⏎ no longer inserts a newline
19
+ in the panel (⇧⏎ does). See docs/desktop.md "Agents in kitty".
20
+
21
+ Update with `chi update`. No bundle versions changed.
22
+
23
+ ## [0.6.0] - 2026-09-30
24
+
25
+ ### Added
26
+
27
+ - Plugins can watch a response while it streams: the `:generation_progress`
28
+ hook gets the new thinking and text in batches (2000 chars or a second),
29
+ and `event[:stop_generation]` / `ctx.stop_generation` cut the generation
30
+ while the turn goes on: the model is asked again (`↻ cut by <bundle>,
31
+ asking again (1/1)`), using the `retry.empty_answer` budget. See
32
+ docs/hooks.md, "Watching the stream".
33
+ - loop-guard 0.2.0 watches the model's thinking while it streams: thinking
34
+ that goes round in the same few sentences is cut and the model asked
35
+ again; if the retry loops too, the turn stops with a card. On by default
36
+ (`bundles: loop-guard: thinking: watch: false` turns it off); upgrade the
37
+ bundle with `chi bundle upgrade loop-guard`.
38
+ - The desktop helper shows the model a new session will use, next to "New
39
+ session" (from the new `chi self --model`, which prints the resolved default
40
+ model).
41
+
42
+ ### Changed
43
+
44
+ - `chi web` draws turns with the stage view by default (`web.view: stage`:
45
+ the running turn pinned above the composer). `web.view: turn`
46
+ (`--web-view turn`, `?view=turn`) brings back one block per turn in the
47
+ history.
48
+ - In the stage view, a plugin card with buttons (check-in's Nudge / Keep going
49
+ / Stop) sets the status to "waiting for you" while it's unanswered, and the
50
+ headline shows plain text while the answer streams (no `|`, `**` or `#`).
51
+ - On a phone, the session footer hides the "copy chi --attach" chip.
52
+ - `delegate` and `delegate_result` with `timeout: 0` look once and return at
53
+ once (a negative timeout counts as 0) instead of waiting 600 s.
54
+
55
+ ### Removed
56
+
57
+ - The web chat view (`web.view: chat`, `--web-view chat`, `?view=chat`): the
58
+ stage and turn views draw every turn. A config that still says
59
+ `web.view: chat` warns about the invalid value and uses the default;
60
+ `?view=chat` in a page URL is ignored.
61
+
62
+ ### Fixed
63
+
64
+ - A reload of the web page, or joining a running turn, shows the turn's own
65
+ rows where they were live: the "↻ empty answer / cut by <bundle>, asking
66
+ again" row (also when `chi --attach` joins), an answered or dismissed
67
+ question card, and a line sent while the turn ran (a "steered" bubble in
68
+ that turn; it no longer splits the turn in two, which shifted the timing
69
+ lines of later turns). A guardrail or plugin load warning comes back above
70
+ the turns after it instead of at the end, and a canceled turn's timing
71
+ line says "· canceled" live too. Rows and cards of finished turns last as
72
+ long as the session's worker.
73
+ - A cancel racing a web page's refresh while a question was open could
74
+ freeze the session's worker (a lock-order deadlock).
75
+ - `chi bundle upgrade --dry-run` on a bundle that isn't installed wrote the
76
+ files anyway; it now writes nothing.
77
+ - `chi bundle install` / `upgrade` with a source that doesn't exist says
78
+ "Install failed: source does not exist: …" instead of a Ruby backtrace.
79
+ - `chi sessions prune --keep N` counts only the sessions that stay: a
80
+ leftover scratch session as the newest one no longer makes `--keep 1`
81
+ delete every session.
82
+
83
+ Update with `chi update` (loop-guard 0.2.0: the thinking watch).
84
+
11
85
  ## [0.5.1] - 2026-09-30
12
86
 
13
87
  ### Fixed
@@ -331,7 +405,9 @@ and long-lived sessions.
331
405
  - A macOS desktop helper (`chi desktop install`): a "Send to chi" Service and a
332
406
  hotkey panel that send selected text or the clipboard to your sessions.
333
407
 
334
- [Unreleased]: https://github.com/dm1try/samagotchi/compare/v0.5.1...HEAD
408
+ [Unreleased]: https://github.com/dm1try/samagotchi/compare/v0.7.0...HEAD
409
+ [0.7.0]: https://github.com/dm1try/samagotchi/compare/v0.6.0...v0.7.0
410
+ [0.6.0]: https://github.com/dm1try/samagotchi/compare/v0.5.1...v0.6.0
335
411
  [0.5.1]: https://github.com/dm1try/samagotchi/compare/v0.5.0...v0.5.1
336
412
  [0.5.0]: https://github.com/dm1try/samagotchi/compare/v0.4.0...v0.5.0
337
413
  [0.4.0]: https://github.com/dm1try/samagotchi/compare/v0.3.0...v0.4.0