diff --git a/docs/concepts/agent-workspace.md b/docs/concepts/agent-workspace.md index ace2ad4eb..f86497e0d 100644 --- a/docs/concepts/agent-workspace.md +++ b/docs/concepts/agent-workspace.md @@ -118,6 +118,44 @@ adjust the limit with `agents.defaults.bootstrapMaxChars` (default: 20000). `moltbot setup` can recreate missing defaults without overwriting existing files. +## Extra workspace files + +You can inject additional workspace files into the system prompt alongside the +defaults using `extraWorkspaceFiles`: + +```json5 +{ + agents: { + defaults: { + extraWorkspaceFiles: ["PANTHEON.md", "protocols/SHARED.md"] + } + } +} +``` + +Paths are relative to the workspace directory. Files that do not exist are +silently skipped (no "missing file" marker). Duplicates of default files are +ignored. + +Per-agent overrides are supported: + +```json5 +{ + agents: { + defaults: { + extraWorkspaceFiles: ["PANTHEON.md"] + }, + list: [ + { id: "researcher", extraWorkspaceFiles: ["RESEARCH_PROTOCOL.md"] }, + { id: "minimal", extraWorkspaceFiles: [] } // disable extras + ] + } +} +``` + +Extra files are included for subagent sessions alongside the default allowlist +(AGENTS.md, TOOLS.md). + ## What is NOT in the workspace These live under `~/.clawdbot/` and should NOT be committed to the workspace repo: diff --git a/src/config/types.agent-defaults.ts b/src/config/types.agent-defaults.ts index 9a4a5fbb8..7a74dce95 100644 --- a/src/config/types.agent-defaults.ts +++ b/src/config/types.agent-defaults.ts @@ -106,7 +106,6 @@ export type AgentDefaultsConfig = { skipBootstrap?: boolean; /** Max chars for injected bootstrap files before truncation (default: 20000). */ bootstrapMaxChars?: number; - /** Extra workspace files to inject alongside the default bootstrap files (paths relative to workspace). */ extraWorkspaceFiles?: string[]; /** Optional IANA timezone for the user (used in system prompt; defaults to host timezone). */ userTimezone?: string; diff --git a/src/config/types.agents.ts b/src/config/types.agents.ts index 355621c89..1fc2d2728 100644 --- a/src/config/types.agents.ts +++ b/src/config/types.agents.ts @@ -24,7 +24,6 @@ export type AgentConfig = { workspace?: string; agentDir?: string; model?: AgentModelConfig; - /** Extra workspace files to inject alongside the default bootstrap files (paths relative to workspace). */ extraWorkspaceFiles?: string[]; memorySearch?: MemorySearchConfig; /** Human-like delay between block replies for this agent. */ diff --git a/src/config/zod-schema.agent-runtime.ts b/src/config/zod-schema.agent-runtime.ts index 24f86a44b..c0126a86e 100644 --- a/src/config/zod-schema.agent-runtime.ts +++ b/src/config/zod-schema.agent-runtime.ts @@ -421,7 +421,6 @@ export const AgentEntrySchema = z workspace: z.string().optional(), agentDir: z.string().optional(), model: AgentModelSchema.optional(), - /** Extra workspace files to inject alongside the default bootstrap files (paths relative to workspace). */ extraWorkspaceFiles: z.array(z.string()).optional(), memorySearch: MemorySearchSchema, humanDelay: HumanDelaySchema.optional(),