恢复 Codex PlanList 并更新发布包
This commit is contained in:
@@ -126,6 +126,33 @@ const TOOLS = [
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ccweb_update_plan',
|
||||
description: '当原生 update_plan 工具不可用时,在当前 ccweb 对话展示并更新多步骤计划。每次传入完整计划;开始、完成步骤时重新调用以同步状态。简单任务无需调用。',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
explanation: { type: 'string', maxLength: 500, description: '可选。此次更新的简短原因。' },
|
||||
plan: {
|
||||
type: 'array',
|
||||
minItems: 1,
|
||||
maxItems: 20,
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
step: { type: 'string', maxLength: 500, description: '计划步骤。' },
|
||||
status: { type: 'string', enum: ['pending', 'in_progress', 'completed'], description: '步骤状态。' },
|
||||
},
|
||||
required: ['step', 'status'],
|
||||
additionalProperties: false,
|
||||
},
|
||||
description: '当前完整计划,按执行顺序排列。',
|
||||
},
|
||||
},
|
||||
required: ['plan'],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'ccweb_create_conversation',
|
||||
description: '创建一个新的 ccweb 持久对话。Agent 固定继承来源对话,不作为参数指定;只用于需要在会话列表中长期追踪、后续可继续对话的工作流;一次性并行研究应优先使用子代能力。工具调用会立即返回。启用 requestReply 后,默认由系统异步回传结果;除非用户明确要求轮询,否则不主动轮询等待。',
|
||||
|
||||
@@ -152,6 +152,10 @@ function createCodexAppRuntime(deps = {}) {
|
||||
return CODEX_APP_PLAN_TOOL_NAMES.has(name) || name.endsWith('_update_plan');
|
||||
}
|
||||
|
||||
function isCcwebPlanItem(item) {
|
||||
return item?.type === 'mcpToolCall' && item.server === 'ccweb' && item.tool === 'ccweb_update_plan';
|
||||
}
|
||||
|
||||
function isPlanLikeItem(item) {
|
||||
if (!item || typeof item !== 'object') return false;
|
||||
if (CODEX_APP_PLAN_ITEM_TYPES.has(normalizeIdentifier(item.type))) return true;
|
||||
@@ -248,7 +252,7 @@ function createCodexAppRuntime(deps = {}) {
|
||||
})
|
||||
.filter(Boolean);
|
||||
return {
|
||||
id: item.id || item.itemId || item.planId || 'codex-app-plan',
|
||||
id: isCcwebPlanItem(item) ? 'ccweb-update-plan' : (item.id || item.itemId || item.planId || 'codex-app-plan'),
|
||||
type: 'todo_list',
|
||||
items,
|
||||
progress: summarizeTodoListProgress(items),
|
||||
@@ -587,7 +591,7 @@ function createCodexAppRuntime(deps = {}) {
|
||||
return {
|
||||
kind: 'todo_list',
|
||||
title: 'Plan List',
|
||||
subtitle: item.explanation || item.title || item.tool || '',
|
||||
subtitle: item.explanation || item.title || (isCcwebPlanItem(item) ? '' : item.tool || ''),
|
||||
status: todoListPlanStatus(item, todoList),
|
||||
progress: todoList.progress,
|
||||
};
|
||||
@@ -698,7 +702,8 @@ function createCodexAppRuntime(deps = {}) {
|
||||
function ensureToolCall(entry, item, sessionId) {
|
||||
if (!item?.id) return null;
|
||||
const kind = itemKind(item);
|
||||
let toolCall = entry.toolCalls.find((tool) => tool.id === item.id);
|
||||
const itemId = isCcwebPlanItem(item) ? 'ccweb-update-plan' : item.id;
|
||||
let toolCall = entry.toolCalls.find((tool) => tool.id === itemId);
|
||||
if (toolCall) {
|
||||
toolCall.name = itemName(item);
|
||||
toolCall.kind = kind;
|
||||
@@ -738,7 +743,7 @@ function createCodexAppRuntime(deps = {}) {
|
||||
|
||||
toolCall = {
|
||||
name: itemName(item),
|
||||
id: item.id,
|
||||
id: itemId,
|
||||
kind,
|
||||
meta: itemMeta(item),
|
||||
input: itemInput(item),
|
||||
|
||||
Reference in New Issue
Block a user