build_pack.py 產生對白索引(放在使用者資料目錄);render_skill.py 把人格卡渲染成 角色 skill 並檢查精選對白逐字來自索引;插件改成執行期從資料目錄讀索引。 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
352ce7dcad
commit
697ed6a0b9
@@ -6,14 +6,14 @@ import { buildInjection } from './inject'
|
||||
import type { IndexEntry } from './retrieval'
|
||||
|
||||
const entry = (id: string, fn: IndexEntry['function']): IndexEntry => ({ id, function: fn, emotion: 'neutral', mode: null, text: `句${id}` })
|
||||
const indexes = {
|
||||
const indexes: Record<string, IndexEntry[]> = {
|
||||
'sao-asuna': [entry('a', 'comfort'), entry('b', 'comfort')],
|
||||
'sao-suguha': [] as IndexEntry[],
|
||||
'sao-suguha': [],
|
||||
}
|
||||
const answer = (text: string): Complete => async () => ({ isAnswered: true, text })
|
||||
const deps = (opts: Record<string, string>, complete: Complete, calls = { n: 0 }) => ({
|
||||
config: resolveConfig(opts),
|
||||
indexes,
|
||||
loadIndex: async (c: string) => indexes[c] ?? [],
|
||||
complete: async (r: Parameters<Complete>[0]) => (calls.n++, complete(r)),
|
||||
now: () => 0,
|
||||
turn: 0,
|
||||
|
||||
Reference in New Issue
Block a user