@hasna/assistants 1.1.66 → 1.1.67

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.
package/dist/index.js CHANGED
@@ -89205,7 +89205,7 @@ Not a git repository or git not available.
89205
89205
  context.setProjectContext(projectContext);
89206
89206
  }
89207
89207
  }
89208
- var VERSION2 = "1.1.66";
89208
+ var VERSION2 = "1.1.67";
89209
89209
  var init_builtin = __esm(async () => {
89210
89210
  init_src2();
89211
89211
  init_context3();
@@ -256305,91 +256305,174 @@ function BudgetsPanel({
256305
256305
  }
256306
256306
 
256307
256307
  // packages/terminal/src/components/ModelPanel.tsx
256308
- init_src2();
256309
256308
  await init_build2();
256310
256309
  var import_react72 = __toESM(require_react(), 1);
256310
+ init_src2();
256311
256311
  var jsx_dev_runtime36 = __toESM(require_jsx_dev_runtime(), 1);
256312
+ var MAX_VISIBLE_ROWS4 = 12;
256313
+ var NAME_WIDTH = 28;
256314
+ var CTX_WIDTH = 6;
256315
+ var OUT_WIDTH = 6;
256316
+ var COST_WIDTH = 10;
256317
+ function fmtTokens(n5) {
256318
+ if (n5 == null)
256319
+ return "\u2014";
256320
+ if (n5 >= 1e6)
256321
+ return `${(n5 / 1e6).toFixed(n5 % 1e6 === 0 ? 0 : 1)}M`;
256322
+ if (n5 >= 1000)
256323
+ return `${Math.round(n5 / 1000)}K`;
256324
+ return String(n5);
256325
+ }
256326
+ function fmtCost(model) {
256327
+ if (model.inputCostPer1M == null || model.outputCostPer1M == null)
256328
+ return "\u2014";
256329
+ const fmtNum = (n5) => n5 >= 1 ? `$${n5 % 1 === 0 ? n5 : n5.toFixed(1)}` : `$${n5}`;
256330
+ return `${fmtNum(model.inputCostPer1M)}/${fmtNum(model.outputCostPer1M)}`;
256331
+ }
256332
+ function padRight(s5, w4) {
256333
+ return s5.length >= w4 ? s5.slice(0, w4) : s5 + " ".repeat(w4 - s5.length);
256334
+ }
256335
+ function padLeft(s5, w4) {
256336
+ return s5.length >= w4 ? s5.slice(0, w4) : " ".repeat(w4 - s5.length) + s5;
256337
+ }
256338
+ function getVisibleRange6(selectedIndex, totalItems, maxVisible = MAX_VISIBLE_ROWS4) {
256339
+ if (totalItems <= maxVisible) {
256340
+ return { start: 0, end: totalItems, hasMore: { above: 0, below: 0 } };
256341
+ }
256342
+ const halfWindow = Math.floor(maxVisible / 2);
256343
+ let start = selectedIndex - halfWindow;
256344
+ let end = selectedIndex + (maxVisible - halfWindow);
256345
+ if (start < 0) {
256346
+ start = 0;
256347
+ end = maxVisible;
256348
+ }
256349
+ if (end > totalItems) {
256350
+ end = totalItems;
256351
+ start = Math.max(0, totalItems - maxVisible);
256352
+ }
256353
+ return { start, end, hasMore: { above: start, below: totalItems - end } };
256354
+ }
256355
+ function buildRows(models2) {
256356
+ const rows = [];
256357
+ for (const provider3 of LLM_PROVIDER_IDS) {
256358
+ const providerModels = models2.filter((m5) => m5.provider === provider3);
256359
+ if (providerModels.length === 0)
256360
+ continue;
256361
+ rows.push({ type: "provider", label: getProviderLabel(provider3) });
256362
+ for (const model of providerModels) {
256363
+ rows.push({ type: "model", model });
256364
+ }
256365
+ }
256366
+ return rows;
256367
+ }
256368
+ function getSelectableIndices(rows) {
256369
+ return rows.reduce((acc, row, i6) => {
256370
+ if (row.type === "model")
256371
+ acc.push(i6);
256372
+ return acc;
256373
+ }, []);
256374
+ }
256312
256375
  function ModelPanel({
256313
256376
  currentModelId,
256314
256377
  assistantName,
256315
256378
  onSelectModel,
256316
256379
  onCancel
256317
256380
  }) {
256318
- const [selectedIndex, setSelectedIndex] = import_react72.useState(0);
256381
+ const [selectedRowIndex, setSelectedRowIndex] = import_react72.useState(0);
256319
256382
  const [isSwitching, setIsSwitching] = import_react72.useState(false);
256320
256383
  const [status, setStatus] = import_react72.useState(null);
256321
- const models2 = import_react72.useMemo(() => {
256322
- const ordered = [];
256323
- for (const provider3 of LLM_PROVIDER_IDS) {
256324
- ordered.push(...ALL_MODELS.filter((model) => model.provider === provider3));
256325
- }
256326
- return ordered;
256327
- }, []);
256328
- const rows = import_react72.useMemo(() => {
256329
- const nextRows = [];
256330
- let modelIndex = 0;
256331
- for (const provider3 of LLM_PROVIDER_IDS) {
256332
- const providerModels = models2.filter((model) => model.provider === provider3);
256333
- if (providerModels.length === 0)
256334
- continue;
256335
- nextRows.push({
256336
- type: "provider",
256337
- key: `provider-${provider3}`,
256338
- label: getProviderLabel(provider3)
256339
- });
256340
- for (const model of providerModels) {
256341
- nextRows.push({
256342
- type: "model",
256343
- key: model.id,
256344
- model,
256345
- index: modelIndex
256346
- });
256347
- modelIndex += 1;
256348
- }
256349
- }
256350
- return nextRows;
256351
- }, [models2]);
256384
+ const [isSearching, setIsSearching] = import_react72.useState(false);
256385
+ const [searchQuery, setSearchQuery] = import_react72.useState("");
256386
+ const filteredModels = import_react72.useMemo(() => {
256387
+ if (!searchQuery.trim())
256388
+ return [...ALL_MODELS];
256389
+ const q5 = searchQuery.toLowerCase();
256390
+ return ALL_MODELS.filter((m5) => m5.name.toLowerCase().includes(q5) || m5.id.toLowerCase().includes(q5));
256391
+ }, [searchQuery]);
256392
+ const rows = import_react72.useMemo(() => buildRows(filteredModels), [filteredModels]);
256393
+ const selectableIndices = import_react72.useMemo(() => getSelectableIndices(rows), [rows]);
256352
256394
  import_react72.useEffect(() => {
256353
256395
  if (!currentModelId)
256354
256396
  return;
256355
- const idx = models2.findIndex((model) => model.id === currentModelId);
256397
+ const idx = rows.findIndex((r5) => r5.type === "model" && r5.model.id === currentModelId);
256356
256398
  if (idx >= 0)
256357
- setSelectedIndex(idx);
256358
- }, [currentModelId, models2]);
256399
+ setSelectedRowIndex(idx);
256400
+ }, [currentModelId, rows]);
256401
+ import_react72.useEffect(() => {
256402
+ if (selectableIndices.length === 0)
256403
+ return;
256404
+ if (!selectableIndices.includes(selectedRowIndex)) {
256405
+ setSelectedRowIndex(selectableIndices[0]);
256406
+ }
256407
+ }, [selectableIndices, selectedRowIndex]);
256408
+ const moveSelection = (direction) => {
256409
+ if (selectableIndices.length === 0)
256410
+ return;
256411
+ const currentPos = selectableIndices.indexOf(selectedRowIndex);
256412
+ let nextPos;
256413
+ if (currentPos === -1) {
256414
+ nextPos = direction === 1 ? 0 : selectableIndices.length - 1;
256415
+ } else {
256416
+ nextPos = currentPos + direction;
256417
+ if (nextPos < 0)
256418
+ nextPos = selectableIndices.length - 1;
256419
+ if (nextPos >= selectableIndices.length)
256420
+ nextPos = 0;
256421
+ }
256422
+ setSelectedRowIndex(selectableIndices[nextPos]);
256423
+ };
256424
+ const handleSelect = () => {
256425
+ const row = rows[selectedRowIndex];
256426
+ if (!row || row.type !== "model")
256427
+ return;
256428
+ if (row.model.id === currentModelId) {
256429
+ setStatus({ type: "info", text: `${row.model.name} is already active.` });
256430
+ return;
256431
+ }
256432
+ setIsSwitching(true);
256433
+ onSelectModel(row.model.id).then(() => {
256434
+ setStatus({ type: "success", text: `Switched to ${row.model.name}.` });
256435
+ }).catch((err) => {
256436
+ const message = err instanceof Error ? err.message : String(err);
256437
+ setStatus({ type: "error", text: message });
256438
+ }).finally(() => {
256439
+ setIsSwitching(false);
256440
+ });
256441
+ };
256359
256442
  useSafeInput((input, key) => {
256360
256443
  if (isSwitching)
256361
256444
  return;
256445
+ if (isSearching) {
256446
+ if (key.escape) {
256447
+ setIsSearching(false);
256448
+ setSearchQuery("");
256449
+ return;
256450
+ }
256451
+ return;
256452
+ }
256362
256453
  if (key.escape || input === "q" || input === "Q") {
256363
256454
  onCancel();
256364
256455
  return;
256365
256456
  }
256457
+ if (input === "/") {
256458
+ setIsSearching(true);
256459
+ setSearchQuery("");
256460
+ return;
256461
+ }
256366
256462
  if (key.upArrow || input === "k") {
256367
- setSelectedIndex((prev) => prev <= 0 ? Math.max(0, models2.length - 1) : prev - 1);
256463
+ moveSelection(-1);
256368
256464
  return;
256369
256465
  }
256370
256466
  if (key.downArrow || input === "j") {
256371
- setSelectedIndex((prev) => prev >= models2.length - 1 ? 0 : prev + 1);
256467
+ moveSelection(1);
256372
256468
  return;
256373
256469
  }
256374
256470
  if (key.return || input === "s" || input === "S") {
256375
- const selected = models2[selectedIndex];
256376
- if (!selected)
256377
- return;
256378
- if (selected.id === currentModelId) {
256379
- setStatus({ type: "info", text: `${selected.name} is already active.` });
256380
- return;
256381
- }
256382
- setIsSwitching(true);
256383
- onSelectModel(selected.id).then(() => {
256384
- setStatus({ type: "success", text: `Switched to ${selected.name}.` });
256385
- }).catch((err) => {
256386
- const message = err instanceof Error ? err.message : String(err);
256387
- setStatus({ type: "error", text: message });
256388
- }).finally(() => {
256389
- setIsSwitching(false);
256390
- });
256471
+ handleSelect();
256391
256472
  }
256392
256473
  }, { isActive: true });
256474
+ const visibleRange = import_react72.useMemo(() => getVisibleRange6(selectedRowIndex, rows.length), [selectedRowIndex, rows.length]);
256475
+ const visibleRows = rows.slice(visibleRange.start, visibleRange.end);
256393
256476
  return /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
256394
256477
  flexDirection: "column",
256395
256478
  paddingY: 1,
@@ -256431,67 +256514,124 @@ function ModelPanel({
256431
256514
  children: status.text
256432
256515
  }, undefined, false, undefined, this)
256433
256516
  }, undefined, false, undefined, this),
256517
+ isSearching && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
256518
+ marginBottom: 1,
256519
+ children: [
256520
+ /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Text, {
256521
+ bold: true,
256522
+ color: "blue",
256523
+ children: "/ "
256524
+ }, undefined, false, undefined, this),
256525
+ /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(build_default2, {
256526
+ value: searchQuery,
256527
+ onChange: setSearchQuery,
256528
+ placeholder: "Search models..."
256529
+ }, undefined, false, undefined, this)
256530
+ ]
256531
+ }, undefined, true, undefined, this),
256532
+ visibleRange.hasMore.above > 0 && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
256533
+ paddingLeft: 2,
256534
+ children: /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Text, {
256535
+ dimColor: true,
256536
+ children: [
256537
+ "\u2191 ",
256538
+ visibleRange.hasMore.above,
256539
+ " more"
256540
+ ]
256541
+ }, undefined, true, undefined, this)
256542
+ }, undefined, false, undefined, this),
256543
+ /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
256544
+ paddingLeft: 2,
256545
+ children: /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Text, {
256546
+ dimColor: true,
256547
+ children: [
256548
+ padRight("Model", NAME_WIDTH),
256549
+ padLeft("Ctx", CTX_WIDTH),
256550
+ padLeft("Out", OUT_WIDTH),
256551
+ padLeft("Cost/1M", COST_WIDTH)
256552
+ ]
256553
+ }, undefined, true, undefined, this)
256554
+ }, undefined, false, undefined, this),
256434
256555
  /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
256435
256556
  flexDirection: "column",
256436
- borderStyle: "round",
256437
- borderColor: "#d4d4d8",
256438
- borderLeft: false,
256439
- borderRight: false,
256440
- paddingX: 1,
256441
- children: rows.map((row) => {
256557
+ children: visibleRows.map((row, i6) => {
256558
+ const globalIndex = visibleRange.start + i6;
256442
256559
  if (row.type === "provider") {
256443
256560
  return /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
256444
- marginTop: 1,
256561
+ paddingLeft: 1,
256445
256562
  children: /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Text, {
256446
256563
  bold: true,
256447
256564
  color: "cyan",
256448
- children: row.label
256449
- }, undefined, false, undefined, this)
256450
- }, row.key, false, undefined, this);
256565
+ children: [
256566
+ " ",
256567
+ row.label
256568
+ ]
256569
+ }, undefined, true, undefined, this)
256570
+ }, `p-${row.label}`, false, undefined, this);
256451
256571
  }
256452
- const isSelected = row.index === selectedIndex;
256572
+ const isSelected = globalIndex === selectedRowIndex;
256453
256573
  const isCurrent = row.model.id === currentModelId;
256574
+ const prefix = isSelected ? "\u25B8 " : " ";
256575
+ const name = padRight(row.model.name, NAME_WIDTH);
256576
+ const ctx = padLeft(fmtTokens(row.model.contextWindow), CTX_WIDTH);
256577
+ const out = padLeft(fmtTokens(row.model.maxOutputTokens), OUT_WIDTH);
256578
+ const cost = padLeft(fmtCost(row.model), COST_WIDTH);
256454
256579
  return /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
256455
- flexDirection: "column",
256456
- marginBottom: 1,
256457
256580
  children: [
256458
- /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
256581
+ /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Text, {
256582
+ color: isSelected ? "blue" : undefined,
256583
+ children: prefix
256584
+ }, undefined, false, undefined, this),
256585
+ /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Text, {
256586
+ bold: isSelected,
256587
+ color: isSelected ? "blue" : undefined,
256588
+ children: name
256589
+ }, undefined, false, undefined, this),
256590
+ /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Text, {
256591
+ dimColor: !isSelected,
256592
+ color: isSelected ? "blue" : undefined,
256459
256593
  children: [
256460
- /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Text, {
256461
- color: isSelected ? "blue" : undefined,
256462
- children: isSelected ? "\u25B8 " : " "
256463
- }, undefined, false, undefined, this),
256464
- /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Text, {
256465
- bold: isSelected,
256466
- color: isSelected ? "blue" : undefined,
256467
- children: row.model.name
256468
- }, undefined, false, undefined, this),
256469
- isCurrent && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Text, {
256470
- color: "green",
256471
- children: " (current)"
256472
- }, undefined, false, undefined, this)
256594
+ ctx,
256595
+ out,
256596
+ cost
256473
256597
  ]
256474
256598
  }, undefined, true, undefined, this),
256475
- /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
256476
- paddingLeft: 2,
256477
- children: /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Text, {
256478
- dimColor: true,
256479
- children: [
256480
- row.model.id,
256481
- " \xB7 ",
256482
- row.model.description
256483
- ]
256484
- }, undefined, true, undefined, this)
256599
+ isCurrent && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Text, {
256600
+ color: "green",
256601
+ children: " \u2190 current"
256485
256602
  }, undefined, false, undefined, this)
256486
256603
  ]
256487
- }, row.key, true, undefined, this);
256604
+ }, row.model.id, true, undefined, this);
256488
256605
  })
256489
256606
  }, undefined, false, undefined, this),
256607
+ visibleRange.hasMore.below > 0 && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
256608
+ paddingLeft: 2,
256609
+ children: /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Text, {
256610
+ dimColor: true,
256611
+ children: [
256612
+ "\u2193 ",
256613
+ visibleRange.hasMore.below,
256614
+ " more"
256615
+ ]
256616
+ }, undefined, true, undefined, this)
256617
+ }, undefined, false, undefined, this),
256618
+ selectableIndices.length === 0 && isSearching && /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
256619
+ paddingLeft: 2,
256620
+ marginY: 1,
256621
+ children: /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Text, {
256622
+ dimColor: true,
256623
+ children: [
256624
+ 'No models match "',
256625
+ searchQuery,
256626
+ '"'
256627
+ ]
256628
+ }, undefined, true, undefined, this)
256629
+ }, undefined, false, undefined, this),
256490
256630
  /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Box_default, {
256491
256631
  marginTop: 1,
256492
256632
  children: /* @__PURE__ */ jsx_dev_runtime36.jsxDEV(Text, {
256493
256633
  dimColor: true,
256494
- children: isSwitching ? "Switching model..." : "Enter/s switch | \u2191\u2193 navigate | q quit"
256634
+ children: isSwitching ? "Switching model..." : isSearching ? "Type to filter | Esc clear search" : "Enter select | \u2191\u2193 navigate | / search | q quit"
256495
256635
  }, undefined, false, undefined, this)
256496
256636
  }, undefined, false, undefined, this)
256497
256637
  ]
@@ -258478,7 +258618,7 @@ var SCOPE_OPTIONS = [
258478
258618
  { id: "global", label: "Global", desc: "Available everywhere (~/.skill/)" }
258479
258619
  ];
258480
258620
  var MAX_VISIBLE_SKILLS = 10;
258481
- function getVisibleRange6(selectedIndex, totalItems, maxVisible = MAX_VISIBLE_SKILLS) {
258621
+ function getVisibleRange7(selectedIndex, totalItems, maxVisible = MAX_VISIBLE_SKILLS) {
258482
258622
  if (totalItems <= maxVisible) {
258483
258623
  return {
258484
258624
  start: 0,
@@ -259396,7 +259536,7 @@ function SkillsPanel({
259396
259536
  }
259397
259537
  const totalSkills = sortedSkills.length;
259398
259538
  const selectedForRange = totalSkills === 0 ? 0 : Math.min(selectedIndex, totalSkills - 1);
259399
- const skillRange = getVisibleRange6(selectedForRange, totalSkills, MAX_VISIBLE_SKILLS);
259539
+ const skillRange = getVisibleRange7(selectedForRange, totalSkills, MAX_VISIBLE_SKILLS);
259400
259540
  const visibleSkills = sortedSkills.slice(skillRange.start, skillRange.end);
259401
259541
  const visibleEntries = visibleSkills.map((skill, offset) => {
259402
259542
  const actualIdx = skillRange.start + offset;
@@ -260872,7 +261012,7 @@ var ADD_FIELDS = [
260872
261012
  { key: "expiryYear", label: "Expiry Year", placeholder: "YYYY" },
260873
261013
  { key: "cvv", label: "CVV", placeholder: "3-4 digits", sensitive: true }
260874
261014
  ];
260875
- function getVisibleRange7(selectedIndex, totalItems, maxVisible = MAX_VISIBLE_ITEMS5) {
261015
+ function getVisibleRange8(selectedIndex, totalItems, maxVisible = MAX_VISIBLE_ITEMS5) {
260876
261016
  if (totalItems <= maxVisible) {
260877
261017
  return {
260878
261018
  start: 0,
@@ -260962,7 +261102,7 @@ function WalletPanel({
260962
261102
  }
260963
261103
  setStatusMessage(null);
260964
261104
  }, [initialMode]);
260965
- const cardRange = import_react79.useMemo(() => getVisibleRange7(cardIndex, cards.length), [cardIndex, cards.length]);
261105
+ const cardRange = import_react79.useMemo(() => getVisibleRange8(cardIndex, cards.length), [cardIndex, cards.length]);
260966
261106
  const currentCard = cards[cardIndex];
260967
261107
  const currentAddField = ADD_FIELDS[addFieldIndex];
260968
261108
  import_react79.useEffect(() => {
@@ -261608,7 +261748,7 @@ var defaultAddForm = () => ({
261608
261748
  scope: "assistant",
261609
261749
  description: ""
261610
261750
  });
261611
- function getVisibleRange8(selectedIndex, totalItems, maxVisible = MAX_VISIBLE_ITEMS6) {
261751
+ function getVisibleRange9(selectedIndex, totalItems, maxVisible = MAX_VISIBLE_ITEMS6) {
261612
261752
  if (totalItems <= maxVisible) {
261613
261753
  return {
261614
261754
  start: 0,
@@ -261687,7 +261827,7 @@ function SecretsPanel({
261687
261827
  import_react80.useEffect(() => {
261688
261828
  setSecretIndex((prev) => Math.min(prev, Math.max(0, secrets2.length - 1)));
261689
261829
  }, [secrets2.length]);
261690
- const secretRange = import_react80.useMemo(() => getVisibleRange8(secretIndex, secrets2.length), [secretIndex, secrets2.length]);
261830
+ const secretRange = import_react80.useMemo(() => getVisibleRange9(secretIndex, secrets2.length), [secretIndex, secrets2.length]);
261691
261831
  const currentSecret = secrets2[secretIndex];
261692
261832
  import_react80.useEffect(() => {
261693
261833
  if (mode === "detail" && !currentSecret) {
@@ -262314,7 +262454,7 @@ await init_build2();
262314
262454
  var import_react81 = __toESM(require_react(), 1);
262315
262455
  var jsx_dev_runtime45 = __toESM(require_jsx_dev_runtime(), 1);
262316
262456
  var MAX_VISIBLE_ITEMS7 = 5;
262317
- function getVisibleRange9(selectedIndex, totalItems, maxVisible = MAX_VISIBLE_ITEMS7) {
262457
+ function getVisibleRange10(selectedIndex, totalItems, maxVisible = MAX_VISIBLE_ITEMS7) {
262318
262458
  if (totalItems <= maxVisible) {
262319
262459
  return { start: 0, end: totalItems, hasMore: { above: 0, below: 0 } };
262320
262460
  }
@@ -262364,7 +262504,7 @@ function WorkspacePanel({
262364
262504
  import_react81.useEffect(() => {
262365
262505
  setWsIndex((prev) => Math.min(prev, Math.max(0, workspaces.length - 1)));
262366
262506
  }, [workspaces.length]);
262367
- const wsRange = import_react81.useMemo(() => getVisibleRange9(wsIndex, workspaces.length), [wsIndex, workspaces.length]);
262507
+ const wsRange = import_react81.useMemo(() => getVisibleRange10(wsIndex, workspaces.length), [wsIndex, workspaces.length]);
262368
262508
  const currentWs = workspaces[wsIndex];
262369
262509
  import_react81.useEffect(() => {
262370
262510
  if (mode === "detail" && !currentWs) {
@@ -269253,17 +269393,38 @@ process.on("unhandledRejection", (reason) => {
269253
269393
  cleanup();
269254
269394
  process.exit(1);
269255
269395
  });
269256
- var VERSION4 = "1.1.66";
269396
+ var VERSION4 = "1.1.67";
269257
269397
  var SYNC_START = "\x1B[?2026h";
269258
269398
  var SYNC_END = "\x1B[?2026l";
269259
269399
  function enableSynchronizedOutput() {
269260
269400
  const originalWrite = process.stdout.write.bind(process.stdout);
269401
+ let buffer = "";
269402
+ let flushScheduled = false;
269403
+ function flush() {
269404
+ flushScheduled = false;
269405
+ if (!buffer)
269406
+ return;
269407
+ const output = buffer;
269408
+ buffer = "";
269409
+ originalWrite(SYNC_START + output + SYNC_END);
269410
+ }
269261
269411
  process.stdout.write = function(chunk, encodingOrCallback, callback) {
269262
269412
  const raw = typeof chunk === "string" ? chunk : chunk.toString();
269263
269413
  const safe = sanitizeTerminalOutput(raw);
269264
- return originalWrite(SYNC_START + safe + SYNC_END, encodingOrCallback, callback);
269414
+ buffer += safe;
269415
+ if (!flushScheduled) {
269416
+ flushScheduled = true;
269417
+ queueMicrotask(flush);
269418
+ }
269419
+ if (typeof encodingOrCallback === "function") {
269420
+ encodingOrCallback();
269421
+ } else if (callback) {
269422
+ callback();
269423
+ }
269424
+ return true;
269265
269425
  };
269266
269426
  return () => {
269427
+ flush();
269267
269428
  process.stdout.write = originalWrite;
269268
269429
  };
269269
269430
  }
@@ -269373,4 +269534,4 @@ export {
269373
269534
  main
269374
269535
  };
269375
269536
 
269376
- //# debugId=BC5CF87B7F42C6AF64756E2164756E21
269537
+ //# debugId=A5FDCCEC1934D13964756E2164756E21