diff --git a/src/servers/data-path.ts b/src/servers/data-path.ts index d6d53f4a..a3466372 100644 --- a/src/servers/data-path.ts +++ b/src/servers/data-path.ts @@ -8,9 +8,9 @@ export const DATA_PATH = process.env.DATA_PATH ?? join(process.cwd(), 'data'); // process/extension is a directory under one of these type subfolders — no scope tiers, no DB. export const OFFICER_ITEMS_DIR = process.env.OFFICER_ITEMS_DIR ?? join(process.cwd(), 'officer-items'); -export type ItemType = 'skills' | 'tools' | 'tasks' | 'processes' | 'extensions'; +export type ItemType = 'skills' | 'tools' | 'tasks' | 'processes' | 'extensions' | 'agents'; -export const ITEM_TYPES: ItemType[] = ['skills', 'tools', 'tasks', 'processes', 'extensions']; +export const ITEM_TYPES: ItemType[] = ['skills', 'tools', 'tasks', 'processes', 'extensions', 'agents']; export const itemsDir = (type: ItemType) => join(OFFICER_ITEMS_DIR, type); @@ -20,6 +20,12 @@ export const ensureItemDirs = () => { export const SERVER_CONFIG_DIR = join(DATA_PATH, 'server-settings'); +// Every run of a given agent shares one working directory. That is deliberate and load-bearing: the +// `claude` CLI groups transcripts by cwd (see api/chat/claude-sessions.ts), so a shared cwd is what +// makes an agent's runs show up as their own project group in /chat, listed newest-first, with no +// database row anywhere. The accumulated CLAUDE.md / LEARNINGS.md for the agent live here too. +export const getAgentRunsDir = (dirName: string) => join(DATA_PATH, 'agentic_runs', dirName); + // The `pi`/opencode agent's own config dir (auth.json + models.json). External-tool path. export const AGENT_CONFIG_DIR = join(homedir(), '.pi', 'agent');