agentplane 0.3.10 → 0.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/AGENTS.md +2 -2
- package/assets/agents/CODER.json +4 -0
- package/assets/agents/CREATOR.json +1 -0
- package/assets/agents/DOCS.json +2 -1
- package/assets/agents/INTEGRATOR.json +2 -1
- package/assets/agents/ORCHESTRATOR.json +2 -0
- package/assets/agents/PLANNER.json +3 -1
- package/assets/agents/REVIEWER.json +1 -0
- package/assets/agents/TESTER.json +2 -2
- package/assets/agents/UPDATER.json +1 -0
- package/assets/agents/UPGRADER.json +1 -1
- package/assets/policy/governance.md +3 -4
- package/assets/policy/incidents.md +20 -88
- package/assets/policy/workflow.branch_pr.md +1 -1
- package/assets/policy/workflow.direct.md +2 -2
- package/bin/agentplane.js +114 -4
- package/bin/runtime-watch.js +1 -0
- package/bin/stale-dist-policy.d.ts +1 -1
- package/bin/stale-dist-policy.js +19 -1
- package/dist/.build-manifest.json +251 -166
- package/dist/cli/bootstrap-guide.d.ts.map +1 -1
- package/dist/cli/bootstrap-guide.js +3 -2
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +2 -1
- package/dist/cli/command-invocations.d.ts.map +1 -1
- package/dist/cli/command-invocations.js +4 -1
- package/dist/cli/run-cli/command-catalog/core.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +6 -1
- package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/project.js +3 -1
- package/dist/cli/run-cli/command-catalog/task.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/task.js +10 -0
- package/dist/cli/run-cli/command-catalog.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/core/preflight.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/core/preflight.js +44 -1
- package/dist/cli/run-cli.test-helpers.d.ts +1 -0
- package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
- package/dist/cli/run-cli.test-helpers.js +26 -0
- package/dist/commands/branch/cleanup-merged.d.ts +3 -0
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
- package/dist/commands/branch/cleanup-merged.js +149 -36
- package/dist/commands/branch/work-start.d.ts.map +1 -1
- package/dist/commands/branch/work-start.js +137 -1
- package/dist/commands/cleanup/merged.command.d.ts +2 -0
- package/dist/commands/cleanup/merged.command.d.ts.map +1 -1
- package/dist/commands/cleanup/merged.command.js +24 -0
- package/dist/commands/doctor/branch-pr.d.ts +4 -0
- package/dist/commands/doctor/branch-pr.d.ts.map +1 -0
- package/dist/commands/doctor/branch-pr.js +96 -0
- package/dist/commands/doctor/fixes.d.ts +5 -0
- package/dist/commands/doctor/fixes.d.ts.map +1 -1
- package/dist/commands/doctor/fixes.js +70 -0
- package/dist/commands/doctor.run.d.ts.map +1 -1
- package/dist/commands/doctor.run.js +6 -1
- package/dist/commands/finish.run.d.ts.map +1 -1
- package/dist/commands/finish.run.js +11 -0
- package/dist/commands/finish.spec.d.ts +11 -0
- package/dist/commands/finish.spec.d.ts.map +1 -1
- package/dist/commands/finish.spec.js +51 -0
- package/dist/commands/guard/impl/close-message.d.ts.map +1 -1
- package/dist/commands/guard/impl/close-message.js +23 -6
- package/dist/commands/guard/impl/commands.d.ts +1 -0
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +94 -2
- package/dist/commands/guard/impl/env.d.ts +1 -0
- package/dist/commands/guard/impl/env.d.ts.map +1 -1
- package/dist/commands/guard/impl/env.js +1 -0
- package/dist/commands/hooks/index.d.ts +1 -1
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +139 -6
- package/dist/commands/incidents/collect.command.d.ts.map +1 -1
- package/dist/commands/incidents/collect.command.js +12 -7
- package/dist/commands/incidents/incidents.command.js +1 -1
- package/dist/commands/incidents/shared.d.ts +34 -0
- package/dist/commands/incidents/shared.d.ts.map +1 -1
- package/dist/commands/incidents/shared.js +166 -12
- package/dist/commands/pr/check.d.ts.map +1 -1
- package/dist/commands/pr/check.js +241 -135
- package/dist/commands/pr/close-superseded.d.ts +9 -0
- package/dist/commands/pr/close-superseded.d.ts.map +1 -0
- package/dist/commands/pr/close-superseded.js +129 -0
- package/dist/commands/pr/close.d.ts +11 -0
- package/dist/commands/pr/close.d.ts.map +1 -0
- package/dist/commands/pr/close.js +116 -0
- package/dist/commands/pr/index.d.ts +2 -0
- package/dist/commands/pr/index.d.ts.map +1 -1
- package/dist/commands/pr/index.js +2 -0
- package/dist/commands/pr/integrate/artifacts.d.ts +7 -0
- package/dist/commands/pr/integrate/artifacts.d.ts.map +1 -1
- package/dist/commands/pr/integrate/artifacts.js +66 -1
- package/dist/commands/pr/integrate/cmd.d.ts.map +1 -1
- package/dist/commands/pr/integrate/cmd.js +43 -2
- package/dist/commands/pr/integrate/internal/bootstrap-guidance.d.ts +8 -0
- package/dist/commands/pr/integrate/internal/bootstrap-guidance.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/bootstrap-guidance.js +59 -0
- package/dist/commands/pr/integrate/internal/cleanup.d.ts +1 -11
- package/dist/commands/pr/integrate/internal/cleanup.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/cleanup.js +1 -46
- package/dist/commands/pr/integrate/internal/finalize.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/finalize.js +43 -12
- package/dist/commands/pr/integrate/internal/github-protection.d.ts +5 -0
- package/dist/commands/pr/integrate/internal/github-protection.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/github-protection.js +13 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/merge.js +36 -13
- package/dist/commands/pr/integrate/internal/post-integrate-bootstrap.d.ts +13 -0
- package/dist/commands/pr/integrate/internal/post-integrate-bootstrap.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/post-integrate-bootstrap.js +25 -0
- package/dist/commands/pr/integrate/internal/pre-integrate-bootstrap.d.ts +15 -0
- package/dist/commands/pr/integrate/internal/pre-integrate-bootstrap.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/pre-integrate-bootstrap.js +35 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts +4 -2
- package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/prepare.js +109 -38
- package/dist/commands/pr/internal/auto-commit.d.ts +7 -0
- package/dist/commands/pr/internal/auto-commit.d.ts.map +1 -0
- package/dist/commands/pr/internal/auto-commit.js +64 -0
- package/dist/commands/pr/internal/freshness.d.ts +21 -0
- package/dist/commands/pr/internal/freshness.d.ts.map +1 -0
- package/dist/commands/pr/internal/freshness.js +52 -0
- package/dist/commands/pr/internal/gh-api.d.ts +6 -0
- package/dist/commands/pr/internal/gh-api.d.ts.map +1 -0
- package/dist/commands/pr/internal/gh-api.js +80 -0
- package/dist/commands/pr/internal/pr-paths.d.ts +10 -0
- package/dist/commands/pr/internal/pr-paths.d.ts.map +1 -1
- package/dist/commands/pr/internal/pr-paths.js +10 -0
- package/dist/commands/pr/internal/review-template.d.ts.map +1 -1
- package/dist/commands/pr/internal/review-template.js +37 -4
- package/dist/commands/pr/internal/sync.d.ts +9 -0
- package/dist/commands/pr/internal/sync.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync.js +531 -124
- package/dist/commands/pr/open.d.ts +1 -0
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +24 -2
- package/dist/commands/pr/pr.command.d.ts +15 -0
- package/dist/commands/pr/pr.command.d.ts.map +1 -1
- package/dist/commands/pr/pr.command.js +118 -2
- package/dist/commands/pr/update.d.ts.map +1 -1
- package/dist/commands/pr/update.js +71 -2
- package/dist/commands/release/apply.command.d.ts +3 -1
- package/dist/commands/release/apply.command.d.ts.map +1 -1
- package/dist/commands/release/apply.command.js +356 -34
- package/dist/commands/release/apply.mutation.d.ts.map +1 -1
- package/dist/commands/release/apply.mutation.js +1 -0
- package/dist/commands/release/apply.preflight.d.ts.map +1 -1
- package/dist/commands/release/apply.preflight.js +1 -1
- package/dist/commands/release/apply.reporting.d.ts +1 -0
- package/dist/commands/release/apply.reporting.d.ts.map +1 -1
- package/dist/commands/release/apply.reporting.js +12 -8
- package/dist/commands/release/apply.types.d.ts +13 -0
- package/dist/commands/release/apply.types.d.ts.map +1 -1
- package/dist/commands/release/plan.command.d.ts.map +1 -1
- package/dist/commands/release/plan.command.js +48 -0
- package/dist/commands/shared/gh-transport.d.ts +16 -0
- package/dist/commands/shared/gh-transport.d.ts.map +1 -0
- package/dist/commands/shared/gh-transport.js +71 -0
- package/dist/commands/shared/git-diff.d.ts +3 -1
- package/dist/commands/shared/git-diff.d.ts.map +1 -1
- package/dist/commands/shared/git-diff.js +10 -2
- package/dist/commands/shared/git-ops.d.ts +1 -0
- package/dist/commands/shared/git-ops.d.ts.map +1 -1
- package/dist/commands/shared/git-ops.js +15 -0
- package/dist/commands/shared/git-worktree.d.ts +2 -0
- package/dist/commands/shared/git-worktree.d.ts.map +1 -1
- package/dist/commands/shared/git-worktree.js +22 -2
- package/dist/commands/shared/merged-branch-cleanup.d.ts +12 -0
- package/dist/commands/shared/merged-branch-cleanup.d.ts.map +1 -0
- package/dist/commands/shared/merged-branch-cleanup.js +46 -0
- package/dist/commands/shared/post-commit-pr-artifacts.d.ts +9 -0
- package/dist/commands/shared/post-commit-pr-artifacts.d.ts.map +1 -0
- package/dist/commands/shared/post-commit-pr-artifacts.js +57 -0
- package/dist/commands/shared/pr-meta.d.ts +20 -0
- package/dist/commands/shared/pr-meta.d.ts.map +1 -1
- package/dist/commands/shared/pr-meta.js +125 -0
- package/dist/commands/shared/task-backend.d.ts +7 -0
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +71 -27
- package/dist/commands/shared/task-local-freshness.d.ts +2 -0
- package/dist/commands/shared/task-local-freshness.d.ts.map +1 -1
- package/dist/commands/shared/task-local-freshness.js +7 -1
- package/dist/commands/task/close-duplicate.d.ts.map +1 -1
- package/dist/commands/task/close-duplicate.js +34 -1
- package/dist/commands/task/derive.js +1 -1
- package/dist/commands/task/doc-template.d.ts.map +1 -1
- package/dist/commands/task/doc-template.js +7 -11
- package/dist/commands/task/findings-add.command.d.ts +20 -0
- package/dist/commands/task/findings-add.command.d.ts.map +1 -0
- package/dist/commands/task/findings-add.command.js +165 -0
- package/dist/commands/task/findings.command.d.ts +7 -0
- package/dist/commands/task/findings.command.d.ts.map +1 -0
- package/dist/commands/task/findings.command.js +20 -0
- package/dist/commands/task/findings.d.ts +63 -0
- package/dist/commands/task/findings.d.ts.map +1 -0
- package/dist/commands/task/findings.js +188 -0
- package/dist/commands/task/finish-shared.d.ts +2 -0
- package/dist/commands/task/finish-shared.d.ts.map +1 -1
- package/dist/commands/task/finish-shared.js +56 -1
- package/dist/commands/task/finish.d.ts +10 -0
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +125 -6
- package/dist/commands/task/hosted-close-pr.command.d.ts +11 -0
- package/dist/commands/task/hosted-close-pr.command.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.command.js +449 -0
- package/dist/commands/task/hosted-close.command.d.ts.map +1 -1
- package/dist/commands/task/hosted-close.command.js +234 -19
- package/dist/commands/task/hosted-merge-sync.d.ts +41 -0
- package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
- package/dist/commands/task/hosted-merge-sync.js +291 -17
- package/dist/commands/task/index.d.ts +1 -0
- package/dist/commands/task/index.d.ts.map +1 -1
- package/dist/commands/task/index.js +1 -0
- package/dist/commands/task/new.d.ts +1 -0
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +71 -1
- package/dist/commands/task/new.spec.d.ts.map +1 -1
- package/dist/commands/task/new.spec.js +7 -0
- package/dist/commands/task/normalize.command.d.ts +2 -0
- package/dist/commands/task/normalize.command.d.ts.map +1 -1
- package/dist/commands/task/normalize.command.js +45 -0
- package/dist/commands/task/normalize.d.ts +2 -0
- package/dist/commands/task/normalize.d.ts.map +1 -1
- package/dist/commands/task/normalize.js +85 -8
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +7 -10
- package/dist/commands/task/shared/docs.d.ts +6 -0
- package/dist/commands/task/shared/docs.d.ts.map +1 -1
- package/dist/commands/task/shared/docs.js +14 -0
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +11 -1
- package/dist/commands/task/shared.d.ts +1 -1
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +1 -1
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +7 -10
- package/dist/commands/task/task.command.d.ts.map +1 -1
- package/dist/commands/task/task.command.js +4 -0
- package/dist/commands/task/verify-command-shared.d.ts +19 -0
- package/dist/commands/task/verify-command-shared.d.ts.map +1 -1
- package/dist/commands/task/verify-command-shared.js +152 -1
- package/dist/commands/task/verify-ok.command.d.ts.map +1 -1
- package/dist/commands/task/verify-ok.command.js +15 -2
- package/dist/commands/task/verify-record.d.ts +36 -0
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +166 -11
- package/dist/commands/task/verify-rework.command.d.ts.map +1 -1
- package/dist/commands/task/verify-rework.command.js +15 -2
- package/dist/commands/task/verify-show.command.d.ts +1 -1
- package/dist/commands/task/verify-show.command.d.ts.map +1 -1
- package/dist/commands/task/verify-show.command.js +28 -1
- package/dist/commands/verify.run.d.ts.map +1 -1
- package/dist/commands/verify.run.js +12 -0
- package/dist/commands/verify.spec.d.ts +2 -6
- package/dist/commands/verify.spec.d.ts.map +1 -1
- package/dist/commands/verify.spec.js +30 -3
- package/dist/runtime/incidents/index.d.ts +1 -1
- package/dist/runtime/incidents/index.d.ts.map +1 -1
- package/dist/runtime/incidents/resolve.d.ts.map +1 -1
- package/dist/runtime/incidents/resolve.js +319 -73
- package/dist/runtime/incidents/types.d.ts +14 -2
- package/dist/runtime/incidents/types.d.ts.map +1 -1
- package/dist/shared/env.d.ts +1 -0
- package/dist/shared/env.d.ts.map +1 -1
- package/dist/shared/env.js +22 -1
- package/dist/shared/protected-paths.d.ts +1 -1
- package/dist/shared/protected-paths.d.ts.map +1 -1
- package/dist/shared/protected-paths.js +4 -0
- package/package.json +2 -2
|
@@ -1,13 +1,55 @@
|
|
|
1
1
|
import { mapBackendError } from "../../cli/error-map.js";
|
|
2
2
|
import { successMessage } from "../../cli/output.js";
|
|
3
|
+
import { CliError } from "../../shared/errors.js";
|
|
3
4
|
import { ensureActionApproved } from "../shared/approval-requirements.js";
|
|
4
5
|
import { loadCommandContext } from "../shared/task-backend.js";
|
|
5
6
|
import { applyTaskCollectionMutation } from "../shared/task-mutation.js";
|
|
6
|
-
import {
|
|
7
|
+
import { collectTaskIncidents } from "../incidents/shared.js";
|
|
8
|
+
import { syncHostedMergedTasks, syncLocallyShippedBranchPrTasks } from "./hosted-merge-sync.js";
|
|
9
|
+
function dedupeTaskIds(taskIds) {
|
|
10
|
+
const seen = new Set();
|
|
11
|
+
const result = [];
|
|
12
|
+
for (const rawTaskId of taskIds) {
|
|
13
|
+
const taskId = rawTaskId.trim();
|
|
14
|
+
if (!taskId || seen.has(taskId))
|
|
15
|
+
continue;
|
|
16
|
+
seen.add(taskId);
|
|
17
|
+
result.push(taskId);
|
|
18
|
+
}
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
21
|
+
function selectTasksForNormalize(current, taskIds) {
|
|
22
|
+
if (taskIds.length === 0)
|
|
23
|
+
return current.map((task) => ({ ...task }));
|
|
24
|
+
const byId = new Map(current.map((task) => [task.id, task]));
|
|
25
|
+
const missing = [];
|
|
26
|
+
const selected = [];
|
|
27
|
+
for (const taskId of taskIds) {
|
|
28
|
+
const task = byId.get(taskId);
|
|
29
|
+
if (!task) {
|
|
30
|
+
missing.push(taskId);
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
selected.push({ ...task });
|
|
34
|
+
}
|
|
35
|
+
if (missing.length > 0) {
|
|
36
|
+
throw new CliError({
|
|
37
|
+
exitCode: 2,
|
|
38
|
+
code: "E_USAGE",
|
|
39
|
+
message: `Unknown task${missing.length === 1 ? "" : "s"}: ${missing.join(", ")}`,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return selected;
|
|
43
|
+
}
|
|
44
|
+
function diffTasksToWrite(current, next) {
|
|
45
|
+
const previousById = new Map(current.map((task) => [task.id, JSON.stringify(task)]));
|
|
46
|
+
return next.filter((task) => previousById.get(task.id) !== JSON.stringify(task));
|
|
47
|
+
}
|
|
7
48
|
export async function cmdTaskNormalize(opts) {
|
|
8
49
|
try {
|
|
9
50
|
const ctx = opts.ctx ??
|
|
10
51
|
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
52
|
+
const selectedTaskIds = dedupeTaskIds(opts.taskIds ?? []);
|
|
11
53
|
if (opts.force) {
|
|
12
54
|
await ensureActionApproved({
|
|
13
55
|
action: "force_action",
|
|
@@ -16,7 +58,9 @@ export async function cmdTaskNormalize(opts) {
|
|
|
16
58
|
reason: "task normalize --force",
|
|
17
59
|
});
|
|
18
60
|
}
|
|
19
|
-
if (ctx.taskBackend.normalizeTasks &&
|
|
61
|
+
if (ctx.taskBackend.normalizeTasks &&
|
|
62
|
+
opts.syncHostedMerges !== true &&
|
|
63
|
+
opts.syncBranchPrState !== true) {
|
|
20
64
|
const result = await ctx.taskBackend.normalizeTasks();
|
|
21
65
|
if (!opts.quiet) {
|
|
22
66
|
process.stdout.write(`${successMessage("normalized tasks", undefined, `scanned=${result.scanned} changed=${result.changed}`)}\n`);
|
|
@@ -24,24 +68,57 @@ export async function cmdTaskNormalize(opts) {
|
|
|
24
68
|
return 0;
|
|
25
69
|
}
|
|
26
70
|
let syncedHostedMerges = 0;
|
|
71
|
+
let syncedBranchPrState = 0;
|
|
72
|
+
let promotedIncidents = 0;
|
|
73
|
+
const passThroughNormalizeWrite = opts.syncHostedMerges !== true && opts.syncBranchPrState !== true;
|
|
27
74
|
const { result, tasksToWrite } = await applyTaskCollectionMutation({
|
|
28
75
|
ctx,
|
|
29
76
|
build: async (tasks) => {
|
|
30
|
-
|
|
77
|
+
const scopedTasks = selectTasksForNormalize(tasks, selectedTaskIds);
|
|
78
|
+
let nextTasks = scopedTasks;
|
|
31
79
|
if (opts.syncHostedMerges === true) {
|
|
32
|
-
const synced = await syncHostedMergedTasks({ ctx, tasks });
|
|
80
|
+
const synced = await syncHostedMergedTasks({ ctx, tasks: nextTasks });
|
|
33
81
|
nextTasks = synced.tasks;
|
|
34
82
|
syncedHostedMerges = synced.synced;
|
|
35
83
|
}
|
|
84
|
+
if (opts.syncBranchPrState === true) {
|
|
85
|
+
const synced = await syncLocallyShippedBranchPrTasks({ ctx, tasks: nextTasks });
|
|
86
|
+
nextTasks = synced.tasks;
|
|
87
|
+
syncedBranchPrState = synced.synced;
|
|
88
|
+
}
|
|
89
|
+
const nextTasksToWrite = passThroughNormalizeWrite
|
|
90
|
+
? nextTasks
|
|
91
|
+
: diffTasksToWrite(scopedTasks, nextTasks);
|
|
92
|
+
const incidentCandidates = opts.syncHostedMerges === true || opts.syncBranchPrState === true
|
|
93
|
+
? nextTasksToWrite.filter((task) => String(task.status || "TODO").toUpperCase() === "DONE")
|
|
94
|
+
: [];
|
|
95
|
+
for (const task of incidentCandidates) {
|
|
96
|
+
await collectTaskIncidents({
|
|
97
|
+
ctx,
|
|
98
|
+
taskId: task.id,
|
|
99
|
+
task,
|
|
100
|
+
write: false,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
36
103
|
return {
|
|
37
|
-
result:
|
|
38
|
-
tasksToWrite:
|
|
104
|
+
result: { incidentCandidates },
|
|
105
|
+
tasksToWrite: nextTasksToWrite,
|
|
39
106
|
};
|
|
40
107
|
},
|
|
41
108
|
});
|
|
42
|
-
|
|
109
|
+
for (const task of result.incidentCandidates) {
|
|
110
|
+
const collected = await collectTaskIncidents({
|
|
111
|
+
ctx,
|
|
112
|
+
taskId: task.id,
|
|
113
|
+
task,
|
|
114
|
+
write: true,
|
|
115
|
+
});
|
|
116
|
+
promotedIncidents += collected.plan.promotable.length;
|
|
117
|
+
}
|
|
43
118
|
if (!opts.quiet) {
|
|
44
|
-
process.stdout.write(`${successMessage("normalized tasks", undefined, `count=${tasksToWrite.length}${opts.syncHostedMerges === true ? ` synced_hosted_merges=${syncedHostedMerges}` : ""}`
|
|
119
|
+
process.stdout.write(`${successMessage("normalized tasks", undefined, `count=${tasksToWrite.length}${opts.syncHostedMerges === true ? ` synced_hosted_merges=${syncedHostedMerges}` : ""}${opts.syncBranchPrState === true ? ` synced_branch_pr_state=${syncedBranchPrState}` : ""}${opts.syncHostedMerges === true || opts.syncBranchPrState === true
|
|
120
|
+
? ` promoted_incidents=${promotedIncidents}`
|
|
121
|
+
: ""}`)}\n`);
|
|
45
122
|
}
|
|
46
123
|
return 0;
|
|
47
124
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/commands/task/plan.ts"],"names":[],"mappings":"AASA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/commands/task/plan.ts"],"names":[],"mappings":"AASA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AA0InC,wBAAsB,cAAc,CAAC,IAAI,EAAE;IACzC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CAuHlB;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,MAAM,CAAC,CAgElB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,OAAO,CAAC,MAAM,CAAC,CAuElB"}
|
|
@@ -7,7 +7,7 @@ import { CliError } from "../../shared/errors.js";
|
|
|
7
7
|
import { loadCommandContext, loadTaskFromContext, } from "../shared/task-backend.js";
|
|
8
8
|
import { applyTaskMutation, withTaskMutationStorage } from "../shared/task-mutation.js";
|
|
9
9
|
import { setTaskFieldsIntent, setTaskSectionIntent, touchTaskDocMetaIntent, } from "../shared/task-store.js";
|
|
10
|
-
import { decodeEscapedTaskTextNewlines, ensureAgentFilledRequiredDocSections, extractDocSection, extractTaskObservationSection,
|
|
10
|
+
import { assertVerifyStepsFilled, decodeEscapedTaskTextNewlines, ensureAgentFilledRequiredDocSections, extractDocSection, extractTaskObservationSection, nowIso, normalizeTaskDocVersion, taskObservationSectionName, requiresVerifyStepsByPrimary, toStringArray, } from "./shared.js";
|
|
11
11
|
async function loadPlanBackend(opts) {
|
|
12
12
|
const ctx = opts.ctx ??
|
|
13
13
|
(await loadCommandContext({ cwd: opts.cwd, rootOverride: opts.rootOverride ?? null }));
|
|
@@ -63,15 +63,12 @@ function assertPlanCanBeApproved(opts) {
|
|
|
63
63
|
const verifyRequired = requiresVerifyStepsByPrimary(tags, opts.config);
|
|
64
64
|
const isSpike = tags.some((tag) => tag.trim().toLowerCase() === spikeTag);
|
|
65
65
|
if (verifyRequired || isSpike) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"(fill it before approving plan)",
|
|
73
|
-
});
|
|
74
|
-
}
|
|
66
|
+
assertVerifyStepsFilled({
|
|
67
|
+
taskId: opts.task.id,
|
|
68
|
+
sectionText: extractDocSection(opts.doc, "Verify Steps"),
|
|
69
|
+
action: "approve plan",
|
|
70
|
+
guidance: "fill it before approving plan",
|
|
71
|
+
});
|
|
75
72
|
}
|
|
76
73
|
if (!isSpike)
|
|
77
74
|
return;
|
|
@@ -8,6 +8,12 @@ export type TaskDocVersion = 2 | 3;
|
|
|
8
8
|
export declare function decodeEscapedTaskTextNewlines(text: string): string;
|
|
9
9
|
export declare function extractDocSection(doc: string, sectionName: string): string | null;
|
|
10
10
|
export declare function isVerifyStepsFilled(sectionText: string | null): boolean;
|
|
11
|
+
export declare function assertVerifyStepsFilled(opts: {
|
|
12
|
+
taskId: string;
|
|
13
|
+
sectionText: string | null;
|
|
14
|
+
action: string;
|
|
15
|
+
guidance?: string;
|
|
16
|
+
}): void;
|
|
11
17
|
export declare function normalizeTaskDocVersion(value: unknown, fallback?: TaskDocVersion): TaskDocVersion;
|
|
12
18
|
export declare function normalizeVerificationSectionLayout(sectionText: string | null, version: TaskDocVersion): string;
|
|
13
19
|
export declare function taskObservationSectionName(version: TaskDocVersion): "Notes" | "Findings";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../../src/commands/task/shared/docs.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,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,EACd,QAAQ,GAAE,cAAkB,GAC3B,cAAc,CAEhB;AAED,wBAAgB,kCAAkC,CAChD,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,OAAO,EAAE,cAAc,GACtB,MAAM,CAyCR;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,GAAG,UAAU,CAExF;AAED,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI,CAIjG;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC/C,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,MAAM,EAAE,CAaX;AAMD,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAKtE;AAED,wBAAgB,oCAAoC,CAAC,IAAI,EAAE;IACzD,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC3B,MAAM,EAAE,gBAAgB,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,IAAI,CA6BP"}
|
|
@@ -7,6 +7,7 @@ export function nowIso() {
|
|
|
7
7
|
export const VERIFY_STEPS_PLACEHOLDER = "<!-- TODO: REPLACE WITH TASK-SPECIFIC ACCEPTANCE STEPS -->";
|
|
8
8
|
export const VERIFICATION_RESULTS_BEGIN = "<!-- BEGIN VERIFICATION RESULTS -->";
|
|
9
9
|
export const VERIFICATION_RESULTS_END = "<!-- END VERIFICATION RESULTS -->";
|
|
10
|
+
const VERIFY_STEPS_TEMPLATE_LINE_RE = /^\d+\.\s*<[^>\n]+>\.\s*Expected:\s*<[^>\n]+>\.?$/m;
|
|
10
11
|
export function decodeEscapedTaskTextNewlines(text) {
|
|
11
12
|
const normalized = text.replaceAll("\r\n", "\n");
|
|
12
13
|
if (!normalized.includes(String.raw `\n`) && !normalized.includes(String.raw `\r\n`)) {
|
|
@@ -39,8 +40,21 @@ export function isVerifyStepsFilled(sectionText) {
|
|
|
39
40
|
return false;
|
|
40
41
|
if (normalized.includes(VERIFY_STEPS_PLACEHOLDER))
|
|
41
42
|
return false;
|
|
43
|
+
if (VERIFY_STEPS_TEMPLATE_LINE_RE.test(normalized))
|
|
44
|
+
return false;
|
|
42
45
|
return true;
|
|
43
46
|
}
|
|
47
|
+
export function assertVerifyStepsFilled(opts) {
|
|
48
|
+
if (isVerifyStepsFilled(opts.sectionText))
|
|
49
|
+
return;
|
|
50
|
+
const guidance = opts.guidance ? ` (${opts.guidance})` : "";
|
|
51
|
+
throw new CliError({
|
|
52
|
+
exitCode: 3,
|
|
53
|
+
code: "E_VALIDATION",
|
|
54
|
+
message: `${opts.taskId}: cannot ${opts.action}: ## Verify Steps section is missing/empty/unfilled` +
|
|
55
|
+
guidance,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
44
58
|
export function normalizeTaskDocVersion(value, fallback = 3) {
|
|
45
59
|
return value === 3 ? 3 : value === 2 ? 2 : fallback;
|
|
46
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transitions.d.ts","sourceRoot":"","sources":["../../../../src/commands/task/shared/transitions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAO5D,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"transitions.d.ts","sourceRoot":"","sources":["../../../../src/commands/task/shared/transitions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAO5D,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,E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orkLock } from "../../../shared/direct-work-lock.js";
|
|
|
6
6
|
import { CliError } from "../../../shared/errors.js";
|
|
7
7
|
import { parseGitLogHashSubject } from "../../../shared/git-log.js";
|
|
8
8
|
import { commitFromComment } from "../../guard/index.js";
|
|
9
|
+
import { refreshBranchPrArtifactsAfterTaskCommit } from "../../shared/post-commit-pr-artifacts.js";
|
|
9
10
|
import { requiresVerificationByPrimary, toStringArray } from "./tags.js";
|
|
10
11
|
const execFileAsync = promisify(execFile);
|
|
11
12
|
export function appendTaskEvent(task, event) {
|
|
@@ -40,6 +41,7 @@ export function ensureVerificationSatisfiedIfRequired(task, config) {
|
|
|
40
41
|
if (state === "ok")
|
|
41
42
|
return;
|
|
42
43
|
const hint = `use \`agentplane verify ${task.id} --ok|--rework --by <ID> --note <TEXT>\` ` +
|
|
44
|
+
`and add \`--observation <TEXT> --impact <TEXT> --resolution <TEXT>\` when you want a structured finding ` +
|
|
43
45
|
`or \`agentplane task verify ok|rework ${task.id} --by <ID> --note <TEXT>\``;
|
|
44
46
|
throw new CliError({
|
|
45
47
|
exitCode: 3,
|
|
@@ -153,7 +155,7 @@ export async function runTaskTransitionCommentCommit(opts) {
|
|
|
153
155
|
author: opts.author,
|
|
154
156
|
})
|
|
155
157
|
: undefined;
|
|
156
|
-
|
|
158
|
+
const result = await commitFromComment({
|
|
157
159
|
ctx: opts.ctx,
|
|
158
160
|
cwd: opts.cwd,
|
|
159
161
|
rootOverride: opts.rootOverride,
|
|
@@ -173,6 +175,14 @@ export async function runTaskTransitionCommentCommit(opts) {
|
|
|
173
175
|
quiet: opts.quiet,
|
|
174
176
|
config: opts.ctx.config,
|
|
175
177
|
});
|
|
178
|
+
await refreshBranchPrArtifactsAfterTaskCommit({
|
|
179
|
+
ctx: opts.ctx,
|
|
180
|
+
cwd: opts.cwd,
|
|
181
|
+
rootOverride: opts.rootOverride,
|
|
182
|
+
taskId: opts.taskId,
|
|
183
|
+
quiet: opts.quiet,
|
|
184
|
+
});
|
|
185
|
+
return result;
|
|
176
186
|
}
|
|
177
187
|
export async function readHeadCommit(cwd) {
|
|
178
188
|
const { stdout } = await execFileAsync("git", ["log", "-1", "--pretty=%H%x00%s"], { cwd });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { dedupeStrings } from "../../shared/strings.js";
|
|
2
|
-
export { decodeEscapedTaskTextNewlines, nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, resolveWritableDocSections, } from "./shared/docs.js";
|
|
2
|
+
export { decodeEscapedTaskTextNewlines, nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, assertVerifyStepsFilled, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, resolveWritableDocSections, } from "./shared/docs.js";
|
|
3
3
|
export { normalizeDependsOnInput, normalizeTaskStatus, toStringArray, requiresVerify, type PrimaryTagResolution, type TaskTagPolicy, readTaskTagPolicy, resolvePrimaryTagFromConfig, requiresVerifyStepsByPrimary, requiresVerificationByPrimary, resolvePrimaryTag, warnIfUnknownOwner, } from "./shared/tags.js";
|
|
4
4
|
export { type DependencyState, dependencyWarningMessages, ensureTaskDependsOnGraphIsAcyclic, resolveTaskDependencyState, buildDependencyState, formatTaskLine, } from "./shared/dependencies.js";
|
|
5
5
|
export { appendTaskEvent, ensurePlanApprovedIfRequired, ensureVerificationSatisfiedIfRequired, isTransitionAllowed, ensureStatusTransitionAllowed, ensureCommentCommitAllowed, emitTransitionWarnings, resolveCommentCommitWarning, requireStructuredComment, prepareTaskTransitionComment, resolveTaskTransitionExecutorAgent, runTaskTransitionCommentCommit, enforceStatusCommitPolicy, resolveStatusCommitPolicyWarning, isMajorStatusCommitTransition, readHeadCommit, readCommitInfo, defaultCommitEmojiForStatus, } from "./shared/transitions.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EACL,6BAA6B,EAC7B,MAAM,EACN,uBAAuB,EACvB,0BAA0B,EAC1B,6BAA6B,EAC7B,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,oCAAoC,EACpC,kCAAkC,EAClC,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,iBAAiB,EACjB,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,EAC7B,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,eAAe,EACpB,yBAAyB,EACzB,iCAAiC,EACjC,0BAA0B,EAC1B,oBAAoB,EACpB,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,4BAA4B,EAC5B,qCAAqC,EACrC,mBAAmB,EACnB,6BAA6B,EAC7B,0BAA0B,EAC1B,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,kCAAkC,EAClC,8BAA8B,EAC9B,yBAAyB,EACzB,gCAAgC,EAChC,6BAA6B,EAC7B,cAAc,EACd,cAAc,EACd,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,yBAAyB,EACzB,kCAAkC,EAClC,+BAA+B,EAC/B,wCAAwC,EACxC,kCAAkC,EAClC,KAAK,mBAAmB,EACxB,KAAK,oCAAoC,EACzC,KAAK,uCAAuC,EAC5C,KAAK,kCAAkC,EACvC,KAAK,6BAA6B,EAClC,KAAK,wCAAwC,EAC7C,KAAK,mCAAmC,GACzC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,EACL,KAAK,eAAe,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,YAAY,GACb,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EACL,6BAA6B,EAC7B,MAAM,EACN,uBAAuB,EACvB,0BAA0B,EAC1B,6BAA6B,EAC7B,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,oCAAoC,EACpC,kCAAkC,EAClC,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,iBAAiB,EACjB,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,EAC7B,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,eAAe,EACpB,yBAAyB,EACzB,iCAAiC,EACjC,0BAA0B,EAC1B,oBAAoB,EACpB,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,eAAe,EACf,4BAA4B,EAC5B,qCAAqC,EACrC,mBAAmB,EACnB,6BAA6B,EAC7B,0BAA0B,EAC1B,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,kCAAkC,EAClC,8BAA8B,EAC9B,yBAAyB,EACzB,gCAAgC,EAChC,6BAA6B,EAC7B,cAAc,EACd,cAAc,EACd,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,yBAAyB,EACzB,kCAAkC,EAClC,+BAA+B,EAC/B,wCAAwC,EACxC,kCAAkC,EAClC,KAAK,mBAAmB,EACxB,KAAK,oCAAoC,EACzC,KAAK,uCAAuC,EAC5C,KAAK,kCAAkC,EACvC,KAAK,6BAA6B,EAClC,KAAK,wCAAwC,EAC7C,KAAK,mCAAmC,GACzC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,EACL,KAAK,eAAe,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,YAAY,GACb,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { dedupeStrings } from "../../shared/strings.js";
|
|
2
|
-
export { decodeEscapedTaskTextNewlines, nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, resolveWritableDocSections, } from "./shared/docs.js";
|
|
2
|
+
export { decodeEscapedTaskTextNewlines, nowIso, normalizeTaskDocVersion, taskObservationSectionName, extractTaskObservationSection, VERIFY_STEPS_PLACEHOLDER, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, extractDocSection, assertVerifyStepsFilled, isVerifyStepsFilled, isDocSectionFilled, ensureAgentFilledRequiredDocSections, normalizeVerificationSectionLayout, resolveWritableDocSections, } from "./shared/docs.js";
|
|
3
3
|
export { normalizeDependsOnInput, normalizeTaskStatus, toStringArray, requiresVerify, readTaskTagPolicy, resolvePrimaryTagFromConfig, requiresVerifyStepsByPrimary, requiresVerificationByPrimary, resolvePrimaryTag, warnIfUnknownOwner, } from "./shared/tags.js";
|
|
4
4
|
export { dependencyWarningMessages, ensureTaskDependsOnGraphIsAcyclic, resolveTaskDependencyState, buildDependencyState, formatTaskLine, } from "./shared/dependencies.js";
|
|
5
5
|
export { appendTaskEvent, ensurePlanApprovedIfRequired, ensureVerificationSatisfiedIfRequired, isTransitionAllowed, ensureStatusTransitionAllowed, ensureCommentCommitAllowed, emitTransitionWarnings, resolveCommentCommitWarning, requireStructuredComment, prepareTaskTransitionComment, resolveTaskTransitionExecutorAgent, runTaskTransitionCommentCommit, enforceStatusCommitPolicy, resolveStatusCommitPolicyWarning, isMajorStatusCommitTransition, readHeadCommit, readCommitInfo, defaultCommitEmojiForStatus, } from "./shared/transitions.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/commands/task/start.ts"],"names":[],"mappings":"AAMA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/commands/task/start.ts"],"names":[],"mappings":"AAMA,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAyDpF,wBAAsB,QAAQ,CAAC,IAAI,EAAE;IACnC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA+FlB"}
|
|
@@ -4,7 +4,7 @@ import { CliError } from "../../shared/errors.js";
|
|
|
4
4
|
import { ensureActionApproved } from "../shared/approval-requirements.js";
|
|
5
5
|
import { loadCommandContext } from "../shared/task-backend.js";
|
|
6
6
|
import { ensurePrArtifactsSynced } from "../pr/internal/sync.js";
|
|
7
|
-
import { applyTaskStatusTransitionCommand, ensurePlanApprovedIfRequired, extractTaskObservationSection, defaultCommitEmojiForStatus, extractDocSection,
|
|
7
|
+
import { applyTaskStatusTransitionCommand, assertVerifyStepsFilled, ensurePlanApprovedIfRequired, extractTaskObservationSection, defaultCommitEmojiForStatus, extractDocSection, normalizeTaskDocVersion, nowIso, prepareTaskTransitionComment, requiresVerifyStepsByPrimary, requireStructuredComment, runTaskTransitionCommentCommit, taskObservationSectionName, toStringArray, } from "./shared.js";
|
|
8
8
|
function assertStartDocRequirements(task, config) {
|
|
9
9
|
if (config.agents?.approvals?.require_plan === true)
|
|
10
10
|
return;
|
|
@@ -17,15 +17,12 @@ function assertStartDocRequirements(task, config) {
|
|
|
17
17
|
const isSpike = tags.some((tag) => tag.trim().toLowerCase() === spikeTag);
|
|
18
18
|
const doc = typeof task.doc === "string" ? task.doc : "";
|
|
19
19
|
if (verifyRequired || isSpike) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"(fill it before starting work when plan approval is disabled)",
|
|
27
|
-
});
|
|
28
|
-
}
|
|
20
|
+
assertVerifyStepsFilled({
|
|
21
|
+
taskId: task.id,
|
|
22
|
+
sectionText: extractDocSection(doc, "Verify Steps"),
|
|
23
|
+
action: "start work",
|
|
24
|
+
guidance: "fill it before starting work when plan approval is disabled",
|
|
25
|
+
});
|
|
29
26
|
}
|
|
30
27
|
if (!isSpike)
|
|
31
28
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/task.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AACpC,KAAK,eAAe,GAAG,kBAAkB,CAAC;AAE1C,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"task.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/task.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AACpC,KAAK,eAAe,GAAG,kBAAkB,CAAC;AAE1C,eAAO,MAAM,QAAQ,EAAE,WAAW,CAAC,eAAe,CAkDjD,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,kBAAkB,CAOtD,CAAC"}
|
|
@@ -39,6 +39,10 @@ export const taskSpec = {
|
|
|
39
39
|
cmd: 'agentplane task hosted-close --event-json "$GITHUB_EVENT_PATH"',
|
|
40
40
|
why: "Apply deterministic task closure from a merged hosted PR event on an automation branch.",
|
|
41
41
|
},
|
|
42
|
+
{
|
|
43
|
+
cmd: "agentplane task hosted-close-pr 202604091218-JREJ4K",
|
|
44
|
+
why: "Open the hosted closure PR after a manual handoff comment leaves only the remote task-close branch.",
|
|
45
|
+
},
|
|
42
46
|
{
|
|
43
47
|
cmd: "agentplane task resume-context <task-id>",
|
|
44
48
|
why: "Inspect deterministic recovery context before resuming or retrying a run.",
|
|
@@ -2,15 +2,34 @@ import type { CommandSpec, OptionSpec, ParsedRaw } from "../../cli/spec/spec.js"
|
|
|
2
2
|
export type VerifyCommonParsed = {
|
|
3
3
|
by: string;
|
|
4
4
|
note: string;
|
|
5
|
+
noteFile?: string;
|
|
5
6
|
details?: string;
|
|
6
7
|
file?: string;
|
|
7
8
|
quiet: boolean;
|
|
9
|
+
collectIncidents: boolean;
|
|
10
|
+
observation?: string;
|
|
11
|
+
impact?: string;
|
|
12
|
+
resolution?: string;
|
|
13
|
+
localOnly: boolean;
|
|
14
|
+
repoFixable: boolean;
|
|
15
|
+
incidentScope?: string;
|
|
16
|
+
incidentTags: string[];
|
|
17
|
+
incidentMatch: string[];
|
|
18
|
+
incidentAdvice?: string;
|
|
19
|
+
incidentRule?: string;
|
|
8
20
|
};
|
|
21
|
+
export declare const verifyFindingOptions: readonly OptionSpec[];
|
|
9
22
|
export declare const verifyCommonOptions: readonly OptionSpec[];
|
|
10
23
|
export declare function validateVerifyDetailsFileExclusive<TParsed>(raw: ParsedRaw, spec: CommandSpec<TParsed>, opts?: {
|
|
11
24
|
command?: string;
|
|
12
25
|
message?: string;
|
|
13
26
|
}): void;
|
|
14
27
|
export declare function validateVerifyNonEmptyInput<TParsed>(raw: ParsedRaw, spec: CommandSpec<TParsed>, name: "by" | "note"): void;
|
|
28
|
+
export declare function validateVerifyNoteSource<TParsed>(raw: ParsedRaw, spec: CommandSpec<TParsed>, opts?: {
|
|
29
|
+
command?: string;
|
|
30
|
+
}): void;
|
|
31
|
+
export declare function validateVerifyFindingSource<TParsed>(raw: ParsedRaw, spec: CommandSpec<TParsed>, opts?: {
|
|
32
|
+
command?: string;
|
|
33
|
+
}): void;
|
|
15
34
|
export declare function parseVerifyCommonOptions(raw: ParsedRaw): VerifyCommonParsed;
|
|
16
35
|
//# sourceMappingURL=verify-command-shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-command-shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-command-shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEjF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"verify-command-shared.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-command-shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEjF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,SAAS,UAAU,EA+D5C,CAAC;AAEX,eAAO,MAAM,mBAAmB,EAAE,SAAS,UAAU,EAwC3C,CAAC;AAEX,wBAAgB,kCAAkC,CAAC,OAAO,EACxD,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,EAC1B,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5C,IAAI,CAQN;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EACjD,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,EAC1B,IAAI,EAAE,IAAI,GAAG,MAAM,GAClB,IAAI,CAKN;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAC9C,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,EAC1B,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1B,IAAI,CA+BN;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EACjD,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,EAC1B,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1B,IAAI,CAkCN;AAED,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,SAAS,GAAG,kBAAkB,CAuB3E"}
|
|
@@ -1,13 +1,82 @@
|
|
|
1
1
|
import { usageError } from "../../cli/spec/errors.js";
|
|
2
|
+
export const verifyFindingOptions = [
|
|
3
|
+
{
|
|
4
|
+
kind: "string",
|
|
5
|
+
name: "observation",
|
|
6
|
+
valueHint: "<text>",
|
|
7
|
+
description: "Structured finding observation to append with the verification.",
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
kind: "string",
|
|
11
|
+
name: "impact",
|
|
12
|
+
valueHint: "<text>",
|
|
13
|
+
description: "Structured finding impact to append with the verification.",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
kind: "string",
|
|
17
|
+
name: "resolution",
|
|
18
|
+
valueHint: "<text>",
|
|
19
|
+
description: "Structured finding resolution to append with the verification.",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
kind: "boolean",
|
|
23
|
+
name: "local-only",
|
|
24
|
+
default: false,
|
|
25
|
+
description: "Keep the finding task-local; omit incident-candidate promotion.",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
kind: "boolean",
|
|
29
|
+
name: "repo-fixable",
|
|
30
|
+
default: false,
|
|
31
|
+
description: "Mark the structured finding as repo-fixable so incidents collect can promote it.",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
kind: "string",
|
|
35
|
+
name: "incident-scope",
|
|
36
|
+
valueHint: "<text>",
|
|
37
|
+
description: "Optional incident scope for the appended finding.",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
kind: "string",
|
|
41
|
+
name: "incident-tag",
|
|
42
|
+
valueHint: "<tag>",
|
|
43
|
+
repeatable: true,
|
|
44
|
+
description: "Repeatable incident tag for the appended finding.",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
kind: "string",
|
|
48
|
+
name: "incident-match",
|
|
49
|
+
valueHint: "<term>",
|
|
50
|
+
repeatable: true,
|
|
51
|
+
description: "Repeatable incident match term for the appended finding.",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
kind: "string",
|
|
55
|
+
name: "incident-advice",
|
|
56
|
+
valueHint: "<text>",
|
|
57
|
+
description: "Optional operator advice for the appended finding.",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
kind: "string",
|
|
61
|
+
name: "incident-rule",
|
|
62
|
+
valueHint: "<text>",
|
|
63
|
+
description: "Optional incident rule for the appended finding.",
|
|
64
|
+
},
|
|
65
|
+
];
|
|
2
66
|
export const verifyCommonOptions = [
|
|
3
67
|
{ kind: "string", name: "by", valueHint: "<id>", required: true, description: "Verifier id." },
|
|
4
68
|
{
|
|
5
69
|
kind: "string",
|
|
6
70
|
name: "note",
|
|
7
71
|
valueHint: "<text>",
|
|
8
|
-
required: true,
|
|
9
72
|
description: "Short verification note.",
|
|
10
73
|
},
|
|
74
|
+
{
|
|
75
|
+
kind: "string",
|
|
76
|
+
name: "note-file",
|
|
77
|
+
valueHint: "<path>",
|
|
78
|
+
description: "Read the verification note from a file path (mutually exclusive with --note).",
|
|
79
|
+
},
|
|
11
80
|
{
|
|
12
81
|
kind: "string",
|
|
13
82
|
name: "details",
|
|
@@ -26,6 +95,13 @@ export const verifyCommonOptions = [
|
|
|
26
95
|
default: false,
|
|
27
96
|
description: "Suppress normal output (still prints errors).",
|
|
28
97
|
},
|
|
98
|
+
{
|
|
99
|
+
kind: "boolean",
|
|
100
|
+
name: "collect-incidents",
|
|
101
|
+
default: false,
|
|
102
|
+
description: "After recording verification, collect promotable findings into incidents.md immediately.",
|
|
103
|
+
},
|
|
104
|
+
...verifyFindingOptions,
|
|
29
105
|
];
|
|
30
106
|
export function validateVerifyDetailsFileExclusive(raw, spec, opts) {
|
|
31
107
|
if (typeof raw.opts.details === "string" && typeof raw.opts.file === "string") {
|
|
@@ -42,12 +118,87 @@ export function validateVerifyNonEmptyInput(raw, spec, name) {
|
|
|
42
118
|
throw usageError({ spec, message: `Invalid value for --${name}: empty.` });
|
|
43
119
|
}
|
|
44
120
|
}
|
|
121
|
+
export function validateVerifyNoteSource(raw, spec, opts) {
|
|
122
|
+
const inlineNote = raw.opts.note;
|
|
123
|
+
const noteFile = raw.opts["note-file"];
|
|
124
|
+
if (typeof inlineNote === "string" && typeof noteFile === "string") {
|
|
125
|
+
throw usageError({
|
|
126
|
+
spec,
|
|
127
|
+
command: opts?.command,
|
|
128
|
+
message: "Options --note and --note-file are mutually exclusive.",
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
if (typeof noteFile === "string" && noteFile.trim().length === 0) {
|
|
132
|
+
throw usageError({
|
|
133
|
+
spec,
|
|
134
|
+
command: opts?.command,
|
|
135
|
+
message: "Invalid value for --note-file: empty.",
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
if (typeof inlineNote === "string" && inlineNote.trim().length === 0) {
|
|
139
|
+
throw usageError({
|
|
140
|
+
spec,
|
|
141
|
+
command: opts?.command,
|
|
142
|
+
message: "Invalid value for --note: empty.",
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
if (typeof inlineNote !== "string" && typeof noteFile !== "string") {
|
|
146
|
+
throw usageError({
|
|
147
|
+
spec,
|
|
148
|
+
command: opts?.command,
|
|
149
|
+
message: "Provide exactly one of --note or --note-file.",
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
export function validateVerifyFindingSource(raw, spec, opts) {
|
|
154
|
+
const hasFindingField = [
|
|
155
|
+
raw.opts.observation,
|
|
156
|
+
raw.opts.impact,
|
|
157
|
+
raw.opts.resolution,
|
|
158
|
+
raw.opts["incident-scope"],
|
|
159
|
+
raw.opts["incident-advice"],
|
|
160
|
+
raw.opts["incident-rule"],
|
|
161
|
+
].some((value) => typeof value === "string" && value.trim().length > 0);
|
|
162
|
+
const hasFindingCollections = Array.isArray(raw.opts["incident-tag"]) && raw.opts["incident-tag"].length > 0
|
|
163
|
+
? true
|
|
164
|
+
: Array.isArray(raw.opts["incident-match"]) && raw.opts["incident-match"].length > 0;
|
|
165
|
+
const hasFindingToggle = raw.opts["local-only"] === true || raw.opts["repo-fixable"] === true;
|
|
166
|
+
if (!hasFindingField && !hasFindingCollections && !hasFindingToggle)
|
|
167
|
+
return;
|
|
168
|
+
const observation = raw.opts.observation;
|
|
169
|
+
const impact = raw.opts.impact;
|
|
170
|
+
const resolution = raw.opts.resolution;
|
|
171
|
+
if (typeof observation !== "string" ||
|
|
172
|
+
observation.trim().length === 0 ||
|
|
173
|
+
typeof impact !== "string" ||
|
|
174
|
+
impact.trim().length === 0 ||
|
|
175
|
+
typeof resolution !== "string" ||
|
|
176
|
+
resolution.trim().length === 0) {
|
|
177
|
+
throw usageError({
|
|
178
|
+
spec,
|
|
179
|
+
command: opts?.command,
|
|
180
|
+
message: "Provide --observation, --impact, and --resolution together when appending a structured finding.",
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
45
184
|
export function parseVerifyCommonOptions(raw) {
|
|
46
185
|
return {
|
|
47
186
|
by: typeof raw.opts.by === "string" ? raw.opts.by : "",
|
|
48
187
|
note: typeof raw.opts.note === "string" ? raw.opts.note : "",
|
|
188
|
+
noteFile: typeof raw.opts["note-file"] === "string" ? raw.opts["note-file"] : undefined,
|
|
49
189
|
details: typeof raw.opts.details === "string" ? raw.opts.details : undefined,
|
|
50
190
|
file: typeof raw.opts.file === "string" ? raw.opts.file : undefined,
|
|
51
191
|
quiet: raw.opts.quiet === true,
|
|
192
|
+
collectIncidents: raw.opts["collect-incidents"] === true,
|
|
193
|
+
observation: typeof raw.opts.observation === "string" ? raw.opts.observation : undefined,
|
|
194
|
+
impact: typeof raw.opts.impact === "string" ? raw.opts.impact : undefined,
|
|
195
|
+
resolution: typeof raw.opts.resolution === "string" ? raw.opts.resolution : undefined,
|
|
196
|
+
localOnly: raw.opts["local-only"] === true,
|
|
197
|
+
repoFixable: raw.opts["repo-fixable"] === true,
|
|
198
|
+
incidentScope: typeof raw.opts["incident-scope"] === "string" ? raw.opts["incident-scope"] : undefined,
|
|
199
|
+
incidentTags: raw.opts["incident-tag"] ?? [],
|
|
200
|
+
incidentMatch: raw.opts["incident-match"] ?? [],
|
|
201
|
+
incidentAdvice: typeof raw.opts["incident-advice"] === "string" ? raw.opts["incident-advice"] : undefined,
|
|
202
|
+
incidentRule: typeof raw.opts["incident-rule"] === "string" ? raw.opts["incident-rule"] : undefined,
|
|
52
203
|
};
|
|
53
204
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-ok.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-ok.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,
|
|
1
|
+
{"version":3,"file":"verify-ok.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-ok.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,EAOL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,GAAG;IACpD,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,kBAAkB,CAwB5D,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAC3E,KAAK,UAAU,EAAE,GAAG,kBAAkB,KAAG,OAAO,CAAC,MAAM,CAAC,CAyBvE"}
|