shadok-ai 0.19.28 → 0.19.30

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.
package/README.md CHANGED
@@ -86,7 +86,8 @@ Enter to skip; you can add it later from the web UI).
86
86
  with a speech bubble (and no presence dot).
87
87
  - **Groups** — on a desktop the groups live in their own **left column**: pick
88
88
  one to narrow the agents pane to it, and the global tools (Profiles, Ledger,
89
- Secrets, Users, Security, Telegram, Sound) stay in the header at the top. Each
89
+ Secrets, Users, Security) stay in the header at the top; Telegram and the
90
+ notification **Sound** live under the header **⋯** to keep the bar compact. Each
90
91
  agent is a round avatar with a presence dot (green ready, red working, hollow
91
92
  offline). A group's icon opens the icon picker: choose from the grid, type any
92
93
  emoji, or **type a word** (`rocket`, `bug`, `money`…) to search for one; its
@@ -533,11 +534,18 @@ Enter to skip; you can add it later from the web UI).
533
534
  rename, change profile, mirror to Telegram, close — and closing it brings the
534
535
  card back. Desktop only: the agents column is hidden on phones.
535
536
  - **Guided tour** — on a browser's first visit, a welcome card explains what
536
- shadok-ai is, then a spotlight walks the real controls: the agents list, an
537
- agent's ⋯ menu, scheduled prompts, the toolbar, the quota bars. Skip and
537
+ shadok-ai is, then a spotlight walks the real controls, in up to eleven stops:
538
+ the groups column, the agents list (and rooms), an agent's own bar (gallery,
539
+ about, terminal), its ⋯ menu, schedules and webhooks, the composer (attach, add
540
+ a skill, dictate), the toolbar (secrets, ledger, Skill Factory, profiles,
541
+ Telegram, sound, and what the ⋯ holds), the people buttons (Users, Reports,
542
+ Security), the quota bars, and the cockpit's name and settings menu. Skip and
538
543
  Escape end it at any point; ⋯ → *Guided tour* replays it. A step whose target
539
544
  isn't on screen is **dropped rather than faked** — an empty cockpit has no
540
- agent menu, so it gets a shorter tour instead of a spotlight on nothing. The
545
+ agent menu, a cockpit with no group has no groups column, a member has no
546
+ Reports button — so it gets a shorter tour instead of a spotlight on nothing.
547
+ The bubble sits below its target, above it, or **beside** it when the target
548
+ is a full-height column, so it never covers what it describes. The
541
549
  **phone gets the whole tour**, because a step can name the landmark on either
542
550
  layout (the agents column *or* the channel picker) and is framed on whichever
543
551
  one is rendered. On a brand-new instance it comes **before** the sign-in card
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadok-ai",
3
- "version": "0.19.28",
3
+ "version": "0.19.30",
4
4
  "main": "dist/session.js",
5
5
  "scripts": {
6
6
  "test": "node --import tsx --test --test-timeout=120000 test/*.ts context/*/test/*.test.mjs",
package/public/index.html CHANGED
@@ -12302,7 +12302,10 @@
12302
12302
  // SINGLE row (brand + dials + ⋯) by moving EVERY tool icon into the ⋯ menu —
12303
12303
  // the real button elements, so their click handlers travel with them.
12304
12304
  // Recomputed on load, on resize, and when the instance name changes.
12305
- const OVERFLOW_TOOLS = ["secretsBtn", "ledgerBtn", "factoryBtn", "profilesBtn", "telegramBtn", "muteNotif"];
12305
+ const OVERFLOW_TOOLS = ["secretsBtn", "ledgerBtn", "factoryBtn", "profilesBtn"];
12306
+ // Always in the ⋯ menu, at EVERY width (not only on a phone): Telegram and the
12307
+ // notification bell were moved off the header row to keep the top bar compact.
12308
+ const PINNED_OVERFLOW_TOOLS = ["telegramBtn", "muteNotif"];
12306
12309
  function reflowHeaderTools() {
12307
12310
  const hdrTools = document.querySelector(".hdr-tools");
12308
12311
  const moreWrap = document.querySelector(".more-wrap");
@@ -12315,6 +12318,12 @@
12315
12318
  if (mobile) overflow.appendChild(el); // all into the ⋯ menu
12316
12319
  else hdrTools.insertBefore(el, moreWrap); // back in the header, in order
12317
12320
  }
12321
+ // These stay under ⋯ regardless of width, appended after the width-driven
12322
+ // ones so the phone menu keeps the header's left-to-right order.
12323
+ for (const id of PINNED_OVERFLOW_TOOLS) {
12324
+ const el = $(id);
12325
+ if (el) overflow.appendChild(el);
12326
+ }
12318
12327
  }
12319
12328
  let reflowPending = false;
12320
12329
  function scheduleReflow() {
@@ -8,8 +8,16 @@
8
8
  // See docs/superpowers/specs/2026-08-11-guided-tour-design.md.
9
9
 
10
10
  /**
11
- * The tour, grouped on purpose: a spotlight frames a REGION, so nine landmarks
12
- * fit in four stops. A step per button is a tour people abandon.
11
+ * The tour, grouped on purpose: a spotlight frames a REGION, so some thirty
12
+ * controls fit in ten stops. A step per button is a tour people abandon.
13
+ *
14
+ * It is also a set of CLAIMS about the page, and the page moves faster than
15
+ * this file: it sat at six steps while the cockpit gained groups, rooms, the
16
+ * Skill Factory, webhooks, a composer with three buttons, accounts and a
17
+ * settings menu — none of which a first-time visitor was shown. So when a
18
+ * landmark is added to the page, it is added to a step here (or gets its own),
19
+ * in the same change. `test/tour-steps.test.ts` holds the list of what must be
20
+ * named; it cannot notice a landmark nobody told it about.
13
21
  *
14
22
  * `target` is a CSS selector, an array of them (framed as one rectangle), or
15
23
  * null for the centred welcome card.
@@ -31,13 +39,30 @@ export const TOUR_STEPS = [
31
39
  "You drive them from this page — or from Telegram, where one topic is one agent.",
32
40
  target: null,
33
41
  },
42
+ {
43
+ id: "groups",
44
+ title: "Groups sort the work",
45
+ // Says "can also be a wall" rather than listing private/restricted as
46
+ // things to click: a single-tenant instance (the `npx` default) refuses to
47
+ // create either, and a tour promising a control that answers "not here" is
48
+ // the copy twin of a spotlight on empty space.
49
+ body:
50
+ "Agents are filed into groups — one per project, team or subject. Pick a group to " +
51
+ "narrow the list to it. On a cockpit set up for several people a group can also be a " +
52
+ "wall: restricted to a team or private to you, with its own secrets, and agents that " +
53
+ "run apart from everyone else's.",
54
+ // The rail is hidden when there is nothing to show in it, and a phone lists
55
+ // the groups inside the closed agents sheet — both drop this step honestly.
56
+ target: "#groupRail",
57
+ },
34
58
  {
35
59
  id: "agents",
36
60
  title: "Your agents live here",
37
61
  body:
38
62
  "Every agent gets its own git worktree and branch, so several never collide. " +
39
63
  "Pick one here to follow it, and “+ New agent” starts another. One of them is this " +
40
- "cockpit's home agent: the only one that cannot be closed.",
64
+ "cockpit's home agent: the only one that cannot be closed. A room is the exception: " +
65
+ "a conversation between people, with no agent behind it and no quota spent.",
41
66
  // The column on desktop, the agents-picker button on a phone — never both at
42
67
  // once. The phone's `#chanPicker` opens the SAME column as a bottom sheet, so
43
68
  // "+ New agent" and Tweak are reachable there too now — but the spotlight
@@ -47,12 +72,26 @@ export const TOUR_STEPS = [
47
72
  // moment of the spotlight is the same failure as a spotlight on empty space.
48
73
  target: ["#tabbar", "#chanPicker"],
49
74
  },
75
+ {
76
+ id: "bar",
77
+ title: "Look inside an agent",
78
+ // A list of functions, not of icons in a row — see the toolbar step for
79
+ // what "left to right" cost. Schedule and webhooks sit inside this frame
80
+ // too and are deliberately NOT described here: they get their own stop.
81
+ body:
82
+ "The bar above the conversation is about the agent on screen. The gallery gathers " +
83
+ "every photo and video exchanged with it, “About” lists the skills it uses and its " +
84
+ "schedules, and the terminal shows the raw Claude Code screen — for the rare moment " +
85
+ "the chat is not enough.",
86
+ target: ["#chanGallery", "#chanCron", "#chanWebhooks", "#chanInfo", "#chanTerm"],
87
+ },
50
88
  {
51
89
  id: "tab",
52
90
  title: "Each agent has its own menu",
53
91
  body:
54
- "This ⋯ holds an agent's controls: mute, reload, rename, change its profile, mirror it " +
55
- "to a Telegram topic, or have it report to another agent when it finishes. " +
92
+ "This ⋯ holds an agent's controls: mute, reload, rename, change its profile, its model " +
93
+ "or how hard it thinks, read its token stats, mirror it to a Telegram topic, or have " +
94
+ "it report to another agent when it finishes. " +
56
95
  "“Context sent” shows exactly what shadok told it at spawn — and, except for the home " +
57
96
  "agent, this is where you close it.",
58
97
  // `#chanMenu`, NOT `.tab.active`. Two reasons, and the second is why it
@@ -70,11 +109,26 @@ export const TOUR_STEPS = [
70
109
  // prominent thing in the tour, and a first-time visitor never met it.
71
110
  id: "schedule",
72
111
  title: "They can work while you're away",
112
+ // It said "in that same ⋯ menu" and pointed at the menu, which stayed true
113
+ // (the entries are still there) while the bar grew a button for each — so
114
+ // the tour described a detour past the control in plain sight. It frames
115
+ // the two buttons now, and the menu remains the fallback target for a
116
+ // layout that would not render them.
73
117
  body:
74
- "“Schedule”, in that same ⋯ menu, pairs a recurring prompt with a shell check that runs " +
75
- "without the model. Silent check → nothing happened, the agent stays asleep at zero " +
76
- "tokens. Otherwise it wakes up holding the finding, and tells you here or on Telegram.",
77
- target: "#chanMenu",
118
+ "A schedule pairs a recurring prompt with a shell check that runs without the model. " +
119
+ "Silent check → nothing happened, the agent stays asleep at zero tokens. Otherwise it " +
120
+ "wakes up holding the finding, and tells you here or on Telegram. A webhook is the " +
121
+ "same idea from outside: an HTTP call from another system wakes the agent.",
122
+ target: ["#chanCron", "#chanWebhooks"],
123
+ },
124
+ {
125
+ id: "composer",
126
+ title: "Talk to it — with more than text",
127
+ body:
128
+ "Write to the agent here. Attach a file, or paste or drop one in; add one of its " +
129
+ "skills to the prompt; or dictate instead of typing. It works the other way too: " +
130
+ "when an agent's result is a file, it arrives in the conversation as a download.",
131
+ target: "#composer",
78
132
  },
79
133
  {
80
134
  id: "tools",
@@ -90,40 +144,78 @@ export const TOUR_STEPS = [
90
144
  // no test here can hold; a list of functions is not.
91
145
  body:
92
146
  "The secret vault injected into agents that need it, the shared ledger of what your " +
93
- "agents have already resolved, profiles (role, guardrails, model), Telegram, and the " +
94
- "notification sound. On a narrow screen they fold into the ⋯ — which also holds the " +
95
- "diff of an agent's work, the palette, and replays this tour.",
147
+ "agents have already resolved, the Skill Factory where skills are written, released " +
148
+ "and shared, and profiles (role, guardrails, model). Telegram and the notification " +
149
+ "sound live under the ⋯ — which also holds the diff of an agent's work, the whole " +
150
+ "instance's stats, light or dark mode, the palette, and this tour. On a narrow screen " +
151
+ "the rest fold in there too.",
96
152
  // NOT `.hdr-tools`, which is `display: contents` on desktop and therefore
97
153
  // generates no box at all — its rect is all zeros, so the step would have
98
154
  // been dropped as "not visible" on the very layout where the toolbar is
99
155
  // most obvious. Framing the buttons themselves works on both layouts.
100
156
  //
101
157
  // Every tool is listed, including the ones `reflowHeaderTools` parks inside
102
- // the closed ⋯ menu on a phone: those measure {0,0,0,0} and `unionRect`
103
- // now drops them, so the group frames exactly what is on screen. Listing
104
- // only some of them was the older bug in the other direction — `#usersBtn`
105
- // sits left of `#secretsBtn` and stayed outside the spotlight.
158
+ // the closed ⋯ menu — the width-driven ones on a phone, and `#telegramBtn` /
159
+ // `#muteNotif` at every width: those measure {0,0,0,0} and `unionRect` drops
160
+ // them, so the group frames exactly what is on screen. Listing only some of
161
+ // them was the older bug in the other direction — `#usersBtn` sits left of
162
+ // `#secretsBtn` and stayed outside the spotlight.
106
163
  target: [
107
164
  "#usersBtn",
108
165
  "#secretsBtn",
109
166
  "#ledgerBtn",
167
+ "#factoryBtn",
110
168
  "#profilesBtn",
169
+ "#securityBtn",
170
+ "#reportsBtn",
111
171
  "#telegramBtn",
112
172
  "#muteNotif",
113
173
  "#moreBtn",
114
174
  "#starBtn",
115
175
  ],
116
176
  },
177
+ {
178
+ id: "people",
179
+ title: "People, not only agents",
180
+ // Its own step BECAUSE it is conditional: all three buttons start `hidden`
181
+ // and which ones show depends on the role (`loadMe`). Folded into the
182
+ // toolbar body they would be named to people who do not have them. Here the
183
+ // step is dropped when none is rendered — the tour's one rule — and the
184
+ // body says "depends on your role" for the partial case.
185
+ //
186
+ // It does NOT say "this instance has accounts": the lone admin of a
187
+ // no-password instance sees all three, and has none.
188
+ body:
189
+ "A few buttons are about people rather than agents — which ones you see depends on " +
190
+ "your role. Users is where people are invited and where you add a passkey for " +
191
+ "two-factor sign-in, Reports is where a stuck agent asks an admin for help, and " +
192
+ "Security shows what happened to your own account.",
193
+ target: ["#securityBtn", "#reportsBtn", "#usersBtn"],
194
+ },
117
195
  {
118
196
  id: "quota",
119
197
  title: "Watch your quota",
120
198
  body:
121
199
  "Your 5h and 7d subscription usage. Each bar fills with what you've spent, and the " +
122
200
  "white marker is the pace that would spend the window exactly on time — a fill past " +
123
- "the marker means you're burning faster. To the left, the cockpit's name is yours to " +
124
- "change, and the version beside it opens updates and the permission mode.",
201
+ "the marker means you're burning faster. Past the pace, a new prompt is held back " +
202
+ "unless you choose to send it anyway.",
125
203
  target: ["#quota5h", "#quota7d"],
126
204
  },
205
+ {
206
+ id: "settings",
207
+ title: "The cockpit's own settings",
208
+ // Was one trailing sentence of the quota step ("to the left… the version
209
+ // beside it"), i.e. a position, on a control the spotlight was not on. The
210
+ // menu behind the version has since become where an instance is configured,
211
+ // which a clause could no longer carry.
212
+ body:
213
+ "The name tells this cockpit apart when you run several; an admin can change it. The " +
214
+ "version opens this instance's settings, most of them an admin's: the Claude account " +
215
+ "and when its sign-in expires, updates and their channel, the permission mode and " +
216
+ "default model for new agents, and the instance context every agent here receives.",
217
+ target: ["#brandName", "#verView", "#verChan"],
218
+ },
127
219
  ];
128
220
 
129
221
  /** Pure: the steps whose target is on screen, in order. */
@@ -167,12 +259,34 @@ const clamp = (v, lo, hi) => Math.max(lo, Math.min(v, hi));
167
259
  *
168
260
  * Below by default, flipped above when it would overflow the bottom, and
169
261
  * clamped to the viewport on both axes so it is never partly off screen.
262
+ *
263
+ * BESIDE when neither fits, which is every full-height column. Flipping above
264
+ * a target that starts near the top has nowhere to go, so the clamp dropped
265
+ * the bubble ON the column it was describing: the groups step hid the very
266
+ * group names it was pointing at, under a card explaining what groups are.
267
+ * Clamped is "on screen", not "out of the way" — only a side placement is
268
+ * both. When no side has room either (a phone), the old clamp still applies:
269
+ * covering part of the target beats leaving the viewport.
170
270
  */
171
271
  export function bubblePlacement({ target, bubble, viewport, gap = 12 }) {
172
272
  const below = target.top + target.height + gap;
173
273
  const fitsBelow = below + bubble.height + gap <= viewport.height;
274
+ const above = target.top - bubble.height - gap;
275
+ if (!fitsBelow && above < gap) {
276
+ const right = target.left + target.width + gap;
277
+ const left = target.left - bubble.width - gap;
278
+ const beside =
279
+ right + bubble.width + gap <= viewport.width ? right : left >= gap ? left : null;
280
+ if (beside !== null) {
281
+ return {
282
+ side: beside === right ? "right" : "left",
283
+ top: clamp(target.top, gap, viewport.height - bubble.height - gap),
284
+ left: beside,
285
+ };
286
+ }
287
+ }
174
288
  const side = fitsBelow ? "below" : "above";
175
- const rawTop = fitsBelow ? below : target.top - bubble.height - gap;
289
+ const rawTop = fitsBelow ? below : above;
176
290
  const rawLeft = target.left + target.width / 2 - bubble.width / 2;
177
291
  return {
178
292
  side,