@cydm/pie 4.3.7 → 4.3.12

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.
@@ -175,7 +175,7 @@ async function runDistillWorkerMain(memoryRoot, date, noExit = false) {
175
175
  const { AuthStorage } = await import("./auth-storage-3EGM3VTK.js");
176
176
  const { getSessionsDir } = await import("./config-74AUVDLT.js");
177
177
  const { FileSessionStore } = await import("./src-4EQ7PBEI.js");
178
- const { MemoryStore, runDistillation } = await import("./src-UVULNQOO.js");
178
+ const { MemoryStore, runDistillation } = await import("./src-V2M7FLWY.js");
179
179
  const store = new MemoryStore(memoryRoot);
180
180
  ledger = store;
181
181
  const registry = new ModelRegistry(AuthStorage.create());
@@ -198,7 +198,10 @@ async function runDistillWorkerMain(memoryRoot, date, noExit = false) {
198
198
  systemPrompt: options?.system ?? "You are a precise extraction engine.",
199
199
  messages: [{ role: "user", content: [{ type: "text", text: prompt }], timestamp: Date.now() }]
200
200
  },
201
- { apiKey: resolved.apiKey, maxTokens: Math.min(resolved.model.maxTokens ?? 4096, 4096) }
201
+ // 4.3.11: reasoning models (deepseek-flash) spend part of the
202
+ // budget on the thinking pass — 4096 truncated the JSON
203
+ // answer mid-array (stopReason=length). 16k for light calls.
204
+ { apiKey: resolved.apiKey, maxTokens: Math.min(resolved.model.maxTokens ?? 16384, 16384) }
202
205
  ),
203
206
  12e4,
204
207
  `memory ${modelClass} model call`
@@ -244,7 +247,7 @@ async function runDistillWorkerMain(memoryRoot, date, noExit = false) {
244
247
  }
245
248
  return result;
246
249
  }
247
- async function runDistillAuto(memoryRoot, days = 7) {
250
+ async function runDistillAuto(memoryRoot, days = 7, runner) {
248
251
  const log = (message) => {
249
252
  try {
250
253
  fs.appendFileSync(distillWorkerLogPath(memoryRoot), `[${(/* @__PURE__ */ new Date()).toISOString()}] ${message}
@@ -252,7 +255,7 @@ async function runDistillAuto(memoryRoot, days = 7) {
252
255
  } catch {
253
256
  }
254
257
  };
255
- const { MemoryStore, todayKey } = await import("./src-UVULNQOO.js");
258
+ const { MemoryStore, todayKey } = await import("./src-V2M7FLWY.js");
256
259
  const store = new MemoryStore(memoryRoot);
257
260
  const today = todayKey(Date.now());
258
261
  const dates = [];
@@ -271,8 +274,9 @@ async function runDistillAuto(memoryRoot, days = 7) {
271
274
  const lines = [];
272
275
  let ok = true;
273
276
  let deferred = false;
277
+ let failures = 0;
274
278
  for (const date of dates) {
275
- const result = await runDistillWorkerMain(memoryRoot, date, true);
279
+ const result = await (runner ?? runDistillWorkerMain)(memoryRoot, date, true);
276
280
  if (!result.ok && result.busy) {
277
281
  lines.push(`${date}: busy \u2014 another distillation worker is running; next schedule retries`);
278
282
  deferred = true;
@@ -281,11 +285,12 @@ async function runDistillAuto(memoryRoot, days = 7) {
281
285
  lines.push(`${date}: ${result.status ?? "failed"}${result.error ? ` \u2014 ${result.error}` : ""}`);
282
286
  if (!result.ok) {
283
287
  ok = false;
284
- lines.push(`stopping: journal order requires oldest-first; fix and re-run --auto for ${dates.slice(dates.indexOf(date) + 1).join(", ") || "the remaining dates"}`);
285
- break;
288
+ failures += 1;
289
+ log(`auto: ${date} failed (retryable); continuing the remaining dates`);
286
290
  }
287
291
  }
288
- setTimeout(() => process.exit(ok || deferred ? 0 : 1), 50).unref?.();
292
+ if (failures > 0) lines.push(`${failures} date(s) failed (retryable; next run retries them)`);
293
+ if (!process.env.NODE_TEST_CONTEXT) setTimeout(() => process.exit(ok || deferred ? 0 : 1), 50).unref?.();
289
294
  return { ok: ok || deferred, lines };
290
295
  }
291
296
 
@@ -10,7 +10,7 @@ import {
10
10
  createSharedWebSearchTool,
11
11
  defaultShellKindForPlatform,
12
12
  interpretShellExit
13
- } from "./chunk-WZLO5V2X.js";
13
+ } from "./chunk-N5B5IGJ6.js";
14
14
  import {
15
15
  requestInteraction
16
16
  } from "./chunk-XMOWWL4B.js";