Files
Codewalkers/apps/server/agent/providers/presets.ts
Lukas May 34578d39c6 refactor: Restructure monorepo to apps/server/ and apps/web/ layout
Move src/ → apps/server/ and packages/web/ → apps/web/ to adopt
standard monorepo conventions (apps/ for runnable apps, packages/
for reusable libraries). Update all config files, shared package
imports, test fixtures, and documentation to reflect new paths.

Key fixes:
- Update workspace config to ["apps/*", "packages/*"]
- Update tsconfig.json rootDir/include for apps/server/
- Add apps/web/** to vitest exclude list
- Update drizzle.config.ts schema path
- Fix ensure-schema.ts migration path detection (3 levels up in dev,
  2 levels up in dist)
- Fix tests/integration/cli-server.test.ts import paths
- Update packages/shared imports to apps/server/ paths
- Update all docs/ files with new paths
2026-03-03 11:22:53 +01:00

146 lines
3.2 KiB
TypeScript

/**
* Built-in Agent Provider Presets
*
* Data-driven configuration for all supported agent CLI providers.
* Ported from reference/gastown/internal/config/agents.go builtinPresets.
*/
import type { AgentProviderConfig } from './types.js';
export const PROVIDER_PRESETS: Record<string, AgentProviderConfig> = {
claude: {
name: 'claude',
command: 'claude',
args: ['--dangerously-skip-permissions', '--verbose'],
processNames: ['node', 'claude'],
configDirEnv: 'CLAUDE_CONFIG_DIR',
resumeFlag: '--resume',
resumeStyle: 'flag',
promptMode: 'native',
// No structuredOutput - schema enforcement via prompt text + validation
sessionId: {
extractFrom: 'event',
field: 'session_id',
eventType: 'system',
},
nonInteractive: {
outputFlag: '--output-format stream-json',
},
},
codex: {
name: 'codex',
command: 'codex',
args: ['--full-auto'],
processNames: ['codex'],
resumeFlag: 'resume',
resumeStyle: 'subcommand',
promptMode: 'native',
structuredOutput: {
flag: '--output-schema',
schemaMode: 'file',
outputFormat: 'jsonl',
},
sessionId: {
extractFrom: 'event',
field: 'thread_id',
eventType: 'thread.started',
},
nonInteractive: {
subcommand: 'exec',
outputFlag: '--json',
},
},
gemini: {
name: 'gemini',
command: 'gemini',
args: ['--sandbox=off'],
processNames: ['gemini'],
resumeFlag: '--resume',
resumeStyle: 'flag',
promptMode: 'flag',
structuredOutput: {
flag: '--output-format',
schemaMode: 'none',
outputFormat: 'json',
},
sessionId: {
extractFrom: 'result',
field: 'session_id',
},
nonInteractive: {
promptFlag: '-p',
outputFlag: '--output-format json',
},
},
cursor: {
name: 'cursor',
command: 'cursor-agent',
args: ['-f'],
processNames: ['cursor-agent'],
resumeStyle: 'none',
promptMode: 'flag',
structuredOutput: {
flag: '--output-format',
schemaMode: 'none',
outputFormat: 'json',
},
nonInteractive: {
promptFlag: '-p',
outputFlag: '--output-format json',
},
},
auggie: {
name: 'auggie',
command: 'aug',
args: ['--allow-indexing'],
processNames: ['aug'],
resumeStyle: 'none',
promptMode: 'flag',
nonInteractive: {
promptFlag: '-p',
},
},
amp: {
name: 'amp',
command: 'amp',
args: ['--allow-all'],
processNames: ['amp'],
resumeFlag: '--thread',
resumeStyle: 'flag',
promptMode: 'flag',
sessionId: {
extractFrom: 'result',
field: 'thread_id',
},
nonInteractive: {
promptFlag: '-p',
outputFlag: '--json',
},
},
opencode: {
name: 'opencode',
command: 'opencode',
args: [],
env: { OPENCODE_PERMISSION: '{"*":"allow"}' },
processNames: ['opencode', 'node', 'bun'],
resumeStyle: 'none',
promptMode: 'flag',
structuredOutput: {
flag: '--format',
schemaMode: 'none',
outputFormat: 'json',
},
nonInteractive: {
subcommand: 'run',
promptFlag: '-p',
outputFlag: '--format json',
},
},
};