agentplane 0.2.5 โ†’ 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 (176) hide show
  1. package/README.md +11 -0
  2. package/assets/AGENTS.md +72 -40
  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/bin/agentplane.js +109 -1
  10. package/dist/cli/archive.d.ts.map +1 -1
  11. package/dist/cli/archive.js +61 -36
  12. package/dist/cli/command-guide.d.ts.map +1 -1
  13. package/dist/cli/command-guide.js +4 -2
  14. package/dist/cli/critical/cli-runner.d.ts +2 -0
  15. package/dist/cli/critical/cli-runner.d.ts.map +1 -0
  16. package/dist/cli/critical/cli-runner.js +11 -0
  17. package/dist/cli/critical/harness.d.ts +22 -0
  18. package/dist/cli/critical/harness.d.ts.map +1 -0
  19. package/dist/cli/critical/harness.js +164 -0
  20. package/dist/cli/run-cli/command-catalog.d.ts +4 -1
  21. package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
  22. package/dist/cli/run-cli/command-catalog.js +40 -22
  23. package/dist/cli/run-cli/commands/config.d.ts +5 -4
  24. package/dist/cli/run-cli/commands/config.d.ts.map +1 -1
  25. package/dist/cli/run-cli/commands/config.js +39 -29
  26. package/dist/cli/run-cli/commands/core.d.ts +2 -1
  27. package/dist/cli/run-cli/commands/core.d.ts.map +1 -1
  28. package/dist/cli/run-cli/commands/core.js +174 -67
  29. package/dist/cli/run-cli/commands/ide.d.ts +3 -1
  30. package/dist/cli/run-cli/commands/ide.d.ts.map +1 -1
  31. package/dist/cli/run-cli/commands/ide.js +7 -6
  32. package/dist/cli/run-cli/commands/init/git.d.ts.map +1 -1
  33. package/dist/cli/run-cli/commands/init/git.js +9 -7
  34. package/dist/cli/run-cli/commands/init/ide-sync.d.ts.map +1 -1
  35. package/dist/cli/run-cli/commands/init/ide-sync.js +10 -1
  36. package/dist/cli/run-cli/commands/init/write-agents.d.ts.map +1 -1
  37. package/dist/cli/run-cli/commands/init/write-agents.js +4 -24
  38. package/dist/cli/run-cli/commands/init/write-gitignore.d.ts +4 -0
  39. package/dist/cli/run-cli/commands/init/write-gitignore.d.ts.map +1 -0
  40. package/dist/cli/run-cli/commands/init/write-gitignore.js +35 -0
  41. package/dist/cli/run-cli/commands/init.d.ts +1 -0
  42. package/dist/cli/run-cli/commands/init.d.ts.map +1 -1
  43. package/dist/cli/run-cli/commands/init.js +32 -13
  44. package/dist/cli/run-cli/registry.run.d.ts +6 -2
  45. package/dist/cli/run-cli/registry.run.d.ts.map +1 -1
  46. package/dist/cli/run-cli/registry.run.js +7 -2
  47. package/dist/cli/run-cli.d.ts.map +1 -1
  48. package/dist/cli/run-cli.js +98 -76
  49. package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
  50. package/dist/cli/run-cli.test-helpers.js +99 -3
  51. package/dist/cli/spec/parse-utils.d.ts +11 -0
  52. package/dist/cli/spec/parse-utils.d.ts.map +1 -0
  53. package/dist/cli/spec/parse-utils.js +28 -0
  54. package/dist/commands/block.command.d.ts +3 -18
  55. package/dist/commands/block.command.d.ts.map +1 -1
  56. package/dist/commands/block.command.js +2 -143
  57. package/dist/commands/block.run.d.ts +5 -0
  58. package/dist/commands/block.run.d.ts.map +1 -0
  59. package/dist/commands/block.run.js +22 -0
  60. package/dist/commands/block.spec.d.ts +17 -0
  61. package/dist/commands/block.spec.d.ts.map +1 -0
  62. package/dist/commands/block.spec.js +115 -0
  63. package/dist/commands/finish.command.d.ts +3 -27
  64. package/dist/commands/finish.command.d.ts.map +1 -1
  65. package/dist/commands/finish.command.js +2 -237
  66. package/dist/commands/finish.run.d.ts +5 -0
  67. package/dist/commands/finish.run.d.ts.map +1 -0
  68. package/dist/commands/finish.run.js +40 -0
  69. package/dist/commands/finish.spec.d.ts +26 -0
  70. package/dist/commands/finish.spec.d.ts.map +1 -0
  71. package/dist/commands/finish.spec.js +193 -0
  72. package/dist/commands/guard/impl/comment-commit.d.ts +1 -0
  73. package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -1
  74. package/dist/commands/guard/impl/comment-commit.js +5 -1
  75. package/dist/commands/guard/impl/env.d.ts +2 -0
  76. package/dist/commands/guard/impl/env.d.ts.map +1 -1
  77. package/dist/commands/guard/impl/env.js +2 -0
  78. package/dist/commands/hooks/index.d.ts.map +1 -1
  79. package/dist/commands/hooks/index.js +42 -6
  80. package/dist/commands/recipes/impl/project.d.ts.map +1 -1
  81. package/dist/commands/recipes/impl/project.js +5 -3
  82. package/dist/commands/release/apply.command.d.ts +11 -0
  83. package/dist/commands/release/apply.command.d.ts.map +1 -0
  84. package/dist/commands/release/apply.command.js +343 -0
  85. package/dist/commands/release/plan.command.d.ts +12 -0
  86. package/dist/commands/release/plan.command.d.ts.map +1 -0
  87. package/dist/commands/release/plan.command.js +206 -0
  88. package/dist/commands/release/release.command.d.ts +5 -0
  89. package/dist/commands/release/release.command.d.ts.map +1 -0
  90. package/dist/commands/release/release.command.js +18 -0
  91. package/dist/commands/shared/git-ops.d.ts.map +1 -1
  92. package/dist/commands/shared/git-ops.js +7 -2
  93. package/dist/commands/shared/task-backend.d.ts +1 -0
  94. package/dist/commands/shared/task-backend.d.ts.map +1 -1
  95. package/dist/commands/start.command.d.ts +3 -18
  96. package/dist/commands/start.command.d.ts.map +1 -1
  97. package/dist/commands/start.command.js +2 -143
  98. package/dist/commands/start.run.d.ts +5 -0
  99. package/dist/commands/start.run.d.ts.map +1 -0
  100. package/dist/commands/start.run.js +22 -0
  101. package/dist/commands/start.spec.d.ts +17 -0
  102. package/dist/commands/start.spec.d.ts.map +1 -0
  103. package/dist/commands/start.spec.js +115 -0
  104. package/dist/commands/task/add.command.d.ts.map +1 -1
  105. package/dist/commands/task/add.command.js +1 -7
  106. package/dist/commands/task/block.d.ts.map +1 -1
  107. package/dist/commands/task/block.js +21 -3
  108. package/dist/commands/task/derive.command.d.ts.map +1 -1
  109. package/dist/commands/task/derive.command.js +1 -7
  110. package/dist/commands/task/finish.d.ts.map +1 -1
  111. package/dist/commands/task/finish.js +29 -1
  112. package/dist/commands/task/list.command.d.ts +3 -8
  113. package/dist/commands/task/list.command.d.ts.map +1 -1
  114. package/dist/commands/task/list.command.js +2 -67
  115. package/dist/commands/task/list.run.d.ts +5 -0
  116. package/dist/commands/task/list.run.d.ts.map +1 -0
  117. package/dist/commands/task/list.run.js +10 -0
  118. package/dist/commands/task/list.spec.d.ts +7 -0
  119. package/dist/commands/task/list.spec.d.ts.map +1 -0
  120. package/dist/commands/task/list.spec.js +51 -0
  121. package/dist/commands/task/next.command.d.ts +3 -8
  122. package/dist/commands/task/next.command.d.ts.map +1 -1
  123. package/dist/commands/task/next.command.js +2 -89
  124. package/dist/commands/task/next.run.d.ts +5 -0
  125. package/dist/commands/task/next.run.d.ts.map +1 -0
  126. package/dist/commands/task/next.run.js +11 -0
  127. package/dist/commands/task/next.spec.d.ts +7 -0
  128. package/dist/commands/task/next.spec.d.ts.map +1 -0
  129. package/dist/commands/task/next.spec.js +69 -0
  130. package/dist/commands/task/search.command.d.ts +3 -10
  131. package/dist/commands/task/search.command.d.ts.map +1 -1
  132. package/dist/commands/task/search.command.js +2 -101
  133. package/dist/commands/task/search.run.d.ts +5 -0
  134. package/dist/commands/task/search.run.d.ts.map +1 -0
  135. package/dist/commands/task/search.run.js +13 -0
  136. package/dist/commands/task/search.spec.d.ts +9 -0
  137. package/dist/commands/task/search.spec.d.ts.map +1 -0
  138. package/dist/commands/task/search.spec.js +79 -0
  139. package/dist/commands/task/set-status.command.d.ts.map +1 -1
  140. package/dist/commands/task/set-status.command.js +1 -7
  141. package/dist/commands/task/shared.d.ts +1 -0
  142. package/dist/commands/task/shared.d.ts.map +1 -1
  143. package/dist/commands/task/shared.js +20 -8
  144. package/dist/commands/task/show.command.d.ts +3 -7
  145. package/dist/commands/task/show.command.d.ts.map +1 -1
  146. package/dist/commands/task/show.command.js +2 -19
  147. package/dist/commands/task/show.run.d.ts +5 -0
  148. package/dist/commands/task/show.run.d.ts.map +1 -0
  149. package/dist/commands/task/show.run.js +11 -0
  150. package/dist/commands/task/show.spec.d.ts +6 -0
  151. package/dist/commands/task/show.spec.d.ts.map +1 -0
  152. package/dist/commands/task/show.spec.js +8 -0
  153. package/dist/commands/task/start.d.ts.map +1 -1
  154. package/dist/commands/task/start.js +21 -3
  155. package/dist/commands/task/update.command.d.ts.map +1 -1
  156. package/dist/commands/task/update.command.js +1 -7
  157. package/dist/commands/upgrade.d.ts.map +1 -1
  158. package/dist/commands/upgrade.js +149 -31
  159. package/dist/commands/verify.command.d.ts +3 -15
  160. package/dist/commands/verify.command.d.ts.map +1 -1
  161. package/dist/commands/verify.command.js +2 -113
  162. package/dist/commands/verify.run.d.ts +5 -0
  163. package/dist/commands/verify.run.d.ts.map +1 -0
  164. package/dist/commands/verify.run.js +17 -0
  165. package/dist/commands/verify.spec.d.ts +14 -0
  166. package/dist/commands/verify.spec.d.ts.map +1 -0
  167. package/dist/commands/verify.spec.js +96 -0
  168. package/dist/policy/rules/commit-subject.d.ts.map +1 -1
  169. package/dist/policy/rules/commit-subject.js +1 -13
  170. package/dist/shared/agent-emoji.d.ts +5 -0
  171. package/dist/shared/agent-emoji.d.ts.map +1 -0
  172. package/dist/shared/agent-emoji.js +50 -0
  173. package/dist/shared/direct-work-lock.d.ts +10 -0
  174. package/dist/shared/direct-work-lock.d.ts.map +1 -0
  175. package/dist/shared/direct-work-lock.js +24 -0
  176. package/package.json +2 -2
@@ -0,0 +1,96 @@
1
+ import { usageError } from "../cli/spec/errors.js";
2
+ export const verifySpec = {
3
+ id: ["verify"],
4
+ group: "Lifecycle",
5
+ summary: "Record a verification outcome for a task (record-only; does not execute commands).",
6
+ args: [
7
+ {
8
+ name: "task-id",
9
+ required: true,
10
+ valueHint: "<task-id>",
11
+ description: "Existing task id.",
12
+ },
13
+ ],
14
+ options: [
15
+ {
16
+ kind: "boolean",
17
+ name: "ok",
18
+ default: false,
19
+ description: "Record an OK verification outcome.",
20
+ },
21
+ {
22
+ kind: "boolean",
23
+ name: "rework",
24
+ default: false,
25
+ description: "Record a needs-rework verification outcome.",
26
+ },
27
+ {
28
+ kind: "string",
29
+ name: "by",
30
+ valueHint: "<id>",
31
+ required: true,
32
+ description: "Verifier id (e.g. REVIEWER).",
33
+ },
34
+ {
35
+ kind: "string",
36
+ name: "note",
37
+ valueHint: "<text>",
38
+ required: true,
39
+ description: "Short note describing the verification outcome.",
40
+ },
41
+ {
42
+ kind: "string",
43
+ name: "details",
44
+ valueHint: "<text>",
45
+ description: "Optional free-form details (mutually exclusive with --file).",
46
+ },
47
+ {
48
+ kind: "string",
49
+ name: "file",
50
+ valueHint: "<path>",
51
+ description: "Read details from a file path (mutually exclusive with --details).",
52
+ },
53
+ { kind: "boolean", name: "quiet", default: false, description: "Suppress output." },
54
+ ],
55
+ examples: [
56
+ {
57
+ cmd: 'agentplane verify 202602030608-F1Q8AB --ok --by REVIEWER --note "Looks good" --quiet',
58
+ why: "Record an OK verification outcome.",
59
+ },
60
+ {
61
+ cmd: 'agentplane verify 202602030608-F1Q8AB --rework --by REVIEWER --note "Needs changes" --details "Missing tests"',
62
+ why: "Record a needs-rework outcome with details.",
63
+ },
64
+ ],
65
+ validateRaw: (raw) => {
66
+ const ok = raw.opts.ok === true;
67
+ const rework = raw.opts.rework === true;
68
+ if (ok === rework) {
69
+ throw usageError({
70
+ spec: verifySpec,
71
+ command: "verify",
72
+ message: "Exactly one of --ok or --rework must be provided.",
73
+ });
74
+ }
75
+ if (typeof raw.opts.details === "string" && typeof raw.opts.file === "string") {
76
+ throw usageError({
77
+ spec: verifySpec,
78
+ command: "verify",
79
+ message: "Options --details and --file are mutually exclusive.",
80
+ });
81
+ }
82
+ },
83
+ parse: (raw) => {
84
+ const ok = raw.opts.ok === true;
85
+ const state = ok ? "ok" : "needs_rework";
86
+ return {
87
+ taskId: typeof raw.args["task-id"] === "string" ? raw.args["task-id"] : "",
88
+ state,
89
+ by: raw.opts.by,
90
+ note: raw.opts.note,
91
+ details: raw.opts.details,
92
+ file: raw.opts.file,
93
+ quiet: raw.opts.quiet === true,
94
+ };
95
+ },
96
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"commit-subject.d.ts","sourceRoot":"","sources":["../../../src/policy/rules/commit-subject.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE/D,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,YAAY,CAkClE"}
1
+ {"version":3,"file":"commit-subject.d.ts","sourceRoot":"","sources":["../../../src/policy/rules/commit-subject.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE/D,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,YAAY,CAmBlE"}
@@ -5,21 +5,9 @@ export function commitSubjectRule(ctx) {
5
5
  if (!subject) {
6
6
  return { ok: false, errors: [gitError("Commit message subject is empty")], warnings: [] };
7
7
  }
8
- const taskId = (ctx.taskId ?? "").trim();
9
- if (!taskId) {
10
- return {
11
- ok: false,
12
- errors: [
13
- gitError(ctx.action === "hook_commit_msg"
14
- ? "AGENTPLANE_TASK_ID is required (use `agentplane commit ...`)"
15
- : "Task id is required for commit subject validation"),
16
- ],
17
- warnings: [],
18
- };
19
- }
20
8
  const policy = validateCommitSubject({
21
9
  subject,
22
- taskId,
10
+ taskId: (ctx.taskId ?? "").trim() || undefined,
23
11
  genericTokens: ctx.config.commit.generic_tokens,
24
12
  });
25
13
  if (!policy.ok) {
@@ -0,0 +1,5 @@
1
+ export declare function resolveCommitEmojiForAgent(opts: {
2
+ agentsDirAbs: string;
3
+ agentId: string;
4
+ }): Promise<string>;
5
+ //# sourceMappingURL=agent-emoji.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-emoji.d.ts","sourceRoot":"","sources":["../../src/shared/agent-emoji.ts"],"names":[],"mappings":"AAmCA,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBlB"}
@@ -0,0 +1,50 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { fileExists } from "../cli/fs-utils.js";
4
+ const FALLBACK_EMOJIS = ["๐Ÿงญ", "๐Ÿง ", "๐Ÿ—๏ธ", "๐Ÿงช", "๐Ÿ› ๏ธ", "๐Ÿ”ง", "๐Ÿงฉ", "๐Ÿ”", "๐Ÿ“ฆ"];
5
+ const WELL_KNOWN_AGENT_EMOJI = {
6
+ ORCHESTRATOR: "๐Ÿงญ",
7
+ PLANNER: "๐Ÿง ",
8
+ CREATOR: "๐Ÿ—๏ธ",
9
+ INTEGRATOR: "๐Ÿงฉ",
10
+ TESTER: "๐Ÿงช",
11
+ CODER: "๐Ÿ› ๏ธ",
12
+ };
13
+ function stableHash32(input) {
14
+ // Simple, stable FNV-1a 32-bit hash (good enough for deterministic emoji selection).
15
+ // FNV-1a offset basis / prime in decimal to avoid numeric-separator style lint quirks.
16
+ let h = 2_166_136_261;
17
+ for (const ch of input) {
18
+ const cp = ch.codePointAt(0) ?? 0;
19
+ h ^= cp;
20
+ h = Math.imul(h, 16_777_619);
21
+ }
22
+ return h >>> 0;
23
+ }
24
+ function fallbackEmojiForAgentId(agentId) {
25
+ const wellKnown = WELL_KNOWN_AGENT_EMOJI[agentId];
26
+ if (wellKnown)
27
+ return wellKnown;
28
+ const idx = stableHash32(agentId) % FALLBACK_EMOJIS.length;
29
+ return FALLBACK_EMOJIS[idx] ?? "๐Ÿงฉ";
30
+ }
31
+ export async function resolveCommitEmojiForAgent(opts) {
32
+ const agentId = opts.agentId.trim();
33
+ if (!agentId)
34
+ return "๐Ÿงฉ";
35
+ // Allow users to override the emoji per agent by adding `commit_emoji` to the agent json file.
36
+ const agentPath = path.join(opts.agentsDirAbs, `${agentId}.json`);
37
+ if (await fileExists(agentPath)) {
38
+ try {
39
+ const text = await readFile(agentPath, "utf8");
40
+ const parsed = JSON.parse(text);
41
+ const emoji = parsed && typeof parsed.commit_emoji === "string" ? parsed.commit_emoji.trim() : "";
42
+ if (emoji)
43
+ return emoji;
44
+ }
45
+ catch {
46
+ // ignore; fallback below
47
+ }
48
+ }
49
+ return fallbackEmojiForAgentId(agentId);
50
+ }
@@ -0,0 +1,10 @@
1
+ export type DirectWorkLock = {
2
+ task_id: string;
3
+ agent: string;
4
+ slug: string;
5
+ branch: string;
6
+ started_at: string;
7
+ };
8
+ export declare function directWorkLockPath(agentplaneDir: string): string;
9
+ export declare function readDirectWorkLock(agentplaneDir: string): Promise<DirectWorkLock | null>;
10
+ //# sourceMappingURL=direct-work-lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"direct-work-lock.d.ts","sourceRoot":"","sources":["../../src/shared/direct-work-lock.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wBAAsB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAkB9F"}
@@ -0,0 +1,24 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import path from "node:path";
3
+ export function directWorkLockPath(agentplaneDir) {
4
+ return path.join(agentplaneDir, "cache", "direct-work.json");
5
+ }
6
+ export async function readDirectWorkLock(agentplaneDir) {
7
+ try {
8
+ const text = await readFile(directWorkLockPath(agentplaneDir), "utf8");
9
+ const parsed = JSON.parse(text);
10
+ if (!parsed || typeof parsed !== "object")
11
+ return null;
12
+ if (typeof parsed.task_id !== "string" ||
13
+ typeof parsed.agent !== "string" ||
14
+ typeof parsed.slug !== "string" ||
15
+ typeof parsed.branch !== "string" ||
16
+ typeof parsed.started_at !== "string") {
17
+ return null;
18
+ }
19
+ return parsed;
20
+ }
21
+ catch {
22
+ return null;
23
+ }
24
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentplane",
3
- "version": "0.2.5",
3
+ "version": "0.2.12",
4
4
  "description": "Agent Plane CLI for task workflows, recipes, and project automation.",
5
5
  "keywords": [
6
6
  "agentplane",
@@ -54,7 +54,7 @@
54
54
  "prepublishOnly": "npm run prepack"
55
55
  },
56
56
  "dependencies": {
57
- "@agentplaneorg/core": "0.2.5",
57
+ "@agentplaneorg/core": "0.2.6",
58
58
  "yauzl": "^2.10.0"
59
59
  },
60
60
  "devDependencies": {