@arcfoundry/cli 0.2.1 → 0.2.3
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.
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { timestampId } from "../parsing/ids.js";
|
|
3
3
|
import { formatExecuteResult } from "../result-format.js";
|
|
4
|
+
import { executeProgressReporter } from "./execute-progress.js";
|
|
4
5
|
export async function runExecuteCommand(args, dependencies) {
|
|
5
6
|
const request = args.requireFlag("--request");
|
|
6
7
|
const repoRoot = path.resolve(dependencies.cwd(), args.readFlag("--repo-root") ?? ".");
|
|
7
8
|
const runtime = parseExecuteRuntime(args.readFlag("--runtime") ?? "opencode");
|
|
8
9
|
const requestId = args.readFlag("--request-id") ?? timestampId("req", dependencies.now());
|
|
9
|
-
dependencies.
|
|
10
|
+
dependencies.stdout(`Starting Arc Foundry ${runtime} agency execution ${requestId} in ${repoRoot}`);
|
|
11
|
+
const onProgress = executeProgressReporter(dependencies.stdout);
|
|
10
12
|
const result = runtime === "opencode"
|
|
11
13
|
? await dependencies.runAgencyExecution({
|
|
12
14
|
repoRoot,
|
|
13
15
|
projectId: "arc-foundry",
|
|
14
16
|
requestId,
|
|
15
17
|
clientRequest: request,
|
|
18
|
+
onProgress,
|
|
16
19
|
})
|
|
17
20
|
: await dependencies.runLocalAgencyExecution({
|
|
18
21
|
repoRoot,
|
|
19
22
|
projectId: "arc-foundry",
|
|
20
23
|
requestId,
|
|
21
24
|
clientRequest: request,
|
|
25
|
+
onProgress,
|
|
22
26
|
});
|
|
27
|
+
dependencies.stdout("Final execution result:");
|
|
23
28
|
dependencies.stdout(JSON.stringify(formatExecuteResult(result, runtime), null, 2));
|
|
24
29
|
return result.status === "passed" ? 0 : 1;
|
|
25
30
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type AgencyExecutionOptions } from "@arcfoundry/core";
|
|
2
|
+
type ProgressEvent = Parameters<NonNullable<AgencyExecutionOptions["onProgress"]>>[0];
|
|
3
|
+
export declare function executeProgressLine(event: ProgressEvent): string;
|
|
4
|
+
export declare function executeProgressReporter(write: (message: string) => void): (event: ProgressEvent) => void;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export function executeProgressLine(event) {
|
|
2
|
+
switch (event.type) {
|
|
3
|
+
case "context-started":
|
|
4
|
+
return "Preparing governed agency context...";
|
|
5
|
+
case "context-ready":
|
|
6
|
+
return `Run workspace ready: ${event.runDir}`;
|
|
7
|
+
case "adr-started":
|
|
8
|
+
return "Retrieving ADRs and project memory evidence...";
|
|
9
|
+
case "adr-ready":
|
|
10
|
+
return "Governance evidence recorded.";
|
|
11
|
+
case "stage-started":
|
|
12
|
+
return `Starting stage: ${event.stage.stage} (${event.stage.agent})`;
|
|
13
|
+
case "stage-completed":
|
|
14
|
+
return `Completed stage: ${event.stage.stage}`;
|
|
15
|
+
case "stage-failed":
|
|
16
|
+
return `Failed stage: ${event.stage.stage} - ${event.result.parsingError ?? "see artifacts"}`;
|
|
17
|
+
case "final-gates-started":
|
|
18
|
+
return "Running final verification gates...";
|
|
19
|
+
case "final-command-completed":
|
|
20
|
+
return `Command completed: ${event.command.command} (exit ${event.command.exitCode})`;
|
|
21
|
+
case "completed":
|
|
22
|
+
return `Agency execution ${event.status}.`;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export function executeProgressReporter(write) {
|
|
26
|
+
return (event) => write(executeProgressLine(event));
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcfoundry/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Command line interface for the Arc Foundry governed agentic web agency runtime.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"bin": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"access": "public"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@arcfoundry/core": "0.2.
|
|
18
|
+
"@arcfoundry/core": "0.2.3"
|
|
19
19
|
},
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": "^25.9.0"
|