* refactor(keyword-detector): split constants into domain-specific modules * feat(shared): add requiresAnyModel and isAnyFallbackModelAvailable * feat(config): add hephaestus to agent schemas * feat(agents): add Hephaestus autonomous deep worker * feat(cli): update model-fallback for hephaestus support * feat(plugin): add hephaestus to config handler with ordering * test(delegate-task): update tests for hephaestus agent * docs: update AGENTS.md files for hephaestus * docs: add hephaestus to READMEs * chore: regenerate config schema * fix(delegate-task): bypass requiresModel check when user provides explicit config * docs(hephaestus): add 4-part context structure for explore/librarian prompts * docs: fix review comments from cubic (non-breaking changes) - Move Hephaestus from Primary Agents to Subagents (uses own fallback chain) - Fix Hephaestus fallback chain documentation (claude-opus-4-5 → gemini-3-pro) - Add settings.local.json to claude-code-hooks config sources - Fix delegate_task parameters in ultrawork prompt (agent→subagent_type, background→run_in_background, add load_skills) - Update line counts in AGENTS.md (index.ts: 788, manager.ts: 1440) * docs: fix additional documentation inconsistencies from oracle review - Fix delegate_task parameters in Background Agents example (docs/features.md) - Fix Hephaestus fallback chain in root AGENTS.md to match model-requirements.ts * docs: clarify Hephaestus has no fallback (requires gpt-5.2-codex only) Hephaestus uses requiresModel constraint - it only activates when gpt-5.2-codex is available. The fallback chain in code is unreachable, so documentation should not mention fallbacks. * fix(hephaestus): remove unreachable fallback chain entries Hephaestus has requiresModel: gpt-5.2-codex which means the agent only activates when that specific model is available. The fallback entries (claude-opus-4-5, gemini-3-pro) were unreachable and misleading. --------- Co-authored-by: justsisyphus <justsisyphus@users.noreply.github.com>
96 lines
2.6 KiB
TypeScript
96 lines
2.6 KiB
TypeScript
import type { AgentConfig } from "@opencode-ai/sdk"
|
|
|
|
/**
|
|
* Agent mode determines UI model selection behavior:
|
|
* - "primary": Respects user's UI-selected model (sisyphus, atlas)
|
|
* - "subagent": Uses own fallback chain, ignores UI selection (oracle, explore, etc.)
|
|
* - "all": Available in both contexts (OpenCode compatibility)
|
|
*/
|
|
export type AgentMode = "primary" | "subagent" | "all"
|
|
|
|
/**
|
|
* Agent factory function with static mode property.
|
|
* Mode is exposed as static property for pre-instantiation access.
|
|
*/
|
|
export type AgentFactory = ((model: string) => AgentConfig) & {
|
|
mode: AgentMode
|
|
}
|
|
|
|
/**
|
|
* 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
|
|
}
|
|
|
|
export function isGptModel(model: string): boolean {
|
|
return model.startsWith("openai/") || model.startsWith("github-copilot/gpt-")
|
|
}
|
|
|
|
export type BuiltinAgentName =
|
|
| "sisyphus"
|
|
| "hephaestus"
|
|
| "oracle"
|
|
| "librarian"
|
|
| "explore"
|
|
| "multimodal-looker"
|
|
| "metis"
|
|
| "momus"
|
|
| "atlas"
|
|
|
|
export type OverridableAgentName =
|
|
| "build"
|
|
| BuiltinAgentName
|
|
|
|
export type AgentName = BuiltinAgentName
|
|
|
|
export type AgentOverrideConfig = Partial<AgentConfig> & {
|
|
prompt_append?: string
|
|
variant?: string
|
|
}
|
|
|
|
export type AgentOverrides = Partial<Record<OverridableAgentName, AgentOverrideConfig>>
|