jinzd-ai-cli 0.4.220 → 0.4.221

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/{batch-QBSKTLTO.js → batch-LSWWSINO.js} +2 -2
  2. package/dist/{chunk-IZW5LMI6.js → chunk-4AX2MEJA.js} +3 -3
  3. package/dist/{chunk-Y25MSSUP.js → chunk-4MOBTDS6.js} +1 -1
  4. package/dist/{chunk-P4PTXCHY.js → chunk-5BY4XICU.js} +3 -3
  5. package/dist/{chunk-MC34ISJU.js → chunk-5GTWZ4QF.js} +30 -6
  6. package/dist/{chunk-P3LKFA54.js → chunk-6SKMGONY.js} +3 -3
  7. package/dist/{chunk-VHX7KZDY.js → chunk-BYQEWWA4.js} +2 -2
  8. package/dist/{chunk-P4DYAGUI.js → chunk-OULVIHCT.js} +1 -1
  9. package/dist/{chunk-5WBNXYDJ.js → chunk-PMTEZTXP.js} +1 -1
  10. package/dist/{chunk-QZYNRCPX.js → chunk-QDN5G7JN.js} +1 -1
  11. package/dist/{chunk-ALQN7VUJ.js → chunk-QKJ3MAP7.js} +1 -1
  12. package/dist/{chunk-A4GUGWEY.js → chunk-QT5FA2ZY.js} +1 -1
  13. package/dist/{chunk-CAUHLHDR.js → chunk-S5EEKS4P.js} +1 -1
  14. package/dist/{ci-5SNXGM3M.js → ci-OIFTAJKR.js} +4 -4
  15. package/dist/{ci-format-57QQTHQE.js → ci-format-H6BLMWQ5.js} +2 -2
  16. package/dist/{constants-ML5KFEOH.js → constants-EJRLT7DM.js} +1 -1
  17. package/dist/{doctor-cli-ZRH3XZ3R.js → doctor-cli-EXC7YU5D.js} +4 -4
  18. package/dist/electron-server.js +73 -44
  19. package/dist/{hub-IPLMJ6TJ.js → hub-HQDRQBNM.js} +2 -2
  20. package/dist/index.js +322 -32
  21. package/dist/{persist-L54DPLI7.js → persist-GTBEKVFL.js} +2 -2
  22. package/dist/{pr-GJYDAPK4.js → pr-VSZNVKBS.js} +4 -4
  23. package/dist/{run-tests-GK5AIAV2.js → run-tests-55JGEZYL.js} +1 -1
  24. package/dist/{run-tests-KLQAI5CX.js → run-tests-OYXK27XH.js} +2 -2
  25. package/dist/{server-RU36PRSH.js → server-JKNIZ5CB.js} +19 -14
  26. package/dist/{server-5FZDALHH.js → server-XX6UM4ZQ.js} +4 -4
  27. package/dist/{task-orchestrator-JMHPVNUO.js → task-orchestrator-F3DUIACA.js} +4 -4
  28. package/dist/{usage-IRMRCCKN.js → usage-4KFX3HTK.js} +2 -2
  29. package/package.json +1 -1
@@ -38,7 +38,7 @@ import {
38
38
  VERSION,
39
39
  buildUserIdentityPrompt,
40
40
  runTestsTool
41
- } from "./chunk-CAUHLHDR.js";
41
+ } from "./chunk-S5EEKS4P.js";
42
42
  import {
43
43
  hasSemanticIndex,
44
44
  semanticSearch
@@ -65,7 +65,7 @@ import express from "express";
65
65
  import { createServer } from "http";
66
66
  import { WebSocketServer } from "ws";
67
67
  import { join as join26, dirname as dirname9, resolve as resolve11, relative as relative4, sep as sep3 } from "path";
68
- import { existsSync as existsSync31, readFileSync as readFileSync24, readdirSync as readdirSync15, statSync as statSync12, realpathSync } from "fs";
68
+ import { existsSync as existsSync31, readFileSync as readFileSync24, readdirSync as readdirSync15, statSync as statSync13, realpathSync } from "fs";
69
69
  import { networkInterfaces } from "os";
70
70
 
71
71
  // src/config/config-manager.ts
@@ -4065,7 +4065,7 @@ var ProviderRegistry = class {
4065
4065
  };
4066
4066
 
4067
4067
  // src/session/session-manager.ts
4068
- import { readFileSync as readFileSync3, existsSync as existsSync3, mkdirSync as mkdirSync3, readdirSync, unlinkSync as unlinkSync2, openSync, readSync, closeSync } from "fs";
4068
+ import { readFileSync as readFileSync3, existsSync as existsSync3, mkdirSync as mkdirSync3, readdirSync, unlinkSync as unlinkSync2, openSync, readSync, closeSync, statSync } from "fs";
4069
4069
  import { join as join3 } from "path";
4070
4070
  import { v4 as uuidv4 } from "uuid";
4071
4071
 
@@ -4668,14 +4668,22 @@ var SessionManager = class {
4668
4668
  this._current = session;
4669
4669
  return session;
4670
4670
  }
4671
- listSessions() {
4671
+ listSessions(opts) {
4672
4672
  if (!existsSync3(this.historyDir)) return [];
4673
4673
  const files = readdirSync(this.historyDir).filter((f) => f.endsWith(".json"));
4674
4674
  const metas = [];
4675
4675
  for (const file of files) {
4676
4676
  try {
4677
- const meta = this.readSessionMeta(join3(this.historyDir, file));
4678
- if (meta) metas.push(meta);
4677
+ const filePath = join3(this.historyDir, file);
4678
+ const meta = this.readSessionMeta(filePath);
4679
+ if (!meta) continue;
4680
+ if (opts?.includeFileSize) {
4681
+ try {
4682
+ meta.fileSize = statSync(filePath).size;
4683
+ } catch {
4684
+ }
4685
+ }
4686
+ metas.push(meta);
4679
4687
  } catch (err) {
4680
4688
  process.stderr.write(
4681
4689
  `[Warning] Skipping corrupted session file "${file}": ${err instanceof Error ? err.message : String(err)}
@@ -4720,6 +4728,18 @@ var SessionManager = class {
4720
4728
  } catch {
4721
4729
  }
4722
4730
  }
4731
+ let branchCount;
4732
+ let activeBranch;
4733
+ try {
4734
+ const brMatch = header.match(/"branches"\s*:\s*\[/);
4735
+ if (brMatch) {
4736
+ const brIds = header.match(/"id"\s*:\s*"[^"]*"/g);
4737
+ const parentMatches = header.match(/"parentBranchId"/g);
4738
+ branchCount = parentMatches ? parentMatches.length + 1 : 1;
4739
+ }
4740
+ activeBranch = extractJsonField(header, "activeBranchId");
4741
+ } catch {
4742
+ }
4723
4743
  return {
4724
4744
  id,
4725
4745
  provider,
@@ -4727,7 +4747,9 @@ var SessionManager = class {
4727
4747
  messageCount,
4728
4748
  created: safeDate(created),
4729
4749
  updated: safeDate(updated),
4730
- title: title || void 0
4750
+ title: title || void 0,
4751
+ branchCount,
4752
+ activeBranch
4731
4753
  };
4732
4754
  }
4733
4755
  const data = JSON.parse(readFileSync3(filePath, "utf-8"));
@@ -4738,7 +4760,9 @@ var SessionManager = class {
4738
4760
  messageCount: data.messages?.length ?? 0,
4739
4761
  created: safeDate(data.created),
4740
4762
  updated: safeDate(data.updated),
4741
- title: data.title
4763
+ title: data.title,
4764
+ branchCount: data.branches?.length ?? 1,
4765
+ activeBranch: data.activeBranchId
4742
4766
  };
4743
4767
  }
4744
4768
  deleteSession(id) {
@@ -4834,7 +4858,7 @@ var SessionManager = class {
4834
4858
 
4835
4859
  // src/tools/builtin/bash.ts
4836
4860
  import { spawn } from "child_process";
4837
- import { existsSync as existsSync5, readdirSync as readdirSync2, statSync } from "fs";
4861
+ import { existsSync as existsSync5, readdirSync as readdirSync2, statSync as statSync2 } from "fs";
4838
4862
  import { platform as platform2 } from "os";
4839
4863
  import { resolve } from "path";
4840
4864
 
@@ -5309,7 +5333,7 @@ function pushBashUndoEntries(beforeSnapshot, parsedTargetsBefore, cwd) {
5309
5333
  for (const absPath of afterSnapshot) {
5310
5334
  if (!beforeSnapshot.has(absPath)) {
5311
5335
  try {
5312
- const st = statSync(absPath);
5336
+ const st = statSync2(absPath);
5313
5337
  if (st.isDirectory()) {
5314
5338
  undoStack.pushNewDir(absPath, `bash (new dir): ${absPath}`);
5315
5339
  } else {
@@ -5323,7 +5347,7 @@ function pushBashUndoEntries(beforeSnapshot, parsedTargetsBefore, cwd) {
5323
5347
  for (const [target, existedBefore] of parsedTargetsBefore) {
5324
5348
  if (!existedBefore && !tracked.has(target) && existsSync5(target)) {
5325
5349
  try {
5326
- const st = statSync(target);
5350
+ const st = statSync2(target);
5327
5351
  if (st.isDirectory()) {
5328
5352
  undoStack.pushNewDir(target, `bash (new dir): ${target}`);
5329
5353
  } else {
@@ -5442,7 +5466,7 @@ function updateCwdFromCommand(command, baseCwd) {
5442
5466
  }
5443
5467
 
5444
5468
  // src/tools/builtin/read-file.ts
5445
- import { readFileSync as readFileSync5, existsSync as existsSync6, statSync as statSync2, readdirSync as readdirSync3 } from "fs";
5469
+ import { readFileSync as readFileSync5, existsSync as existsSync6, statSync as statSync3, readdirSync as readdirSync3 } from "fs";
5446
5470
  import { execFileSync } from "child_process";
5447
5471
  import { extname, resolve as resolve2, basename, sep, dirname as dirname2 } from "path";
5448
5472
  import { homedir as homedir2 } from "os";
@@ -5738,7 +5762,7 @@ Current working directory: ${process.cwd()}
5738
5762
  Please use list_dir to verify the file path and retry.`
5739
5763
  );
5740
5764
  }
5741
- const { size } = statSync2(normalizedPath);
5765
+ const { size } = statSync3(normalizedPath);
5742
5766
  if (size > MAX_FILE_BYTES) {
5743
5767
  const mb = (size / 1024 / 1024).toFixed(1);
5744
5768
  return `[File too large: ${filePath} (${mb} MB)]
@@ -8145,7 +8169,7 @@ function truncatePreview(str, maxLen = 80) {
8145
8169
  }
8146
8170
 
8147
8171
  // src/tools/builtin/list-dir.ts
8148
- import { readdirSync as readdirSync4, statSync as statSync3, existsSync as existsSync12 } from "fs";
8172
+ import { readdirSync as readdirSync4, statSync as statSync4, existsSync as existsSync12 } from "fs";
8149
8173
  import { join as join7, basename as basename3 } from "path";
8150
8174
  var listDirTool = {
8151
8175
  definition: {
@@ -8230,7 +8254,7 @@ function listRecursive(basePath, indent, recursive, lines) {
8230
8254
  }
8231
8255
  } else {
8232
8256
  try {
8233
- const stat = statSync3(join7(basePath, entry.name));
8257
+ const stat = statSync4(join7(basePath, entry.name));
8234
8258
  const size = formatSize(stat.size);
8235
8259
  lines.push(`${indent}\u{1F4C4} ${entry.name} (${size})`);
8236
8260
  } catch {
@@ -8246,7 +8270,7 @@ function formatSize(bytes) {
8246
8270
  }
8247
8271
 
8248
8272
  // src/tools/builtin/grep-files.ts
8249
- import { readdirSync as readdirSync5, readFileSync as readFileSync11, statSync as statSync4, existsSync as existsSync13 } from "fs";
8273
+ import { readdirSync as readdirSync5, readFileSync as readFileSync11, statSync as statSync5, existsSync as existsSync13 } from "fs";
8250
8274
  import { readFile } from "fs/promises";
8251
8275
  import { join as join8, relative } from "path";
8252
8276
  var grepFilesTool = {
@@ -8312,7 +8336,7 @@ Supports regex. Automatically skips node_modules, dist, .git directories.`,
8312
8336
  regex = new RegExp(escaped, ignoreCase ? "gi" : "g");
8313
8337
  }
8314
8338
  const results = [];
8315
- const stat = statSync4(rootPath);
8339
+ const stat = statSync5(rootPath);
8316
8340
  if (stat.isFile()) {
8317
8341
  searchInFile(rootPath, rootPath, regex, contextLines, maxResults, results);
8318
8342
  } else {
@@ -8399,7 +8423,7 @@ function collectFilePaths(rootPath, filePattern, maxFiles) {
8399
8423
  if (filePattern && !matchesFilePattern(entry.name, filePattern)) continue;
8400
8424
  const fullPath = join8(dirPath, entry.name);
8401
8425
  try {
8402
- if (statSync4(fullPath).size > 1e6) continue;
8426
+ if (statSync5(fullPath).size > 1e6) continue;
8403
8427
  } catch {
8404
8428
  continue;
8405
8429
  }
@@ -8445,7 +8469,7 @@ async function searchInFileAsync(fullPath, displayPath2, regex, contextLines, ma
8445
8469
  }
8446
8470
  function searchInFile(fullPath, displayPath2, regex, contextLines, maxResults, results) {
8447
8471
  try {
8448
- const stat = statSync4(fullPath);
8472
+ const stat = statSync5(fullPath);
8449
8473
  if (stat.size > 1e6) return;
8450
8474
  } catch {
8451
8475
  return;
@@ -8483,7 +8507,7 @@ function searchInFile(fullPath, displayPath2, regex, contextLines, maxResults, r
8483
8507
  }
8484
8508
 
8485
8509
  // src/tools/builtin/glob-files.ts
8486
- import { readdirSync as readdirSync6, statSync as statSync5, existsSync as existsSync14 } from "fs";
8510
+ import { readdirSync as readdirSync6, statSync as statSync6, existsSync as existsSync14 } from "fs";
8487
8511
  import { join as join9, relative as relative2, basename as basename4 } from "path";
8488
8512
  var globFilesTool = {
8489
8513
  definition: {
@@ -8602,7 +8626,7 @@ function collectMatchingFiles(dirPath, rootPath, regex, results, maxResults) {
8602
8626
  const relPath = relative2(rootPath, fullPath).replace(/\\/g, "/");
8603
8627
  if (regex.test(relPath) || regex.test(basename4(relPath))) {
8604
8628
  try {
8605
- const stat = statSync5(fullPath);
8629
+ const stat = statSync6(fullPath);
8606
8630
  results.push({ relPath, absPath: fullPath, mtime: stat.mtimeMs });
8607
8631
  } catch {
8608
8632
  results.push({ relPath, absPath: fullPath, mtime: 0 });
@@ -10021,7 +10045,7 @@ import { join as join14 } from "path";
10021
10045
  import { homedir as homedir6 } from "os";
10022
10046
 
10023
10047
  // src/plugins/plugin-manager.ts
10024
- import { existsSync as existsSync17, mkdirSync as mkdirSync9, readdirSync as readdirSync7, readFileSync as readFileSync13, cpSync, rmSync, statSync as statSync6 } from "fs";
10048
+ import { existsSync as existsSync17, mkdirSync as mkdirSync9, readdirSync as readdirSync7, readFileSync as readFileSync13, cpSync, rmSync, statSync as statSync7 } from "fs";
10025
10049
  import { basename as basename5, dirname as dirname7, join as join13, resolve as resolve7 } from "path";
10026
10050
  import { createHash as createHash3 } from "crypto";
10027
10051
  import { z as z2 } from "zod";
@@ -10112,7 +10136,7 @@ function readPluginManifest(manifestPath) {
10112
10136
  }
10113
10137
  function findPluginSourceDir(inputPath) {
10114
10138
  const abs = resolve7(inputPath);
10115
- const direct = statSync6(abs).isDirectory() ? abs : dirname7(abs);
10139
+ const direct = statSync7(abs).isDirectory() ? abs : dirname7(abs);
10116
10140
  if (existsSync17(pluginManifestPath(direct))) return direct;
10117
10141
  const nested = join13(direct, ".aicli-plugin");
10118
10142
  if (existsSync17(join13(nested, "plugin.json"))) return direct;
@@ -10187,7 +10211,7 @@ function listInstalledPlugins(configDir) {
10187
10211
  for (const entry of readdirSync7(root)) {
10188
10212
  const dir = join13(root, entry);
10189
10213
  try {
10190
- if (!statSync6(dir).isDirectory()) continue;
10214
+ if (!statSync7(dir).isDirectory()) continue;
10191
10215
  } catch {
10192
10216
  continue;
10193
10217
  }
@@ -10232,7 +10256,7 @@ function uniqueDirs(plugin, rels) {
10232
10256
  for (const rel of rels) {
10233
10257
  const abs = resolve7(plugin.dir, rel);
10234
10258
  if (!abs.startsWith(resolve7(plugin.dir))) continue;
10235
- if (existsSync17(abs)) dirs.add(statSync6(abs).isDirectory() ? abs : dirname7(abs));
10259
+ if (existsSync17(abs)) dirs.add(statSync7(abs).isDirectory() ? abs : dirname7(abs));
10236
10260
  }
10237
10261
  return [...dirs];
10238
10262
  }
@@ -12613,7 +12637,7 @@ var McpManager = class {
12613
12637
  };
12614
12638
 
12615
12639
  // src/skills/manager.ts
12616
- import { existsSync as existsSync22, readdirSync as readdirSync10, mkdirSync as mkdirSync11, statSync as statSync7 } from "fs";
12640
+ import { existsSync as existsSync22, readdirSync as readdirSync10, mkdirSync as mkdirSync11, statSync as statSync8 } from "fs";
12617
12641
  import { join as join17 } from "path";
12618
12642
 
12619
12643
  // src/skills/types.ts
@@ -12709,7 +12733,7 @@ var SkillManager = class {
12709
12733
  filePath = fullPath;
12710
12734
  } else {
12711
12735
  try {
12712
- if (statSync7(fullPath).isDirectory()) {
12736
+ if (statSync8(fullPath).isDirectory()) {
12713
12737
  const skillMd = join17(fullPath, "SKILL.md");
12714
12738
  if (existsSync22(skillMd)) filePath = skillMd;
12715
12739
  else continue;
@@ -13637,7 +13661,7 @@ function loadContextFiles(options) {
13637
13661
  }
13638
13662
 
13639
13663
  // src/web/session-handler.ts
13640
- import { existsSync as existsSync29, readFileSync as readFileSync22, writeFileSync as writeFileSync3, mkdirSync as mkdirSync14, readdirSync as readdirSync13, statSync as statSync11, createWriteStream } from "fs";
13664
+ import { existsSync as existsSync29, readFileSync as readFileSync22, writeFileSync as writeFileSync3, mkdirSync as mkdirSync14, readdirSync as readdirSync13, statSync as statSync12, createWriteStream } from "fs";
13641
13665
  import { join as join24, resolve as resolve10, dirname as dirname8 } from "path";
13642
13666
 
13643
13667
  // src/cli/review-prompts.ts
@@ -13699,7 +13723,7 @@ If no security issues found, state "\u2705 No security vulnerabilities detected"
13699
13723
  }
13700
13724
 
13701
13725
  // src/repl/commands/project-init.ts
13702
- import { existsSync as existsSync26, readFileSync as readFileSync20, readdirSync as readdirSync11, statSync as statSync8 } from "fs";
13726
+ import { existsSync as existsSync26, readFileSync as readFileSync20, readdirSync as readdirSync11, statSync as statSync9 } from "fs";
13703
13727
  import { join as join20 } from "path";
13704
13728
  var SCAN_SKIP_DIRS = /* @__PURE__ */ new Set([
13705
13729
  "node_modules",
@@ -13744,11 +13768,11 @@ function scanDirTree(dir, maxDepth = 2, maxEntries = 80) {
13744
13768
  const sorted = filtered.sort((a, b) => {
13745
13769
  let aIsDir = false, bIsDir = false;
13746
13770
  try {
13747
- aIsDir = statSync8(join20(d, a)).isDirectory();
13771
+ aIsDir = statSync9(join20(d, a)).isDirectory();
13748
13772
  } catch {
13749
13773
  }
13750
13774
  try {
13751
- bIsDir = statSync8(join20(d, b)).isDirectory();
13775
+ bIsDir = statSync9(join20(d, b)).isDirectory();
13752
13776
  } catch {
13753
13777
  }
13754
13778
  if (aIsDir !== bIsDir) return aIsDir ? -1 : 1;
@@ -13761,7 +13785,7 @@ function scanDirTree(dir, maxDepth = 2, maxEntries = 80) {
13761
13785
  const connector = isLast ? "+-- " : "|-- ";
13762
13786
  let isDir;
13763
13787
  try {
13764
- isDir = statSync8(fullPath).isDirectory();
13788
+ isDir = statSync9(fullPath).isDirectory();
13765
13789
  } catch {
13766
13790
  continue;
13767
13791
  }
@@ -14284,7 +14308,7 @@ var DiscussionOrchestrator = class {
14284
14308
  };
14285
14309
 
14286
14310
  // src/diagnostics/doctor-report.ts
14287
- import { existsSync as existsSync28, statSync as statSync10 } from "fs";
14311
+ import { existsSync as existsSync28, statSync as statSync11 } from "fs";
14288
14312
  import { join as join22 } from "path";
14289
14313
  import { arch as arch2, platform as platform6, release as release2 } from "os";
14290
14314
 
@@ -14294,7 +14318,7 @@ import {
14294
14318
  mkdirSync as mkdirSync13,
14295
14319
  readdirSync as readdirSync12,
14296
14320
  readFileSync as readFileSync21,
14297
- statSync as statSync9,
14321
+ statSync as statSync10,
14298
14322
  unlinkSync as unlinkSync6,
14299
14323
  writeFileSync as writeFileSync2
14300
14324
  } from "fs";
@@ -14323,7 +14347,7 @@ function listRecentCrashes(limit = 10, configDir) {
14323
14347
  if (!name.startsWith(CRASH_LOG_PREFIX) || !name.endsWith(".log")) continue;
14324
14348
  const full = join21(dir, name);
14325
14349
  try {
14326
- const st = statSync9(full);
14350
+ const st = statSync10(full);
14327
14351
  const head = readFileSync21(full, "utf-8").split("\n").slice(0, 20);
14328
14352
  const tsLine = head.find((l) => l.startsWith("timestamp:"));
14329
14353
  const kindLine = head.find((l) => l.startsWith("kind:"));
@@ -14364,7 +14388,7 @@ function getConfigDirUsage(configDir) {
14364
14388
  }
14365
14389
  function dirSize(path3) {
14366
14390
  try {
14367
- const st = statSync9(path3);
14391
+ const st = statSync10(path3);
14368
14392
  if (st.isFile()) return st.size;
14369
14393
  if (!st.isDirectory()) return 0;
14370
14394
  let sum = 0;
@@ -14383,7 +14407,7 @@ function checkFile(label, path3) {
14383
14407
  let sizeBytes = null;
14384
14408
  if (exists) {
14385
14409
  try {
14386
- sizeBytes = statSync10(path3).size;
14410
+ sizeBytes = statSync11(path3).size;
14387
14411
  } catch {
14388
14412
  }
14389
14413
  }
@@ -16962,7 +16986,7 @@ ${undoResults.map((r) => ` \u2022 ${r}`).join("\n")}` });
16962
16986
  case "test": {
16963
16987
  this.send({ type: "info", message: "\u{1F9EA} Running tests..." });
16964
16988
  try {
16965
- const { executeTests } = await import("./run-tests-GK5AIAV2.js");
16989
+ const { executeTests } = await import("./run-tests-55JGEZYL.js");
16966
16990
  const argStr = args.join(" ").trim();
16967
16991
  let testArgs = {};
16968
16992
  if (argStr) {
@@ -17178,7 +17202,7 @@ Use /add-dir remove to clear.` : "No directories added.\nUsage: /add-dir <path>
17178
17202
  this.send({ type: "error", message: `Directory not found: ${dirPath}` });
17179
17203
  break;
17180
17204
  }
17181
- if (!statSync11(dirPath).isDirectory()) {
17205
+ if (!statSync12(dirPath).isDirectory()) {
17182
17206
  this.send({ type: "error", message: `Not a directory: ${dirPath}` });
17183
17207
  break;
17184
17208
  }
@@ -17385,7 +17409,8 @@ Add .md files to create commands.` });
17385
17409
  messageCount: s.messageCount,
17386
17410
  updated: s.updated instanceof Date ? s.updated.toISOString() : String(s.updated),
17387
17411
  isCurrent: s.id === this.sessions.current?.id
17388
- }))
17412
+ })),
17413
+ totalCount: list.length
17389
17414
  });
17390
17415
  }
17391
17416
  sendToolsList() {
@@ -18315,18 +18340,22 @@ async function startWebServer(options = {}) {
18315
18340
  const authUser = req._authUser;
18316
18341
  const sm = authUser ? getUserShared(authUser).sessions : sessions;
18317
18342
  const list = sm.listSessions();
18343
+ const all = req.query.all === "true";
18344
+ const limit = all ? -1 : Number(req.query.limit) || 50;
18345
+ const sliced = limit > 0 ? list.slice(0, limit) : list;
18318
18346
  res.json({
18319
- sessions: list.slice(0, 50).map((s) => ({
18347
+ sessions: sliced.map((s) => ({
18320
18348
  id: s.id,
18321
18349
  title: s.title,
18322
18350
  provider: s.provider,
18323
18351
  model: s.model,
18324
18352
  messageCount: s.messageCount,
18325
18353
  updated: s.updated
18326
- }))
18354
+ })),
18355
+ totalCount: list.length
18327
18356
  });
18328
18357
  } catch {
18329
- res.json({ sessions: [] });
18358
+ res.json({ sessions: [], totalCount: 0 });
18330
18359
  }
18331
18360
  });
18332
18361
  app.get("/api/sessions/:id/replay", requireAuth, (req, res) => {
@@ -18380,7 +18409,7 @@ async function startWebServer(options = {}) {
18380
18409
  return;
18381
18410
  }
18382
18411
  try {
18383
- const stat = statSync12(fullPath);
18412
+ const stat = statSync13(fullPath);
18384
18413
  if (stat.size > 512 * 1024) {
18385
18414
  res.json({ error: `File too large (${(stat.size / 1024).toFixed(0)} KB, max 512 KB)` });
18386
18415
  return;
@@ -139,7 +139,7 @@ ${content}`);
139
139
  const state = await runDiscussion(config, providers, options.topic);
140
140
  if (options.save !== false && state.messages.length > 0) {
141
141
  try {
142
- const { persistDiscussion } = await import("./persist-L54DPLI7.js");
142
+ const { persistDiscussion } = await import("./persist-GTBEKVFL.js");
143
143
  const { path } = await persistDiscussion(state, configManager, defaultProvider, defaultModel);
144
144
  console.log(chalk.dim(`
145
145
  \u{1F4BE} Saved to history \u2014 open it in the Web UI and hit \u{1F3AC} to replay.
@@ -154,7 +154,7 @@ ${content}`);
154
154
  }
155
155
  }
156
156
  async function runTaskMode(config, providers, configManager, topic) {
157
- const { TaskOrchestrator } = await import("./task-orchestrator-JMHPVNUO.js");
157
+ const { TaskOrchestrator } = await import("./task-orchestrator-F3DUIACA.js");
158
158
  const orchestrator = new TaskOrchestrator(config, providers, configManager);
159
159
  let interrupted = false;
160
160
  const onSigint = () => {