@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.
@@ -25155,7 +25155,7 @@ ${tail}` : ""),
25155
25155
  }
25156
25156
  try {
25157
25157
  const result = await withTimeout(
25158
- client.callTool({ name: toolName, arguments: args }, void 0, signal !== void 0 ? { signal } : void 0),
25158
+ client.callTool({ name: toolName, arguments: args }, signal !== void 0 ? { signal } : void 0),
25159
25159
  CALL_TIMEOUT_MS,
25160
25160
  `call "${prefixedName}"`,
25161
25161
  signal
@@ -25174,7 +25174,7 @@ ${tail}` : ""),
25174
25174
  error: `MCP server "${server}" returned a result that fails its own outputSchema: ${message}. The call DID reach the server and the tool likely executed \u2014 do NOT retry automatically; verify state with a read-only tool first.`
25175
25175
  };
25176
25176
  }
25177
- if (runtime.client === void 0 || /closed|aborted|timed out|socket|ECONNRESET/i.test(message)) {
25177
+ if (signal?.aborted || runtime.client === void 0 || /closed|aborted|timed out|socket|ECONNRESET/i.test(message)) {
25178
25178
  return {
25179
25179
  delivery: "may_have_run",
25180
25180
  error: `MCP call "${prefixedName}" outcome unknown: ${message}. The request may have executed \u2014 do NOT retry automatically; verify state with a read-only tool first.`
@@ -3,7 +3,7 @@ import {
3
3
  distillWorkerLogPath,
4
4
  readDistillWorkerLog,
5
5
  spawnDistillWorker
6
- } from "../../../chunks/chunk-BJ4XN5VX.js";
6
+ } from "../../../chunks/chunk-GY47MKCJ.js";
7
7
  import {
8
8
  getConfigDir,
9
9
  getSettingsPath
@@ -19,7 +19,7 @@ import {
19
19
  saveAttestedEntry,
20
20
  searchMemory,
21
21
  todayKey
22
- } from "../../../chunks/chunk-WZLO5V2X.js";
22
+ } from "../../../chunks/chunk-N5B5IGJ6.js";
23
23
  import "../../../chunks/chunk-XMOWWL4B.js";
24
24
  import "../../../chunks/chunk-B4N5LJMD.js";
25
25
  import "../../../chunks/chunk-6JEYRAQM.js";
@@ -282,11 +282,17 @@ function buildInjectionSection(store, budget, projectKey) {
282
282
  }
283
283
  function buildInjectionSectionWithIds(store, budget, projectKey) {
284
284
  const entries = store.loadEntries();
285
+ const isLowValue = (entry) => {
286
+ if (entry.provenance === "user-attested") return false;
287
+ const inj = entry.injectedCount ?? 0;
288
+ const cons = entry.consumedCount ?? 0;
289
+ return inj >= 10 && inj / (cons + 1) >= 10;
290
+ };
285
291
  const take = (surface, limit, extra) => {
286
292
  const pool = entries.filter((entry) => {
287
293
  if (surface === "project") return entry.kind === "project" && (!extra || extra(entry));
288
294
  return entry.surface === surface && (!extra || extra(entry));
289
- }).sort((a, b) => b.usageCount - a.usageCount || b.lastAccessed - a.lastAccessed);
295
+ }).sort((a, b) => Number(isLowValue(a)) - Number(isLowValue(b)) || b.usageCount - a.usageCount || b.lastAccessed - a.lastAccessed);
290
296
  const kept = [];
291
297
  let used = 0;
292
298
  for (const entry of pool) {
@@ -322,6 +328,7 @@ function buildInjectionSectionWithIds(store, budget, projectKey) {
322
328
  }
323
329
  const recentDates = store.listJournalDates().slice(-3);
324
330
  const digest = [];
331
+ let digestUsed = 0;
325
332
  for (const date of recentDates.reverse()) {
326
333
  const journal = store.readJournal(date);
327
334
  if (!journal) continue;