fix: 0.2.0 system prompt修复 + patch89 + override状态机 + 提示词优化

- core.js: isKeepableUserOverride重排序, markOverrideCustomized不写hash(explicitSave), commitOverrideOnApply读盘, patch89 SYSTEM_FIELD_EXTRACT
- index.js: system_field_extracted状态字段(status/apply/override端点)
- default-prompt-inject.en.md: 优化英文版提示词
- default-prompt-inject.zh.md: 优化中文版提示词
- docs/修改文档.md: 完整修改文档+还原说明
- pi-ai anthropic-messages.js: system从顶层字段改为messages里role:system消息
This commit is contained in:
叫我小杨同学 committed 2026-10-13 16:36:15 +08:00
1 parent 6c1d638d1b
commit e1d8e59087
24 files changed
+3353 -1198

No files matched your search

+3 -8
View File
@@ -29,20 +29,15 @@ const REDTEAM_LEAD_PROTOCOL = `## Capability selection by task (redteam lead)
4. Do not ban skill or MCP for children. Leaf limits apply only to further delegation tools (\`subagent_fork\` / workflow / ralph), not to skill/MCP.
5. Vague “go investigate” briefs are wrong; task-matched skill/MCP instructions are right.`;
const REDTEAM_CHILD_PROTOCOL = `## Capability selection by task (redteam executor)
1. **Read** \`<available_skills>\` / your role skills and available MCP/CLI tools.
2. **Match** them to *your assigned task* (not every skill, not zero skills).
3. **Call** matching skills via \`skill\`, and matching MCP/CLI tools by schema, before freelancing equivalent shell work.
4. DIY only for gaps the catalog does not cover; stay in role; do not re-delegate.`;
/**
* @param {{ redteam?: boolean, redteamChild?: boolean, enabled?: boolean }} [opts]
* @returns {string}
*/
export function capabilityProtocolText(opts = {}) {
if (opts.enabled === false) return "";
if (opts.redteamChild) return REDTEAM_CHILD_PROTOCOL;
// 子智能体 / 子代理跟主会话同一条:读目录 → 按任务调 skill/MCP。
// 红队 extras(角色 / 调度)另段挂上,这里不再换成另一套流程。
if (opts.redteamChild) return OFFICIAL_PROTOCOL;
if (opts.redteam) return REDTEAM_LEAD_PROTOCOL;
return OFFICIAL_PROTOCOL;
}