ai-foreman 1.7.5 → 1.7.6
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 +1 -1
- package/dist/branch/github.js +3 -2
- package/dist/branch/gitlab.js +3 -2
- package/dist/branch/planner.d.ts +5 -0
- package/dist/branch/planner.js +42 -3
- package/dist/buildRuns.d.ts +41 -17
- package/dist/buildRuns.js +243 -22
- package/dist/cli/start.js +104 -24
- package/dist/cli/tickets.d.ts +10 -1
- package/dist/cli/tickets.js +418 -79
- package/dist/foreman.d.ts +4 -4
- package/dist/foreman.js +35 -14
- package/dist/qaReview.d.ts +1 -0
- package/dist/qaReview.js +11 -6
- package/dist/tickets/details.d.ts +17 -0
- package/dist/tickets/details.js +94 -0
- package/dist/tickets/eligibility.d.ts +28 -0
- package/dist/tickets/eligibility.js +71 -0
- package/dist/tickets/reset.d.ts +27 -0
- package/dist/tickets/reset.js +213 -0
- package/dist/tickets/reviewStandards.d.ts +7 -0
- package/dist/tickets/reviewStandards.js +53 -0
- package/dist/tickets/setupConfig.d.ts +22 -0
- package/dist/tickets/setupConfig.js +105 -1
- package/dist/tickets/stateDb.d.ts +8 -1
- package/dist/tickets/stateDb.js +54 -23
- package/dist/workflowDb.d.ts +3 -0
- package/dist/workflowDb.js +26 -0
- package/package.json +7 -3
package/dist/workflowDb.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ export interface ProjectLease {
|
|
|
36
36
|
heartbeatAt: string;
|
|
37
37
|
runId: string;
|
|
38
38
|
}
|
|
39
|
+
/** Read the current project lease without creating or migrating recovery state. */
|
|
40
|
+
export declare function readCurrentWorkflowLease(projectDir: string): ProjectLease | undefined;
|
|
39
41
|
export interface PublicationTransaction {
|
|
40
42
|
transactionId: string;
|
|
41
43
|
runId: string;
|
|
@@ -63,6 +65,7 @@ export declare class WorkflowDb {
|
|
|
63
65
|
}, now?: Date): WorkflowRunSnapshot;
|
|
64
66
|
getRun(runId: string): WorkflowRunSnapshot | undefined;
|
|
65
67
|
activeRuns(): WorkflowRunSnapshot[];
|
|
68
|
+
resumableRuns(kind?: WorkflowKind): WorkflowRunSnapshot[];
|
|
66
69
|
transition(runId: string, update: {
|
|
67
70
|
status?: WorkflowRunStatus;
|
|
68
71
|
checkpoint: string;
|
package/dist/workflowDb.js
CHANGED
|
@@ -4,6 +4,26 @@ import { hostname } from "node:os";
|
|
|
4
4
|
import { dirname, join, resolve } from "node:path";
|
|
5
5
|
import Database from "better-sqlite3";
|
|
6
6
|
export const WORKFLOW_DB_FILE = ".rafi/recovery.sqlite3";
|
|
7
|
+
/** Read the current project lease without creating or migrating recovery state. */
|
|
8
|
+
export function readCurrentWorkflowLease(projectDir) {
|
|
9
|
+
const path = join(resolve(projectDir), WORKFLOW_DB_FILE);
|
|
10
|
+
if (!existsSync(path))
|
|
11
|
+
return undefined;
|
|
12
|
+
let db;
|
|
13
|
+
try {
|
|
14
|
+
db = new Database(path, { readonly: true, fileMustExist: true });
|
|
15
|
+
const row = db.prepare("SELECT * FROM project_lease WHERE singleton=1").get();
|
|
16
|
+
return row ? { owner: row.owner, generation: row.generation, pid: row.pid, host: row.host, processStart: row.process_start, heartbeatAt: row.heartbeat_at, runId: row.run_id } : undefined;
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
if (String(error).includes("no such table"))
|
|
20
|
+
return undefined;
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
finally {
|
|
24
|
+
db?.close();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
7
27
|
/** Authoritative persistence for every resumable workflow in a project. */
|
|
8
28
|
export class WorkflowDb {
|
|
9
29
|
projectDir;
|
|
@@ -43,6 +63,12 @@ export class WorkflowDb {
|
|
|
43
63
|
activeRuns() {
|
|
44
64
|
return this.db.prepare("SELECT * FROM workflow_runs WHERE status IN ('running','paused','blocked') ORDER BY created_at").all().map(rowToRun);
|
|
45
65
|
}
|
|
66
|
+
resumableRuns(kind) {
|
|
67
|
+
const rows = kind
|
|
68
|
+
? this.db.prepare("SELECT * FROM workflow_runs WHERE kind=? AND status NOT IN ('completed','cancelled','superseded') ORDER BY created_at").all(kind)
|
|
69
|
+
: this.db.prepare("SELECT * FROM workflow_runs WHERE status NOT IN ('completed','cancelled','superseded') ORDER BY created_at").all();
|
|
70
|
+
return rows.map(rowToRun);
|
|
71
|
+
}
|
|
46
72
|
transition(runId, update, now = new Date()) {
|
|
47
73
|
const at = now.toISOString();
|
|
48
74
|
return this.db.transaction(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-foreman",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.6",
|
|
4
4
|
"description": "An orchestrator that keeps Codex CLI / Claude Code builders moving through their step list unattended. Part of Rafi.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -73,6 +73,10 @@
|
|
|
73
73
|
"types": "./dist/tickets/setupConfig.d.ts",
|
|
74
74
|
"default": "./dist/tickets/setupConfig.js"
|
|
75
75
|
},
|
|
76
|
+
"./ticket-reset.js": {
|
|
77
|
+
"types": "./dist/tickets/reset.d.ts",
|
|
78
|
+
"default": "./dist/tickets/reset.js"
|
|
79
|
+
},
|
|
76
80
|
"./sources/source-registry.js": {
|
|
77
81
|
"types": "./dist/sources/sourceRegistry.d.ts",
|
|
78
82
|
"default": "./dist/sources/sourceRegistry.js"
|
|
@@ -126,8 +130,8 @@
|
|
|
126
130
|
"@anthropic-ai/claude-agent-sdk": "^0.3.148"
|
|
127
131
|
},
|
|
128
132
|
"dependencies": {
|
|
129
|
-
"special-agents": "0.8.
|
|
130
|
-
"rafi-spec": "0.8.
|
|
133
|
+
"special-agents": "0.8.4",
|
|
134
|
+
"rafi-spec": "0.8.4",
|
|
131
135
|
"@clack/prompts": "^1.4.0",
|
|
132
136
|
"ajv": "^8.20.0",
|
|
133
137
|
"ajv-formats": "^3.0.1",
|