shadok-ai 0.15.23 → 0.15.25

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
@@ -296,6 +296,9 @@ Enter to skip; you can add it later from the web UI).
296
296
 
297
297
  ### Telegram (optional)
298
298
 
299
+ The Telegram panel (header icon) carries a folded *How to set it up, step by step*
300
+ guide, open until a token is saved and a group is bound.
301
+
299
302
  Add your bot to a group with **Topics** enabled, make it an admin with *Manage
300
303
  topics* (and *Delete messages* so `/secret` can scrub values), then in the group:
301
304
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadok-ai",
3
- "version": "0.15.23",
3
+ "version": "0.15.25",
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
@@ -204,6 +204,24 @@
204
204
  }
205
205
  header .ver:hover { text-decoration: underline; }
206
206
  header .ver.stale { color: var(--amber); }
207
+ /* Small badge next to the version: which release channel this instance
208
+ follows (beta by default, alpha on the fast channel). Passive label — the
209
+ version number beside it is what opens the menu. */
210
+ header .ver-chan {
211
+ font-family: var(--mono);
212
+ font-size: 8px;
213
+ letter-spacing: .5px;
214
+ text-transform: uppercase;
215
+ color: var(--text-dim);
216
+ border: 1px solid currentColor;
217
+ border-radius: 3px;
218
+ padding: 0 3px;
219
+ margin-left: 4px;
220
+ vertical-align: 1px;
221
+ opacity: .7;
222
+ }
223
+ header .ver-chan:empty { display: none; }
224
+ header .ver-chan.alpha { color: var(--amber); opacity: .85; }
207
225
  #verMenu {
208
226
  position: fixed; top: 42px; left: 12px; z-index: 1001;
209
227
  background: var(--menu-bg); border: 1px solid var(--line); border-radius: 6px;
@@ -818,6 +836,10 @@
818
836
  .fold > summary:hover { color: var(--text); }
819
837
  .fold > *:not(summary) { margin-top: 8px; }
820
838
  .fold-count { color: var(--amber); }
839
+ .tg-guide { margin-bottom: 12px; }
840
+ .tg-guide ol { margin: 8px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.5; }
841
+ .tg-guide li { margin-bottom: 4px; }
842
+ .tg-guide code { font-size: 12px; }
821
843
  /* A field with no effect in the current mode (resume/continue) — visible but inert. */
822
844
  .na { opacity: .45; pointer-events: none; }
823
845
 
@@ -1914,7 +1936,7 @@
1914
1936
  <body>
1915
1937
 
1916
1938
  <header>
1917
- <span class="brand"><span class="brand-name" id="brandName" title="Rename this cockpit">shadok-ai</span><span class="brand-edit" id="brandEdit" title="Rename this cockpit" aria-hidden="true">✎</span> <span class="ver" id="verView" title="Running version"></span></span>
1939
+ <span class="brand"><span class="brand-name" id="brandName" title="Rename this cockpit">shadok-ai</span><span class="brand-edit" id="brandEdit" title="Rename this cockpit" aria-hidden="true">✎</span> <span class="ver" id="verView" title="Running version"></span><span class="ver-chan" id="verChan" aria-hidden="true"></span></span>
1918
1940
  <span class="spacer"></span>
1919
1941
  <div class="gauge quota" id="quota5h" data-window="5h" title="5h rolling limit">
1920
1942
  <svg class="dial" viewBox="0 0 56 44" role="img" aria-label="5h rolling limit">
@@ -2336,6 +2358,18 @@
2336
2358
  <p class="sec-note" id="tgStatus">…</p>
2337
2359
  </div>
2338
2360
  <div class="pin-body">
2361
+ <details class="fold tg-guide" id="tgGuide">
2362
+ <summary>How to set it up, step by step</summary>
2363
+ <ol>
2364
+ <li>In Telegram, open <b>@BotFather</b>, send <code>/newbot</code>, pick a name and a username ending in <code>bot</code>. It answers with a <b>token</b>.</li>
2365
+ <li>Paste that token below and click <b>Save</b>. The status above turns 🟢 with the bot's name.</li>
2366
+ <li>Create a Telegram <b>group</b>, open its settings and turn on <b>Topics</b>.</li>
2367
+ <li>Add your bot to the group and make it an <b>admin</b> with <i>Manage topics</i> (and <i>Delete messages</i>, so <code>/secret</code> can scrub values).</li>
2368
+ <li>In the group, send <code>/setup</code>. The status above now shows the bound group.</li>
2369
+ <li>Send <code>/spawn &lt;name&gt;</code> (or create a topic by hand): each topic is one agent, also visible here as a tab.</li>
2370
+ </ol>
2371
+ <p class="check-hint">Optional: list chat ids under <i>Allowed chats</i> so only they can reach the bot.</p>
2372
+ </details>
2339
2373
  <button id="tgUnbind" hidden title="Unbind the board group so you can /setup a fresh one (e.g. after it became a supergroup)">Unbind group</button>
2340
2374
  <label class="check"><input type="checkbox" id="tgEnabled"><span>Bot enabled</span></label>
2341
2375
  <div class="field">
@@ -6148,6 +6182,7 @@
6148
6182
  let bootVersion = null;
6149
6183
  let lastVersion = null; // last {current, latest, autoUpdate} seen
6150
6184
  const verView = document.getElementById("verView");
6185
+ const verChan = document.getElementById("verChan");
6151
6186
  const verMenu = document.getElementById("verMenu");
6152
6187
  const autoUpdateChk = document.getElementById("autoUpdateChk");
6153
6188
  const updChannelSel = document.getElementById("updChannelSel");
@@ -6178,6 +6213,14 @@
6178
6213
  verView.textContent = ahead ? "v" + msg.current + " → " + msg.latest : "v" + (msg.current || "?");
6179
6214
  verView.classList.toggle("stale", !!ahead);
6180
6215
  verView.title = ahead ? "Update available — click for options" : "running version — click for options";
6216
+ // Release channel next to the number: beta by default, alpha on the fast
6217
+ // channel. Honest per instance rather than a hardcoded label.
6218
+ if (verChan) {
6219
+ const ch = msg.updateChannel === "alpha" ? "alpha" : "beta";
6220
+ verChan.textContent = ch;
6221
+ verChan.classList.toggle("alpha", ch === "alpha");
6222
+ verChan.title = "Release channel — click the version for options";
6223
+ }
6181
6224
  renderVerMenu();
6182
6225
  }
6183
6226
 
@@ -6357,7 +6400,7 @@
6357
6400
  .catch(() => {});
6358
6401
  // Click outside closes it; clicks inside the menu don't.
6359
6402
  document.addEventListener("click", (e) => {
6360
- if (!verMenu.hidden && !verMenu.contains(e.target) && e.target !== verView) toggleVerMenu(false);
6403
+ if (!verMenu.hidden && !verMenu.contains(e.target) && e.target !== verView && e.target !== verChan) toggleVerMenu(false);
6361
6404
  });
6362
6405
  autoUpdateChk.addEventListener("change", async () => {
6363
6406
  const enabled = autoUpdateChk.checked;
@@ -8926,6 +8969,13 @@
8926
8969
  const err = s.tokenError ? ` — ${s.tokenError}` : "";
8927
8970
  $("tgStatus").textContent = `${dot} ${who}${grp}${err}`;
8928
8971
  $("tgUnbind").hidden = !s.boundGroup; // only offer unbind when a group is bound
8972
+ // The guide unfolds on its own until the setup is done (token + bound group);
8973
+ // once it is, it stays folded unless opened — decided once per opening of
8974
+ // the panel, so saving a token never folds a guide the user is reading.
8975
+ if (!$("tgGuide").dataset.auto) {
8976
+ $("tgGuide").open = !(s.hasToken && s.boundGroup);
8977
+ $("tgGuide").dataset.auto = "1";
8978
+ }
8929
8979
  $("tgEnabled").checked = s.enabled;
8930
8980
  const tok = $("tgToken");
8931
8981
  tok.disabled = s.envOverride;
@@ -8943,6 +8993,7 @@
8943
8993
  }
8944
8994
  }
8945
8995
  async function loadTelegram() {
8996
+ delete $("tgGuide").dataset.auto; // each opening of the panel re-decides the fold
8946
8997
  renderTelegram(await (await fetch("/telegram")).json());
8947
8998
  }
8948
8999
  async function putTelegram(patch) {