Files
Agent-Workbench/docs/task-agreement-1.25-evidence/source-bytes/src/shared/contracts/task-plan-tools.mjs
T

19 lines
3.2 KiB
JavaScript

export const taskPlanToolDefinitions = [
{ type: 'function', function: { name: 'plan_task', description: '为当前复杂任务保存1–12步有依赖的计划。每步固定通过条件及实际证据类别,规划不执行操作。expected_revision首次为0;以后保留全部原步骤并追加,不能删改条件掩盖失败。原用户要求或计划变化后重新封存并核验仍有效的原证据,不重跑已完成工具。', parameters: {
type: 'object', additionalProperties: false, required: ['expected_revision', 'steps'], properties: { expected_revision: { type: 'integer', minimum: 0 }, steps: { type: 'array', minItems: 1, maxItems: 12, items: {
type: 'object', additionalProperties: false, required: ['key', 'title', 'criterion', 'kind'], properties: {
key: { type: 'string', pattern: '^[a-z][a-z0-9_-]{0,39}$' }, title: { type: 'string', maxLength: 100 }, criterion: { type: 'string', maxLength: 300 },
kind: { type: 'string', enum: ['analysis', 'changes', 'results', 'checks', 'browser'] }, depends_on: { type: 'array', items: { type: 'string' }, maxItems: 12 },
tools: { type: 'array', description: 'analysis必填,只读工具名称,例如inspect_project/read_file/query_code。', items: { type: 'string' } },
paths: { type: 'array', description: 'changes/results必填,项目相对文件路径。changes仅核验本Task实际应用;results核验verify_existing_files的当前文件成果。', items: { type: 'string' }, maxItems: 32 },
checks: { type: 'array', description: 'checks必填,仅核验当前源码的最新通过结果,名称如test/build/python:test。基线失败仍保留在检查日志,不设为checks计划步骤;改动后的通过验收再设此步骤。', items: { type: 'string' }, maxItems: 6 },
viewport_width: { type: 'integer', description: 'browser必填,固定桌面/手机视口宽度。', minimum: 320, maximum: 1440 },
actions: { type: 'array', description: 'browser需要的实际操作,始终要求非空通过断言及进程退出。', items: { type: 'string', enum: ['fill', 'select', 'click', 'assert_text', 'assert_count', 'assert_visible'] } },
} } } } } } },
{ type: 'function', function: { name: 'verify_task_step', description: '核验当前计划的一步,前置步骤必须先核验。evidence_id为原tool_invocation_id、已应用change_set_id、实际检查job_id或browser_job_id;类别按原步骤决定。核对原字节/当前输入,失败和失效保留,模型不能直接标完成,不重新执行工具。', parameters: {
type: 'object', additionalProperties: false, required: ['plan_id', 'step_key', 'evidence_id', 'expected_revision'], properties: {
plan_id: { type: 'string' }, step_key: { type: 'string' }, evidence_id: { type: 'string' }, expected_revision: { type: 'integer', minimum: 1 },
} } } },
{ type: 'function', function: { name: 'inspect_task_plan', description: '核对当前Task原计划、步骤依赖及现有证明的有效性。返回ready/blocked/verified/stale/needs_update及未完成项和原工件引用;读取不执行或重放工具。', parameters: { type: 'object', additionalProperties: false, properties: {} } } },
];