sequant 1.20.3 → 2.0.0

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 (137) hide show
  1. package/.claude-plugin/marketplace.json +2 -4
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +29 -9
  4. package/dist/bin/cli.js +25 -2
  5. package/dist/src/commands/doctor.js +42 -9
  6. package/dist/src/commands/init.d.ts +1 -0
  7. package/dist/src/commands/init.js +52 -0
  8. package/dist/src/commands/logs.d.ts +1 -0
  9. package/dist/src/commands/logs.js +18 -2
  10. package/dist/src/commands/run.d.ts +7 -0
  11. package/dist/src/commands/run.js +235 -68
  12. package/dist/src/commands/serve.d.ts +13 -0
  13. package/dist/src/commands/serve.js +131 -0
  14. package/dist/src/commands/stats.d.ts +1 -0
  15. package/dist/src/commands/stats.js +185 -26
  16. package/dist/src/commands/status.d.ts +2 -0
  17. package/dist/src/commands/status.js +99 -50
  18. package/dist/src/index.d.ts +2 -2
  19. package/dist/src/index.js +4 -1
  20. package/dist/src/lib/ac-parser.d.ts +2 -0
  21. package/dist/src/lib/ac-parser.js +12 -2
  22. package/dist/src/lib/assess-comment-parser.d.ts +137 -0
  23. package/dist/src/lib/assess-comment-parser.js +344 -0
  24. package/dist/src/lib/ci/config.d.ts +22 -0
  25. package/dist/src/lib/ci/config.js +134 -0
  26. package/dist/src/lib/ci/index.d.ts +12 -0
  27. package/dist/src/lib/ci/index.js +10 -0
  28. package/dist/src/lib/ci/inputs.d.ts +29 -0
  29. package/dist/src/lib/ci/inputs.js +103 -0
  30. package/dist/src/lib/ci/labels.d.ts +34 -0
  31. package/dist/src/lib/ci/labels.js +101 -0
  32. package/dist/src/lib/ci/outputs.d.ts +25 -0
  33. package/dist/src/lib/ci/outputs.js +84 -0
  34. package/dist/src/lib/ci/triggers.d.ts +9 -0
  35. package/dist/src/lib/ci/triggers.js +86 -0
  36. package/dist/src/lib/ci/types.d.ts +131 -0
  37. package/dist/src/lib/ci/types.js +47 -0
  38. package/dist/src/lib/mcp-config.d.ts +54 -0
  39. package/dist/src/lib/mcp-config.js +172 -0
  40. package/dist/src/lib/merge-check/index.js +6 -12
  41. package/dist/src/lib/merge-check/types.d.ts +20 -7
  42. package/dist/src/lib/merge-check/types.js +11 -0
  43. package/dist/src/lib/phase-signal.d.ts +3 -3
  44. package/dist/src/lib/phase-signal.js +5 -3
  45. package/dist/src/lib/settings.d.ts +52 -0
  46. package/dist/src/lib/settings.js +41 -0
  47. package/dist/src/lib/shutdown.d.ts +16 -5
  48. package/dist/src/lib/shutdown.js +32 -12
  49. package/dist/src/lib/solve-comment-parser.d.ts +9 -102
  50. package/dist/src/lib/solve-comment-parser.js +13 -248
  51. package/dist/src/lib/stacks.d.ts +8 -0
  52. package/dist/src/lib/stacks.js +34 -0
  53. package/dist/src/lib/system.js +3 -7
  54. package/dist/src/lib/test-tautology-detector.d.ts +10 -0
  55. package/dist/src/lib/test-tautology-detector.js +43 -4
  56. package/dist/src/lib/upstream/assessment.js +9 -59
  57. package/dist/src/lib/upstream/issues.js +12 -75
  58. package/dist/src/lib/version-check.d.ts +2 -2
  59. package/dist/src/lib/version-check.js +6 -3
  60. package/dist/src/lib/version.d.ts +4 -0
  61. package/dist/src/lib/version.js +25 -0
  62. package/dist/src/lib/workflow/batch-executor.d.ts +18 -86
  63. package/dist/src/lib/workflow/batch-executor.js +232 -55
  64. package/dist/src/lib/workflow/drivers/agent-driver.d.ts +56 -0
  65. package/dist/src/lib/workflow/drivers/agent-driver.js +8 -0
  66. package/dist/src/lib/workflow/drivers/aider.d.ts +18 -0
  67. package/dist/src/lib/workflow/drivers/aider.js +160 -0
  68. package/dist/src/lib/workflow/drivers/claude-code.d.ts +17 -0
  69. package/dist/src/lib/workflow/drivers/claude-code.js +165 -0
  70. package/dist/src/lib/workflow/drivers/index.d.ts +20 -0
  71. package/dist/src/lib/workflow/drivers/index.js +27 -0
  72. package/dist/src/lib/workflow/error-classifier.d.ts +16 -0
  73. package/dist/src/lib/workflow/error-classifier.js +90 -0
  74. package/dist/src/lib/workflow/log-writer.d.ts +6 -3
  75. package/dist/src/lib/workflow/log-writer.js +57 -27
  76. package/dist/src/lib/workflow/metrics-schema.d.ts +9 -9
  77. package/dist/src/lib/workflow/phase-detection.d.ts +23 -0
  78. package/dist/src/lib/workflow/phase-detection.js +45 -29
  79. package/dist/src/lib/workflow/phase-executor.d.ts +42 -3
  80. package/dist/src/lib/workflow/phase-executor.js +340 -220
  81. package/dist/src/lib/workflow/phase-mapper.d.ts +1 -1
  82. package/dist/src/lib/workflow/phase-mapper.js +7 -7
  83. package/dist/src/lib/workflow/platforms/github.d.ts +157 -0
  84. package/dist/src/lib/workflow/platforms/github.js +466 -0
  85. package/dist/src/lib/workflow/platforms/index.d.ts +17 -0
  86. package/dist/src/lib/workflow/platforms/index.js +25 -0
  87. package/dist/src/lib/workflow/platforms/platform-provider.d.ts +67 -0
  88. package/dist/src/lib/workflow/platforms/platform-provider.js +8 -0
  89. package/dist/src/lib/workflow/pr-status.d.ts +2 -4
  90. package/dist/src/lib/workflow/pr-status.js +3 -16
  91. package/dist/src/lib/workflow/qa-cache.d.ts +58 -0
  92. package/dist/src/lib/workflow/qa-cache.js +88 -0
  93. package/dist/src/lib/workflow/reconcile.d.ts +69 -0
  94. package/dist/src/lib/workflow/reconcile.js +290 -0
  95. package/dist/src/lib/workflow/ring-buffer.d.ts +17 -0
  96. package/dist/src/lib/workflow/ring-buffer.js +37 -0
  97. package/dist/src/lib/workflow/run-log-schema.d.ts +115 -24
  98. package/dist/src/lib/workflow/run-log-schema.js +47 -12
  99. package/dist/src/lib/workflow/run-reflect.js +1 -1
  100. package/dist/src/lib/workflow/state-cleanup.js +21 -0
  101. package/dist/src/lib/workflow/state-manager.d.ts +34 -3
  102. package/dist/src/lib/workflow/state-manager.js +278 -126
  103. package/dist/src/lib/workflow/state-schema.d.ts +34 -30
  104. package/dist/src/lib/workflow/state-schema.js +35 -25
  105. package/dist/src/lib/workflow/state-utils.d.ts +3 -1
  106. package/dist/src/lib/workflow/state-utils.js +1 -0
  107. package/dist/src/lib/workflow/types.d.ts +208 -6
  108. package/dist/src/lib/workflow/types.js +20 -1
  109. package/dist/src/lib/workflow/worktree-discovery.d.ts +1 -1
  110. package/dist/src/lib/workflow/worktree-discovery.js +6 -14
  111. package/dist/src/lib/workflow/worktree-manager.js +33 -51
  112. package/dist/src/mcp/index.d.ts +4 -0
  113. package/dist/src/mcp/index.js +4 -0
  114. package/dist/src/mcp/resources.d.ts +7 -0
  115. package/dist/src/mcp/resources.js +111 -0
  116. package/dist/src/mcp/run-registry.d.ts +34 -0
  117. package/dist/src/mcp/run-registry.js +42 -0
  118. package/dist/src/mcp/server.d.ts +12 -0
  119. package/dist/src/mcp/server.js +50 -0
  120. package/dist/src/mcp/tools/logs.d.ts +7 -0
  121. package/dist/src/mcp/tools/logs.js +149 -0
  122. package/dist/src/mcp/tools/run.d.ts +121 -0
  123. package/dist/src/mcp/tools/run.js +591 -0
  124. package/dist/src/mcp/tools/status.d.ts +7 -0
  125. package/dist/src/mcp/tools/status.js +127 -0
  126. package/package.json +10 -1
  127. package/templates/hooks/post-tool.sh +19 -8
  128. package/templates/hooks/pre-tool.sh +36 -49
  129. package/templates/mcp.json +6 -0
  130. package/templates/skills/assess/SKILL.md +354 -352
  131. package/templates/skills/exec/SKILL.md +64 -1
  132. package/templates/skills/fullsolve/SKILL.md +35 -4
  133. package/templates/skills/qa/SKILL.md +486 -9
  134. package/templates/skills/qa/scripts/quality-checks.sh +1 -1
  135. package/templates/skills/setup/SKILL.md +386 -0
  136. package/templates/skills/solve/SKILL.md +38 -664
  137. package/templates/skills/spec/SKILL.md +90 -31
@@ -2,9 +2,9 @@
2
2
  * Main assessment module for upstream analysis
3
3
  * Coordinates release fetching, analysis, and output generation
4
4
  */
5
- import { spawn } from "node:child_process";
6
5
  import { readFile, writeFile, access, mkdir } from "node:fs/promises";
7
6
  import { dirname, join } from "node:path";
7
+ import { GitHubProvider } from "../workflow/platforms/github.js";
8
8
  import { analyzeRelease, getActionableFindings } from "./relevance.js";
9
9
  import { calculateSummary, generateAssessmentReport, generateBatchedSummaryReport, generateLocalReport, } from "./report.js";
10
10
  import { createAssessmentIssue, createOrLinkFinding } from "./issues.js";
@@ -22,62 +22,28 @@ export function validateVersion(version) {
22
22
  throw new Error(`Invalid version format: "${version}". Expected semver format (e.g., v1.2.3 or 1.2.3-beta.1)`);
23
23
  }
24
24
  }
25
- /**
26
- * Execute a command safely using spawn with argument arrays
27
- * This prevents command injection by not using shell interpolation
28
- */
29
- async function execCommand(command, args) {
30
- return new Promise((resolve, reject) => {
31
- const proc = spawn(command, args, { stdio: ["pipe", "pipe", "pipe"] });
32
- let stdout = "";
33
- let stderr = "";
34
- proc.stdout.on("data", (data) => {
35
- stdout += data.toString();
36
- });
37
- proc.stderr.on("data", (data) => {
38
- stderr += data.toString();
39
- });
40
- proc.on("close", (code) => {
41
- if (code === 0) {
42
- resolve({ stdout, stderr });
43
- }
44
- else {
45
- reject(new Error(`Command failed with exit code ${code}: ${stderr}`));
46
- }
47
- });
48
- proc.on("error", (err) => {
49
- reject(err);
50
- });
51
- });
52
- }
25
+ /** Shared GitHubProvider instance for upstream gh CLI calls. */
26
+ const ghProvider = new GitHubProvider();
53
27
  /**
54
28
  * Check if gh CLI is available and authenticated
55
29
  * @returns Object with availability status and error message if not available
56
30
  */
57
31
  export async function checkGhCliAvailable() {
58
- try {
59
- // Check if gh is installed
60
- await execCommand("gh", ["--version"]);
61
- }
62
- catch {
32
+ if (!ghProvider.checkGhInstalledSync()) {
63
33
  return {
64
34
  available: false,
65
35
  authenticated: false,
66
36
  error: "GitHub CLI (gh) is not installed. Install from: https://cli.github.com/",
67
37
  };
68
38
  }
69
- try {
70
- // Check if gh is authenticated
71
- await execCommand("gh", ["auth", "status"]);
72
- return { available: true, authenticated: true };
73
- }
74
- catch {
39
+ if (!ghProvider.checkAuthSync()) {
75
40
  return {
76
41
  available: true,
77
42
  authenticated: false,
78
43
  error: "GitHub CLI is not authenticated. Run: gh auth login",
79
44
  };
80
45
  }
46
+ return { available: true, authenticated: true };
81
47
  }
82
48
  /**
83
49
  * Default paths for upstream files
@@ -93,14 +59,8 @@ export async function fetchRelease(version) {
93
59
  if (version) {
94
60
  validateVersion(version);
95
61
  }
96
- // Build args array safely - no shell interpolation
97
- const args = ["release", "view"];
98
- if (version) {
99
- args.push(version);
100
- }
101
- args.push("--repo", "anthropics/claude-code", "--json", "tagName,name,body,publishedAt");
102
- const { stdout } = await execCommand("gh", args);
103
- return JSON.parse(stdout);
62
+ const data = ghProvider.fetchReleaseSync("anthropics/claude-code", version);
63
+ return data;
104
64
  }
105
65
  catch (error) {
106
66
  console.error("Error fetching release:", error);
@@ -116,17 +76,7 @@ export async function listReleases(limit = 50) {
116
76
  if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
117
77
  throw new Error("Limit must be an integer between 1 and 100");
118
78
  }
119
- const { stdout } = await execCommand("gh", [
120
- "release",
121
- "list",
122
- "--repo",
123
- "anthropics/claude-code",
124
- "--limit",
125
- String(limit),
126
- "--json",
127
- "tagName,publishedAt",
128
- ]);
129
- return JSON.parse(stdout);
79
+ return ghProvider.listReleasesSync("anthropics/claude-code", limit);
130
80
  }
131
81
  catch (error) {
132
82
  console.error("Error listing releases:", error);
@@ -5,10 +5,10 @@
5
5
  * Security: All gh CLI calls use spawn() with argument arrays to prevent
6
6
  * command injection. No shell interpolation is used.
7
7
  */
8
- import { spawn } from "node:child_process";
9
8
  import { writeFile, unlink } from "node:fs/promises";
10
9
  import { tmpdir } from "node:os";
11
10
  import { join } from "node:path";
11
+ import { GitHubProvider } from "../workflow/platforms/github.js";
12
12
  import { generateFindingIssue } from "./report.js";
13
13
  /**
14
14
  * Regex pattern for valid GitHub owner/repo names
@@ -26,34 +26,8 @@ function validateRepoParams(owner, repo) {
26
26
  throw new Error(`Invalid repo name: "${repo}"`);
27
27
  }
28
28
  }
29
- /**
30
- * Execute a command safely using spawn with argument arrays
31
- * This prevents command injection by not using shell interpolation
32
- */
33
- async function execCommand(command, args) {
34
- return new Promise((resolve, reject) => {
35
- const proc = spawn(command, args, { stdio: ["pipe", "pipe", "pipe"] });
36
- let stdout = "";
37
- let stderr = "";
38
- proc.stdout.on("data", (data) => {
39
- stdout += data.toString();
40
- });
41
- proc.stderr.on("data", (data) => {
42
- stderr += data.toString();
43
- });
44
- proc.on("close", (code) => {
45
- if (code === 0) {
46
- resolve({ stdout, stderr });
47
- }
48
- else {
49
- reject(new Error(`Command failed with exit code ${code}: ${stderr}`));
50
- }
51
- });
52
- proc.on("error", (err) => {
53
- reject(err);
54
- });
55
- });
56
- }
29
+ /** Shared GitHubProvider instance for upstream gh CLI calls. */
30
+ const ghProvider = new GitHubProvider();
57
31
  /**
58
32
  * Check if a similar upstream issue already exists
59
33
  */
@@ -61,24 +35,8 @@ export async function checkForDuplicate(title, owner = "sequant-io", repo = "seq
61
35
  try {
62
36
  validateRepoParams(owner, repo);
63
37
  // Search for existing upstream issues with similar title
64
- // Extract key terms from title for search
65
38
  const searchTerms = extractSearchTerms(title);
66
- // Use spawn with argument arrays - no shell interpolation
67
- const { stdout } = await execCommand("gh", [
68
- "issue",
69
- "list",
70
- "--repo",
71
- `${owner}/${repo}`,
72
- "--label",
73
- "upstream",
74
- "--search",
75
- searchTerms,
76
- "--json",
77
- "number,title",
78
- "--limit",
79
- "10",
80
- ]);
81
- const issues = JSON.parse(stdout);
39
+ const issues = ghProvider.searchIssuesSync(`${owner}/${repo}`, ["upstream"], searchTerms, 10);
82
40
  // Check for similarity
83
41
  for (const issue of issues) {
84
42
  if (isSimilarTitle(title, issue.title)) {
@@ -158,27 +116,11 @@ export async function createIssue(params, owner = "sequant-io", repo = "sequant"
158
116
  const tempFile = join(tmpdir(), `gh-issue-body-${Date.now()}.md`);
159
117
  try {
160
118
  await writeFile(tempFile, params.body, "utf-8");
161
- // Build args array
162
- const args = [
163
- "issue",
164
- "create",
165
- "--repo",
166
- `${owner}/${repo}`,
167
- "--title",
168
- params.title,
169
- "--body-file",
170
- tempFile,
171
- ];
172
- // Add labels
173
- for (const label of params.labels) {
174
- args.push("--label", label);
119
+ const result = ghProvider.createIssueWithBodyFileSync(`${owner}/${repo}`, params.title, tempFile, params.labels);
120
+ if (!result) {
121
+ throw new Error("Failed to create issue");
175
122
  }
176
- const { stdout } = await execCommand("gh", args);
177
- // Parse issue URL from output
178
- const url = stdout.trim();
179
- const numberMatch = url.match(/\/issues\/(\d+)$/);
180
- const number = numberMatch ? parseInt(numberMatch[1], 10) : 0;
181
- return { number, url };
123
+ return result;
182
124
  }
183
125
  finally {
184
126
  // Clean up temp file
@@ -203,15 +145,10 @@ export async function addIssueComment(issueNumber, comment, owner = "sequant-io"
203
145
  const tempFile = join(tmpdir(), `gh-comment-${Date.now()}.md`);
204
146
  try {
205
147
  await writeFile(tempFile, comment, "utf-8");
206
- await execCommand("gh", [
207
- "issue",
208
- "comment",
209
- String(issueNumber),
210
- "--repo",
211
- `${owner}/${repo}`,
212
- "--body-file",
213
- tempFile,
214
- ]);
148
+ const success = ghProvider.commentOnIssueWithBodyFileSync(`${owner}/${repo}`, issueNumber, tempFile);
149
+ if (!success) {
150
+ throw new Error(`Failed to comment on issue #${issueNumber}`);
151
+ }
215
152
  }
216
153
  finally {
217
154
  // Clean up temp file
@@ -66,8 +66,8 @@ export declare function isOutdated(currentVersion: string, latestVersion: string
66
66
  /**
67
67
  * Get the version warning message
68
68
  *
69
- * For local node_modules installs, recommends `npm update sequant`
70
- * For npx usage, recommends `npx sequant@latest`
69
+ * For local node_modules installs, recommends the correct update command
70
+ * for the project's package manager. For npx usage, recommends `npx sequant@latest`.
71
71
  */
72
72
  export declare function getVersionWarning(currentVersion: string, latestVersion: string, isLocal?: boolean): string;
73
73
  /**
@@ -7,6 +7,7 @@
7
7
  import fs from "fs";
8
8
  import path from "path";
9
9
  import { fileURLToPath } from "url";
10
+ import { detectPackageManagerSync, getPackageManagerCommands, } from "./stacks.js";
10
11
  const __filename = fileURLToPath(import.meta.url);
11
12
  const __dirname = path.dirname(__filename);
12
13
  const PACKAGE_NAME = "sequant";
@@ -178,14 +179,16 @@ export function isOutdated(currentVersion, latestVersion) {
178
179
  /**
179
180
  * Get the version warning message
180
181
  *
181
- * For local node_modules installs, recommends `npm update sequant`
182
- * For npx usage, recommends `npx sequant@latest`
182
+ * For local node_modules installs, recommends the correct update command
183
+ * for the project's package manager. For npx usage, recommends `npx sequant@latest`.
183
184
  */
184
185
  export function getVersionWarning(currentVersion, latestVersion, isLocal) {
185
186
  const isLocalInstall = isLocal ?? isLocalNodeModulesInstall();
186
187
  if (isLocalInstall) {
188
+ const pm = detectPackageManagerSync();
189
+ const pmConfig = getPackageManagerCommands(pm);
187
190
  return `sequant ${latestVersion} is available (you have ${currentVersion})
188
- Run: npm update sequant
191
+ Run: ${pmConfig.updatePkg} sequant
189
192
  Note: You have sequant as a local dependency. npx uses your node_modules version.`;
190
193
  }
191
194
  return `sequant ${latestVersion} is available (you have ${currentVersion})
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Version utility - reads version from package.json
3
+ */
4
+ export declare function getVersion(): string;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Version utility - reads version from package.json
3
+ */
4
+ import { fileURLToPath } from "url";
5
+ import { dirname, resolve } from "path";
6
+ import { readFileSync } from "fs";
7
+ export function getVersion() {
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ let dir = __dirname;
10
+ while (dir !== dirname(dir)) {
11
+ const candidate = resolve(dir, "package.json");
12
+ try {
13
+ const content = readFileSync(candidate, "utf-8");
14
+ const pkg = JSON.parse(content);
15
+ if (pkg.name === "sequant") {
16
+ return pkg.version;
17
+ }
18
+ }
19
+ catch {
20
+ // Not found, continue searching
21
+ }
22
+ dir = dirname(dir);
23
+ }
24
+ return "0.0.0";
25
+ }
@@ -7,87 +7,22 @@
7
7
  * (including quality-loop retries, checkpoint commits, rebasing, and PR
8
8
  * creation).
9
9
  */
10
- import { LogWriter } from "./log-writer.js";
11
- import { StateManager } from "./state-manager.js";
12
- import { ExecutionConfig, IssueResult } from "./types.js";
13
- import { ShutdownManager } from "../shutdown.js";
14
- import type { WorktreeInfo } from "./worktree-manager.js";
15
- export interface RunOptions {
16
- phases?: string;
17
- sequential?: boolean;
18
- dryRun?: boolean;
19
- verbose?: boolean;
20
- timeout?: number;
21
- logJson?: boolean;
22
- noLog?: boolean;
23
- logPath?: string;
24
- qualityLoop?: boolean;
25
- maxIterations?: number;
26
- batch?: string[];
27
- smartTests?: boolean;
28
- noSmartTests?: boolean;
29
- testgen?: boolean;
30
- autoDetectPhases?: boolean;
31
- /** Enable automatic worktree creation for issue isolation */
32
- worktreeIsolation?: boolean;
33
- /** Reuse existing worktrees instead of creating new ones */
34
- reuseWorktrees?: boolean;
35
- /** Suppress version warnings and non-essential output */
36
- quiet?: boolean;
37
- /** Chain issues: each branches from previous (requires --sequential) */
38
- chain?: boolean;
39
- /**
40
- * Wait for QA pass before starting next issue in chain mode.
41
- * When enabled, the chain pauses if QA fails, preventing downstream issues
42
- * from building on potentially broken code.
43
- */
44
- qaGate?: boolean;
45
- /**
46
- * Base branch for worktree creation.
47
- * Resolution priority: this CLI flag → settings.run.defaultBase → 'main'
48
- */
49
- base?: string;
50
- /**
51
- * Disable MCP servers in headless mode.
52
- * When true, MCPs are not passed to the SDK (faster/cheaper runs).
53
- * Resolution priority: this CLI flag → settings.run.mcp → default (true)
54
- */
55
- noMcp?: boolean;
56
- /**
57
- * Resume from last completed phase.
58
- * Reads phase markers from GitHub issue comments and skips completed phases.
59
- */
60
- resume?: boolean;
61
- /**
62
- * Disable automatic retry with MCP fallback.
63
- * When true, no retry attempts are made on phase failure.
64
- * Useful for debugging to see the actual failure without retry masking it.
65
- */
66
- noRetry?: boolean;
67
- /**
68
- * Skip pre-PR rebase onto the base branch.
69
- * When true, branches are not rebased before creating the PR.
70
- * Use when you want to preserve branch state or handle rebasing manually.
71
- */
72
- noRebase?: boolean;
73
- /**
74
- * Skip PR creation after successful QA.
75
- * When true, branches are pushed but no PR is created.
76
- * Useful for manual workflows where PRs are created separately.
77
- */
78
- noPr?: boolean;
79
- /**
80
- * Force re-execution of issues even if they have completed status.
81
- * Bypasses the pre-flight state guard that skips ready_for_merge/merged issues.
82
- */
83
- force?: boolean;
84
- /**
85
- * Analyze run results and suggest workflow improvements.
86
- * Displays observations about timing patterns, phase mismatches, and
87
- * actionable suggestions after the summary output.
88
- */
89
- reflect?: boolean;
90
- }
10
+ import { IssueResult, type RunOptions, type IssueExecutionContext, type BatchExecutionContext } from "./types.js";
11
+ export type { RunOptions, ProgressCallback, IssueExecutionContext, BatchExecutionContext, } from "./types.js";
12
+ /**
13
+ * Emit a structured progress line to stderr for MCP progress notifications.
14
+ * Only emits when running under an orchestrator (e.g., MCP server).
15
+ * The MCP handler parses these lines to send `notifications/progress`.
16
+ *
17
+ * @param issue - GitHub issue number
18
+ * @param phase - Phase name (e.g., "spec", "exec", "qa")
19
+ * @param event - Phase lifecycle event: "start", "complete", or "failed"
20
+ * @param extra - Optional fields: durationSeconds (on complete), error (on failed)
21
+ */
22
+ export declare function emitProgressLine(issue: number, phase: string, event?: "start" | "complete" | "failed", extra?: {
23
+ durationSeconds?: number;
24
+ error?: string;
25
+ }): void;
91
26
  export declare function getIssueInfo(issueNumber: number): Promise<{
92
27
  title: string;
93
28
  labels: string[];
@@ -110,8 +45,5 @@ export declare function parseBatches(batchArgs: string[]): number[][];
110
45
  * Parse environment variables for CI configuration
111
46
  */
112
47
  export declare function getEnvConfig(): Partial<RunOptions>;
113
- export declare function executeBatch(issueNumbers: number[], config: ExecutionConfig, logWriter: LogWriter | null, stateManager: StateManager | null, options: RunOptions, issueInfoMap: Map<number, {
114
- title: string;
115
- labels: string[];
116
- }>, worktreeMap: Map<number, WorktreeInfo>, shutdownManager?: ShutdownManager, packageManager?: string, baseBranch?: string): Promise<IssueResult[]>;
117
- export declare function runIssueWithLogging(issueNumber: number, config: ExecutionConfig, logWriter: LogWriter | null, stateManager: StateManager | null, issueTitle: string, labels: string[], options: RunOptions, worktreePath?: string, branch?: string, shutdownManager?: ShutdownManager, chainMode?: boolean, packageManager?: string, isLastInChain?: boolean, baseBranch?: string): Promise<IssueResult>;
48
+ export declare function executeBatch(issueNumbers: number[], batchCtx: BatchExecutionContext): Promise<IssueResult[]>;
49
+ export declare function runIssueWithLogging(ctx: IssueExecutionContext): Promise<IssueResult>;