@tekmidian/pai 0.9.15 → 0.9.16

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.
@@ -4,13 +4,13 @@ import { _ as warn, a as fmtDate, c as ok, d as scaffoldProjectDirs, f as shorte
4
4
  import { a as slugify$1, i as parseSessionFilename } from "../migrate-fLD6rAdO.mjs";
5
5
  import { n as ensurePaiMarker } from "../pai-marker-CXQPX2P6.mjs";
6
6
  import { n as openFederation } from "../db-CYmBWcjh.mjs";
7
- import "../helpers-OCVFgprQ.mjs";
8
- import { i as indexProject, n as indexAll, t as embedChunks } from "../sync-CdHSL9Kc.mjs";
7
+ import "../helpers-crDEr6S2.mjs";
8
+ import { i as indexProject, n as indexAll, t as embedChunks } from "../sync-CmBKOL3K.mjs";
9
9
  import "../embeddings-DGRAPAYb.mjs";
10
10
  import { t as STOP_WORDS } from "../stop-words-BaMEGVeY.mjs";
11
11
  import { n as populateSlugs, r as searchMemory } from "../search-i2nlQ-JM.mjs";
12
12
  import { n as formatDetection, r as formatDetectionJson, t as detectProject } from "../detect-CdaA48EI.mjs";
13
- import { a as resolveHome, c as upsertSession, n as cmdScan, o as saveScanConfig, r as loadScanConfig, s as upsertProject, t as extractAndStoreTriples } from "../kg-extraction-r5KkTmWY.mjs";
13
+ import { a as resolveHome, c as upsertSession, n as cmdScan, o as saveScanConfig, r as loadScanConfig, s as upsertProject, t as extractAndStoreTriples } from "../kg-extraction-iR1BKKWK.mjs";
14
14
  import "../indexer-D7MvSQPY.mjs";
15
15
  import { t as PaiClient } from "../ipc-client-C3pjwy2m.mjs";
16
16
  import { a as expandHome, i as ensureConfigDir, n as CONFIG_FILE$2, o as loadConfig, t as CONFIG_DIR } from "../config-DqBY3aT0.mjs";
@@ -2470,8 +2470,10 @@ function fmtStatus(status) {
2470
2470
  case "orphan": return chalk.dim("orphan");
2471
2471
  }
2472
2472
  }
2473
- function renderLiveSessions(liveSessions) {
2474
- if (liveSessions.length === 0) return;
2473
+ function renderLiveSessions(allLiveSessions) {
2474
+ const claudeSessions = allLiveSessions.filter((s) => s.paiName !== null && s.paiName !== void 0 && s.paiName !== "");
2475
+ const skippedCount = allLiveSessions.length - claudeSessions.length;
2476
+ if (claudeSessions.length === 0) return;
2475
2477
  console.log("\n" + header("Live Sessions") + "\n");
2476
2478
  const liveHeaders = [
2477
2479
  "#",
@@ -2480,10 +2482,10 @@ function renderLiveSessions(liveSessions) {
2480
2482
  "at prompt",
2481
2483
  "paiName"
2482
2484
  ];
2483
- const liveRows = liveSessions.map((s, idx) => {
2485
+ const liveRows = claudeSessions.map((s, idx) => {
2484
2486
  const shortId = s.sessionId.slice(0, 8);
2485
2487
  const name = s.name.length > 32 ? s.name.slice(0, 31) + "…" : s.name;
2486
- const paiName = s.paiName ? s.paiName.length > 20 ? s.paiName.slice(0, 19) + "…" : s.paiName : dim("—");
2488
+ const paiName = s.paiName.length > 20 ? s.paiName.slice(0, 19) + "…" : s.paiName;
2487
2489
  const atPrompt = s.atPrompt ? chalk.green("yes") : chalk.yellow("busy");
2488
2490
  return [
2489
2491
  chalk.dim(String(idx + 1)),
@@ -2494,6 +2496,7 @@ function renderLiveSessions(liveSessions) {
2494
2496
  ];
2495
2497
  });
2496
2498
  console.log(renderTable(liveHeaders, liveRows));
2499
+ if (skippedCount > 0) console.log(dim(` (${skippedCount} non-Claude tab${skippedCount === 1 ? "" : "s"} hidden — use pai pause all to see full list)`));
2497
2500
  }
2498
2501
  async function cmdRecent(db, opts) {
2499
2502
  const limit = parseInt(opts.n ?? "20", 10);
@@ -2530,9 +2533,10 @@ async function cmdRecent(db, opts) {
2530
2533
  console.log(JSON.stringify(output, null, 2));
2531
2534
  return;
2532
2535
  }
2536
+ const hasClaudeLive = liveSessions.some((s) => s.paiName !== null && s.paiName !== void 0 && s.paiName !== "");
2533
2537
  if (liveSessions.length > 0) renderLiveSessions(liveSessions);
2534
2538
  if (sessions.length === 0) {
2535
- if (liveSessions.length === 0) if (includeAll) console.log(err("No sessions found in ~/.claude/projects/."));
2539
+ if (!hasClaudeLive) if (includeAll) console.log(err("No sessions found in ~/.claude/projects/."));
2536
2540
  else console.log(err("No named sessions found.\n\n Named sessions appear when you have entries in ~/.claude/session.json\n (set via /Name inside Claude Code) or resumable top-level jsonl files.\n Run: pai session recent --all to list all sessions including unnamed orphans."));
2537
2541
  return;
2538
2542
  }
@@ -2563,7 +2567,7 @@ async function cmdRecent(db, opts) {
2563
2567
  ];
2564
2568
  });
2565
2569
  console.log(renderTable(headers, rows));
2566
- console.log("\n" + dim("Go to a session: ") + chalk.white("pai resume <name>") + "\n" + (liveSessions.length > 0 ? dim("Pause all live: ") + chalk.white("pai pause all") + "\n" : "") + (includeAll ? "" : dim("Show all sessions: ") + chalk.white("pai sessions --all") + "\n"));
2570
+ console.log("\n" + dim("Go to a session: ") + chalk.white("pai resume <name>") + "\n" + (hasClaudeLive ? dim("Pause all live: ") + chalk.white("pai pause all") + "\n" : "") + (includeAll ? "" : dim("Show all sessions: ") + chalk.white("pai sessions --all") + "\n"));
2567
2571
  }
2568
2572
 
2569
2573
  //#endregion
@@ -4697,7 +4701,7 @@ function cmdLogs(opts) {
4697
4701
  }
4698
4702
  function registerDaemonCommands(daemonCmd) {
4699
4703
  daemonCmd.command("serve").description("Start the PAI daemon in the foreground").action(async () => {
4700
- const { serve } = await import("../daemon-B-vBWU1i.mjs").then((n) => n.t);
4704
+ const { serve } = await import("../daemon-CSKj8Xm9.mjs").then((n) => n.t);
4701
4705
  const { loadConfig: lc, ensureConfigDir } = await import("../config-DqBY3aT0.mjs").then((n) => n.r);
4702
4706
  ensureConfigDir();
4703
4707
  await serve(lc());