reevesagents 2.1.0 → 2.2.1
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/CHANGELOG.md +21 -0
- package/README.md +232 -318
- package/dist/chunk-CJKEBBUI.js +7663 -0
- package/dist/{chunk-UEYJAKAZ.js → chunk-DGLUP7Q7.js} +2 -2
- package/dist/{chunk-PWYG5IM5.js → chunk-HTCENB3Q.js} +2 -2
- package/dist/chunk-PKMTELW4.js +115 -0
- package/dist/chunk-PVYM35RS.js +1697 -0
- package/dist/{chunk-OQJNBACW.js → chunk-QWUBYDUV.js} +2 -2
- package/dist/chunk-XEOWHTRQ.js +1246 -0
- package/dist/{chunk-KROKGL2R.js → chunk-XHP63Y64.js} +879 -2
- package/dist/cli.js +1099 -13
- package/dist/index.d.ts +5 -0
- package/dist/index.js +2 -2
- package/dist/{router-AYNTF24M.js → router-S7KR2CIE.js} +146 -79
- package/dist/{server-TIFQ5JSM.js → server-4OILK2LL.js} +344 -6
- package/dist/{server-BNBSZZIP.js → server-5U4NNV43.js} +305 -14
- package/dist/{tui-launch-7DBX4JYA.js → tui-launch-7WKLVYEH.js} +2 -2
- package/dist/web/app.css +444 -11
- package/dist/web/app.js +672 -21
- package/dist/web/favicon.png +0 -0
- package/dist/web/index.html +75 -0
- package/dist/web/insights-core.js +92 -0
- package/dist/web/plan-controller.js +91 -0
- package/dist/web/plan-error.js +81 -0
- package/dist/web/tick-line.js +78 -0
- package/package.json +10 -8
- package/dist/chunk-DLWYZPW6.js +0 -3222
- package/dist/chunk-YWS3MILO.js +0 -266
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
PROVIDER_DEFS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CJKEBBUI.js";
|
|
5
5
|
|
|
6
6
|
// src/core/model-catalog.ts
|
|
7
7
|
var PROVIDER_DEFAULT_MODEL = "";
|
|
@@ -27,4 +27,4 @@ export {
|
|
|
27
27
|
modelDisplayName,
|
|
28
28
|
modelSourceForProvider
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
30
|
+
//# sourceMappingURL=chunk-DGLUP7Q7.js.map
|
|
@@ -28,7 +28,7 @@ async function startTuiWebServer() {
|
|
|
28
28
|
const { checkWebExtras, webExtrasMessage } = await import("./extras-MWGWGEPB.js");
|
|
29
29
|
const extras = await checkWebExtras();
|
|
30
30
|
if (!extras.ok) throw new Error(webExtrasMessage(extras.missing));
|
|
31
|
-
const { startWebServer } = await import("./server-
|
|
31
|
+
const { startWebServer } = await import("./server-5U4NNV43.js");
|
|
32
32
|
return startWebServer({ open: true });
|
|
33
33
|
}
|
|
34
34
|
async function closeTuiWebServer() {
|
|
@@ -48,4 +48,4 @@ export {
|
|
|
48
48
|
startWebFromTui,
|
|
49
49
|
closeTuiWebServer
|
|
50
50
|
};
|
|
51
|
-
//# sourceMappingURL=chunk-
|
|
51
|
+
//# sourceMappingURL=chunk-HTCENB3Q.js.map
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
readGitHead,
|
|
4
|
+
readSpecFile
|
|
5
|
+
} from "./chunk-PVYM35RS.js";
|
|
6
|
+
import {
|
|
7
|
+
FlowStateError,
|
|
8
|
+
createFlowState,
|
|
9
|
+
displayPath,
|
|
10
|
+
flowExists,
|
|
11
|
+
flowPath,
|
|
12
|
+
isRunsLockTimeout,
|
|
13
|
+
listAgents,
|
|
14
|
+
listRuns,
|
|
15
|
+
readFlow,
|
|
16
|
+
removeNotesDir,
|
|
17
|
+
saveFlow,
|
|
18
|
+
withRunsLock
|
|
19
|
+
} from "./chunk-CJKEBBUI.js";
|
|
20
|
+
|
|
21
|
+
// src/core/flow-start.ts
|
|
22
|
+
function findRun(input) {
|
|
23
|
+
const wanted = input.trim();
|
|
24
|
+
if (!wanted) throw new FlowStateError("a run id is required");
|
|
25
|
+
const runs = listRuns();
|
|
26
|
+
const exact = runs.find((run) => run.id === wanted || run.name === wanted);
|
|
27
|
+
if (exact) return exact;
|
|
28
|
+
const matches = runs.filter((run) => run.id.startsWith(wanted) || run.name.startsWith(wanted));
|
|
29
|
+
if (matches.length === 1) return matches[0];
|
|
30
|
+
if (matches.length > 1) throw new FlowStateError(`ambiguous run id: ${matches.map((run) => run.id).join(", ")}`);
|
|
31
|
+
throw new FlowStateError(`run not found: ${wanted}`);
|
|
32
|
+
}
|
|
33
|
+
function findRunAgent(run, input, role) {
|
|
34
|
+
const wanted = input.trim();
|
|
35
|
+
if (!wanted) throw new FlowStateError(`a ${role} agent is required`);
|
|
36
|
+
const agents = listAgents(run.id);
|
|
37
|
+
const exact = agents.find((agent) => agent.id === wanted || agent.nickname === wanted);
|
|
38
|
+
if (exact) return exact;
|
|
39
|
+
const matches = agents.filter((agent) => agent.id.startsWith(wanted) || agent.nickname.startsWith(wanted));
|
|
40
|
+
if (matches.length === 1) return matches[0];
|
|
41
|
+
if (matches.length > 1) {
|
|
42
|
+
throw new FlowStateError(`ambiguous ${role} agent in run ${run.id}: ${matches.map((agent) => agent.id).join(", ")}`);
|
|
43
|
+
}
|
|
44
|
+
throw new FlowStateError(`no ${role} agent ${wanted} in run ${run.id} (agents there: ${agents.map((agent) => agent.id).join(", ") || "none"})`);
|
|
45
|
+
}
|
|
46
|
+
function readQueuedSpecs(paths, repo) {
|
|
47
|
+
const specs = [];
|
|
48
|
+
for (const path of paths) {
|
|
49
|
+
const spec = readSpecFile(path, { repo, existingIds: specs.map((entry) => entry.id) });
|
|
50
|
+
specs.push(spec);
|
|
51
|
+
}
|
|
52
|
+
return specs;
|
|
53
|
+
}
|
|
54
|
+
function startFlow(input, options = {}) {
|
|
55
|
+
const run = findRun(input.run_id);
|
|
56
|
+
const dev = findRunAgent(run, input.dev, "dev");
|
|
57
|
+
const review = findRunAgent(run, input.review, "review");
|
|
58
|
+
const repo = (input.repo ?? run.working_dir).trim();
|
|
59
|
+
if (!repo) {
|
|
60
|
+
throw new FlowStateError(`run ${run.id} has no working directory; pass a project directory`);
|
|
61
|
+
}
|
|
62
|
+
const head = options.head ?? readGitHead(repo);
|
|
63
|
+
if (!head) {
|
|
64
|
+
throw new FlowStateError(`cannot read HEAD in ${displayPath(repo)} (is it a git repository with a commit?)`);
|
|
65
|
+
}
|
|
66
|
+
const specs = input.specs?.length ? readQueuedSpecs(input.specs, repo) : [];
|
|
67
|
+
const at = input.at ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
68
|
+
try {
|
|
69
|
+
return withRunsLock(() => {
|
|
70
|
+
const existed = flowExists(run.id, { root: options.root });
|
|
71
|
+
if (existed) {
|
|
72
|
+
const existing = readFlow(run.id, { root: options.root });
|
|
73
|
+
const closed = existing.state === "escalated" || existing.state === "done";
|
|
74
|
+
if (!closed) {
|
|
75
|
+
throw new FlowStateError(
|
|
76
|
+
`run ${run.id} already has a flow in state ${existing.state} (${displayPath(flowPath(run.id, options.root))}); use \`flow status --run ${run.id}\`, or wait until it is escalated or done`
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
if (input.replace !== true) {
|
|
80
|
+
throw new FlowStateError(
|
|
81
|
+
`run ${run.id} has a closed flow (${existing.state}); pass --replace to start a new one on the same run`
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (existed) removeNotesDir(run.id, options.root);
|
|
86
|
+
const created = createFlowState({
|
|
87
|
+
run_id: run.id,
|
|
88
|
+
repo,
|
|
89
|
+
roles: { dev: dev.id, review: review.id },
|
|
90
|
+
head,
|
|
91
|
+
max_rounds: input.max_rounds,
|
|
92
|
+
review_timeout_sec: input.review_timeout_sec,
|
|
93
|
+
dev_timeout_sec: input.dev_timeout_sec,
|
|
94
|
+
dev_stall_max_attempts: input.dev_stall_max_attempts,
|
|
95
|
+
specs,
|
|
96
|
+
at
|
|
97
|
+
});
|
|
98
|
+
const state = {
|
|
99
|
+
...created,
|
|
100
|
+
log: [{ at, event: "flow_started", detail: `${head} ${specs.length} queued` }]
|
|
101
|
+
};
|
|
102
|
+
return { state, path: saveFlow(state, { root: options.root }), replaced: existed };
|
|
103
|
+
});
|
|
104
|
+
} catch (err) {
|
|
105
|
+
if (isRunsLockTimeout(err)) {
|
|
106
|
+
throw new FlowStateError("another reevesagents process is writing the state directory; try again");
|
|
107
|
+
}
|
|
108
|
+
throw err;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export {
|
|
113
|
+
startFlow
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=chunk-PKMTELW4.js.map
|