refactor(mode-prompts): migrate search 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,6 @@
|
|||||||
|
[search-mode]
|
||||||
|
MAXIMIZE SEARCH EFFORT. Launch multiple background agents IN PARALLEL:
|
||||||
|
- explore agents (codebase patterns, file structures, ast-grep)
|
||||||
|
- librarian agents (remote repos, official docs, GitHub examples)
|
||||||
|
Plus direct tools: Grep, ripgrep (rg), ast-grep (sg)
|
||||||
|
NEVER stop at first result - be exhaustive.
|
||||||
@@ -9,3 +9,4 @@ export type {
|
|||||||
export { resolveVariant } from "./variant-resolver"
|
export { resolveVariant } from "./variant-resolver"
|
||||||
export type { ResolveVariantInput } from "./variant-resolver"
|
export type { ResolveVariantInput } from "./variant-resolver"
|
||||||
export { loadPrompt, PromptFileNotFoundError, PromptPathTraversalError } from "./loader"
|
export { loadPrompt, PromptFileNotFoundError, PromptPathTraversalError } from "./loader"
|
||||||
|
export { SEARCH_MODE_PROMPT } from "./mode-prompts"
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import searchModePrompt from "../prompts/mode/search.md" with { type: "text" }
|
||||||
|
|
||||||
|
export const SEARCH_MODE_PROMPT = stripFinalLineFeed(searchModePrompt)
|
||||||
|
|
||||||
|
function stripFinalLineFeed(prompt: string): string {
|
||||||
|
return prompt.endsWith("\n") ? prompt.slice(0, -1) : prompt
|
||||||
|
}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { SEARCH_MODE_PROMPT } from "@oh-my-opencode/prompts-core"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search mode keyword detector.
|
* Search mode keyword detector.
|
||||||
*
|
*
|
||||||
@@ -12,9 +14,4 @@
|
|||||||
export const SEARCH_PATTERN =
|
export const SEARCH_PATTERN =
|
||||||
/\b(search|find|locate|lookup|look\s*up|explore|discover|scan|grep|query|browse|detect|trace|seek|track|pinpoint|hunt)\b|where\s+is|show\s+me|list\s+all|검색|찾아|탐색|조회|스캔|서치|뒤져|찾기|어디|추적|탐지|찾아봐|찾아내|보여줘|목록|検索|探して|見つけて|サーチ|探索|スキャン|どこ|発見|捜索|見つけ出す|一覧|搜索|查找|寻找|查询|检索|定位|扫描|发现|在哪里|找出来|列出|tìm kiếm|tra cứu|định vị|quét|phát hiện|truy tìm|tìm ra|ở đâu|liệt kê/i
|
/\b(search|find|locate|lookup|look\s*up|explore|discover|scan|grep|query|browse|detect|trace|seek|track|pinpoint|hunt)\b|where\s+is|show\s+me|list\s+all|검색|찾아|탐색|조회|스캔|서치|뒤져|찾기|어디|추적|탐지|찾아봐|찾아내|보여줘|목록|検索|探して|見つけて|サーチ|探索|スキャン|どこ|発見|捜索|見つけ出す|一覧|搜索|查找|寻找|查询|检索|定位|扫描|发现|在哪里|找出来|列出|tìm kiếm|tra cứu|định vị|quét|phát hiện|truy tìm|tìm ra|ở đâu|liệt kê/i
|
||||||
|
|
||||||
export const SEARCH_MESSAGE = `[search-mode]
|
export const SEARCH_MESSAGE = SEARCH_MODE_PROMPT
|
||||||
MAXIMIZE SEARCH EFFORT. Launch multiple background agents IN PARALLEL:
|
|
||||||
- explore agents (codebase patterns, file structures, ast-grep)
|
|
||||||
- librarian agents (remote repos, official docs, GitHub examples)
|
|
||||||
Plus direct tools: Grep, ripgrep (rg), ast-grep (sg)
|
|
||||||
NEVER stop at first result - be exhaustive.`
|
|
||||||
|
|||||||
Reference in New Issue
Block a user