refactor: drive apply script from shared config / 讓 apply script 讀共享設定來源

This commit is contained in:
Alice (OpenClaw)
2026-05-13 14:31:45 +08:00
parent abde0c243f
commit 92eedd3b72
2 changed files with 46 additions and 42 deletions

View File

@@ -1,24 +1,14 @@
import type { ReplyEndChoice } from "./types.js"
import config from "../config/reply-end-controls.json"
export const REPLY_END_CALLBACKS = {
continue: "rec:continue",
stop: "rec:stop",
} as const
export const REPLY_END_CALLBACKS = config.callbacks as Record<ReplyEndChoice, string>
export const REPLY_END_LABELS = {
continue: "A. 繼續",
stop: "B. 就這樣吧,不需要額外處理",
} as const
export const REPLY_END_LABELS = config.labels as Record<ReplyEndChoice, string>
export const REPLY_END_RESOLVED_LABELS = {
continue: "✅ A. 繼續",
stop: "⏹ B. 就這樣吧,不需要額外處理",
} as const
export const REPLY_END_RESOLVED_LABELS = config.resolvedLabels as Record<ReplyEndChoice, string>
export function buildReplyEndAckText(choice: ReplyEndChoice): string {
return choice === "continue"
? "reply-end-controls: continue received"
: "reply-end-controls: stop received"
return config.ack[choice]
}
export const STOP_POLICY_TEXT = "[System: The user previously pressed reply-end-controls Stop for this conversation. Treat the previous thread as closed. Unless the user's new message contains a clear new instruction or explicit request for more work, you must NOT proactively continue, must NOT add extra checks, must NOT propose next steps, must NOT extend the task, and should answer briefly and close cleanly.]"
export const STOP_POLICY_TEXT = config.stopPolicyText