data-path: the agents item type and run directory the router needs
Second half ofc69cda4. The agents router imports getAgentRunsDir from data-path, which was still an uncommitted edit, so a clone got past the missing-module error only to fail on a missing export: SyntaxError: Export named 'getAgentRunsDir' not found in module '.../src/servers/data-path.ts' My check beforec69cda4verified that every module the agents files import is TRACKED, but not that the SYMBOLS they import actually EXIST in the committed version of those modules. Module resolution and named-export resolution are separate failures and the first check only covered the former. The whole diff to this file is one feature — 'agents' joins ItemType/ITEM_TYPES, and getAgentRunsDir is added — so it goes in whole rather than split. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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.
|
// 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 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);
|
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');
|
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.
|
// The `pi`/opencode agent's own config dir (auth.json + models.json). External-tool path.
|
||||||
export const AGENT_CONFIG_DIR = join(homedir(), '.pi', 'agent');
|
export const AGENT_CONFIG_DIR = join(homedir(), '.pi', 'agent');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user