diff --git a/README.md b/README.md index 8b8a4d9..1073f05 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,14 @@ export default { temperature: 0.7, // Custom settings + // customPrompt can be a string or an array of strings for multiple lines customPrompt: '', + // Example of multiple line custom prompts: + // customPrompt: [ + // 'Custom instruction line 1', + // 'Custom instruction line 2', + // 'Custom instruction line 3', + // ], profile: false, tokenCache: true, diff --git a/mycoder.config.js b/mycoder.config.js index ead98ee..cd796b8 100644 --- a/mycoder.config.js +++ b/mycoder.config.js @@ -20,7 +20,14 @@ export default { temperature: 0.7, // Custom settings + // customPrompt can be a string or an array of strings for multiple lines customPrompt: '', + // Example of multiple line custom prompts: + // customPrompt: [ + // 'Custom instruction line 1', + // 'Custom instruction line 2', + // 'Custom instruction line 3', + // ], profile: false, tokenCache: true, }; diff --git a/packages/agent/src/core/toolAgent/config.ts b/packages/agent/src/core/toolAgent/config.ts index fea22e8..4861ed3 100644 --- a/packages/agent/src/core/toolAgent/config.ts +++ b/packages/agent/src/core/toolAgent/config.ts @@ -199,6 +199,13 @@ export function getDefaultSystemPrompt(toolContext: ToolContext): string { 'When you run into issues or unexpected results, take a step back and read the project documentation and configuration files and look at other source files in the project for examples of what works.', '', 'Use sub-agents for parallel tasks, providing them with specific context they need rather than having them rediscover it.', - toolContext.customPrompt ? `\n\n${toolContext.customPrompt}` : '', + (() => { + if (!toolContext.customPrompt) return ''; + if (typeof toolContext.customPrompt === 'string') { + return `\n\n${toolContext.customPrompt}`; + } + // It's an array of strings + return `\n\n${toolContext.customPrompt.join('\n')}`; + })(), ].join('\n'); } diff --git a/packages/agent/src/core/types.ts b/packages/agent/src/core/types.ts index a1871f0..0ceac3c 100644 --- a/packages/agent/src/core/types.ts +++ b/packages/agent/src/core/types.ts @@ -19,7 +19,7 @@ export type ToolContext = { pageFilter: pageFilter; tokenTracker: TokenTracker; githubMode: boolean; - customPrompt?: string; + customPrompt?: string | string[]; tokenCache?: boolean; userPrompt?: boolean; agentId?: string; // Unique identifier for the agent, used for background tool tracking diff --git a/packages/cli/src/settings/config.ts b/packages/cli/src/settings/config.ts index 6bbf0ef..80b2e08 100644 --- a/packages/cli/src/settings/config.ts +++ b/packages/cli/src/settings/config.ts @@ -13,7 +13,7 @@ export type Config = { model: string; maxTokens: number; temperature: number; - customPrompt: string; + customPrompt: string | string[]; profile: boolean; tokenCache: boolean; userPrompt: boolean;