pi-subagents 0.56.0 → 0.58.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 +92 -0
- 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/docs/agents.md +124 -21
- package/docs/configuration.md +37 -0
- package/docs/extension-api.md +41 -2
- package/docs/models.md +3 -3
- package/docs/observability.md +8 -7
- package/docs/tool-reference.md +14 -3
- package/docs/workflows.md +44 -0
- package/package.json +1 -1
- package/skills/pi-subagents/SKILL.md +2 -0
- package/skills/pi-subagents/references/execution-controls.md +2 -2
- package/skills/pi-subagents/references/management-authoring-rpc.md +1 -0
- package/skills/pi-subagents/references/prompting-and-roles.md +2 -2
- package/src/agents/agent-management.ts +36 -5
- package/src/agents/agent-refinements.ts +4 -4
- package/src/agents/agent-serializer.ts +5 -0
- package/src/agents/agents.ts +257 -51
- package/src/agents/builtin-names.ts +6 -0
- package/src/agents/runtime-agent-events.ts +70 -0
- package/src/agents/runtime-agent-registry.ts +18 -4
- package/src/api/agents.ts +10 -5
- package/src/api/preflight.ts +28 -3
- package/src/extension/config.ts +70 -0
- package/src/extension/doctor.ts +3 -3
- package/src/extension/index.ts +33 -8
- package/src/extension/public-execution.ts +29 -13
- package/src/extension/rpc.ts +55 -19
- package/src/extension/schemas.ts +6 -5
- package/src/extension/tool-description.ts +18 -12
- package/src/inspectors/herdr/actions.ts +2 -1
- package/src/inspectors/herdr/inspector-runner.ts +2 -10
- package/src/inspectors/herdr/session-roots-codec.ts +42 -0
- package/src/integrations/herdr-status.ts +51 -3
- package/src/runs/background/active-async-capacity.ts +77 -10
- package/src/runs/background/async-execution.ts +127 -19
- package/src/runs/background/async-job-tracker.ts +5 -0
- package/src/runs/background/async-resume.ts +6 -2
- package/src/runs/background/async-retention.ts +20 -3
- package/src/runs/background/async-status.ts +7 -0
- package/src/runs/background/chain-append.ts +2 -0
- package/src/runs/background/chain-root-attachment.ts +15 -1
- package/src/runs/background/fleet-view.ts +16 -10
- package/src/runs/background/inspect-rpc.ts +8 -8
- package/src/runs/background/notify.ts +26 -3
- package/src/runs/background/result-delivery-ownership.ts +45 -0
- package/src/runs/background/result-files.ts +27 -14
- package/src/runs/background/result-watcher.ts +36 -15
- package/src/runs/background/run-status.ts +33 -6
- package/src/runs/background/scheduled-runs.ts +7 -1
- package/src/runs/background/subagent-runner.ts +239 -56
- package/src/runs/background/wait-completions.ts +4 -0
- package/src/runs/foreground/execution.ts +92 -11
- package/src/runs/foreground/foreground-control.ts +6 -0
- package/src/runs/foreground/foreground-history.ts +22 -1
- package/src/runs/foreground/subagent-executor.ts +322 -102
- package/src/runs/foreground/workflow-detach-reconcile.ts +144 -18
- package/src/runs/shared/child-protocol.ts +21 -7
- package/src/runs/shared/claude-code-adapter.ts +129 -0
- package/src/runs/shared/codex-exec-adapter.ts +129 -0
- package/src/runs/shared/completion-guard.ts +4 -3
- 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 +122 -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/launch-cwd.ts +16 -0
- package/src/runs/shared/long-running-guard.ts +2 -1
- package/src/runs/shared/mcp-config-sources.ts +386 -0
- package/src/runs/shared/mcp-direct-tool-allowlist.ts +155 -42
- package/src/runs/shared/model-exclusions.ts +69 -7
- package/src/runs/shared/model-fallback.ts +39 -5
- package/src/runs/shared/mutation-evidence.ts +7 -2
- package/src/runs/shared/nested-events.ts +3 -1
- package/src/runs/shared/nested-render.ts +2 -2
- package/src/runs/shared/parallel-utils.ts +8 -1
- package/src/runs/shared/pi-args.ts +61 -6
- package/src/runs/shared/process-signal.ts +13 -0
- package/src/runs/shared/run-history.ts +21 -1
- package/src/runs/shared/single-output.ts +17 -0
- package/src/runs/shared/subagent-prompt-runtime.ts +85 -9
- package/src/shared/fork-context.ts +21 -0
- package/src/shared/formatters.ts +13 -1
- package/src/shared/launch-contract.ts +4 -0
- 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 +10 -2
- package/src/shared/shortcuts.ts +17 -0
- package/src/shared/types.ts +160 -10
- package/src/shared/utils.ts +6 -29
- package/src/shared/workflow-child-permit.ts +116 -0
- package/src/slash/delegation-adapters.ts +0 -1
- package/src/slash/slash-commands.ts +8 -6
- package/src/slash/subagents-admin.ts +3 -0
- package/src/tui/fleet-status.ts +27 -10
- package/src/tui/fleet-transcript.ts +11 -5
- package/src/tui/fleet.ts +28 -13
- package/src/tui/render.ts +55 -21
- package/src/workflows/scripted-workflow.ts +299 -31
- package/src/workflows/workflow-child-summary.ts +117 -0
- package/src/workflows/workflow-receipt.ts +155 -5
|
@@ -6,7 +6,7 @@ import { registerNativeSupervisorClient } from "../../intercom/native-supervisor
|
|
|
6
6
|
import { shouldUseNativeFsWatch } from "../../shared/watch-strategy.ts";
|
|
7
7
|
import { decodePermissionRules, permissionDecision, PERMISSION_AUDIT_PATH_ENV, PERMISSION_POLICY_ENV } from "./permissions.ts";
|
|
8
8
|
import { consumeSteerRequestsFromDir, MAX_STEER_QUEUE_SIZE, steerAckPathFromDir, writeSteerAckAt, writeSteerCapabilityAt, writeSteerRequestToDir, type SteerDeliveryStatus, type SteerRequest } from "../background/control-channel.ts";
|
|
9
|
-
import { SUBAGENT_CHILD_AGENT_ENV, SUBAGENT_CHILD_INDEX_ENV, SUBAGENT_FANOUT_CHILD_ENV, SUBAGENT_STEER_ACK_DIR_ENV, SUBAGENT_STEER_CAPABILITY_ENV, SUBAGENT_STEER_INBOX_ENV } from "./pi-args.ts";
|
|
9
|
+
import { SUBAGENT_CHILD_AGENT_ENV, SUBAGENT_CHILD_INDEX_ENV, SUBAGENT_FANOUT_CHILD_ENV, SUBAGENT_INHERIT_GLOBAL_CONTEXT_ENV, SUBAGENT_STEER_ACK_DIR_ENV, SUBAGENT_STEER_CAPABILITY_ENV, SUBAGENT_STEER_INBOX_ENV } from "./pi-args.ts";
|
|
10
10
|
import { RUNTIME_EXTENSION_ACK_EVENT, RUNTIME_EXTENSION_ACK_PATH_ENV, isRuntimeAcknowledgedExtensionId, writeRuntimeAcknowledgedExtensions } from "./runtime-acknowledged-extensions.ts";
|
|
11
11
|
import { createStructuredOutputToolParameters, STRUCTURED_OUTPUT_ACCEPTANCE_CAPTURE_ENV, STRUCTURED_OUTPUT_CAPTURE_ENV, STRUCTURED_OUTPUT_SCHEMA_ENV, validateStructuredOutputValue } from "./structured-output.ts";
|
|
12
12
|
import {
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
import { TOOL_BUDGET_ENV, TOOL_BUDGET_ZERO_AUTH_ENV, decodeToolBudgetEnv, shouldBlockToolForBudget, toolBudgetBlockedMessage, toolBudgetSoftNudge } from "./tool-budget.ts";
|
|
21
21
|
import type { JsonSchemaObject, ResolvedToolBudget, SubagentState } from "../../shared/types.ts";
|
|
22
22
|
import { resolveCurrentSessionId } from "../../shared/session-identity.ts";
|
|
23
|
-
import { resolveWatchPath } from "../../shared/utils.ts";
|
|
23
|
+
import { getAgentDir, resolveWatchPath } from "../../shared/utils.ts";
|
|
24
24
|
import { registerChildWatchdog } from "../../watchdog/register-child.ts";
|
|
25
25
|
import { CHILD_WATCHDOG_CONFIG_ENV, decodeChildWatchdogConfig } from "../../watchdog/child-status.ts";
|
|
26
26
|
import { requestWatchdogPermission, type WatchdogPermissionRequest, type WatchdogPermissionResult } from "../../watchdog/permission-arbiter.ts";
|
|
@@ -68,7 +68,8 @@ const PARENT_ONLY_CUSTOM_MESSAGE_TYPES = new Set([
|
|
|
68
68
|
"subagent-control-notice",
|
|
69
69
|
]);
|
|
70
70
|
const SUBAGENT_ORCHESTRATION_SKILL_NAME_PATTERN = /<name>\s*pi-subagents\s*<\/name>/;
|
|
71
|
-
const
|
|
71
|
+
const PROJECT_CONTEXT_XML_HEADER = "\n\n<project_context>\n\n";
|
|
72
|
+
const PROJECT_CONTEXT_LEGACY_HEADER = "\n\n# Project Context\n\nProject-specific instructions and guidelines:\n\n";
|
|
72
73
|
const SKILLS_HEADER = "\n\nThe following skills provide specialized instructions for specific tasks.";
|
|
73
74
|
const DATE_HEADER = "\nCurrent date:";
|
|
74
75
|
|
|
@@ -148,10 +149,80 @@ function findSectionEnd(prompt: string, startIndex: number, nextHeaders: string[
|
|
|
148
149
|
}
|
|
149
150
|
|
|
150
151
|
export function stripProjectContext(prompt: string): string {
|
|
151
|
-
const
|
|
152
|
-
if (
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
const xmlStartIndex = prompt.indexOf(PROJECT_CONTEXT_XML_HEADER);
|
|
153
|
+
if (xmlStartIndex !== -1) {
|
|
154
|
+
const closingTag = "</project_context>";
|
|
155
|
+
const closingIndex = prompt.indexOf(closingTag, xmlStartIndex + PROJECT_CONTEXT_XML_HEADER.length);
|
|
156
|
+
if (closingIndex !== -1) {
|
|
157
|
+
return `${prompt.slice(0, xmlStartIndex)}${prompt.slice(closingIndex + closingTag.length)}`;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
const legacyStartIndex = prompt.indexOf(PROJECT_CONTEXT_LEGACY_HEADER);
|
|
161
|
+
if (legacyStartIndex === -1) return prompt;
|
|
162
|
+
const endIndex = findSectionEnd(prompt, legacyStartIndex + PROJECT_CONTEXT_LEGACY_HEADER.length, [SKILLS_HEADER, DATE_HEADER]);
|
|
163
|
+
return `${prompt.slice(0, legacyStartIndex)}${prompt.slice(endIndex)}`;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const GLOBAL_CONTEXT_FILE_NAMES = new Set(["agents.md", "agents.override.md", "claude.md"]);
|
|
167
|
+
|
|
168
|
+
function canonicalDirectory(dir: string): string {
|
|
169
|
+
try {
|
|
170
|
+
return fs.realpathSync(dir);
|
|
171
|
+
} catch {
|
|
172
|
+
return path.resolve(dir);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function expandContextPath(filePath: string): string {
|
|
177
|
+
const home = process.env.HOME ?? process.env.USERPROFILE;
|
|
178
|
+
return filePath === "~"
|
|
179
|
+
? home ?? filePath
|
|
180
|
+
: /^~[\\/]/.test(filePath)
|
|
181
|
+
? path.join(home ?? "~", filePath.slice(2))
|
|
182
|
+
: filePath;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function isContextFilePath(filePath: string): boolean {
|
|
186
|
+
return GLOBAL_CONTEXT_FILE_NAMES.has(path.basename(expandContextPath(filePath)).toLowerCase());
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function isGlobalContextFile(filePath: string): boolean {
|
|
190
|
+
const expanded = expandContextPath(filePath);
|
|
191
|
+
if (!isContextFilePath(filePath)) return false;
|
|
192
|
+
return canonicalDirectory(path.dirname(expanded)) === canonicalDirectory(getAgentDir());
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function stripGlobalInstructionsFromXmlContext(context: string): string {
|
|
196
|
+
const block = /<project_instructions\s+path=(["'])(.*?)\1\s*>[\s\S]*?<\/project_instructions>\s*/gi;
|
|
197
|
+
return context.replace(block, (match, _quote: string, filePath: string) => isGlobalContextFile(filePath) ? "" : match);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function stripGlobalInstructionsFromLegacyContext(context: string): string {
|
|
201
|
+
const sections = [...context.matchAll(/^## ([^\r\n]+)(?:\r?\n|$)/gm)]
|
|
202
|
+
.filter((match) => isContextFilePath(match[1]!.trim()));
|
|
203
|
+
let rewritten = "";
|
|
204
|
+
let cursor = 0;
|
|
205
|
+
for (let index = 0; index < sections.length; index++) {
|
|
206
|
+
const section = sections[index]!;
|
|
207
|
+
const start = section.index!;
|
|
208
|
+
const end = sections[index + 1]?.index ?? context.length;
|
|
209
|
+
rewritten += context.slice(cursor, start);
|
|
210
|
+
if (!isGlobalContextFile(section[1]!.trim())) rewritten += context.slice(start, end);
|
|
211
|
+
cursor = end;
|
|
212
|
+
}
|
|
213
|
+
return `${rewritten}${context.slice(cursor)}`;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export function stripGlobalContext(prompt: string): string {
|
|
217
|
+
const rewrittenXml = prompt.replace(/<project_context>[\s\S]*?<\/project_context>/gi, (context) => {
|
|
218
|
+
const rewritten = stripGlobalInstructionsFromXmlContext(context);
|
|
219
|
+
return /<project_instructions\b/i.test(rewritten) ? rewritten : "";
|
|
220
|
+
});
|
|
221
|
+
const legacyStartIndex = rewrittenXml.indexOf(PROJECT_CONTEXT_LEGACY_HEADER);
|
|
222
|
+
if (legacyStartIndex === -1) return rewrittenXml;
|
|
223
|
+
const legacyEndIndex = findSectionEnd(rewrittenXml, legacyStartIndex + PROJECT_CONTEXT_LEGACY_HEADER.length, [SKILLS_HEADER, DATE_HEADER]);
|
|
224
|
+
const legacyContext = rewrittenXml.slice(legacyStartIndex, legacyEndIndex);
|
|
225
|
+
return `${rewrittenXml.slice(0, legacyStartIndex)}${stripGlobalInstructionsFromLegacyContext(legacyContext)}${rewrittenXml.slice(legacyEndIndex)}`;
|
|
155
226
|
}
|
|
156
227
|
|
|
157
228
|
export function stripInheritedSkills(prompt: string): string {
|
|
@@ -177,12 +248,15 @@ function stripChildBoundaryInstructions(prompt: string): string {
|
|
|
177
248
|
|
|
178
249
|
export function rewriteSubagentPrompt(
|
|
179
250
|
prompt: string,
|
|
180
|
-
options: { inheritProjectContext: boolean; inheritSkills: boolean; fanoutChild?: boolean },
|
|
251
|
+
options: { inheritProjectContext: boolean; inheritGlobalContext: boolean; inheritSkills: boolean; fanoutChild?: boolean },
|
|
181
252
|
): string {
|
|
182
253
|
let rewritten = prompt;
|
|
183
254
|
if (!options.inheritProjectContext) {
|
|
184
255
|
rewritten = stripProjectContext(rewritten);
|
|
185
256
|
}
|
|
257
|
+
if (!options.inheritGlobalContext) {
|
|
258
|
+
rewritten = stripGlobalContext(rewritten);
|
|
259
|
+
}
|
|
186
260
|
if (!options.inheritSkills) {
|
|
187
261
|
rewritten = stripInheritedSkills(rewritten);
|
|
188
262
|
}
|
|
@@ -688,12 +762,14 @@ export default function registerSubagentPromptRuntime(pi: ExtensionAPI): void {
|
|
|
688
762
|
}
|
|
689
763
|
|
|
690
764
|
const inheritProjectContext = readBooleanEnv(SUBAGENT_INHERIT_PROJECT_CONTEXT_ENV);
|
|
765
|
+
const inheritGlobalContext = readBooleanEnv(SUBAGENT_INHERIT_GLOBAL_CONTEXT_ENV);
|
|
691
766
|
const inheritSkills = readBooleanEnv(SUBAGENT_INHERIT_SKILLS_ENV);
|
|
692
767
|
const fanoutChild = readBooleanEnv(SUBAGENT_FANOUT_CHILD_ENV);
|
|
693
768
|
let rewritten = event.systemPrompt;
|
|
694
|
-
if (inheritProjectContext !== undefined || inheritSkills !== undefined || fanoutChild !== undefined) {
|
|
769
|
+
if (inheritProjectContext !== undefined || inheritGlobalContext !== undefined || inheritSkills !== undefined || fanoutChild !== undefined) {
|
|
695
770
|
rewritten = rewriteSubagentPrompt(event.systemPrompt, {
|
|
696
771
|
inheritProjectContext: inheritProjectContext ?? true,
|
|
772
|
+
inheritGlobalContext: inheritGlobalContext ?? true,
|
|
697
773
|
inheritSkills: inheritSkills ?? true,
|
|
698
774
|
fanoutChild: fanoutChild === true,
|
|
699
775
|
});
|
|
@@ -37,6 +37,8 @@ interface ForkableSessionManager {
|
|
|
37
37
|
|
|
38
38
|
interface ForkContextResolverOptions {
|
|
39
39
|
openSession?: (path: string, sessionDir?: string) => BranchSessionManager;
|
|
40
|
+
/** Rewrite a created fork before its path can be used to spawn a child. */
|
|
41
|
+
pruneSession?: (sessionFile: string) => Promise<void>;
|
|
40
42
|
/** Decide per child index whether a sanitized transcript must also disable the child's
|
|
41
43
|
* thinking. Defaults to true (the pre-existing conservative behavior) when omitted. */
|
|
42
44
|
forceThinkingOffForIndex?: (index: number) => boolean;
|
|
@@ -48,6 +50,7 @@ interface ForkContextResolution {
|
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
interface ForkContextResolver {
|
|
53
|
+
prepareSessionForIndex(index?: number): Promise<void>;
|
|
51
54
|
sessionFileForIndex(index?: number): string | undefined;
|
|
52
55
|
thinkingOverrideForIndex(index?: number): "off" | undefined;
|
|
53
56
|
}
|
|
@@ -190,6 +193,7 @@ export function createForkContextResolver(
|
|
|
190
193
|
): ForkContextResolver {
|
|
191
194
|
if (resolveSubagentContext(requestedContext) !== "fork") {
|
|
192
195
|
return {
|
|
196
|
+
prepareSessionForIndex: async () => {},
|
|
193
197
|
sessionFileForIndex: () => undefined,
|
|
194
198
|
thinkingOverrideForIndex: () => undefined,
|
|
195
199
|
};
|
|
@@ -226,6 +230,8 @@ export function createForkContextResolver(
|
|
|
226
230
|
"forks",
|
|
227
231
|
);
|
|
228
232
|
const cachedResolutions = new Map<number, ForkContextResolution>();
|
|
233
|
+
const preparedIndexes = new Set<number>();
|
|
234
|
+
const preparationPromises = new Map<number, Promise<void>>();
|
|
229
235
|
|
|
230
236
|
const resolveFork = (index = 0): ForkContextResolution => {
|
|
231
237
|
const cached = cachedResolutions.get(index);
|
|
@@ -274,7 +280,22 @@ export function createForkContextResolver(
|
|
|
274
280
|
};
|
|
275
281
|
|
|
276
282
|
return {
|
|
283
|
+
async prepareSessionForIndex(index = 0): Promise<void> {
|
|
284
|
+
const resolution = resolveFork(index);
|
|
285
|
+
if (!options.pruneSession || preparedIndexes.has(index)) return;
|
|
286
|
+
let preparation = preparationPromises.get(index);
|
|
287
|
+
if (!preparation) {
|
|
288
|
+
preparation = options.pruneSession(resolution.sessionFile).then(() => {
|
|
289
|
+
preparedIndexes.add(index);
|
|
290
|
+
});
|
|
291
|
+
preparationPromises.set(index, preparation);
|
|
292
|
+
}
|
|
293
|
+
await preparation;
|
|
294
|
+
},
|
|
277
295
|
sessionFileForIndex(index = 0): string | undefined {
|
|
296
|
+
if (options.pruneSession && !preparedIndexes.has(index)) {
|
|
297
|
+
throw new Error(`Pruned fork session ${index} was used before pruning completed.`);
|
|
298
|
+
}
|
|
278
299
|
return resolveFork(index).sessionFile;
|
|
279
300
|
},
|
|
280
301
|
thinkingOverrideForIndex(index = 0): "off" | undefined {
|
package/src/shared/formatters.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as fs from "node:fs";
|
|
6
6
|
import * as path from "node:path";
|
|
7
|
-
import type { Usage, SingleResult } from "./types.ts";
|
|
7
|
+
import type { Usage, SingleResult, TokenUsage } from "./types.ts";
|
|
8
8
|
import type { ChainStep } from "./settings.ts";
|
|
9
9
|
import { isDynamicParallelStep, isParallelStep } from "./settings.ts";
|
|
10
10
|
import { previewDisplayText, sanitizeDisplayText } from "./display-text.ts";
|
|
@@ -17,6 +17,18 @@ export function formatTokens(n: number): string {
|
|
|
17
17
|
return n < 1000 ? String(n) : n < 10000 ? `${(n / 1000).toFixed(1)}k` : `${Math.round(n / 1000)}k`;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
export function formatTokenUsage(usage: TokenUsage, legacyLabel = "tok"): string {
|
|
21
|
+
return usage.window !== undefined
|
|
22
|
+
? `${formatTokens(usage.window)} window · ${formatTokens(usage.total)} spent`
|
|
23
|
+
: `${formatTokens(usage.total)} ${legacyLabel}`;
|
|
24
|
+
}
|
|
25
|
+
export function formatContextUsage(usage: Pick<TokenUsage, "window" | "windowPeak">, contextLimit: number): string | undefined {
|
|
26
|
+
if (usage.window === undefined || !Number.isFinite(usage.window) || !Number.isFinite(contextLimit) || contextLimit <= 0) return undefined;
|
|
27
|
+
const peak = usage.windowPeak !== undefined && Number.isFinite(usage.windowPeak) ? usage.windowPeak : usage.window;
|
|
28
|
+
const used = Math.max(0, usage.window, peak);
|
|
29
|
+
return `ctx ${formatTokens(used)}/${formatTokens(contextLimit)} (${Math.round((used / contextLimit) * 100)}%)`;
|
|
30
|
+
}
|
|
31
|
+
|
|
20
32
|
export function formatModelThinking(model?: string, thinking?: string): string {
|
|
21
33
|
const parsed = model ? splitKnownThinkingSuffix(model) : undefined;
|
|
22
34
|
let displayModel = parsed?.baseModel ?? model;
|
|
@@ -43,6 +43,7 @@ export function projectAgentDefinition(agent: AgentConfig): Record<string, unkno
|
|
|
43
43
|
systemPrompt: agent.systemPrompt,
|
|
44
44
|
systemPromptMode: agent.systemPromptMode,
|
|
45
45
|
inheritProjectContext: agent.inheritProjectContext,
|
|
46
|
+
inheritGlobalContext: agent.inheritGlobalContext,
|
|
46
47
|
inheritSkills: agent.inheritSkills,
|
|
47
48
|
model: agent.model,
|
|
48
49
|
modelProvider: agent.modelProvider,
|
|
@@ -53,6 +54,7 @@ export function projectAgentDefinition(agent: AgentConfig): Record<string, unkno
|
|
|
53
54
|
mcpDirectTools: agent.mcpDirectTools,
|
|
54
55
|
extensions: agent.extensions,
|
|
55
56
|
subagentOnlyExtensions: agent.subagentOnlyExtensions,
|
|
57
|
+
mutationTools: agent.mutationTools,
|
|
56
58
|
skills: agent.skills,
|
|
57
59
|
skillPath: agent.skillPath,
|
|
58
60
|
output: agent.output,
|
|
@@ -87,6 +89,7 @@ export interface LaunchBindingInput {
|
|
|
87
89
|
systemPrompt?: string | null;
|
|
88
90
|
systemPromptMode?: AgentConfig["systemPromptMode"];
|
|
89
91
|
inheritProjectContext: boolean;
|
|
92
|
+
inheritGlobalContext: boolean;
|
|
90
93
|
inheritSkills: boolean;
|
|
91
94
|
skills?: string[];
|
|
92
95
|
tools?: string[];
|
|
@@ -113,6 +116,7 @@ export function projectLaunchBinding(input: LaunchBindingInput): Record<string,
|
|
|
113
116
|
systemPromptDigest: input.systemPrompt === undefined || input.systemPrompt === null ? undefined : stableJsonDigest(input.systemPrompt),
|
|
114
117
|
systemPromptMode: input.systemPromptMode,
|
|
115
118
|
inheritProjectContext: input.inheritProjectContext,
|
|
119
|
+
inheritGlobalContext: input.inheritGlobalContext,
|
|
116
120
|
inheritSkills: input.inheritSkills,
|
|
117
121
|
skills: input.skills,
|
|
118
122
|
tools: input.tools,
|