@herbertgao/pi-subagents 0.15.5 → 0.16.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.
@@ -6,7 +6,12 @@ import { existsSync, readdirSync, readFileSync } from "node:fs"
6
6
  import { basename, join } from "node:path"
7
7
  import { getAgentDir, parseFrontmatter } from "@earendil-works/pi-coding-agent"
8
8
  import { BUILTIN_TOOL_NAMES } from "./agent-types.js"
9
- import type { AgentConfig, MemoryScope, ThinkingLevel } from "./types.js"
9
+ import type {
10
+ AgentConfig,
11
+ IsolationMode,
12
+ MemoryScope,
13
+ ThinkingLevel,
14
+ } from "./types.js"
10
15
 
11
16
  interface WarningState {
12
17
  previous: Set<string>
@@ -124,7 +129,7 @@ function loadFromDir(
124
129
  : undefined,
125
130
  isolated: fm.isolated != null ? fm.isolated === true : undefined,
126
131
  memory: parseMemory(fm.memory),
127
- isolation: fm.isolation === "worktree" ? "worktree" : undefined,
132
+ isolation: parseIsolation(fm.isolation),
128
133
  enabled: fm.enabled !== false, // default true; explicitly false disables
129
134
  source,
130
135
  sourcePath: path,
@@ -270,6 +275,25 @@ function parseMemory(val: unknown): MemoryScope | undefined {
270
275
  return undefined
271
276
  }
272
277
 
278
+ /**
279
+ * Parse the `isolation` frontmatter field.
280
+ *
281
+ * `off` is kept as a value rather than folded into `undefined` because the two
282
+ * do not mean the same thing here: agent config outranks tool-call params, so
283
+ * `off` vetoes a caller's `worktree` while an absent field lets it through.
284
+ *
285
+ * pi's frontmatter parser is not YAML 1.1 — bare `off` and `no` arrive as
286
+ * strings and only `false` becomes a boolean — so all three spellings are
287
+ * accepted rather than leaving an author's intent silently dropped. Anything
288
+ * else stays `undefined`, as before.
289
+ */
290
+ function parseIsolation(val: unknown): IsolationMode | undefined {
291
+ if (val === "worktree") return "worktree"
292
+ if (val === "off" || val === "none" || val === "no" || val === false)
293
+ return "off"
294
+ return undefined
295
+ }
296
+
273
297
  /**
274
298
  * Parse an inherit field (extensions, skills).
275
299
  * omitted/true → true (inherit all); false/"none"/empty → false; csv → listed names.