samagotchi 0.171.0 → 0.172.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 (202) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +33 -1
  3. data/bin/chi +6 -4
  4. data/docs/architecture.md +24 -7
  5. data/docs/bundles.md +4 -21
  6. data/docs/cli.md +50 -80
  7. data/docs/configuration.md +11 -13
  8. data/docs/context.md +5 -6
  9. data/docs/guardrails.md +57 -96
  10. data/docs/hooks.md +3 -4
  11. data/docs/internals/attached-context.md +6 -7
  12. data/docs/internals/background-tasks.md +4 -3
  13. data/docs/internals/bridge.md +29 -3
  14. data/docs/internals/engine.md +21 -9
  15. data/docs/internals/objectives.md +3 -5
  16. data/docs/internals/participants.md +118 -143
  17. data/docs/internals/prompt-caching.md +4 -5
  18. data/docs/internals/web-frontend.md +33 -14
  19. data/docs/internals/working-set.md +7 -5
  20. data/docs/memory.md +1 -1
  21. data/docs/plugins.md +2 -16
  22. data/docs/scheduling.md +1 -1
  23. data/docs/sessions.md +15 -49
  24. data/docs/sub-agent.md +2 -2
  25. data/docs/system-one.md +2 -2
  26. data/docs/testing.md +56 -7
  27. data/lib/samagotchi/bridge/card_store.rb +1 -0
  28. data/lib/samagotchi/bridge/sse_writer.rb +1 -0
  29. data/lib/samagotchi/bridge/turn_accumulator.rb +0 -1
  30. data/lib/samagotchi/bridge.rb +26 -9
  31. data/lib/samagotchi/bridge_client/event_stream.rb +2 -0
  32. data/lib/samagotchi/bundle_command/test_run.rb +1 -0
  33. data/lib/samagotchi/bundle_command/try/run.rb +1 -0
  34. data/lib/samagotchi/bundles/coordinator/manifest.yml +4 -5
  35. data/lib/samagotchi/bundles/coordinator/plugin.rb +6 -79
  36. data/lib/samagotchi/bundles/coordinator/skill_coordinator.md +1 -16
  37. data/lib/samagotchi/bundles/github-pr/manifest.yml +2 -2
  38. data/lib/samagotchi/bundles/github-pr/plugin.rb +0 -1
  39. data/lib/samagotchi/bundles/inline-widgets/manifest.yml +2 -2
  40. data/lib/samagotchi/bundles/inline-widgets/plugin.rb +4 -5
  41. data/lib/samagotchi/bundles/system/manifest.yml +1 -1
  42. data/lib/samagotchi/client_id.rb +126 -67
  43. data/lib/samagotchi/command_intake.rb +15 -3
  44. data/lib/samagotchi/compat.rb +6 -1
  45. data/lib/samagotchi/context_candidate_choice.rb +1 -3
  46. data/lib/samagotchi/context_candidates.rb +3 -4
  47. data/lib/samagotchi/continue_offer.rb +9 -2
  48. data/lib/samagotchi/delivery.rb +23 -12
  49. data/lib/samagotchi/empty_answer_error.rb +5 -0
  50. data/lib/samagotchi/engine/cards.rb +3 -0
  51. data/lib/samagotchi/engine/context_judge.rb +5 -3
  52. data/lib/samagotchi/engine/events.rb +4 -0
  53. data/lib/samagotchi/engine/hooks.rb +3 -0
  54. data/lib/samagotchi/engine/messages.rb +5 -0
  55. data/lib/samagotchi/engine/model_settings.rb +2 -0
  56. data/lib/samagotchi/engine/models.rb +10 -0
  57. data/lib/samagotchi/engine/objectives.rb +6 -0
  58. data/lib/samagotchi/engine/participants.rb +18 -14
  59. data/lib/samagotchi/engine/plugins.rb +8 -0
  60. data/lib/samagotchi/engine/questions.rb +3 -0
  61. data/lib/samagotchi/engine/recap.rb +1 -0
  62. data/lib/samagotchi/engine/session.rb +4 -0
  63. data/lib/samagotchi/engine/side_requests.rb +9 -0
  64. data/lib/samagotchi/engine/steering.rb +2 -0
  65. data/lib/samagotchi/engine/toolkit.rb +5 -0
  66. data/lib/samagotchi/engine/turn_end.rb +7 -0
  67. data/lib/samagotchi/engine/turn_helpers.rb +8 -0
  68. data/lib/samagotchi/engine/verify.rb +2 -0
  69. data/lib/samagotchi/engine.rb +3 -2
  70. data/lib/samagotchi/grants.rb +28 -22
  71. data/lib/samagotchi/guardrail_wiring.rb +23 -18
  72. data/lib/samagotchi/guardrails/approval_use.rb +59 -0
  73. data/lib/samagotchi/guardrails/approvals.rb +9 -11
  74. data/lib/samagotchi/guardrails/child_boundary.rb +1 -0
  75. data/lib/samagotchi/guardrails/gate.rb +10 -5
  76. data/lib/samagotchi/guardrails/implicit_writers.rb +1 -0
  77. data/lib/samagotchi/guardrails/pair_boundary.rb +6 -6
  78. data/lib/samagotchi/guardrails/participant_refusal.rb +33 -0
  79. data/lib/samagotchi/guardrails/review_paths.rb +2 -3
  80. data/lib/samagotchi/guardrails.rb +1 -1
  81. data/lib/samagotchi/llm_context_strategy.rb +2 -0
  82. data/lib/samagotchi/objectives.rb +1 -4
  83. data/lib/samagotchi/objectives_audit.rb +1 -1
  84. data/lib/samagotchi/objectives_track.rb +1 -1
  85. data/lib/samagotchi/owner_prompt.rb +3 -6
  86. data/lib/samagotchi/parent_report.rb +1 -0
  87. data/lib/samagotchi/participant_messages.rb +9 -4
  88. data/lib/samagotchi/participant_turn_mode.rb +50 -0
  89. data/lib/samagotchi/participants.rb +21 -12
  90. data/lib/samagotchi/participants_watch.rb +2 -2
  91. data/lib/samagotchi/plugin/api.rb +2 -2
  92. data/lib/samagotchi/plugin/attached_context.rb +1 -1
  93. data/lib/samagotchi/plugin/context.rb +0 -4
  94. data/lib/samagotchi/plugin/sessions.rb +1 -25
  95. data/lib/samagotchi/run_options.rb +2 -3
  96. data/lib/samagotchi/send_command.rb +10 -10
  97. data/lib/samagotchi/session.rb +0 -3
  98. data/lib/samagotchi/session_access/contract.rb +1 -10
  99. data/lib/samagotchi/session_access/local.rb +10 -23
  100. data/lib/samagotchi/session_access/remote.rb +9 -20
  101. data/lib/samagotchi/session_access.rb +12 -16
  102. data/lib/samagotchi/session_chain.rb +4 -6
  103. data/lib/samagotchi/session_commands.rb +6 -3
  104. data/lib/samagotchi/session_continue.rb +1 -2
  105. data/lib/samagotchi/session_manager/delivery.rb +25 -5
  106. data/lib/samagotchi/session_manager/lifecycle.rb +12 -0
  107. data/lib/samagotchi/session_manager/listing.rb +5 -0
  108. data/lib/samagotchi/session_manager/spawn.rb +2 -2
  109. data/lib/samagotchi/session_manager/worker_command.rb +9 -0
  110. data/lib/samagotchi/session_participants.rb +12 -8
  111. data/lib/samagotchi/session_review.rb +5 -7
  112. data/lib/samagotchi/session_stores.rb +3 -3
  113. data/lib/samagotchi/share_command.rb +10 -12
  114. data/lib/samagotchi/share_terms.rb +41 -0
  115. data/lib/samagotchi/steer.rb +8 -14
  116. data/lib/samagotchi/system_prompt.rb +16 -25
  117. data/lib/samagotchi/terminal_ui/attach_launcher.rb +2 -1
  118. data/lib/samagotchi/terminal_ui/attached_loop/exit_commands.rb +1 -0
  119. data/lib/samagotchi/terminal_ui/attached_loop/queueing.rb +1 -0
  120. data/lib/samagotchi/terminal_ui/attached_loop/sending.rb +2 -0
  121. data/lib/samagotchi/terminal_ui/formatting.rb +15 -17
  122. data/lib/samagotchi/terminal_ui/participant_commands.rb +2 -2
  123. data/lib/samagotchi/terminal_ui/status_row.rb +2 -2
  124. data/lib/samagotchi/terminal_ui.rb +1 -2
  125. data/lib/samagotchi/testing/sessions.rb +2 -10
  126. data/lib/samagotchi/tool_runner.rb +8 -9
  127. data/lib/samagotchi/toolkit.rb +4 -22
  128. data/lib/samagotchi/toolkit_suggest.rb +3 -3
  129. data/lib/samagotchi/tools/deferred_tools.rb +1 -0
  130. data/lib/samagotchi/tools/execute.rb +11 -45
  131. data/lib/samagotchi/tools/leftovers.rb +122 -0
  132. data/lib/samagotchi/tools/memory.rb +70 -26
  133. data/lib/samagotchi/tools/task_get.rb +1 -0
  134. data/lib/samagotchi/tools/task_list.rb +3 -2
  135. data/lib/samagotchi/tools/task_record.rb +6 -4
  136. data/lib/samagotchi/tools/task_runtime.rb +199 -20
  137. data/lib/samagotchi/tools/task_wait.rb +4 -3
  138. data/lib/samagotchi/turn_context.rb +1 -1
  139. data/lib/samagotchi/turn_origin.rb +1 -1
  140. data/lib/samagotchi/turn_stages/context_judge.rb +4 -4
  141. data/lib/samagotchi/turn_stages/objectives.rb +2 -2
  142. data/lib/samagotchi/turn_stages/toolkit_suggestion.rb +2 -2
  143. data/lib/samagotchi/update_hint.rb +3 -1
  144. data/lib/samagotchi/verify_fresh.rb +1 -1
  145. data/lib/samagotchi/verify_fresh_origin.rb +13 -11
  146. data/lib/samagotchi/version.rb +1 -1
  147. data/lib/samagotchi/web/app.rb +3 -5
  148. data/lib/samagotchi/web/participant_access.rb +14 -18
  149. data/lib/samagotchi/web/participant_review.rb +3 -4
  150. data/lib/samagotchi/web/participant_show.rb +4 -3
  151. data/lib/samagotchi/web/participant_view.rb +3 -3
  152. data/lib/samagotchi/web/participants_admin.rb +21 -40
  153. data/lib/samagotchi/web/public/app.js +5 -47
  154. data/lib/samagotchi/web/public/data.js +2 -10
  155. data/lib/samagotchi/web/public/delivery_line.js +17 -60
  156. data/lib/samagotchi/web/public/index.html +10 -30
  157. data/lib/samagotchi/web/public/live_turn.js +1 -1
  158. data/lib/samagotchi/web/public/owner_claim.js +2 -2
  159. data/lib/samagotchi/web/public/participant_bar.js +4 -5
  160. data/lib/samagotchi/web/public/participant_names.js +14 -10
  161. data/lib/samagotchi/web/public/participants_panel.js +29 -62
  162. data/lib/samagotchi/web/public/reload_check.js +2 -3
  163. data/lib/samagotchi/web/public/send_turn.js +4 -23
  164. data/lib/samagotchi/web/public/session_actions.js +4 -45
  165. data/lib/samagotchi/web/public/session_fields.js +0 -1
  166. data/lib/samagotchi/web/public/session_state.js +0 -3
  167. data/lib/samagotchi/web/public/session_view.js +2 -3
  168. data/lib/samagotchi/web/public/settings_panel.js +4 -18
  169. data/lib/samagotchi/web/public/stage_answer.js +56 -0
  170. data/lib/samagotchi/web/public/stage_asking.js +1 -1
  171. data/lib/samagotchi/web/public/stage_cloud.js +93 -0
  172. data/lib/samagotchi/web/public/stage_dom.js +100 -0
  173. data/lib/samagotchi/web/public/stage_handoff.js +154 -0
  174. data/lib/samagotchi/web/public/stage_pager.js +59 -0
  175. data/lib/samagotchi/web/public/stage_quiet_clock.js +52 -0
  176. data/lib/samagotchi/web/public/stage_view.js +90 -411
  177. data/lib/samagotchi/web/public/start_page.js +12 -33
  178. data/lib/samagotchi/web/public/start_settings.js +24 -78
  179. data/lib/samagotchi/web/public/start_toolkit.js +6 -10
  180. data/lib/samagotchi/web/public/stream_handlers.js +1 -9
  181. data/lib/samagotchi/web/public/turn_block.js +3 -7
  182. data/lib/samagotchi/web/public/turn_events.js +15 -6
  183. data/lib/samagotchi/web/public/turn_pieces.js +3 -4
  184. data/lib/samagotchi/web/public/viewer_self.js +8 -2
  185. data/lib/samagotchi/web/qr.rb +1 -1
  186. data/lib/samagotchi/web/session_control.rb +3 -1
  187. data/lib/samagotchi/web/session_create.rb +5 -71
  188. data/lib/samagotchi/web/session_summary.rb +1 -4
  189. data/lib/samagotchi/web/verify_fresh_routes.rb +8 -7
  190. data/lib/samagotchi/web/viewer.rb +3 -3
  191. data/lib/samagotchi/worker.rb +16 -14
  192. data/lib/samagotchi/worker_inbound.rb +4 -3
  193. data/lib/samagotchi/worker_link.rb +17 -0
  194. data/lib/samagotchi/working_set.rb +87 -28
  195. metadata +13 -8
  196. data/lib/samagotchi/guardrails/review_boundary.rb +0 -99
  197. data/lib/samagotchi/participant_mode.rb +0 -86
  198. data/lib/samagotchi/review_apply.rb +0 -131
  199. data/lib/samagotchi/review_command.rb +0 -123
  200. data/lib/samagotchi/review_start.rb +0 -196
  201. data/lib/samagotchi/web/public/review_apply.js +0 -34
  202. data/lib/samagotchi/web/public/review_start.js +0 -55
@@ -6,7 +6,6 @@ require_relative "../llm_context_override"
6
6
  require_relative "../model_profile"
7
7
  require_relative "../parent_answers_command"
8
8
  require_relative "../prompt_history"
9
- require_relative "../review_start"
10
9
  require_relative "../send_command"
11
10
  require_relative "../session"
12
11
  require_relative "../session_access"
@@ -22,8 +21,7 @@ require_relative "../turn_flow"
22
21
  module Samagotchi
23
22
  module Web
24
23
  # POST /api/sessions: a new session (handle_create), a continue
25
- # (handle_continue, continue_from), a review fork (request_review,
26
- # handle_review_fork), and their refusals (continue_refusal,
24
+ # (handle_continue, continue_from), and their refusals (continue_refusal,
27
25
  # create_refusal, parent_gate, vision_refused) and request readers
28
26
  # (request_toolkit, request_parent_answers, request_llm_context,
29
27
  # request_thinking). Included in App: its ROUTES name handle_create, and
@@ -32,9 +30,6 @@ module Samagotchi
32
30
  # ivars (@manager, @session_class, @state_dir, @hub) answer. See
33
31
  # docs/architecture.md (chi web's routes).
34
32
  module SessionCreate
35
- # What a review session's create refuses beside review.
36
- REVIEW_REFUSES = %w[prompt preview idle continues].freeze
37
-
38
33
  # What a continue takes from the previous link: refused beside it.
39
34
  CONTINUE_TAKES = %w[dir llm_context thinking settings toolkit tools no_tools parent_answers].freeze
40
35
 
@@ -54,11 +49,7 @@ module Samagotchi
54
49
  # idle: a session with no first turn, for a first message with
55
50
  # images (the page uploads them into it, then sends the turn).
56
51
  idle = body["idle"] == true
57
- review, error = request_review(body)
58
- return error if error
59
- return handle_review_fork(body, review) if review&.from
60
-
61
- if prompt.to_s.strip.empty? && !idle && !review
52
+ if prompt.to_s.strip.empty? && !idle
62
53
  return error_response(400, "missing_fields", "prompt is required")
63
54
  end
64
55
  return handle_continue(body, prompt, idle) if body.key?("continues")
@@ -118,19 +109,12 @@ module Samagotchi
118
109
  parent_answers: parent_answers)
119
110
  folder[:setup] = setup unless setup.empty?
120
111
  begin
121
- session = if review
122
- ReviewStart.start(subjects: review.subjects, dir: dir || start_dir, model: folder[:model_name],
123
- setup: setup, state_dir: @state_dir)
124
- else
125
- @manager.spawn_session(prompt: idle ? nil : prompt.to_s,
126
- client_id: body["client_id"] || ClientId::WEB_CREATE,
127
- state_dir: @state_dir, **folder)
128
- end
112
+ session = @manager.spawn_session(prompt: idle ? nil : prompt.to_s,
113
+ client_id: body["client_id"] || ClientId::WEB_CREATE,
114
+ state_dir: @state_dir, **folder)
129
115
  rescue ModelProfile::MissingModel => e
130
116
  # No model configured, or one qualified with an unknown host.
131
117
  return error_response(400, "invalid_model", e.message)
132
- rescue ReviewStart::Refused => e
133
- return error_response(400, "invalid_review", e.message)
134
118
  end
135
119
  # The worker's Bridge is the single live transport: wait (bounded) for
136
120
  # it so the client can attach without client-side polling.
@@ -189,56 +173,6 @@ module Samagotchi
189
173
  first_turn_id: session.first_turn_id))
190
174
  end
191
175
 
192
- # The create's review: {subjects: [paths], from: id} (chi review, the
193
- # page's Start review) as a SessionAccess::Review: [review, nil] (nil
194
- # when absent), or [nil, a 400 invalid_review]. A review session
195
- # starts idle: prompt, preview, idle and continues are refused beside
196
- # it. Its subjects are checked where it starts (ReviewStart).
197
- def request_review(body)
198
- return [nil, nil] unless body.key?("review")
199
-
200
- raw = body["review"]
201
- subjects = raw.is_a?(Hash) ? raw.fetch("subjects", []) : nil
202
- from = raw.is_a?(Hash) ? raw["from"] : nil
203
- unless subjects.is_a?(Array) && subjects.all?(String) && (from.nil? || (from.is_a?(String) && !from.strip.empty?))
204
- return [nil, error_response(400, "invalid_review", "review is {subjects: [project files], from: a session id}")]
205
- end
206
- if (fields = REVIEW_REFUSES.select { |key| body.key?(key) }).any?
207
- return [nil, error_response(400, "invalid_review", "a review session starts idle; leave out #{fields.join(", ")}")]
208
- end
209
-
210
- [SessionAccess::Review.new(subjects: subjects, from: from&.strip), nil]
211
- end
212
-
213
- # POST /api/sessions with review.from: a review fork of that session
214
- # (ReviewStart.fork), in its folder and with its setup (dir and the
215
- # setup fields refused beside it, as for a continue), on model when
216
- # given. 201 as a create's; 400 invalid_review (a subject, its folder
217
- # gone), invalid_model, ambiguous_id; 404 not_found.
218
- def handle_review_fork(body, review)
219
- if (fields = CONTINUE_TAKES.select { |key| body.key?(key) }).any?
220
- return error_response(400, "invalid_review",
221
- "a review of a session takes its folder and setup; leave out #{fields.join(", ")}")
222
- end
223
-
224
- model = (body["model"] || body["model_name"]).to_s.strip
225
- begin
226
- session = ReviewStart.fork(from: review.from, subjects: review.subjects, model: model.empty? ? nil : model,
227
- state_dir: @state_dir)
228
- rescue ReviewStart::Refused => e
229
- return error_response(400, "invalid_review", e.message)
230
- rescue ModelProfile::MissingModel => e
231
- return error_response(400, "invalid_model", e.message)
232
- rescue Session::AmbiguousId => e
233
- return refusal_response(400, "ambiguous_id", e, ids: e.ids)
234
- rescue ArgumentError => e
235
- return error_response(404, "not_found", e.message)
236
- end
237
- port = await_worker_link(session.id).then { |link| link.live? ? link.port : nil }
238
- @hub&.touch(session.id)
239
- json_response(201, session_to_json(session).merge(bridge_port: port, model_warning: session.model_warning))
240
- end
241
-
242
176
  # The previous link's parent_answers and the model the new one runs,
243
177
  # for #create_refusal; nil when the previous link isn't there
244
178
  # (continue_from says so).
@@ -26,7 +26,7 @@ module Samagotchi
26
26
  # compares with ==, a 0.156 page reads them by name).
27
27
  WEB_KEYS = %i[id status mode model_name working_directory created_at updated_at last_prompt short_id test_run
28
28
  used_memory_names preloaded_memory_names muted_memory_names prompt_notes parent_id delegate
29
- continues review first_preview title owner recap auto_title ctx_pct tokens memory_index side
29
+ continues first_preview title owner recap auto_title ctx_pct tokens memory_index side
30
30
  archived project_root bridge_up worker_version worker_features worker_compat pending_question pending_card
31
31
  last_turn verdicts verify_fresh last_verdict].freeze
32
32
 
@@ -84,9 +84,6 @@ module Samagotchi
84
84
  # The session this one continues (the previous link of its
85
85
  # chain), else nil: the lists draw chains from it.
86
86
  continues: row.continues,
87
- # A review session's {subjects, from} (SessionReview), else nil:
88
- # the session bar offers Start review on the others.
89
- review: session.review&.to_file,
90
87
  first_preview: first_preview_for(session),
91
88
  # The session's own name (/title), else nil: the pages show it in
92
89
  # place of the first message.
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "../delivery"
4
- require_relative "../participant_mode"
4
+ require_relative "../worker_link"
5
5
  require_relative "../participant_messages"
6
6
  require_relative "../participants"
7
7
  require_relative "../session"
@@ -16,7 +16,7 @@ module Samagotchi
16
16
  # with their fresh children's spend; a worker that predates
17
17
  # participants' turns) and audited like one (participants.log,
18
18
  # verify_fresh); their child runs under the boundary their grant has
19
- # here now (ParticipantMode.live_for), saved on the child. See
19
+ # here now (Grants::PAIR_MODE), saved on the child. See
20
20
  # docs/internals/participants.md (Verify fresh).
21
21
  module VerifyFreshRoutes
22
22
  private
@@ -48,7 +48,7 @@ module Samagotchi
48
48
  return verify_fresh_refused(clicker, of, *refused, runner: runner)
49
49
  end
50
50
 
51
- mode = runner && ParticipantMode.live_for(session, runner, state_dir: default_state_dir)
51
+ mode = runner && Grants::PAIR_MODE
52
52
  child = VerifyFresh.start(id, of: of, author: runner&.author, mode: mode, state_dir: default_state_dir,
53
53
  spawn: fresh_spawn)
54
54
  audit_verify_fresh(clicker, of, status: "accepted", child: child.id, mode: mode&.to_s, runner: runner)
@@ -81,14 +81,15 @@ module Samagotchi
81
81
  def field_of(record, key) = record && (record[key] || record[key.to_s])
82
82
 
83
83
  # A live worker must support VerifyFresh's parent checks. For a
84
- # participant's child it must also have the review boundary.
84
+ # participant's child it must also run their turns under the owner's
85
+ # rules (Delivery::PAIR_FEATURE).
85
86
  def fresh_worker_refusal(session, participant: false)
86
- features = ParticipantMode.live_features(session, default_state_dir)
87
+ features = WorkerLink.live_features(session.id, state_dir: default_state_dir)
87
88
  return nil if features.nil?
88
89
  return [409, VerifyAnchor::UNAVAILABLE["error"], VerifyAnchor::UNAVAILABLE["detail"]] if VerifyAnchor.worker_unavailable?(features)
89
- return nil unless participant && !features.include?(Delivery::REVIEW_FEATURE)
90
+ return nil unless participant && !features.include?(Delivery::PAIR_FEATURE)
90
91
 
91
- [409, Delivery::REVIEW_UNAVAILABLE["error"], Delivery::REVIEW_UNAVAILABLE["detail"]]
92
+ [409, Delivery::PAIR_UNAVAILABLE["error"], Delivery::PAIR_UNAVAILABLE["detail"]]
92
93
  end
93
94
 
94
95
  def verify_fresh_refused(clicker, of, status, code, detail, runner: nil)
@@ -29,9 +29,9 @@ module Samagotchi
29
29
  def owner? = kind == "owner"
30
30
 
31
31
  # The client id chi web gives this viewer's turns (it replaces the
32
- # body's): a participant's review:<grant id> (ClientId.review), so the
32
+ # body's): a participant's participant:<grant id> (ClientId.participant), so the
33
33
  # page can tell its own turns; nil for the owner (each tab names its own).
34
- def client_id = owner? ? nil : ClientId.review(id)
34
+ def client_id = owner? ? nil : ClientId.participant(id)
35
35
 
36
36
  def can?(name) = can.include?(name.to_s)
37
37
 
@@ -48,7 +48,7 @@ module Samagotchi
48
48
  # docs/internals/web-frontend.md, The viewer).
49
49
  Viewer::CAPABILITIES = %w[
50
50
  sessions models prompt_history push context working_set working_set_items participants_admin rename images
51
- session_controls revise apply answer_cards render block_renderers stop_any_turn steer_any_turn
51
+ session_controls revise answer_cards render block_renderers stop_any_turn steer_any_turn
52
52
  ].freeze
53
53
 
54
54
  # A participant's capabilities: names of their own (the owner's are
@@ -848,16 +848,22 @@ module Samagotchi
848
848
  end
849
849
 
850
850
  # Why the participant +author+ ("p:<id>") may run no more turns, nil
851
- # while they may (and for the owner): "revoked" when participants.json
852
- # has no active entry for them (revoked, expired, never invited),
853
- # "cap_reached" once they spent their cap (its own, else the config's;
854
- # their turns and the side requests they caused, Engine#metrics). The
855
- # owner hears the cap once per cap (#cap_notice).
851
+ # while they may (and for the owner): by ParticipantTurnMode, "outdated"
852
+ # for an older chi's read-only invite (an entry, or a Verify fresh child
853
+ # saved, without "pair": this chi runs no read-only turn), "revoked" when
854
+ # participants.json has no current entry for them (revoked, expired,
855
+ # never invited) or they aren't invited to this (the owner's own Verify
856
+ # fresh child), "cap_reached" once they spent their cap (its own,
857
+ # else the config's; their turns and the side requests they caused,
858
+ # Engine#metrics). The owner hears the cap once per cap (#cap_notice).
856
859
  def participant_refusal(author)
857
860
  author = Steer.sender_author(author) or return nil
858
861
 
859
862
  entry = participant_entry(author)
860
- return "revoked" unless entry&.active?(Time.now)
863
+ case ParticipantTurnMode.of(entry: entry, session: @session, now: Time.now)
864
+ when :outdated then return "outdated"
865
+ when :revoked, :not_invited then return "revoked"
866
+ end
861
867
 
862
868
  cap = participant_cap(entry)
863
869
  return nil if participant_spend(author) < cap
@@ -875,7 +881,7 @@ module Samagotchi
875
881
 
876
882
  entry = participant_entry(author)
877
883
  name = participant_label(author, entry&.name)
878
- return format(REVOKED_STOP, name: name) if reason == "revoked"
884
+ return format(REVOKED_STOP, name: name) if %w[revoked outdated].include?(reason)
879
885
 
880
886
  format(CAP_STOP, name: name, cap: participant_cap(entry))
881
887
  end
@@ -908,23 +914,19 @@ module Samagotchi
908
914
 
909
915
  # The owner's notice that a participant reached their cap: once per
910
916
  # participant and cap (a raised cap that is reached again says so again).
911
- # A pair participant's says turns (their turns act), a review one's
912
- # comments.
913
917
  def cap_notice(author, entry, cap)
914
918
  key = [author, cap]
915
919
  return if (@cap_noticed ||= Set.new).include?(key)
916
920
 
917
921
  @cap_noticed << key
918
922
  id = Steer.participant_id(author)
919
- text = ParticipantMode.for_turn(@session, entry) == ParticipantMode::PAIR ? PAIR_CAP_NOTICE : CAP_NOTICE
920
923
  @engine.announce(type: :hook_notice, hook: Engine::PARTICIPANTS_HOOK, level: :warn, between_turns: true,
921
- text: format(text, name: participant_label(author, entry.name), cap: cap, session: participants_id[0, 8], id: id))
924
+ text: format(CAP_NOTICE, name: participant_label(author, entry.name), cap: cap,
925
+ session: participants_id[0, 8], id: id))
922
926
  end
923
927
 
924
- CAP_NOTICE = "%<name>s reached their $%<cap>.2f review cap: their comments are refused until you raise it " \
928
+ CAP_NOTICE = "%<name>s reached their $%<cap>.2f cap: their turns stop and are refused until you raise it " \
925
929
  "(chi share cap %<session>s %<id>s AMOUNT)."
926
- PAIR_CAP_NOTICE = "%<name>s reached their $%<cap>.2f cap: their turns stop and are refused until you raise it " \
927
- "(chi share cap %<session>s %<id>s AMOUNT)."
928
930
  # The reason a pair turn stopped at its participant's cap (the turn's
929
931
  # "stopped the turn: …" notice).
930
932
  CAP_STOP = "%<name>s reached their $%<cap>.2f cap"
@@ -240,13 +240,14 @@ module Samagotchi
240
240
  # for it, --new --wait, names it) and who sent it when no person did
241
241
  # (Session#first_turn_client_id: a delegating parent, a schedule). A
242
242
  # delegate child's task is its parent's even without the field (one
243
- # spawned by an older chi, or by a caller that names no sender). NONE
244
- # for a person's session from before either field.
243
+ # spawned by an older chi, or by a caller that names no sender). Else
244
+ # the owner's (ClientId::FIRST_PROMPT): a person's session saves no
245
+ # sender for its first prompt, nor did one from before either field.
245
246
  # @return [TurnOrigin]
246
247
  def initial_origin
247
248
  client_id = @session.first_turn_client_id
248
249
  client_id ||= ClientId.delegate(@session.parent_id) if @session.delegate? && @session.parent_id
249
- TurnOrigin.of(client_id: client_id, enqueued_id: @session.first_turn_id)
250
+ TurnOrigin.of(client_id: client_id || ClientId::FIRST_PROMPT, enqueued_id: @session.first_turn_id)
250
251
  end
251
252
 
252
253
  # The first prompt as a command (queued): the session was saved as
@@ -8,6 +8,7 @@ require_relative "compat"
8
8
  require_relative "worker_sidecar"
9
9
  require_relative "bridge_client"
10
10
  require_relative "chi_invocation"
11
+ require_relative "session_paths"
11
12
 
12
13
  module Samagotchi
13
14
  # Whether a session's worker can be reached, and how: the one question
@@ -145,6 +146,22 @@ module Samagotchi
145
146
  Live.new(sidecar: sidecar, owner: owner)
146
147
  end
147
148
 
149
+ # The features of session +session_id+'s live worker (WorkerSidecar#features,
150
+ # a read-only look), nil without a live worker or when it can't be read:
151
+ # what chi web and chi share check before they send it a participant's
152
+ # turn or invite anyone to it.
153
+ # @param state_dir [String, nil] the sessions' state dir (nil: the default)
154
+ # @return [Array<String>, nil]
155
+ def live_features(session_id, state_dir: nil)
156
+ return nil if session_id.to_s.empty?
157
+
158
+ dir = SessionPaths.session_dir(session_id, state_dir: state_dir || SessionPaths.default_state_dir)
159
+ link = resolve(dir, unlink: false)
160
+ link.live? ? link.features : nil
161
+ rescue StandardError # degrade-ok: an unreadable sidecar reads as no live worker (the callers' fallback)
162
+ nil
163
+ end
164
+
148
165
  # @return [BridgeClient, nil] a client for the session's Live worker
149
166
  def client(session_id, session_dir:, unlink: true, host: BridgeClient::HOST, read_timeout: BridgeClient::READ_TIMEOUT)
150
167
  link = resolve(session_dir, unlink: unlink)
@@ -113,13 +113,15 @@ module Samagotchi
113
113
  # LLMContextView takes it (the session's current one)
114
114
  # @param stat [#call] File.stat, or a stand-in (specs)
115
115
  # @param pins [Array<WorkingSetPin>] the session's pins
116
+ # @param root [String] the system memories folder
116
117
  # @return [Snapshot]
117
- def build(conversation, cwd:, strategy:, stat: File.method(:stat), pins: [])
118
+ def build(conversation, cwd:, strategy:, stat: File.method(:stat), pins: [],
119
+ root: Tools::MemoryRead.memories_dir("system"))
118
120
  conversation = Array(conversation)
119
121
  view = LLMContextView.new(strategy: strategy)
120
122
  pinned = pins.to_set { |pin| [pin.kind, pin.key] }
121
123
  items = all_touches(conversation, cwd, view).group_by { |touch| [touch.kind, touch.key] }.map do |(kind, key), group|
122
- item(kind, key, group, conversation, view, stat, pinned.include?([kind, key]))
124
+ item(kind, key, group, conversation, view, stat, pinned.include?([kind, key]), root)
123
125
  end
124
126
  Snapshot.new(items: items, at: conversation.size, adds: pending_adds(conversation))
125
127
  end
@@ -239,9 +241,6 @@ module Samagotchi
239
241
  MEMORY_WRITE => "memory_write", WEB_FETCH => "fetch" }.freeze
240
242
  # A range read past the file's end says so after its lines (Tools::Read).
241
243
  CLAMP_NOTE = /\n\[read: end_line \d+ exceeds \d+ lines; returning lines \d+-\d+\]\z/
242
- # How memory_read appends a model overlay (Tools::MemoryRead.call).
243
- OVERLAY_HEAD = "#{Tools::MemoryRead::SEPARATOR}Model-specific guidance (".freeze
244
-
245
244
  # The timeline of the item +kind+/+key+ (#build's identity): every run
246
245
  # that touched it, edits and writes too, by the same walk #build and
247
246
  # #outputs_of use (one all_touches), so the projection, the steer and
@@ -263,8 +262,8 @@ module Samagotchi
263
262
  # diff from what that read sent; nil when no read of it has a stamp (a
264
263
  # session saved before memory stamps). +root+: the memories folder
265
264
  # (MemoryPaths.system_dir: the projects' folders are under it); a stamped
266
- # path (entry or overlay) outside it is never read, nil then. +read+:
267
- # File.read, or a stand-in.
265
+ # or resolved path outside it is never read, nil then. +read+: File.read,
266
+ # or a stand-in.
268
267
  # @return [Now, nil]
269
268
  def memory_now(conversation, key:, strategy:, cwd:, root:, read: ->(path) { File.read(path, encoding: "UTF-8") })
270
269
  conversation = Array(conversation)
@@ -276,10 +275,25 @@ module Samagotchi
276
275
  return nil unless entries
277
276
 
278
277
  names = found_names(touch.run)
279
- return nil unless names.all? { |name| entries[name].is_a?(Hash) && memory_paths?(entries[name], root) }
278
+ current_entries = names.map do |name|
279
+ entry = entries[name]
280
+ return nil unless entry.is_a?(Hash)
281
+
282
+ if resolution_metadata?(entry)
283
+ resolved = resolve_memory(name, entry, system_dir: root)
284
+ if resolved != :stamped_paths
285
+ return Now.new(text: nil, diff: nil, gone: true) unless resolved
286
+
287
+ entry = resolved_memory_entry(resolved)
288
+ end
289
+ end
290
+ return nil unless memory_paths?(entry, root)
291
+
292
+ entry
293
+ end
280
294
 
281
295
  had = body_of(touch.run.text)
282
- bodies = names.map { |name| memory_body(name, entries[name], read) }
296
+ bodies = names.zip(current_entries).map { |name, entry| memory_body(name, entry, read) }
283
297
  return Now.new(text: nil, diff: nil, gone: true) if bodies.any?(&:nil?)
284
298
 
285
299
  # Here, not at load: the testing kit loads WorkingSet and keeps a file budget (sandbox_spec).
@@ -306,6 +320,30 @@ module Samagotchi
306
320
  end
307
321
  end
308
322
 
323
+ def project_dir_within_root?(path, root)
324
+ return true if path.nil?
325
+
326
+ File.expand_path(path.to_s).start_with?(File.join(File.expand_path(root.to_s), ""))
327
+ end
328
+
329
+ def resolution_metadata?(entry)
330
+ %i[requested_scope model_key fallback_model_key project_dir].all? do |key|
331
+ entry.key?(key) || entry.key?(key.to_s)
332
+ end
333
+ end
334
+
335
+ def resolve_memory(name, entry, system_dir:)
336
+ return :stamped_paths unless project_dir_within_root?(field(entry, :project_dir), system_dir)
337
+
338
+ Tools::MemoryRead.resolve(name, scope: field(entry, :requested_scope), model_key: field(entry, :model_key),
339
+ fallback_model_key: field(entry, :fallback_model_key),
340
+ project_dir: field(entry, :project_dir), system_dir: system_dir)
341
+ end
342
+
343
+ def resolved_memory_entry(resolved)
344
+ { path: resolved.path, overlay: resolved.overlay_path && { path: resolved.overlay_path } }
345
+ end
346
+
309
347
  def event(touch, conversation, view, cwd)
310
348
  run = touch.run
311
349
  name = run.call[:name].to_s
@@ -321,7 +359,10 @@ module Samagotchi
321
359
  diff = saved_diff(conversation[run.index], run.ref.run)
322
360
  when MEMORY_READ
323
361
  memory = memory_part(touch, conversation)
324
- text = text.delete_suffix(overlay_tail(text)) if memory&.overlay
362
+ if memory&.overlay
363
+ overlay_key = Tools::MemoryRead.overlay_key(touch.key, memory.overlay_path)
364
+ text = text.delete_suffix(overlay_tail(text, overlay_key)) if overlay_key
365
+ end
325
366
  when MEMORY_WRITE
326
367
  text = run.call[:content].to_s
327
368
  end
@@ -372,17 +413,15 @@ module Samagotchi
372
413
  path = field(entry, :path).to_s
373
414
  overlay = field(entry, :overlay)
374
415
  overlay_path = overlay.is_a?(Hash) ? field(overlay, :path).to_s : nil
375
- tail = touch.share == 1 && overlay_path ? overlay_tail(body_of(touch.run.text)) : ""
416
+ overlay_key = overlay_path && Tools::MemoryRead.overlay_key(touch.key, overlay_path)
417
+ tail = touch.share == 1 && overlay_key ? overlay_tail(body_of(touch.run.text), overlay_key) : ""
376
418
  MemoryPart.new(scope: memory_scope(path), path: path, overlay_path: overlay_path,
377
- overlay: tail.empty? ? nil : tail.sub(/\A#{Regexp.escape(OVERLAY_HEAD)}[^\n]*\n/o, ""))
419
+ overlay: tail.empty? ? nil : tail.sub(Tools::MemoryRead.overlay_prefix(overlay_key), ""))
378
420
  end
379
421
 
380
422
  # The overlay memory_read appended to +text+ (its separator and head
381
423
  # line included), or "".
382
- def overlay_tail(text)
383
- at = text.rindex(OVERLAY_HEAD)
384
- at ? text[at..] : ""
385
- end
424
+ def overlay_tail(text, key) = Tools::MemoryRead.overlay_tail(text, key)
386
425
 
387
426
  # A memory's scope by where its file is: a project's under
388
427
  # memories/projects/<key>/, a system one's in memories/.
@@ -397,8 +436,8 @@ module Samagotchi
397
436
  return body unless overlay.is_a?(Hash)
398
437
 
399
438
  overlay_path = field(overlay, :path).to_s
400
- model_key = File.basename(overlay_path, ".md").delete_prefix("#{name}.")
401
- "#{body}#{Tools::MemoryRead::SEPARATOR}Model-specific guidance (#{model_key}):\n#{read.call(overlay_path)}"
439
+ model_key = Tools::MemoryRead.overlay_key(name, overlay_path)
440
+ model_key ? Tools::MemoryRead.append_overlay(body, read.call(overlay_path), model_key) : body
402
441
  rescue SystemCallError
403
442
  nil
404
443
  end
@@ -458,7 +497,7 @@ module Samagotchi
458
497
  names - missing
459
498
  end
460
499
 
461
- def item(kind, key, group, conversation, view, stat, pinned)
500
+ def item(kind, key, group, conversation, view, stat, pinned, root)
462
501
  first = group.first
463
502
  contents = group.select(&:content)
464
503
  tokens = contents.sum { |touch| touch.sent.length / TokenUsage::CHARS_PER_TOKEN / touch.share }.ceil
@@ -466,7 +505,7 @@ module Samagotchi
466
505
  contents.all? { |touch| dropped?(touch, conversation) } ? DROPPED : FORGOTTEN
467
506
  elsif kind == FILE && changed?(key, group.last.run, conversation, stat)
468
507
  STALE
469
- elsif kind == MEMORY && memory_changed?(key, group.last.run, conversation, stat)
508
+ elsif kind == MEMORY && memory_changed?(key, group.last.run, conversation, stat, root)
470
509
  STALE
471
510
  else
472
511
  LIVE
@@ -511,12 +550,10 @@ module Samagotchi
511
550
  end
512
551
 
513
552
  # Whether the memory +key+ has changed since +run+'s stamp (the item's
514
- # latest run): a memory_read's stamp has one entry per name it read, each
515
- # with the file that answered and the model overlay read with it. No stamp
516
- # - a session saved before memory stamps, or a reader that only knows file
517
- # stamps - means not changed. The memory is gone, or its overlay is, as
518
- # well: changed.
519
- def memory_changed?(key, run, conversation, stat)
553
+ # latest run): re-resolve stamps with request metadata, then compare the
554
+ # answering files. Older path-only stamps compare their stamped files.
555
+ # No stamp means not changed; a missing entry or overlay is changed.
556
+ def memory_changed?(key, run, conversation, stat, root)
520
557
  stamp = stamp_hash(conversation[run.index], run.ref.run)
521
558
  return false unless stamp
522
559
 
@@ -524,11 +561,31 @@ module Samagotchi
524
561
  entry = entries.is_a?(Hash) ? field(entries, key) : nil
525
562
  return false unless entry.is_a?(Hash)
526
563
 
564
+ if resolution_metadata?(entry)
565
+ resolved = resolve_memory(key, entry, system_dir: root)
566
+ unless resolved == :stamped_paths
567
+ return true unless resolved
568
+
569
+ return true unless memory_paths?(resolved_memory_entry(resolved), root)
570
+
571
+ stamped_overlay = field(entry, :overlay)
572
+ stamped_overlay_path = stamped_overlay.is_a?(Hash) ? field(stamped_overlay, :path) : nil
573
+ return true unless same_path?(resolved.path, field(entry, :path))
574
+ return true unless same_path?(resolved.overlay_path, stamped_overlay_path)
575
+ end
576
+ end
577
+
527
578
  overlay = field(entry, :overlay)
528
579
  differs?(field(entry, :path), entry, stat) ||
529
580
  (overlay.is_a?(Hash) && differs?(field(overlay, :path), overlay, stat))
530
581
  end
531
582
 
583
+ def same_path?(left, right)
584
+ return left.nil? && right.nil? if left.nil? || right.nil?
585
+
586
+ File.expand_path(left.to_s) == File.expand_path(right.to_s)
587
+ end
588
+
532
589
  # Whether the file at +path+ is not what +entry+ ({mtime_ns:, size:}) says
533
590
  # it was, in mtime or size.
534
591
  def differs?(path, entry, stat)
@@ -560,7 +617,9 @@ module Samagotchi
560
617
  def field(hash, key) = hash.key?(key) ? hash[key] : hash[key.to_s]
561
618
 
562
619
  private_class_method :all_touches, :touches, :failed?, :shared_with, :item, :still_sent?, :dropped?, :with_id,
563
- :changed?, :memory_changed?, :differs?, :stamp_hash, :stamp_of, :field, :event, :body_of,
564
- :lines_of, :saved_diff, :memory_entries, :memory_paths?, :memory_part, :overlay_tail, :memory_scope, :memory_body
620
+ :changed?, :memory_changed?, :same_path?, :differs?, :stamp_hash, :stamp_of, :field, :event, :body_of,
621
+ :lines_of, :saved_diff, :memory_entries, :memory_paths?, :project_dir_within_root?,
622
+ :resolution_metadata?, :resolve_memory, :resolved_memory_entry, :memory_part, :overlay_tail,
623
+ :memory_scope, :memory_body
565
624
  end
566
625
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: samagotchi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.171.0
4
+ version: 0.172.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Dedov
@@ -366,6 +366,7 @@ files:
366
366
  - lib/samagotchi/desktop_command.rb
367
367
  - lib/samagotchi/edit_preview.rb
368
368
  - lib/samagotchi/effective_model.rb
369
+ - lib/samagotchi/empty_answer_error.rb
369
370
  - lib/samagotchi/empty_answer_retry.rb
370
371
  - lib/samagotchi/engine.rb
371
372
  - lib/samagotchi/engine/cards.rb
@@ -403,6 +404,7 @@ files:
403
404
  - lib/samagotchi/guardrail_wiring.rb
404
405
  - lib/samagotchi/guardrails.rb
405
406
  - lib/samagotchi/guardrails/approval.rb
407
+ - lib/samagotchi/guardrails/approval_use.rb
406
408
  - lib/samagotchi/guardrails/approvals.rb
407
409
  - lib/samagotchi/guardrails/chi_dirs.rb
408
410
  - lib/samagotchi/guardrails/child_boundary.rb
@@ -419,10 +421,10 @@ files:
419
421
  - lib/samagotchi/guardrails/parent_approvals.rb
420
422
  - lib/samagotchi/guardrails/parent_levels.rb
421
423
  - lib/samagotchi/guardrails/parent_policy.rb
424
+ - lib/samagotchi/guardrails/participant_refusal.rb
422
425
  - lib/samagotchi/guardrails/path_resolve.rb
423
426
  - lib/samagotchi/guardrails/protected_paths.rb
424
427
  - lib/samagotchi/guardrails/read_only_shell.rb
425
- - lib/samagotchi/guardrails/review_boundary.rb
426
428
  - lib/samagotchi/guardrails/review_paths.rb
427
429
  - lib/samagotchi/guardrails/rm_targets.rb
428
430
  - lib/samagotchi/guardrails/rules.rb
@@ -577,9 +579,9 @@ files:
577
579
  - lib/samagotchi/parent_report.rb
578
580
  - lib/samagotchi/participant_exposure.rb
579
581
  - lib/samagotchi/participant_messages.rb
580
- - lib/samagotchi/participant_mode.rb
581
582
  - lib/samagotchi/participant_name.rb
582
583
  - lib/samagotchi/participant_revise.rb
584
+ - lib/samagotchi/participant_turn_mode.rb
583
585
  - lib/samagotchi/participant_uploads.rb
584
586
  - lib/samagotchi/participants.rb
585
587
  - lib/samagotchi/participants_watch.rb
@@ -649,9 +651,6 @@ files:
649
651
  - lib/samagotchi/reply_wait/poll.rb
650
652
  - lib/samagotchi/reply_wait/target.rb
651
653
  - lib/samagotchi/reprefill_meter.rb
652
- - lib/samagotchi/review_apply.rb
653
- - lib/samagotchi/review_command.rb
654
- - lib/samagotchi/review_start.rb
655
654
  - lib/samagotchi/revise_anchor.rb
656
655
  - lib/samagotchi/row_refs.rb
657
656
  - lib/samagotchi/run_options.rb
@@ -709,6 +708,7 @@ files:
709
708
  - lib/samagotchi/sessions_command.rb
710
709
  - lib/samagotchi/setting_explained.rb
711
710
  - lib/samagotchi/share_command.rb
711
+ - lib/samagotchi/share_terms.rb
712
712
  - lib/samagotchi/side_judgments.rb
713
713
  - lib/samagotchi/side_usage.rb
714
714
  - lib/samagotchi/starting_marker.rb
@@ -837,6 +837,7 @@ files:
837
837
  - lib/samagotchi/tools/execute.rb
838
838
  - lib/samagotchi/tools/forget_outputs.rb
839
839
  - lib/samagotchi/tools/index_hint.rb
840
+ - lib/samagotchi/tools/leftovers.rb
840
841
  - lib/samagotchi/tools/list_reminders.rb
841
842
  - lib/samagotchi/tools/list_schedules.rb
842
843
  - lib/samagotchi/tools/list_sessions.rb
@@ -1026,8 +1027,6 @@ files:
1026
1027
  - lib/samagotchi/web/public/reload_check.js
1027
1028
  - lib/samagotchi/web/public/restore.js
1028
1029
  - lib/samagotchi/web/public/resync_reach.js
1029
- - lib/samagotchi/web/public/review_apply.js
1030
- - lib/samagotchi/web/public/review_start.js
1031
1030
  - lib/samagotchi/web/public/revise_stack.js
1032
1031
  - lib/samagotchi/web/public/revise_switch.js
1033
1032
  - lib/samagotchi/web/public/route.js
@@ -1049,12 +1048,18 @@ files:
1049
1048
  - lib/samagotchi/web/public/settings_panel.js
1050
1049
  - lib/samagotchi/web/public/shell_command.js
1051
1050
  - lib/samagotchi/web/public/shown_texts.js
1051
+ - lib/samagotchi/web/public/stage_answer.js
1052
1052
  - lib/samagotchi/web/public/stage_asking.js
1053
1053
  - lib/samagotchi/web/public/stage_cards.js
1054
+ - lib/samagotchi/web/public/stage_cloud.js
1055
+ - lib/samagotchi/web/public/stage_dom.js
1054
1056
  - lib/samagotchi/web/public/stage_frame.js
1057
+ - lib/samagotchi/web/public/stage_handoff.js
1055
1058
  - lib/samagotchi/web/public/stage_model.js
1056
1059
  - lib/samagotchi/web/public/stage_opened.js
1057
1060
  - lib/samagotchi/web/public/stage_owner_wait.js
1061
+ - lib/samagotchi/web/public/stage_pager.js
1062
+ - lib/samagotchi/web/public/stage_quiet_clock.js
1058
1063
  - lib/samagotchi/web/public/stage_slots.js
1059
1064
  - lib/samagotchi/web/public/stage_stall.js
1060
1065
  - lib/samagotchi/web/public/stage_view.js