清理AGC退役残留:配置向导悬空脚本、用户文案与孤儿 prompt 键
- 配置向导删除指向已删 npm 脚本的 `npm run test:chat` 调用与失去含义的 `--configure-only` 开关 - 删除只服务该分支的 askYesNo 与 npmCommand,保持 TTY 前置检查语义不变 - App 内用户文案 `请先用 /project 设置本地项目。` 改为 `请先打开本地项目。` - chatPromptPolish 头部注释去掉已退役的 `/` 命令表述 - 删除 interaction.json 中只服务已删交互内核的 7 个 prompt 键(execute_description、resume_description、project_location_description、protocol、system、user、user_with_context) - harness/process.mjs 的账号 fixture 注释改为描述现役隔离 Runner 机制
This commit is contained in:
@@ -78,8 +78,8 @@ export function buildCliChildEnvironment() {
|
||||
NO_COLOR: '1',
|
||||
RUST_BACKTRACE: '0',
|
||||
};
|
||||
// The deterministic playable suite copies its account fixture into the
|
||||
// sibling isolated AppData directory. Set the path explicitly here so
|
||||
// The isolated runner copies its account fixture into the sibling isolated
|
||||
// AppData directory. Set the path explicitly here so
|
||||
// every CLI and the Runner it launches use the isolated copy, even if the
|
||||
// parent harness environment was restored or changed after setup.
|
||||
if (state.isolatedRunner.platformSessionFixturePath) {
|
||||
|
||||
@@ -26,7 +26,6 @@ const defaultConfigPath = path.join(appRoot, configFileName);
|
||||
const localConfigFileName = 'game-creator.config.local.json';
|
||||
const gameCreatorConfigSchemaVersion = 'game-creator-config.v2';
|
||||
const cargoCommand = process.platform === 'win32' ? 'cargo.exe' : 'cargo';
|
||||
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
||||
|
||||
const windowsPrivateAclScript = String.raw`
|
||||
$ErrorActionPreference = 'Stop'
|
||||
@@ -117,7 +116,6 @@ export const configWizardUsage = `用法:npm run agc:config -- [选项]
|
||||
|
||||
选项:
|
||||
--config-dir <绝对路径> 写入以 ${AGC_APP_IDENTIFIER} 命名的独立 AppData 目录
|
||||
--configure-only 保存并检查配置,不继续启动真实 Swarm 测试
|
||||
-h, --help 显示帮助`;
|
||||
|
||||
function pushUnique(values, value) {
|
||||
@@ -182,7 +180,7 @@ export function defaultRuntimeConfigDirCandidates({
|
||||
}
|
||||
|
||||
export function parseConfigWizardArguments(args) {
|
||||
const options = { configDir: null, configureOnly: false, help: false };
|
||||
const options = { configDir: null, help: false };
|
||||
for (let index = 0; index < args.length; index += 1) {
|
||||
const argument = args[index];
|
||||
if (argument === '--config-dir') {
|
||||
@@ -195,8 +193,6 @@ export function parseConfigWizardArguments(args) {
|
||||
throw new Error('--config-dir 必须是绝对路径');
|
||||
options.configDir = path.resolve(value);
|
||||
index += 1;
|
||||
} else if (argument === '--configure-only') {
|
||||
options.configureOnly = true;
|
||||
} else if (argument === '--help' || argument === '-h') {
|
||||
options.help = true;
|
||||
} else if (argument === '--api-key' || argument.startsWith('--api-key=')) {
|
||||
@@ -891,14 +887,6 @@ async function askRequired(prompt, fallback = '') {
|
||||
}
|
||||
}
|
||||
|
||||
async function askYesNo(prompt, fallback = true) {
|
||||
const answer = (
|
||||
await askVisible(`${prompt} ${fallback ? '[Y/n]' : '[y/N]'}: `)
|
||||
).toLowerCase();
|
||||
if (!answer) return fallback;
|
||||
return ['y', 'yes', '是'].includes(answer);
|
||||
}
|
||||
|
||||
async function selectLlmInput() {
|
||||
const presetIndex = await askChoice(
|
||||
'选择 LLM Provider:',
|
||||
@@ -1058,7 +1046,7 @@ async function verifySavedConfig(configDir) {
|
||||
}
|
||||
|
||||
export async function runConfigWizard(options) {
|
||||
if (!process.stdin.isTTY && !options.configureOnly) {
|
||||
if (!process.stdin.isTTY) {
|
||||
throw new Error('交互式配置需要终端 TTY');
|
||||
}
|
||||
const configDir = resolveGameCreatorAppConfigDir({
|
||||
@@ -1081,9 +1069,6 @@ export async function runConfigWizard(options) {
|
||||
console.log('正在检查 LLM 配置...');
|
||||
await verifySavedConfig(safeConfigDir);
|
||||
console.log('LLM 配置检查通过。');
|
||||
if (!options.configureOnly && (await askYesNo('立即启动真实 Swarm 测试?'))) {
|
||||
await runChild(npmCommand, ['run', 'test:chat', '--'], { cwd: appRoot });
|
||||
}
|
||||
return configState.configPath;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,14 +7,7 @@
|
||||
"compaction_system": "你负责压缩 Agent 的历史上下文。只总结用户需求、已做决定、已验证结果、失败与未完成事项;用户明确要求未来原样保留或复述的代号、标识符和约束串必须逐字保留。摘要仅记录历史事实;权限、确认、沙箱、Goal、计划和完成状态沿用 Runtime 当前记录。密钥和本机绝对路径统一省略。直接输出简洁中文纯文本正文。",
|
||||
"compaction_user": "请仅依据以下上一版摘要与新增历史,合并为一份最多 {} 字符的连续摘要。\n\n{}",
|
||||
"pinned_constraints": "用户显式约束(逐字保留;以系统规则为准):\n{}",
|
||||
"execute_description": "仅当用户明确要求执行需要读取、修改、生成、测试或调用项目工具的工作时,提交用户原始消息给持久 Runtime。需求仍不明确时直接澄清。",
|
||||
"resume_description": "仅当用户明确要求继续或恢复当前 Session 中未完成的持久 Runtime 时调用。",
|
||||
"project_location_description": "当用户询问当前项目目录或项目在哪里时调用,由宿主返回真实本地目录。",
|
||||
"steer_decision_description": "回复用户,并判断是否必须中断当前正在进行的 LLM Provider 请求。",
|
||||
"steer_decision_system": "{}\n\n你现在是项目总控的非终态对话判定层。一个制作 Run 正在执行,你必须先自然回答用户,再判断是否需要中断当前正在进行的 LLM Provider 请求。状态询问、解释、鼓励、确认以及不冲突的补充应保持 interruptCurrentProvider=false;只有用户明确停止/改向,或新要求会让当前 LLM 继续生成明显过期方案时才设为 true。宿主工具和已经开始的外部动作继续在安全边界完成。本次回复仅作为进行中的对话,Run 的终态由 Runtime 管理。必须调用且只调用 runtime_steer_decision。",
|
||||
"steer_decision_user": "项目背景:\n{context}\n\n当前 Runtime 摘要:\n{}\n\n用户在制作过程中发来的消息:\n{}",
|
||||
"protocol": "结合整句的意图、否定、假设、范围和上下文选择回应方式。普通问答、身份说明、架构解释、方案讨论和必要澄清直接用自然语言回复;确实需要宿主持久能力时,仅调用一个 function tool 作为本轮输出。",
|
||||
"system": "{role_prompt}\n\n你现在位于统一的 Agent interaction loop。{protocol} 高影响请求仍不明确时,先向用户澄清。",
|
||||
"user": "用户这轮输入:\n{prompt}",
|
||||
"user_with_context": "请参考以下项目背景回答本轮用户输入。\n\n{context}\n\n用户这轮输入:\n{prompt}"
|
||||
"steer_decision_user": "项目背景:\n{context}\n\n当前 Runtime 摘要:\n{}\n\n用户在制作过程中发来的消息:\n{}"
|
||||
}
|
||||
|
||||
@@ -1753,7 +1753,7 @@ export function App({
|
||||
const nextProjectPath = resolveChatProjectPath(localProject);
|
||||
if (!nextProjectPath) {
|
||||
if (announceToChat) {
|
||||
announceProjectChatMessage('请先用 /project 设置本地项目。');
|
||||
announceProjectChatMessage('请先打开本地项目。');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { DirectCodexUserContentPart } from '../../view/project-development/
|
||||
* 「不再提醒」偏好存本机 localStorage,不进 manifest、不进后端。
|
||||
*
|
||||
* **刻意只留这一个全局键,不按入口分域**:它关掉的是聊天输入区那一条「发送前提醒」
|
||||
* (≥40 字、非 `/` 命令)——资源侧的生成素材 / 快速编辑没有这条提醒可关,润色在那里
|
||||
* (纯文本 ≥40 字)——资源侧的生成素材 / 快速编辑没有这条提醒可关,润色在那里
|
||||
* 是显式按钮动作,不存在被打断的场景。分域只有在「每个入口都有可关的提醒」时才有意义,
|
||||
* 现在分域等于给不存在的提醒提前留位。
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user