@hyperwindmill/caretaker-cli 0.30.0 → 0.32.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 (63) hide show
  1. package/dist/cli/web/mcp_bridge.d.ts +1 -0
  2. package/dist/cli/web/mcp_bridge.d.ts.map +1 -1
  3. package/dist/cli/web/mcp_bridge.js +11 -2
  4. package/dist/cli/web/scheduler/email_triage.d.ts +63 -0
  5. package/dist/cli/web/scheduler/email_triage.d.ts.map +1 -0
  6. package/dist/cli/web/scheduler/email_triage.js +247 -0
  7. package/dist/cli/web/scheduler/email_triage_agent.d.ts +16 -0
  8. package/dist/cli/web/scheduler/email_triage_agent.d.ts.map +1 -0
  9. package/dist/cli/web/scheduler/email_triage_agent.js +93 -0
  10. package/dist/cli/web/scheduler.d.ts.map +1 -1
  11. package/dist/cli/web/scheduler.js +2 -0
  12. package/dist/cli/web/voice_backend.d.ts +4 -0
  13. package/dist/cli/web/voice_backend.d.ts.map +1 -1
  14. package/dist/cli/web/voice_backend.js +14 -3
  15. package/dist/cli/web/voice_builtin.d.ts.map +1 -1
  16. package/dist/cli/web/voice_builtin.js +32 -13
  17. package/dist/cli/web/voice_proxy.d.ts +3 -0
  18. package/dist/cli/web/voice_proxy.d.ts.map +1 -1
  19. package/dist/cli/web/voice_proxy.js +28 -3
  20. package/dist/harness/tools/builtin/email_tools.d.ts +1 -0
  21. package/dist/harness/tools/builtin/email_tools.d.ts.map +1 -1
  22. package/dist/harness/tools/builtin/email_tools.js +41 -1
  23. package/dist/harness/tools/builtin/index.d.ts +2 -2
  24. package/dist/harness/tools/builtin/index.d.ts.map +1 -1
  25. package/dist/harness/tools/builtin/index.js +3 -2
  26. package/dist/harness/tools/builtin/set_workspace.d.ts.map +1 -1
  27. package/dist/harness/tools/builtin/set_workspace.js +26 -4
  28. package/dist/lib/email.d.ts +20 -0
  29. package/dist/lib/email.d.ts.map +1 -1
  30. package/dist/lib/email.js +106 -33
  31. package/dist/session/store.d.ts +2 -2
  32. package/dist/session/store.d.ts.map +1 -1
  33. package/dist/session/store.js +5 -2
  34. package/dist/session/types.d.ts +2 -1
  35. package/dist/session/types.d.ts.map +1 -1
  36. package/dist/store/db.d.ts.map +1 -1
  37. package/dist/store/db.js +3 -1
  38. package/dist/voice/pocket/install.d.ts +16 -2
  39. package/dist/voice/pocket/install.d.ts.map +1 -1
  40. package/dist/voice/pocket/install.js +59 -5
  41. package/dist/voice/pronunciation.d.ts.map +1 -1
  42. package/dist/voice/pronunciation.js +3 -0
  43. package/dist/voice/whisper/catalog.d.ts +15 -0
  44. package/dist/voice/whisper/catalog.d.ts.map +1 -0
  45. package/dist/voice/whisper/catalog.js +53 -0
  46. package/dist/voice/whisper/decoder.d.ts +3 -0
  47. package/dist/voice/whisper/decoder.d.ts.map +1 -0
  48. package/dist/voice/whisper/decoder.js +48 -0
  49. package/dist/voice/whisper/engine.d.ts +8 -0
  50. package/dist/voice/whisper/engine.d.ts.map +1 -0
  51. package/dist/voice/whisper/engine.js +77 -0
  52. package/dist/voice/whisper/features.d.ts +10 -0
  53. package/dist/voice/whisper/features.d.ts.map +1 -0
  54. package/dist/voice/whisper/features.js +149 -0
  55. package/dist/voice/whisper/inference.d.ts +17 -0
  56. package/dist/voice/whisper/inference.d.ts.map +1 -0
  57. package/dist/voice/whisper/inference.js +257 -0
  58. package/dist/voice/whisper/wav.d.ts +5 -0
  59. package/dist/voice/whisper/wav.d.ts.map +1 -0
  60. package/dist/voice/whisper/wav.js +48 -0
  61. package/dist/webview/standalone.js +1114 -689
  62. package/dist/webview/standalone.js.map +4 -4
  63. 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);
@@ -19849,6 +19849,32 @@ Please report this to https://github.com/markedjs/marked.`, e) {
19849
19849
 
19850
19850
  // src/ServicesTab.tsx
19851
19851
  var import_react14 = __toESM(require_react(), 1);
19852
+
19853
+ // src/services_form_utils.ts
19854
+ function triageAccountOptions(services, agentId) {
19855
+ return services.filter(
19856
+ (s) => s.type === "email" && s.enabled && !!s.imapHost && !!s.smtpHost && (!s.allowedAgents?.length || s.allowedAgents.includes(agentId))
19857
+ );
19858
+ }
19859
+ function splitRecipients(raw) {
19860
+ return (raw || "").split(/[,\n;]/).map((r) => r.trim()).filter(Boolean);
19861
+ }
19862
+ function triageFormError(f, accounts) {
19863
+ if (!f.agentId) return "Please select an agent for this service.";
19864
+ if (f.cron.trim().split(/\s+/).filter(Boolean).length !== 5) {
19865
+ return 'Invalid cron expression. It must contain exactly 5 space-separated fields (e.g. "*/15 * * * *").';
19866
+ }
19867
+ if (!f.accountId) return "Select the email account to triage.";
19868
+ if (!accounts.some((a2) => a2.id === f.accountId)) {
19869
+ return "The selected email account is not available (it must be enabled, have IMAP and SMTP, and be open to the selected agent).";
19870
+ }
19871
+ if (splitRecipients(f.recipients).length === 0) return "Add at least one recipient for the triage report.";
19872
+ const n = Number(f.maxEmails);
19873
+ if (!/^\d+$/.test(f.maxEmails.trim()) || n < 1 || n > 50) return "Max emails must be a whole number between 1 and 50.";
19874
+ return null;
19875
+ }
19876
+
19877
+ // src/ServicesTab.tsx
19852
19878
  var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
19853
19879
  function closeStreamingAssistant(items) {
19854
19880
  const last = items[items.length - 1];
@@ -19934,6 +19960,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
19934
19960
  const [allowedSenders, setAllowedSenders] = (0, import_react14.useState)("");
19935
19961
  const [allowedRecipients, setAllowedRecipients] = (0, import_react14.useState)("");
19936
19962
  const [allowedAgents, setAllowedAgents] = (0, import_react14.useState)([]);
19963
+ const [triageAccountId, setTriageAccountId] = (0, import_react14.useState)("");
19964
+ const [triageRecipients, setTriageRecipients] = (0, import_react14.useState)("");
19965
+ const [triageMaxEmails, setTriageMaxEmails] = (0, import_react14.useState)("50");
19966
+ const [triageSubjectPrefix, setTriageSubjectPrefix] = (0, import_react14.useState)("");
19937
19967
  const [errorMsg, setErrorMsg] = (0, import_react14.useState)(null);
19938
19968
  const startEdit = (task) => {
19939
19969
  setEditingTask(task);
@@ -19961,6 +19991,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
19961
19991
  setAllowedSenders(task.allowedSenders || "");
19962
19992
  setAllowedRecipients(task.allowedRecipients || "");
19963
19993
  setAllowedAgents(task.allowedAgents || []);
19994
+ setTriageAccountId(task.triageAccountId || "");
19995
+ setTriageRecipients(task.triageRecipients || "");
19996
+ setTriageMaxEmails(task.triageMaxEmails ? String(task.triageMaxEmails) : "50");
19997
+ setTriageSubjectPrefix(task.triageSubjectPrefix || "");
19964
19998
  setErrorMsg(null);
19965
19999
  };
19966
20000
  const startCreate = () => {
@@ -19989,6 +20023,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
19989
20023
  setAllowedSenders("");
19990
20024
  setAllowedRecipients("");
19991
20025
  setAllowedAgents([]);
20026
+ setTriageAccountId("");
20027
+ setTriageRecipients("");
20028
+ setTriageMaxEmails("50");
20029
+ setTriageSubjectPrefix("");
19992
20030
  setErrorMsg(null);
19993
20031
  };
19994
20032
  const cancelForm = () => {
@@ -20026,6 +20064,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
20026
20064
  setErrorMsg('Invalid cron expression. It must contain exactly 5 space-separated fields (e.g. "*/15 * * * *").');
20027
20065
  return;
20028
20066
  }
20067
+ } else if (type === "email_triage") {
20068
+ const err = triageFormError(
20069
+ { agentId, cron: trimmedCron, accountId: triageAccountId, recipients: triageRecipients, maxEmails: triageMaxEmails },
20070
+ triageAccountOptions(tasks, agentId)
20071
+ );
20072
+ if (err) {
20073
+ setErrorMsg(err);
20074
+ return;
20075
+ }
20029
20076
  } else if (type === "telegram") {
20030
20077
  if (!telegramBotToken.trim()) {
20031
20078
  setErrorMsg("Telegram Bot Token is required.");
@@ -20075,6 +20122,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
20075
20122
  telegramBotToken: telegramBotToken.trim(),
20076
20123
  telegramAllowedChats: telegramAllowedChats.trim()
20077
20124
  } : {},
20125
+ ...type === "email_triage" ? {
20126
+ triageAccountId,
20127
+ triageRecipients: triageRecipients.trim(),
20128
+ triageMaxEmails: Number(triageMaxEmails),
20129
+ triageSubjectPrefix: triageSubjectPrefix.trim()
20130
+ } : {},
20078
20131
  ...type === "email" ? {
20079
20132
  imapHost: imapHost.trim(),
20080
20133
  imapPort: Number(imapPort),
@@ -20200,7 +20253,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
20200
20253
  children: [
20201
20254
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "heartbeat", children: "Heartbeat (Scheduled Agent Run)" }),
20202
20255
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "telegram", children: "Telegram Bot (Poller)" }),
20203
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "email", children: "Email (IMAP credentials)" })
20256
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "email", children: "Email (IMAP credentials)" }),
20257
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "email_triage", children: "Email triage (Scheduled Report)" })
20204
20258
  ]
20205
20259
  }
20206
20260
  )
@@ -20294,6 +20348,134 @@ Please report this to https://github.com/markedjs/marked.`, e) {
20294
20348
  }
20295
20349
  )
20296
20350
  ] })
20351
+ ] }) : type === "email_triage" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
20352
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
20353
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: "task-cron", children: "Cron Timing" }),
20354
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
20355
+ "input",
20356
+ {
20357
+ id: "task-cron",
20358
+ type: "text",
20359
+ placeholder: "e.g. 0 8 * * * (every morning at 8)",
20360
+ value: cron,
20361
+ onChange: (e) => setCron(e.target.value)
20362
+ }
20363
+ )
20364
+ ] }),
20365
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
20366
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: "triage-account", children: "Email account" }),
20367
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
20368
+ "select",
20369
+ {
20370
+ id: "triage-account",
20371
+ value: triageAccountId,
20372
+ onChange: (e) => setTriageAccountId(e.target.value),
20373
+ style: {
20374
+ width: "100%",
20375
+ padding: "6px 8px",
20376
+ borderRadius: "var(--radius-sm)",
20377
+ background: "var(--vscode-dropdown-background, #252526)",
20378
+ color: "var(--vscode-dropdown-foreground, #cccccc)",
20379
+ border: "1px solid var(--vscode-dropdown-border, #3c3c3c)",
20380
+ fontSize: "12px",
20381
+ cursor: "pointer"
20382
+ },
20383
+ children: [
20384
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", disabled: true, children: "-- Select account --" }),
20385
+ triageAccountOptions(tasks, agentId).map((a2) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: a2.id, children: a2.name }, a2.id))
20386
+ ]
20387
+ }
20388
+ ),
20389
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "field-hint", style: { fontSize: "11px", opacity: 0.8, marginTop: "4px" }, children: "Only enabled email services with both IMAP and SMTP configured are listed." })
20390
+ ] }),
20391
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
20392
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: "triage-recipients", children: "Report recipients (one per line)" }),
20393
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
20394
+ "textarea",
20395
+ {
20396
+ id: "triage-recipients",
20397
+ placeholder: "you@example.com",
20398
+ value: triageRecipients,
20399
+ onChange: (e) => setTriageRecipients(e.target.value),
20400
+ rows: 3,
20401
+ style: {
20402
+ width: "100%",
20403
+ padding: "8px",
20404
+ borderRadius: "var(--radius-sm)",
20405
+ background: "var(--vscode-input-background, #252526)",
20406
+ color: "var(--vscode-input-foreground, #cccccc)",
20407
+ border: "1px solid var(--vscode-input-border, #3c3c3c)",
20408
+ fontFamily: "inherit",
20409
+ fontSize: "12px",
20410
+ resize: "vertical"
20411
+ }
20412
+ }
20413
+ )
20414
+ ] }),
20415
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
20416
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: "triage-max", children: "Max emails per run (1-50)" }),
20417
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
20418
+ "input",
20419
+ {
20420
+ id: "triage-max",
20421
+ type: "number",
20422
+ min: 1,
20423
+ max: 50,
20424
+ value: triageMaxEmails,
20425
+ onChange: (e) => setTriageMaxEmails(e.target.value)
20426
+ }
20427
+ )
20428
+ ] }),
20429
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
20430
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: "triage-prefix", children: "Subject prefix (optional)" }),
20431
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
20432
+ "input",
20433
+ {
20434
+ id: "triage-prefix",
20435
+ type: "text",
20436
+ placeholder: "[Email Triage]",
20437
+ value: triageSubjectPrefix,
20438
+ onChange: (e) => setTriageSubjectPrefix(e.target.value)
20439
+ }
20440
+ )
20441
+ ] }),
20442
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
20443
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: "task-dir", children: "Working Directory (Absolute path, optional)" }),
20444
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
20445
+ "input",
20446
+ {
20447
+ id: "task-dir",
20448
+ type: "text",
20449
+ placeholder: "e.g. /home/user/project (default: process.cwd())",
20450
+ value: workingDir,
20451
+ onChange: (e) => setWorkingDir(e.target.value)
20452
+ }
20453
+ )
20454
+ ] }),
20455
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
20456
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: "task-prompt", children: "Extra triage instructions (optional)" }),
20457
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
20458
+ "textarea",
20459
+ {
20460
+ id: "task-prompt",
20461
+ placeholder: "e.g. Treat anything from our main client as urgent.",
20462
+ value: prompt,
20463
+ onChange: (e) => setPrompt(e.target.value),
20464
+ rows: 4,
20465
+ style: {
20466
+ width: "100%",
20467
+ padding: "8px",
20468
+ borderRadius: "var(--radius-sm)",
20469
+ background: "var(--vscode-input-background, #252526)",
20470
+ color: "var(--vscode-input-foreground, #cccccc)",
20471
+ border: "1px solid var(--vscode-input-border, #3c3c3c)",
20472
+ fontFamily: "inherit",
20473
+ fontSize: "12px",
20474
+ resize: "vertical"
20475
+ }
20476
+ }
20477
+ )
20478
+ ] })
20297
20479
  ] }) : type === "telegram" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
20298
20480
  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
20299
20481
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: "tg-token", children: "Telegram Bot Token" }),
@@ -20639,6 +20821,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
20639
20821
  task.imapPort,
20640
20822
  task.smtpHost ? ` \xB7 SMTP ${task.smtpHost}:${task.smtpPort}` : " \xB7 sending off",
20641
20823
  task.allowedAgents?.length ? ` \xB7 agents: ${task.allowedAgents.map((id) => agents.find((a2) => a2.id === id)?.name || id).join(", ")}` : " \xB7 any agent"
20824
+ ] }) : task.type === "email_triage" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "settings-card__subtitle", style: { fontSize: "11px", marginTop: "4px" }, children: [
20825
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "Agent:" }),
20826
+ " ",
20827
+ agentName,
20828
+ " \xB7 ",
20829
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "Schedule:" }),
20830
+ " ",
20831
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("code", { children: task.cron }),
20832
+ " \xB7 ",
20833
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "Account:" }),
20834
+ " ",
20835
+ tasks.find((t) => t.id === task.triageAccountId)?.name || "missing",
20836
+ " \xB7",
20837
+ " ",
20838
+ splitRecipients(task.triageRecipients).length,
20839
+ " recipient(s)"
20642
20840
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
20643
20841
  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "settings-card__subtitle", style: { fontSize: "11px", marginTop: "4px" }, children: [
20644
20842
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "Agent:" }),
@@ -20657,7 +20855,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
20657
20855
  ] })
20658
20856
  ] }),
20659
20857
  /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "settings-card__actions", children: [
20660
- task.type === "heartbeat" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
20858
+ (task.type === "heartbeat" || task.type === "email_triage") && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
20661
20859
  "button",
20662
20860
  {
20663
20861
  className: "icon-btn",
@@ -20774,7 +20972,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
20774
20972
  }
20775
20973
 
20776
20974
  // src/VoiceTab.tsx
20777
- var import_react17 = __toESM(require_react(), 1);
20975
+ var import_react18 = __toESM(require_react(), 1);
20778
20976
 
20779
20977
  // src/voice_utils.ts
20780
20978
  var END_OF_TURN_MS = 1200;
@@ -20839,6 +21037,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
20839
21037
  v2.lang ?? "",
20840
21038
  v2.autoStartBackend === true,
20841
21039
  v2.ttsEngine ?? "",
21040
+ v2.sttEngine ?? "",
21041
+ v2.sttBuiltinModel ?? "",
20842
21042
  v2.ttsLanguage ?? "",
20843
21043
  v2.pronunciationEnabled === true,
20844
21044
  v2.pronunciation ?? null,
@@ -21157,8 +21357,135 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21157
21357
  ] });
21158
21358
  }
21159
21359
 
21160
- // src/PronunciationTable.tsx
21360
+ // src/BuiltinSttBlock.tsx
21361
+ var import_react17 = __toESM(require_react(), 1);
21161
21362
  var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
21363
+ var MB2 = 1024 * 1024;
21364
+ function sizeLabel2(bytes) {
21365
+ return `${Math.max(1, Math.round(bytes / MB2))} MB`;
21366
+ }
21367
+ function BuiltinSttBlock({ status, onStatusChange, model, onModelChange }) {
21368
+ const [busy, setBusy] = (0, import_react17.useState)(false);
21369
+ const [progress, setProgress] = (0, import_react17.useState)(null);
21370
+ const [error, setError] = (0, import_react17.useState)(null);
21371
+ const [confirmingDelete, setConfirmingDelete] = (0, import_react17.useState)(false);
21372
+ const loadError = status.runtime.loadError;
21373
+ const selected = status.stt.find((m2) => m2.id === model);
21374
+ const query = `?stt=${encodeURIComponent(model)}`;
21375
+ const install = async () => {
21376
+ setBusy(true);
21377
+ setError(null);
21378
+ setProgress("Starting\u2026");
21379
+ try {
21380
+ const res = await fetch(`/api/voice/builtin/install${query}`, { method: "POST" });
21381
+ if (!res.ok || !res.body) {
21382
+ setError(await res.text().catch(() => "") || "Install failed.");
21383
+ return;
21384
+ }
21385
+ const reader = res.body.getReader();
21386
+ const decoder = new TextDecoder();
21387
+ let buffer = "";
21388
+ for (; ; ) {
21389
+ const { done, value } = await reader.read();
21390
+ if (done) break;
21391
+ const { lines, remainder } = splitNdjsonLines(buffer, decoder.decode(value, { stream: true }));
21392
+ buffer = remainder;
21393
+ for (const line of lines) {
21394
+ let p;
21395
+ try {
21396
+ p = JSON.parse(line);
21397
+ } catch {
21398
+ continue;
21399
+ }
21400
+ if (p.step === "done") onStatusChange(p.status);
21401
+ else if (p.step === "error") setError(p.message);
21402
+ else {
21403
+ const pct = p.total > 0 ? ` ${Math.floor(p.received / p.total * 100)}%` : "";
21404
+ setProgress(`${p.step === "runtime" ? "Runtime" : "Model"}: ${p.file}${pct}`);
21405
+ }
21406
+ }
21407
+ }
21408
+ } catch (err) {
21409
+ setError(err instanceof Error ? err.message : String(err));
21410
+ } finally {
21411
+ setBusy(false);
21412
+ setProgress(null);
21413
+ }
21414
+ };
21415
+ const remove = async () => {
21416
+ setConfirmingDelete(false);
21417
+ setBusy(true);
21418
+ setError(null);
21419
+ try {
21420
+ const res = await fetch(`/api/voice/builtin/delete${query}`, { method: "POST" });
21421
+ if (res.ok) onStatusChange(await res.json());
21422
+ else setError(await res.text().catch(() => "") || "Delete failed.");
21423
+ } catch (err) {
21424
+ setError(err instanceof Error ? err.message : String(err));
21425
+ } finally {
21426
+ setBusy(false);
21427
+ }
21428
+ };
21429
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "form-group", children: [
21430
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { htmlFor: "voice-builtin-stt", children: [
21431
+ "Built-in transcription",
21432
+ " ",
21433
+ loadError ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("em", { children: "(not available on this system)" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("em", { children: "(Whisper)" })
21434
+ ] }),
21435
+ loadError ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { className: "form-error", children: loadError }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
21436
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21437
+ "select",
21438
+ {
21439
+ id: "voice-builtin-stt",
21440
+ value: model,
21441
+ onChange: (e) => {
21442
+ onModelChange(e.target.value);
21443
+ setConfirmingDelete(false);
21444
+ },
21445
+ children: status.stt.map((m2) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("option", { value: m2.id, children: [
21446
+ m2.id,
21447
+ m2.id === "base" ? " (recommended)" : "",
21448
+ " \u2014",
21449
+ " ",
21450
+ m2.installed ? "installed" : `not installed, ${sizeLabel2(m2.bytes)}`
21451
+ ] }, m2.id))
21452
+ }
21453
+ ),
21454
+ selected && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "voice-backend-status", children: [
21455
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: progress ?? (selected.installed ? `Installed (${sizeLabel2(selected.bytes)})` : `Not installed \u2014 downloads ${sizeLabel2(selected.bytes)}`) }),
21456
+ !selected.installed && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: install, disabled: busy, children: busy ? "Installing\u2026" : "Install" }),
21457
+ selected.installed && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21458
+ "button",
21459
+ {
21460
+ type: "button",
21461
+ onClick: confirmingDelete ? remove : () => setConfirmingDelete(true),
21462
+ disabled: busy,
21463
+ children: confirmingDelete ? "Really delete?" : "Delete"
21464
+ }
21465
+ )
21466
+ ] }),
21467
+ error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { className: "form-error", children: error }),
21468
+ /* @__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." })
21469
+ ] }),
21470
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
21471
+ "Whisper by OpenAI (MIT), ONNX export by",
21472
+ " ",
21473
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21474
+ "a",
21475
+ {
21476
+ href: `https://huggingface.co/onnx-community/whisper-${model || "base"}`,
21477
+ target: "_blank",
21478
+ rel: "noreferrer",
21479
+ children: "onnx-community"
21480
+ }
21481
+ ),
21482
+ "."
21483
+ ] })
21484
+ ] });
21485
+ }
21486
+
21487
+ // src/PronunciationTable.tsx
21488
+ var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
21162
21489
  function PronunciationTable({
21163
21490
  code,
21164
21491
  entries,
@@ -21171,9 +21498,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21171
21498
  listenError
21172
21499
  }) {
21173
21500
  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)(
21501
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group", children: [
21502
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "form-group--checkbox", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { htmlFor: "voice-pron-enabled", children: [
21503
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21177
21504
  "input",
21178
21505
  {
21179
21506
  id: "voice-pron-enabled",
@@ -21184,14 +21511,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21184
21511
  ),
21185
21512
  "Pronunciation dictionary"
21186
21513
  ] }) }),
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: [
21514
+ 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: [
21515
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("small", { children: [
21189
21516
  "Words below are respelled before synthesis (whole word, case-insensitive, longest first) for language ",
21190
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("code", { children: code }),
21517
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("code", { children: code }),
21191
21518
  ". Listen uses the unsaved form."
21192
21519
  ] }),
21193
- entries.map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "voice-backend-status", children: [
21194
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21520
+ entries.map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "voice-backend-status", children: [
21521
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21195
21522
  "input",
21196
21523
  {
21197
21524
  type: "text",
@@ -21201,7 +21528,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21201
21528
  onChange: (ev) => update(i, { term: ev.target.value })
21202
21529
  }
21203
21530
  ),
21204
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21531
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21205
21532
  "input",
21206
21533
  {
21207
21534
  type: "text",
@@ -21211,7 +21538,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21211
21538
  onChange: (ev) => update(i, { say: ev.target.value })
21212
21539
  }
21213
21540
  ),
21214
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21541
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21215
21542
  "button",
21216
21543
  {
21217
21544
  type: "button",
@@ -21220,14 +21547,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21220
21547
  children: "Listen"
21221
21548
  }
21222
21549
  ),
21223
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => onChange(entries.filter((_2, j) => j !== i)), children: "Remove" })
21550
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", onClick: () => onChange(entries.filter((_2, j) => j !== i)), children: "Remove" })
21224
21551
  ] }, 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" })
21552
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "voice-backend-status", children: [
21553
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", onClick: () => onChange([...entries, { term: "", say: "" }]), children: "Add word" }),
21554
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", onClick: onRestoreDefaults, children: "Restore defaults" })
21228
21555
  ] })
21229
21556
  ] }),
21230
- listenError && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { className: "form-error", children: [
21557
+ listenError && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("small", { className: "form-error", children: [
21231
21558
  "Listen failed: ",
21232
21559
  listenError
21233
21560
  ] })
@@ -21293,7 +21620,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21293
21620
  return playBuffered(res, signal);
21294
21621
  }
21295
21622
  async function playPcm(res, signal, fmt, buffer) {
21296
- const ctx = new AudioContext();
21623
+ const ctx = new AudioContext({ sampleRate: fmt.rate });
21297
21624
  const reader = res.body.getReader();
21298
21625
  const sources = [];
21299
21626
  const onAbort = () => {
@@ -21314,6 +21641,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21314
21641
  let rest = new Float32Array(0);
21315
21642
  let cursor = 0;
21316
21643
  let last = null;
21644
+ let chunks = 0;
21645
+ let dry = 0;
21317
21646
  for (; ; ) {
21318
21647
  const { done, value } = await reader.read();
21319
21648
  if (signal.aborted) return;
@@ -21338,13 +21667,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21338
21667
  const src = ctx.createBufferSource();
21339
21668
  src.buffer = buf;
21340
21669
  src.connect(ctx.destination);
21341
- const at2 = nextStart(ctx.currentTime, cursor, buffer);
21670
+ const now = ctx.currentTime;
21671
+ const at2 = nextStart(now, cursor, buffer);
21672
+ if (chunks > 0 && at2 !== cursor) {
21673
+ dry++;
21674
+ console.warn(
21675
+ `[voice] playback ran dry before chunk ${chunks}: ${Math.round((now - cursor) * 1e3)} ms late, re-buffering ${Math.round(buffer * 1e3)} ms`
21676
+ );
21677
+ }
21678
+ chunks++;
21342
21679
  src.start(at2);
21343
21680
  cursor = at2 + buf.duration;
21344
21681
  sources.push(src);
21345
21682
  last = src;
21346
21683
  }
21347
21684
  if (!last) return;
21685
+ if (dry > 0) console.warn(`[voice] ${dry} of ${chunks} chunks arrived after the audio ran dry`);
21348
21686
  const latency = (ctx.outputLatency || 0) + (ctx.baseLatency || 0);
21349
21687
  const remainingMs = Math.max(0, (cursor - ctx.currentTime + latency) * 1e3);
21350
21688
  await new Promise((resolve) => {
@@ -21456,6 +21794,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21456
21794
  const id = pocketLanguageFor(lang, status);
21457
21795
  const entry = status.languages.find((l) => l.id === id);
21458
21796
  return {
21797
+ sttEngine: "builtin",
21798
+ sttBuiltinModel: "base",
21459
21799
  ttsEngine: "builtin",
21460
21800
  ttsLanguage: id,
21461
21801
  ttsVoice: entry?.nativeVoice ?? status.voices[0] ?? "",
@@ -21463,11 +21803,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21463
21803
  };
21464
21804
  }
21465
21805
  function edgePreset() {
21466
- return { ...EDGE_TTS_DEFAULTS, ttsEngine: "endpoint", pronunciationEnabled: false };
21806
+ return { ...EDGE_TTS_DEFAULTS, sttEngine: "endpoint", ttsEngine: "endpoint", pronunciationEnabled: false };
21467
21807
  }
21468
21808
  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) };
21809
+ const stt = { enabled: true, sttEngine: "endpoint", endpoint: LOCAL_DEFAULTS.endpoint, sttModel: LOCAL_DEFAULTS.sttModel };
21810
+ if (status && !status.runtime.loadError) return { ...stt, ...builtinPreset(lang, status), sttEngine: "endpoint" };
21471
21811
  return {
21472
21812
  ...stt,
21473
21813
  ttsEngine: "endpoint",
@@ -21477,7 +21817,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21477
21817
  }
21478
21818
 
21479
21819
  // src/VoiceTab.tsx
21480
- var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
21820
+ var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
21481
21821
  function parsedBufferMs(v2) {
21482
21822
  const n = Number.parseInt(v2, 10);
21483
21823
  return Number.isFinite(n) ? Math.min(Math.max(n, 0), MAX_PLAYBACK_BUFFER_MS) : void 0;
@@ -21499,37 +21839,39 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21499
21839
  }
21500
21840
  function VoiceTab({ config, onSave, postMessage, sttCatalogResult, ttsCatalogResult }) {
21501
21841
  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)(
21842
+ const [enabled, setEnabled] = (0, import_react18.useState)(current.enabled);
21843
+ const [endpoint, setEndpoint] = (0, import_react18.useState)(current.endpoint);
21844
+ const [apiKey, setApiKey] = (0, import_react18.useState)(current.apiKey ?? "");
21845
+ const [sttModel, setSttModel] = (0, import_react18.useState)(current.sttModel);
21846
+ const [ttsEndpoint, setTtsEndpoint] = (0, import_react18.useState)(current.ttsEndpoint ?? "");
21847
+ const [ttsApiKey, setTtsApiKey] = (0, import_react18.useState)(current.ttsApiKey ?? "");
21848
+ const [ttsModel, setTtsModel] = (0, import_react18.useState)(current.ttsModel ?? "");
21849
+ const [ttsVoice, setTtsVoice] = (0, import_react18.useState)(current.ttsVoice ?? "");
21850
+ const [ttsSpeed, setTtsSpeed] = (0, import_react18.useState)(
21511
21851
  current.ttsSpeed === void 0 ? "" : String(current.ttsSpeed)
21512
21852
  );
21513
- const [lang, setLang] = (0, import_react17.useState)(current.lang ?? "");
21514
- const [bufferMs, setBufferMs] = (0, import_react17.useState)(
21853
+ const [lang, setLang] = (0, import_react18.useState)(current.lang ?? "");
21854
+ const [bufferMs, setBufferMs] = (0, import_react18.useState)(
21515
21855
  current.playbackBufferMs === void 0 ? "" : String(current.playbackBufferMs)
21516
21856
  );
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)(
21857
+ const [ttsEngine, setTtsEngine] = (0, import_react18.useState)(current.ttsEngine ?? "endpoint");
21858
+ const [sttEngine, setSttEngine] = (0, import_react18.useState)(current.sttEngine ?? "endpoint");
21859
+ const [sttBuiltinModel, setSttBuiltinModel] = (0, import_react18.useState)(current.sttBuiltinModel ?? "base");
21860
+ const [ttsLanguage, setTtsLanguage] = (0, import_react18.useState)(current.ttsLanguage ?? "");
21861
+ const [pronEnabled, setPronEnabled] = (0, import_react18.useState)(current.pronunciationEnabled ?? false);
21862
+ const [pronunciation, setPronunciation] = (0, import_react18.useState)(
21521
21863
  current.pronunciation ?? {}
21522
21864
  );
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);
21865
+ const [builtinStatus, setBuiltinStatus] = (0, import_react18.useState)(null);
21866
+ const [listening, setListening] = (0, import_react18.useState)(false);
21867
+ const [listenError, setListenError] = (0, import_react18.useState)(null);
21868
+ const listenAbort = (0, import_react18.useRef)(null);
21869
+ const [fetching, setFetching] = (0, import_react18.useState)(false);
21870
+ const [fetchingTts, setFetchingTts] = (0, import_react18.useState)(false);
21871
+ const [saveState, setSaveState] = (0, import_react18.useState)("idle");
21872
+ const pendingSave = (0, import_react18.useRef)(null);
21873
+ const [autoStartBackend, setAutoStartBackend] = (0, import_react18.useState)(current.autoStartBackend ?? false);
21874
+ const [backendStatuses, setBackendStatuses] = (0, import_react18.useState)(null);
21533
21875
  const fetchBackendStatuses = async () => {
21534
21876
  try {
21535
21877
  const res = await fetch("/api/voice/backend");
@@ -21539,12 +21881,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21539
21881
  } catch {
21540
21882
  }
21541
21883
  };
21542
- (0, import_react17.useEffect)(() => {
21884
+ (0, import_react18.useEffect)(() => {
21543
21885
  fetch("/api/voice/builtin").then((res) => res.ok ? res.json() : null).then((st2) => st2 && setBuiltinStatus(st2)).catch(() => {
21544
21886
  });
21545
21887
  return () => listenAbort.current?.abort();
21546
21888
  }, []);
21547
- (0, import_react17.useEffect)(() => {
21889
+ (0, import_react18.useEffect)(() => {
21548
21890
  fetchBackendStatuses();
21549
21891
  const interval = setInterval(fetchBackendStatuses, BACKEND_POLL_MS);
21550
21892
  return () => clearInterval(interval);
@@ -21554,23 +21896,23 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21554
21896
  (prev) => prev ? { ...prev, [target]: status } : { stt: status, tts: null }
21555
21897
  );
21556
21898
  };
21557
- (0, import_react17.useEffect)(() => {
21899
+ (0, import_react18.useEffect)(() => {
21558
21900
  if (sttCatalogResult) setFetching(false);
21559
21901
  }, [sttCatalogResult]);
21560
- (0, import_react17.useEffect)(() => {
21902
+ (0, import_react18.useEffect)(() => {
21561
21903
  if (ttsCatalogResult) setFetchingTts(false);
21562
21904
  }, [ttsCatalogResult]);
21563
- (0, import_react17.useEffect)(() => {
21905
+ (0, import_react18.useEffect)(() => {
21564
21906
  if (saveState !== "saving" || pendingSave.current === null) return;
21565
21907
  if (voiceSignature(config.voice) !== pendingSave.current) return;
21566
21908
  setSaveState("saved");
21567
21909
  }, [config.voice, saveState]);
21568
- (0, import_react17.useEffect)(() => {
21910
+ (0, import_react18.useEffect)(() => {
21569
21911
  if (saveState !== "saved") return;
21570
21912
  const clear = setTimeout(() => setSaveState("idle"), 2500);
21571
21913
  return () => clearTimeout(clear);
21572
21914
  }, [saveState]);
21573
- (0, import_react17.useEffect)(() => {
21915
+ (0, import_react18.useEffect)(() => {
21574
21916
  if (saveState !== "saving") return;
21575
21917
  const giveUp = setTimeout(() => setSaveState("idle"), 6e3);
21576
21918
  return () => clearTimeout(giveUp);
@@ -21603,6 +21945,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21603
21945
  if (p.enabled !== void 0) setEnabled(p.enabled);
21604
21946
  if (p.endpoint !== void 0) setEndpoint(p.endpoint);
21605
21947
  if (p.sttModel !== void 0) setSttModel(p.sttModel);
21948
+ if (p.sttEngine !== void 0) setSttEngine(p.sttEngine);
21949
+ if (p.sttBuiltinModel !== void 0) setSttBuiltinModel(p.sttBuiltinModel);
21606
21950
  if (p.ttsEngine !== void 0) setTtsEngine(p.ttsEngine);
21607
21951
  if (p.ttsLanguage !== void 0) setTtsLanguage(p.ttsLanguage);
21608
21952
  if (p.ttsEndpoint !== void 0) setTtsEndpoint(p.ttsEndpoint);
@@ -21611,7 +21955,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21611
21955
  if (p.pronunciationEnabled !== void 0) setPronEnabled(p.pronunciationEnabled);
21612
21956
  };
21613
21957
  const builtin = ttsEngine === "builtin";
21614
- const synthCode = (0, import_react17.useMemo)(() => {
21958
+ const sttBuiltin = sttEngine === "builtin" && !!builtinStatus;
21959
+ const showEndpoint = !sttBuiltin || !builtin;
21960
+ const synthCode = (0, import_react18.useMemo)(() => {
21615
21961
  if (builtin) return builtinStatus?.languages.find((l) => l.id === ttsLanguage)?.code ?? null;
21616
21962
  return lang.trim().split(/[-_]/)[0].toLowerCase() || null;
21617
21963
  }, [builtin, builtinStatus, ttsLanguage, lang]);
@@ -21670,6 +22016,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21670
22016
  const buf = parsedBufferMs(bufferMs);
21671
22017
  if (buf !== void 0) voice.playbackBufferMs = buf;
21672
22018
  if (autoStartBackend) voice.autoStartBackend = true;
22019
+ if (sttEngine === "builtin") {
22020
+ voice.sttEngine = "builtin";
22021
+ voice.sttBuiltinModel = sttBuiltinModel;
22022
+ }
21673
22023
  if (builtin) {
21674
22024
  voice.ttsEngine = "builtin";
21675
22025
  if (ttsLanguage) voice.ttsLanguage = ttsLanguage;
@@ -21686,18 +22036,18 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21686
22036
  };
21687
22037
  const showSttBackend = backendStatuses !== null && backendStatuses.stt.docker !== "absent" && backendStatuses.stt.port !== null;
21688
22038
  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)" }),
22039
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "glass-form", children: [
22040
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h4", { children: "Voice" }),
22041
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "glass-form__body", children: [
22042
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22043
+ 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
22044
  " ",
21695
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", onClick: () => applyPreset(localDefaultsPreset(lang, builtinStatus)), children: "Use local defaults" }),
22045
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: () => applyPreset(localDefaultsPreset(lang, builtinStatus)), children: "Use local defaults" }),
21696
22046
  " ",
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." })
22047
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: () => applyPreset(edgePreset()), children: "Use Microsoft Edge voices" }),
22048
+ /* @__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
22049
  ] }),
21700
- showSttBackend && backendStatuses && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
22050
+ showSttBackend && backendStatuses && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21701
22051
  VoiceBackendBlock,
21702
22052
  {
21703
22053
  target: "stt",
@@ -21707,7 +22057,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21707
22057
  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
22058
  }
21709
22059
  ),
21710
- showTtsBackend && backendStatuses?.tts && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
22060
+ showTtsBackend && backendStatuses?.tts && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21711
22061
  VoiceBackendBlock,
21712
22062
  {
21713
22063
  target: "tts",
@@ -21717,9 +22067,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21717
22067
  hint: "A small image. The container publishes on the port in your synthesis endpoint. Delete removes the container; the image stays cached."
21718
22068
  }
21719
22069
  ),
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)(
22070
+ (showSttBackend || showTtsBackend) && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group form-group--checkbox", children: [
22071
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("label", { htmlFor: "voice-backend-autostart", children: [
22072
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21723
22073
  "input",
21724
22074
  {
21725
22075
  id: "voice-backend-autostart",
@@ -21730,10 +22080,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21730
22080
  ),
21731
22081
  "Start automatically with caretaker"
21732
22082
  ] }),
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." })
22083
+ /* @__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
22084
  ] }),
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)(
22085
+ /* @__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: [
22086
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21737
22087
  "input",
21738
22088
  {
21739
22089
  id: "voice-enabled",
@@ -21744,89 +22094,117 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21744
22094
  ),
21745
22095
  "Enable voice mode"
21746
22096
  ] }) }),
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)(
22097
+ builtinStatus && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22098
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-stt-engine", children: "Transcription engine" }),
22099
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
21793
22100
  "select",
21794
22101
  {
21795
- id: "voice-stt",
21796
- value: sttModel,
21797
- onChange: (e) => setSttModel(e.target.value),
22102
+ id: "voice-stt-engine",
22103
+ value: sttEngine,
22104
+ onChange: (e) => setSttEngine(e.target.value),
21798
22105
  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))
22106
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: "endpoint", children: "Speech endpoint (Speaches, OpenAI\u2026)" }),
22107
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: "builtin", children: "Built-in transcription (Whisper)" })
21801
22108
  ]
21802
22109
  }
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
22110
  )
21813
22111
  ] }),
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)(
22112
+ sttBuiltin && builtinStatus && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
22113
+ BuiltinSttBlock,
22114
+ {
22115
+ status: builtinStatus,
22116
+ onStatusChange: setBuiltinStatus,
22117
+ model: sttBuiltinModel,
22118
+ onModelChange: setSttBuiltinModel
22119
+ }
22120
+ ),
22121
+ showEndpoint && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
22122
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22123
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-endpoint", children: "Speech Endpoint" }),
22124
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
22125
+ "input",
22126
+ {
22127
+ id: "voice-endpoint",
22128
+ type: "text",
22129
+ placeholder: "http://127.0.0.1:8969/v1",
22130
+ value: endpoint,
22131
+ onChange: (e) => setEndpoint(e.target.value)
22132
+ }
22133
+ ),
22134
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { children: [
22135
+ "OpenAI-compatible speech endpoint \u2014 e.g. a local Speaches container. Transcription posts to ",
22136
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { children: "/audio/transcriptions" }),
22137
+ ". When no separate synthesis endpoint is set below, synthesis also posts to",
22138
+ " ",
22139
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { children: "/audio/speech" }),
22140
+ " here. Voice is unavailable in the VSCode sidebar."
22141
+ ] })
22142
+ ] }),
22143
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22144
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-key", children: "API Key (optional)" }),
22145
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
22146
+ "input",
22147
+ {
22148
+ id: "voice-key",
22149
+ type: "password",
22150
+ placeholder: "Leave empty for a local server with no auth",
22151
+ value: apiKey,
22152
+ onChange: (e) => setApiKey(e.target.value)
22153
+ }
22154
+ ),
22155
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "Stored encrypted. Never sent to the browser \u2014 requests are proxied." })
22156
+ ] })
22157
+ ] }),
22158
+ !sttBuiltin && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
22159
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22160
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: fetchSttCatalog, disabled: fetching || !endpoint.trim(), children: fetching ? "Fetching\u2026" : "Fetch models" }),
22161
+ /* @__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." }),
22162
+ sttFetchError && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { className: "form-error", children: [
22163
+ "Fetch failed: ",
22164
+ sttFetchError
22165
+ ] })
22166
+ ] }),
22167
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22168
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-stt", children: "Transcription Model" }),
22169
+ sttCatalog && sttCatalog.stt.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
22170
+ "select",
22171
+ {
22172
+ id: "voice-stt",
22173
+ value: sttModel,
22174
+ onChange: (e) => setSttModel(e.target.value),
22175
+ children: [
22176
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: "", children: "-- Select a model --" }),
22177
+ withCurrent(sttCatalog.stt, sttModel).map((id) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: id, children: id }, id))
22178
+ ]
22179
+ }
22180
+ ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
22181
+ "input",
22182
+ {
22183
+ id: "voice-stt",
22184
+ type: "text",
22185
+ placeholder: "e.g. Systran/faster-whisper-small",
22186
+ value: sttModel,
22187
+ onChange: (e) => setSttModel(e.target.value)
22188
+ }
22189
+ )
22190
+ ] })
22191
+ ] }),
22192
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22193
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-engine", children: "Synthesis engine" }),
22194
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
21817
22195
  "select",
21818
22196
  {
21819
22197
  id: "voice-engine",
21820
22198
  value: ttsEngine,
21821
22199
  onChange: (e) => setTtsEngine(e.target.value),
21822
22200
  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" })
22201
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: "endpoint", children: "Speech endpoint (Speaches, edge-tts, OpenAI\u2026)" }),
22202
+ builtinStatus && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: "builtin", children: "Built-in voice" })
21825
22203
  ]
21826
22204
  }
21827
22205
  )
21828
22206
  ] }),
21829
- builtin && builtinStatus && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
22207
+ builtin && builtinStatus && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21830
22208
  BuiltinVoiceBlock,
21831
22209
  {
21832
22210
  status: builtinStatus,
@@ -21837,10 +22215,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21837
22215
  onVoiceChange: setTtsVoice
21838
22216
  }
21839
22217
  ),
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)(
22218
+ !builtin && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
22219
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22220
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-tts-endpoint", children: "Synthesis Endpoint (optional)" }),
22221
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21844
22222
  "input",
21845
22223
  {
21846
22224
  id: "voice-tts-endpoint",
@@ -21850,18 +22228,18 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21850
22228
  onChange: (e) => setTtsEndpoint(e.target.value)
21851
22229
  }
21852
22230
  ),
21853
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("small", { children: [
22231
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { children: [
21854
22232
  "Leave empty when one server does both. A local openai-edge-tts container gives you Microsoft Neural voices such as",
21855
22233
  " ",
21856
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("code", { children: "it-IT-ElsaNeural" }),
22234
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { children: "it-IT-ElsaNeural" }),
21857
22235
  " or ",
21858
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("code", { children: "it-IT-DiegoNeural" }),
22236
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { children: "it-IT-DiegoNeural" }),
21859
22237
  ", but cannot transcribe \u2014 transcription always uses the endpoint above. Nothing is saved yet \u2014 press Save after adjusting."
21860
22238
  ] })
21861
22239
  ] }),
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)(
22240
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22241
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-tts-key", children: "Synthesis API Key (optional)" }),
22242
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21865
22243
  "input",
21866
22244
  {
21867
22245
  id: "voice-tts-key",
@@ -21871,10 +22249,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21871
22249
  onChange: (e) => setTtsApiKey(e.target.value)
21872
22250
  }
21873
22251
  ),
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." })
22252
+ /* @__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
22253
  ] }),
21876
- ttsEndpoint.trim() && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "form-group", children: [
21877
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
22254
+ ttsEndpoint.trim() && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22255
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21878
22256
  "button",
21879
22257
  {
21880
22258
  type: "button",
@@ -21883,19 +22261,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21883
22261
  children: fetchingTts ? "Fetching\u2026" : "Fetch synthesis models"
21884
22262
  }
21885
22263
  ),
21886
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("small", { children: [
22264
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { children: [
21887
22265
  "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" }),
22266
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("code", { children: "/voices/all" }),
21889
22267
  "."
21890
22268
  ] }),
21891
- ttsFetchError && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("small", { className: "form-error", children: [
22269
+ ttsFetchError && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { className: "form-error", children: [
21892
22270
  "Fetch failed: ",
21893
22271
  ttsFetchError
21894
22272
  ] })
21895
22273
  ] }),
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)(
22274
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22275
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-tts", children: "Synthesis Model (optional)" }),
22276
+ ttsCatalog && ttsCatalog.tts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
21899
22277
  "select",
21900
22278
  {
21901
22279
  id: "voice-tts",
@@ -21908,14 +22286,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21908
22286
  }
21909
22287
  },
21910
22288
  children: [
21911
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "", children: "-- None (dictation only) --" }),
22289
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: "", children: "-- None (dictation only) --" }),
21912
22290
  withCurrent(
21913
22291
  ttsCatalog.tts.map((m2) => m2.id),
21914
22292
  ttsModel
21915
- ).map((id) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: id, children: id }, id))
22293
+ ).map((id) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: id, children: id }, id))
21916
22294
  ]
21917
22295
  }
21918
- ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
22296
+ ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21919
22297
  "input",
21920
22298
  {
21921
22299
  id: "voice-tts",
@@ -21925,22 +22303,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21925
22303
  onChange: (e) => setTtsModel(e.target.value)
21926
22304
  }
21927
22305
  ),
21928
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { children: "Required for conversation mode. Without it, only dictation is offered." })
22306
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "Required for conversation mode. Without it, only dictation is offered." })
21929
22307
  ] }),
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)(
22308
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22309
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-voice", children: "Voice (optional)" }),
22310
+ voicesForModel.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
21933
22311
  "select",
21934
22312
  {
21935
22313
  id: "voice-voice",
21936
22314
  value: ttsVoice,
21937
22315
  onChange: (e) => setTtsVoice(e.target.value),
21938
22316
  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))
22317
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: "", children: "-- Select a voice --" }),
22318
+ voicesForModel.map((v2) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: v2.id, children: voiceLabel(v2) }, v2.id))
21941
22319
  ]
21942
22320
  }
21943
- ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
22321
+ ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21944
22322
  "input",
21945
22323
  {
21946
22324
  id: "voice-voice",
@@ -21950,11 +22328,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21950
22328
  onChange: (e) => setTtsVoice(e.target.value)
21951
22329
  }
21952
22330
  ),
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." })
22331
+ /* @__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
22332
  ] }),
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)(
22333
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22334
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-speed", children: "Speaking Rate (optional)" }),
22335
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21958
22336
  "input",
21959
22337
  {
21960
22338
  id: "voice-speed",
@@ -21967,12 +22345,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21967
22345
  onChange: (e) => setTtsSpeed(e.target.value)
21968
22346
  }
21969
22347
  ),
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." })
22348
+ /* @__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
22349
  ] })
21972
22350
  ] }),
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)(
22351
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22352
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-buffer", children: "Playback buffer, ms (optional)" }),
22353
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21976
22354
  "input",
21977
22355
  {
21978
22356
  id: "voice-buffer",
@@ -21985,11 +22363,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
21985
22363
  onChange: (e) => setBufferMs(e.target.value)
21986
22364
  }
21987
22365
  ),
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." })
22366
+ /* @__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
22367
  ] }),
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)(
22368
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22369
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { htmlFor: "voice-lang", children: "Language (optional)" }),
22370
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21993
22371
  "input",
21994
22372
  {
21995
22373
  id: "voice-lang",
@@ -22000,7 +22378,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22000
22378
  }
22001
22379
  )
22002
22380
  ] }),
22003
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
22381
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
22004
22382
  PronunciationTable,
22005
22383
  {
22006
22384
  code: synthCode,
@@ -22017,20 +22395,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22017
22395
  listenError
22018
22396
  }
22019
22397
  ),
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." })
22398
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-group", children: [
22399
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: listening ? stopListening : () => void listen(), children: listening ? "Stop" : "Listen" }),
22400
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "Speaks a sample sentence with the form as it is now, without saving." })
22023
22401
  ] })
22024
22402
  ] }),
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" : "" })
22403
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "form-actions", children: [
22404
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: save, children: "Save" }),
22405
+ /* @__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
22406
  ] })
22029
22407
  ] });
22030
22408
  }
22031
22409
 
22032
22410
  // src/MemoryTab.tsx
22033
- var import_react18 = __toESM(require_react(), 1);
22411
+ var import_react19 = __toESM(require_react(), 1);
22034
22412
 
22035
22413
  // src/memory_tab_utils.ts
22036
22414
  function buildMemoryConfig(form) {
@@ -22049,26 +22427,26 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22049
22427
  }
22050
22428
 
22051
22429
  // src/MemoryTab.tsx
22052
- var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
22430
+ var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
22053
22431
  function MemoryTab({ config, agents, onSave }) {
22054
22432
  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)(
22433
+ const [enabled, setEnabled] = (0, import_react19.useState)(!!current);
22434
+ const [agentId, setAgentId] = (0, import_react19.useState)(current?.agentId ?? "");
22435
+ const [sweepMinutes, setSweepMinutes] = (0, import_react19.useState)(
22058
22436
  current?.sweepMinutes === void 0 ? "" : String(current.sweepMinutes)
22059
22437
  );
22060
- const [minNewMessages, setMinNewMessages] = (0, import_react18.useState)(
22438
+ const [minNewMessages, setMinNewMessages] = (0, import_react19.useState)(
22061
22439
  current?.minNewMessages === void 0 ? "" : String(current.minNewMessages)
22062
22440
  );
22063
- const [saveState, setSaveState] = (0, import_react18.useState)("idle");
22064
- const pendingSave = (0, import_react18.useRef)(null);
22065
- (0, import_react18.useEffect)(() => {
22441
+ const [saveState, setSaveState] = (0, import_react19.useState)("idle");
22442
+ const pendingSave = (0, import_react19.useRef)(null);
22443
+ (0, import_react19.useEffect)(() => {
22066
22444
  if (saveState !== "saving" || pendingSave.current === null) return;
22067
22445
  if (memorySignature(config.memory) !== pendingSave.current)
22068
22446
  return;
22069
22447
  setSaveState("saved");
22070
22448
  }, [config.memory, saveState]);
22071
- (0, import_react18.useEffect)(() => {
22449
+ (0, import_react19.useEffect)(() => {
22072
22450
  if (saveState !== "saved") return;
22073
22451
  const t = setTimeout(() => setSaveState("idle"), 2e3);
22074
22452
  return () => clearTimeout(t);
@@ -22084,12 +22462,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22084
22462
  else delete next.memory;
22085
22463
  onSave(next);
22086
22464
  };
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)(
22465
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "glass-form", children: [
22466
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h4", { children: "Memory" }),
22467
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "glass-form__body", children: [
22468
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "form-group form-group--checkbox", children: [
22469
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { htmlFor: "memory-enabled", children: [
22470
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
22093
22471
  "input",
22094
22472
  {
22095
22473
  id: "memory-enabled",
@@ -22100,25 +22478,25 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22100
22478
  ),
22101
22479
  "Enable memory"
22102
22480
  ] }),
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." })
22481
+ /* @__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
22482
  ] }),
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: [
22483
+ enabled && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
22484
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "form-group", children: [
22485
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { htmlFor: "memory-agent", children: "Memory agent" }),
22486
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("select", { id: "memory-agent", value: agentId, onChange: (e) => setAgentId(e.target.value), children: [
22487
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("option", { value: "", children: "\u2014 select an agent \u2014" }),
22488
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("option", { value: a2.id, children: [
22111
22489
  a2.name,
22112
22490
  " \xB7 ",
22113
22491
  a2.model
22114
22492
  ] }, a2.id))
22115
22493
  ] }),
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." })
22494
+ /* @__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." }),
22495
+ missingAgent && agentId && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { className: "form-error", children: "This agent no longer exists \u2014 pick another." })
22118
22496
  ] }),
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)(
22497
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "form-group", children: [
22498
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { htmlFor: "memory-sweep-minutes", children: "Sweep interval (minutes)" }),
22499
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
22122
22500
  "input",
22123
22501
  {
22124
22502
  id: "memory-sweep-minutes",
@@ -22130,9 +22508,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22130
22508
  }
22131
22509
  )
22132
22510
  ] }),
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)(
22511
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "form-group", children: [
22512
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { htmlFor: "memory-min-new", children: "Min new messages per session" }),
22513
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
22136
22514
  "input",
22137
22515
  {
22138
22516
  id: "memory-min-new",
@@ -22143,19 +22521,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22143
22521
  onChange: (e) => setMinNewMessages(e.target.value)
22144
22522
  }
22145
22523
  ),
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." })
22524
+ /* @__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
22525
  ] })
22148
22526
  ] })
22149
22527
  ] }),
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" : "" })
22528
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "form-actions", children: [
22529
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", onClick: save, disabled: enabled && !agentId, children: "Save" }),
22530
+ /* @__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
22531
  ] })
22154
22532
  ] });
22155
22533
  }
22156
22534
 
22157
22535
  // src/DesktopTab.tsx
22158
- var import_react19 = __toESM(require_react(), 1);
22536
+ var import_react20 = __toESM(require_react(), 1);
22159
22537
 
22160
22538
  // src/desktop_tab_utils.ts
22161
22539
  var DEFAULT_ASSISTANT_SHORTCUT = "CommandOrControl+Shift+Space";
@@ -22170,21 +22548,21 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22170
22548
  }
22171
22549
 
22172
22550
  // src/DesktopTab.tsx
22173
- var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
22551
+ var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
22174
22552
  function DesktopTab({ config, agents, onSave }) {
22175
22553
  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)(() => {
22554
+ const [enabled, setEnabled] = (0, import_react20.useState)(!!current);
22555
+ const [agentId, setAgentId] = (0, import_react20.useState)(current?.agentId ?? "");
22556
+ const [shortcut, setShortcut] = (0, import_react20.useState)(current?.shortcut ?? "");
22557
+ const [saveState, setSaveState] = (0, import_react20.useState)("idle");
22558
+ const pendingSave = (0, import_react20.useRef)(null);
22559
+ (0, import_react20.useEffect)(() => {
22182
22560
  if (saveState !== "saving" || pendingSave.current === null) return;
22183
22561
  if (desktopAssistantSignature(config.desktopAssistant) !== pendingSave.current)
22184
22562
  return;
22185
22563
  setSaveState("saved");
22186
22564
  }, [config.desktopAssistant, saveState]);
22187
- (0, import_react19.useEffect)(() => {
22565
+ (0, import_react20.useEffect)(() => {
22188
22566
  if (saveState !== "saved") return;
22189
22567
  const t = setTimeout(() => setSaveState("idle"), 2e3);
22190
22568
  return () => clearTimeout(t);
@@ -22199,12 +22577,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22199
22577
  else delete next.desktopAssistant;
22200
22578
  onSave(next);
22201
22579
  };
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)(
22580
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "glass-form", children: [
22581
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h4", { children: "Desktop assistant" }),
22582
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "glass-form__body", children: [
22583
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "form-group form-group--checkbox", children: [
22584
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { htmlFor: "desktop-assistant-enabled", children: [
22585
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22208
22586
  "input",
22209
22587
  {
22210
22588
  id: "desktop-assistant-enabled",
@@ -22215,20 +22593,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22215
22593
  ),
22216
22594
  "Enable desktop assistant"
22217
22595
  ] }),
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." })
22596
+ /* @__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
22597
  ] }),
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)(
22598
+ enabled && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
22599
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "form-group", children: [
22600
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { htmlFor: "desktop-assistant-agent", children: "Assistant agent" }),
22601
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
22224
22602
  "select",
22225
22603
  {
22226
22604
  id: "desktop-assistant-agent",
22227
22605
  value: agentId,
22228
22606
  onChange: (e) => setAgentId(e.target.value),
22229
22607
  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: [
22608
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: "", children: "\u2014 select an agent \u2014" }),
22609
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("option", { value: a2.id, children: [
22232
22610
  a2.name,
22233
22611
  " \xB7 ",
22234
22612
  a2.model
@@ -22236,12 +22614,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22236
22614
  ]
22237
22615
  }
22238
22616
  ),
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." })
22617
+ /* @__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." }),
22618
+ missingAgent && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { className: "form-error", children: "This agent no longer exists \u2014 pick another." })
22241
22619
  ] }),
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)(
22620
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "form-group", children: [
22621
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { htmlFor: "desktop-assistant-shortcut", children: "Global shortcut" }),
22622
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22245
22623
  "input",
22246
22624
  {
22247
22625
  id: "desktop-assistant-shortcut",
@@ -22251,23 +22629,23 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22251
22629
  onChange: (e) => setShortcut(e.target.value)
22252
22630
  }
22253
22631
  ),
22254
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("small", { children: [
22632
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { children: [
22255
22633
  "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
22634
  " ",
22257
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("code", { children: "caretaker-desktop --assistant" })
22635
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("code", { children: "caretaker-desktop --assistant" })
22258
22636
  ] })
22259
22637
  ] })
22260
22638
  ] })
22261
22639
  ] }),
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" : "" })
22640
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "form-actions", children: [
22641
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", onClick: save, disabled: enabled && !agentId, children: "Save" }),
22642
+ /* @__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
22643
  ] })
22266
22644
  ] });
22267
22645
  }
22268
22646
 
22269
22647
  // src/SettingsPanel.tsx
22270
- var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
22648
+ var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
22271
22649
  function SettingsPanel({
22272
22650
  layout = "compact",
22273
22651
  postMessage,
@@ -22288,16 +22666,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22288
22666
  onClose,
22289
22667
  initialTab = "providers"
22290
22668
  }) {
22291
- const [activeTab, setActiveTab] = (0, import_react20.useState)(initialTab);
22669
+ const [activeTab, setActiveTab] = (0, import_react21.useState)(initialTab);
22292
22670
  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 }),
22671
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "settings-panel settings-panel--loading", children: [
22672
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { className: "settings-panel__back-btn", onClick: onClose, children: [
22673
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ArrowLeft, { size: 14 }),
22296
22674
  " Back to Chat"
22297
22675
  ] }),
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..." })
22676
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "settings-panel__loading-spinner", children: [
22677
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "spinner" }),
22678
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "Loading configurations..." })
22301
22679
  ] })
22302
22680
  ] });
22303
22681
  }
@@ -22305,7 +22683,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22305
22683
  const renderTabContent = () => {
22306
22684
  switch (activeTab) {
22307
22685
  case "providers":
22308
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22686
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22309
22687
  ProvidersTab,
22310
22688
  {
22311
22689
  config,
@@ -22317,7 +22695,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22317
22695
  }
22318
22696
  );
22319
22697
  case "projects":
22320
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22698
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22321
22699
  ProjectsTabSettings,
22322
22700
  {
22323
22701
  config,
@@ -22326,7 +22704,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22326
22704
  }
22327
22705
  );
22328
22706
  case "agents":
22329
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22707
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22330
22708
  AgentsTab,
22331
22709
  {
22332
22710
  config,
@@ -22340,7 +22718,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22340
22718
  }
22341
22719
  );
22342
22720
  case "plugins":
22343
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22721
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22344
22722
  PluginsTab,
22345
22723
  {
22346
22724
  pluginsFile,
@@ -22351,7 +22729,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22351
22729
  }
22352
22730
  );
22353
22731
  case "mcp":
22354
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22732
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22355
22733
  McpTab,
22356
22734
  {
22357
22735
  mcpServersFile,
@@ -22361,7 +22739,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22361
22739
  }
22362
22740
  );
22363
22741
  case "services":
22364
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22742
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22365
22743
  ServicesTab,
22366
22744
  {
22367
22745
  config,
@@ -22371,7 +22749,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22371
22749
  }
22372
22750
  );
22373
22751
  case "voice":
22374
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22752
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22375
22753
  VoiceTab,
22376
22754
  {
22377
22755
  config,
@@ -22382,7 +22760,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22382
22760
  }
22383
22761
  );
22384
22762
  case "memory":
22385
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22763
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22386
22764
  MemoryTab,
22387
22765
  {
22388
22766
  config,
@@ -22391,7 +22769,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22391
22769
  }
22392
22770
  );
22393
22771
  case "desktop":
22394
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22772
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22395
22773
  DesktopTab,
22396
22774
  {
22397
22775
  config,
@@ -22401,16 +22779,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22401
22779
  );
22402
22780
  }
22403
22781
  };
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 }),
22782
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "settings-panel", children: [
22783
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { className: "settings-panel__header", children: [
22784
+ layout !== "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { className: "settings-panel__back-btn", onClick: onClose, title: "Go back to chat", children: [
22785
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ArrowLeft, { size: 14 }),
22408
22786
  " Chat"
22409
22787
  ] }),
22410
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h2", { className: "settings-panel__title", children: "Caretaker Config" })
22788
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h2", { className: "settings-panel__title", children: "Caretaker Config" })
22411
22789
  ] }),
22412
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("nav", { className: "settings-panel__tabs", children: [
22413
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22790
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("nav", { className: "settings-panel__tabs", children: [
22791
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22414
22792
  "button",
22415
22793
  {
22416
22794
  className: `settings-panel__tab-btn ${activeTab === "providers" ? "settings-panel__tab-btn--active" : ""}`,
@@ -22418,7 +22796,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22418
22796
  children: "Providers"
22419
22797
  }
22420
22798
  ),
22421
- layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22799
+ layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22422
22800
  "button",
22423
22801
  {
22424
22802
  className: `settings-panel__tab-btn ${activeTab === "projects" ? "settings-panel__tab-btn--active" : ""}`,
@@ -22426,7 +22804,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22426
22804
  children: "Projects"
22427
22805
  }
22428
22806
  ),
22429
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22807
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22430
22808
  "button",
22431
22809
  {
22432
22810
  className: `settings-panel__tab-btn ${activeTab === "agents" ? "settings-panel__tab-btn--active" : ""}`,
@@ -22434,7 +22812,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22434
22812
  children: "Agents"
22435
22813
  }
22436
22814
  ),
22437
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22815
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22438
22816
  "button",
22439
22817
  {
22440
22818
  className: `settings-panel__tab-btn ${activeTab === "plugins" ? "settings-panel__tab-btn--active" : ""}`,
@@ -22442,7 +22820,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22442
22820
  children: "Plugins"
22443
22821
  }
22444
22822
  ),
22445
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22823
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22446
22824
  "button",
22447
22825
  {
22448
22826
  className: `settings-panel__tab-btn ${activeTab === "mcp" ? "settings-panel__tab-btn--active" : ""}`,
@@ -22450,7 +22828,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22450
22828
  children: "MCP"
22451
22829
  }
22452
22830
  ),
22453
- layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22831
+ layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22454
22832
  "button",
22455
22833
  {
22456
22834
  className: `settings-panel__tab-btn ${activeTab === "services" ? "settings-panel__tab-btn--active" : ""}`,
@@ -22458,7 +22836,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22458
22836
  children: "Services"
22459
22837
  }
22460
22838
  ),
22461
- layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22839
+ layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22462
22840
  "button",
22463
22841
  {
22464
22842
  className: `settings-panel__tab-btn ${activeTab === "voice" ? "settings-panel__tab-btn--active" : ""}`,
@@ -22466,7 +22844,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22466
22844
  children: "Voice"
22467
22845
  }
22468
22846
  ),
22469
- layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22847
+ layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22470
22848
  "button",
22471
22849
  {
22472
22850
  className: `settings-panel__tab-btn ${activeTab === "memory" ? "settings-panel__tab-btn--active" : ""}`,
@@ -22474,7 +22852,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22474
22852
  children: "Memory"
22475
22853
  }
22476
22854
  ),
22477
- layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
22855
+ layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
22478
22856
  "button",
22479
22857
  {
22480
22858
  className: `settings-panel__tab-btn ${activeTab === "desktop" ? "settings-panel__tab-btn--active" : ""}`,
@@ -22483,15 +22861,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22483
22861
  }
22484
22862
  )
22485
22863
  ] }),
22486
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("main", { className: "settings-panel__content", children: renderTabContent() })
22864
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("main", { className: "settings-panel__content", children: renderTabContent() })
22487
22865
  ] });
22488
22866
  }
22489
22867
 
22490
22868
  // src/ProjectsTab.tsx
22491
- var import_react22 = __toESM(require_react(), 1);
22869
+ var import_react23 = __toESM(require_react(), 1);
22492
22870
 
22493
22871
  // src/TaskCycleView.tsx
22494
- var import_react21 = __toESM(require_react(), 1);
22872
+ var import_react22 = __toESM(require_react(), 1);
22495
22873
 
22496
22874
  // src/chat_state.ts
22497
22875
  function closeStreamingAssistant2(items) {
@@ -22667,13 +23045,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22667
23045
  };
22668
23046
 
22669
23047
  // src/TaskCycleView.tsx
22670
- var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
23048
+ var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
22671
23049
  function TaskCycleView({ item, postMessage, onBack }) {
22672
- const [chat, dispatch] = (0, import_react21.useReducer)(chatReducer, initialChatState);
23050
+ const [chat, dispatch] = (0, import_react22.useReducer)(chatReducer, initialChatState);
22673
23051
  const { sessionId, agentId } = item;
22674
- const postRef = (0, import_react21.useRef)(postMessage);
23052
+ const postRef = (0, import_react22.useRef)(postMessage);
22675
23053
  postRef.current = postMessage;
22676
- (0, import_react21.useEffect)(() => {
23054
+ (0, import_react22.useEffect)(() => {
22677
23055
  function handle(event) {
22678
23056
  const msg = event.data;
22679
23057
  if (!msg || typeof msg !== "object" || !("type" in msg) || !("sessionId" in msg)) return;
@@ -22714,25 +23092,25 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22714
23092
  };
22715
23093
  }, [sessionId, agentId]);
22716
23094
  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: [
23095
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: [
23096
+ /* @__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: [
23097
+ /* @__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 }) }),
23098
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "app__chat-header-info", children: [
23099
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("h3", { className: "app__chat-header-title", style: { fontSize: "13px", margin: 0 }, children: [
22722
23100
  cycleRoleLabel(item.role),
22723
23101
  " cycle",
22724
23102
  item.label ? ` \xB7 ${item.label}` : ""
22725
23103
  ] }),
22726
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "app__chat-header-status", style: { fontSize: "10px" }, children: running ? "running" : cycleOutcomeLabel(item.outcome) })
23104
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "app__chat-header-status", style: { fontSize: "10px" }, children: running ? "running" : cycleOutcomeLabel(item.outcome) })
22727
23105
  ] })
22728
23106
  ] }) }),
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 })
23107
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MessageList, { items: chat.items, sessionId: null, isStreaming: running, agentName: item.label }),
23108
+ chat.errorText && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "notice notice--block", children: chat.errorText })
22731
23109
  ] });
22732
23110
  }
22733
23111
 
22734
23112
  // src/ProjectsTab.tsx
22735
- var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
23113
+ var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
22736
23114
  var LS_ARCHIVED_KEY = "caretaker.taskView.showArchived";
22737
23115
  function persistLastProject(id) {
22738
23116
  void fetch("/api/ui-state", {
@@ -22757,15 +23135,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22757
23135
  }
22758
23136
  var PAGE_SIZE = 20;
22759
23137
  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)({
23138
+ const [projects, setProjects] = (0, import_react23.useState)([]);
23139
+ const [selectedProjectId, setSelectedProjectId] = (0, import_react23.useState)(null);
23140
+ const [tasks, setTasks] = (0, import_react23.useState)([]);
23141
+ const [selectedTaskId, setSelectedTaskId] = (0, import_react23.useState)(null);
23142
+ const [taskMessages, setTaskMessages] = (0, import_react23.useState)([]);
23143
+ const [view, setView] = (0, import_react23.useState)("list");
23144
+ const [page, setPage] = (0, import_react23.useState)(0);
23145
+ const [isNewTaskOpen, setIsNewTaskOpen] = (0, import_react23.useState)(false);
23146
+ const [newTask, setNewTask] = (0, import_react23.useState)({
22769
23147
  title: "",
22770
23148
  objective: "",
22771
23149
  checklistText: "",
@@ -22774,12 +23152,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22774
23152
  plannerAgentId: "",
22775
23153
  reviewerAgentId: ""
22776
23154
  });
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)(() => {
23155
+ const [isSending, setIsSending] = (0, import_react23.useState)(false);
23156
+ const [showArchived, setShowArchived] = (0, import_react23.useState)(loadShowArchived);
23157
+ const [pendingConfirm, setPendingConfirm] = (0, import_react23.useState)(null);
23158
+ const [taskError, setTaskError] = (0, import_react23.useState)(null);
23159
+ const threadIntervalRef = (0, import_react23.useRef)(null);
23160
+ (0, import_react23.useEffect)(() => {
22783
23161
  void (async () => {
22784
23162
  try {
22785
23163
  const res = await fetch("/api/ui-state");
@@ -22795,7 +23173,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22795
23173
  stopThreadPolling();
22796
23174
  };
22797
23175
  }, []);
22798
- (0, import_react22.useEffect)(() => {
23176
+ (0, import_react23.useEffect)(() => {
22799
23177
  if (projects.length > 0 && selectedProjectId === null) {
22800
23178
  setSelectedProjectId(projects[0].id);
22801
23179
  }
@@ -22806,10 +23184,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22806
23184
  setSelectedProjectId(null);
22807
23185
  }
22808
23186
  }, [projects]);
22809
- (0, import_react22.useEffect)(() => {
23187
+ (0, import_react23.useEffect)(() => {
22810
23188
  saveShowArchived(showArchived);
22811
23189
  }, [showArchived]);
22812
- (0, import_react22.useEffect)(() => {
23190
+ (0, import_react23.useEffect)(() => {
22813
23191
  if (selectedProjectId !== null) {
22814
23192
  fetchTasks(selectedProjectId);
22815
23193
  setView("list");
@@ -22821,7 +23199,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22821
23199
  setTasks([]);
22822
23200
  }
22823
23201
  }, [selectedProjectId, showArchived]);
22824
- (0, import_react22.useEffect)(() => {
23202
+ (0, import_react23.useEffect)(() => {
22825
23203
  if (selectedTaskId !== null) {
22826
23204
  fetchTaskMessages(selectedTaskId);
22827
23205
  startThreadPolling(selectedTaskId);
@@ -22994,7 +23372,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22994
23372
  const cancelPendingAction = () => {
22995
23373
  setPendingConfirm(null);
22996
23374
  };
22997
- (0, import_react22.useEffect)(() => {
23375
+ (0, import_react23.useEffect)(() => {
22998
23376
  if (!pendingConfirm) return;
22999
23377
  function handleKeyDown(event) {
23000
23378
  if (event.key === "Escape") {
@@ -23004,7 +23382,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23004
23382
  window.addEventListener("keydown", handleKeyDown);
23005
23383
  return () => window.removeEventListener("keydown", handleKeyDown);
23006
23384
  }, [pendingConfirm]);
23007
- (0, import_react22.useEffect)(() => {
23385
+ (0, import_react23.useEffect)(() => {
23008
23386
  if (!taskError) return;
23009
23387
  const t = setTimeout(() => setTaskError(null), 5e3);
23010
23388
  return () => clearTimeout(t);
@@ -23135,7 +23513,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23135
23513
  const selectedProject = projects.find((p) => p.id === selectedProjectId);
23136
23514
  const selectedTask = tasks.find((t) => t.id === selectedTaskId);
23137
23515
  const selectedProjectAgentName = agents.find((a2) => a2.id === selectedProject?.agentId)?.name || "Default Agent";
23138
- const taskAgentLabels = (0, import_react22.useMemo)(() => {
23516
+ const taskAgentLabels = (0, import_react23.useMemo)(() => {
23139
23517
  if (!selectedTask) return void 0;
23140
23518
  const agentLabelFor = (agentId) => {
23141
23519
  const a2 = agents.find((x) => x.id === agentId);
@@ -23181,14 +23559,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23181
23559
  const safePage = Math.min(page, totalPages - 1);
23182
23560
  const pageStart = safePage * PAGE_SIZE;
23183
23561
  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: [
23562
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app", style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
23563
+ /* @__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
23564
  "No projects registered.",
23187
23565
  " ",
23188
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { className: "app__link-btn", onClick: onOpenSettings, children: "Create one in Settings" }),
23566
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "app__link-btn", onClick: onOpenSettings, children: "Create one in Settings" }),
23189
23567
  " ",
23190
23568
  "to get started."
23191
- ] }) }) : selectedProject ? view === "list" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23569
+ ] }) }) : selectedProject ? view === "list" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23192
23570
  TaskListView,
23193
23571
  {
23194
23572
  projects,
@@ -23213,7 +23591,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23213
23591
  onArchive: handleArchiveFromList,
23214
23592
  statusColor
23215
23593
  }
23216
- ) : view === "log" && selectedTask ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23594
+ ) : view === "log" && selectedTask ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23217
23595
  TaskLogView,
23218
23596
  {
23219
23597
  task: selectedTask,
@@ -23229,7 +23607,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23229
23607
  onToggleStatus: handleToggleTaskStatus,
23230
23608
  statusColor
23231
23609
  }
23232
- ) : view === "edit" && selectedTask ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23610
+ ) : view === "edit" && selectedTask ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23233
23611
  TaskEditView,
23234
23612
  {
23235
23613
  task: selectedTask,
@@ -23247,11 +23625,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23247
23625
  onOpenLog: () => setView("log"),
23248
23626
  statusColor
23249
23627
  }
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" })
23628
+ ) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__empty-state", children: [
23629
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { children: "Task not found. Go back to the list." }),
23630
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "settings-panel__back-btn", onClick: backToList, style: { marginTop: "12px" }, children: "\u2190 Back to list" })
23253
23631
  ] }) : null }),
23254
- isNewTaskOpen && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23632
+ isNewTaskOpen && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23255
23633
  "div",
23256
23634
  {
23257
23635
  style: {
@@ -23266,7 +23644,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23266
23644
  justifyContent: "center",
23267
23645
  zIndex: 999
23268
23646
  },
23269
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
23647
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23270
23648
  "form",
23271
23649
  {
23272
23650
  onSubmit: handleCreateTask,
@@ -23277,14 +23655,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23277
23655
  background: "var(--vscode-sideBar-background)"
23278
23656
  },
23279
23657
  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" })
23658
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "confirm__header", children: [
23659
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { fontSize: "18px", display: "inline-flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Wrench, { size: 18 }) }),
23660
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "confirm__prompt", style: { fontSize: "14px" }, children: "Create New Task" })
23283
23661
  ] }),
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: [
23662
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: [
23663
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23286
23664
  "Task Title",
23287
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23665
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23288
23666
  "input",
23289
23667
  {
23290
23668
  type: "text",
@@ -23304,9 +23682,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23304
23682
  }
23305
23683
  )
23306
23684
  ] }),
23307
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23685
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23308
23686
  "Objective (Extended markdown goal description)",
23309
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23687
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23310
23688
  "textarea",
23311
23689
  {
23312
23690
  required: true,
@@ -23327,9 +23705,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23327
23705
  }
23328
23706
  )
23329
23707
  ] }),
23330
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23708
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23331
23709
  "Checklist Items (One item per line)",
23332
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23710
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23333
23711
  "textarea",
23334
23712
  {
23335
23713
  placeholder: "Create route handler\nWrite unit tests\nUpdate documentation",
@@ -23349,9 +23727,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23349
23727
  }
23350
23728
  )
23351
23729
  ] }),
23352
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23730
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23353
23731
  "Assigned Agent (optional \u2014 overrides project default)",
23354
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
23732
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23355
23733
  "select",
23356
23734
  {
23357
23735
  value: newTask.agentId,
@@ -23366,8 +23744,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23366
23744
  outline: "none"
23367
23745
  },
23368
23746
  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: [
23747
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: "Project default" }),
23748
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: a2.id, children: [
23371
23749
  a2.name,
23372
23750
  " (",
23373
23751
  a2.provider,
@@ -23377,9 +23755,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23377
23755
  }
23378
23756
  )
23379
23757
  ] }),
23380
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23758
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23381
23759
  "Planner Agent Override (optional)",
23382
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
23760
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23383
23761
  "select",
23384
23762
  {
23385
23763
  value: newTask.plannerAgentId,
@@ -23394,8 +23772,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23394
23772
  outline: "none"
23395
23773
  },
23396
23774
  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: [
23775
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: "Project default" }),
23776
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: a2.id, children: [
23399
23777
  a2.name,
23400
23778
  " (",
23401
23779
  a2.provider,
@@ -23405,9 +23783,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23405
23783
  }
23406
23784
  )
23407
23785
  ] }),
23408
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23786
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23409
23787
  "Reviewer Agent Override (optional)",
23410
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
23788
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23411
23789
  "select",
23412
23790
  {
23413
23791
  value: newTask.reviewerAgentId,
@@ -23422,8 +23800,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23422
23800
  outline: "none"
23423
23801
  },
23424
23802
  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: [
23803
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: "Project default" }),
23804
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: a2.id, children: [
23427
23805
  a2.name,
23428
23806
  " (",
23429
23807
  a2.provider,
@@ -23433,8 +23811,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23433
23811
  }
23434
23812
  )
23435
23813
  ] }),
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)(
23814
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "12px", display: "flex", alignItems: "center", gap: "6px", cursor: "pointer", marginTop: "4px" }, children: [
23815
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23438
23816
  "input",
23439
23817
  {
23440
23818
  type: "checkbox",
@@ -23443,24 +23821,24 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23443
23821
  style: { cursor: "pointer" }
23444
23822
  }
23445
23823
  ),
23446
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "Start active immediately (Heartbeat loop claims it)" })
23824
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: "Start active immediately (Heartbeat loop claims it)" })
23447
23825
  ] })
23448
23826
  ] }),
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" })
23827
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "confirm__buttons", style: { justifyContent: "flex-end", marginTop: "10px" }, children: [
23828
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { type: "button", className: "confirm__btn", onClick: () => setIsNewTaskOpen(false), children: "Cancel" }),
23829
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { type: "submit", className: "confirm__btn confirm__btn--primary", children: "Create Task" })
23452
23830
  ] })
23453
23831
  ]
23454
23832
  }
23455
23833
  )
23456
23834
  }
23457
23835
  ),
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)(
23836
+ 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: [
23837
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__confirm-title", children: pendingConfirm.type === "delete" ? "Delete task" : pendingConfirm.type === "archive" ? "Archive task" : "Discard worktree" }),
23838
+ /* @__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.` }),
23839
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__confirm-buttons", children: [
23840
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "app__confirm-btn", onClick: cancelPendingAction, children: "Cancel" }),
23841
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23464
23842
  "button",
23465
23843
  {
23466
23844
  className: `app__confirm-btn ${pendingConfirm.type === "delete" ? "app__confirm-btn--danger" : ""}`,
@@ -23470,7 +23848,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23470
23848
  )
23471
23849
  ] })
23472
23850
  ] }) }),
23473
- taskError && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "app__error-banner", onClick: () => setTaskError(null), title: "Click to dismiss", children: taskError })
23851
+ taskError && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__error-banner", onClick: () => setTaskError(null), title: "Click to dismiss", children: taskError })
23474
23852
  ] });
23475
23853
  }
23476
23854
  function TaskListView({
@@ -23493,10 +23871,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23493
23871
  onArchive,
23494
23872
  statusColor
23495
23873
  }) {
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)(
23874
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%" }, children: [
23875
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "task-view__header", children: [
23876
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
23877
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23500
23878
  "select",
23501
23879
  {
23502
23880
  className: "task-view__project-filter",
@@ -23513,17 +23891,17 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23513
23891
  outline: "none",
23514
23892
  cursor: "pointer"
23515
23893
  },
23516
- children: projects.map((p) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("option", { value: p.id, children: p.name }, p.id))
23894
+ children: projects.map((p) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: p.id, children: p.name }, p.id))
23517
23895
  }
23518
23896
  ),
23519
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { style: { fontSize: "10px", opacity: 0.6 }, children: [
23897
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { style: { fontSize: "10px", opacity: 0.6 }, children: [
23520
23898
  "Agent: ",
23521
23899
  agentName
23522
23900
  ] })
23523
23901
  ] }),
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)(
23902
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
23903
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { className: "task-view__archived-toggle", children: [
23904
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23527
23905
  "input",
23528
23906
  {
23529
23907
  type: "checkbox",
@@ -23534,42 +23912,42 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23534
23912
  ),
23535
23913
  "Show archived"
23536
23914
  ] }),
23537
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { className: "app__new-chat-btn", onClick: onNewTask, style: { padding: "4px 10px", fontSize: "11px" }, children: "+ New Task" })
23915
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "app__new-chat-btn", onClick: onNewTask, style: { padding: "4px 10px", fontSize: "11px" }, children: "+ New Task" })
23538
23916
  ] })
23539
23917
  ] }),
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: [
23918
+ /* @__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
23919
  "No tasks created for ",
23542
23920
  project.name,
23543
23921
  '. 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" } })
23922
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("table", { className: "task-table", children: [
23923
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("tr", { children: [
23924
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "60px" }, children: "#" }),
23925
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", children: "Title" }),
23926
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "90px" }, children: "Status" }),
23927
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "100px" }, children: "Agent" }),
23928
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "120px" }, children: "Checklist" }),
23929
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "180px" }, children: "Branch" }),
23930
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "150px" }, children: "Updated" }),
23931
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "70px" } })
23554
23932
  ] }) }),
23555
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tbody", { children: tasks.map((task) => {
23933
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tbody", { children: tasks.map((task) => {
23556
23934
  const completedCount = task.checklist.filter((c2) => c2.status === "done").length;
23557
23935
  const totalCount = task.checklist.length;
23558
23936
  const isArchived = !!task.archived;
23559
23937
  const updated = new Date(task.updatedAt);
23560
23938
  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)(
23939
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23562
23940
  "tr",
23563
23941
  {
23564
23942
  className: `task-table__row${isArchived ? " task-table__row--archived" : ""}`,
23565
23943
  onClick: () => onOpenLog(task),
23566
23944
  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 }),
23945
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: "task-table__td task-table__td--mono", children: task.id }),
23946
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "task-table__title", children: [
23947
+ isArchived && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Archive, { size: 11 }),
23570
23948
  task.title
23571
23949
  ] }) }),
23572
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23950
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23573
23951
  "span",
23574
23952
  {
23575
23953
  className: "task-table__badge",
@@ -23577,28 +23955,28 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23577
23955
  children: task.status
23578
23956
  }
23579
23957
  ) }),
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)(
23958
+ /* @__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" }) }),
23959
+ /* @__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: [
23960
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "task-table__progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23583
23961
  "span",
23584
23962
  {
23585
23963
  className: "task-table__progress-fill",
23586
23964
  style: { width: `${completedCount / totalCount * 100}%` }
23587
23965
  }
23588
23966
  ) }),
23589
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "task-table__progress-text", children: [
23967
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "task-table__progress-text", children: [
23590
23968
  completedCount,
23591
23969
  "/",
23592
23970
  totalCount
23593
23971
  ] })
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)(
23972
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { opacity: 0.4, fontSize: "11px" }, children: "\u2014" }) }),
23973
+ /* @__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: [
23974
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GitBranch, { size: 11 }),
23975
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("code", { children: task.branch })
23976
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { opacity: 0.4, fontSize: "11px" }, children: "\u2014" }) }),
23977
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: "task-table__td task-table__td--muted", children: updatedStr }),
23978
+ /* @__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: [
23979
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23602
23980
  "button",
23603
23981
  {
23604
23982
  className: "task-table__edit-btn",
@@ -23608,10 +23986,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23608
23986
  },
23609
23987
  title: task.archived ? "Unarchive task" : "Archive task",
23610
23988
  "aria-label": task.archived ? "Unarchive task" : "Archive task",
23611
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Archive, { size: 13 })
23989
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Archive, { size: 13 })
23612
23990
  }
23613
23991
  ),
23614
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23992
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23615
23993
  "button",
23616
23994
  {
23617
23995
  className: "task-table__edit-btn",
@@ -23621,7 +23999,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23621
23999
  },
23622
24000
  title: "Edit task",
23623
24001
  "aria-label": "Edit task",
23624
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Pencil, { size: 13 })
24002
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Pencil, { size: 13 })
23625
24003
  }
23626
24004
  )
23627
24005
  ] }) })
@@ -23631,8 +24009,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23631
24009
  );
23632
24010
  }) })
23633
24011
  ] }) }),
23634
- totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "task-table__pagination", children: [
23635
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24012
+ totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "task-table__pagination", children: [
24013
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23636
24014
  "button",
23637
24015
  {
23638
24016
  className: "task-table__page-btn",
@@ -23641,13 +24019,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23641
24019
  children: "\u2039 Prev"
23642
24020
  }
23643
24021
  ),
23644
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "task-table__page-info", children: [
24022
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "task-table__page-info", children: [
23645
24023
  "Page ",
23646
24024
  page + 1,
23647
24025
  " of ",
23648
24026
  totalPages
23649
24027
  ] }),
23650
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24028
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23651
24029
  "button",
23652
24030
  {
23653
24031
  className: "task-table__page-btn",
@@ -23675,31 +24053,31 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23675
24053
  }) {
23676
24054
  const completedCount = task.checklist.filter((c2) => c2.status === "done").length;
23677
24055
  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)(() => {
24056
+ const chatItems = (0, import_react23.useMemo)(() => taskMessagesToChatItems(taskMessages, agentLabels), [taskMessages, agentLabels]);
24057
+ const [openCycle, setOpenCycle] = (0, import_react23.useState)(null);
24058
+ const [draft, setDraft] = (0, import_react23.useState)("");
24059
+ const openCycleItem = (0, import_react23.useCallback)((item) => setOpenCycle(item), []);
24060
+ const autoOpenedFor = (0, import_react23.useRef)(null);
24061
+ (0, import_react23.useEffect)(() => {
23684
24062
  if (autoOpenedFor.current === task.id || taskMessages.length === 0) return;
23685
24063
  autoOpenedFor.current = task.id;
23686
24064
  const latest = [...chatItems].reverse().find((i) => i.kind === "cycle");
23687
24065
  if (latest && latest.outcome === "running") setOpenCycle(latest);
23688
24066
  }, [task.id, taskMessages.length, chatItems]);
23689
24067
  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: [
24068
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%" }, children: [
24069
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("header", { className: "app__chat-header task-view__sub-header", style: { padding: "12px 14px" }, children: [
24070
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
24071
+ /* @__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 }) }),
24072
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__chat-header-info", children: [
24073
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("h3", { className: "app__chat-header-title", style: { fontSize: "13px", margin: 0 }, children: [
23696
24074
  "Task #",
23697
24075
  task.id,
23698
24076
  ": ",
23699
24077
  task.title
23700
24078
  ] }),
23701
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "app__chat-header-status", style: { fontSize: "10px" }, children: [
23702
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24079
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "app__chat-header-status", style: { fontSize: "10px" }, children: [
24080
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23703
24081
  "span",
23704
24082
  {
23705
24083
  className: `agent-status-dot agent-status-dot--active ${isActiveLike ? "agent-status-dot--pulsing" : ""}`,
@@ -23710,24 +24088,24 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23710
24088
  ] })
23711
24089
  ] })
23712
24090
  ] }),
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)(
24091
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
24092
+ task.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23715
24093
  "button",
23716
24094
  {
23717
24095
  className: "confirm__btn confirm__btn--primary",
23718
24096
  onClick: () => onToggleStatus(task),
23719
24097
  title: isActiveLike ? "Pause this task (aborts the running agent)" : "Activate this task",
23720
24098
  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 }),
24099
+ children: isActiveLike ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
24100
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Pause, { size: 12 }),
23723
24101
  " Pause"
23724
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
23725
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Play, { size: 12 }),
24102
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
24103
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Play, { size: 12 }),
23726
24104
  " Activate"
23727
24105
  ] })
23728
24106
  }
23729
24107
  ),
23730
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24108
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23731
24109
  "span",
23732
24110
  {
23733
24111
  className: "task-table__badge",
@@ -23737,8 +24115,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23737
24115
  )
23738
24116
  ] })
23739
24117
  ] }),
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)(
24118
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "row" }, children: [
24119
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23742
24120
  "aside",
23743
24121
  {
23744
24122
  style: {
@@ -23751,19 +24129,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23751
24129
  background: "var(--vscode-sideBar-background, rgba(0,0,0,0.1))"
23752
24130
  },
23753
24131
  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: [
24132
+ /* @__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: [
24133
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h4", { style: { margin: 0, fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Checklist" }),
24134
+ totalCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { fontSize: "10px", opacity: 0.5, marginTop: "2px" }, children: [
23757
24135
  completedCount,
23758
24136
  "/",
23759
24137
  totalCount,
23760
24138
  " done"
23761
24139
  ] })
23762
24140
  ] }),
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) => {
24141
+ /* @__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
24142
  const isDone = item.status === "done";
23765
24143
  const isInProgress = item.status === "in_progress";
23766
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
24144
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23767
24145
  "label",
23768
24146
  {
23769
24147
  style: {
@@ -23780,7 +24158,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23780
24158
  },
23781
24159
  title: isInProgress ? "In progress" : isDone ? "Done" : "Pending",
23782
24160
  children: [
23783
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24161
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23784
24162
  "input",
23785
24163
  {
23786
24164
  type: "checkbox",
@@ -23789,7 +24167,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23789
24167
  style: { marginTop: "2px", cursor: "pointer", flexShrink: 0 }
23790
24168
  }
23791
24169
  ),
23792
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: { wordBreak: "break-word" }, children: item.text })
24170
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { wordBreak: "break-word" }, children: item.text })
23793
24171
  ]
23794
24172
  },
23795
24173
  item.id
@@ -23798,8 +24176,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23798
24176
  ]
23799
24177
  }
23800
24178
  ),
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)(
24179
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column" }, children: [
24180
+ liveCycle ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23803
24181
  TaskCycleView,
23804
24182
  {
23805
24183
  item: liveCycle,
@@ -23807,8 +24185,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23807
24185
  onBack: () => setOpenCycle(null)
23808
24186
  },
23809
24187
  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)(
24188
+ ) : 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 }),
24189
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23812
24190
  Composer,
23813
24191
  {
23814
24192
  disabled: isSending,
@@ -23845,12 +24223,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23845
24223
  statusColor
23846
24224
  }) {
23847
24225
  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);
24226
+ const [draftTitle, setDraftTitle] = (0, import_react23.useState)(task.title);
24227
+ const [draftObjective, setDraftObjective] = (0, import_react23.useState)(task.objective);
24228
+ const [lastTaskId, setLastTaskId] = (0, import_react23.useState)(task.id);
23851
24229
  const trimmedTitle = draftTitle.trim();
23852
24230
  const isDirty = trimmedTitle !== task.title.trim() || draftObjective.trim() !== task.objective.trim();
23853
- (0, import_react22.useEffect)(() => {
24231
+ (0, import_react23.useEffect)(() => {
23854
24232
  if (task.id !== lastTaskId) {
23855
24233
  setDraftTitle(task.title);
23856
24234
  setDraftObjective(task.objective);
@@ -23865,16 +24243,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23865
24243
  setDraftTitle(task.title);
23866
24244
  setDraftObjective(task.objective);
23867
24245
  };
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: [
24246
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%", overflowY: "auto" }, children: [
24247
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "task-view__sub-header", style: { padding: "12px 14px", display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
24248
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
24249
+ /* @__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 }) }),
24250
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("h3", { style: { margin: 0, fontSize: "15px", fontWeight: 700, display: "flex", alignItems: "center", gap: "6px" }, children: [
24251
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { style: { opacity: 0.6 }, children: [
23874
24252
  "Task #",
23875
24253
  task.id
23876
24254
  ] }),
23877
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24255
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23878
24256
  "input",
23879
24257
  {
23880
24258
  value: draftTitle,
@@ -23895,7 +24273,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23895
24273
  }
23896
24274
  )
23897
24275
  ] }),
23898
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24276
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23899
24277
  "span",
23900
24278
  {
23901
24279
  className: "task-table__badge",
@@ -23904,8 +24282,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23904
24282
  }
23905
24283
  )
23906
24284
  ] }),
23907
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { display: "inline-flex", gap: "6px" }, children: [
23908
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24285
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "inline-flex", gap: "6px" }, children: [
24286
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23909
24287
  "button",
23910
24288
  {
23911
24289
  className: "confirm__btn",
@@ -23915,7 +24293,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23915
24293
  children: "View Log"
23916
24294
  }
23917
24295
  ),
23918
- task.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
24296
+ task.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23919
24297
  "button",
23920
24298
  {
23921
24299
  className: "confirm__btn",
@@ -23923,12 +24301,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23923
24301
  title: `Commit pending changes to ${task.branch} and remove the worktree`,
23924
24302
  style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px" },
23925
24303
  children: [
23926
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GitBranch, { size: 12 }),
24304
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GitBranch, { size: 12 }),
23927
24305
  " Discard worktree"
23928
24306
  ]
23929
24307
  }
23930
24308
  ),
23931
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
24309
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23932
24310
  "button",
23933
24311
  {
23934
24312
  className: "confirm__btn",
@@ -23936,28 +24314,28 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23936
24314
  title: task.archived ? "Unarchive this task" : "Archive this task (hides it from the list, excludes from scheduler)",
23937
24315
  style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px" },
23938
24316
  children: [
23939
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Archive, { size: 12 }),
24317
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Archive, { size: 12 }),
23940
24318
  " ",
23941
24319
  task.archived ? "Unarchive" : "Archive"
23942
24320
  ]
23943
24321
  }
23944
24322
  ),
23945
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24323
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23946
24324
  "button",
23947
24325
  {
23948
24326
  className: "confirm__btn confirm__btn--primary",
23949
24327
  onClick: () => onToggleStatus(task),
23950
24328
  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 }),
24329
+ children: task.status === "active" || task.status === "reviewing" || task.status === "planning" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
24330
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Pause, { size: 12 }),
23953
24331
  " Pause"
23954
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
23955
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Play, { size: 12 }),
24332
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
24333
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Play, { size: 12 }),
23956
24334
  " Activate"
23957
24335
  ] })
23958
24336
  }
23959
24337
  ),
23960
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
24338
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23961
24339
  "button",
23962
24340
  {
23963
24341
  className: "confirm__btn",
@@ -23965,22 +24343,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23965
24343
  title: "Permanently delete this task and all its messages",
23966
24344
  style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px", color: "#ef4444" },
23967
24345
  children: [
23968
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Trash, { size: 12 }),
24346
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Trash, { size: 12 }),
23969
24347
  " Delete"
23970
24348
  ]
23971
24349
  }
23972
24350
  )
23973
24351
  ] })
23974
24352
  ] }),
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)" })
24353
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { padding: "16px", maxWidth: "720px" }, children: [
24354
+ task.branch && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { marginBottom: "16px", display: "flex", alignItems: "center", gap: "6px", fontSize: "11px", opacity: 0.75 }, children: [
24355
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GitBranch, { size: 12 }),
24356
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("code", { style: { fontFamily: "monospace" }, children: task.branch }),
24357
+ !task.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { opacity: 0.6 }, children: "(worktree removed)" })
23980
24358
  ] }),
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)(
24359
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24360
+ /* @__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" }),
24361
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23984
24362
  "textarea",
23985
24363
  {
23986
24364
  value: draftObjective,
@@ -24004,8 +24382,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24004
24382
  }
24005
24383
  }
24006
24384
  ),
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)(
24385
+ isDirty && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", gap: "6px", alignItems: "center", marginTop: "8px" }, children: [
24386
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24009
24387
  "button",
24010
24388
  {
24011
24389
  className: "confirm__btn confirm__btn--primary",
@@ -24018,13 +24396,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24018
24396
  children: "Save"
24019
24397
  }
24020
24398
  ),
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." })
24399
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "confirm__btn", onClick: resetDraft, style: { padding: "3px 10px", fontSize: "10px" }, children: "Cancel" }),
24400
+ isRunning && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { fontSize: "10px", opacity: 0.6 }, children: "Applies from the next cycle." })
24023
24401
  ] })
24024
24402
  ] }),
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)(
24403
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24404
+ /* @__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" }),
24405
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24028
24406
  "select",
24029
24407
  {
24030
24408
  value: task.agentId || "",
@@ -24044,8 +24422,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24044
24422
  },
24045
24423
  title: isRunning ? "Pause the task before changing its agent" : "Choose which agent runs this task",
24046
24424
  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: [
24425
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: "Project default" }),
24426
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: a2.id, children: [
24049
24427
  a2.name,
24050
24428
  " (",
24051
24429
  a2.provider,
@@ -24055,9 +24433,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24055
24433
  }
24056
24434
  )
24057
24435
  ] }),
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)(
24436
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24437
+ /* @__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" }),
24438
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24061
24439
  "select",
24062
24440
  {
24063
24441
  value: task.plannerAgentId || "",
@@ -24066,8 +24444,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24066
24444
  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
24445
  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
24446
  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: [
24447
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: "Project default" }),
24448
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: a2.id, children: [
24071
24449
  a2.name,
24072
24450
  " (",
24073
24451
  a2.provider,
@@ -24077,9 +24455,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24077
24455
  }
24078
24456
  )
24079
24457
  ] }),
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)(
24458
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24459
+ /* @__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" }),
24460
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24083
24461
  "select",
24084
24462
  {
24085
24463
  value: task.reviewerAgentId || "",
@@ -24088,8 +24466,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24088
24466
  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
24467
  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
24468
  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: [
24469
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: "Project default" }),
24470
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: a2.id, children: [
24093
24471
  a2.name,
24094
24472
  " (",
24095
24473
  a2.provider,
@@ -24099,31 +24477,31 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24099
24477
  }
24100
24478
  )
24101
24479
  ] }),
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: [
24480
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24481
+ /* @__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" }),
24482
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { display: "flex", gap: "12px" }, children: [
24105
24483
  { flag: "planningEnabled", label: "Planning phase", value: task.planningEnabled },
24106
24484
  { flag: "reviewEnabled", label: "Review at DONE", value: task.reviewEnabled },
24107
24485
  { 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: [
24486
+ ].map(({ flag, label, value }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px", flex: 1 }, children: [
24109
24487
  label,
24110
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
24488
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24111
24489
  "select",
24112
24490
  {
24113
24491
  value: value === true ? "on" : value === false ? "off" : "inherit",
24114
24492
  onChange: (e) => onSetFlag(task, flag, e.target.value === "inherit" ? null : e.target.value === "on"),
24115
24493
  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
24494
  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" })
24495
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "inherit", children: "Project default" }),
24496
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "on", children: "On" }),
24497
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "off", children: "Off" })
24120
24498
  ]
24121
24499
  }
24122
24500
  )
24123
24501
  ] }, flag)) }),
24124
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px", marginTop: "12px", maxWidth: "260px" }, children: [
24502
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px", marginTop: "12px", maxWidth: "260px" }, children: [
24125
24503
  "Max run seconds per cycle",
24126
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24504
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24127
24505
  "input",
24128
24506
  {
24129
24507
  type: "number",
@@ -24146,7 +24524,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24146
24524
  )
24147
24525
  ] })
24148
24526
  ] }),
24149
- task.status === "blocked" && task.blockedReason && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
24527
+ task.status === "blocked" && task.blockedReason && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24150
24528
  "div",
24151
24529
  {
24152
24530
  style: {
@@ -24159,19 +24537,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24159
24537
  fontSize: "12px"
24160
24538
  },
24161
24539
  children: [
24162
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("strong", { children: [
24163
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TriangleAlert, { size: 13 }),
24540
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("strong", { children: [
24541
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TriangleAlert, { size: 13 }),
24164
24542
  " Blocked Reason:"
24165
24543
  ] }),
24166
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { style: { margin: "4px 0 0 0" }, children: task.blockedReason })
24544
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { style: { margin: "4px 0 0 0" }, children: task.blockedReason })
24167
24545
  ]
24168
24546
  }
24169
24547
  ),
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) => {
24548
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
24549
+ /* @__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" }),
24550
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: (task.checklist || []).map((item) => {
24173
24551
  const isDone = item.status === "done";
24174
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
24552
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24175
24553
  "label",
24176
24554
  {
24177
24555
  style: {
@@ -24188,7 +24566,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24188
24566
  opacity: isDone ? 0.6 : 1
24189
24567
  },
24190
24568
  children: [
24191
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
24569
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24192
24570
  "input",
24193
24571
  {
24194
24572
  type: "checkbox",
@@ -24197,7 +24575,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24197
24575
  style: { marginTop: "2px", cursor: "pointer" }
24198
24576
  }
24199
24577
  ),
24200
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: item.text })
24578
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: item.text })
24201
24579
  ]
24202
24580
  },
24203
24581
  item.id
@@ -24209,7 +24587,51 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24209
24587
  }
24210
24588
 
24211
24589
  // src/useVoice.ts
24212
- var import_react23 = __toESM(require_react(), 1);
24590
+ var import_react24 = __toESM(require_react(), 1);
24591
+
24592
+ // src/pcm_wav.ts
24593
+ function encodeWavPcm16(samples, rate) {
24594
+ const out = new Uint8Array(44 + samples.length * 2);
24595
+ const view = new DataView(out.buffer);
24596
+ const tag = (at2, s) => {
24597
+ for (let i = 0; i < s.length; i++) view.setUint8(at2 + i, s.charCodeAt(i));
24598
+ };
24599
+ tag(0, "RIFF");
24600
+ view.setUint32(4, 36 + samples.length * 2, true);
24601
+ tag(8, "WAVE");
24602
+ tag(12, "fmt ");
24603
+ view.setUint32(16, 16, true);
24604
+ view.setUint16(20, 1, true);
24605
+ view.setUint16(22, 1, true);
24606
+ view.setUint32(24, rate, true);
24607
+ view.setUint32(28, rate * 2, true);
24608
+ view.setUint16(32, 2, true);
24609
+ view.setUint16(34, 16, true);
24610
+ tag(36, "data");
24611
+ view.setUint32(40, samples.length * 2, true);
24612
+ for (let i = 0; i < samples.length; i++) {
24613
+ const s = Math.max(-1, Math.min(1, samples[i]));
24614
+ view.setInt16(44 + i * 2, s < 0 ? s * 32768 : s * 32767, true);
24615
+ }
24616
+ return out;
24617
+ }
24618
+ async function toWav16k(blob) {
24619
+ const ctx = new AudioContext();
24620
+ try {
24621
+ const decoded = await ctx.decodeAudioData(await blob.arrayBuffer());
24622
+ const offline = new OfflineAudioContext(1, Math.max(1, Math.ceil(decoded.duration * 16e3)), 16e3);
24623
+ const src = offline.createBufferSource();
24624
+ src.buffer = decoded;
24625
+ src.connect(offline.destination);
24626
+ src.start();
24627
+ const rendered = await offline.startRendering();
24628
+ return new Blob([encodeWavPcm16(rendered.getChannelData(0), 16e3)], { type: "audio/wav" });
24629
+ } finally {
24630
+ void ctx.close();
24631
+ }
24632
+ }
24633
+
24634
+ // src/useVoice.ts
24213
24635
  function canCapture() {
24214
24636
  return typeof window !== "undefined" && typeof MediaRecorder !== "undefined" && !!navigator.mediaDevices?.getUserMedia;
24215
24637
  }
@@ -24234,39 +24656,41 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24234
24656
  const { voice, chatStatus, pendingConfirmCount, items, onTranscript } = opts;
24235
24657
  const available = !!voice && voice.enabled && voice.configured && canCapture();
24236
24658
  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);
24659
+ const [phase, setPhase] = (0, import_react24.useState)("idle");
24660
+ const [mode, setMode] = (0, import_react24.useState)("dictate");
24661
+ const [error, setError] = (0, import_react24.useState)(null);
24662
+ const voiceRef = (0, import_react24.useRef)(voice);
24663
+ voiceRef.current = voice;
24664
+ const bufferMsRef = (0, import_react24.useRef)(voice?.playbackBufferMs);
24241
24665
  bufferMsRef.current = voice?.playbackBufferMs;
24242
- const phaseRef = (0, import_react23.useRef)(phase);
24666
+ const phaseRef = (0, import_react24.useRef)(phase);
24243
24667
  phaseRef.current = phase;
24244
- const modeRef = (0, import_react23.useRef)(mode);
24668
+ const modeRef = (0, import_react24.useRef)(mode);
24245
24669
  modeRef.current = mode;
24246
- const onTranscriptRef = (0, import_react23.useRef)(onTranscript);
24670
+ const onTranscriptRef = (0, import_react24.useRef)(onTranscript);
24247
24671
  onTranscriptRef.current = onTranscript;
24248
- const itemsRef = (0, import_react23.useRef)(items);
24672
+ const itemsRef = (0, import_react24.useRef)(items);
24249
24673
  itemsRef.current = items;
24250
- const chatStatusRef = (0, import_react23.useRef)(chatStatus);
24674
+ const chatStatusRef = (0, import_react24.useRef)(chatStatus);
24251
24675
  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) => {
24676
+ const streamRef = (0, import_react24.useRef)(null);
24677
+ const recorderRef = (0, import_react24.useRef)(null);
24678
+ const chunksRef = (0, import_react24.useRef)([]);
24679
+ const vadRef = (0, import_react24.useRef)(null);
24680
+ const speechAbortRef = (0, import_react24.useRef)(null);
24681
+ const idleTimerRef = (0, import_react24.useRef)(null);
24682
+ const heardSpeechRef = (0, import_react24.useRef)(false);
24683
+ const sawStreamingRef = (0, import_react24.useRef)(false);
24684
+ const cursorRef = (0, import_react24.useRef)(0);
24685
+ const queueRef = (0, import_react24.useRef)([]);
24686
+ const apply = (0, import_react24.useCallback)((event) => {
24263
24687
  setPhase((current) => nextPhase(current, event));
24264
24688
  }, []);
24265
24689
  const clearIdleTimer = () => {
24266
24690
  if (idleTimerRef.current) clearTimeout(idleTimerRef.current);
24267
24691
  idleTimerRef.current = null;
24268
24692
  };
24269
- const teardownCapture = (0, import_react23.useCallback)(() => {
24693
+ const teardownCapture = (0, import_react24.useCallback)(() => {
24270
24694
  clearIdleTimer();
24271
24695
  try {
24272
24696
  vadRef.current?.destroy();
@@ -24283,11 +24707,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24283
24707
  chunksRef.current = [];
24284
24708
  heardSpeechRef.current = false;
24285
24709
  }, []);
24286
- const stopPlayback = (0, import_react23.useCallback)(() => {
24710
+ const stopPlayback = (0, import_react24.useCallback)(() => {
24287
24711
  speechAbortRef.current?.abort();
24288
24712
  speechAbortRef.current = null;
24289
24713
  }, []);
24290
- const fail = (0, import_react23.useCallback)(
24714
+ const fail = (0, import_react24.useCallback)(
24291
24715
  (message) => {
24292
24716
  teardownCapture();
24293
24717
  stopPlayback();
@@ -24296,7 +24720,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24296
24720
  },
24297
24721
  [apply, teardownCapture, stopPlayback]
24298
24722
  );
24299
- const finishRecording = (0, import_react23.useCallback)(() => {
24723
+ const finishRecording = (0, import_react24.useCallback)(() => {
24300
24724
  const recorder = recorderRef.current;
24301
24725
  if (!recorder || recorder.state === "inactive") return;
24302
24726
  recorder.onstop = async () => {
@@ -24304,7 +24728,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24304
24728
  teardownCapture();
24305
24729
  try {
24306
24730
  const form = new FormData();
24307
- form.set("file", blob, "turn.webm");
24731
+ if (voiceRef.current?.sttEngine === "builtin") form.set("file", await toWav16k(blob), "audio.wav");
24732
+ else form.set("file", blob, "turn.webm");
24308
24733
  const res = await fetch("/api/voice/transcribe", { method: "POST", body: form });
24309
24734
  if (!res.ok) return fail(await res.text());
24310
24735
  const { text } = await res.json();
@@ -24325,7 +24750,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24325
24750
  };
24326
24751
  recorder.stop();
24327
24752
  }, [apply, fail, teardownCapture]);
24328
- const startRecording = (0, import_react23.useCallback)(async () => {
24753
+ const startRecording = (0, import_react24.useCallback)(async () => {
24329
24754
  setError(null);
24330
24755
  chunksRef.current = [];
24331
24756
  heardSpeechRef.current = false;
@@ -24370,7 +24795,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24370
24795
  fail(`Microphone unavailable: ${err}`);
24371
24796
  }
24372
24797
  }, [apply, fail, finishRecording, teardownCapture]);
24373
- const speakReply = (0, import_react23.useCallback)(async () => {
24798
+ const speakReply = (0, import_react24.useCallback)(async () => {
24374
24799
  const text = queueRef.current.shift();
24375
24800
  if (!text) {
24376
24801
  apply({
@@ -24409,10 +24834,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24409
24834
  fail(`Synthesis failed: ${err}`);
24410
24835
  }
24411
24836
  }, [apply, fail]);
24412
- (0, import_react23.useEffect)(() => {
24837
+ (0, import_react24.useEffect)(() => {
24413
24838
  if (chatStatus === "streaming") sawStreamingRef.current = true;
24414
24839
  }, [chatStatus]);
24415
- (0, import_react23.useEffect)(() => {
24840
+ (0, import_react24.useEffect)(() => {
24416
24841
  if (modeRef.current !== "conversation") return;
24417
24842
  if (phaseRef.current === "idle") return;
24418
24843
  const { texts, cursor } = takeFinalizedBubbles(items, cursorRef.current);
@@ -24421,7 +24846,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24421
24846
  queueRef.current.push(...texts);
24422
24847
  apply({ kind: "speechQueued", mode: "conversation", canSpeak });
24423
24848
  }, [items, canSpeak, apply]);
24424
- (0, import_react23.useEffect)(() => {
24849
+ (0, import_react24.useEffect)(() => {
24425
24850
  if (phase !== "awaiting") return;
24426
24851
  if (chatStatus === "error") {
24427
24852
  apply({ kind: "failed", mode: "conversation" });
@@ -24443,8 +24868,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24443
24868
  pendingSpeech: queueRef.current.length
24444
24869
  });
24445
24870
  }, [phase, chatStatus, pendingConfirmCount, canSpeak, apply]);
24446
- const prevPhase = (0, import_react23.useRef)("idle");
24447
- (0, import_react23.useEffect)(() => {
24871
+ const prevPhase = (0, import_react24.useRef)("idle");
24872
+ (0, import_react24.useEffect)(() => {
24448
24873
  const from = prevPhase.current;
24449
24874
  prevPhase.current = phase;
24450
24875
  if (from === phase) return;
@@ -24456,14 +24881,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24456
24881
  queueRef.current = [];
24457
24882
  }
24458
24883
  }, [phase, startRecording, speakReply, teardownCapture, stopPlayback]);
24459
- (0, import_react23.useEffect)(
24884
+ (0, import_react24.useEffect)(
24460
24885
  () => () => {
24461
24886
  teardownCapture();
24462
24887
  stopPlayback();
24463
24888
  },
24464
24889
  [teardownCapture, stopPlayback]
24465
24890
  );
24466
- const toggle = (0, import_react23.useCallback)(() => {
24891
+ const toggle = (0, import_react24.useCallback)(() => {
24467
24892
  if (!available) return;
24468
24893
  const current = phaseRef.current;
24469
24894
  if (current === "idle") {
@@ -24477,7 +24902,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24477
24902
  }
24478
24903
  apply({ kind: "userStop", mode: modeRef.current });
24479
24904
  }, [available, apply, finishRecording]);
24480
- const changeMode = (0, import_react23.useCallback)(
24905
+ const changeMode = (0, import_react24.useCallback)(
24481
24906
  (next) => {
24482
24907
  apply({ kind: "userStop", mode: modeRef.current });
24483
24908
  setMode(next);
@@ -24488,7 +24913,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24488
24913
  }
24489
24914
 
24490
24915
  // src/App.tsx
24491
- var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
24916
+ var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
24492
24917
  function takeInjectedActivation() {
24493
24918
  const w2 = window;
24494
24919
  const id = typeof w2.__caretakerAssistant === "string" ? w2.__caretakerAssistant : null;
@@ -24496,36 +24921,36 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24496
24921
  return id;
24497
24922
  }
24498
24923
  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)(() => {
24924
+ const [chatState, dispatch] = (0, import_react25.useReducer)(chatReducer, initialChatState);
24925
+ const [agents, setAgents] = (0, import_react25.useState)([]);
24926
+ const [sessions, setSessions] = (0, import_react25.useState)([]);
24927
+ const [selectedAgentId, setSelectedAgentId] = (0, import_react25.useState)(null);
24928
+ const [selectedSessionId, setSelectedSessionId] = (0, import_react25.useState)(null);
24929
+ const [showSessions, setShowSessions] = (0, import_react25.useState)(false);
24930
+ const [showAllAgents, setShowAllAgents] = (0, import_react25.useState)(false);
24931
+ const [pendingDelete, setPendingDelete] = (0, import_react25.useState)(null);
24932
+ const [activeScreen, setActiveScreen] = (0, import_react25.useState)("chat");
24933
+ const [settingsTab, setSettingsTab] = (0, import_react25.useState)();
24934
+ const [settingsData, setSettingsData] = (0, import_react25.useState)(null);
24935
+ const [modelsResult, setModelsResult] = (0, import_react25.useState)(null);
24936
+ const [acpRegistry, setAcpRegistry] = (0, import_react25.useState)(null);
24937
+ const [acpInstall, setAcpInstall] = (0, import_react25.useState)(null);
24938
+ const [refreshingSourceId, setRefreshingSourceId] = (0, import_react25.useState)(null);
24939
+ const [refreshOutcome, setRefreshOutcome] = (0, import_react25.useState)(null);
24940
+ const [mcpAuthOutcome, setMcpAuthOutcome] = (0, import_react25.useState)(null);
24941
+ const [taskRuns, setTaskRuns] = (0, import_react25.useState)({});
24942
+ const [voiceConfig, setVoiceConfig] = (0, import_react25.useState)(null);
24943
+ const [sttCatalogResult, setSttCatalogResult] = (0, import_react25.useState)(null);
24944
+ const [ttsCatalogResult, setTtsCatalogResult] = (0, import_react25.useState)(null);
24945
+ const [composerDraft, setComposerDraft] = (0, import_react25.useState)("");
24946
+ const [activation, setActivation] = (0, import_react25.useState)(null);
24947
+ const [confirmedAgentId, setConfirmedAgentId] = (0, import_react25.useState)(null);
24948
+ const [pendingAssistantId, setPendingAssistantId] = (0, import_react25.useState)(() => takeInjectedActivation());
24949
+ const [composerFocusToken, setComposerFocusToken] = (0, import_react25.useState)(0);
24950
+ (0, import_react25.useEffect)(() => {
24526
24951
  postMessage({ type: "webviewReady" });
24527
24952
  }, []);
24528
- (0, import_react24.useEffect)(() => {
24953
+ (0, import_react25.useEffect)(() => {
24529
24954
  function handle(event) {
24530
24955
  const msg = event.data;
24531
24956
  if (!msg || typeof msg !== "object" || !("type" in msg)) return;
@@ -24657,15 +25082,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24657
25082
  if (voice2) msg.voice = true;
24658
25083
  postMessage(msg);
24659
25084
  };
24660
- const onConfirm = (0, import_react24.useCallback)((id, decision) => {
25085
+ const onConfirm = (0, import_react25.useCallback)((id, decision) => {
24661
25086
  dispatch({ kind: "permission-resolved", id });
24662
25087
  postMessage({ type: "permission_response", id, decision });
24663
25088
  }, [postMessage]);
24664
25089
  const onAbort = () => {
24665
25090
  postMessage({ type: "abort" });
24666
25091
  };
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)),
25092
+ const confirmCards = (0, import_react25.useMemo)(
25093
+ () => chatState.pendingConfirms.map((p) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ConfirmCard, { pending: p, onDecide: onConfirm }, p.id)),
24669
25094
  [chatState.pendingConfirms, onConfirm]
24670
25095
  );
24671
25096
  const onSelectAgent = (agentId) => {
@@ -24705,7 +25130,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24705
25130
  const cancelDeleteSession = () => {
24706
25131
  setPendingDelete(null);
24707
25132
  };
24708
- (0, import_react24.useEffect)(() => {
25133
+ (0, import_react25.useEffect)(() => {
24709
25134
  if (!pendingDelete) return;
24710
25135
  function handleKeyDown(event) {
24711
25136
  if (event.key === "Escape") {
@@ -24720,7 +25145,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24720
25145
  setShowSessions(!showSessions);
24721
25146
  }
24722
25147
  };
24723
- (0, import_react24.useEffect)(() => {
25148
+ (0, import_react25.useEffect)(() => {
24724
25149
  function handleClickOutside(event) {
24725
25150
  const target = event.target;
24726
25151
  if (showSessions && !target.closest(".app__sessions-dropdown")) {
@@ -24730,7 +25155,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24730
25155
  document.addEventListener("mousedown", handleClickOutside);
24731
25156
  return () => document.removeEventListener("mousedown", handleClickOutside);
24732
25157
  }, [showSessions]);
24733
- (0, import_react24.useEffect)(() => {
25158
+ (0, import_react25.useEffect)(() => {
24734
25159
  if (!pendingAssistantId) return;
24735
25160
  const r = resolvePending(pendingAssistantId, confirmedAgentId, agents.map((a2) => a2.id), activation);
24736
25161
  setPendingAssistantId(r.pending);
@@ -24739,7 +25164,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24739
25164
  if (r.activation?.step === "awaiting-agent") onSelectAgent(r.activation.agentId);
24740
25165
  setActivation(r.activation);
24741
25166
  }, [pendingAssistantId, agents]);
24742
- (0, import_react24.useEffect)(() => {
25167
+ (0, import_react25.useEffect)(() => {
24743
25168
  if (activation?.step !== "open") return;
24744
25169
  const adopt = localSelectionFor(activation, selectedAgentId);
24745
25170
  if (adopt) {
@@ -24755,7 +25180,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24755
25180
  setActivation(null);
24756
25181
  }
24757
25182
  }, [activation]);
24758
- (0, import_react24.useEffect)(() => {
25183
+ (0, import_react25.useEffect)(() => {
24759
25184
  if (activation?.step !== "mic") return;
24760
25185
  if (voice.mode !== "conversation" || voice.phase !== "idle") return;
24761
25186
  voice.toggle();
@@ -24774,30 +25199,30 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24774
25199
  { id: "projects", label: "Projects", Icon: FolderKanban },
24775
25200
  { id: "settings", label: "Settings", Icon: Settings }
24776
25201
  ];
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)(
25202
+ const navRail = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("nav", { className: "app__nav", children: [
25203
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("img", { src: caretaker_cli_default, alt: "Caretaker", className: "app__logo app__nav-logo" }),
25204
+ navItems.map(({ id, label, Icon: Icon2 }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
24780
25205
  "button",
24781
25206
  {
24782
25207
  className: `app__nav-btn ${activeScreen === id ? "app__nav-btn--active" : ""}`,
24783
25208
  onClick: () => openScreen(id),
24784
25209
  title: label,
24785
25210
  children: [
24786
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon2, { size: 18 }),
24787
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: label })
25211
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon2, { size: 18 }),
25212
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: label })
24788
25213
  ]
24789
25214
  },
24790
25215
  id
24791
25216
  ))
24792
25217
  ] });
24793
25218
  if (activeScreen === "projects" && layout === "sidebar") {
24794
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app app--with-sidebar", children: [
25219
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app app--with-sidebar", children: [
24795
25220
  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 }) })
25221
+ /* @__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
25222
  ] });
24798
25223
  }
24799
25224
  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)(
25225
+ 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
25226
  SettingsPanel,
24802
25227
  {
24803
25228
  layout,
@@ -24820,44 +25245,44 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24820
25245
  onClose: () => setActiveScreen("chat")
24821
25246
  }
24822
25247
  ) });
24823
- return layout === "sidebar" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app app--with-sidebar", children: [
25248
+ return layout === "sidebar" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app app--with-sidebar", children: [
24824
25249
  navRail,
24825
25250
  panel
24826
25251
  ] }) : panel;
24827
25252
  }
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: [
25253
+ 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: [
25254
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__confirm-title", children: "Delete conversation" }),
25255
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("p", { className: "app__confirm-message", children: [
24831
25256
  "Delete conversation \u201C",
24832
25257
  pendingDelete.title,
24833
25258
  "\u201D? This cannot be undone."
24834
25259
  ] }),
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" })
25260
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__confirm-buttons", children: [
25261
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { className: "app__confirm-btn", onClick: cancelDeleteSession, children: "Cancel" }),
25262
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { className: "app__confirm-btn app__confirm-btn--danger", onClick: confirmDeleteSession, children: "Delete" })
24838
25263
  ] })
24839
25264
  ] }) });
24840
25265
  if (layout === "sidebar") {
24841
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app app--with-sidebar", children: [
25266
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app app--with-sidebar", children: [
24842
25267
  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)(
25268
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("aside", { className: "app__sidebar", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sidebar-content", children: [
25269
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sidebar-section", children: [
25270
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__sidebar-section-title", children: "Agents" }),
25271
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__sidebar-agents-list", children: selectedAgentId && !showAllAgents ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
24847
25272
  "button",
24848
25273
  {
24849
25274
  className: "app__sidebar-agent-item app__sidebar-agent-item--collapsed-active",
24850
25275
  onClick: () => setShowAllAgents(true),
24851
25276
  title: "Switch Agent",
24852
25277
  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 })
25278
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "agent-status-dot agent-status-dot--active" }),
25279
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__sidebar-agent-name", children: activeAgent?.name || selectedAgentId }),
25280
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChevronDown, { className: "app__sidebar-chevron", size: 10 })
24856
25281
  ]
24857
25282
  }
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) => {
25283
+ ) : /* @__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
25284
  const isSelected = selectedAgentId === agent.id;
24860
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
25285
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
24861
25286
  "button",
24862
25287
  {
24863
25288
  className: `app__sidebar-agent-item ${isSelected ? "app__sidebar-agent-item--active" : ""}`,
@@ -24870,19 +25295,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24870
25295
  }
24871
25296
  },
24872
25297
  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 })
25298
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: `agent-status-dot ${isSelected ? "agent-status-dot--active" : ""}` }),
25299
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__sidebar-agent-name", children: agent.name }),
25300
+ isSelected && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChevronUp, { className: "app__sidebar-chevron app__sidebar-chevron--up", size: 10 })
24876
25301
  ]
24877
25302
  },
24878
25303
  agent.id
24879
25304
  );
24880
25305
  }) }) })
24881
25306
  ] }),
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)(
25307
+ selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sidebar-section", children: [
25308
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sidebar-section-header", children: [
25309
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__sidebar-section-title", children: "Conversations" }),
25310
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
24886
25311
  "button",
24887
25312
  {
24888
25313
  className: "app__sidebar-new-chat-btn",
@@ -24892,15 +25317,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24892
25317
  }
24893
25318
  )
24894
25319
  ] }),
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)(
25320
+ /* @__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
25321
  "div",
24897
25322
  {
24898
25323
  className: `app__sidebar-session-item ${selectedSessionId === session.id ? "app__sidebar-session-item--active" : ""}`,
24899
25324
  onClick: () => onSelectSession(session.id),
24900
25325
  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)(
25326
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__sidebar-session-icon", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MessageSquare, { size: 13 }) }),
25327
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__sidebar-session-title", title: session.title, children: session.title }),
25328
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
24904
25329
  "button",
24905
25330
  {
24906
25331
  className: "app__sidebar-session-delete",
@@ -24909,7 +25334,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24909
25334
  e.stopPropagation();
24910
25335
  onDeleteSession(session.id, session.title);
24911
25336
  },
24912
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Trash, { size: 12 })
25337
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Trash, { size: 12 })
24913
25338
  }
24914
25339
  )
24915
25340
  ]
@@ -24918,15 +25343,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24918
25343
  )) })
24919
25344
  ] })
24920
25345
  ] }) }),
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" : ""}` }),
25346
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("main", { className: "app__chat-pane", children: selectedAgentId ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
25347
+ /* @__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: [
25348
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h2", { className: "app__chat-header-title", children: selectedAgentName }),
25349
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "app__chat-header-status", children: [
25350
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: `agent-status-dot agent-status-dot--active ${chatState.status === "streaming" ? "agent-status-dot--pulsing" : ""}` }),
24926
25351
  chatState.status === "streaming" ? "Streaming response..." : "Ready"
24927
25352
  ] })
24928
25353
  ] }) }),
24929
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
25354
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
24930
25355
  MessageList,
24931
25356
  {
24932
25357
  items: chatState.items,
@@ -24936,12 +25361,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24936
25361
  trailing: confirmCards
24937
25362
  }
24938
25363
  ),
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 }),
25364
+ (chatState.errorText || voice.error) && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__error", children: [
25365
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TriangleAlert, { size: 14 }),
24941
25366
  " ",
24942
25367
  chatState.errorText || voice.error
24943
25368
  ] }),
24944
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
25369
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
24945
25370
  Composer,
24946
25371
  {
24947
25372
  disabled: composerDisabled,
@@ -24961,18 +25386,18 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24961
25386
  onValueChange: setComposerDraft
24962
25387
  }
24963
25388
  )
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" }) }) }),
25389
+ ] }) : /* @__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
25390
  deleteOverlay
24966
25391
  ] });
24967
25392
  }
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" })
25393
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app", children: [
25394
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("header", { className: "app__header", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__header-row", children: [
25395
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__logo-title-wrapper", children: [
25396
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("img", { src: caretaker_cli_default, alt: "Caretaker", className: "app__logo" }),
25397
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: "Caretaker" })
24973
25398
  ] }),
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)(
25399
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__controls", children: [
25400
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__agent-select-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
24976
25401
  "select",
24977
25402
  {
24978
25403
  className: "app__agent-select",
@@ -24982,12 +25407,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24982
25407
  onSelectAgent(e.target.value);
24983
25408
  },
24984
25409
  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))
25410
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("option", { value: "", disabled: true, children: "-- Select Agent --" }),
25411
+ agents.map((agent) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("option", { value: agent.id, children: agent.name }, agent.id))
24987
25412
  ]
24988
25413
  }
24989
25414
  ) }),
24990
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
25415
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
24991
25416
  "button",
24992
25417
  {
24993
25418
  className: "app__sessions-btn",
@@ -24995,13 +25420,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24995
25420
  disabled: !selectedAgentId,
24996
25421
  title: "View conversations",
24997
25422
  children: [
24998
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(MessageSquare, { size: 13 }),
25423
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MessageSquare, { size: 13 }),
24999
25424
  " ",
25000
25425
  sessions.length
25001
25426
  ]
25002
25427
  }
25003
25428
  ),
25004
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
25429
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25005
25430
  "button",
25006
25431
  {
25007
25432
  className: "app__new-chat-btn",
@@ -25011,7 +25436,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25011
25436
  children: "+ New"
25012
25437
  }
25013
25438
  ),
25014
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
25439
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25015
25440
  "button",
25016
25441
  {
25017
25442
  className: "app__settings-btn",
@@ -25020,24 +25445,24 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25020
25445
  postMessage({ type: "getSettingsData" });
25021
25446
  },
25022
25447
  title: "Caretaker Settings",
25023
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Settings, { className: "app__settings-icon", size: 14 })
25448
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Settings, { className: "app__settings-icon", size: 14 })
25024
25449
  }
25025
25450
  )
25026
25451
  ] })
25027
25452
  ] }) }),
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: [
25453
+ showSessions && sessions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sessions-dropdown", children: [
25454
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sessions-title", children: [
25030
25455
  "Conversations for ",
25031
25456
  selectedAgentName
25032
25457
  ] }),
25033
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__sessions-list", children: sessions.map((session) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
25458
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__sessions-list", children: sessions.map((session) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
25034
25459
  "div",
25035
25460
  {
25036
25461
  className: `app__session-item ${selectedSessionId === session.id ? "app__session-item--active" : ""}`,
25037
25462
  onClick: () => onSelectSession(session.id),
25038
25463
  children: [
25039
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "app__session-item-title", children: session.title }),
25040
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
25464
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__session-item-title", children: session.title }),
25465
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25041
25466
  "button",
25042
25467
  {
25043
25468
  className: "app__session-item-delete",
@@ -25046,7 +25471,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25046
25471
  e.stopPropagation();
25047
25472
  onDeleteSession(session.id, session.title);
25048
25473
  },
25049
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Trash, { size: 12 })
25474
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Trash, { size: 12 })
25050
25475
  }
25051
25476
  )
25052
25477
  ]
@@ -25054,12 +25479,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25054
25479
  session.id
25055
25480
  )) })
25056
25481
  ] }),
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" })
25482
+ showSessions && sessions.length === 0 && selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sessions-dropdown app__sessions-dropdown--empty", children: [
25483
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__sessions-title", children: "No conversations yet" }),
25484
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "app__sessions-empty", children: "Start a new chat to create a conversation" })
25060
25485
  ] }),
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)(
25486
+ !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" }) }),
25487
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25063
25488
  MessageList,
25064
25489
  {
25065
25490
  items: chatState.items,
@@ -25069,12 +25494,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25069
25494
  trailing: confirmCards
25070
25495
  }
25071
25496
  ),
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 }),
25497
+ (chatState.errorText || voice.error) && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__error", children: [
25498
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TriangleAlert, { size: 14 }),
25074
25499
  " ",
25075
25500
  chatState.errorText || voice.error
25076
25501
  ] }),
25077
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
25502
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25078
25503
  Composer,
25079
25504
  {
25080
25505
  disabled: composerDisabled,
@@ -25099,12 +25524,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25099
25524
  }
25100
25525
 
25101
25526
  // src/standalone.tsx
25102
- var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
25527
+ var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
25103
25528
  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)(() => {
25529
+ const [ws, setWs] = (0, import_react26.useState)(null);
25530
+ const [connected, setConnected] = (0, import_react26.useState)(false);
25531
+ const [error, setError] = (0, import_react26.useState)(null);
25532
+ (0, import_react26.useEffect)(() => {
25108
25533
  let active = true;
25109
25534
  const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
25110
25535
  const socket = new WebSocket(`${protocol}//${window.location.host}/api/ws`);
@@ -25150,7 +25575,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25150
25575
  }
25151
25576
  };
25152
25577
  if (error) {
25153
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: {
25578
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: {
25154
25579
  display: "flex",
25155
25580
  flexDirection: "column",
25156
25581
  alignItems: "center",
@@ -25162,9 +25587,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25162
25587
  padding: "20px",
25163
25588
  textAlign: "center"
25164
25589
  }, 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)(
25590
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h3", { style: { color: "#ff6b6b" }, children: "Caretaker Connection Failed" }),
25591
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: error }),
25592
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
25168
25593
  "button",
25169
25594
  {
25170
25595
  onClick: () => setWs(null),
@@ -25183,7 +25608,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25183
25608
  ] });
25184
25609
  }
25185
25610
  if (!connected) {
25186
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: {
25611
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: {
25187
25612
  display: "flex",
25188
25613
  flexDirection: "column",
25189
25614
  alignItems: "center",
@@ -25193,7 +25618,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25193
25618
  background: "#1e1e1e",
25194
25619
  color: "#f1f1f1"
25195
25620
  }, children: [
25196
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { style: {
25621
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: {
25197
25622
  border: "4px solid rgba(255,255,255,0.1)",
25198
25623
  width: "36px",
25199
25624
  height: "36px",
@@ -25202,8 +25627,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25202
25627
  animation: "spin 1s linear infinite",
25203
25628
  marginBottom: "16px"
25204
25629
  } }),
25205
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: "Connecting to Caretaker server..." }),
25206
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("style", { children: `
25630
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "Connecting to Caretaker server..." }),
25631
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("style", { children: `
25207
25632
  @keyframes spin {
25208
25633
  0% { transform: rotate(0deg); }
25209
25634
  100% { transform: rotate(360deg); }
@@ -25211,12 +25636,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25211
25636
  ` })
25212
25637
  ] });
25213
25638
  }
25214
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(App, { postMessage, layout: "sidebar" });
25639
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(App, { postMessage, layout: "sidebar" });
25215
25640
  }
25216
25641
  var rootEl = document.getElementById("root");
25217
25642
  if (!rootEl) throw new Error("#root not found");
25218
25643
  (0, import_client.createRoot)(rootEl).render(
25219
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react25.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(StandaloneApp, {}) })
25644
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react26.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(StandaloneApp, {}) })
25220
25645
  );
25221
25646
  })();
25222
25647
  /*! Bundled license information: