foldrun 14.2.0 → 14.2.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 (2) hide show
  1. package/package.json +2 -2
  2. package/src/commands.mjs +6 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foldrun",
3
- "version": "14.2.0",
3
+ "version": "14.2.1",
4
4
  "description": "Agents are just folders. Write them, check them, run them — on your machine.",
5
5
  "license": "FSL-1.1-ALv2",
6
6
  "type": "module",
@@ -11,7 +11,7 @@
11
11
  "node": ">=22"
12
12
  },
13
13
  "dependencies": {
14
- "@foldrun/core": "^14.3.2"
14
+ "@foldrun/core": "^14.3.3"
15
15
  },
16
16
  "files": [
17
17
  "bin",
package/src/commands.mjs CHANGED
@@ -8970,22 +8970,16 @@ function ownSandboxOf(agent) {
8970
8970
  return /** @type {{ sandbox?: string } | undefined} */ (agent)?.sandbox === "own";
8971
8971
  }
8972
8972
 
8973
- /** An agent file's frontmatter as a run reads it, from its text. A run folds
8974
- * the four job blocks' keys up to the top (core's configMatter, kept private
8975
- * — not in @foldrun/core's publicApi), so `guardrail: { sandbox: own }` reads
8976
- * as `sandbox: own`. The CLI reads only two foldable keys off this — `sandbox`
8977
- * and `network`, both in an agent's `guardrail:` block — so it lifts just
8978
- * those, the same way a run does: a top-level value wins, else the block's is
8979
- * lifted. {} when it does not parse. */
8973
+ /** An agent file's frontmatter as a run reads it, from its text. Core's
8974
+ * readFrontmatter folds the four job blocks' keys up to the top (its
8975
+ * configMatter), so `guardrail: { sandbox: own }` reads as `sandbox: own`.
8976
+ * The CLI keeps no fold rule of its own (FOL-93). {} when it does not parse. */
8980
8977
  async function effectiveFront(raw) {
8981
8978
  const { readFrontmatter } = await core();
8982
8979
  const dir = fs.mkdtempSync(path.join(os.tmpdir(), "foldrun-front-"));
8983
8980
  try {
8984
8981
  fs.writeFileSync(path.join(dir, "agent.md"), raw);
8985
- const front = /** @type {Record<string, any>} */ (readFrontmatter(path.join(dir, "agent.md")) ?? {});
8986
- const guardrail = front.guardrail && typeof front.guardrail === "object" ? front.guardrail : {};
8987
- for (const key of ["sandbox", "network"]) if (!(key in front) && key in guardrail) front[key] = guardrail[key];
8988
- return front;
8982
+ return /** @type {Record<string, any>} */ (readFrontmatter(path.join(dir, "agent.md")) ?? {});
8989
8983
  } catch {
8990
8984
  return {};
8991
8985
  } finally {
@@ -9234,7 +9228,7 @@ async function agentNetworkCmd(positional, flags, layout) {
9234
9228
  inTree(desk, files, async (dir) => {
9235
9229
  const { listAgents } = await core();
9236
9230
  // The folded view a run reads: `network` set inside a `guardrail:` block
9237
- // counts the same as a top-level one (effectiveFront lifts it).
9231
+ // counts the same as a top-level one (core folds it).
9238
9232
  const front = await effectiveFront(fs.readFileSync(path.join(dir, rel), "utf8"));
9239
9233
  const info = listAgents("default", "workspace").find((a) => a.name === name);
9240
9234
  // May it browse? Core answers it (network.browses, with web: inherited