feat: 改寫為 Node.js,新增動漫角色建人格、劇場模式與記憶固化條件
腳本全面從 Python 改寫為 Node.js(ESM,只用內建模組,無 npm 依賴): scripts/persona-lib.mjs(核心)、scripts/persona.mjs(CLI)、hooks/*.mjs(六個 hook)、scripts/selftest.mjs(68 項自我測試,全綠)。 新增: - persona-anime skill:用「動漫作品+角色名」建立人格,先上網蒐集至少三個獨立 來源的公開設定,映射成 OpenClaw 的 IDENTITY 五欄位與 SOUL 四段落,再固化成 canon 基礎記憶(每則帶來源 URL)+原作人際關係圖+依角色型別的情緒基線; 必寫 roleplay-frame 界線記憶(非官方、非本人)。 - 劇場模式:invite 後只顯示人格對話(`名字:內容`)。UserPromptSubmit hook 每輪 注入強制規則、Stop hook 完全靜音,CLI 新增 --quiet 與 room script(乾淨對話稿)。 leave 後沒客人自動關閉,也可用 room theater --on/--off 手動切換。 - 短期→長期記憶的成文轉入條件 R1–R6(promotionCandidates)與 candidates 子指令, hook 在達標時提醒固化;長期記憶新增 canon 型別與 rules 欄位。 - 人格改為「由使用者呼叫才載入」:SessionStart hook 只列出可用人格,不自動附身。 其他:版本號改回 0.0.1;README/AGENTS.md 同步更新。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@ description: 維護人格的人際關係圖:新增或更新人物/人格/群
|
||||
|
||||
資料在 `relations/graph.json`,Mermaid 呈現在 `relations/graph.mmd`(由 CLI 產生,勿手改)。
|
||||
|
||||
**CLI**:`python3 "${CLAUDE_PLUGIN_ROOT}/scripts/persona.py"`(帶 `--session <PERSONA_SESSION>`)
|
||||
**CLI**:`node "${CLAUDE_PLUGIN_ROOT}/scripts/persona.mjs"`(帶 `--session <PERSONA_SESSION>`)
|
||||
|
||||
---
|
||||
|
||||
@@ -24,23 +24,23 @@ description: 維護人格的人際關係圖:新增或更新人物/人格/群
|
||||
|
||||
```bash
|
||||
# 看現況
|
||||
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/persona.py" relation show --session <PERSONA_SESSION>
|
||||
node "${CLAUDE_PLUGIN_ROOT}/scripts/persona.mjs" relation show --session <PERSONA_SESSION>
|
||||
|
||||
# 新增/更新節點
|
||||
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/persona.py" relation node \
|
||||
node "${CLAUDE_PLUGIN_ROOT}/scripts/persona.mjs" relation node \
|
||||
--session <PERSONA_SESSION> --name "小林" --kind human \
|
||||
--closeness 35 --trust 40 --note "使用者的同事,Q3 專案 PM" --tags "work"
|
||||
|
||||
# 連線(self → 小林)
|
||||
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/persona.py" relation edge \
|
||||
node "${CLAUDE_PLUGIN_ROOT}/scripts/persona.mjs" relation edge \
|
||||
--session <PERSONA_SESSION> --to xiao-lin --label "透過使用者認識" --affinity 45
|
||||
|
||||
# 人與人之間的連線(使用者 → 小林)
|
||||
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/persona.py" relation edge \
|
||||
node "${CLAUDE_PLUGIN_ROOT}/scripts/persona.mjs" relation edge \
|
||||
--session <PERSONA_SESSION> --from user --to xiao-lin --label "同事/有摩擦" --affinity 30
|
||||
|
||||
# 重繪 Mermaid
|
||||
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/persona.py" relation render --session <PERSONA_SESSION>
|
||||
node "${CLAUDE_PLUGIN_ROOT}/scripts/persona.mjs" relation render --session <PERSONA_SESSION>
|
||||
```
|
||||
|
||||
## 調整幅度(單次)
|
||||
|
||||
Reference in New Issue
Block a user