shadok-ai 0.15.45 → 0.15.46

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 (2) hide show
  1. package/package.json +1 -1
  2. package/public/index.html +13 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadok-ai",
3
- "version": "0.15.45",
3
+ "version": "0.15.46",
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
@@ -4234,8 +4234,20 @@
4234
4234
  d.scrollIntoView({ behavior: "smooth", block: "start" });
4235
4235
  }
4236
4236
 
4237
+ // One confirmation for ending an agent, shared by the header's End button and
4238
+ // the left-column close (the tab's × and the agent menu's "Close agent"), so
4239
+ // the wording never drifts between them. Ending stops the process and drops the
4240
+ // agent from the list; work it committed or left in its worktree is kept — an
4241
+ // empty worktree is cleaned up (invariant 5). The main channel never reaches
4242
+ // here (it cannot be closed).
4243
+ function confirmEndAgent(tab) {
4244
+ const name = (tab && tab.nameEl ? tab.nameEl.textContent : "") || "this agent";
4245
+ return confirm("End “" + name + "”?\n\nIts session stops and it leaves the list. Any work it committed or left in its worktree is kept; an empty worktree is cleaned up.");
4246
+ }
4247
+
4237
4248
  function closeTab(tab) {
4238
4249
  if (tab.isMain) return; // the environment's main channel is never closed
4250
+ if (!confirmEndAgent(tab)) return;
4239
4251
  // Full close: end the channel everywhere (stop the agent, delete its
4240
4252
  // Telegram topic, drop it from the registry). Use the HTTP endpoint so it
4241
4253
  // works even when the session is dead (no live WebSocket) — a zombie channel
@@ -8397,6 +8409,7 @@
8397
8409
  $("chanUpdate").addEventListener("click", () => { if (active) handleClaudeUpdate(active); });
8398
8410
  $("chanCron").addEventListener("click", () => { $("cronOverlay").hidden = false; renderCrons(); });
8399
8411
  $("chanStop").addEventListener("click", () => {
8412
+ if (!active || !confirmEndAgent(active)) return;
8400
8413
  sendTo(active, { type: "stop" });
8401
8414
  });
8402
8415
  // The per-agent menu, opened from the channel header — the same one a