agent.libx.js 0.94.15 → 0.94.16

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.
package/dist/cli.js CHANGED
@@ -9313,13 +9313,14 @@ async function closeMcp(mounted) {
9313
9313
  await Promise.all(mounted.map((m) => m.client.close().catch((e) => log17.debug("mcp close failed", e))));
9314
9314
  }
9315
9315
  var IMG_EXT = { ".png": "image/png", ".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".gif": "image/gif", ".webp": "image/webp" };
9316
+ var untilde = (p) => p.startsWith("~/") ? join9(homedir6(), p.slice(2)) : p;
9316
9317
  function readImageParts(cwd, line) {
9317
9318
  const refs = [...line.matchAll(/(?:^|\s)@(\S+)/g)].map((m) => m[1].replace(/[?!.,;:)\]}'">]+$/, "")).filter(Boolean);
9318
9319
  const parts = [];
9319
9320
  for (const ref of refs) {
9320
9321
  const mime = IMG_EXT[extname(ref).toLowerCase()];
9321
9322
  if (!mime) continue;
9322
- const abs = ref.startsWith("~/") ? join9(homedir6(), ref.slice(2)) : resolve3(cwd, ref);
9323
+ const abs = ref.startsWith("~/") ? untilde(ref) : resolve3(cwd, ref);
9323
9324
  try {
9324
9325
  parts.push(imagePart(`data:${mime};base64,${readFileSync5(abs).toString("base64")}`));
9325
9326
  } catch {
@@ -9334,7 +9335,7 @@ function pastePathClassifier(cwd) {
9334
9335
  t = t.replace(/\\ /g, " ").replace(/^['"]|['"]$/g, "");
9335
9336
  if (/\s/.test(t)) return null;
9336
9337
  if (!/^(\/|~\/|\.\/|\.\.\/)/.test(t)) return null;
9337
- const abs = t.startsWith("~/") ? join9(homedir6(), t.slice(2)) : resolve3(cwd, t);
9338
+ const abs = t.startsWith("~/") ? untilde(t) : resolve3(cwd, t);
9338
9339
  try {
9339
9340
  if (!statSync3(abs).isFile()) return null;
9340
9341
  } catch {
@@ -9367,7 +9368,7 @@ ${body}`);
9367
9368
  continue;
9368
9369
  }
9369
9370
  }
9370
- const path = ref.startsWith("~/") ? join9(homedir6(), ref.slice(2)) : ref;
9371
+ const path = untilde(ref);
9371
9372
  try {
9372
9373
  if (await fs.exists(path)) {
9373
9374
  blocks.push(`--- @${ref} ---