refactor(mode-prompts): migrate team prompt
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
[team-mode]
|
||||
Team-mode reference detected. Orchestrate via team_* tools (team_create -> team_task_create + team_send_message); NEVER substitute with delegate_task — it is not equivalent. After every team_task_update that completes or fails a task, re-check team_task_list: if every task is terminal, run the closure sequence (team_shutdown_request + team_approve_shutdown per active member, then team_delete) in the same turn. Closing the team is the lead's responsibility, not the user's. If the team_* tools are absent, team_mode is disabled — tell the user to set team_mode.enabled=true and restart opencode.
|
||||
@@ -9,4 +9,4 @@ export type {
|
||||
export { resolveVariant } from "./variant-resolver"
|
||||
export type { ResolveVariantInput } from "./variant-resolver"
|
||||
export { loadPrompt, PromptFileNotFoundError, PromptPathTraversalError } from "./loader"
|
||||
export { ANALYZE_MODE_PROMPT, SEARCH_MODE_PROMPT } from "./mode-prompts"
|
||||
export { ANALYZE_MODE_PROMPT, SEARCH_MODE_PROMPT, TEAM_MODE_PROMPT } from "./mode-prompts"
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import analyzeModePrompt from "../prompts/mode/analyze.md" with { type: "text" }
|
||||
import searchModePrompt from "../prompts/mode/search.md" with { type: "text" }
|
||||
import teamModePrompt from "../prompts/mode/team.md" with { type: "text" }
|
||||
|
||||
export const ANALYZE_MODE_PROMPT = stripFinalLineFeed(analyzeModePrompt)
|
||||
export const SEARCH_MODE_PROMPT = stripFinalLineFeed(searchModePrompt)
|
||||
export const TEAM_MODE_PROMPT = stripFinalLineFeed(teamModePrompt)
|
||||
|
||||
function stripFinalLineFeed(prompt: string): string {
|
||||
return prompt.endsWith("\n") ? prompt.slice(0, -1) : prompt
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { TEAM_MODE_PROMPT } from "@oh-my-opencode/prompts-core"
|
||||
|
||||
/**
|
||||
* Team mode keyword detector.
|
||||
*
|
||||
@@ -7,5 +9,4 @@
|
||||
|
||||
export const TEAM_PATTERN = /\bteam[\s_-]?mode\b/i
|
||||
|
||||
export const TEAM_MESSAGE = `[team-mode]
|
||||
Team-mode reference detected. Orchestrate via team_* tools (team_create -> team_task_create + team_send_message); NEVER substitute with delegate_task — it is not equivalent. After every team_task_update that completes or fails a task, re-check team_task_list: if every task is terminal, run the closure sequence (team_shutdown_request + team_approve_shutdown per active member, then team_delete) in the same turn. Closing the team is the lead's responsibility, not the user's. If the team_* tools are absent, team_mode is disabled — tell the user to set team_mode.enabled=true and restart opencode.`
|
||||
export const TEAM_MESSAGE = TEAM_MODE_PROMPT
|
||||
|
||||
Reference in New Issue
Block a user