agentplane 0.2.6 → 0.2.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.
Files changed (140) hide show
  1. package/README.md +11 -0
  2. package/assets/AGENTS.md +35 -0
  3. package/assets/agents/CODER.json +0 -1
  4. package/assets/agents/INTEGRATOR.json +0 -1
  5. package/assets/agents/ORCHESTRATOR.json +1 -2
  6. package/assets/agents/PLANNER.json +1 -3
  7. package/assets/agents/TESTER.json +0 -1
  8. package/assets/agents/UPGRADER.json +17 -15
  9. package/dist/cli/archive.d.ts.map +1 -1
  10. package/dist/cli/archive.js +61 -36
  11. package/dist/cli/command-guide.d.ts.map +1 -1
  12. package/dist/cli/command-guide.js +4 -2
  13. package/dist/cli/run-cli/command-catalog.d.ts +4 -1
  14. package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
  15. package/dist/cli/run-cli/command-catalog.js +40 -22
  16. package/dist/cli/run-cli/commands/config.d.ts +5 -4
  17. package/dist/cli/run-cli/commands/config.d.ts.map +1 -1
  18. package/dist/cli/run-cli/commands/config.js +39 -29
  19. package/dist/cli/run-cli/commands/core.d.ts +2 -1
  20. package/dist/cli/run-cli/commands/core.d.ts.map +1 -1
  21. package/dist/cli/run-cli/commands/core.js +174 -67
  22. package/dist/cli/run-cli/commands/ide.d.ts +3 -1
  23. package/dist/cli/run-cli/commands/ide.d.ts.map +1 -1
  24. package/dist/cli/run-cli/commands/ide.js +7 -6
  25. package/dist/cli/run-cli/commands/init/ide-sync.d.ts.map +1 -1
  26. package/dist/cli/run-cli/commands/init/ide-sync.js +10 -1
  27. package/dist/cli/run-cli/commands/init/write-agents.d.ts.map +1 -1
  28. package/dist/cli/run-cli/commands/init/write-agents.js +4 -24
  29. package/dist/cli/run-cli/commands/init/write-gitignore.d.ts +4 -0
  30. package/dist/cli/run-cli/commands/init/write-gitignore.d.ts.map +1 -0
  31. package/dist/cli/run-cli/commands/init/write-gitignore.js +35 -0
  32. package/dist/cli/run-cli/commands/init.d.ts +1 -0
  33. package/dist/cli/run-cli/commands/init.d.ts.map +1 -1
  34. package/dist/cli/run-cli/commands/init.js +31 -8
  35. package/dist/cli/run-cli/registry.run.d.ts +6 -2
  36. package/dist/cli/run-cli/registry.run.d.ts.map +1 -1
  37. package/dist/cli/run-cli/registry.run.js +7 -2
  38. package/dist/cli/run-cli.d.ts.map +1 -1
  39. package/dist/cli/run-cli.js +94 -75
  40. package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
  41. package/dist/cli/run-cli.test-helpers.js +99 -3
  42. package/dist/cli/spec/parse-utils.d.ts +11 -0
  43. package/dist/cli/spec/parse-utils.d.ts.map +1 -0
  44. package/dist/cli/spec/parse-utils.js +28 -0
  45. package/dist/commands/block.command.d.ts +3 -18
  46. package/dist/commands/block.command.d.ts.map +1 -1
  47. package/dist/commands/block.command.js +2 -143
  48. package/dist/commands/block.run.d.ts +5 -0
  49. package/dist/commands/block.run.d.ts.map +1 -0
  50. package/dist/commands/block.run.js +22 -0
  51. package/dist/commands/block.spec.d.ts +17 -0
  52. package/dist/commands/block.spec.d.ts.map +1 -0
  53. package/dist/commands/block.spec.js +115 -0
  54. package/dist/commands/finish.command.d.ts +3 -27
  55. package/dist/commands/finish.command.d.ts.map +1 -1
  56. package/dist/commands/finish.command.js +2 -237
  57. package/dist/commands/finish.run.d.ts +5 -0
  58. package/dist/commands/finish.run.d.ts.map +1 -0
  59. package/dist/commands/finish.run.js +40 -0
  60. package/dist/commands/finish.spec.d.ts +26 -0
  61. package/dist/commands/finish.spec.d.ts.map +1 -0
  62. package/dist/commands/finish.spec.js +193 -0
  63. package/dist/commands/release/apply.command.d.ts +11 -0
  64. package/dist/commands/release/apply.command.d.ts.map +1 -0
  65. package/dist/commands/release/apply.command.js +343 -0
  66. package/dist/commands/release/plan.command.d.ts +12 -0
  67. package/dist/commands/release/plan.command.d.ts.map +1 -0
  68. package/dist/commands/release/plan.command.js +206 -0
  69. package/dist/commands/release/release.command.d.ts +5 -0
  70. package/dist/commands/release/release.command.d.ts.map +1 -0
  71. package/dist/commands/release/release.command.js +18 -0
  72. package/dist/commands/shared/task-backend.d.ts +1 -0
  73. package/dist/commands/shared/task-backend.d.ts.map +1 -1
  74. package/dist/commands/start.command.d.ts +3 -18
  75. package/dist/commands/start.command.d.ts.map +1 -1
  76. package/dist/commands/start.command.js +2 -143
  77. package/dist/commands/start.run.d.ts +5 -0
  78. package/dist/commands/start.run.d.ts.map +1 -0
  79. package/dist/commands/start.run.js +22 -0
  80. package/dist/commands/start.spec.d.ts +17 -0
  81. package/dist/commands/start.spec.d.ts.map +1 -0
  82. package/dist/commands/start.spec.js +115 -0
  83. package/dist/commands/task/add.command.d.ts.map +1 -1
  84. package/dist/commands/task/add.command.js +1 -7
  85. package/dist/commands/task/derive.command.d.ts.map +1 -1
  86. package/dist/commands/task/derive.command.js +1 -7
  87. package/dist/commands/task/list.command.d.ts +3 -8
  88. package/dist/commands/task/list.command.d.ts.map +1 -1
  89. package/dist/commands/task/list.command.js +2 -67
  90. package/dist/commands/task/list.run.d.ts +5 -0
  91. package/dist/commands/task/list.run.d.ts.map +1 -0
  92. package/dist/commands/task/list.run.js +10 -0
  93. package/dist/commands/task/list.spec.d.ts +7 -0
  94. package/dist/commands/task/list.spec.d.ts.map +1 -0
  95. package/dist/commands/task/list.spec.js +51 -0
  96. package/dist/commands/task/next.command.d.ts +3 -8
  97. package/dist/commands/task/next.command.d.ts.map +1 -1
  98. package/dist/commands/task/next.command.js +2 -89
  99. package/dist/commands/task/next.run.d.ts +5 -0
  100. package/dist/commands/task/next.run.d.ts.map +1 -0
  101. package/dist/commands/task/next.run.js +11 -0
  102. package/dist/commands/task/next.spec.d.ts +7 -0
  103. package/dist/commands/task/next.spec.d.ts.map +1 -0
  104. package/dist/commands/task/next.spec.js +69 -0
  105. package/dist/commands/task/search.command.d.ts +3 -10
  106. package/dist/commands/task/search.command.d.ts.map +1 -1
  107. package/dist/commands/task/search.command.js +2 -101
  108. package/dist/commands/task/search.run.d.ts +5 -0
  109. package/dist/commands/task/search.run.d.ts.map +1 -0
  110. package/dist/commands/task/search.run.js +13 -0
  111. package/dist/commands/task/search.spec.d.ts +9 -0
  112. package/dist/commands/task/search.spec.d.ts.map +1 -0
  113. package/dist/commands/task/search.spec.js +79 -0
  114. package/dist/commands/task/set-status.command.d.ts.map +1 -1
  115. package/dist/commands/task/set-status.command.js +1 -7
  116. package/dist/commands/task/shared.d.ts.map +1 -1
  117. package/dist/commands/task/shared.js +15 -8
  118. package/dist/commands/task/show.command.d.ts +3 -7
  119. package/dist/commands/task/show.command.d.ts.map +1 -1
  120. package/dist/commands/task/show.command.js +2 -19
  121. package/dist/commands/task/show.run.d.ts +5 -0
  122. package/dist/commands/task/show.run.d.ts.map +1 -0
  123. package/dist/commands/task/show.run.js +11 -0
  124. package/dist/commands/task/show.spec.d.ts +6 -0
  125. package/dist/commands/task/show.spec.d.ts.map +1 -0
  126. package/dist/commands/task/show.spec.js +8 -0
  127. package/dist/commands/task/update.command.d.ts.map +1 -1
  128. package/dist/commands/task/update.command.js +1 -7
  129. package/dist/commands/upgrade.d.ts.map +1 -1
  130. package/dist/commands/upgrade.js +149 -31
  131. package/dist/commands/verify.command.d.ts +3 -15
  132. package/dist/commands/verify.command.d.ts.map +1 -1
  133. package/dist/commands/verify.command.js +2 -113
  134. package/dist/commands/verify.run.d.ts +5 -0
  135. package/dist/commands/verify.run.d.ts.map +1 -0
  136. package/dist/commands/verify.run.js +17 -0
  137. package/dist/commands/verify.spec.d.ts +14 -0
  138. package/dist/commands/verify.spec.d.ts.map +1 -0
  139. package/dist/commands/verify.spec.js +96 -0
  140. package/package.json +1 -1
@@ -1,143 +1,2 @@
1
- import { usageError } from "../cli/spec/errors.js";
2
- import { cmdBlock } from "./task/block.js";
3
- function toStringList(v) {
4
- if (typeof v === "string")
5
- return [v];
6
- if (Array.isArray(v))
7
- return v.filter((x) => typeof x === "string");
8
- return [];
9
- }
10
- export const blockSpec = {
11
- id: ["block"],
12
- group: "Lifecycle",
13
- summary: "Transition a task to BLOCKED and record a structured Blocked comment.",
14
- args: [
15
- {
16
- name: "task-id",
17
- required: true,
18
- valueHint: "<task-id>",
19
- description: "Existing task id.",
20
- },
21
- ],
22
- options: [
23
- {
24
- kind: "string",
25
- name: "author",
26
- valueHint: "<id>",
27
- required: true,
28
- description: "Comment author id (e.g. CODER).",
29
- },
30
- {
31
- kind: "string",
32
- name: "body",
33
- valueHint: "<text>",
34
- required: true,
35
- description: "Structured comment body (must match the configured Blocked: prefix).",
36
- },
37
- {
38
- kind: "boolean",
39
- name: "commit-from-comment",
40
- default: false,
41
- description: "Create a status commit using the comment body.",
42
- },
43
- {
44
- kind: "string",
45
- name: "commit-emoji",
46
- valueHint: "<emoji>",
47
- description: "Override the status commit emoji (used with --commit-from-comment).",
48
- },
49
- {
50
- kind: "string",
51
- name: "commit-allow",
52
- valueHint: "<path-prefix>",
53
- repeatable: true,
54
- description: "Repeatable. Allowlist path prefixes to stage for the status commit (used with --commit-from-comment).",
55
- },
56
- {
57
- kind: "boolean",
58
- name: "commit-auto-allow",
59
- default: false,
60
- description: "Auto-allow inferred allowlist paths if none are provided (used with --commit-from-comment).",
61
- },
62
- {
63
- kind: "boolean",
64
- name: "commit-allow-tasks",
65
- default: true,
66
- hidden: true,
67
- description: "Deprecated. Tasks are always allowed for status commits.",
68
- deprecated: "no-op",
69
- },
70
- {
71
- kind: "boolean",
72
- name: "commit-require-clean",
73
- default: false,
74
- description: "Require a clean working tree for the status commit (used with --commit-from-comment).",
75
- },
76
- {
77
- kind: "boolean",
78
- name: "confirm-status-commit",
79
- default: false,
80
- description: "Confirm status commit creation when status_commit_policy=confirm (used with --commit-from-comment).",
81
- },
82
- {
83
- kind: "boolean",
84
- name: "force",
85
- default: false,
86
- description: "Override status transition restrictions.",
87
- },
88
- { kind: "boolean", name: "quiet", default: false, description: "Suppress output." },
89
- ],
90
- examples: [
91
- {
92
- cmd: 'agentplane block 202602030608-F1Q8AB --author CODER --body "Blocked: waiting for review"',
93
- why: "Block work on a task.",
94
- },
95
- {
96
- cmd: 'agentplane block 202602030608-F1Q8AB --author CODER --body "Blocked: waiting for review" --commit-from-comment --commit-allow packages/agentplane/src',
97
- why: "Block work and create a status commit from the comment.",
98
- },
99
- ],
100
- validateRaw: (raw) => {
101
- const author = typeof raw.opts.author === "string" ? raw.opts.author.trim() : "";
102
- const body = typeof raw.opts.body === "string" ? raw.opts.body.trim() : "";
103
- if (!author)
104
- throw usageError({ spec: blockSpec, message: "Invalid value for --author: empty." });
105
- if (!body)
106
- throw usageError({ spec: blockSpec, message: "Invalid value for --body: empty." });
107
- },
108
- parse: (raw) => ({
109
- taskId: typeof raw.args["task-id"] === "string" ? raw.args["task-id"] : "",
110
- author: raw.opts.author,
111
- body: raw.opts.body,
112
- commitFromComment: raw.opts["commit-from-comment"] === true,
113
- commitEmoji: raw.opts["commit-emoji"],
114
- commitAllow: toStringList(raw.opts["commit-allow"]),
115
- commitAutoAllow: raw.opts["commit-auto-allow"] === true,
116
- commitAllowTasks: raw.opts["commit-allow-tasks"] !== false,
117
- commitRequireClean: raw.opts["commit-require-clean"] === true,
118
- confirmStatusCommit: raw.opts["confirm-status-commit"] === true,
119
- force: raw.opts.force === true,
120
- quiet: raw.opts.quiet === true,
121
- }),
122
- };
123
- export function makeRunBlockHandler(getCtx) {
124
- return async (ctx, p) => {
125
- return await cmdBlock({
126
- ctx: await getCtx("block"),
127
- cwd: ctx.cwd,
128
- rootOverride: ctx.rootOverride,
129
- taskId: p.taskId,
130
- author: p.author,
131
- body: p.body,
132
- commitFromComment: p.commitFromComment,
133
- commitEmoji: p.commitEmoji,
134
- commitAllow: p.commitAllow,
135
- commitAutoAllow: p.commitAutoAllow,
136
- commitAllowTasks: p.commitAllowTasks,
137
- commitRequireClean: p.commitRequireClean,
138
- confirmStatusCommit: p.confirmStatusCommit,
139
- force: p.force,
140
- quiet: p.quiet,
141
- });
142
- };
143
- }
1
+ export { blockSpec } from "./block.spec.js";
2
+ export { makeRunBlockHandler } from "./block.run.js";
@@ -0,0 +1,5 @@
1
+ import type { CommandCtx } from "../cli/spec/spec.js";
2
+ import type { CommandContext } from "./shared/task-backend.js";
3
+ import type { BlockParsed } from "./block.spec.js";
4
+ export declare function makeRunBlockHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: BlockParsed) => Promise<number>;
5
+ //# sourceMappingURL=block.run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block.run.d.ts","sourceRoot":"","sources":["../../src/commands/block.run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IACpE,KAAK,UAAU,EAAE,GAAG,WAAW,KAAG,OAAO,CAAC,MAAM,CAAC,CAmBhE"}
@@ -0,0 +1,22 @@
1
+ import { cmdBlock } from "./task/block.js";
2
+ export function makeRunBlockHandler(getCtx) {
3
+ return async (ctx, p) => {
4
+ return await cmdBlock({
5
+ ctx: await getCtx("block"),
6
+ cwd: ctx.cwd,
7
+ rootOverride: ctx.rootOverride,
8
+ taskId: p.taskId,
9
+ author: p.author,
10
+ body: p.body,
11
+ commitFromComment: p.commitFromComment,
12
+ commitEmoji: p.commitEmoji,
13
+ commitAllow: p.commitAllow,
14
+ commitAutoAllow: p.commitAutoAllow,
15
+ commitAllowTasks: p.commitAllowTasks,
16
+ commitRequireClean: p.commitRequireClean,
17
+ confirmStatusCommit: p.confirmStatusCommit,
18
+ force: p.force,
19
+ quiet: p.quiet,
20
+ });
21
+ };
22
+ }
@@ -0,0 +1,17 @@
1
+ import type { CommandSpec } from "../cli/spec/spec.js";
2
+ export type BlockParsed = {
3
+ taskId: string;
4
+ author: string;
5
+ body: string;
6
+ commitFromComment: boolean;
7
+ commitEmoji?: string;
8
+ commitAllow: string[];
9
+ commitAutoAllow: boolean;
10
+ commitAllowTasks: boolean;
11
+ commitRequireClean: boolean;
12
+ confirmStatusCommit: boolean;
13
+ force: boolean;
14
+ quiet: boolean;
15
+ };
16
+ export declare const blockSpec: CommandSpec<BlockParsed>;
17
+ //# sourceMappingURL=block.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block.spec.d.ts","sourceRoot":"","sources":["../../src/commands/block.spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAKvD,MAAM,MAAM,WAAW,GAAG;IACxB,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,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,WAAW,CAAC,WAAW,CAmH9C,CAAC"}
@@ -0,0 +1,115 @@
1
+ import { usageError } from "../cli/spec/errors.js";
2
+ import { toStringList } from "../cli/spec/parse-utils.js";
3
+ export const blockSpec = {
4
+ id: ["block"],
5
+ group: "Lifecycle",
6
+ summary: "Transition a task to BLOCKED and record a structured Blocked comment.",
7
+ args: [
8
+ {
9
+ name: "task-id",
10
+ required: true,
11
+ valueHint: "<task-id>",
12
+ description: "Existing task id.",
13
+ },
14
+ ],
15
+ options: [
16
+ {
17
+ kind: "string",
18
+ name: "author",
19
+ valueHint: "<id>",
20
+ required: true,
21
+ description: "Comment author id (e.g. CODER).",
22
+ },
23
+ {
24
+ kind: "string",
25
+ name: "body",
26
+ valueHint: "<text>",
27
+ required: true,
28
+ description: "Structured comment body (must match the configured Blocked: prefix).",
29
+ },
30
+ {
31
+ kind: "boolean",
32
+ name: "commit-from-comment",
33
+ default: false,
34
+ description: "Create a status commit using the comment body.",
35
+ },
36
+ {
37
+ kind: "string",
38
+ name: "commit-emoji",
39
+ valueHint: "<emoji>",
40
+ description: "Override the status commit emoji (used with --commit-from-comment).",
41
+ },
42
+ {
43
+ kind: "string",
44
+ name: "commit-allow",
45
+ valueHint: "<path-prefix>",
46
+ repeatable: true,
47
+ description: "Repeatable. Allowlist path prefixes to stage for the status commit (used with --commit-from-comment).",
48
+ },
49
+ {
50
+ kind: "boolean",
51
+ name: "commit-auto-allow",
52
+ default: false,
53
+ description: "Auto-allow inferred allowlist paths if none are provided (used with --commit-from-comment).",
54
+ },
55
+ {
56
+ kind: "boolean",
57
+ name: "commit-allow-tasks",
58
+ default: true,
59
+ hidden: true,
60
+ description: "Deprecated. Tasks are always allowed for status commits.",
61
+ deprecated: "no-op",
62
+ },
63
+ {
64
+ kind: "boolean",
65
+ name: "commit-require-clean",
66
+ default: false,
67
+ description: "Require a clean working tree for the status commit (used with --commit-from-comment).",
68
+ },
69
+ {
70
+ kind: "boolean",
71
+ name: "confirm-status-commit",
72
+ default: false,
73
+ description: "Confirm status commit creation when status_commit_policy=confirm (used with --commit-from-comment).",
74
+ },
75
+ {
76
+ kind: "boolean",
77
+ name: "force",
78
+ default: false,
79
+ description: "Override status transition restrictions.",
80
+ },
81
+ { kind: "boolean", name: "quiet", default: false, description: "Suppress output." },
82
+ ],
83
+ examples: [
84
+ {
85
+ cmd: 'agentplane block 202602030608-F1Q8AB --author CODER --body "Blocked: waiting for review"',
86
+ why: "Block work on a task.",
87
+ },
88
+ {
89
+ cmd: 'agentplane block 202602030608-F1Q8AB --author CODER --body "Blocked: waiting for review" --commit-from-comment --commit-allow packages/agentplane/src',
90
+ why: "Block work and create a status commit from the comment.",
91
+ },
92
+ ],
93
+ validateRaw: (raw) => {
94
+ const author = typeof raw.opts.author === "string" ? raw.opts.author.trim() : "";
95
+ const body = typeof raw.opts.body === "string" ? raw.opts.body.trim() : "";
96
+ if (!author)
97
+ throw usageError({ spec: blockSpec, message: "Invalid value for --author: empty." });
98
+ if (!body)
99
+ throw usageError({ spec: blockSpec, message: "Invalid value for --body: empty." });
100
+ },
101
+ parse: (raw) => ({
102
+ taskId: typeof raw.args["task-id"] === "string" ? raw.args["task-id"] : "",
103
+ author: raw.opts.author,
104
+ body: raw.opts.body,
105
+ commitFromComment: raw.opts["commit-from-comment"] === true,
106
+ commitEmoji: raw.opts["commit-emoji"],
107
+ commitAllow: toStringList(raw.opts["commit-allow"]),
108
+ commitAutoAllow: raw.opts["commit-auto-allow"] === true,
109
+ commitAllowTasks: raw.opts["commit-allow-tasks"] !== false,
110
+ commitRequireClean: raw.opts["commit-require-clean"] === true,
111
+ confirmStatusCommit: raw.opts["confirm-status-commit"] === true,
112
+ force: raw.opts.force === true,
113
+ quiet: raw.opts.quiet === true,
114
+ }),
115
+ };
@@ -1,28 +1,4 @@
1
- import type { CommandCtx, CommandSpec } from "../cli/spec/spec.js";
2
- import type { CommandContext } from "./shared/task-backend.js";
3
- export type FinishParsed = {
4
- taskIds: string[];
5
- author: string;
6
- body: string;
7
- result?: string;
8
- risk?: "low" | "med" | "high";
9
- breaking: boolean;
10
- commit?: string;
11
- force: boolean;
12
- commitFromComment: boolean;
13
- commitEmoji?: string;
14
- commitAllow: string[];
15
- commitAutoAllow: boolean;
16
- commitAllowTasks: boolean;
17
- commitRequireClean: boolean;
18
- statusCommit: boolean;
19
- statusCommitEmoji?: string;
20
- statusCommitAllow: string[];
21
- statusCommitAutoAllow: boolean;
22
- statusCommitRequireClean: boolean;
23
- confirmStatusCommit: boolean;
24
- quiet: boolean;
25
- };
26
- export declare const finishSpec: CommandSpec<FinishParsed>;
27
- export declare function makeRunFinishHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: FinishParsed) => Promise<number>;
1
+ export { finishSpec } from "./finish.spec.js";
2
+ export type { FinishParsed } from "./finish.spec.js";
3
+ export { makeRunFinishHandler } from "./finish.run.js";
28
4
  //# sourceMappingURL=finish.command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"finish.command.d.ts","sourceRoot":"","sources":["../../src/commands/finish.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI/D,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,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,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,wBAAwB,EAAE,OAAO,CAAC;IAClC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAQF,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,YAAY,CAsMhD,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IACrE,KAAK,UAAU,EAAE,GAAG,YAAY,KAAG,OAAO,CAAC,MAAM,CAAC,CAmCjE"}
1
+ {"version":3,"file":"finish.command.d.ts","sourceRoot":"","sources":["../../src/commands/finish.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,237 +1,2 @@
1
- import { usageError } from "../cli/spec/errors.js";
2
- import { cmdFinish } from "./task/finish.js";
3
- function toStringList(v) {
4
- if (typeof v === "string")
5
- return [v];
6
- if (Array.isArray(v))
7
- return v.filter((x) => typeof x === "string");
8
- return [];
9
- }
10
- export const finishSpec = {
11
- id: ["finish"],
12
- group: "Lifecycle",
13
- summary: "Mark task(s) as DONE and record a structured Verified comment.",
14
- args: [
15
- {
16
- name: "task-id",
17
- required: true,
18
- variadic: true,
19
- valueHint: "<task-id>",
20
- description: "One or more existing task ids.",
21
- },
22
- ],
23
- options: [
24
- {
25
- kind: "string",
26
- name: "author",
27
- valueHint: "<id>",
28
- required: true,
29
- description: "Comment author id (e.g. INTEGRATOR).",
30
- },
31
- {
32
- kind: "string",
33
- name: "body",
34
- valueHint: "<text>",
35
- required: true,
36
- description: "Structured comment body (must match the configured Verified: prefix).",
37
- },
38
- {
39
- kind: "string",
40
- name: "result",
41
- valueHint: "<one-line>",
42
- description: "One-line result summary stored in task metadata (required for non-spike tasks when finishing a single task).",
43
- },
44
- {
45
- kind: "string",
46
- name: "risk",
47
- valueHint: "<low|med|high>",
48
- choices: ["low", "med", "high"],
49
- description: "Optional. Risk level stored in task metadata.",
50
- },
51
- {
52
- kind: "boolean",
53
- name: "breaking",
54
- default: false,
55
- description: "Optional. Mark the change as breaking in task metadata.",
56
- },
57
- {
58
- kind: "string",
59
- name: "commit",
60
- valueHint: "<hash>",
61
- description: "Commit hash to record on the task (optional).",
62
- },
63
- { kind: "boolean", name: "force", default: false, description: "Force finish despite gates." },
64
- {
65
- kind: "boolean",
66
- name: "commit-from-comment",
67
- default: false,
68
- description: "Create a commit using the comment body (requires exactly one task id).",
69
- },
70
- {
71
- kind: "string",
72
- name: "commit-emoji",
73
- valueHint: "<emoji>",
74
- description: "Override the commit emoji (used with --commit-from-comment).",
75
- },
76
- {
77
- kind: "string",
78
- name: "commit-allow",
79
- valueHint: "<path-prefix>",
80
- repeatable: true,
81
- description: "Repeatable. Allowlist path prefixes to stage for the commit (used with --commit-from-comment).",
82
- },
83
- {
84
- kind: "boolean",
85
- name: "commit-auto-allow",
86
- default: false,
87
- description: "Auto-allow inferred allowlist paths if none are provided (used with --commit-from-comment).",
88
- },
89
- {
90
- kind: "boolean",
91
- name: "commit-allow-tasks",
92
- default: true,
93
- hidden: true,
94
- description: "Deprecated. Tasks are always allowed for status commits.",
95
- deprecated: "no-op",
96
- },
97
- {
98
- kind: "boolean",
99
- name: "commit-require-clean",
100
- default: false,
101
- description: "Require a clean working tree for the commit (used with --commit-from-comment).",
102
- },
103
- {
104
- kind: "boolean",
105
- name: "status-commit",
106
- default: false,
107
- description: "Create a separate status commit (requires exactly one task id).",
108
- },
109
- {
110
- kind: "string",
111
- name: "status-commit-emoji",
112
- valueHint: "<emoji>",
113
- description: "Override the status commit emoji (used with --status-commit).",
114
- },
115
- {
116
- kind: "string",
117
- name: "status-commit-allow",
118
- valueHint: "<path-prefix>",
119
- repeatable: true,
120
- description: "Repeatable. Allowlist path prefixes to stage for the status commit (used with --status-commit).",
121
- },
122
- {
123
- kind: "boolean",
124
- name: "status-commit-auto-allow",
125
- default: false,
126
- description: "Auto-allow inferred allowlist paths if none are provided (used with --status-commit).",
127
- },
128
- {
129
- kind: "boolean",
130
- name: "status-commit-require-clean",
131
- default: false,
132
- description: "Require a clean working tree for the status commit (used with --status-commit).",
133
- },
134
- {
135
- kind: "boolean",
136
- name: "confirm-status-commit",
137
- default: false,
138
- description: "Confirm status commit creation when status_commit_policy=confirm (used with --commit-from-comment or --status-commit).",
139
- },
140
- { kind: "boolean", name: "quiet", default: false, description: "Suppress output." },
141
- ],
142
- examples: [
143
- {
144
- cmd: 'agentplane finish 202602030608-F1Q8AB --author INTEGRATOR --body "Verified: all checks passed" --commit abcdef123456',
145
- why: "Finish a task and record commit metadata.",
146
- },
147
- {
148
- cmd: 'agentplane finish 202602030608-F1Q8AB --author INTEGRATOR --body "Verified: all checks passed" --commit-from-comment --commit-allow packages/agentplane/src',
149
- why: "Finish and create a commit from the comment (single-task only).",
150
- },
151
- ],
152
- validateRaw: (raw) => {
153
- const ids = raw.args["task-id"];
154
- const taskIds = Array.isArray(ids) ? ids : [];
155
- const commitFromComment = raw.opts["commit-from-comment"] === true;
156
- const statusCommit = raw.opts["status-commit"] === true;
157
- if ((commitFromComment || statusCommit) && taskIds.length !== 1) {
158
- throw usageError({
159
- spec: finishSpec,
160
- command: "finish",
161
- message: "--commit-from-comment/--status-commit requires exactly one task id",
162
- });
163
- }
164
- const hasMeta = typeof raw.opts.result === "string" ||
165
- typeof raw.opts.risk === "string" ||
166
- raw.opts.breaking === true;
167
- if (hasMeta && taskIds.length !== 1) {
168
- throw usageError({
169
- spec: finishSpec,
170
- command: "finish",
171
- message: "--result/--risk/--breaking requires exactly one task id",
172
- });
173
- }
174
- },
175
- parse: (raw) => ({
176
- taskIds: Array.isArray(raw.args["task-id"])
177
- ? raw.args["task-id"].filter((x) => typeof x === "string")
178
- : [],
179
- author: raw.opts.author,
180
- body: raw.opts.body,
181
- result: raw.opts.result,
182
- risk: raw.opts.risk,
183
- breaking: raw.opts.breaking === true,
184
- commit: raw.opts.commit,
185
- force: raw.opts.force === true,
186
- commitFromComment: raw.opts["commit-from-comment"] === true,
187
- commitEmoji: raw.opts["commit-emoji"],
188
- commitAllow: toStringList(raw.opts["commit-allow"]),
189
- commitAutoAllow: raw.opts["commit-auto-allow"] === true,
190
- commitAllowTasks: raw.opts["commit-allow-tasks"] !== false,
191
- commitRequireClean: raw.opts["commit-require-clean"] === true,
192
- statusCommit: raw.opts["status-commit"] === true,
193
- statusCommitEmoji: raw.opts["status-commit-emoji"],
194
- statusCommitAllow: toStringList(raw.opts["status-commit-allow"]),
195
- statusCommitAutoAllow: raw.opts["status-commit-auto-allow"] === true,
196
- statusCommitRequireClean: raw.opts["status-commit-require-clean"] === true,
197
- confirmStatusCommit: raw.opts["confirm-status-commit"] === true,
198
- quiet: raw.opts.quiet === true,
199
- }),
200
- };
201
- export function makeRunFinishHandler(getCtx) {
202
- return async (ctx, p) => {
203
- if (p.taskIds.length === 0) {
204
- throw usageError({
205
- spec: finishSpec,
206
- command: "finish",
207
- message: "Missing required argument: task-id",
208
- });
209
- }
210
- return await cmdFinish({
211
- ctx: await getCtx("finish"),
212
- cwd: ctx.cwd,
213
- rootOverride: ctx.rootOverride,
214
- taskIds: p.taskIds,
215
- author: p.author,
216
- body: p.body,
217
- result: p.result,
218
- risk: p.risk,
219
- breaking: p.breaking,
220
- commit: p.commit,
221
- force: p.force,
222
- commitFromComment: p.commitFromComment,
223
- commitEmoji: p.commitEmoji,
224
- commitAllow: p.commitAllow,
225
- commitAutoAllow: p.commitAutoAllow,
226
- commitAllowTasks: p.commitAllowTasks,
227
- commitRequireClean: p.commitRequireClean,
228
- statusCommit: p.statusCommit,
229
- statusCommitEmoji: p.statusCommitEmoji,
230
- statusCommitAllow: p.statusCommitAllow,
231
- statusCommitAutoAllow: p.statusCommitAutoAllow,
232
- statusCommitRequireClean: p.statusCommitRequireClean,
233
- confirmStatusCommit: p.confirmStatusCommit,
234
- quiet: p.quiet,
235
- });
236
- };
237
- }
1
+ export { finishSpec } from "./finish.spec.js";
2
+ export { makeRunFinishHandler } from "./finish.run.js";
@@ -0,0 +1,5 @@
1
+ import type { CommandCtx } from "../cli/spec/spec.js";
2
+ import type { CommandContext } from "./shared/task-backend.js";
3
+ import { type FinishParsed } from "./finish.spec.js";
4
+ export declare function makeRunFinishHandler(getCtx: (cmd: string) => Promise<CommandContext>): (ctx: CommandCtx, p: FinishParsed) => Promise<number>;
5
+ //# sourceMappingURL=finish.run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"finish.run.d.ts","sourceRoot":"","sources":["../../src/commands/finish.run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEjE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,IACrE,KAAK,UAAU,EAAE,GAAG,YAAY,KAAG,OAAO,CAAC,MAAM,CAAC,CAmCjE"}
@@ -0,0 +1,40 @@
1
+ import { usageError } from "../cli/spec/errors.js";
2
+ import { cmdFinish } from "./task/finish.js";
3
+ import { finishSpec } from "./finish.spec.js";
4
+ export function makeRunFinishHandler(getCtx) {
5
+ return async (ctx, p) => {
6
+ if (p.taskIds.length === 0) {
7
+ throw usageError({
8
+ spec: finishSpec,
9
+ command: "finish",
10
+ message: "Missing required argument: task-id",
11
+ });
12
+ }
13
+ return await cmdFinish({
14
+ ctx: await getCtx("finish"),
15
+ cwd: ctx.cwd,
16
+ rootOverride: ctx.rootOverride,
17
+ taskIds: p.taskIds,
18
+ author: p.author,
19
+ body: p.body,
20
+ result: p.result,
21
+ risk: p.risk,
22
+ breaking: p.breaking,
23
+ commit: p.commit,
24
+ force: p.force,
25
+ commitFromComment: p.commitFromComment,
26
+ commitEmoji: p.commitEmoji,
27
+ commitAllow: p.commitAllow,
28
+ commitAutoAllow: p.commitAutoAllow,
29
+ commitAllowTasks: p.commitAllowTasks,
30
+ commitRequireClean: p.commitRequireClean,
31
+ statusCommit: p.statusCommit,
32
+ statusCommitEmoji: p.statusCommitEmoji,
33
+ statusCommitAllow: p.statusCommitAllow,
34
+ statusCommitAutoAllow: p.statusCommitAutoAllow,
35
+ statusCommitRequireClean: p.statusCommitRequireClean,
36
+ confirmStatusCommit: p.confirmStatusCommit,
37
+ quiet: p.quiet,
38
+ });
39
+ };
40
+ }
@@ -0,0 +1,26 @@
1
+ import type { CommandSpec } from "../cli/spec/spec.js";
2
+ export type FinishParsed = {
3
+ taskIds: string[];
4
+ author: string;
5
+ body: string;
6
+ result?: string;
7
+ risk?: "low" | "med" | "high";
8
+ breaking: boolean;
9
+ commit?: string;
10
+ force: boolean;
11
+ commitFromComment: boolean;
12
+ commitEmoji?: string;
13
+ commitAllow: string[];
14
+ commitAutoAllow: boolean;
15
+ commitAllowTasks: boolean;
16
+ commitRequireClean: boolean;
17
+ statusCommit: boolean;
18
+ statusCommitEmoji?: string;
19
+ statusCommitAllow: string[];
20
+ statusCommitAutoAllow: boolean;
21
+ statusCommitRequireClean: boolean;
22
+ confirmStatusCommit: boolean;
23
+ quiet: boolean;
24
+ };
25
+ export declare const finishSpec: CommandSpec<FinishParsed>;
26
+ //# sourceMappingURL=finish.spec.d.ts.map