@foldrun/core 24.4.0 → 24.4.2

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.
@@ -558,11 +558,18 @@ export function setFrontmatterScalar(raw, key, value) {
558
558
  return ["---", line, "---", ...lines].join(eol);
559
559
  const k = keyLine(lines, b.close, key);
560
560
  if (k) {
561
- const { value: v, comment } = splitComment(k.rest);
561
+ const { comment } = splitComment(k.rest);
562
+ // Every line indented deeper than the key is its value's — a block
563
+ // scalar, a plain scalar folded onto the next lines, blank lines inside
564
+ // either. Trailing blank lines are left where they are (Codex: a value
565
+ // after a blank line survived and joined the new one).
562
566
  let end = k.index + 1;
563
- if (/^\s*[|>][-+]?\d*\s*$/.test(v) || !v.trim()) {
564
- while (end < b.close && (lines[end].match(/^\s*/)?.[0].length ?? 0) > k.indent.length && /\S/.test(lines[end]))
565
- end++;
567
+ for (let i = k.index + 1; i < b.close; i++) {
568
+ if (!/\S/.test(lines[i]))
569
+ continue;
570
+ if ((lines[i].match(/^\s*/)?.[0].length ?? 0) <= k.indent.length)
571
+ break;
572
+ end = i + 1;
566
573
  }
567
574
  lines.splice(k.index, end - k.index, `${k.indent}${line}${comment}`);
568
575
  return lines.join(eol);
@@ -442,7 +442,9 @@ const workspaceRootOf = (agentDir) => path.join(agentDir, "..", "..");
442
442
  const SNAPSHOT_NOTE = "The folder you were sent to work on is in snapshot/ (inside your working directory). Make your changes there, as files: " +
443
443
  "when you finish, foldrun turns what changed in snapshot/ into a patch the person applies. " +
444
444
  "Only snapshot/ (as that patch) and your outputs/ come back from this step; anything you write elsewhere is not kept. " +
445
- "Do not create links or a .git folder in snapshot/ — links make the patch refused, and .git is left out.";
445
+ "Do not create links or a .git folder in snapshot/ — links make the patch refused, and .git is left out. " +
446
+ "snapshot/ is the person's own folder: when you write to them, name paths from its top (site/index.html, not snapshot/site/index.html), " +
447
+ "and do not mention snapshot/, outputs/, the sandbox or the patch — to them it is just their folder.";
446
448
  /**
447
449
  * Configuration from AGENTS.md, nearest-wins: the workspace's overrides the
448
450
  * account's, key by key.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foldrun/core",
3
- "version": "24.4.0",
3
+ "version": "24.4.2",
4
4
  "description": "Agents are just folders. The format, the runner, the checks.",
5
5
  "license": "FSL-1.1-ALv2",
6
6
  "type": "module",
@@ -587,10 +587,16 @@ export function setFrontmatterScalar(raw: string, key: string, value: string): s
587
587
  if (!b) return ["---", line, "---", ...lines].join(eol);
588
588
  const k = keyLine(lines, b.close, key);
589
589
  if (k) {
590
- const { value: v, comment } = splitComment(k.rest);
590
+ const { comment } = splitComment(k.rest);
591
+ // Every line indented deeper than the key is its value's — a block
592
+ // scalar, a plain scalar folded onto the next lines, blank lines inside
593
+ // either. Trailing blank lines are left where they are (Codex: a value
594
+ // after a blank line survived and joined the new one).
591
595
  let end = k.index + 1;
592
- if (/^\s*[|>][-+]?\d*\s*$/.test(v) || !v.trim()) {
593
- while (end < b.close && (lines[end].match(/^\s*/)?.[0].length ?? 0) > k.indent.length && /\S/.test(lines[end])) end++;
596
+ for (let i = k.index + 1; i < b.close; i++) {
597
+ if (!/\S/.test(lines[i])) continue;
598
+ if ((lines[i].match(/^\s*/)?.[0].length ?? 0) <= k.indent.length) break;
599
+ end = i + 1;
594
600
  }
595
601
  lines.splice(k.index, end - k.index, `${k.indent}${line}${comment}`);
596
602
  return lines.join(eol);
package/src/runner.ts CHANGED
@@ -522,7 +522,9 @@ const SNAPSHOT_NOTE =
522
522
  "The folder you were sent to work on is in snapshot/ (inside your working directory). Make your changes there, as files: " +
523
523
  "when you finish, foldrun turns what changed in snapshot/ into a patch the person applies. " +
524
524
  "Only snapshot/ (as that patch) and your outputs/ come back from this step; anything you write elsewhere is not kept. " +
525
- "Do not create links or a .git folder in snapshot/ — links make the patch refused, and .git is left out.";
525
+ "Do not create links or a .git folder in snapshot/ — links make the patch refused, and .git is left out. " +
526
+ "snapshot/ is the person's own folder: when you write to them, name paths from its top (site/index.html, not snapshot/site/index.html), " +
527
+ "and do not mention snapshot/, outputs/, the sandbox or the patch — to them it is just their folder.";
526
528
 
527
529
  /**
528
530
  * Configuration from AGENTS.md, nearest-wins: the workspace's overrides the