/**
 * Built-in workflow: `release_check`
 *
 * Runs a release-readiness review for a finished change. It inspects the diff,
 * validates risk areas in parallel, and produces a go/no-go checklist.
 *
 * Args:
 *   - target: release candidate, branch, commit range, or feature summary
 *   - checks: optional subset of check keys
 */
export declare const RELEASE_CHECK_SCRIPT = "export const meta = {\n  name: 'release_check',\n  description: 'Assess whether a change is ready to release with parallel risk checks and a go/no-go verdict.',\n  whenToUse: 'User is near the end of implementation and wants a release-quality readiness check before shipping.',\n  examplePrompts: [\n    { field: 'target', text: 'Is this repo ready to release v1.2?' },\n    { field: 'target', text: 'Pre-release readiness check for the current branch' },\n  ],\n  i18n: {\n    zh: {\n      description: '\u5E76\u884C\u68C0\u67E5\u53D1\u5E03\u98CE\u9669\uFF0C\u5224\u65AD\u53D8\u66F4\u662F\u5426\u8FBE\u5230\u53EF\u53D1\u5E03\u6807\u51C6\u3002',\n      whenToUse: '\u7528\u6237\u63A5\u8FD1\u5F00\u53D1\u5C3E\u58F0\uFF0C\u60F3\u5728\u53D1\u5E03\u524D\u505A\u53D1\u5E03\u8D28\u91CF/\u5C31\u7EEA\u68C0\u67E5\u65F6\u3002',\n      examplePrompts: [\n        { field: 'target', text: '\u8FD9\u4E2A\u4ED3\u5E93\u662F\u5426\u51C6\u5907\u597D\u53D1\u5E03 v1.2\uFF1F' },\n        { field: 'target', text: '\u5BF9\u5F53\u524D\u5206\u652F\u505A\u53D1\u5E03\u524D\u5C31\u7EEA\u68C0\u67E5' },\n      ],\n    },\n  },\n  tags: ['release', 'quality', 'validation'],\n  estimatedAgents: { min: 6, max: 7 },\n  phases: [\n    { title: 'Scope' },\n    { title: 'Checks' },\n    { title: 'Verdict' },\n  ],\n}\n\nconst READ_ONLY_TOOLS = ['read_file', 'grep', 'find', 'list_dir', 'shell']\n\nconst target = args && typeof args === 'object' && args.target\n  ? String(args.target)\n  : 'Current working tree or release candidate from the conversation context.'\n\nconst ALL_CHECKS = [\n  { key: 'regression', focus: 'Behavior changes, compatibility breaks, edge cases, and accidental scope creep.' },\n  { key: 'tests', focus: 'Relevant automated tests, missing regression cases, flaky or weak assertions, and manual coverage gaps.' },\n  { key: 'build', focus: 'Typecheck, lint, build, packaging, lazy imports, generated assets, and dependency correctness.' },\n  { key: 'security', focus: 'Secrets, auth/authz, input validation, unsafe shell/file/network access, and data exposure.' },\n  { key: 'ops', focus: 'Logging, observability, migrations, persistence, rollback, failure modes, and supportability.' },\n]\n\nlet checks = ALL_CHECKS\nif (args && typeof args === 'object' && Array.isArray(args.checks) && args.checks.length) {\n  const selected = new Set(args.checks.map((check) => String(check)))\n  checks = ALL_CHECKS.filter((check) => selected.has(check.key))\n  if (!checks.length) checks = ALL_CHECKS\n}\n\nphase('Scope')\nconst scope = await agent(\n  'Identify the release candidate scope. Inspect the working tree or target if useful. Return changed areas, user-visible behavior, and likely blast radius.\\n\\n' +\n    'TARGET:\\n' + target,\n  {\n    label: 'release scope',\n    toolset: READ_ONLY_TOOLS,\n    schema: {\n      type: 'object',\n      properties: {\n        changedAreas: { type: 'array', items: { type: 'string' } },\n        userVisibleChanges: { type: 'array', items: { type: 'string' } },\n        blastRadius: { type: 'string' },\n      },\n      required: ['changedAreas', 'blastRadius'],\n    },\n  },\n)\n\nphase('Checks')\nconst reports = await parallel(\n  checks.map((check) => () =>\n    agent(\n      'Run a release-readiness check through the ' + check.key + ' lens.\\n' +\n        'Focus: ' + check.focus + '\\n\\n' +\n        'TARGET:\\n' + target + '\\n\\n' +\n        'SCOPE:\\n' + JSON.stringify(scope, null, 2) + '\\n\\n' +\n        'Return blockers, warnings, evidence, and concrete fixes. Prefer specific files/commands over generic statements.',\n      {\n        label: check.key + ' check',\n        toolset: READ_ONLY_TOOLS,\n        schema: {\n          type: 'object',\n          properties: {\n            blockers: {\n              type: 'array',\n              items: {\n                type: 'object',\n                properties: {\n                  title: { type: 'string' },\n                  evidence: { type: 'string' },\n                  fix: { type: 'string' },\n                },\n                required: ['title', 'evidence', 'fix'],\n              },\n            },\n            warnings: {\n              type: 'array',\n              items: {\n                type: 'object',\n                properties: {\n                  title: { type: 'string' },\n                  evidence: { type: 'string' },\n                  fix: { type: 'string' },\n                },\n                required: ['title', 'evidence'],\n              },\n            },\n            recommendedCommands: { type: 'array', items: { type: 'string' } },\n          },\n          required: ['blockers', 'warnings'],\n        },\n      },\n    ),\n  ),\n)\n\nphase('Verdict')\nconst byCheck = {}\nfor (let i = 0; i < checks.length; i++) {\n  byCheck[checks[i].key] = reports[i] ?? { blockers: [], warnings: [], recommendedCommands: [] }\n}\n\nconst verdict = await agent(\n  'Synthesize a release go/no-go verdict. Block if any credible blocker remains. If not blocked, distinguish ship_now from ship_after_checks. ' +\n    'Deduplicate issues and produce the shortest checklist that would make this release safe.\\n\\n' +\n    JSON.stringify({ target, scope, byCheck }, null, 2),\n  {\n    label: 'release verdict',\n    schema: {\n      type: 'object',\n      properties: {\n        recommendation: { type: 'string', enum: ['ship_now', 'ship_after_checks', 'block'] },\n        summary: { type: 'string' },\n        blockers: { type: 'array', items: { type: 'string' } },\n        finalChecklist: { type: 'array', items: { type: 'string' } },\n        commandsToRun: { type: 'array', items: { type: 'string' } },\n      },\n      required: ['recommendation', 'summary', 'blockers', 'finalChecklist'],\n    },\n  },\n)\n\nreturn {\n  ok: true,\n  target,\n  checks: checks.map((check) => check.key),\n  scope,\n  ...(verdict ?? { recommendation: 'ship_after_checks', summary: 'verdict failed', blockers: [], finalChecklist: [] }),\n  byCheck,\n}\n";
