feat: add bootstrap hook and soul-evil hook

This commit is contained in:
Peter Steinberger
2026-01-18 05:24:47 +00:00
parent 7e2d91f3b7
commit ad3c12a43a
15 changed files with 678 additions and 9 deletions

View File

@@ -9,6 +9,7 @@ import { getSkillsSnapshotVersion } from "../../agents/skills/refresh.js";
import { buildAgentSystemPrompt } from "../../agents/system-prompt.js";
import { buildSystemPromptReport } from "../../agents/system-prompt-report.js";
import { buildToolSummaryMap } from "../../agents/tool-summaries.js";
import { applyBootstrapHookOverrides } from "../../agents/bootstrap-hooks.js";
import {
filterBootstrapFilesForSession,
loadWorkspaceBootstrapFiles,
@@ -59,7 +60,14 @@ async function resolveContextReport(
await loadWorkspaceBootstrapFiles(workspaceDir),
params.sessionKey,
);
const injectedFiles = buildBootstrapContextFiles(bootstrapFiles, {
const hookAdjustedBootstrapFiles = await applyBootstrapHookOverrides({
files: bootstrapFiles,
workspaceDir,
config: params.cfg,
sessionKey: params.sessionKey,
sessionId: params.sessionEntry?.sessionId,
});
const injectedFiles = buildBootstrapContextFiles(hookAdjustedBootstrapFiles, {
maxChars: bootstrapMaxChars,
});
const skillsSnapshot = (() => {
@@ -143,7 +151,7 @@ async function resolveContextReport(
bootstrapMaxChars,
sandbox: { mode: sandboxRuntime.mode, sandboxed: sandboxRuntime.sandboxed },
systemPrompt,
bootstrapFiles,
bootstrapFiles: hookAdjustedBootstrapFiles,
injectedFiles,
skillsPrompt,
tools,