@cydm/pie 4.13.1 → 4.14.1

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 (34) hide show
  1. package/dist/builtin/extensions/ask-user/index.js +4 -4
  2. package/dist/builtin/extensions/cron/index.js +70 -17
  3. package/dist/builtin/extensions/im-forward/index.js +8094 -8100
  4. package/dist/builtin/extensions/mcp-adapter/index.js +86 -81
  5. package/dist/builtin/extensions/memory/index.js +30 -7
  6. package/dist/builtin/extensions/pie-ipc/index.js +13 -18
  7. package/dist/builtin/extensions/pie-proc/README.md +12 -3
  8. package/dist/builtin/extensions/pie-proc/index.js +145 -96
  9. package/dist/builtin/extensions/plan-mode/index.js +4 -4
  10. package/dist/builtin/extensions/subagent/index.js +5 -5
  11. package/dist/builtin/extensions/todo/index.js +4 -4
  12. package/dist/chunks/{chunk-6Z54UHXM.js → chunk-2WLKAMOH.js} +21 -16
  13. package/dist/chunks/{chunk-3F2CSVNH.js → chunk-DJ4LO7PQ.js} +2 -1
  14. package/dist/chunks/{chunk-MCR4JYI6.js → chunk-IM7DLPPY.js} +74 -8
  15. package/dist/chunks/{chunk-HSMO2BEA.js → chunk-IQDVL34H.js} +24 -19
  16. package/dist/chunks/{chunk-DT22BBZL.js → chunk-OQCKDEEE.js} +1 -1
  17. package/dist/chunks/{chunk-26KRUYZH.js → chunk-SAXKBFX3.js} +1 -1
  18. package/dist/chunks/{chunk-CCPNHS6B.js → chunk-SYZR74QO.js} +1582 -1570
  19. package/dist/chunks/{chunk-UCVPNLCO.js → chunk-TNRZEQD5.js} +2 -2
  20. package/dist/chunks/{chunk-NHWWRE3T.js → chunk-TTSQWGAT.js} +727 -719
  21. package/dist/chunks/{chunk-XPJHZRTN.js → chunk-X3ZVZB2R.js} +1133 -381
  22. package/dist/chunks/{host-image-fallback-LGWYQMLA.js → host-image-fallback-AEKY2LSZ.js} +1 -1
  23. package/dist/chunks/{manager-cli-OTIMAWO6.js → manager-cli-ZV36YNPJ.js} +187 -173
  24. package/dist/chunks/{memory-git-7SRO5KLB.js → memory-git-G56IXFWU.js} +5 -5
  25. package/dist/chunks/{model-registry-IWOOAMLZ.js → model-registry-4LM2I6FR.js} +2 -2
  26. package/dist/chunks/{read-file-understanding-3TYWVOLX.js → read-file-understanding-GTNZHAK5.js} +5 -5
  27. package/dist/chunks/{src-WA2O2O2V.js → src-3YJ4UVEC.js} +3 -3
  28. package/dist/chunks/{src-ALHMJZ5R.js → src-APNP4M4N.js} +2 -2
  29. package/dist/chunks/{src-D2ICRXWW.js → src-T6AUO53N.js} +24 -6
  30. package/dist/chunks/{src-76Q33OY5.js → src-TNUD7EDH.js} +1 -1
  31. package/dist/chunks/{test-stream-OVGDTXOY.js → test-stream-EF2DHEHV.js} +1 -1
  32. package/dist/cli.js +3131 -3013
  33. package/package.json +1 -1
  34. package/dist/chunks/{chunk-3GG342QY.js → chunk-TYCKSYUF.js} +19 -19
@@ -15,7 +15,7 @@ var require_windows = __commonJS({
15
15
  module.exports = isexe;
16
16
  isexe.sync = sync;
17
17
  var fs5 = __require("fs");
18
- function checkPathExt(path5, options) {
18
+ function checkPathExt(path6, options) {
19
19
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
20
20
  if (!pathext) {
21
21
  return true;
@@ -26,25 +26,25 @@ var require_windows = __commonJS({
26
26
  }
27
27
  for (var i = 0; i < pathext.length; i++) {
28
28
  var p = pathext[i].toLowerCase();
29
- if (p && path5.substr(-p.length).toLowerCase() === p) {
29
+ if (p && path6.substr(-p.length).toLowerCase() === p) {
30
30
  return true;
31
31
  }
32
32
  }
33
33
  return false;
34
34
  }
35
- function checkStat(stat, path5, options) {
35
+ function checkStat(stat, path6, options) {
36
36
  if (!stat.isSymbolicLink() && !stat.isFile()) {
37
37
  return false;
38
38
  }
39
- return checkPathExt(path5, options);
39
+ return checkPathExt(path6, options);
40
40
  }
41
- function isexe(path5, options, cb) {
42
- fs5.stat(path5, function(er, stat) {
43
- cb(er, er ? false : checkStat(stat, path5, options));
41
+ function isexe(path6, options, cb) {
42
+ fs5.stat(path6, function(er, stat) {
43
+ cb(er, er ? false : checkStat(stat, path6, options));
44
44
  });
45
45
  }
46
- function sync(path5, options) {
47
- return checkStat(fs5.statSync(path5), path5, options);
46
+ function sync(path6, options) {
47
+ return checkStat(fs5.statSync(path6), path6, options);
48
48
  }
49
49
  }
50
50
  });
@@ -55,13 +55,13 @@ var require_mode = __commonJS({
55
55
  module.exports = isexe;
56
56
  isexe.sync = sync;
57
57
  var fs5 = __require("fs");
58
- function isexe(path5, options, cb) {
59
- fs5.stat(path5, function(er, stat) {
58
+ function isexe(path6, options, cb) {
59
+ fs5.stat(path6, function(er, stat) {
60
60
  cb(er, er ? false : checkStat(stat, options));
61
61
  });
62
62
  }
63
- function sync(path5, options) {
64
- return checkStat(fs5.statSync(path5), options);
63
+ function sync(path6, options) {
64
+ return checkStat(fs5.statSync(path6), options);
65
65
  }
66
66
  function checkStat(stat, options) {
67
67
  return stat.isFile() && checkMode(stat, options);
@@ -94,7 +94,7 @@ var require_isexe = __commonJS({
94
94
  }
95
95
  module.exports = isexe;
96
96
  isexe.sync = sync;
97
- function isexe(path5, options, cb) {
97
+ function isexe(path6, options, cb) {
98
98
  if (typeof options === "function") {
99
99
  cb = options;
100
100
  options = {};
@@ -104,7 +104,7 @@ var require_isexe = __commonJS({
104
104
  throw new TypeError("callback not provided");
105
105
  }
106
106
  return new Promise(function(resolve, reject) {
107
- isexe(path5, options || {}, function(er, is) {
107
+ isexe(path6, options || {}, function(er, is) {
108
108
  if (er) {
109
109
  reject(er);
110
110
  } else {
@@ -113,7 +113,7 @@ var require_isexe = __commonJS({
113
113
  });
114
114
  });
115
115
  }
116
- core(path5, options || {}, function(er, is) {
116
+ core(path6, options || {}, function(er, is) {
117
117
  if (er) {
118
118
  if (er.code === "EACCES" || options && options.ignoreErrors) {
119
119
  er = null;
@@ -123,9 +123,9 @@ var require_isexe = __commonJS({
123
123
  cb(er, is);
124
124
  });
125
125
  }
126
- function sync(path5, options) {
126
+ function sync(path6, options) {
127
127
  try {
128
- return core.sync(path5, options || {});
128
+ return core.sync(path6, options || {});
129
129
  } catch (er) {
130
130
  if (options && options.ignoreErrors || er.code === "EACCES") {
131
131
  return false;
@@ -141,7 +141,7 @@ var require_isexe = __commonJS({
141
141
  var require_which = __commonJS({
142
142
  "../../node_modules/which/which.js"(exports, module) {
143
143
  var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
144
- var path5 = __require("path");
144
+ var path6 = __require("path");
145
145
  var COLON = isWindows ? ";" : ":";
146
146
  var isexe = require_isexe();
147
147
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -179,7 +179,7 @@ var require_which = __commonJS({
179
179
  return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
180
180
  const ppRaw = pathEnv[i];
181
181
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
182
- const pCmd = path5.join(pathPart, cmd);
182
+ const pCmd = path6.join(pathPart, cmd);
183
183
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
184
184
  resolve(subStep(p, i, 0));
185
185
  });
@@ -206,7 +206,7 @@ var require_which = __commonJS({
206
206
  for (let i = 0; i < pathEnv.length; i++) {
207
207
  const ppRaw = pathEnv[i];
208
208
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
209
- const pCmd = path5.join(pathPart, cmd);
209
+ const pCmd = path6.join(pathPart, cmd);
210
210
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
211
211
  for (let j = 0; j < pathExt.length; j++) {
212
212
  const cur = p + pathExt[j];
@@ -254,7 +254,7 @@ var require_path_key = __commonJS({
254
254
  var require_resolveCommand = __commonJS({
255
255
  "../../node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
256
256
  "use strict";
257
- var path5 = __require("path");
257
+ var path6 = __require("path");
258
258
  var which = require_which();
259
259
  var getPathKey = require_path_key();
260
260
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -272,7 +272,7 @@ var require_resolveCommand = __commonJS({
272
272
  try {
273
273
  resolved = which.sync(parsed.command, {
274
274
  path: env[getPathKey({ env })],
275
- pathExt: withoutPathExt ? path5.delimiter : void 0
275
+ pathExt: withoutPathExt ? path6.delimiter : void 0
276
276
  });
277
277
  } catch (e) {
278
278
  } finally {
@@ -281,7 +281,7 @@ var require_resolveCommand = __commonJS({
281
281
  }
282
282
  }
283
283
  if (resolved) {
284
- resolved = path5.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
284
+ resolved = path6.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
285
285
  }
286
286
  return resolved;
287
287
  }
@@ -335,8 +335,8 @@ var require_shebang_command = __commonJS({
335
335
  if (!match) {
336
336
  return null;
337
337
  }
338
- const [path5, argument] = match[0].replace(/#! ?/, "").split(" ");
339
- const binary = path5.split("/").pop();
338
+ const [path6, argument] = match[0].replace(/#! ?/, "").split(" ");
339
+ const binary = path6.split("/").pop();
340
340
  if (binary === "env") {
341
341
  return argument;
342
342
  }
@@ -371,7 +371,7 @@ var require_readShebang = __commonJS({
371
371
  var require_parse = __commonJS({
372
372
  "../../node_modules/cross-spawn/lib/parse.js"(exports, module) {
373
373
  "use strict";
374
- var path5 = __require("path");
374
+ var path6 = __require("path");
375
375
  var resolveCommand = require_resolveCommand();
376
376
  var escape2 = require_escape();
377
377
  var readShebang = require_readShebang();
@@ -396,7 +396,7 @@ var require_parse = __commonJS({
396
396
  const needsShell = !isExecutableRegExp.test(commandFile);
397
397
  if (parsed.options.forceShell || needsShell) {
398
398
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
399
- parsed.command = path5.normalize(parsed.command);
399
+ parsed.command = path6.normalize(parsed.command);
400
400
  parsed.command = escape2.command(parsed.command);
401
401
  parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
402
402
  const shellCommand = [parsed.command].concat(parsed.args).join(" ");
@@ -508,7 +508,7 @@ var require_cross_spawn = __commonJS({
508
508
 
509
509
  // builtin/extensions/mcp-adapter/index.ts
510
510
  import { randomBytes } from "node:crypto";
511
- import * as path4 from "node:path";
511
+ import * as path5 from "node:path";
512
512
  import * as os2 from "node:os";
513
513
  import * as fs4 from "node:fs";
514
514
 
@@ -918,10 +918,10 @@ function mergeDefs(...defs) {
918
918
  function cloneDef(schema) {
919
919
  return mergeDefs(schema._zod.def);
920
920
  }
921
- function getElementAtPath(obj, path5) {
922
- if (!path5)
921
+ function getElementAtPath(obj, path6) {
922
+ if (!path6)
923
923
  return obj;
924
- return path5.reduce((acc, key) => acc?.[key], obj);
924
+ return path6.reduce((acc, key) => acc?.[key], obj);
925
925
  }
926
926
  function promiseAllObject(promisesObj) {
927
927
  const keys = Object.keys(promisesObj);
@@ -1261,11 +1261,11 @@ function explicitlyAborted(x, startIndex = 0) {
1261
1261
  }
1262
1262
  return false;
1263
1263
  }
1264
- function prefixIssues(path5, issues) {
1264
+ function prefixIssues(path6, issues) {
1265
1265
  return issues.map((iss) => {
1266
1266
  var _a3;
1267
1267
  (_a3 = iss).path ?? (_a3.path = []);
1268
- iss.path.unshift(path5);
1268
+ iss.path.unshift(path6);
1269
1269
  return iss;
1270
1270
  });
1271
1271
  }
@@ -1714,16 +1714,16 @@ function flattenError(error2, mapper = (issue2) => issue2.message) {
1714
1714
  }
1715
1715
  function formatError(error2, mapper = (issue2) => issue2.message) {
1716
1716
  const fieldErrors = { _errors: [] };
1717
- const processError = (error3, path5 = []) => {
1717
+ const processError = (error3, path6 = []) => {
1718
1718
  for (const issue2 of error3.issues) {
1719
1719
  if (issue2.code === "invalid_union" && issue2.errors.length) {
1720
- issue2.errors.map((issues) => processError({ issues }, [...path5, ...issue2.path]));
1720
+ issue2.errors.map((issues) => processError({ issues }, [...path6, ...issue2.path]));
1721
1721
  } else if (issue2.code === "invalid_key") {
1722
- processError({ issues: issue2.issues }, [...path5, ...issue2.path]);
1722
+ processError({ issues: issue2.issues }, [...path6, ...issue2.path]);
1723
1723
  } else if (issue2.code === "invalid_element") {
1724
- processError({ issues: issue2.issues }, [...path5, ...issue2.path]);
1724
+ processError({ issues: issue2.issues }, [...path6, ...issue2.path]);
1725
1725
  } else {
1726
- const fullpath = [...path5, ...issue2.path];
1726
+ const fullpath = [...path6, ...issue2.path];
1727
1727
  if (fullpath.length === 0) {
1728
1728
  fieldErrors._errors.push(mapper(issue2));
1729
1729
  } else {
@@ -11043,9 +11043,9 @@ var rev2026Codec = {
11043
11043
  });
11044
11044
  const parsed = buildSchemas2026().RequestMetaEnvelopeSchema.safeParse(meta2);
11045
11045
  if (!parsed.success) for (const issue2 of parsed.error.issues) {
11046
- const path5 = issue2.path.map(String);
11047
- const key = path5.length > 0 ? path5.join(".") : "_meta";
11048
- if (path5.length === 1 && issues.some((existing) => existing.key === key && existing.problem === "missing")) continue;
11046
+ const path6 = issue2.path.map(String);
11047
+ const key = path6.length > 0 ? path6.join(".") : "_meta";
11048
+ if (path6.length === 1 && issues.some((existing) => existing.key === key && existing.problem === "missing")) continue;
11049
11049
  issues.push({
11050
11050
  key,
11051
11051
  problem: issue2.message
@@ -11347,29 +11347,29 @@ var PERMITTED_X_MCP_HEADER_TYPES = /* @__PURE__ */ new Set([
11347
11347
  function scanXMcpHeaderDeclarations(inputSchema) {
11348
11348
  const declarations = [];
11349
11349
  const seenLower = /* @__PURE__ */ new Map();
11350
- const visit = (node2, path5, reachable) => {
11350
+ const visit = (node2, path6, reachable) => {
11351
11351
  if (node2 === null || typeof node2 !== "object") return void 0;
11352
11352
  const schema = node2;
11353
11353
  if (X_MCP_HEADER_KEY in schema) {
11354
- if (!reachable || path5.length === 0) return `${pathName(path5)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;
11354
+ if (!reachable || path6.length === 0) return `${pathName(path6)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;
11355
11355
  const raw = schema[X_MCP_HEADER_KEY];
11356
- if (typeof raw !== "string" || raw.length === 0) return `${pathName(path5)}: x-mcp-header MUST be a non-empty string`;
11357
- if (!RFC9110_TOKEN.test(raw)) return `${pathName(path5)}: x-mcp-header '${raw}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;
11356
+ if (typeof raw !== "string" || raw.length === 0) return `${pathName(path6)}: x-mcp-header MUST be a non-empty string`;
11357
+ if (!RFC9110_TOKEN.test(raw)) return `${pathName(path6)}: x-mcp-header '${raw}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;
11358
11358
  const type = typeof schema.type === "string" ? schema.type : void 0;
11359
- if (type === void 0 || !PERMITTED_X_MCP_HEADER_TYPES.has(type)) return `${pathName(path5)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${type ?? "<none>"}`;
11359
+ if (type === void 0 || !PERMITTED_X_MCP_HEADER_TYPES.has(type)) return `${pathName(path6)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${type ?? "<none>"}`;
11360
11360
  const lower = raw.toLowerCase();
11361
11361
  const prior = seenLower.get(lower);
11362
11362
  if (prior !== void 0) return `x-mcp-header '${raw}' is not case-insensitively unique (also declared as '${prior}')`;
11363
11363
  seenLower.set(lower, raw);
11364
11364
  declarations.push({
11365
- path: path5,
11365
+ path: path6,
11366
11366
  headerName: raw,
11367
11367
  type
11368
11368
  });
11369
11369
  }
11370
11370
  const properties = schema.properties;
11371
11371
  if (properties !== null && typeof properties === "object") for (const [key, child] of Object.entries(properties)) {
11372
- const fault$1 = visit(child, [...path5, key], reachable);
11372
+ const fault$1 = visit(child, [...path6, key], reachable);
11373
11373
  if (fault$1 !== void 0) return fault$1;
11374
11374
  }
11375
11375
  for (const k of NON_REACHABLE_SUBSCHEMA_KEYWORDS) {
@@ -11377,7 +11377,7 @@ function scanXMcpHeaderDeclarations(inputSchema) {
11377
11377
  if (sub === void 0) continue;
11378
11378
  const branches = Array.isArray(sub) ? sub : sub !== null && typeof sub === "object" && OBJECT_VALUED_SUBSCHEMA_KEYWORDS.has(k) ? Object.values(sub) : [sub];
11379
11379
  for (const branch of branches) {
11380
- const fault$1 = visit(branch, [...path5, `<${k}>`], false);
11380
+ const fault$1 = visit(branch, [...path6, `<${k}>`], false);
11381
11381
  if (fault$1 !== void 0) return fault$1;
11382
11382
  }
11383
11383
  }
@@ -11417,8 +11417,8 @@ var OBJECT_VALUED_SUBSCHEMA_KEYWORDS = /* @__PURE__ */ new Set([
11417
11417
  "$defs",
11418
11418
  "definitions"
11419
11419
  ]);
11420
- function pathName(path5) {
11421
- return path5.length === 0 ? "<root>" : path5.join(".");
11420
+ function pathName(path6) {
11421
+ return path6.length === 0 ? "<root>" : path6.join(".");
11422
11422
  }
11423
11423
  var BASE64_SENTINEL_PREFIX = "=?base64?";
11424
11424
  var BASE64_SENTINEL_SUFFIX = "?=";
@@ -11451,9 +11451,9 @@ function utf8ToBase64(s) {
11451
11451
  function encodeMcpParamValue(value) {
11452
11452
  return needsBase64(value) ? `${BASE64_SENTINEL_PREFIX}${utf8ToBase64(value)}${BASE64_SENTINEL_SUFFIX}` : value;
11453
11453
  }
11454
- function valueAtPath(root, path5) {
11454
+ function valueAtPath(root, path6) {
11455
11455
  let node2 = root;
11456
- for (const key of path5) {
11456
+ for (const key of path6) {
11457
11457
  if (node2 === null || typeof node2 !== "object") return void 0;
11458
11458
  node2 = node2[key];
11459
11459
  }
@@ -11728,7 +11728,7 @@ var PROPERTY_KEYS_BY_TYPE = {
11728
11728
  array: shapeKeys([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema])
11729
11729
  };
11730
11730
  var SUPPORTED_STRING_FORMATS = new Set(StringSchemaSchema.shape.format.unwrap().options);
11731
- function walkProperty(node2, path5, vendor, unsupported) {
11731
+ function walkProperty(node2, path6, vendor, unsupported) {
11732
11732
  if (!isJsonObject(node2)) return node2;
11733
11733
  const allowedKeys = typeof node2.type === "string" && Object.hasOwn(PROPERTY_KEYS_BY_TYPE, node2.type) ? PROPERTY_KEYS_BY_TYPE[node2.type] : void 0;
11734
11734
  if (allowedKeys === void 0) return node2;
@@ -11736,8 +11736,8 @@ function walkProperty(node2, path5, vendor, unsupported) {
11736
11736
  for (const [key, value] of Object.entries(node2)) if (allowedKeys.has(key) || isAnnotationOnlyJsonSchemaKeyword(key)) pruned[key] = value;
11737
11737
  else if (key === "pattern" && node2.type === "string" && typeof node2.format === "string") {
11738
11738
  if (!SUPPORTED_STRING_FORMATS.has(node2.format)) pruned[key] = value;
11739
- else if (typeof value !== "string" || !isLibraryFormatPattern(node2.format, value, vendor)) unsupported.push(`${path5}.${key}`);
11740
- } else unsupported.push(`${path5}.${key}`);
11739
+ else if (typeof value !== "string" || !isLibraryFormatPattern(node2.format, value, vendor)) unsupported.push(`${path6}.${key}`);
11740
+ } else unsupported.push(`${path6}.${key}`);
11741
11741
  return pruned;
11742
11742
  }
11743
11743
  function walkRequestedSchema(converted, vendor) {
@@ -11754,11 +11754,11 @@ function describeUnsupportedProperties(pruned, fallback) {
11754
11754
  const offenders = Object.entries(pruned.properties).filter(([, node2]) => !parseSchema(PrimitiveSchemaDefinitionSchema, node2).success).map(([name]) => `properties.${name}`);
11755
11755
  return offenders.length > 0 ? offenders.join(", ") : fallback;
11756
11756
  }
11757
- function findDroppedConstraintPaths(original, parsed, path5 = "") {
11758
- if (Array.isArray(original) && Array.isArray(parsed)) return original.flatMap((item, index) => findDroppedConstraintPaths(item, parsed[index], `${path5}[${index}]`));
11757
+ function findDroppedConstraintPaths(original, parsed, path6 = "") {
11758
+ if (Array.isArray(original) && Array.isArray(parsed)) return original.flatMap((item, index) => findDroppedConstraintPaths(item, parsed[index], `${path6}[${index}]`));
11759
11759
  if (!isJsonObject(original) || !isJsonObject(parsed)) return [];
11760
11760
  return Object.entries(original).flatMap(([key, value]) => {
11761
- const childPath = path5 ? `${path5}.${key}` : key;
11761
+ const childPath = path6 ? `${path6}.${key}` : key;
11762
11762
  if (!Object.prototype.hasOwnProperty.call(parsed, key)) return isAnnotationOnlyJsonSchemaKeyword(key) ? [] : [childPath];
11763
11763
  return findDroppedConstraintPaths(value, parsed[key], childPath);
11764
11764
  });
@@ -15940,8 +15940,8 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
15940
15940
  for (let i = 0; i < str.length; i++) if (str[i] === token) ind++;
15941
15941
  return ind;
15942
15942
  }
15943
- function removeDotSegments(path5) {
15944
- let input = path5;
15943
+ function removeDotSegments(path6) {
15944
+ let input = path6;
15945
15945
  const output = [];
15946
15946
  let nextSlash = -1;
15947
15947
  let len = 0;
@@ -16094,8 +16094,8 @@ var require_schemes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16094
16094
  wsComponent.secure = void 0;
16095
16095
  }
16096
16096
  if (wsComponent.resourceName) {
16097
- const [path5, query] = wsComponent.resourceName.split("?");
16098
- wsComponent.path = path5 && path5 !== "/" ? path5 : void 0;
16097
+ const [path6, query] = wsComponent.resourceName.split("?");
16098
+ wsComponent.path = path6 && path6 !== "/" ? path6 : void 0;
16099
16099
  wsComponent.query = query;
16100
16100
  wsComponent.resourceName = void 0;
16101
16101
  }
@@ -24435,8 +24435,11 @@ var StdioClientTransport = class {
24435
24435
  };
24436
24436
 
24437
24437
  // builtin/extensions/mcp-adapter/src/server-manager.ts
24438
- import { createHash } from "node:crypto";
24439
24438
  import * as fs2 from "node:fs";
24439
+ import * as path3 from "node:path";
24440
+
24441
+ // builtin/extensions/mcp-adapter/src/server-manager-support.ts
24442
+ import { createHash } from "node:crypto";
24440
24443
  import * as path2 from "node:path";
24441
24444
  var CONNECT_TIMEOUT_MS = 3e4;
24442
24445
  var PACKAGE_MANAGER_CONNECT_TIMEOUT_MS = 12e4;
@@ -24768,6 +24771,8 @@ function canonicalizeKeys(record2) {
24768
24771
  if (!record2) return {};
24769
24772
  return Object.fromEntries(Object.entries(record2).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0));
24770
24773
  }
24774
+
24775
+ // builtin/extensions/mcp-adapter/src/server-manager.ts
24771
24776
  var McpServerManager = class {
24772
24777
  constructor(definitions, cacheDir, log, now = Date.now) {
24773
24778
  this.now = now;
@@ -24948,7 +24953,7 @@ var McpServerManager = class {
24948
24953
  fs2.mkdirSync(this.cacheDir, { recursive: true });
24949
24954
  for (const [key, runtime] of this.runtimes) {
24950
24955
  if (!runtime.tools) continue;
24951
- const shardPath = path2.join(this.cacheDir, `${key}.json`);
24956
+ const shardPath = path3.join(this.cacheDir, `${key}.json`);
24952
24957
  const tempPath = `${shardPath}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
24953
24958
  fs2.writeFileSync(tempPath, JSON.stringify({ updatedAt: this.now(), fingerprint: cacheFingerprint(runtime.definition), tools: runtime.tools }, null, 2), "utf8");
24954
24959
  try {
@@ -24973,7 +24978,7 @@ var McpServerManager = class {
24973
24978
  }
24974
24979
  for (const name of names) {
24975
24980
  if (!name.endsWith(".json")) continue;
24976
- const filePath = path2.join(this.cacheDir, name);
24981
+ const filePath = path3.join(this.cacheDir, name);
24977
24982
  try {
24978
24983
  const mtimeMs = fs2.statSync(filePath).mtimeMs;
24979
24984
  const parsed = JSON.parse(fs2.readFileSync(filePath, "utf8"));
@@ -25054,7 +25059,7 @@ var McpServerManager = class {
25054
25059
  let signature = "";
25055
25060
  for (const name of names) {
25056
25061
  try {
25057
- signature += `${name}:${fs2.statSync(path2.join(this.cacheDir, name)).mtimeMs};`;
25062
+ signature += `${name}:${fs2.statSync(path3.join(this.cacheDir, name)).mtimeMs};`;
25058
25063
  } catch {
25059
25064
  }
25060
25065
  }
@@ -25064,7 +25069,7 @@ var McpServerManager = class {
25064
25069
  for (const name of names) {
25065
25070
  if (!name.endsWith(".json")) continue;
25066
25071
  try {
25067
- const parsed = JSON.parse(fs2.readFileSync(path2.join(this.cacheDir, name), "utf8"));
25072
+ const parsed = JSON.parse(fs2.readFileSync(path3.join(this.cacheDir, name), "utf8"));
25068
25073
  if (typeof parsed.updatedAt !== "number" || this.now() - parsed.updatedAt > METADATA_TTL_MS) continue;
25069
25074
  if (!Array.isArray(parsed.tools)) continue;
25070
25075
  const key = name.slice(0, -".json".length);
@@ -25205,7 +25210,7 @@ ${tail}` : ""),
25205
25210
  // builtin/extensions/mcp-adapter/src/trust.ts
25206
25211
  import { createHash as createHash2 } from "node:crypto";
25207
25212
  import * as fs3 from "node:fs";
25208
- import * as path3 from "node:path";
25213
+ import * as path4 from "node:path";
25209
25214
  function serverFingerprint(cwd, definition) {
25210
25215
  const spec = JSON.stringify({
25211
25216
  cwd,
@@ -25251,7 +25256,7 @@ var McpTrustStore = class {
25251
25256
  trust(cwd, definition) {
25252
25257
  this.load();
25253
25258
  this.fingerprints.add(serverFingerprint(cwd, definition));
25254
- fs3.mkdirSync(path3.dirname(this.filePath), { recursive: true });
25259
+ fs3.mkdirSync(path4.dirname(this.filePath), { recursive: true });
25255
25260
  fs3.writeFileSync(
25256
25261
  this.filePath,
25257
25262
  JSON.stringify({ trusted: [...this.fingerprints] }, null, 2) + "\n",
@@ -25569,7 +25574,7 @@ function resolveConfigDir() {
25569
25574
  if (envDir.startsWith("~/")) return os2.homedir() + envDir.slice(1);
25570
25575
  return envDir;
25571
25576
  }
25572
- return path4.join(os2.homedir(), ".pie");
25577
+ return path5.join(os2.homedir(), ".pie");
25573
25578
  }
25574
25579
  function tokenizeCommandArgs(input) {
25575
25580
  const tokens = [];
@@ -25608,8 +25613,8 @@ function tokenizeCommandArgs(input) {
25608
25613
  return tokens;
25609
25614
  }
25610
25615
  function writeFileAtomic(filePath, content) {
25611
- fs4.mkdirSync(path4.dirname(filePath), { recursive: true });
25612
- const tmp = path4.join(path4.dirname(filePath), `.mcp-${process.pid}-${randomBytes(4).toString("hex")}.tmp`);
25616
+ fs4.mkdirSync(path5.dirname(filePath), { recursive: true });
25617
+ const tmp = path5.join(path5.dirname(filePath), `.mcp-${process.pid}-${randomBytes(4).toString("hex")}.tmp`);
25613
25618
  try {
25614
25619
  fs4.writeFileSync(tmp, content, { encoding: "utf8", flag: "wx", mode: 384 });
25615
25620
  fs4.renameSync(tmp, filePath);
@@ -25650,8 +25655,8 @@ function formatServerForTrustPrompt(definition) {
25650
25655
  }
25651
25656
  function mcpAdapter(ctx) {
25652
25657
  const configDir = resolveConfigDir();
25653
- const trustStore = new McpTrustStore(path4.join(configDir, "mcp-trust.json"));
25654
- const metadataCacheDir = path4.join(configDir, "mcp-metadata");
25658
+ const trustStore = new McpTrustStore(path5.join(configDir, "mcp-trust.json"));
25659
+ const metadataCacheDir = path5.join(configDir, "mcp-metadata");
25655
25660
  let manager = new McpServerManager(
25656
25661
  resolveMcpAdapterConfig(ctx.cwd, configDir).servers,
25657
25662
  metadataCacheDir,
@@ -25681,7 +25686,7 @@ function mcpAdapter(ctx) {
25681
25686
  }
25682
25687
  ctx.registerCleanup?.(() => manager.dispose().catch(() => void 0));
25683
25688
  function readProjectOverride() {
25684
- const filePath = path4.join(ctx.cwd, ".pie", "mcp-adapter.json");
25689
+ const filePath = path5.join(ctx.cwd, ".pie", "mcp-adapter.json");
25685
25690
  let parsed = {};
25686
25691
  try {
25687
25692
  parsed = JSON.parse(fs4.readFileSync(filePath, "utf8"));
@@ -25690,7 +25695,7 @@ function mcpAdapter(ctx) {
25690
25695
  return parsed;
25691
25696
  }
25692
25697
  function writeProjectOverride(serverName, disabled) {
25693
- const filePath = path4.join(ctx.cwd, ".pie", "mcp-adapter.json");
25698
+ const filePath = path5.join(ctx.cwd, ".pie", "mcp-adapter.json");
25694
25699
  const parsed = readProjectOverride();
25695
25700
  const servers = parsed.mcpServers && typeof parsed.mcpServers === "object" && !Array.isArray(parsed.mcpServers) ? { ...parsed.mcpServers } : {};
25696
25701
  const existing = servers[serverName];
@@ -25707,7 +25712,7 @@ function mcpAdapter(ctx) {
25707
25712
  servers[serverName] = existingObj;
25708
25713
  }
25709
25714
  parsed.mcpServers = servers;
25710
- fs4.mkdirSync(path4.dirname(filePath), { recursive: true });
25715
+ fs4.mkdirSync(path5.dirname(filePath), { recursive: true });
25711
25716
  fs4.writeFileSync(filePath, JSON.stringify(parsed, null, 2) + "\n", "utf8");
25712
25717
  return filePath;
25713
25718
  }
@@ -25805,7 +25810,7 @@ function mcpAdapter(ctx) {
25805
25810
  commandCtx.ui.notify(`Invalid MCP server name "${name}" (use letters, digits, ., _, -).`, "warning");
25806
25811
  return;
25807
25812
  }
25808
- const filePath = isGlobal ? path4.join(configDir, "mcp-adapter.json") : path4.join(ctx.cwd, ".mcp.json");
25813
+ const filePath = isGlobal ? path5.join(configDir, "mcp-adapter.json") : path5.join(ctx.cwd, ".mcp.json");
25809
25814
  let priorRaw = null;
25810
25815
  let doc = {};
25811
25816
  if (fs4.existsSync(filePath)) {
@@ -25856,7 +25861,7 @@ function mcpAdapter(ctx) {
25856
25861
  commandCtx.ui.notify("Usage: /mcp remove <server> [--global]", "warning");
25857
25862
  return;
25858
25863
  }
25859
- const filePath = isGlobal ? path4.join(configDir, "mcp-adapter.json") : path4.join(ctx.cwd, ".mcp.json");
25864
+ const filePath = isGlobal ? path5.join(configDir, "mcp-adapter.json") : path5.join(ctx.cwd, ".mcp.json");
25860
25865
  if (!fs4.existsSync(filePath)) {
25861
25866
  commandCtx.ui.notify(`No MCP config file at ${filePath}.`, "warning");
25862
25867
  return;
@@ -3,10 +3,10 @@ import {
3
3
  distillWorkerLogPath,
4
4
  readDistillWorkerLog,
5
5
  spawnDistillWorker
6
- } from "../../../chunks/chunk-HSMO2BEA.js";
6
+ } from "../../../chunks/chunk-IQDVL34H.js";
7
7
  import {
8
8
  commitCuratedMemoryBestEffort
9
- } from "../../../chunks/chunk-3F2CSVNH.js";
9
+ } from "../../../chunks/chunk-DJ4LO7PQ.js";
10
10
  import {
11
11
  getConfigDir,
12
12
  getSessionsDir,
@@ -16,20 +16,23 @@ import {
16
16
  DEFAULT_MEMORY_INJECTION_BUDGET,
17
17
  MemoryStore,
18
18
  WikiStore,
19
+ appendWikiInboxItem,
20
+ countWikiInbox,
19
21
  lookupSessionEvidence,
20
22
  materialConsumedIn,
21
23
  projectKeyForDir,
22
24
  recordConsumption,
23
25
  recordInjection,
26
+ removeWikiInboxItems,
24
27
  saveAttestedEntry,
25
28
  searchMemory,
26
29
  todayKey
27
- } from "../../../chunks/chunk-XPJHZRTN.js";
30
+ } from "../../../chunks/chunk-X3ZVZB2R.js";
28
31
  import {
29
32
  FileSessionStore
30
- } from "../../../chunks/chunk-CCPNHS6B.js";
31
- import "../../../chunks/chunk-26KRUYZH.js";
32
- import "../../../chunks/chunk-MCR4JYI6.js";
33
+ } from "../../../chunks/chunk-SYZR74QO.js";
34
+ import "../../../chunks/chunk-SAXKBFX3.js";
35
+ import "../../../chunks/chunk-IM7DLPPY.js";
33
36
  import {
34
37
  Type
35
38
  } from "../../../chunks/chunk-XXGYUYXI.js";
@@ -287,7 +290,25 @@ ${injectionMemo.text}` };
287
290
  cwd: ctx.cwd,
288
291
  ...args.replaces ? { replaces: args.replaces } : {}
289
292
  });
290
- const retired = ops.filter((op) => op.op === "retire").length;
293
+ const retiredIds = ops.filter((op) => op.op === "retire").map((op) => op.id);
294
+ try {
295
+ if (retiredIds.length > 0) removeWikiInboxItems(store.dir, retiredIds);
296
+ if (args.kind !== "preference" && new WikiStore(store.dir).exists()) {
297
+ appendWikiInboxItem(store.dir, {
298
+ id: entryId,
299
+ kind: args.kind,
300
+ text: args.text.trim(),
301
+ quote: args.quote.trim(),
302
+ sessionId: activeSessionId ?? "session-unbound",
303
+ date: todayKey(),
304
+ ...args.kind === "project" ? { projectKey: project.key } : {},
305
+ cwd: ctx.cwd,
306
+ createdAt: Date.now()
307
+ });
308
+ }
309
+ } catch {
310
+ }
311
+ const retired = retiredIds.length;
291
312
  commitCuratedMemoryBestEffort(store.dir, `memory_save(${args.kind}): ${entryId}`, { initIfMissing: false });
292
313
  return {
293
314
  content: [
@@ -659,6 +680,8 @@ async function handleMemoryCommand(ctx, store, args, hooks = {}) {
659
680
  }
660
681
  const dreamed = [...meta.dreamedDates ?? []].sort().reverse();
661
682
  if (dreamed.length > 0) lines.push(`Recent dreamed dates: ${dreamed.slice(0, 7).join(", ")}`);
683
+ const pendingInbox = countWikiInbox(store.dir);
684
+ if (pendingInbox > 0) lines.push(`Inbox: ${pendingInbox} pending`);
662
685
  return lines.join("\n");
663
686
  }
664
687
  case "log": {