shadok-ai 0.2.30 → 0.2.31

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 +18 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadok-ai",
3
- "version": "0.2.30",
3
+ "version": "0.2.31",
4
4
  "main": "dist/session.js",
5
5
  "scripts": {
6
6
  "test": "node --import tsx --test test/*.ts .claude/skills/shadok-ai-agents/test/*.test.mjs",
package/public/index.html CHANGED
@@ -1308,10 +1308,6 @@
1308
1308
  <span class="label">Name</span>
1309
1309
  <input type="text" id="nameInput" placeholder="agent" autocomplete="off" spellcheck="false">
1310
1310
  </div>
1311
- <div class="field">
1312
- <span class="label">Working directory</span>
1313
- <input type="text" id="cwdInput" placeholder="/path/to/project">
1314
- </div>
1315
1311
  <label class="check" id="worktreeField">
1316
1312
  <input type="checkbox" id="worktreeInput" checked>
1317
1313
  <span>Isolate in a git worktree <span class="check-hint">— the agent edits a fresh branch; review &amp; merge from the Diff panel. Auto-removed on close if unused, kept if it has changes. (new sessions only)</span></span>
@@ -1321,7 +1317,11 @@
1321
1317
  <span>Mirror to Telegram <span class="check-hint">— gives this agent its own topic in the board group, so you can follow it and reply from your phone. Off by default; switchable later from the channel menu.</span></span>
1322
1318
  </label>
1323
1319
  <details class="fold" id="advancedField">
1324
- <summary>Advanced — resume an existing session</summary>
1320
+ <summary>Advanced — working directory, resume an existing session</summary>
1321
+ <div class="field">
1322
+ <span class="label">Working directory <span class="check-hint">— defaults to where shadok-ai runs; point at another repo for a multi-project agent.</span></span>
1323
+ <input type="text" id="cwdInput" placeholder="/path/to/project">
1324
+ </div>
1325
1325
  <div class="field">
1326
1326
  <div class="radio-row">
1327
1327
  <label><input type="radio" name="mode" value="new" checked> new session</label>
@@ -3323,10 +3323,16 @@
3323
3323
  * à la place de la conversation qu'on regardait.
3324
3324
  */
3325
3325
  function openSetup() {
3326
- // Ne jamais écraser ce qui est déjà tapé (la popin peut se rouvrir).
3327
- if (!$("cwdInput").value) {
3328
- $("cwdInput").value = (active && active.cwd) || localStorage.getItem("cp.cwd") || serverCwd || "";
3329
- }
3326
+ // Défauts PRÉVISIBLES à chaque ouverture. Le navigateur restaure l'état des
3327
+ // champs de formulaire (un mode "continue"/"resume" choisi une fois, une case
3328
+ // worktree décochée, un cwd de worktree) c'est ce qui faisait retomber
3329
+ // « créer un agent » dans le répertoire de base, en silence. On réaffirme le
3330
+ // défaut : session NEUVE, worktree isolé, depuis la base.
3331
+ const newRadio = document.querySelector('input[name="mode"][value="new"]');
3332
+ newRadio.checked = true;
3333
+ newRadio.dispatchEvent(new Event("change")); // réactive worktree/profil, cache le resume
3334
+ $("worktreeInput").checked = true;
3335
+ $("cwdInput").value = serverCwd || "";
3330
3336
  const last = localStorage.getItem("cp.session");
3331
3337
  if (last && !$("resumeInput").value) $("resumeInput").value = last;
3332
3338
  $("startBtn").disabled = false;
@@ -3341,7 +3347,9 @@
3341
3347
  refreshRecoverList();
3342
3348
  refreshLiveList();
3343
3349
  $("setupOverlay").hidden = false;
3344
- $("cwdInput").focus();
3350
+ // Le cwd est désormais dans le fold « Advanced » (replié) : on focus le nom,
3351
+ // premier champ du flux principal.
3352
+ $("nameInput").focus();
3345
3353
  }
3346
3354
  function closeSetup() { $("setupOverlay").hidden = true; }
3347
3355