@hyperwindmill/caretaker-cli 0.17.0 → 0.19.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.
@@ -3276,10 +3276,10 @@
3276
3276
  refCount: 0
3277
3277
  };
3278
3278
  }
3279
- function releaseCache(cache) {
3280
- cache.refCount--;
3281
- 0 === cache.refCount && scheduleCallback$2(NormalPriority, function() {
3282
- cache.controller.abort();
3279
+ function releaseCache(cache2) {
3280
+ cache2.refCount--;
3281
+ 0 === cache2.refCount && scheduleCallback$2(NormalPriority, function() {
3282
+ cache2.controller.abort();
3283
3283
  });
3284
3284
  }
3285
3285
  var currentEntangledListeners = null;
@@ -8639,21 +8639,21 @@
8639
8639
  case 23:
8640
8640
  case 22:
8641
8641
  if (null !== fiber.memoizedState && null !== fiber.memoizedState.cachePool) {
8642
- var cache = fiber.memoizedState.cachePool.pool;
8643
- null != cache && cache.refCount++;
8642
+ var cache2 = fiber.memoizedState.cachePool.pool;
8643
+ null != cache2 && cache2.refCount++;
8644
8644
  }
8645
8645
  break;
8646
8646
  case 24:
8647
8647
  releaseCache(fiber.memoizedState.cache);
8648
8648
  }
8649
- cache = fiber.child;
8650
- if (null !== cache) cache.return = fiber, nextEffect = cache;
8649
+ cache2 = fiber.child;
8650
+ if (null !== cache2) cache2.return = fiber, nextEffect = cache2;
8651
8651
  else
8652
8652
  a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) {
8653
- cache = nextEffect;
8654
- var sibling = cache.sibling, returnFiber = cache.return;
8655
- detachFiberAfterEffects(cache);
8656
- if (cache === fiber) {
8653
+ cache2 = nextEffect;
8654
+ var sibling = cache2.sibling, returnFiber = cache2.return;
8655
+ detachFiberAfterEffects(cache2);
8656
+ if (cache2 === fiber) {
8657
8657
  nextEffect = null;
8658
8658
  break a;
8659
8659
  }
@@ -8668,8 +8668,8 @@
8668
8668
  }
8669
8669
  var DefaultAsyncDispatcher = {
8670
8670
  getCacheForType: function(resourceType) {
8671
- var cache = readContext(CacheContext), cacheForType = cache.data.get(resourceType);
8672
- void 0 === cacheForType && (cacheForType = resourceType(), cache.data.set(resourceType, cacheForType));
8671
+ var cache2 = readContext(CacheContext), cacheForType = cache2.data.get(resourceType);
8672
+ void 0 === cacheForType && (cacheForType = resourceType(), cache2.data.set(resourceType, cacheForType));
8673
8673
  return cacheForType;
8674
8674
  },
8675
8675
  cacheSignal: function() {
@@ -11808,24 +11808,24 @@
11808
11808
  var tagCaches = null;
11809
11809
  function getHydratableHoistableCache(type, keyAttribute, ownerDocument) {
11810
11810
  if (null === tagCaches) {
11811
- var cache = /* @__PURE__ */ new Map();
11811
+ var cache2 = /* @__PURE__ */ new Map();
11812
11812
  var caches = tagCaches = /* @__PURE__ */ new Map();
11813
- caches.set(ownerDocument, cache);
11813
+ caches.set(ownerDocument, cache2);
11814
11814
  } else
11815
- caches = tagCaches, cache = caches.get(ownerDocument), cache || (cache = /* @__PURE__ */ new Map(), caches.set(ownerDocument, cache));
11816
- if (cache.has(type)) return cache;
11817
- cache.set(type, null);
11815
+ caches = tagCaches, cache2 = caches.get(ownerDocument), cache2 || (cache2 = /* @__PURE__ */ new Map(), caches.set(ownerDocument, cache2));
11816
+ if (cache2.has(type)) return cache2;
11817
+ cache2.set(type, null);
11818
11818
  ownerDocument = ownerDocument.getElementsByTagName(type);
11819
11819
  for (caches = 0; caches < ownerDocument.length; caches++) {
11820
11820
  var node = ownerDocument[caches];
11821
11821
  if (!(node[internalHoistableMarker] || node[internalInstanceKey] || "link" === type && "stylesheet" === node.getAttribute("rel")) && "http://www.w3.org/2000/svg" !== node.namespaceURI) {
11822
11822
  var nodeKey = node.getAttribute(keyAttribute) || "";
11823
11823
  nodeKey = type + nodeKey;
11824
- var existing = cache.get(nodeKey);
11825
- existing ? existing.push(node) : cache.set(nodeKey, [node]);
11824
+ var existing = cache2.get(nodeKey);
11825
+ existing ? existing.push(node) : cache2.set(nodeKey, [node]);
11826
11826
  }
11827
11827
  }
11828
- return cache;
11828
+ return cache2;
11829
11829
  }
11830
11830
  function mountHoistable(hoistableRoot, type, instance) {
11831
11831
  hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
@@ -12755,14 +12755,17 @@
12755
12755
  });
12756
12756
 
12757
12757
  // src/standalone.tsx
12758
- var import_react17 = __toESM(require_react(), 1);
12758
+ var import_react19 = __toESM(require_react(), 1);
12759
12759
  var import_client = __toESM(require_client(), 1);
12760
12760
 
12761
12761
  // src/App.tsx
12762
- var import_react16 = __toESM(require_react(), 1);
12762
+ var import_react18 = __toESM(require_react(), 1);
12763
12763
 
12764
12764
  // src/MessageList.tsx
12765
- var import_react3 = __toESM(require_react(), 1);
12765
+ var import_react4 = __toESM(require_react(), 1);
12766
+
12767
+ // src/MarkdownText.tsx
12768
+ var import_react = __toESM(require_react(), 1);
12766
12769
 
12767
12770
  // ../../node_modules/.pnpm/marked@15.0.12/node_modules/marked/lib/marked.esm.js
12768
12771
  function _getDefaults() {
@@ -14900,8 +14903,7 @@ ${text}</tr>
14900
14903
  var parser = _Parser.parse;
14901
14904
  var lexer = _Lexer.lex;
14902
14905
 
14903
- // src/MarkdownText.tsx
14904
- var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
14906
+ // src/markdown.ts
14905
14907
  function sanitize(html2) {
14906
14908
  const dangerous = /<(script|style|iframe|object|embed|form|input|button|textarea)[^>]*>.*?<\/\1>|<(script|style|iframe|object|embed|form|input|button|textarea)[^>]*>/gi;
14907
14909
  const sanitized = html2.replace(dangerous, "");
@@ -14910,16 +14912,58 @@ ${text}</tr>
14910
14912
  const jsUrls = /href\s*=\s*["']\s*javascript:[^"']*["']/gi;
14911
14913
  return noEvents.replace(jsUrls, 'href="#"');
14912
14914
  }
14913
- function MarkdownText({ content, inline: inline2 = false }) {
14914
- const html2 = marked.parse(content, {
14915
- breaks: true,
14916
- gfm: true
14917
- });
14918
- const sanitized = sanitize(html2);
14915
+ var cacheLimit = 2e3;
14916
+ var cache = /* @__PURE__ */ new Map();
14917
+ function renderMarkdown(content, useCache = true) {
14918
+ if (useCache) {
14919
+ const hit = cache.get(content);
14920
+ if (hit !== void 0) {
14921
+ cache.delete(content);
14922
+ cache.set(content, hit);
14923
+ return hit;
14924
+ }
14925
+ }
14926
+ const html2 = sanitize(marked.parse(content, { breaks: true, gfm: true }));
14927
+ if (useCache) {
14928
+ cache.set(content, html2);
14929
+ if (cache.size > cacheLimit) {
14930
+ const oldest = cache.keys().next();
14931
+ if (!oldest.done) cache.delete(oldest.value);
14932
+ }
14933
+ }
14934
+ return html2;
14935
+ }
14936
+
14937
+ // src/MarkdownText.tsx
14938
+ var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
14939
+ var MarkdownText = (0, import_react.memo)(function MarkdownText2({ content, inline: inline2 = false, cache: cache2 = true }) {
14940
+ const html2 = renderMarkdown(content, cache2);
14919
14941
  if (inline2) {
14920
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { dangerouslySetInnerHTML: { __html: sanitized } });
14942
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { dangerouslySetInnerHTML: { __html: html2 } });
14943
+ }
14944
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "markdown-body", dangerouslySetInnerHTML: { __html: html2 } });
14945
+ });
14946
+
14947
+ // src/compactGroups.ts
14948
+ function groupCompactItems(items) {
14949
+ const groups = [];
14950
+ let i = 0;
14951
+ while (i < items.length) {
14952
+ const item = items[i];
14953
+ if (item.kind === "tool") {
14954
+ const start = i;
14955
+ const run = [];
14956
+ while (i < items.length && items[i].kind === "tool") {
14957
+ run.push(items[i]);
14958
+ i++;
14959
+ }
14960
+ groups.push({ kind: "tool-row", key: start, items: run });
14961
+ } else {
14962
+ groups.push({ kind: "single", key: i, item });
14963
+ i++;
14964
+ }
14921
14965
  }
14922
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "markdown-body", dangerouslySetInnerHTML: { __html: sanitized } });
14966
+ return groups;
14923
14967
  }
14924
14968
 
14925
14969
  // src/toolFormat.ts
@@ -14968,9 +15012,15 @@ ${text}</tr>
14968
15012
  function truncate(s, max) {
14969
15013
  return s.length > max ? `${s.slice(0, max)}\u2026` : s;
14970
15014
  }
15015
+ function popoverPosition(rect, vw, vh, gap = 6, width = 480) {
15016
+ const maxWidth = Math.min(width, vw - 16);
15017
+ const left = Math.max(8, Math.min(rect.left, vw - 8 - maxWidth));
15018
+ const placeAbove = rect.top > vh * 0.6;
15019
+ return placeAbove ? { left, bottom: vh - rect.top + gap, maxWidth } : { left, top: rect.bottom + gap, maxWidth };
15020
+ }
14971
15021
 
14972
15022
  // ../../node_modules/.pnpm/lucide-react@0.545.0_react@19.2.6/node_modules/lucide-react/dist/esm/createLucideIcon.js
14973
- var import_react2 = __toESM(require_react());
15023
+ var import_react3 = __toESM(require_react());
14974
15024
 
14975
15025
  // ../../node_modules/.pnpm/lucide-react@0.545.0_react@19.2.6/node_modules/lucide-react/dist/esm/shared/src/utils.js
14976
15026
  var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
@@ -14994,7 +15044,7 @@ ${text}</tr>
14994
15044
  };
14995
15045
 
14996
15046
  // ../../node_modules/.pnpm/lucide-react@0.545.0_react@19.2.6/node_modules/lucide-react/dist/esm/Icon.js
14997
- var import_react = __toESM(require_react());
15047
+ var import_react2 = __toESM(require_react());
14998
15048
 
14999
15049
  // ../../node_modules/.pnpm/lucide-react@0.545.0_react@19.2.6/node_modules/lucide-react/dist/esm/defaultAttributes.js
15000
15050
  var defaultAttributes = {
@@ -15010,7 +15060,7 @@ ${text}</tr>
15010
15060
  };
15011
15061
 
15012
15062
  // ../../node_modules/.pnpm/lucide-react@0.545.0_react@19.2.6/node_modules/lucide-react/dist/esm/Icon.js
15013
- var Icon = (0, import_react.forwardRef)(
15063
+ var Icon = (0, import_react2.forwardRef)(
15014
15064
  ({
15015
15065
  color = "currentColor",
15016
15066
  size = 24,
@@ -15020,7 +15070,7 @@ ${text}</tr>
15020
15070
  children,
15021
15071
  iconNode,
15022
15072
  ...rest
15023
- }, ref) => (0, import_react.createElement)(
15073
+ }, ref) => (0, import_react2.createElement)(
15024
15074
  "svg",
15025
15075
  {
15026
15076
  ref,
@@ -15034,7 +15084,7 @@ ${text}</tr>
15034
15084
  ...rest
15035
15085
  },
15036
15086
  [
15037
- ...iconNode.map(([tag2, attrs]) => (0, import_react.createElement)(tag2, attrs)),
15087
+ ...iconNode.map(([tag2, attrs]) => (0, import_react2.createElement)(tag2, attrs)),
15038
15088
  ...Array.isArray(children) ? children : [children]
15039
15089
  ]
15040
15090
  )
@@ -15042,8 +15092,8 @@ ${text}</tr>
15042
15092
 
15043
15093
  // ../../node_modules/.pnpm/lucide-react@0.545.0_react@19.2.6/node_modules/lucide-react/dist/esm/createLucideIcon.js
15044
15094
  var createLucideIcon = (iconName, iconNode) => {
15045
- const Component = (0, import_react2.forwardRef)(
15046
- ({ className, ...props }, ref) => (0, import_react2.createElement)(Icon, {
15095
+ const Component = (0, import_react3.forwardRef)(
15096
+ ({ className, ...props }, ref) => (0, import_react3.createElement)(Icon, {
15047
15097
  ref,
15048
15098
  iconNode,
15049
15099
  className: mergeClasses(
@@ -15324,16 +15374,23 @@ ${text}</tr>
15324
15374
  // src/MessageList.tsx
15325
15375
  var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
15326
15376
  var STICK_THRESHOLD = 100;
15327
- function MessageList({ items, sessionId = null, trailing, isStreaming, agentName }) {
15328
- const containerRef = (0, import_react3.useRef)(null);
15329
- const prevItemsLengthRef = (0, import_react3.useRef)(items.length);
15330
- const stickRef = (0, import_react3.useRef)(true);
15377
+ var MessageList = (0, import_react4.memo)(function MessageList2({
15378
+ items,
15379
+ sessionId = null,
15380
+ trailing,
15381
+ isStreaming,
15382
+ agentName,
15383
+ compact = false
15384
+ }) {
15385
+ const containerRef = (0, import_react4.useRef)(null);
15386
+ const prevItemsLengthRef = (0, import_react4.useRef)(items.length);
15387
+ const stickRef = (0, import_react4.useRef)(true);
15331
15388
  const onScroll = () => {
15332
15389
  const c = containerRef.current;
15333
15390
  if (!c) return;
15334
15391
  stickRef.current = c.scrollHeight - c.scrollTop - c.clientHeight <= STICK_THRESHOLD;
15335
15392
  };
15336
- (0, import_react3.useEffect)(() => {
15393
+ (0, import_react4.useEffect)(() => {
15337
15394
  const container = containerRef.current;
15338
15395
  if (!container) return;
15339
15396
  const grew = items.length > prevItemsLengthRef.current;
@@ -15348,7 +15405,9 @@ ${text}</tr>
15348
15405
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "messages messages--empty", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: "Send a message to start." }) });
15349
15406
  }
15350
15407
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { ref: containerRef, className: "messages", onScroll, children: [
15351
- items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Item, { item, sessionId }, i)),
15408
+ compact ? groupCompactItems(items).map(
15409
+ (g) => g.kind === "tool-row" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "tool-bubble-row", children: g.items.map((item, j) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Item, { item, sessionId, compact }, g.key + j)) }, g.key) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Item, { item: g.item, sessionId, compact }, g.key)
15410
+ ) : items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Item, { item, sessionId, compact }, i)),
15352
15411
  trailing,
15353
15412
  isStreaming && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "messages__loading-indicator", children: [
15354
15413
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("img", { src: caretaker_cli_default, alt: "Loading", className: "messages__loading-logo" }),
@@ -15358,8 +15417,126 @@ ${text}</tr>
15358
15417
  ] })
15359
15418
  ] })
15360
15419
  ] });
15361
- }
15362
- function Item({ item, sessionId }) {
15420
+ });
15421
+ var ToolBlock = (0, import_react4.memo)(function ToolBlock2({ item }) {
15422
+ const [open, setOpen] = (0, import_react4.useState)(false);
15423
+ const summary = toolSummary(item.args);
15424
+ const fullArgs = prettyArgs(item.args);
15425
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("details", { className: "tool", open, onToggle: (e) => setOpen(e.currentTarget.open), children: [
15426
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("summary", { className: "tool__header", children: [
15427
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "tool__icon", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Wrench, { size: 14 }) }),
15428
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "tool__name", children: item.name }),
15429
+ summary && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "tool__args", children: summary }),
15430
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "tool__status", children: item.result === null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LoaderCircle, { className: "tool__spinner", size: 14 }) : item.result === "" ? null : resultMetric(item.result) }),
15431
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "tool__chevron" })
15432
+ ] }),
15433
+ open && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "tool__body", children: [
15434
+ fullArgs && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("pre", { className: "tool__args-full", children: fullArgs }),
15435
+ item.result !== null && item.result !== "" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "tool__result", children: [
15436
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "tool__arrow", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CornerDownRight, { size: 13 }) }),
15437
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "tool__result-content", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MarkdownText, { content: item.result }) })
15438
+ ] })
15439
+ ] })
15440
+ ] });
15441
+ });
15442
+ var ToolBubble = (0, import_react4.memo)(function ToolBubble2({ item }) {
15443
+ const chipRef = (0, import_react4.useRef)(null);
15444
+ const popoverRef = (0, import_react4.useRef)(null);
15445
+ const [hovering, setHovering] = (0, import_react4.useState)(false);
15446
+ const [pinned, setPinned] = (0, import_react4.useState)(false);
15447
+ const [rect, setRect] = (0, import_react4.useState)(null);
15448
+ const summary = toolSummary(item.args);
15449
+ const fullArgs = prettyArgs(item.args);
15450
+ const hasResult = item.result !== null && item.result !== "";
15451
+ const hasDetail = Boolean(fullArgs) || hasResult;
15452
+ const open = hasDetail && (hovering || pinned);
15453
+ (0, import_react4.useEffect)(() => {
15454
+ if (!open) return;
15455
+ const measure = () => {
15456
+ if (chipRef.current) setRect(chipRef.current.getBoundingClientRect());
15457
+ };
15458
+ measure();
15459
+ const onKey = (e) => {
15460
+ if (e.key === "Escape") {
15461
+ setPinned(false);
15462
+ setHovering(false);
15463
+ }
15464
+ };
15465
+ window.addEventListener("scroll", measure, true);
15466
+ window.addEventListener("resize", measure);
15467
+ window.addEventListener("keydown", onKey);
15468
+ return () => {
15469
+ window.removeEventListener("scroll", measure, true);
15470
+ window.removeEventListener("resize", measure);
15471
+ window.removeEventListener("keydown", onKey);
15472
+ };
15473
+ }, [open]);
15474
+ (0, import_react4.useEffect)(() => {
15475
+ if (!pinned) return;
15476
+ const onDown = (e) => {
15477
+ const t = e.target;
15478
+ if (chipRef.current?.contains(t) || popoverRef.current?.contains(t)) return;
15479
+ setPinned(false);
15480
+ };
15481
+ document.addEventListener("mousedown", onDown, true);
15482
+ return () => document.removeEventListener("mousedown", onDown, true);
15483
+ }, [pinned]);
15484
+ const pos = open && rect ? popoverPosition(rect, window.innerWidth, window.innerHeight) : null;
15485
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "tool-bubble-wrap", children: [
15486
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
15487
+ "div",
15488
+ {
15489
+ ref: chipRef,
15490
+ className: `tool-bubble${open ? " tool-bubble--open" : ""}`,
15491
+ tabIndex: hasDetail ? 0 : -1,
15492
+ role: hasDetail ? "button" : void 0,
15493
+ "aria-expanded": hasDetail ? open : void 0,
15494
+ onMouseEnter: () => setHovering(true),
15495
+ onMouseLeave: () => setHovering(false),
15496
+ onFocus: () => setHovering(true),
15497
+ onBlur: () => setHovering(false),
15498
+ onClick: () => hasDetail && setPinned((p) => !p),
15499
+ onKeyDown: (e) => {
15500
+ if (hasDetail && (e.key === "Enter" || e.key === " ")) {
15501
+ e.preventDefault();
15502
+ setPinned((p) => !p);
15503
+ }
15504
+ },
15505
+ children: [
15506
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "tool-bubble__icon", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Wrench, { size: 12 }) }),
15507
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "tool-bubble__name", children: item.name }),
15508
+ summary && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "tool-bubble__summary", children: summary }),
15509
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "tool-bubble__status", children: item.result === null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LoaderCircle, { className: "tool__spinner", size: 12 }) : hasResult ? resultMetric(item.result) : null })
15510
+ ]
15511
+ }
15512
+ ),
15513
+ pos && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
15514
+ "div",
15515
+ {
15516
+ ref: popoverRef,
15517
+ className: `tool-bubble__popover${pinned ? " tool-bubble__popover--pinned" : ""}`,
15518
+ role: "tooltip",
15519
+ style: {
15520
+ position: "fixed",
15521
+ left: pos.left,
15522
+ top: pos.top,
15523
+ bottom: pos.bottom,
15524
+ maxWidth: pos.maxWidth,
15525
+ pointerEvents: pinned ? "auto" : "none"
15526
+ },
15527
+ children: [
15528
+ fullArgs && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("pre", { className: "tool-bubble__args", children: fullArgs }),
15529
+ hasResult && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "tool-bubble__result", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MarkdownText, { content: item.result }) })
15530
+ ]
15531
+ }
15532
+ )
15533
+ ] });
15534
+ });
15535
+ var Item = (0, import_react4.memo)(function Item2({
15536
+ item,
15537
+ sessionId,
15538
+ compact
15539
+ }) {
15363
15540
  switch (item.kind) {
15364
15541
  case "user":
15365
15542
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "bubble bubble--user", children: [
@@ -15406,7 +15583,7 @@ ${text}</tr>
15406
15583
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "bubble bubble--assistant", children: [
15407
15584
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "bubble__role", children: item.label || "assistant" }),
15408
15585
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "bubble__text", children: [
15409
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MarkdownText, { content: item.text }),
15586
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MarkdownText, { content: item.text, cache: !item.streaming }),
15410
15587
  item.streaming && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "bubble__caret", children: "\u258C" })
15411
15588
  ] })
15412
15589
  ] });
@@ -15417,38 +15594,27 @@ ${text}</tr>
15417
15594
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "thinking__title", children: "Thinking Process" }),
15418
15595
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "thinking__chevron" })
15419
15596
  ] }),
15420
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "thinking__content", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MarkdownText, { content: item.text }) })
15597
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "thinking__content", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MarkdownText, { content: item.text, cache: false }) })
15421
15598
  ] });
15422
- case "tool": {
15423
- const summary = toolSummary(item.args);
15424
- const fullArgs = prettyArgs(item.args);
15425
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("details", { className: "tool", children: [
15426
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("summary", { className: "tool__header", children: [
15427
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "tool__icon", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Wrench, { size: 14 }) }),
15428
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "tool__name", children: item.name }),
15429
- summary && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "tool__args", children: summary }),
15430
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "tool__status", children: item.result === null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LoaderCircle, { className: "tool__spinner", size: 14 }) : item.result === "" ? null : resultMetric(item.result) }),
15431
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "tool__chevron" })
15432
- ] }),
15433
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "tool__body", children: [
15434
- fullArgs && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("pre", { className: "tool__args-full", children: fullArgs }),
15435
- item.result !== null && item.result !== "" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "tool__result", children: [
15436
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "tool__arrow", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CornerDownRight, { size: 13 }) }),
15437
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "tool__result-content", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MarkdownText, { content: item.result }) })
15438
- ] })
15439
- ] })
15440
- ] });
15441
- }
15599
+ case "tool":
15600
+ return compact ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ToolBubble, { item }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ToolBlock, { item });
15442
15601
  case "notice":
15443
15602
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: `notice${item.variant === "block" ? " notice--block" : ""}`, children: [
15444
15603
  item.variant === "block" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TriangleAlert, { size: 12 }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Settings, { size: 12 }),
15445
15604
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MarkdownText, { content: item.text })
15446
15605
  ] });
15447
15606
  }
15607
+ });
15608
+
15609
+ // src/Composer.tsx
15610
+ var import_react5 = __toESM(require_react(), 1);
15611
+
15612
+ // src/composer_utils.ts
15613
+ function shouldFocusComposer(prevDisabled, disabled, documentHasFocus) {
15614
+ return prevDisabled && !disabled && documentHasFocus;
15448
15615
  }
15449
15616
 
15450
15617
  // src/Composer.tsx
15451
- var import_react4 = __toESM(require_react(), 1);
15452
15618
  var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
15453
15619
  function Composer({
15454
15620
  disabled,
@@ -15460,7 +15626,7 @@ ${text}</tr>
15460
15626
  value: propValue,
15461
15627
  onValueChange: propOnValueChange
15462
15628
  }) {
15463
- const [internalValue, setInternalValue] = (0, import_react4.useState)("");
15629
+ const [internalValue, setInternalValue] = (0, import_react5.useState)("");
15464
15630
  const value = propValue !== void 0 ? propValue : internalValue;
15465
15631
  const setValue = (val) => {
15466
15632
  if (propOnValueChange) {
@@ -15473,10 +15639,18 @@ ${text}</tr>
15473
15639
  setInternalValue(val);
15474
15640
  }
15475
15641
  };
15476
- const [attachments, setAttachments] = (0, import_react4.useState)([]);
15477
- const [isDragging, setIsDragging] = (0, import_react4.useState)(false);
15478
- const fileInputRef = (0, import_react4.useRef)(null);
15479
- const dragCounter = (0, import_react4.useRef)(0);
15642
+ const [attachments, setAttachments] = (0, import_react5.useState)([]);
15643
+ const [isDragging, setIsDragging] = (0, import_react5.useState)(false);
15644
+ const fileInputRef = (0, import_react5.useRef)(null);
15645
+ const dragCounter = (0, import_react5.useRef)(0);
15646
+ const inputRef = (0, import_react5.useRef)(null);
15647
+ const prevDisabled = (0, import_react5.useRef)(true);
15648
+ (0, import_react5.useEffect)(() => {
15649
+ if (shouldFocusComposer(prevDisabled.current, disabled, document.hasFocus())) {
15650
+ inputRef.current?.focus();
15651
+ }
15652
+ prevDisabled.current = disabled;
15653
+ }, [disabled]);
15480
15654
  const send = () => {
15481
15655
  onSend(value, attachments.length > 0 ? attachments : void 0);
15482
15656
  setValue("");
@@ -15577,6 +15751,7 @@ ${text}</tr>
15577
15751
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
15578
15752
  "textarea",
15579
15753
  {
15754
+ ref: inputRef,
15580
15755
  className: "composer__input",
15581
15756
  value,
15582
15757
  placeholder: "Message Caretaker (Drop/paste files/images)...",
@@ -15736,20 +15911,20 @@ ${text}</tr>
15736
15911
  }
15737
15912
 
15738
15913
  // src/SettingsPanel.tsx
15739
- var import_react13 = __toESM(require_react(), 1);
15914
+ var import_react15 = __toESM(require_react(), 1);
15740
15915
 
15741
15916
  // src/ProvidersTab.tsx
15742
- var import_react5 = __toESM(require_react(), 1);
15917
+ var import_react6 = __toESM(require_react(), 1);
15743
15918
  var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
15744
15919
  function ProvidersTab({ config, agents, postMessage }) {
15745
- const [editingProvider, setEditingProvider] = (0, import_react5.useState)(null);
15746
- const [isCreating, setIsCreating] = (0, import_react5.useState)(false);
15747
- const [name, setName] = (0, import_react5.useState)("");
15748
- const [type, setType] = (0, import_react5.useState)("openai");
15749
- const [endpoint, setEndpoint] = (0, import_react5.useState)("");
15750
- const [apiKey, setApiKey] = (0, import_react5.useState)("");
15751
- const [command, setCommand] = (0, import_react5.useState)("");
15752
- const [errorMsg, setErrorMsg] = (0, import_react5.useState)(null);
15920
+ const [editingProvider, setEditingProvider] = (0, import_react6.useState)(null);
15921
+ const [isCreating, setIsCreating] = (0, import_react6.useState)(false);
15922
+ const [name, setName] = (0, import_react6.useState)("");
15923
+ const [type, setType] = (0, import_react6.useState)("openai");
15924
+ const [endpoint, setEndpoint] = (0, import_react6.useState)("");
15925
+ const [apiKey, setApiKey] = (0, import_react6.useState)("");
15926
+ const [command, setCommand] = (0, import_react6.useState)("");
15927
+ const [errorMsg, setErrorMsg] = (0, import_react6.useState)(null);
15753
15928
  const startEdit = (provider) => {
15754
15929
  setEditingProvider(provider);
15755
15930
  setIsCreating(false);
@@ -15975,17 +16150,17 @@ ${text}</tr>
15975
16150
  }
15976
16151
 
15977
16152
  // src/ProjectsTabSettings.tsx
15978
- var import_react7 = __toESM(require_react(), 1);
16153
+ var import_react8 = __toESM(require_react(), 1);
15979
16154
 
15980
16155
  // src/FolderPicker.tsx
15981
- var import_react6 = __toESM(require_react(), 1);
16156
+ var import_react7 = __toESM(require_react(), 1);
15982
16157
  var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
15983
16158
  function FolderPicker({ id, value, onChange, placeholder }) {
15984
- const [isOpen, setIsOpen] = (0, import_react6.useState)(false);
15985
- const [currentPath, setCurrentPath] = (0, import_react6.useState)(null);
15986
- const [directories, setDirectories] = (0, import_react6.useState)([]);
15987
- const [loading, setLoading] = (0, import_react6.useState)(false);
15988
- const [error, setError] = (0, import_react6.useState)(null);
16159
+ const [isOpen, setIsOpen] = (0, import_react7.useState)(false);
16160
+ const [currentPath, setCurrentPath] = (0, import_react7.useState)(null);
16161
+ const [directories, setDirectories] = (0, import_react7.useState)([]);
16162
+ const [loading, setLoading] = (0, import_react7.useState)(false);
16163
+ const [error, setError] = (0, import_react7.useState)(null);
15989
16164
  const fetchDir = async (path) => {
15990
16165
  setLoading(true);
15991
16166
  setError(null);
@@ -16197,21 +16372,21 @@ ${text}</tr>
16197
16372
  // src/ProjectsTabSettings.tsx
16198
16373
  var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
16199
16374
  function ProjectsTabSettings({ config, agents, postMessage }) {
16200
- const [editingProject, setEditingProject] = (0, import_react7.useState)(null);
16201
- const [isCreating, setIsCreating] = (0, import_react7.useState)(false);
16202
- const [name, setName] = (0, import_react7.useState)("");
16203
- const [description, setDescription] = (0, import_react7.useState)("");
16204
- const [workingDir, setWorkingDir] = (0, import_react7.useState)("");
16205
- const [agentId, setAgentId] = (0, import_react7.useState)("");
16206
- const [plannerAgentId, setPlannerAgentId] = (0, import_react7.useState)("");
16207
- const [reviewerAgentId, setReviewerAgentId] = (0, import_react7.useState)("");
16208
- const [planningEnabled, setPlanningEnabled] = (0, import_react7.useState)(null);
16209
- const [reviewEnabled, setReviewEnabled] = (0, import_react7.useState)(null);
16210
- const [sddEnabled, setSddEnabled] = (0, import_react7.useState)(null);
16211
- const [bootstrapText, setBootstrapText] = (0, import_react7.useState)("");
16212
- const [maxRunSecondsText, setMaxRunSecondsText] = (0, import_react7.useState)("");
16213
- const [dockerImage, setDockerImage] = (0, import_react7.useState)("");
16214
- const [errorMsg, setErrorMsg] = (0, import_react7.useState)(null);
16375
+ const [editingProject, setEditingProject] = (0, import_react8.useState)(null);
16376
+ const [isCreating, setIsCreating] = (0, import_react8.useState)(false);
16377
+ const [name, setName] = (0, import_react8.useState)("");
16378
+ const [description, setDescription] = (0, import_react8.useState)("");
16379
+ const [workingDir, setWorkingDir] = (0, import_react8.useState)("");
16380
+ const [agentId, setAgentId] = (0, import_react8.useState)("");
16381
+ const [plannerAgentId, setPlannerAgentId] = (0, import_react8.useState)("");
16382
+ const [reviewerAgentId, setReviewerAgentId] = (0, import_react8.useState)("");
16383
+ const [planningEnabled, setPlanningEnabled] = (0, import_react8.useState)(null);
16384
+ const [reviewEnabled, setReviewEnabled] = (0, import_react8.useState)(null);
16385
+ const [sddEnabled, setSddEnabled] = (0, import_react8.useState)(null);
16386
+ const [bootstrapText, setBootstrapText] = (0, import_react8.useState)("");
16387
+ const [maxRunSecondsText, setMaxRunSecondsText] = (0, import_react8.useState)("");
16388
+ const [dockerImage, setDockerImage] = (0, import_react8.useState)("");
16389
+ const [errorMsg, setErrorMsg] = (0, import_react8.useState)(null);
16215
16390
  const projects = config.projects || [];
16216
16391
  const startEdit = (proj) => {
16217
16392
  setEditingProject(proj);
@@ -16635,7 +16810,7 @@ ${text}</tr>
16635
16810
  }
16636
16811
 
16637
16812
  // src/AgentsTab.tsx
16638
- var import_react8 = __toESM(require_react(), 1);
16813
+ var import_react9 = __toESM(require_react(), 1);
16639
16814
  var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
16640
16815
  function AgentsTab({
16641
16816
  config,
@@ -16647,25 +16822,25 @@ ${text}</tr>
16647
16822
  setModelsResult,
16648
16823
  postMessage
16649
16824
  }) {
16650
- const [editingAgent, setEditingAgent] = (0, import_react8.useState)(null);
16651
- const [isCreating, setIsCreating] = (0, import_react8.useState)(false);
16652
- const [name, setName] = (0, import_react8.useState)("");
16653
- const [systemPrompt, setSystemPrompt] = (0, import_react8.useState)("");
16654
- const [provider, setProvider] = (0, import_react8.useState)("");
16655
- const [model, setModel] = (0, import_react8.useState)("");
16656
- const [maxTurns, setMaxTurns] = (0, import_react8.useState)(30);
16657
- const [workingDir, setWorkingDir] = (0, import_react8.useState)("");
16658
- const [permissionMode, setPermissionMode] = (0, import_react8.useState)("");
16659
- const [strictMcp, setStrictMcp] = (0, import_react8.useState)(false);
16660
- const [selectedTools, setSelectedTools] = (0, import_react8.useState)({});
16661
- const [confirmTools, setConfirmTools] = (0, import_react8.useState)({});
16662
- const [selectedPlugins, setSelectedPlugins] = (0, import_react8.useState)({});
16663
- const [selectedMcpServers, setSelectedMcpServers] = (0, import_react8.useState)({});
16664
- const [fetchingModels, setFetchingModels] = (0, import_react8.useState)(false);
16665
- const [errorMsg, setErrorMsg] = (0, import_react8.useState)(null);
16825
+ const [editingAgent, setEditingAgent] = (0, import_react9.useState)(null);
16826
+ const [isCreating, setIsCreating] = (0, import_react9.useState)(false);
16827
+ const [name, setName] = (0, import_react9.useState)("");
16828
+ const [systemPrompt, setSystemPrompt] = (0, import_react9.useState)("");
16829
+ const [provider, setProvider] = (0, import_react9.useState)("");
16830
+ const [model, setModel] = (0, import_react9.useState)("");
16831
+ const [maxTurns, setMaxTurns] = (0, import_react9.useState)(30);
16832
+ const [workingDir, setWorkingDir] = (0, import_react9.useState)("");
16833
+ const [permissionMode, setPermissionMode] = (0, import_react9.useState)("");
16834
+ const [strictMcp, setStrictMcp] = (0, import_react9.useState)(false);
16835
+ const [selectedTools, setSelectedTools] = (0, import_react9.useState)({});
16836
+ const [confirmTools, setConfirmTools] = (0, import_react9.useState)({});
16837
+ const [selectedPlugins, setSelectedPlugins] = (0, import_react9.useState)({});
16838
+ const [selectedMcpServers, setSelectedMcpServers] = (0, import_react9.useState)({});
16839
+ const [fetchingModels, setFetchingModels] = (0, import_react9.useState)(false);
16840
+ const [errorMsg, setErrorMsg] = (0, import_react9.useState)(null);
16666
16841
  const providerType = config.providers.find((p) => p.name === provider)?.type ?? "openai";
16667
16842
  const isClaudeCode = providerType === "claude-code";
16668
- (0, import_react8.useEffect)(() => {
16843
+ (0, import_react9.useEffect)(() => {
16669
16844
  if (modelsResult) {
16670
16845
  setFetchingModels(false);
16671
16846
  if (!modelsResult.ok) {
@@ -17151,7 +17326,7 @@ ${text}</tr>
17151
17326
  }
17152
17327
 
17153
17328
  // src/PluginsTab.tsx
17154
- var import_react9 = __toESM(require_react(), 1);
17329
+ var import_react10 = __toESM(require_react(), 1);
17155
17330
  var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
17156
17331
  function PluginsTab({
17157
17332
  pluginsFile,
@@ -17160,15 +17335,15 @@ ${text}</tr>
17160
17335
  setRefreshOutcome,
17161
17336
  postMessage
17162
17337
  }) {
17163
- const [editingSource, setEditingSource] = (0, import_react9.useState)(null);
17164
- const [isCreating, setIsCreating] = (0, import_react9.useState)(false);
17165
- const [kind, setKind] = (0, import_react9.useState)("git");
17166
- const [url, setUrl] = (0, import_react9.useState)("");
17167
- const [ref, setRef] = (0, import_react9.useState)("");
17168
- const [authToken, setAuthToken] = (0, import_react9.useState)("");
17169
- const [refreshOnStart, setRefreshOnStart] = (0, import_react9.useState)(true);
17170
- const [errorMsg, setErrorMsg] = (0, import_react9.useState)(null);
17171
- (0, import_react9.useEffect)(() => {
17338
+ const [editingSource, setEditingSource] = (0, import_react10.useState)(null);
17339
+ const [isCreating, setIsCreating] = (0, import_react10.useState)(false);
17340
+ const [kind, setKind] = (0, import_react10.useState)("git");
17341
+ const [url, setUrl] = (0, import_react10.useState)("");
17342
+ const [ref, setRef] = (0, import_react10.useState)("");
17343
+ const [authToken, setAuthToken] = (0, import_react10.useState)("");
17344
+ const [refreshOnStart, setRefreshOnStart] = (0, import_react10.useState)(true);
17345
+ const [errorMsg, setErrorMsg] = (0, import_react10.useState)(null);
17346
+ (0, import_react10.useEffect)(() => {
17172
17347
  return () => {
17173
17348
  setRefreshOutcome(null);
17174
17349
  };
@@ -17447,25 +17622,25 @@ ${text}</tr>
17447
17622
  }
17448
17623
 
17449
17624
  // src/McpTab.tsx
17450
- var import_react10 = __toESM(require_react(), 1);
17625
+ var import_react11 = __toESM(require_react(), 1);
17451
17626
  var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
17452
17627
  function McpTab({ mcpServersFile, mcpAuthOutcome, setMcpAuthOutcome, postMessage }) {
17453
- const [editingServer, setEditingServer] = (0, import_react10.useState)(null);
17454
- const [isCreating, setIsCreating] = (0, import_react10.useState)(false);
17455
- (0, import_react10.useEffect)(() => {
17628
+ const [editingServer, setEditingServer] = (0, import_react11.useState)(null);
17629
+ const [isCreating, setIsCreating] = (0, import_react11.useState)(false);
17630
+ (0, import_react11.useEffect)(() => {
17456
17631
  return () => {
17457
17632
  setMcpAuthOutcome(null);
17458
17633
  };
17459
17634
  }, []);
17460
- const [name, setName] = (0, import_react10.useState)("");
17461
- const [transport, setTransport] = (0, import_react10.useState)("stdio");
17462
- const [enabled, setEnabled] = (0, import_react10.useState)(true);
17463
- const [command, setCommand] = (0, import_react10.useState)("");
17464
- const [argsStr, setArgsStr] = (0, import_react10.useState)("");
17465
- const [envStr, setEnvStr] = (0, import_react10.useState)("");
17466
- const [url, setUrl] = (0, import_react10.useState)("");
17467
- const [headersStr, setHeadersStr] = (0, import_react10.useState)("");
17468
- const [errorMsg, setErrorMsg] = (0, import_react10.useState)(null);
17635
+ const [name, setName] = (0, import_react11.useState)("");
17636
+ const [transport, setTransport] = (0, import_react11.useState)("stdio");
17637
+ const [enabled, setEnabled] = (0, import_react11.useState)(true);
17638
+ const [command, setCommand] = (0, import_react11.useState)("");
17639
+ const [argsStr, setArgsStr] = (0, import_react11.useState)("");
17640
+ const [envStr, setEnvStr] = (0, import_react11.useState)("");
17641
+ const [url, setUrl] = (0, import_react11.useState)("");
17642
+ const [headersStr, setHeadersStr] = (0, import_react11.useState)("");
17643
+ const [errorMsg, setErrorMsg] = (0, import_react11.useState)(null);
17469
17644
  const startCreate = () => {
17470
17645
  setIsCreating(true);
17471
17646
  setEditingServer(null);
@@ -17846,7 +18021,7 @@ ${text}</tr>
17846
18021
  }
17847
18022
 
17848
18023
  // src/SchedulerTab.tsx
17849
- var import_react11 = __toESM(require_react(), 1);
18024
+ var import_react12 = __toESM(require_react(), 1);
17850
18025
  var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
17851
18026
  function closeStreamingAssistant(items) {
17852
18027
  const last = items[items.length - 1];
@@ -17905,20 +18080,20 @@ ${text}</tr>
17905
18080
  }
17906
18081
  function SchedulerTab({ config, agents, postMessage, taskRuns = {} }) {
17907
18082
  const tasks = config.scheduler?.tasks || [];
17908
- const [editingTask, setEditingTask] = (0, import_react11.useState)(null);
17909
- const [isCreating, setIsCreating] = (0, import_react11.useState)(false);
17910
- const [viewingTaskLogs, setViewingTaskLogs] = (0, import_react11.useState)(null);
17911
- const [selectedRunId, setSelectedRunId] = (0, import_react11.useState)(null);
17912
- const [name, setName] = (0, import_react11.useState)("");
17913
- const [type, setType] = (0, import_react11.useState)("heartbeat");
17914
- const [enabled, setEnabled] = (0, import_react11.useState)(true);
17915
- const [agentId, setAgentId] = (0, import_react11.useState)("");
17916
- const [workingDir, setWorkingDir] = (0, import_react11.useState)("");
17917
- const [prompt, setPrompt] = (0, import_react11.useState)("");
17918
- const [cron, setCron] = (0, import_react11.useState)("*/15 * * * *");
17919
- const [telegramBotToken, setTelegramBotToken] = (0, import_react11.useState)("");
17920
- const [telegramAllowedChats, setTelegramAllowedChats] = (0, import_react11.useState)("");
17921
- const [errorMsg, setErrorMsg] = (0, import_react11.useState)(null);
18083
+ const [editingTask, setEditingTask] = (0, import_react12.useState)(null);
18084
+ const [isCreating, setIsCreating] = (0, import_react12.useState)(false);
18085
+ const [viewingTaskLogs, setViewingTaskLogs] = (0, import_react12.useState)(null);
18086
+ const [selectedRunId, setSelectedRunId] = (0, import_react12.useState)(null);
18087
+ const [name, setName] = (0, import_react12.useState)("");
18088
+ const [type, setType] = (0, import_react12.useState)("heartbeat");
18089
+ const [enabled, setEnabled] = (0, import_react12.useState)(true);
18090
+ const [agentId, setAgentId] = (0, import_react12.useState)("");
18091
+ const [workingDir, setWorkingDir] = (0, import_react12.useState)("");
18092
+ const [prompt, setPrompt] = (0, import_react12.useState)("");
18093
+ const [cron, setCron] = (0, import_react12.useState)("*/15 * * * *");
18094
+ const [telegramBotToken, setTelegramBotToken] = (0, import_react12.useState)("");
18095
+ const [telegramAllowedChats, setTelegramAllowedChats] = (0, import_react12.useState)("");
18096
+ const [errorMsg, setErrorMsg] = (0, import_react12.useState)(null);
17922
18097
  const startEdit = (task) => {
17923
18098
  setEditingTask(task);
17924
18099
  setIsCreating(false);
@@ -18072,7 +18247,7 @@ ${text}</tr>
18072
18247
  const runs = viewingTaskLogs ? taskRuns[viewingTaskLogs.id] || [] : [];
18073
18248
  const activeRunId = selectedRunId || runs[0]?.runId;
18074
18249
  const activeRun = runs.find((r) => r.runId === activeRunId);
18075
- const activeRunChatItems = activeRun ? reconstructChatItems(activeRun.messages || []) : [];
18250
+ const activeRunChatItems = (0, import_react12.useMemo)(() => activeRun ? reconstructChatItems(activeRun.messages || []) : [], [activeRun]);
18076
18251
  const selectedAgentName = viewingTaskLogs ? agents.find((a) => a.id === viewingTaskLogs.agentId)?.name : "";
18077
18252
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "tab-pane scheduler-tab", children: [
18078
18253
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "tab-pane__header", children: [
@@ -18468,7 +18643,7 @@ ${text}</tr>
18468
18643
  }
18469
18644
 
18470
18645
  // src/VoiceTab.tsx
18471
- var import_react12 = __toESM(require_react(), 1);
18646
+ var import_react14 = __toESM(require_react(), 1);
18472
18647
 
18473
18648
  // src/voice_utils.ts
18474
18649
  var END_OF_TURN_MS = 1200;
@@ -18526,6 +18701,7 @@ ${text}</tr>
18526
18701
  v.enabled === true,
18527
18702
  v.endpoint ?? "",
18528
18703
  v.sttModel ?? "",
18704
+ v.ttsEndpoint ?? "",
18529
18705
  v.ttsModel ?? "",
18530
18706
  v.ttsVoice ?? "",
18531
18707
  v.ttsSpeed ?? "",
@@ -18534,6 +18710,9 @@ ${text}</tr>
18534
18710
  ]);
18535
18711
  }
18536
18712
 
18713
+ // src/VoiceBackendBlock.tsx
18714
+ var import_react13 = __toESM(require_react(), 1);
18715
+
18537
18716
  // src/voice_backend_utils.ts
18538
18717
  function backendStatusText(status) {
18539
18718
  if (status.docker === "denied") return "your user needs to be in the docker group";
@@ -18548,48 +18727,21 @@ ${text}</tr>
18548
18727
  return { lines: parts.filter((line) => line.length > 0), remainder };
18549
18728
  }
18550
18729
 
18551
- // src/VoiceTab.tsx
18730
+ // src/VoiceBackendBlock.tsx
18552
18731
  var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
18553
- var BACKEND_POLL_MS = 1e4;
18554
18732
  var CONFIRM_DELETE_MS = 4e3;
18555
- var EMPTY = { enabled: false, endpoint: "", sttModel: "" };
18556
- var LOCAL_DEFAULTS = {
18557
- endpoint: "http://127.0.0.1:8969/v1",
18558
- sttModel: "Systran/faster-whisper-small",
18559
- ttsModel: "speaches-ai/Kokoro-82M-v1.0-ONNX",
18560
- ttsVoice: "af_heart"
18561
- };
18562
- function withCurrent(ids, current) {
18563
- const trimmed = current.trim();
18564
- if (!trimmed || ids.includes(trimmed)) return ids;
18565
- return [trimmed, ...ids];
18566
- }
18567
- function voiceLabel(v) {
18568
- const meta = [v.language, v.gender].filter(Boolean).join(", ");
18569
- return meta ? `${v.id} \u2014 ${meta}` : v.id;
18570
- }
18571
- function VoiceTab({ config, onSave, postMessage, catalogResult }) {
18572
- const current = config.voice ?? EMPTY;
18573
- const [enabled, setEnabled] = (0, import_react12.useState)(current.enabled);
18574
- const [endpoint, setEndpoint] = (0, import_react12.useState)(current.endpoint);
18575
- const [apiKey, setApiKey] = (0, import_react12.useState)(current.apiKey ?? "");
18576
- const [sttModel, setSttModel] = (0, import_react12.useState)(current.sttModel);
18577
- const [ttsModel, setTtsModel] = (0, import_react12.useState)(current.ttsModel ?? "");
18578
- const [ttsVoice, setTtsVoice] = (0, import_react12.useState)(current.ttsVoice ?? "");
18579
- const [ttsSpeed, setTtsSpeed] = (0, import_react12.useState)(
18580
- current.ttsSpeed === void 0 ? "" : String(current.ttsSpeed)
18581
- );
18582
- const [lang, setLang] = (0, import_react12.useState)(current.lang ?? "");
18583
- const [fetching, setFetching] = (0, import_react12.useState)(false);
18584
- const [saveState, setSaveState] = (0, import_react12.useState)("idle");
18585
- const pendingSave = (0, import_react12.useRef)(null);
18586
- const [autoStartBackend, setAutoStartBackend] = (0, import_react12.useState)(current.autoStartBackend ?? false);
18587
- const [backendStatus, setBackendStatus] = (0, import_react12.useState)(null);
18588
- const [backendBusy, setBackendBusy] = (0, import_react12.useState)(false);
18589
- const [backendProgress, setBackendProgress] = (0, import_react12.useState)(null);
18590
- const [backendError, setBackendError] = (0, import_react12.useState)(null);
18591
- const [confirmingDelete, setConfirmingDelete] = (0, import_react12.useState)(false);
18592
- const confirmDeleteTimer = (0, import_react12.useRef)(null);
18733
+ function VoiceBackendBlock({
18734
+ target,
18735
+ label,
18736
+ status,
18737
+ onStatusChange,
18738
+ hint
18739
+ }) {
18740
+ const [busy, setBusy] = (0, import_react13.useState)(false);
18741
+ const [progress, setProgress] = (0, import_react13.useState)(null);
18742
+ const [error, setError] = (0, import_react13.useState)(null);
18743
+ const [confirmingDelete, setConfirmingDelete] = (0, import_react13.useState)(false);
18744
+ const confirmDeleteTimer = (0, import_react13.useRef)(null);
18593
18745
  const disarmDelete = () => {
18594
18746
  if (confirmDeleteTimer.current) clearTimeout(confirmDeleteTimer.current);
18595
18747
  confirmDeleteTimer.current = null;
@@ -18598,44 +18750,33 @@ ${text}</tr>
18598
18750
  const armDelete = () => {
18599
18751
  if (confirmDeleteTimer.current) clearTimeout(confirmDeleteTimer.current);
18600
18752
  setConfirmingDelete(true);
18601
- confirmDeleteTimer.current = setTimeout(() => setConfirmingDelete(false), CONFIRM_DELETE_MS);
18753
+ confirmDeleteTimer.current = setTimeout(
18754
+ () => setConfirmingDelete(false),
18755
+ CONFIRM_DELETE_MS
18756
+ );
18602
18757
  };
18603
- (0, import_react12.useEffect)(
18758
+ (0, import_react13.useEffect)(
18604
18759
  () => () => {
18605
18760
  if (confirmDeleteTimer.current) clearTimeout(confirmDeleteTimer.current);
18606
18761
  },
18607
18762
  []
18608
18763
  );
18609
- const lastContainer = (0, import_react12.useRef)(null);
18610
- const adoptBackendStatus = (status) => {
18611
- lastContainer.current = status.container;
18612
- setBackendStatus(status);
18613
- };
18614
- const fetchBackendStatus = async () => {
18615
- try {
18616
- const res = await fetch("/api/voice/backend");
18617
- if (!res.ok) return;
18618
- const status = await res.json();
18619
- if (status.container === "running" && lastContainer.current !== "running") {
18620
- setBackendError(null);
18621
- }
18622
- adoptBackendStatus(status);
18623
- } catch {
18764
+ const lastContainer = (0, import_react13.useRef)(null);
18765
+ (0, import_react13.useEffect)(() => {
18766
+ if (status.container === "running" && lastContainer.current !== "running") {
18767
+ setError(null);
18624
18768
  }
18625
- };
18626
- (0, import_react12.useEffect)(() => {
18627
- fetchBackendStatus();
18628
- const interval = setInterval(fetchBackendStatus, BACKEND_POLL_MS);
18629
- return () => clearInterval(interval);
18630
- }, []);
18631
- const startBackend = async () => {
18632
- setBackendBusy(true);
18633
- setBackendError(null);
18634
- setBackendProgress("Starting\u2026");
18769
+ lastContainer.current = status.container;
18770
+ }, [status]);
18771
+ const query = `?target=${target}`;
18772
+ const start = async () => {
18773
+ setBusy(true);
18774
+ setError(null);
18775
+ setProgress("Starting\u2026");
18635
18776
  try {
18636
- const res = await fetch("/api/voice/backend/start", { method: "POST" });
18777
+ const res = await fetch(`/api/voice/backend/start${query}`, { method: "POST" });
18637
18778
  if (!res.ok || !res.body) {
18638
- setBackendError(await res.text().catch(() => "") || "Start failed.");
18779
+ setError(await res.text().catch(() => "") || "Start failed.");
18639
18780
  return;
18640
18781
  }
18641
18782
  const reader = res.body.getReader();
@@ -18650,76 +18791,175 @@ ${text}</tr>
18650
18791
  );
18651
18792
  buffer = remainder;
18652
18793
  for (const line of lines) {
18653
- let progress;
18794
+ let p;
18654
18795
  try {
18655
- progress = JSON.parse(line);
18796
+ p = JSON.parse(line);
18656
18797
  } catch {
18657
18798
  continue;
18658
18799
  }
18659
- if (progress.status) {
18660
- adoptBackendStatus(progress.status);
18661
- setBackendProgress(null);
18662
- if (progress.step === "error") setBackendError(progress.message);
18800
+ if (p.status) {
18801
+ lastContainer.current = p.status.container;
18802
+ onStatusChange(p.status);
18803
+ setProgress(null);
18804
+ if (p.step === "error") setError(p.message);
18663
18805
  } else {
18664
- setBackendProgress(progress.message);
18806
+ setProgress(p.message);
18665
18807
  }
18666
18808
  }
18667
18809
  }
18668
18810
  } catch (err) {
18669
- setBackendError(err instanceof Error ? err.message : String(err));
18811
+ setError(err instanceof Error ? err.message : String(err));
18670
18812
  } finally {
18671
- setBackendBusy(false);
18672
- setBackendProgress(null);
18673
- fetchBackendStatus();
18813
+ setBusy(false);
18814
+ setProgress(null);
18674
18815
  }
18675
18816
  };
18676
- const stopBackend = async () => {
18677
- setBackendBusy(true);
18678
- setBackendError(null);
18817
+ const stop = async () => {
18818
+ setBusy(true);
18819
+ setError(null);
18679
18820
  try {
18680
- const res = await fetch("/api/voice/backend/stop", { method: "POST" });
18681
- if (res.ok) adoptBackendStatus(await res.json());
18821
+ const res = await fetch(`/api/voice/backend/stop${query}`, { method: "POST" });
18822
+ if (res.ok) {
18823
+ const status2 = await res.json();
18824
+ lastContainer.current = status2.container;
18825
+ onStatusChange(status2);
18826
+ }
18682
18827
  } catch {
18683
18828
  } finally {
18684
- setBackendBusy(false);
18685
- fetchBackendStatus();
18829
+ setBusy(false);
18686
18830
  }
18687
18831
  };
18688
- const deleteBackend = async () => {
18832
+ const remove = async () => {
18689
18833
  disarmDelete();
18690
- setBackendBusy(true);
18691
- setBackendError(null);
18834
+ setBusy(true);
18835
+ setError(null);
18692
18836
  try {
18693
- const res = await fetch("/api/voice/backend/delete", { method: "POST" });
18694
- if (res.ok) adoptBackendStatus(await res.json());
18695
- else setBackendError(await res.text().catch(() => "") || "Delete failed.");
18837
+ const res = await fetch(`/api/voice/backend/delete${query}`, { method: "POST" });
18838
+ if (res.ok) {
18839
+ const status2 = await res.json();
18840
+ lastContainer.current = status2.container;
18841
+ onStatusChange(status2);
18842
+ } else setError(await res.text().catch(() => "") || "Delete failed.");
18696
18843
  } catch {
18697
18844
  } finally {
18698
- setBackendBusy(false);
18699
- fetchBackendStatus();
18845
+ setBusy(false);
18700
18846
  }
18701
18847
  };
18702
- (0, import_react12.useEffect)(() => {
18703
- if (catalogResult) setFetching(false);
18704
- }, [catalogResult]);
18705
- (0, import_react12.useEffect)(() => {
18848
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
18849
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "voice-backend-status", children: [
18850
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: progress ?? backendStatusText(status) }),
18851
+ status.container === "running" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", onClick: stop, disabled: busy, children: busy ? "Stopping\u2026" : "Stop" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", onClick: start, disabled: busy, children: busy ? "Starting\u2026" : "Start" }),
18852
+ status.container !== "absent" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
18853
+ "button",
18854
+ {
18855
+ type: "button",
18856
+ onClick: confirmingDelete ? remove : armDelete,
18857
+ disabled: busy,
18858
+ children: confirmingDelete ? "Really delete?" : "Delete"
18859
+ }
18860
+ )
18861
+ ] }),
18862
+ error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { className: "form-error", children: error }),
18863
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("small", { children: [
18864
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("strong", { children: [
18865
+ label,
18866
+ "."
18867
+ ] }),
18868
+ " ",
18869
+ hint
18870
+ ] })
18871
+ ] });
18872
+ }
18873
+
18874
+ // src/VoiceTab.tsx
18875
+ var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
18876
+ var BACKEND_POLL_MS = 1e4;
18877
+ var EMPTY = { enabled: false, endpoint: "", sttModel: "" };
18878
+ var LOCAL_DEFAULTS = {
18879
+ endpoint: "http://127.0.0.1:8969/v1",
18880
+ sttModel: "Systran/faster-whisper-small",
18881
+ ttsModel: "speaches-ai/Kokoro-82M-v1.0-ONNX",
18882
+ ttsVoice: "af_heart"
18883
+ };
18884
+ var EDGE_TTS_DEFAULTS = {
18885
+ ttsEndpoint: "http://127.0.0.1:5050/v1",
18886
+ ttsModel: "tts-1",
18887
+ ttsVoice: "it-IT-ElsaNeural"
18888
+ };
18889
+ function withCurrent(ids, current) {
18890
+ const trimmed = current.trim();
18891
+ if (!trimmed || ids.includes(trimmed)) return ids;
18892
+ return [trimmed, ...ids];
18893
+ }
18894
+ function voiceLabel(v) {
18895
+ const meta = [v.language, v.gender].filter(Boolean).join(", ");
18896
+ return meta ? `${v.id} \u2014 ${meta}` : v.id;
18897
+ }
18898
+ function VoiceTab({ config, onSave, postMessage, sttCatalogResult, ttsCatalogResult }) {
18899
+ const current = config.voice ?? EMPTY;
18900
+ const [enabled, setEnabled] = (0, import_react14.useState)(current.enabled);
18901
+ const [endpoint, setEndpoint] = (0, import_react14.useState)(current.endpoint);
18902
+ const [apiKey, setApiKey] = (0, import_react14.useState)(current.apiKey ?? "");
18903
+ const [sttModel, setSttModel] = (0, import_react14.useState)(current.sttModel);
18904
+ const [ttsEndpoint, setTtsEndpoint] = (0, import_react14.useState)(current.ttsEndpoint ?? "");
18905
+ const [ttsApiKey, setTtsApiKey] = (0, import_react14.useState)(current.ttsApiKey ?? "");
18906
+ const [ttsModel, setTtsModel] = (0, import_react14.useState)(current.ttsModel ?? "");
18907
+ const [ttsVoice, setTtsVoice] = (0, import_react14.useState)(current.ttsVoice ?? "");
18908
+ const [ttsSpeed, setTtsSpeed] = (0, import_react14.useState)(
18909
+ current.ttsSpeed === void 0 ? "" : String(current.ttsSpeed)
18910
+ );
18911
+ const [lang, setLang] = (0, import_react14.useState)(current.lang ?? "");
18912
+ const [fetching, setFetching] = (0, import_react14.useState)(false);
18913
+ const [fetchingTts, setFetchingTts] = (0, import_react14.useState)(false);
18914
+ const [saveState, setSaveState] = (0, import_react14.useState)("idle");
18915
+ const pendingSave = (0, import_react14.useRef)(null);
18916
+ const [autoStartBackend, setAutoStartBackend] = (0, import_react14.useState)(current.autoStartBackend ?? false);
18917
+ const [backendStatuses, setBackendStatuses] = (0, import_react14.useState)(null);
18918
+ const fetchBackendStatuses = async () => {
18919
+ try {
18920
+ const res = await fetch("/api/voice/backend");
18921
+ if (!res.ok) return;
18922
+ const statuses = await res.json();
18923
+ setBackendStatuses(statuses);
18924
+ } catch {
18925
+ }
18926
+ };
18927
+ (0, import_react14.useEffect)(() => {
18928
+ fetchBackendStatuses();
18929
+ const interval = setInterval(fetchBackendStatuses, BACKEND_POLL_MS);
18930
+ return () => clearInterval(interval);
18931
+ }, []);
18932
+ const adoptStatus = (target) => (status) => {
18933
+ setBackendStatuses(
18934
+ (prev) => prev ? { ...prev, [target]: status } : { stt: status, tts: null }
18935
+ );
18936
+ };
18937
+ (0, import_react14.useEffect)(() => {
18938
+ if (sttCatalogResult) setFetching(false);
18939
+ }, [sttCatalogResult]);
18940
+ (0, import_react14.useEffect)(() => {
18941
+ if (ttsCatalogResult) setFetchingTts(false);
18942
+ }, [ttsCatalogResult]);
18943
+ (0, import_react14.useEffect)(() => {
18706
18944
  if (saveState !== "saving" || pendingSave.current === null) return;
18707
18945
  if (voiceSignature(config.voice) !== pendingSave.current) return;
18708
18946
  setSaveState("saved");
18709
18947
  }, [config.voice, saveState]);
18710
- (0, import_react12.useEffect)(() => {
18948
+ (0, import_react14.useEffect)(() => {
18711
18949
  if (saveState !== "saved") return;
18712
18950
  const clear = setTimeout(() => setSaveState("idle"), 2500);
18713
18951
  return () => clearTimeout(clear);
18714
18952
  }, [saveState]);
18715
- (0, import_react12.useEffect)(() => {
18953
+ (0, import_react14.useEffect)(() => {
18716
18954
  if (saveState !== "saving") return;
18717
18955
  const giveUp = setTimeout(() => setSaveState("idle"), 6e3);
18718
18956
  return () => clearTimeout(giveUp);
18719
18957
  }, [saveState]);
18720
- const catalog = catalogResult?.ok ? catalogResult.catalog : null;
18721
- const fetchError = catalogResult && !catalogResult.ok ? catalogResult.error : null;
18722
- const fetchCatalog = () => {
18958
+ const sttCatalog = sttCatalogResult?.ok ? sttCatalogResult.catalog : null;
18959
+ const sttFetchError = sttCatalogResult && !sttCatalogResult.ok ? sttCatalogResult.error : null;
18960
+ const ttsCatalog = ttsCatalogResult?.ok ? ttsCatalogResult.catalog : !ttsEndpoint.trim() ? sttCatalog : null;
18961
+ const ttsFetchError = ttsCatalogResult && !ttsCatalogResult.ok ? ttsCatalogResult.error : null;
18962
+ const fetchSttCatalog = () => {
18723
18963
  if (!endpoint.trim()) return;
18724
18964
  setFetching(true);
18725
18965
  postMessage({
@@ -18728,10 +18968,22 @@ ${text}</tr>
18728
18968
  apiKey: apiKey.trim() || void 0
18729
18969
  });
18730
18970
  };
18731
- const voicesForModel = catalog?.tts.find((m) => m.id === ttsModel.trim())?.voices ?? [];
18971
+ const fetchTtsCatalog = () => {
18972
+ const ep = ttsEndpoint.trim();
18973
+ setFetchingTts(true);
18974
+ postMessage({
18975
+ type: "fetchVoiceModels",
18976
+ endpoint: ep,
18977
+ apiKey: ttsApiKey.trim() || void 0,
18978
+ target: "tts"
18979
+ });
18980
+ };
18981
+ const voicesForModel = ttsCatalog?.tts.find((m) => m.id === ttsModel.trim())?.voices ?? [];
18732
18982
  const save = () => {
18733
18983
  const voice = { enabled, endpoint: endpoint.trim(), sttModel: sttModel.trim() };
18734
18984
  if (apiKey.trim()) voice.apiKey = apiKey.trim();
18985
+ if (ttsEndpoint.trim()) voice.ttsEndpoint = ttsEndpoint.trim();
18986
+ if (ttsApiKey.trim()) voice.ttsApiKey = ttsApiKey.trim();
18735
18987
  if (ttsModel.trim()) voice.ttsModel = ttsModel.trim();
18736
18988
  if (ttsVoice.trim()) voice.ttsVoice = ttsVoice.trim();
18737
18989
  const speed = Number.parseFloat(ttsSpeed);
@@ -18744,12 +18996,13 @@ ${text}</tr>
18744
18996
  setSaveState("saving");
18745
18997
  onSave({ ...config, voice });
18746
18998
  };
18747
- const showBackendBlock = backendStatus !== null && backendStatus.docker !== "absent" && backendStatus.port !== null;
18748
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "glass-form", children: [
18749
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h4", { children: "Voice" }),
18750
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "glass-form__body", children: [
18751
- !endpoint.trim() && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
18752
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
18999
+ const showSttBackend = backendStatuses !== null && backendStatuses.stt.docker !== "absent" && backendStatuses.stt.port !== null;
19000
+ const showTtsBackend = backendStatuses !== null && backendStatuses.tts !== null && backendStatuses.tts.docker !== "absent" && backendStatuses.tts.port !== null;
19001
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "glass-form", children: [
19002
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h4", { children: "Voice" }),
19003
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "glass-form__body", children: [
19004
+ !endpoint.trim() && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "form-group", children: [
19005
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
18753
19006
  "button",
18754
19007
  {
18755
19008
  type: "button",
@@ -18763,25 +19016,31 @@ ${text}</tr>
18763
19016
  children: "Use local defaults"
18764
19017
  }
18765
19018
  ),
18766
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: "Fills the form for a fully local backend (a Speaches container on port 8969) that caretaker can run for you if Docker is installed. Nothing is saved yet \u2014 adjust anything, including the port in the endpoint, then press Save; a Start button appears below afterwards." })
19019
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: "Fills the form for a fully local backend (a Speaches container on port 8969) that caretaker can run for you if Docker is installed. Nothing is saved yet \u2014 adjust anything, including the port in the endpoint, then press Save; a Start button appears below afterwards." })
18767
19020
  ] }),
18768
- showBackendBlock && backendStatus && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
18769
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "voice-backend-status", children: [
18770
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: backendProgress ?? backendStatusText(backendStatus) }),
18771
- backendStatus.container === "running" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", onClick: stopBackend, disabled: backendBusy, children: backendBusy ? "Stopping\u2026" : "Stop" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", onClick: startBackend, disabled: backendBusy, children: backendBusy ? "Starting\u2026" : "Start" }),
18772
- backendStatus.container !== "absent" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
18773
- "button",
18774
- {
18775
- type: "button",
18776
- onClick: confirmingDelete ? deleteBackend : armDelete,
18777
- disabled: backendBusy,
18778
- children: confirmingDelete ? "Really delete?" : "Delete"
18779
- }
18780
- )
18781
- ] }),
18782
- backendError && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { className: "form-error", children: backendError }),
18783
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "form-group form-group--checkbox", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { htmlFor: "voice-backend-autostart", children: [
18784
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
19021
+ showSttBackend && backendStatuses && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19022
+ VoiceBackendBlock,
19023
+ {
19024
+ target: "stt",
19025
+ label: "Speech backend (Speaches)",
19026
+ status: backendStatuses.stt,
19027
+ onStatusChange: adoptStatus("stt"),
19028
+ hint: "The first start downloads about 2 GB. The container publishes on the port in your endpoint \u2014 if that port is taken, change it there and save; caretaker never picks a port for you. Delete removes the container but keeps the downloaded models \u2014 try it when the backend misbehaves after switching networks."
19029
+ }
19030
+ ),
19031
+ showTtsBackend && backendStatuses?.tts && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19032
+ VoiceBackendBlock,
19033
+ {
19034
+ target: "tts",
19035
+ label: "Synthesis backend (edge-tts)",
19036
+ status: backendStatuses.tts,
19037
+ onStatusChange: adoptStatus("tts"),
19038
+ hint: "A small image. The container publishes on the port in your synthesis endpoint. Delete removes the container; the image stays cached."
19039
+ }
19040
+ ),
19041
+ (showSttBackend || showTtsBackend) && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "form-group form-group--checkbox", children: [
19042
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { htmlFor: "voice-backend-autostart", children: [
19043
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
18785
19044
  "input",
18786
19045
  {
18787
19046
  id: "voice-backend-autostart",
@@ -18791,11 +19050,11 @@ ${text}</tr>
18791
19050
  }
18792
19051
  ),
18793
19052
  "Start automatically with caretaker"
18794
- ] }) }),
18795
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: "The first start downloads about 2 GB. The container publishes on the port in your endpoint \u2014 if that port is taken, change it there and save; caretaker never picks a port for you. Delete removes the container but keeps the downloaded models \u2014 try it when the backend misbehaves after switching networks." })
19053
+ ] }),
19054
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: "Applies to both containers: a Speaches pull does not block the edge-tts start \u2014 they are independent." })
18796
19055
  ] }),
18797
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "form-group form-group--checkbox", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { htmlFor: "voice-enabled", children: [
18798
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
19056
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "form-group form-group--checkbox", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { htmlFor: "voice-enabled", children: [
19057
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
18799
19058
  "input",
18800
19059
  {
18801
19060
  id: "voice-enabled",
@@ -18806,9 +19065,9 @@ ${text}</tr>
18806
19065
  ),
18807
19066
  "Enable voice mode"
18808
19067
  ] }) }),
18809
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
18810
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: "voice-endpoint", children: "Speech Endpoint" }),
18811
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
19068
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "form-group", children: [
19069
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { htmlFor: "voice-endpoint", children: "Speech Endpoint" }),
19070
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
18812
19071
  "input",
18813
19072
  {
18814
19073
  id: "voice-endpoint",
@@ -18818,18 +19077,18 @@ ${text}</tr>
18818
19077
  onChange: (e) => setEndpoint(e.target.value)
18819
19078
  }
18820
19079
  ),
18821
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("small", { children: [
19080
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("small", { children: [
18822
19081
  "OpenAI-compatible speech endpoint \u2014 e.g. a local Speaches container. Transcription posts to ",
18823
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("code", { children: "/audio/transcriptions" }),
18824
- ", synthesis to",
19082
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("code", { children: "/audio/transcriptions" }),
19083
+ ". When no separate synthesis endpoint is set below, synthesis also posts to",
18825
19084
  " ",
18826
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("code", { children: "/audio/speech" }),
18827
- ". Leave the synthesis fields empty for dictation only. Voice is unavailable in the VSCode sidebar."
19085
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("code", { children: "/audio/speech" }),
19086
+ " here. Voice is unavailable in the VSCode sidebar."
18828
19087
  ] })
18829
19088
  ] }),
18830
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
18831
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: "voice-key", children: "API Key (optional)" }),
18832
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
19089
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "form-group", children: [
19090
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { htmlFor: "voice-key", children: "API Key (optional)" }),
19091
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
18833
19092
  "input",
18834
19093
  {
18835
19094
  id: "voice-key",
@@ -18839,30 +19098,30 @@ ${text}</tr>
18839
19098
  onChange: (e) => setApiKey(e.target.value)
18840
19099
  }
18841
19100
  ),
18842
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: "Stored encrypted. Never sent to the browser \u2014 requests are proxied." })
19101
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: "Stored encrypted. Never sent to the browser \u2014 requests are proxied." })
18843
19102
  ] }),
18844
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
18845
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", onClick: fetchCatalog, disabled: fetching || !endpoint.trim(), children: fetching ? "Fetching\u2026" : "Fetch models" }),
18846
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: "Reads the endpoint's installed models so the fields below become lists. Endpoints that do not report a task per model still work \u2014 the fields stay free text." }),
18847
- fetchError && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("small", { className: "form-error", children: [
19103
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "form-group", children: [
19104
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", onClick: fetchSttCatalog, disabled: fetching || !endpoint.trim(), children: fetching ? "Fetching\u2026" : "Fetch models" }),
19105
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: "Reads the endpoint's installed models so the transcription field below becomes a list. Endpoints that do not report a task per model still work \u2014 the field stays free text." }),
19106
+ sttFetchError && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("small", { className: "form-error", children: [
18848
19107
  "Fetch failed: ",
18849
- fetchError
19108
+ sttFetchError
18850
19109
  ] })
18851
19110
  ] }),
18852
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
18853
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: "voice-stt", children: "Transcription Model" }),
18854
- catalog && catalog.stt.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
19111
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "form-group", children: [
19112
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { htmlFor: "voice-stt", children: "Transcription Model" }),
19113
+ sttCatalog && sttCatalog.stt.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
18855
19114
  "select",
18856
19115
  {
18857
19116
  id: "voice-stt",
18858
19117
  value: sttModel,
18859
19118
  onChange: (e) => setSttModel(e.target.value),
18860
19119
  children: [
18861
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", children: "-- Select a model --" }),
18862
- withCurrent(catalog.stt, sttModel).map((id) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: id, children: id }, id))
19120
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "", children: "-- Select a model --" }),
19121
+ withCurrent(sttCatalog.stt, sttModel).map((id) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: id, children: id }, id))
18863
19122
  ]
18864
19123
  }
18865
- ) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
19124
+ ) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
18866
19125
  "input",
18867
19126
  {
18868
19127
  id: "voice-stt",
@@ -18873,68 +19132,136 @@ ${text}</tr>
18873
19132
  }
18874
19133
  )
18875
19134
  ] }),
18876
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
18877
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: "voice-tts", children: "Synthesis Model (optional)" }),
18878
- catalog && catalog.tts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
19135
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "form-group", children: [
19136
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { htmlFor: "voice-tts-endpoint", children: "Synthesis Endpoint (optional)" }),
19137
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19138
+ "input",
19139
+ {
19140
+ id: "voice-tts-endpoint",
19141
+ type: "text",
19142
+ placeholder: "Leave empty when one server does both",
19143
+ value: ttsEndpoint,
19144
+ onChange: (e) => setTtsEndpoint(e.target.value)
19145
+ }
19146
+ ),
19147
+ !ttsEndpoint.trim() && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19148
+ "button",
19149
+ {
19150
+ type: "button",
19151
+ onClick: () => {
19152
+ setTtsEndpoint(EDGE_TTS_DEFAULTS.ttsEndpoint);
19153
+ setTtsModel(EDGE_TTS_DEFAULTS.ttsModel);
19154
+ setTtsVoice(EDGE_TTS_DEFAULTS.ttsVoice);
19155
+ },
19156
+ style: { marginTop: "0.4em" },
19157
+ children: "Use Microsoft Edge voices"
19158
+ }
19159
+ ),
19160
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("small", { children: [
19161
+ "Leave empty when one server does both. A local openai-edge-tts container gives you Microsoft Neural voices such as",
19162
+ " ",
19163
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("code", { children: "it-IT-ElsaNeural" }),
19164
+ " or ",
19165
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("code", { children: "it-IT-DiegoNeural" }),
19166
+ ", but cannot transcribe \u2014 transcription always uses the endpoint above. Nothing is saved yet \u2014 press Save after adjusting."
19167
+ ] })
19168
+ ] }),
19169
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "form-group", children: [
19170
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { htmlFor: "voice-tts-key", children: "Synthesis API Key (optional)" }),
19171
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19172
+ "input",
19173
+ {
19174
+ id: "voice-tts-key",
19175
+ type: "password",
19176
+ placeholder: "Leave empty for a local server with no auth",
19177
+ value: ttsApiKey,
19178
+ onChange: (e) => setTtsApiKey(e.target.value)
19179
+ }
19180
+ ),
19181
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: "Stored encrypted. Only sent to the synthesis endpoint \u2014 the transcription key is never sent there, and vice versa." })
19182
+ ] }),
19183
+ ttsEndpoint.trim() && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "form-group", children: [
19184
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19185
+ "button",
19186
+ {
19187
+ type: "button",
19188
+ onClick: fetchTtsCatalog,
19189
+ disabled: fetchingTts,
19190
+ children: fetchingTts ? "Fetching\u2026" : "Fetch synthesis models"
19191
+ }
19192
+ ),
19193
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("small", { children: [
19194
+ "Reads the synthesis endpoint's models and voices. For edge-tts, the voice list comes from ",
19195
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("code", { children: "/voices/all" }),
19196
+ "."
19197
+ ] }),
19198
+ ttsFetchError && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("small", { className: "form-error", children: [
19199
+ "Fetch failed: ",
19200
+ ttsFetchError
19201
+ ] })
19202
+ ] }),
19203
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "form-group", children: [
19204
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { htmlFor: "voice-tts", children: "Synthesis Model (optional)" }),
19205
+ ttsCatalog && ttsCatalog.tts.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
18879
19206
  "select",
18880
19207
  {
18881
19208
  id: "voice-tts",
18882
19209
  value: ttsModel,
18883
19210
  onChange: (e) => {
18884
19211
  setTtsModel(e.target.value);
18885
- const next = catalog.tts.find((m) => m.id === e.target.value);
19212
+ const next = ttsCatalog.tts.find((m) => m.id === e.target.value);
18886
19213
  if (next && !next.voices.some((v) => v.id === ttsVoice)) {
18887
19214
  setTtsVoice(next.voices.length === 1 ? next.voices[0].id : "");
18888
19215
  }
18889
19216
  },
18890
19217
  children: [
18891
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", children: "-- None (dictation only) --" }),
19218
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "", children: "-- None (dictation only) --" }),
18892
19219
  withCurrent(
18893
- catalog.tts.map((m) => m.id),
19220
+ ttsCatalog.tts.map((m) => m.id),
18894
19221
  ttsModel
18895
- ).map((id) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: id, children: id }, id))
19222
+ ).map((id) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: id, children: id }, id))
18896
19223
  ]
18897
19224
  }
18898
- ) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
19225
+ ) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
18899
19226
  "input",
18900
19227
  {
18901
19228
  id: "voice-tts",
18902
19229
  type: "text",
18903
- placeholder: "e.g. speaches-ai/Kokoro-82M-v1.0-ONNX",
19230
+ placeholder: "e.g. speaches-ai/Kokoro-82M-v1.0-ONNX or tts-1",
18904
19231
  value: ttsModel,
18905
19232
  onChange: (e) => setTtsModel(e.target.value)
18906
19233
  }
18907
19234
  ),
18908
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: "Required for conversation mode. Without it, only dictation is offered." })
19235
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: "Required for conversation mode. Without it, only dictation is offered." })
18909
19236
  ] }),
18910
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
18911
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: "voice-voice", children: "Voice (optional)" }),
18912
- voicesForModel.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
19237
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "form-group", children: [
19238
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { htmlFor: "voice-voice", children: "Voice (optional)" }),
19239
+ voicesForModel.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
18913
19240
  "select",
18914
19241
  {
18915
19242
  id: "voice-voice",
18916
19243
  value: ttsVoice,
18917
19244
  onChange: (e) => setTtsVoice(e.target.value),
18918
19245
  children: [
18919
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", children: "-- Select a voice --" }),
18920
- voicesForModel.map((v) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: v.id, children: voiceLabel(v) }, v.id))
19246
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "", children: "-- Select a voice --" }),
19247
+ voicesForModel.map((v) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: v.id, children: voiceLabel(v) }, v.id))
18921
19248
  ]
18922
19249
  }
18923
- ) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
19250
+ ) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
18924
19251
  "input",
18925
19252
  {
18926
19253
  id: "voice-voice",
18927
19254
  type: "text",
18928
- placeholder: "e.g. if_sara",
19255
+ placeholder: "e.g. af_heart or it-IT-ElsaNeural",
18929
19256
  value: ttsVoice,
18930
19257
  onChange: (e) => setTtsVoice(e.target.value)
18931
19258
  }
18932
19259
  ),
18933
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: "Pick one whose language matches yours. A model trained mostly on English keeps an English inflection even on its other-language voices." })
19260
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: "Pick one whose language matches yours. A model trained mostly on English keeps an English inflection even on its other-language voices." })
18934
19261
  ] }),
18935
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
18936
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: "voice-speed", children: "Speaking Rate (optional)" }),
18937
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
19262
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "form-group", children: [
19263
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { htmlFor: "voice-speed", children: "Speaking Rate (optional)" }),
19264
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
18938
19265
  "input",
18939
19266
  {
18940
19267
  id: "voice-speed",
@@ -18947,11 +19274,11 @@ ${text}</tr>
18947
19274
  onChange: (e) => setTtsSpeed(e.target.value)
18948
19275
  }
18949
19276
  ),
18950
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: "Multiplier, clamped to 0.5\u20132. Useful because some voices are just slow: raise it if the reply drags. Piper responds less to this than Kokoro, since for Piper it stretches phoneme durations." })
19277
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: "Multiplier, clamped to 0.5\u20132. Useful because some voices are just slow: raise it if the reply drags. Piper responds less to this than Kokoro, since for Piper it stretches phoneme durations." })
18951
19278
  ] }),
18952
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-group", children: [
18953
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: "voice-lang", children: "Language (optional)" }),
18954
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
19279
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "form-group", children: [
19280
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { htmlFor: "voice-lang", children: "Language (optional)" }),
19281
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
18955
19282
  "input",
18956
19283
  {
18957
19284
  id: "voice-lang",
@@ -18963,21 +19290,22 @@ ${text}</tr>
18963
19290
  )
18964
19291
  ] })
18965
19292
  ] }),
18966
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "form-actions", children: [
18967
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", onClick: save, children: "Save" }),
18968
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { role: "status", "aria-live": "polite", className: "form-save-state", children: saveState === "saving" ? "Saving\u2026" : saveState === "saved" ? "Saved \u2713" : "" })
19293
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "form-actions", children: [
19294
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", onClick: save, children: "Save" }),
19295
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { role: "status", "aria-live": "polite", className: "form-save-state", children: saveState === "saving" ? "Saving\u2026" : saveState === "saved" ? "Saved \u2713" : "" })
18969
19296
  ] })
18970
19297
  ] });
18971
19298
  }
18972
19299
 
18973
19300
  // src/SettingsPanel.tsx
18974
- var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
19301
+ var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
18975
19302
  function SettingsPanel({
18976
19303
  layout = "compact",
18977
19304
  postMessage,
18978
19305
  settingsData,
18979
19306
  modelsResult,
18980
- voiceCatalogResult,
19307
+ sttCatalogResult,
19308
+ ttsCatalogResult,
18981
19309
  setModelsResult,
18982
19310
  refreshingSourceId,
18983
19311
  refreshOutcome,
@@ -18987,16 +19315,16 @@ ${text}</tr>
18987
19315
  taskRuns = {},
18988
19316
  onClose
18989
19317
  }) {
18990
- const [activeTab, setActiveTab] = (0, import_react13.useState)("providers");
19318
+ const [activeTab, setActiveTab] = (0, import_react15.useState)("providers");
18991
19319
  if (!settingsData) {
18992
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "settings-panel settings-panel--loading", children: [
18993
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { className: "settings-panel__back-btn", onClick: onClose, children: [
18994
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ArrowLeft, { size: 14 }),
19320
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "settings-panel settings-panel--loading", children: [
19321
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { className: "settings-panel__back-btn", onClick: onClose, children: [
19322
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ArrowLeft, { size: 14 }),
18995
19323
  " Back to Chat"
18996
19324
  ] }),
18997
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "settings-panel__loading-spinner", children: [
18998
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "spinner" }),
18999
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "Loading configurations..." })
19325
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "settings-panel__loading-spinner", children: [
19326
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "spinner" }),
19327
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "Loading configurations..." })
19000
19328
  ] })
19001
19329
  ] });
19002
19330
  }
@@ -19004,7 +19332,7 @@ ${text}</tr>
19004
19332
  const renderTabContent = () => {
19005
19333
  switch (activeTab) {
19006
19334
  case "providers":
19007
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19335
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
19008
19336
  ProvidersTab,
19009
19337
  {
19010
19338
  config,
@@ -19013,7 +19341,7 @@ ${text}</tr>
19013
19341
  }
19014
19342
  );
19015
19343
  case "projects":
19016
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19344
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
19017
19345
  ProjectsTabSettings,
19018
19346
  {
19019
19347
  config,
@@ -19022,7 +19350,7 @@ ${text}</tr>
19022
19350
  }
19023
19351
  );
19024
19352
  case "agents":
19025
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19353
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
19026
19354
  AgentsTab,
19027
19355
  {
19028
19356
  config,
@@ -19036,7 +19364,7 @@ ${text}</tr>
19036
19364
  }
19037
19365
  );
19038
19366
  case "plugins":
19039
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19367
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
19040
19368
  PluginsTab,
19041
19369
  {
19042
19370
  pluginsFile,
@@ -19047,7 +19375,7 @@ ${text}</tr>
19047
19375
  }
19048
19376
  );
19049
19377
  case "mcp":
19050
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19378
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
19051
19379
  McpTab,
19052
19380
  {
19053
19381
  mcpServersFile,
@@ -19057,7 +19385,7 @@ ${text}</tr>
19057
19385
  }
19058
19386
  );
19059
19387
  case "scheduler":
19060
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19388
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
19061
19389
  SchedulerTab,
19062
19390
  {
19063
19391
  config,
@@ -19067,27 +19395,28 @@ ${text}</tr>
19067
19395
  }
19068
19396
  );
19069
19397
  case "voice":
19070
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19398
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
19071
19399
  VoiceTab,
19072
19400
  {
19073
19401
  config,
19074
19402
  onSave: (updatedConfig) => postMessage({ type: "saveConfig", config: updatedConfig }),
19075
19403
  postMessage,
19076
- catalogResult: voiceCatalogResult
19404
+ sttCatalogResult,
19405
+ ttsCatalogResult
19077
19406
  }
19078
19407
  );
19079
19408
  }
19080
19409
  };
19081
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "settings-panel", children: [
19082
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("header", { className: "settings-panel__header", children: [
19083
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { className: "settings-panel__back-btn", onClick: onClose, title: "Go back to chat", children: [
19084
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ArrowLeft, { size: 14 }),
19410
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "settings-panel", children: [
19411
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { className: "settings-panel__header", children: [
19412
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { className: "settings-panel__back-btn", onClick: onClose, title: "Go back to chat", children: [
19413
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ArrowLeft, { size: 14 }),
19085
19414
  " Chat"
19086
19415
  ] }),
19087
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h2", { className: "settings-panel__title", children: "Caretaker Config" })
19416
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h2", { className: "settings-panel__title", children: "Caretaker Config" })
19088
19417
  ] }),
19089
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("nav", { className: "settings-panel__tabs", children: [
19090
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19418
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("nav", { className: "settings-panel__tabs", children: [
19419
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
19091
19420
  "button",
19092
19421
  {
19093
19422
  className: `settings-panel__tab-btn ${activeTab === "providers" ? "settings-panel__tab-btn--active" : ""}`,
@@ -19095,7 +19424,7 @@ ${text}</tr>
19095
19424
  children: "Providers"
19096
19425
  }
19097
19426
  ),
19098
- layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19427
+ layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
19099
19428
  "button",
19100
19429
  {
19101
19430
  className: `settings-panel__tab-btn ${activeTab === "projects" ? "settings-panel__tab-btn--active" : ""}`,
@@ -19103,7 +19432,7 @@ ${text}</tr>
19103
19432
  children: "Projects"
19104
19433
  }
19105
19434
  ),
19106
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19435
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
19107
19436
  "button",
19108
19437
  {
19109
19438
  className: `settings-panel__tab-btn ${activeTab === "agents" ? "settings-panel__tab-btn--active" : ""}`,
@@ -19111,7 +19440,7 @@ ${text}</tr>
19111
19440
  children: "Agents"
19112
19441
  }
19113
19442
  ),
19114
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19443
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
19115
19444
  "button",
19116
19445
  {
19117
19446
  className: `settings-panel__tab-btn ${activeTab === "plugins" ? "settings-panel__tab-btn--active" : ""}`,
@@ -19119,7 +19448,7 @@ ${text}</tr>
19119
19448
  children: "Plugins"
19120
19449
  }
19121
19450
  ),
19122
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19451
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
19123
19452
  "button",
19124
19453
  {
19125
19454
  className: `settings-panel__tab-btn ${activeTab === "mcp" ? "settings-panel__tab-btn--active" : ""}`,
@@ -19127,7 +19456,7 @@ ${text}</tr>
19127
19456
  children: "MCP"
19128
19457
  }
19129
19458
  ),
19130
- layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19459
+ layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
19131
19460
  "button",
19132
19461
  {
19133
19462
  className: `settings-panel__tab-btn ${activeTab === "scheduler" ? "settings-panel__tab-btn--active" : ""}`,
@@ -19135,7 +19464,7 @@ ${text}</tr>
19135
19464
  children: "Scheduler"
19136
19465
  }
19137
19466
  ),
19138
- layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
19467
+ layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
19139
19468
  "button",
19140
19469
  {
19141
19470
  className: `settings-panel__tab-btn ${activeTab === "voice" ? "settings-panel__tab-btn--active" : ""}`,
@@ -19144,13 +19473,13 @@ ${text}</tr>
19144
19473
  }
19145
19474
  )
19146
19475
  ] }),
19147
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("main", { className: "settings-panel__content", children: renderTabContent() })
19476
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("main", { className: "settings-panel__content", children: renderTabContent() })
19148
19477
  ] });
19149
19478
  }
19150
19479
 
19151
19480
  // src/ProjectsTab.tsx
19152
- var import_react14 = __toESM(require_react(), 1);
19153
- var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
19481
+ var import_react16 = __toESM(require_react(), 1);
19482
+ var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
19154
19483
  var LS_PROJECT_KEY = "caretaker.taskView.selectedProjectId";
19155
19484
  var LS_ARCHIVED_KEY = "caretaker.taskView.showArchived";
19156
19485
  function loadSavedProjectId() {
@@ -19241,15 +19570,15 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19241
19570
  }
19242
19571
  var PAGE_SIZE = 20;
19243
19572
  function ProjectsTab({ agents }) {
19244
- const [projects, setProjects] = (0, import_react14.useState)([]);
19245
- const [selectedProjectId, setSelectedProjectId] = (0, import_react14.useState)(loadSavedProjectId);
19246
- const [tasks, setTasks] = (0, import_react14.useState)([]);
19247
- const [selectedTaskId, setSelectedTaskId] = (0, import_react14.useState)(null);
19248
- const [taskMessages, setTaskMessages] = (0, import_react14.useState)([]);
19249
- const [view, setView] = (0, import_react14.useState)("list");
19250
- const [page, setPage] = (0, import_react14.useState)(0);
19251
- const [isNewTaskOpen, setIsNewTaskOpen] = (0, import_react14.useState)(false);
19252
- const [newTask, setNewTask] = (0, import_react14.useState)({
19573
+ const [projects, setProjects] = (0, import_react16.useState)([]);
19574
+ const [selectedProjectId, setSelectedProjectId] = (0, import_react16.useState)(loadSavedProjectId);
19575
+ const [tasks, setTasks] = (0, import_react16.useState)([]);
19576
+ const [selectedTaskId, setSelectedTaskId] = (0, import_react16.useState)(null);
19577
+ const [taskMessages, setTaskMessages] = (0, import_react16.useState)([]);
19578
+ const [view, setView] = (0, import_react16.useState)("list");
19579
+ const [page, setPage] = (0, import_react16.useState)(0);
19580
+ const [isNewTaskOpen, setIsNewTaskOpen] = (0, import_react16.useState)(false);
19581
+ const [newTask, setNewTask] = (0, import_react16.useState)({
19253
19582
  title: "",
19254
19583
  objective: "",
19255
19584
  checklistText: "",
@@ -19258,19 +19587,19 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19258
19587
  plannerAgentId: "",
19259
19588
  reviewerAgentId: ""
19260
19589
  });
19261
- const [composerText, setComposerText] = (0, import_react14.useState)("");
19262
- const [isSending, setIsSending] = (0, import_react14.useState)(false);
19263
- const [showArchived, setShowArchived] = (0, import_react14.useState)(loadShowArchived);
19264
- const [pendingConfirm, setPendingConfirm] = (0, import_react14.useState)(null);
19265
- const [taskError, setTaskError] = (0, import_react14.useState)(null);
19266
- const threadIntervalRef = (0, import_react14.useRef)(null);
19267
- (0, import_react14.useEffect)(() => {
19590
+ const [composerText, setComposerText] = (0, import_react16.useState)("");
19591
+ const [isSending, setIsSending] = (0, import_react16.useState)(false);
19592
+ const [showArchived, setShowArchived] = (0, import_react16.useState)(loadShowArchived);
19593
+ const [pendingConfirm, setPendingConfirm] = (0, import_react16.useState)(null);
19594
+ const [taskError, setTaskError] = (0, import_react16.useState)(null);
19595
+ const threadIntervalRef = (0, import_react16.useRef)(null);
19596
+ (0, import_react16.useEffect)(() => {
19268
19597
  fetchProjects();
19269
19598
  return () => {
19270
19599
  stopThreadPolling();
19271
19600
  };
19272
19601
  }, []);
19273
- (0, import_react14.useEffect)(() => {
19602
+ (0, import_react16.useEffect)(() => {
19274
19603
  if (projects.length > 0 && selectedProjectId === null) {
19275
19604
  setSelectedProjectId(projects[0].id);
19276
19605
  }
@@ -19281,13 +19610,13 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19281
19610
  setSelectedProjectId(null);
19282
19611
  }
19283
19612
  }, [projects]);
19284
- (0, import_react14.useEffect)(() => {
19613
+ (0, import_react16.useEffect)(() => {
19285
19614
  saveProjectId(selectedProjectId);
19286
19615
  }, [selectedProjectId]);
19287
- (0, import_react14.useEffect)(() => {
19616
+ (0, import_react16.useEffect)(() => {
19288
19617
  saveShowArchived(showArchived);
19289
19618
  }, [showArchived]);
19290
- (0, import_react14.useEffect)(() => {
19619
+ (0, import_react16.useEffect)(() => {
19291
19620
  if (selectedProjectId !== null) {
19292
19621
  fetchTasks(selectedProjectId);
19293
19622
  setView("list");
@@ -19299,7 +19628,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19299
19628
  setTasks([]);
19300
19629
  }
19301
19630
  }, [selectedProjectId, showArchived]);
19302
- (0, import_react14.useEffect)(() => {
19631
+ (0, import_react16.useEffect)(() => {
19303
19632
  if (selectedTaskId !== null) {
19304
19633
  fetchTaskMessages(selectedTaskId);
19305
19634
  startThreadPolling(selectedTaskId);
@@ -19472,7 +19801,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19472
19801
  const cancelPendingAction = () => {
19473
19802
  setPendingConfirm(null);
19474
19803
  };
19475
- (0, import_react14.useEffect)(() => {
19804
+ (0, import_react16.useEffect)(() => {
19476
19805
  if (!pendingConfirm) return;
19477
19806
  function handleKeyDown(event) {
19478
19807
  if (event.key === "Escape") {
@@ -19482,7 +19811,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19482
19811
  window.addEventListener("keydown", handleKeyDown);
19483
19812
  return () => window.removeEventListener("keydown", handleKeyDown);
19484
19813
  }, [pendingConfirm]);
19485
- (0, import_react14.useEffect)(() => {
19814
+ (0, import_react16.useEffect)(() => {
19486
19815
  if (!taskError) return;
19487
19816
  const t = setTimeout(() => setTaskError(null), 5e3);
19488
19817
  return () => clearTimeout(t);
@@ -19613,16 +19942,28 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19613
19942
  const selectedProject = projects.find((p) => p.id === selectedProjectId);
19614
19943
  const selectedTask = tasks.find((t) => t.id === selectedTaskId);
19615
19944
  const selectedProjectAgentName = agents.find((a) => a.id === selectedProject?.agentId)?.name || "Default Agent";
19616
- const agentLabelFor = (agentId) => {
19617
- const a = agents.find((x) => x.id === agentId);
19618
- return a ? `${a.name} \xB7 ${a.model}` : void 0;
19619
- };
19620
- const developerId = selectedTask?.agentId || selectedProject?.agentId || agents[0]?.id;
19621
- const taskAgentLabels = selectedTask ? {
19622
- developer: agentLabelFor(developerId),
19623
- planner: agentLabelFor(selectedTask.plannerAgentId || selectedProject?.plannerAgentId || developerId),
19624
- reviewer: agentLabelFor(selectedTask.reviewerAgentId || selectedProject?.reviewerAgentId || developerId)
19625
- } : void 0;
19945
+ const taskAgentLabels = (0, import_react16.useMemo)(() => {
19946
+ if (!selectedTask) return void 0;
19947
+ const agentLabelFor = (agentId) => {
19948
+ const a = agents.find((x) => x.id === agentId);
19949
+ return a ? `${a.name} \xB7 ${a.model}` : void 0;
19950
+ };
19951
+ const developerId = selectedTask.agentId || selectedProject?.agentId || agents[0]?.id;
19952
+ return {
19953
+ developer: agentLabelFor(developerId),
19954
+ planner: agentLabelFor(selectedTask.plannerAgentId || selectedProject?.plannerAgentId || developerId),
19955
+ reviewer: agentLabelFor(selectedTask.reviewerAgentId || selectedProject?.reviewerAgentId || developerId)
19956
+ };
19957
+ }, [
19958
+ selectedTask?.agentId,
19959
+ selectedTask?.plannerAgentId,
19960
+ selectedTask?.reviewerAgentId,
19961
+ selectedProject?.agentId,
19962
+ selectedProject?.plannerAgentId,
19963
+ selectedProject?.reviewerAgentId,
19964
+ selectedTask,
19965
+ agents
19966
+ ]);
19626
19967
  const reviewRound = selectedTask ? taskMessages.filter((m) => m.messageType === "review").length + 1 : 1;
19627
19968
  const isActiveLike = selectedTask ? selectedTask.status === "active" || selectedTask.status === "reviewing" || selectedTask.status === "planning" : false;
19628
19969
  const statusColor = (status) => {
@@ -19647,8 +19988,8 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19647
19988
  const safePage = Math.min(page, totalPages - 1);
19648
19989
  const pageStart = safePage * PAGE_SIZE;
19649
19990
  const pageTasks = tasks.slice(pageStart, pageStart + PAGE_SIZE);
19650
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "app", style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
19651
- /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: "No projects registered. Create one from the Settings panel to get started." }) }) : selectedProject ? view === "list" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
19991
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app", style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
19992
+ /* @__PURE__ */ (0, import_jsx_runtime15.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_runtime15.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: "No projects registered. Create one from the Settings panel to get started." }) }) : selectedProject ? view === "list" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
19652
19993
  TaskListView,
19653
19994
  {
19654
19995
  projects,
@@ -19670,7 +20011,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19670
20011
  onArchive: handleArchiveFromList,
19671
20012
  statusColor
19672
20013
  }
19673
- ) : view === "log" && selectedTask ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20014
+ ) : view === "log" && selectedTask ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
19674
20015
  TaskLogView,
19675
20016
  {
19676
20017
  task: selectedTask,
@@ -19687,7 +20028,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19687
20028
  onToggleStatus: handleToggleTaskStatus,
19688
20029
  statusColor
19689
20030
  }
19690
- ) : view === "edit" && selectedTask ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20031
+ ) : view === "edit" && selectedTask ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
19691
20032
  TaskEditView,
19692
20033
  {
19693
20034
  task: selectedTask,
@@ -19705,11 +20046,11 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19705
20046
  onOpenLog: () => setView("log"),
19706
20047
  statusColor
19707
20048
  }
19708
- ) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "app__empty-state", children: [
19709
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: "Task not found. Go back to the list." }),
19710
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { className: "settings-panel__back-btn", onClick: backToList, style: { marginTop: "12px" }, children: "\u2190 Back to list" })
20049
+ ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__empty-state", children: [
20050
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: "Task not found. Go back to the list." }),
20051
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "settings-panel__back-btn", onClick: backToList, style: { marginTop: "12px" }, children: "\u2190 Back to list" })
19711
20052
  ] }) : null }),
19712
- isNewTaskOpen && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20053
+ isNewTaskOpen && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
19713
20054
  "div",
19714
20055
  {
19715
20056
  style: {
@@ -19724,7 +20065,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19724
20065
  justifyContent: "center",
19725
20066
  zIndex: 999
19726
20067
  },
19727
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
20068
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
19728
20069
  "form",
19729
20070
  {
19730
20071
  onSubmit: handleCreateTask,
@@ -19735,14 +20076,14 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19735
20076
  background: "var(--vscode-sideBar-background)"
19736
20077
  },
19737
20078
  children: [
19738
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "confirm__header", children: [
19739
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: "18px", display: "inline-flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Wrench, { size: 18 }) }),
19740
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "confirm__prompt", style: { fontSize: "14px" }, children: "Create New Task" })
20079
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "confirm__header", children: [
20080
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: "18px", display: "inline-flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Wrench, { size: 18 }) }),
20081
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "confirm__prompt", style: { fontSize: "14px" }, children: "Create New Task" })
19741
20082
  ] }),
19742
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: [
19743
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
20083
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: [
20084
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
19744
20085
  "Task Title",
19745
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20086
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
19746
20087
  "input",
19747
20088
  {
19748
20089
  type: "text",
@@ -19762,9 +20103,9 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19762
20103
  }
19763
20104
  )
19764
20105
  ] }),
19765
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
20106
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
19766
20107
  "Objective (Extended markdown goal description)",
19767
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20108
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
19768
20109
  "textarea",
19769
20110
  {
19770
20111
  required: true,
@@ -19785,9 +20126,9 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19785
20126
  }
19786
20127
  )
19787
20128
  ] }),
19788
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
20129
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
19789
20130
  "Checklist Items (One item per line)",
19790
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20131
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
19791
20132
  "textarea",
19792
20133
  {
19793
20134
  placeholder: "Create route handler\nWrite unit tests\nUpdate documentation",
@@ -19807,9 +20148,9 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19807
20148
  }
19808
20149
  )
19809
20150
  ] }),
19810
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
20151
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
19811
20152
  "Assigned Agent (optional \u2014 overrides project default)",
19812
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
20153
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
19813
20154
  "select",
19814
20155
  {
19815
20156
  value: newTask.agentId,
@@ -19824,8 +20165,8 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19824
20165
  outline: "none"
19825
20166
  },
19826
20167
  children: [
19827
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "", children: "Project default" }),
19828
- agents.map((a) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: a.id, children: [
20168
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "", children: "Project default" }),
20169
+ agents.map((a) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("option", { value: a.id, children: [
19829
20170
  a.name,
19830
20171
  " (",
19831
20172
  a.provider,
@@ -19835,9 +20176,9 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19835
20176
  }
19836
20177
  )
19837
20178
  ] }),
19838
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
20179
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
19839
20180
  "Planner Agent Override (optional)",
19840
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
20181
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
19841
20182
  "select",
19842
20183
  {
19843
20184
  value: newTask.plannerAgentId,
@@ -19852,8 +20193,8 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19852
20193
  outline: "none"
19853
20194
  },
19854
20195
  children: [
19855
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "", children: "Project default" }),
19856
- agents.map((a) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: a.id, children: [
20196
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "", children: "Project default" }),
20197
+ agents.map((a) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("option", { value: a.id, children: [
19857
20198
  a.name,
19858
20199
  " (",
19859
20200
  a.provider,
@@ -19863,9 +20204,9 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19863
20204
  }
19864
20205
  )
19865
20206
  ] }),
19866
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
20207
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
19867
20208
  "Reviewer Agent Override (optional)",
19868
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
20209
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
19869
20210
  "select",
19870
20211
  {
19871
20212
  value: newTask.reviewerAgentId,
@@ -19880,8 +20221,8 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19880
20221
  outline: "none"
19881
20222
  },
19882
20223
  children: [
19883
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "", children: "Project default" }),
19884
- agents.map((a) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: a.id, children: [
20224
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "", children: "Project default" }),
20225
+ agents.map((a) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("option", { value: a.id, children: [
19885
20226
  a.name,
19886
20227
  " (",
19887
20228
  a.provider,
@@ -19891,8 +20232,8 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19891
20232
  }
19892
20233
  )
19893
20234
  ] }),
19894
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { style: { fontSize: "12px", display: "flex", alignItems: "center", gap: "6px", cursor: "pointer", marginTop: "4px" }, children: [
19895
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20235
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { style: { fontSize: "12px", display: "flex", alignItems: "center", gap: "6px", cursor: "pointer", marginTop: "4px" }, children: [
20236
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
19896
20237
  "input",
19897
20238
  {
19898
20239
  type: "checkbox",
@@ -19901,24 +20242,24 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19901
20242
  style: { cursor: "pointer" }
19902
20243
  }
19903
20244
  ),
19904
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "Start active immediately (Heartbeat loop claims it)" })
20245
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "Start active immediately (Heartbeat loop claims it)" })
19905
20246
  ] })
19906
20247
  ] }),
19907
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "confirm__buttons", style: { justifyContent: "flex-end", marginTop: "10px" }, children: [
19908
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "confirm__btn", onClick: () => setIsNewTaskOpen(false), children: "Cancel" }),
19909
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "submit", className: "confirm__btn confirm__btn--primary", children: "Create Task" })
20248
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "confirm__buttons", style: { justifyContent: "flex-end", marginTop: "10px" }, children: [
20249
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "confirm__btn", onClick: () => setIsNewTaskOpen(false), children: "Cancel" }),
20250
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "submit", className: "confirm__btn confirm__btn--primary", children: "Create Task" })
19910
20251
  ] })
19911
20252
  ]
19912
20253
  }
19913
20254
  )
19914
20255
  }
19915
20256
  ),
19916
- pendingConfirm && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "app__confirm-overlay", onClick: cancelPendingAction, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "app__confirm-dialog", onClick: (e) => e.stopPropagation(), children: [
19917
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "app__confirm-title", children: pendingConfirm.type === "delete" ? "Delete task" : pendingConfirm.type === "archive" ? "Archive task" : "Discard worktree" }),
19918
- /* @__PURE__ */ (0, import_jsx_runtime14.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.` }),
19919
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "app__confirm-buttons", children: [
19920
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { className: "app__confirm-btn", onClick: cancelPendingAction, children: "Cancel" }),
19921
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20257
+ pendingConfirm && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "app__confirm-overlay", onClick: cancelPendingAction, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__confirm-dialog", onClick: (e) => e.stopPropagation(), children: [
20258
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "app__confirm-title", children: pendingConfirm.type === "delete" ? "Delete task" : pendingConfirm.type === "archive" ? "Archive task" : "Discard worktree" }),
20259
+ /* @__PURE__ */ (0, import_jsx_runtime15.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.` }),
20260
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__confirm-buttons", children: [
20261
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "app__confirm-btn", onClick: cancelPendingAction, children: "Cancel" }),
20262
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
19922
20263
  "button",
19923
20264
  {
19924
20265
  className: `app__confirm-btn ${pendingConfirm.type === "delete" ? "app__confirm-btn--danger" : ""}`,
@@ -19928,7 +20269,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19928
20269
  )
19929
20270
  ] })
19930
20271
  ] }) }),
19931
- taskError && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "app__error-banner", onClick: () => setTaskError(null), title: "Click to dismiss", children: taskError })
20272
+ taskError && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "app__error-banner", onClick: () => setTaskError(null), title: "Click to dismiss", children: taskError })
19932
20273
  ] });
19933
20274
  }
19934
20275
  function TaskListView({
@@ -19951,10 +20292,10 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19951
20292
  onArchive,
19952
20293
  statusColor
19953
20294
  }) {
19954
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%" }, children: [
19955
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "task-view__header", children: [
19956
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
19957
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20295
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%" }, children: [
20296
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "task-view__header", children: [
20297
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
20298
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
19958
20299
  "select",
19959
20300
  {
19960
20301
  className: "task-view__project-filter",
@@ -19971,17 +20312,17 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19971
20312
  outline: "none",
19972
20313
  cursor: "pointer"
19973
20314
  },
19974
- children: projects.map((p) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: p.id, children: p.name }, p.id))
20315
+ children: projects.map((p) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: p.id, children: p.name }, p.id))
19975
20316
  }
19976
20317
  ),
19977
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { style: { fontSize: "10px", opacity: 0.6 }, children: [
20318
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { style: { fontSize: "10px", opacity: 0.6 }, children: [
19978
20319
  "Agent: ",
19979
20320
  agentName
19980
20321
  ] })
19981
20322
  ] }),
19982
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
19983
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "task-view__archived-toggle", children: [
19984
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20323
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
20324
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "task-view__archived-toggle", children: [
20325
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
19985
20326
  "input",
19986
20327
  {
19987
20328
  type: "checkbox",
@@ -19992,42 +20333,42 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
19992
20333
  ),
19993
20334
  "Show archived"
19994
20335
  ] }),
19995
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { className: "app__new-chat-btn", onClick: onNewTask, style: { padding: "4px 10px", fontSize: "11px" }, children: "+ New Task" })
20336
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "app__new-chat-btn", onClick: onNewTask, style: { padding: "4px 10px", fontSize: "11px" }, children: "+ New Task" })
19996
20337
  ] })
19997
20338
  ] }),
19998
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { flex: 1, overflowY: "auto", padding: "0 16px 16px" }, children: allTasksCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
20339
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { flex: 1, overflowY: "auto", padding: "0 16px 16px" }, children: allTasksCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { children: [
19999
20340
  "No tasks created for ",
20000
20341
  project.name,
20001
20342
  '. Click "+ New Task" to start.'
20002
- ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("table", { className: "task-table", children: [
20003
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("tr", { children: [
20004
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("th", { className: "task-table__th", style: { width: "60px" }, children: "#" }),
20005
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("th", { className: "task-table__th", children: "Title" }),
20006
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("th", { className: "task-table__th", style: { width: "90px" }, children: "Status" }),
20007
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("th", { className: "task-table__th", style: { width: "100px" }, children: "Agent" }),
20008
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("th", { className: "task-table__th", style: { width: "120px" }, children: "Checklist" }),
20009
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("th", { className: "task-table__th", style: { width: "180px" }, children: "Branch" }),
20010
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("th", { className: "task-table__th", style: { width: "150px" }, children: "Updated" }),
20011
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("th", { className: "task-table__th", style: { width: "70px" } })
20343
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("table", { className: "task-table", children: [
20344
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("tr", { children: [
20345
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("th", { className: "task-table__th", style: { width: "60px" }, children: "#" }),
20346
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("th", { className: "task-table__th", children: "Title" }),
20347
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("th", { className: "task-table__th", style: { width: "90px" }, children: "Status" }),
20348
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("th", { className: "task-table__th", style: { width: "100px" }, children: "Agent" }),
20349
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("th", { className: "task-table__th", style: { width: "120px" }, children: "Checklist" }),
20350
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("th", { className: "task-table__th", style: { width: "180px" }, children: "Branch" }),
20351
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("th", { className: "task-table__th", style: { width: "150px" }, children: "Updated" }),
20352
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("th", { className: "task-table__th", style: { width: "70px" } })
20012
20353
  ] }) }),
20013
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tbody", { children: tasks.map((task) => {
20354
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tbody", { children: tasks.map((task) => {
20014
20355
  const completedCount = task.checklist.filter((c) => c.status === "done").length;
20015
20356
  const totalCount = task.checklist.length;
20016
20357
  const isArchived = !!task.archived;
20017
20358
  const updated = new Date(task.updatedAt);
20018
20359
  const updatedStr = isNaN(updated.getTime()) ? task.updatedAt : updated.toLocaleString(void 0, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" });
20019
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
20360
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
20020
20361
  "tr",
20021
20362
  {
20022
20363
  className: `task-table__row${isArchived ? " task-table__row--archived" : ""}`,
20023
20364
  onClick: () => onOpenLog(task),
20024
20365
  children: [
20025
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: "task-table__td task-table__td--mono", children: task.id }),
20026
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "task-table__title", children: [
20027
- isArchived && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Archive, { size: 11 }),
20366
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("td", { className: "task-table__td task-table__td--mono", children: task.id }),
20367
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "task-table__title", children: [
20368
+ isArchived && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Archive, { size: 11 }),
20028
20369
  task.title
20029
20370
  ] }) }),
20030
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20371
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20031
20372
  "span",
20032
20373
  {
20033
20374
  className: "task-table__badge",
@@ -20035,28 +20376,28 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20035
20376
  children: task.status
20036
20377
  }
20037
20378
  ) }),
20038
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: "task-table__td", style: { fontSize: "11px" }, children: task.agentId ? agents.find((a) => a.id === task.agentId)?.name || task.agentId : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { opacity: 0.4 }, children: "default" }) }),
20039
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: "task-table__td", children: totalCount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "task-table__progress", children: [
20040
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "task-table__progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20379
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("td", { className: "task-table__td", style: { fontSize: "11px" }, children: task.agentId ? agents.find((a) => a.id === task.agentId)?.name || task.agentId : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { opacity: 0.4 }, children: "default" }) }),
20380
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("td", { className: "task-table__td", children: totalCount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "task-table__progress", children: [
20381
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "task-table__progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20041
20382
  "span",
20042
20383
  {
20043
20384
  className: "task-table__progress-fill",
20044
20385
  style: { width: `${completedCount / totalCount * 100}%` }
20045
20386
  }
20046
20387
  ) }),
20047
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "task-table__progress-text", children: [
20388
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "task-table__progress-text", children: [
20048
20389
  completedCount,
20049
20390
  "/",
20050
20391
  totalCount
20051
20392
  ] })
20052
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { opacity: 0.4, fontSize: "11px" }, children: "\u2014" }) }),
20053
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: "task-table__td", children: task.branch ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "task-table__branch", children: [
20054
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GitBranch, { size: 11 }),
20055
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("code", { children: task.branch })
20056
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { opacity: 0.4, fontSize: "11px" }, children: "\u2014" }) }),
20057
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: "task-table__td task-table__td--muted", children: updatedStr }),
20058
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "inline-flex", gap: "2px" }, children: [
20059
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20393
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { opacity: 0.4, fontSize: "11px" }, children: "\u2014" }) }),
20394
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("td", { className: "task-table__td", children: task.branch ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "task-table__branch", children: [
20395
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GitBranch, { size: 11 }),
20396
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("code", { children: task.branch })
20397
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { opacity: 0.4, fontSize: "11px" }, children: "\u2014" }) }),
20398
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("td", { className: "task-table__td task-table__td--muted", children: updatedStr }),
20399
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "inline-flex", gap: "2px" }, children: [
20400
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20060
20401
  "button",
20061
20402
  {
20062
20403
  className: "task-table__edit-btn",
@@ -20066,10 +20407,10 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20066
20407
  },
20067
20408
  title: task.archived ? "Unarchive task" : "Archive task",
20068
20409
  "aria-label": task.archived ? "Unarchive task" : "Archive task",
20069
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Archive, { size: 13 })
20410
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Archive, { size: 13 })
20070
20411
  }
20071
20412
  ),
20072
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20413
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20073
20414
  "button",
20074
20415
  {
20075
20416
  className: "task-table__edit-btn",
@@ -20079,7 +20420,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20079
20420
  },
20080
20421
  title: "Edit task",
20081
20422
  "aria-label": "Edit task",
20082
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Pencil, { size: 13 })
20423
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Pencil, { size: 13 })
20083
20424
  }
20084
20425
  )
20085
20426
  ] }) })
@@ -20089,8 +20430,8 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20089
20430
  );
20090
20431
  }) })
20091
20432
  ] }) }),
20092
- totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "task-table__pagination", children: [
20093
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20433
+ totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "task-table__pagination", children: [
20434
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20094
20435
  "button",
20095
20436
  {
20096
20437
  className: "task-table__page-btn",
@@ -20099,13 +20440,13 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20099
20440
  children: "\u2039 Prev"
20100
20441
  }
20101
20442
  ),
20102
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "task-table__page-info", children: [
20443
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "task-table__page-info", children: [
20103
20444
  "Page ",
20104
20445
  page + 1,
20105
20446
  " of ",
20106
20447
  totalPages
20107
20448
  ] }),
20108
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20449
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20109
20450
  "button",
20110
20451
  {
20111
20452
  className: "task-table__page-btn",
@@ -20134,19 +20475,20 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20134
20475
  }) {
20135
20476
  const completedCount = task.checklist.filter((c) => c.status === "done").length;
20136
20477
  const totalCount = task.checklist.length;
20137
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%" }, children: [
20138
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { className: "app__chat-header task-view__sub-header", style: { padding: "12px 14px" }, children: [
20139
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
20140
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { className: "settings-panel__back-btn", onClick: onBack, title: "Back to task list", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ArrowLeft, { size: 13 }) }),
20141
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "app__chat-header-info", children: [
20142
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("h3", { className: "app__chat-header-title", style: { fontSize: "13px", margin: 0 }, children: [
20478
+ const chatItems = (0, import_react16.useMemo)(() => taskMessagesToChatItems(taskMessages, agentLabels), [taskMessages, agentLabels]);
20479
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%" }, children: [
20480
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { className: "app__chat-header task-view__sub-header", style: { padding: "12px 14px" }, children: [
20481
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
20482
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "settings-panel__back-btn", onClick: onBack, title: "Back to task list", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ArrowLeft, { size: 13 }) }),
20483
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__chat-header-info", children: [
20484
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("h3", { className: "app__chat-header-title", style: { fontSize: "13px", margin: 0 }, children: [
20143
20485
  "Task #",
20144
20486
  task.id,
20145
20487
  ": ",
20146
20488
  task.title
20147
20489
  ] }),
20148
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "app__chat-header-status", style: { fontSize: "10px" }, children: [
20149
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20490
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "app__chat-header-status", style: { fontSize: "10px" }, children: [
20491
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20150
20492
  "span",
20151
20493
  {
20152
20494
  className: `agent-status-dot agent-status-dot--active ${isActiveLike ? "agent-status-dot--pulsing" : ""}`,
@@ -20157,24 +20499,24 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20157
20499
  ] })
20158
20500
  ] })
20159
20501
  ] }),
20160
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
20161
- task.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20502
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
20503
+ task.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20162
20504
  "button",
20163
20505
  {
20164
20506
  className: "confirm__btn confirm__btn--primary",
20165
20507
  onClick: () => onToggleStatus(task),
20166
20508
  title: isActiveLike ? "Pause this task (aborts the running agent)" : "Activate this task",
20167
20509
  style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px" },
20168
- children: isActiveLike ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
20169
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Pause, { size: 12 }),
20510
+ children: isActiveLike ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
20511
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Pause, { size: 12 }),
20170
20512
  " Pause"
20171
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
20172
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Play, { size: 12 }),
20513
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
20514
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Play, { size: 12 }),
20173
20515
  " Activate"
20174
20516
  ] })
20175
20517
  }
20176
20518
  ),
20177
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20519
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20178
20520
  "span",
20179
20521
  {
20180
20522
  className: "task-table__badge",
@@ -20184,8 +20526,8 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20184
20526
  )
20185
20527
  ] })
20186
20528
  ] }),
20187
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "row" }, children: [
20188
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
20529
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "row" }, children: [
20530
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
20189
20531
  "aside",
20190
20532
  {
20191
20533
  style: {
@@ -20198,19 +20540,19 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20198
20540
  background: "var(--vscode-sideBar-background, rgba(0,0,0,0.1))"
20199
20541
  },
20200
20542
  children: [
20201
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { padding: "10px 12px", borderBottom: "1px solid var(--vscode-panel-border, rgba(255,255,255,0.05))" }, children: [
20202
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h4", { style: { margin: 0, fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Checklist" }),
20203
- totalCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { fontSize: "10px", opacity: 0.5, marginTop: "2px" }, children: [
20543
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { padding: "10px 12px", borderBottom: "1px solid var(--vscode-panel-border, rgba(255,255,255,0.05))" }, children: [
20544
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h4", { style: { margin: 0, fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Checklist" }),
20545
+ totalCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { fontSize: "10px", opacity: 0.5, marginTop: "2px" }, children: [
20204
20546
  completedCount,
20205
20547
  "/",
20206
20548
  totalCount,
20207
20549
  " done"
20208
20550
  ] })
20209
20551
  ] }),
20210
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { padding: "8px 10px", display: "flex", flexDirection: "column", gap: "4px" }, children: totalCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: "11px", opacity: 0.4, padding: "8px 4px" }, children: "No checklist items." }) : (task.checklist || []).map((item) => {
20552
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { padding: "8px 10px", display: "flex", flexDirection: "column", gap: "4px" }, children: totalCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: "11px", opacity: 0.4, padding: "8px 4px" }, children: "No checklist items." }) : (task.checklist || []).map((item) => {
20211
20553
  const isDone = item.status === "done";
20212
20554
  const isInProgress = item.status === "in_progress";
20213
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
20555
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
20214
20556
  "label",
20215
20557
  {
20216
20558
  style: {
@@ -20227,7 +20569,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20227
20569
  },
20228
20570
  title: isInProgress ? "In progress" : isDone ? "Done" : "Pending",
20229
20571
  children: [
20230
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20572
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20231
20573
  "input",
20232
20574
  {
20233
20575
  type: "checkbox",
@@ -20236,7 +20578,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20236
20578
  style: { marginTop: "2px", cursor: "pointer", flexShrink: 0 }
20237
20579
  }
20238
20580
  ),
20239
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { wordBreak: "break-word" }, children: item.text })
20581
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { wordBreak: "break-word" }, children: item.text })
20240
20582
  ]
20241
20583
  },
20242
20584
  item.id
@@ -20245,10 +20587,10 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20245
20587
  ]
20246
20588
  }
20247
20589
  ),
20248
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column" }, children: [
20249
- taskMessages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "messages messages--empty", children: "No messages in this execution yet. Agent will start on next tick." }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MessageList, { items: taskMessagesToChatItems(taskMessages, agentLabels), sessionId: null }),
20250
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("form", { className: "composer", onSubmit: onSend, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", gap: "8px", alignItems: "flex-end" }, children: [
20251
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20590
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column" }, children: [
20591
+ taskMessages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "messages messages--empty", children: "No messages in this execution yet. Agent will start on next tick." }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MessageList, { items: chatItems, sessionId: null, compact: true }),
20592
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("form", { className: "composer", onSubmit: onSend, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", gap: "8px", alignItems: "flex-end" }, children: [
20593
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20252
20594
  "textarea",
20253
20595
  {
20254
20596
  className: "composer__input",
@@ -20264,7 +20606,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20264
20606
  style: { flex: 1, minHeight: "44px" }
20265
20607
  }
20266
20608
  ),
20267
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20609
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20268
20610
  "button",
20269
20611
  {
20270
20612
  type: "submit",
@@ -20296,12 +20638,12 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20296
20638
  statusColor
20297
20639
  }) {
20298
20640
  const isRunning = task.status === "active" || task.status === "reviewing" || task.status === "planning";
20299
- const [draftTitle, setDraftTitle] = (0, import_react14.useState)(task.title);
20300
- const [draftObjective, setDraftObjective] = (0, import_react14.useState)(task.objective);
20301
- const [lastTaskId, setLastTaskId] = (0, import_react14.useState)(task.id);
20641
+ const [draftTitle, setDraftTitle] = (0, import_react16.useState)(task.title);
20642
+ const [draftObjective, setDraftObjective] = (0, import_react16.useState)(task.objective);
20643
+ const [lastTaskId, setLastTaskId] = (0, import_react16.useState)(task.id);
20302
20644
  const trimmedTitle = draftTitle.trim();
20303
20645
  const isDirty = trimmedTitle !== task.title.trim() || draftObjective.trim() !== task.objective.trim();
20304
- (0, import_react14.useEffect)(() => {
20646
+ (0, import_react16.useEffect)(() => {
20305
20647
  if (task.id !== lastTaskId) {
20306
20648
  setDraftTitle(task.title);
20307
20649
  setDraftObjective(task.objective);
@@ -20316,16 +20658,16 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20316
20658
  setDraftTitle(task.title);
20317
20659
  setDraftObjective(task.objective);
20318
20660
  };
20319
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%", overflowY: "auto" }, children: [
20320
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "task-view__sub-header", style: { padding: "12px 14px", display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
20321
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
20322
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { className: "settings-panel__back-btn", onClick: onBack, title: "Back to task list", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ArrowLeft, { size: 13 }) }),
20323
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("h3", { style: { margin: 0, fontSize: "15px", fontWeight: 700, display: "flex", alignItems: "center", gap: "6px" }, children: [
20324
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { style: { opacity: 0.6 }, children: [
20661
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%", overflowY: "auto" }, children: [
20662
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "task-view__sub-header", style: { padding: "12px 14px", display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
20663
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
20664
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "settings-panel__back-btn", onClick: onBack, title: "Back to task list", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ArrowLeft, { size: 13 }) }),
20665
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("h3", { style: { margin: 0, fontSize: "15px", fontWeight: 700, display: "flex", alignItems: "center", gap: "6px" }, children: [
20666
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { style: { opacity: 0.6 }, children: [
20325
20667
  "Task #",
20326
20668
  task.id
20327
20669
  ] }),
20328
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20670
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20329
20671
  "input",
20330
20672
  {
20331
20673
  value: draftTitle,
@@ -20346,7 +20688,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20346
20688
  }
20347
20689
  )
20348
20690
  ] }),
20349
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20691
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20350
20692
  "span",
20351
20693
  {
20352
20694
  className: "task-table__badge",
@@ -20355,8 +20697,8 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20355
20697
  }
20356
20698
  )
20357
20699
  ] }),
20358
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "inline-flex", gap: "6px" }, children: [
20359
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20700
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "inline-flex", gap: "6px" }, children: [
20701
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20360
20702
  "button",
20361
20703
  {
20362
20704
  className: "confirm__btn",
@@ -20366,7 +20708,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20366
20708
  children: "View Log"
20367
20709
  }
20368
20710
  ),
20369
- task.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
20711
+ task.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
20370
20712
  "button",
20371
20713
  {
20372
20714
  className: "confirm__btn",
@@ -20374,12 +20716,12 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20374
20716
  title: `Commit pending changes to ${task.branch} and remove the worktree`,
20375
20717
  style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px" },
20376
20718
  children: [
20377
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GitBranch, { size: 12 }),
20719
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GitBranch, { size: 12 }),
20378
20720
  " Discard worktree"
20379
20721
  ]
20380
20722
  }
20381
20723
  ),
20382
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
20724
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
20383
20725
  "button",
20384
20726
  {
20385
20727
  className: "confirm__btn",
@@ -20387,28 +20729,28 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20387
20729
  title: task.archived ? "Unarchive this task" : "Archive this task (hides it from the list, excludes from scheduler)",
20388
20730
  style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px" },
20389
20731
  children: [
20390
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Archive, { size: 12 }),
20732
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Archive, { size: 12 }),
20391
20733
  " ",
20392
20734
  task.archived ? "Unarchive" : "Archive"
20393
20735
  ]
20394
20736
  }
20395
20737
  ),
20396
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20738
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20397
20739
  "button",
20398
20740
  {
20399
20741
  className: "confirm__btn confirm__btn--primary",
20400
20742
  onClick: () => onToggleStatus(task),
20401
20743
  style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px" },
20402
- children: task.status === "active" || task.status === "reviewing" || task.status === "planning" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
20403
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Pause, { size: 12 }),
20744
+ children: task.status === "active" || task.status === "reviewing" || task.status === "planning" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
20745
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Pause, { size: 12 }),
20404
20746
  " Pause"
20405
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
20406
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Play, { size: 12 }),
20747
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
20748
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Play, { size: 12 }),
20407
20749
  " Activate"
20408
20750
  ] })
20409
20751
  }
20410
20752
  ),
20411
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
20753
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
20412
20754
  "button",
20413
20755
  {
20414
20756
  className: "confirm__btn",
@@ -20416,22 +20758,22 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20416
20758
  title: "Permanently delete this task and all its messages",
20417
20759
  style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px", color: "#ef4444" },
20418
20760
  children: [
20419
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Trash2, { size: 12 }),
20761
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Trash2, { size: 12 }),
20420
20762
  " Delete"
20421
20763
  ]
20422
20764
  }
20423
20765
  )
20424
20766
  ] })
20425
20767
  ] }),
20426
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { padding: "16px", maxWidth: "720px" }, children: [
20427
- task.branch && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { marginBottom: "16px", display: "flex", alignItems: "center", gap: "6px", fontSize: "11px", opacity: 0.75 }, children: [
20428
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GitBranch, { size: 12 }),
20429
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("code", { style: { fontFamily: "monospace" }, children: task.branch }),
20430
- !task.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { opacity: 0.6 }, children: "(worktree removed)" })
20768
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { padding: "16px", maxWidth: "720px" }, children: [
20769
+ task.branch && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { marginBottom: "16px", display: "flex", alignItems: "center", gap: "6px", fontSize: "11px", opacity: 0.75 }, children: [
20770
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GitBranch, { size: 12 }),
20771
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("code", { style: { fontFamily: "monospace" }, children: task.branch }),
20772
+ !task.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { opacity: 0.6 }, children: "(worktree removed)" })
20431
20773
  ] }),
20432
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { marginBottom: "16px" }, children: [
20433
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Objective" }),
20434
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20774
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { marginBottom: "16px" }, children: [
20775
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Objective" }),
20776
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20435
20777
  "textarea",
20436
20778
  {
20437
20779
  value: draftObjective,
@@ -20455,8 +20797,8 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20455
20797
  }
20456
20798
  }
20457
20799
  ),
20458
- isDirty && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", gap: "6px", alignItems: "center", marginTop: "8px" }, children: [
20459
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20800
+ isDirty && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", gap: "6px", alignItems: "center", marginTop: "8px" }, children: [
20801
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20460
20802
  "button",
20461
20803
  {
20462
20804
  className: "confirm__btn confirm__btn--primary",
@@ -20469,13 +20811,13 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20469
20811
  children: "Save"
20470
20812
  }
20471
20813
  ),
20472
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { className: "confirm__btn", onClick: resetDraft, style: { padding: "3px 10px", fontSize: "10px" }, children: "Cancel" }),
20473
- isRunning && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: "10px", opacity: 0.6 }, children: "Applies from the next cycle." })
20814
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "confirm__btn", onClick: resetDraft, style: { padding: "3px 10px", fontSize: "10px" }, children: "Cancel" }),
20815
+ isRunning && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: "10px", opacity: 0.6 }, children: "Applies from the next cycle." })
20474
20816
  ] })
20475
20817
  ] }),
20476
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { marginBottom: "16px" }, children: [
20477
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Assigned Agent" }),
20478
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
20818
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { marginBottom: "16px" }, children: [
20819
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Assigned Agent" }),
20820
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
20479
20821
  "select",
20480
20822
  {
20481
20823
  value: task.agentId || "",
@@ -20495,8 +20837,8 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20495
20837
  },
20496
20838
  title: isRunning ? "Pause the task before changing its agent" : "Choose which agent runs this task",
20497
20839
  children: [
20498
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "", children: "Project default" }),
20499
- agents.map((a) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: a.id, children: [
20840
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "", children: "Project default" }),
20841
+ agents.map((a) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("option", { value: a.id, children: [
20500
20842
  a.name,
20501
20843
  " (",
20502
20844
  a.provider,
@@ -20506,9 +20848,9 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20506
20848
  }
20507
20849
  )
20508
20850
  ] }),
20509
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { marginBottom: "16px" }, children: [
20510
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Planner Agent" }),
20511
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
20851
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { marginBottom: "16px" }, children: [
20852
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Planner Agent" }),
20853
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
20512
20854
  "select",
20513
20855
  {
20514
20856
  value: task.plannerAgentId || "",
@@ -20517,8 +20859,8 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20517
20859
  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 },
20518
20860
  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.",
20519
20861
  children: [
20520
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "", children: "Project default" }),
20521
- agents.map((a) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: a.id, children: [
20862
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "", children: "Project default" }),
20863
+ agents.map((a) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("option", { value: a.id, children: [
20522
20864
  a.name,
20523
20865
  " (",
20524
20866
  a.provider,
@@ -20528,9 +20870,9 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20528
20870
  }
20529
20871
  )
20530
20872
  ] }),
20531
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { marginBottom: "16px" }, children: [
20532
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Reviewer Agent" }),
20533
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
20873
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { marginBottom: "16px" }, children: [
20874
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Reviewer Agent" }),
20875
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
20534
20876
  "select",
20535
20877
  {
20536
20878
  value: task.reviewerAgentId || "",
@@ -20539,8 +20881,8 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20539
20881
  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 },
20540
20882
  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.",
20541
20883
  children: [
20542
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "", children: "Project default" }),
20543
- agents.map((a) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: a.id, children: [
20884
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "", children: "Project default" }),
20885
+ agents.map((a) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("option", { value: a.id, children: [
20544
20886
  a.name,
20545
20887
  " (",
20546
20888
  a.provider,
@@ -20550,31 +20892,31 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20550
20892
  }
20551
20893
  )
20552
20894
  ] }),
20553
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { marginBottom: "16px" }, children: [
20554
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Phases" }),
20555
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { display: "flex", gap: "12px" }, children: [
20895
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { marginBottom: "16px" }, children: [
20896
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Phases" }),
20897
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { display: "flex", gap: "12px" }, children: [
20556
20898
  { flag: "planningEnabled", label: "Planning phase", value: task.planningEnabled },
20557
20899
  { flag: "reviewEnabled", label: "Review at DONE", value: task.reviewEnabled },
20558
20900
  { flag: "sddEnabled", label: "SDD mode (.md specs)", value: task.sddEnabled }
20559
- ].map(({ flag, label, value }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px", flex: 1 }, children: [
20901
+ ].map(({ flag, label, value }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px", flex: 1 }, children: [
20560
20902
  label,
20561
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
20903
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
20562
20904
  "select",
20563
20905
  {
20564
20906
  value: value === true ? "on" : value === false ? "off" : "inherit",
20565
20907
  onChange: (e) => onSetFlag(task, flag, e.target.value === "inherit" ? null : e.target.value === "on"),
20566
20908
  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" },
20567
20909
  children: [
20568
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "inherit", children: "Project default" }),
20569
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "on", children: "On" }),
20570
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "off", children: "Off" })
20910
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "inherit", children: "Project default" }),
20911
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "on", children: "On" }),
20912
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "off", children: "Off" })
20571
20913
  ]
20572
20914
  }
20573
20915
  )
20574
20916
  ] }, flag)) }),
20575
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px", marginTop: "12px", maxWidth: "260px" }, children: [
20917
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px", marginTop: "12px", maxWidth: "260px" }, children: [
20576
20918
  "Max run seconds per cycle",
20577
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20919
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20578
20920
  "input",
20579
20921
  {
20580
20922
  type: "number",
@@ -20597,7 +20939,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20597
20939
  )
20598
20940
  ] })
20599
20941
  ] }),
20600
- task.status === "blocked" && task.blockedReason && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
20942
+ task.status === "blocked" && task.blockedReason && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
20601
20943
  "div",
20602
20944
  {
20603
20945
  style: {
@@ -20610,19 +20952,19 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20610
20952
  fontSize: "12px"
20611
20953
  },
20612
20954
  children: [
20613
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
20614
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TriangleAlert, { size: 13 }),
20955
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
20956
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TriangleAlert, { size: 13 }),
20615
20957
  " Blocked Reason:"
20616
20958
  ] }),
20617
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { style: { margin: "4px 0 0 0" }, children: task.blockedReason })
20959
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { style: { margin: "4px 0 0 0" }, children: task.blockedReason })
20618
20960
  ]
20619
20961
  }
20620
20962
  ),
20621
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
20622
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h4", { style: { margin: "0 0 8px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Checklist" }),
20623
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: (task.checklist || []).map((item) => {
20963
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
20964
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h4", { style: { margin: "0 0 8px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Checklist" }),
20965
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: (task.checklist || []).map((item) => {
20624
20966
  const isDone = item.status === "done";
20625
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
20967
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
20626
20968
  "label",
20627
20969
  {
20628
20970
  style: {
@@ -20639,7 +20981,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20639
20981
  opacity: isDone ? 0.6 : 1
20640
20982
  },
20641
20983
  children: [
20642
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
20984
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
20643
20985
  "input",
20644
20986
  {
20645
20987
  type: "checkbox",
@@ -20648,7 +20990,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20648
20990
  style: { marginTop: "2px", cursor: "pointer" }
20649
20991
  }
20650
20992
  ),
20651
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: item.text })
20993
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: item.text })
20652
20994
  ]
20653
20995
  },
20654
20996
  item.id
@@ -20660,7 +21002,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20660
21002
  }
20661
21003
 
20662
21004
  // src/useVoice.ts
20663
- var import_react15 = __toESM(require_react(), 1);
21005
+ var import_react17 = __toESM(require_react(), 1);
20664
21006
  function canCapture() {
20665
21007
  return typeof window !== "undefined" && typeof MediaRecorder !== "undefined" && !!navigator.mediaDevices?.getUserMedia;
20666
21008
  }
@@ -20685,37 +21027,37 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20685
21027
  const { voice, chatStatus, pendingConfirmCount, items, onTranscript } = opts;
20686
21028
  const available = !!voice && voice.enabled && voice.configured && canCapture();
20687
21029
  const canSpeak = !!voice?.canSpeak;
20688
- const [phase, setPhase] = (0, import_react15.useState)("idle");
20689
- const [mode, setMode] = (0, import_react15.useState)("dictate");
20690
- const [error, setError] = (0, import_react15.useState)(null);
20691
- const phaseRef = (0, import_react15.useRef)(phase);
21030
+ const [phase, setPhase] = (0, import_react17.useState)("idle");
21031
+ const [mode, setMode] = (0, import_react17.useState)("dictate");
21032
+ const [error, setError] = (0, import_react17.useState)(null);
21033
+ const phaseRef = (0, import_react17.useRef)(phase);
20692
21034
  phaseRef.current = phase;
20693
- const modeRef = (0, import_react15.useRef)(mode);
21035
+ const modeRef = (0, import_react17.useRef)(mode);
20694
21036
  modeRef.current = mode;
20695
- const onTranscriptRef = (0, import_react15.useRef)(onTranscript);
21037
+ const onTranscriptRef = (0, import_react17.useRef)(onTranscript);
20696
21038
  onTranscriptRef.current = onTranscript;
20697
- const itemsRef = (0, import_react15.useRef)(items);
21039
+ const itemsRef = (0, import_react17.useRef)(items);
20698
21040
  itemsRef.current = items;
20699
- const chatStatusRef = (0, import_react15.useRef)(chatStatus);
21041
+ const chatStatusRef = (0, import_react17.useRef)(chatStatus);
20700
21042
  chatStatusRef.current = chatStatus;
20701
- const streamRef = (0, import_react15.useRef)(null);
20702
- const recorderRef = (0, import_react15.useRef)(null);
20703
- const chunksRef = (0, import_react15.useRef)([]);
20704
- const vadRef = (0, import_react15.useRef)(null);
20705
- const audioRef = (0, import_react15.useRef)(null);
20706
- const idleTimerRef = (0, import_react15.useRef)(null);
20707
- const heardSpeechRef = (0, import_react15.useRef)(false);
20708
- const sawStreamingRef = (0, import_react15.useRef)(false);
20709
- const cursorRef = (0, import_react15.useRef)(0);
20710
- const queueRef = (0, import_react15.useRef)([]);
20711
- const apply = (0, import_react15.useCallback)((event) => {
21043
+ const streamRef = (0, import_react17.useRef)(null);
21044
+ const recorderRef = (0, import_react17.useRef)(null);
21045
+ const chunksRef = (0, import_react17.useRef)([]);
21046
+ const vadRef = (0, import_react17.useRef)(null);
21047
+ const audioRef = (0, import_react17.useRef)(null);
21048
+ const idleTimerRef = (0, import_react17.useRef)(null);
21049
+ const heardSpeechRef = (0, import_react17.useRef)(false);
21050
+ const sawStreamingRef = (0, import_react17.useRef)(false);
21051
+ const cursorRef = (0, import_react17.useRef)(0);
21052
+ const queueRef = (0, import_react17.useRef)([]);
21053
+ const apply = (0, import_react17.useCallback)((event) => {
20712
21054
  setPhase((current) => nextPhase(current, event));
20713
21055
  }, []);
20714
21056
  const clearIdleTimer = () => {
20715
21057
  if (idleTimerRef.current) clearTimeout(idleTimerRef.current);
20716
21058
  idleTimerRef.current = null;
20717
21059
  };
20718
- const teardownCapture = (0, import_react15.useCallback)(() => {
21060
+ const teardownCapture = (0, import_react17.useCallback)(() => {
20719
21061
  clearIdleTimer();
20720
21062
  try {
20721
21063
  vadRef.current?.destroy();
@@ -20732,14 +21074,14 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20732
21074
  chunksRef.current = [];
20733
21075
  heardSpeechRef.current = false;
20734
21076
  }, []);
20735
- const stopPlayback = (0, import_react15.useCallback)(() => {
21077
+ const stopPlayback = (0, import_react17.useCallback)(() => {
20736
21078
  if (audioRef.current) {
20737
21079
  audioRef.current.pause();
20738
21080
  audioRef.current.src = "";
20739
21081
  audioRef.current = null;
20740
21082
  }
20741
21083
  }, []);
20742
- const fail = (0, import_react15.useCallback)(
21084
+ const fail = (0, import_react17.useCallback)(
20743
21085
  (message) => {
20744
21086
  teardownCapture();
20745
21087
  stopPlayback();
@@ -20748,7 +21090,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20748
21090
  },
20749
21091
  [apply, teardownCapture, stopPlayback]
20750
21092
  );
20751
- const finishRecording = (0, import_react15.useCallback)(() => {
21093
+ const finishRecording = (0, import_react17.useCallback)(() => {
20752
21094
  const recorder = recorderRef.current;
20753
21095
  if (!recorder || recorder.state === "inactive") return;
20754
21096
  recorder.onstop = async () => {
@@ -20777,7 +21119,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20777
21119
  };
20778
21120
  recorder.stop();
20779
21121
  }, [apply, fail, teardownCapture]);
20780
- const startRecording = (0, import_react15.useCallback)(async () => {
21122
+ const startRecording = (0, import_react17.useCallback)(async () => {
20781
21123
  setError(null);
20782
21124
  chunksRef.current = [];
20783
21125
  heardSpeechRef.current = false;
@@ -20822,7 +21164,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20822
21164
  fail(`Microphone unavailable: ${err}`);
20823
21165
  }
20824
21166
  }, [apply, fail, finishRecording, teardownCapture]);
20825
- const speakReply = (0, import_react15.useCallback)(async () => {
21167
+ const speakReply = (0, import_react17.useCallback)(async () => {
20826
21168
  const text = queueRef.current.shift();
20827
21169
  if (!text) {
20828
21170
  apply({
@@ -20866,10 +21208,10 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20866
21208
  fail(`Synthesis failed: ${err}`);
20867
21209
  }
20868
21210
  }, [apply, fail]);
20869
- (0, import_react15.useEffect)(() => {
21211
+ (0, import_react17.useEffect)(() => {
20870
21212
  if (chatStatus === "streaming") sawStreamingRef.current = true;
20871
21213
  }, [chatStatus]);
20872
- (0, import_react15.useEffect)(() => {
21214
+ (0, import_react17.useEffect)(() => {
20873
21215
  if (modeRef.current !== "conversation") return;
20874
21216
  if (phaseRef.current === "idle") return;
20875
21217
  const { texts, cursor } = takeFinalizedBubbles(items, cursorRef.current);
@@ -20878,7 +21220,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20878
21220
  queueRef.current.push(...texts);
20879
21221
  apply({ kind: "speechQueued", mode: "conversation", canSpeak });
20880
21222
  }, [items, canSpeak, apply]);
20881
- (0, import_react15.useEffect)(() => {
21223
+ (0, import_react17.useEffect)(() => {
20882
21224
  if (phase !== "awaiting") return;
20883
21225
  if (chatStatus === "error") {
20884
21226
  apply({ kind: "failed", mode: "conversation" });
@@ -20900,8 +21242,8 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20900
21242
  pendingSpeech: queueRef.current.length
20901
21243
  });
20902
21244
  }, [phase, chatStatus, pendingConfirmCount, canSpeak, apply]);
20903
- const prevPhase = (0, import_react15.useRef)("idle");
20904
- (0, import_react15.useEffect)(() => {
21245
+ const prevPhase = (0, import_react17.useRef)("idle");
21246
+ (0, import_react17.useEffect)(() => {
20905
21247
  const from = prevPhase.current;
20906
21248
  prevPhase.current = phase;
20907
21249
  if (from === phase) return;
@@ -20913,14 +21255,14 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20913
21255
  queueRef.current = [];
20914
21256
  }
20915
21257
  }, [phase, startRecording, speakReply, teardownCapture, stopPlayback]);
20916
- (0, import_react15.useEffect)(
21258
+ (0, import_react17.useEffect)(
20917
21259
  () => () => {
20918
21260
  teardownCapture();
20919
21261
  stopPlayback();
20920
21262
  },
20921
21263
  [teardownCapture, stopPlayback]
20922
21264
  );
20923
- const toggle = (0, import_react15.useCallback)(() => {
21265
+ const toggle = (0, import_react17.useCallback)(() => {
20924
21266
  if (!available) return;
20925
21267
  const current = phaseRef.current;
20926
21268
  if (current === "idle") {
@@ -20934,7 +21276,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20934
21276
  }
20935
21277
  apply({ kind: "userStop", mode: modeRef.current });
20936
21278
  }, [available, apply, finishRecording]);
20937
- const changeMode = (0, import_react15.useCallback)(
21279
+ const changeMode = (0, import_react17.useCallback)(
20938
21280
  (next) => {
20939
21281
  apply({ kind: "userStop", mode: modeRef.current });
20940
21282
  setMode(next);
@@ -20945,7 +21287,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
20945
21287
  }
20946
21288
 
20947
21289
  // src/App.tsx
20948
- var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
21290
+ var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
20949
21291
  function closeStreamingAssistant2(items) {
20950
21292
  const last = items[items.length - 1];
20951
21293
  if (!last || last.kind !== "assistant" || !last.streaming) return items;
@@ -21107,34 +21449,35 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21107
21449
  }
21108
21450
  }
21109
21451
  function App({ postMessage, layout = "compact" }) {
21110
- const [chatState, dispatch] = (0, import_react16.useReducer)(reducer, {
21452
+ const [chatState, dispatch] = (0, import_react18.useReducer)(reducer, {
21111
21453
  items: [],
21112
21454
  status: "idle",
21113
21455
  errorText: null,
21114
21456
  pendingConfirms: [],
21115
21457
  contextUsage: null
21116
21458
  });
21117
- const [agents, setAgents] = (0, import_react16.useState)([]);
21118
- const [sessions, setSessions] = (0, import_react16.useState)([]);
21119
- const [selectedAgentId, setSelectedAgentId] = (0, import_react16.useState)(null);
21120
- const [selectedSessionId, setSelectedSessionId] = (0, import_react16.useState)(null);
21121
- const [showSessions, setShowSessions] = (0, import_react16.useState)(false);
21122
- const [showAllAgents, setShowAllAgents] = (0, import_react16.useState)(false);
21123
- const [pendingDelete, setPendingDelete] = (0, import_react16.useState)(null);
21124
- const [activeScreen, setActiveScreen] = (0, import_react16.useState)("chat");
21125
- const [settingsData, setSettingsData] = (0, import_react16.useState)(null);
21126
- const [modelsResult, setModelsResult] = (0, import_react16.useState)(null);
21127
- const [refreshingSourceId, setRefreshingSourceId] = (0, import_react16.useState)(null);
21128
- const [refreshOutcome, setRefreshOutcome] = (0, import_react16.useState)(null);
21129
- const [mcpAuthOutcome, setMcpAuthOutcome] = (0, import_react16.useState)(null);
21130
- const [taskRuns, setTaskRuns] = (0, import_react16.useState)({});
21131
- const [voiceConfig, setVoiceConfig] = (0, import_react16.useState)(null);
21132
- const [voiceCatalogResult, setVoiceCatalogResult] = (0, import_react16.useState)(null);
21133
- const [composerDraft, setComposerDraft] = (0, import_react16.useState)("");
21134
- (0, import_react16.useEffect)(() => {
21459
+ const [agents, setAgents] = (0, import_react18.useState)([]);
21460
+ const [sessions, setSessions] = (0, import_react18.useState)([]);
21461
+ const [selectedAgentId, setSelectedAgentId] = (0, import_react18.useState)(null);
21462
+ const [selectedSessionId, setSelectedSessionId] = (0, import_react18.useState)(null);
21463
+ const [showSessions, setShowSessions] = (0, import_react18.useState)(false);
21464
+ const [showAllAgents, setShowAllAgents] = (0, import_react18.useState)(false);
21465
+ const [pendingDelete, setPendingDelete] = (0, import_react18.useState)(null);
21466
+ const [activeScreen, setActiveScreen] = (0, import_react18.useState)("chat");
21467
+ const [settingsData, setSettingsData] = (0, import_react18.useState)(null);
21468
+ const [modelsResult, setModelsResult] = (0, import_react18.useState)(null);
21469
+ const [refreshingSourceId, setRefreshingSourceId] = (0, import_react18.useState)(null);
21470
+ const [refreshOutcome, setRefreshOutcome] = (0, import_react18.useState)(null);
21471
+ const [mcpAuthOutcome, setMcpAuthOutcome] = (0, import_react18.useState)(null);
21472
+ const [taskRuns, setTaskRuns] = (0, import_react18.useState)({});
21473
+ const [voiceConfig, setVoiceConfig] = (0, import_react18.useState)(null);
21474
+ const [sttCatalogResult, setSttCatalogResult] = (0, import_react18.useState)(null);
21475
+ const [ttsCatalogResult, setTtsCatalogResult] = (0, import_react18.useState)(null);
21476
+ const [composerDraft, setComposerDraft] = (0, import_react18.useState)("");
21477
+ (0, import_react18.useEffect)(() => {
21135
21478
  postMessage({ type: "webviewReady" });
21136
21479
  }, []);
21137
- (0, import_react16.useEffect)(() => {
21480
+ (0, import_react18.useEffect)(() => {
21138
21481
  function handle(event) {
21139
21482
  const msg = event.data;
21140
21483
  if (!msg || typeof msg !== "object" || !("type" in msg)) return;
@@ -21192,7 +21535,8 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21192
21535
  setModelsResult(msg.result);
21193
21536
  return;
21194
21537
  case "voiceModelsFetched":
21195
- setVoiceCatalogResult(msg.result);
21538
+ if (msg.target === "tts") setTtsCatalogResult(msg.result);
21539
+ else setSttCatalogResult(msg.result);
21196
21540
  return;
21197
21541
  case "refreshingPlugin":
21198
21542
  setRefreshingSourceId(msg.sourceId);
@@ -21241,13 +21585,17 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21241
21585
  if (voice2) msg.voice = true;
21242
21586
  postMessage(msg);
21243
21587
  };
21244
- const onConfirm = (id, decision) => {
21588
+ const onConfirm = (0, import_react18.useCallback)((id, decision) => {
21245
21589
  dispatch({ kind: "permission-resolved", id });
21246
21590
  postMessage({ type: "permission_response", id, decision });
21247
- };
21591
+ }, [postMessage]);
21248
21592
  const onAbort = () => {
21249
21593
  postMessage({ type: "abort" });
21250
21594
  };
21595
+ const confirmCards = (0, import_react18.useMemo)(
21596
+ () => chatState.pendingConfirms.map((p) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ConfirmCard, { pending: p, onDecide: onConfirm }, p.id)),
21597
+ [chatState.pendingConfirms, onConfirm]
21598
+ );
21251
21599
  const onSelectAgent = (agentId) => {
21252
21600
  if (!agentId) return;
21253
21601
  setSelectedAgentId(agentId);
@@ -21285,7 +21633,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21285
21633
  const cancelDeleteSession = () => {
21286
21634
  setPendingDelete(null);
21287
21635
  };
21288
- (0, import_react16.useEffect)(() => {
21636
+ (0, import_react18.useEffect)(() => {
21289
21637
  if (!pendingDelete) return;
21290
21638
  function handleKeyDown(event) {
21291
21639
  if (event.key === "Escape") {
@@ -21300,7 +21648,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21300
21648
  setShowSessions(!showSessions);
21301
21649
  }
21302
21650
  };
21303
- (0, import_react16.useEffect)(() => {
21651
+ (0, import_react18.useEffect)(() => {
21304
21652
  function handleClickOutside(event) {
21305
21653
  const target = event.target;
21306
21654
  if (showSessions && !target.closest(".app__sessions-dropdown")) {
@@ -21314,18 +21662,18 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21314
21662
  const selectedAgentName = agents.find((a) => a.id === selectedAgentId)?.name;
21315
21663
  const activeAgent = agents.find((a) => a.id === selectedAgentId);
21316
21664
  if (activeScreen === "projects" && layout === "sidebar") {
21317
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app", style: { height: "100%" }, children: [
21318
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("header", { className: "app__header", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__header-row", children: [
21319
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__logo-title-wrapper", onClick: () => setActiveScreen("chat"), style: { cursor: "pointer" }, children: [
21320
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("img", { src: caretaker_cli_default, alt: "Caretaker", className: "app__logo" }),
21321
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "Caretaker" })
21665
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app", style: { height: "100%" }, children: [
21666
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("header", { className: "app__header", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__header-row", children: [
21667
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__logo-title-wrapper", onClick: () => setActiveScreen("chat"), style: { cursor: "pointer" }, children: [
21668
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("img", { src: caretaker_cli_default, alt: "Caretaker", className: "app__logo" }),
21669
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: "Caretaker" })
21322
21670
  ] }),
21323
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__controls", children: [
21324
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { className: "app__sessions-btn", onClick: () => setActiveScreen("chat"), children: [
21325
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MessageSquare, { size: 13 }),
21671
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__controls", children: [
21672
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("button", { className: "app__sessions-btn", onClick: () => setActiveScreen("chat"), children: [
21673
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(MessageSquare, { size: 13 }),
21326
21674
  " Chat"
21327
21675
  ] }),
21328
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
21676
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
21329
21677
  "button",
21330
21678
  {
21331
21679
  className: "app__settings-btn",
@@ -21335,25 +21683,26 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21335
21683
  },
21336
21684
  title: "Caretaker Settings",
21337
21685
  children: [
21338
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Settings, { size: 13 }),
21686
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Settings, { size: 13 }),
21339
21687
  " Settings"
21340
21688
  ]
21341
21689
  }
21342
21690
  )
21343
21691
  ] })
21344
21692
  ] }) }),
21345
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ProjectsTab, { agents }) })
21693
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ProjectsTab, { agents }) })
21346
21694
  ] });
21347
21695
  }
21348
21696
  if (activeScreen === "settings") {
21349
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `app ${layout === "sidebar" ? "app--settings-centered" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21697
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: `app ${layout === "sidebar" ? "app--settings-centered" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21350
21698
  SettingsPanel,
21351
21699
  {
21352
21700
  layout,
21353
21701
  postMessage,
21354
21702
  settingsData,
21355
21703
  modelsResult,
21356
- voiceCatalogResult,
21704
+ sttCatalogResult,
21705
+ ttsCatalogResult,
21357
21706
  setModelsResult,
21358
21707
  refreshingSourceId,
21359
21708
  refreshOutcome,
@@ -21365,43 +21714,43 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21365
21714
  }
21366
21715
  ) });
21367
21716
  }
21368
- const deleteOverlay = pendingDelete && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "app__confirm-overlay", onClick: cancelDeleteSession, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__confirm-dialog", onClick: (e) => e.stopPropagation(), children: [
21369
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "app__confirm-title", children: "Delete conversation" }),
21370
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { className: "app__confirm-message", children: [
21717
+ const deleteOverlay = pendingDelete && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "app__confirm-overlay", onClick: cancelDeleteSession, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__confirm-dialog", onClick: (e) => e.stopPropagation(), children: [
21718
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "app__confirm-title", children: "Delete conversation" }),
21719
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { className: "app__confirm-message", children: [
21371
21720
  "Delete conversation \u201C",
21372
21721
  pendingDelete.title,
21373
21722
  "\u201D? This cannot be undone."
21374
21723
  ] }),
21375
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__confirm-buttons", children: [
21376
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "app__confirm-btn", onClick: cancelDeleteSession, children: "Cancel" }),
21377
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "app__confirm-btn app__confirm-btn--danger", onClick: confirmDeleteSession, children: "Delete" })
21724
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__confirm-buttons", children: [
21725
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { className: "app__confirm-btn", onClick: cancelDeleteSession, children: "Cancel" }),
21726
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { className: "app__confirm-btn app__confirm-btn--danger", onClick: confirmDeleteSession, children: "Delete" })
21378
21727
  ] })
21379
21728
  ] }) });
21380
21729
  if (layout === "sidebar") {
21381
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app app--with-sidebar", children: [
21382
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("aside", { className: "app__sidebar", children: [
21383
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "app__sidebar-header", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__logo-title-wrapper", children: [
21384
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("img", { src: caretaker_cli_default, alt: "Caretaker", className: "app__logo" }),
21385
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "Caretaker" })
21730
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app app--with-sidebar", children: [
21731
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("aside", { className: "app__sidebar", children: [
21732
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "app__sidebar-header", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__logo-title-wrapper", children: [
21733
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("img", { src: caretaker_cli_default, alt: "Caretaker", className: "app__logo" }),
21734
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: "Caretaker" })
21386
21735
  ] }) }),
21387
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__sidebar-content", children: [
21388
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__sidebar-section", children: [
21389
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "app__sidebar-section-title", children: "Agents" }),
21390
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "app__sidebar-agents-list", children: selectedAgentId && !showAllAgents ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
21736
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__sidebar-content", children: [
21737
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__sidebar-section", children: [
21738
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "app__sidebar-section-title", children: "Agents" }),
21739
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "app__sidebar-agents-list", children: selectedAgentId && !showAllAgents ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
21391
21740
  "button",
21392
21741
  {
21393
21742
  className: "app__sidebar-agent-item app__sidebar-agent-item--collapsed-active",
21394
21743
  onClick: () => setShowAllAgents(true),
21395
21744
  title: "Switch Agent",
21396
21745
  children: [
21397
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "agent-status-dot agent-status-dot--active" }),
21398
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "app__sidebar-agent-name", children: activeAgent?.name || selectedAgentId }),
21399
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChevronDown, { className: "app__sidebar-chevron", size: 10 })
21746
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "agent-status-dot agent-status-dot--active" }),
21747
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "app__sidebar-agent-name", children: activeAgent?.name || selectedAgentId }),
21748
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ChevronDown, { className: "app__sidebar-chevron", size: 10 })
21400
21749
  ]
21401
21750
  }
21402
- ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `app__sidebar-agents-list-expanded ${selectedAgentId ? "app__sidebar-agents-list-expanded--has-active" : ""}`, children: agents.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "app__sidebar-empty-text", children: "No agents found" }) : agents.map((agent) => {
21751
+ ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: `app__sidebar-agents-list-expanded ${selectedAgentId ? "app__sidebar-agents-list-expanded--has-active" : ""}`, children: agents.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "app__sidebar-empty-text", children: "No agents found" }) : agents.map((agent) => {
21403
21752
  const isSelected = selectedAgentId === agent.id;
21404
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
21753
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
21405
21754
  "button",
21406
21755
  {
21407
21756
  className: `app__sidebar-agent-item ${isSelected ? "app__sidebar-agent-item--active" : ""}`,
@@ -21413,19 +21762,19 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21413
21762
  }
21414
21763
  },
21415
21764
  children: [
21416
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: `agent-status-dot ${isSelected ? "agent-status-dot--active" : ""}` }),
21417
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "app__sidebar-agent-name", children: agent.name }),
21418
- isSelected && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChevronUp, { className: "app__sidebar-chevron app__sidebar-chevron--up", size: 10 })
21765
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: `agent-status-dot ${isSelected ? "agent-status-dot--active" : ""}` }),
21766
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "app__sidebar-agent-name", children: agent.name }),
21767
+ isSelected && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ChevronUp, { className: "app__sidebar-chevron app__sidebar-chevron--up", size: 10 })
21419
21768
  ]
21420
21769
  },
21421
21770
  agent.id
21422
21771
  );
21423
21772
  }) }) })
21424
21773
  ] }),
21425
- selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__sidebar-section", children: [
21426
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__sidebar-section-header", children: [
21427
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "app__sidebar-section-title", children: "Conversations" }),
21428
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21774
+ selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__sidebar-section", children: [
21775
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__sidebar-section-header", children: [
21776
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "app__sidebar-section-title", children: "Conversations" }),
21777
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21429
21778
  "button",
21430
21779
  {
21431
21780
  className: "app__sidebar-new-chat-btn",
@@ -21435,15 +21784,15 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21435
21784
  }
21436
21785
  )
21437
21786
  ] }),
21438
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "app__sidebar-sessions-list", children: sessions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "app__sidebar-empty-text", children: "No conversations yet" }) : sessions.map((session) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
21787
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "app__sidebar-sessions-list", children: sessions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "app__sidebar-empty-text", children: "No conversations yet" }) : sessions.map((session) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
21439
21788
  "div",
21440
21789
  {
21441
21790
  className: `app__sidebar-session-item ${selectedSessionId === session.id ? "app__sidebar-session-item--active" : ""}`,
21442
21791
  onClick: () => onSelectSession(session.id),
21443
21792
  children: [
21444
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "app__sidebar-session-icon", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MessageSquare, { size: 13 }) }),
21445
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "app__sidebar-session-title", title: session.title, children: session.title }),
21446
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21793
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "app__sidebar-session-icon", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(MessageSquare, { size: 13 }) }),
21794
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "app__sidebar-session-title", title: session.title, children: session.title }),
21795
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21447
21796
  "button",
21448
21797
  {
21449
21798
  className: "app__sidebar-session-delete",
@@ -21452,7 +21801,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21452
21801
  e.stopPropagation();
21453
21802
  onDeleteSession(session.id, session.title);
21454
21803
  },
21455
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Trash2, { size: 12 })
21804
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Trash2, { size: 12 })
21456
21805
  }
21457
21806
  )
21458
21807
  ]
@@ -21461,8 +21810,8 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21461
21810
  )) })
21462
21811
  ] })
21463
21812
  ] }),
21464
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__sidebar-footer", style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
21465
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21813
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__sidebar-footer", style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
21814
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21466
21815
  "button",
21467
21816
  {
21468
21817
  className: "app__sidebar-settings-btn",
@@ -21470,13 +21819,13 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21470
21819
  setActiveScreen("projects");
21471
21820
  },
21472
21821
  title: "Projects & Autonomous Tasks",
21473
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
21474
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FolderKanban, { size: 13 }),
21822
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { children: [
21823
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FolderKanban, { size: 13 }),
21475
21824
  " Projects"
21476
21825
  ] })
21477
21826
  }
21478
21827
  ),
21479
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
21828
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
21480
21829
  "button",
21481
21830
  {
21482
21831
  className: "app__sidebar-settings-btn",
@@ -21486,37 +21835,37 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21486
21835
  },
21487
21836
  title: "Caretaker Settings",
21488
21837
  children: [
21489
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Settings, { className: "app__settings-icon", size: 14 }),
21490
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "Settings" })
21838
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Settings, { className: "app__settings-icon", size: 14 }),
21839
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: "Settings" })
21491
21840
  ]
21492
21841
  }
21493
21842
  )
21494
21843
  ] })
21495
21844
  ] }),
21496
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("main", { className: "app__chat-pane", children: selectedAgentId ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
21497
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("header", { className: "app__chat-header", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__chat-header-info", children: [
21498
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h2", { className: "app__chat-header-title", children: selectedAgentName }),
21499
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "app__chat-header-status", children: [
21500
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: `agent-status-dot agent-status-dot--active ${chatState.status === "streaming" ? "agent-status-dot--pulsing" : ""}` }),
21845
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("main", { className: "app__chat-pane", children: selectedAgentId ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
21846
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("header", { className: "app__chat-header", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__chat-header-info", children: [
21847
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h2", { className: "app__chat-header-title", children: selectedAgentName }),
21848
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "app__chat-header-status", children: [
21849
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: `agent-status-dot agent-status-dot--active ${chatState.status === "streaming" ? "agent-status-dot--pulsing" : ""}` }),
21501
21850
  chatState.status === "streaming" ? "Streaming response..." : "Ready"
21502
21851
  ] })
21503
21852
  ] }) }),
21504
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21853
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21505
21854
  MessageList,
21506
21855
  {
21507
21856
  items: chatState.items,
21508
21857
  sessionId: selectedSessionId,
21509
21858
  isStreaming: chatState.status === "streaming",
21510
21859
  agentName: selectedAgentName,
21511
- trailing: chatState.pendingConfirms.map((p) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ConfirmCard, { pending: p, onDecide: onConfirm }, p.id))
21860
+ trailing: confirmCards
21512
21861
  }
21513
21862
  ),
21514
- (chatState.errorText || voice.error) && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__error", children: [
21515
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TriangleAlert, { size: 14 }),
21863
+ (chatState.errorText || voice.error) && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__error", children: [
21864
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TriangleAlert, { size: 14 }),
21516
21865
  " ",
21517
21866
  chatState.errorText || voice.error
21518
21867
  ] }),
21519
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21868
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21520
21869
  Composer,
21521
21870
  {
21522
21871
  disabled: composerDisabled,
@@ -21535,30 +21884,30 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21535
21884
  onValueChange: setComposerDraft
21536
21885
  }
21537
21886
  )
21538
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: "Select an agent from the sidebar to start chatting" }) }) }),
21887
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { children: "Select an agent from the sidebar to start chatting" }) }) }),
21539
21888
  deleteOverlay
21540
21889
  ] });
21541
21890
  }
21542
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app", children: [
21543
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("header", { className: "app__header", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__header-row", children: [
21544
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__logo-title-wrapper", children: [
21545
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("img", { src: caretaker_cli_default, alt: "Caretaker", className: "app__logo" }),
21546
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "Caretaker" })
21891
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app", children: [
21892
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("header", { className: "app__header", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__header-row", children: [
21893
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__logo-title-wrapper", children: [
21894
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("img", { src: caretaker_cli_default, alt: "Caretaker", className: "app__logo" }),
21895
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: "Caretaker" })
21547
21896
  ] }),
21548
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__controls", children: [
21549
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "app__agent-select-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
21897
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__controls", children: [
21898
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "app__agent-select-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
21550
21899
  "select",
21551
21900
  {
21552
21901
  className: "app__agent-select",
21553
21902
  value: selectedAgentId ?? "",
21554
21903
  onChange: (e) => onSelectAgent(e.target.value),
21555
21904
  children: [
21556
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "", disabled: true, children: "-- Select Agent --" }),
21557
- agents.map((agent) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: agent.id, children: agent.name }, agent.id))
21905
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "", disabled: true, children: "-- Select Agent --" }),
21906
+ agents.map((agent) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: agent.id, children: agent.name }, agent.id))
21558
21907
  ]
21559
21908
  }
21560
21909
  ) }),
21561
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
21910
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
21562
21911
  "button",
21563
21912
  {
21564
21913
  className: "app__sessions-btn",
@@ -21566,13 +21915,13 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21566
21915
  disabled: !selectedAgentId,
21567
21916
  title: "View conversations",
21568
21917
  children: [
21569
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MessageSquare, { size: 13 }),
21918
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(MessageSquare, { size: 13 }),
21570
21919
  " ",
21571
21920
  sessions.length
21572
21921
  ]
21573
21922
  }
21574
21923
  ),
21575
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21924
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21576
21925
  "button",
21577
21926
  {
21578
21927
  className: "app__new-chat-btn",
@@ -21582,7 +21931,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21582
21931
  children: "+ New"
21583
21932
  }
21584
21933
  ),
21585
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21934
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21586
21935
  "button",
21587
21936
  {
21588
21937
  className: "app__settings-btn",
@@ -21591,24 +21940,24 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21591
21940
  postMessage({ type: "getSettingsData" });
21592
21941
  },
21593
21942
  title: "Caretaker Settings",
21594
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Settings, { className: "app__settings-icon", size: 14 })
21943
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Settings, { className: "app__settings-icon", size: 14 })
21595
21944
  }
21596
21945
  )
21597
21946
  ] })
21598
21947
  ] }) }),
21599
- showSessions && sessions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__sessions-dropdown", children: [
21600
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__sessions-title", children: [
21948
+ showSessions && sessions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__sessions-dropdown", children: [
21949
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__sessions-title", children: [
21601
21950
  "Conversations for ",
21602
21951
  selectedAgentName
21603
21952
  ] }),
21604
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "app__sessions-list", children: sessions.map((session) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
21953
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "app__sessions-list", children: sessions.map((session) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
21605
21954
  "div",
21606
21955
  {
21607
21956
  className: `app__session-item ${selectedSessionId === session.id ? "app__session-item--active" : ""}`,
21608
21957
  onClick: () => onSelectSession(session.id),
21609
21958
  children: [
21610
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "app__session-item-title", children: session.title }),
21611
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21959
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "app__session-item-title", children: session.title }),
21960
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21612
21961
  "button",
21613
21962
  {
21614
21963
  className: "app__session-item-delete",
@@ -21617,7 +21966,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21617
21966
  e.stopPropagation();
21618
21967
  onDeleteSession(session.id, session.title);
21619
21968
  },
21620
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Trash2, { size: 12 })
21969
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Trash2, { size: 12 })
21621
21970
  }
21622
21971
  )
21623
21972
  ]
@@ -21625,27 +21974,27 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21625
21974
  session.id
21626
21975
  )) })
21627
21976
  ] }),
21628
- showSessions && sessions.length === 0 && selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__sessions-dropdown app__sessions-dropdown--empty", children: [
21629
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "app__sessions-title", children: "No conversations yet" }),
21630
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "app__sessions-empty", children: "Start a new chat to create a conversation" })
21977
+ showSessions && sessions.length === 0 && selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__sessions-dropdown app__sessions-dropdown--empty", children: [
21978
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "app__sessions-title", children: "No conversations yet" }),
21979
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "app__sessions-empty", children: "Start a new chat to create a conversation" })
21631
21980
  ] }),
21632
- !selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: "Select an agent to start chatting" }) }),
21633
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21981
+ !selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { children: "Select an agent to start chatting" }) }),
21982
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21634
21983
  MessageList,
21635
21984
  {
21636
21985
  items: chatState.items,
21637
21986
  sessionId: selectedSessionId,
21638
21987
  isStreaming: chatState.status === "streaming",
21639
21988
  agentName: selectedAgentName,
21640
- trailing: chatState.pendingConfirms.map((p) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ConfirmCard, { pending: p, onDecide: onConfirm }, p.id))
21989
+ trailing: confirmCards
21641
21990
  }
21642
21991
  ),
21643
- (chatState.errorText || voice.error) && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "app__error", children: [
21644
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TriangleAlert, { size: 14 }),
21992
+ (chatState.errorText || voice.error) && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "app__error", children: [
21993
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TriangleAlert, { size: 14 }),
21645
21994
  " ",
21646
21995
  chatState.errorText || voice.error
21647
21996
  ] }),
21648
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
21997
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
21649
21998
  Composer,
21650
21999
  {
21651
22000
  disabled: composerDisabled,
@@ -21669,12 +22018,12 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21669
22018
  }
21670
22019
 
21671
22020
  // src/standalone.tsx
21672
- var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
22021
+ var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
21673
22022
  function StandaloneApp() {
21674
- const [ws, setWs] = (0, import_react17.useState)(null);
21675
- const [connected, setConnected] = (0, import_react17.useState)(false);
21676
- const [error, setError] = (0, import_react17.useState)(null);
21677
- (0, import_react17.useEffect)(() => {
22023
+ const [ws, setWs] = (0, import_react19.useState)(null);
22024
+ const [connected, setConnected] = (0, import_react19.useState)(false);
22025
+ const [error, setError] = (0, import_react19.useState)(null);
22026
+ (0, import_react19.useEffect)(() => {
21678
22027
  let active = true;
21679
22028
  const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
21680
22029
  const socket = new WebSocket(`${protocol}//${window.location.host}/api/ws`);
@@ -21720,7 +22069,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21720
22069
  }
21721
22070
  };
21722
22071
  if (error) {
21723
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: {
22072
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: {
21724
22073
  display: "flex",
21725
22074
  flexDirection: "column",
21726
22075
  alignItems: "center",
@@ -21732,9 +22081,9 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21732
22081
  padding: "20px",
21733
22082
  textAlign: "center"
21734
22083
  }, children: [
21735
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h3", { style: { color: "#ff6b6b" }, children: "Caretaker Connection Failed" }),
21736
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { children: error }),
21737
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
22084
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h3", { style: { color: "#ff6b6b" }, children: "Caretaker Connection Failed" }),
22085
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: error }),
22086
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
21738
22087
  "button",
21739
22088
  {
21740
22089
  onClick: () => setWs(null),
@@ -21753,7 +22102,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21753
22102
  ] });
21754
22103
  }
21755
22104
  if (!connected) {
21756
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: {
22105
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: {
21757
22106
  display: "flex",
21758
22107
  flexDirection: "column",
21759
22108
  alignItems: "center",
@@ -21763,7 +22112,7 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21763
22112
  background: "#1e1e1e",
21764
22113
  color: "#f1f1f1"
21765
22114
  }, children: [
21766
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: {
22115
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: {
21767
22116
  border: "4px solid rgba(255,255,255,0.1)",
21768
22117
  width: "36px",
21769
22118
  height: "36px",
@@ -21772,8 +22121,8 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21772
22121
  animation: "spin 1s linear infinite",
21773
22122
  marginBottom: "16px"
21774
22123
  } }),
21775
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: "Connecting to Caretaker server..." }),
21776
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("style", { children: `
22124
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "Connecting to Caretaker server..." }),
22125
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("style", { children: `
21777
22126
  @keyframes spin {
21778
22127
  0% { transform: rotate(0deg); }
21779
22128
  100% { transform: rotate(360deg); }
@@ -21781,12 +22130,12 @@ ${msg.content}`, streaming: false, label: msg.agentLabel || labels?.reviewer });
21781
22130
  ` })
21782
22131
  ] });
21783
22132
  }
21784
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(App, { postMessage, layout: "sidebar" });
22133
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(App, { postMessage, layout: "sidebar" });
21785
22134
  }
21786
22135
  var rootEl = document.getElementById("root");
21787
22136
  if (!rootEl) throw new Error("#root not found");
21788
22137
  (0, import_client.createRoot)(rootEl).render(
21789
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react17.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(StandaloneApp, {}) })
22138
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react19.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(StandaloneApp, {}) })
21790
22139
  );
21791
22140
  })();
21792
22141
  /*! Bundled license information: