2025-12-05 02:32:33 +09:00
|
|
|
import type { AgentConfig } from "@opencode-ai/sdk"
|
|
|
|
|
|
2026-01-17 12:51:03 -05:00
|
|
|
export type AgentFactory = (model: string) => AgentConfig
|
2025-12-21 19:09:26 +11:00
|
|
|
|
2025-12-30 23:56:09 +09:00
|
|
|
/**
|
|
|
|
|
* Agent category for grouping in Sisyphus prompt sections
|
|
|
|
|
*/
|
|
|
|
|
export type AgentCategory = "exploration" | "specialist" | "advisor" | "utility"
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Cost classification for Tool Selection table
|
|
|
|
|
*/
|
|
|
|
|
export type AgentCost = "FREE" | "CHEAP" | "EXPENSIVE"
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Delegation trigger for Sisyphus prompt's Delegation Table
|
|
|
|
|
*/
|
|
|
|
|
export interface DelegationTrigger {
|
|
|
|
|
/** Domain of work (e.g., "Frontend UI/UX") */
|
|
|
|
|
domain: string
|
|
|
|
|
/** When to delegate (e.g., "Visual changes only...") */
|
|
|
|
|
trigger: string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Metadata for generating Sisyphus prompt sections dynamically
|
|
|
|
|
* This allows adding/removing agents without manually updating the Sisyphus prompt
|
|
|
|
|
*/
|
|
|
|
|
export interface AgentPromptMetadata {
|
|
|
|
|
/** Category for grouping in prompt sections */
|
|
|
|
|
category: AgentCategory
|
|
|
|
|
|
|
|
|
|
/** Cost classification for Tool Selection table */
|
|
|
|
|
cost: AgentCost
|
|
|
|
|
|
|
|
|
|
/** Domain triggers for Delegation Table */
|
|
|
|
|
triggers: DelegationTrigger[]
|
|
|
|
|
|
|
|
|
|
/** When to use this agent (for detailed sections) */
|
|
|
|
|
useWhen?: string[]
|
|
|
|
|
|
|
|
|
|
/** When NOT to use this agent */
|
|
|
|
|
avoidWhen?: string[]
|
|
|
|
|
|
|
|
|
|
/** Optional dedicated prompt section (markdown) - for agents like Oracle that have special sections */
|
|
|
|
|
dedicatedSection?: string
|
|
|
|
|
|
|
|
|
|
/** Nickname/alias used in prompt (e.g., "Oracle" instead of "oracle") */
|
|
|
|
|
promptAlias?: string
|
|
|
|
|
|
|
|
|
|
/** Key triggers that should appear in Phase 0 (e.g., "External library mentioned → fire librarian") */
|
|
|
|
|
keyTrigger?: string
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-21 19:09:26 +11:00
|
|
|
export function isGptModel(model: string): boolean {
|
|
|
|
|
return model.startsWith("openai/") || model.startsWith("github-copilot/gpt-")
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-13 22:13:23 +09:00
|
|
|
export type BuiltinAgentName =
|
2025-12-19 04:11:20 +09:00
|
|
|
| "Sisyphus"
|
2025-12-05 02:32:33 +09:00
|
|
|
| "oracle"
|
|
|
|
|
| "librarian"
|
|
|
|
|
| "explore"
|
2025-12-13 15:25:29 +09:00
|
|
|
| "multimodal-looker"
|
2026-01-09 02:24:43 +09:00
|
|
|
| "Metis (Plan Consultant)"
|
|
|
|
|
| "Momus (Plan Reviewer)"
|
2026-01-20 19:10:21 +09:00
|
|
|
| "Atlas"
|
2025-12-05 02:32:33 +09:00
|
|
|
|
2025-12-13 22:13:23 +09:00
|
|
|
export type OverridableAgentName =
|
|
|
|
|
| "build"
|
|
|
|
|
| BuiltinAgentName
|
|
|
|
|
|
|
|
|
|
export type AgentName = BuiltinAgentName
|
|
|
|
|
|
2025-12-25 01:49:16 +09:00
|
|
|
export type AgentOverrideConfig = Partial<AgentConfig> & {
|
|
|
|
|
prompt_append?: string
|
2026-01-10 21:44:20 +00:00
|
|
|
variant?: string
|
2025-12-25 01:49:16 +09:00
|
|
|
}
|
2025-12-05 02:32:33 +09:00
|
|
|
|
2025-12-13 22:13:23 +09:00
|
|
|
export type AgentOverrides = Partial<Record<OverridableAgentName, AgentOverrideConfig>>
|