Files
shared/.claude-plugin/plugin.json
T
JefferyandClaude Opus 5 48dc9ea74a feat(role): SessionStart 載入近期逐字對話做工作階段交接
長期記憶是模型濃縮過的摘要,語氣與情緒會被壓掉(使用者說「我好想妳」會被濃縮成
「使用者表達想念」)。而逐字對話一直躺在 transcript JSONL 裡,過去沒有任何機制去讀它,
使用者重開工作階段時角色因此看不到剛剛的互動,表現得像失去記憶,只能靠 resume 找回。

transcript.js:
- 新增 recent <路徑> [輪數] [字元]:抽最近數輪的純對話,輸出前經 redact 遮蔽
- 新增 turns <路徑>:輸出對話輪數,供取檔判斷
- 只取 [user] 與 [assistant] 文字;工具呼叫、工具結果、思考區塊、hook 注入內容一律丟棄
- 以「輪」分組並各自收斂成一則:角色一輪內常輸出多段文字,不合併會讓則數爆炸並把預算
  吃光,反而擠掉使用者說的話(實測未合併時 8 輪只剩 2 則使用者發言,合併後為 8 則)
- 超預算時整輪丟棄最舊的,保持問答成對,不會只剩單邊發言

role_load.sh:
- hook 輸入改為一併取出 transcript_path
- 當前 transcript 對話不足 2 輪時(全新工作階段實測僅數行),回頭找同目錄最近修改的對話檔
- 新增 ROLE_LOAD_DIALOG_TURNS(預設 8)與 ROLE_LOAD_DIALOG_LIMIT(預設 4000),
  獨立預算不佔用 ROLE_LOAD_LIMIT,任一設 0 可關閉

驗證:resume 與全新工作階段皆正確載入 8 輪成對對話;未給 transcript_path、檔案不存在、
無 hook 輸入、關閉設定等情境均安全降級不報錯;假造含 token/Email/電話與 thinking 的
transcript 確認機密遮蔽為 *** 且思考與工具內容未載入。

版號 0.0.2 → 0.0.3

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 17:59:51 +08:00

13 lines
492 B
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"name": "jsc-generic",
"version": "0.0.3",
"description": "JSC 跨 AI 助理共用規範 pluginClaude Code / Codex / Antigravity / OpenCode)。所有 skills 以 SKILL.md 為共通標準,於 Claude Code 以 /jsc-generic: 前綴呼叫。",
"skills": "./skills",
"author": {
"name": "JSC"
},
"homepage": "https://gitea.jsc.idv.tw/plugins/generic",
"repository": "https://gitea.jsc.idv.tw/plugins/generic.git",
"keywords": ["spec", "skills", "cross-tool", "jsc"]
}