feat(agents): implement dynamic Sisyphus prompt system with agent metadata
Introduce a new dynamic prompt generation system for Sisyphus orchestrator that leverages agent metadata for intelligent delegation. This revives the dynamic-sisyphus-agent-prompt branch with comprehensive refactoring. Changes: - Add AgentPromptMetadata, AgentCategory, AgentCost, DelegationTrigger types - Create sisyphus-prompt-builder with dynamic prompt generation logic - Add AGENT_PROMPT_METADATA exports to all agent modules (oracle, librarian, explore, frontend-ui-ux-engineer, document-writer, multimodal-looker) - Refactor sisyphus.ts to use buildDynamicSisyphusPrompt() - Add AvailableAgent type export for type safety This enables Sisyphus to make intelligent agent selection decisions based on agent capabilities, costs, and delegation triggers, improving orchestration efficiency. 🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
@@ -1,7 +1,25 @@
|
||||
import type { AgentConfig } from "@opencode-ai/sdk"
|
||||
import type { AgentPromptMetadata } from "./types"
|
||||
|
||||
const DEFAULT_MODEL = "anthropic/claude-sonnet-4-5"
|
||||
|
||||
export const LIBRARIAN_PROMPT_METADATA: AgentPromptMetadata = {
|
||||
category: "exploration",
|
||||
cost: "CHEAP",
|
||||
promptAlias: "Librarian",
|
||||
keyTrigger: "External library/source mentioned → fire `librarian` background",
|
||||
triggers: [
|
||||
{ domain: "Librarian", trigger: "Unfamiliar packages / libraries, struggles at weird behaviour (to find existing implementation of opensource)" },
|
||||
],
|
||||
useWhen: [
|
||||
"How do I use [library]?",
|
||||
"What's the best practice for [framework feature]?",
|
||||
"Why does [external dependency] behave this way?",
|
||||
"Find examples of [library] usage",
|
||||
"Working with unfamiliar npm/pip/cargo packages",
|
||||
],
|
||||
}
|
||||
|
||||
export function createLibrarianAgent(model: string = DEFAULT_MODEL): AgentConfig {
|
||||
return {
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user