mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 13:04:08 +00:00
12 examples showing increasing levels of customization: - 01-minimal: all defaults - 02-custom-model: model and thinking level - 03-custom-prompt: replace or modify prompt - 04-skills: discover, filter, merge skills - 05-tools: built-in tools, custom tools - 06-hooks: logging, blocking, result modification - 07-context-files: AGENTS.md files - 08-slash-commands: file-based commands - 09-api-keys-and-oauth: API key resolution, OAuth config - 10-settings: compaction, retry, terminal settings - 11-sessions: persistence options - 12-full-control: replace everything Also exports FileSlashCommand type from index.ts
33 lines
749 B
TypeScript
33 lines
749 B
TypeScript
/**
|
|
* Settings Configuration
|
|
*
|
|
* Override settings from agentDir/settings.json.
|
|
*/
|
|
|
|
import { createAgentSession, loadSettings, SessionManager } from "../../src/index.js";
|
|
|
|
// Load current settings
|
|
const settings = loadSettings();
|
|
console.log("Current settings:", JSON.stringify(settings, null, 2));
|
|
|
|
// Override specific settings
|
|
const { session } = await createAgentSession({
|
|
settings: {
|
|
// Disable auto-compaction
|
|
compaction: { enabled: false },
|
|
|
|
// Custom retry behavior
|
|
retry: {
|
|
enabled: true,
|
|
maxRetries: 5,
|
|
baseDelayMs: 1000,
|
|
},
|
|
|
|
// Terminal options
|
|
terminal: { showImages: true },
|
|
hideThinkingBlock: true,
|
|
},
|
|
sessionManager: SessionManager.inMemory(),
|
|
});
|
|
|
|
console.log("Session created with custom settings");
|