samagotchi 0.12.0 → 0.14.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +116 -1
- data/README.md +20 -7
- data/bin/chi +9 -9
- data/docs/architecture.md +4 -2
- data/docs/cli.md +34 -10
- data/docs/configuration.md +79 -15
- data/docs/desktop.md +10 -6
- data/docs/guardrails.md +74 -7
- data/docs/hooks.md +13 -9
- data/docs/memory.md +5 -3
- data/docs/plugins.md +31 -16
- data/docs/sessions.md +9 -6
- data/docs/sub-agent.md +128 -0
- data/lib/samagotchi/answer_command.rb +220 -0
- data/lib/samagotchi/bridge/card_store.rb +94 -6
- data/lib/samagotchi/bridge.rb +14 -2
- data/lib/samagotchi/bridge_client.rb +8 -3
- data/lib/samagotchi/bundle_command.rb +18 -10
- data/lib/samagotchi/bundles/check-in/manifest.yml +2 -2
- data/lib/samagotchi/bundles/check-in/plugin.rb +68 -5
- data/lib/samagotchi/bundles/guardrails/guardrails/rules.yml +19 -0
- data/lib/samagotchi/bundles/guardrails/manifest.yml +2 -2
- data/lib/samagotchi/bundles/mcp/manifest.yml +2 -2
- data/lib/samagotchi/bundles/mcp/plugin.rb +166 -34
- data/lib/samagotchi/bundles/system/config_modification_protocol.md +5 -5
- data/lib/samagotchi/bundles/system/manifest.yml +2 -2
- data/lib/samagotchi/cli/command.rb +3 -2
- data/lib/samagotchi/cli/exit.rb +23 -0
- data/lib/samagotchi/cli/parent_wait.rb +82 -0
- data/lib/samagotchi/config.rb +81 -24
- data/lib/samagotchi/context_window.rb +30 -5
- data/lib/samagotchi/desktop_command.rb +5 -3
- data/lib/samagotchi/engine.rb +54 -17
- data/lib/samagotchi/guardrails/parent_approvals.rb +158 -0
- data/lib/samagotchi/hooks/bundle_loader.rb +10 -3
- data/lib/samagotchi/host_registry.rb +31 -7
- data/lib/samagotchi/kernel_loop.rb +1 -1
- data/lib/samagotchi/llm/chat_loop.rb +5 -3
- data/lib/samagotchi/llm/openai_chat.rb +9 -1
- data/lib/samagotchi/llm/turn_settings.rb +7 -5
- data/lib/samagotchi/memory_bundle/installer.rb +12 -0
- data/lib/samagotchi/memory_bundle/status.rb +9 -1
- data/lib/samagotchi/memory_paths.rb +8 -0
- data/lib/samagotchi/model_profile.rb +30 -16
- data/lib/samagotchi/parent_report.rb +213 -0
- data/lib/samagotchi/plugin/api.rb +15 -2
- data/lib/samagotchi/prompt_literal_guard.rb +4 -2
- data/lib/samagotchi/question_desk.rb +29 -2
- data/lib/samagotchi/recap_setup.rb +15 -5
- data/lib/samagotchi/reply_wait.rb +5 -1
- data/lib/samagotchi/send_command.rb +50 -75
- data/lib/samagotchi/session.rb +15 -0
- data/lib/samagotchi/session_manager.rb +40 -7
- data/lib/samagotchi/sessions_command.rb +13 -3
- data/lib/samagotchi/system_prompt.rb +11 -3
- data/lib/samagotchi/terminal_ui/attach_launcher.rb +33 -5
- data/lib/samagotchi/terminal_ui/attached_loop.rb +53 -14
- data/lib/samagotchi/terminal_ui.rb +30 -3
- data/lib/samagotchi/thought_stream_splitter.rb +4 -4
- data/lib/samagotchi/tool_call_parser.rb +5 -6
- data/lib/samagotchi/tools/builtin_calls.rb +14 -3
- data/lib/samagotchi/tools/builtins.rb +14 -2
- data/lib/samagotchi/tools/delegate_wait.rb +32 -13
- data/lib/samagotchi/tools/execute.rb +8 -8
- data/lib/samagotchi/tools/memory.rb +3 -3
- data/lib/samagotchi/tools/task_create.rb +3 -2
- data/lib/samagotchi/tools/task_runtime.rb +7 -2
- data/lib/samagotchi/utf8_default.rb +29 -0
- data/lib/samagotchi/version.rb +1 -1
- data/lib/samagotchi/web/app.rb +22 -10
- data/lib/samagotchi/web/message_parts.rb +2 -1
- data/lib/samagotchi/web/public/activity.js +6 -1
- data/lib/samagotchi/web/public/app.js +39 -6
- data/lib/samagotchi/web/public/index.html +8 -1
- data/lib/samagotchi/web/public/notify.js +16 -3
- data/lib/samagotchi/web/public/question_cards.js +3 -1
- data/lib/samagotchi/web/public/sessions_list.js +37 -0
- data/lib/samagotchi/web/public/turn_view.js +6 -9
- data/lib/samagotchi/web/server.rb +2 -1
- data/lib/samagotchi/web/session_summary.rb +3 -11
- metadata +8 -1
|
@@ -61,22 +61,14 @@ module Samagotchi
|
|
|
61
61
|
bridge_up: up,
|
|
62
62
|
# For the tab's notifications (notify.js): an open question, the
|
|
63
63
|
# running turn's open card with actions, and how the last turn
|
|
64
|
-
# ended. A question saved by a worker that died is not open
|
|
65
|
-
|
|
64
|
+
# ended. A question saved by a worker that died is not open, nor a
|
|
65
|
+
# chi REPL's (SessionManager.worker_live?'s rule: only a worker shares it).
|
|
66
|
+
pending_question: session.waiting_question(live: !!owner&.worker?),
|
|
66
67
|
pending_card: up ? Bridge::PendingCard.read(session_dir) : nil,
|
|
67
68
|
last_turn: session.last_turn
|
|
68
69
|
}
|
|
69
70
|
end
|
|
70
71
|
|
|
71
|
-
# The open question as {id:, kind:} ("approval" for a guardrail's,
|
|
72
|
-
# else "question"); nil when there is none. The text stays out.
|
|
73
|
-
def pending_question_for(session)
|
|
74
|
-
pending = session.pending_question
|
|
75
|
-
return nil unless pending.is_a?(Hash) && pending[:id]
|
|
76
|
-
|
|
77
|
-
{ id: pending[:id], kind: pending[:kind].to_s == "approval" ? "approval" : "question" }
|
|
78
|
-
end
|
|
79
|
-
|
|
80
72
|
# status is turn state (idle/running). The live worker's snapshot is the
|
|
81
73
|
# truth; on disk, a "running" with no live owner was left by a worker
|
|
82
74
|
# that died mid-turn.
|
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.
|
|
4
|
+
version: 0.14.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dmitry Dedov
|
|
@@ -136,7 +136,9 @@ files:
|
|
|
136
136
|
- docs/plugins.md
|
|
137
137
|
- docs/releasing.md
|
|
138
138
|
- docs/sessions.md
|
|
139
|
+
- docs/sub-agent.md
|
|
139
140
|
- lib/samagotchi.rb
|
|
141
|
+
- lib/samagotchi/answer_command.rb
|
|
140
142
|
- lib/samagotchi/answer_display.rb
|
|
141
143
|
- lib/samagotchi/archive_store.rb
|
|
142
144
|
- lib/samagotchi/atomic_file.rb
|
|
@@ -188,7 +190,9 @@ files:
|
|
|
188
190
|
- lib/samagotchi/bundles/system/self_map.md
|
|
189
191
|
- lib/samagotchi/cancellation_controller.rb
|
|
190
192
|
- lib/samagotchi/cli/command.rb
|
|
193
|
+
- lib/samagotchi/cli/exit.rb
|
|
191
194
|
- lib/samagotchi/cli/flags.rb
|
|
195
|
+
- lib/samagotchi/cli/parent_wait.rb
|
|
192
196
|
- lib/samagotchi/client.rb
|
|
193
197
|
- lib/samagotchi/commands/registry.rb
|
|
194
198
|
- lib/samagotchi/config.rb
|
|
@@ -224,6 +228,7 @@ files:
|
|
|
224
228
|
- lib/samagotchi/guardrails/gate.rb
|
|
225
229
|
- lib/samagotchi/guardrails/load_failures.rb
|
|
226
230
|
- lib/samagotchi/guardrails/model_size.rb
|
|
231
|
+
- lib/samagotchi/guardrails/parent_approvals.rb
|
|
227
232
|
- lib/samagotchi/guardrails/protected_paths.rb
|
|
228
233
|
- lib/samagotchi/guardrails/rules.rb
|
|
229
234
|
- lib/samagotchi/guardrails/scratch_writes.rb
|
|
@@ -286,6 +291,7 @@ files:
|
|
|
286
291
|
- lib/samagotchi/note_command.rb
|
|
287
292
|
- lib/samagotchi/output_formatter.rb
|
|
288
293
|
- lib/samagotchi/owner_lock.rb
|
|
294
|
+
- lib/samagotchi/parent_report.rb
|
|
289
295
|
- lib/samagotchi/paths.rb
|
|
290
296
|
- lib/samagotchi/pending_input_queue.rb
|
|
291
297
|
- lib/samagotchi/plugin/api.rb
|
|
@@ -388,6 +394,7 @@ files:
|
|
|
388
394
|
- lib/samagotchi/update_command.rb
|
|
389
395
|
- lib/samagotchi/update_hint.rb
|
|
390
396
|
- lib/samagotchi/used_memories.rb
|
|
397
|
+
- lib/samagotchi/utf8_default.rb
|
|
391
398
|
- lib/samagotchi/version.rb
|
|
392
399
|
- lib/samagotchi/vision_context.rb
|
|
393
400
|
- lib/samagotchi/vision_support.rb
|