Update ccweb codex app integration
This commit is contained in:
@@ -36,6 +36,43 @@ const TOOLS = [
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ccweb_create_conversation',
|
||||
description: '创建一个新的 ccweb 持久对话。只用于需要在会话列表中长期追踪、后续可继续对话的工作流;一次性并行研究应优先使用子代能力。',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
agent: {
|
||||
type: 'string',
|
||||
enum: ['claude', 'codex', 'codexapp'],
|
||||
description: '可选。新对话使用的 Agent,默认继承来源对话。',
|
||||
},
|
||||
cwd: {
|
||||
type: 'string',
|
||||
description: '可选。新对话工作目录;指定时必须是已存在的绝对路径,默认继承来源对话 cwd。',
|
||||
},
|
||||
title: {
|
||||
type: 'string',
|
||||
maxLength: 120,
|
||||
description: '可选。新对话标题。',
|
||||
},
|
||||
mode: {
|
||||
type: 'string',
|
||||
enum: ['default', 'plan', 'yolo'],
|
||||
description: '可选。权限模式,默认继承来源对话;不会自动写死为 plan。',
|
||||
},
|
||||
initialMessage: {
|
||||
type: 'string',
|
||||
description: '可选。创建后立即发送到新对话的首条消息。',
|
||||
},
|
||||
requestReply: {
|
||||
type: 'boolean',
|
||||
description: '可选。若为 true,会在新对话完成本轮输出后把回复作为已处理的只读消息写回来源对话,不会再次触发来源对话运行。默认 false。',
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ccweb_send_message',
|
||||
description: '向指定 ccweb 对话发送一条消息,并以“来自某对话”的气泡在目标对话中展示。',
|
||||
@@ -57,7 +94,7 @@ const TOOLS = [
|
||||
},
|
||||
{
|
||||
name: 'ccweb_request_reply',
|
||||
description: '向指定 ccweb 对话发送一条消息,并在目标对话本轮输出完成后自动把回复发回当前对话。',
|
||||
description: '向指定 ccweb 对话发送一条消息,并在目标对话本轮输出完成后把回复作为已处理的只读消息写回当前对话;写回不会再次触发当前对话运行。',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
@@ -244,27 +281,31 @@ async function handleRequest(message) {
|
||||
}
|
||||
}
|
||||
|
||||
let lineBuffer = '';
|
||||
module.exports = { TOOLS };
|
||||
|
||||
process.stdin.setEncoding('utf8');
|
||||
process.stdin.on('data', (chunk) => {
|
||||
lineBuffer += chunk;
|
||||
let index;
|
||||
while ((index = lineBuffer.indexOf('\n')) >= 0) {
|
||||
const line = lineBuffer.slice(0, index).trim();
|
||||
lineBuffer = lineBuffer.slice(index + 1);
|
||||
if (!line) continue;
|
||||
let message;
|
||||
try {
|
||||
message = JSON.parse(line);
|
||||
} catch (err) {
|
||||
jsonRpcError(null, -32700, 'Parse error', err.message);
|
||||
continue;
|
||||
if (require.main === module) {
|
||||
let lineBuffer = '';
|
||||
|
||||
process.stdin.setEncoding('utf8');
|
||||
process.stdin.on('data', (chunk) => {
|
||||
lineBuffer += chunk;
|
||||
let index;
|
||||
while ((index = lineBuffer.indexOf('\n')) >= 0) {
|
||||
const line = lineBuffer.slice(0, index).trim();
|
||||
lineBuffer = lineBuffer.slice(index + 1);
|
||||
if (!line) continue;
|
||||
let message;
|
||||
try {
|
||||
message = JSON.parse(line);
|
||||
} catch (err) {
|
||||
jsonRpcError(null, -32700, 'Parse error', err.message);
|
||||
continue;
|
||||
}
|
||||
handleRequest(message);
|
||||
}
|
||||
handleRequest(message);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
process.stdin.on('end', () => {
|
||||
process.exit(0);
|
||||
});
|
||||
process.stdin.on('end', () => {
|
||||
process.exit(0);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user