@tekmidian/pai 0.60.0 → 0.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/{chain-DFlzAfDE.mjs → chain-C5oeyUg4.mjs} +4 -4
  2. package/dist/{chain-DFlzAfDE.mjs.map → chain-C5oeyUg4.mjs.map} +1 -1
  3. package/dist/cli/index.mjs +12 -12
  4. package/dist/cli/program.mjs +12 -12
  5. package/dist/{config-msER8xj_.mjs → config-CQCmH_gV.mjs} +2 -1
  6. package/dist/config-CQCmH_gV.mjs.map +1 -0
  7. package/dist/{config-GceCMUxa.mjs → config-DjXq_W42.mjs} +1 -1
  8. package/dist/{context-handover-cache-DF0xWVB0.mjs → context-handover-cache-BdtJZpgv.mjs} +4 -4
  9. package/dist/{context-handover-cache-DF0xWVB0.mjs.map → context-handover-cache-BdtJZpgv.mjs.map} +1 -1
  10. package/dist/daemon/index.mjs +11 -11
  11. package/dist/{daemon-DArRKBlk.mjs → daemon-DSsIEqzW.mjs} +26 -19
  12. package/dist/{daemon-DArRKBlk.mjs.map → daemon-DSsIEqzW.mjs.map} +1 -1
  13. package/dist/daemon-MoFF4oeg.mjs +19 -0
  14. package/dist/daemon-mcp/index.mjs +9 -11
  15. package/dist/daemon-mcp/index.mjs.map +1 -1
  16. package/dist/{factory-D6I2jmjQ.mjs → factory-DW7BCJJT.mjs} +1 -1
  17. package/dist/{factory-ChfAvCzO.mjs → factory-EUUhSSoq.mjs} +5 -6
  18. package/dist/factory-EUUhSSoq.mjs.map +1 -0
  19. package/dist/{fallback-B7VEMMRn.mjs → fallback-DDbJVaR8.mjs} +12 -14
  20. package/dist/{fallback-B7VEMMRn.mjs.map → fallback-DDbJVaR8.mjs.map} +1 -1
  21. package/dist/hooks/block-sleep-poll.mjs.map +2 -2
  22. package/dist/hooks/context-compression-hook.mjs.map +1 -1
  23. package/dist/hooks/post-compact-inject.mjs.map +1 -1
  24. package/dist/hooks/route-agents-to-worker.mjs +5 -5
  25. package/dist/hooks/route-agents-to-worker.mjs.map +3 -3
  26. package/dist/hooks/security-validator.mjs +60 -60
  27. package/dist/hooks/security-validator.mjs.map +3 -3
  28. package/dist/hooks/stop-hook.mjs +15 -15
  29. package/dist/hooks/stop-hook.mjs.map +3 -3
  30. package/dist/hooks/update-tab-on-action.mjs +14 -12
  31. package/dist/hooks/update-tab-on-action.mjs.map +3 -3
  32. package/dist/hooks/update-tab-titles.mjs +13 -9
  33. package/dist/hooks/update-tab-titles.mjs.map +3 -3
  34. package/dist/hooks/whisper-rules.mjs +2 -2
  35. package/dist/hooks/whisper-rules.mjs.map +3 -3
  36. package/dist/hooks/worker-proxy.mjs +5 -5
  37. package/dist/hooks/worker-proxy.mjs.map +3 -3
  38. package/dist/hooks/worker-status-line.mjs +5 -5
  39. package/dist/hooks/worker-status-line.mjs.map +3 -3
  40. package/dist/hooks/worker-supervision.mjs +5 -5
  41. package/dist/hooks/worker-supervision.mjs.map +3 -3
  42. package/dist/main-resolver-CxOsxtOr.mjs +7 -0
  43. package/dist/{main-resolver-BqTjt-GL.mjs → main-resolver-DIQ6m_RA.mjs} +4 -4
  44. package/dist/{main-resolver-BqTjt-GL.mjs.map → main-resolver-DIQ6m_RA.mjs.map} +1 -1
  45. package/dist/{planner-DbpsMZqY.mjs → planner-D8jAr_sx.mjs} +7 -7
  46. package/dist/{planner-DbpsMZqY.mjs.map → planner-D8jAr_sx.mjs.map} +1 -1
  47. package/dist/{program-QSuci3RH.mjs → program-BTdspOOa.mjs} +131 -81
  48. package/dist/program-BTdspOOa.mjs.map +1 -0
  49. package/dist/{run-BFxuNnIJ.mjs → run-CxxZKEZw.mjs} +336 -174
  50. package/dist/run-CxxZKEZw.mjs.map +1 -0
  51. package/dist/{run-env-kbWVwUvU.mjs → run-env-BE5xyCwy.mjs} +26 -7
  52. package/dist/run-env-BE5xyCwy.mjs.map +1 -0
  53. package/dist/{server-B0vBmfJt.mjs → server-BY6AedmC.mjs} +2 -2
  54. package/dist/{server-B0vBmfJt.mjs.map → server-BY6AedmC.mjs.map} +1 -1
  55. package/dist/{session-keepalive-CUcFa8ld.mjs → session-keepalive-urk--pfa.mjs} +5 -5
  56. package/dist/{session-keepalive-CUcFa8ld.mjs.map → session-keepalive-urk--pfa.mjs.map} +1 -1
  57. package/dist/{tools-CaTZnIau.mjs → tools-qXyHFwNj.mjs} +2 -2
  58. package/dist/{tools-CaTZnIau.mjs.map → tools-qXyHFwNj.mjs.map} +1 -1
  59. package/dist/{tools-_7MF8Ebb.mjs → tools-r-7ZG8B5.mjs} +3 -3
  60. package/dist/{wakeup-CTX3rlz-.mjs → wakeup-C48hcN6O.mjs} +2 -2
  61. package/dist/{wakeup-CTX3rlz-.mjs.map → wakeup-C48hcN6O.mjs.map} +1 -1
  62. package/dist/work-queue-worker-1_VBfI_k.mjs +11 -0
  63. package/dist/{work-queue-worker-B4eZGy5n.mjs → work-queue-worker-DUvPiwGO.mjs} +2 -2
  64. package/dist/{work-queue-worker-B4eZGy5n.mjs.map → work-queue-worker-DUvPiwGO.mjs.map} +1 -1
  65. package/docs/commands/worker.md +1 -0
  66. package/package.json +1 -1
  67. package/src/hooks/ts/lib/tab-title.ts +18 -0
  68. package/src/hooks/ts/post-tool-use/update-tab-on-action.ts +3 -20
  69. package/src/hooks/ts/stop/stop-hook.ts +4 -15
  70. package/src/hooks/ts/user-prompt/update-tab-titles.ts +2 -10
  71. package/dist/config-msER8xj_.mjs.map +0 -1
  72. package/dist/daemon-BppwJtrH.mjs +0 -19
  73. package/dist/factory-ChfAvCzO.mjs.map +0 -1
  74. package/dist/main-resolver-CCojcYr2.mjs +0 -7
  75. package/dist/program-QSuci3RH.mjs.map +0 -1
  76. package/dist/run-BFxuNnIJ.mjs.map +0 -1
  77. package/dist/run-env-kbWVwUvU.mjs.map +0 -1
  78. package/dist/work-queue-worker-DuhZmfDB.mjs +0 -11
@@ -3,27 +3,27 @@ import { a as slugify$1, i as parseSessionFilename } from "./migrate-BD7D8EEh.mj
3
3
  import { n as ensurePaiMarker } from "./pai-marker-D1MMswkz.mjs";
4
4
  import { t as STOP_WORDS } from "./stop-words-ClCwO8mZ.mjs";
5
5
  import { t as applyRecencyBoost } from "./search-BaTbyWjK.mjs";
6
- import { a as getStorageBackend, i as getRegistryBackend, r as createStorageBackend, s as humanDuration } from "./factory-ChfAvCzO.mjs";
7
- import { a as formatDetectionJson, i as formatDetection, n as migrateIdentityFile, r as detectProject } from "./wakeup-CTX3rlz-.mjs";
8
- import { B as claudeProjectsDir, C as findLatestNote, H as scanTranscriptFolders, I as resolveHome, L as saveScanConfig, M as cmdScan, N as loadScanConfig, P as migrateScanConfig, R as upsertProject, S as applyContinue, T as readBodyFile, U as transcriptFiles, V as findMovedProjects, d as migrateWorkQueue, g as migrateSummaryCooldowns, t as readContextHandoverCache, v as extractAndStoreTriples, w as findNotesDir$1, x as appendCheckpointToNote, z as upsertSession } from "./context-handover-cache-DF0xWVB0.mjs";
6
+ import { a as getStorageBackend, i as getRegistryBackend, r as createStorageBackend, s as humanDuration } from "./factory-EUUhSSoq.mjs";
7
+ import { a as formatDetectionJson, i as formatDetection, n as migrateIdentityFile, r as detectProject } from "./wakeup-C48hcN6O.mjs";
8
+ import { B as claudeProjectsDir, C as findLatestNote, H as scanTranscriptFolders, I as resolveHome, L as saveScanConfig, M as cmdScan, N as loadScanConfig, P as migrateScanConfig, R as upsertProject, S as applyContinue, T as readBodyFile, U as transcriptFiles, V as findMovedProjects, d as migrateWorkQueue, g as migrateSummaryCooldowns, t as readContextHandoverCache, v as extractAndStoreTriples, w as findNotesDir$1, x as appendCheckpointToNote, z as upsertSession } from "./context-handover-cache-BdtJZpgv.mjs";
9
9
  import { a as paiHomePath, i as paiHomeDir, n as migratePaiDir, o as resolvePaiFile, r as migratePaiFile, t as PaiFileMigrationError } from "./pai-home-CeOIYltV.mjs";
10
- import { b as OWNER_LABEL_PREFIX, c as migrateConfigFile, d as readMainConfigRaw, f as writeMainConfigRaw, h as resolvedMainConfigPath, l as paiConfigFilePath, m as migrateMainConfigToYaml, n as CONFIG_FILE$2, o as expandHome, p as MainConfigError, s as loadConfig, t as CONFIG_DIR, u as paiConfigYamlFilePath, v as readJsonStrict, x as UNROUTED, y as writeJsonAtomic } from "./config-msER8xj_.mjs";
10
+ import { b as OWNER_LABEL_PREFIX, c as migrateConfigFile, d as readMainConfigRaw, f as writeMainConfigRaw, h as resolvedMainConfigPath, l as paiConfigFilePath, m as migrateMainConfigToYaml, n as CONFIG_FILE$2, o as expandHome, p as MainConfigError, s as loadConfig, t as CONFIG_DIR, u as paiConfigYamlFilePath, v as readJsonStrict, x as UNROUTED, y as writeJsonAtomic } from "./config-CQCmH_gV.mjs";
11
11
  import { a as schedulerLogPath, i as paiSocketPath, n as daemonLogPath, r as daemonPidPath } from "./runtime-paths-BRwDeBEg.mjs";
12
- import { A as initWorkersYaml, B as stripModelVariant, F as relocateWorkersYaml, I as workersYamlLegacyNotice, L as workersYamlPath, M as migrateWorkersToYaml, N as needsWorkersYamlRelocation, P as parseWorkersYamlDocument, R as DEFAULT_CONTEXT_WINDOW, S as nativeAnthropicProvider, T as readWorkersSection, _ as expandHome$1, d as PROVIDER_TAGS, j as inlineWorkersYamlKeys, p as WorkersConfigError, r as ANTHROPIC_NATIVE, t as buildRunEnv, u as MODEL_CAPABILITIES, v as getProviderOrNative, x as maskKey, y as isModelCapability, z as contextWindowFromModelId } from "./run-env-kbWVwUvU.mjs";
13
- import { A as UNLABELED, E as mergeWorker, G as waitForTerminalStatus, H as ownsPid, I as isChatPane, K as longInlinePromptHint, L as isLive, O as appendLedger, R as loadStatus, U as saveStatus, W as setWorkerLabel, X as expandMcpNames, Y as describeMcp, a as projectLaunchConfig, c as handoffFromInside, f as checkPaneForWorker, g as markControlsHeld, h as clickrControlsArgv, i as usageContextTokens, m as openPaneForWorker, n as runWorker, o as parseWorkerReport, p as openFollowPane, q as parseRunnerArgs, r as testProvider, u as sayToWorker, w as discardWorker, z as loadStatuses } from "./run-BFxuNnIJ.mjs";
12
+ import { B as contextWindowFromModelId, C as nativeAnthropicProvider, E as readWorkersSection, F as parseWorkersYamlDocument, I as relocateWorkersYaml, L as workersYamlLegacyNotice, M as inlineWorkersYamlKeys, N as migrateWorkersToYaml, P as needsWorkersYamlRelocation, R as workersYamlPath, S as maskKey, V as stripModelVariant, b as isModelCapability, f as PROVIDER_TAGS, j as initWorkersYaml, m as WorkersConfigError, r as ANTHROPIC_NATIVE, t as buildRunEnv, u as MODEL_CAPABILITIES, v as expandHome$1, y as getProviderOrNative, z as DEFAULT_CONTEXT_WINDOW } from "./run-env-BE5xyCwy.mjs";
13
+ import { A as UNLABELED, E as mergeWorker, G as waitForTerminalStatus, H as ownsPid, I as isChatPane, K as longInlinePromptHint, L as isLive, O as appendLedger, R as loadStatus, U as saveStatus, W as setWorkerLabel, X as expandMcpNames, Y as describeMcp, a as projectLaunchConfig, c as handoffFromInside, f as checkPaneForWorker, g as markControlsHeld, h as clickrControlsArgv, i as usageContextTokens, m as openPaneForWorker, n as runWorker, o as parseWorkerReport, p as openFollowPane, q as parseRunnerArgs, r as testProvider, u as sayToWorker, w as discardWorker, z as loadStatuses } from "./run-CxxZKEZw.mjs";
14
14
  import { t as MergeError } from "./merge-xoyfZQ4W.mjs";
15
15
  import { n as oldFederationPath, t as federationDbPath } from "./federation-db-w8e-sKjp.mjs";
16
16
  import { r as registryDbPath, t as oldRegistryPath } from "./registry-db-Bkpbp7Gf.mjs";
17
17
  import { i as indexProjectWithBackend } from "./async-CLvuY7b-.mjs";
18
18
  import { t as PaiClient } from "./ipc-client-Dasm515c.mjs";
19
- import { A as getConfigValueOp, C as psOutput, D as resolveSpecPath, E as readSpecPrompt, M as setConfigValueOp, N as unsetConfigValueOp, O as MainConfigOpsError, S as followWorkers, T as statusLineOutput, _ as setWorkersEnabled, a as addProvider, b as updateProvider, c as describeModels, d as removeProvider, f as resolveProviderName, g as setProviderModel, h as setProviderEnabled, i as fallbackStatusText, j as listConfigOp, k as formatConfigGetOutput, l as describeProviders, m as setClass, n as fallbackOn, o as classTargetText, p as setCapabilityPreference, r as fallbackStatus, s as describeCapabilities, t as fallbackOff, u as modelPrefsText, v as unsetCapabilityPreference, w as replayOutput, x as useProvider, y as unsetClass } from "./fallback-B7VEMMRn.mjs";
20
- import { _ as resolveSessionByNameOrId, a as buildDeduped, c as hasConversation, d as providerResumePlan, f as restoreTopLevel, g as migrateSessionScanCache, h as fmtAge, l as launchInDir, m as printExitDir, o as normalizeName$2, p as resumeArgvText, s as renderDedupedSessions, t as cmdMain, u as launchPrompt, v as scanCacheFilePath, y as scanSessions } from "./main-resolver-BqTjt-GL.mjs";
19
+ import { A as getConfigValueOp, C as psOutput, D as resolveSpecPath, E as readSpecPrompt, M as setConfigValueOp, N as unsetConfigValueOp, O as MainConfigOpsError, S as followWorkers, T as statusLineOutput, _ as setWorkersEnabled, a as addProvider, b as updateProvider, c as describeModels, d as removeProvider, f as resolveProviderName, g as setProviderModel, h as setProviderEnabled, i as fallbackStatusText, j as listConfigOp, k as formatConfigGetOutput, l as describeProviders, m as setClass, n as fallbackOn, o as classTargetText, p as setCapabilityPreference, r as fallbackStatus, s as describeCapabilities, t as fallbackOff, u as modelPrefsText, v as unsetCapabilityPreference, w as replayOutput, x as useProvider, y as unsetClass } from "./fallback-DDbJVaR8.mjs";
20
+ import { _ as resolveSessionByNameOrId, a as buildDeduped, c as hasConversation, d as providerResumePlan, f as restoreTopLevel, g as migrateSessionScanCache, h as fmtAge, l as launchInDir, m as printExitDir, o as normalizeName$2, p as resumeArgvText, s as renderDedupedSessions, t as cmdMain, u as launchPrompt, v as scanCacheFilePath, y as scanSessions } from "./main-resolver-DIQ6m_RA.mjs";
21
21
  import { n as queriesDirPath, t as migrateQueriesDir } from "./query-feedback-xz5axTj3.mjs";
22
- import { h as ledgerPath, m as eventsPath, n as ensureProxyRunning, p as ensureNoMcpConfig, r as stopProxy, t as DEFAULT_PROXY_PORT, v as workersLogDir } from "./server-B0vBmfJt.mjs";
22
+ import { h as ledgerPath, m as eventsPath, n as ensureProxyRunning, p as ensureNoMcpConfig, r as stopProxy, t as DEFAULT_PROXY_PORT, v as workersLogDir } from "./server-BY6AedmC.mjs";
23
23
  import { i as sendToSession, n as fetchLiveSessions, r as revealItermSession, t as callAiBroker } from "./aibroker-client-BK1h--W_.mjs";
24
- import { a as totalUsageTokens, i as parseSessionUsage, r as sessionKeepaliveLedgerSummary, t as loadSessionKeepaliveState } from "./session-keepalive-CUcFa8ld.mjs";
25
- import { t as runChain } from "./chain-DFlzAfDE.mjs";
26
- import { appendFileSync, chmodSync, copyFileSync, cpSync, createReadStream, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, statSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
24
+ import { a as totalUsageTokens, i as parseSessionUsage, r as sessionKeepaliveLedgerSummary, t as loadSessionKeepaliveState } from "./session-keepalive-urk--pfa.mjs";
25
+ import { t as runChain } from "./chain-C5oeyUg4.mjs";
26
+ import { appendFileSync, chmodSync, closeSync, copyFileSync, cpSync, createReadStream, existsSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, statSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
27
27
  import { homedir, platform, tmpdir, userInfo } from "node:os";
28
28
  import { basename, dirname, join, relative, resolve, sep } from "node:path";
29
29
  import chalk from "chalk";
@@ -161,7 +161,7 @@ async function cmdPromote(opts) {
161
161
  console.error(dim$1(` Pick a durable location for the new project.`));
162
162
  process.exit(1);
163
163
  }
164
- const { getRegistryBackend } = await import("./factory-D6I2jmjQ.mjs");
164
+ const { getRegistryBackend } = await import("./factory-DW7BCJJT.mjs");
165
165
  const registryBackend = await getRegistryBackend();
166
166
  const encodedDir = encodeDir(targetPath);
167
167
  if (await registryBackend.getProjectBySlug(slug) ?? await registryBackend.getProjectByRootPath(targetPath) ?? await registryBackend.getProjectByEncodedDir(encodedDir)) {
@@ -2035,7 +2035,7 @@ async function cmdUnregister(slug, opts = {}) {
2035
2035
  //#region src/cli/commands/project/projects-index.ts
2036
2036
  function registerProjectsCommands(projectsCmd) {
2037
2037
  projectsCmd.command("list", { isDefault: true }).description("Show the unified deduped listing (same as `pai`).\nUse --all to include cold / zero-session / archived projects.").option("--all", "Show all entries including cold / zero-session / archived projects").option("-n, --n <count>", "Max rows to show", "20").action(async (opts) => {
2038
- const { cmdMain } = await import("./main-resolver-CCojcYr2.mjs");
2038
+ const { cmdMain } = await import("./main-resolver-CxOsxtOr.mjs");
2039
2039
  await cmdMain(void 0, void 0, opts);
2040
2040
  });
2041
2041
  projectsCmd.command("list-raw").description("Raw registry listing with slug, path, status, last_active columns").option("--all", "Include archived projects (default: active only)").option("--status <status>", "Filter by status: active | archived").option("--tag <tag>", "Filter by tag").option("--type <type>", "Filter by type").action(async (opts) => {
@@ -2630,13 +2630,13 @@ function migrateFederationDbOrphan(dryRun) {
2630
2630
  if (existsSync(oldPath) && !dryRun) {
2631
2631
  let heldOpen = false;
2632
2632
  try {
2633
- execSync(`lsof "${oldPath}"`, { stdio: "pipe" });
2633
+ execFileSync("lsof", [oldPath], { stdio: "pipe" });
2634
2634
  heldOpen = true;
2635
2635
  } catch {}
2636
2636
  if (heldOpen) {
2637
2637
  console.log(" federation database (orphan): held open by the daemon — restarting it first");
2638
- execSync("pai daemon restart", { stdio: "inherit" });
2639
- execSync("sleep 2");
2638
+ execFileSync("pai", ["daemon", "restart"], { stdio: "inherit" });
2639
+ execFileSync("sleep", ["2"]);
2640
2640
  }
2641
2641
  }
2642
2642
  return migrateOrphanFederationDb({ dryRun });
@@ -2644,12 +2644,12 @@ function migrateFederationDbOrphan(dryRun) {
2644
2644
  function checkpointAndVerify(oldPath, newPath, label) {
2645
2645
  let hasSqlite3 = true;
2646
2646
  try {
2647
- execSync("command -v sqlite3", { stdio: "pipe" });
2647
+ execFileSync("which", ["sqlite3"], { stdio: "pipe" });
2648
2648
  } catch {
2649
2649
  hasSqlite3 = false;
2650
2650
  }
2651
2651
  if (hasSqlite3) try {
2652
- execSync(`sqlite3 "${oldPath}" "PRAGMA wal_checkpoint(TRUNCATE);"`, { stdio: "pipe" });
2652
+ execFileSync("sqlite3", [oldPath, "PRAGMA wal_checkpoint(TRUNCATE);"], { stdio: "pipe" });
2653
2653
  } catch {}
2654
2654
  const stamp = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10).replace(/-/g, "");
2655
2655
  for (const suffix of ["-wal", "-shm"]) {
@@ -2659,7 +2659,7 @@ function checkpointAndVerify(oldPath, newPath, label) {
2659
2659
  } catch {}
2660
2660
  }
2661
2661
  if (hasSqlite3) try {
2662
- const check = execSync(`sqlite3 "${newPath}" "PRAGMA integrity_check;"`, { stdio: "pipe" }).toString().trim();
2662
+ const check = execFileSync("sqlite3", [newPath, "PRAGMA integrity_check;"], { stdio: "pipe" }).toString().trim();
2663
2663
  if (check !== "ok") throw new PaiFileMigrationError(`${newPath}: PRAGMA integrity_check reported "${check}" — investigate before trusting this copy`);
2664
2664
  } catch (e) {
2665
2665
  if (e instanceof PaiFileMigrationError) throw e;
@@ -2682,13 +2682,13 @@ function migrateRegistryDbFile(dryRun) {
2682
2682
  if (!existsSync(oldPath) || dryRun) return migratePaiFile(newPath, [oldPath], { dryRun });
2683
2683
  let heldOpen = false;
2684
2684
  try {
2685
- execSync(`lsof "${oldPath}"`, { stdio: "pipe" });
2685
+ execFileSync("lsof", [oldPath], { stdio: "pipe" });
2686
2686
  heldOpen = true;
2687
2687
  } catch {}
2688
2688
  if (heldOpen) {
2689
2689
  console.log(" registry database: held open by the daemon — restarting it first");
2690
- execSync("pai daemon restart", { stdio: "inherit" });
2691
- execSync("sleep 2");
2690
+ execFileSync("pai", ["daemon", "restart"], { stdio: "inherit" });
2691
+ execFileSync("sleep", ["2"]);
2692
2692
  }
2693
2693
  const result = migratePaiFile(newPath, [oldPath], { dryRun: false });
2694
2694
  if (result.fromPath) checkpointAndVerify(oldPath, newPath, "registry database");
@@ -2711,13 +2711,13 @@ function migrateFederationDbFile(dryRun) {
2711
2711
  if (!existsSync(oldPath) || dryRun) return migratePaiFile(newPath, [oldPath], { dryRun });
2712
2712
  let heldOpen = false;
2713
2713
  try {
2714
- execSync(`lsof "${oldPath}"`, { stdio: "pipe" });
2714
+ execFileSync("lsof", [oldPath], { stdio: "pipe" });
2715
2715
  heldOpen = true;
2716
2716
  } catch {}
2717
2717
  if (heldOpen) {
2718
2718
  console.log(" federation database (live): held open by the daemon — restarting it first");
2719
- execSync("pai daemon restart", { stdio: "inherit" });
2720
- execSync("sleep 2");
2719
+ execFileSync("pai", ["daemon", "restart"], { stdio: "inherit" });
2720
+ execFileSync("sleep", ["2"]);
2721
2721
  }
2722
2722
  const result = migratePaiFile(newPath, [oldPath], { dryRun: false });
2723
2723
  if (result.fromPath) checkpointAndVerify(oldPath, newPath, "federation database");
@@ -3247,8 +3247,8 @@ function registerStatsCommands(memoryCmd) {
3247
3247
  //#region src/cli/commands/memory/sources-cmd.ts
3248
3248
  function registerSourcesCommand(memoryCmd) {
3249
3249
  memoryCmd.command("sources").description("Show what the indexer has taken in: composition by source, which roots\ncontent enters from, the heaviest single files, and how many chunks are\nrewritten per day (which distinguishes a finite backlog from a treadmill).").option("--limit <n>", "Rows per section (default 8)", "8").action(async (opts) => {
3250
- const { createStorageBackend } = await import("./factory-D6I2jmjQ.mjs");
3251
- const { loadConfig } = await import("./config-GceCMUxa.mjs");
3250
+ const { createStorageBackend } = await import("./factory-DW7BCJJT.mjs");
3251
+ const { loadConfig } = await import("./config-DjXq_W42.mjs");
3252
3252
  const { cmdMemorySources } = await import("./sources-BBe3AZ-W.mjs");
3253
3253
  let backend;
3254
3254
  try {
@@ -3950,7 +3950,7 @@ async function escalate(task, headline, detail, state, now, opts) {
3950
3950
  let delivered = false;
3951
3951
  try {
3952
3952
  const { routeNotification } = await import("./router-C5hPk9YP.mjs");
3953
- const { loadConfig } = await import("./config-GceCMUxa.mjs");
3953
+ const { loadConfig } = await import("./config-DjXq_W42.mjs");
3954
3954
  delivered = (await routeNotification({
3955
3955
  event: "error",
3956
3956
  title: `PAI: ${headline}`,
@@ -4752,15 +4752,29 @@ function registerBackupCommands(program) {
4752
4752
  const sqlDest = join(backupDir, "postgres-pai.sql");
4753
4753
  console.log(dim$1(` Running pg_dump on ${DOCKER_CONTAINER$1} (this may take a moment)...`));
4754
4754
  try {
4755
- execSync(`docker inspect ${DOCKER_CONTAINER$1} --format='{{.State.Status}}'`, { stdio: "pipe" });
4756
- execSync(`docker exec ${DOCKER_CONTAINER$1} pg_dump -U ${PG_USER$1} ${PG_DATABASE$1} > "${sqlDest}"`, {
4757
- stdio: [
4758
- "pipe",
4755
+ execFileSync("docker", [
4756
+ "inspect",
4757
+ DOCKER_CONTAINER$1,
4758
+ "--format={{.State.Status}}"
4759
+ ], { stdio: "pipe" });
4760
+ const sqlFd = openSync(sqlDest, "w");
4761
+ try {
4762
+ const dump = spawnSync("docker", [
4763
+ "exec",
4764
+ DOCKER_CONTAINER$1,
4765
+ "pg_dump",
4766
+ "-U",
4767
+ PG_USER$1,
4768
+ PG_DATABASE$1
4769
+ ], { stdio: [
4759
4770
  "pipe",
4771
+ sqlFd,
4760
4772
  "pipe"
4761
- ],
4762
- shell: true
4763
- });
4773
+ ] });
4774
+ if (dump.status !== 0) throw new Error(dump.stderr?.toString().trim() || `pg_dump exited with code ${dump.status}`);
4775
+ } finally {
4776
+ closeSync(sqlFd);
4777
+ }
4764
4778
  results.push({
4765
4779
  label: "Postgres DB",
4766
4780
  path: sqlDest,
@@ -5650,7 +5664,7 @@ function cmdOpen(opts) {
5650
5664
  const url = `obsidian://open?vault=${encodeURIComponent(vaultName)}`;
5651
5665
  console.log(dim$1(` Opening: ${url}`));
5652
5666
  try {
5653
- execSync(`open "${url}"`, { stdio: "ignore" });
5667
+ execFileSync("open", [url], { stdio: "ignore" });
5654
5668
  console.log(ok$1(` Opened vault "${vaultName}" in Obsidian.`));
5655
5669
  } catch (e) {
5656
5670
  console.error(err(` Failed to open Obsidian: ${e}`));
@@ -7038,10 +7052,19 @@ function cmdLogs(opts) {
7038
7052
  return;
7039
7053
  }
7040
7054
  if (opts.follow) try {
7041
- execSync(`tail -f -n ${lines} "${DAEMON_LOG}"`, { stdio: "inherit" });
7055
+ execFileSync("tail", [
7056
+ "-f",
7057
+ "-n",
7058
+ lines,
7059
+ DAEMON_LOG
7060
+ ], { stdio: "inherit" });
7042
7061
  } catch {}
7043
7062
  else try {
7044
- execSync(`tail -n ${lines} "${DAEMON_LOG}"`, { stdio: "inherit" });
7063
+ execFileSync("tail", [
7064
+ "-n",
7065
+ lines,
7066
+ DAEMON_LOG
7067
+ ], { stdio: "inherit" });
7045
7068
  } catch (e) {
7046
7069
  const msg = e instanceof Error ? e.message : String(e);
7047
7070
  console.error(err(`Could not read log: ${msg}`));
@@ -7050,8 +7073,8 @@ function cmdLogs(opts) {
7050
7073
  }
7051
7074
  function registerDaemonCommands(daemonCmd) {
7052
7075
  daemonCmd.command("serve").description("Start the PAI daemon in the foreground").action(async () => {
7053
- const { serve } = await import("./daemon-BppwJtrH.mjs");
7054
- const { loadConfig: lc, ensureConfigDir } = await import("./config-GceCMUxa.mjs");
7076
+ const { serve } = await import("./daemon-MoFF4oeg.mjs");
7077
+ const { loadConfig: lc, ensureConfigDir } = await import("./config-DjXq_W42.mjs");
7055
7078
  ensureConfigDir();
7056
7079
  await serve(lc());
7057
7080
  });
@@ -7228,11 +7251,20 @@ function registerRestoreCommands(program) {
7228
7251
  if (hasSql && opts.postgres) {
7229
7252
  console.log(dim$1(" Restoring Postgres database (this may take a while)..."));
7230
7253
  try {
7231
- execSync(`docker inspect ${DOCKER_CONTAINER} --format='{{.State.Status}}'`, { stdio: "pipe" });
7232
- execSync(`docker exec ${DOCKER_CONTAINER} psql -U ${PG_USER} -c "DROP DATABASE IF EXISTS ${PG_DATABASE}; CREATE DATABASE ${PG_DATABASE} OWNER ${PG_USER};"`, {
7233
- stdio: "pipe",
7234
- shell: true
7235
- });
7254
+ execFileSync("docker", [
7255
+ "inspect",
7256
+ DOCKER_CONTAINER,
7257
+ "--format={{.State.Status}}"
7258
+ ], { stdio: "pipe" });
7259
+ execFileSync("docker", [
7260
+ "exec",
7261
+ DOCKER_CONTAINER,
7262
+ "psql",
7263
+ "-U",
7264
+ PG_USER,
7265
+ "-c",
7266
+ `DROP DATABASE IF EXISTS ${PG_DATABASE}; CREATE DATABASE ${PG_DATABASE} OWNER ${PG_USER};`
7267
+ ], { stdio: "pipe" });
7236
7268
  const sqlContent = readFileSync(join(resolvedDir, "postgres-pai.sql"), "utf8");
7237
7269
  const psqlResult = spawnSync("docker", [
7238
7270
  "exec",
@@ -9304,7 +9336,7 @@ async function stepTaskBus(rl) {
9304
9336
  if (await promptYesNo(rl, "Found TODOIST_API_KEY in the environment. Use it?", true)) apiKey = envToken;
9305
9337
  }
9306
9338
  while (!apiKey) {
9307
- apiKey = (await prompt$1(rl, " Paste your Todoist API token: ")).trim();
9339
+ apiKey = (await prompt$1(rl, " Paste your Todoist API token here: ")).trim();
9308
9340
  if (!apiKey) console.log(c.warn(" A token is required, or answer no to skip the task bus."));
9309
9341
  }
9310
9342
  line$1();
@@ -15574,20 +15606,32 @@ function pgDump(container, pgConfig, destPath) {
15574
15606
  const database = resolvePgDatabaseName(pgConfig);
15575
15607
  const user = pgConfig.user ?? "pai";
15576
15608
  mkdirSync(dirname(destPath), { recursive: true });
15609
+ const fd = openSync(destPath, "w");
15577
15610
  try {
15578
- execSync(`docker exec ${container} pg_dump -U ${user} -Fc ${database} > "${destPath}"`, {
15579
- stdio: [
15580
- "pipe",
15581
- "pipe",
15582
- "pipe"
15583
- ],
15584
- shell: true
15585
- });
15611
+ const dump = spawnSync("docker", [
15612
+ "exec",
15613
+ container,
15614
+ "pg_dump",
15615
+ "-U",
15616
+ user,
15617
+ "-Fc",
15618
+ database
15619
+ ], { stdio: [
15620
+ "pipe",
15621
+ fd,
15622
+ "pipe"
15623
+ ] });
15624
+ if (dump.status !== 0) return {
15625
+ ok: false,
15626
+ reason: `pg_dump failed: ${dump.stderr?.toString().trim() || `pg_dump exited with code ${dump.status}`}`
15627
+ };
15586
15628
  } catch (e) {
15587
15629
  return {
15588
15630
  ok: false,
15589
15631
  reason: `pg_dump failed: ${e instanceof Error ? e.message.split("\n")[0] : String(e)}`
15590
15632
  };
15633
+ } finally {
15634
+ closeSync(fd);
15591
15635
  }
15592
15636
  if (!existsSync(destPath) || statSync(destPath).size === 0) return {
15593
15637
  ok: false,
@@ -16613,7 +16657,7 @@ async function getSessionTags(registryBackend, sessionId) {
16613
16657
  * Session CRUD commands: list, info, rename, slug, tag, route, active, auto-route.
16614
16658
  */
16615
16659
  async function cmdList(projectSlug, opts) {
16616
- const { getRegistryBackend } = await import("./factory-D6I2jmjQ.mjs");
16660
+ const { getRegistryBackend } = await import("./factory-DW7BCJJT.mjs");
16617
16661
  const registryBackend = await getRegistryBackend();
16618
16662
  const limit = parseInt(opts.limit ?? "20", 10);
16619
16663
  let project;
@@ -16678,7 +16722,7 @@ async function cmdList(projectSlug, opts) {
16678
16722
  console.log(dim$1(` ${rows.length} session(s) shown (limit: ${limit})`));
16679
16723
  }
16680
16724
  async function cmdInfo(projectSlug, sessionNumber) {
16681
- const { getRegistryBackend } = await import("./factory-D6I2jmjQ.mjs");
16725
+ const { getRegistryBackend } = await import("./factory-DW7BCJJT.mjs");
16682
16726
  const registryBackend = await getRegistryBackend();
16683
16727
  const project = await getProject$1(registryBackend, projectSlug);
16684
16728
  if (!project) {
@@ -16702,7 +16746,7 @@ async function cmdInfo(projectSlug, sessionNumber) {
16702
16746
  console.log();
16703
16747
  }
16704
16748
  async function cmdRename(projectSlug, numberOrLatest, newSlug) {
16705
- const { getRegistryBackend } = await import("./factory-D6I2jmjQ.mjs");
16749
+ const { getRegistryBackend } = await import("./factory-DW7BCJJT.mjs");
16706
16750
  await cmdRenameWith(await getRegistryBackend(), projectSlug, numberOrLatest, newSlug);
16707
16751
  }
16708
16752
  async function cmdRenameWith(registryBackend, projectSlug, numberOrLatest, newSlug) {
@@ -16765,7 +16809,7 @@ async function cmdRenameWith(registryBackend, projectSlug, numberOrLatest, newSl
16765
16809
  console.log();
16766
16810
  }
16767
16811
  async function cmdSlug(projectSlug, numberOrLatest, opts) {
16768
- const { getRegistryBackend } = await import("./factory-D6I2jmjQ.mjs");
16812
+ const { getRegistryBackend } = await import("./factory-DW7BCJJT.mjs");
16769
16813
  const registryBackend = await getRegistryBackend();
16770
16814
  const project = await getProject$1(registryBackend, projectSlug);
16771
16815
  if (!project) {
@@ -16795,7 +16839,7 @@ async function cmdSlug(projectSlug, numberOrLatest, opts) {
16795
16839
  }
16796
16840
  }
16797
16841
  async function cmdTag(projectSlug, sessionNumber, rawTags) {
16798
- const { getRegistryBackend } = await import("./factory-D6I2jmjQ.mjs");
16842
+ const { getRegistryBackend } = await import("./factory-DW7BCJJT.mjs");
16799
16843
  const registryBackend = await getRegistryBackend();
16800
16844
  const project = await getProject$1(registryBackend, projectSlug);
16801
16845
  if (!project) {
@@ -16835,7 +16879,7 @@ async function cmdTag(projectSlug, sessionNumber, rawTags) {
16835
16879
  console.log();
16836
16880
  }
16837
16881
  async function cmdRoute(projectSlug, sessionNumber, targetProjectSlug, opts) {
16838
- const { getRegistryBackend } = await import("./factory-D6I2jmjQ.mjs");
16882
+ const { getRegistryBackend } = await import("./factory-DW7BCJJT.mjs");
16839
16883
  const registryBackend = await getRegistryBackend();
16840
16884
  const project = await getProject$1(registryBackend, projectSlug);
16841
16885
  if (!project) {
@@ -16877,7 +16921,7 @@ async function cmdRoute(projectSlug, sessionNumber, targetProjectSlug, opts) {
16877
16921
  console.log();
16878
16922
  }
16879
16923
  async function cmdActive(opts) {
16880
- const { getRegistryBackend } = await import("./factory-D6I2jmjQ.mjs");
16924
+ const { getRegistryBackend } = await import("./factory-DW7BCJJT.mjs");
16881
16925
  const registryBackend = await getRegistryBackend();
16882
16926
  const minutes = parseInt(opts.minutes ?? "60", 10);
16883
16927
  const cutoff = Date.now() - minutes * 60 * 1e3;
@@ -16965,8 +17009,8 @@ async function cmdActive(opts) {
16965
17009
  }
16966
17010
  async function cmdAutoRoute(opts) {
16967
17011
  const { autoRoute, formatAutoRouteJson } = await import("./auto-route-CF8WNaoy.mjs");
16968
- const { getRegistryBackend, createStorageBackend } = await import("./factory-D6I2jmjQ.mjs");
16969
- const { loadConfig } = await import("./config-GceCMUxa.mjs");
17012
+ const { getRegistryBackend, createStorageBackend } = await import("./factory-DW7BCJJT.mjs");
17013
+ const { loadConfig } = await import("./config-DjXq_W42.mjs");
16970
17014
  const config = loadConfig();
16971
17015
  const registryBackend = await getRegistryBackend();
16972
17016
  const federation = await createStorageBackend(config);
@@ -17202,7 +17246,7 @@ async function cmdPause(opts) {
17202
17246
  process.exitCode = 1;
17203
17247
  return;
17204
17248
  }
17205
- const { getRegistryBackend } = await import("./factory-D6I2jmjQ.mjs");
17249
+ const { getRegistryBackend } = await import("./factory-DW7BCJJT.mjs");
17206
17250
  const registryBackend = await getRegistryBackend();
17207
17251
  const cwd = process.cwd();
17208
17252
  const project = await resolveProjectByCwd(registryBackend, cwd);
@@ -17597,7 +17641,7 @@ function buildStopBody(project, sessionId) {
17597
17641
  }
17598
17642
  }
17599
17643
  async function cmdHandover(projectSlug, numberOrLatest, sessionId) {
17600
- const { getRegistryBackend } = await import("./factory-D6I2jmjQ.mjs");
17644
+ const { getRegistryBackend } = await import("./factory-DW7BCJJT.mjs");
17601
17645
  const registryBackend = await getRegistryBackend();
17602
17646
  let project;
17603
17647
  if (projectSlug) {
@@ -17893,7 +17937,7 @@ function touchSentinel(rootPath) {
17893
17937
  async function cmdAutosave(opts) {
17894
17938
  const minGap = parseInt(opts.minGap ?? String(DEFAULT_MIN_GAP), 10);
17895
17939
  const cwd = process.cwd();
17896
- const { getRegistryBackend } = await import("./factory-D6I2jmjQ.mjs");
17940
+ const { getRegistryBackend } = await import("./factory-DW7BCJJT.mjs");
17897
17941
  const registryBackend = await getRegistryBackend();
17898
17942
  const project = await resolveProjectByCwd(registryBackend, cwd);
17899
17943
  if (!project) return;
@@ -18802,9 +18846,15 @@ function fail$3(e) {
18802
18846
  process.exitCode = 1;
18803
18847
  }
18804
18848
  function registerWorkerModelCommand(workerCmd) {
18805
- workerCmd.command("model [what] [model]").description("Model ids per provider: no args lists them,\n`model <model-id>` sets the active provider's default model (back-compat),\n`model <capability>` shows one capability, `model <capability> <model-id>` sets it.\nCapability names are open (default, fast, image, … — any ^[a-z][a-z0-9-]*$ name);\n`pai worker capability` picks which provider serves one across the whole config.\n--provider targets another provider.").option("--provider <name>", "Provider to read or change (default: the active one)").action((what, model, opts) => {
18849
+ workerCmd.command("model [what] [model]").description("Model ids per provider: no args lists them,\n`model <model-id>` sets the active provider's default model (back-compat),\n`model <capability>` shows one capability, `model <capability> <model-id>` sets it.\nCapability names are open (default, fast, image, … — any ^[a-z][a-z0-9-]*$ name);\n`pai worker capability` picks which provider serves one across the whole config.\n--provider targets another provider.").option("--provider <name>", "Provider to read or change (default: the active one)").option("--capability <name>", "Capability to set/show, with a model id as the only argument (same as the MCP tool)").action((what, model, opts) => {
18806
18850
  try {
18807
18851
  const { workers } = readWorkersSection();
18852
+ if (opts.capability !== void 0) {
18853
+ if (!isModelCapability(opts.capability)) throw new WorkersConfigError(`"${opts.capability}" is not a valid capability name`);
18854
+ if (model !== void 0) throw new WorkersConfigError("with --capability pass only a model id");
18855
+ model = what;
18856
+ what = opts.capability;
18857
+ }
18808
18858
  if (what === void 0) {
18809
18859
  for (const line of describeModels(workers)) console.log(` ${line}`);
18810
18860
  return;
@@ -18815,14 +18865,14 @@ function registerWorkerModelCommand(workerCmd) {
18815
18865
  capability = what;
18816
18866
  if (model === void 0) {
18817
18867
  const name = resolveProviderName(workers, opts.provider);
18818
- const p = workers.providers[name];
18868
+ const p = getProviderOrNative(workers, name);
18819
18869
  if (p) console.log(` ${name} ${capability} ${p.models[capability] ?? "(none)"}`);
18820
18870
  return;
18821
18871
  }
18822
18872
  id = model;
18823
18873
  } else if (model !== void 0) throw new WorkersConfigError(`unexpected second argument "${model}" — usage: model [<capability>] <model-id>`);
18824
18874
  const name = resolveProviderName(workers, opts.provider);
18825
- const p = setProviderModel(name, capability, id).providers[name];
18875
+ const p = getProviderOrNative(setProviderModel(name, capability, id), name);
18826
18876
  if (p) {
18827
18877
  console.log(ok$1(`${name} ${capability} model: ${p.models[capability]}`));
18828
18878
  console.log(dim$1(` ${modelPrefsText(p)}`));
@@ -19179,7 +19229,7 @@ function registerWorkerCommands(workerCmd) {
19179
19229
  const logDir = currentLogDir();
19180
19230
  const term = process.env.ITERM_SESSION_ID ?? "";
19181
19231
  if (id) {
19182
- const msg = opts.check ? await checkPaneForWorker(id, workers.pane.fontSize, term) : await openPaneForWorker(logDir, workers, id, term);
19232
+ const msg = opts.check ? await checkPaneForWorker(id, workers.pane.fontSize, term) : (await openPaneForWorker(logDir, workers, id, term)).message;
19183
19233
  console.log(msg);
19184
19234
  } else console.log(await openFollowPane(logDir, workers, term, opts.check === true));
19185
19235
  } catch (e) {
@@ -20169,8 +20219,8 @@ async function analyzeProject(registryBackend, project) {
20169
20219
  async function countVectorDbPaths(oldPaths) {
20170
20220
  if (oldPaths.length === 0) return 0;
20171
20221
  try {
20172
- const { loadConfig } = await import("./config-GceCMUxa.mjs");
20173
- const { createStorageBackend } = await import("./factory-D6I2jmjQ.mjs");
20222
+ const { loadConfig } = await import("./config-DjXq_W42.mjs");
20223
+ const { createStorageBackend } = await import("./factory-DW7BCJJT.mjs");
20174
20224
  const config = loadConfig();
20175
20225
  if (config.storageBackend !== "postgres") return 0;
20176
20226
  const backend = await createStorageBackend(config);
@@ -20187,8 +20237,8 @@ async function countVectorDbPaths(oldPaths) {
20187
20237
  async function updateVectorDbPaths(moves) {
20188
20238
  if (moves.length === 0) return 0;
20189
20239
  try {
20190
- const { loadConfig } = await import("./config-GceCMUxa.mjs");
20191
- const { createStorageBackend } = await import("./factory-D6I2jmjQ.mjs");
20240
+ const { loadConfig } = await import("./config-DjXq_W42.mjs");
20241
+ const { createStorageBackend } = await import("./factory-DW7BCJJT.mjs");
20192
20242
  const config = loadConfig();
20193
20243
  if (config.storageBackend !== "postgres") return 0;
20194
20244
  const backend = await createStorageBackend(config);
@@ -20275,7 +20325,7 @@ async function displayDryRun(plans) {
20275
20325
  console.log();
20276
20326
  }
20277
20327
  async function executeCleanup(plans, skipReindex) {
20278
- const { getRegistryBackend } = await import("./factory-D6I2jmjQ.mjs");
20328
+ const { getRegistryBackend } = await import("./factory-DW7BCJJT.mjs");
20279
20329
  const registryBackend = await getRegistryBackend();
20280
20330
  let deleted = 0;
20281
20331
  let renamed = 0;
@@ -20472,7 +20522,7 @@ async function executeCleanup(plans, skipReindex) {
20472
20522
  //#region src/cli/commands/session-cleanup/index.ts
20473
20523
  function registerSessionCleanupCommand(sessionCmd) {
20474
20524
  sessionCmd.command("cleanup [project-slug]").description("Clean up session notes: delete empties, auto-name unnamed, move into YYYY/MM/ hierarchy, renumber").option("--execute", "Actually perform the cleanup (default is dry-run)").option("--no-renumber", "Skip renumbering sessions after deletions").option("--no-reindex", "Skip triggering memory re-index after moves").action(async (projectSlug, opts) => {
20475
- const { getRegistryBackend } = await import("./factory-D6I2jmjQ.mjs");
20525
+ const { getRegistryBackend } = await import("./factory-DW7BCJJT.mjs");
20476
20526
  const registryBackend = await getRegistryBackend();
20477
20527
  const dryRun = !opts.execute;
20478
20528
  const skipReindex = opts.reindex === false;
@@ -20542,7 +20592,7 @@ function finalizeNote(notePath) {
20542
20592
  }
20543
20593
  async function cmdEnd(opts) {
20544
20594
  await cmdPause(opts);
20545
- const { getRegistryBackend } = await import("./factory-D6I2jmjQ.mjs");
20595
+ const { getRegistryBackend } = await import("./factory-DW7BCJJT.mjs");
20546
20596
  const registryBackend = await getRegistryBackend();
20547
20597
  const cwd = process.cwd();
20548
20598
  const project = await registryBackend.findProjectByCwdPrefix(cwd);
@@ -20990,7 +21040,7 @@ async function cmdFind(query, opts) {
20990
21040
  */
20991
21041
  async function getProjects(includeArchived) {
20992
21042
  try {
20993
- const { getRegistryBackend } = await import("./factory-D6I2jmjQ.mjs");
21043
+ const { getRegistryBackend } = await import("./factory-DW7BCJJT.mjs");
20994
21044
  const rows = await (await getRegistryBackend()).listProjectsWithSessionStats();
20995
21045
  return includeArchived ? rows : rows.filter((p) => p.status === "active");
20996
21046
  } catch {
@@ -21464,7 +21514,7 @@ async function cmdPick(opts = {}) {
21464
21514
  const onRemove = async (rec) => {
21465
21515
  if (!rec.slug) return false;
21466
21516
  try {
21467
- const { getRegistryBackend } = await import("./factory-D6I2jmjQ.mjs");
21517
+ const { getRegistryBackend } = await import("./factory-DW7BCJJT.mjs");
21468
21518
  const registryBackend = await getRegistryBackend();
21469
21519
  const project = await registryBackend.getProjectBySlug(rec.slug);
21470
21520
  if (!project || project.status !== "active") return false;
@@ -21749,4 +21799,4 @@ claude() {
21749
21799
 
21750
21800
  //#endregion
21751
21801
  export { drainStdio as n, buildProgram as t };
21752
- //# sourceMappingURL=program-QSuci3RH.mjs.map
21802
+ //# sourceMappingURL=program-BTdspOOa.mjs.map