@xzzpig/pi-subagents 0.8.0 → 0.9.0
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 +443 -0
- package/README.md +2 -2
- package/agents/claude-code-writer.md +15 -0
- package/agents/claude-code.md +15 -0
- package/agents/codex-exec-writer.md +15 -0
- package/agents/codex-exec.md +15 -0
- package/agents/cursor-agent-writer.md +14 -0
- package/agents/cursor-agent.md +14 -0
- package/agents/reviewer.md +1 -1
- package/agents/scout.md +1 -1
- package/docs/agents.md +151 -39
- package/docs/configuration.md +81 -22
- package/docs/extension-api.md +69 -14
- package/docs/missions.md +2 -0
- package/docs/models.md +32 -9
- package/docs/observability.md +22 -20
- package/docs/tool-reference.md +123 -14
- package/docs/watchdog.md +92 -114
- package/docs/workflows.md +142 -4
- package/install.mjs +1 -1
- package/package.json +5 -4
- package/prompts/review-loop.md +2 -2
- package/skills/council-mode/SKILL.md +48 -243
- package/skills/council-mode/references/pass-contracts.md +150 -0
- package/skills/pi-subagents/SKILL.md +89 -35
- package/skills/pi-subagents/references/constraints-and-recipes.md +30 -234
- package/skills/pi-subagents/references/execution-controls.md +91 -15
- package/skills/pi-subagents/references/management-authoring-rpc.md +5 -5
- package/skills/pi-subagents/references/multi-lane-orchestration.md +13 -1
- package/skills/pi-subagents/references/prompting-and-roles.md +59 -31
- package/skills/pi-subagents/references/review-and-validation.md +73 -0
- package/src/agents/agent-management.ts +370 -114
- package/src/agents/agent-refinements.ts +4 -4
- package/src/agents/agent-serializer.ts +12 -2
- package/src/agents/agents.ts +919 -372
- package/src/agents/builtin-names.ts +6 -0
- package/src/agents/runtime-agent-events.ts +70 -0
- package/src/agents/runtime-agent-registry.ts +31 -20
- package/src/api/agents.ts +10 -5
- package/src/api/background-work.ts +12 -3
- package/src/api/capability-ceiling.ts +0 -1
- package/src/api/{pi-args.ts → child-tool-plan.ts} +1 -1
- package/src/api/delegation.ts +0 -7
- package/src/api/external-runs.ts +67 -4
- package/src/api/preflight.ts +48 -18
- package/src/api/shared-types.ts +6 -0
- package/src/extension/config.ts +90 -0
- package/src/extension/doctor.ts +5 -13
- package/src/extension/fanout-child.ts +14 -14
- package/src/extension/index.ts +115 -37
- package/src/extension/public-execution.ts +103 -15
- package/src/extension/rpc.ts +120 -25
- package/src/extension/schemas.ts +57 -21
- package/src/extension/tool-description.ts +48 -26
- package/src/inspectors/herdr/actions.ts +2 -1
- package/src/inspectors/herdr/inspector-runner.ts +21 -23
- package/src/inspectors/herdr/session-roots-codec.ts +42 -0
- package/src/integrations/herdr-status.ts +51 -3
- package/src/intercom/native-supervisor-channel.ts +138 -60
- package/src/intercom/result-intercom.ts +2 -0
- package/src/intercom/supervisor-ui.ts +243 -0
- package/src/profiles/profiles.ts +5 -6
- package/src/runs/background/active-async-capacity.ts +103 -18
- package/src/runs/background/async-execution.ts +366 -128
- package/src/runs/background/async-job-tracker.ts +95 -15
- package/src/runs/background/async-resume.ts +45 -28
- package/src/runs/background/async-retention.ts +20 -3
- package/src/runs/background/async-status-snapshot.ts +23 -261
- package/src/runs/background/async-status.ts +189 -14
- package/src/runs/background/auto-drain.ts +1 -1
- package/src/runs/background/chain-append.ts +8 -3
- package/src/runs/background/chain-root-attachment.ts +74 -8
- package/src/runs/background/control-channel.ts +4 -205
- package/src/runs/background/fleet-view.ts +38 -22
- package/src/runs/background/inspect-rpc.ts +8 -8
- package/src/runs/background/notify.ts +238 -12
- package/src/runs/background/process-terminal.ts +16 -0
- package/src/runs/background/result-delivery-ownership.ts +45 -0
- package/src/runs/background/result-files.ts +28 -14
- package/src/runs/background/result-watcher.ts +39 -16
- package/src/runs/background/resume-guidance.ts +2 -2
- package/src/runs/background/retained-children.ts +1 -1
- package/src/runs/background/run-child-session.ts +613 -0
- package/src/runs/background/run-status.ts +84 -17
- package/src/runs/background/runner-aliases.ts +125 -0
- package/src/runs/background/runner-child-sessions.ts +31 -0
- package/src/runs/background/scheduled-runs.ts +174 -18
- package/src/runs/background/stale-run-reconciler.ts +10 -4
- package/src/runs/background/steering.ts +8 -15
- package/src/runs/background/subagent-runner.ts +676 -1161
- package/src/runs/background/subagent-wait.ts +86 -31
- package/src/runs/background/terminal-run-index.ts +1 -1
- package/src/runs/background/wait-completions.ts +43 -2
- package/src/runs/background/wait-config.ts +23 -9
- package/src/runs/background/wait-tool.ts +26 -19
- package/src/runs/foreground/async-steering-action.ts +3 -19
- package/src/runs/foreground/execution.ts +468 -499
- package/src/runs/foreground/foreground-control.ts +13 -0
- package/src/runs/foreground/foreground-history.ts +23 -1
- package/src/runs/foreground/subagent-executor.ts +1172 -400
- package/src/runs/foreground/workflow-detach-reconcile.ts +140 -115
- package/src/runs/foreground/workflow-foreground-steering.ts +24 -98
- package/src/runs/shared/abort-recovery.ts +119 -0
- package/src/runs/shared/acceptance.ts +138 -36
- package/src/runs/shared/async-status-projection.ts +565 -0
- package/src/runs/shared/background-process-options.ts +9 -0
- package/src/runs/shared/capability-ceiling.ts +2 -2
- package/src/runs/shared/child-hooks.ts +25 -0
- package/src/runs/shared/child-identity.ts +32 -6
- package/src/runs/shared/child-launch-plan.ts +151 -0
- package/src/runs/shared/child-launch.ts +314 -0
- package/src/runs/shared/child-lifecycle.ts +25 -0
- package/src/runs/shared/child-runtime-config.ts +126 -0
- package/src/runs/shared/child-session.ts +342 -0
- package/src/runs/shared/child-tool-plan.ts +540 -0
- package/src/runs/shared/claude-code-adapter.ts +133 -0
- package/src/runs/shared/codex-exec-adapter.ts +129 -0
- package/src/runs/shared/completion-evidence.ts +89 -0
- package/src/runs/shared/completion-guard.ts +6 -5
- package/src/runs/shared/cursor-agent-adapter.ts +114 -0
- package/src/runs/shared/dynamic-fanout.ts +3 -3
- package/src/runs/shared/external-cli-contract.ts +167 -0
- package/src/runs/shared/external-cli-preflight.ts +138 -0
- package/src/runs/shared/external-cli-runner.ts +348 -55
- package/src/runs/shared/fast-mode-extension.ts +5 -5
- package/src/runs/shared/host-step-status.ts +231 -0
- package/src/runs/shared/lane-metadata.ts +126 -0
- package/src/runs/shared/launch-cwd.ts +16 -0
- package/src/runs/shared/long-running-guard.ts +2 -1
- package/src/runs/shared/mcp-config-sources.ts +422 -0
- package/src/runs/shared/mcp-direct-tool-allowlist.ts +222 -158
- package/src/runs/shared/mcp-direct-tool-grant.ts +194 -0
- package/src/runs/shared/model-exclusions.ts +139 -9
- package/src/runs/shared/model-fallback.ts +142 -14
- package/src/runs/shared/mutation-evidence.ts +57 -3
- package/src/runs/shared/nested-events.ts +38 -48
- package/src/runs/shared/nested-path.ts +0 -14
- package/src/runs/shared/nested-render.ts +9 -5
- package/src/runs/shared/orca-progress-tabs.ts +12 -7
- package/src/runs/shared/parallel-handoff.ts +423 -7
- package/src/runs/shared/parallel-utils.ts +15 -7
- package/src/runs/shared/permissions.ts +1 -14
- package/src/runs/shared/pi-spawn.ts +69 -35
- package/src/runs/shared/process-signal.ts +16 -0
- package/src/runs/shared/run-fanout-budget.ts +0 -13
- package/src/runs/shared/run-history.ts +21 -1
- package/src/runs/shared/runtime-acknowledged-extensions.ts +0 -27
- package/src/runs/shared/single-output.ts +89 -22
- package/src/runs/shared/structured-output.ts +49 -9
- package/src/runs/shared/subagent-control.ts +6 -2
- package/src/runs/shared/subagent-prompt-runtime.ts +188 -365
- package/src/runs/shared/task-intent.ts +21 -7
- package/src/runs/shared/tool-availability.ts +18 -62
- package/src/runs/shared/tool-budget.ts +0 -14
- package/src/runs/shared/tool-timeout.ts +1 -1
- package/src/runs/shared/workflow-graph.ts +16 -0
- package/src/runs/shared/worktree-cleanup-plan.ts +866 -0
- package/src/runs/shared/worktree.ts +571 -62
- package/src/shared/atomic-json.ts +3 -1
- package/src/shared/child-session-name.ts +46 -0
- package/src/shared/extension-context.ts +24 -0
- package/src/shared/fork-context.ts +21 -12
- package/src/shared/fork-session-cwd.ts +27 -0
- package/src/shared/formatters.ts +18 -3
- package/src/shared/jsonl-writer.ts +11 -0
- package/src/shared/launch-contract.ts +8 -1
- package/src/shared/pruned-fork.ts +450 -0
- package/src/shared/session-file-trust.ts +19 -0
- package/src/shared/session-tokens.ts +14 -3
- package/src/shared/settings.ts +19 -105
- package/src/shared/shortcuts.ts +17 -0
- package/src/shared/thinking-ceiling.ts +0 -6
- package/src/shared/types.ts +524 -70
- package/src/shared/utils.ts +60 -93
- package/src/shared/workflow-child-permit.ts +207 -0
- package/src/slash/delegation-adapters.ts +1 -9
- package/src/slash/delegation-request.ts +0 -4
- package/src/slash/prompt-template-bridge.ts +37 -1
- package/src/slash/slash-bridge.ts +1 -2
- package/src/slash/slash-commands.ts +383 -116
- package/src/slash/slash-live-state.ts +22 -11
- package/src/slash/subagents-admin.ts +29 -12
- package/src/tui/fleet-native-transcript.ts +4 -0
- package/src/tui/fleet-status.ts +217 -82
- package/src/tui/fleet-transcript.ts +11 -5
- package/src/tui/fleet.ts +54 -28
- package/src/tui/render-helpers.ts +31 -0
- package/src/tui/render.ts +1429 -163
- package/src/watchdog/change-signature.ts +40 -1
- package/src/watchdog/child-status.ts +54 -34
- package/src/watchdog/diff-tool.ts +77 -0
- package/src/watchdog/emission-guard.ts +5 -3
- package/src/watchdog/guidance.ts +20 -0
- package/src/watchdog/register-child.ts +28 -25
- package/src/watchdog/register-main.ts +10 -9
- package/src/watchdog/render.ts +4 -5
- package/src/watchdog/review.ts +15 -4
- package/src/watchdog/rules.ts +70 -0
- package/src/watchdog/runtime.ts +75 -92
- package/src/watchdog/scope.ts +0 -11
- package/src/watchdog/settings.ts +48 -104
- package/src/watchdog/turn-delta.ts +1 -1
- package/src/watchdog/types.ts +18 -32
- package/src/watchdog/warning-format.ts +0 -1
- package/src/workflows/chat-progress.ts +7 -3
- package/src/workflows/host-command.ts +235 -0
- package/src/workflows/scripted-workflow.ts +988 -59
- package/src/workflows/workflow-checklist.ts +439 -0
- package/src/workflows/workflow-child-summary.ts +121 -0
- package/src/workflows/workflow-preflight.ts +297 -0
- package/src/workflows/workflow-receipt.ts +232 -6
- package/src/workflows/workflow-resources.ts +150 -0
- package/src/workflows/workflow-settlement.ts +246 -0
- package/src/runs/shared/child-protocol.ts +0 -401
- package/src/runs/shared/pi-args.ts +0 -935
- package/src/runs/shared/subagent-startup-retry.ts +0 -116
- package/src/runs/shared/turn-budget.ts +0 -98
- package/src/shared/post-exit-stdio-guard.ts +0 -85
|
@@ -2,6 +2,7 @@ import type { AgentToolResult } from "@earendil-works/pi-agent-core";
|
|
|
2
2
|
import type { Message } from "@earendil-works/pi-ai";
|
|
3
3
|
import type { SubagentParamsLike } from "../runs/foreground/subagent-executor.ts";
|
|
4
4
|
import { previewSimpleWorkflowRun } from "../workflows/scripted-workflow.ts";
|
|
5
|
+
import { deriveChildSessionName } from "../shared/child-session-name.ts";
|
|
5
6
|
import type { SlashSubagentResponse, SlashSubagentUpdate } from "./slash-bridge.ts";
|
|
6
7
|
import { type Details, type SingleResult, type Usage, SLASH_RESULT_TYPE } from "../shared/types.ts";
|
|
7
8
|
|
|
@@ -54,9 +55,11 @@ function createPlaceholderResult(
|
|
|
54
55
|
status: "pending" | "running",
|
|
55
56
|
index: number,
|
|
56
57
|
): SingleResult {
|
|
58
|
+
const sessionName = deriveChildSessionName({ agent, task });
|
|
57
59
|
return {
|
|
58
60
|
agent,
|
|
59
61
|
task,
|
|
62
|
+
...(sessionName ? { sessionName } : {}),
|
|
60
63
|
index,
|
|
61
64
|
exitCode: 0,
|
|
62
65
|
messages: EMPTY_MESSAGES,
|
|
@@ -64,6 +67,7 @@ function createPlaceholderResult(
|
|
|
64
67
|
progress: {
|
|
65
68
|
index,
|
|
66
69
|
agent,
|
|
70
|
+
...(sessionName ? { sessionName } : {}),
|
|
67
71
|
status,
|
|
68
72
|
task,
|
|
69
73
|
recentTools: [],
|
|
@@ -84,17 +88,21 @@ function buildParallelInitialResult(params: SubagentParamsLike): AgentToolResult
|
|
|
84
88
|
...(params.async ? { background: true } : {}),
|
|
85
89
|
...(params.context === "fresh" || params.context === "fork" ? { context: params.context } : {}),
|
|
86
90
|
results: tasks.map((task, index) => createPlaceholderResult(task.agent, task.task, "running", index)),
|
|
87
|
-
progress: tasks.map((task, index) =>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
progress: tasks.map((task, index) => {
|
|
92
|
+
const sessionName = deriveChildSessionName({ agent: task.agent, task: task.task });
|
|
93
|
+
return {
|
|
94
|
+
index,
|
|
95
|
+
agent: task.agent,
|
|
96
|
+
...(sessionName ? { sessionName } : {}),
|
|
97
|
+
status: "running" as const,
|
|
98
|
+
task: task.task,
|
|
99
|
+
recentTools: [],
|
|
100
|
+
recentOutput: [],
|
|
101
|
+
toolCount: 0,
|
|
102
|
+
tokens: 0,
|
|
103
|
+
durationMs: 0,
|
|
104
|
+
};
|
|
105
|
+
}),
|
|
98
106
|
},
|
|
99
107
|
};
|
|
100
108
|
}
|
|
@@ -143,6 +151,7 @@ function buildChainInitialResult(params: SubagentParamsLike): AgentToolResult<De
|
|
|
143
151
|
progress: results.map((result, index) => ({
|
|
144
152
|
index,
|
|
145
153
|
agent: result.agent,
|
|
154
|
+
...(result.sessionName ? { sessionName: result.sessionName } : {}),
|
|
146
155
|
status: index === 0 ? "running" as const : "pending" as const,
|
|
147
156
|
task: result.task,
|
|
148
157
|
recentTools: [],
|
|
@@ -162,6 +171,7 @@ function buildSingleInitialResult(params: SubagentParamsLike): AgentToolResult<D
|
|
|
162
171
|
const preview = previewSimpleWorkflowRun(params.workflowScript) ?? {};
|
|
163
172
|
const agent = params.agent ?? preview.agent ?? "subagent";
|
|
164
173
|
const task = params.task ?? preview.task ?? "";
|
|
174
|
+
const sessionName = deriveChildSessionName({ agent, task });
|
|
165
175
|
return {
|
|
166
176
|
content: [{ type: "text", text: task }],
|
|
167
177
|
details: {
|
|
@@ -172,6 +182,7 @@ function buildSingleInitialResult(params: SubagentParamsLike): AgentToolResult<D
|
|
|
172
182
|
progress: [{
|
|
173
183
|
index: 0,
|
|
174
184
|
agent,
|
|
185
|
+
...(sessionName ? { sessionName } : {}),
|
|
175
186
|
status: "running",
|
|
176
187
|
task,
|
|
177
188
|
recentTools: [],
|
|
@@ -2,7 +2,6 @@ import * as fs from "node:fs";
|
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
4
4
|
import {
|
|
5
|
-
agentHasFrontmatterField,
|
|
6
5
|
discoverAgentsAll,
|
|
7
6
|
EXTRA_AGENT_DIRS_ENV,
|
|
8
7
|
frontmatterNameForConfig,
|
|
@@ -89,6 +88,7 @@ function buildBuiltinBase(agent: AgentConfig): BuiltinAgentOverrideBase {
|
|
|
89
88
|
...(agent.thinking !== undefined ? { thinking: agent.thinking } : {}),
|
|
90
89
|
systemPromptMode: agent.systemPromptMode,
|
|
91
90
|
inheritProjectContext: agent.inheritProjectContext,
|
|
91
|
+
inheritGlobalContext: agent.inheritGlobalContext,
|
|
92
92
|
inheritSkills: agent.inheritSkills,
|
|
93
93
|
...(agent.defaultContext !== undefined ? { defaultContext: agent.defaultContext } : {}),
|
|
94
94
|
...(agent.acceptanceRole !== undefined ? { acceptanceRole: agent.acceptanceRole } : {}),
|
|
@@ -96,8 +96,10 @@ function buildBuiltinBase(agent: AgentConfig): BuiltinAgentOverrideBase {
|
|
|
96
96
|
systemPrompt: agent.systemPrompt,
|
|
97
97
|
...(agent.skills !== undefined ? { skills: [...agent.skills] } : {}),
|
|
98
98
|
...(agent.tools !== undefined ? { tools: [...agent.tools] } : {}),
|
|
99
|
+
...(agent.excludeTools !== undefined ? { excludeTools: [...agent.excludeTools] } : {}),
|
|
99
100
|
...(agent.mcpDirectTools !== undefined ? { mcpDirectTools: [...agent.mcpDirectTools] } : {}),
|
|
100
101
|
...(agent.subagentOnlyExtensions !== undefined ? { subagentOnlyExtensions: [...agent.subagentOnlyExtensions] } : {}),
|
|
102
|
+
...(agent.mutationTools !== undefined ? { mutationTools: [...agent.mutationTools] } : {}),
|
|
101
103
|
...(agent.completionGuard !== undefined ? { completionGuard: agent.completionGuard } : {}),
|
|
102
104
|
...(agent.toolBudget !== undefined ? { toolBudget: agent.toolBudget } : {}),
|
|
103
105
|
};
|
|
@@ -113,18 +115,15 @@ type AgentSelection =
|
|
|
113
115
|
|
|
114
116
|
function savesThroughSettings(agent: AgentConfig, field: EditableOverrideField): boolean {
|
|
115
117
|
if (agent.source === "builtin") return true;
|
|
116
|
-
if (agent.source === "package")
|
|
117
|
-
if (field === "systemPrompt") return false;
|
|
118
|
-
return !agentHasFrontmatterField(agent, field);
|
|
119
|
-
}
|
|
118
|
+
if (agent.source === "package") return true;
|
|
120
119
|
if (!agent.override) return false;
|
|
120
|
+
if (agent.override.fields?.includes(field) === true) return true;
|
|
121
121
|
// A lower-scope override can flow into a higher-scope custom agent with the
|
|
122
122
|
// same name. Persist that agent's edits in its own frontmatter instead of
|
|
123
123
|
// rewriting the shared lower-scope override used by another agent.
|
|
124
124
|
if (agent.source !== agent.override.scope) return false;
|
|
125
|
-
//
|
|
126
|
-
//
|
|
127
|
-
// not redirect edits to an unrelated frontmatter-owned field.
|
|
125
|
+
// Compare the effective value with the pre-override base so an override on one
|
|
126
|
+
// field does not redirect edits to an unrelated frontmatter-owned field.
|
|
128
127
|
return agent[field] !== agent.override.base[field];
|
|
129
128
|
}
|
|
130
129
|
|
|
@@ -186,9 +185,11 @@ function metadataFor(agent: AgentConfig): string {
|
|
|
186
185
|
if (agent.fallbackModels?.length) lines.push(`Fallback models: ${agent.fallbackModels.join(", ")}`);
|
|
187
186
|
if (agent.thinking !== undefined) lines.push(`Thinking: ${agent.thinking === false ? "off" : agent.thinking}`);
|
|
188
187
|
if (tools.length) lines.push(`Tools: ${tools.join(", ")}`);
|
|
188
|
+
if (agent.excludeTools?.length) lines.push(`Excluded tools: ${agent.excludeTools.join(", ")}`);
|
|
189
189
|
if (agent.skills?.length) lines.push(`Skills: ${agent.skills.join(", ")}`);
|
|
190
190
|
lines.push(`System prompt mode: ${agent.systemPromptMode}`);
|
|
191
191
|
lines.push(`Inherit project context: ${agent.inheritProjectContext ? "true" : "false"}`);
|
|
192
|
+
lines.push(`Inherit global context: ${agent.inheritGlobalContext ? "true" : "false"}`);
|
|
192
193
|
lines.push(`Inherit skills: ${agent.inheritSkills ? "true" : "false"}`);
|
|
193
194
|
if (agent.defaultContext) lines.push(`Default context: ${agent.defaultContext}`);
|
|
194
195
|
if (agent.output) lines.push(`Output: ${agent.output}`);
|
|
@@ -251,10 +252,12 @@ async function chooseThinking(ctx: ExtensionContext, agent: AgentConfig): Promis
|
|
|
251
252
|
}
|
|
252
253
|
|
|
253
254
|
async function chooseOverrideScope(ctx: ExtensionContext, agent: AgentConfig): Promise<"user" | "project" | undefined> {
|
|
254
|
-
if (agent.override?.scope) return agent.override.scope;
|
|
255
255
|
const d = discoverAgentsAll(ctx.cwd);
|
|
256
|
+
if (agent.override?.scope) {
|
|
257
|
+
return agent.source === "project" && agent.override.scope === "user" && d.projectSettingsPath ? "project" : agent.override.scope;
|
|
258
|
+
}
|
|
256
259
|
if (!d.projectSettingsPath || !ctx.hasUI) return "user";
|
|
257
|
-
const choice = await ctx.ui.select(`Save
|
|
260
|
+
const choice = await ctx.ui.select(`Save subagent override for ${agent.name}`, ["user", "project"]);
|
|
258
261
|
return choice === "user" || choice === "project" ? choice : undefined;
|
|
259
262
|
}
|
|
260
263
|
|
|
@@ -266,6 +269,18 @@ function persistSettingsField(
|
|
|
266
269
|
value: string | undefined,
|
|
267
270
|
): { filePath: string; overridden: boolean } {
|
|
268
271
|
const base = agent.override?.base ?? buildBuiltinBase(agent);
|
|
272
|
+
const shadowsLowerScope = scope === "project" && agent.override?.fieldScopes?.[field]?.includes("user") === true;
|
|
273
|
+
if (shadowsLowerScope && (value === undefined || value === base[field])) {
|
|
274
|
+
const filePath = field === "model"
|
|
275
|
+
? mergeBuiltinAgentOverride(ctx.cwd, agent.name, scope, { model: value ?? base.model ?? false })
|
|
276
|
+
: field === "thinking"
|
|
277
|
+
? mergeBuiltinAgentOverride(ctx.cwd, agent.name, scope, { thinking: value ?? (base.thinking === false ? "off" : base.thinking) ?? false })
|
|
278
|
+
: mergeBuiltinAgentOverride(ctx.cwd, agent.name, scope, { systemPrompt: value ?? base.systemPrompt });
|
|
279
|
+
return {
|
|
280
|
+
filePath,
|
|
281
|
+
overridden: true,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
269
284
|
if (value === undefined || value === base[field]) {
|
|
270
285
|
return {
|
|
271
286
|
filePath: removeBuiltinAgentOverrideFields(ctx.cwd, agent.name, scope, [field]).path,
|
|
@@ -353,13 +368,15 @@ async function saveAgentSystemPrompt(ctx: ExtensionContext, agent: AgentConfig,
|
|
|
353
368
|
}
|
|
354
369
|
|
|
355
370
|
async function editSystemPrompt(ctx: ExtensionContext, agent: AgentConfig): Promise<string | null> {
|
|
356
|
-
|
|
371
|
+
const saveThroughSettings = savesThroughSettings(agent, "systemPrompt");
|
|
372
|
+
if (!saveThroughSettings) {
|
|
357
373
|
const readOnlyMessage = readOnlyAgentMessage(agent, "systemPrompt");
|
|
358
374
|
if (readOnlyMessage) return readOnlyMessage;
|
|
359
375
|
}
|
|
360
376
|
const edited = await ctx.ui.editor(`Edit '${agent.name}' system prompt`, agent.systemPrompt ?? "");
|
|
361
377
|
if (edited === undefined) return null;
|
|
362
|
-
|
|
378
|
+
const projectOwnsLowerScopeOverride = agent.source === "project" && agent.override?.scope === "user" && discoverAgentsAll(ctx.cwd).projectSettingsPath;
|
|
379
|
+
if (edited.replace(/\s+$/, "") === (agent.systemPrompt ?? "").replace(/\s+$/, "") && !(saveThroughSettings && projectOwnsLowerScopeOverride)) {
|
|
363
380
|
return `System prompt for '${agent.name}' left unchanged.`;
|
|
364
381
|
}
|
|
365
382
|
return saveAgentSystemPrompt(ctx, agent, edited);
|
|
@@ -59,6 +59,8 @@ export function loadNativeTranscriptSupport(): Promise<NativeTranscriptModule |
|
|
|
59
59
|
export interface NativeFleetBuildInput {
|
|
60
60
|
filePath: string;
|
|
61
61
|
trustedRoots: string[];
|
|
62
|
+
trustedFiles?: string[];
|
|
63
|
+
trustedFileRoot?: string;
|
|
62
64
|
width: number;
|
|
63
65
|
expandedTools: boolean;
|
|
64
66
|
cwd?: string;
|
|
@@ -314,6 +316,8 @@ export function buildNativeFleetTranscript(
|
|
|
314
316
|
mod.ensureTranscriptTheme();
|
|
315
317
|
const readOptions: FleetTranscriptReadOptions = {
|
|
316
318
|
trustedRoots: input.trustedRoots,
|
|
319
|
+
...(input.trustedFiles ? { trustedFiles: input.trustedFiles } : {}),
|
|
320
|
+
...(input.trustedFileRoot ? { trustedFileRoot: input.trustedFileRoot } : {}),
|
|
317
321
|
...(input.maxRecords !== undefined ? { maxRecords: input.maxRecords } : {}),
|
|
318
322
|
};
|
|
319
323
|
const read = readTranscriptRecords(input.filePath, readOptions);
|