@cydm/pie 4.13.1 → 4.14.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 (27) hide show
  1. package/dist/builtin/extensions/ask-user/index.js +2 -2
  2. package/dist/builtin/extensions/im-forward/index.js +8092 -8098
  3. package/dist/builtin/extensions/mcp-adapter/index.js +86 -81
  4. package/dist/builtin/extensions/memory/index.js +28 -5
  5. package/dist/builtin/extensions/pie-ipc/index.js +13 -18
  6. package/dist/builtin/extensions/pie-proc/index.js +61 -55
  7. package/dist/builtin/extensions/plan-mode/index.js +2 -2
  8. package/dist/builtin/extensions/subagent/index.js +3 -3
  9. package/dist/builtin/extensions/todo/index.js +2 -2
  10. package/dist/chunks/{chunk-6Z54UHXM.js → chunk-BOQIGMGQ.js} +20 -15
  11. package/dist/chunks/{chunk-XPJHZRTN.js → chunk-EZZTMDWZ.js} +712 -378
  12. package/dist/chunks/{chunk-HSMO2BEA.js → chunk-FD3KBPDR.js} +23 -18
  13. package/dist/chunks/{chunk-3F2CSVNH.js → chunk-IK2FR2YF.js} +2 -1
  14. package/dist/chunks/{chunk-CCPNHS6B.js → chunk-JJH77AUU.js} +1578 -1566
  15. package/dist/chunks/{chunk-DT22BBZL.js → chunk-JKO42HZW.js} +1 -1
  16. package/dist/chunks/{chunk-UCVPNLCO.js → chunk-KGWKRO7Z.js} +1 -1
  17. package/dist/chunks/{chunk-NHWWRE3T.js → chunk-UYDS75SI.js} +725 -718
  18. package/dist/chunks/{host-image-fallback-LGWYQMLA.js → host-image-fallback-LPHB5CTL.js} +1 -1
  19. package/dist/chunks/{manager-cli-OTIMAWO6.js → manager-cli-ZV36YNPJ.js} +187 -173
  20. package/dist/chunks/{memory-git-7SRO5KLB.js → memory-git-ZJN6SPIU.js} +3 -3
  21. package/dist/chunks/{model-registry-IWOOAMLZ.js → model-registry-GLBIUOJR.js} +1 -1
  22. package/dist/chunks/{read-file-understanding-3TYWVOLX.js → read-file-understanding-DFJPTTSB.js} +3 -3
  23. package/dist/chunks/{src-WA2O2O2V.js → src-KZ7YID3I.js} +1 -1
  24. package/dist/chunks/{src-D2ICRXWW.js → src-LEXKDSFV.js} +22 -4
  25. package/dist/cli.js +2859 -2741
  26. package/package.json +1 -1
  27. package/dist/chunks/{chunk-3GG342QY.js → chunk-TYCKSYUF.js} +19 -19
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-CBDQJMUI.js";
5
5
  import {
6
6
  createMemoryLockBackend
7
- } from "./chunk-XPJHZRTN.js";
7
+ } from "./chunk-EZZTMDWZ.js";
8
8
 
9
9
  // src/commands/memory-distill.ts
10
10
  import * as fs from "node:fs";
@@ -356,22 +356,23 @@ async function runDistillWorkerMain(memoryRoot, date, noExit = false, sessionsDi
356
356
  let result;
357
357
  let wikiForError;
358
358
  try {
359
- const { ModelRegistry } = await import("./model-registry-IWOOAMLZ.js");
359
+ const { ModelRegistry } = await import("./model-registry-GLBIUOJR.js");
360
360
  const { AuthStorage } = await import("./auth-storage-IJEJ2TGE.js");
361
361
  const { getSessionsDir } = await import("./config-4EOI5NOU.js");
362
- const { FileSessionStore } = await import("./src-WA2O2O2V.js");
363
- const { WikiStore, runWikiBootstrap, runWikiDream, runWikiGc } = await import("./src-D2ICRXWW.js");
364
- const { commitCuratedMemoryBestEffort } = await import("./memory-git-7SRO5KLB.js");
362
+ const { FileSessionStore } = await import("./src-KZ7YID3I.js");
363
+ const { WikiStore, runWikiBootstrap, runWikiDreamBatches, runWikiGc } = await import("./src-LEXKDSFV.js");
364
+ const { commitCuratedMemoryBestEffort } = await import("./memory-git-ZJN6SPIU.js");
365
365
  const wiki = new WikiStore(memoryRoot);
366
366
  wikiForError = wiki;
367
- if (wiki.hasDreamedDate(date)) {
367
+ const inboxOnly = date === "__inbox__";
368
+ if (!inboxOnly && wiki.hasDreamedDate(date)) {
368
369
  result = { ok: true, status: "skipped-ran" };
369
370
  } else {
370
371
  const registry = new ModelRegistry(AuthStorage.create());
371
372
  const cwdFilter = await createExcludeCwdFilter();
372
373
  const lightCall = createWikiModelCall(registry, "light", void 0, 12e4);
373
374
  const balancedCall = createWikiModelCall(registry, "balanced", void 0, 18e4);
374
- if (!wiki.exists() && hasLegacyMemorySeed(memoryRoot)) {
375
+ if (!inboxOnly && !wiki.exists() && hasLegacyMemorySeed(memoryRoot)) {
375
376
  const boot = await runWikiBootstrap({ memoryRoot, balancedCall });
376
377
  log(`[wiki] auto-bootstrap ok=${boot.ok} written=${boot.written.length}${boot.error ? ` error=${boot.error}` : ""}`);
377
378
  if (!boot.ok) {
@@ -388,18 +389,20 @@ async function runDistillWorkerMain(memoryRoot, date, noExit = false, sessionsDi
388
389
  }
389
390
  if (!result) {
390
391
  const resolvedSessionsDir = sessionsDir ? path.resolve(sessionsDir) : getSessionsDir();
391
- const dreamRes = await runWikiDream({
392
+ const dreamRes = await runWikiDreamBatches({
392
393
  sessionStore: new FileSessionStore(resolvedSessionsDir),
393
394
  memoryRoot,
394
- dates: [date],
395
+ dates: inboxOnly ? [] : [date],
395
396
  lightCall,
396
397
  balancedCall,
397
398
  cwdFilter,
398
399
  log
399
400
  });
400
- log(`[wiki] dream ${date}: ok=${dreamRes.ok} sessions=${dreamRes.sessionsHarvested} signals=${dreamRes.signalsAuthenticated} written=${dreamRes.written.length}${dreamRes.error ? ` error=${dreamRes.error}` : ""}`);
401
+ const batchNote = dreamRes.batchesRun > 1 ? ` batches=${dreamRes.batchesRun}` : "";
402
+ const inboxNote = dreamRes.inboxMerged ? ` inbox=${dreamRes.inboxMerged}` : "";
403
+ log(`[wiki] dream ${inboxOnly ? "inbox" : date}: ok=${dreamRes.ok} sessions=${dreamRes.sessionsHarvested} signals=${dreamRes.signalsAuthenticated} written=${dreamRes.written.length}${batchNote}${inboxNote}${dreamRes.error ? ` error=${dreamRes.error}` : ""}`);
401
404
  let gcWrote = false;
402
- if (wiki.exists()) {
405
+ if (!inboxOnly && wiki.exists()) {
403
406
  const meta = wiki.readMeta();
404
407
  const sevenDaysMs = 7 * 24 * 60 * 60 * 1e3;
405
408
  const atCapacityPressure = wiki.listActivePages().length >= 18;
@@ -411,16 +414,16 @@ async function runDistillWorkerMain(memoryRoot, date, noExit = false, sessionsDi
411
414
  }
412
415
  }
413
416
  if (dreamRes.written.length > 0 || dreamRes.archived.length > 0 || gcWrote) {
414
- commitCuratedMemoryBestEffort(memoryRoot, `wiki(dream): ${date}`);
417
+ commitCuratedMemoryBestEffort(memoryRoot, inboxOnly ? "wiki(inbox): merge attested saves" : `wiki(dream): ${date}`);
415
418
  }
416
419
  if (dreamRes.ok) {
417
- const status = dreamRes.sessionsHarvested === 0 ? "skipped-empty" : "applied";
420
+ const status = dreamRes.sessionsHarvested === 0 && !dreamRes.inboxMerged ? "skipped-empty" : "applied";
418
421
  result = { ok: true, status };
419
422
  } else {
420
423
  const err = dreamRes.error ?? "wiki dream failed";
421
424
  const retryable = isWikiDreamResultRetryable(dreamRes);
422
425
  try {
423
- wiki.recordDreamFailure(err, date);
426
+ wiki.recordDreamFailure(err, inboxOnly ? "inbox" : date);
424
427
  } catch {
425
428
  }
426
429
  result = { ok: false, status: "failed", error: err, retryable };
@@ -453,7 +456,7 @@ async function runDistillAuto(memoryRoot, days = 7, runner, sessionsDir) {
453
456
  } catch {
454
457
  }
455
458
  };
456
- const { WikiStore, todayKey } = await import("./src-D2ICRXWW.js");
459
+ const { WikiStore, countWikiInbox, todayKey } = await import("./src-LEXKDSFV.js");
457
460
  const wiki = new WikiStore(memoryRoot);
458
461
  const today = todayKey(Date.now());
459
462
  const dates = [];
@@ -466,15 +469,17 @@ async function runDistillAuto(memoryRoot, days = 7, runner, sessionsDir) {
466
469
  dates.push(date);
467
470
  }
468
471
  }
469
- if (dates.length === 0) {
472
+ const pendingInbox = countWikiInbox(memoryRoot);
473
+ if (dates.length === 0 && pendingInbox === 0) {
470
474
  log("auto: no missing checkpoints in the window");
471
475
  return { ok: true, lines: ["memory --auto: no missing checkpoints in the last " + days + " days."] };
472
476
  }
473
- log(`auto: ${dates.length} missing date(s): ${dates.join(", ")}`);
477
+ const runTargets = dates.length > 0 ? dates : ["__inbox__"];
478
+ log(dates.length > 0 ? `auto: ${dates.length} missing date(s): ${dates.join(", ")}` : `auto: draining ${pendingInbox} pending inbox item(s)`);
474
479
  const lines = [];
475
480
  let failures = 0;
476
481
  let hasPermanentFailure = false;
477
- for (const date of dates) {
482
+ for (const date of runTargets) {
478
483
  const result = await (runner ?? runDistillWorkerMain)(memoryRoot, date, true, sessionsDir);
479
484
  if (!result.ok && result.busy) {
480
485
  lines.push(`${date}: busy \u2014 another distillation worker is running; next schedule retries`);
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  redactText
4
- } from "./chunk-XPJHZRTN.js";
4
+ } from "./chunk-EZZTMDWZ.js";
5
5
 
6
6
  // src/commands/memory-git.ts
7
7
  import { execFileSync } from "node:child_process";
@@ -14,6 +14,7 @@ var REQUIRED_IGNORE_RULES = [
14
14
  "evidence-ledger.json",
15
15
  ".gated-patches.json",
16
16
  ".snapshots/",
17
+ "inbox/",
17
18
  "wiki/.meta.json",
18
19
  "projects/*/meta.json",
19
20
  "*.lock",