@tekmidian/pai 0.34.1 → 0.35.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.
@@ -10,8 +10,8 @@ import { n as formatDetection, r as formatDetectionJson, t as detectProject } fr
10
10
  import { _ as transcriptFiles, a as readBodyFile, c as loadScanConfig, d as saveScanConfig, f as upsertProject, g as scanTranscriptFolders, h as findMovedProjects, i as findNotesDir$1, m as claudeProjectsDir, n as applyContinue, o as extractAndStoreTriples, p as upsertSession, r as findLatestNote, s as cmdScan, t as appendCheckpointToNote, u as resolveHome } from "./checkpoint-block-D3rm4dAJ.mjs";
11
11
  import { a as schedulerLogPath, i as paiSocketPath, n as daemonLogPath, r as daemonPidPath } from "./runtime-paths-B0P1TvUr.mjs";
12
12
  import { t as PaiClient } from "./ipc-client-aVKVERjJ.mjs";
13
- import { a as expandHome, c as UNROUTED, i as ensureConfigDir, n as CONFIG_FILE$2, o as loadConfig, s as OWNER_LABEL_PREFIX, t as CONFIG_DIR } from "./config-CcdkNSWa.mjs";
14
- import { i as humanDuration, t as createStorageBackend } from "./factory-CDjViCff.mjs";
13
+ import { a as expandHome, c as UNROUTED, i as ensureConfigDir, n as CONFIG_FILE$2, o as loadConfig, s as OWNER_LABEL_PREFIX, t as CONFIG_DIR } from "./config-BSkVcvfq.mjs";
14
+ import { i as humanDuration, t as createStorageBackend } from "./factory-WCByhnB6.mjs";
15
15
  import { s as kgQuery } from "./kg-entity-r8duqhi9.mjs";
16
16
  import { _ as scanSessions, a as renderDedupedSessions, c as probeResume, d as callAiBroker, f as fetchLiveSessions, g as resolveSessionByNameOrId, h as fmtAge, i as normalizeName$2, l as restoreTopLevel, m as sendToSession, o as hasConversation, p as revealItermSession, r as buildDeduped, s as launchInDir, u as printExitDir } from "./main-resolver-CNSqU8wo.mjs";
17
17
  import { appendFileSync, chmodSync, copyFileSync, createReadStream, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, statSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
@@ -2924,8 +2924,8 @@ function registerStatsCommands(memoryCmd, getDb) {
2924
2924
  //#region src/cli/commands/memory/sources-cmd.ts
2925
2925
  function registerSourcesCommand(memoryCmd) {
2926
2926
  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) => {
2927
- const { createStorageBackend } = await import("./factory-CDjViCff.mjs").then((n) => n.n);
2928
- const { loadConfig } = await import("./config-CcdkNSWa.mjs").then((n) => n.r);
2927
+ const { createStorageBackend } = await import("./factory-WCByhnB6.mjs").then((n) => n.n);
2928
+ const { loadConfig } = await import("./config-BSkVcvfq.mjs").then((n) => n.r);
2929
2929
  const { cmdMemorySources } = await import("./sources-BDwN0B8i.mjs");
2930
2930
  let backend;
2931
2931
  try {
@@ -3608,8 +3608,8 @@ function cmdLogs(opts) {
3608
3608
  }
3609
3609
  function registerDaemonCommands(daemonCmd) {
3610
3610
  daemonCmd.command("serve").description("Start the PAI daemon in the foreground").action(async () => {
3611
- const { serve } = await import("./daemon-COSnvTY1.mjs").then((n) => n.t);
3612
- const { loadConfig: lc, ensureConfigDir } = await import("./config-CcdkNSWa.mjs").then((n) => n.r);
3611
+ const { serve } = await import("./daemon-D6qwIKjj.mjs").then((n) => n.t);
3612
+ const { loadConfig: lc, ensureConfigDir } = await import("./config-BSkVcvfq.mjs").then((n) => n.r);
3613
3613
  ensureConfigDir();
3614
3614
  await serve(lc());
3615
3615
  });
@@ -8853,7 +8853,7 @@ async function escalate(task, headline, detail, state, now, opts) {
8853
8853
  let delivered = false;
8854
8854
  try {
8855
8855
  const { routeNotification } = await import("./router-i9S19Usg.mjs").then((n) => n.n);
8856
- const { loadConfig } = await import("./config-CcdkNSWa.mjs").then((n) => n.r);
8856
+ const { loadConfig } = await import("./config-BSkVcvfq.mjs").then((n) => n.r);
8857
8857
  delivered = (await routeNotification({
8858
8858
  event: "error",
8859
8859
  title: `PAI: ${headline}`,
@@ -11372,8 +11372,8 @@ function cmdActive(db, opts) {
11372
11372
  async function cmdAutoRoute(opts) {
11373
11373
  const { autoRoute, formatAutoRoute, formatAutoRouteJson } = await import("./auto-route-lDk1q_2h.mjs");
11374
11374
  const { openRegistry } = await import("./db-BtuN768f.mjs").then((n) => n.t);
11375
- const { createStorageBackend } = await import("./factory-CDjViCff.mjs").then((n) => n.n);
11376
- const { loadConfig } = await import("./config-CcdkNSWa.mjs").then((n) => n.r);
11375
+ const { createStorageBackend } = await import("./factory-WCByhnB6.mjs").then((n) => n.n);
11376
+ const { loadConfig } = await import("./config-BSkVcvfq.mjs").then((n) => n.r);
11377
11377
  const config = loadConfig();
11378
11378
  const registryDb = openRegistry();
11379
11379
  const federation = await createStorageBackend(config);
@@ -12837,13 +12837,33 @@ function scanNotesDir(notesDir, dbByFilename) {
12837
12837
  }
12838
12838
  return candidates;
12839
12839
  }
12840
- function buildRenumberMap(survivors) {
12841
- const map = /* @__PURE__ */ new Map();
12842
- [...survivors].sort((a, b) => a.number - b.number).forEach((s, idx) => {
12843
- const newNum = idx + 1;
12844
- if (s.number !== newNum) map.set(s.number, newNum);
12845
- });
12846
- return map;
12840
+ /**
12841
+ * Renumbering is disabled. This always returns an empty map.
12842
+ *
12843
+ * It used to reassign every surviving note to its position in the sorted list
12844
+ * (`newNum = idx + 1`), which treats the number as a position. The number is
12845
+ * also the note's identity — handovers and other notes cite notes by number —
12846
+ * and a value that is both a position and an identity parts company with
12847
+ * itself the moment the set changes.
12848
+ *
12849
+ * What that cost, measured on a real corpus: deleting or adding one note
12850
+ * shifted the whole series, and because the number is also written into the H1
12851
+ * (`# Session 0006: ...`), the rewrite changed file *contents* as well as
12852
+ * names. Git could not pair them as renames — 0 of 262 rewritten notes were
12853
+ * byte-identical to anything in HEAD — so a single shift produced 261 deletions
12854
+ * plus 262 additions. The operator changed one source file and their prompt
12855
+ * reported 262 changes, which hides any real uncommitted work in the noise.
12856
+ *
12857
+ * Numbers are now minted once, at creation, and never reassigned. Gaps are
12858
+ * expected and harmless: a gap is information (a note was removed) and costs
12859
+ * nothing, whereas a renumber invalidates every existing reference silently.
12860
+ *
12861
+ * Kept as a function rather than deleted so the call site and the CleanupPlan
12862
+ * shape stay intact; collisions should be reported by the caller, never
12863
+ * resolved by shifting.
12864
+ */
12865
+ function buildRenumberMap(_survivors) {
12866
+ return /* @__PURE__ */ new Map();
12847
12867
  }
12848
12868
  function analyzeProject(db, project) {
12849
12869
  const notesDirPaths = findAllNotesDirs(project);
@@ -12880,7 +12900,7 @@ function analyzeProject(db, project) {
12880
12900
  async function countVectorDbPaths(oldPaths) {
12881
12901
  if (oldPaths.length === 0) return 0;
12882
12902
  try {
12883
- const { loadConfig } = await import("./config-CcdkNSWa.mjs").then((n) => n.r);
12903
+ const { loadConfig } = await import("./config-BSkVcvfq.mjs").then((n) => n.r);
12884
12904
  const { PostgresBackend } = await import("./postgres-CYQuLAfD.mjs");
12885
12905
  const config = loadConfig();
12886
12906
  if (config.storageBackend !== "postgres") return 0;
@@ -12901,7 +12921,7 @@ async function countVectorDbPaths(oldPaths) {
12901
12921
  async function updateVectorDbPaths(moves) {
12902
12922
  if (moves.length === 0) return 0;
12903
12923
  try {
12904
- const { loadConfig } = await import("./config-CcdkNSWa.mjs").then((n) => n.r);
12924
+ const { loadConfig } = await import("./config-BSkVcvfq.mjs").then((n) => n.r);
12905
12925
  const { PostgresBackend } = await import("./postgres-CYQuLAfD.mjs");
12906
12926
  const config = loadConfig();
12907
12927
  if (config.storageBackend !== "postgres") return 0;
@@ -14185,4 +14205,4 @@ async function cmdPick(db, opts = {}) {
14185
14205
 
14186
14206
  //#endregion
14187
14207
  export { registerProjectsCommands as A, registerRestoreCommands as C, registerIdentityCommands as D, registerMcpCommands as E, resolveIdentifier as M, registerMemoryCommands as O, registerSetupCommand as S, registerDaemonCommands as T, registerUpdateCommand as _, cmdEnd as a, registerZettelCommands as b, cmdGoto as c, registerHelpCommand as d, registerDbCommands as f, registerNotifyCommands as g, registerTaskCommands as h, cmdPauseAll as i, findMovedPath as j, registerRegistryCommands as k, cmdPause as l, registerTopicCommands as m, cmdFind as n, registerSessionCleanupCommand as o, registerKgCommands as p, cmdClearNames as r, registerSessionCommands as s, cmdPick as t, cmdList as u, registerSkillCommands as v, registerBackupCommands as w, registerObsidianCommands as x, registerObservationCommands as y };
14188
- //# sourceMappingURL=pick-T4sZPpFh.mjs.map
14208
+ //# sourceMappingURL=pick-D7-XuJqF.mjs.map