pi-subagents 0.70.0 → 0.70.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 +25 -0
- package/README.md +1 -1
- package/agents/claude-code-writer.md +1 -0
- package/agents/codex-exec-writer.md +1 -0
- package/agents/cursor-agent-writer.md +1 -0
- package/agents/worker.md +1 -0
- package/docs/agents.md +6 -7
- package/docs/configuration.md +2 -0
- package/docs/extension-api.md +2 -0
- package/docs/models.md +1 -1
- package/docs/observability.md +1 -1
- package/docs/standalone-background.md +4 -4
- package/docs/tool-reference.md +3 -7
- package/inspector-runner.mjs +1 -1
- package/package.json +1 -1
- package/skills/pi-subagents/SKILL.md +1 -0
- package/skills/pi-subagents/references/management-authoring-rpc.md +1 -1
- package/skills/pi-subagents/references/multi-lane-orchestration.md +8 -0
- package/skills/pi-subagents/references/prompting-and-roles.md +14 -13
- package/src/agents/agent-management.d.ts.map +1 -1
- package/src/agents/agent-management.js +11 -25
- package/src/agents/agent-management.js.map +1 -1
- package/src/agents/agent-serializer.d.ts.map +1 -1
- package/src/agents/agent-serializer.js +0 -4
- package/src/agents/agent-serializer.js.map +1 -1
- package/src/agents/agents.d.ts +17 -4
- package/src/agents/agents.d.ts.map +1 -1
- package/src/agents/agents.js +39 -22
- package/src/agents/agents.js.map +1 -1
- package/src/agents/runtime-agent-registry.d.ts +8 -3
- package/src/agents/runtime-agent-registry.d.ts.map +1 -1
- package/src/agents/runtime-agent-registry.js +14 -9
- package/src/agents/runtime-agent-registry.js.map +1 -1
- package/src/extension/index.js +1 -1
- package/src/extension/index.js.map +1 -1
- package/src/runs/background/async-execution.d.ts.map +1 -1
- package/src/runs/background/async-execution.js +0 -34
- package/src/runs/background/async-execution.js.map +1 -1
- package/src/runs/background/async-resume.d.ts.map +1 -1
- package/src/runs/background/async-resume.js +1 -4
- package/src/runs/background/async-resume.js.map +1 -1
- package/src/runs/background/run-status.d.ts.map +1 -1
- package/src/runs/background/run-status.js +6 -4
- package/src/runs/background/run-status.js.map +1 -1
- package/src/runs/background/runner-aliases.d.ts.map +1 -1
- package/src/runs/background/runner-aliases.js +26 -15
- package/src/runs/background/runner-aliases.js.map +1 -1
- package/src/runs/background/subagent-runner.d.ts +1 -5
- package/src/runs/background/subagent-runner.d.ts.map +1 -1
- package/src/runs/background/subagent-runner.js +31 -113
- package/src/runs/background/subagent-runner.js.map +1 -1
- package/src/runs/foreground/execution.d.ts.map +1 -1
- package/src/runs/foreground/execution.js +0 -97
- package/src/runs/foreground/execution.js.map +1 -1
- package/src/runs/foreground/subagent-executor.d.ts.map +1 -1
- package/src/runs/foreground/subagent-executor.js +0 -2
- package/src/runs/foreground/subagent-executor.js.map +1 -1
- package/src/runs/shared/acceptance.d.ts.map +1 -1
- package/src/runs/shared/acceptance.js +7 -40
- package/src/runs/shared/acceptance.js.map +1 -1
- package/src/runs/shared/child-hooks.d.ts +1 -3
- package/src/runs/shared/child-hooks.d.ts.map +1 -1
- package/src/runs/shared/child-hooks.js +1 -16
- package/src/runs/shared/child-hooks.js.map +1 -1
- package/src/runs/shared/child-launch.d.ts +0 -2
- package/src/runs/shared/child-launch.d.ts.map +1 -1
- package/src/runs/shared/child-launch.js +1 -2
- package/src/runs/shared/child-launch.js.map +1 -1
- package/src/runs/shared/child-session.d.ts +8 -9
- package/src/runs/shared/child-session.d.ts.map +1 -1
- package/src/runs/shared/child-session.js +67 -2
- package/src/runs/shared/child-session.js.map +1 -1
- package/src/runs/shared/dynamic-fanout.js +1 -1
- package/src/runs/shared/dynamic-fanout.js.map +1 -1
- package/src/runs/shared/parallel-utils.d.ts +0 -1
- package/src/runs/shared/parallel-utils.d.ts.map +1 -1
- package/src/runs/shared/parallel-utils.js.map +1 -1
- package/src/runs/shared/single-output.d.ts.map +1 -1
- package/src/runs/shared/single-output.js +10 -2
- package/src/runs/shared/single-output.js.map +1 -1
- package/src/runs/shared/subagent-control.d.ts.map +1 -1
- package/src/runs/shared/subagent-control.js +6 -19
- package/src/runs/shared/subagent-control.js.map +1 -1
- package/src/shared/launch-contract.d.ts.map +1 -1
- package/src/shared/launch-contract.js +0 -1
- package/src/shared/launch-contract.js.map +1 -1
- package/src/shared/pruned-fork.d.ts +1 -1
- package/src/shared/pruned-fork.d.ts.map +1 -1
- package/src/shared/pruned-fork.js +2 -9
- package/src/shared/pruned-fork.js.map +1 -1
- package/src/shared/types.d.ts +3 -10
- package/src/shared/types.d.ts.map +1 -1
- package/src/shared/types.js.map +1 -1
- package/src/slash/slash-commands.js +1 -1
- package/src/slash/slash-commands.js.map +1 -1
- package/src/slash/subagents-admin.d.ts.map +1 -1
- package/src/slash/subagents-admin.js +4 -5
- package/src/slash/subagents-admin.js.map +1 -1
- package/src/tui/render.d.ts.map +1 -1
- package/src/tui/render.js +8 -7
- package/src/tui/render.js.map +1 -1
- package/src/watchdog/permission-arbiter.d.ts.map +1 -1
- package/src/watchdog/permission-arbiter.js +13 -8
- package/src/watchdog/permission-arbiter.js.map +1 -1
- package/src/watchdog/review.d.ts +2 -1
- package/src/watchdog/review.d.ts.map +1 -1
- package/src/watchdog/review.js +13 -6
- package/src/watchdog/review.js.map +1 -1
- package/src/workflows/scripted-workflow.d.ts.map +1 -1
- package/src/workflows/scripted-workflow.js +1 -3
- package/src/workflows/scripted-workflow.js.map +1 -1
- package/src/runs/shared/completion-evidence.d.ts +0 -31
- package/src/runs/shared/completion-evidence.d.ts.map +0 -1
- package/src/runs/shared/completion-evidence.js +0 -54
- package/src/runs/shared/completion-evidence.js.map +0 -1
- package/src/runs/shared/completion-guard.d.ts +0 -35
- package/src/runs/shared/completion-guard.d.ts.map +0 -1
- package/src/runs/shared/completion-guard.js +0 -214
- package/src/runs/shared/completion-guard.js.map +0 -1
- package/src/runs/shared/llm-intent-arbiter.d.ts +0 -48
- package/src/runs/shared/llm-intent-arbiter.d.ts.map +0 -1
- package/src/runs/shared/llm-intent-arbiter.js +0 -235
- package/src/runs/shared/llm-intent-arbiter.js.map +0 -1
- package/src/runs/shared/task-intent.d.ts +0 -38
- package/src/runs/shared/task-intent.d.ts.map +0 -1
- package/src/runs/shared/task-intent.js +0 -213
- package/src/runs/shared/task-intent.js.map +0 -1
package/src/agents/agents.js
CHANGED
|
@@ -510,7 +510,6 @@ function cloneOverrideBase(agent) {
|
|
|
510
510
|
...(!agent.extensionsFromDefault && agent.extensions ? { extensions: [...agent.extensions] } : {}),
|
|
511
511
|
...(agent.subagentOnlyExtensions ? { subagentOnlyExtensions: [...agent.subagentOnlyExtensions] } : {}),
|
|
512
512
|
...(agent.mutationTools ? { mutationTools: [...agent.mutationTools] } : {}),
|
|
513
|
-
...(agent.completionGuard !== undefined ? { completionGuard: agent.completionGuard } : {}),
|
|
514
513
|
...(agent.toolBudget !== undefined ? { toolBudget: agent.toolBudget } : {}),
|
|
515
514
|
};
|
|
516
515
|
}
|
|
@@ -541,7 +540,6 @@ function cloneOverrideValue(override) {
|
|
|
541
540
|
...(override.extensions !== undefined ? { extensions: override.extensions === false ? false : [...override.extensions] } : {}),
|
|
542
541
|
...(override.subagentOnlyExtensions !== undefined ? { subagentOnlyExtensions: override.subagentOnlyExtensions === false ? false : [...override.subagentOnlyExtensions] } : {}),
|
|
543
542
|
...(override.mutationTools !== undefined ? { mutationTools: override.mutationTools === false ? false : [...override.mutationTools] } : {}),
|
|
544
|
-
...(override.completionGuard !== undefined ? { completionGuard: override.completionGuard } : {}),
|
|
545
543
|
...(override.toolBudget !== undefined ? { toolBudget: override.toolBudget === false ? false : { ...override.toolBudget, ...(Array.isArray(override.toolBudget.block) ? { block: [...override.toolBudget.block] } : {}) } } : {}),
|
|
546
544
|
};
|
|
547
545
|
}
|
|
@@ -804,14 +802,6 @@ function parseBuiltinOverrideEntry(name, value, filePath) {
|
|
|
804
802
|
throw new Error(`Builtin override '${name}' in '${filePath}' has invalid 'disabled'; expected a boolean.`);
|
|
805
803
|
}
|
|
806
804
|
}
|
|
807
|
-
if ("completionGuard" in input) {
|
|
808
|
-
if (typeof input.completionGuard === "boolean") {
|
|
809
|
-
override.completionGuard = input.completionGuard;
|
|
810
|
-
}
|
|
811
|
-
else {
|
|
812
|
-
throw new Error(`Builtin override '${name}' in '${filePath}' has invalid 'completionGuard'; expected a boolean.`);
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
805
|
if ("toolBudget" in input) {
|
|
816
806
|
if (input.toolBudget === false) {
|
|
817
807
|
override.toolBudget = false;
|
|
@@ -1263,8 +1253,6 @@ function applyBuiltinOverride(agent, override, meta) {
|
|
|
1263
1253
|
else
|
|
1264
1254
|
next.mutationTools = [...override.mutationTools];
|
|
1265
1255
|
}
|
|
1266
|
-
if (override.completionGuard !== undefined)
|
|
1267
|
-
next.completionGuard = override.completionGuard;
|
|
1268
1256
|
if (override.toolBudget !== undefined) {
|
|
1269
1257
|
if (override.toolBudget === false)
|
|
1270
1258
|
delete next.toolBudget;
|
|
@@ -1331,6 +1319,43 @@ function applyCustomAgentOverrides(agents, userSettings, projectSettings, userSe
|
|
|
1331
1319
|
return withUserOverride;
|
|
1332
1320
|
});
|
|
1333
1321
|
}
|
|
1322
|
+
function runtimeAgentOverrides(settings) {
|
|
1323
|
+
const overrides = {};
|
|
1324
|
+
for (const [name, override] of Object.entries(settings.overrides)) {
|
|
1325
|
+
const narrowed = {};
|
|
1326
|
+
if (override.model !== undefined)
|
|
1327
|
+
narrowed.model = override.model;
|
|
1328
|
+
if (override.defaultProvider !== undefined)
|
|
1329
|
+
narrowed.defaultProvider = override.defaultProvider;
|
|
1330
|
+
if (override.fast !== undefined)
|
|
1331
|
+
narrowed.fast = override.fast;
|
|
1332
|
+
if (override.thinking !== undefined)
|
|
1333
|
+
narrowed.thinking = override.thinking;
|
|
1334
|
+
if (Object.keys(narrowed).length > 0)
|
|
1335
|
+
overrides[name] = narrowed;
|
|
1336
|
+
}
|
|
1337
|
+
return { ...settings, overrides };
|
|
1338
|
+
}
|
|
1339
|
+
/**
|
|
1340
|
+
* Runtime-registered agents keep their extension-owned definition (prompt,
|
|
1341
|
+
* tools, context, budgets, and every other launch field) but follow the same
|
|
1342
|
+
* model-tier settings as every other agent: `subagents.defaultModel`,
|
|
1343
|
+
* `defaultProvider`, `defaultThinking`, and the `model`, `defaultProvider`,
|
|
1344
|
+
* `fast`, and `thinking` fields of `agentOverrides.<name>`, user then project,
|
|
1345
|
+
* provider-scoped overrides included. Other override fields are ignored for
|
|
1346
|
+
* runtime agents. A definition `model` still wins over `defaultModel`.
|
|
1347
|
+
*/
|
|
1348
|
+
export function applyRuntimeAgentSettings(agents, context) {
|
|
1349
|
+
if (agents.length === 0)
|
|
1350
|
+
return agents;
|
|
1351
|
+
const sources = getAgentDiscoverySources(context.cwd, context.preferredModelProvider);
|
|
1352
|
+
const { user, project } = settingsForScope(sources, context.scope);
|
|
1353
|
+
const defaultProvider = resolveSubagentDefaultProvider(user, project, sources.projectSettingsPath);
|
|
1354
|
+
const defaultModel = resolveSubagentDefaultModel(user, project, sources.userSettingsPath, sources.projectSettingsPath, defaultProvider);
|
|
1355
|
+
const defaultThinking = resolveSubagentDefaultThinking(user, project, sources.projectSettingsPath);
|
|
1356
|
+
const withDefaults = applySubagentDefaultThinking(applySubagentDefaultModel(agents, defaultModel, defaultProvider), defaultThinking);
|
|
1357
|
+
return applyCustomAgentOverrides(withDefaults, runtimeAgentOverrides(user), runtimeAgentOverrides(project), sources.userSettingsPath, sources.projectSettingsPath);
|
|
1358
|
+
}
|
|
1334
1359
|
export function buildBuiltinOverrideConfig(base, draft) {
|
|
1335
1360
|
const override = {};
|
|
1336
1361
|
if (draft.machine !== base.machine)
|
|
@@ -1387,9 +1412,6 @@ export function buildBuiltinOverrideConfig(base, draft) {
|
|
|
1387
1412
|
}
|
|
1388
1413
|
if (!arraysEqual(draft.mutationTools, base.mutationTools))
|
|
1389
1414
|
override.mutationTools = draft.mutationTools ? [...draft.mutationTools] : false;
|
|
1390
|
-
if ((draft.completionGuard !== false) !== (base.completionGuard !== false)) {
|
|
1391
|
-
override.completionGuard = draft.completionGuard !== false;
|
|
1392
|
-
}
|
|
1393
1415
|
if (JSON.stringify(draft.toolBudget) !== JSON.stringify(base.toolBudget))
|
|
1394
1416
|
override.toolBudget = draft.toolBudget ?? false;
|
|
1395
1417
|
return Object.keys(override).length > 0 ? override : undefined;
|
|
@@ -1741,7 +1763,7 @@ function parseAgentRunnerFrontmatter(raw, agentName) {
|
|
|
1741
1763
|
function validateExternalRunnerProfile(frontmatter, agentName, runner) {
|
|
1742
1764
|
if (runner?.type !== "external-cli" && runner?.type !== "external-job")
|
|
1743
1765
|
return;
|
|
1744
|
-
const unsupported = ["tools", "excludeTools", "allowNestedSubagents", "allowedAgents", "model", "thinking", "extensions", "subagentOnlyExtensions", "mutationTools", "maxSubagentDepth", "
|
|
1766
|
+
const unsupported = ["tools", "excludeTools", "allowNestedSubagents", "allowedAgents", "model", "thinking", "extensions", "subagentOnlyExtensions", "mutationTools", "maxSubagentDepth", "skills", "skill", "skillPath", "toolBudget", "permission", "permissions"]
|
|
1745
1767
|
.filter((field) => frontmatter[field] !== undefined);
|
|
1746
1768
|
if (unsupported.length > 0) {
|
|
1747
1769
|
throw new Error(`Agent '${agentName}' uses runner.type='${runner.type}' and declares unsupported Pi-only fields: ${unsupported.join(", ")}.`);
|
|
@@ -1946,11 +1968,6 @@ function loadAgentsFromDefinitionFiles(files, source, discoveryPriority, package
|
|
|
1946
1968
|
assertJsonSchemaObject(parsed, `Agent '${localName}' outputSchema`);
|
|
1947
1969
|
outputSchema = parsed;
|
|
1948
1970
|
}
|
|
1949
|
-
const completionGuard = frontmatter.completionGuard === "false"
|
|
1950
|
-
? false
|
|
1951
|
-
: frontmatter.completionGuard === "true"
|
|
1952
|
-
? true
|
|
1953
|
-
: undefined;
|
|
1954
1971
|
const maxSubagentDepth = Number.isInteger(parsedMaxSubagentDepth) && parsedMaxSubagentDepth >= 0
|
|
1955
1972
|
? parsedMaxSubagentDepth
|
|
1956
1973
|
: undefined;
|
|
@@ -2002,7 +2019,6 @@ function loadAgentsFromDefinitionFiles(files, source, discoveryPriority, package
|
|
|
2002
2019
|
defaultProgress: frontmatter.defaultProgress === "true",
|
|
2003
2020
|
interactive: frontmatter.interactive === "true",
|
|
2004
2021
|
...(maxSubagentDepth !== undefined ? { maxSubagentDepth } : {}),
|
|
2005
|
-
...(completionGuard !== undefined ? { completionGuard } : {}),
|
|
2006
2022
|
...(toolBudget !== undefined ? { toolBudget } : {}),
|
|
2007
2023
|
...(permissions !== undefined ? { permissions } : {}),
|
|
2008
2024
|
...(memory !== undefined ? { memory } : {}),
|
|
@@ -2540,6 +2556,7 @@ function buildAllDiscovery(sources, includeChains, settingsScope) {
|
|
|
2540
2556
|
],
|
|
2541
2557
|
chains,
|
|
2542
2558
|
chainDiagnostics: [...packageChainDiagnostics, ...(sources.userChains?.diagnostics ?? []), ...projectChainDiagnostics],
|
|
2559
|
+
cwd: sources.cwd,
|
|
2543
2560
|
userDir: sources.userDir,
|
|
2544
2561
|
projectDir: sources.projectAgentsDir,
|
|
2545
2562
|
userChainDir: sources.userChainDir,
|