agentplane 0.3.5 → 0.3.7
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/README.md +103 -75
- package/assets/AGENTS.md +4 -2
- package/bin/dist-guard.js +13 -3
- package/bin/runtime-watch.d.ts +1 -0
- package/bin/runtime-watch.js +22 -5
- package/bin/stale-dist-policy.js +9 -2
- package/dist/.build-manifest.json +251 -821
- package/dist/adapters/task-backend/task-backend-adapter.d.ts +2 -2
- package/dist/adapters/task-backend/task-backend-adapter.d.ts.map +1 -1
- package/dist/adapters/task-backend/task-backend-adapter.js +2 -2
- package/dist/backends/task-backend/local-backend.d.ts +7 -5
- package/dist/backends/task-backend/local-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend.js +79 -7
- package/dist/backends/task-backend/redmine/env.d.ts +1 -1
- package/dist/backends/task-backend/redmine/env.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/env.js +3 -0
- package/dist/backends/task-backend/redmine/inspect.d.ts +11 -0
- package/dist/backends/task-backend/redmine/inspect.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/inspect.js +75 -0
- package/dist/backends/task-backend/redmine/mapping.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/mapping.js +21 -2
- package/dist/backends/task-backend/redmine/state.d.ts +17 -0
- package/dist/backends/task-backend/redmine/state.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/state.js +95 -0
- package/dist/backends/task-backend/redmine-backend.d.ts +10 -16
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine-backend.js +205 -15
- package/dist/backends/task-backend/shared/constants.d.ts +1 -1
- package/dist/backends/task-backend/shared/constants.js +1 -1
- package/dist/backends/task-backend/shared/record.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/record.js +20 -1
- package/dist/backends/task-backend/shared/types.d.ts +42 -4
- package/dist/backends/task-backend/shared/types.d.ts.map +1 -1
- package/dist/backends/task-backend/shared.d.ts +1 -1
- package/dist/backends/task-backend/shared.d.ts.map +1 -1
- package/dist/backends/task-backend.d.ts +1 -1
- package/dist/backends/task-backend.d.ts.map +1 -1
- package/dist/backends/task-backend.test-helpers.d.ts +4 -0
- package/dist/backends/task-backend.test-helpers.d.ts.map +1 -0
- package/dist/backends/task-backend.test-helpers.js +33 -0
- package/dist/backends/task-index.d.ts.map +1 -1
- package/dist/backends/task-index.js +1 -0
- package/dist/cli/bootstrap-guide.d.ts.map +1 -1
- package/dist/cli/bootstrap-guide.js +1 -0
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +3 -2
- package/dist/cli/reason-codes.d.ts.map +1 -1
- package/dist/cli/reason-codes.js +30 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts +3 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/core.js +137 -0
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts +3 -0
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/lifecycle.js +52 -0
- package/dist/cli/run-cli/command-catalog/project.d.ts +3 -0
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/project.js +80 -0
- package/dist/cli/run-cli/command-catalog/shared.d.ts +19 -0
- package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/shared.js +9 -0
- package/dist/cli/run-cli/command-catalog/task.d.ts +3 -0
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog/task.js +85 -0
- package/dist/cli/run-cli/command-catalog.d.ts +3 -18
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog.js +8 -337
- package/dist/cli/run-cli/commands/ide.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/ide.js +64 -2
- package/dist/cli/run-cli/commands/init/ui.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/ui.js +33 -13
- package/dist/cli/run-cli/commands/init/write-env.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-env.js +12 -0
- package/dist/cli/run-cli.core.pr-flow.test-helpers.d.ts +3 -0
- package/dist/cli/run-cli.core.pr-flow.test-helpers.d.ts.map +1 -0
- package/dist/cli/run-cli.core.pr-flow.test-helpers.js +41 -0
- package/dist/cli/run-cli.core.tasks.test-helpers.d.ts +2 -0
- package/dist/cli/run-cli.core.tasks.test-helpers.d.ts.map +1 -0
- package/dist/cli/run-cli.core.tasks.test-helpers.js +6 -0
- package/dist/cli/run-cli.test-helpers.d.ts +3 -0
- package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
- package/dist/cli/run-cli.test-helpers.js +140 -6
- package/dist/commands/backend/sync.command.d.ts +5 -1
- package/dist/commands/backend/sync.command.d.ts.map +1 -1
- package/dist/commands/backend/sync.command.js +67 -3
- package/dist/commands/backend.d.ts +22 -0
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +110 -1
- package/dist/commands/commit.spec.d.ts.map +1 -1
- package/dist/commands/commit.spec.js +31 -7
- package/dist/commands/doctor/runtime.d.ts.map +1 -1
- package/dist/commands/doctor/runtime.js +3 -6
- package/dist/commands/doctor/workspace.d.ts +8 -0
- package/dist/commands/doctor/workspace.d.ts.map +1 -1
- package/dist/commands/doctor/workspace.js +127 -3
- package/dist/commands/guard/commit.command.d.ts.map +1 -1
- package/dist/commands/guard/commit.command.js +30 -6
- package/dist/commands/guard/impl/allow.d.ts +9 -0
- package/dist/commands/guard/impl/allow.d.ts.map +1 -1
- package/dist/commands/guard/impl/allow.js +26 -10
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +146 -18
- package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -1
- package/dist/commands/guard/impl/comment-commit.js +2 -0
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +8 -35
- package/dist/commands/recipes/impl/apply.d.ts +4 -0
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
- package/dist/commands/recipes/impl/apply.js +34 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/explain.js +70 -11
- package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/info.js +24 -12
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/install.js +32 -36
- package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/list.js +7 -4
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/remove.js +9 -11
- package/dist/commands/recipes/impl/constants.d.ts +2 -0
- package/dist/commands/recipes/impl/constants.d.ts.map +1 -1
- package/dist/commands/recipes/impl/constants.js +2 -0
- package/dist/commands/recipes/impl/manifest.d.ts.map +1 -1
- package/dist/commands/recipes/impl/manifest.js +219 -23
- package/dist/commands/recipes/impl/normalize.d.ts +3 -0
- package/dist/commands/recipes/impl/normalize.d.ts.map +1 -1
- package/dist/commands/recipes/impl/normalize.js +28 -24
- package/dist/commands/recipes/impl/paths.d.ts +9 -0
- package/dist/commands/recipes/impl/paths.d.ts.map +1 -1
- package/dist/commands/recipes/impl/paths.js +10 -1
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts +7 -0
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -0
- package/dist/commands/recipes/impl/project-installed-recipes.js +102 -0
- package/dist/commands/recipes/impl/resolver.d.ts +20 -0
- package/dist/commands/recipes/impl/resolver.d.ts.map +1 -0
- package/dist/commands/recipes/impl/resolver.js +220 -0
- package/dist/commands/recipes/impl/scenario.d.ts.map +1 -1
- package/dist/commands/recipes/impl/scenario.js +40 -11
- package/dist/commands/recipes/impl/types.d.ts +145 -16
- package/dist/commands/recipes/impl/types.d.ts.map +1 -1
- package/dist/commands/recipes/install.spec.d.ts.map +1 -1
- package/dist/commands/recipes/install.spec.js +3 -2
- package/dist/commands/recipes.d.ts +6 -4
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +5 -3
- package/dist/commands/recipes.test-helpers.d.ts +185 -0
- package/dist/commands/recipes.test-helpers.d.ts.map +1 -0
- package/dist/commands/recipes.test-helpers.js +339 -0
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -1
- package/dist/commands/scenario/impl/commands.js +192 -336
- package/dist/commands/scenario/info.command.d.ts.map +1 -1
- package/dist/commands/scenario/info.command.js +7 -2
- package/dist/commands/scenario/list.command.js +2 -2
- package/dist/commands/scenario/run.command.d.ts.map +1 -1
- package/dist/commands/scenario/run.command.js +7 -2
- package/dist/commands/shared/reconcile-check.d.ts.map +1 -1
- package/dist/commands/shared/reconcile-check.js +77 -2
- package/dist/commands/shared/task-backend.d.ts +1 -1
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +9 -0
- package/dist/commands/shared/task-store.d.ts +92 -2
- package/dist/commands/shared/task-store.d.ts.map +1 -1
- package/dist/commands/shared/task-store.js +405 -43
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +84 -46
- package/dist/commands/task/close-duplicate.d.ts.map +1 -1
- package/dist/commands/task/close-duplicate.js +12 -37
- package/dist/commands/task/close-noop.d.ts.map +1 -1
- package/dist/commands/task/close-noop.js +12 -30
- package/dist/commands/task/close-shared.d.ts +14 -0
- package/dist/commands/task/close-shared.d.ts.map +1 -0
- package/dist/commands/task/close-shared.js +73 -0
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +34 -21
- package/dist/commands/task/derive.command.d.ts +1 -0
- package/dist/commands/task/derive.command.d.ts.map +1 -1
- package/dist/commands/task/derive.command.js +15 -2
- package/dist/commands/task/derive.d.ts +1 -0
- package/dist/commands/task/derive.d.ts.map +1 -1
- package/dist/commands/task/derive.js +27 -4
- package/dist/commands/task/doc-set.command.d.ts +2 -1
- package/dist/commands/task/doc-set.command.d.ts.map +1 -1
- package/dist/commands/task/doc-set.command.js +36 -4
- package/dist/commands/task/doc-template.d.ts.map +1 -1
- package/dist/commands/task/doc-template.js +2 -7
- package/dist/commands/task/doc.command.js +1 -1
- package/dist/commands/task/doc.d.ts +2 -1
- package/dist/commands/task/doc.d.ts.map +1 -1
- package/dist/commands/task/doc.js +139 -76
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +142 -80
- package/dist/commands/task/migrate-doc.d.ts +15 -0
- package/dist/commands/task/migrate-doc.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.js +128 -43
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +3 -1
- package/dist/commands/task/plan-set.command.js +1 -1
- package/dist/commands/task/plan.command.d.ts +8 -0
- package/dist/commands/task/plan.command.d.ts.map +1 -0
- package/dist/commands/task/plan.command.js +37 -0
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +198 -101
- package/dist/commands/task/set-status.command.d.ts.map +1 -1
- package/dist/commands/task/set-status.command.js +1 -1
- package/dist/commands/task/set-status.d.ts.map +1 -1
- package/dist/commands/task/set-status.js +115 -35
- package/dist/commands/task/shared/dependencies.d.ts +1 -0
- package/dist/commands/task/shared/dependencies.d.ts.map +1 -1
- package/dist/commands/task/shared/dependencies.js +10 -0
- package/dist/commands/task/shared/docs.d.ts +1 -0
- package/dist/commands/task/shared/docs.d.ts.map +1 -1
- package/dist/commands/task/shared/docs.js +8 -1
- package/dist/commands/task/shared/transitions.d.ts +17 -2
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +20 -13
- package/dist/commands/task/shared.d.ts +3 -3
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +3 -3
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +101 -71
- package/dist/commands/task/task.command.d.ts +8 -0
- package/dist/commands/task/task.command.d.ts.map +1 -0
- package/dist/commands/task/task.command.js +71 -0
- package/dist/commands/task/verify-command-shared.d.ts +16 -0
- package/dist/commands/task/verify-command-shared.d.ts.map +1 -0
- package/dist/commands/task/verify-command-shared.js +53 -0
- package/dist/commands/task/verify-ok.command.d.ts +2 -6
- package/dist/commands/task/verify-ok.command.d.ts.map +1 -1
- package/dist/commands/task/verify-ok.command.js +8 -50
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +124 -145
- package/dist/commands/task/verify-rework.command.d.ts +2 -6
- package/dist/commands/task/verify-rework.command.d.ts.map +1 -1
- package/dist/commands/task/verify-rework.command.js +8 -50
- package/dist/commands/upgrade/apply.d.ts +2 -0
- package/dist/commands/upgrade/apply.d.ts.map +1 -1
- package/dist/commands/upgrade/apply.js +33 -1
- package/dist/commands/upgrade.command.d.ts.map +1 -1
- package/dist/commands/upgrade.command.js +25 -0
- package/dist/commands/upgrade.d.ts +1 -0
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +34 -0
- package/dist/commands/verify.spec.d.ts.map +1 -1
- package/dist/commands/verify.spec.js +3 -12
- package/dist/policy/rules/allowlist.d.ts.map +1 -1
- package/dist/policy/rules/allowlist.js +16 -4
- package/dist/policy/rules/protected-paths.d.ts.map +1 -1
- package/dist/policy/rules/protected-paths.js +6 -1
- package/dist/ports/task-backend-port.d.ts +2 -2
- package/dist/ports/task-backend-port.d.ts.map +1 -1
- package/dist/shared/agent-emoji.d.ts.map +1 -1
- package/dist/shared/protected-paths.d.ts +17 -0
- package/dist/shared/protected-paths.d.ts.map +1 -1
- package/dist/shared/protected-paths.js +59 -10
- package/dist/shared/repo-cli-version.d.ts.map +1 -1
- package/dist/shared/repo-cli-version.js +9 -3
- package/package.json +2 -2
|
@@ -1,38 +1,11 @@
|
|
|
1
|
-
import { usageError } from "../../cli/spec/errors.js";
|
|
2
1
|
import { cmdTaskVerifyOk } from "./verify-record.js";
|
|
2
|
+
import { parseVerifyCommonOptions, validateVerifyDetailsFileExclusive, validateVerifyNonEmptyInput, verifyCommonOptions, } from "./verify-command-shared.js";
|
|
3
3
|
export const taskVerifyOkSpec = {
|
|
4
4
|
id: ["task", "verify", "ok"],
|
|
5
5
|
group: "Task",
|
|
6
6
|
summary: "Record verification as OK (updates Verification section and verification frontmatter).",
|
|
7
7
|
args: [{ name: "task-id", required: true, valueHint: "<task-id>" }],
|
|
8
|
-
options:
|
|
9
|
-
{ kind: "string", name: "by", valueHint: "<id>", required: true, description: "Verifier id." },
|
|
10
|
-
{
|
|
11
|
-
kind: "string",
|
|
12
|
-
name: "note",
|
|
13
|
-
valueHint: "<text>",
|
|
14
|
-
required: true,
|
|
15
|
-
description: "Short verification note.",
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
kind: "string",
|
|
19
|
-
name: "details",
|
|
20
|
-
valueHint: "<text>",
|
|
21
|
-
description: "Optional details text (mutually exclusive with --file).",
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
kind: "string",
|
|
25
|
-
name: "file",
|
|
26
|
-
valueHint: "<path>",
|
|
27
|
-
description: "Optional details file path (mutually exclusive with --details).",
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
kind: "boolean",
|
|
31
|
-
name: "quiet",
|
|
32
|
-
default: false,
|
|
33
|
-
description: "Suppress normal output (still prints errors).",
|
|
34
|
-
},
|
|
35
|
-
],
|
|
8
|
+
options: verifyCommonOptions,
|
|
36
9
|
examples: [
|
|
37
10
|
{
|
|
38
11
|
cmd: 'agentplane task verify ok 202602030608-F1Q8AB --by REVIEWER --note "Looks good"',
|
|
@@ -40,30 +13,15 @@ export const taskVerifyOkSpec = {
|
|
|
40
13
|
},
|
|
41
14
|
],
|
|
42
15
|
validateRaw: (raw) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
message: "Provide at most one of --details or --file.",
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
const by = raw.opts.by;
|
|
52
|
-
if (typeof by === "string" && by.trim().length === 0) {
|
|
53
|
-
throw usageError({ spec: taskVerifyOkSpec, message: "Invalid value for --by: empty." });
|
|
54
|
-
}
|
|
55
|
-
const note = raw.opts.note;
|
|
56
|
-
if (typeof note === "string" && note.trim().length === 0) {
|
|
57
|
-
throw usageError({ spec: taskVerifyOkSpec, message: "Invalid value for --note: empty." });
|
|
58
|
-
}
|
|
16
|
+
validateVerifyDetailsFileExclusive(raw, taskVerifyOkSpec, {
|
|
17
|
+
message: "Provide at most one of --details or --file.",
|
|
18
|
+
});
|
|
19
|
+
validateVerifyNonEmptyInput(raw, taskVerifyOkSpec, "by");
|
|
20
|
+
validateVerifyNonEmptyInput(raw, taskVerifyOkSpec, "note");
|
|
59
21
|
},
|
|
60
22
|
parse: (raw) => ({
|
|
61
23
|
taskId: String(raw.args["task-id"]),
|
|
62
|
-
|
|
63
|
-
note: String(raw.opts.note),
|
|
64
|
-
details: typeof raw.opts.details === "string" ? raw.opts.details : undefined,
|
|
65
|
-
file: typeof raw.opts.file === "string" ? raw.opts.file : undefined,
|
|
66
|
-
quiet: raw.opts.quiet === true,
|
|
24
|
+
...parseVerifyCommonOptions(raw),
|
|
67
25
|
}),
|
|
68
26
|
};
|
|
69
27
|
export function makeRunTaskVerifyOkHandler(getCtx) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-record.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-record.ts"],"names":[],"mappings":"AAUA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"verify-record.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-record.ts"],"names":[],"mappings":"AAUA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AAqBnC,KAAK,WAAW,GAAG,IAAI,GAAG,cAAc,CAAC;AA0RzC,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,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;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAElB;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,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;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAMlB;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,WAAW,CAAC;IACnB,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;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAElB"}
|
|
@@ -3,12 +3,12 @@ import { readFile } from "node:fs/promises";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { ensureDocSections, setMarkdownSection } from "@agentplaneorg/core";
|
|
5
5
|
import { mapBackendError, mapCoreError } from "../../cli/error-map.js";
|
|
6
|
-
import { backendNotSupportedMessage } from "../../cli/output.js";
|
|
6
|
+
import { backendNotSupportedMessage, successMessage } from "../../cli/output.js";
|
|
7
7
|
import { CliError } from "../../shared/errors.js";
|
|
8
8
|
import { ensureReconciledBeforeMutation } from "../shared/reconcile-check.js";
|
|
9
9
|
import { loadCommandContext, loadTaskFromContext, } from "../shared/task-backend.js";
|
|
10
|
-
import { backendIsLocalFileBackend, getTaskStore } from "../shared/task-store.js";
|
|
11
|
-
import { appendTaskEvent, extractDocSection, normalizeTaskDocVersion, normalizeVerificationSectionLayout, nowIso, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, } from "./shared.js";
|
|
10
|
+
import { appendTaskEventIntent, backendIsLocalFileBackend, getTaskStore, setTaskFieldsIntent, setTaskSectionIntent, touchTaskDocMetaIntent, } from "../shared/task-store.js";
|
|
11
|
+
import { appendTaskEvent, decodeEscapedTaskTextNewlines, extractDocSection, normalizeTaskDocVersion, normalizeVerificationSectionLayout, nowIso, VERIFICATION_RESULTS_BEGIN, VERIFICATION_RESULTS_END, } from "./shared.js";
|
|
12
12
|
function appendBetweenMarkers(sectionText, entryText, version) {
|
|
13
13
|
const ensured = normalizeVerificationSectionLayout(sectionText, version);
|
|
14
14
|
const beginIdx = ensured.indexOf(VERIFICATION_RESULTS_BEGIN);
|
|
@@ -65,108 +65,113 @@ async function recordVerificationResult(opts) {
|
|
|
65
65
|
}
|
|
66
66
|
const useStore = backendIsLocalFileBackend(ctx);
|
|
67
67
|
const store = useStore ? getTaskStore(ctx) : null;
|
|
68
|
-
const task = useStore
|
|
69
|
-
? await store.get(opts.taskId)
|
|
70
|
-
: await loadTaskFromContext({ ctx, taskId: opts.taskId });
|
|
71
|
-
const existingDoc = useStore
|
|
72
|
-
? String(task.doc ?? "")
|
|
73
|
-
: (typeof task.doc === "string" ? task.doc : "") || (await backend.getTaskDoc(task.id));
|
|
74
|
-
const baseDoc = ensureDocSections(existingDoc ?? "", config.tasks.doc.required_sections);
|
|
75
|
-
const verificationSection = extractDocSection(baseDoc, "Verification") ?? "";
|
|
76
|
-
const verifySteps = extractDocSection(baseDoc, "Verify Steps");
|
|
77
|
-
const verifyStepsHash = verifySteps
|
|
78
|
-
? sha256Hex(verifySteps.replaceAll("\r\n", "\n").trim())
|
|
79
|
-
: null;
|
|
80
|
-
const docVersion = normalizeTaskDocVersion(task.doc_version);
|
|
81
|
-
const verifyStepsRef = [
|
|
82
|
-
`doc_version=${String(docVersion)}`,
|
|
83
|
-
`doc_updated_at=${String(task.doc_updated_at ?? "missing")}`,
|
|
84
|
-
`excerpt_hash=sha256:${verifyStepsHash ?? "missing"}`,
|
|
85
|
-
].join(", ");
|
|
68
|
+
const task = useStore ? null : await loadTaskFromContext({ ctx, taskId: opts.taskId });
|
|
86
69
|
const at = nowIso();
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
70
|
+
if (useStore) {
|
|
71
|
+
await store.mutate(opts.taskId, (current) => {
|
|
72
|
+
const existingDoc = String(current.doc ?? "");
|
|
73
|
+
const baseDoc = ensureDocSections(existingDoc, config.tasks.doc.required_sections);
|
|
74
|
+
const verificationSection = extractDocSection(baseDoc, "Verification") ?? "";
|
|
75
|
+
const verifySteps = extractDocSection(baseDoc, "Verify Steps");
|
|
76
|
+
const verifyStepsHash = verifySteps
|
|
77
|
+
? sha256Hex(verifySteps.replaceAll("\r\n", "\n").trim())
|
|
78
|
+
: null;
|
|
79
|
+
const docVersion = normalizeTaskDocVersion(current.doc_version);
|
|
80
|
+
const verifyStepsRef = [
|
|
81
|
+
`doc_version=${String(docVersion)}`,
|
|
82
|
+
`doc_updated_at=${String(current.doc_updated_at ?? "missing")}`,
|
|
83
|
+
`excerpt_hash=sha256:${verifyStepsHash ?? "missing"}`,
|
|
84
|
+
].join(", ");
|
|
85
|
+
const entry = renderVerificationEntry({
|
|
86
|
+
at,
|
|
87
|
+
state: opts.state,
|
|
88
|
+
by: opts.by,
|
|
89
|
+
note: opts.note,
|
|
90
|
+
details: opts.details ?? null,
|
|
91
|
+
verifyStepsRef,
|
|
92
|
+
});
|
|
93
|
+
const nextVerification = appendBetweenMarkers(verificationSection, entry, docVersion);
|
|
94
|
+
return [
|
|
95
|
+
setTaskFieldsIntent({
|
|
96
|
+
status: opts.state === "needs_rework" ? "DOING" : current.status,
|
|
97
|
+
commit: opts.state === "needs_rework" ? null : (current.commit ?? null),
|
|
98
|
+
verification: {
|
|
99
|
+
state: opts.state,
|
|
100
|
+
updated_at: at,
|
|
101
|
+
updated_by: opts.by,
|
|
102
|
+
note: opts.note,
|
|
103
|
+
},
|
|
104
|
+
}),
|
|
105
|
+
setTaskSectionIntent({
|
|
106
|
+
section: "Verification",
|
|
107
|
+
text: nextVerification,
|
|
108
|
+
requiredSections: config.tasks.doc.required_sections,
|
|
109
|
+
}),
|
|
110
|
+
appendTaskEventIntent({
|
|
111
|
+
type: "verify",
|
|
112
|
+
at,
|
|
113
|
+
author: opts.by,
|
|
114
|
+
state: opts.state,
|
|
115
|
+
note: opts.note,
|
|
116
|
+
}),
|
|
117
|
+
touchTaskDocMetaIntent({ updatedBy: opts.by }),
|
|
118
|
+
];
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
const remoteTask = task;
|
|
123
|
+
const existingDoc = (typeof remoteTask.doc === "string" ? remoteTask.doc : "") ||
|
|
124
|
+
(await backend.getTaskDoc(remoteTask.id));
|
|
125
|
+
const baseDoc = ensureDocSections(existingDoc ?? "", config.tasks.doc.required_sections);
|
|
126
|
+
const verificationSection = extractDocSection(baseDoc, "Verification") ?? "";
|
|
127
|
+
const verifySteps = extractDocSection(baseDoc, "Verify Steps");
|
|
128
|
+
const verifyStepsHash = verifySteps
|
|
129
|
+
? sha256Hex(verifySteps.replaceAll("\r\n", "\n").trim())
|
|
130
|
+
: null;
|
|
131
|
+
const docVersion = normalizeTaskDocVersion(remoteTask.doc_version);
|
|
132
|
+
const verifyStepsRef = [
|
|
133
|
+
`doc_version=${String(docVersion)}`,
|
|
134
|
+
`doc_updated_at=${String(remoteTask.doc_updated_at ?? "missing")}`,
|
|
135
|
+
`excerpt_hash=sha256:${verifyStepsHash ?? "missing"}`,
|
|
136
|
+
].join(", ");
|
|
137
|
+
const entry = renderVerificationEntry({
|
|
105
138
|
at,
|
|
106
|
-
author: opts.by,
|
|
107
139
|
state: opts.state,
|
|
140
|
+
by: opts.by,
|
|
108
141
|
note: opts.note,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
state: opts.state,
|
|
112
|
-
updated_at: at,
|
|
113
|
-
updated_by: opts.by,
|
|
114
|
-
note: opts.note,
|
|
115
|
-
},
|
|
116
|
-
};
|
|
117
|
-
await (useStore ? store.update(opts.taskId, () => nextTask) : backend.writeTask(nextTask));
|
|
118
|
-
if (!opts.quiet) {
|
|
119
|
-
const readmePath = path.join(resolved.gitRoot, config.paths.workflow_dir, task.id, "README.md");
|
|
120
|
-
process.stdout.write(`${readmePath}\n`);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
export async function cmdTaskVerifyOk(opts) {
|
|
124
|
-
const by = String(opts.by ?? "").trim();
|
|
125
|
-
const note = String(opts.note ?? "").trim();
|
|
126
|
-
if (!by || !note) {
|
|
127
|
-
throw new CliError({
|
|
128
|
-
exitCode: 2,
|
|
129
|
-
code: "E_USAGE",
|
|
130
|
-
message: "Missing required inputs: --by and --note.",
|
|
142
|
+
details: opts.details ?? null,
|
|
143
|
+
verifyStepsRef,
|
|
131
144
|
});
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
145
|
+
const nextVerification = appendBetweenMarkers(verificationSection, entry, docVersion);
|
|
146
|
+
const nextDoc = ensureDocSections(setMarkdownSection(baseDoc, "Verification", nextVerification), config.tasks.doc.required_sections);
|
|
147
|
+
await backend.writeTask({
|
|
148
|
+
...remoteTask,
|
|
149
|
+
status: opts.state === "needs_rework" ? "DOING" : remoteTask.status,
|
|
150
|
+
commit: opts.state === "needs_rework" ? null : (remoteTask.commit ?? null),
|
|
151
|
+
doc: nextDoc,
|
|
152
|
+
doc_updated_by: opts.by,
|
|
153
|
+
events: appendTaskEvent(remoteTask, {
|
|
154
|
+
type: "verify",
|
|
155
|
+
at,
|
|
156
|
+
author: opts.by,
|
|
157
|
+
state: opts.state,
|
|
158
|
+
note: opts.note,
|
|
159
|
+
}),
|
|
160
|
+
verification: {
|
|
161
|
+
state: opts.state,
|
|
162
|
+
updated_at: at,
|
|
163
|
+
updated_by: opts.by,
|
|
164
|
+
note: opts.note,
|
|
165
|
+
},
|
|
138
166
|
});
|
|
139
167
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
catch (err) {
|
|
146
|
-
throw mapCoreError(err, { command: "task verify ok", filePath: opts.file });
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
try {
|
|
150
|
-
await recordVerificationResult({
|
|
151
|
-
ctx: opts.ctx,
|
|
152
|
-
cwd: opts.cwd,
|
|
153
|
-
rootOverride: opts.rootOverride,
|
|
154
|
-
taskId: opts.taskId,
|
|
155
|
-
state: "ok",
|
|
156
|
-
by,
|
|
157
|
-
note,
|
|
158
|
-
details,
|
|
159
|
-
quiet: opts.quiet,
|
|
160
|
-
});
|
|
161
|
-
return 0;
|
|
162
|
-
}
|
|
163
|
-
catch (err) {
|
|
164
|
-
if (err instanceof CliError)
|
|
165
|
-
throw err;
|
|
166
|
-
throw mapBackendError(err, { command: "task verify ok", root: opts.rootOverride ?? null });
|
|
168
|
+
if (!opts.quiet) {
|
|
169
|
+
const readmePath = path.join(resolved.gitRoot, config.paths.workflow_dir, opts.taskId, "README.md");
|
|
170
|
+
const relReadmePath = path.relative(resolved.gitRoot, readmePath);
|
|
171
|
+
process.stdout.write(`${successMessage("verified", opts.taskId, `state=${opts.state} readme=${relReadmePath}`)}\n`);
|
|
167
172
|
}
|
|
168
173
|
}
|
|
169
|
-
|
|
174
|
+
async function resolveVerifyRecordInput(opts) {
|
|
170
175
|
const by = String(opts.by ?? "").trim();
|
|
171
176
|
const note = String(opts.note ?? "").trim();
|
|
172
177
|
if (!by || !note) {
|
|
@@ -189,55 +194,16 @@ export async function cmdTaskVerifyRework(opts) {
|
|
|
189
194
|
details = await readFile(path.resolve(opts.cwd, opts.file), "utf8");
|
|
190
195
|
}
|
|
191
196
|
catch (err) {
|
|
192
|
-
throw mapCoreError(err, { command:
|
|
197
|
+
throw mapCoreError(err, { command: opts.command, filePath: opts.file });
|
|
193
198
|
}
|
|
194
199
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
ctx: opts.ctx,
|
|
198
|
-
cwd: opts.cwd,
|
|
199
|
-
rootOverride: opts.rootOverride,
|
|
200
|
-
taskId: opts.taskId,
|
|
201
|
-
state: "needs_rework",
|
|
202
|
-
by,
|
|
203
|
-
note,
|
|
204
|
-
details,
|
|
205
|
-
quiet: opts.quiet,
|
|
206
|
-
});
|
|
207
|
-
return 0;
|
|
208
|
-
}
|
|
209
|
-
catch (err) {
|
|
210
|
-
if (err instanceof CliError)
|
|
211
|
-
throw err;
|
|
212
|
-
throw mapBackendError(err, { command: "task verify rework", root: opts.rootOverride ?? null });
|
|
200
|
+
if (typeof details === "string") {
|
|
201
|
+
details = decodeEscapedTaskTextNewlines(details);
|
|
213
202
|
}
|
|
203
|
+
return { by, note, details };
|
|
214
204
|
}
|
|
215
|
-
|
|
216
|
-
const
|
|
217
|
-
const note = String(opts.note ?? "").trim();
|
|
218
|
-
if (!by || !note) {
|
|
219
|
-
throw new CliError({
|
|
220
|
-
exitCode: 2,
|
|
221
|
-
code: "E_USAGE",
|
|
222
|
-
message: "Missing required inputs: --by and --note.",
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
if (typeof opts.details === "string" && typeof opts.file === "string") {
|
|
226
|
-
throw new CliError({
|
|
227
|
-
exitCode: 2,
|
|
228
|
-
code: "E_USAGE",
|
|
229
|
-
message: "Options --details and --file are mutually exclusive.",
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
let details = typeof opts.details === "string" ? opts.details : null;
|
|
233
|
-
if (typeof opts.file === "string") {
|
|
234
|
-
try {
|
|
235
|
-
details = await readFile(path.resolve(opts.cwd, opts.file), "utf8");
|
|
236
|
-
}
|
|
237
|
-
catch (err) {
|
|
238
|
-
throw mapCoreError(err, { command: "verify", filePath: opts.file });
|
|
239
|
-
}
|
|
240
|
-
}
|
|
205
|
+
async function executeVerifyRecordCommand(opts) {
|
|
206
|
+
const input = await resolveVerifyRecordInput(opts);
|
|
241
207
|
try {
|
|
242
208
|
await recordVerificationResult({
|
|
243
209
|
ctx: opts.ctx,
|
|
@@ -245,9 +211,9 @@ export async function cmdVerifyParsed(opts) {
|
|
|
245
211
|
rootOverride: opts.rootOverride,
|
|
246
212
|
taskId: opts.taskId,
|
|
247
213
|
state: opts.state,
|
|
248
|
-
by,
|
|
249
|
-
note,
|
|
250
|
-
details,
|
|
214
|
+
by: input.by,
|
|
215
|
+
note: input.note,
|
|
216
|
+
details: input.details,
|
|
251
217
|
quiet: opts.quiet,
|
|
252
218
|
});
|
|
253
219
|
return 0;
|
|
@@ -255,6 +221,19 @@ export async function cmdVerifyParsed(opts) {
|
|
|
255
221
|
catch (err) {
|
|
256
222
|
if (err instanceof CliError)
|
|
257
223
|
throw err;
|
|
258
|
-
throw mapBackendError(err, { command:
|
|
224
|
+
throw mapBackendError(err, { command: opts.command, root: opts.rootOverride ?? null });
|
|
259
225
|
}
|
|
260
226
|
}
|
|
227
|
+
export async function cmdTaskVerifyOk(opts) {
|
|
228
|
+
return await executeVerifyRecordCommand({ ...opts, state: "ok", command: "task verify ok" });
|
|
229
|
+
}
|
|
230
|
+
export async function cmdTaskVerifyRework(opts) {
|
|
231
|
+
return await executeVerifyRecordCommand({
|
|
232
|
+
...opts,
|
|
233
|
+
state: "needs_rework",
|
|
234
|
+
command: "task verify rework",
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
export async function cmdVerifyParsed(opts) {
|
|
238
|
+
return await executeVerifyRecordCommand({ ...opts, command: "verify" });
|
|
239
|
+
}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import type { CommandCtx, CommandSpec } from "../../cli/spec/spec.js";
|
|
2
2
|
import type { CommandContext } from "../shared/task-backend.js";
|
|
3
|
-
|
|
3
|
+
import { type VerifyCommonParsed } from "./verify-command-shared.js";
|
|
4
|
+
export type TaskVerifyReworkParsed = VerifyCommonParsed & {
|
|
4
5
|
taskId: string;
|
|
5
|
-
by: string;
|
|
6
|
-
note: string;
|
|
7
|
-
details?: string;
|
|
8
|
-
file?: string;
|
|
9
|
-
quiet: boolean;
|
|
10
6
|
};
|
|
11
7
|
export declare const taskVerifyReworkSpec: CommandSpec<TaskVerifyReworkParsed>;
|
|
12
8
|
export declare function makeRunTaskVerifyReworkHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: TaskVerifyReworkParsed) => Promise<number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-rework.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-rework.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"verify-rework.command.d.ts","sourceRoot":"","sources":["../../../src/commands/task/verify-rework.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,EAKL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,GAAG;IACxD,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,sBAAsB,CAwBpE,CAAC;AAEF,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IAC/E,KAAK,UAAU,EAAE,GAAG,sBAAsB,KAAG,OAAO,CAAC,MAAM,CAAC,CAa3E"}
|
|
@@ -1,38 +1,11 @@
|
|
|
1
|
-
import { usageError } from "../../cli/spec/errors.js";
|
|
2
1
|
import { cmdTaskVerifyRework } from "./verify-record.js";
|
|
2
|
+
import { parseVerifyCommonOptions, validateVerifyDetailsFileExclusive, validateVerifyNonEmptyInput, verifyCommonOptions, } from "./verify-command-shared.js";
|
|
3
3
|
export const taskVerifyReworkSpec = {
|
|
4
4
|
id: ["task", "verify", "rework"],
|
|
5
5
|
group: "Task",
|
|
6
6
|
summary: "Record verification as needs rework (resets commit, sets status to DOING, updates Verification).",
|
|
7
7
|
args: [{ name: "task-id", required: true, valueHint: "<task-id>" }],
|
|
8
|
-
options:
|
|
9
|
-
{ kind: "string", name: "by", valueHint: "<id>", required: true, description: "Verifier id." },
|
|
10
|
-
{
|
|
11
|
-
kind: "string",
|
|
12
|
-
name: "note",
|
|
13
|
-
valueHint: "<text>",
|
|
14
|
-
required: true,
|
|
15
|
-
description: "Short verification note.",
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
kind: "string",
|
|
19
|
-
name: "details",
|
|
20
|
-
valueHint: "<text>",
|
|
21
|
-
description: "Optional details text (mutually exclusive with --file).",
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
kind: "string",
|
|
25
|
-
name: "file",
|
|
26
|
-
valueHint: "<path>",
|
|
27
|
-
description: "Optional details file path (mutually exclusive with --details).",
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
kind: "boolean",
|
|
31
|
-
name: "quiet",
|
|
32
|
-
default: false,
|
|
33
|
-
description: "Suppress normal output (still prints errors).",
|
|
34
|
-
},
|
|
35
|
-
],
|
|
8
|
+
options: verifyCommonOptions,
|
|
36
9
|
examples: [
|
|
37
10
|
{
|
|
38
11
|
cmd: 'agentplane task verify rework 202602030608-F1Q8AB --by REVIEWER --note "Needs changes"',
|
|
@@ -40,30 +13,15 @@ export const taskVerifyReworkSpec = {
|
|
|
40
13
|
},
|
|
41
14
|
],
|
|
42
15
|
validateRaw: (raw) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
message: "Provide at most one of --details or --file.",
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
const by = raw.opts.by;
|
|
52
|
-
if (typeof by === "string" && by.trim().length === 0) {
|
|
53
|
-
throw usageError({ spec: taskVerifyReworkSpec, message: "Invalid value for --by: empty." });
|
|
54
|
-
}
|
|
55
|
-
const note = raw.opts.note;
|
|
56
|
-
if (typeof note === "string" && note.trim().length === 0) {
|
|
57
|
-
throw usageError({ spec: taskVerifyReworkSpec, message: "Invalid value for --note: empty." });
|
|
58
|
-
}
|
|
16
|
+
validateVerifyDetailsFileExclusive(raw, taskVerifyReworkSpec, {
|
|
17
|
+
message: "Provide at most one of --details or --file.",
|
|
18
|
+
});
|
|
19
|
+
validateVerifyNonEmptyInput(raw, taskVerifyReworkSpec, "by");
|
|
20
|
+
validateVerifyNonEmptyInput(raw, taskVerifyReworkSpec, "note");
|
|
59
21
|
},
|
|
60
22
|
parse: (raw) => ({
|
|
61
23
|
taskId: String(raw.args["task-id"]),
|
|
62
|
-
|
|
63
|
-
note: String(raw.opts.note),
|
|
64
|
-
details: typeof raw.opts.details === "string" ? raw.opts.details : undefined,
|
|
65
|
-
file: typeof raw.opts.file === "string" ? raw.opts.file : undefined,
|
|
66
|
-
quiet: raw.opts.quiet === true,
|
|
24
|
+
...parseVerifyCommonOptions(raw),
|
|
67
25
|
}),
|
|
68
26
|
};
|
|
69
27
|
export function makeRunTaskVerifyReworkHandler(getCtx) {
|
|
@@ -7,6 +7,8 @@ export declare function ensureCleanTrackedTreeForUpgrade(gitRoot: string): Promi
|
|
|
7
7
|
export declare function createUpgradeCommit(opts: {
|
|
8
8
|
gitRoot: string;
|
|
9
9
|
paths: string[];
|
|
10
|
+
tasksPath: string;
|
|
11
|
+
workflowDir: string;
|
|
10
12
|
versionLabel: string;
|
|
11
13
|
source: "local_assets" | "upgrade_bundle" | "repo_tarball";
|
|
12
14
|
additions: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../src/commands/upgrade/apply.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../src/commands/upgrade/apply.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAUtD,wBAAsB,2BAA2B,CAAC,IAAI,EAAE;IACtD,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B,GAAG,OAAO,CAAC,IAAI,CAAC,CAKhB;AAED,wBAAsB,gCAAgC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BrF;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,cAAc,GAAG,gBAAgB,GAAG,cAAc,CAAC;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,MAAM,CAAC;CAChC,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CA8FpD;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAC/C,GAAG,OAAO,CAAC,IAAI,CAAC,CA2ChB;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE;IAC9C,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,mBAAmB,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,cAAc,GAAG,gBAAgB,GAAG,cAAc,CAAC;IAC3D,aAAa,EAAE,mBAAmB,EAAE,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,OAAO,CAAC,CA4CnB"}
|
|
@@ -5,6 +5,7 @@ import { backupPath, fileExists } from "../../cli/fs-utils.js";
|
|
|
5
5
|
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
6
6
|
import { withDiagnosticContext } from "../../shared/diagnostics.js";
|
|
7
7
|
import { CliError } from "../../shared/errors.js";
|
|
8
|
+
import { protectedPathKindForFile } from "../../shared/protected-paths.js";
|
|
8
9
|
import { execFileAsync, gitEnv } from "../shared/git.js";
|
|
9
10
|
async function safeRemovePath(targetPath) {
|
|
10
11
|
try {
|
|
@@ -74,10 +75,41 @@ export async function createUpgradeCommit(opts) {
|
|
|
74
75
|
`Source: ${opts.source}\n` +
|
|
75
76
|
`Managed-Changes: add=${opts.additions}, update=${opts.updates}, unchanged=${opts.unchanged}\n` +
|
|
76
77
|
`Incidents-Appended: ${opts.incidentsAppendedCount}\n`;
|
|
78
|
+
const allow = {
|
|
79
|
+
allowTasks: false,
|
|
80
|
+
allowPolicy: false,
|
|
81
|
+
allowConfig: false,
|
|
82
|
+
allowHooks: false,
|
|
83
|
+
allowCI: false,
|
|
84
|
+
};
|
|
85
|
+
for (const filePath of uniquePaths) {
|
|
86
|
+
const kind = protectedPathKindForFile({
|
|
87
|
+
filePath,
|
|
88
|
+
tasksPath: opts.tasksPath,
|
|
89
|
+
workflowDir: opts.workflowDir,
|
|
90
|
+
});
|
|
91
|
+
if (kind === "tasks")
|
|
92
|
+
allow.allowTasks = true;
|
|
93
|
+
if (kind === "policy")
|
|
94
|
+
allow.allowPolicy = true;
|
|
95
|
+
if (kind === "config")
|
|
96
|
+
allow.allowConfig = true;
|
|
97
|
+
if (kind === "hooks")
|
|
98
|
+
allow.allowHooks = true;
|
|
99
|
+
if (kind === "ci")
|
|
100
|
+
allow.allowCI = true;
|
|
101
|
+
}
|
|
77
102
|
try {
|
|
78
103
|
await execFileAsync("git", ["commit", "-m", subject, "-m", body], {
|
|
79
104
|
cwd: opts.gitRoot,
|
|
80
|
-
env:
|
|
105
|
+
env: {
|
|
106
|
+
...gitEnv(),
|
|
107
|
+
AGENTPLANE_ALLOW_TASKS: allow.allowTasks ? "1" : "0",
|
|
108
|
+
AGENTPLANE_ALLOW_POLICY: allow.allowPolicy ? "1" : "0",
|
|
109
|
+
AGENTPLANE_ALLOW_CONFIG: allow.allowConfig ? "1" : "0",
|
|
110
|
+
AGENTPLANE_ALLOW_HOOKS: allow.allowHooks ? "1" : "0",
|
|
111
|
+
AGENTPLANE_ALLOW_CI: allow.allowCI ? "1" : "0",
|
|
112
|
+
},
|
|
81
113
|
maxBuffer: 10 * 1024 * 1024,
|
|
82
114
|
});
|
|
83
115
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.command.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvE,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAEnE,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC;AAEzC,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"upgrade.command.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvE,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAEnE,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC;AAEzC,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,aAAa,CAwLlD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,aAAa,CACsB,CAAC"}
|
|
@@ -72,6 +72,12 @@ export const upgradeSpec = {
|
|
|
72
72
|
default: false,
|
|
73
73
|
description: "Report changes without modifying files.",
|
|
74
74
|
},
|
|
75
|
+
{
|
|
76
|
+
kind: "boolean",
|
|
77
|
+
name: "migrate-task-docs",
|
|
78
|
+
default: false,
|
|
79
|
+
description: "After applying the framework upgrade, migrate legacy task README docs in the same run.",
|
|
80
|
+
},
|
|
75
81
|
{
|
|
76
82
|
kind: "boolean",
|
|
77
83
|
name: "no-backup",
|
|
@@ -115,6 +121,10 @@ export const upgradeSpec = {
|
|
|
115
121
|
cmd: "agentplane upgrade --bundle ./agentplane-upgrade.tar.gz --checksum ./agentplane-upgrade.tar.gz.sha256",
|
|
116
122
|
why: "Upgrade from local bundle files (no network).",
|
|
117
123
|
},
|
|
124
|
+
{
|
|
125
|
+
cmd: "agentplane upgrade --yes --migrate-task-docs",
|
|
126
|
+
why: "Apply the framework upgrade and migrate legacy task README docs in one operator run.",
|
|
127
|
+
},
|
|
118
128
|
],
|
|
119
129
|
parse: (raw) => {
|
|
120
130
|
const noBackup = raw.opts["no-backup"] === true;
|
|
@@ -130,6 +140,7 @@ export const upgradeSpec = {
|
|
|
130
140
|
checksumAsset: raw.opts["checksum-asset"],
|
|
131
141
|
dryRun: raw.opts["dry-run"] === true,
|
|
132
142
|
backup: !noBackup,
|
|
143
|
+
migrateTaskDocs: raw.opts["migrate-task-docs"] === true,
|
|
133
144
|
yes: raw.opts.yes === true,
|
|
134
145
|
};
|
|
135
146
|
},
|
|
@@ -151,6 +162,20 @@ export const upgradeSpec = {
|
|
|
151
162
|
message: "Remote upgrade options (--tag/--source/--asset/--checksum-asset) require --remote.",
|
|
152
163
|
});
|
|
153
164
|
}
|
|
165
|
+
if (p.migrateTaskDocs && p.mode === "agent") {
|
|
166
|
+
throw usageError({
|
|
167
|
+
spec: upgradeSpec,
|
|
168
|
+
command: "upgrade",
|
|
169
|
+
message: "Option --migrate-task-docs cannot be used with --agent.",
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
if (p.migrateTaskDocs && p.dryRun) {
|
|
173
|
+
throw usageError({
|
|
174
|
+
spec: upgradeSpec,
|
|
175
|
+
command: "upgrade",
|
|
176
|
+
message: "Option --migrate-task-docs cannot be used with --dry-run.",
|
|
177
|
+
});
|
|
178
|
+
}
|
|
154
179
|
},
|
|
155
180
|
};
|
|
156
181
|
export const runUpgrade = (ctx, flags) => cmdUpgradeParsed({ cwd: ctx.cwd, rootOverride: ctx.rootOverride, flags });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.ts"],"names":[],"mappings":"AA+CA,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,EAAE,OAAO,CAAC;IACzB,GAAG,EAAE,OAAO,CAAC;CACd,CAAC;AAuMF,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,YAAY,CAAC;CACrB,GAAG,OAAO,CAAC,MAAM,CAAC,CA2kBlB;AAED,OAAO,EACL,kCAAkC,EAClC,qBAAqB,EACrB,iCAAiC,GAClC,MAAM,qBAAqB,CAAC"}
|