@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.
- package/CHANGELOG.md +14 -0
- package/README.md +46 -25
- package/examples/agent-tool-description.md +5 -5
- package/package.json +7 -7
- package/src/agent-file-toggle.ts +7 -1
- package/src/agent-manager.ts +48 -19
- package/src/agent-runner.ts +17 -13
- package/src/cross-extension-rpc.ts +15 -4
- package/src/custom-agents.ts +26 -2
- package/src/index.ts +235 -40
- package/src/invocation-config.ts +101 -3
- package/src/nested-tools.ts +18 -4
- package/src/settings.ts +99 -0
- package/src/types.ts +22 -3
- package/src/ui/agent-widget.ts +51 -3
- package/src/ui/conversation-viewer.ts +25 -3
- package/src/ui/fleet-list.ts +21 -6
- package/src/usage.ts +129 -1
- package/src/worktree.ts +20 -0
package/src/custom-agents.ts
CHANGED
|
@@ -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 {
|
|
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
|
|
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.
|