@livx.cc/agentx 0.99.55 → 0.99.56

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/index.js CHANGED
@@ -673,8 +673,10 @@ var init_tools_structured = __esm({
673
673
  required: ["path", "content"],
674
674
  properties: { path: { type: "string" }, content: { type: "string" } }
675
675
  },
676
- async run({ path, content }, ctx) {
677
- const body = String(content ?? "");
676
+ async run({ path, content, contents }, ctx) {
677
+ const raw = content ?? contents;
678
+ if (raw == null) throw new Error(`Write needs \`content\` (the file body) \u2014 none was given for ${path}; nothing written.`);
679
+ const body = String(raw);
678
680
  const key = ctx.fs.resolvePath(path);
679
681
  if (await wouldClobberUnread(ctx, path, key))
680
682
  throw new Error(`Refusing to overwrite ${path}: it exists and hasn't been Read. Read it first, then Write to replace it (or Edit to change part of it).`);