chore: rebuild release package

This commit is contained in:
shiyue
2026-07-16 18:04:37 +08:00
parent 614e222f14
commit 5c3401292d
18 changed files with 1032 additions and 64 deletions

View File

@@ -6372,7 +6372,8 @@ wss.on('connection', (ws, req) => {
switch (msg.type) {
case 'message':
if (msg.text && msg.text.trim().startsWith('/')) {
handleSlashCommand(ws, msg.text.trim(), msg.sessionId, msg.agent, msg);
const handled = handleSlashCommand(ws, msg.text.trim(), msg.sessionId, msg.agent, msg);
if (!handled) handleMessage(ws, msg, { unknownSlash: true });
} else {
handleMessage(ws, msg);
}
@@ -7026,13 +7027,18 @@ function handleSlashCommand(ws, text, sessionId, fallbackAgent, source = {}) {
sendSlashResponse({ type: 'system_message', message, ...extra }, options);
};
if (!COMPOSER_COMMANDS.some((item) => item.name === cmd)) {
sendSlashSystemMessage(`未知指令: ${cmd}\n输入 /help 查看可用指令`);
return false;
}
if (session && isCodexAppSession(session) && activeCodexAppTurns.has(sessionId)) {
sendSlashSystemMessage('Codex App 运行中暂不支持 slash 指令,请等待完成或点击停止。', {}, { preserveComposerDraft: true });
return;
return true;
}
if (session && isCodexAppSession(session) && activeCodexAppGoalCommands.has(sessionId)) {
sendSlashSystemMessage('Codex App Goal 正在同步,请稍候。', { sessionId }, { preserveComposerDraft: true });
return;
return true;
}
switch (cmd) {
@@ -7226,8 +7232,10 @@ function handleSlashCommand(ws, text, sessionId, fallbackAgent, source = {}) {
}
default:
sendSlashSystemMessage(`未知指令: ${cmd}\n输入 /help 查看可用指令`, {}, { preserveComposerDraft: true });
sendSlashSystemMessage(`未知指令: ${cmd}\n输入 /help 查看可用指令`);
return false;
}
return true;
}
// === Session Handlers ===
@@ -8007,7 +8015,7 @@ function handleCcwebMcpChildAgentClose(ws, msg = {}) {
// === Runtime Message Handler ===
function handleMessage(ws, msg, options = {}) {
const { text, sessionId, mode } = msg;
const { hideInHistory = false } = options;
const { hideInHistory = false, unknownSlash = false } = options;
const fail = (code, message) => {
wsSend(ws, attachClientRequestId({
type: 'error',
@@ -8100,7 +8108,7 @@ function handleMessage(ws, msg, options = {}) {
runtimeTextValue = decoratorResolution.runtimeText;
normalizedRuntimeText = runtimeTextValue.trim();
if (normalizedText.startsWith('/') && resolvedAttachments.length > 0) {
if (!unknownSlash && normalizedText.startsWith('/') && resolvedAttachments.length > 0) {
return fail('command_attachment_unsupported', '命令消息暂不支持同时附带图片。请先发送图片说明,再单独使用 /model 或 /mode。');
}
@@ -10166,7 +10174,7 @@ function handleCodexAppSteerMessage(ws, msg, options = {}) {
const normalizedText = textValue.trim();
const attachments = Array.isArray(msg.attachments) ? msg.attachments : [];
if (!normalizedText) return fail('empty_message', '运行中插入内容不能为空。');
if (normalizedText.startsWith('/')) return fail('codexapp_running_slash_unsupported', 'Codex App 运行中暂不支持 slash 指令插入。');
if (!options.unknownSlash && normalizedText.startsWith('/')) return fail('codexapp_running_slash_unsupported', 'Codex App 运行中暂不支持 slash 指令插入。');
if (attachments.length > 0) return fail('codexapp_running_attachment_unsupported', 'Codex App 运行中插入暂不支持图片附件。');
if (!entry.threadId || !entry.turnId) return fail('codexapp_turn_not_ready', 'Codex App 当前 turn 尚未准备好,请稍后再插入。');
if (!codexAppClient || !codexAppClient.isRunning()) return fail('codexapp_server_not_running', 'Codex app-server 未运行,无法插入。');