samagotchi 0.165.0 → 0.167.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 (100) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +99 -1
  3. data/docs/architecture.md +1 -0
  4. data/docs/cli.md +16 -7
  5. data/docs/configuration.md +4 -1
  6. data/docs/guardrails.md +8 -3
  7. data/docs/hooks.md +4 -6
  8. data/docs/internals/bridge.md +6 -0
  9. data/docs/internals/bundles.md +2 -4
  10. data/docs/internals/engine.md +4 -5
  11. data/docs/internals/objectives.md +141 -9
  12. data/docs/internals/remote-sessions.md +6 -7
  13. data/docs/internals/web-frontend.md +62 -24
  14. data/docs/memory.md +1 -2
  15. data/docs/releasing.md +12 -3
  16. data/docs/sessions.md +24 -6
  17. data/docs/testing.md +14 -4
  18. data/lib/samagotchi/bridge.rb +1 -1
  19. data/lib/samagotchi/bundle_command/installed_check.rb +2 -14
  20. data/lib/samagotchi/bundle_command.rb +19 -11
  21. data/lib/samagotchi/bundles/system/manifest.yml +1 -1
  22. data/lib/samagotchi/cli/command.rb +10 -0
  23. data/lib/samagotchi/compat.rb +4 -14
  24. data/lib/samagotchi/config.rb +3 -0
  25. data/lib/samagotchi/context_command.rb +2 -1
  26. data/lib/samagotchi/engine/objectives.rb +20 -1
  27. data/lib/samagotchi/engine/side_requests.rb +3 -2
  28. data/lib/samagotchi/engine/turn_end.rb +4 -1
  29. data/lib/samagotchi/engine.rb +3 -0
  30. data/lib/samagotchi/extension_load.rb +2 -26
  31. data/lib/samagotchi/guardrails/approvals.rb +59 -9
  32. data/lib/samagotchi/jsonl_store.rb +61 -0
  33. data/lib/samagotchi/memory_bundle/status.rb +3 -15
  34. data/lib/samagotchi/memory_bundle/system_bundle.rb +16 -10
  35. data/lib/samagotchi/memory_command.rb +4 -2
  36. data/lib/samagotchi/objectives.rb +43 -14
  37. data/lib/samagotchi/objectives_backing.rb +124 -0
  38. data/lib/samagotchi/objectives_check.rb +19 -126
  39. data/lib/samagotchi/objectives_command.rb +14 -7
  40. data/lib/samagotchi/objectives_record.rb +104 -0
  41. data/lib/samagotchi/objectives_track.rb +353 -0
  42. data/lib/samagotchi/plugin/sessions.rb +4 -1
  43. data/lib/samagotchi/push_command.rb +2 -1
  44. data/lib/samagotchi/remote_command.rb +2 -1
  45. data/lib/samagotchi/reply_wait/poll.rb +10 -21
  46. data/lib/samagotchi/reply_wait.rb +4 -47
  47. data/lib/samagotchi/run_options.rb +1 -1
  48. data/lib/samagotchi/schedule_command.rb +6 -0
  49. data/lib/samagotchi/schedules.rb +1 -1
  50. data/lib/samagotchi/session_access/remote.rb +7 -24
  51. data/lib/samagotchi/session_commands.rb +1 -1
  52. data/lib/samagotchi/session_inbox.rb +1 -1
  53. data/lib/samagotchi/sessions_command.rb +12 -6
  54. data/lib/samagotchi/share_command.rb +2 -1
  55. data/lib/samagotchi/tool_activity.rb +11 -1
  56. data/lib/samagotchi/tool_declarations.rb +5 -1
  57. data/lib/samagotchi/tools/delegate.rb +2 -4
  58. data/lib/samagotchi/tools/objectives_tool.rb +19 -2
  59. data/lib/samagotchi/turn_stages/objectives.rb +46 -3
  60. data/lib/samagotchi/version.rb +1 -1
  61. data/lib/samagotchi/web/participant_access.rb +1 -1
  62. data/lib/samagotchi/web/public/app.js +55 -420
  63. data/lib/samagotchi/web/public/auth_lost.js +3 -1
  64. data/lib/samagotchi/web/public/bar_fold.js +1 -1
  65. data/lib/samagotchi/web/public/chip_popover.js +5 -1
  66. data/lib/samagotchi/web/public/copy.js +2 -1
  67. data/lib/samagotchi/web/public/delivery_line.js +19 -4
  68. data/lib/samagotchi/web/public/index.html +156 -49
  69. data/lib/samagotchi/web/public/info_bar.js +1 -1
  70. data/lib/samagotchi/web/public/info_bar_model.js +8 -1
  71. data/lib/samagotchi/web/public/live_timing.js +3 -0
  72. data/lib/samagotchi/web/public/no_contact_fill.js +29 -0
  73. data/lib/samagotchi/web/public/objectives.css +14 -0
  74. data/lib/samagotchi/web/public/objectives_moves.js +82 -9
  75. data/lib/samagotchi/web/public/objectives_state.js +42 -0
  76. data/lib/samagotchi/web/public/objectives_strip.js +33 -9
  77. data/lib/samagotchi/web/public/objectives_track.js +52 -0
  78. data/lib/samagotchi/web/public/objectives_wiring.js +16 -1
  79. data/lib/samagotchi/web/public/participant.html +1 -1
  80. data/lib/samagotchi/web/public/participants_panel.js +14 -7
  81. data/lib/samagotchi/web/public/question_cards.js +7 -12
  82. data/lib/samagotchi/web/public/resync_reach.js +63 -0
  83. data/lib/samagotchi/web/public/scope.js +3 -3
  84. data/lib/samagotchi/web/public/session_fields.js +1 -0
  85. data/lib/samagotchi/web/public/session_rename.js +6 -2
  86. data/lib/samagotchi/web/public/session_state.js +6 -1
  87. data/lib/samagotchi/web/public/session_sync.js +249 -0
  88. data/lib/samagotchi/web/public/session_view.js +279 -0
  89. data/lib/samagotchi/web/public/stage_frame.js +4 -2
  90. data/lib/samagotchi/web/public/stage_stall.js +134 -0
  91. data/lib/samagotchi/web/public/stage_view.js +75 -6
  92. data/lib/samagotchi/web/public/stream_handlers.js +1 -1
  93. data/lib/samagotchi/web/public/tokens.css +2 -2
  94. data/lib/samagotchi/web/public/turn_block.js +8 -0
  95. data/lib/samagotchi/web/public/turn_html.js +1 -1
  96. data/lib/samagotchi/web/public/widget_picks.js +3 -0
  97. data/lib/samagotchi/web/public/working_set_view.js +1 -1
  98. data/lib/samagotchi/web/session_access_routes.rb +4 -15
  99. data/lib/samagotchi/web/token.rb +2 -2
  100. metadata +12 -1
@@ -12,6 +12,7 @@
12
12
  // turn-end markdown) gets them without knowing about them.
13
13
 
14
14
  import { html, render } from "./vendor/lit-html.js";
15
+ import { noContactFill } from "./no_contact_fill.js";
15
16
 
16
17
  export const COPY_SOURCE_ATTR = "data-copy-source";
17
18
 
@@ -22,7 +23,7 @@ export async function copyText(text) {
22
23
  await navigator.clipboard.writeText(text);
23
24
  return true;
24
25
  } catch (_) {
25
- const area = document.createElement("textarea");
26
+ const area = noContactFill(document.createElement("textarea"), "chi-copy");
26
27
  area.value = text;
27
28
  document.body.appendChild(area);
28
29
  area.select();
@@ -2,7 +2,11 @@
2
2
  // text field in a session, always there so the composer never changes
3
3
  // height (the stage above it would jump). Idle it holds the key hint; while
4
4
  // the open session's turn runs it says where a message typed now goes in,
5
- // and offers the other two deliveries as links:
5
+ // and offers the other two deliveries as links (a phone has no row: idle
6
+ // the line is gone; running it lies over the session bar's left, where
7
+ // status, ctx and speed are, only while it matters: the text field focused
8
+ // or holding text or images, a choice armed or an Apply turn held, the last
9
+ // two written here as data-armed and data-held; index.html):
6
10
  //
7
11
  // ↳ goes in after this thinking step · 2:31 · 31k chars cut in now · queue for after the turn
8
12
  // ↳ goes in after this tool call (execute · 0:12) queue for after the turn
@@ -215,6 +219,7 @@ export function createDeliveryControl({ el, read, composerEmpty, send, session =
215
219
  if (mode !== "running" || !line?.[which]?.enabled) return;
216
220
  if (!composerEmpty()) {
217
221
  armed = null;
222
+ mark();
218
223
  send(which);
219
224
  return;
220
225
  }
@@ -222,15 +227,25 @@ export function createDeliveryControl({ el, read, composerEmpty, send, session =
222
227
  refresh();
223
228
  };
224
229
 
230
+ // For a phone's CSS (index.html): whether a choice is armed or an Apply
231
+ // turn held while the turn runs ("1" or ""): the line shows then. Not the
232
+ // queue chip's pressed look: a participant's turn draws it with nothing
233
+ // armed.
234
+ const mark = () => {
235
+ el.dataset.armed = mode === "running" && armed ? "1" : "";
236
+ el.dataset.held = mode === "running" && held() ? "1" : "";
237
+ };
238
+
225
239
  function refresh() {
226
- if (mode === "off") return;
227
- if (mode === "idle") {
228
- render(idleTemplate(), el);
240
+ if (mode !== "running") {
241
+ mark();
242
+ if (mode === "idle") render(idleTemplate(), el);
229
243
  return;
230
244
  }
231
245
  line = deliveryLine({ ...read(), now: now(), armed, held: held() });
232
246
  // A choice no longer possible (a tool started) disarms.
233
247
  armed = line.armed;
248
+ mark();
234
249
  render(deliveryLineTemplate(line, { onCut: () => click("cut"), onQueue: () => click("queue") }), el);
235
250
  }
236
251
 
@@ -8,7 +8,15 @@
8
8
  <link rel="manifest" href="/manifest.webmanifest">
9
9
  <link rel="apple-touch-icon" href="/apple-touch-icon.png">
10
10
  <meta name="apple-mobile-web-app-title" content="Chi">
11
- <meta name="viewport" content="width=device-width,initial-scale=1">
11
+ <!-- viewport-fit=cover: the page runs under the notch and the home indicator; what must stay clear of them pads by --safe-* (below). -->
12
+ <meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
13
+ <!-- The phone's status bar and Safari's toolbar take the page's own background, per theme: on a phone (600px and less) the
14
+ colour its top edge starts with (tokens.css --bg-top, the top bar's tint), so the status bar and the bar under it are one
15
+ surface; elsewhere --bg. The first meta that matches wins. -->
16
+ <meta name="theme-color" content="#131d29" media="(prefers-color-scheme: dark) and (max-width: 600px)">
17
+ <meta name="theme-color" content="#dde8f4" media="(prefers-color-scheme: light) and (max-width: 600px)">
18
+ <meta name="theme-color" content="#0b0d11" media="(prefers-color-scheme: dark)">
19
+ <meta name="theme-color" content="#f5f6f8" media="(prefers-color-scheme: light)">
12
20
  <link rel="stylesheet" href="/assets/tokens.css">
13
21
  <link rel="stylesheet" href="/assets/verify_card.css">
14
22
  <link rel="stylesheet" href="/assets/annotate_bar.css">
@@ -19,10 +27,19 @@
19
27
  <style>
20
28
  /* Icon masks shared by the phone info bar and the all view's cards (the stroke only shapes the mask; the icon takes currentColor); the image icon is composer.css's. */
21
29
  :root{--icon-archive:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2.75' width='12' height='3.5' rx='1'/%3E%3Cpath d='M3.25 6.25v6a1 1 0 0 0 1 1h7.5a1 1 0 0 0 1-1v-6M6.5 9h3'/%3E%3C/svg%3E");--icon-unarchive:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2.75' width='12' height='3.5' rx='1'/%3E%3Cpath d='M3.25 6.25v6a1 1 0 0 0 1 1h7.5a1 1 0 0 0 1-1v-6M8 11.5V8.25M6.5 9.75 8 8.25l1.5 1.5'/%3E%3C/svg%3E")}
30
+ /* The phone's safe areas (the notch, the status bar, the home indicator; 0 elsewhere): main's padding, the bottom
31
+ sheets, the update sheet, the toast and the lightbox keep clear of them. One name per side, so the e2e can set them. */
32
+ :root{--safe-t:env(safe-area-inset-top,0px);--safe-r:env(safe-area-inset-right,0px);--safe-b:env(safe-area-inset-bottom,0px);--safe-l:env(safe-area-inset-left,0px)}
22
33
  *{box-sizing:border-box;margin:0;padding:0}
23
34
  /* No iOS text autosizing: it grows text in a box sized for the text as written (it clipped the session cards). */
24
35
  html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
25
- body{font-family: ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:radial-gradient(1100px 700px at 8% 0%,color-mix(in srgb,var(--accent) 13%,transparent),transparent 70%),var(--bg);background-attachment:fixed;color:var(--text);height:100vh;display:flex;flex-direction:column}
36
+ body{font-family: ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:radial-gradient(1100px 700px at 8% 0%,color-mix(in srgb,var(--accent) 13%,transparent),transparent 70%),var(--bg);background-attachment:fixed;color:var(--text);height:100vh;height:100dvh;display:flex;flex-direction:column}
37
+ /* A phone: the accent's tint runs down from the top edge, flat across it (--bg-top, the status bar's theme-color above),
38
+ not from the top-left corner: the status bar, which iOS paints in theme-color (the Home Screen app) or over the page's
39
+ top (a Safari tab), meets the top bar with no seam. The colour layer under the gradient is never seen in the page
40
+ (the gradient covers the body): it is the body's background-color, which is what iOS 26's Home Screen app paints
41
+ the status bar strip in (not theme-color, not html's background; with no colour the strip is black). */
42
+ @media(max-width:600px){body{background:linear-gradient(var(--bg-top),var(--bg) 420px),var(--bg-top)}}
26
43
  /* Glass: the composer card, the strip cards, the all-sessions cards and the question cards (by selector, so app.js is untouched). */
27
44
  .turn-stage,#topStrip .card,#allList .card,.bubble.question,.bubble.plugin-card{background:var(--glass-bg);-webkit-backdrop-filter:blur(18px) saturate(1.35);backdrop-filter:blur(18px) saturate(1.35);border:1px solid var(--glass-border);box-shadow:inset 0 1px 0 var(--glass-highlight),var(--glass-shadow)}
28
45
  @media(hover:hover){#topStrip .card:hover,#allList .card:hover{background:color-mix(in srgb,var(--bg-hover) 75%,transparent);border-color:var(--card-hover-border)}}
@@ -44,7 +61,10 @@ button{background:var(--primary);border:0;color:var(--on-solid);padding:8px 12px
44
61
  button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
45
62
  button.ghost{background:var(--bg-raised);color:var(--text-2)}
46
63
  button:disabled{opacity:.5;cursor:not-allowed}
47
- main{flex:1;display:flex;flex-direction:column;gap:16px;padding:16px;overflow:auto;background:transparent;min-height:0}
64
+ /* 16px, or the safe area where it is wider. At the bottom 16px less than it: the session's composer card floats 16px
65
+ above main's bottom (#dock bottom:16px), which puts it right on the home indicator's line (a phone's session has none:
66
+ its card is placed by --dock-bottom). */
67
+ main{flex:1;display:flex;flex-direction:column;gap:16px;padding:max(16px,var(--safe-t)) max(16px,var(--safe-r)) max(16px,calc(var(--safe-b) - 16px)) max(16px,var(--safe-l));overflow:auto;background:transparent;min-height:0}
48
68
  #topStrip{display:grid;grid-template-columns:repeat(var(--strip-cols,3),minmax(0,440px)) 150px;gap:12px;min-height:88px;align-content:start}
49
69
  #topStrip:empty{display:grid}
50
70
  #center{flex:1;display:flex;flex-direction:column;min-height:45vh;background:var(--bg-panel);border:1px solid var(--border);border-radius:12px;overflow:hidden}
@@ -662,19 +682,22 @@ body.has-session #center{background:color-mix(in srgb,var(--bg) 35%,transparent)
662
682
  body.has-session #stage,body.has-session #history{background:transparent}
663
683
  @media (prefers-reduced-transparency:reduce){body.has-session #center{background:var(--bg);border-color:var(--border)}}
664
684
  body.no-glass.has-session #center{background:var(--bg);border-color:var(--border)}
665
- body.has-session #dock{position:absolute;left:16px;right:16px;bottom:16px;margin:0;z-index:3}
666
- body.has-session #history{padding-bottom:calc(var(--dock-h,160px) + 32px)}
685
+ /* --dock-bottom: the card's offset from the panel's bottom (16px; a phone's is below). stage_frame.js fitCap reads it. */
686
+ body.has-session #dock{position:absolute;left:16px;right:16px;bottom:var(--dock-bottom,16px);margin:0;z-index:3}
687
+ body.has-session #history{padding-bottom:calc(var(--dock-h,160px) + 16px + var(--dock-bottom,16px))}
667
688
  /* A phone's session panel runs edge to edge: its sides, corners and bottom line go (main's 16px side padding is taken
668
689
  back), so only the message cards are framed and an answer gets the width. The history, the objectives' strip and the
669
- card keep 8px sides; the card's bottom offset (16px) and the history's bottom padding stay, so stage_frame.js's fitCap
670
- reads the same. */
690
+ card keep 8px sides. It runs to the screen's bottom too (main's bottom padding goes): the history scrolls on under
691
+ the card, which floats 16px over the bottom, or on the home indicator's line where that is higher (--dock-bottom). */
671
692
  @media(max-width:600px){
693
+ body.has-session main{padding-bottom:0}
694
+ body.has-session{--dock-bottom:max(16px,var(--safe-b))}
672
695
  body.has-session #center{margin:0 -16px;border-width:1px 0 0;border-radius:0}
673
696
  body.has-session #history{padding-left:8px;padding-right:8px}
674
697
  body.has-session #objectivesStrip{padding-left:8px;padding-right:8px}
675
698
  body.has-session #dock{left:8px;right:8px}
676
699
  }
677
- /* The delivery line (delivery_line.js): a session's row above the text field, always there so the composer never changes height: the key hint while idle; while a turn runs, where a message typed now goes in, then the cut and queue links. One quiet row, ellipsised; a phone gets the short text and chips. */
700
+ /* The delivery line (delivery_line.js): above a phone's width, a session's row above the text field, always there so the composer never changes height: the key hint while idle; while a turn runs, where a message typed now goes in, then the cut and queue links. One quiet row, ellipsised. A phone has no such row (its composer is shorter, and as steady): while a turn runs the line, its short text and chips, lies over the session bar's left, where status, ctx and speed are (hidden while it shows), up to ⚙, only while you type or have a choice armed (below). */
678
701
  #deliveryLine{display:flex;align-items:center;gap:10px}
679
702
  #deliveryLine[hidden]{display:none}
680
703
  #deliveryLine .delivery-where{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@@ -693,6 +716,18 @@ body.has-session #history{padding-bottom:calc(var(--dock-h,160px) + 32px)}
693
716
  #deliveryLine .delivery-link{padding:0 8px;border:1px solid var(--accent-border);border-radius:999px;background:var(--accent-bg);line-height:16px}
694
717
  #deliveryLine .delivery-link:disabled{border-color:var(--border);background:transparent}
695
718
  #deliveryLine .delivery-link.armed{border-color:var(--accent-strong);background:var(--accent-strong)}
719
+ /* No row of its own: idle it is gone; running it is placed over the bar's first row (#composer is its box, the bar
720
+ right under it): the bar's phone padding (10px sides, 6px top, 8px bottom) and height, its right end clear of ⚙
721
+ (32px) and ⋯ (38px) with their gaps. The chips the line covers are hidden, unless the composer is folded away.
722
+ Running, it shows only while it matters, the bar's status, ctx and speed otherwise (a card waiting, a sent steer, a
723
+ message queued after the turn): the text field focused (the keyboard up) or holding text or images, or a choice
724
+ armed or an Apply turn held (delivery_line.js data-armed, data-held; not the queue chip's pressed look, which a
725
+ participant's turn draws with nothing armed). The two rules below share that list: change both. A chip's
726
+ mousedown keeps the focus in the text field, so tapping one doesn't hide the line under the finger. On a bare
727
+ stage an after-turn queued message isn't drawn and the line is hidden too: accepted. */
728
+ body.has-session #deliveryLine{display:none}
729
+ body.has-session #composer:has(:is(#prompt:focus,#prompt:not(:placeholder-shown),#chips:not([hidden]),#deliveryLine[data-armed="1"],#deliveryLine[data-held="1"])) #deliveryLine.running:not([hidden]){display:flex;position:absolute;left:10px;right:96px;top:100%;height:41px;padding:6px 0 8px;box-sizing:border-box;z-index:1}
730
+ body.has-session:not(.composer-folded) #dock:has(#deliveryLine.running:not([hidden])):has(:is(#prompt:focus,#prompt:not(:placeholder-shown),#chips:not([hidden]),#deliveryLine[data-armed="1"],#deliveryLine[data-held="1"])) #infoBar .meta :is(.status,.ctx,.speed){visibility:hidden}
696
731
  }
697
732
  /* A line queued for after the running turn: a dashed bubble, a turn of its own to come. */
698
733
  .bubble.user.queued[data-delivery="queue"]{border:1px dashed var(--accent-border);border-left:3px dashed var(--accent);background:transparent}
@@ -700,9 +735,10 @@ body.has-session #history{padding-bottom:calc(var(--dock-h,160px) + 32px)}
700
735
  .thumb{max-height:120px;max-width:200px;border-radius:6px;border:1px solid var(--border-strong);cursor:zoom-in;object-fit:contain;background:var(--bg)}
701
736
  .activity-row .thumbs{flex-basis:100%;margin-left:var(--row-gutter)}
702
737
  @media(max-width:600px){.activity-row .thumbs{margin-left:0}}
703
- #lightbox{position:fixed;inset:0;z-index:50;background:var(--backdrop);display:flex;align-items:center;justify-content:center;cursor:zoom-out}
738
+ /* The image keeps clear of the notch and the home indicator (its padding: the safe areas; 0 on a desktop). */
739
+ #lightbox{position:fixed;inset:0;z-index:50;background:var(--backdrop);display:flex;align-items:center;justify-content:center;cursor:zoom-out;padding:var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l)}
704
740
  #lightbox[hidden]{display:none}
705
- #lightbox img{max-width:96vw;max-height:94vh;border-radius:6px}
741
+ #lightbox img{max-width:min(96vw,100%);max-height:min(94vh,100%);border-radius:6px}
706
742
  /* The model picker (the start page, and a fresh chain link: start_page.js syncModelPick): reads as a label, "host:model ▾", left of Start; a button under a drawn caret that opens a searchable list (model_picker.js). Its name ellipsizes within max-width. */
707
743
  #composer .actions-col .model-pick{order:0;position:relative;display:inline-block;max-width:min(50%,380px);height:28px;min-height:28px;padding:0 22px 0 8px;border-radius:8px;overflow:hidden;background:transparent;color:var(--text-muted);font-size:12px;line-height:28px;text-align:left;text-overflow:ellipsis;transition:background .12s ease,color .12s ease}
708
744
  /* The start page's row stays one row (Start never wraps): the model name gives way first, down to its min-width, then the override chips ellipsize (100000x their shrink weight: at 1000x their share of the shrink was still a fraction of a pixel, enough for an ellipsis). Scoped off the session composer and a fresh link's button. */
@@ -855,6 +891,24 @@ body.stage-view .turn-stage{position:absolute;left:0;right:0;bottom:100%;margin-
855
891
  .ts-tool{flex:none;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;font-weight:600;color:var(--accent)}
856
892
  .ts-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;color:var(--text-2)}
857
893
  .ts-title.quiet{font-family:inherit;font-style:italic;color:var(--text-faint)}
894
+ /* The quiet signal (stage_stall.js): a running turn silent for a while says so at the now row's right ("quiet 0:40"),
895
+ tinted by level; a running call shows its own clock there instead, plain. No transitions: it appears as it is. */
896
+ .ts-stall,.ts-tool-clock{margin-left:auto;flex:none;white-space:nowrap;font-size:12px;font-variant-numeric:tabular-nums}
897
+ .ts-tool-clock{color:var(--text-muted)}
898
+ .ts-tool-clock+button.task-stop{margin-left:0}
899
+ .ts-stall .short{display:none}
900
+ .ts-now[data-stall="1"]{background:color-mix(in srgb,var(--warn) 10%,transparent)}
901
+ .ts-now[data-stall="1"] .ts-stall{color:var(--warn-text)}
902
+ .ts-now[data-stall="2"]{background:var(--warn-bg);box-shadow:inset 0 0 0 1px var(--warn-border)}
903
+ .ts-now[data-stall="2"] .ts-stall{color:var(--warn-text);font-weight:600}
904
+ .ts-now[data-stall="net"]{background:var(--bg-hover)}
905
+ .ts-now[data-stall="net"] .ts-stall{color:var(--text-muted);font-style:italic}
906
+ /* Its short text in the status row, where the now row doesn't show: a collapsed stage, a plain turn's. */
907
+ .ts-stall-head{display:none;flex:none;font-variant-numeric:tabular-nums}
908
+ .turn-stage:is(.collapsed,.plain) .ts-stall-head:not(:empty){display:inline}
909
+ .turn-stage[data-stall="1"] .ts-stall-head,.turn-stage[data-stall="2"] .ts-stall-head{color:var(--warn-text)}
910
+ .turn-stage[data-stall="2"] .ts-stall-head{font-weight:600}
911
+ .turn-stage[data-stall="net"] .ts-stall-head{font-style:italic}
858
912
  .ts-trail{height:var(--ts-trail-h);display:flex;gap:10px;overflow:hidden;font-size:12px;line-height:18px;color:var(--text-faint);white-space:nowrap}
859
913
  .ts-trail-item{flex:none;max-width:36ch;overflow:hidden;text-overflow:ellipsis}
860
914
  .ts-trail-item:is(.error,.blocked){color:var(--danger-text)}
@@ -1111,6 +1165,10 @@ button.ws-row:hover:not(:disabled){filter:none}@media(hover:hover){button.ws-row
1111
1165
  .ts-defer{display:none}
1112
1166
  .ts-cancel{padding:1px 8px}
1113
1167
  .ts-trail-item{max-width:24ch}
1168
+ /* The quiet signal's short text on a phone; in the status row it takes the step's and the mini tool's room. */
1169
+ .ts-stall .long{display:none}
1170
+ .ts-stall .short{display:inline}
1171
+ .turn-stage.stalled:is(.collapsed,.plain) :is(.ts-step,.ts-mini){display:none}
1114
1172
  /* An approval's Submit in sight on a phone: its folder, reason and rows a little tighter. */
1115
1173
  .approval-where,.approval-why{line-height:1.35}
1116
1174
  .bubble.question.approval .question-option{padding:5px 8px}
@@ -1175,6 +1233,8 @@ button.ws-row:hover:not(:disabled){filter:none}@media(hover:hover){button.ws-row
1175
1233
  #infoBar[data-compact~="settings"] .meta .settings-chip .sc-own{display:none}
1176
1234
  #infoBar[data-compact~="settings"] .meta .settings-chip.own{padding-right:6px}
1177
1235
  #infoBar[data-compact~="settings"] .meta .settings-chip.own::after{content:"";position:absolute;top:3px;right:3px;width:5px;height:5px;border-radius:50%;background:var(--accent)}
1236
+ /* Compact, the dot says the session set its own: no accent border too (it comes back while the panel is open). */
1237
+ #infoBar[data-compact~="settings"] .meta .settings-chip.own:not([aria-expanded="true"]){border-color:transparent}
1178
1238
  /* The plain chips (spans, links) and the status take the button chips' 1px border, transparent and outside their tint, so every chip is one height: a chip wrapping onto a row of plain ones doesn't grow it. */
1179
1239
  #infoBar .meta :is(span,a).model,#infoBar .meta .status{border:1px solid transparent;background-clip:padding-box}
1180
1240
  /* The chips a running turn rewrites (the session clock each second, the last generation's speed, ctx): tabular digits in a reserved width, so a tick ("9.5s" → "10s" → "1m 00s") or a new number doesn't widen the line and move the chips after it. The speed and the clock show from the session's start, a muted placeholder until there is a number. */
@@ -1260,9 +1320,9 @@ body.has-session.composer-folded #infoBar{border-top-color:transparent}
1260
1320
  .pp-invite-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
1261
1321
  .pp-invite-row label{display:inline-flex;align-items:center;gap:4px;font-size:12px;color:var(--text-3)}
1262
1322
  .participants-popover input,.participants-popover select{font:inherit;font-size:12.5px;color:var(--text);background:var(--bg-inset);border:1px solid var(--border-strong);border-radius:6px;padding:3px 7px}
1263
- .pp-invite input[name=name]{flex:1;min-width:120px}
1323
+ .pp-invite input[name=chi-invitee]{flex:1;min-width:120px}
1264
1324
  .pp-invite input[name=cap]{width:52px}
1265
- .pp-invite input[name=identity]{flex:1;min-width:160px}
1325
+ .pp-invite input[name=chi-invitee-account]{flex:1;min-width:160px}
1266
1326
  .pp-bound{color:var(--text-2)}
1267
1327
  .pp-invite .pp-invite-btn{margin-left:auto;background:var(--primary);border-color:var(--primary);color:var(--on-solid);font-weight:600}
1268
1328
  .pp-invite-done{display:flex;flex-direction:column;gap:6px;padding-top:6px;border-top:1px solid var(--border)}
@@ -1386,7 +1446,7 @@ body.has-session.composer-folded #infoBar{border-top-color:transparent}
1386
1446
  .us-detail{margin-top:4px;color:var(--text-muted);font-size:12px;overflow-wrap:anywhere}
1387
1447
  .us-kept{margin-top:6px;color:var(--warn-text);font-size:12px}
1388
1448
  .us-foot{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;margin-top:10px}
1389
- @media(max-width:600px){#updateSheet{position:fixed;inset:auto 8px 8px;width:auto;max-width:none;max-height:min(80dvh,calc(100dvh - 16px));margin:0}}
1449
+ @media(max-width:600px){#updateSheet{position:fixed;inset:auto 8px calc(8px + var(--safe-b));width:auto;max-width:none;max-height:min(80dvh,calc(100dvh - 16px - var(--safe-t) - var(--safe-b)));margin:0}}
1390
1450
  .ctx-pop-kind{font-size:11px;color:var(--text-muted)}
1391
1451
  .ctx-pop-close{margin-left:auto;padding:0 6px;border:none;background:transparent;color:var(--text-muted);font-size:16px;line-height:1}
1392
1452
  @media(hover:hover){.ctx-pop-close:hover{color:var(--text)}}
@@ -1422,6 +1482,9 @@ body.has-session.composer-folded #infoBar{border-top-color:transparent}
1422
1482
  /* ⚙ and ⋯: bigger to the thumb than to the eye. 2 px of negative margin keep the row its height, and each one's ::before reaches the foot's edges for the tap. */
1423
1483
  #infoBar .meta .settings-chip{margin:-2px 0 -2px auto;min-width:32px;min-height:30px;justify-content:center}
1424
1484
  #infoBar .meta .settings-chip::before,#infoBar #infoMoreBtn::before{content:"";position:absolute;inset:-4px -3px -6px}
1485
+ /* ⚙ is in .info, which clips (the fold): its clip box reaches past ⚙'s outset box and its tap reach, so ⚙'s border
1486
+ and ::before are whole; the negative margin keeps the row its height. (⋯ is outside .info.) */
1487
+ #infoBar .info{padding:6px 0;margin:-6px 0}
1425
1488
  #infoBar #infoMoreBtn{width:38px;height:30px;margin:-2px 0;padding:0;font-size:16px}
1426
1489
  #infoBar #infoMoreBtn .more-count{display:none}
1427
1490
  #infoBar #infoMoreBtn[data-attention]::after{top:4px;right:4px}
@@ -1476,21 +1539,35 @@ body:not(.has-session) #dock{width:min(720px,calc(100% - 32px));margin:0 auto}
1476
1539
  body:not(.has-session) #infoBar{display:none}
1477
1540
  #notice{width:min(720px,calc(100% - 32px));margin:0 auto 12px;padding:8px 12px;border:1px solid var(--border-strong);border-radius:8px;color:var(--text-muted);font-size:13px;text-align:center}
1478
1541
  body.has-session #notice{display:none}
1479
- #topBar{display:flex;align-items:center;gap:12px;margin-bottom:-6px}
1480
- #newBtn.brand{background:transparent;border:0;padding:2px 4px;min-height:0;display:inline-flex;align-items:baseline;gap:10px;color:var(--text)}
1542
+ /* The top bar's words on one text line: "chi", "new session", the pills, "all" and the title share a baseline at every
1543
+ width; the bell and the all view's header (no text line of their own) are centred on the row. */
1544
+ #topBar{display:flex;align-items:baseline;gap:12px;margin-bottom:-6px}
1545
+ #newBtn.brand{background:transparent;border:0;padding:1px 4px 2px;min-height:0;display:inline-flex;align-items:baseline;gap:10px;color:var(--text)}
1481
1546
  #newBtn .brand-name{font-size:18px;font-weight:700;letter-spacing:.02em;color:var(--accent)}
1482
- #newBtn .brand-new{font-size:12px;color:var(--text-muted);display:none}
1547
+ #newBtn .brand-new{font-size:12px;color:var(--text-muted);display:none;white-space:nowrap}
1548
+ /* The plus is drawn, as the bell is: 10px beside "new session", 13px alone in a phone's round button. */
1549
+ #newBtn .brand-plus{width:10px;height:10px;vertical-align:-1px;margin-right:5px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round}
1483
1550
  body.has-session #newBtn .brand-new{display:inline}
1484
1551
  #newBtn:hover .brand-new{color:var(--text-2)}
1485
1552
  /* The scope chip: "<project> · all", or "all projects" and where a new session starts (start page only). */
1486
1553
  #scope{display:inline-flex;align-items:center;gap:8px;min-width:0;font-size:12px;color:var(--text-muted)}
1487
1554
  #scope[hidden]{display:none}
1488
- #scope .scope-name{display:inline-flex;align-items:center;flex-shrink:0;padding:2px 9px;border:1px solid var(--border-strong);border-radius:999px;background:transparent;color:var(--text-2);font:inherit;line-height:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:40vw;cursor:pointer;transition:none}
1555
+ #scope .scope-name{display:inline-flex;align-items:center;flex-shrink:0;min-height:28px;padding:0 9px;border:1px solid var(--border-strong);border-radius:999px;background:transparent;color:var(--text-2);font:inherit;line-height:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:40vw;cursor:pointer;transition:none}
1556
+ /* The chip's words in a span of their own: a flex container's bare text gets no ellipsis, a flex item's does. */
1557
+ #scope .scope-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1489
1558
  #scope .scope-name:hover:not(:disabled){filter:none}
1490
1559
  #scope .scope-name.error{color:var(--warn-text);border-color:var(--warn-border)}
1491
1560
  #scope .scope-all{color:var(--text-muted);text-decoration:none}
1492
1561
  #scope .scope-all:hover{color:var(--accent);text-decoration:underline}
1493
1562
  #scope .scope-where{display:inline-flex;gap:5px;min-width:0;white-space:nowrap;font-size:11px}
1563
+ /* A project view (and the error state): the project pill and "all" are one segmented control, at every width. The left
1564
+ segment opens the picker, the right one goes to all projects. No border on the left segment here: on touch its border is
1565
+ its ::before (the touch rules below), and the error state's is the warn one. */
1566
+ #scope:has(> .scope-name + .scope-all:not(.scope-back)){gap:0}
1567
+ #scope:has(> .scope-name + .scope-all:not(.scope-back)) .scope-name{border-radius:999px 0 0 999px;background:var(--bg-raised)}
1568
+ #scope:has(> .scope-name + .scope-all:not(.scope-back)) .scope-all{display:inline-flex;align-items:center;height:28px;padding:0 8px;font-size:12px;border:1px solid var(--border-strong);border-left:0;border-radius:0 999px 999px 0;color:var(--text-muted)}
1569
+ #scope:has(> .scope-name + .scope-all:not(.scope-back)) .scope-all:hover{color:var(--text-2);text-decoration:none}
1570
+ #scope:has(> .scope-name + .scope-all:not(.scope-back)) .scope-all:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
1494
1571
  /* The path cuts on the left, so its last folders stay in view. */
1495
1572
  #scope .scope-where .path{overflow:hidden;text-overflow:ellipsis;direction:rtl;min-width:0;font-family:ui-monospace,monospace}
1496
1573
  #projectPicker{width:min(380px,calc(100vw - 32px))}
@@ -1531,15 +1608,13 @@ body.all-view #scope .scope-where{display:none}
1531
1608
  #topBar{gap:8px}
1532
1609
  #scope{gap:6px}
1533
1610
  #newBtn .brand-new-word{display:none}
1534
- #newBtn .brand-new,#scope .scope-back{white-space:nowrap}
1535
- #scope .scope-back{min-width:0;overflow:hidden;text-overflow:ellipsis}
1536
- #stripStatus{padding:3px 8px}
1537
- #newBtn .brand-new{font-size:16px}
1538
- /* In a session the brand gives its room to the bar: a bare "+", a 32px round button (the start page keeps "chi"); its extra 4px
1539
- taken back so the bar keeps its height. */
1611
+ #scope .scope-back{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1612
+ /* In a session the brand gives its room to the bar: a bare drawn plus, a 28px round button centred on the row, as the bell
1613
+ (the start page keeps "chi"). The plus is centred by flex, not by its line. */
1540
1614
  body.has-session #newBtn .brand-name{display:none}
1541
- body.has-session #newBtn.brand{width:32px;height:32px;margin:-2px 0;padding:0;justify-content:center;align-items:center;border-radius:999px;border:1px solid var(--border-strong)}
1542
- body.has-session #newBtn .brand-new{font-size:20px;line-height:1;color:var(--text-2)}
1615
+ body.has-session #newBtn.brand{align-self:center;width:28px;height:28px;padding:0;justify-content:center;align-items:center;border-radius:999px;border:1px solid var(--border-strong)}
1616
+ body.has-session #newBtn .brand-new{display:flex;color:var(--text-2)}
1617
+ body.has-session #newBtn .brand-plus{width:13px;height:13px;margin:0}
1543
1618
  }
1544
1619
  /* The bell (notifications): quiet at the top bar's right end; filled in the accent when on, struck through when the browser blocks it. */
1545
1620
  /* The open session's title, when no strip card in sight shows it (session_title.js): the bar's middle, cut with an ellipsis; the whole first message in its tooltip.
@@ -1562,20 +1637,23 @@ body.all-view #scope .scope-where{display:none}
1562
1637
  a wrapping line counts) and grow to their text, the pill first; the scope chip cuts with an ellipsis before the pill does.
1563
1638
  The pill drops its session count while it says live or waiting, so the scope chip keeps its words. */
1564
1639
  @media(max-width:600px){
1565
- #topBar{flex-wrap:wrap;row-gap:2px}
1640
+ #topBar{flex-wrap:wrap;row-gap:5px}
1566
1641
  #sessionTitleRow{flex-basis:100%;order:10}
1567
1642
  #sessionTitle{font-size:12px}
1568
1643
  .title-rename{font-size:12px;line-height:18px}
1569
1644
  #scope,#stripStatus{flex:1 1 0;min-width:0;max-width:max-content}
1570
- #stripStatus{flex-grow:1000;overflow:hidden;text-overflow:ellipsis}
1645
+ /* clip, not hidden: the ellipsis as before, and the touch tap box (its ::after) reaches out above and below. */
1646
+ #stripStatus{flex-grow:1000;overflow-x:clip;overflow-y:visible;text-overflow:ellipsis}
1571
1647
  /* A session page: the chip gives way to the pill. The start page has the "new session in …" path beside the chip:
1572
- there the chip keeps its words and the path is what cuts. */
1573
- body.has-session #scope .scope-name{flex-shrink:1;min-width:0}
1574
- body:not(.has-session) #scope .scope-name,body:not(.has-session) #scope .scope-back{flex-shrink:0}
1648
+ there the chip keeps its words and the path is what cuts. Where the path is hidden (the strip hidden, the all view)
1649
+ the chip cuts with an ellipsis as on a session page, or "all" would run under the pill (320px). */
1650
+ #scope .scope-name{flex-shrink:1;min-width:0}
1651
+ body:not(.has-session):not(.strip-hidden):not(.all-view) #scope .scope-name,
1652
+ body:not(.has-session):not(.strip-hidden):not(.all-view) #scope .scope-back{flex-shrink:0}
1575
1653
  body:not(.has-session) #scope .scope-where{flex:1 1 auto;min-width:0}
1576
1654
  #stripStatus:has(.live,.waiting) .pill-count{display:none}
1577
1655
  }
1578
- #notifyBtn{margin-left:auto;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;min-height:0;background:transparent;border:1px solid transparent;border-radius:999px;color:var(--text-muted)}
1656
+ #notifyBtn{margin-left:auto;align-self:center;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;min-height:0;background:transparent;border:1px solid transparent;border-radius:999px;color:var(--text-muted)}
1579
1657
  #notifyBtn[hidden]{display:none}
1580
1658
  @media(hover:hover){#notifyBtn:hover{color:var(--text-2);border-color:var(--border)}}
1581
1659
  #notifyBtn svg{fill:none;stroke:currentColor;stroke-width:1.3;stroke-linejoin:round;stroke-linecap:round}
@@ -1659,15 +1737,15 @@ body.no-glass :is(#familyPop,#chainPop){background:var(--bg-panel);-webkit-backd
1659
1737
  .scope-error{grid-column:1/-1;font-size:13px;color:var(--warn-text)}
1660
1738
  .strip-toggle{font-size:11px;padding:3px 10px;background:transparent;color:var(--text-muted);border:1px solid var(--border);border-radius:999px}
1661
1739
  .strip-toggle:hover{color:var(--text-2);border-color:var(--border-strong)}
1662
- #stripStatus{display:none;white-space:nowrap;flex-shrink:0}
1740
+ /* The sessions pill: the scope pill's twin (28px, the bell's height; 12px text), at every width. Sizes only on the bare id:
1741
+ a colour there would beat .strip-toggle[aria-pressed="true"], the all view's pressed look. */
1742
+ #stripStatus{display:none;align-self:center;height:28px;min-height:0;padding:0 10px;font-size:12px;line-height:26px;white-space:nowrap;flex-shrink:0}
1743
+ #stripStatus:not([aria-pressed="true"]){border-color:var(--border-strong)}
1744
+ #stripStatus:hover{filter:none}
1663
1745
  #stripStatus .live{color:var(--ok-text);white-space:nowrap}
1664
1746
  #stripStatus .live-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--ok);margin-right:4px;vertical-align:1px}
1665
1747
  #stripStatus .waiting{color:var(--warn-text);white-space:nowrap}
1666
1748
  #stripStatus .waiting-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--warn);margin-right:4px;vertical-align:1px}
1667
- /* A narrow window's strip scrolls sideways, and the grip's own target there is thin: the status pill gets a finger-sized one. */
1668
- @media(max-width:900px){
1669
- #stripStatus{min-height:30px;padding:4px 12px;font-size:12px}
1670
- }
1671
1749
  body.strip-hidden #stripStatus{display:block}
1672
1750
  body.strip-hidden #topStrip{display:none}
1673
1751
  /* In the all view the pill is the view's own button, pressed (app.js applyView), whatever the strip's state: a click goes
@@ -1708,9 +1786,23 @@ body.all-view #center, body.all-view #topStrip{display:none}
1708
1786
  /* All sessions' header sits in the top bar (before the bell, at its right end), shown in the all view alone: the search as a
1709
1787
  pill at chip height, the count, the archived toggle, Select. Its own auto margin pushes it right; the bell drops its own
1710
1788
  there (two auto margins would split the space). */
1711
- #allHead{display:none;margin-left:auto;gap:8px;align-items:center;min-width:0;flex-wrap:nowrap;justify-content:flex-end}
1789
+ #allHead{display:none;align-self:center;margin-left:auto;gap:8px;align-items:center;min-width:0;flex-wrap:nowrap;justify-content:flex-end}
1712
1790
  body.all-view #allHead{display:flex}
1713
1791
  @media(min-width:601px){body.all-view #notifyBtn{margin-left:0}}
1792
+ /* Nor does the header squeeze the scope chip there: its "all" segment would run under the sessions pill (800px). */
1793
+ @media(min-width:601px){body.all-view #scope{flex-shrink:0}}
1794
+ /* Where the header doesn't fit beside the chips at its smallest (the search at its min-width), it and the bell after it
1795
+ wrap to a line of their own, right-aligned, rather than run over the sessions pill (~601-760px). The header's basis is
1796
+ that smallest width; it grows into the free space, so where it fits the line looks as before. With the bell shown, the
1797
+ header's box also holds the bell's place (40px: its 28px and the 12px gap) as padding, and the bell's negative margin
1798
+ pulls it into that padding (taking no room of its own): a line breaks before the header and the bell together,
1799
+ never between them. */
1800
+ @media(min-width:601px){
1801
+ body.all-view #topBar{flex-wrap:wrap;row-gap:8px}
1802
+ body.all-view #allHead{flex:1 1 260px}
1803
+ body.all-view:has(#notifyBtn:not([hidden])) #allHead{flex-basis:300px;padding-right:40px}
1804
+ body.all-view #notifyBtn{margin-left:-40px}
1805
+ }
1714
1806
  /* The search field is glass too (no shadow: it is a field, not a card); the focus ring below replaces the highlight. */
1715
1807
  #allHead input{flex:0 1 240px;width:240px;min-width:90px;box-sizing:border-box;height:24px;background:var(--glass-bg);-webkit-backdrop-filter:blur(18px) saturate(1.35);backdrop-filter:blur(18px) saturate(1.35);border:1px solid var(--glass-border);box-shadow:inset 0 1px 0 var(--glass-highlight);color:var(--text);padding:2px 11px;border-radius:999px;font-size:12px}
1716
1808
  #allHead input::placeholder{color:var(--text-faint)}
@@ -1739,8 +1831,9 @@ body.all-view #allHead{display:flex}
1739
1831
  .card.archived{opacity:.6}
1740
1832
  .card.archived:hover{opacity:.85}
1741
1833
  .card .archived-badge,.family-row .archived-badge{font-size:10px;padding:1px 6px;border-radius:6px;border:1px solid var(--border-strong);color:var(--text-muted)}
1742
- /* bottom: above the session's composer card when one shows (--toast-bottom, dock_reserve.js placeToast). */
1743
- #toast{position:fixed;left:50%;bottom:var(--toast-bottom,24px);transform:translateX(-50%);width:max-content;max-width:calc(100vw - 32px);box-sizing:border-box;z-index:50;display:flex;flex-direction:column;align-items:center;gap:8px}
1834
+ /* bottom: above the session's composer card when one shows (--toast-bottom, dock_reserve.js placeToast); else 24px, or
1835
+ 12px over the home indicator. */
1836
+ #toast{position:fixed;left:50%;bottom:var(--toast-bottom,max(24px,calc(var(--safe-b) + 12px)));transform:translateX(-50%);width:max-content;max-width:calc(100vw - 32px);box-sizing:border-box;z-index:50;display:flex;flex-direction:column;align-items:center;gap:8px}
1744
1837
  #toast[hidden]{display:none}
1745
1838
  #toast .toast-item{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;width:max-content;max-width:100%;box-sizing:border-box;padding:8px 14px;border-radius:10px;background:var(--bg-raised);color:var(--text);border:1px solid var(--border-strong);box-shadow:var(--toast-shadow);font-size:13px}
1746
1839
  #toast .toast-message{flex:1 1 180px;min-width:0;overflow-wrap:anywhere}
@@ -1805,6 +1898,9 @@ body.all-view #allHead{display:flex}
1805
1898
  .status.waiting{background:var(--warn-bg);color:var(--warn-text)}
1806
1899
  .status.completed{background:var(--accent-bg);color:var(--accent)}
1807
1900
  .status.error{background:var(--danger-bg-dim);color:var(--danger-text)}
1901
+ /* A re-read that can't reach chi web (resync_reach.js): the history stays, the chip says so. */
1902
+ .status.reconnecting{background:var(--warn-bg);color:var(--warn-text)}
1903
+ .status.offline{background:var(--danger-bg-dim);color:var(--danger-text)}
1808
1904
  .card .owner,.family-row .owner{font-size:11px;padding:2px 6px;border-radius:999px}
1809
1905
  .card .owner.worker,.family-row .owner.worker{background:var(--ok-bg);color:var(--ok-text)}
1810
1906
  .card .owner.tui,.family-row .owner.tui{background:var(--warn-bg);color:var(--warn-text)}
@@ -1828,20 +1924,31 @@ a{color:var(--accent)}
1828
1924
  .bubble.output>.copy-btn::before{inset:-15px -8px -2px -6px}
1829
1925
  .code-wrap>.copy-btn::before{inset:-5px -5px -12px -10px}
1830
1926
  .bubble.user>.copy-btn::before{inset:0 -2px -17px -13px}
1831
- /* The top bar. A phone's has two rows 2px apart (the scope pill over the title's ✎): the pill grows up only, the ✎
1832
- mostly down. */
1927
+ /* The top bar. A phone's has two rows 5px apart (the scope pill over the title's ✎): the pill grows up only, the ✎
1928
+ mostly down, its area ending at the pills' row. The sessions pill keeps a 30px tap box and a phone's round "+" a 32px
1929
+ one (the old sizes) with an invisible pseudo-element. */
1833
1930
  .title-rename{position:relative;z-index:1}
1834
1931
  .title-rename::after{content:"";position:absolute;inset:-5px -9px -16px}
1835
1932
  #notifyBtn{position:relative}
1836
1933
  #notifyBtn::after{content:"";position:absolute;inset:-7px}
1837
1934
  #scope .scope-all{position:relative}
1838
1935
  #scope .scope-all::after{content:"";position:absolute;inset:-14px -4px -11px -3px}
1839
- /* The pill: its box 40px tall and borderless, its border drawn at the box's bottom at the old height (21px) with the
1840
- text in its middle, the box's extra height above taken back by a negative margin so the row keeps its height; the box's
1936
+ #stripStatus{position:relative}
1937
+ #stripStatus::after{content:"";position:absolute;inset:-2px 0}
1938
+ #newBtn{position:relative}
1939
+ #newBtn::after{content:"";position:absolute;inset:-3px}
1940
+ /* The pill: its box 40px tall and borderless (no border at all: a transparent one would put the ::before 1px inside, a
1941
+ 26px pill beside the 28px "all"; the side padding takes its 1px), its border drawn at the box's bottom at the pill's
1942
+ height (28px) with the text in its middle, the box's extra height above taken back by a negative margin so the row keeps its height; the box's
1841
1943
  corners no rounder than the drawn pill's (overflow:hidden would clip them). */
1842
- #scope .scope-name,#scope .scope-name.error{position:relative;min-height:40px;margin:-19px 0 0;padding-top:21px;border-color:transparent;border-radius:11px}
1843
- #scope .scope-name::before{content:"";position:absolute;left:0;right:0;top:19px;bottom:0;border:1px solid var(--border-strong);border-radius:999px;pointer-events:none}
1944
+ #scope .scope-name,#scope .scope-name.error{position:relative;min-height:40px;margin:-12px 0 0;padding:12px 10px 0;border-width:0;border-radius:11px}
1945
+ #scope .scope-name::before{content:"";position:absolute;left:0;right:0;top:12px;bottom:0;border:1px solid var(--border-strong);border-radius:999px;pointer-events:none}
1844
1946
  #scope .scope-name.error::before{border-color:var(--warn-border)}
1947
+ /* The segmented control (project view): the left segment's fill on its drawn pill (::before, under the text), its box's
1948
+ left corners no rounder than the drawn pill's; "all"'s tap box 40px, as the left segment's, up from the row's bottom. */
1949
+ #scope:has(> .scope-name + .scope-all:not(.scope-back)) .scope-name{isolation:isolate;background:transparent;border-radius:11px 0 0 11px}
1950
+ #scope:has(> .scope-name + .scope-all:not(.scope-back)) .scope-name::before{z-index:-1;background:var(--bg-raised);border-radius:999px 0 0 999px}
1951
+ #scope:has(> .scope-name + .scope-all:not(.scope-back)) .scope-all::after{inset:-13px -4px -1px 0}
1845
1952
  /* The active strip card's ✎: inside the strip (overflow-x:auto clips), so its own box grows, into the card's padding. */
1846
1953
  #topStrip .card-rename{padding:9px 13px;margin:-9px -8px}
1847
1954
  /* 🖼 and Send at 36px; the one-line field's line centred on Send (the field is 27px: it sits 4.5px up). */
@@ -1862,12 +1969,12 @@ a{color:var(--accent)}
1862
1969
  <body>
1863
1970
  <main>
1864
1971
  <div id="topBar">
1865
- <button type="button" id="newBtn" class="brand" title="New session"><span class="brand-name">chi</span><span class="brand-new">+<span class="brand-new-word"> new session</span></span></button>
1972
+ <button type="button" id="newBtn" class="brand" title="New session" aria-label="New session"><span class="brand-name">chi</span><span class="brand-new"><svg class="brand-plus" viewBox="0 0 12 12" aria-hidden="true"><path d="M6 1.5v9M1.5 6h9"/></svg><span class="brand-new-word">new session</span></span></button>
1866
1973
  <div id="scope" hidden></div>
1867
1974
  <button type="button" class="strip-toggle" id="stripStatus" title="All sessions, with search"><span class="pill-count">sessions</span></button>
1868
1975
  <span id="sessionTitleRow" hidden><span id="sessionTitle"></span><button type="button" id="titleRenameBtn" class="title-rename" title="Rename this session" aria-label="Rename this session" hidden>✎</button></span>
1869
1976
  <div id="allHead">
1870
- <input id="filter" type="search" placeholder="Search preview, id or status" aria-label="Search sessions" autocomplete="off">
1977
+ <input id="filter" name="chi-filter" type="search" placeholder="Search preview, id or status" aria-label="Search sessions" autocomplete="off">
1871
1978
  <span class="count" id="count"></span>
1872
1979
  <button type="button" class="strip-toggle" id="includeArchived" aria-pressed="false" title="Show archived sessions too">archived</button>
1873
1980
  <button class="ghost" id="selectBtn" title="Pick sessions to archive several at once">Select</button>
@@ -1899,14 +2006,14 @@ a{color:var(--accent)}
1899
2006
  <div id="composer" style="position:relative">
1900
2007
  <div id="commandList" role="listbox" aria-label="Commands" hidden></div>
1901
2008
  <div id="modelPanel" hidden>
1902
- <label class="model-search"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><circle cx="7" cy="7" r="4.5"/><path d="M10.5 10.5 14 14" stroke-linecap="round"/></svg><input id="modelSearch" type="text" placeholder="Search models" autocomplete="off" spellcheck="false" role="combobox" aria-label="Search models" aria-autocomplete="list" aria-controls="modelList" aria-expanded="false"></label>
2009
+ <label class="model-search"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><circle cx="7" cy="7" r="4.5"/><path d="M10.5 10.5 14 14" stroke-linecap="round"/></svg><input id="modelSearch" name="chi-model-search" type="text" placeholder="Search models" autocomplete="off" spellcheck="false" role="combobox" aria-label="Search models" aria-autocomplete="list" aria-controls="modelList" aria-expanded="false"></label>
1903
2010
  <div id="modelList" role="listbox" aria-label="Models"></div>
1904
2011
  </div>
1905
2012
  <div id="deliveryLine" class="composer-line" aria-live="off" hidden></div>
1906
2013
  <div class="compose-col">
1907
2014
  <div id="reviseChip" hidden></div>
1908
2015
  <div id="chips" hidden></div>
1909
- <textarea id="prompt" placeholder="Ask chi anything…" aria-controls="commandList" aria-autocomplete="list" aria-expanded="false"></textarea>
2016
+ <textarea id="prompt" name="chi-composer" autocomplete="off" placeholder="Ask chi anything…" aria-controls="commandList" aria-autocomplete="list" aria-expanded="false"></textarea>
1910
2017
  <div id="composeHint">Enter to start · Shift+Enter for a newline</div>
1911
2018
  </div>
1912
2019
  <div class="actions-col">
@@ -107,7 +107,7 @@ export function infoBarHtml(bar) {
107
107
  if (!bar) return nothing;
108
108
  const memories = bar.memories || [];
109
109
  const sep = (group) => html`<span class=${`bar-sep sep-${group}`} aria-hidden="true"></span>`;
110
- const identity = html`<button type="button" class="id" title=${`Session id ${bar.id}: click to copy it`}>${String(bar.id).slice(0, 8)}</button><span class=${bar.status ? `status ${bar.status}` : "status"}><span>${bar.status || ""}</span></span><span class="model ctx" title=${bar.ctx.tip}>${bar.ctx.text}</span>${bar.speed ? html`<span class=${`model speed${bar.speed.empty ? " empty" : ""}`} title=${bar.speed.tip}>${bar.speed.text}</span>` : nothing}<span class=${`model session-time${bar.clock ? "" : " empty"}`} title=${bar.clock ? "This session's time: its turns, and the running one" : "This session's time: no turn yet"}>${bar.clock || CLOCK_NONE}</span>`;
110
+ const identity = html`<button type="button" class="id" title=${`Session id ${bar.id}: click to copy it`}>${String(bar.id).slice(0, 8)}</button><span class=${bar.status ? `status ${bar.status}` : "status"} title=${bar.statusTip || nothing}><span>${bar.statusText || bar.status || ""}</span></span><span class="model ctx" title=${bar.ctx.tip}>${bar.ctx.text}</span>${bar.speed ? html`<span class=${`model speed${bar.speed.empty ? " empty" : ""}`} title=${bar.speed.tip}>${bar.speed.text}</span>` : nothing}<span class=${`model session-time${bar.clock ? "" : " empty"}`} title=${bar.clock ? "This session's time: its turns, and the running one" : "This session's time: no turn yet"}>${bar.clock || CLOCK_NONE}</span>`;
111
111
  const setup = html`${settingsChip(bar.settings)}<span class=${`model model-name${bar.model.mismatch ? " served-mismatch" : ""}`} title=${bar.model.title}>${bar.model.text}</span>${toolkitChip(bar.toolkit)}${bar.notes ? html`<span class="model notes-chip" title=${bar.notes.title}>${bar.notes.text}</span>` : nothing}${bar.workingSet ? workingSetChipTemplate(bar.workingSet.chip) : memories.length ? html`<span class="model mem-chip" title=${memChipTitle(memories)}>${memChipText(memories)}</span>` : nothing}`;
112
112
  const pruned = !!bar.chain?.pruned && !bar.chain?.prev;
113
113
  const related = !!(bar.chain?.prev || bar.chain?.next || pruned || bar.parent || bar.kids || bar.participants);
@@ -9,6 +9,7 @@ import { ctxBarText, ctxBarTip, lastSpeedText, speedText } from "./ctx.js";
9
9
  import { formatDuration, sessionDurationNow } from "./timing.js";
10
10
  import { workerBadge } from "./update_notice.js";
11
11
  import { chipModel as settingsChipModel } from "./settings_chip.js";
12
+ import { REACH } from "./resync_reach.js";
12
13
 
13
14
  // Every chip and button of the session bar (#infoBar), one item per key:
14
15
  // {key, selector (its element in #infoBar), group (the .meta's identity,
@@ -151,10 +152,16 @@ export function infoBarModel({ id, state, sessions, chain, cardTitle, badge, res
151
152
  // link may not be listed yet: then neither, and its links show dates).
152
153
  const selfIso = state.createdAt || sessions.find((x) => x.id === id)?.created_at || null;
153
154
  const parentChip = delegatedBy(state.parentId, sessions.find((x) => x.id === state.parentId) || null);
155
+ // Not while its turn runs: the stage says "reconnecting…" then (on a
156
+ // phone too, where the bar can hide its status), and the chip keeps it.
157
+ const reach = running ? null : REACH[state.reach] || null;
154
158
  return {
155
159
  id,
156
160
  // Its turn runs but a card blocks it: the word `chi sessions list` has for it.
157
- status: running && waiting ? "waiting" : state.status,
161
+ // A re-read that can't reach chi web says so in its place
162
+ // (resync_reach.js): +statusText+ and +statusTip+ then.
163
+ status: reach ? reach.status : running && waiting ? "waiting" : state.status,
164
+ ...(reach ? { statusText: reach.text, statusTip: reach.tip } : {}),
158
165
  model: modelLabel(state.model, ...(state.served || [])),
159
166
  // A link of a session chain: ← the previous link, → the next one (each
160
167
  // only while the list holds it).
@@ -102,6 +102,9 @@ export function createLiveTiming({
102
102
  get ended() { return ended; },
103
103
  set ended(n) { ended = n; },
104
104
  get ticking() { return ticker !== null; },
105
+ // What the running turn waits on ("": nothing; the stage's quiet signal
106
+ // says nothing while it waits on something named).
107
+ get note() { return note; },
105
108
 
106
109
  start(startedAt = new Date(now()).toISOString(), id = null) {
107
110
  stopTicker();
@@ -0,0 +1,29 @@
1
+ // A text field that isn't a contact form. iOS Safari offers its "AutoFill
2
+ // Contact" bar above the keyboard on a field that looks like one (no
3
+ // autocomplete, a name or label with a contact word in it: name, email,
4
+ // title, phone…), and once it has seen one it offers it on the page's later
5
+ // text fields too, the composer among them. What it respects against that:
6
+ // autocomplete="off" and a name with no contact word in it.
7
+ //
8
+ // Fields drawn by a lit-html template can't call this: they carry the same
9
+ // two attributes in the template (autocomplete="off", a chi-… name), and
10
+ // spec/web/public/no_contact_fill.test.js checks the templates for them; it
11
+ // also checks each field made with createElement (or an el/node helper)
12
+ // goes through this.
13
+ //
14
+ // A module of its own: static JS is cached at unversioned URLs.
15
+
16
+ // The words iOS reads as a contact field, in a name, a placeholder or a
17
+ // label. A field's name never has one; its wording avoids them.
18
+ export const CONTACT_WORDS = /\b(name|e-?mail|title|phone|tel|address|street|city|zip|postal|country|company|organi[sz]ation|first|last|given|family|nickname)\b/i;
19
+
20
+ // +input+ an input or textarea; +name+ its form name (no contact word in
21
+ // it: a chi-… name). +prose+: the reader writes prose here, so autocorrect
22
+ // stays on (autocomplete="off" turns it off in some browsers).
23
+ export function noContactFill(input, name, { prose = false } = {}) {
24
+ if (CONTACT_WORDS.test(name)) throw new Error(`noContactFill: "${name}" reads as a contact field`);
25
+ input.setAttribute("autocomplete", "off");
26
+ if (prose) input.setAttribute("autocorrect", "on");
27
+ input.name = name;
28
+ return input;
29
+ }
@@ -39,6 +39,11 @@ button.obj-chip{cursor:pointer;font:inherit;font-size:13px;line-height:1.4;text-
39
39
  .obj-row-acts{flex:none;display:flex;gap:4px}
40
40
  .obj-check.refuted{color:var(--warn-text)}
41
41
  .obj-check.confirmed{color:var(--text-2)}
42
+ /* The tracker's reading (objectives_track.js): words first; one that differs from the agent's last move gets weight, never colour alone; a stale one fades. */
43
+ .obj-track.differs{color:var(--warn-text);font-weight:600}
44
+ .obj-track.stale{opacity:.7}
45
+ .obj-track-at{font-weight:400;color:var(--text-muted)}
46
+ .obj-track-row{display:flex;justify-content:flex-end}
42
47
  .obj-act{padding:3px 10px;font-size:12px;border-radius:6px}
43
48
  .obj-act.ghost{background:var(--bg-raised);color:var(--text-2)}
44
49
  form.obj-row{align-items:center}
@@ -73,6 +78,15 @@ form.obj-row{align-items:center}
73
78
  .obj-moves{display:flex;flex-direction:column;gap:2px;margin-bottom:-4px;font-size:13px}
74
79
  .obj-move-line{display:flex;align-items:baseline;gap:8px;color:var(--text-2);flex-wrap:wrap}
75
80
  .obj-move-note{min-width:0;flex:1 1 200px;overflow-wrap:anywhere}
81
+ /* A move's state beside its id: words, never colour alone (objectives_state.js). */
82
+ .obj-state{font-size:12px;color:var(--text-2);white-space:nowrap}
83
+ .obj-state.done{font-weight:600}
84
+ /* A done move its turn's runs don't back (Objectives::Backing): muted words. */
85
+ .obj-unbacked{font-size:12px;color:var(--text-muted);font-style:italic}
86
+ /* The newest turn did work and recorded no move (objectives_moves.js), muted where a moves line goes. */
87
+ .obj-nomove{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px;color:var(--text-muted);margin-bottom:-4px}
88
+ @media (pointer:coarse){.obj-track-ask{min-height:36px}}
89
+ .obj-panel.sheet .obj-track-row .obj-act{min-width:0;padding:0 12px}
76
90
  .obj-concerns .obj-pill{margin-right:4px}
77
91
  .obj-notyet{flex:none}
78
92
  .obj-moves:not(.newest) .obj-notyet{display:none}