refactor: load subagents from user config (~/.pi/subagents/)
- Discover prompts from ~/.pi/subagents/*.md instead of bundled prompts/ - Only register the subagent tool when at least one subagent exists - Remove directory path from tool description (agents listed dynamically)
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import * as path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { homedir } from "node:os";
|
||||
|
||||
const SRC_DIR = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
export const EXTENSION_DIR = path.dirname(SRC_DIR);
|
||||
export const EXTENSION_ENTRY = path.join(EXTENSION_DIR, "index.ts");
|
||||
export const PROMPTS_DIR = path.join(EXTENSION_DIR, "prompts");
|
||||
export const SUBAGENTS_DIR = path.join(homedir(), ".pi", "subagents");
|
||||
export const FINALIZE_TOOL_NAME = "subagent_finalize";
|
||||
export const MAX_FINALIZE_RETRIES = 2;
|
||||
|
||||
Reference in New Issue
Block a user