feat: replace prompt templates with snippets
Replace the prompt-template workflow with snippet support that is compatible with opencode snippet conventions. Snippets are now stored and loaded from global and project snippet directories, including legacy pluralized paths, with frontmatter metadata for aliases and descriptions. Snippet expansion supports recursive references plus prepend and append sections, while inject sections are treated as unsupported no-ops so OpenChamber remains compatible without requiring an external plugin. Add the snippets settings experience and remove the old prompt-template settings surface. The new settings page and sidebar support creating, editing, deleting, selecting, and describing snippets, with localized copy across every supported locale. The settings navigation now exposes Snippets with a dedicated icon and metadata. Wire snippets into all prompt-entry surfaces that need them. Chat, multi-run groups, and scheduled task prompts now offer hash-trigger snippet autocomplete and expand snippets before sending work to OpenCode. Chat also uses an adaptive compact placeholder on mobile or narrow composer widths so helper trigger guidance stays readable in constrained layouts. Keep multi-run aligned with grouped prompts. Multi-run sessions now use a shared title builder that handles both legacy titles and the newer g1, g2 prompt-group title format. Fusion parsing now recognizes grouped multi-run titles, scopes fusion sources to the same prompt group, and creates fusion sessions under the matching group so outputs from different prompts are not mixed accidentally. Harden the icon sprite pipeline. The sprite generator now discovers icon names used through typed icon maps, JSX icon props, IconName returns, and generated-value flows without scanning unrelated string literals or the generated sprite itself. The generated sprite is strictly typed so invalid icon names are caught by type checking, and existing invalid or unsafe icon references were cleaned up across settings, provider, Git identity, scheduled task, voice, header, and sidebar surfaces. Update backend configuration routes and documentation for snippets. The OpenCode config route layer now exposes snippet CRUD and expansion endpoints, accepts JSON bodies for snippet writes, and removes the old prompt-template provider. Scheduled task runtime expansion now uses snippets before dispatching messages. Add regression coverage for snippet storage and expansion, config-route JSON handling, and multi-run title parsing. Validated with full type checking, full linting, targeted multi-run title tests, and targeted OpenCode snippet/config route tests.
This commit is contained in:
@@ -44,6 +44,29 @@ export const settingsDict = {
|
||||
'settings.page.notifications.title': '알림',
|
||||
'settings.page.voice.title': '음성',
|
||||
'settings.page.tunnel.title': '원격 터널',
|
||||
'settings.page.snippets.title': '스니펫',
|
||||
'settings.snippets.sidebar.title': '스니펫',
|
||||
'settings.snippets.sidebar.total': '총 {count}개',
|
||||
'settings.snippets.sidebar.actions.create': '스니펫 만들기',
|
||||
'settings.snippets.sidebar.actions.more': '{name} 추가 작업',
|
||||
'settings.snippets.sidebar.toast.deleted': '스니펫이 삭제되었습니다',
|
||||
'settings.snippets.sidebar.toast.deleteFailed': '스니펫 삭제 실패',
|
||||
'settings.snippets.sidebar.dialog.deleteTitle': '스니펫을 삭제할까요?',
|
||||
'settings.snippets.sidebar.dialog.deleteDescription': '이 작업은 #{name}을(를) 영구적으로 삭제합니다.',
|
||||
'settings.snippets.page.empty.title': '스니펫 선택',
|
||||
'settings.snippets.page.empty.description': '편집할 스니펫을 사이드바에서 선택하세요.',
|
||||
'settings.snippets.page.title.new': '새 스니펫',
|
||||
'settings.snippets.page.field.namePlaceholder': 'snippet-name',
|
||||
'settings.snippets.page.field.descriptionPlaceholder': '이 스니펫의 역할',
|
||||
'settings.snippets.page.field.aliases': '별칭',
|
||||
'settings.snippets.page.field.aliasesPlaceholder': 'safe, careful',
|
||||
'settings.snippets.page.field.content': '내용',
|
||||
'settings.snippets.page.field.contentPlaceholder': '스니펫 Markdown...',
|
||||
'settings.snippets.page.hint': '프롬프트에서 #name을 사용하세요. opencode-snippets와 호환되는 별칭 및 prepend/append 블록을 지원합니다.',
|
||||
'settings.snippets.page.toast.nameRequired': '스니펫 이름은 필수입니다',
|
||||
'settings.snippets.page.toast.contentRequired': '스니펫 내용은 필수입니다',
|
||||
'settings.snippets.page.toast.saveFailed': '스니펫 저장 실패',
|
||||
'settings.snippets.page.toast.saved': '스니펫이 저장되었습니다',
|
||||
'settings.openchamber.tunnel.title': '원격 터널',
|
||||
'settings.openchamber.tunnel.description': '퀵 링크나 직접 관리하는 Cloudflare 터널로 안전한 원격 접속을 설정하세요.',
|
||||
'settings.openchamber.tunnel.note.serverSideEnforced': '보안 터널 접근은 서버 측에서 강제됩니다.',
|
||||
|
||||
Reference in New Issue
Block a user