@thaodangspace/argos 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +51 -2
- package/dist/args.d.ts +21 -0
- package/dist/args.d.ts.map +1 -0
- package/dist/args.js +94 -0
- package/dist/args.js.map +1 -0
- package/dist/commands/actions.d.ts +13 -0
- package/dist/commands/actions.d.ts.map +1 -0
- package/dist/commands/actions.js +112 -0
- package/dist/commands/actions.js.map +1 -0
- package/dist/commands/db.d.ts +12 -0
- package/dist/commands/db.d.ts.map +1 -0
- package/dist/commands/db.js +122 -0
- package/dist/commands/db.js.map +1 -0
- package/dist/commands/doctor.d.ts +12 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +213 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/run.d.ts +5 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +78 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/runs.d.ts +7 -0
- package/dist/commands/runs.d.ts.map +1 -0
- package/dist/commands/runs.js +146 -0
- package/dist/commands/runs.js.map +1 -0
- package/dist/commands/schedule.d.ts +15 -0
- package/dist/commands/schedule.d.ts.map +1 -0
- package/dist/commands/schedule.js +337 -0
- package/dist/commands/schedule.js.map +1 -0
- package/dist/commands/serve.d.ts +37 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +340 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/validate.d.ts +23 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +185 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/commands/worktree.d.ts +11 -0
- package/dist/commands/worktree.d.ts.map +1 -0
- package/dist/commands/worktree.js +92 -0
- package/dist/commands/worktree.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +41 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +5 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +66 -0
- package/dist/main.js.map +1 -0
- package/dist/output.d.ts +50 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +203 -0
- package/dist/output.js.map +1 -0
- package/dist/rpc-command.d.ts +12 -0
- package/dist/rpc-command.d.ts.map +1 -0
- package/dist/rpc-command.js +34 -0
- package/dist/rpc-command.js.map +1 -0
- package/dist/ui-dir.d.ts +23 -0
- package/dist/ui-dir.d.ts.map +1 -0
- package/dist/ui-dir.js +51 -0
- package/dist/ui-dir.js.map +1 -0
- package/package.json +53 -4
- package/ui/_app/immutable/assets/0.Y-Ej83kR.css +1 -0
- package/ui/_app/immutable/assets/2.D2FEqQBh.css +1 -0
- package/ui/_app/immutable/assets/3.CI7aeD9i.css +1 -0
- package/ui/_app/immutable/assets/StartRunDialog.BbbZvJfB.css +1 -0
- package/ui/_app/immutable/assets/runs.CU5wtnW2.css +1 -0
- package/ui/_app/immutable/chunks/BKHbyffl.js +3 -0
- package/ui/_app/immutable/chunks/BeG5AxKI.js +3 -0
- package/ui/_app/immutable/chunks/Beqi9dRN.js +72 -0
- package/ui/_app/immutable/chunks/Buwi_lQz.js +2 -0
- package/ui/_app/immutable/chunks/CV2Ptlrp.js +1 -0
- package/ui/_app/immutable/chunks/CtbaNJav.js +1 -0
- package/ui/_app/immutable/chunks/D8sQwgC_.js +55 -0
- package/ui/_app/immutable/chunks/DclECHGd.js +1 -0
- package/ui/_app/immutable/entry/app.DPg5reEl.js +2 -0
- package/ui/_app/immutable/entry/payload.DSmR2FwN.js +1 -0
- package/ui/_app/immutable/entry/start.iWBP-EvH.js +2 -0
- package/ui/_app/immutable/nodes/0.Cu8SyVzm.js +1 -0
- package/ui/_app/immutable/nodes/1.Bga_qdeZ.js +1 -0
- package/ui/_app/immutable/nodes/2.CKNrkmzJ.js +1 -0
- package/ui/_app/immutable/nodes/3.OrFQ8OoI.js +1 -0
- package/ui/_app/version.json +1 -0
- package/ui/build.json +5 -0
- package/ui/index.html +45 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `argos doctor` (FR25, NFR Observability) — works with and without a running server.
|
|
3
|
+
*
|
|
4
|
+
* Without a server it reports what it can read safely: the storage path and modes, the configured
|
|
5
|
+
* port, the Node runtime check, and "not reachable" for the daemon. With a server it adds the live
|
|
6
|
+
* `GET /info` view (schema version, actual port, pid, Paseo reachability, provider catalog, pending
|
|
7
|
+
* gates, run counters). It **never** opens SQLite: the database is a `stat` at most.
|
|
8
|
+
*/
|
|
9
|
+
import { existsSync, statSync } from "node:fs";
|
|
10
|
+
import { resolve } from "node:path";
|
|
11
|
+
import { argosHome, dbPath } from "@thaodangspace/argos-core";
|
|
12
|
+
import { ARGOS_SCHEMA_VERSION, DEFAULT_ARGOS_PORT, RpcClient, RpcClientError, } from "@thaodangspace/argos-core/rpc";
|
|
13
|
+
import { flag, rejectUnknownFlags } from "../args.js";
|
|
14
|
+
import { EXIT_OK, EXIT_RUNTIME, REQUIRED_NODE_VERSION, nodeVersionOk, printJson, } from "../output.js";
|
|
15
|
+
function configuredPort(value) {
|
|
16
|
+
const raw = value ?? process.env["ARGOS_PORT"];
|
|
17
|
+
if (raw === undefined)
|
|
18
|
+
return DEFAULT_ARGOS_PORT;
|
|
19
|
+
const parsed = Number.parseInt(raw, 10);
|
|
20
|
+
return Number.isInteger(parsed) && parsed >= 0 ? parsed : DEFAULT_ARGOS_PORT;
|
|
21
|
+
}
|
|
22
|
+
function mode(path) {
|
|
23
|
+
try {
|
|
24
|
+
return statSync(path).mode & 0o777;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function describeServer(report) {
|
|
31
|
+
if (!report.server.reachable)
|
|
32
|
+
return `${report.server.url} (not reachable)`;
|
|
33
|
+
const pid = report.server.pid === undefined ? "" : `, pid ${report.server.pid}`;
|
|
34
|
+
return `${report.server.url} (reachable${pid})`;
|
|
35
|
+
}
|
|
36
|
+
function describePaseo(report) {
|
|
37
|
+
const modeLabel = report.paseo.mode === "fake" ? ", fake" : "";
|
|
38
|
+
if (report.paseo.reachable) {
|
|
39
|
+
return `${report.paseo.url ?? "default"} (reachable${modeLabel})`;
|
|
40
|
+
}
|
|
41
|
+
return report.paseo.error === undefined
|
|
42
|
+
? "not reachable"
|
|
43
|
+
: `not reachable (${report.paseo.error})`;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* FR9: every registered executor with its reachability, its version when it reports one, and the
|
|
47
|
+
* adapter's error when it is down. `paseo (default, reachable), hc (not reachable: …)`.
|
|
48
|
+
*/
|
|
49
|
+
function describeExecutors(executors) {
|
|
50
|
+
if (executors.length === 0)
|
|
51
|
+
return "none";
|
|
52
|
+
return executors
|
|
53
|
+
.map((executor) => {
|
|
54
|
+
const flags = [
|
|
55
|
+
...(executor.default ? ["default"] : []),
|
|
56
|
+
executor.reachable
|
|
57
|
+
? "reachable"
|
|
58
|
+
: `not reachable${executor.error === undefined ? "" : `: ${executor.error}`}`,
|
|
59
|
+
...(executor.version === undefined ? [] : [`v${executor.version}`]),
|
|
60
|
+
];
|
|
61
|
+
return `${executor.id} (${flags.join(", ")})`;
|
|
62
|
+
})
|
|
63
|
+
.join(", ");
|
|
64
|
+
}
|
|
65
|
+
function humanReport(report) {
|
|
66
|
+
const homeMode = report.storage.homeMode === undefined ? "" : ` (${octal(report.storage.homeMode)})`;
|
|
67
|
+
const dbMode = report.storage.dbMode === undefined ? " (not created yet)" : ` (${octal(report.storage.dbMode)})`;
|
|
68
|
+
const lines = [
|
|
69
|
+
`argos doctor`,
|
|
70
|
+
` node v${report.node.version} (requires ${report.node.required})`,
|
|
71
|
+
` home ${report.home}${homeMode}`,
|
|
72
|
+
` storage ${report.storage.path}${report.storage.exists ? dbMode : " (missing)"}`,
|
|
73
|
+
` schema v${report.schemaVersion}`,
|
|
74
|
+
` port ${report.port}`,
|
|
75
|
+
` server ${describeServer(report)}`,
|
|
76
|
+
` paseo ${describePaseo(report)}`,
|
|
77
|
+
` providers ${report.providers.map((provider) => provider.provider).join(", ") || "none"}`,
|
|
78
|
+
];
|
|
79
|
+
// FR9: the executor line only exists when the server answered (it owns the registry).
|
|
80
|
+
if (report.executors !== undefined) {
|
|
81
|
+
lines.push(` executors ${describeExecutors(report.executors)}`);
|
|
82
|
+
}
|
|
83
|
+
lines.push(` gates ${report.pendingGates.length} pending`, ` runs ${report.runs.total} total (${report.runs.active} active)`);
|
|
84
|
+
// FR10.3: the schedules line only exists when the server answered.
|
|
85
|
+
const schedules = report.checks.find((check) => check.name === "schedules");
|
|
86
|
+
if (schedules !== undefined)
|
|
87
|
+
lines.push(` schedules ${schedules.detail}`);
|
|
88
|
+
return lines.join("\n");
|
|
89
|
+
}
|
|
90
|
+
function octal(value) {
|
|
91
|
+
return `0${value.toString(8)}`;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* FR10.3: the scheduler's health, as `checks[]` sees it. The report schema does not change — this
|
|
95
|
+
* is one more entry. A refused last fire of an enabled schedule is the one thing that turns the
|
|
96
|
+
* entry red, and the detail always carries the counts plus the earliest upcoming fire.
|
|
97
|
+
*/
|
|
98
|
+
function schedulesCheck(schedules, error) {
|
|
99
|
+
if (schedules === undefined) {
|
|
100
|
+
return { name: "schedules", ok: false, detail: error ?? "cannot list schedules" };
|
|
101
|
+
}
|
|
102
|
+
const enabled = schedules.filter((schedule) => schedule.enabled);
|
|
103
|
+
const paused = schedules.length - enabled.length;
|
|
104
|
+
const refused = enabled.filter((schedule) => schedule.lastFire?.status === "refused").length;
|
|
105
|
+
const upcoming = enabled.flatMap((schedule) => schedule.nextFireAt === null ? [] : [schedule.nextFireAt]);
|
|
106
|
+
const earliest = upcoming.length === 0 ? undefined : Math.min(...upcoming);
|
|
107
|
+
return {
|
|
108
|
+
name: "schedules",
|
|
109
|
+
ok: refused === 0,
|
|
110
|
+
detail: `${enabled.length} enabled, ${paused} paused, ${refused} refused;` +
|
|
111
|
+
` next ${earliest === undefined ? "-" : new Date(earliest).toISOString()}`,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
export async function doctorCommand(args, io) {
|
|
115
|
+
const unknown = rejectUnknownFlags(args, ["home", "port"]);
|
|
116
|
+
if (unknown !== undefined) {
|
|
117
|
+
io.stderr(`argos: ${unknown}\n`);
|
|
118
|
+
return EXIT_RUNTIME;
|
|
119
|
+
}
|
|
120
|
+
const version = process.versions.node;
|
|
121
|
+
if (!nodeVersionOk(version)) {
|
|
122
|
+
io.stderr(`argos: Node ${version} is too old; Argos needs ${REQUIRED_NODE_VERSION} (built-in SQLite)\n`);
|
|
123
|
+
return EXIT_RUNTIME;
|
|
124
|
+
}
|
|
125
|
+
const homeFlag = flag(args, "home");
|
|
126
|
+
const home = resolve(homeFlag ?? argosHome());
|
|
127
|
+
const port = configuredPort(flag(args, "port"));
|
|
128
|
+
const storagePath = dbPath(home);
|
|
129
|
+
const storageExists = existsSync(storagePath);
|
|
130
|
+
let info;
|
|
131
|
+
let serverError;
|
|
132
|
+
const client = new RpcClient({ home, url: `http://127.0.0.1:${port}` });
|
|
133
|
+
try {
|
|
134
|
+
info = await client.info();
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
serverError =
|
|
138
|
+
error instanceof RpcClientError
|
|
139
|
+
? error.unreachable
|
|
140
|
+
? "argos serve is not running"
|
|
141
|
+
: `${error.code}: ${error.message}`
|
|
142
|
+
: String(error);
|
|
143
|
+
}
|
|
144
|
+
// FR10.3: only meaningful while the server answers; a failed call (an older server, a blip)
|
|
145
|
+
// is reported in the check and never breaks the rest of the report.
|
|
146
|
+
let schedules;
|
|
147
|
+
let schedulesError;
|
|
148
|
+
if (info !== undefined) {
|
|
149
|
+
try {
|
|
150
|
+
schedules = (await client.listSchedules()).schedules;
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
schedulesError =
|
|
154
|
+
error instanceof RpcClientError ? `${error.code}: ${error.message}` : String(error);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const checks = [
|
|
158
|
+
{ name: "node", ok: true, detail: `v${version} (requires ${REQUIRED_NODE_VERSION})` },
|
|
159
|
+
{
|
|
160
|
+
name: "storage",
|
|
161
|
+
ok: true,
|
|
162
|
+
detail: storageExists ? storagePath : `${storagePath} (not created yet)`,
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: "server",
|
|
166
|
+
ok: info !== undefined,
|
|
167
|
+
detail: info === undefined ? (serverError ?? "not reachable") : `pid ${info.pid}`,
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: "paseo",
|
|
171
|
+
ok: info?.paseo.reachable === true,
|
|
172
|
+
detail: info?.paseo.reachable === true ? "reachable" : (info?.paseo.error ?? "not reachable"),
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: "gates",
|
|
176
|
+
ok: (info?.pendingGates.length ?? 0) === 0,
|
|
177
|
+
detail: `${info?.pendingGates.length ?? 0} pending`,
|
|
178
|
+
},
|
|
179
|
+
];
|
|
180
|
+
if (info !== undefined)
|
|
181
|
+
checks.push(schedulesCheck(schedules, schedulesError));
|
|
182
|
+
const report = {
|
|
183
|
+
node: { version, required: REQUIRED_NODE_VERSION, ok: true },
|
|
184
|
+
home,
|
|
185
|
+
storage: {
|
|
186
|
+
path: storagePath,
|
|
187
|
+
exists: storageExists,
|
|
188
|
+
...(mode(home) === undefined ? {} : { homeMode: mode(home) }),
|
|
189
|
+
...(mode(storagePath) === undefined ? {} : { dbMode: mode(storagePath) }),
|
|
190
|
+
},
|
|
191
|
+
schemaVersion: info?.schemaVersion ?? ARGOS_SCHEMA_VERSION,
|
|
192
|
+
port: info?.port ?? port,
|
|
193
|
+
server: {
|
|
194
|
+
reachable: info !== undefined,
|
|
195
|
+
url: `http://127.0.0.1:${info?.port ?? port}`,
|
|
196
|
+
...(info === undefined ? {} : { pid: info.pid, uptimeMs: info.uptimeMs }),
|
|
197
|
+
},
|
|
198
|
+
paseo: info?.paseo ?? { reachable: false, error: serverError ?? "argos serve is not running" },
|
|
199
|
+
providers: info?.providers ?? [],
|
|
200
|
+
// FR9: absent (not `[]`) without a server, so an unreachable-server report does not claim the
|
|
201
|
+
// registry is empty; the key's presence means "a server answered".
|
|
202
|
+
...(info?.executors === undefined ? {} : { executors: info.executors }),
|
|
203
|
+
pendingGates: info?.pendingGates ?? [],
|
|
204
|
+
runs: info?.runs ?? { total: 0, active: 0 },
|
|
205
|
+
checks,
|
|
206
|
+
};
|
|
207
|
+
if (args.json)
|
|
208
|
+
printJson(io, report);
|
|
209
|
+
else
|
|
210
|
+
io.stdout(`${humanReport(report)}\n`);
|
|
211
|
+
return EXIT_OK;
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,SAAS,EACT,cAAc,GAMf,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAmB,MAAM,YAAY,CAAC;AACvE,OAAO,EACL,OAAO,EACP,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,SAAS,GAEV,MAAM,cAAc,CAAC;AAEtB,SAAS,cAAc,CAAC,KAAyB;IAC/C,MAAM,GAAG,GAAG,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC/C,IAAI,GAAG,KAAK,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AAI,EAAE,IAAI,IAAI,IAAI,EAAE;YAC7C,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;SAC1E;QACD,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,IAAI,4BAA4B,EAAE;QAC9F,SAAS,EAAE,IAAI,EAAE,SAAS,IAAI,EAAE;QAChC,8FAA8F;QAC9F,mEAAmE;QACnE,GAAG,CAAC,IAAI,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;QACvE,YAAY,EAAE,IAAI,EAAE,YAAY,IAAI,EAAE;QACtC,IAAI,EAAE,IAAI,EAAE,IAAI,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;QAC3C,MAAM;KACP,CAAC;IAEF,IAAI,IAAI,CAAC,IAAI;QAAE,SAAS,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;;QAChC,EAAE,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3C,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** `argos run <playbook>` (FR25) — HTTP client only, never opens storage. */
|
|
2
|
+
import { type ParsedArgs } from "../args.js";
|
|
3
|
+
import { type CliIo } from "../output.js";
|
|
4
|
+
export declare function runCommand(args: ParsedArgs, io: CliIo): Promise<number>;
|
|
5
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAW7E,OAAO,EAAwC,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AACnF,OAAO,EAAgB,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAaxD,wBAAsB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAgE7E"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** `argos run <playbook>` (FR25) — HTTP client only, never opens storage. */
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { EXECUTOR_IDS, executorIdFor, } from "@thaodangspace/argos-core/rpc";
|
|
4
|
+
import { flag, flagValues, rejectUnknownFlags } from "../args.js";
|
|
5
|
+
import { EXIT_RUNTIME } from "../output.js";
|
|
6
|
+
import { withRpc } from "../rpc-command.js";
|
|
7
|
+
function parseInputs(raw) {
|
|
8
|
+
const inputs = {};
|
|
9
|
+
for (const pair of raw) {
|
|
10
|
+
const equals = pair.indexOf("=");
|
|
11
|
+
if (equals <= 0)
|
|
12
|
+
return undefined;
|
|
13
|
+
inputs[pair.slice(0, equals)] = pair.slice(equals + 1);
|
|
14
|
+
}
|
|
15
|
+
return inputs;
|
|
16
|
+
}
|
|
17
|
+
export async function runCommand(args, io) {
|
|
18
|
+
const unknown = rejectUnknownFlags(args, [
|
|
19
|
+
"input",
|
|
20
|
+
"cwd",
|
|
21
|
+
"isolation",
|
|
22
|
+
"executor",
|
|
23
|
+
"client-request-id",
|
|
24
|
+
]);
|
|
25
|
+
if (unknown !== undefined) {
|
|
26
|
+
io.stderr(`argos: ${unknown}\n`);
|
|
27
|
+
return EXIT_RUNTIME;
|
|
28
|
+
}
|
|
29
|
+
const playbookId = args.positionals[0];
|
|
30
|
+
if (playbookId === undefined) {
|
|
31
|
+
io.stderr("argos: run needs a playbook id (argos run <playbook> --input k=v)\n");
|
|
32
|
+
return EXIT_RUNTIME;
|
|
33
|
+
}
|
|
34
|
+
if (args.positionals.length > 1) {
|
|
35
|
+
io.stderr("argos: run takes exactly one playbook id\n");
|
|
36
|
+
return EXIT_RUNTIME;
|
|
37
|
+
}
|
|
38
|
+
const inputs = parseInputs(flagValues(args, "input"));
|
|
39
|
+
if (inputs === undefined) {
|
|
40
|
+
io.stderr("argos: --input expects k=v\n");
|
|
41
|
+
return EXIT_RUNTIME;
|
|
42
|
+
}
|
|
43
|
+
const isolation = flag(args, "isolation");
|
|
44
|
+
if (isolation !== undefined && isolation !== "none" && isolation !== "worktree") {
|
|
45
|
+
io.stderr("argos: --isolation must be none or worktree\n");
|
|
46
|
+
return EXIT_RUNTIME;
|
|
47
|
+
}
|
|
48
|
+
// FR3: an id that is not an executor at all is refused locally — exit 1, no request sent — so a
|
|
49
|
+
// typo never costs a round trip. The canonical id travels; an alias such as `herdr-core` is
|
|
50
|
+
// normalized here, so storage and the read model only ever hold `paseo`/`hc`. Whether the server
|
|
51
|
+
// has an adapter for that id is the server's answer (`executor_unavailable`, 422).
|
|
52
|
+
const executorFlag = flag(args, "executor");
|
|
53
|
+
const executor = executorFlag === undefined ? undefined : executorIdFor(executorFlag);
|
|
54
|
+
if (executorFlag !== undefined && executor === undefined) {
|
|
55
|
+
io.stderr(`argos: --executor ${JSON.stringify(executorFlag)} is unknown: use one of ${EXECUTOR_IDS.join(", ")}\n`);
|
|
56
|
+
return EXIT_RUNTIME;
|
|
57
|
+
}
|
|
58
|
+
const cwdFlag = flag(args, "cwd");
|
|
59
|
+
const clientRequestId = flag(args, "client-request-id");
|
|
60
|
+
const request = {
|
|
61
|
+
playbookId,
|
|
62
|
+
inputs,
|
|
63
|
+
// Default to the caller's directory: `argos run` in a repo must not depend on where the
|
|
64
|
+
// long-lived `argos serve` process was started.
|
|
65
|
+
cwd: cwdFlag === undefined ? process.cwd() : resolve(cwdFlag),
|
|
66
|
+
...(isolation === undefined ? {} : { isolation: { mode: isolation } }),
|
|
67
|
+
...(executor === undefined ? {} : { executor }),
|
|
68
|
+
...(clientRequestId === undefined ? {} : { clientRequestId }),
|
|
69
|
+
};
|
|
70
|
+
return withRpc(io, args.json, async (client) => {
|
|
71
|
+
const started = await client.startRun(request);
|
|
72
|
+
return {
|
|
73
|
+
jsonValue: started,
|
|
74
|
+
human: `started run ${started.runId} (task ${started.taskId})`,
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAE7E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,YAAY,EACZ,aAAa,GAGd,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,kBAAkB,EAAmB,MAAM,YAAY,CAAC;AACnF,OAAO,EAAE,YAAY,EAAc,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,SAAS,WAAW,CAAC,GAAsB;IACzC,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE,CAAC;QACvB,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,MAAM,IAAI,CAAC;YAAE,OAAO,SAAS,CAAC;QAClC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAgB,EAAE,EAAS;IAC1D,MAAM,OAAO,GAAG,kBAAkB,CAAC,IAAI,EAAE;QACvC,OAAO;QACP,KAAK;QACL,WAAW;QACX,UAAU;QAC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
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** `argos ls` (with `--schedule`), `argos status <runId>`, `argos gates` (FR25, FR8.4). */
|
|
2
|
+
import { type ParsedArgs } from "../args.js";
|
|
3
|
+
import { type CliIo } from "../output.js";
|
|
4
|
+
export declare function lsCommand(args: ParsedArgs, io: CliIo): Promise<number>;
|
|
5
|
+
export declare function statusCommand(args: ParsedArgs, io: CliIo): Promise<number>;
|
|
6
|
+
export declare function gatesCommand(args: ParsedArgs, io: CliIo): Promise<number>;
|
|
7
|
+
//# sourceMappingURL=runs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/commands/runs.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAE3F,OAAO,EAA4B,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAyC,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AA4GjF,wBAAsB,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAoB5E;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAehF;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAU/E"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/** `argos ls` (with `--schedule`), `argos status <runId>`, `argos gates` (FR25, FR8.4). */
|
|
2
|
+
import { flag, rejectUnknownFlags } from "../args.js";
|
|
3
|
+
import { EXIT_RUNTIME, formatCost, formatUsage } from "../output.js";
|
|
4
|
+
import { withRpc } from "../rpc-command.js";
|
|
5
|
+
function when(at) {
|
|
6
|
+
return at === undefined ? "-" : new Date(at).toISOString();
|
|
7
|
+
}
|
|
8
|
+
/** The cost component of an aggregate usage record, if the executor reported one. */
|
|
9
|
+
function costLabel(usage) {
|
|
10
|
+
const total = usage?.["totalCostUsd"];
|
|
11
|
+
return total === undefined ? undefined : formatCost(total);
|
|
12
|
+
}
|
|
13
|
+
function lsHuman(runs) {
|
|
14
|
+
if (runs.length === 0)
|
|
15
|
+
return "no runs";
|
|
16
|
+
const costs = runs.map((run) => costLabel(run.usage));
|
|
17
|
+
// The COST column appears only when at least one run reported accounting, so a deployment with
|
|
18
|
+
// no usage data keeps the old (shorter) line byte-for-byte.
|
|
19
|
+
const withCost = costs.some((cost) => cost !== undefined);
|
|
20
|
+
const header = withCost
|
|
21
|
+
? "ID STATUS PLAYBOOK UPDATED COST"
|
|
22
|
+
: "ID STATUS PLAYBOOK UPDATED";
|
|
23
|
+
const lines = [header];
|
|
24
|
+
for (const [index, run] of runs.entries()) {
|
|
25
|
+
// FR8.4: a scheduled run says so; a manual run's line stays byte-identical.
|
|
26
|
+
const schedule = run.trigger === undefined ? "" : ` [schedule ${run.trigger.scheduleId}]`;
|
|
27
|
+
// S-FR12: a forked run names its parent and fork point, after the schedule marker (a run can
|
|
28
|
+
// be both).
|
|
29
|
+
const fork = run.forkedFrom === undefined
|
|
30
|
+
? ""
|
|
31
|
+
: ` [fork ${run.forkedFrom.runId.slice(0, 8)}@${run.forkedFrom.stepId}]`;
|
|
32
|
+
// FR8: only a run on a non-default substrate says so; a paseo run's line stays byte-identical.
|
|
33
|
+
const executor = run.executor === undefined ? "" : ` [executor ${run.executor}]`;
|
|
34
|
+
const cost = withCost ? ` ${(costs[index] ?? "-").padStart(7)}` : "";
|
|
35
|
+
lines.push(`${run.id.padEnd(32)} ${run.status.padEnd(11)} ${run.playbookId.padEnd(24)} ${when(run.updatedAt)}${cost}${schedule}${fork}${executor}`);
|
|
36
|
+
}
|
|
37
|
+
return lines.join("\n");
|
|
38
|
+
}
|
|
39
|
+
function stepLine(step) {
|
|
40
|
+
const attempts = step.attemptCount === 1 ? "1 attempt" : `${step.attemptCount} attempts`;
|
|
41
|
+
const error = step.errorCode === undefined ? "" : ` ${step.errorCode}`;
|
|
42
|
+
const cost = costLabel(step.usage);
|
|
43
|
+
return ` ${step.id.padEnd(20)} ${step.status.padEnd(10)} ${attempts}${error}${cost === undefined ? "" : ` ${cost}`}`;
|
|
44
|
+
}
|
|
45
|
+
function gateLine(gate) {
|
|
46
|
+
const decision = gate.status === "decided"
|
|
47
|
+
? ` decided "${gate.decision ?? "?"}"${gate.decidedBy === undefined ? "" : ` by ${gate.decidedBy}`}`
|
|
48
|
+
: "";
|
|
49
|
+
return ` ${gate.gateId.padEnd(20)} ${gate.kind.padEnd(10)} ${gate.status}${decision} ${gate.question}`;
|
|
50
|
+
}
|
|
51
|
+
function statusHuman(run) {
|
|
52
|
+
const lines = [
|
|
53
|
+
`run ${run.id}`,
|
|
54
|
+
` status ${run.status}`,
|
|
55
|
+
` playbook ${run.playbookId} (${run.playbookHash.slice(0, 12)})`,
|
|
56
|
+
// FR8: the substrate, spelled out (`paseo` when the record does not name one), so an operator
|
|
57
|
+
// overriding the playbook default can see which one ran.
|
|
58
|
+
` executor ${run.executor ?? "paseo"}`,
|
|
59
|
+
` cwd ${run.cwd}`,
|
|
60
|
+
];
|
|
61
|
+
if (run.worktree !== undefined) {
|
|
62
|
+
lines.push(` worktree ${run.worktree.path} [${run.worktree.branch}]`);
|
|
63
|
+
}
|
|
64
|
+
// S-FR12: both hashes, so the discontinuity is visible without `--json`.
|
|
65
|
+
if (run.forkedFrom !== undefined) {
|
|
66
|
+
lines.push(` forked from ${run.forkedFrom.runId} at ${run.forkedFrom.stepId} ` +
|
|
67
|
+
`(${run.forkedFrom.fromHash.slice(0, 12)} -> ${run.forkedFrom.toHash.slice(0, 12)})`);
|
|
68
|
+
}
|
|
69
|
+
// Workflow total: counters summed across every agent step; absent when nothing was reported.
|
|
70
|
+
const usage = formatUsage(run.usage);
|
|
71
|
+
if (usage !== null)
|
|
72
|
+
lines.push(` usage ${usage}`);
|
|
73
|
+
lines.push("steps:");
|
|
74
|
+
for (const step of run.steps)
|
|
75
|
+
lines.push(stepLine(step));
|
|
76
|
+
if (run.gates.length > 0) {
|
|
77
|
+
lines.push("gates:");
|
|
78
|
+
for (const gate of run.gates)
|
|
79
|
+
lines.push(gateLine(gate));
|
|
80
|
+
}
|
|
81
|
+
if (run.after.length > 0) {
|
|
82
|
+
lines.push("after:");
|
|
83
|
+
for (const after of run.after)
|
|
84
|
+
lines.push(` ${after.id.padEnd(20)} ${after.status}`);
|
|
85
|
+
}
|
|
86
|
+
if (run.history.length > 0) {
|
|
87
|
+
const last = run.history.at(-1);
|
|
88
|
+
lines.push(`history ${run.history.length} event(s), last ${last?.type ?? "?"} at ${when(last?.at)}`);
|
|
89
|
+
}
|
|
90
|
+
return lines.join("\n");
|
|
91
|
+
}
|
|
92
|
+
function gatesHuman(gates) {
|
|
93
|
+
if (gates.length === 0)
|
|
94
|
+
return "no pending gates";
|
|
95
|
+
return gates
|
|
96
|
+
.map((gate) => `${gate.runId} ${gate.gateId.padEnd(20)} ${gate.kind.padEnd(10)} ${gate.question}`)
|
|
97
|
+
.join("\n");
|
|
98
|
+
}
|
|
99
|
+
export async function lsCommand(args, io) {
|
|
100
|
+
const unknown = rejectUnknownFlags(args, ["schedule"]);
|
|
101
|
+
if (unknown !== undefined) {
|
|
102
|
+
io.stderr(`argos: ${unknown}\n`);
|
|
103
|
+
return EXIT_RUNTIME;
|
|
104
|
+
}
|
|
105
|
+
const scheduleId = flag(args, "schedule");
|
|
106
|
+
return withRpc(io, args.json, async (client) => {
|
|
107
|
+
const response = await client.listRuns();
|
|
108
|
+
// FR8.4: filter on the client, by the trigger the mirror already carries. A run started by
|
|
109
|
+
// hand never matches, because it has no trigger at all.
|
|
110
|
+
const runs = scheduleId === undefined
|
|
111
|
+
? response.runs
|
|
112
|
+
: response.runs.filter((run) => run.trigger?.scheduleId === scheduleId);
|
|
113
|
+
return {
|
|
114
|
+
jsonValue: scheduleId === undefined ? response : { runs },
|
|
115
|
+
human: lsHuman(runs),
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
export async function statusCommand(args, io) {
|
|
120
|
+
const unknown = rejectUnknownFlags(args, []);
|
|
121
|
+
if (unknown !== undefined) {
|
|
122
|
+
io.stderr(`argos: ${unknown}\n`);
|
|
123
|
+
return EXIT_RUNTIME;
|
|
124
|
+
}
|
|
125
|
+
const runId = args.positionals[0];
|
|
126
|
+
if (runId === undefined) {
|
|
127
|
+
io.stderr("argos: status needs a run id\n");
|
|
128
|
+
return EXIT_RUNTIME;
|
|
129
|
+
}
|
|
130
|
+
return withRpc(io, args.json, async (client) => {
|
|
131
|
+
const detail = await client.getRun(runId);
|
|
132
|
+
return { jsonValue: detail, human: statusHuman(detail) };
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
export async function gatesCommand(args, io) {
|
|
136
|
+
const unknown = rejectUnknownFlags(args, []);
|
|
137
|
+
if (unknown !== undefined) {
|
|
138
|
+
io.stderr(`argos: ${unknown}\n`);
|
|
139
|
+
return EXIT_RUNTIME;
|
|
140
|
+
}
|
|
141
|
+
return withRpc(io, args.json, async (client) => {
|
|
142
|
+
const response = await client.listPendingGates();
|
|
143
|
+
return { jsonValue: response, human: gatesHuman(response.gates) };
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=runs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../src/commands/runs.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAE3F,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAmB,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAc,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,SAAS,IAAI,CAAC,EAAsB;IAClC,OAAO,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,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AC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAgB,EAAE,EAAS;IAC5D,MAAM,OAAO,GAAG,kBAAkB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC7C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,EAAE,CAAC,MAAM,CAAC,UAAU,OAAO,IAAI,CAAC,CAAC;QACjC,OAAO,YAAY,CAAC;IACtB,CAAC;IACD,OAAO,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QAC7C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,gBAAgB,EAAE,CAAC;QACjD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;IACpE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `argos schedule` (FR10.2) — the operator's view of the scheduler.
|
|
3
|
+
*
|
|
4
|
+
* Parsed by hand in the same shape as `commands/worktree.ts` (no dependency, one request per
|
|
5
|
+
* invocation) and every call goes through `argos serve`: the CLI never opens SQLite and never arms
|
|
6
|
+
* a timer. `cwd` and `tz` are filled from the caller's process, because a schedule is unattended
|
|
7
|
+
* execution — the target must not depend on how `argos serve` was started, nor on the zone of
|
|
8
|
+
* whichever machine happens to notice the fire (FR2.5).
|
|
9
|
+
*
|
|
10
|
+
* Only `@thaodangspace/argos-core/rpc` is imported here (the import-graph guard depends on it).
|
|
11
|
+
*/
|
|
12
|
+
import { type ParsedArgs } from "../args.js";
|
|
13
|
+
import { type CliIo } from "../output.js";
|
|
14
|
+
export declare function scheduleCommand(args: ParsedArgs, io: CliIo): Promise<number>;
|
|
15
|
+
//# sourceMappingURL=schedule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../src/commands/schedule.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAgBH,OAAO,EAAiD,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,EAAgB,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AA4MxD,wBAAsB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAalF"}
|