import { fileURLToPath } from "node:url"; import { createPiSubagentsExtension } from "../pi-subagents/src/index.ts"; import { readSubagentPreamble, resolveSubagentAgentsDir, } from "./system-prompt-config.ts"; // Bundle authority: Agent frontmatter may disable optional extensions, but it // cannot remove the exact wrapper that deploys my-pi's permission baseline and // binds the maintained permission-system source. const BUNDLED_PERMISSION_EXTENSION = fileURLToPath( new URL("./permission-system.ts", import.meta.url), ); // Subagents get their own prompt profile: config/prompt/subagent/preamble.md // replaces the parent-prompt embedding upstream performs, and // config/prompt/subagent/agents/*.md are loaded as built-in agent types. // ask_user_question is main-session-only — a child has no user to ask. const ASK_USER_EXTENSION = fileURLToPath( new URL("../pi-ask-user/index.ts", import.meta.url), ); export default createPiSubagentsExtension({ mandatoryExtensionPaths: [BUNDLED_PERMISSION_EXTENSION], basePrompt: readSubagentPreamble, bundledAgentsDir: resolveSubagentAgentsDir(), excludedExtensionPaths: [ASK_USER_EXTENSION], });