shadok-ai 0.9.20 → 0.9.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadok-ai",
3
- "version": "0.9.20",
3
+ "version": "0.9.22",
4
4
  "main": "dist/session.js",
5
5
  "scripts": {
6
6
  "test": "node --import tsx --test test/*.ts context/*/test/*.test.mjs",
@@ -19,5 +19,8 @@ export function echoAuthor(msg) {
19
19
  // want of a name, and even then through the generic wording.
20
20
  const place = origin && origin !== "web" ? origin : "";
21
21
  if (from) return place ? `${from} · ${place}` : from;
22
- return place || "pilot (elsewhere)";
22
+ // No name and nowhere worth naming (a web message, or none): it is the human
23
+ // driving this cockpit — you. Shown for your own prompts and for a message
24
+ // from another of your tabs; a single cockpit has one human.
25
+ return place || "you";
23
26
  }
package/public/index.html CHANGED
@@ -3792,7 +3792,7 @@
3792
3792
  * in /echo-author.js (pure, tested). Guarded on `window`: the ESM bridge runs
3793
3793
  * AFTER the document is parsed (invariant 10). */
3794
3794
  function echoAuthorLabel(msg) {
3795
- return window.echoAuthor ? window.echoAuthor(msg) : "pilot (elsewhere)";
3795
+ return window.echoAuthor ? window.echoAuthor(msg) : "you";
3796
3796
  }
3797
3797
 
3798
3798
  function addTurn(tab, role, who, text, extraClass, at) {
@@ -4701,13 +4701,10 @@
4701
4701
  addTurn(t, "system", "", "— resumed session history —");
4702
4702
  for (const h of msg.turns) {
4703
4703
  if (h.role === "user") {
4704
- // Who sent it, recovered from the stripped ⟦…⟧ header: the SAME
4705
- // label the live echo shows (Michael · telegram). A message with no
4706
- // recoverable author (a plain web prompt) stays the generic "pilot".
4707
- const who = h.from || (h.origin && h.origin !== "web")
4708
- ? echoAuthorLabel({ from: h.from, origin: h.origin })
4709
- : "pilot";
4710
- addTurn(t, "user", who, h.text, "hist", h.at);
4704
+ // Who sent it, recovered from the stripped ⟦…⟧ header, through the
4705
+ // SAME echoAuthor the live echo uses: "Ada · telegram"
4706
+ // for a Telegram message, "you" for your own web prompt.
4707
+ addTurn(t, "user", echoAuthorLabel({ from: h.from, origin: h.origin }), h.text, "hist", h.at);
4711
4708
  } else {
4712
4709
  const b = addTurn(t, "claude", "claude", h.text, "hist", h.at);
4713
4710
  // A hidden prompt (cron / notification) ran before this turn: keep
@@ -5100,7 +5097,7 @@
5100
5097
  // Sending = going back to the bottom, whatever happens (even after scrolling
5101
5098
  // up): you want to see your message and the answer that follows.
5102
5099
  t.transcriptEl._stickBottom = true;
5103
- addTurn(t, "user", "pilot", text, null, Date.now());
5100
+ addTurn(t, "user", "you", text, null, Date.now());
5104
5101
  startTurnTimer(t);
5105
5102
  setTabMood(t, "working");
5106
5103
  // Remember this channel's last sent prompt, so Escape (an interruption) can