@hyperwindmill/caretaker-cli 0.30.0 → 0.31.0

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 (43) hide show
  1. package/dist/cli/web/voice_backend.d.ts +4 -0
  2. package/dist/cli/web/voice_backend.d.ts.map +1 -1
  3. package/dist/cli/web/voice_backend.js +14 -3
  4. package/dist/cli/web/voice_builtin.d.ts.map +1 -1
  5. package/dist/cli/web/voice_builtin.js +32 -13
  6. package/dist/cli/web/voice_proxy.d.ts +3 -0
  7. package/dist/cli/web/voice_proxy.d.ts.map +1 -1
  8. package/dist/cli/web/voice_proxy.js +28 -3
  9. package/dist/harness/tools/builtin/set_workspace.d.ts.map +1 -1
  10. package/dist/harness/tools/builtin/set_workspace.js +26 -4
  11. package/dist/session/store.d.ts +2 -2
  12. package/dist/session/store.d.ts.map +1 -1
  13. package/dist/session/store.js +5 -2
  14. package/dist/session/types.d.ts +2 -1
  15. package/dist/session/types.d.ts.map +1 -1
  16. package/dist/store/db.d.ts.map +1 -1
  17. package/dist/store/db.js +3 -1
  18. package/dist/voice/pocket/install.d.ts +16 -2
  19. package/dist/voice/pocket/install.d.ts.map +1 -1
  20. package/dist/voice/pocket/install.js +59 -5
  21. package/dist/voice/pronunciation.d.ts.map +1 -1
  22. package/dist/voice/pronunciation.js +3 -0
  23. package/dist/voice/whisper/catalog.d.ts +15 -0
  24. package/dist/voice/whisper/catalog.d.ts.map +1 -0
  25. package/dist/voice/whisper/catalog.js +53 -0
  26. package/dist/voice/whisper/decoder.d.ts +3 -0
  27. package/dist/voice/whisper/decoder.d.ts.map +1 -0
  28. package/dist/voice/whisper/decoder.js +48 -0
  29. package/dist/voice/whisper/engine.d.ts +8 -0
  30. package/dist/voice/whisper/engine.d.ts.map +1 -0
  31. package/dist/voice/whisper/engine.js +77 -0
  32. package/dist/voice/whisper/features.d.ts +10 -0
  33. package/dist/voice/whisper/features.d.ts.map +1 -0
  34. package/dist/voice/whisper/features.js +149 -0
  35. package/dist/voice/whisper/inference.d.ts +17 -0
  36. package/dist/voice/whisper/inference.d.ts.map +1 -0
  37. package/dist/voice/whisper/inference.js +257 -0
  38. package/dist/voice/whisper/wav.d.ts +5 -0
  39. package/dist/voice/whisper/wav.d.ts.map +1 -0
  40. package/dist/voice/whisper/wav.js +48 -0
  41. package/dist/webview/standalone.js +914 -687
  42. package/dist/webview/standalone.js.map +4 -4
  43. package/package.json +3 -3
@@ -14583,11 +14583,11 @@
14583
14583
  });
14584
14584
 
14585
14585
  // src/standalone.tsx
14586
- var import_react25 = __toESM(require_react(), 1);
14586
+ var import_react26 = __toESM(require_react(), 1);
14587
14587
  var import_client = __toESM(require_client(), 1);
14588
14588
 
14589
14589
  // src/App.tsx
14590
- var import_react24 = __toESM(require_react(), 1);
14590
+ var import_react25 = __toESM(require_react(), 1);
14591
14591
 
14592
14592
  // src/assistant_activation.ts
14593
14593
  function beginActivation(agentId, confirmedAgentId, knownAgentIds, current) {
@@ -17392,7 +17392,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
17392
17392
  }
17393
17393
 
17394
17394
  // src/SettingsPanel.tsx
17395
- var import_react20 = __toESM(require_react(), 1);
17395
+ var import_react21 = __toESM(require_react(), 1);
17396
17396
 
17397
17397
  // src/ProvidersTab.tsx
17398
17398
  var import_react7 = __toESM(require_react(), 1);
@@ -20774,7 +20774,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
20774
20774
  }
20775
20775
 
20776
20776
  // src/VoiceTab.tsx
20777
- var import_react17 = __toESM(require_react(), 1);
20777
+ var import_react18 = __toESM(require_react(), 1);
20778
20778
 
20779
20779
  // src/voice_utils.ts
20780
20780
  var END_OF_TURN_MS = 1200;
@@ -20839,6 +20839,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
20839
20839
  v2.lang ?? "",
20840
20840
  v2.autoStartBackend === true,
20841
20841
  v2.ttsEngine ?? "",
20842
+ v2.sttEngine ?? "",
20843
+ v2.sttBuiltinModel ?? "",
20842
20844
  v2.ttsLanguage ?? "",
20843
20845
  v2.pronunciationEnabled === true,
20844
20846
  v2.pronunciation ?? null,
@@ -21157,8 +21159,135 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21157
21159
  ] });
21158
21160
  }
21159
21161
 
21160
- // src/PronunciationTable.tsx
21162
+ // src/BuiltinSttBlock.tsx
21163
+ var import_react17 = __toESM(require_react(), 1);
21161
21164
  var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
21165
+ var MB2 = 1024 * 1024;
21166
+ function sizeLabel2(bytes) {
21167
+ return `${Math.max(1, Math.round(bytes / MB2))} MB`;
21168
+ }
21169
+ function BuiltinSttBlock({ status, onStatusChange, model, onModelChange }) {
21170
+ const [busy, setBusy] = (0, import_react17.useState)(false);
21171
+ const [progress, setProgress] = (0, import_react17.useState)(null);
21172
+ const [error, setError] = (0, import_react17.useState)(null);
21173
+ const [confirmingDelete, setConfirmingDelete] = (0, import_react17.useState)(false);
21174
+ const loadError = status.runtime.loadError;
21175
+ const selected = status.stt.find((m2) => m2.id === model);
21176
+ const query = `?stt=${encodeURIComponent(model)}`;
21177
+ const install = async () => {
21178
+ setBusy(true);
21179
+ setError(null);
21180
+ setProgress("Starting\u2026");
21181
+ try {
21182
+ const res = await fetch(`/api/voice/builtin/install${query}`, { method: "POST" });
21183
+ if (!res.ok || !res.body) {
21184
+ setError(await res.text().catch(() => "") || "Install failed.");
21185
+ return;
21186
+ }
21187
+ const reader = res.body.getReader();
21188
+ const decoder = new TextDecoder();
21189
+ let buffer = "";
21190
+ for (; ; ) {
21191
+ const { done, value } = await reader.read();
21192
+ if (done) break;
21193
+ const { lines, remainder } = splitNdjsonLines(buffer, decoder.decode(value, { stream: true }));
21194
+ buffer = remainder;
21195
+ for (const line of lines) {
21196
+ let p;
21197
+ try {
21198
+ p = JSON.parse(line);
21199
+ } catch {
21200
+ continue;
21201
+ }
21202
+ if (p.step === "done") onStatusChange(p.status);
21203
+ else if (p.step === "error") setError(p.message);
21204
+ else {
21205
+ const pct = p.total > 0 ? ` ${Math.floor(p.received / p.total * 100)}%` : "";
21206
+ setProgress(`${p.step === "runtime" ? "Runtime" : "Model"}: ${p.file}${pct}`);
21207
+ }
21208
+ }
21209
+ }
21210
+ } catch (err) {
21211
+ setError(err instanceof Error ? err.message : String(err));
21212
+ } finally {
21213
+ setBusy(false);
21214
+ setProgress(null);
21215
+ }
21216
+ };
21217
+ const remove = async () => {
21218
+ setConfirmingDelete(false);
21219
+ setBusy(true);
21220
+ setError(null);
21221
+ try {
21222
+ const res = await fetch(`/api/voice/builtin/delete${query}`, { method: "POST" });
21223
+ if (res.ok) onStatusChange(await res.json());
21224
+ else setError(await res.text().catch(() => "") || "Delete failed.");
21225
+ } catch (err) {
21226
+ setError(err instanceof Error ? err.message : String(err));
21227
+ } finally {
21228
+ setBusy(false);
21229
+ }
21230
+ };
21231
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "form-group", children: [
21232
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { htmlFor: "voice-builtin-stt", children: [
21233
+ "Built-in transcription",
21234
+ " ",
21235
+ loadError ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("em", { children: "(not available on this system)" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("em", { children: "(Whisper)" })
21236
+ ] }),
21237
+ loadError ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { className: "form-error", children: loadError }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
21238
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21239
+ "select",
21240
+ {
21241
+ id: "voice-builtin-stt",
21242
+ value: model,
21243
+ onChange: (e) => {
21244
+ onModelChange(e.target.value);
21245
+ setConfirmingDelete(false);
21246
+ },
21247
+ children: status.stt.map((m2) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("option", { value: m2.id, children: [
21248
+ m2.id,
21249
+ m2.id === "base" ? " (recommended)" : "",
21250
+ " \u2014",
21251
+ " ",
21252
+ m2.installed ? "installed" : `not installed, ${sizeLabel2(m2.bytes)}`
21253
+ ] }, m2.id))
21254
+ }
21255
+ ),
21256
+ selected && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "voice-backend-status", children: [
21257
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: progress ?? (selected.installed ? `Installed (${sizeLabel2(selected.bytes)})` : `Not installed \u2014 downloads ${sizeLabel2(selected.bytes)}`) }),
21258
+ !selected.installed && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: install, disabled: busy, children: busy ? "Installing\u2026" : "Install" }),
21259
+ selected.installed && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21260
+ "button",
21261
+ {
21262
+ type: "button",
21263
+ onClick: confirmingDelete ? remove : () => setConfirmingDelete(true),
21264
+ disabled: busy,
21265
+ children: confirmingDelete ? "Really delete?" : "Delete"
21266
+ }
21267
+ )
21268
+ ] }),
21269
+ error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { className: "form-error", children: error }),
21270
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "Runs inside caretaker \u2014 no server or Docker. Small is slow for conversation on most CPUs; base is the better trade-off." })
21271
+ ] }),
21272
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
21273
+ "Whisper by OpenAI (MIT), ONNX export by",
21274
+ " ",
21275
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21276
+ "a",
21277
+ {
21278
+ href: `https://huggingface.co/onnx-community/whisper-${model || "base"}`,
21279
+ target: "_blank",
21280
+ rel: "noreferrer",
21281
+ children: "onnx-community"
21282
+ }
21283
+ ),
21284
+ "."
21285
+ ] })
21286
+ ] });
21287
+ }
21288
+
21289
+ // src/PronunciationTable.tsx
21290
+ var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
21162
21291
  function PronunciationTable({
21163
21292
  code,
21164
21293
  entries,
@@ -21171,9 +21300,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21171
21300
  listenError
21172
21301
  }) {
21173
21302
  const update = (i, patch) => onChange(entries.map((e, j) => j === i ? { ...e, ...patch } : e));
21174
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "form-group", children: [
21175
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "form-group--checkbox", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { htmlFor: "voice-pron-enabled", children: [
21176
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21303
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group", children: [
21304
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "form-group--checkbox", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { htmlFor: "voice-pron-enabled", children: [
21305
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21177
21306
  "input",
21178
21307
  {
21179
21308
  id: "voice-pron-enabled",
@@ -21184,14 +21313,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21184
21313
  ),
21185
21314
  "Pronunciation dictionary"
21186
21315
  ] }) }),
21187
- code === null ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "Set a language above to edit its dictionary." }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
21188
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
21316
+ code === null ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { children: "Set a language above to edit its dictionary." }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
21317
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("small", { children: [
21189
21318
  "Words below are respelled before synthesis (whole word, case-insensitive, longest first) for language ",
21190
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("code", { children: code }),
21319
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("code", { children: code }),
21191
21320
  ". Listen uses the unsaved form."
21192
21321
  ] }),
21193
- entries.map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "voice-backend-status", children: [
21194
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21322
+ entries.map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "voice-backend-status", children: [
21323
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21195
21324
  "input",
21196
21325
  {
21197
21326
  type: "text",
@@ -21201,7 +21330,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21201
21330
  onChange: (ev) => update(i, { term: ev.target.value })
21202
21331
  }
21203
21332
  ),
21204
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21333
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21205
21334
  "input",
21206
21335
  {
21207
21336
  type: "text",
@@ -21211,7 +21340,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21211
21340
  onChange: (ev) => update(i, { say: ev.target.value })
21212
21341
  }
21213
21342
  ),
21214
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21343
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21215
21344
  "button",
21216
21345
  {
21217
21346
  type: "button",
@@ -21220,14 +21349,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21220
21349
  children: "Listen"
21221
21350
  }
21222
21351
  ),
21223
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => onChange(entries.filter((_2, j) => j !== i)), children: "Remove" })
21352
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", onClick: () => onChange(entries.filter((_2, j) => j !== i)), children: "Remove" })
21224
21353
  ] }, i)),
21225
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "voice-backend-status", children: [
21226
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => onChange([...entries, { term: "", say: "" }]), children: "Add word" }),
21227
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: onRestoreDefaults, children: "Restore defaults" })
21354
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "voice-backend-status", children: [
21355
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", onClick: () => onChange([...entries, { term: "", say: "" }]), children: "Add word" }),
21356
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", onClick: onRestoreDefaults, children: "Restore defaults" })
21228
21357
  ] })
21229
21358
  ] }),
21230
- listenError && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { className: "form-error", children: [
21359
+ listenError && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("small", { className: "form-error", children: [
21231
21360
  "Listen failed: ",
21232
21361
  listenError
21233
21362
  ] })
@@ -21293,7 +21422,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21293
21422
  return playBuffered(res, signal);
21294
21423
  }
21295
21424
  async function playPcm(res, signal, fmt, buffer) {
21296
- const ctx = new AudioContext();
21425
+ const ctx = new AudioContext({ sampleRate: fmt.rate });
21297
21426
  const reader = res.body.getReader();
21298
21427
  const sources = [];
21299
21428
  const onAbort = () => {
@@ -21314,6 +21443,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21314
21443
  let rest = new Float32Array(0);
21315
21444
  let cursor = 0;
21316
21445
  let last = null;
21446
+ let chunks = 0;
21447
+ let dry = 0;
21317
21448
  for (; ; ) {
21318
21449
  const { done, value } = await reader.read();
21319
21450
  if (signal.aborted) return;
@@ -21338,13 +21469,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21338
21469
  const src = ctx.createBufferSource();
21339
21470
  src.buffer = buf;
21340
21471
  src.connect(ctx.destination);
21341
- const at2 = nextStart(ctx.currentTime, cursor, buffer);
21472
+ const now = ctx.currentTime;
21473
+ const at2 = nextStart(now, cursor, buffer);
21474
+ if (chunks > 0 && at2 !== cursor) {
21475
+ dry++;
21476
+ console.warn(
21477
+ `[voice] playback ran dry before chunk ${chunks}: ${Math.round((now - cursor) * 1e3)} ms late, re-buffering ${Math.round(buffer * 1e3)} ms`
21478
+ );
21479
+ }
21480
+ chunks++;
21342
21481
  src.start(at2);
21343
21482
  cursor = at2 + buf.duration;
21344
21483
  sources.push(src);
21345
21484
  last = src;
21346
21485
  }
21347
21486
  if (!last) return;
21487
+ if (dry > 0) console.warn(`[voice] ${dry} of ${chunks} chunks arrived after the audio ran dry`);
21348
21488
  const latency = (ctx.outputLatency || 0) + (ctx.baseLatency || 0);
21349
21489
  const remainingMs = Math.max(0, (cursor - ctx.currentTime + latency) * 1e3);
21350
21490
  await new Promise((resolve) => {
@@ -21456,6 +21596,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21456
21596
  const id = pocketLanguageFor(lang, status);
21457
21597
  const entry = status.languages.find((l) => l.id === id);
21458
21598
  return {
21599
+ sttEngine: "builtin",
21600
+ sttBuiltinModel: "base",
21459
21601
  ttsEngine: "builtin",
21460
21602
  ttsLanguage: id,
21461
21603
  ttsVoice: entry?.nativeVoice ?? status.voices[0] ?? "",
@@ -21463,11 +21605,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21463
21605
  };
21464
21606
  }
21465
21607
  function edgePreset() {
21466
- return { ...EDGE_TTS_DEFAULTS, ttsEngine: "endpoint", pronunciationEnabled: false };
21608
+ return { ...EDGE_TTS_DEFAULTS, sttEngine: "endpoint", ttsEngine: "endpoint", pronunciationEnabled: false };
21467
21609
  }
21468
21610
  function localDefaultsPreset(lang, status) {
21469
- const stt = { enabled: true, endpoint: LOCAL_DEFAULTS.endpoint, sttModel: LOCAL_DEFAULTS.sttModel };
21470
- if (status && !status.runtime.loadError) return { ...stt, ...builtinPreset(lang, status) };
21611
+ const stt = { enabled: true, sttEngine: "endpoint", endpoint: LOCAL_DEFAULTS.endpoint, sttModel: LOCAL_DEFAULTS.sttModel };
21612
+ if (status && !status.runtime.loadError) return { ...stt, ...builtinPreset(lang, status), sttEngine: "endpoint" };
21471
21613
  return {
21472
21614
  ...stt,
21473
21615
  ttsEngine: "endpoint",
@@ -21477,7 +21619,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21477
21619
  }
21478
21620
 
21479
21621
  // src/VoiceTab.tsx
21480
- var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
21622
+ var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
21481
21623
  function parsedBufferMs(v2) {
21482
21624
  const n = Number.parseInt(v2, 10);
21483
21625
  return Number.isFinite(n) ? Math.min(Math.max(n, 0), MAX_PLAYBACK_BUFFER_MS) : void 0;
@@ -21499,37 +21641,39 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21499
21641
  }
21500
21642
  function VoiceTab({ config, onSave, postMessage, sttCatalogResult, ttsCatalogResult }) {
21501
21643
  const current = config.voice ?? EMPTY;
21502
- const [enabled, setEnabled] = (0, import_react17.useState)(current.enabled);
21503
- const [endpoint, setEndpoint] = (0, import_react17.useState)(current.endpoint);
21504
- const [apiKey, setApiKey] = (0, import_react17.useState)(current.apiKey ?? "");
21505
- const [sttModel, setSttModel] = (0, import_react17.useState)(current.sttModel);
21506
- const [ttsEndpoint, setTtsEndpoint] = (0, import_react17.useState)(current.ttsEndpoint ?? "");
21507
- const [ttsApiKey, setTtsApiKey] = (0, import_react17.useState)(current.ttsApiKey ?? "");
21508
- const [ttsModel, setTtsModel] = (0, import_react17.useState)(current.ttsModel ?? "");
21509
- const [ttsVoice, setTtsVoice] = (0, import_react17.useState)(current.ttsVoice ?? "");
21510
- const [ttsSpeed, setTtsSpeed] = (0, import_react17.useState)(
21644
+ const [enabled, setEnabled] = (0, import_react18.useState)(current.enabled);
21645
+ const [endpoint, setEndpoint] = (0, import_react18.useState)(current.endpoint);
21646
+ const [apiKey, setApiKey] = (0, import_react18.useState)(current.apiKey ?? "");
21647
+ const [sttModel, setSttModel] = (0, import_react18.useState)(current.sttModel);
21648
+ const [ttsEndpoint, setTtsEndpoint] = (0, import_react18.useState)(current.ttsEndpoint ?? "");
21649
+ const [ttsApiKey, setTtsApiKey] = (0, import_react18.useState)(current.ttsApiKey ?? "");
21650
+ const [ttsModel, setTtsModel] = (0, import_react18.useState)(current.ttsModel ?? "");
21651
+ const [ttsVoice, setTtsVoice] = (0, import_react18.useState)(current.ttsVoice ?? "");
21652
+ const [ttsSpeed, setTtsSpeed] = (0, import_react18.useState)(
21511
21653
  current.ttsSpeed === void 0 ? "" : String(current.ttsSpeed)
21512
21654
  );
21513
- const [lang, setLang] = (0, import_react17.useState)(current.lang ?? "");
21514
- const [bufferMs, setBufferMs] = (0, import_react17.useState)(
21655
+ const [lang, setLang] = (0, import_react18.useState)(current.lang ?? "");
21656
+ const [bufferMs, setBufferMs] = (0, import_react18.useState)(
21515
21657
  current.playbackBufferMs === void 0 ? "" : String(current.playbackBufferMs)
21516
21658
  );
21517
- const [ttsEngine, setTtsEngine] = (0, import_react17.useState)(current.ttsEngine ?? "endpoint");
21518
- const [ttsLanguage, setTtsLanguage] = (0, import_react17.useState)(current.ttsLanguage ?? "");
21519
- const [pronEnabled, setPronEnabled] = (0, import_react17.useState)(current.pronunciationEnabled ?? false);
21520
- const [pronunciation, setPronunciation] = (0, import_react17.useState)(
21659
+ const [ttsEngine, setTtsEngine] = (0, import_react18.useState)(current.ttsEngine ?? "endpoint");
21660
+ const [sttEngine, setSttEngine] = (0, import_react18.useState)(current.sttEngine ?? "endpoint");
21661
+ const [sttBuiltinModel, setSttBuiltinModel] = (0, import_react18.useState)(current.sttBuiltinModel ?? "base");
21662
+ const [ttsLanguage, setTtsLanguage] = (0, import_react18.useState)(current.ttsLanguage ?? "");
21663
+ const [pronEnabled, setPronEnabled] = (0, import_react18.useState)(current.pronunciationEnabled ?? false);
21664
+ const [pronunciation, setPronunciation] = (0, import_react18.useState)(
21521
21665
  current.pronunciation ?? {}
21522
21666
  );
21523
- const [builtinStatus, setBuiltinStatus] = (0, import_react17.useState)(null);
21524
- const [listening, setListening] = (0, import_react17.useState)(false);
21525
- const [listenError, setListenError] = (0, import_react17.useState)(null);
21526
- const listenAbort = (0, import_react17.useRef)(null);
21527
- const [fetching, setFetching] = (0, import_react17.useState)(false);
21528
- const [fetchingTts, setFetchingTts] = (0, import_react17.useState)(false);
21529
- const [saveState, setSaveState] = (0, import_react17.useState)("idle");
21530
- const pendingSave = (0, import_react17.useRef)(null);
21531
- const [autoStartBackend, setAutoStartBackend] = (0, import_react17.useState)(current.autoStartBackend ?? false);
21532
- const [backendStatuses, setBackendStatuses] = (0, import_react17.useState)(null);
21667
+ const [builtinStatus, setBuiltinStatus] = (0, import_react18.useState)(null);
21668
+ const [listening, setListening] = (0, import_react18.useState)(false);
21669
+ const [listenError, setListenError] = (0, import_react18.useState)(null);
21670
+ const listenAbort = (0, import_react18.useRef)(null);
21671
+ const [fetching, setFetching] = (0, import_react18.useState)(false);
21672
+ const [fetchingTts, setFetchingTts] = (0, import_react18.useState)(false);
21673
+ const [saveState, setSaveState] = (0, import_react18.useState)("idle");
21674
+ const pendingSave = (0, import_react18.useRef)(null);
21675
+ const [autoStartBackend, setAutoStartBackend] = (0, import_react18.useState)(current.autoStartBackend ?? false);
21676
+ const [backendStatuses, setBackendStatuses] = (0, import_react18.useState)(null);
21533
21677
  const fetchBackendStatuses = async () => {
21534
21678
  try {
21535
21679
  const res = await fetch("/api/voice/backend");
@@ -21539,12 +21683,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21539
21683
  } catch {
21540
21684
  }
21541
21685
  };
21542
- (0, import_react17.useEffect)(() => {
21686
+ (0, import_react18.useEffect)(() => {
21543
21687
  fetch("/api/voice/builtin").then((res) => res.ok ? res.json() : null).then((st2) => st2 && setBuiltinStatus(st2)).catch(() => {
21544
21688
  });
21545
21689
  return () => listenAbort.current?.abort();
21546
21690
  }, []);
21547
- (0, import_react17.useEffect)(() => {
21691
+ (0, import_react18.useEffect)(() => {
21548
21692
  fetchBackendStatuses();
21549
21693
  const interval = setInterval(fetchBackendStatuses, BACKEND_POLL_MS);
21550
21694
  return () => clearInterval(interval);
@@ -21554,23 +21698,23 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21554
21698
  (prev) => prev ? { ...prev, [target]: status } : { stt: status, tts: null }
21555
21699
  );
21556
21700
  };
21557
- (0, import_react17.useEffect)(() => {
21701
+ (0, import_react18.useEffect)(() => {
21558
21702
  if (sttCatalogResult) setFetching(false);
21559
21703
  }, [sttCatalogResult]);
21560
- (0, import_react17.useEffect)(() => {
21704
+ (0, import_react18.useEffect)(() => {
21561
21705
  if (ttsCatalogResult) setFetchingTts(false);
21562
21706
  }, [ttsCatalogResult]);
21563
- (0, import_react17.useEffect)(() => {
21707
+ (0, import_react18.useEffect)(() => {
21564
21708
  if (saveState !== "saving" || pendingSave.current === null) return;
21565
21709
  if (voiceSignature(config.voice) !== pendingSave.current) return;
21566
21710
  setSaveState("saved");
21567
21711
  }, [config.voice, saveState]);
21568
- (0, import_react17.useEffect)(() => {
21712
+ (0, import_react18.useEffect)(() => {
21569
21713
  if (saveState !== "saved") return;
21570
21714
  const clear = setTimeout(() => setSaveState("idle"), 2500);
21571
21715
  return () => clearTimeout(clear);
21572
21716
  }, [saveState]);
21573
- (0, import_react17.useEffect)(() => {
21717
+ (0, import_react18.useEffect)(() => {
21574
21718
  if (saveState !== "saving") return;
21575
21719
  const giveUp = setTimeout(() => setSaveState("idle"), 6e3);
21576
21720
  return () => clearTimeout(giveUp);
@@ -21603,6 +21747,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21603
21747
  if (p.enabled !== void 0) setEnabled(p.enabled);
21604
21748
  if (p.endpoint !== void 0) setEndpoint(p.endpoint);
21605
21749
  if (p.sttModel !== void 0) setSttModel(p.sttModel);
21750
+ if (p.sttEngine !== void 0) setSttEngine(p.sttEngine);
21751
+ if (p.sttBuiltinModel !== void 0) setSttBuiltinModel(p.sttBuiltinModel);
21606
21752
  if (p.ttsEngine !== void 0) setTtsEngine(p.ttsEngine);
21607
21753
  if (p.ttsLanguage !== void 0) setTtsLanguage(p.ttsLanguage);
21608
21754
  if (p.ttsEndpoint !== void 0) setTtsEndpoint(p.ttsEndpoint);
@@ -21611,7 +21757,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21611
21757
  if (p.pronunciationEnabled !== void 0) setPronEnabled(p.pronunciationEnabled);
21612
21758
  };
21613
21759
  const builtin = ttsEngine === "builtin";
21614
- const synthCode = (0, import_react17.useMemo)(() => {
21760
+ const sttBuiltin = sttEngine === "builtin" && !!builtinStatus;
21761
+ const showEndpoint = !sttBuiltin || !builtin;
21762
+ const synthCode = (0, import_react18.useMemo)(() => {
21615
21763
  if (builtin) return builtinStatus?.languages.find((l) => l.id === ttsLanguage)?.code ?? null;
21616
21764
  return lang.trim().split(/[-_]/)[0].toLowerCase() || null;
21617
21765
  }, [builtin, builtinStatus, ttsLanguage, lang]);
@@ -21670,6 +21818,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21670
21818
  const buf = parsedBufferMs(bufferMs);
21671
21819
  if (buf !== void 0) voice.playbackBufferMs = buf;
21672
21820
  if (autoStartBackend) voice.autoStartBackend = true;
21821
+ if (sttEngine === "builtin") {
21822
+ voice.sttEngine = "builtin";
21823
+ voice.sttBuiltinModel = sttBuiltinModel;
21824
+ }
21673
21825
  if (builtin) {
21674
21826
  voice.ttsEngine = "builtin";
21675
21827
  if (ttsLanguage) voice.ttsLanguage = ttsLanguage;
@@ -21686,18 +21838,18 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21686
21838
  };
21687
21839
  const showSttBackend = backendStatuses !== null && backendStatuses.stt.docker !== "absent" && backendStatuses.stt.port !== null;
21688
21840
  const showTtsBackend = backendStatuses !== null && backendStatuses.tts !== null && backendStatuses.tts.docker !== "absent" && backendStatuses.tts.port !== null;
21689
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "glass-form", children: [
21690
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h4", { children: "Voice" }),
21691
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "glass-form__body", children: [
21692
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group", children: [
21693
- builtinStatus && !builtinStatus.runtime.loadError && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", onClick: () => applyPreset(builtinPreset(lang, builtinStatus)), children: "Use built-in voice (recommended)" }),
21841
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "glass-form", children: [
21842
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h4", { children: "Voice" }),
21843
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "glass-form__body", children: [
21844
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
21845
+ builtinStatus && !builtinStatus.runtime.loadError && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: () => applyPreset(builtinPreset(lang, builtinStatus)), children: "Use built-in voice (recommended)" }),
21694
21846
  " ",
21695
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", onClick: () => applyPreset(localDefaultsPreset(lang, builtinStatus)), children: "Use local defaults" }),
21847
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: () => applyPreset(localDefaultsPreset(lang, builtinStatus)), children: "Use local defaults" }),
21696
21848
  " ",
21697
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", onClick: () => applyPreset(edgePreset()), children: "Use Microsoft Edge voices" }),
21698
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { children: "Presets only fill the form. The built-in voice runs inside caretaker; local defaults add a Speaches container on port 8969 for transcription (caretaker can run it for you if Docker is installed); Edge voices use an openai-edge-tts container on port 5050. Nothing is saved yet \u2014 adjust anything, then press Save." })
21849
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: () => applyPreset(edgePreset()), children: "Use Microsoft Edge voices" }),
21850
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "Presets only fill the form. The built-in voice runs inside caretaker; local defaults add a Speaches container on port 8969 for transcription (caretaker can run it for you if Docker is installed); Edge voices use an openai-edge-tts container on port 5050. Nothing is saved yet \u2014 adjust anything, then press Save." })
21699
21851
  ] }),
21700
- showSttBackend && backendStatuses && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21852
+ showSttBackend && backendStatuses && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21701
21853
  VoiceBackendBlock,
21702
21854
  {
21703
21855
  target: "stt",
@@ -21707,7 +21859,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21707
21859
  hint: "The first start downloads about 2 GB. The container publishes on the port in your endpoint \u2014 if that port is taken, change it there and save; caretaker never picks a port for you. Delete removes the container but keeps the downloaded models \u2014 try it when the backend misbehaves after switching networks."
21708
21860
  }
21709
21861
  ),
21710
- showTtsBackend && backendStatuses?.tts && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21862
+ showTtsBackend && backendStatuses?.tts && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21711
21863
  VoiceBackendBlock,
21712
21864
  {
21713
21865
  target: "tts",
@@ -21717,9 +21869,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21717
21869
  hint: "A small image. The container publishes on the port in your synthesis endpoint. Delete removes the container; the image stays cached."
21718
21870
  }
21719
21871
  ),
21720
- (showSttBackend || showTtsBackend) && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group form-group--checkbox", children: [
21721
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { htmlFor: "voice-backend-autostart", children: [
21722
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21872
+ (showSttBackend || showTtsBackend) && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group form-group--checkbox", children: [
21873
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("label", { htmlFor: "voice-backend-autostart", children: [
21874
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21723
21875
  "input",
21724
21876
  {
21725
21877
  id: "voice-backend-autostart",
@@ -21730,10 +21882,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21730
21882
  ),
21731
21883
  "Start automatically with caretaker"
21732
21884
  ] }),
21733
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { children: "Applies to both containers: a Speaches pull does not block the edge-tts start \u2014 they are independent." })
21885
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "Applies to both containers: a Speaches pull does not block the edge-tts start \u2014 they are independent." })
21734
21886
  ] }),
21735
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "form-group form-group--checkbox", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { htmlFor: "voice-enabled", children: [
21736
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21887
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "form-group form-group--checkbox", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("label", { htmlFor: "voice-enabled", children: [
21888
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21737
21889
  "input",
21738
21890
  {
21739
21891
  id: "voice-enabled",
@@ -21744,89 +21896,117 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21744
21896
  ),
21745
21897
  "Enable voice mode"
21746
21898
  ] }) }),
21747
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group", children: [
21748
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: "voice-endpoint", children: "Speech Endpoint" }),
21749
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21750
- "input",
21751
- {
21752
- id: "voice-endpoint",
21753
- type: "text",
21754
- placeholder: "http://127.0.0.1:8969/v1",
21755
- value: endpoint,
21756
- onChange: (e) => setEndpoint(e.target.value)
21757
- }
21758
- ),
21759
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("small", { children: [
21760
- "OpenAI-compatible speech endpoint \u2014 e.g. a local Speaches container. Transcription posts to ",
21761
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("code", { children: "/audio/transcriptions" }),
21762
- ". When no separate synthesis endpoint is set below, synthesis also posts to",
21763
- " ",
21764
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("code", { children: "/audio/speech" }),
21765
- " here. Voice is unavailable in the VSCode sidebar."
21766
- ] })
21767
- ] }),
21768
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group", children: [
21769
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: "voice-key", children: "API Key (optional)" }),
21770
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21771
- "input",
21772
- {
21773
- id: "voice-key",
21774
- type: "password",
21775
- placeholder: "Leave empty for a local server with no auth",
21776
- value: apiKey,
21777
- onChange: (e) => setApiKey(e.target.value)
21778
- }
21779
- ),
21780
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { children: "Stored encrypted. Never sent to the browser \u2014 requests are proxied." })
21781
- ] }),
21782
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group", children: [
21783
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", onClick: fetchSttCatalog, disabled: fetching || !endpoint.trim(), children: fetching ? "Fetching\u2026" : "Fetch models" }),
21784
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { children: "Reads the endpoint's installed models so the transcription field below becomes a list. Endpoints that do not report a task per model still work \u2014 the field stays free text." }),
21785
- sttFetchError && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("small", { className: "form-error", children: [
21786
- "Fetch failed: ",
21787
- sttFetchError
21788
- ] })
21789
- ] }),
21790
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group", children: [
21791
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: "voice-stt", children: "Transcription Model" }),
21792
- sttCatalog && sttCatalog.stt.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
21899
+ builtinStatus && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
21900
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-stt-engine", children: "Transcription engine" }),
21901
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
21793
21902
  "select",
21794
21903
  {
21795
- id: "voice-stt",
21796
- value: sttModel,
21797
- onChange: (e) => setSttModel(e.target.value),
21904
+ id: "voice-stt-engine",
21905
+ value: sttEngine,
21906
+ onChange: (e) => setSttEngine(e.target.value),
21798
21907
  children: [
21799
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "", children: "-- Select a model --" }),
21800
- withCurrent(sttCatalog.stt, sttModel).map((id) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: id, children: id }, id))
21908
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: "endpoint", children: "Speech endpoint (Speaches, OpenAI\u2026)" }),
21909
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: "builtin", children: "Built-in transcription (Whisper)" })
21801
21910
  ]
21802
21911
  }
21803
- ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21804
- "input",
21805
- {
21806
- id: "voice-stt",
21807
- type: "text",
21808
- placeholder: "e.g. Systran/faster-whisper-small",
21809
- value: sttModel,
21810
- onChange: (e) => setSttModel(e.target.value)
21811
- }
21812
21912
  )
21813
21913
  ] }),
21814
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group", children: [
21815
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: "voice-engine", children: "Synthesis engine" }),
21816
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
21914
+ sttBuiltin && builtinStatus && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21915
+ BuiltinSttBlock,
21916
+ {
21917
+ status: builtinStatus,
21918
+ onStatusChange: setBuiltinStatus,
21919
+ model: sttBuiltinModel,
21920
+ onModelChange: setSttBuiltinModel
21921
+ }
21922
+ ),
21923
+ showEndpoint && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
21924
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
21925
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-endpoint", children: "Speech Endpoint" }),
21926
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21927
+ "input",
21928
+ {
21929
+ id: "voice-endpoint",
21930
+ type: "text",
21931
+ placeholder: "http://127.0.0.1:8969/v1",
21932
+ value: endpoint,
21933
+ onChange: (e) => setEndpoint(e.target.value)
21934
+ }
21935
+ ),
21936
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { children: [
21937
+ "OpenAI-compatible speech endpoint \u2014 e.g. a local Speaches container. Transcription posts to ",
21938
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { children: "/audio/transcriptions" }),
21939
+ ". When no separate synthesis endpoint is set below, synthesis also posts to",
21940
+ " ",
21941
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { children: "/audio/speech" }),
21942
+ " here. Voice is unavailable in the VSCode sidebar."
21943
+ ] })
21944
+ ] }),
21945
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
21946
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-key", children: "API Key (optional)" }),
21947
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21948
+ "input",
21949
+ {
21950
+ id: "voice-key",
21951
+ type: "password",
21952
+ placeholder: "Leave empty for a local server with no auth",
21953
+ value: apiKey,
21954
+ onChange: (e) => setApiKey(e.target.value)
21955
+ }
21956
+ ),
21957
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "Stored encrypted. Never sent to the browser \u2014 requests are proxied." })
21958
+ ] })
21959
+ ] }),
21960
+ !sttBuiltin && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
21961
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
21962
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: fetchSttCatalog, disabled: fetching || !endpoint.trim(), children: fetching ? "Fetching\u2026" : "Fetch models" }),
21963
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "Reads the endpoint's installed models so the transcription field below becomes a list. Endpoints that do not report a task per model still work \u2014 the field stays free text." }),
21964
+ sttFetchError && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { className: "form-error", children: [
21965
+ "Fetch failed: ",
21966
+ sttFetchError
21967
+ ] })
21968
+ ] }),
21969
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
21970
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-stt", children: "Transcription Model" }),
21971
+ sttCatalog && sttCatalog.stt.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
21972
+ "select",
21973
+ {
21974
+ id: "voice-stt",
21975
+ value: sttModel,
21976
+ onChange: (e) => setSttModel(e.target.value),
21977
+ children: [
21978
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: "", children: "-- Select a model --" }),
21979
+ withCurrent(sttCatalog.stt, sttModel).map((id) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: id, children: id }, id))
21980
+ ]
21981
+ }
21982
+ ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21983
+ "input",
21984
+ {
21985
+ id: "voice-stt",
21986
+ type: "text",
21987
+ placeholder: "e.g. Systran/faster-whisper-small",
21988
+ value: sttModel,
21989
+ onChange: (e) => setSttModel(e.target.value)
21990
+ }
21991
+ )
21992
+ ] })
21993
+ ] }),
21994
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
21995
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-engine", children: "Synthesis engine" }),
21996
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
21817
21997
  "select",
21818
21998
  {
21819
21999
  id: "voice-engine",
21820
22000
  value: ttsEngine,
21821
22001
  onChange: (e) => setTtsEngine(e.target.value),
21822
22002
  children: [
21823
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "endpoint", children: "Speech endpoint (Speaches, edge-tts, OpenAI\u2026)" }),
21824
- builtinStatus && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "builtin", children: "Built-in voice" })
22003
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: "endpoint", children: "Speech endpoint (Speaches, edge-tts, OpenAI\u2026)" }),
22004
+ builtinStatus && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: "builtin", children: "Built-in voice" })
21825
22005
  ]
21826
22006
  }
21827
22007
  )
21828
22008
  ] }),
21829
- builtin && builtinStatus && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
22009
+ builtin && builtinStatus && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21830
22010
  BuiltinVoiceBlock,
21831
22011
  {
21832
22012
  status: builtinStatus,
@@ -21837,10 +22017,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21837
22017
  onVoiceChange: setTtsVoice
21838
22018
  }
21839
22019
  ),
21840
- !builtin && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
21841
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group", children: [
21842
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: "voice-tts-endpoint", children: "Synthesis Endpoint (optional)" }),
21843
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
22020
+ !builtin && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
22021
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22022
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-tts-endpoint", children: "Synthesis Endpoint (optional)" }),
22023
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21844
22024
  "input",
21845
22025
  {
21846
22026
  id: "voice-tts-endpoint",
@@ -21850,18 +22030,18 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21850
22030
  onChange: (e) => setTtsEndpoint(e.target.value)
21851
22031
  }
21852
22032
  ),
21853
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("small", { children: [
22033
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { children: [
21854
22034
  "Leave empty when one server does both. A local openai-edge-tts container gives you Microsoft Neural voices such as",
21855
22035
  " ",
21856
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("code", { children: "it-IT-ElsaNeural" }),
22036
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { children: "it-IT-ElsaNeural" }),
21857
22037
  " or ",
21858
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("code", { children: "it-IT-DiegoNeural" }),
22038
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { children: "it-IT-DiegoNeural" }),
21859
22039
  ", but cannot transcribe \u2014 transcription always uses the endpoint above. Nothing is saved yet \u2014 press Save after adjusting."
21860
22040
  ] })
21861
22041
  ] }),
21862
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group", children: [
21863
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: "voice-tts-key", children: "Synthesis API Key (optional)" }),
21864
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
22042
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22043
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-tts-key", children: "Synthesis API Key (optional)" }),
22044
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21865
22045
  "input",
21866
22046
  {
21867
22047
  id: "voice-tts-key",
@@ -21871,10 +22051,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21871
22051
  onChange: (e) => setTtsApiKey(e.target.value)
21872
22052
  }
21873
22053
  ),
21874
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { children: "Stored encrypted. Only sent to the synthesis endpoint \u2014 the transcription key is never sent there, and vice versa." })
22054
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "Stored encrypted. Only sent to the synthesis endpoint \u2014 the transcription key is never sent there, and vice versa." })
21875
22055
  ] }),
21876
- ttsEndpoint.trim() && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group", children: [
21877
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
22056
+ ttsEndpoint.trim() && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22057
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21878
22058
  "button",
21879
22059
  {
21880
22060
  type: "button",
@@ -21883,19 +22063,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21883
22063
  children: fetchingTts ? "Fetching\u2026" : "Fetch synthesis models"
21884
22064
  }
21885
22065
  ),
21886
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("small", { children: [
22066
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { children: [
21887
22067
  "Reads the synthesis endpoint's models and voices. For edge-tts, the voice list comes from ",
21888
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("code", { children: "/voices/all" }),
22068
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { children: "/voices/all" }),
21889
22069
  "."
21890
22070
  ] }),
21891
- ttsFetchError && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("small", { className: "form-error", children: [
22071
+ ttsFetchError && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { className: "form-error", children: [
21892
22072
  "Fetch failed: ",
21893
22073
  ttsFetchError
21894
22074
  ] })
21895
22075
  ] }),
21896
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group", children: [
21897
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: "voice-tts", children: "Synthesis Model (optional)" }),
21898
- ttsCatalog && ttsCatalog.tts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
22076
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22077
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-tts", children: "Synthesis Model (optional)" }),
22078
+ ttsCatalog && ttsCatalog.tts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
21899
22079
  "select",
21900
22080
  {
21901
22081
  id: "voice-tts",
@@ -21908,14 +22088,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21908
22088
  }
21909
22089
  },
21910
22090
  children: [
21911
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "", children: "-- None (dictation only) --" }),
22091
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: "", children: "-- None (dictation only) --" }),
21912
22092
  withCurrent(
21913
22093
  ttsCatalog.tts.map((m2) => m2.id),
21914
22094
  ttsModel
21915
- ).map((id) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: id, children: id }, id))
22095
+ ).map((id) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: id, children: id }, id))
21916
22096
  ]
21917
22097
  }
21918
- ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
22098
+ ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21919
22099
  "input",
21920
22100
  {
21921
22101
  id: "voice-tts",
@@ -21925,22 +22105,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21925
22105
  onChange: (e) => setTtsModel(e.target.value)
21926
22106
  }
21927
22107
  ),
21928
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { children: "Required for conversation mode. Without it, only dictation is offered." })
22108
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "Required for conversation mode. Without it, only dictation is offered." })
21929
22109
  ] }),
21930
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group", children: [
21931
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: "voice-voice", children: "Voice (optional)" }),
21932
- voicesForModel.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
22110
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22111
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-voice", children: "Voice (optional)" }),
22112
+ voicesForModel.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
21933
22113
  "select",
21934
22114
  {
21935
22115
  id: "voice-voice",
21936
22116
  value: ttsVoice,
21937
22117
  onChange: (e) => setTtsVoice(e.target.value),
21938
22118
  children: [
21939
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "", children: "-- Select a voice --" }),
21940
- voicesForModel.map((v2) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: v2.id, children: voiceLabel(v2) }, v2.id))
22119
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: "", children: "-- Select a voice --" }),
22120
+ voicesForModel.map((v2) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: v2.id, children: voiceLabel(v2) }, v2.id))
21941
22121
  ]
21942
22122
  }
21943
- ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
22123
+ ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21944
22124
  "input",
21945
22125
  {
21946
22126
  id: "voice-voice",
@@ -21950,11 +22130,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21950
22130
  onChange: (e) => setTtsVoice(e.target.value)
21951
22131
  }
21952
22132
  ),
21953
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { children: "Pick one whose language matches yours. A model trained mostly on English keeps an English inflection even on its other-language voices." })
22133
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "Pick one whose language matches yours. A model trained mostly on English keeps an English inflection even on its other-language voices." })
21954
22134
  ] }),
21955
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group", children: [
21956
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: "voice-speed", children: "Speaking Rate (optional)" }),
21957
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
22135
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22136
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-speed", children: "Speaking Rate (optional)" }),
22137
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21958
22138
  "input",
21959
22139
  {
21960
22140
  id: "voice-speed",
@@ -21967,12 +22147,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21967
22147
  onChange: (e) => setTtsSpeed(e.target.value)
21968
22148
  }
21969
22149
  ),
21970
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { children: "Multiplier, clamped to 0.5\u20132. Useful because some voices are just slow: raise it if the reply drags. Piper responds less to this than Kokoro, since for Piper it stretches phoneme durations." })
22150
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "Multiplier, clamped to 0.5\u20132. Useful because some voices are just slow: raise it if the reply drags. Piper responds less to this than Kokoro, since for Piper it stretches phoneme durations." })
21971
22151
  ] })
21972
22152
  ] }),
21973
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group", children: [
21974
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: "voice-buffer", children: "Playback buffer, ms (optional)" }),
21975
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
22153
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22154
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-buffer", children: "Playback buffer, ms (optional)" }),
22155
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21976
22156
  "input",
21977
22157
  {
21978
22158
  id: "voice-buffer",
@@ -21985,11 +22165,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21985
22165
  onChange: (e) => setBufferMs(e.target.value)
21986
22166
  }
21987
22167
  ),
21988
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { children: "Audio collected before speech starts, and again if it runs dry. Raise it if speech stutters (a slower machine or endpoint); lower it for a quicker start. Listen uses the value in the form, so you can try it before saving." })
22168
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "Audio collected before speech starts, and again if it runs dry. Raise it if speech stutters (a slower machine or endpoint); lower it for a quicker start. Listen uses the value in the form, so you can try it before saving." })
21989
22169
  ] }),
21990
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group", children: [
21991
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: "voice-lang", children: "Language (optional)" }),
21992
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
22170
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22171
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-lang", children: "Language (optional)" }),
22172
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21993
22173
  "input",
21994
22174
  {
21995
22175
  id: "voice-lang",
@@ -22000,7 +22180,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22000
22180
  }
22001
22181
  )
22002
22182
  ] }),
22003
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
22183
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
22004
22184
  PronunciationTable,
22005
22185
  {
22006
22186
  code: synthCode,
@@ -22017,20 +22197,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22017
22197
  listenError
22018
22198
  }
22019
22199
  ),
22020
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group", children: [
22021
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", onClick: listening ? stopListening : () => void listen(), children: listening ? "Stop" : "Listen" }),
22022
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { children: "Speaks a sample sentence with the form as it is now, without saving." })
22200
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22201
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: listening ? stopListening : () => void listen(), children: listening ? "Stop" : "Listen" }),
22202
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "Speaks a sample sentence with the form as it is now, without saving." })
22023
22203
  ] })
22024
22204
  ] }),
22025
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-actions", children: [
22026
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", onClick: save, children: "Save" }),
22027
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { role: "status", "aria-live": "polite", className: "form-save-state", children: saveState === "saving" ? "Saving\u2026" : saveState === "saved" ? "Saved \u2713" : "" })
22205
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-actions", children: [
22206
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: save, children: "Save" }),
22207
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { role: "status", "aria-live": "polite", className: "form-save-state", children: saveState === "saving" ? "Saving\u2026" : saveState === "saved" ? "Saved \u2713" : "" })
22028
22208
  ] })
22029
22209
  ] });
22030
22210
  }
22031
22211
 
22032
22212
  // src/MemoryTab.tsx
22033
- var import_react18 = __toESM(require_react(), 1);
22213
+ var import_react19 = __toESM(require_react(), 1);
22034
22214
 
22035
22215
  // src/memory_tab_utils.ts
22036
22216
  function buildMemoryConfig(form) {
@@ -22049,26 +22229,26 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22049
22229
  }
22050
22230
 
22051
22231
  // src/MemoryTab.tsx
22052
- var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
22232
+ var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
22053
22233
  function MemoryTab({ config, agents, onSave }) {
22054
22234
  const current = config.memory;
22055
- const [enabled, setEnabled] = (0, import_react18.useState)(!!current);
22056
- const [agentId, setAgentId] = (0, import_react18.useState)(current?.agentId ?? "");
22057
- const [sweepMinutes, setSweepMinutes] = (0, import_react18.useState)(
22235
+ const [enabled, setEnabled] = (0, import_react19.useState)(!!current);
22236
+ const [agentId, setAgentId] = (0, import_react19.useState)(current?.agentId ?? "");
22237
+ const [sweepMinutes, setSweepMinutes] = (0, import_react19.useState)(
22058
22238
  current?.sweepMinutes === void 0 ? "" : String(current.sweepMinutes)
22059
22239
  );
22060
- const [minNewMessages, setMinNewMessages] = (0, import_react18.useState)(
22240
+ const [minNewMessages, setMinNewMessages] = (0, import_react19.useState)(
22061
22241
  current?.minNewMessages === void 0 ? "" : String(current.minNewMessages)
22062
22242
  );
22063
- const [saveState, setSaveState] = (0, import_react18.useState)("idle");
22064
- const pendingSave = (0, import_react18.useRef)(null);
22065
- (0, import_react18.useEffect)(() => {
22243
+ const [saveState, setSaveState] = (0, import_react19.useState)("idle");
22244
+ const pendingSave = (0, import_react19.useRef)(null);
22245
+ (0, import_react19.useEffect)(() => {
22066
22246
  if (saveState !== "saving" || pendingSave.current === null) return;
22067
22247
  if (memorySignature(config.memory) !== pendingSave.current)
22068
22248
  return;
22069
22249
  setSaveState("saved");
22070
22250
  }, [config.memory, saveState]);
22071
- (0, import_react18.useEffect)(() => {
22251
+ (0, import_react19.useEffect)(() => {
22072
22252
  if (saveState !== "saved") return;
22073
22253
  const t = setTimeout(() => setSaveState("idle"), 2e3);
22074
22254
  return () => clearTimeout(t);
@@ -22084,12 +22264,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22084
22264
  else delete next.memory;
22085
22265
  onSave(next);
22086
22266
  };
22087
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "glass-form", children: [
22088
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h4", { children: "Memory" }),
22089
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "glass-form__body", children: [
22090
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group form-group--checkbox", children: [
22091
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("label", { htmlFor: "memory-enabled", children: [
22092
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
22267
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "glass-form", children: [
22268
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h4", { children: "Memory" }),
22269
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "glass-form__body", children: [
22270
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "form-group form-group--checkbox", children: [
22271
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { htmlFor: "memory-enabled", children: [
22272
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
22093
22273
  "input",
22094
22274
  {
22095
22275
  id: "memory-enabled",
@@ -22100,25 +22280,25 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22100
22280
  ),
22101
22281
  "Enable memory"
22102
22282
  ] }),
22103
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "A background sweep keeps a rolling summary of every chat session. It runs only while the web server (or the desktop app) is up, like the rest of the scheduler." })
22283
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { children: "A background sweep keeps a rolling summary of every chat session. It runs only while the web server (or the desktop app) is up, like the rest of the scheduler." })
22104
22284
  ] }),
22105
- enabled && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
22106
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22107
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "memory-agent", children: "Memory agent" }),
22108
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("select", { id: "memory-agent", value: agentId, onChange: (e) => setAgentId(e.target.value), children: [
22109
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: "", children: "\u2014 select an agent \u2014" }),
22110
- agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("option", { value: a2.id, children: [
22285
+ enabled && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
22286
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "form-group", children: [
22287
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { htmlFor: "memory-agent", children: "Memory agent" }),
22288
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("select", { id: "memory-agent", value: agentId, onChange: (e) => setAgentId(e.target.value), children: [
22289
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("option", { value: "", children: "\u2014 select an agent \u2014" }),
22290
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("option", { value: a2.id, children: [
22111
22291
  a2.name,
22112
22292
  " \xB7 ",
22113
22293
  a2.model
22114
22294
  ] }, a2.id))
22115
22295
  ] }),
22116
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "The agent whose identity (system prompt, provider, model) runs the summarize calls \u2014 every provider works, Claude Code included. Calls are always fresh one-shot conversations, never the agent's own sessions. A lean dedicated agent (short system prompt, no plugins) keeps them cheap." }),
22117
- missingAgent && agentId && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { className: "form-error", children: "This agent no longer exists \u2014 pick another." })
22296
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { children: "The agent whose identity (system prompt, provider, model) runs the summarize calls \u2014 every provider works, Claude Code included. Calls are always fresh one-shot conversations, never the agent's own sessions. A lean dedicated agent (short system prompt, no plugins) keeps them cheap." }),
22297
+ missingAgent && agentId && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { className: "form-error", children: "This agent no longer exists \u2014 pick another." })
22118
22298
  ] }),
22119
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22120
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "memory-sweep-minutes", children: "Sweep interval (minutes)" }),
22121
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
22299
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "form-group", children: [
22300
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { htmlFor: "memory-sweep-minutes", children: "Sweep interval (minutes)" }),
22301
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
22122
22302
  "input",
22123
22303
  {
22124
22304
  id: "memory-sweep-minutes",
@@ -22130,9 +22310,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22130
22310
  }
22131
22311
  )
22132
22312
  ] }),
22133
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22134
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "memory-min-new", children: "Min new messages per session" }),
22135
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
22313
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "form-group", children: [
22314
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { htmlFor: "memory-min-new", children: "Min new messages per session" }),
22315
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
22136
22316
  "input",
22137
22317
  {
22138
22318
  id: "memory-min-new",
@@ -22143,19 +22323,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22143
22323
  onChange: (e) => setMinNewMessages(e.target.value)
22144
22324
  }
22145
22325
  ),
22146
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "A session is re-summarized only once it accumulated at least this many new messages since the last pass." })
22326
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { children: "A session is re-summarized only once it accumulated at least this many new messages since the last pass." })
22147
22327
  ] })
22148
22328
  ] })
22149
22329
  ] }),
22150
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-actions", children: [
22151
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: save, disabled: enabled && !agentId, children: "Save" }),
22152
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { role: "status", "aria-live": "polite", className: "form-save-state", children: saveState === "saving" ? "Saving\u2026" : saveState === "saved" ? "Saved \u2713" : "" })
22330
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "form-actions", children: [
22331
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", onClick: save, disabled: enabled && !agentId, children: "Save" }),
22332
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { role: "status", "aria-live": "polite", className: "form-save-state", children: saveState === "saving" ? "Saving\u2026" : saveState === "saved" ? "Saved \u2713" : "" })
22153
22333
  ] })
22154
22334
  ] });
22155
22335
  }
22156
22336
 
22157
22337
  // src/DesktopTab.tsx
22158
- var import_react19 = __toESM(require_react(), 1);
22338
+ var import_react20 = __toESM(require_react(), 1);
22159
22339
 
22160
22340
  // src/desktop_tab_utils.ts
22161
22341
  var DEFAULT_ASSISTANT_SHORTCUT = "CommandOrControl+Shift+Space";
@@ -22170,21 +22350,21 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22170
22350
  }
22171
22351
 
22172
22352
  // src/DesktopTab.tsx
22173
- var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
22353
+ var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
22174
22354
  function DesktopTab({ config, agents, onSave }) {
22175
22355
  const current = config.desktopAssistant;
22176
- const [enabled, setEnabled] = (0, import_react19.useState)(!!current);
22177
- const [agentId, setAgentId] = (0, import_react19.useState)(current?.agentId ?? "");
22178
- const [shortcut, setShortcut] = (0, import_react19.useState)(current?.shortcut ?? "");
22179
- const [saveState, setSaveState] = (0, import_react19.useState)("idle");
22180
- const pendingSave = (0, import_react19.useRef)(null);
22181
- (0, import_react19.useEffect)(() => {
22356
+ const [enabled, setEnabled] = (0, import_react20.useState)(!!current);
22357
+ const [agentId, setAgentId] = (0, import_react20.useState)(current?.agentId ?? "");
22358
+ const [shortcut, setShortcut] = (0, import_react20.useState)(current?.shortcut ?? "");
22359
+ const [saveState, setSaveState] = (0, import_react20.useState)("idle");
22360
+ const pendingSave = (0, import_react20.useRef)(null);
22361
+ (0, import_react20.useEffect)(() => {
22182
22362
  if (saveState !== "saving" || pendingSave.current === null) return;
22183
22363
  if (desktopAssistantSignature(config.desktopAssistant) !== pendingSave.current)
22184
22364
  return;
22185
22365
  setSaveState("saved");
22186
22366
  }, [config.desktopAssistant, saveState]);
22187
- (0, import_react19.useEffect)(() => {
22367
+ (0, import_react20.useEffect)(() => {
22188
22368
  if (saveState !== "saved") return;
22189
22369
  const t = setTimeout(() => setSaveState("idle"), 2e3);
22190
22370
  return () => clearTimeout(t);
@@ -22199,12 +22379,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22199
22379
  else delete next.desktopAssistant;
22200
22380
  onSave(next);
22201
22381
  };
22202
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "glass-form", children: [
22203
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h4", { children: "Desktop assistant" }),
22204
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "glass-form__body", children: [
22205
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "form-group form-group--checkbox", children: [
22206
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { htmlFor: "desktop-assistant-enabled", children: [
22207
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
22382
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "glass-form", children: [
22383
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h4", { children: "Desktop assistant" }),
22384
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "glass-form__body", children: [
22385
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "form-group form-group--checkbox", children: [
22386
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { htmlFor: "desktop-assistant-enabled", children: [
22387
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22208
22388
  "input",
22209
22389
  {
22210
22390
  id: "desktop-assistant-enabled",
@@ -22215,20 +22395,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22215
22395
  ),
22216
22396
  "Enable desktop assistant"
22217
22397
  ] }),
22218
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { children: "Desktop app only. Press the shortcut from any app to open caretaker on a new conversation with this agent \u2014 in voice conversation mode when voice is configured." })
22398
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "Desktop app only. Press the shortcut from any app to open caretaker on a new conversation with this agent \u2014 in voice conversation mode when voice is configured." })
22219
22399
  ] }),
22220
- enabled && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
22221
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "form-group", children: [
22222
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { htmlFor: "desktop-assistant-agent", children: "Assistant agent" }),
22223
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
22400
+ enabled && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
22401
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "form-group", children: [
22402
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { htmlFor: "desktop-assistant-agent", children: "Assistant agent" }),
22403
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
22224
22404
  "select",
22225
22405
  {
22226
22406
  id: "desktop-assistant-agent",
22227
22407
  value: agentId,
22228
22408
  onChange: (e) => setAgentId(e.target.value),
22229
22409
  children: [
22230
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("option", { value: "", children: "\u2014 select an agent \u2014" }),
22231
- agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("option", { value: a2.id, children: [
22410
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: "", children: "\u2014 select an agent \u2014" }),
22411
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("option", { value: a2.id, children: [
22232
22412
  a2.name,
22233
22413
  " \xB7 ",
22234
22414
  a2.model
@@ -22236,12 +22416,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22236
22416
  ]
22237
22417
  }
22238
22418
  ),
22239
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { children: "To let it move the conversation into one of your projects, enable the set_workspace tool on the agent. That needs a native agent: Claude Code and ACP agents have no caretaker tools." }),
22240
- missingAgent && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { className: "form-error", children: "This agent no longer exists \u2014 pick another." })
22419
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "To let it move the conversation into one of your projects, enable the set_workspace tool on the agent. That needs a native agent: Claude Code and ACP agents have no caretaker tools." }),
22420
+ missingAgent && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { className: "form-error", children: "This agent no longer exists \u2014 pick another." })
22241
22421
  ] }),
22242
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "form-group", children: [
22243
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { htmlFor: "desktop-assistant-shortcut", children: "Global shortcut" }),
22244
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
22422
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "form-group", children: [
22423
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { htmlFor: "desktop-assistant-shortcut", children: "Global shortcut" }),
22424
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22245
22425
  "input",
22246
22426
  {
22247
22427
  id: "desktop-assistant-shortcut",
@@ -22251,23 +22431,23 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22251
22431
  onChange: (e) => setShortcut(e.target.value)
22252
22432
  }
22253
22433
  ),
22254
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("small", { children: [
22434
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { children: [
22255
22435
  "An Electron accelerator. On Linux under Wayland the global shortcut does not fire: bind this command to a keyboard shortcut in your desktop environment instead \u2014",
22256
22436
  " ",
22257
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("code", { children: "caretaker-desktop --assistant" })
22437
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("code", { children: "caretaker-desktop --assistant" })
22258
22438
  ] })
22259
22439
  ] })
22260
22440
  ] })
22261
22441
  ] }),
22262
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "form-actions", children: [
22263
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", onClick: save, disabled: enabled && !agentId, children: "Save" }),
22264
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { role: "status", "aria-live": "polite", className: "form-save-state", children: saveState === "saving" ? "Saving\u2026" : saveState === "saved" ? "Saved \u2713" : "" })
22442
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "form-actions", children: [
22443
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", onClick: save, disabled: enabled && !agentId, children: "Save" }),
22444
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { role: "status", "aria-live": "polite", className: "form-save-state", children: saveState === "saving" ? "Saving\u2026" : saveState === "saved" ? "Saved \u2713" : "" })
22265
22445
  ] })
22266
22446
  ] });
22267
22447
  }
22268
22448
 
22269
22449
  // src/SettingsPanel.tsx
22270
- var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
22450
+ var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
22271
22451
  function SettingsPanel({
22272
22452
  layout = "compact",
22273
22453
  postMessage,
@@ -22288,16 +22468,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22288
22468
  onClose,
22289
22469
  initialTab = "providers"
22290
22470
  }) {
22291
- const [activeTab, setActiveTab] = (0, import_react20.useState)(initialTab);
22471
+ const [activeTab, setActiveTab] = (0, import_react21.useState)(initialTab);
22292
22472
  if (!settingsData) {
22293
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "settings-panel settings-panel--loading", children: [
22294
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { className: "settings-panel__back-btn", onClick: onClose, children: [
22295
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ArrowLeft, { size: 14 }),
22473
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "settings-panel settings-panel--loading", children: [
22474
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { className: "settings-panel__back-btn", onClick: onClose, children: [
22475
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ArrowLeft, { size: 14 }),
22296
22476
  " Back to Chat"
22297
22477
  ] }),
22298
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "settings-panel__loading-spinner", children: [
22299
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "spinner" }),
22300
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: "Loading configurations..." })
22478
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "settings-panel__loading-spinner", children: [
22479
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "spinner" }),
22480
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "Loading configurations..." })
22301
22481
  ] })
22302
22482
  ] });
22303
22483
  }
@@ -22305,7 +22485,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22305
22485
  const renderTabContent = () => {
22306
22486
  switch (activeTab) {
22307
22487
  case "providers":
22308
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22488
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22309
22489
  ProvidersTab,
22310
22490
  {
22311
22491
  config,
@@ -22317,7 +22497,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22317
22497
  }
22318
22498
  );
22319
22499
  case "projects":
22320
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22500
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22321
22501
  ProjectsTabSettings,
22322
22502
  {
22323
22503
  config,
@@ -22326,7 +22506,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22326
22506
  }
22327
22507
  );
22328
22508
  case "agents":
22329
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22509
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22330
22510
  AgentsTab,
22331
22511
  {
22332
22512
  config,
@@ -22340,7 +22520,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22340
22520
  }
22341
22521
  );
22342
22522
  case "plugins":
22343
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22523
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22344
22524
  PluginsTab,
22345
22525
  {
22346
22526
  pluginsFile,
@@ -22351,7 +22531,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22351
22531
  }
22352
22532
  );
22353
22533
  case "mcp":
22354
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22534
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22355
22535
  McpTab,
22356
22536
  {
22357
22537
  mcpServersFile,
@@ -22361,7 +22541,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22361
22541
  }
22362
22542
  );
22363
22543
  case "services":
22364
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22544
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22365
22545
  ServicesTab,
22366
22546
  {
22367
22547
  config,
@@ -22371,7 +22551,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22371
22551
  }
22372
22552
  );
22373
22553
  case "voice":
22374
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22554
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22375
22555
  VoiceTab,
22376
22556
  {
22377
22557
  config,
@@ -22382,7 +22562,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22382
22562
  }
22383
22563
  );
22384
22564
  case "memory":
22385
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22565
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22386
22566
  MemoryTab,
22387
22567
  {
22388
22568
  config,
@@ -22391,7 +22571,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22391
22571
  }
22392
22572
  );
22393
22573
  case "desktop":
22394
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22574
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22395
22575
  DesktopTab,
22396
22576
  {
22397
22577
  config,
@@ -22401,16 +22581,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22401
22581
  );
22402
22582
  }
22403
22583
  };
22404
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "settings-panel", children: [
22405
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { className: "settings-panel__header", children: [
22406
- layout !== "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { className: "settings-panel__back-btn", onClick: onClose, title: "Go back to chat", children: [
22407
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ArrowLeft, { size: 14 }),
22584
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "settings-panel", children: [
22585
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { className: "settings-panel__header", children: [
22586
+ layout !== "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { className: "settings-panel__back-btn", onClick: onClose, title: "Go back to chat", children: [
22587
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ArrowLeft, { size: 14 }),
22408
22588
  " Chat"
22409
22589
  ] }),
22410
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h2", { className: "settings-panel__title", children: "Caretaker Config" })
22590
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h2", { className: "settings-panel__title", children: "Caretaker Config" })
22411
22591
  ] }),
22412
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("nav", { className: "settings-panel__tabs", children: [
22413
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22592
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("nav", { className: "settings-panel__tabs", children: [
22593
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22414
22594
  "button",
22415
22595
  {
22416
22596
  className: `settings-panel__tab-btn ${activeTab === "providers" ? "settings-panel__tab-btn--active" : ""}`,
@@ -22418,7 +22598,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22418
22598
  children: "Providers"
22419
22599
  }
22420
22600
  ),
22421
- layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22601
+ layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22422
22602
  "button",
22423
22603
  {
22424
22604
  className: `settings-panel__tab-btn ${activeTab === "projects" ? "settings-panel__tab-btn--active" : ""}`,
@@ -22426,7 +22606,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22426
22606
  children: "Projects"
22427
22607
  }
22428
22608
  ),
22429
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22609
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22430
22610
  "button",
22431
22611
  {
22432
22612
  className: `settings-panel__tab-btn ${activeTab === "agents" ? "settings-panel__tab-btn--active" : ""}`,
@@ -22434,7 +22614,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22434
22614
  children: "Agents"
22435
22615
  }
22436
22616
  ),
22437
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22617
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22438
22618
  "button",
22439
22619
  {
22440
22620
  className: `settings-panel__tab-btn ${activeTab === "plugins" ? "settings-panel__tab-btn--active" : ""}`,
@@ -22442,7 +22622,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22442
22622
  children: "Plugins"
22443
22623
  }
22444
22624
  ),
22445
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22625
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22446
22626
  "button",
22447
22627
  {
22448
22628
  className: `settings-panel__tab-btn ${activeTab === "mcp" ? "settings-panel__tab-btn--active" : ""}`,
@@ -22450,7 +22630,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22450
22630
  children: "MCP"
22451
22631
  }
22452
22632
  ),
22453
- layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22633
+ layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22454
22634
  "button",
22455
22635
  {
22456
22636
  className: `settings-panel__tab-btn ${activeTab === "services" ? "settings-panel__tab-btn--active" : ""}`,
@@ -22458,7 +22638,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22458
22638
  children: "Services"
22459
22639
  }
22460
22640
  ),
22461
- layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22641
+ layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22462
22642
  "button",
22463
22643
  {
22464
22644
  className: `settings-panel__tab-btn ${activeTab === "voice" ? "settings-panel__tab-btn--active" : ""}`,
@@ -22466,7 +22646,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22466
22646
  children: "Voice"
22467
22647
  }
22468
22648
  ),
22469
- layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22649
+ layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22470
22650
  "button",
22471
22651
  {
22472
22652
  className: `settings-panel__tab-btn ${activeTab === "memory" ? "settings-panel__tab-btn--active" : ""}`,
@@ -22474,7 +22654,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22474
22654
  children: "Memory"
22475
22655
  }
22476
22656
  ),
22477
- layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22657
+ layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22478
22658
  "button",
22479
22659
  {
22480
22660
  className: `settings-panel__tab-btn ${activeTab === "desktop" ? "settings-panel__tab-btn--active" : ""}`,
@@ -22483,15 +22663,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22483
22663
  }
22484
22664
  )
22485
22665
  ] }),
22486
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("main", { className: "settings-panel__content", children: renderTabContent() })
22666
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("main", { className: "settings-panel__content", children: renderTabContent() })
22487
22667
  ] });
22488
22668
  }
22489
22669
 
22490
22670
  // src/ProjectsTab.tsx
22491
- var import_react22 = __toESM(require_react(), 1);
22671
+ var import_react23 = __toESM(require_react(), 1);
22492
22672
 
22493
22673
  // src/TaskCycleView.tsx
22494
- var import_react21 = __toESM(require_react(), 1);
22674
+ var import_react22 = __toESM(require_react(), 1);
22495
22675
 
22496
22676
  // src/chat_state.ts
22497
22677
  function closeStreamingAssistant2(items) {
@@ -22667,13 +22847,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22667
22847
  };
22668
22848
 
22669
22849
  // src/TaskCycleView.tsx
22670
- var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
22850
+ var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
22671
22851
  function TaskCycleView({ item, postMessage, onBack }) {
22672
- const [chat, dispatch] = (0, import_react21.useReducer)(chatReducer, initialChatState);
22852
+ const [chat, dispatch] = (0, import_react22.useReducer)(chatReducer, initialChatState);
22673
22853
  const { sessionId, agentId } = item;
22674
- const postRef = (0, import_react21.useRef)(postMessage);
22854
+ const postRef = (0, import_react22.useRef)(postMessage);
22675
22855
  postRef.current = postMessage;
22676
- (0, import_react21.useEffect)(() => {
22856
+ (0, import_react22.useEffect)(() => {
22677
22857
  function handle(event) {
22678
22858
  const msg = event.data;
22679
22859
  if (!msg || typeof msg !== "object" || !("type" in msg) || !("sessionId" in msg)) return;
@@ -22714,25 +22894,25 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22714
22894
  };
22715
22895
  }, [sessionId, agentId]);
22716
22896
  const running = chat.status === "streaming";
22717
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: [
22718
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("header", { className: "app__chat-header task-view__sub-header", style: { padding: "10px 14px" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
22719
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { className: "settings-panel__back-btn", onClick: onBack, title: "Back to the task thread", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ArrowLeft, { size: 13 }) }),
22720
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "app__chat-header-info", children: [
22721
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("h3", { className: "app__chat-header-title", style: { fontSize: "13px", margin: 0 }, children: [
22897
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: [
22898
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("header", { className: "app__chat-header task-view__sub-header", style: { padding: "10px 14px" }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
22899
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { className: "settings-panel__back-btn", onClick: onBack, title: "Back to the task thread", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ArrowLeft, { size: 13 }) }),
22900
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "app__chat-header-info", children: [
22901
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("h3", { className: "app__chat-header-title", style: { fontSize: "13px", margin: 0 }, children: [
22722
22902
  cycleRoleLabel(item.role),
22723
22903
  " cycle",
22724
22904
  item.label ? ` \xB7 ${item.label}` : ""
22725
22905
  ] }),
22726
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "app__chat-header-status", style: { fontSize: "10px" }, children: running ? "running" : cycleOutcomeLabel(item.outcome) })
22906
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "app__chat-header-status", style: { fontSize: "10px" }, children: running ? "running" : cycleOutcomeLabel(item.outcome) })
22727
22907
  ] })
22728
22908
  ] }) }),
22729
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MessageList, { items: chat.items, sessionId: null, isStreaming: running, agentName: item.label }),
22730
- chat.errorText && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "notice notice--block", children: chat.errorText })
22909
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MessageList, { items: chat.items, sessionId: null, isStreaming: running, agentName: item.label }),
22910
+ chat.errorText && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "notice notice--block", children: chat.errorText })
22731
22911
  ] });
22732
22912
  }
22733
22913
 
22734
22914
  // src/ProjectsTab.tsx
22735
- var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
22915
+ var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
22736
22916
  var LS_ARCHIVED_KEY = "caretaker.taskView.showArchived";
22737
22917
  function persistLastProject(id) {
22738
22918
  void fetch("/api/ui-state", {
@@ -22757,15 +22937,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22757
22937
  }
22758
22938
  var PAGE_SIZE = 20;
22759
22939
  function ProjectsTab({ agents, onOpenSettings, postMessage }) {
22760
- const [projects, setProjects] = (0, import_react22.useState)([]);
22761
- const [selectedProjectId, setSelectedProjectId] = (0, import_react22.useState)(null);
22762
- const [tasks, setTasks] = (0, import_react22.useState)([]);
22763
- const [selectedTaskId, setSelectedTaskId] = (0, import_react22.useState)(null);
22764
- const [taskMessages, setTaskMessages] = (0, import_react22.useState)([]);
22765
- const [view, setView] = (0, import_react22.useState)("list");
22766
- const [page, setPage] = (0, import_react22.useState)(0);
22767
- const [isNewTaskOpen, setIsNewTaskOpen] = (0, import_react22.useState)(false);
22768
- const [newTask, setNewTask] = (0, import_react22.useState)({
22940
+ const [projects, setProjects] = (0, import_react23.useState)([]);
22941
+ const [selectedProjectId, setSelectedProjectId] = (0, import_react23.useState)(null);
22942
+ const [tasks, setTasks] = (0, import_react23.useState)([]);
22943
+ const [selectedTaskId, setSelectedTaskId] = (0, import_react23.useState)(null);
22944
+ const [taskMessages, setTaskMessages] = (0, import_react23.useState)([]);
22945
+ const [view, setView] = (0, import_react23.useState)("list");
22946
+ const [page, setPage] = (0, import_react23.useState)(0);
22947
+ const [isNewTaskOpen, setIsNewTaskOpen] = (0, import_react23.useState)(false);
22948
+ const [newTask, setNewTask] = (0, import_react23.useState)({
22769
22949
  title: "",
22770
22950
  objective: "",
22771
22951
  checklistText: "",
@@ -22774,12 +22954,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22774
22954
  plannerAgentId: "",
22775
22955
  reviewerAgentId: ""
22776
22956
  });
22777
- const [isSending, setIsSending] = (0, import_react22.useState)(false);
22778
- const [showArchived, setShowArchived] = (0, import_react22.useState)(loadShowArchived);
22779
- const [pendingConfirm, setPendingConfirm] = (0, import_react22.useState)(null);
22780
- const [taskError, setTaskError] = (0, import_react22.useState)(null);
22781
- const threadIntervalRef = (0, import_react22.useRef)(null);
22782
- (0, import_react22.useEffect)(() => {
22957
+ const [isSending, setIsSending] = (0, import_react23.useState)(false);
22958
+ const [showArchived, setShowArchived] = (0, import_react23.useState)(loadShowArchived);
22959
+ const [pendingConfirm, setPendingConfirm] = (0, import_react23.useState)(null);
22960
+ const [taskError, setTaskError] = (0, import_react23.useState)(null);
22961
+ const threadIntervalRef = (0, import_react23.useRef)(null);
22962
+ (0, import_react23.useEffect)(() => {
22783
22963
  void (async () => {
22784
22964
  try {
22785
22965
  const res = await fetch("/api/ui-state");
@@ -22795,7 +22975,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22795
22975
  stopThreadPolling();
22796
22976
  };
22797
22977
  }, []);
22798
- (0, import_react22.useEffect)(() => {
22978
+ (0, import_react23.useEffect)(() => {
22799
22979
  if (projects.length > 0 && selectedProjectId === null) {
22800
22980
  setSelectedProjectId(projects[0].id);
22801
22981
  }
@@ -22806,10 +22986,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22806
22986
  setSelectedProjectId(null);
22807
22987
  }
22808
22988
  }, [projects]);
22809
- (0, import_react22.useEffect)(() => {
22989
+ (0, import_react23.useEffect)(() => {
22810
22990
  saveShowArchived(showArchived);
22811
22991
  }, [showArchived]);
22812
- (0, import_react22.useEffect)(() => {
22992
+ (0, import_react23.useEffect)(() => {
22813
22993
  if (selectedProjectId !== null) {
22814
22994
  fetchTasks(selectedProjectId);
22815
22995
  setView("list");
@@ -22821,7 +23001,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22821
23001
  setTasks([]);
22822
23002
  }
22823
23003
  }, [selectedProjectId, showArchived]);
22824
- (0, import_react22.useEffect)(() => {
23004
+ (0, import_react23.useEffect)(() => {
22825
23005
  if (selectedTaskId !== null) {
22826
23006
  fetchTaskMessages(selectedTaskId);
22827
23007
  startThreadPolling(selectedTaskId);
@@ -22994,7 +23174,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22994
23174
  const cancelPendingAction = () => {
22995
23175
  setPendingConfirm(null);
22996
23176
  };
22997
- (0, import_react22.useEffect)(() => {
23177
+ (0, import_react23.useEffect)(() => {
22998
23178
  if (!pendingConfirm) return;
22999
23179
  function handleKeyDown(event) {
23000
23180
  if (event.key === "Escape") {
@@ -23004,7 +23184,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23004
23184
  window.addEventListener("keydown", handleKeyDown);
23005
23185
  return () => window.removeEventListener("keydown", handleKeyDown);
23006
23186
  }, [pendingConfirm]);
23007
- (0, import_react22.useEffect)(() => {
23187
+ (0, import_react23.useEffect)(() => {
23008
23188
  if (!taskError) return;
23009
23189
  const t = setTimeout(() => setTaskError(null), 5e3);
23010
23190
  return () => clearTimeout(t);
@@ -23135,7 +23315,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23135
23315
  const selectedProject = projects.find((p) => p.id === selectedProjectId);
23136
23316
  const selectedTask = tasks.find((t) => t.id === selectedTaskId);
23137
23317
  const selectedProjectAgentName = agents.find((a2) => a2.id === selectedProject?.agentId)?.name || "Default Agent";
23138
- const taskAgentLabels = (0, import_react22.useMemo)(() => {
23318
+ const taskAgentLabels = (0, import_react23.useMemo)(() => {
23139
23319
  if (!selectedTask) return void 0;
23140
23320
  const agentLabelFor = (agentId) => {
23141
23321
  const a2 = agents.find((x) => x.id === agentId);
@@ -23181,14 +23361,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23181
23361
  const safePage = Math.min(page, totalPages - 1);
23182
23362
  const pageStart = safePage * PAGE_SIZE;
23183
23363
  const pageTasks = tasks.slice(pageStart, pageStart + PAGE_SIZE);
23184
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "app", style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
23185
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("main", { className: "app__chat-pane", style: { flex: 1, display: "flex", flexDirection: "column", background: "var(--vscode-editor-background)" }, children: projects.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("p", { children: [
23364
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app", style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
23365
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("main", { className: "app__chat-pane", style: { flex: 1, display: "flex", flexDirection: "column", background: "var(--vscode-editor-background)" }, children: projects.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("p", { children: [
23186
23366
  "No projects registered.",
23187
23367
  " ",
23188
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { className: "app__link-btn", onClick: onOpenSettings, children: "Create one in Settings" }),
23368
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "app__link-btn", onClick: onOpenSettings, children: "Create one in Settings" }),
23189
23369
  " ",
23190
23370
  "to get started."
23191
- ] }) }) : selectedProject ? view === "list" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23371
+ ] }) }) : selectedProject ? view === "list" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23192
23372
  TaskListView,
23193
23373
  {
23194
23374
  projects,
@@ -23213,7 +23393,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23213
23393
  onArchive: handleArchiveFromList,
23214
23394
  statusColor
23215
23395
  }
23216
- ) : view === "log" && selectedTask ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23396
+ ) : view === "log" && selectedTask ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23217
23397
  TaskLogView,
23218
23398
  {
23219
23399
  task: selectedTask,
@@ -23229,7 +23409,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23229
23409
  onToggleStatus: handleToggleTaskStatus,
23230
23410
  statusColor
23231
23411
  }
23232
- ) : view === "edit" && selectedTask ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23412
+ ) : view === "edit" && selectedTask ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23233
23413
  TaskEditView,
23234
23414
  {
23235
23415
  task: selectedTask,
@@ -23247,11 +23427,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23247
23427
  onOpenLog: () => setView("log"),
23248
23428
  statusColor
23249
23429
  }
23250
- ) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "app__empty-state", children: [
23251
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { children: "Task not found. Go back to the list." }),
23252
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { className: "settings-panel__back-btn", onClick: backToList, style: { marginTop: "12px" }, children: "\u2190 Back to list" })
23430
+ ) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__empty-state", children: [
23431
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { children: "Task not found. Go back to the list." }),
23432
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "settings-panel__back-btn", onClick: backToList, style: { marginTop: "12px" }, children: "\u2190 Back to list" })
23253
23433
  ] }) : null }),
23254
- isNewTaskOpen && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23434
+ isNewTaskOpen && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23255
23435
  "div",
23256
23436
  {
23257
23437
  style: {
@@ -23266,7 +23446,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23266
23446
  justifyContent: "center",
23267
23447
  zIndex: 999
23268
23448
  },
23269
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
23449
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23270
23450
  "form",
23271
23451
  {
23272
23452
  onSubmit: handleCreateTask,
@@ -23277,14 +23457,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23277
23457
  background: "var(--vscode-sideBar-background)"
23278
23458
  },
23279
23459
  children: [
23280
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "confirm__header", children: [
23281
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: { fontSize: "18px", display: "inline-flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Wrench, { size: 18 }) }),
23282
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "confirm__prompt", style: { fontSize: "14px" }, children: "Create New Task" })
23460
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "confirm__header", children: [
23461
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { fontSize: "18px", display: "inline-flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Wrench, { size: 18 }) }),
23462
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "confirm__prompt", style: { fontSize: "14px" }, children: "Create New Task" })
23283
23463
  ] }),
23284
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: [
23285
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23464
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: [
23465
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23286
23466
  "Task Title",
23287
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23467
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23288
23468
  "input",
23289
23469
  {
23290
23470
  type: "text",
@@ -23304,9 +23484,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23304
23484
  }
23305
23485
  )
23306
23486
  ] }),
23307
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23487
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23308
23488
  "Objective (Extended markdown goal description)",
23309
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23489
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23310
23490
  "textarea",
23311
23491
  {
23312
23492
  required: true,
@@ -23327,9 +23507,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23327
23507
  }
23328
23508
  )
23329
23509
  ] }),
23330
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23510
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23331
23511
  "Checklist Items (One item per line)",
23332
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23512
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23333
23513
  "textarea",
23334
23514
  {
23335
23515
  placeholder: "Create route handler\nWrite unit tests\nUpdate documentation",
@@ -23349,9 +23529,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23349
23529
  }
23350
23530
  )
23351
23531
  ] }),
23352
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23532
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23353
23533
  "Assigned Agent (optional \u2014 overrides project default)",
23354
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
23534
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23355
23535
  "select",
23356
23536
  {
23357
23537
  value: newTask.agentId,
@@ -23366,8 +23546,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23366
23546
  outline: "none"
23367
23547
  },
23368
23548
  children: [
23369
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "", children: "Project default" }),
23370
- agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("option", { value: a2.id, children: [
23549
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: "Project default" }),
23550
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: a2.id, children: [
23371
23551
  a2.name,
23372
23552
  " (",
23373
23553
  a2.provider,
@@ -23377,9 +23557,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23377
23557
  }
23378
23558
  )
23379
23559
  ] }),
23380
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23560
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23381
23561
  "Planner Agent Override (optional)",
23382
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
23562
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23383
23563
  "select",
23384
23564
  {
23385
23565
  value: newTask.plannerAgentId,
@@ -23394,8 +23574,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23394
23574
  outline: "none"
23395
23575
  },
23396
23576
  children: [
23397
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "", children: "Project default" }),
23398
- agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("option", { value: a2.id, children: [
23577
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: "Project default" }),
23578
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: a2.id, children: [
23399
23579
  a2.name,
23400
23580
  " (",
23401
23581
  a2.provider,
@@ -23405,9 +23585,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23405
23585
  }
23406
23586
  )
23407
23587
  ] }),
23408
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23588
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23409
23589
  "Reviewer Agent Override (optional)",
23410
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
23590
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23411
23591
  "select",
23412
23592
  {
23413
23593
  value: newTask.reviewerAgentId,
@@ -23422,8 +23602,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23422
23602
  outline: "none"
23423
23603
  },
23424
23604
  children: [
23425
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "", children: "Project default" }),
23426
- agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("option", { value: a2.id, children: [
23605
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: "Project default" }),
23606
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: a2.id, children: [
23427
23607
  a2.name,
23428
23608
  " (",
23429
23609
  a2.provider,
@@ -23433,8 +23613,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23433
23613
  }
23434
23614
  )
23435
23615
  ] }),
23436
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { style: { fontSize: "12px", display: "flex", alignItems: "center", gap: "6px", cursor: "pointer", marginTop: "4px" }, children: [
23437
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23616
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "12px", display: "flex", alignItems: "center", gap: "6px", cursor: "pointer", marginTop: "4px" }, children: [
23617
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23438
23618
  "input",
23439
23619
  {
23440
23620
  type: "checkbox",
@@ -23443,24 +23623,24 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23443
23623
  style: { cursor: "pointer" }
23444
23624
  }
23445
23625
  ),
23446
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "Start active immediately (Heartbeat loop claims it)" })
23626
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: "Start active immediately (Heartbeat loop claims it)" })
23447
23627
  ] })
23448
23628
  ] }),
23449
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "confirm__buttons", style: { justifyContent: "flex-end", marginTop: "10px" }, children: [
23450
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", className: "confirm__btn", onClick: () => setIsNewTaskOpen(false), children: "Cancel" }),
23451
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "submit", className: "confirm__btn confirm__btn--primary", children: "Create Task" })
23629
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "confirm__buttons", style: { justifyContent: "flex-end", marginTop: "10px" }, children: [
23630
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { type: "button", className: "confirm__btn", onClick: () => setIsNewTaskOpen(false), children: "Cancel" }),
23631
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { type: "submit", className: "confirm__btn confirm__btn--primary", children: "Create Task" })
23452
23632
  ] })
23453
23633
  ]
23454
23634
  }
23455
23635
  )
23456
23636
  }
23457
23637
  ),
23458
- pendingConfirm && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "app__confirm-overlay", onClick: cancelPendingAction, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "app__confirm-dialog", onClick: (e) => e.stopPropagation(), children: [
23459
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "app__confirm-title", children: pendingConfirm.type === "delete" ? "Delete task" : pendingConfirm.type === "archive" ? "Archive task" : "Discard worktree" }),
23460
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "app__confirm-message", children: pendingConfirm.type === "delete" ? `Permanently delete task #${pendingConfirm.task.id} "${pendingConfirm.task.title}"? This removes the task and all its messages from the store. This action cannot be undone.` : pendingConfirm.type === "archive" ? `Archive task #${pendingConfirm.task.id} "${pendingConfirm.task.title}"? It will be hidden from the list and excluded from the scheduler. You can unarchive it later by enabling "Show archived".` : `Discard the worktree for task #${pendingConfirm.task.id}? Pending changes are committed to branch ${pendingConfirm.task.branch}; the branch is kept.` }),
23461
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "app__confirm-buttons", children: [
23462
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { className: "app__confirm-btn", onClick: cancelPendingAction, children: "Cancel" }),
23463
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23638
+ pendingConfirm && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__confirm-overlay", onClick: cancelPendingAction, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__confirm-dialog", onClick: (e) => e.stopPropagation(), children: [
23639
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__confirm-title", children: pendingConfirm.type === "delete" ? "Delete task" : pendingConfirm.type === "archive" ? "Archive task" : "Discard worktree" }),
23640
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "app__confirm-message", children: pendingConfirm.type === "delete" ? `Permanently delete task #${pendingConfirm.task.id} "${pendingConfirm.task.title}"? This removes the task and all its messages from the store. This action cannot be undone.` : pendingConfirm.type === "archive" ? `Archive task #${pendingConfirm.task.id} "${pendingConfirm.task.title}"? It will be hidden from the list and excluded from the scheduler. You can unarchive it later by enabling "Show archived".` : `Discard the worktree for task #${pendingConfirm.task.id}? Pending changes are committed to branch ${pendingConfirm.task.branch}; the branch is kept.` }),
23641
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__confirm-buttons", children: [
23642
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "app__confirm-btn", onClick: cancelPendingAction, children: "Cancel" }),
23643
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23464
23644
  "button",
23465
23645
  {
23466
23646
  className: `app__confirm-btn ${pendingConfirm.type === "delete" ? "app__confirm-btn--danger" : ""}`,
@@ -23470,7 +23650,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23470
23650
  )
23471
23651
  ] })
23472
23652
  ] }) }),
23473
- taskError && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "app__error-banner", onClick: () => setTaskError(null), title: "Click to dismiss", children: taskError })
23653
+ taskError && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__error-banner", onClick: () => setTaskError(null), title: "Click to dismiss", children: taskError })
23474
23654
  ] });
23475
23655
  }
23476
23656
  function TaskListView({
@@ -23493,10 +23673,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23493
23673
  onArchive,
23494
23674
  statusColor
23495
23675
  }) {
23496
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%" }, children: [
23497
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "task-view__header", children: [
23498
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
23499
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23676
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%" }, children: [
23677
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "task-view__header", children: [
23678
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
23679
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23500
23680
  "select",
23501
23681
  {
23502
23682
  className: "task-view__project-filter",
@@ -23513,17 +23693,17 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23513
23693
  outline: "none",
23514
23694
  cursor: "pointer"
23515
23695
  },
23516
- children: projects.map((p) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: p.id, children: p.name }, p.id))
23696
+ children: projects.map((p) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: p.id, children: p.name }, p.id))
23517
23697
  }
23518
23698
  ),
23519
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { style: { fontSize: "10px", opacity: 0.6 }, children: [
23699
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { style: { fontSize: "10px", opacity: 0.6 }, children: [
23520
23700
  "Agent: ",
23521
23701
  agentName
23522
23702
  ] })
23523
23703
  ] }),
23524
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
23525
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "task-view__archived-toggle", children: [
23526
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23704
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
23705
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { className: "task-view__archived-toggle", children: [
23706
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23527
23707
  "input",
23528
23708
  {
23529
23709
  type: "checkbox",
@@ -23534,42 +23714,42 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23534
23714
  ),
23535
23715
  "Show archived"
23536
23716
  ] }),
23537
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { className: "app__new-chat-btn", onClick: onNewTask, style: { padding: "4px 10px", fontSize: "11px" }, children: "+ New Task" })
23717
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "app__new-chat-btn", onClick: onNewTask, style: { padding: "4px 10px", fontSize: "11px" }, children: "+ New Task" })
23538
23718
  ] })
23539
23719
  ] }),
23540
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: { flex: 1, overflowY: "auto", padding: "0 16px 16px" }, children: allTasksCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("p", { children: [
23720
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { flex: 1, overflowY: "auto", padding: "0 16px 16px" }, children: allTasksCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("p", { children: [
23541
23721
  "No tasks created for ",
23542
23722
  project.name,
23543
23723
  '. Click "+ New Task" to start.'
23544
- ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("table", { className: "task-table", children: [
23545
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("tr", { children: [
23546
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("th", { className: "task-table__th", style: { width: "60px" }, children: "#" }),
23547
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("th", { className: "task-table__th", children: "Title" }),
23548
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("th", { className: "task-table__th", style: { width: "90px" }, children: "Status" }),
23549
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("th", { className: "task-table__th", style: { width: "100px" }, children: "Agent" }),
23550
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("th", { className: "task-table__th", style: { width: "120px" }, children: "Checklist" }),
23551
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("th", { className: "task-table__th", style: { width: "180px" }, children: "Branch" }),
23552
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("th", { className: "task-table__th", style: { width: "150px" }, children: "Updated" }),
23553
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("th", { className: "task-table__th", style: { width: "70px" } })
23724
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("table", { className: "task-table", children: [
23725
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("tr", { children: [
23726
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "60px" }, children: "#" }),
23727
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", children: "Title" }),
23728
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "90px" }, children: "Status" }),
23729
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "100px" }, children: "Agent" }),
23730
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "120px" }, children: "Checklist" }),
23731
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "180px" }, children: "Branch" }),
23732
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "150px" }, children: "Updated" }),
23733
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "70px" } })
23554
23734
  ] }) }),
23555
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tbody", { children: tasks.map((task) => {
23735
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tbody", { children: tasks.map((task) => {
23556
23736
  const completedCount = task.checklist.filter((c2) => c2.status === "done").length;
23557
23737
  const totalCount = task.checklist.length;
23558
23738
  const isArchived = !!task.archived;
23559
23739
  const updated = new Date(task.updatedAt);
23560
23740
  const updatedStr = isNaN(updated.getTime()) ? task.updatedAt : updated.toLocaleString(void 0, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" });
23561
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
23741
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23562
23742
  "tr",
23563
23743
  {
23564
23744
  className: `task-table__row${isArchived ? " task-table__row--archived" : ""}`,
23565
23745
  onClick: () => onOpenLog(task),
23566
23746
  children: [
23567
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: "task-table__td task-table__td--mono", children: task.id }),
23568
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "task-table__title", children: [
23569
- isArchived && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Archive, { size: 11 }),
23747
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: "task-table__td task-table__td--mono", children: task.id }),
23748
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "task-table__title", children: [
23749
+ isArchived && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Archive, { size: 11 }),
23570
23750
  task.title
23571
23751
  ] }) }),
23572
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23752
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23573
23753
  "span",
23574
23754
  {
23575
23755
  className: "task-table__badge",
@@ -23577,28 +23757,28 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23577
23757
  children: task.status
23578
23758
  }
23579
23759
  ) }),
23580
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: "task-table__td", style: { fontSize: "11px" }, children: task.agentId ? agents.find((a2) => a2.id === task.agentId)?.name || task.agentId : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: { opacity: 0.4 }, children: "default" }) }),
23581
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: "task-table__td", children: totalCount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "task-table__progress", children: [
23582
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "task-table__progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23760
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: "task-table__td", style: { fontSize: "11px" }, children: task.agentId ? agents.find((a2) => a2.id === task.agentId)?.name || task.agentId : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { opacity: 0.4 }, children: "default" }) }),
23761
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: "task-table__td", children: totalCount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "task-table__progress", children: [
23762
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "task-table__progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23583
23763
  "span",
23584
23764
  {
23585
23765
  className: "task-table__progress-fill",
23586
23766
  style: { width: `${completedCount / totalCount * 100}%` }
23587
23767
  }
23588
23768
  ) }),
23589
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "task-table__progress-text", children: [
23769
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "task-table__progress-text", children: [
23590
23770
  completedCount,
23591
23771
  "/",
23592
23772
  totalCount
23593
23773
  ] })
23594
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: { opacity: 0.4, fontSize: "11px" }, children: "\u2014" }) }),
23595
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: "task-table__td", children: task.branch ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "task-table__branch", children: [
23596
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GitBranch, { size: 11 }),
23597
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("code", { children: task.branch })
23598
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: { opacity: 0.4, fontSize: "11px" }, children: "\u2014" }) }),
23599
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: "task-table__td task-table__td--muted", children: updatedStr }),
23600
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { display: "inline-flex", gap: "2px" }, children: [
23601
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23774
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { opacity: 0.4, fontSize: "11px" }, children: "\u2014" }) }),
23775
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: "task-table__td", children: task.branch ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "task-table__branch", children: [
23776
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GitBranch, { size: 11 }),
23777
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("code", { children: task.branch })
23778
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { opacity: 0.4, fontSize: "11px" }, children: "\u2014" }) }),
23779
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: "task-table__td task-table__td--muted", children: updatedStr }),
23780
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "inline-flex", gap: "2px" }, children: [
23781
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23602
23782
  "button",
23603
23783
  {
23604
23784
  className: "task-table__edit-btn",
@@ -23608,10 +23788,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23608
23788
  },
23609
23789
  title: task.archived ? "Unarchive task" : "Archive task",
23610
23790
  "aria-label": task.archived ? "Unarchive task" : "Archive task",
23611
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Archive, { size: 13 })
23791
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Archive, { size: 13 })
23612
23792
  }
23613
23793
  ),
23614
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23794
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23615
23795
  "button",
23616
23796
  {
23617
23797
  className: "task-table__edit-btn",
@@ -23621,7 +23801,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23621
23801
  },
23622
23802
  title: "Edit task",
23623
23803
  "aria-label": "Edit task",
23624
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Pencil, { size: 13 })
23804
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Pencil, { size: 13 })
23625
23805
  }
23626
23806
  )
23627
23807
  ] }) })
@@ -23631,8 +23811,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23631
23811
  );
23632
23812
  }) })
23633
23813
  ] }) }),
23634
- totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "task-table__pagination", children: [
23635
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23814
+ totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "task-table__pagination", children: [
23815
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23636
23816
  "button",
23637
23817
  {
23638
23818
  className: "task-table__page-btn",
@@ -23641,13 +23821,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23641
23821
  children: "\u2039 Prev"
23642
23822
  }
23643
23823
  ),
23644
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "task-table__page-info", children: [
23824
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "task-table__page-info", children: [
23645
23825
  "Page ",
23646
23826
  page + 1,
23647
23827
  " of ",
23648
23828
  totalPages
23649
23829
  ] }),
23650
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23830
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23651
23831
  "button",
23652
23832
  {
23653
23833
  className: "task-table__page-btn",
@@ -23675,31 +23855,31 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23675
23855
  }) {
23676
23856
  const completedCount = task.checklist.filter((c2) => c2.status === "done").length;
23677
23857
  const totalCount = task.checklist.length;
23678
- const chatItems = (0, import_react22.useMemo)(() => taskMessagesToChatItems(taskMessages, agentLabels), [taskMessages, agentLabels]);
23679
- const [openCycle, setOpenCycle] = (0, import_react22.useState)(null);
23680
- const [draft, setDraft] = (0, import_react22.useState)("");
23681
- const openCycleItem = (0, import_react22.useCallback)((item) => setOpenCycle(item), []);
23682
- const autoOpenedFor = (0, import_react22.useRef)(null);
23683
- (0, import_react22.useEffect)(() => {
23858
+ const chatItems = (0, import_react23.useMemo)(() => taskMessagesToChatItems(taskMessages, agentLabels), [taskMessages, agentLabels]);
23859
+ const [openCycle, setOpenCycle] = (0, import_react23.useState)(null);
23860
+ const [draft, setDraft] = (0, import_react23.useState)("");
23861
+ const openCycleItem = (0, import_react23.useCallback)((item) => setOpenCycle(item), []);
23862
+ const autoOpenedFor = (0, import_react23.useRef)(null);
23863
+ (0, import_react23.useEffect)(() => {
23684
23864
  if (autoOpenedFor.current === task.id || taskMessages.length === 0) return;
23685
23865
  autoOpenedFor.current = task.id;
23686
23866
  const latest = [...chatItems].reverse().find((i) => i.kind === "cycle");
23687
23867
  if (latest && latest.outcome === "running") setOpenCycle(latest);
23688
23868
  }, [task.id, taskMessages.length, chatItems]);
23689
23869
  const liveCycle = openCycle ? chatItems.find((i) => i.kind === "cycle" && i.sessionId === openCycle.sessionId) ?? openCycle : null;
23690
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%" }, children: [
23691
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("header", { className: "app__chat-header task-view__sub-header", style: { padding: "12px 14px" }, children: [
23692
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
23693
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { className: "settings-panel__back-btn", onClick: onBack, title: "Back to task list", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ArrowLeft, { size: 13 }) }),
23694
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "app__chat-header-info", children: [
23695
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("h3", { className: "app__chat-header-title", style: { fontSize: "13px", margin: 0 }, children: [
23870
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%" }, children: [
23871
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("header", { className: "app__chat-header task-view__sub-header", style: { padding: "12px 14px" }, children: [
23872
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
23873
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "settings-panel__back-btn", onClick: onBack, title: "Back to task list", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ArrowLeft, { size: 13 }) }),
23874
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__chat-header-info", children: [
23875
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("h3", { className: "app__chat-header-title", style: { fontSize: "13px", margin: 0 }, children: [
23696
23876
  "Task #",
23697
23877
  task.id,
23698
23878
  ": ",
23699
23879
  task.title
23700
23880
  ] }),
23701
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "app__chat-header-status", style: { fontSize: "10px" }, children: [
23702
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23881
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "app__chat-header-status", style: { fontSize: "10px" }, children: [
23882
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23703
23883
  "span",
23704
23884
  {
23705
23885
  className: `agent-status-dot agent-status-dot--active ${isActiveLike ? "agent-status-dot--pulsing" : ""}`,
@@ -23710,24 +23890,24 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23710
23890
  ] })
23711
23891
  ] })
23712
23892
  ] }),
23713
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
23714
- task.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23893
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
23894
+ task.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23715
23895
  "button",
23716
23896
  {
23717
23897
  className: "confirm__btn confirm__btn--primary",
23718
23898
  onClick: () => onToggleStatus(task),
23719
23899
  title: isActiveLike ? "Pause this task (aborts the running agent)" : "Activate this task",
23720
23900
  style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px" },
23721
- children: isActiveLike ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
23722
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Pause, { size: 12 }),
23901
+ children: isActiveLike ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
23902
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Pause, { size: 12 }),
23723
23903
  " Pause"
23724
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
23725
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Play, { size: 12 }),
23904
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
23905
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Play, { size: 12 }),
23726
23906
  " Activate"
23727
23907
  ] })
23728
23908
  }
23729
23909
  ),
23730
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23910
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23731
23911
  "span",
23732
23912
  {
23733
23913
  className: "task-table__badge",
@@ -23737,8 +23917,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23737
23917
  )
23738
23918
  ] })
23739
23919
  ] }),
23740
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "row" }, children: [
23741
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
23920
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "row" }, children: [
23921
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23742
23922
  "aside",
23743
23923
  {
23744
23924
  style: {
@@ -23751,19 +23931,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23751
23931
  background: "var(--vscode-sideBar-background, rgba(0,0,0,0.1))"
23752
23932
  },
23753
23933
  children: [
23754
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { padding: "10px 12px", borderBottom: "1px solid var(--vscode-panel-border, rgba(255,255,255,0.05))" }, children: [
23755
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { style: { margin: 0, fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Checklist" }),
23756
- totalCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { fontSize: "10px", opacity: 0.5, marginTop: "2px" }, children: [
23934
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { padding: "10px 12px", borderBottom: "1px solid var(--vscode-panel-border, rgba(255,255,255,0.05))" }, children: [
23935
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h4", { style: { margin: 0, fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Checklist" }),
23936
+ totalCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { fontSize: "10px", opacity: 0.5, marginTop: "2px" }, children: [
23757
23937
  completedCount,
23758
23938
  "/",
23759
23939
  totalCount,
23760
23940
  " done"
23761
23941
  ] })
23762
23942
  ] }),
23763
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: { padding: "8px 10px", display: "flex", flexDirection: "column", gap: "4px" }, children: totalCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: { fontSize: "11px", opacity: 0.4, padding: "8px 4px" }, children: "No checklist items." }) : (task.checklist || []).map((item) => {
23943
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { padding: "8px 10px", display: "flex", flexDirection: "column", gap: "4px" }, children: totalCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { fontSize: "11px", opacity: 0.4, padding: "8px 4px" }, children: "No checklist items." }) : (task.checklist || []).map((item) => {
23764
23944
  const isDone = item.status === "done";
23765
23945
  const isInProgress = item.status === "in_progress";
23766
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
23946
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23767
23947
  "label",
23768
23948
  {
23769
23949
  style: {
@@ -23780,7 +23960,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23780
23960
  },
23781
23961
  title: isInProgress ? "In progress" : isDone ? "Done" : "Pending",
23782
23962
  children: [
23783
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23963
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23784
23964
  "input",
23785
23965
  {
23786
23966
  type: "checkbox",
@@ -23789,7 +23969,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23789
23969
  style: { marginTop: "2px", cursor: "pointer", flexShrink: 0 }
23790
23970
  }
23791
23971
  ),
23792
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: { wordBreak: "break-word" }, children: item.text })
23972
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { wordBreak: "break-word" }, children: item.text })
23793
23973
  ]
23794
23974
  },
23795
23975
  item.id
@@ -23798,8 +23978,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23798
23978
  ]
23799
23979
  }
23800
23980
  ),
23801
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column" }, children: [
23802
- liveCycle ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23981
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column" }, children: [
23982
+ liveCycle ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23803
23983
  TaskCycleView,
23804
23984
  {
23805
23985
  item: liveCycle,
@@ -23807,8 +23987,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23807
23987
  onBack: () => setOpenCycle(null)
23808
23988
  },
23809
23989
  liveCycle.sessionId
23810
- ) : taskMessages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "messages messages--empty", children: "No messages in this execution yet. Agent will start on next tick." }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MessageList, { items: chatItems, sessionId: null, compact: true, onOpenCycle: openCycleItem }),
23811
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23990
+ ) : taskMessages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "messages messages--empty", children: "No messages in this execution yet. Agent will start on next tick." }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(MessageList, { items: chatItems, sessionId: null, compact: true, onOpenCycle: openCycleItem }),
23991
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23812
23992
  Composer,
23813
23993
  {
23814
23994
  disabled: isSending,
@@ -23845,12 +24025,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23845
24025
  statusColor
23846
24026
  }) {
23847
24027
  const isRunning = task.status === "active" || task.status === "reviewing" || task.status === "planning";
23848
- const [draftTitle, setDraftTitle] = (0, import_react22.useState)(task.title);
23849
- const [draftObjective, setDraftObjective] = (0, import_react22.useState)(task.objective);
23850
- const [lastTaskId, setLastTaskId] = (0, import_react22.useState)(task.id);
24028
+ const [draftTitle, setDraftTitle] = (0, import_react23.useState)(task.title);
24029
+ const [draftObjective, setDraftObjective] = (0, import_react23.useState)(task.objective);
24030
+ const [lastTaskId, setLastTaskId] = (0, import_react23.useState)(task.id);
23851
24031
  const trimmedTitle = draftTitle.trim();
23852
24032
  const isDirty = trimmedTitle !== task.title.trim() || draftObjective.trim() !== task.objective.trim();
23853
- (0, import_react22.useEffect)(() => {
24033
+ (0, import_react23.useEffect)(() => {
23854
24034
  if (task.id !== lastTaskId) {
23855
24035
  setDraftTitle(task.title);
23856
24036
  setDraftObjective(task.objective);
@@ -23865,16 +24045,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23865
24045
  setDraftTitle(task.title);
23866
24046
  setDraftObjective(task.objective);
23867
24047
  };
23868
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%", overflowY: "auto" }, children: [
23869
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "task-view__sub-header", style: { padding: "12px 14px", display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
23870
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
23871
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { className: "settings-panel__back-btn", onClick: onBack, title: "Back to task list", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ArrowLeft, { size: 13 }) }),
23872
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("h3", { style: { margin: 0, fontSize: "15px", fontWeight: 700, display: "flex", alignItems: "center", gap: "6px" }, children: [
23873
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { style: { opacity: 0.6 }, children: [
24048
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%", overflowY: "auto" }, children: [
24049
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "task-view__sub-header", style: { padding: "12px 14px", display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
24050
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
24051
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "settings-panel__back-btn", onClick: onBack, title: "Back to task list", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ArrowLeft, { size: 13 }) }),
24052
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("h3", { style: { margin: 0, fontSize: "15px", fontWeight: 700, display: "flex", alignItems: "center", gap: "6px" }, children: [
24053
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { style: { opacity: 0.6 }, children: [
23874
24054
  "Task #",
23875
24055
  task.id
23876
24056
  ] }),
23877
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24057
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23878
24058
  "input",
23879
24059
  {
23880
24060
  value: draftTitle,
@@ -23895,7 +24075,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23895
24075
  }
23896
24076
  )
23897
24077
  ] }),
23898
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24078
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23899
24079
  "span",
23900
24080
  {
23901
24081
  className: "task-table__badge",
@@ -23904,8 +24084,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23904
24084
  }
23905
24085
  )
23906
24086
  ] }),
23907
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { display: "inline-flex", gap: "6px" }, children: [
23908
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24087
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "inline-flex", gap: "6px" }, children: [
24088
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23909
24089
  "button",
23910
24090
  {
23911
24091
  className: "confirm__btn",
@@ -23915,7 +24095,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23915
24095
  children: "View Log"
23916
24096
  }
23917
24097
  ),
23918
- task.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
24098
+ task.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23919
24099
  "button",
23920
24100
  {
23921
24101
  className: "confirm__btn",
@@ -23923,12 +24103,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23923
24103
  title: `Commit pending changes to ${task.branch} and remove the worktree`,
23924
24104
  style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px" },
23925
24105
  children: [
23926
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GitBranch, { size: 12 }),
24106
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GitBranch, { size: 12 }),
23927
24107
  " Discard worktree"
23928
24108
  ]
23929
24109
  }
23930
24110
  ),
23931
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
24111
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23932
24112
  "button",
23933
24113
  {
23934
24114
  className: "confirm__btn",
@@ -23936,28 +24116,28 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23936
24116
  title: task.archived ? "Unarchive this task" : "Archive this task (hides it from the list, excludes from scheduler)",
23937
24117
  style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px" },
23938
24118
  children: [
23939
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Archive, { size: 12 }),
24119
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Archive, { size: 12 }),
23940
24120
  " ",
23941
24121
  task.archived ? "Unarchive" : "Archive"
23942
24122
  ]
23943
24123
  }
23944
24124
  ),
23945
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24125
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23946
24126
  "button",
23947
24127
  {
23948
24128
  className: "confirm__btn confirm__btn--primary",
23949
24129
  onClick: () => onToggleStatus(task),
23950
24130
  style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px" },
23951
- children: task.status === "active" || task.status === "reviewing" || task.status === "planning" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
23952
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Pause, { size: 12 }),
24131
+ children: task.status === "active" || task.status === "reviewing" || task.status === "planning" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
24132
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Pause, { size: 12 }),
23953
24133
  " Pause"
23954
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
23955
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Play, { size: 12 }),
24134
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
24135
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Play, { size: 12 }),
23956
24136
  " Activate"
23957
24137
  ] })
23958
24138
  }
23959
24139
  ),
23960
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
24140
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23961
24141
  "button",
23962
24142
  {
23963
24143
  className: "confirm__btn",
@@ -23965,22 +24145,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23965
24145
  title: "Permanently delete this task and all its messages",
23966
24146
  style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px", color: "#ef4444" },
23967
24147
  children: [
23968
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Trash, { size: 12 }),
24148
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Trash, { size: 12 }),
23969
24149
  " Delete"
23970
24150
  ]
23971
24151
  }
23972
24152
  )
23973
24153
  ] })
23974
24154
  ] }),
23975
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { padding: "16px", maxWidth: "720px" }, children: [
23976
- task.branch && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { marginBottom: "16px", display: "flex", alignItems: "center", gap: "6px", fontSize: "11px", opacity: 0.75 }, children: [
23977
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GitBranch, { size: 12 }),
23978
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("code", { style: { fontFamily: "monospace" }, children: task.branch }),
23979
- !task.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: { opacity: 0.6 }, children: "(worktree removed)" })
24155
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { padding: "16px", maxWidth: "720px" }, children: [
24156
+ task.branch && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { marginBottom: "16px", display: "flex", alignItems: "center", gap: "6px", fontSize: "11px", opacity: 0.75 }, children: [
24157
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GitBranch, { size: 12 }),
24158
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("code", { style: { fontFamily: "monospace" }, children: task.branch }),
24159
+ !task.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { opacity: 0.6 }, children: "(worktree removed)" })
23980
24160
  ] }),
23981
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { marginBottom: "16px" }, children: [
23982
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Objective" }),
23983
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24161
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24162
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Objective" }),
24163
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23984
24164
  "textarea",
23985
24165
  {
23986
24166
  value: draftObjective,
@@ -24004,8 +24184,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24004
24184
  }
24005
24185
  }
24006
24186
  ),
24007
- isDirty && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { display: "flex", gap: "6px", alignItems: "center", marginTop: "8px" }, children: [
24008
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24187
+ isDirty && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", gap: "6px", alignItems: "center", marginTop: "8px" }, children: [
24188
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24009
24189
  "button",
24010
24190
  {
24011
24191
  className: "confirm__btn confirm__btn--primary",
@@ -24018,13 +24198,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24018
24198
  children: "Save"
24019
24199
  }
24020
24200
  ),
24021
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { className: "confirm__btn", onClick: resetDraft, style: { padding: "3px 10px", fontSize: "10px" }, children: "Cancel" }),
24022
- isRunning && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: { fontSize: "10px", opacity: 0.6 }, children: "Applies from the next cycle." })
24201
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "confirm__btn", onClick: resetDraft, style: { padding: "3px 10px", fontSize: "10px" }, children: "Cancel" }),
24202
+ isRunning && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { fontSize: "10px", opacity: 0.6 }, children: "Applies from the next cycle." })
24023
24203
  ] })
24024
24204
  ] }),
24025
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24026
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Assigned Agent" }),
24027
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
24205
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24206
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Assigned Agent" }),
24207
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24028
24208
  "select",
24029
24209
  {
24030
24210
  value: task.agentId || "",
@@ -24044,8 +24224,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24044
24224
  },
24045
24225
  title: isRunning ? "Pause the task before changing its agent" : "Choose which agent runs this task",
24046
24226
  children: [
24047
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "", children: "Project default" }),
24048
- agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("option", { value: a2.id, children: [
24227
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: "Project default" }),
24228
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: a2.id, children: [
24049
24229
  a2.name,
24050
24230
  " (",
24051
24231
  a2.provider,
@@ -24055,9 +24235,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24055
24235
  }
24056
24236
  )
24057
24237
  ] }),
24058
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24059
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Planner Agent" }),
24060
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
24238
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24239
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Planner Agent" }),
24240
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24061
24241
  "select",
24062
24242
  {
24063
24243
  value: task.plannerAgentId || "",
@@ -24066,8 +24246,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24066
24246
  style: { background: "var(--vscode-input-background, #252526)", color: "var(--vscode-input-foreground)", border: "1px solid var(--vscode-input-border, #3c3c3c)", borderRadius: "4px", padding: "6px 8px", fontSize: "12px", outline: "none", width: "100%", cursor: isRunning ? "not-allowed" : "pointer", opacity: isRunning ? 0.6 : 1 },
24067
24247
  title: isRunning ? "Pause the task before changing its planner" : "Agent that runs the planning phase (read-only). Unset: falls back to the project planner, then the developer.",
24068
24248
  children: [
24069
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "", children: "Project default" }),
24070
- agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("option", { value: a2.id, children: [
24249
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: "Project default" }),
24250
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: a2.id, children: [
24071
24251
  a2.name,
24072
24252
  " (",
24073
24253
  a2.provider,
@@ -24077,9 +24257,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24077
24257
  }
24078
24258
  )
24079
24259
  ] }),
24080
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24081
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Reviewer Agent" }),
24082
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
24260
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24261
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Reviewer Agent" }),
24262
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24083
24263
  "select",
24084
24264
  {
24085
24265
  value: task.reviewerAgentId || "",
@@ -24088,8 +24268,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24088
24268
  style: { background: "var(--vscode-input-background, #252526)", color: "var(--vscode-input-foreground)", border: "1px solid var(--vscode-input-border, #3c3c3c)", borderRadius: "4px", padding: "6px 8px", fontSize: "12px", outline: "none", width: "100%", cursor: isRunning ? "not-allowed" : "pointer", opacity: isRunning ? 0.6 : 1 },
24089
24269
  title: isRunning ? "Pause the task before changing its reviewer" : "Agent that reviews the branch at DONE. Unset: falls back to the project reviewer, then the developer.",
24090
24270
  children: [
24091
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "", children: "Project default" }),
24092
- agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("option", { value: a2.id, children: [
24271
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: "Project default" }),
24272
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: a2.id, children: [
24093
24273
  a2.name,
24094
24274
  " (",
24095
24275
  a2.provider,
@@ -24099,31 +24279,31 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24099
24279
  }
24100
24280
  )
24101
24281
  ] }),
24102
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24103
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Phases" }),
24104
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: { display: "flex", gap: "12px" }, children: [
24282
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24283
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Phases" }),
24284
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { display: "flex", gap: "12px" }, children: [
24105
24285
  { flag: "planningEnabled", label: "Planning phase", value: task.planningEnabled },
24106
24286
  { flag: "reviewEnabled", label: "Review at DONE", value: task.reviewEnabled },
24107
24287
  { flag: "sddEnabled", label: "SDD mode (.md specs)", value: task.sddEnabled }
24108
- ].map(({ flag, label, value }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px", flex: 1 }, children: [
24288
+ ].map(({ flag, label, value }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px", flex: 1 }, children: [
24109
24289
  label,
24110
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
24290
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24111
24291
  "select",
24112
24292
  {
24113
24293
  value: value === true ? "on" : value === false ? "off" : "inherit",
24114
24294
  onChange: (e) => onSetFlag(task, flag, e.target.value === "inherit" ? null : e.target.value === "on"),
24115
24295
  style: { background: "var(--vscode-input-background, #252526)", color: "var(--vscode-input-foreground)", border: "1px solid var(--vscode-input-border, #3c3c3c)", borderRadius: "4px", padding: "6px 8px", fontSize: "12px", outline: "none" },
24116
24296
  children: [
24117
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "inherit", children: "Project default" }),
24118
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "on", children: "On" }),
24119
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: "off", children: "Off" })
24297
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "inherit", children: "Project default" }),
24298
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "on", children: "On" }),
24299
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "off", children: "Off" })
24120
24300
  ]
24121
24301
  }
24122
24302
  )
24123
24303
  ] }, flag)) }),
24124
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px", marginTop: "12px", maxWidth: "260px" }, children: [
24304
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px", marginTop: "12px", maxWidth: "260px" }, children: [
24125
24305
  "Max run seconds per cycle",
24126
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24306
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24127
24307
  "input",
24128
24308
  {
24129
24309
  type: "number",
@@ -24146,7 +24326,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24146
24326
  )
24147
24327
  ] })
24148
24328
  ] }),
24149
- task.status === "blocked" && task.blockedReason && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
24329
+ task.status === "blocked" && task.blockedReason && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24150
24330
  "div",
24151
24331
  {
24152
24332
  style: {
@@ -24159,19 +24339,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24159
24339
  fontSize: "12px"
24160
24340
  },
24161
24341
  children: [
24162
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("strong", { children: [
24163
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TriangleAlert, { size: 13 }),
24342
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("strong", { children: [
24343
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TriangleAlert, { size: 13 }),
24164
24344
  " Blocked Reason:"
24165
24345
  ] }),
24166
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { style: { margin: "4px 0 0 0" }, children: task.blockedReason })
24346
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { style: { margin: "4px 0 0 0" }, children: task.blockedReason })
24167
24347
  ]
24168
24348
  }
24169
24349
  ),
24170
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
24171
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { style: { margin: "0 0 8px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Checklist" }),
24172
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: (task.checklist || []).map((item) => {
24350
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
24351
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h4", { style: { margin: "0 0 8px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Checklist" }),
24352
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: (task.checklist || []).map((item) => {
24173
24353
  const isDone = item.status === "done";
24174
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
24354
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24175
24355
  "label",
24176
24356
  {
24177
24357
  style: {
@@ -24188,7 +24368,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24188
24368
  opacity: isDone ? 0.6 : 1
24189
24369
  },
24190
24370
  children: [
24191
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24371
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24192
24372
  "input",
24193
24373
  {
24194
24374
  type: "checkbox",
@@ -24197,7 +24377,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24197
24377
  style: { marginTop: "2px", cursor: "pointer" }
24198
24378
  }
24199
24379
  ),
24200
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: item.text })
24380
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: item.text })
24201
24381
  ]
24202
24382
  },
24203
24383
  item.id
@@ -24209,7 +24389,51 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24209
24389
  }
24210
24390
 
24211
24391
  // src/useVoice.ts
24212
- var import_react23 = __toESM(require_react(), 1);
24392
+ var import_react24 = __toESM(require_react(), 1);
24393
+
24394
+ // src/pcm_wav.ts
24395
+ function encodeWavPcm16(samples, rate) {
24396
+ const out = new Uint8Array(44 + samples.length * 2);
24397
+ const view = new DataView(out.buffer);
24398
+ const tag = (at2, s) => {
24399
+ for (let i = 0; i < s.length; i++) view.setUint8(at2 + i, s.charCodeAt(i));
24400
+ };
24401
+ tag(0, "RIFF");
24402
+ view.setUint32(4, 36 + samples.length * 2, true);
24403
+ tag(8, "WAVE");
24404
+ tag(12, "fmt ");
24405
+ view.setUint32(16, 16, true);
24406
+ view.setUint16(20, 1, true);
24407
+ view.setUint16(22, 1, true);
24408
+ view.setUint32(24, rate, true);
24409
+ view.setUint32(28, rate * 2, true);
24410
+ view.setUint16(32, 2, true);
24411
+ view.setUint16(34, 16, true);
24412
+ tag(36, "data");
24413
+ view.setUint32(40, samples.length * 2, true);
24414
+ for (let i = 0; i < samples.length; i++) {
24415
+ const s = Math.max(-1, Math.min(1, samples[i]));
24416
+ view.setInt16(44 + i * 2, s < 0 ? s * 32768 : s * 32767, true);
24417
+ }
24418
+ return out;
24419
+ }
24420
+ async function toWav16k(blob) {
24421
+ const ctx = new AudioContext();
24422
+ try {
24423
+ const decoded = await ctx.decodeAudioData(await blob.arrayBuffer());
24424
+ const offline = new OfflineAudioContext(1, Math.max(1, Math.ceil(decoded.duration * 16e3)), 16e3);
24425
+ const src = offline.createBufferSource();
24426
+ src.buffer = decoded;
24427
+ src.connect(offline.destination);
24428
+ src.start();
24429
+ const rendered = await offline.startRendering();
24430
+ return new Blob([encodeWavPcm16(rendered.getChannelData(0), 16e3)], { type: "audio/wav" });
24431
+ } finally {
24432
+ void ctx.close();
24433
+ }
24434
+ }
24435
+
24436
+ // src/useVoice.ts
24213
24437
  function canCapture() {
24214
24438
  return typeof window !== "undefined" && typeof MediaRecorder !== "undefined" && !!navigator.mediaDevices?.getUserMedia;
24215
24439
  }
@@ -24234,39 +24458,41 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24234
24458
  const { voice, chatStatus, pendingConfirmCount, items, onTranscript } = opts;
24235
24459
  const available = !!voice && voice.enabled && voice.configured && canCapture();
24236
24460
  const canSpeak = !!voice?.canSpeak;
24237
- const [phase, setPhase] = (0, import_react23.useState)("idle");
24238
- const [mode, setMode] = (0, import_react23.useState)("dictate");
24239
- const [error, setError] = (0, import_react23.useState)(null);
24240
- const bufferMsRef = (0, import_react23.useRef)(voice?.playbackBufferMs);
24461
+ const [phase, setPhase] = (0, import_react24.useState)("idle");
24462
+ const [mode, setMode] = (0, import_react24.useState)("dictate");
24463
+ const [error, setError] = (0, import_react24.useState)(null);
24464
+ const voiceRef = (0, import_react24.useRef)(voice);
24465
+ voiceRef.current = voice;
24466
+ const bufferMsRef = (0, import_react24.useRef)(voice?.playbackBufferMs);
24241
24467
  bufferMsRef.current = voice?.playbackBufferMs;
24242
- const phaseRef = (0, import_react23.useRef)(phase);
24468
+ const phaseRef = (0, import_react24.useRef)(phase);
24243
24469
  phaseRef.current = phase;
24244
- const modeRef = (0, import_react23.useRef)(mode);
24470
+ const modeRef = (0, import_react24.useRef)(mode);
24245
24471
  modeRef.current = mode;
24246
- const onTranscriptRef = (0, import_react23.useRef)(onTranscript);
24472
+ const onTranscriptRef = (0, import_react24.useRef)(onTranscript);
24247
24473
  onTranscriptRef.current = onTranscript;
24248
- const itemsRef = (0, import_react23.useRef)(items);
24474
+ const itemsRef = (0, import_react24.useRef)(items);
24249
24475
  itemsRef.current = items;
24250
- const chatStatusRef = (0, import_react23.useRef)(chatStatus);
24476
+ const chatStatusRef = (0, import_react24.useRef)(chatStatus);
24251
24477
  chatStatusRef.current = chatStatus;
24252
- const streamRef = (0, import_react23.useRef)(null);
24253
- const recorderRef = (0, import_react23.useRef)(null);
24254
- const chunksRef = (0, import_react23.useRef)([]);
24255
- const vadRef = (0, import_react23.useRef)(null);
24256
- const speechAbortRef = (0, import_react23.useRef)(null);
24257
- const idleTimerRef = (0, import_react23.useRef)(null);
24258
- const heardSpeechRef = (0, import_react23.useRef)(false);
24259
- const sawStreamingRef = (0, import_react23.useRef)(false);
24260
- const cursorRef = (0, import_react23.useRef)(0);
24261
- const queueRef = (0, import_react23.useRef)([]);
24262
- const apply = (0, import_react23.useCallback)((event) => {
24478
+ const streamRef = (0, import_react24.useRef)(null);
24479
+ const recorderRef = (0, import_react24.useRef)(null);
24480
+ const chunksRef = (0, import_react24.useRef)([]);
24481
+ const vadRef = (0, import_react24.useRef)(null);
24482
+ const speechAbortRef = (0, import_react24.useRef)(null);
24483
+ const idleTimerRef = (0, import_react24.useRef)(null);
24484
+ const heardSpeechRef = (0, import_react24.useRef)(false);
24485
+ const sawStreamingRef = (0, import_react24.useRef)(false);
24486
+ const cursorRef = (0, import_react24.useRef)(0);
24487
+ const queueRef = (0, import_react24.useRef)([]);
24488
+ const apply = (0, import_react24.useCallback)((event) => {
24263
24489
  setPhase((current) => nextPhase(current, event));
24264
24490
  }, []);
24265
24491
  const clearIdleTimer = () => {
24266
24492
  if (idleTimerRef.current) clearTimeout(idleTimerRef.current);
24267
24493
  idleTimerRef.current = null;
24268
24494
  };
24269
- const teardownCapture = (0, import_react23.useCallback)(() => {
24495
+ const teardownCapture = (0, import_react24.useCallback)(() => {
24270
24496
  clearIdleTimer();
24271
24497
  try {
24272
24498
  vadRef.current?.destroy();
@@ -24283,11 +24509,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24283
24509
  chunksRef.current = [];
24284
24510
  heardSpeechRef.current = false;
24285
24511
  }, []);
24286
- const stopPlayback = (0, import_react23.useCallback)(() => {
24512
+ const stopPlayback = (0, import_react24.useCallback)(() => {
24287
24513
  speechAbortRef.current?.abort();
24288
24514
  speechAbortRef.current = null;
24289
24515
  }, []);
24290
- const fail = (0, import_react23.useCallback)(
24516
+ const fail = (0, import_react24.useCallback)(
24291
24517
  (message) => {
24292
24518
  teardownCapture();
24293
24519
  stopPlayback();
@@ -24296,7 +24522,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24296
24522
  },
24297
24523
  [apply, teardownCapture, stopPlayback]
24298
24524
  );
24299
- const finishRecording = (0, import_react23.useCallback)(() => {
24525
+ const finishRecording = (0, import_react24.useCallback)(() => {
24300
24526
  const recorder = recorderRef.current;
24301
24527
  if (!recorder || recorder.state === "inactive") return;
24302
24528
  recorder.onstop = async () => {
@@ -24304,7 +24530,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24304
24530
  teardownCapture();
24305
24531
  try {
24306
24532
  const form = new FormData();
24307
- form.set("file", blob, "turn.webm");
24533
+ if (voiceRef.current?.sttEngine === "builtin") form.set("file", await toWav16k(blob), "audio.wav");
24534
+ else form.set("file", blob, "turn.webm");
24308
24535
  const res = await fetch("/api/voice/transcribe", { method: "POST", body: form });
24309
24536
  if (!res.ok) return fail(await res.text());
24310
24537
  const { text } = await res.json();
@@ -24325,7 +24552,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24325
24552
  };
24326
24553
  recorder.stop();
24327
24554
  }, [apply, fail, teardownCapture]);
24328
- const startRecording = (0, import_react23.useCallback)(async () => {
24555
+ const startRecording = (0, import_react24.useCallback)(async () => {
24329
24556
  setError(null);
24330
24557
  chunksRef.current = [];
24331
24558
  heardSpeechRef.current = false;
@@ -24370,7 +24597,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24370
24597
  fail(`Microphone unavailable: ${err}`);
24371
24598
  }
24372
24599
  }, [apply, fail, finishRecording, teardownCapture]);
24373
- const speakReply = (0, import_react23.useCallback)(async () => {
24600
+ const speakReply = (0, import_react24.useCallback)(async () => {
24374
24601
  const text = queueRef.current.shift();
24375
24602
  if (!text) {
24376
24603
  apply({
@@ -24409,10 +24636,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24409
24636
  fail(`Synthesis failed: ${err}`);
24410
24637
  }
24411
24638
  }, [apply, fail]);
24412
- (0, import_react23.useEffect)(() => {
24639
+ (0, import_react24.useEffect)(() => {
24413
24640
  if (chatStatus === "streaming") sawStreamingRef.current = true;
24414
24641
  }, [chatStatus]);
24415
- (0, import_react23.useEffect)(() => {
24642
+ (0, import_react24.useEffect)(() => {
24416
24643
  if (modeRef.current !== "conversation") return;
24417
24644
  if (phaseRef.current === "idle") return;
24418
24645
  const { texts, cursor } = takeFinalizedBubbles(items, cursorRef.current);
@@ -24421,7 +24648,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24421
24648
  queueRef.current.push(...texts);
24422
24649
  apply({ kind: "speechQueued", mode: "conversation", canSpeak });
24423
24650
  }, [items, canSpeak, apply]);
24424
- (0, import_react23.useEffect)(() => {
24651
+ (0, import_react24.useEffect)(() => {
24425
24652
  if (phase !== "awaiting") return;
24426
24653
  if (chatStatus === "error") {
24427
24654
  apply({ kind: "failed", mode: "conversation" });
@@ -24443,8 +24670,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24443
24670
  pendingSpeech: queueRef.current.length
24444
24671
  });
24445
24672
  }, [phase, chatStatus, pendingConfirmCount, canSpeak, apply]);
24446
- const prevPhase = (0, import_react23.useRef)("idle");
24447
- (0, import_react23.useEffect)(() => {
24673
+ const prevPhase = (0, import_react24.useRef)("idle");
24674
+ (0, import_react24.useEffect)(() => {
24448
24675
  const from = prevPhase.current;
24449
24676
  prevPhase.current = phase;
24450
24677
  if (from === phase) return;
@@ -24456,14 +24683,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24456
24683
  queueRef.current = [];
24457
24684
  }
24458
24685
  }, [phase, startRecording, speakReply, teardownCapture, stopPlayback]);
24459
- (0, import_react23.useEffect)(
24686
+ (0, import_react24.useEffect)(
24460
24687
  () => () => {
24461
24688
  teardownCapture();
24462
24689
  stopPlayback();
24463
24690
  },
24464
24691
  [teardownCapture, stopPlayback]
24465
24692
  );
24466
- const toggle = (0, import_react23.useCallback)(() => {
24693
+ const toggle = (0, import_react24.useCallback)(() => {
24467
24694
  if (!available) return;
24468
24695
  const current = phaseRef.current;
24469
24696
  if (current === "idle") {
@@ -24477,7 +24704,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24477
24704
  }
24478
24705
  apply({ kind: "userStop", mode: modeRef.current });
24479
24706
  }, [available, apply, finishRecording]);
24480
- const changeMode = (0, import_react23.useCallback)(
24707
+ const changeMode = (0, import_react24.useCallback)(
24481
24708
  (next) => {
24482
24709
  apply({ kind: "userStop", mode: modeRef.current });
24483
24710
  setMode(next);
@@ -24488,7 +24715,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24488
24715
  }
24489
24716
 
24490
24717
  // src/App.tsx
24491
- var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
24718
+ var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
24492
24719
  function takeInjectedActivation() {
24493
24720
  const w2 = window;
24494
24721
  const id = typeof w2.__caretakerAssistant === "string" ? w2.__caretakerAssistant : null;
@@ -24496,36 +24723,36 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24496
24723
  return id;
24497
24724
  }
24498
24725
  function App({ postMessage, layout = "compact" }) {
24499
- const [chatState, dispatch] = (0, import_react24.useReducer)(chatReducer, initialChatState);
24500
- const [agents, setAgents] = (0, import_react24.useState)([]);
24501
- const [sessions, setSessions] = (0, import_react24.useState)([]);
24502
- const [selectedAgentId, setSelectedAgentId] = (0, import_react24.useState)(null);
24503
- const [selectedSessionId, setSelectedSessionId] = (0, import_react24.useState)(null);
24504
- const [showSessions, setShowSessions] = (0, import_react24.useState)(false);
24505
- const [showAllAgents, setShowAllAgents] = (0, import_react24.useState)(false);
24506
- const [pendingDelete, setPendingDelete] = (0, import_react24.useState)(null);
24507
- const [activeScreen, setActiveScreen] = (0, import_react24.useState)("chat");
24508
- const [settingsTab, setSettingsTab] = (0, import_react24.useState)();
24509
- const [settingsData, setSettingsData] = (0, import_react24.useState)(null);
24510
- const [modelsResult, setModelsResult] = (0, import_react24.useState)(null);
24511
- const [acpRegistry, setAcpRegistry] = (0, import_react24.useState)(null);
24512
- const [acpInstall, setAcpInstall] = (0, import_react24.useState)(null);
24513
- const [refreshingSourceId, setRefreshingSourceId] = (0, import_react24.useState)(null);
24514
- const [refreshOutcome, setRefreshOutcome] = (0, import_react24.useState)(null);
24515
- const [mcpAuthOutcome, setMcpAuthOutcome] = (0, import_react24.useState)(null);
24516
- const [taskRuns, setTaskRuns] = (0, import_react24.useState)({});
24517
- const [voiceConfig, setVoiceConfig] = (0, import_react24.useState)(null);
24518
- const [sttCatalogResult, setSttCatalogResult] = (0, import_react24.useState)(null);
24519
- const [ttsCatalogResult, setTtsCatalogResult] = (0, import_react24.useState)(null);
24520
- const [composerDraft, setComposerDraft] = (0, import_react24.useState)("");
24521
- const [activation, setActivation] = (0, import_react24.useState)(null);
24522
- const [confirmedAgentId, setConfirmedAgentId] = (0, import_react24.useState)(null);
24523
- const [pendingAssistantId, setPendingAssistantId] = (0, import_react24.useState)(() => takeInjectedActivation());
24524
- const [composerFocusToken, setComposerFocusToken] = (0, import_react24.useState)(0);
24525
- (0, import_react24.useEffect)(() => {
24726
+ const [chatState, dispatch] = (0, import_react25.useReducer)(chatReducer, initialChatState);
24727
+ const [agents, setAgents] = (0, import_react25.useState)([]);
24728
+ const [sessions, setSessions] = (0, import_react25.useState)([]);
24729
+ const [selectedAgentId, setSelectedAgentId] = (0, import_react25.useState)(null);
24730
+ const [selectedSessionId, setSelectedSessionId] = (0, import_react25.useState)(null);
24731
+ const [showSessions, setShowSessions] = (0, import_react25.useState)(false);
24732
+ const [showAllAgents, setShowAllAgents] = (0, import_react25.useState)(false);
24733
+ const [pendingDelete, setPendingDelete] = (0, import_react25.useState)(null);
24734
+ const [activeScreen, setActiveScreen] = (0, import_react25.useState)("chat");
24735
+ const [settingsTab, setSettingsTab] = (0, import_react25.useState)();
24736
+ const [settingsData, setSettingsData] = (0, import_react25.useState)(null);
24737
+ const [modelsResult, setModelsResult] = (0, import_react25.useState)(null);
24738
+ const [acpRegistry, setAcpRegistry] = (0, import_react25.useState)(null);
24739
+ const [acpInstall, setAcpInstall] = (0, import_react25.useState)(null);
24740
+ const [refreshingSourceId, setRefreshingSourceId] = (0, import_react25.useState)(null);
24741
+ const [refreshOutcome, setRefreshOutcome] = (0, import_react25.useState)(null);
24742
+ const [mcpAuthOutcome, setMcpAuthOutcome] = (0, import_react25.useState)(null);
24743
+ const [taskRuns, setTaskRuns] = (0, import_react25.useState)({});
24744
+ const [voiceConfig, setVoiceConfig] = (0, import_react25.useState)(null);
24745
+ const [sttCatalogResult, setSttCatalogResult] = (0, import_react25.useState)(null);
24746
+ const [ttsCatalogResult, setTtsCatalogResult] = (0, import_react25.useState)(null);
24747
+ const [composerDraft, setComposerDraft] = (0, import_react25.useState)("");
24748
+ const [activation, setActivation] = (0, import_react25.useState)(null);
24749
+ const [confirmedAgentId, setConfirmedAgentId] = (0, import_react25.useState)(null);
24750
+ const [pendingAssistantId, setPendingAssistantId] = (0, import_react25.useState)(() => takeInjectedActivation());
24751
+ const [composerFocusToken, setComposerFocusToken] = (0, import_react25.useState)(0);
24752
+ (0, import_react25.useEffect)(() => {
24526
24753
  postMessage({ type: "webviewReady" });
24527
24754
  }, []);
24528
- (0, import_react24.useEffect)(() => {
24755
+ (0, import_react25.useEffect)(() => {
24529
24756
  function handle(event) {
24530
24757
  const msg = event.data;
24531
24758
  if (!msg || typeof msg !== "object" || !("type" in msg)) return;
@@ -24657,15 +24884,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24657
24884
  if (voice2) msg.voice = true;
24658
24885
  postMessage(msg);
24659
24886
  };
24660
- const onConfirm = (0, import_react24.useCallback)((id, decision) => {
24887
+ const onConfirm = (0, import_react25.useCallback)((id, decision) => {
24661
24888
  dispatch({ kind: "permission-resolved", id });
24662
24889
  postMessage({ type: "permission_response", id, decision });
24663
24890
  }, [postMessage]);
24664
24891
  const onAbort = () => {
24665
24892
  postMessage({ type: "abort" });
24666
24893
  };
24667
- const confirmCards = (0, import_react24.useMemo)(
24668
- () => chatState.pendingConfirms.map((p) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ConfirmCard, { pending: p, onDecide: onConfirm }, p.id)),
24894
+ const confirmCards = (0, import_react25.useMemo)(
24895
+ () => chatState.pendingConfirms.map((p) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ConfirmCard, { pending: p, onDecide: onConfirm }, p.id)),
24669
24896
  [chatState.pendingConfirms, onConfirm]
24670
24897
  );
24671
24898
  const onSelectAgent = (agentId) => {
@@ -24705,7 +24932,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24705
24932
  const cancelDeleteSession = () => {
24706
24933
  setPendingDelete(null);
24707
24934
  };
24708
- (0, import_react24.useEffect)(() => {
24935
+ (0, import_react25.useEffect)(() => {
24709
24936
  if (!pendingDelete) return;
24710
24937
  function handleKeyDown(event) {
24711
24938
  if (event.key === "Escape") {
@@ -24720,7 +24947,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24720
24947
  setShowSessions(!showSessions);
24721
24948
  }
24722
24949
  };
24723
- (0, import_react24.useEffect)(() => {
24950
+ (0, import_react25.useEffect)(() => {
24724
24951
  function handleClickOutside(event) {
24725
24952
  const target = event.target;
24726
24953
  if (showSessions && !target.closest(".app__sessions-dropdown")) {
@@ -24730,7 +24957,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24730
24957
  document.addEventListener("mousedown", handleClickOutside);
24731
24958
  return () => document.removeEventListener("mousedown", handleClickOutside);
24732
24959
  }, [showSessions]);
24733
- (0, import_react24.useEffect)(() => {
24960
+ (0, import_react25.useEffect)(() => {
24734
24961
  if (!pendingAssistantId) return;
24735
24962
  const r = resolvePending(pendingAssistantId, confirmedAgentId, agents.map((a2) => a2.id), activation);
24736
24963
  setPendingAssistantId(r.pending);
@@ -24739,7 +24966,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24739
24966
  if (r.activation?.step === "awaiting-agent") onSelectAgent(r.activation.agentId);
24740
24967
  setActivation(r.activation);
24741
24968
  }, [pendingAssistantId, agents]);
24742
- (0, import_react24.useEffect)(() => {
24969
+ (0, import_react25.useEffect)(() => {
24743
24970
  if (activation?.step !== "open") return;
24744
24971
  const adopt = localSelectionFor(activation, selectedAgentId);
24745
24972
  if (adopt) {
@@ -24755,7 +24982,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24755
24982
  setActivation(null);
24756
24983
  }
24757
24984
  }, [activation]);
24758
- (0, import_react24.useEffect)(() => {
24985
+ (0, import_react25.useEffect)(() => {
24759
24986
  if (activation?.step !== "mic") return;
24760
24987
  if (voice.mode !== "conversation" || voice.phase !== "idle") return;
24761
24988
  voice.toggle();
@@ -24774,30 +25001,30 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24774
25001
  { id: "projects", label: "Projects", Icon: FolderKanban },
24775
25002
  { id: "settings", label: "Settings", Icon: Settings }
24776
25003
  ];
24777
- const navRail = /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("nav", { className: "app__nav", children: [
24778
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("img", { src: caretaker_cli_default, alt: "Caretaker", className: "app__logo app__nav-logo" }),
24779
- navItems.map(({ id, label, Icon: Icon2 }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
25004
+ const navRail = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("nav", { className: "app__nav", children: [
25005
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("img", { src: caretaker_cli_default, alt: "Caretaker", className: "app__logo app__nav-logo" }),
25006
+ navItems.map(({ id, label, Icon: Icon2 }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
24780
25007
  "button",
24781
25008
  {
24782
25009
  className: `app__nav-btn ${activeScreen === id ? "app__nav-btn--active" : ""}`,
24783
25010
  onClick: () => openScreen(id),
24784
25011
  title: label,
24785
25012
  children: [
24786
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon2, { size: 18 }),
24787
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: label })
25013
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon2, { size: 18 }),
25014
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: label })
24788
25015
  ]
24789
25016
  },
24790
25017
  id
24791
25018
  ))
24792
25019
  ] });
24793
25020
  if (activeScreen === "projects" && layout === "sidebar") {
24794
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app app--with-sidebar", children: [
25021
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app app--with-sidebar", children: [
24795
25022
  navRail,
24796
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__screen", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ProjectsTab, { agents, onOpenSettings: () => openScreen("settings", "projects"), postMessage }) })
25023
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__screen", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ProjectsTab, { agents, onOpenSettings: () => openScreen("settings", "projects"), postMessage }) })
24797
25024
  ] });
24798
25025
  }
24799
25026
  if (activeScreen === "settings") {
24800
- const panel = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: `app ${layout === "sidebar" ? "app--settings-centered app__screen" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
25027
+ const panel = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: `app ${layout === "sidebar" ? "app--settings-centered app__screen" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
24801
25028
  SettingsPanel,
24802
25029
  {
24803
25030
  layout,
@@ -24820,44 +25047,44 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24820
25047
  onClose: () => setActiveScreen("chat")
24821
25048
  }
24822
25049
  ) });
24823
- return layout === "sidebar" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app app--with-sidebar", children: [
25050
+ return layout === "sidebar" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app app--with-sidebar", children: [
24824
25051
  navRail,
24825
25052
  panel
24826
25053
  ] }) : panel;
24827
25054
  }
24828
- const deleteOverlay = pendingDelete && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__confirm-overlay", onClick: cancelDeleteSession, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__confirm-dialog", onClick: (e) => e.stopPropagation(), children: [
24829
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__confirm-title", children: "Delete conversation" }),
24830
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("p", { className: "app__confirm-message", children: [
25055
+ const deleteOverlay = pendingDelete && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__confirm-overlay", onClick: cancelDeleteSession, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__confirm-dialog", onClick: (e) => e.stopPropagation(), children: [
25056
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__confirm-title", children: "Delete conversation" }),
25057
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("p", { className: "app__confirm-message", children: [
24831
25058
  "Delete conversation \u201C",
24832
25059
  pendingDelete.title,
24833
25060
  "\u201D? This cannot be undone."
24834
25061
  ] }),
24835
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__confirm-buttons", children: [
24836
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "app__confirm-btn", onClick: cancelDeleteSession, children: "Cancel" }),
24837
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "app__confirm-btn app__confirm-btn--danger", onClick: confirmDeleteSession, children: "Delete" })
25062
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__confirm-buttons", children: [
25063
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { className: "app__confirm-btn", onClick: cancelDeleteSession, children: "Cancel" }),
25064
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { className: "app__confirm-btn app__confirm-btn--danger", onClick: confirmDeleteSession, children: "Delete" })
24838
25065
  ] })
24839
25066
  ] }) });
24840
25067
  if (layout === "sidebar") {
24841
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app app--with-sidebar", children: [
25068
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app app--with-sidebar", children: [
24842
25069
  navRail,
24843
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("aside", { className: "app__sidebar", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__sidebar-content", children: [
24844
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__sidebar-section", children: [
24845
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__sidebar-section-title", children: "Agents" }),
24846
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__sidebar-agents-list", children: selectedAgentId && !showAllAgents ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
25070
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("aside", { className: "app__sidebar", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sidebar-content", children: [
25071
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sidebar-section", children: [
25072
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__sidebar-section-title", children: "Agents" }),
25073
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__sidebar-agents-list", children: selectedAgentId && !showAllAgents ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
24847
25074
  "button",
24848
25075
  {
24849
25076
  className: "app__sidebar-agent-item app__sidebar-agent-item--collapsed-active",
24850
25077
  onClick: () => setShowAllAgents(true),
24851
25078
  title: "Switch Agent",
24852
25079
  children: [
24853
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "agent-status-dot agent-status-dot--active" }),
24854
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "app__sidebar-agent-name", children: activeAgent?.name || selectedAgentId }),
24855
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ChevronDown, { className: "app__sidebar-chevron", size: 10 })
25080
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "agent-status-dot agent-status-dot--active" }),
25081
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__sidebar-agent-name", children: activeAgent?.name || selectedAgentId }),
25082
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChevronDown, { className: "app__sidebar-chevron", size: 10 })
24856
25083
  ]
24857
25084
  }
24858
- ) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: `app__sidebar-agents-list-expanded ${selectedAgentId ? "app__sidebar-agents-list-expanded--has-active" : ""}`, children: agents.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__sidebar-empty-text", children: "No agents found" }) : agents.map((agent) => {
25085
+ ) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: `app__sidebar-agents-list-expanded ${selectedAgentId ? "app__sidebar-agents-list-expanded--has-active" : ""}`, children: agents.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__sidebar-empty-text", children: "No agents found" }) : agents.map((agent) => {
24859
25086
  const isSelected = selectedAgentId === agent.id;
24860
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
25087
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
24861
25088
  "button",
24862
25089
  {
24863
25090
  className: `app__sidebar-agent-item ${isSelected ? "app__sidebar-agent-item--active" : ""}`,
@@ -24870,19 +25097,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24870
25097
  }
24871
25098
  },
24872
25099
  children: [
24873
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: `agent-status-dot ${isSelected ? "agent-status-dot--active" : ""}` }),
24874
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "app__sidebar-agent-name", children: agent.name }),
24875
- isSelected && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ChevronUp, { className: "app__sidebar-chevron app__sidebar-chevron--up", size: 10 })
25100
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: `agent-status-dot ${isSelected ? "agent-status-dot--active" : ""}` }),
25101
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__sidebar-agent-name", children: agent.name }),
25102
+ isSelected && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChevronUp, { className: "app__sidebar-chevron app__sidebar-chevron--up", size: 10 })
24876
25103
  ]
24877
25104
  },
24878
25105
  agent.id
24879
25106
  );
24880
25107
  }) }) })
24881
25108
  ] }),
24882
- selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__sidebar-section", children: [
24883
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__sidebar-section-header", children: [
24884
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "app__sidebar-section-title", children: "Conversations" }),
24885
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
25109
+ selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sidebar-section", children: [
25110
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sidebar-section-header", children: [
25111
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__sidebar-section-title", children: "Conversations" }),
25112
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
24886
25113
  "button",
24887
25114
  {
24888
25115
  className: "app__sidebar-new-chat-btn",
@@ -24892,15 +25119,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24892
25119
  }
24893
25120
  )
24894
25121
  ] }),
24895
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__sidebar-sessions-list", children: sessions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__sidebar-empty-text", children: "No conversations yet" }) : sessions.map((session) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
25122
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__sidebar-sessions-list", children: sessions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__sidebar-empty-text", children: "No conversations yet" }) : sessions.map((session) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
24896
25123
  "div",
24897
25124
  {
24898
25125
  className: `app__sidebar-session-item ${selectedSessionId === session.id ? "app__sidebar-session-item--active" : ""}`,
24899
25126
  onClick: () => onSelectSession(session.id),
24900
25127
  children: [
24901
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "app__sidebar-session-icon", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(MessageSquare, { size: 13 }) }),
24902
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "app__sidebar-session-title", title: session.title, children: session.title }),
24903
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
25128
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__sidebar-session-icon", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MessageSquare, { size: 13 }) }),
25129
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__sidebar-session-title", title: session.title, children: session.title }),
25130
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
24904
25131
  "button",
24905
25132
  {
24906
25133
  className: "app__sidebar-session-delete",
@@ -24909,7 +25136,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24909
25136
  e.stopPropagation();
24910
25137
  onDeleteSession(session.id, session.title);
24911
25138
  },
24912
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Trash, { size: 12 })
25139
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Trash, { size: 12 })
24913
25140
  }
24914
25141
  )
24915
25142
  ]
@@ -24918,15 +25145,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24918
25145
  )) })
24919
25146
  ] })
24920
25147
  ] }) }),
24921
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("main", { className: "app__chat-pane", children: selectedAgentId ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
24922
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("header", { className: "app__chat-header", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__chat-header-info", children: [
24923
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { className: "app__chat-header-title", children: selectedAgentName }),
24924
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "app__chat-header-status", children: [
24925
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: `agent-status-dot agent-status-dot--active ${chatState.status === "streaming" ? "agent-status-dot--pulsing" : ""}` }),
25148
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("main", { className: "app__chat-pane", children: selectedAgentId ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
25149
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("header", { className: "app__chat-header", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__chat-header-info", children: [
25150
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h2", { className: "app__chat-header-title", children: selectedAgentName }),
25151
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "app__chat-header-status", children: [
25152
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: `agent-status-dot agent-status-dot--active ${chatState.status === "streaming" ? "agent-status-dot--pulsing" : ""}` }),
24926
25153
  chatState.status === "streaming" ? "Streaming response..." : "Ready"
24927
25154
  ] })
24928
25155
  ] }) }),
24929
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
25156
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
24930
25157
  MessageList,
24931
25158
  {
24932
25159
  items: chatState.items,
@@ -24936,12 +25163,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24936
25163
  trailing: confirmCards
24937
25164
  }
24938
25165
  ),
24939
- (chatState.errorText || voice.error) && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__error", children: [
24940
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TriangleAlert, { size: 14 }),
25166
+ (chatState.errorText || voice.error) && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__error", children: [
25167
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TriangleAlert, { size: 14 }),
24941
25168
  " ",
24942
25169
  chatState.errorText || voice.error
24943
25170
  ] }),
24944
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
25171
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
24945
25172
  Composer,
24946
25173
  {
24947
25174
  disabled: composerDisabled,
@@ -24961,18 +25188,18 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24961
25188
  onValueChange: setComposerDraft
24962
25189
  }
24963
25190
  )
24964
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { children: "Select an agent from the sidebar to start chatting" }) }) }),
25191
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { children: "Select an agent from the sidebar to start chatting" }) }) }),
24965
25192
  deleteOverlay
24966
25193
  ] });
24967
25194
  }
24968
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app", children: [
24969
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("header", { className: "app__header", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__header-row", children: [
24970
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__logo-title-wrapper", children: [
24971
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("img", { src: caretaker_cli_default, alt: "Caretaker", className: "app__logo" }),
24972
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: "Caretaker" })
25195
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app", children: [
25196
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("header", { className: "app__header", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__header-row", children: [
25197
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__logo-title-wrapper", children: [
25198
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("img", { src: caretaker_cli_default, alt: "Caretaker", className: "app__logo" }),
25199
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: "Caretaker" })
24973
25200
  ] }),
24974
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__controls", children: [
24975
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__agent-select-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
25201
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__controls", children: [
25202
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__agent-select-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
24976
25203
  "select",
24977
25204
  {
24978
25205
  className: "app__agent-select",
@@ -24982,12 +25209,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24982
25209
  onSelectAgent(e.target.value);
24983
25210
  },
24984
25211
  children: [
24985
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", disabled: true, children: "-- Select Agent --" }),
24986
- agents.map((agent) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: agent.id, children: agent.name }, agent.id))
25212
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("option", { value: "", disabled: true, children: "-- Select Agent --" }),
25213
+ agents.map((agent) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("option", { value: agent.id, children: agent.name }, agent.id))
24987
25214
  ]
24988
25215
  }
24989
25216
  ) }),
24990
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
25217
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
24991
25218
  "button",
24992
25219
  {
24993
25220
  className: "app__sessions-btn",
@@ -24995,13 +25222,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24995
25222
  disabled: !selectedAgentId,
24996
25223
  title: "View conversations",
24997
25224
  children: [
24998
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(MessageSquare, { size: 13 }),
25225
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MessageSquare, { size: 13 }),
24999
25226
  " ",
25000
25227
  sessions.length
25001
25228
  ]
25002
25229
  }
25003
25230
  ),
25004
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
25231
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25005
25232
  "button",
25006
25233
  {
25007
25234
  className: "app__new-chat-btn",
@@ -25011,7 +25238,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25011
25238
  children: "+ New"
25012
25239
  }
25013
25240
  ),
25014
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
25241
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25015
25242
  "button",
25016
25243
  {
25017
25244
  className: "app__settings-btn",
@@ -25020,24 +25247,24 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25020
25247
  postMessage({ type: "getSettingsData" });
25021
25248
  },
25022
25249
  title: "Caretaker Settings",
25023
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Settings, { className: "app__settings-icon", size: 14 })
25250
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Settings, { className: "app__settings-icon", size: 14 })
25024
25251
  }
25025
25252
  )
25026
25253
  ] })
25027
25254
  ] }) }),
25028
- showSessions && sessions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__sessions-dropdown", children: [
25029
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__sessions-title", children: [
25255
+ showSessions && sessions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sessions-dropdown", children: [
25256
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sessions-title", children: [
25030
25257
  "Conversations for ",
25031
25258
  selectedAgentName
25032
25259
  ] }),
25033
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__sessions-list", children: sessions.map((session) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
25260
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__sessions-list", children: sessions.map((session) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
25034
25261
  "div",
25035
25262
  {
25036
25263
  className: `app__session-item ${selectedSessionId === session.id ? "app__session-item--active" : ""}`,
25037
25264
  onClick: () => onSelectSession(session.id),
25038
25265
  children: [
25039
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "app__session-item-title", children: session.title }),
25040
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
25266
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__session-item-title", children: session.title }),
25267
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25041
25268
  "button",
25042
25269
  {
25043
25270
  className: "app__session-item-delete",
@@ -25046,7 +25273,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25046
25273
  e.stopPropagation();
25047
25274
  onDeleteSession(session.id, session.title);
25048
25275
  },
25049
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Trash, { size: 12 })
25276
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Trash, { size: 12 })
25050
25277
  }
25051
25278
  )
25052
25279
  ]
@@ -25054,12 +25281,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25054
25281
  session.id
25055
25282
  )) })
25056
25283
  ] }),
25057
- showSessions && sessions.length === 0 && selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__sessions-dropdown app__sessions-dropdown--empty", children: [
25058
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__sessions-title", children: "No conversations yet" }),
25059
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "app__sessions-empty", children: "Start a new chat to create a conversation" })
25284
+ showSessions && sessions.length === 0 && selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sessions-dropdown app__sessions-dropdown--empty", children: [
25285
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__sessions-title", children: "No conversations yet" }),
25286
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "app__sessions-empty", children: "Start a new chat to create a conversation" })
25060
25287
  ] }),
25061
- !selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { children: "Select an agent to start chatting" }) }),
25062
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
25288
+ !selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { children: "Select an agent to start chatting" }) }),
25289
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25063
25290
  MessageList,
25064
25291
  {
25065
25292
  items: chatState.items,
@@ -25069,12 +25296,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25069
25296
  trailing: confirmCards
25070
25297
  }
25071
25298
  ),
25072
- (chatState.errorText || voice.error) && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__error", children: [
25073
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TriangleAlert, { size: 14 }),
25299
+ (chatState.errorText || voice.error) && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__error", children: [
25300
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TriangleAlert, { size: 14 }),
25074
25301
  " ",
25075
25302
  chatState.errorText || voice.error
25076
25303
  ] }),
25077
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
25304
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25078
25305
  Composer,
25079
25306
  {
25080
25307
  disabled: composerDisabled,
@@ -25099,12 +25326,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25099
25326
  }
25100
25327
 
25101
25328
  // src/standalone.tsx
25102
- var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
25329
+ var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
25103
25330
  function StandaloneApp() {
25104
- const [ws, setWs] = (0, import_react25.useState)(null);
25105
- const [connected, setConnected] = (0, import_react25.useState)(false);
25106
- const [error, setError] = (0, import_react25.useState)(null);
25107
- (0, import_react25.useEffect)(() => {
25331
+ const [ws, setWs] = (0, import_react26.useState)(null);
25332
+ const [connected, setConnected] = (0, import_react26.useState)(false);
25333
+ const [error, setError] = (0, import_react26.useState)(null);
25334
+ (0, import_react26.useEffect)(() => {
25108
25335
  let active = true;
25109
25336
  const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
25110
25337
  const socket = new WebSocket(`${protocol}//${window.location.host}/api/ws`);
@@ -25150,7 +25377,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25150
25377
  }
25151
25378
  };
25152
25379
  if (error) {
25153
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: {
25380
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: {
25154
25381
  display: "flex",
25155
25382
  flexDirection: "column",
25156
25383
  alignItems: "center",
@@ -25162,9 +25389,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25162
25389
  padding: "20px",
25163
25390
  textAlign: "center"
25164
25391
  }, children: [
25165
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h3", { style: { color: "#ff6b6b" }, children: "Caretaker Connection Failed" }),
25166
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { children: error }),
25167
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25392
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h3", { style: { color: "#ff6b6b" }, children: "Caretaker Connection Failed" }),
25393
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: error }),
25394
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
25168
25395
  "button",
25169
25396
  {
25170
25397
  onClick: () => setWs(null),
@@ -25183,7 +25410,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25183
25410
  ] });
25184
25411
  }
25185
25412
  if (!connected) {
25186
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: {
25413
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: {
25187
25414
  display: "flex",
25188
25415
  flexDirection: "column",
25189
25416
  alignItems: "center",
@@ -25193,7 +25420,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25193
25420
  background: "#1e1e1e",
25194
25421
  color: "#f1f1f1"
25195
25422
  }, children: [
25196
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { style: {
25423
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: {
25197
25424
  border: "4px solid rgba(255,255,255,0.1)",
25198
25425
  width: "36px",
25199
25426
  height: "36px",
@@ -25202,8 +25429,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25202
25429
  animation: "spin 1s linear infinite",
25203
25430
  marginBottom: "16px"
25204
25431
  } }),
25205
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: "Connecting to Caretaker server..." }),
25206
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("style", { children: `
25432
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "Connecting to Caretaker server..." }),
25433
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("style", { children: `
25207
25434
  @keyframes spin {
25208
25435
  0% { transform: rotate(0deg); }
25209
25436
  100% { transform: rotate(360deg); }
@@ -25211,12 +25438,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25211
25438
  ` })
25212
25439
  ] });
25213
25440
  }
25214
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(App, { postMessage, layout: "sidebar" });
25441
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(App, { postMessage, layout: "sidebar" });
25215
25442
  }
25216
25443
  var rootEl = document.getElementById("root");
25217
25444
  if (!rootEl) throw new Error("#root not found");
25218
25445
  (0, import_client.createRoot)(rootEl).render(
25219
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react25.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(StandaloneApp, {}) })
25446
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react26.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(StandaloneApp, {}) })
25220
25447
  );
25221
25448
  })();
25222
25449
  /*! Bundled license information: