samagotchi 0.134.0 → 0.136.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 +78 -1
- data/bin/chi +2 -3
- data/docs/architecture.md +6 -3
- data/docs/cli.md +43 -38
- data/docs/configuration.md +11 -9
- data/docs/guardrails.md +53 -9
- data/docs/internals/engine.md +6 -3
- data/docs/internals/participants.md +1 -1
- data/docs/internals/prompt-caching.md +1 -1
- data/docs/internals/web-frontend.md +263 -0
- data/docs/internals/working-set.md +2 -2
- data/docs/sessions.md +5 -3
- data/docs/testing.md +36 -6
- data/lib/samagotchi/bridge.rb +11 -6
- data/lib/samagotchi/bridge_client.rb +8 -5
- data/lib/samagotchi/bundles/system/manifest.yml +1 -1
- data/lib/samagotchi/config.rb +0 -2
- data/lib/samagotchi/engine.rb +69 -12
- data/lib/samagotchi/guardrail_wiring.rb +8 -6
- data/lib/samagotchi/guardrails/approval.rb +41 -5
- data/lib/samagotchi/guardrails/implicit_writers.rb +19 -4
- data/lib/samagotchi/guardrails/pair_boundary.rb +5 -1
- data/lib/samagotchi/guardrails/pair_command.rb +387 -78
- data/lib/samagotchi/guardrails/parent_approvals.rb +12 -15
- data/lib/samagotchi/guardrails/read_only_shell.rb +24 -2
- data/lib/samagotchi/guardrails/shared_git.rb +1 -1
- data/lib/samagotchi/guardrails/shell_git_dirs.rb +1 -1
- data/lib/samagotchi/guardrails/shell_lex.rb +22 -0
- data/lib/samagotchi/guardrails_command.rb +13 -10
- data/lib/samagotchi/llm/chat_loop.rb +4 -3
- data/lib/samagotchi/message_parts.rb +1 -1
- data/lib/samagotchi/revise_anchor.rb +33 -0
- data/lib/samagotchi/session_inbox.rb +20 -12
- data/lib/samagotchi/session_manager.rb +13 -11
- data/lib/samagotchi/system_one/approval_question.rb +21 -16
- data/lib/samagotchi/system_one/self_protect.rb +13 -15
- data/lib/samagotchi/tools/delegate_relay.rb +6 -5
- data/lib/samagotchi/tools/delegate_wait.rb +5 -5
- data/lib/samagotchi/tools/execute.rb +6 -6
- data/lib/samagotchi/tools/output_guardrails.rb +9 -2
- data/lib/samagotchi/tools/read.rb +5 -5
- data/lib/samagotchi/turn_anchors.rb +49 -0
- data/lib/samagotchi/verify_anchor.rb +5 -5
- data/lib/samagotchi/version.rb +1 -1
- data/lib/samagotchi/web/app.rb +6 -18
- data/lib/samagotchi/web/message_display.rb +33 -1
- data/lib/samagotchi/web/participant_access.rb +2 -2
- data/lib/samagotchi/web/participant_view.rb +8 -0
- data/lib/samagotchi/web/public/activity.js +1 -1
- data/lib/samagotchi/web/public/annotations.js +1 -1
- data/lib/samagotchi/web/public/answer_fold.js +100 -31
- data/lib/samagotchi/web/public/app.js +451 -367
- data/lib/samagotchi/web/public/bubbles.js +30 -10
- data/lib/samagotchi/web/public/cards_place.js +4 -2
- data/lib/samagotchi/web/public/chip_popover.js +2 -2
- data/lib/samagotchi/web/public/composer.css +8 -0
- data/lib/samagotchi/web/public/context_chips.js +9 -6
- data/lib/samagotchi/web/public/data.js +4 -2
- data/lib/samagotchi/web/public/dock_reserve.js +13 -15
- data/lib/samagotchi/web/public/feature_gates.js +33 -0
- data/lib/samagotchi/web/public/history_reveal.js +10 -6
- data/lib/samagotchi/web/public/index.html +105 -53
- data/lib/samagotchi/web/public/info_bar.js +11 -12
- data/lib/samagotchi/web/public/info_bar_model.js +8 -10
- data/lib/samagotchi/web/public/latest.js +46 -0
- data/lib/samagotchi/web/public/level_chip.js +33 -95
- data/lib/samagotchi/web/public/lists_view.js +15 -13
- data/lib/samagotchi/web/public/live_timing.js +2 -0
- data/lib/samagotchi/web/public/llm_context_chip.js +13 -144
- data/lib/samagotchi/web/public/markdown_place.js +1 -1
- data/lib/samagotchi/web/public/method_api.js +14 -0
- data/lib/samagotchi/web/public/notifications.js +4 -11
- data/lib/samagotchi/web/public/participant.js +11 -6
- data/lib/samagotchi/web/public/participant_names.js +1 -1
- data/lib/samagotchi/web/public/participants_panel.js +4 -2
- data/lib/samagotchi/web/public/project_picker.js +18 -22
- data/lib/samagotchi/web/public/question_cards.js +2 -2
- data/lib/samagotchi/web/public/reasoning_history_chip.js +8 -34
- data/lib/samagotchi/web/public/restore.js +2 -0
- data/lib/samagotchi/web/public/revise_stack.js +378 -0
- data/lib/samagotchi/web/public/scope.js +12 -20
- data/lib/samagotchi/web/public/send_turn.js +29 -16
- data/lib/samagotchi/web/public/session_actions.js +15 -14
- data/lib/samagotchi/web/public/session_fields.js +152 -0
- data/lib/samagotchi/web/public/session_payload.js +35 -0
- data/lib/samagotchi/web/public/session_state.js +9 -5
- data/lib/samagotchi/web/public/session_store.js +191 -0
- data/lib/samagotchi/web/public/settings_chip.js +212 -0
- data/lib/samagotchi/web/public/settings_panel.js +121 -0
- data/lib/samagotchi/web/public/shell_command.js +26 -0
- data/lib/samagotchi/web/public/stage_model.js +4 -4
- data/lib/samagotchi/web/public/stage_view.js +11 -16
- data/lib/samagotchi/web/public/start_settings.js +25 -88
- data/lib/samagotchi/web/public/stream_handlers.js +88 -90
- data/lib/samagotchi/web/public/task_stop.js +1 -1
- data/lib/samagotchi/web/public/thinking_chip.js +7 -45
- data/lib/samagotchi/web/public/time_gaps.js +5 -2
- data/lib/samagotchi/web/public/timing.js +15 -5
- data/lib/samagotchi/web/public/toolkit_chip.js +37 -21
- data/lib/samagotchi/web/public/{turn_view.js → turn_block.js} +33 -93
- data/lib/samagotchi/web/public/turn_events.js +3 -3
- data/lib/samagotchi/web/public/turn_html.js +20 -16
- data/lib/samagotchi/web/public/turn_model.js +6 -6
- data/lib/samagotchi/web/public/verdict_fresh.js +2 -0
- data/lib/samagotchi/web/public/working_set_view.js +3 -1
- data/lib/samagotchi/web/server.rb +4 -4
- data/lib/samagotchi/web/session_control.rb +2 -2
- data/lib/samagotchi/web/session_create.rb +1 -1
- data/lib/samagotchi/web/session_show.rb +6 -3
- data/lib/samagotchi/worker.rb +9 -9
- data/lib/samagotchi/worker_inbound.rb +6 -5
- metadata +15 -3
- data/lib/samagotchi/web/public/hold.js +0 -78
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.136.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dmitry Dedov
|
|
@@ -164,6 +164,7 @@ files:
|
|
|
164
164
|
- docs/internals/prompt-caching.md
|
|
165
165
|
- docs/internals/remote-sessions.md
|
|
166
166
|
- docs/internals/tool-guardrails.md
|
|
167
|
+
- docs/internals/web-frontend.md
|
|
167
168
|
- docs/internals/web-push.md
|
|
168
169
|
- docs/internals/working-set.md
|
|
169
170
|
- docs/memory.md
|
|
@@ -550,6 +551,7 @@ files:
|
|
|
550
551
|
- lib/samagotchi/review_apply.rb
|
|
551
552
|
- lib/samagotchi/review_command.rb
|
|
552
553
|
- lib/samagotchi/review_start.rb
|
|
554
|
+
- lib/samagotchi/revise_anchor.rb
|
|
553
555
|
- lib/samagotchi/row_refs.rb
|
|
554
556
|
- lib/samagotchi/run_options.rb
|
|
555
557
|
- lib/samagotchi/sampling_settings.rb
|
|
@@ -728,6 +730,7 @@ files:
|
|
|
728
730
|
- lib/samagotchi/tools/tool_path.rb
|
|
729
731
|
- lib/samagotchi/tools/web_fetch.rb
|
|
730
732
|
- lib/samagotchi/tools/write.rb
|
|
733
|
+
- lib/samagotchi/turn_anchors.rb
|
|
731
734
|
- lib/samagotchi/turn_checkpoint.rb
|
|
732
735
|
- lib/samagotchi/turn_endings.rb
|
|
733
736
|
- lib/samagotchi/turn_flow.rb
|
|
@@ -803,10 +806,10 @@ files:
|
|
|
803
806
|
- lib/samagotchi/web/public/dock_reserve.js
|
|
804
807
|
- lib/samagotchi/web/public/families_view.js
|
|
805
808
|
- lib/samagotchi/web/public/favicon.svg
|
|
809
|
+
- lib/samagotchi/web/public/feature_gates.js
|
|
806
810
|
- lib/samagotchi/web/public/format.js
|
|
807
811
|
- lib/samagotchi/web/public/forms.css
|
|
808
812
|
- lib/samagotchi/web/public/history_reveal.js
|
|
809
|
-
- lib/samagotchi/web/public/hold.js
|
|
810
813
|
- lib/samagotchi/web/public/icons/chi-180.png
|
|
811
814
|
- lib/samagotchi/web/public/icons/chi-192.png
|
|
812
815
|
- lib/samagotchi/web/public/icons/chi-512.png
|
|
@@ -817,6 +820,7 @@ files:
|
|
|
817
820
|
- lib/samagotchi/web/public/init_row.js
|
|
818
821
|
- lib/samagotchi/web/public/keep_focus.js
|
|
819
822
|
- lib/samagotchi/web/public/kept_commands.js
|
|
823
|
+
- lib/samagotchi/web/public/latest.js
|
|
820
824
|
- lib/samagotchi/web/public/level_chip.js
|
|
821
825
|
- lib/samagotchi/web/public/lists_view.js
|
|
822
826
|
- lib/samagotchi/web/public/live_timing.js
|
|
@@ -825,6 +829,7 @@ files:
|
|
|
825
829
|
- lib/samagotchi/web/public/manifest.webmanifest
|
|
826
830
|
- lib/samagotchi/web/public/markdown_place.js
|
|
827
831
|
- lib/samagotchi/web/public/markdown_tip.js
|
|
832
|
+
- lib/samagotchi/web/public/method_api.js
|
|
828
833
|
- lib/samagotchi/web/public/model_pick.js
|
|
829
834
|
- lib/samagotchi/web/public/model_picker.js
|
|
830
835
|
- lib/samagotchi/web/public/notice_links.js
|
|
@@ -852,16 +857,23 @@ files:
|
|
|
852
857
|
- lib/samagotchi/web/public/review_apply.js
|
|
853
858
|
- lib/samagotchi/web/public/review_history.js
|
|
854
859
|
- lib/samagotchi/web/public/review_start.js
|
|
860
|
+
- lib/samagotchi/web/public/revise_stack.js
|
|
855
861
|
- lib/samagotchi/web/public/route.js
|
|
856
862
|
- lib/samagotchi/web/public/scope.js
|
|
857
863
|
- lib/samagotchi/web/public/scroll.js
|
|
858
864
|
- lib/samagotchi/web/public/send_turn.js
|
|
859
865
|
- lib/samagotchi/web/public/sentences.js
|
|
860
866
|
- lib/samagotchi/web/public/session_actions.js
|
|
867
|
+
- lib/samagotchi/web/public/session_fields.js
|
|
868
|
+
- lib/samagotchi/web/public/session_payload.js
|
|
861
869
|
- lib/samagotchi/web/public/session_rename.js
|
|
862
870
|
- lib/samagotchi/web/public/session_state.js
|
|
871
|
+
- lib/samagotchi/web/public/session_store.js
|
|
863
872
|
- lib/samagotchi/web/public/session_title.js
|
|
864
873
|
- lib/samagotchi/web/public/sessions_list.js
|
|
874
|
+
- lib/samagotchi/web/public/settings_chip.js
|
|
875
|
+
- lib/samagotchi/web/public/settings_panel.js
|
|
876
|
+
- lib/samagotchi/web/public/shell_command.js
|
|
865
877
|
- lib/samagotchi/web/public/shown_texts.js
|
|
866
878
|
- lib/samagotchi/web/public/stage_frame.js
|
|
867
879
|
- lib/samagotchi/web/public/stage_model.js
|
|
@@ -890,11 +902,11 @@ files:
|
|
|
890
902
|
- lib/samagotchi/web/public/tokens.css
|
|
891
903
|
- lib/samagotchi/web/public/toolkit_chip.js
|
|
892
904
|
- lib/samagotchi/web/public/tools_overview.js
|
|
905
|
+
- lib/samagotchi/web/public/turn_block.js
|
|
893
906
|
- lib/samagotchi/web/public/turn_events.js
|
|
894
907
|
- lib/samagotchi/web/public/turn_html.js
|
|
895
908
|
- lib/samagotchi/web/public/turn_model.js
|
|
896
909
|
- lib/samagotchi/web/public/turn_range.js
|
|
897
|
-
- lib/samagotchi/web/public/turn_view.js
|
|
898
910
|
- lib/samagotchi/web/public/unqueue.js
|
|
899
911
|
- lib/samagotchi/web/public/update_notice.js
|
|
900
912
|
- lib/samagotchi/web/public/update_sheet.js
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
// The answer pop (D6): the promoted answer bubble is held at the live box's
|
|
2
|
-
// height (`.boxed` + an inline max-height, scrolled to its tail), then grows
|
|
3
|
-
// to its content while the content fades in, then becomes a plain bubble.
|
|
4
|
-
// One hold at a time: a new hold, and reset, finish the previous one first,
|
|
5
|
-
// and a safety timer un-boxes its own bubble whatever happens to the rest, so
|
|
6
|
-
// no bubble is left clipped for good.
|
|
7
|
-
//
|
|
8
|
-
// Timers, not transitionend: under reduced motion and in a hidden tab none
|
|
9
|
-
// fires. rAF only to follow the pop: a hidden tab has none, and finish()
|
|
10
|
-
// follows once more.
|
|
11
|
-
export const HOLD_MS = 1500;
|
|
12
|
-
export const REVEAL_MS = 400;
|
|
13
|
-
export const SAFETY_MS = HOLD_MS + REVEAL_MS + 1000;
|
|
14
|
-
|
|
15
|
-
export function createHold({ isNearBottom, follow, timers = globalThis }) {
|
|
16
|
-
// { bubble, timer, follow, revealing }
|
|
17
|
-
let held = null;
|
|
18
|
-
|
|
19
|
-
function unbox(bubble) {
|
|
20
|
-
bubble.classList.remove("boxed", "revealing");
|
|
21
|
-
bubble.removeAttribute("style");
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Hold +bubble+ at +maxHeight+ px until reveal() or HOLD_MS.
|
|
25
|
-
function start(bubble, maxHeight) {
|
|
26
|
-
finish();
|
|
27
|
-
bubble.classList.add("boxed");
|
|
28
|
-
bubble.style.maxHeight = `${maxHeight}px`;
|
|
29
|
-
bubble.scrollTop = bubble.scrollHeight;
|
|
30
|
-
held = {
|
|
31
|
-
bubble,
|
|
32
|
-
timer: timers.setTimeout(reveal, HOLD_MS),
|
|
33
|
-
follow: false,
|
|
34
|
-
};
|
|
35
|
-
timers.setTimeout(() => {
|
|
36
|
-
if (held?.bubble === bubble) finish();
|
|
37
|
-
else unbox(bubble);
|
|
38
|
-
}, SAFETY_MS);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// The pop: the held bubble grows to its content under the CSS transition;
|
|
42
|
-
// the class and the inline style go REVEAL_MS later (reload parity).
|
|
43
|
-
function reveal() {
|
|
44
|
-
if (!held || held.revealing) return;
|
|
45
|
-
timers.clearTimeout(held.timer);
|
|
46
|
-
const { bubble } = held;
|
|
47
|
-
held.revealing = true;
|
|
48
|
-
held.follow = isNearBottom();
|
|
49
|
-
bubble.scrollTop = 0;
|
|
50
|
-
bubble.style.maxHeight = `${bubble.scrollHeight}px`;
|
|
51
|
-
bubble.classList.add("revealing");
|
|
52
|
-
held.timer = timers.setTimeout(finish, REVEAL_MS);
|
|
53
|
-
// Following: the answer's end stays above the dock while it grows,
|
|
54
|
-
// frame by frame, not one jump at the end.
|
|
55
|
-
if (held.follow && timers.requestAnimationFrame) {
|
|
56
|
-
const pin = () => {
|
|
57
|
-
if (held?.bubble !== bubble) return;
|
|
58
|
-
follow();
|
|
59
|
-
timers.requestAnimationFrame(pin);
|
|
60
|
-
};
|
|
61
|
-
timers.requestAnimationFrame(pin);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// The held bubble as a plain answer bubble, at once.
|
|
66
|
-
function finish() {
|
|
67
|
-
if (!held) return;
|
|
68
|
-
// The safety timer stays: it un-boxes its bubble again, a no-op on a
|
|
69
|
-
// plain one.
|
|
70
|
-
timers.clearTimeout(held.timer);
|
|
71
|
-
const { bubble, follow: wasFollowing } = held;
|
|
72
|
-
held = null;
|
|
73
|
-
unbox(bubble);
|
|
74
|
-
if (wasFollowing) follow();
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return { start, reveal, finish, get bubble() { return held?.bubble ?? null; } };
|
|
78
|
-
}
|