@hyperwindmill/caretaker-cli 0.33.0 → 0.35.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 (47) hide show
  1. package/dist/cli/index.d.ts.map +1 -1
  2. package/dist/cli/index.js +25 -1
  3. package/dist/cli/orchestrator_demo.d.ts +39 -0
  4. package/dist/cli/orchestrator_demo.d.ts.map +1 -0
  5. package/dist/cli/orchestrator_demo.js +98 -0
  6. package/dist/cli/web/api_access.d.ts +38 -0
  7. package/dist/cli/web/api_access.d.ts.map +1 -0
  8. package/dist/cli/web/api_access.js +125 -0
  9. package/dist/cli/web/openapi.d.ts +12 -0
  10. package/dist/cli/web/openapi.d.ts.map +1 -0
  11. package/dist/cli/web/openapi.js +526 -0
  12. package/dist/cli/web/orchestrator.d.ts +51 -0
  13. package/dist/cli/web/orchestrator.d.ts.map +1 -0
  14. package/dist/cli/web/orchestrator.js +596 -0
  15. package/dist/cli/web/orchestrator_core.d.ts +83 -0
  16. package/dist/cli/web/orchestrator_core.d.ts.map +1 -0
  17. package/dist/cli/web/orchestrator_core.js +219 -0
  18. package/dist/cli/web/save_config.d.ts +8 -0
  19. package/dist/cli/web/save_config.d.ts.map +1 -0
  20. package/dist/cli/web/save_config.js +9 -0
  21. package/dist/cli/web/scheduler/task_review.d.ts +8 -0
  22. package/dist/cli/web/scheduler/task_review.d.ts.map +1 -1
  23. package/dist/cli/web/scheduler/task_review.js +17 -1
  24. package/dist/cli/web/scheduler/task_strategy.d.ts.map +1 -1
  25. package/dist/cli/web/scheduler/task_strategy.js +62 -16
  26. package/dist/cli/web/server.d.ts +7 -1
  27. package/dist/cli/web/server.d.ts.map +1 -1
  28. package/dist/cli/web/server.js +44 -25
  29. package/dist/harness/tools/builtin/task_tools.d.ts.map +1 -1
  30. package/dist/harness/tools/builtin/task_tools.js +5 -17
  31. package/dist/lib/task_git.d.ts +3 -0
  32. package/dist/lib/task_git.d.ts.map +1 -1
  33. package/dist/lib/task_git.js +29 -0
  34. package/dist/store/db.d.ts +12 -0
  35. package/dist/store/db.d.ts.map +1 -1
  36. package/dist/store/db.js +37 -0
  37. package/dist/store/json.d.ts +29 -0
  38. package/dist/store/json.d.ts.map +1 -1
  39. package/dist/store/json.js +54 -0
  40. package/dist/store/orchestrator.d.ts +50 -0
  41. package/dist/store/orchestrator.d.ts.map +1 -0
  42. package/dist/store/orchestrator.js +127 -0
  43. package/dist/webview/standalone.css +159 -1
  44. package/dist/webview/standalone.css.map +2 -2
  45. package/dist/webview/standalone.js +933 -495
  46. package/dist/webview/standalone.js.map +4 -4
  47. package/package.json +3 -3
@@ -14583,11 +14583,11 @@
14583
14583
  });
14584
14584
 
14585
14585
  // src/standalone.tsx
14586
- var import_react26 = __toESM(require_react(), 1);
14586
+ var import_react28 = __toESM(require_react(), 1);
14587
14587
  var import_client = __toESM(require_client(), 1);
14588
14588
 
14589
14589
  // src/App.tsx
14590
- var import_react25 = __toESM(require_react(), 1);
14590
+ var import_react27 = __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_react22 = __toESM(require_react(), 1);
17395
+ var import_react24 = __toESM(require_react(), 1);
17396
17396
 
17397
17397
  // src/ProvidersTab.tsx
17398
17398
  var import_react7 = __toESM(require_react(), 1);
@@ -22970,8 +22970,471 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22970
22970
  ] });
22971
22971
  }
22972
22972
 
22973
- // src/SettingsPanel.tsx
22973
+ // src/ApiAccessTab.tsx
22974
+ var import_react22 = __toESM(require_react(), 1);
22974
22975
  var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
22976
+ function ApiAccessTab() {
22977
+ const [status, setStatus] = (0, import_react22.useState)(null);
22978
+ const [port, setPort] = (0, import_react22.useState)("");
22979
+ const [name, setName] = (0, import_react22.useState)("");
22980
+ const [created, setCreated] = (0, import_react22.useState)(null);
22981
+ const [copied, setCopied] = (0, import_react22.useState)(false);
22982
+ const [confirmId, setConfirmId] = (0, import_react22.useState)(null);
22983
+ const [error, setError] = (0, import_react22.useState)(null);
22984
+ const call = (0, import_react22.useCallback)(async (path, init) => {
22985
+ setError(null);
22986
+ try {
22987
+ const res = await fetch(path, {
22988
+ ...init,
22989
+ headers: init?.body ? { "content-type": "application/json" } : void 0
22990
+ });
22991
+ const data = await res.json();
22992
+ if (!res.ok) {
22993
+ setError(data?.error ?? `Request failed (${res.status})`);
22994
+ return null;
22995
+ }
22996
+ setStatus(data);
22997
+ return data;
22998
+ } catch {
22999
+ setError("The server did not answer.");
23000
+ return null;
23001
+ }
23002
+ }, []);
23003
+ (0, import_react22.useEffect)(() => {
23004
+ void call("/api/access").then((s) => {
23005
+ if (s) setPort(s.port === null ? "" : String(s.port));
23006
+ });
23007
+ }, [call]);
23008
+ const savePort = () => call("/api/access/port", { method: "PUT", body: JSON.stringify({ port: port.trim() === "" ? null : port }) });
23009
+ const createToken = async () => {
23010
+ const data = await call("/api/access/tokens", { method: "POST", body: JSON.stringify({ name }) });
23011
+ if (!data?.token) return;
23012
+ setCreated(data.token);
23013
+ setCopied(false);
23014
+ setName("");
23015
+ };
23016
+ const revoke = async (id) => {
23017
+ setConfirmId(null);
23018
+ await call(`/api/access/tokens/${encodeURIComponent(id)}`, { method: "DELETE" });
23019
+ };
23020
+ const copy = async () => {
23021
+ if (!created) return;
23022
+ try {
23023
+ await navigator.clipboard.writeText(created);
23024
+ setCopied(true);
23025
+ } catch {
23026
+ }
23027
+ };
23028
+ if (!status) {
23029
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "glass-form", children: [
23030
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h4", { children: "API access" }),
23031
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "glass-form__body", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { className: error ? "form-error" : void 0, children: error ?? "Loading\u2026" }) })
23032
+ ] });
23033
+ }
23034
+ const { listener, portOverride } = status;
23035
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "glass-form", children: [
23036
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h4", { children: "API access" }),
23037
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "glass-form__body", children: [
23038
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "form-group", children: [
23039
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("label", { htmlFor: "api-access-port", children: "API port" }),
23040
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23041
+ "input",
23042
+ {
23043
+ id: "api-access-port",
23044
+ type: "number",
23045
+ min: 1,
23046
+ max: 65535,
23047
+ placeholder: "off",
23048
+ value: port,
23049
+ onChange: (e) => setPort(e.target.value)
23050
+ }
23051
+ ),
23052
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("small", { children: [
23053
+ "A second port that serves the REST API to scripts and other programs. Every request to it must carry ",
23054
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("code", { children: "Authorization: Bearer <token>" }),
23055
+ ". Leave empty to keep it off. The address you are using now is not affected: it stays without authentication, so keep it on this machine or behind an authenticating proxy."
23056
+ ] }),
23057
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("small", { children: [
23058
+ "The project and task routes are described at",
23059
+ " ",
23060
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("a", { href: "/api/docs", target: "_blank", rel: "noreferrer", children: "/api/docs" }),
23061
+ " ",
23062
+ "(OpenAPI document: ",
23063
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("code", { children: "/api/openapi.json" }),
23064
+ ")."
23065
+ ] }),
23066
+ portOverride !== null && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("small", { children: [
23067
+ "This server was started with ",
23068
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("code", { children: [
23069
+ "--api-port ",
23070
+ portOverride
23071
+ ] }),
23072
+ ", which takes precedence over the saved port until it restarts without it."
23073
+ ] }),
23074
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { role: "status", "aria-live": "polite", className: listener?.error ? "form-error" : void 0, children: !listener ? "The API is off." : listener.error ? `The API could not start on port ${listener.port}: ${listener.error}` : `The API is listening on ${listener.host}:${listener.port}.` })
23075
+ ] }),
23076
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "form-actions", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", onClick: savePort, children: "Save port" }) }),
23077
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "form-group", children: [
23078
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("label", { htmlFor: "api-access-token-name", children: "Tokens" }),
23079
+ status.tokens.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "No tokens yet. Without one, every request to the API port is refused." }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "settings-list", children: status.tokens.map((t) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "settings-card", children: [
23080
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "settings-card__body", children: [
23081
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "settings-card__title", children: t.name }),
23082
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "settings-card__metadata", children: [
23083
+ "Created ",
23084
+ new Date(t.createdAt).toLocaleString()
23085
+ ] })
23086
+ ] }),
23087
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "settings-card__actions", children: confirmId === t.id ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
23088
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "btn btn--secondary btn--xs", onClick: () => revoke(t.id), children: "Confirm revoke" }),
23089
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "btn btn--secondary btn--xs", onClick: () => setConfirmId(null), children: "Cancel" })
23090
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "btn btn--secondary btn--xs", onClick: () => setConfirmId(t.id), children: "Revoke" }) })
23091
+ ] }, t.id)) })
23092
+ ] }),
23093
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "form-group", children: [
23094
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23095
+ "input",
23096
+ {
23097
+ id: "api-access-token-name",
23098
+ type: "text",
23099
+ placeholder: "Name, e.g. the program that will use it",
23100
+ maxLength: 80,
23101
+ value: name,
23102
+ onChange: (e) => setName(e.target.value)
23103
+ }
23104
+ ),
23105
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "form-actions", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", onClick: createToken, disabled: !name.trim(), children: "Create token" }) }),
23106
+ created && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
23107
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "Copy this token now. It is not stored and cannot be shown again." }),
23108
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", { type: "text", readOnly: true, value: created, "aria-label": "New token", onFocus: (e) => e.target.select() }),
23109
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "form-actions", children: [
23110
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", onClick: copy, children: "Copy" }),
23111
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", onClick: () => setCreated(null), children: "Done" }),
23112
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { role: "status", "aria-live": "polite", className: "form-save-state", children: copied ? "Copied \u2713" : "" })
23113
+ ] })
23114
+ ] })
23115
+ ] }),
23116
+ error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { role: "alert", className: "form-error", children: error })
23117
+ ] })
23118
+ ] });
23119
+ }
23120
+
23121
+ // src/OrchestrationTab.tsx
23122
+ var import_react23 = __toESM(require_react(), 1);
23123
+ var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
23124
+ function relativeTime(iso) {
23125
+ if (!iso) return "never";
23126
+ const diffSec = Math.max(0, Math.round((Date.now() - Date.parse(iso)) / 1e3));
23127
+ if (diffSec < 60) return `${diffSec}s ago`;
23128
+ const diffMin = Math.round(diffSec / 60);
23129
+ if (diffMin < 60) return `${diffMin}m ago`;
23130
+ return `${Math.round(diffMin / 60)}h ago`;
23131
+ }
23132
+ function formatTime(iso) {
23133
+ const d = new Date(iso);
23134
+ if (Number.isNaN(d.getTime())) return iso;
23135
+ return d.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
23136
+ }
23137
+ function statusText(status) {
23138
+ switch (status.state) {
23139
+ case "off":
23140
+ return "Off";
23141
+ case "registering":
23142
+ return "Registering\u2026";
23143
+ case "connected": {
23144
+ const target = status.orchestratorName ? `"${status.orchestratorName}"` : "orchestrator";
23145
+ return `Connected to ${target} \xB7 last poll ${relativeTime(status.lastPollAt)}`;
23146
+ }
23147
+ case "error":
23148
+ return `Error: ${status.lastError ?? "Unknown error"}`;
23149
+ }
23150
+ }
23151
+ function OrchestrationTab({ onPendingChange }) {
23152
+ const [view, setView] = (0, import_react23.useState)(null);
23153
+ const [enabled, setEnabled] = (0, import_react23.useState)(false);
23154
+ const [name, setName] = (0, import_react23.useState)("");
23155
+ const [endpoint, setEndpoint] = (0, import_react23.useState)("");
23156
+ const [token, setToken] = (0, import_react23.useState)("");
23157
+ const [pollSeconds, setPollSeconds] = (0, import_react23.useState)("15");
23158
+ const [policy, setPolicy] = (0, import_react23.useState)("approve");
23159
+ const [error, setError] = (0, import_react23.useState)(null);
23160
+ const [loadError, setLoadError] = (0, import_react23.useState)(null);
23161
+ const [testResult, setTestResult] = (0, import_react23.useState)(null);
23162
+ const [busy, setBusy] = (0, import_react23.useState)(false);
23163
+ const seededRef = (0, import_react23.useRef)(false);
23164
+ const seedForm = (0, import_react23.useCallback)((cfg) => {
23165
+ setEnabled(cfg.enabled);
23166
+ setName(cfg.name);
23167
+ setEndpoint(cfg.endpoint);
23168
+ setToken("");
23169
+ setPollSeconds(String(cfg.pollSeconds));
23170
+ setPolicy(cfg.policy);
23171
+ }, []);
23172
+ const call = (0, import_react23.useCallback)(
23173
+ async (path, init, report = setError) => {
23174
+ report(null);
23175
+ try {
23176
+ const res = await fetch(path, {
23177
+ ...init,
23178
+ headers: init?.body ? { "content-type": "application/json" } : void 0
23179
+ });
23180
+ const data = await res.json();
23181
+ if (!res.ok) {
23182
+ report(data?.error ?? `Request failed (${res.status})`);
23183
+ return null;
23184
+ }
23185
+ return data;
23186
+ } catch {
23187
+ report("The server did not answer.");
23188
+ return null;
23189
+ }
23190
+ },
23191
+ []
23192
+ );
23193
+ const refresh = (0, import_react23.useCallback)(async () => {
23194
+ const data = await call("/api/orchestrator", void 0, setLoadError);
23195
+ if (!data) return;
23196
+ setView(data);
23197
+ onPendingChange?.(data.pending);
23198
+ if (!seededRef.current) {
23199
+ seededRef.current = true;
23200
+ seedForm(data.config);
23201
+ }
23202
+ }, [call, onPendingChange, seedForm]);
23203
+ (0, import_react23.useEffect)(() => {
23204
+ void refresh();
23205
+ const timer = setInterval(() => {
23206
+ void refresh();
23207
+ }, 5e3);
23208
+ return () => clearInterval(timer);
23209
+ }, [refresh]);
23210
+ const handleSave = async () => {
23211
+ setBusy(true);
23212
+ setTestResult(null);
23213
+ const data = await call("/api/orchestrator", {
23214
+ method: "PUT",
23215
+ body: JSON.stringify({
23216
+ enabled,
23217
+ name,
23218
+ endpoint,
23219
+ token,
23220
+ pollSeconds: Number(pollSeconds),
23221
+ policy
23222
+ })
23223
+ });
23224
+ setBusy(false);
23225
+ if (data) {
23226
+ setView(data);
23227
+ onPendingChange?.(data.pending);
23228
+ seedForm(data.config);
23229
+ }
23230
+ };
23231
+ const handleTest = async () => {
23232
+ setBusy(true);
23233
+ setTestResult(null);
23234
+ const res = await call("/api/orchestrator/test", {
23235
+ method: "POST",
23236
+ body: JSON.stringify({ endpoint, token })
23237
+ });
23238
+ setBusy(false);
23239
+ if (res) setTestResult(res);
23240
+ };
23241
+ const handleDecision = async (id, decision) => {
23242
+ await call(`/api/orchestrator/messages/${encodeURIComponent(id)}/${decision}`, {
23243
+ method: "POST"
23244
+ });
23245
+ await refresh();
23246
+ };
23247
+ if (!view) {
23248
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "glass-form", children: [
23249
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { children: "Orchestration" }),
23250
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "glass-form__body", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { className: loadError ? "form-error" : void 0, children: loadError ?? "Loading\u2026" }) })
23251
+ ] });
23252
+ }
23253
+ const pendingMessages = view.messages.filter((m2) => m2.state === "pending");
23254
+ const activityMessages = view.messages.filter((m2) => m2.state !== "pending");
23255
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "glass-form", children: [
23256
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "orchestration-tab__header", children: [
23257
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { children: "Orchestration" }),
23258
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: `orchestration-tab__status orchestration-tab__status--${view.status.state}`, children: statusText(view.status) })
23259
+ ] }),
23260
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "glass-form__body", children: [
23261
+ loadError && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { className: "form-error", children: loadError }),
23262
+ error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { className: "form-error", children: error }),
23263
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "form-checkbox", children: [
23264
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23265
+ "input",
23266
+ {
23267
+ type: "checkbox",
23268
+ checked: enabled,
23269
+ onChange: (e) => setEnabled(e.target.checked)
23270
+ }
23271
+ ),
23272
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "Enabled" })
23273
+ ] }),
23274
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "form-group", children: [
23275
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "orch-name", children: "Instance name" }),
23276
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23277
+ "input",
23278
+ {
23279
+ id: "orch-name",
23280
+ type: "text",
23281
+ value: name,
23282
+ onChange: (e) => setName(e.target.value),
23283
+ placeholder: "My workstation"
23284
+ }
23285
+ )
23286
+ ] }),
23287
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "form-group", children: [
23288
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "orch-endpoint", children: "Endpoint" }),
23289
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23290
+ "input",
23291
+ {
23292
+ id: "orch-endpoint",
23293
+ type: "text",
23294
+ value: endpoint,
23295
+ onChange: (e) => setEndpoint(e.target.value),
23296
+ placeholder: "https://orchestrator.example.com/v1"
23297
+ }
23298
+ )
23299
+ ] }),
23300
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "form-group", children: [
23301
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "orch-token", children: "Token" }),
23302
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23303
+ "input",
23304
+ {
23305
+ id: "orch-token",
23306
+ type: "password",
23307
+ value: token,
23308
+ onChange: (e) => setToken(e.target.value),
23309
+ placeholder: view.config.hasToken ? "Leave blank to keep the saved token" : "Bearer token"
23310
+ }
23311
+ )
23312
+ ] }),
23313
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "form-group", children: [
23314
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "orch-poll", children: "Poll every (seconds)" }),
23315
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23316
+ "input",
23317
+ {
23318
+ id: "orch-poll",
23319
+ type: "number",
23320
+ min: 5,
23321
+ max: 3600,
23322
+ value: pollSeconds,
23323
+ onChange: (e) => setPollSeconds(e.target.value)
23324
+ }
23325
+ )
23326
+ ] }),
23327
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "form-group", children: [
23328
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { children: "Policy" }),
23329
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "orchestration-tab__radios", children: [
23330
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "form-radio", children: [
23331
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23332
+ "input",
23333
+ {
23334
+ type: "radio",
23335
+ name: "orch-policy",
23336
+ checked: policy === "approve",
23337
+ onChange: () => setPolicy("approve")
23338
+ }
23339
+ ),
23340
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "Ask me before applying changes" })
23341
+ ] }),
23342
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "form-radio", children: [
23343
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23344
+ "input",
23345
+ {
23346
+ type: "radio",
23347
+ name: "orch-policy",
23348
+ checked: policy === "auto",
23349
+ onChange: () => setPolicy("auto")
23350
+ }
23351
+ ),
23352
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "Apply automatically" })
23353
+ ] }),
23354
+ policy === "auto" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { className: "orchestration-tab__warning", children: "The orchestrator can create projects and start tasks on this machine without asking." })
23355
+ ] })
23356
+ ] }),
23357
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "orchestration-tab__actions", children: [
23358
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", className: "btn btn--secondary btn--sm", onClick: handleTest, disabled: busy, children: "Test connection" }),
23359
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", className: "btn btn--primary btn--sm", onClick: handleSave, disabled: busy, children: "Save" })
23360
+ ] }),
23361
+ testResult && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { className: testResult.ok ? "orchestration-tab__test-ok" : "form-error", children: testResult.ok ? `\u2713 Reached "${testResult.name || "orchestrator"}" (protocol ${testResult.protocol})` : testResult.error ?? "Connection test failed." })
23362
+ ] }),
23363
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "orchestration-tab__section", children: [
23364
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("h5", { children: [
23365
+ "Waiting for approval (",
23366
+ pendingMessages.length,
23367
+ ")"
23368
+ ] }),
23369
+ pendingMessages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { className: "orchestration-tab__empty", children: "No pending messages." }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "orchestration-tab__list", children: pendingMessages.map((m2) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "orchestration-tab__pending-row", children: [
23370
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "orchestration-tab__pending-main", children: [
23371
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("code", { children: m2.method }),
23372
+ " ",
23373
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: m2.path }),
23374
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "orchestration-tab__row-actions", children: [
23375
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23376
+ "button",
23377
+ {
23378
+ type: "button",
23379
+ className: "btn btn--primary btn--xs",
23380
+ onClick: () => void handleDecision(m2.id, "approve"),
23381
+ children: "Approve"
23382
+ }
23383
+ ),
23384
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
23385
+ "button",
23386
+ {
23387
+ type: "button",
23388
+ className: "btn btn--secondary btn--xs",
23389
+ onClick: () => void handleDecision(m2.id, "reject"),
23390
+ children: "Reject"
23391
+ }
23392
+ )
23393
+ ] })
23394
+ ] }),
23395
+ m2.body !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("details", { className: "orchestration-tab__details", children: [
23396
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("summary", { children: "Body" }),
23397
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("pre", { children: JSON.stringify(m2.body, null, 2) })
23398
+ ] })
23399
+ ] }, m2.id)) })
23400
+ ] }),
23401
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "orchestration-tab__section", children: [
23402
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h5", { children: "Activity" }),
23403
+ activityMessages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { className: "orchestration-tab__empty", children: "No activity yet." }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "orchestration-tab__list", children: activityMessages.map((m2) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "orchestration-tab__activity-row", children: [
23404
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "orchestration-tab__time", children: formatTime(m2.resolvedAt ?? m2.receivedAt) }),
23405
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("code", { children: m2.method }),
23406
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "orchestration-tab__path", children: m2.path }),
23407
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "orchestration-tab__code", children: m2.status === 403 ? "403 rejected" : m2.status ?? m2.state })
23408
+ ] }, m2.id)) })
23409
+ ] })
23410
+ ] });
23411
+ }
23412
+
23413
+ // src/settings_tabs.ts
23414
+ var ALL_TABS = [
23415
+ { id: "providers", label: "Providers" },
23416
+ { id: "projects", label: "Projects", sidebarOnly: true },
23417
+ { id: "agents", label: "Agents" },
23418
+ { id: "plugins", label: "Plugins" },
23419
+ { id: "mcp", label: "MCP" },
23420
+ { id: "services", label: "Services", sidebarOnly: true },
23421
+ // Voice is out of scope for the VSCode sidebar (webview CSP blocks the mic).
23422
+ { id: "voice", label: "Voice", sidebarOnly: true },
23423
+ // The memory sweep runs only in the web server's scheduler.
23424
+ { id: "memory", label: "Memory", sidebarOnly: true },
23425
+ // Only the Electron desktop app acts on the assistant shortcut (runs web server).
23426
+ { id: "desktop", label: "Desktop", sidebarOnly: true },
23427
+ // The API listener belongs to the web server; /api/access exists only there.
23428
+ { id: "api", label: "API", sidebarOnly: true },
23429
+ // Remote orchestration runs only in the web server; /api/orchestrator exists only there.
23430
+ { id: "orchestration", label: "Orchestration", sidebarOnly: true }
23431
+ ];
23432
+ function settingsTabs(layout) {
23433
+ return ALL_TABS.filter((t) => layout === "sidebar" || !t.sidebarOnly).map(({ id, label }) => ({ id, label }));
23434
+ }
23435
+
23436
+ // src/SettingsPanel.tsx
23437
+ var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
22975
23438
  function SettingsPanel({
22976
23439
  layout = "compact",
22977
23440
  postMessage,
@@ -22990,18 +23453,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
22990
23453
  setMcpAuthOutcome,
22991
23454
  taskRuns = {},
22992
23455
  onClose,
22993
- initialTab = "providers"
23456
+ initialTab = "providers",
23457
+ orchestrationPending = 0,
23458
+ onOrchestrationPendingChange
22994
23459
  }) {
22995
- const [activeTab, setActiveTab] = (0, import_react22.useState)(initialTab);
23460
+ const [activeTab, setActiveTab] = (0, import_react24.useState)(initialTab);
22996
23461
  if (!settingsData) {
22997
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "settings-panel settings-panel--loading", children: [
22998
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { className: "settings-panel__back-btn", onClick: onClose, children: [
22999
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ArrowLeft, { size: 14 }),
23462
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "settings-panel settings-panel--loading", children: [
23463
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("button", { className: "settings-panel__back-btn", onClick: onClose, children: [
23464
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ArrowLeft, { size: 14 }),
23000
23465
  " Back to Chat"
23001
23466
  ] }),
23002
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "settings-panel__loading-spinner", children: [
23003
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "spinner" }),
23004
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "Loading configurations..." })
23467
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "settings-panel__loading-spinner", children: [
23468
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "spinner" }),
23469
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: "Loading configurations..." })
23005
23470
  ] })
23006
23471
  ] });
23007
23472
  }
@@ -23009,7 +23474,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23009
23474
  const renderTabContent = () => {
23010
23475
  switch (activeTab) {
23011
23476
  case "providers":
23012
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23477
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23013
23478
  ProvidersTab,
23014
23479
  {
23015
23480
  config,
@@ -23021,7 +23486,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23021
23486
  }
23022
23487
  );
23023
23488
  case "projects":
23024
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23489
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23025
23490
  ProjectsTabSettings,
23026
23491
  {
23027
23492
  config,
@@ -23030,7 +23495,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23030
23495
  }
23031
23496
  );
23032
23497
  case "agents":
23033
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23498
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23034
23499
  AgentsTab,
23035
23500
  {
23036
23501
  config,
@@ -23044,7 +23509,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23044
23509
  }
23045
23510
  );
23046
23511
  case "plugins":
23047
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23512
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23048
23513
  PluginsTab,
23049
23514
  {
23050
23515
  pluginsFile,
@@ -23055,7 +23520,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23055
23520
  }
23056
23521
  );
23057
23522
  case "mcp":
23058
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23523
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23059
23524
  McpTab,
23060
23525
  {
23061
23526
  mcpServersFile,
@@ -23065,7 +23530,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23065
23530
  }
23066
23531
  );
23067
23532
  case "services":
23068
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23533
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23069
23534
  ServicesTab,
23070
23535
  {
23071
23536
  config,
@@ -23075,7 +23540,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23075
23540
  }
23076
23541
  );
23077
23542
  case "voice":
23078
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23543
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23079
23544
  VoiceTab,
23080
23545
  {
23081
23546
  config,
@@ -23086,7 +23551,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23086
23551
  }
23087
23552
  );
23088
23553
  case "memory":
23089
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23554
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23090
23555
  MemoryTab,
23091
23556
  {
23092
23557
  config,
@@ -23095,7 +23560,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23095
23560
  }
23096
23561
  );
23097
23562
  case "desktop":
23098
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23563
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
23099
23564
  DesktopTab,
23100
23565
  {
23101
23566
  config,
@@ -23103,99 +23568,41 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23103
23568
  onSave: (updatedConfig) => postMessage({ type: "saveConfig", config: updatedConfig })
23104
23569
  }
23105
23570
  );
23571
+ case "api":
23572
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ApiAccessTab, {});
23573
+ case "orchestration":
23574
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(OrchestrationTab, { onPendingChange: onOrchestrationPendingChange });
23106
23575
  }
23107
23576
  };
23108
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "settings-panel", children: [
23109
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { className: "settings-panel__header", children: [
23110
- layout !== "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { className: "settings-panel__back-btn", onClick: onClose, title: "Go back to chat", children: [
23111
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ArrowLeft, { size: 14 }),
23577
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: `settings-panel${layout === "sidebar" ? " settings-panel--vertical" : ""}`, children: [
23578
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("header", { className: "settings-panel__header", children: [
23579
+ layout !== "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("button", { className: "settings-panel__back-btn", onClick: onClose, title: "Go back to chat", children: [
23580
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ArrowLeft, { size: 14 }),
23112
23581
  " Chat"
23113
23582
  ] }),
23114
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h2", { className: "settings-panel__title", children: "Caretaker Config" })
23115
- ] }),
23116
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("nav", { className: "settings-panel__tabs", children: [
23117
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23118
- "button",
23119
- {
23120
- className: `settings-panel__tab-btn ${activeTab === "providers" ? "settings-panel__tab-btn--active" : ""}`,
23121
- onClick: () => setActiveTab("providers"),
23122
- children: "Providers"
23123
- }
23124
- ),
23125
- layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23126
- "button",
23127
- {
23128
- className: `settings-panel__tab-btn ${activeTab === "projects" ? "settings-panel__tab-btn--active" : ""}`,
23129
- onClick: () => setActiveTab("projects"),
23130
- children: "Projects"
23131
- }
23132
- ),
23133
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23134
- "button",
23135
- {
23136
- className: `settings-panel__tab-btn ${activeTab === "agents" ? "settings-panel__tab-btn--active" : ""}`,
23137
- onClick: () => setActiveTab("agents"),
23138
- children: "Agents"
23139
- }
23140
- ),
23141
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23142
- "button",
23143
- {
23144
- className: `settings-panel__tab-btn ${activeTab === "plugins" ? "settings-panel__tab-btn--active" : ""}`,
23145
- onClick: () => setActiveTab("plugins"),
23146
- children: "Plugins"
23147
- }
23148
- ),
23149
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23150
- "button",
23151
- {
23152
- className: `settings-panel__tab-btn ${activeTab === "mcp" ? "settings-panel__tab-btn--active" : ""}`,
23153
- onClick: () => setActiveTab("mcp"),
23154
- children: "MCP"
23155
- }
23156
- ),
23157
- layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23158
- "button",
23159
- {
23160
- className: `settings-panel__tab-btn ${activeTab === "services" ? "settings-panel__tab-btn--active" : ""}`,
23161
- onClick: () => setActiveTab("services"),
23162
- children: "Services"
23163
- }
23164
- ),
23165
- layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23166
- "button",
23167
- {
23168
- className: `settings-panel__tab-btn ${activeTab === "voice" ? "settings-panel__tab-btn--active" : ""}`,
23169
- onClick: () => setActiveTab("voice"),
23170
- children: "Voice"
23171
- }
23172
- ),
23173
- layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23174
- "button",
23175
- {
23176
- className: `settings-panel__tab-btn ${activeTab === "memory" ? "settings-panel__tab-btn--active" : ""}`,
23177
- onClick: () => setActiveTab("memory"),
23178
- children: "Memory"
23179
- }
23180
- ),
23181
- layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
23182
- "button",
23183
- {
23184
- className: `settings-panel__tab-btn ${activeTab === "desktop" ? "settings-panel__tab-btn--active" : ""}`,
23185
- onClick: () => setActiveTab("desktop"),
23186
- children: "Desktop"
23187
- }
23188
- )
23583
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { className: "settings-panel__title", children: "Caretaker Config" })
23189
23584
  ] }),
23190
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("main", { className: "settings-panel__content", children: renderTabContent() })
23585
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("nav", { className: "settings-panel__tabs", children: settingsTabs(layout).map((tab) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
23586
+ "button",
23587
+ {
23588
+ className: `settings-panel__tab-btn ${activeTab === tab.id ? "settings-panel__tab-btn--active" : ""}`,
23589
+ onClick: () => setActiveTab(tab.id),
23590
+ children: [
23591
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: tab.label }),
23592
+ tab.id === "orchestration" && orchestrationPending > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "settings-panel__badge", children: orchestrationPending })
23593
+ ]
23594
+ },
23595
+ tab.id
23596
+ )) }),
23597
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("main", { className: "settings-panel__content", children: renderTabContent() })
23191
23598
  ] });
23192
23599
  }
23193
23600
 
23194
23601
  // src/ProjectsTab.tsx
23195
- var import_react23 = __toESM(require_react(), 1);
23602
+ var import_react25 = __toESM(require_react(), 1);
23196
23603
 
23197
23604
  // src/TaskCycleView.tsx
23198
- var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
23605
+ var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
23199
23606
  function TaskCycleView({ item, postMessage, onBack }) {
23200
23607
  const { sessionId, agentId } = item;
23201
23608
  const chat = useCycleStream(sessionId, {
@@ -23205,25 +23612,25 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23205
23612
  onDone: () => postMessage({ type: "watchCycle", agentId, sessionId })
23206
23613
  });
23207
23614
  const running = chat.status === "streaming";
23208
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: [
23209
- /* @__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: [
23210
- /* @__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 }) }),
23211
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "app__chat-header-info", children: [
23212
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("h3", { className: "app__chat-header-title", style: { fontSize: "13px", margin: 0 }, children: [
23615
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: [
23616
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("header", { className: "app__chat-header task-view__sub-header", style: { padding: "10px 14px" }, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
23617
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { className: "settings-panel__back-btn", onClick: onBack, title: "Back to the task thread", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ArrowLeft, { size: 13 }) }),
23618
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__chat-header-info", children: [
23619
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("h3", { className: "app__chat-header-title", style: { fontSize: "13px", margin: 0 }, children: [
23213
23620
  cycleRoleLabel(item.role),
23214
23621
  " cycle",
23215
23622
  item.label ? ` \xB7 ${item.label}` : ""
23216
23623
  ] }),
23217
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "app__chat-header-status", style: { fontSize: "10px" }, children: running ? "running" : cycleOutcomeLabel(item.outcome) })
23624
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__chat-header-status", style: { fontSize: "10px" }, children: running ? "running" : cycleOutcomeLabel(item.outcome) })
23218
23625
  ] })
23219
23626
  ] }) }),
23220
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MessageList, { items: chat.items, sessionId: null, isStreaming: running, agentName: item.label }),
23221
- chat.errorText && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "notice notice--block", children: chat.errorText })
23627
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MessageList, { items: chat.items, sessionId: null, isStreaming: running, agentName: item.label }),
23628
+ chat.errorText && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "notice notice--block", children: chat.errorText })
23222
23629
  ] });
23223
23630
  }
23224
23631
 
23225
23632
  // src/ProjectsTab.tsx
23226
- var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
23633
+ var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
23227
23634
  var LS_ARCHIVED_KEY = "caretaker.taskView.showArchived";
23228
23635
  function persistLastProject(id) {
23229
23636
  void fetch("/api/ui-state", {
@@ -23248,15 +23655,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23248
23655
  }
23249
23656
  var PAGE_SIZE = 20;
23250
23657
  function ProjectsTab({ agents, onOpenSettings, postMessage }) {
23251
- const [projects, setProjects] = (0, import_react23.useState)([]);
23252
- const [selectedProjectId, setSelectedProjectId] = (0, import_react23.useState)(null);
23253
- const [tasks, setTasks] = (0, import_react23.useState)([]);
23254
- const [selectedTaskId, setSelectedTaskId] = (0, import_react23.useState)(null);
23255
- const [taskMessages, setTaskMessages] = (0, import_react23.useState)([]);
23256
- const [view, setView] = (0, import_react23.useState)("list");
23257
- const [page, setPage] = (0, import_react23.useState)(0);
23258
- const [isNewTaskOpen, setIsNewTaskOpen] = (0, import_react23.useState)(false);
23259
- const [newTask, setNewTask] = (0, import_react23.useState)({
23658
+ const [projects, setProjects] = (0, import_react25.useState)([]);
23659
+ const [selectedProjectId, setSelectedProjectId] = (0, import_react25.useState)(null);
23660
+ const [tasks, setTasks] = (0, import_react25.useState)([]);
23661
+ const [selectedTaskId, setSelectedTaskId] = (0, import_react25.useState)(null);
23662
+ const [taskMessages, setTaskMessages] = (0, import_react25.useState)([]);
23663
+ const [view, setView] = (0, import_react25.useState)("list");
23664
+ const [page, setPage] = (0, import_react25.useState)(0);
23665
+ const [isNewTaskOpen, setIsNewTaskOpen] = (0, import_react25.useState)(false);
23666
+ const [newTask, setNewTask] = (0, import_react25.useState)({
23260
23667
  title: "",
23261
23668
  objective: "",
23262
23669
  checklistText: "",
@@ -23265,12 +23672,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23265
23672
  plannerAgentId: "",
23266
23673
  reviewerAgentId: ""
23267
23674
  });
23268
- const [isSending, setIsSending] = (0, import_react23.useState)(false);
23269
- const [showArchived, setShowArchived] = (0, import_react23.useState)(loadShowArchived);
23270
- const [pendingConfirm, setPendingConfirm] = (0, import_react23.useState)(null);
23271
- const [taskError, setTaskError] = (0, import_react23.useState)(null);
23272
- const threadIntervalRef = (0, import_react23.useRef)(null);
23273
- (0, import_react23.useEffect)(() => {
23675
+ const [isSending, setIsSending] = (0, import_react25.useState)(false);
23676
+ const [showArchived, setShowArchived] = (0, import_react25.useState)(loadShowArchived);
23677
+ const [pendingConfirm, setPendingConfirm] = (0, import_react25.useState)(null);
23678
+ const [taskError, setTaskError] = (0, import_react25.useState)(null);
23679
+ const threadIntervalRef = (0, import_react25.useRef)(null);
23680
+ (0, import_react25.useEffect)(() => {
23274
23681
  void (async () => {
23275
23682
  try {
23276
23683
  const res = await fetch("/api/ui-state");
@@ -23286,7 +23693,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23286
23693
  stopThreadPolling();
23287
23694
  };
23288
23695
  }, []);
23289
- (0, import_react23.useEffect)(() => {
23696
+ (0, import_react25.useEffect)(() => {
23290
23697
  if (projects.length > 0 && selectedProjectId === null) {
23291
23698
  setSelectedProjectId(projects[0].id);
23292
23699
  }
@@ -23297,10 +23704,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23297
23704
  setSelectedProjectId(null);
23298
23705
  }
23299
23706
  }, [projects]);
23300
- (0, import_react23.useEffect)(() => {
23707
+ (0, import_react25.useEffect)(() => {
23301
23708
  saveShowArchived(showArchived);
23302
23709
  }, [showArchived]);
23303
- (0, import_react23.useEffect)(() => {
23710
+ (0, import_react25.useEffect)(() => {
23304
23711
  if (selectedProjectId !== null) {
23305
23712
  fetchTasks(selectedProjectId);
23306
23713
  setView("list");
@@ -23312,7 +23719,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23312
23719
  setTasks([]);
23313
23720
  }
23314
23721
  }, [selectedProjectId, showArchived]);
23315
- (0, import_react23.useEffect)(() => {
23722
+ (0, import_react25.useEffect)(() => {
23316
23723
  if (selectedTaskId !== null) {
23317
23724
  fetchTaskMessages(selectedTaskId);
23318
23725
  startThreadPolling(selectedTaskId);
@@ -23485,7 +23892,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23485
23892
  const cancelPendingAction = () => {
23486
23893
  setPendingConfirm(null);
23487
23894
  };
23488
- (0, import_react23.useEffect)(() => {
23895
+ (0, import_react25.useEffect)(() => {
23489
23896
  if (!pendingConfirm) return;
23490
23897
  function handleKeyDown(event) {
23491
23898
  if (event.key === "Escape") {
@@ -23495,7 +23902,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23495
23902
  window.addEventListener("keydown", handleKeyDown);
23496
23903
  return () => window.removeEventListener("keydown", handleKeyDown);
23497
23904
  }, [pendingConfirm]);
23498
- (0, import_react23.useEffect)(() => {
23905
+ (0, import_react25.useEffect)(() => {
23499
23906
  if (!taskError) return;
23500
23907
  const t = setTimeout(() => setTaskError(null), 5e3);
23501
23908
  return () => clearTimeout(t);
@@ -23626,7 +24033,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23626
24033
  const selectedProject = projects.find((p) => p.id === selectedProjectId);
23627
24034
  const selectedTask = tasks.find((t) => t.id === selectedTaskId);
23628
24035
  const selectedProjectAgentName = agents.find((a2) => a2.id === selectedProject?.agentId)?.name || "Default Agent";
23629
- const taskAgentLabels = (0, import_react23.useMemo)(() => {
24036
+ const taskAgentLabels = (0, import_react25.useMemo)(() => {
23630
24037
  if (!selectedTask) return void 0;
23631
24038
  const agentLabelFor = (agentId) => {
23632
24039
  const a2 = agents.find((x) => x.id === agentId);
@@ -23672,14 +24079,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23672
24079
  const safePage = Math.min(page, totalPages - 1);
23673
24080
  const pageStart = safePage * PAGE_SIZE;
23674
24081
  const pageTasks = tasks.slice(pageStart, pageStart + PAGE_SIZE);
23675
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app", style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
23676
- /* @__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: [
24082
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "app", style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
24083
+ /* @__PURE__ */ (0, import_jsx_runtime24.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_runtime24.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("p", { children: [
23677
24084
  "No projects registered.",
23678
24085
  " ",
23679
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "app__link-btn", onClick: onOpenSettings, children: "Create one in Settings" }),
24086
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { className: "app__link-btn", onClick: onOpenSettings, children: "Create one in Settings" }),
23680
24087
  " ",
23681
24088
  "to get started."
23682
- ] }) }) : selectedProject ? view === "list" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24089
+ ] }) }) : selectedProject ? view === "list" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23683
24090
  TaskListView,
23684
24091
  {
23685
24092
  projects,
@@ -23704,7 +24111,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23704
24111
  onArchive: handleArchiveFromList,
23705
24112
  statusColor
23706
24113
  }
23707
- ) : view === "log" && selectedTask ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24114
+ ) : view === "log" && selectedTask ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23708
24115
  TaskLogView,
23709
24116
  {
23710
24117
  task: selectedTask,
@@ -23720,7 +24127,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23720
24127
  onToggleStatus: handleToggleTaskStatus,
23721
24128
  statusColor
23722
24129
  }
23723
- ) : view === "edit" && selectedTask ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24130
+ ) : view === "edit" && selectedTask ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23724
24131
  TaskEditView,
23725
24132
  {
23726
24133
  task: selectedTask,
@@ -23738,11 +24145,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23738
24145
  onOpenLog: () => setView("log"),
23739
24146
  statusColor
23740
24147
  }
23741
- ) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__empty-state", children: [
23742
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { children: "Task not found. Go back to the list." }),
23743
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "settings-panel__back-btn", onClick: backToList, style: { marginTop: "12px" }, children: "\u2190 Back to list" })
24148
+ ) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "app__empty-state", children: [
24149
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: "Task not found. Go back to the list." }),
24150
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { className: "settings-panel__back-btn", onClick: backToList, style: { marginTop: "12px" }, children: "\u2190 Back to list" })
23744
24151
  ] }) : null }),
23745
- isNewTaskOpen && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24152
+ isNewTaskOpen && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23746
24153
  "div",
23747
24154
  {
23748
24155
  style: {
@@ -23757,7 +24164,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23757
24164
  justifyContent: "center",
23758
24165
  zIndex: 999
23759
24166
  },
23760
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24167
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
23761
24168
  "form",
23762
24169
  {
23763
24170
  onSubmit: handleCreateTask,
@@ -23768,14 +24175,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23768
24175
  background: "var(--vscode-sideBar-background)"
23769
24176
  },
23770
24177
  children: [
23771
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "confirm__header", children: [
23772
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { fontSize: "18px", display: "inline-flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Wrench, { size: 18 }) }),
23773
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "confirm__prompt", style: { fontSize: "14px" }, children: "Create New Task" })
24178
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "confirm__header", children: [
24179
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: { fontSize: "18px", display: "inline-flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Wrench, { size: 18 }) }),
24180
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "confirm__prompt", style: { fontSize: "14px" }, children: "Create New Task" })
23774
24181
  ] }),
23775
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: [
23776
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
24182
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: [
24183
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23777
24184
  "Task Title",
23778
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24185
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23779
24186
  "input",
23780
24187
  {
23781
24188
  type: "text",
@@ -23795,9 +24202,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23795
24202
  }
23796
24203
  )
23797
24204
  ] }),
23798
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
24205
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23799
24206
  "Objective (Extended markdown goal description)",
23800
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24207
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23801
24208
  "textarea",
23802
24209
  {
23803
24210
  required: true,
@@ -23818,9 +24225,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23818
24225
  }
23819
24226
  )
23820
24227
  ] }),
23821
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
24228
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23822
24229
  "Checklist Items (One item per line)",
23823
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24230
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23824
24231
  "textarea",
23825
24232
  {
23826
24233
  placeholder: "Create route handler\nWrite unit tests\nUpdate documentation",
@@ -23840,9 +24247,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23840
24247
  }
23841
24248
  )
23842
24249
  ] }),
23843
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
24250
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23844
24251
  "Assigned Agent (optional \u2014 overrides project default)",
23845
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24252
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
23846
24253
  "select",
23847
24254
  {
23848
24255
  value: newTask.agentId,
@@ -23857,8 +24264,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23857
24264
  outline: "none"
23858
24265
  },
23859
24266
  children: [
23860
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: "Project default" }),
23861
- agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: a2.id, children: [
24267
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: "Project default" }),
24268
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: a2.id, children: [
23862
24269
  a2.name,
23863
24270
  " (",
23864
24271
  a2.provider,
@@ -23868,9 +24275,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23868
24275
  }
23869
24276
  )
23870
24277
  ] }),
23871
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
24278
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23872
24279
  "Planner Agent Override (optional)",
23873
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24280
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
23874
24281
  "select",
23875
24282
  {
23876
24283
  value: newTask.plannerAgentId,
@@ -23885,8 +24292,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23885
24292
  outline: "none"
23886
24293
  },
23887
24294
  children: [
23888
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: "Project default" }),
23889
- agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: a2.id, children: [
24295
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: "Project default" }),
24296
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: a2.id, children: [
23890
24297
  a2.name,
23891
24298
  " (",
23892
24299
  a2.provider,
@@ -23896,9 +24303,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23896
24303
  }
23897
24304
  )
23898
24305
  ] }),
23899
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
24306
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
23900
24307
  "Reviewer Agent Override (optional)",
23901
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24308
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
23902
24309
  "select",
23903
24310
  {
23904
24311
  value: newTask.reviewerAgentId,
@@ -23913,8 +24320,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23913
24320
  outline: "none"
23914
24321
  },
23915
24322
  children: [
23916
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: "Project default" }),
23917
- agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: a2.id, children: [
24323
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: "Project default" }),
24324
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: a2.id, children: [
23918
24325
  a2.name,
23919
24326
  " (",
23920
24327
  a2.provider,
@@ -23924,8 +24331,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23924
24331
  }
23925
24332
  )
23926
24333
  ] }),
23927
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "12px", display: "flex", alignItems: "center", gap: "6px", cursor: "pointer", marginTop: "4px" }, children: [
23928
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24334
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { style: { fontSize: "12px", display: "flex", alignItems: "center", gap: "6px", cursor: "pointer", marginTop: "4px" }, children: [
24335
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23929
24336
  "input",
23930
24337
  {
23931
24338
  type: "checkbox",
@@ -23934,24 +24341,24 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23934
24341
  style: { cursor: "pointer" }
23935
24342
  }
23936
24343
  ),
23937
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: "Start active immediately (Heartbeat loop claims it)" })
24344
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "Start active immediately (Heartbeat loop claims it)" })
23938
24345
  ] })
23939
24346
  ] }),
23940
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "confirm__buttons", style: { justifyContent: "flex-end", marginTop: "10px" }, children: [
23941
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { type: "button", className: "confirm__btn", onClick: () => setIsNewTaskOpen(false), children: "Cancel" }),
23942
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { type: "submit", className: "confirm__btn confirm__btn--primary", children: "Create Task" })
24347
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "confirm__buttons", style: { justifyContent: "flex-end", marginTop: "10px" }, children: [
24348
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", className: "confirm__btn", onClick: () => setIsNewTaskOpen(false), children: "Cancel" }),
24349
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "submit", className: "confirm__btn confirm__btn--primary", children: "Create Task" })
23943
24350
  ] })
23944
24351
  ]
23945
24352
  }
23946
24353
  )
23947
24354
  }
23948
24355
  ),
23949
- 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: [
23950
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__confirm-title", children: pendingConfirm.type === "delete" ? "Delete task" : pendingConfirm.type === "archive" ? "Archive task" : "Discard worktree" }),
23951
- /* @__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.` }),
23952
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__confirm-buttons", children: [
23953
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "app__confirm-btn", onClick: cancelPendingAction, children: "Cancel" }),
23954
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24356
+ pendingConfirm && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "app__confirm-overlay", onClick: cancelPendingAction, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "app__confirm-dialog", onClick: (e) => e.stopPropagation(), children: [
24357
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "app__confirm-title", children: pendingConfirm.type === "delete" ? "Delete task" : pendingConfirm.type === "archive" ? "Archive task" : "Discard worktree" }),
24358
+ /* @__PURE__ */ (0, import_jsx_runtime24.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.` }),
24359
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "app__confirm-buttons", children: [
24360
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { className: "app__confirm-btn", onClick: cancelPendingAction, children: "Cancel" }),
24361
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23955
24362
  "button",
23956
24363
  {
23957
24364
  className: `app__confirm-btn ${pendingConfirm.type === "delete" ? "app__confirm-btn--danger" : ""}`,
@@ -23961,7 +24368,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23961
24368
  )
23962
24369
  ] })
23963
24370
  ] }) }),
23964
- taskError && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "app__error-banner", onClick: () => setTaskError(null), title: "Click to dismiss", children: taskError })
24371
+ taskError && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "app__error-banner", onClick: () => setTaskError(null), title: "Click to dismiss", children: taskError })
23965
24372
  ] });
23966
24373
  }
23967
24374
  function TaskListView({
@@ -23984,10 +24391,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
23984
24391
  onArchive,
23985
24392
  statusColor
23986
24393
  }) {
23987
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%" }, children: [
23988
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "task-view__header", children: [
23989
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
23990
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24394
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%" }, children: [
24395
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "task-view__header", children: [
24396
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
24397
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
23991
24398
  "select",
23992
24399
  {
23993
24400
  className: "task-view__project-filter",
@@ -24004,17 +24411,17 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24004
24411
  outline: "none",
24005
24412
  cursor: "pointer"
24006
24413
  },
24007
- children: projects.map((p) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: p.id, children: p.name }, p.id))
24414
+ children: projects.map((p) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: p.id, children: p.name }, p.id))
24008
24415
  }
24009
24416
  ),
24010
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { style: { fontSize: "10px", opacity: 0.6 }, children: [
24417
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { style: { fontSize: "10px", opacity: 0.6 }, children: [
24011
24418
  "Agent: ",
24012
24419
  agentName
24013
24420
  ] })
24014
24421
  ] }),
24015
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
24016
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { className: "task-view__archived-toggle", children: [
24017
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24422
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
24423
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "task-view__archived-toggle", children: [
24424
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24018
24425
  "input",
24019
24426
  {
24020
24427
  type: "checkbox",
@@ -24025,42 +24432,42 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24025
24432
  ),
24026
24433
  "Show archived"
24027
24434
  ] }),
24028
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "app__new-chat-btn", onClick: onNewTask, style: { padding: "4px 10px", fontSize: "11px" }, children: "+ New Task" })
24435
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { className: "app__new-chat-btn", onClick: onNewTask, style: { padding: "4px 10px", fontSize: "11px" }, children: "+ New Task" })
24029
24436
  ] })
24030
24437
  ] }),
24031
- /* @__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: [
24438
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: { flex: 1, overflowY: "auto", padding: "0 16px 16px" }, children: allTasksCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("p", { children: [
24032
24439
  "No tasks created for ",
24033
24440
  project.name,
24034
24441
  '. Click "+ New Task" to start.'
24035
- ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("table", { className: "task-table", children: [
24036
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("tr", { children: [
24037
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "60px" }, children: "#" }),
24038
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", children: "Title" }),
24039
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "90px" }, children: "Status" }),
24040
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "100px" }, children: "Agent" }),
24041
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "120px" }, children: "Checklist" }),
24042
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "180px" }, children: "Branch" }),
24043
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "150px" }, children: "Updated" }),
24044
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "task-table__th", style: { width: "70px" } })
24442
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("table", { className: "task-table", children: [
24443
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("tr", { children: [
24444
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", { className: "task-table__th", style: { width: "60px" }, children: "#" }),
24445
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", { className: "task-table__th", children: "Title" }),
24446
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", { className: "task-table__th", style: { width: "90px" }, children: "Status" }),
24447
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", { className: "task-table__th", style: { width: "100px" }, children: "Agent" }),
24448
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", { className: "task-table__th", style: { width: "120px" }, children: "Checklist" }),
24449
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", { className: "task-table__th", style: { width: "180px" }, children: "Branch" }),
24450
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", { className: "task-table__th", style: { width: "150px" }, children: "Updated" }),
24451
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", { className: "task-table__th", style: { width: "70px" } })
24045
24452
  ] }) }),
24046
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("tbody", { children: tasks.map((task) => {
24453
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tbody", { children: tasks.map((task) => {
24047
24454
  const completedCount = task.checklist.filter((c2) => c2.status === "done").length;
24048
24455
  const totalCount = task.checklist.length;
24049
24456
  const isArchived = !!task.archived;
24050
24457
  const updated = new Date(task.updatedAt);
24051
24458
  const updatedStr = isNaN(updated.getTime()) ? task.updatedAt : updated.toLocaleString(void 0, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" });
24052
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24459
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
24053
24460
  "tr",
24054
24461
  {
24055
24462
  className: `task-table__row${isArchived ? " task-table__row--archived" : ""}`,
24056
24463
  onClick: () => onOpenLog(task),
24057
24464
  children: [
24058
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: "task-table__td task-table__td--mono", children: task.id }),
24059
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "task-table__title", children: [
24060
- isArchived && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Archive, { size: 11 }),
24465
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { className: "task-table__td task-table__td--mono", children: task.id }),
24466
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "task-table__title", children: [
24467
+ isArchived && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Archive, { size: 11 }),
24061
24468
  task.title
24062
24469
  ] }) }),
24063
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24470
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24064
24471
  "span",
24065
24472
  {
24066
24473
  className: "task-table__badge",
@@ -24068,28 +24475,28 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24068
24475
  children: task.status
24069
24476
  }
24070
24477
  ) }),
24071
- /* @__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" }) }),
24072
- /* @__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: [
24073
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "task-table__progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24478
+ /* @__PURE__ */ (0, import_jsx_runtime24.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_runtime24.jsx)("span", { style: { opacity: 0.4 }, children: "default" }) }),
24479
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { className: "task-table__td", children: totalCount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "task-table__progress", children: [
24480
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "task-table__progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24074
24481
  "span",
24075
24482
  {
24076
24483
  className: "task-table__progress-fill",
24077
24484
  style: { width: `${completedCount / totalCount * 100}%` }
24078
24485
  }
24079
24486
  ) }),
24080
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "task-table__progress-text", children: [
24487
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "task-table__progress-text", children: [
24081
24488
  completedCount,
24082
24489
  "/",
24083
24490
  totalCount
24084
24491
  ] })
24085
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { opacity: 0.4, fontSize: "11px" }, children: "\u2014" }) }),
24086
- /* @__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: [
24087
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GitBranch, { size: 11 }),
24088
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("code", { children: task.branch })
24089
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { opacity: 0.4, fontSize: "11px" }, children: "\u2014" }) }),
24090
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: "task-table__td task-table__td--muted", children: updatedStr }),
24091
- /* @__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: [
24092
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24492
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: { opacity: 0.4, fontSize: "11px" }, children: "\u2014" }) }),
24493
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { className: "task-table__td", children: task.branch ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "task-table__branch", children: [
24494
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(GitBranch, { size: 11 }),
24495
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("code", { children: task.branch })
24496
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: { opacity: 0.4, fontSize: "11px" }, children: "\u2014" }) }),
24497
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { className: "task-table__td task-table__td--muted", children: updatedStr }),
24498
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "inline-flex", gap: "2px" }, children: [
24499
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24093
24500
  "button",
24094
24501
  {
24095
24502
  className: "task-table__edit-btn",
@@ -24099,10 +24506,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24099
24506
  },
24100
24507
  title: task.archived ? "Unarchive task" : "Archive task",
24101
24508
  "aria-label": task.archived ? "Unarchive task" : "Archive task",
24102
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Archive, { size: 13 })
24509
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Archive, { size: 13 })
24103
24510
  }
24104
24511
  ),
24105
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24512
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24106
24513
  "button",
24107
24514
  {
24108
24515
  className: "task-table__edit-btn",
@@ -24112,7 +24519,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24112
24519
  },
24113
24520
  title: "Edit task",
24114
24521
  "aria-label": "Edit task",
24115
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Pencil, { size: 13 })
24522
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Pencil, { size: 13 })
24116
24523
  }
24117
24524
  )
24118
24525
  ] }) })
@@ -24122,8 +24529,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24122
24529
  );
24123
24530
  }) })
24124
24531
  ] }) }),
24125
- totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "task-table__pagination", children: [
24126
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24532
+ totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "task-table__pagination", children: [
24533
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24127
24534
  "button",
24128
24535
  {
24129
24536
  className: "task-table__page-btn",
@@ -24132,13 +24539,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24132
24539
  children: "\u2039 Prev"
24133
24540
  }
24134
24541
  ),
24135
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "task-table__page-info", children: [
24542
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "task-table__page-info", children: [
24136
24543
  "Page ",
24137
24544
  page + 1,
24138
24545
  " of ",
24139
24546
  totalPages
24140
24547
  ] }),
24141
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24548
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24142
24549
  "button",
24143
24550
  {
24144
24551
  className: "task-table__page-btn",
@@ -24166,31 +24573,31 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24166
24573
  }) {
24167
24574
  const completedCount = task.checklist.filter((c2) => c2.status === "done").length;
24168
24575
  const totalCount = task.checklist.length;
24169
- const chatItems = (0, import_react23.useMemo)(() => taskMessagesToChatItems(taskMessages, agentLabels), [taskMessages, agentLabels]);
24170
- const [openCycle, setOpenCycle] = (0, import_react23.useState)(null);
24171
- const [draft, setDraft] = (0, import_react23.useState)("");
24172
- const openCycleItem = (0, import_react23.useCallback)((item) => setOpenCycle(item), []);
24173
- const autoOpenedFor = (0, import_react23.useRef)(null);
24174
- (0, import_react23.useEffect)(() => {
24576
+ const chatItems = (0, import_react25.useMemo)(() => taskMessagesToChatItems(taskMessages, agentLabels), [taskMessages, agentLabels]);
24577
+ const [openCycle, setOpenCycle] = (0, import_react25.useState)(null);
24578
+ const [draft, setDraft] = (0, import_react25.useState)("");
24579
+ const openCycleItem = (0, import_react25.useCallback)((item) => setOpenCycle(item), []);
24580
+ const autoOpenedFor = (0, import_react25.useRef)(null);
24581
+ (0, import_react25.useEffect)(() => {
24175
24582
  if (autoOpenedFor.current === task.id || taskMessages.length === 0) return;
24176
24583
  autoOpenedFor.current = task.id;
24177
24584
  const latest = [...chatItems].reverse().find((i) => i.kind === "cycle");
24178
24585
  if (latest && latest.outcome === "running") setOpenCycle(latest);
24179
24586
  }, [task.id, taskMessages.length, chatItems]);
24180
24587
  const liveCycle = openCycle ? chatItems.find((i) => i.kind === "cycle" && i.sessionId === openCycle.sessionId) ?? openCycle : null;
24181
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%" }, children: [
24182
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("header", { className: "app__chat-header task-view__sub-header", style: { padding: "12px 14px" }, children: [
24183
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
24184
- /* @__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 }) }),
24185
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "app__chat-header-info", children: [
24186
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("h3", { className: "app__chat-header-title", style: { fontSize: "13px", margin: 0 }, children: [
24588
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%" }, children: [
24589
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("header", { className: "app__chat-header task-view__sub-header", style: { padding: "12px 14px" }, children: [
24590
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
24591
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { className: "settings-panel__back-btn", onClick: onBack, title: "Back to task list", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ArrowLeft, { size: 13 }) }),
24592
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "app__chat-header-info", children: [
24593
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("h3", { className: "app__chat-header-title", style: { fontSize: "13px", margin: 0 }, children: [
24187
24594
  "Task #",
24188
24595
  task.id,
24189
24596
  ": ",
24190
24597
  task.title
24191
24598
  ] }),
24192
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "app__chat-header-status", style: { fontSize: "10px" }, children: [
24193
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24599
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "app__chat-header-status", style: { fontSize: "10px" }, children: [
24600
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24194
24601
  "span",
24195
24602
  {
24196
24603
  className: `agent-status-dot agent-status-dot--active ${isActiveLike ? "agent-status-dot--pulsing" : ""}`,
@@ -24201,24 +24608,24 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24201
24608
  ] })
24202
24609
  ] })
24203
24610
  ] }),
24204
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
24205
- task.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24611
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
24612
+ task.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24206
24613
  "button",
24207
24614
  {
24208
24615
  className: "confirm__btn confirm__btn--primary",
24209
24616
  onClick: () => onToggleStatus(task),
24210
24617
  title: isActiveLike ? "Pause this task (aborts the running agent)" : "Activate this task",
24211
24618
  style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px" },
24212
- children: isActiveLike ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
24213
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Pause, { size: 12 }),
24619
+ children: isActiveLike ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
24620
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Pause, { size: 12 }),
24214
24621
  " Pause"
24215
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
24216
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Play, { size: 12 }),
24622
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
24623
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Play, { size: 12 }),
24217
24624
  " Activate"
24218
24625
  ] })
24219
24626
  }
24220
24627
  ),
24221
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24628
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24222
24629
  "span",
24223
24630
  {
24224
24631
  className: "task-table__badge",
@@ -24228,8 +24635,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24228
24635
  )
24229
24636
  ] })
24230
24637
  ] }),
24231
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "row" }, children: [
24232
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24638
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "row" }, children: [
24639
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
24233
24640
  "aside",
24234
24641
  {
24235
24642
  style: {
@@ -24242,19 +24649,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24242
24649
  background: "var(--vscode-sideBar-background, rgba(0,0,0,0.1))"
24243
24650
  },
24244
24651
  children: [
24245
- /* @__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: [
24246
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h4", { style: { margin: 0, fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Checklist" }),
24247
- totalCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { fontSize: "10px", opacity: 0.5, marginTop: "2px" }, children: [
24652
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { padding: "10px 12px", borderBottom: "1px solid var(--vscode-panel-border, rgba(255,255,255,0.05))" }, children: [
24653
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h4", { style: { margin: 0, fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Checklist" }),
24654
+ totalCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { fontSize: "10px", opacity: 0.5, marginTop: "2px" }, children: [
24248
24655
  completedCount,
24249
24656
  "/",
24250
24657
  totalCount,
24251
24658
  " done"
24252
24659
  ] })
24253
24660
  ] }),
24254
- /* @__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) => {
24661
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: { padding: "8px 10px", display: "flex", flexDirection: "column", gap: "4px" }, children: totalCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: { fontSize: "11px", opacity: 0.4, padding: "8px 4px" }, children: "No checklist items." }) : (task.checklist || []).map((item) => {
24255
24662
  const isDone = item.status === "done";
24256
24663
  const isInProgress = item.status === "in_progress";
24257
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24664
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
24258
24665
  "label",
24259
24666
  {
24260
24667
  style: {
@@ -24271,7 +24678,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24271
24678
  },
24272
24679
  title: isInProgress ? "In progress" : isDone ? "Done" : "Pending",
24273
24680
  children: [
24274
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24681
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24275
24682
  "input",
24276
24683
  {
24277
24684
  type: "checkbox",
@@ -24280,7 +24687,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24280
24687
  style: { marginTop: "2px", cursor: "pointer", flexShrink: 0 }
24281
24688
  }
24282
24689
  ),
24283
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { wordBreak: "break-word" }, children: item.text })
24690
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: { wordBreak: "break-word" }, children: item.text })
24284
24691
  ]
24285
24692
  },
24286
24693
  item.id
@@ -24289,8 +24696,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24289
24696
  ]
24290
24697
  }
24291
24698
  ),
24292
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column" }, children: [
24293
- liveCycle ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24699
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column" }, children: [
24700
+ liveCycle ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24294
24701
  TaskCycleView,
24295
24702
  {
24296
24703
  item: liveCycle,
@@ -24298,8 +24705,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24298
24705
  onBack: () => setOpenCycle(null)
24299
24706
  },
24300
24707
  liveCycle.sessionId
24301
- ) : 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 }),
24302
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24708
+ ) : taskMessages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "messages messages--empty", children: "No messages in this execution yet. Agent will start on next tick." }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(MessageList, { items: chatItems, sessionId: null, compact: true, onOpenCycle: openCycleItem }),
24709
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24303
24710
  Composer,
24304
24711
  {
24305
24712
  disabled: isSending,
@@ -24336,12 +24743,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24336
24743
  statusColor
24337
24744
  }) {
24338
24745
  const isRunning = task.status === "active" || task.status === "reviewing" || task.status === "planning";
24339
- const [draftTitle, setDraftTitle] = (0, import_react23.useState)(task.title);
24340
- const [draftObjective, setDraftObjective] = (0, import_react23.useState)(task.objective);
24341
- const [lastTaskId, setLastTaskId] = (0, import_react23.useState)(task.id);
24746
+ const [draftTitle, setDraftTitle] = (0, import_react25.useState)(task.title);
24747
+ const [draftObjective, setDraftObjective] = (0, import_react25.useState)(task.objective);
24748
+ const [lastTaskId, setLastTaskId] = (0, import_react25.useState)(task.id);
24342
24749
  const trimmedTitle = draftTitle.trim();
24343
24750
  const isDirty = trimmedTitle !== task.title.trim() || draftObjective.trim() !== task.objective.trim();
24344
- (0, import_react23.useEffect)(() => {
24751
+ (0, import_react25.useEffect)(() => {
24345
24752
  if (task.id !== lastTaskId) {
24346
24753
  setDraftTitle(task.title);
24347
24754
  setDraftObjective(task.objective);
@@ -24356,16 +24763,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24356
24763
  setDraftTitle(task.title);
24357
24764
  setDraftObjective(task.objective);
24358
24765
  };
24359
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%", overflowY: "auto" }, children: [
24360
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "task-view__sub-header", style: { padding: "12px 14px", display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
24361
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
24362
- /* @__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 }) }),
24363
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("h3", { style: { margin: 0, fontSize: "15px", fontWeight: 700, display: "flex", alignItems: "center", gap: "6px" }, children: [
24364
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { style: { opacity: 0.6 }, children: [
24766
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%", overflowY: "auto" }, children: [
24767
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "task-view__sub-header", style: { padding: "12px 14px", display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
24768
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
24769
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { className: "settings-panel__back-btn", onClick: onBack, title: "Back to task list", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ArrowLeft, { size: 13 }) }),
24770
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("h3", { style: { margin: 0, fontSize: "15px", fontWeight: 700, display: "flex", alignItems: "center", gap: "6px" }, children: [
24771
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { style: { opacity: 0.6 }, children: [
24365
24772
  "Task #",
24366
24773
  task.id
24367
24774
  ] }),
24368
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24775
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24369
24776
  "input",
24370
24777
  {
24371
24778
  value: draftTitle,
@@ -24386,7 +24793,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24386
24793
  }
24387
24794
  )
24388
24795
  ] }),
24389
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24796
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24390
24797
  "span",
24391
24798
  {
24392
24799
  className: "task-table__badge",
@@ -24395,8 +24802,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24395
24802
  }
24396
24803
  )
24397
24804
  ] }),
24398
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "inline-flex", gap: "6px" }, children: [
24399
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24805
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "inline-flex", gap: "6px" }, children: [
24806
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24400
24807
  "button",
24401
24808
  {
24402
24809
  className: "confirm__btn",
@@ -24406,7 +24813,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24406
24813
  children: "View Log"
24407
24814
  }
24408
24815
  ),
24409
- task.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24816
+ task.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
24410
24817
  "button",
24411
24818
  {
24412
24819
  className: "confirm__btn",
@@ -24414,12 +24821,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24414
24821
  title: `Commit pending changes to ${task.branch} and remove the worktree`,
24415
24822
  style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px" },
24416
24823
  children: [
24417
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GitBranch, { size: 12 }),
24824
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(GitBranch, { size: 12 }),
24418
24825
  " Discard worktree"
24419
24826
  ]
24420
24827
  }
24421
24828
  ),
24422
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24829
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
24423
24830
  "button",
24424
24831
  {
24425
24832
  className: "confirm__btn",
@@ -24427,28 +24834,28 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24427
24834
  title: task.archived ? "Unarchive this task" : "Archive this task (hides it from the list, excludes from scheduler)",
24428
24835
  style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px" },
24429
24836
  children: [
24430
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Archive, { size: 12 }),
24837
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Archive, { size: 12 }),
24431
24838
  " ",
24432
24839
  task.archived ? "Unarchive" : "Archive"
24433
24840
  ]
24434
24841
  }
24435
24842
  ),
24436
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24843
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24437
24844
  "button",
24438
24845
  {
24439
24846
  className: "confirm__btn confirm__btn--primary",
24440
24847
  onClick: () => onToggleStatus(task),
24441
24848
  style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px" },
24442
- children: task.status === "active" || task.status === "reviewing" || task.status === "planning" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
24443
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Pause, { size: 12 }),
24849
+ children: task.status === "active" || task.status === "reviewing" || task.status === "planning" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
24850
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Pause, { size: 12 }),
24444
24851
  " Pause"
24445
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
24446
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Play, { size: 12 }),
24852
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
24853
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Play, { size: 12 }),
24447
24854
  " Activate"
24448
24855
  ] })
24449
24856
  }
24450
24857
  ),
24451
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24858
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
24452
24859
  "button",
24453
24860
  {
24454
24861
  className: "confirm__btn",
@@ -24456,22 +24863,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24456
24863
  title: "Permanently delete this task and all its messages",
24457
24864
  style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px", color: "#ef4444" },
24458
24865
  children: [
24459
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Trash, { size: 12 }),
24866
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Trash, { size: 12 }),
24460
24867
  " Delete"
24461
24868
  ]
24462
24869
  }
24463
24870
  )
24464
24871
  ] })
24465
24872
  ] }),
24466
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { padding: "16px", maxWidth: "720px" }, children: [
24467
- task.branch && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { marginBottom: "16px", display: "flex", alignItems: "center", gap: "6px", fontSize: "11px", opacity: 0.75 }, children: [
24468
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(GitBranch, { size: 12 }),
24469
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("code", { style: { fontFamily: "monospace" }, children: task.branch }),
24470
- !task.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { opacity: 0.6 }, children: "(worktree removed)" })
24873
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { padding: "16px", maxWidth: "720px" }, children: [
24874
+ task.branch && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { marginBottom: "16px", display: "flex", alignItems: "center", gap: "6px", fontSize: "11px", opacity: 0.75 }, children: [
24875
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(GitBranch, { size: 12 }),
24876
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("code", { style: { fontFamily: "monospace" }, children: task.branch }),
24877
+ !task.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: { opacity: 0.6 }, children: "(worktree removed)" })
24471
24878
  ] }),
24472
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24473
- /* @__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" }),
24474
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24879
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24880
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Objective" }),
24881
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24475
24882
  "textarea",
24476
24883
  {
24477
24884
  value: draftObjective,
@@ -24495,8 +24902,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24495
24902
  }
24496
24903
  }
24497
24904
  ),
24498
- isDirty && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", gap: "6px", alignItems: "center", marginTop: "8px" }, children: [
24499
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
24905
+ isDirty && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", gap: "6px", alignItems: "center", marginTop: "8px" }, children: [
24906
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24500
24907
  "button",
24501
24908
  {
24502
24909
  className: "confirm__btn confirm__btn--primary",
@@ -24509,13 +24916,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24509
24916
  children: "Save"
24510
24917
  }
24511
24918
  ),
24512
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("button", { className: "confirm__btn", onClick: resetDraft, style: { padding: "3px 10px", fontSize: "10px" }, children: "Cancel" }),
24513
- isRunning && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { fontSize: "10px", opacity: 0.6 }, children: "Applies from the next cycle." })
24919
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { className: "confirm__btn", onClick: resetDraft, style: { padding: "3px 10px", fontSize: "10px" }, children: "Cancel" }),
24920
+ isRunning && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: { fontSize: "10px", opacity: 0.6 }, children: "Applies from the next cycle." })
24514
24921
  ] })
24515
24922
  ] }),
24516
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24517
- /* @__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" }),
24518
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24923
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24924
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Assigned Agent" }),
24925
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
24519
24926
  "select",
24520
24927
  {
24521
24928
  value: task.agentId || "",
@@ -24535,8 +24942,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24535
24942
  },
24536
24943
  title: isRunning ? "Pause the task before changing its agent" : "Choose which agent runs this task",
24537
24944
  children: [
24538
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: "Project default" }),
24539
- agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: a2.id, children: [
24945
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: "Project default" }),
24946
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: a2.id, children: [
24540
24947
  a2.name,
24541
24948
  " (",
24542
24949
  a2.provider,
@@ -24546,9 +24953,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24546
24953
  }
24547
24954
  )
24548
24955
  ] }),
24549
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24550
- /* @__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" }),
24551
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24956
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24957
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Planner Agent" }),
24958
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
24552
24959
  "select",
24553
24960
  {
24554
24961
  value: task.plannerAgentId || "",
@@ -24557,8 +24964,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24557
24964
  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 },
24558
24965
  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.",
24559
24966
  children: [
24560
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: "Project default" }),
24561
- agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: a2.id, children: [
24967
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: "Project default" }),
24968
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: a2.id, children: [
24562
24969
  a2.name,
24563
24970
  " (",
24564
24971
  a2.provider,
@@ -24568,9 +24975,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24568
24975
  }
24569
24976
  )
24570
24977
  ] }),
24571
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24572
- /* @__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" }),
24573
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
24978
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24979
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Reviewer Agent" }),
24980
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
24574
24981
  "select",
24575
24982
  {
24576
24983
  value: task.reviewerAgentId || "",
@@ -24579,8 +24986,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24579
24986
  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 },
24580
24987
  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.",
24581
24988
  children: [
24582
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: "Project default" }),
24583
- agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: a2.id, children: [
24989
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: "Project default" }),
24990
+ agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: a2.id, children: [
24584
24991
  a2.name,
24585
24992
  " (",
24586
24993
  a2.provider,
@@ -24590,31 +24997,31 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24590
24997
  }
24591
24998
  )
24592
24999
  ] }),
24593
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { marginBottom: "16px" }, children: [
24594
- /* @__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" }),
24595
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { display: "flex", gap: "12px" }, children: [
25000
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { marginBottom: "16px" }, children: [
25001
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Phases" }),
25002
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: { display: "flex", gap: "12px" }, children: [
24596
25003
  { flag: "planningEnabled", label: "Planning phase", value: task.planningEnabled },
24597
25004
  { flag: "reviewEnabled", label: "Review at DONE", value: task.reviewEnabled },
24598
25005
  { flag: "sddEnabled", label: "SDD mode (.md specs)", value: task.sddEnabled }
24599
- ].map(({ flag, label, value }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px", flex: 1 }, children: [
25006
+ ].map(({ flag, label, value }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px", flex: 1 }, children: [
24600
25007
  label,
24601
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
25008
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
24602
25009
  "select",
24603
25010
  {
24604
25011
  value: value === true ? "on" : value === false ? "off" : "inherit",
24605
25012
  onChange: (e) => onSetFlag(task, flag, e.target.value === "inherit" ? null : e.target.value === "on"),
24606
25013
  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" },
24607
25014
  children: [
24608
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "inherit", children: "Project default" }),
24609
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "on", children: "On" }),
24610
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "off", children: "Off" })
25015
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "inherit", children: "Project default" }),
25016
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "on", children: "On" }),
25017
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "off", children: "Off" })
24611
25018
  ]
24612
25019
  }
24613
25020
  )
24614
25021
  ] }, flag)) }),
24615
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px", marginTop: "12px", maxWidth: "260px" }, children: [
25022
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px", marginTop: "12px", maxWidth: "260px" }, children: [
24616
25023
  "Max run seconds per cycle",
24617
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
25024
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24618
25025
  "input",
24619
25026
  {
24620
25027
  type: "number",
@@ -24637,7 +25044,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24637
25044
  )
24638
25045
  ] })
24639
25046
  ] }),
24640
- task.status === "blocked" && task.blockedReason && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
25047
+ task.status === "blocked" && task.blockedReason && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
24641
25048
  "div",
24642
25049
  {
24643
25050
  style: {
@@ -24650,19 +25057,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24650
25057
  fontSize: "12px"
24651
25058
  },
24652
25059
  children: [
24653
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("strong", { children: [
24654
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TriangleAlert, { size: 13 }),
25060
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("strong", { children: [
25061
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TriangleAlert, { size: 13 }),
24655
25062
  " Blocked Reason:"
24656
25063
  ] }),
24657
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { style: { margin: "4px 0 0 0" }, children: task.blockedReason })
25064
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { style: { margin: "4px 0 0 0" }, children: task.blockedReason })
24658
25065
  ]
24659
25066
  }
24660
25067
  ),
24661
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
24662
- /* @__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" }),
24663
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: (task.checklist || []).map((item) => {
25068
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
25069
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h4", { style: { margin: "0 0 8px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Checklist" }),
25070
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: (task.checklist || []).map((item) => {
24664
25071
  const isDone = item.status === "done";
24665
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
25072
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
24666
25073
  "label",
24667
25074
  {
24668
25075
  style: {
@@ -24679,7 +25086,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24679
25086
  opacity: isDone ? 0.6 : 1
24680
25087
  },
24681
25088
  children: [
24682
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
25089
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
24683
25090
  "input",
24684
25091
  {
24685
25092
  type: "checkbox",
@@ -24688,7 +25095,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24688
25095
  style: { marginTop: "2px", cursor: "pointer" }
24689
25096
  }
24690
25097
  ),
24691
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: item.text })
25098
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: item.text })
24692
25099
  ]
24693
25100
  },
24694
25101
  item.id
@@ -24700,7 +25107,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24700
25107
  }
24701
25108
 
24702
25109
  // src/useVoice.ts
24703
- var import_react24 = __toESM(require_react(), 1);
25110
+ var import_react26 = __toESM(require_react(), 1);
24704
25111
 
24705
25112
  // src/pcm_wav.ts
24706
25113
  function encodeWavPcm16(samples, rate) {
@@ -24769,41 +25176,41 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24769
25176
  const { voice, chatStatus, pendingConfirmCount, items, onTranscript } = opts;
24770
25177
  const available = !!voice && voice.enabled && voice.configured && canCapture();
24771
25178
  const canSpeak = !!voice?.canSpeak;
24772
- const [phase, setPhase] = (0, import_react24.useState)("idle");
24773
- const [mode, setMode] = (0, import_react24.useState)("dictate");
24774
- const [error, setError] = (0, import_react24.useState)(null);
24775
- const voiceRef = (0, import_react24.useRef)(voice);
25179
+ const [phase, setPhase] = (0, import_react26.useState)("idle");
25180
+ const [mode, setMode] = (0, import_react26.useState)("dictate");
25181
+ const [error, setError] = (0, import_react26.useState)(null);
25182
+ const voiceRef = (0, import_react26.useRef)(voice);
24776
25183
  voiceRef.current = voice;
24777
- const bufferMsRef = (0, import_react24.useRef)(voice?.playbackBufferMs);
25184
+ const bufferMsRef = (0, import_react26.useRef)(voice?.playbackBufferMs);
24778
25185
  bufferMsRef.current = voice?.playbackBufferMs;
24779
- const phaseRef = (0, import_react24.useRef)(phase);
25186
+ const phaseRef = (0, import_react26.useRef)(phase);
24780
25187
  phaseRef.current = phase;
24781
- const modeRef = (0, import_react24.useRef)(mode);
25188
+ const modeRef = (0, import_react26.useRef)(mode);
24782
25189
  modeRef.current = mode;
24783
- const onTranscriptRef = (0, import_react24.useRef)(onTranscript);
25190
+ const onTranscriptRef = (0, import_react26.useRef)(onTranscript);
24784
25191
  onTranscriptRef.current = onTranscript;
24785
- const itemsRef = (0, import_react24.useRef)(items);
25192
+ const itemsRef = (0, import_react26.useRef)(items);
24786
25193
  itemsRef.current = items;
24787
- const chatStatusRef = (0, import_react24.useRef)(chatStatus);
25194
+ const chatStatusRef = (0, import_react26.useRef)(chatStatus);
24788
25195
  chatStatusRef.current = chatStatus;
24789
- const streamRef = (0, import_react24.useRef)(null);
24790
- const recorderRef = (0, import_react24.useRef)(null);
24791
- const chunksRef = (0, import_react24.useRef)([]);
24792
- const vadRef = (0, import_react24.useRef)(null);
24793
- const speechAbortRef = (0, import_react24.useRef)(null);
24794
- const idleTimerRef = (0, import_react24.useRef)(null);
24795
- const heardSpeechRef = (0, import_react24.useRef)(false);
24796
- const sawStreamingRef = (0, import_react24.useRef)(false);
24797
- const cursorRef = (0, import_react24.useRef)(0);
24798
- const queueRef = (0, import_react24.useRef)([]);
24799
- const apply = (0, import_react24.useCallback)((event) => {
25196
+ const streamRef = (0, import_react26.useRef)(null);
25197
+ const recorderRef = (0, import_react26.useRef)(null);
25198
+ const chunksRef = (0, import_react26.useRef)([]);
25199
+ const vadRef = (0, import_react26.useRef)(null);
25200
+ const speechAbortRef = (0, import_react26.useRef)(null);
25201
+ const idleTimerRef = (0, import_react26.useRef)(null);
25202
+ const heardSpeechRef = (0, import_react26.useRef)(false);
25203
+ const sawStreamingRef = (0, import_react26.useRef)(false);
25204
+ const cursorRef = (0, import_react26.useRef)(0);
25205
+ const queueRef = (0, import_react26.useRef)([]);
25206
+ const apply = (0, import_react26.useCallback)((event) => {
24800
25207
  setPhase((current) => nextPhase(current, event));
24801
25208
  }, []);
24802
25209
  const clearIdleTimer = () => {
24803
25210
  if (idleTimerRef.current) clearTimeout(idleTimerRef.current);
24804
25211
  idleTimerRef.current = null;
24805
25212
  };
24806
- const teardownCapture = (0, import_react24.useCallback)(() => {
25213
+ const teardownCapture = (0, import_react26.useCallback)(() => {
24807
25214
  clearIdleTimer();
24808
25215
  try {
24809
25216
  vadRef.current?.destroy();
@@ -24820,11 +25227,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24820
25227
  chunksRef.current = [];
24821
25228
  heardSpeechRef.current = false;
24822
25229
  }, []);
24823
- const stopPlayback = (0, import_react24.useCallback)(() => {
25230
+ const stopPlayback = (0, import_react26.useCallback)(() => {
24824
25231
  speechAbortRef.current?.abort();
24825
25232
  speechAbortRef.current = null;
24826
25233
  }, []);
24827
- const fail = (0, import_react24.useCallback)(
25234
+ const fail = (0, import_react26.useCallback)(
24828
25235
  (message) => {
24829
25236
  teardownCapture();
24830
25237
  stopPlayback();
@@ -24833,7 +25240,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24833
25240
  },
24834
25241
  [apply, teardownCapture, stopPlayback]
24835
25242
  );
24836
- const finishRecording = (0, import_react24.useCallback)(() => {
25243
+ const finishRecording = (0, import_react26.useCallback)(() => {
24837
25244
  const recorder = recorderRef.current;
24838
25245
  if (!recorder || recorder.state === "inactive") return;
24839
25246
  recorder.onstop = async () => {
@@ -24863,7 +25270,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24863
25270
  };
24864
25271
  recorder.stop();
24865
25272
  }, [apply, fail, teardownCapture]);
24866
- const startRecording = (0, import_react24.useCallback)(async () => {
25273
+ const startRecording = (0, import_react26.useCallback)(async () => {
24867
25274
  setError(null);
24868
25275
  chunksRef.current = [];
24869
25276
  heardSpeechRef.current = false;
@@ -24908,7 +25315,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24908
25315
  fail(`Microphone unavailable: ${err}`);
24909
25316
  }
24910
25317
  }, [apply, fail, finishRecording, teardownCapture]);
24911
- const speakReply = (0, import_react24.useCallback)(async () => {
25318
+ const speakReply = (0, import_react26.useCallback)(async () => {
24912
25319
  const text = queueRef.current.shift();
24913
25320
  if (!text) {
24914
25321
  apply({
@@ -24947,10 +25354,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24947
25354
  fail(`Synthesis failed: ${err}`);
24948
25355
  }
24949
25356
  }, [apply, fail]);
24950
- (0, import_react24.useEffect)(() => {
25357
+ (0, import_react26.useEffect)(() => {
24951
25358
  if (chatStatus === "streaming") sawStreamingRef.current = true;
24952
25359
  }, [chatStatus]);
24953
- (0, import_react24.useEffect)(() => {
25360
+ (0, import_react26.useEffect)(() => {
24954
25361
  if (modeRef.current !== "conversation") return;
24955
25362
  if (phaseRef.current === "idle") return;
24956
25363
  const { texts, cursor } = takeFinalizedBubbles(items, cursorRef.current);
@@ -24959,7 +25366,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24959
25366
  queueRef.current.push(...texts);
24960
25367
  apply({ kind: "speechQueued", mode: "conversation", canSpeak });
24961
25368
  }, [items, canSpeak, apply]);
24962
- (0, import_react24.useEffect)(() => {
25369
+ (0, import_react26.useEffect)(() => {
24963
25370
  if (phase !== "awaiting") return;
24964
25371
  if (chatStatus === "error") {
24965
25372
  apply({ kind: "failed", mode: "conversation" });
@@ -24981,8 +25388,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24981
25388
  pendingSpeech: queueRef.current.length
24982
25389
  });
24983
25390
  }, [phase, chatStatus, pendingConfirmCount, canSpeak, apply]);
24984
- const prevPhase = (0, import_react24.useRef)("idle");
24985
- (0, import_react24.useEffect)(() => {
25391
+ const prevPhase = (0, import_react26.useRef)("idle");
25392
+ (0, import_react26.useEffect)(() => {
24986
25393
  const from = prevPhase.current;
24987
25394
  prevPhase.current = phase;
24988
25395
  if (from === phase) return;
@@ -24994,14 +25401,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
24994
25401
  queueRef.current = [];
24995
25402
  }
24996
25403
  }, [phase, startRecording, speakReply, teardownCapture, stopPlayback]);
24997
- (0, import_react24.useEffect)(
25404
+ (0, import_react26.useEffect)(
24998
25405
  () => () => {
24999
25406
  teardownCapture();
25000
25407
  stopPlayback();
25001
25408
  },
25002
25409
  [teardownCapture, stopPlayback]
25003
25410
  );
25004
- const toggle = (0, import_react24.useCallback)(() => {
25411
+ const toggle = (0, import_react26.useCallback)(() => {
25005
25412
  if (!available) return;
25006
25413
  const current = phaseRef.current;
25007
25414
  if (current === "idle") {
@@ -25015,7 +25422,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25015
25422
  }
25016
25423
  apply({ kind: "userStop", mode: modeRef.current });
25017
25424
  }, [available, apply, finishRecording]);
25018
- const changeMode = (0, import_react24.useCallback)(
25425
+ const changeMode = (0, import_react26.useCallback)(
25019
25426
  (next) => {
25020
25427
  apply({ kind: "userStop", mode: modeRef.current });
25021
25428
  setMode(next);
@@ -25026,7 +25433,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25026
25433
  }
25027
25434
 
25028
25435
  // src/App.tsx
25029
- var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
25436
+ var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
25030
25437
  function takeInjectedActivation() {
25031
25438
  const w2 = window;
25032
25439
  const id = typeof w2.__caretakerAssistant === "string" ? w2.__caretakerAssistant : null;
@@ -25034,36 +25441,37 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25034
25441
  return id;
25035
25442
  }
25036
25443
  function App({ postMessage, layout = "compact" }) {
25037
- const [chatState, dispatch] = (0, import_react25.useReducer)(chatReducer, initialChatState);
25038
- const [agents, setAgents] = (0, import_react25.useState)([]);
25039
- const [sessions, setSessions] = (0, import_react25.useState)([]);
25040
- const [selectedAgentId, setSelectedAgentId] = (0, import_react25.useState)(null);
25041
- const [selectedSessionId, setSelectedSessionId] = (0, import_react25.useState)(null);
25042
- const [showSessions, setShowSessions] = (0, import_react25.useState)(false);
25043
- const [showAllAgents, setShowAllAgents] = (0, import_react25.useState)(false);
25044
- const [pendingDelete, setPendingDelete] = (0, import_react25.useState)(null);
25045
- const [activeScreen, setActiveScreen] = (0, import_react25.useState)("chat");
25046
- const [settingsTab, setSettingsTab] = (0, import_react25.useState)();
25047
- const [settingsData, setSettingsData] = (0, import_react25.useState)(null);
25048
- const [modelsResult, setModelsResult] = (0, import_react25.useState)(null);
25049
- const [acpRegistry, setAcpRegistry] = (0, import_react25.useState)(null);
25050
- const [acpInstall, setAcpInstall] = (0, import_react25.useState)(null);
25051
- const [refreshingSourceId, setRefreshingSourceId] = (0, import_react25.useState)(null);
25052
- const [refreshOutcome, setRefreshOutcome] = (0, import_react25.useState)(null);
25053
- const [mcpAuthOutcome, setMcpAuthOutcome] = (0, import_react25.useState)(null);
25054
- const [taskRuns, setTaskRuns] = (0, import_react25.useState)({});
25055
- const [voiceConfig, setVoiceConfig] = (0, import_react25.useState)(null);
25056
- const [sttCatalogResult, setSttCatalogResult] = (0, import_react25.useState)(null);
25057
- const [ttsCatalogResult, setTtsCatalogResult] = (0, import_react25.useState)(null);
25058
- const [composerDraft, setComposerDraft] = (0, import_react25.useState)("");
25059
- const [activation, setActivation] = (0, import_react25.useState)(null);
25060
- const [confirmedAgentId, setConfirmedAgentId] = (0, import_react25.useState)(null);
25061
- const [pendingAssistantId, setPendingAssistantId] = (0, import_react25.useState)(() => takeInjectedActivation());
25062
- const [composerFocusToken, setComposerFocusToken] = (0, import_react25.useState)(0);
25063
- (0, import_react25.useEffect)(() => {
25444
+ const [chatState, dispatch] = (0, import_react27.useReducer)(chatReducer, initialChatState);
25445
+ const [agents, setAgents] = (0, import_react27.useState)([]);
25446
+ const [sessions, setSessions] = (0, import_react27.useState)([]);
25447
+ const [selectedAgentId, setSelectedAgentId] = (0, import_react27.useState)(null);
25448
+ const [selectedSessionId, setSelectedSessionId] = (0, import_react27.useState)(null);
25449
+ const [showSessions, setShowSessions] = (0, import_react27.useState)(false);
25450
+ const [showAllAgents, setShowAllAgents] = (0, import_react27.useState)(false);
25451
+ const [pendingDelete, setPendingDelete] = (0, import_react27.useState)(null);
25452
+ const [activeScreen, setActiveScreen] = (0, import_react27.useState)("chat");
25453
+ const [settingsTab, setSettingsTab] = (0, import_react27.useState)();
25454
+ const [orchestrationPending, setOrchestrationPending] = (0, import_react27.useState)(0);
25455
+ const [settingsData, setSettingsData] = (0, import_react27.useState)(null);
25456
+ const [modelsResult, setModelsResult] = (0, import_react27.useState)(null);
25457
+ const [acpRegistry, setAcpRegistry] = (0, import_react27.useState)(null);
25458
+ const [acpInstall, setAcpInstall] = (0, import_react27.useState)(null);
25459
+ const [refreshingSourceId, setRefreshingSourceId] = (0, import_react27.useState)(null);
25460
+ const [refreshOutcome, setRefreshOutcome] = (0, import_react27.useState)(null);
25461
+ const [mcpAuthOutcome, setMcpAuthOutcome] = (0, import_react27.useState)(null);
25462
+ const [taskRuns, setTaskRuns] = (0, import_react27.useState)({});
25463
+ const [voiceConfig, setVoiceConfig] = (0, import_react27.useState)(null);
25464
+ const [sttCatalogResult, setSttCatalogResult] = (0, import_react27.useState)(null);
25465
+ const [ttsCatalogResult, setTtsCatalogResult] = (0, import_react27.useState)(null);
25466
+ const [composerDraft, setComposerDraft] = (0, import_react27.useState)("");
25467
+ const [activation, setActivation] = (0, import_react27.useState)(null);
25468
+ const [confirmedAgentId, setConfirmedAgentId] = (0, import_react27.useState)(null);
25469
+ const [pendingAssistantId, setPendingAssistantId] = (0, import_react27.useState)(() => takeInjectedActivation());
25470
+ const [composerFocusToken, setComposerFocusToken] = (0, import_react27.useState)(0);
25471
+ (0, import_react27.useEffect)(() => {
25064
25472
  postMessage({ type: "webviewReady" });
25065
25473
  }, []);
25066
- (0, import_react25.useEffect)(() => {
25474
+ (0, import_react27.useEffect)(() => {
25067
25475
  function handle(event) {
25068
25476
  const msg = event.data;
25069
25477
  if (!msg || typeof msg !== "object" || !("type" in msg)) return;
@@ -25195,15 +25603,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25195
25603
  if (voice2) msg.voice = true;
25196
25604
  postMessage(msg);
25197
25605
  };
25198
- const onConfirm = (0, import_react25.useCallback)((id, decision) => {
25606
+ const onConfirm = (0, import_react27.useCallback)((id, decision) => {
25199
25607
  dispatch({ kind: "permission-resolved", id });
25200
25608
  postMessage({ type: "permission_response", id, decision });
25201
25609
  }, [postMessage]);
25202
25610
  const onAbort = () => {
25203
25611
  postMessage({ type: "abort" });
25204
25612
  };
25205
- const confirmCards = (0, import_react25.useMemo)(
25206
- () => chatState.pendingConfirms.map((p) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ConfirmCard, { pending: p, onDecide: onConfirm }, p.id)),
25613
+ const confirmCards = (0, import_react27.useMemo)(
25614
+ () => chatState.pendingConfirms.map((p) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ConfirmCard, { pending: p, onDecide: onConfirm }, p.id)),
25207
25615
  [chatState.pendingConfirms, onConfirm]
25208
25616
  );
25209
25617
  const onSelectAgent = (agentId) => {
@@ -25243,7 +25651,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25243
25651
  const cancelDeleteSession = () => {
25244
25652
  setPendingDelete(null);
25245
25653
  };
25246
- (0, import_react25.useEffect)(() => {
25654
+ (0, import_react27.useEffect)(() => {
25247
25655
  if (!pendingDelete) return;
25248
25656
  function handleKeyDown(event) {
25249
25657
  if (event.key === "Escape") {
@@ -25258,7 +25666,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25258
25666
  setShowSessions(!showSessions);
25259
25667
  }
25260
25668
  };
25261
- (0, import_react25.useEffect)(() => {
25669
+ (0, import_react27.useEffect)(() => {
25262
25670
  function handleClickOutside(event) {
25263
25671
  const target = event.target;
25264
25672
  if (showSessions && !target.closest(".app__sessions-dropdown")) {
@@ -25268,7 +25676,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25268
25676
  document.addEventListener("mousedown", handleClickOutside);
25269
25677
  return () => document.removeEventListener("mousedown", handleClickOutside);
25270
25678
  }, [showSessions]);
25271
- (0, import_react25.useEffect)(() => {
25679
+ (0, import_react27.useEffect)(() => {
25272
25680
  if (!pendingAssistantId) return;
25273
25681
  const r = resolvePending(pendingAssistantId, confirmedAgentId, agents.map((a2) => a2.id), activation);
25274
25682
  setPendingAssistantId(r.pending);
@@ -25277,7 +25685,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25277
25685
  if (r.activation?.step === "awaiting-agent") onSelectAgent(r.activation.agentId);
25278
25686
  setActivation(r.activation);
25279
25687
  }, [pendingAssistantId, agents]);
25280
- (0, import_react25.useEffect)(() => {
25688
+ (0, import_react27.useEffect)(() => {
25281
25689
  if (activation?.step !== "open") return;
25282
25690
  const adopt = localSelectionFor(activation, selectedAgentId);
25283
25691
  if (adopt) {
@@ -25293,7 +25701,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25293
25701
  setActivation(null);
25294
25702
  }
25295
25703
  }, [activation]);
25296
- (0, import_react25.useEffect)(() => {
25704
+ (0, import_react27.useEffect)(() => {
25297
25705
  if (activation?.step !== "mic") return;
25298
25706
  if (voice.mode !== "conversation" || voice.phase !== "idle") return;
25299
25707
  voice.toggle();
@@ -25307,35 +25715,63 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25307
25715
  setSettingsTab(tab);
25308
25716
  if (screen === "settings") postMessage({ type: "getSettingsData" });
25309
25717
  };
25718
+ (0, import_react27.useEffect)(() => {
25719
+ if (layout !== "sidebar") return;
25720
+ let cancelled = false;
25721
+ const pollPending = async () => {
25722
+ try {
25723
+ const res = await fetch("/api/orchestrator");
25724
+ if (!res.ok) {
25725
+ if (!cancelled) setOrchestrationPending(0);
25726
+ return;
25727
+ }
25728
+ const data = await res.json();
25729
+ if (!cancelled) {
25730
+ setOrchestrationPending(typeof data.pending === "number" ? data.pending : 0);
25731
+ }
25732
+ } catch {
25733
+ if (!cancelled) setOrchestrationPending(0);
25734
+ }
25735
+ };
25736
+ void pollPending();
25737
+ const timer = setInterval(() => {
25738
+ void pollPending();
25739
+ }, 15e3);
25740
+ return () => {
25741
+ cancelled = true;
25742
+ clearInterval(timer);
25743
+ };
25744
+ }, [layout]);
25310
25745
  const navItems = [
25311
25746
  { id: "chat", label: "Chat", Icon: MessageSquare },
25312
25747
  { id: "projects", label: "Projects", Icon: FolderKanban },
25313
25748
  { id: "settings", label: "Settings", Icon: Settings }
25314
25749
  ];
25315
- const navRail = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("nav", { className: "app__nav", children: [
25316
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("img", { src: caretaker_cli_default, alt: "Caretaker", className: "app__logo app__nav-logo" }),
25317
- navItems.map(({ id, label, Icon: Icon2 }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
25750
+ const navRail = /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("nav", { className: "app__nav", children: [
25751
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("img", { src: caretaker_cli_default, alt: "Caretaker", className: "app__logo app__nav-logo" }),
25752
+ navItems.map(({ id, label, Icon: Icon2 }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
25318
25753
  "button",
25319
25754
  {
25320
25755
  className: `app__nav-btn ${activeScreen === id ? "app__nav-btn--active" : ""}`,
25321
25756
  onClick: () => openScreen(id),
25322
25757
  title: label,
25323
25758
  children: [
25324
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon2, { size: 18 }),
25325
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: label })
25759
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon2, { size: 18 }),
25760
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: label }),
25761
+ id === "settings" && orchestrationPending > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "app__nav-badge", children: orchestrationPending })
25326
25762
  ]
25327
25763
  },
25328
25764
  id
25329
25765
  ))
25330
25766
  ] });
25331
25767
  if (activeScreen === "projects" && layout === "sidebar") {
25332
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app app--with-sidebar", children: [
25768
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app app--with-sidebar", children: [
25333
25769
  navRail,
25334
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__screen", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ProjectsTab, { agents, onOpenSettings: () => openScreen("settings", "projects"), postMessage }) })
25770
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__screen", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ProjectsTab, { agents, onOpenSettings: () => openScreen("settings", "projects"), postMessage }) })
25335
25771
  ] });
25336
25772
  }
25337
25773
  if (activeScreen === "settings") {
25338
- 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)(
25774
+ const panel = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: `app ${layout === "sidebar" ? "app--settings-centered app__screen" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
25339
25775
  SettingsPanel,
25340
25776
  {
25341
25777
  layout,
@@ -25355,47 +25791,49 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25355
25791
  mcpAuthOutcome,
25356
25792
  setMcpAuthOutcome,
25357
25793
  taskRuns,
25794
+ orchestrationPending,
25795
+ onOrchestrationPendingChange: setOrchestrationPending,
25358
25796
  onClose: () => setActiveScreen("chat")
25359
25797
  }
25360
25798
  ) });
25361
- return layout === "sidebar" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app app--with-sidebar", children: [
25799
+ return layout === "sidebar" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app app--with-sidebar", children: [
25362
25800
  navRail,
25363
25801
  panel
25364
25802
  ] }) : panel;
25365
25803
  }
25366
- 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: [
25367
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__confirm-title", children: "Delete conversation" }),
25368
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("p", { className: "app__confirm-message", children: [
25804
+ const deleteOverlay = pendingDelete && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__confirm-overlay", onClick: cancelDeleteSession, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__confirm-dialog", onClick: (e) => e.stopPropagation(), children: [
25805
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__confirm-title", children: "Delete conversation" }),
25806
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("p", { className: "app__confirm-message", children: [
25369
25807
  "Delete conversation \u201C",
25370
25808
  pendingDelete.title,
25371
25809
  "\u201D? This cannot be undone."
25372
25810
  ] }),
25373
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__confirm-buttons", children: [
25374
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { className: "app__confirm-btn", onClick: cancelDeleteSession, children: "Cancel" }),
25375
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { className: "app__confirm-btn app__confirm-btn--danger", onClick: confirmDeleteSession, children: "Delete" })
25811
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__confirm-buttons", children: [
25812
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { className: "app__confirm-btn", onClick: cancelDeleteSession, children: "Cancel" }),
25813
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { className: "app__confirm-btn app__confirm-btn--danger", onClick: confirmDeleteSession, children: "Delete" })
25376
25814
  ] })
25377
25815
  ] }) });
25378
25816
  if (layout === "sidebar") {
25379
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app app--with-sidebar", children: [
25817
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app app--with-sidebar", children: [
25380
25818
  navRail,
25381
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("aside", { className: "app__sidebar", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sidebar-content", children: [
25382
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sidebar-section", children: [
25383
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__sidebar-section-title", children: "Agents" }),
25384
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__sidebar-agents-list", children: selectedAgentId && !showAllAgents ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
25819
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("aside", { className: "app__sidebar", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__sidebar-content", children: [
25820
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__sidebar-section", children: [
25821
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__sidebar-section-title", children: "Agents" }),
25822
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__sidebar-agents-list", children: selectedAgentId && !showAllAgents ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
25385
25823
  "button",
25386
25824
  {
25387
25825
  className: "app__sidebar-agent-item app__sidebar-agent-item--collapsed-active",
25388
25826
  onClick: () => setShowAllAgents(true),
25389
25827
  title: "Switch Agent",
25390
25828
  children: [
25391
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "agent-status-dot agent-status-dot--active" }),
25392
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__sidebar-agent-name", children: activeAgent?.name || selectedAgentId }),
25393
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChevronDown, { className: "app__sidebar-chevron", size: 10 })
25829
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "agent-status-dot agent-status-dot--active" }),
25830
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "app__sidebar-agent-name", children: activeAgent?.name || selectedAgentId }),
25831
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ChevronDown, { className: "app__sidebar-chevron", size: 10 })
25394
25832
  ]
25395
25833
  }
25396
- ) : /* @__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) => {
25834
+ ) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: `app__sidebar-agents-list-expanded ${selectedAgentId ? "app__sidebar-agents-list-expanded--has-active" : ""}`, children: agents.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__sidebar-empty-text", children: "No agents found" }) : agents.map((agent) => {
25397
25835
  const isSelected = selectedAgentId === agent.id;
25398
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
25836
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
25399
25837
  "button",
25400
25838
  {
25401
25839
  className: `app__sidebar-agent-item ${isSelected ? "app__sidebar-agent-item--active" : ""}`,
@@ -25408,19 +25846,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25408
25846
  }
25409
25847
  },
25410
25848
  children: [
25411
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: `agent-status-dot ${isSelected ? "agent-status-dot--active" : ""}` }),
25412
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__sidebar-agent-name", children: agent.name }),
25413
- isSelected && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChevronUp, { className: "app__sidebar-chevron app__sidebar-chevron--up", size: 10 })
25849
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: `agent-status-dot ${isSelected ? "agent-status-dot--active" : ""}` }),
25850
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "app__sidebar-agent-name", children: agent.name }),
25851
+ isSelected && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ChevronUp, { className: "app__sidebar-chevron app__sidebar-chevron--up", size: 10 })
25414
25852
  ]
25415
25853
  },
25416
25854
  agent.id
25417
25855
  );
25418
25856
  }) }) })
25419
25857
  ] }),
25420
- selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sidebar-section", children: [
25421
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sidebar-section-header", children: [
25422
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__sidebar-section-title", children: "Conversations" }),
25423
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25858
+ selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__sidebar-section", children: [
25859
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__sidebar-section-header", children: [
25860
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "app__sidebar-section-title", children: "Conversations" }),
25861
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
25424
25862
  "button",
25425
25863
  {
25426
25864
  className: "app__sidebar-new-chat-btn",
@@ -25430,15 +25868,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25430
25868
  }
25431
25869
  )
25432
25870
  ] }),
25433
- /* @__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)(
25871
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__sidebar-sessions-list", children: sessions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__sidebar-empty-text", children: "No conversations yet" }) : sessions.map((session) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
25434
25872
  "div",
25435
25873
  {
25436
25874
  className: `app__sidebar-session-item ${selectedSessionId === session.id ? "app__sidebar-session-item--active" : ""}`,
25437
25875
  onClick: () => onSelectSession(session.id),
25438
25876
  children: [
25439
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__sidebar-session-icon", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MessageSquare, { size: 13 }) }),
25440
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__sidebar-session-title", title: session.title, children: session.title }),
25441
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25877
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "app__sidebar-session-icon", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MessageSquare, { size: 13 }) }),
25878
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "app__sidebar-session-title", title: session.title, children: session.title }),
25879
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
25442
25880
  "button",
25443
25881
  {
25444
25882
  className: "app__sidebar-session-delete",
@@ -25447,7 +25885,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25447
25885
  e.stopPropagation();
25448
25886
  onDeleteSession(session.id, session.title);
25449
25887
  },
25450
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Trash, { size: 12 })
25888
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Trash, { size: 12 })
25451
25889
  }
25452
25890
  )
25453
25891
  ]
@@ -25456,15 +25894,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25456
25894
  )) })
25457
25895
  ] })
25458
25896
  ] }) }),
25459
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("main", { className: "app__chat-pane", children: selectedAgentId ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
25460
- /* @__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: [
25461
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h2", { className: "app__chat-header-title", children: selectedAgentName }),
25462
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "app__chat-header-status", children: [
25463
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: `agent-status-dot agent-status-dot--active ${chatState.status === "streaming" ? "agent-status-dot--pulsing" : ""}` }),
25897
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("main", { className: "app__chat-pane", children: selectedAgentId ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
25898
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("header", { className: "app__chat-header", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__chat-header-info", children: [
25899
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "app__chat-header-title", children: selectedAgentName }),
25900
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "app__chat-header-status", children: [
25901
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: `agent-status-dot agent-status-dot--active ${chatState.status === "streaming" ? "agent-status-dot--pulsing" : ""}` }),
25464
25902
  chatState.status === "streaming" ? "Streaming response..." : "Ready"
25465
25903
  ] })
25466
25904
  ] }) }),
25467
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25905
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
25468
25906
  MessageList,
25469
25907
  {
25470
25908
  items: chatState.items,
@@ -25474,12 +25912,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25474
25912
  trailing: confirmCards
25475
25913
  }
25476
25914
  ),
25477
- (chatState.errorText || voice.error) && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__error", children: [
25478
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TriangleAlert, { size: 14 }),
25915
+ (chatState.errorText || voice.error) && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__error", children: [
25916
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TriangleAlert, { size: 14 }),
25479
25917
  " ",
25480
25918
  chatState.errorText || voice.error
25481
25919
  ] }),
25482
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25920
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
25483
25921
  Composer,
25484
25922
  {
25485
25923
  disabled: composerDisabled,
@@ -25499,18 +25937,18 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25499
25937
  onValueChange: setComposerDraft
25500
25938
  }
25501
25939
  )
25502
- ] }) : /* @__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" }) }) }),
25940
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { children: "Select an agent from the sidebar to start chatting" }) }) }),
25503
25941
  deleteOverlay
25504
25942
  ] });
25505
25943
  }
25506
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app", children: [
25507
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("header", { className: "app__header", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__header-row", children: [
25508
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__logo-title-wrapper", children: [
25509
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("img", { src: caretaker_cli_default, alt: "Caretaker", className: "app__logo" }),
25510
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: "Caretaker" })
25944
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app", children: [
25945
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("header", { className: "app__header", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__header-row", children: [
25946
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__logo-title-wrapper", children: [
25947
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("img", { src: caretaker_cli_default, alt: "Caretaker", className: "app__logo" }),
25948
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: "Caretaker" })
25511
25949
  ] }),
25512
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__controls", children: [
25513
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__agent-select-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
25950
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__controls", children: [
25951
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__agent-select-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
25514
25952
  "select",
25515
25953
  {
25516
25954
  className: "app__agent-select",
@@ -25520,12 +25958,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25520
25958
  onSelectAgent(e.target.value);
25521
25959
  },
25522
25960
  children: [
25523
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("option", { value: "", disabled: true, children: "-- Select Agent --" }),
25524
- agents.map((agent) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("option", { value: agent.id, children: agent.name }, agent.id))
25961
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("option", { value: "", disabled: true, children: "-- Select Agent --" }),
25962
+ agents.map((agent) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("option", { value: agent.id, children: agent.name }, agent.id))
25525
25963
  ]
25526
25964
  }
25527
25965
  ) }),
25528
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
25966
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
25529
25967
  "button",
25530
25968
  {
25531
25969
  className: "app__sessions-btn",
@@ -25533,13 +25971,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25533
25971
  disabled: !selectedAgentId,
25534
25972
  title: "View conversations",
25535
25973
  children: [
25536
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MessageSquare, { size: 13 }),
25974
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MessageSquare, { size: 13 }),
25537
25975
  " ",
25538
25976
  sessions.length
25539
25977
  ]
25540
25978
  }
25541
25979
  ),
25542
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25980
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
25543
25981
  "button",
25544
25982
  {
25545
25983
  className: "app__new-chat-btn",
@@ -25549,7 +25987,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25549
25987
  children: "+ New"
25550
25988
  }
25551
25989
  ),
25552
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
25990
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
25553
25991
  "button",
25554
25992
  {
25555
25993
  className: "app__settings-btn",
@@ -25558,24 +25996,24 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25558
25996
  postMessage({ type: "getSettingsData" });
25559
25997
  },
25560
25998
  title: "Caretaker Settings",
25561
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Settings, { className: "app__settings-icon", size: 14 })
25999
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Settings, { className: "app__settings-icon", size: 14 })
25562
26000
  }
25563
26001
  )
25564
26002
  ] })
25565
26003
  ] }) }),
25566
- showSessions && sessions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sessions-dropdown", children: [
25567
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sessions-title", children: [
26004
+ showSessions && sessions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__sessions-dropdown", children: [
26005
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__sessions-title", children: [
25568
26006
  "Conversations for ",
25569
26007
  selectedAgentName
25570
26008
  ] }),
25571
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__sessions-list", children: sessions.map((session) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
26009
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__sessions-list", children: sessions.map((session) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
25572
26010
  "div",
25573
26011
  {
25574
26012
  className: `app__session-item ${selectedSessionId === session.id ? "app__session-item--active" : ""}`,
25575
26013
  onClick: () => onSelectSession(session.id),
25576
26014
  children: [
25577
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__session-item-title", children: session.title }),
25578
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
26015
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "app__session-item-title", children: session.title }),
26016
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
25579
26017
  "button",
25580
26018
  {
25581
26019
  className: "app__session-item-delete",
@@ -25584,7 +26022,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25584
26022
  e.stopPropagation();
25585
26023
  onDeleteSession(session.id, session.title);
25586
26024
  },
25587
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Trash, { size: 12 })
26025
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Trash, { size: 12 })
25588
26026
  }
25589
26027
  )
25590
26028
  ]
@@ -25592,12 +26030,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25592
26030
  session.id
25593
26031
  )) })
25594
26032
  ] }),
25595
- showSessions && sessions.length === 0 && selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__sessions-dropdown app__sessions-dropdown--empty", children: [
25596
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "app__sessions-title", children: "No conversations yet" }),
25597
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "app__sessions-empty", children: "Start a new chat to create a conversation" })
26033
+ showSessions && sessions.length === 0 && selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__sessions-dropdown app__sessions-dropdown--empty", children: [
26034
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__sessions-title", children: "No conversations yet" }),
26035
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "app__sessions-empty", children: "Start a new chat to create a conversation" })
25598
26036
  ] }),
25599
- !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" }) }),
25600
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
26037
+ !selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { children: "Select an agent to start chatting" }) }),
26038
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
25601
26039
  MessageList,
25602
26040
  {
25603
26041
  items: chatState.items,
@@ -25607,12 +26045,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25607
26045
  trailing: confirmCards
25608
26046
  }
25609
26047
  ),
25610
- (chatState.errorText || voice.error) && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__error", children: [
25611
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TriangleAlert, { size: 14 }),
26048
+ (chatState.errorText || voice.error) && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__error", children: [
26049
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TriangleAlert, { size: 14 }),
25612
26050
  " ",
25613
26051
  chatState.errorText || voice.error
25614
26052
  ] }),
25615
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
26053
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
25616
26054
  Composer,
25617
26055
  {
25618
26056
  disabled: composerDisabled,
@@ -25637,12 +26075,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25637
26075
  }
25638
26076
 
25639
26077
  // src/standalone.tsx
25640
- var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
26078
+ var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
25641
26079
  function StandaloneApp() {
25642
- const [ws, setWs] = (0, import_react26.useState)(null);
25643
- const [connected, setConnected] = (0, import_react26.useState)(false);
25644
- const [error, setError] = (0, import_react26.useState)(null);
25645
- (0, import_react26.useEffect)(() => {
26080
+ const [ws, setWs] = (0, import_react28.useState)(null);
26081
+ const [connected, setConnected] = (0, import_react28.useState)(false);
26082
+ const [error, setError] = (0, import_react28.useState)(null);
26083
+ (0, import_react28.useEffect)(() => {
25646
26084
  let active = true;
25647
26085
  const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
25648
26086
  const socket = new WebSocket(`${protocol}//${window.location.host}/api/ws`);
@@ -25688,7 +26126,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25688
26126
  }
25689
26127
  };
25690
26128
  if (error) {
25691
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: {
26129
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { style: {
25692
26130
  display: "flex",
25693
26131
  flexDirection: "column",
25694
26132
  alignItems: "center",
@@ -25700,9 +26138,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25700
26138
  padding: "20px",
25701
26139
  textAlign: "center"
25702
26140
  }, children: [
25703
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h3", { style: { color: "#ff6b6b" }, children: "Caretaker Connection Failed" }),
25704
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: error }),
25705
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
26141
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h3", { style: { color: "#ff6b6b" }, children: "Caretaker Connection Failed" }),
26142
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { children: error }),
26143
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
25706
26144
  "button",
25707
26145
  {
25708
26146
  onClick: () => setWs(null),
@@ -25721,7 +26159,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25721
26159
  ] });
25722
26160
  }
25723
26161
  if (!connected) {
25724
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: {
26162
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { style: {
25725
26163
  display: "flex",
25726
26164
  flexDirection: "column",
25727
26165
  alignItems: "center",
@@ -25731,7 +26169,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25731
26169
  background: "#1e1e1e",
25732
26170
  color: "#f1f1f1"
25733
26171
  }, children: [
25734
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: {
26172
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { style: {
25735
26173
  border: "4px solid rgba(255,255,255,0.1)",
25736
26174
  width: "36px",
25737
26175
  height: "36px",
@@ -25740,8 +26178,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25740
26178
  animation: "spin 1s linear infinite",
25741
26179
  marginBottom: "16px"
25742
26180
  } }),
25743
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "Connecting to Caretaker server..." }),
25744
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("style", { children: `
26181
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "Connecting to Caretaker server..." }),
26182
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("style", { children: `
25745
26183
  @keyframes spin {
25746
26184
  0% { transform: rotate(0deg); }
25747
26185
  100% { transform: rotate(360deg); }
@@ -25749,12 +26187,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
25749
26187
  ` })
25750
26188
  ] });
25751
26189
  }
25752
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(App, { postMessage, layout: "sidebar" });
26190
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(App, { postMessage, layout: "sidebar" });
25753
26191
  }
25754
26192
  var rootEl = document.getElementById("root");
25755
26193
  if (!rootEl) throw new Error("#root not found");
25756
26194
  (0, import_client.createRoot)(rootEl).render(
25757
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react26.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(StandaloneApp, {}) })
26195
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react28.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(StandaloneApp, {}) })
25758
26196
  );
25759
26197
  })();
25760
26198
  /*! Bundled license information: