@makine/cli 0.6.4 → 0.8.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/dist/agents/command.d.ts +49 -0
- package/dist/agents/command.d.ts.map +1 -0
- package/dist/agents/command.js +394 -0
- package/dist/agents/command.js.map +1 -0
- package/dist/contracts/command.js +10 -3
- package/dist/contracts/command.js.map +1 -1
- package/dist/gov-id/command.d.ts +35 -0
- package/dist/gov-id/command.d.ts.map +1 -0
- package/dist/gov-id/command.js +189 -0
- package/dist/gov-id/command.js.map +1 -0
- package/dist/index.d.ts +28 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +308 -7
- package/dist/index.js.map +1 -1
- package/dist/migrate/runtime-rules.d.ts.map +1 -1
- package/dist/migrate/runtime-rules.js +5 -1
- package/dist/migrate/runtime-rules.js.map +1 -1
- package/dist/quality/command.d.ts +1 -1
- package/dist/quality/command.d.ts.map +1 -1
- package/dist/quality/command.js +1 -1
- package/dist/quality/command.js.map +1 -1
- package/dist/receipts/command.d.ts +26 -2
- package/dist/receipts/command.d.ts.map +1 -1
- package/dist/receipts/command.js +91 -6
- package/dist/receipts/command.js.map +1 -1
- package/dist/runs/command.d.ts +48 -0
- package/dist/runs/command.d.ts.map +1 -0
- package/dist/runs/command.js +439 -0
- package/dist/runs/command.js.map +1 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -12,12 +12,15 @@ import { BASELINE_SUBCOMMANDS, runBaseline, } from "./baseline/command.js";
|
|
|
12
12
|
import { CHALLENGER_ACTIONS, CONTRACT_SUBCOMMANDS, runContracts, } from "./contracts/command.js";
|
|
13
13
|
import { USE_CASE_SUBCOMMANDS, runUseCases, } from "./use-cases/command.js";
|
|
14
14
|
import { JUDGE_SUBCOMMANDS, runJudge, } from "./judge/command.js";
|
|
15
|
-
import {
|
|
15
|
+
import { GOV_ID_SUBCOMMANDS, isGovIdSubcommand, runGovId, } from "./gov-id/command.js";
|
|
16
|
+
import { runReceipts, runReceiptsShow, RECEIPTS_SUBCOMMANDS, } from "./receipts/command.js";
|
|
16
17
|
import { SUGGESTIONS_SUBCOMMANDS, runSuggestions, } from "./suggestions/command.js";
|
|
17
18
|
import { DIAGNOSIS_SUBCOMMANDS, runDiagnosis, } from "./diagnosis/command.js";
|
|
18
19
|
import { KEYS_SUBCOMMANDS, runKeys, } from "./keys/command.js";
|
|
19
20
|
import { CONNECTIONS_SUBCOMMANDS, runConnections, } from "./connections/command.js";
|
|
20
21
|
import { WORKFLOWS_SUBCOMMANDS, runWorkflows, } from "./workflows/command.js";
|
|
22
|
+
import { AGENTS_SUBCOMMANDS, isAgentsSubcommand, runAgents, } from "./agents/command.js";
|
|
23
|
+
import { RUNS_SUBCOMMANDS, isRunsSubcommand, runRuns, } from "./runs/command.js";
|
|
21
24
|
import { CORRECTIONS_SUBCOMMANDS, DATASETS_SUBCOMMANDS, EXPERIMENTS_SUBCOMMANDS, isCorrectionsSubcommand, isDatasetsSubcommand, isExperimentsSubcommand, runCorrections, runDatasets, runExperiments, } from "./lab/command.js";
|
|
22
25
|
import { runLogin, runLogout } from "./login/command.js";
|
|
23
26
|
import { REVIEWS_SUBCOMMANDS, isReviewAction, isReviewsSubcommand, runReviews, } from "./reviews/command.js";
|
|
@@ -124,6 +127,7 @@ USAGE
|
|
|
124
127
|
makine login Sign in as yourself, by approving a code in the dashboard
|
|
125
128
|
makine logout End that session and delete the stored token
|
|
126
129
|
makine run [prompt...] Send one buffered chat completion and print the verdict
|
|
130
|
+
makine runs <cmd> Send one task to a registered executor, and read what came of it
|
|
127
131
|
makine accept "<input>" Judge an answer your own system produced, with it on stdin
|
|
128
132
|
makine quality Acceptance and failure figures, as Quality in the dashboard
|
|
129
133
|
makine models [--used] List the model aliases this workspace may call; --used lists only
|
|
@@ -132,11 +136,13 @@ USAGE
|
|
|
132
136
|
makine contracts <cmd> Define what a good result is, and make it live
|
|
133
137
|
makine use-cases <cmd> Name a job, give it an address, and point it at a model
|
|
134
138
|
makine judge <cmd> Switch the semantic judge on or off for this workspace
|
|
135
|
-
makine
|
|
139
|
+
makine gov-id <cmd> Which cloud vendors may receive government-ID data, and hints
|
|
140
|
+
makine receipts <cmd> Read a run's receipt, and verify the receipts an issuer signed
|
|
136
141
|
makine suggestions <cmd> Suggested prompt instructions, checks, schemas and fixes
|
|
137
142
|
makine diagnosis <cmd> Whether Makine may read rejected answers to spot near misses
|
|
138
143
|
makine connections <cmd> Connect your own model provider, and keep it until you disconnect it
|
|
139
144
|
makine workflows <cmd> Define an HTTP or container step, and approve the hosts it may reach
|
|
145
|
+
makine agents <cmd> Register an outside A2A agent, and keep its credential and card
|
|
140
146
|
makine baseline <cmd> Compare your model's first answer with what Makine delivered
|
|
141
147
|
makine datasets <cmd> Keep the cases you judge a prompt or a contract against
|
|
142
148
|
makine experiments <cmd> Run variants over a dataset and compare what each got accepted
|
|
@@ -201,6 +207,59 @@ WORKFLOWS
|
|
|
201
207
|
A change needs a session. Holding only MAKINE_API_KEY you can \`list\`, \`test\` and read models;
|
|
202
208
|
run \`makine login\` to connect, rotate or disconnect.
|
|
203
209
|
|
|
210
|
+
OUTSIDE AGENTS
|
|
211
|
+
makine agents list Your agents, where each lives, and its status
|
|
212
|
+
makine agents show <agent_id> One agent, its pinned card and every past pin
|
|
213
|
+
makine agents register <host> --name <display name>
|
|
214
|
+
--artifact <role>:<artifact_type>[:<artifact_name>]
|
|
215
|
+
[--credential-stdin] [--acknowledge-egress]
|
|
216
|
+
makine agents credential <agent_id> Replace the credential, keeping the agent
|
|
217
|
+
makine agents repin <agent_id> [--yes] Pin whatever card the agent serves now
|
|
218
|
+
makine agents retire <agent_id> Stop new runs; history and running attempts stay
|
|
219
|
+
|
|
220
|
+
Registering an agent sends this workspace's task input to a company Makine has never evaluated.
|
|
221
|
+
\`register\` prints what that means and writes nothing until you pass --acknowledge-egress, and the
|
|
222
|
+
agent's host must already be approved with \`makine workflows approve-host\`.
|
|
223
|
+
|
|
224
|
+
--artifact repeats, once per thing the agent must deliver; the A2A artifact name defaults to the
|
|
225
|
+
role, and every declaration is required. --credential-stdin reads the agent's credential from
|
|
226
|
+
STDIN and from nowhere else, as \`credential\` does:
|
|
227
|
+
|
|
228
|
+
pbpaste | makine agents register agent.example.com --name "Acme" \\
|
|
229
|
+
--artifact message:text --credential-stdin --acknowledge-egress
|
|
230
|
+
|
|
231
|
+
The credential is never taken in an argument or an environment variable, where it would reach
|
|
232
|
+
\`ps\` and your shell history, and it is never printed back. A card that declares a security
|
|
233
|
+
scheme needs one.
|
|
234
|
+
|
|
235
|
+
Every write here needs \`makine login\`: a workspace key may list and show. \`register\` prints the
|
|
236
|
+
executor reference on stdout, which is what \`makine runs submit --executor\` takes.
|
|
237
|
+
|
|
238
|
+
RUNS
|
|
239
|
+
makine runs submit --executor <ref> --contract <id>@<version> --input <file.json> [--wait]
|
|
240
|
+
makine runs show <task_id> The run's state, or its outcome once it settles
|
|
241
|
+
makine runs download <task_id> [--format md|docx|pdf] [--out <path>] [--force]
|
|
242
|
+
|
|
243
|
+
A settled run also prints each tool Makine bought with its supplier and the price charged, and
|
|
244
|
+
what the run cost by part. \`--json\` prints the Task as the API sent it and adds neither.
|
|
245
|
+
|
|
246
|
+
\`download\` saves the run's answer as a Markdown, Word or PDF file and prints the path it wrote.
|
|
247
|
+
It needs \`makine login\`, as reading a run's answer does. Without --out it saves the name the
|
|
248
|
+
server suggests — the agent's name and the run's date — in the current directory; --out takes a
|
|
249
|
+
file to write or a directory to write that name into. An existing file is kept unless --force.
|
|
250
|
+
|
|
251
|
+
\`submit\` sends the file's JSON as the run's input and prints the task id on stdout, so
|
|
252
|
+
\`TASK=$(makine runs submit ...)\` captures it and nothing else. --wait polls until the run
|
|
253
|
+
settles and prints the state it settled in; --timeout-minutes bounds the wait (30 by default),
|
|
254
|
+
and a run still going when that passes keeps going — read it later with \`show\`.
|
|
255
|
+
|
|
256
|
+
Exit 0 means an accepted delivery. Exit 2 means no accepted result: the run settled without one,
|
|
257
|
+
was parked for a person, or has not settled yet — in the last case it is still going, so read it
|
|
258
|
+
again rather than submitting a second time. \`show\` reports the same way.
|
|
259
|
+
|
|
260
|
+
This is the Runner's path, and the only one an \`agent.\` reference reaches. \`makine run\` is the
|
|
261
|
+
Gateway's chat completion, which never reaches an outside agent.
|
|
262
|
+
|
|
204
263
|
THE LAB
|
|
205
264
|
makine datasets list Your datasets, their version and case count
|
|
206
265
|
makine datasets create --name <name> A new, empty dataset
|
|
@@ -323,13 +382,19 @@ USE CASES
|
|
|
323
382
|
how you organise traffic a model is already taking. Removing an address is the only thing that
|
|
324
383
|
frees it for another use case.
|
|
325
384
|
|
|
326
|
-
|
|
385
|
+
RECEIPTS
|
|
386
|
+
makine receipts show <task_id> [--out <file>] One run's receipt, exactly as signed
|
|
327
387
|
makine receipts trust <name> --origin <https-origin> Anchor an issuer by fetching its key list
|
|
328
388
|
makine receipts trust <name> --from-file <key-set> Anchor one by a hand-over, the stronger form
|
|
329
389
|
makine receipts trust <name> --refresh --origin <o> Refresh a record you already hold
|
|
330
390
|
makine receipts verify <file> [--issuer <name>] Check a receipt. NEVER fetches
|
|
331
391
|
makine receipts issuers The issuers you have anchored
|
|
332
392
|
|
|
393
|
+
\`show\` is the one subcommand that needs a Makine address and a credential, and any credential of
|
|
394
|
+
the run's workspace may run it. The other three need neither: the party checking a receipt has no
|
|
395
|
+
Makine workspace. Hand on the file \`show --out\` writes; it verifies unchanged.
|
|
396
|
+
|
|
397
|
+
THE SEMANTIC JUDGE
|
|
333
398
|
makine judge show Whether it is on, which model, and the statement
|
|
334
399
|
makine judge enable --model <alias> [--yes] Agree to the statement and switch it on
|
|
335
400
|
makine judge disable Switch it off for this workspace
|
|
@@ -343,6 +408,28 @@ THE SEMANTIC JUDGE
|
|
|
343
408
|
\`show\` also reports the deployment operator's own switch. Both must be on for anything to be
|
|
344
409
|
judged, so a workspace that has consented and sees no judgments can tell whose switch is off.
|
|
345
410
|
|
|
411
|
+
GOVERNMENT-ID DATA
|
|
412
|
+
makine gov-id show Which vendors are allowed, and whether hints are on
|
|
413
|
+
makine gov-id acknowledge <vendor> [--yes] Allow one cloud vendor to receive it
|
|
414
|
+
makine gov-id revoke <vendor> Take that permission back
|
|
415
|
+
makine gov-id detection on|off Switch the hints on or off for this workspace
|
|
416
|
+
makine gov-id business-hints on|off Hint a company's own numbers in a public lookup
|
|
417
|
+
|
|
418
|
+
A contract that carries a government identity or tax number is not sent to a cloud model until
|
|
419
|
+
somebody here has allowed that vendor, once. \`acknowledge\` prints the warning and asks you to
|
|
420
|
+
type yes; \`--yes\` skips the prompt, and the warning is printed either way. A model on your own
|
|
421
|
+
network is never affected. The vendor is the name a call's address resolves to — \`openai\`,
|
|
422
|
+
\`anthropic\`, or the host name of another endpoint — so allowing one never allows another.
|
|
423
|
+
|
|
424
|
+
Hints are separate and block nothing: Makine says an input may hold a national ID or tax number,
|
|
425
|
+
names the country and the field, and never the number. Allowing a vendor needs a signed-in
|
|
426
|
+
account; switching either kind of hint needs a session or a workspace key.
|
|
427
|
+
|
|
428
|
+
A company's own numbers — a VAT, company or legal-entity registration — found by a public look-up
|
|
429
|
+
raise no hint: they are printed on the company's invoices and sit in a public register.
|
|
430
|
+
\`business-hints on\` hints them there too. A person's number in the same answer, and any number in
|
|
431
|
+
your own input or in an account you connected, is hinted either way.
|
|
432
|
+
|
|
346
433
|
SUGGESTIONS
|
|
347
434
|
makine suggestions show Whether they are on, which model, the statement
|
|
348
435
|
makine suggestions enable --model <alias> [--yes] Agree to the statement and switch them on
|
|
@@ -481,11 +568,14 @@ export function parseArgs(argv) {
|
|
|
481
568
|
};
|
|
482
569
|
}
|
|
483
570
|
args.receiptsSubcommand = sub;
|
|
484
|
-
// `trust <name>` and `
|
|
571
|
+
// `trust <name>`, `verify <file>` and `show <task_id>` each take one positional after the
|
|
572
|
+
// subcommand.
|
|
485
573
|
const positional = argv[2];
|
|
486
574
|
if (positional !== undefined && !positional.startsWith("--")) {
|
|
487
575
|
if (sub === "verify")
|
|
488
576
|
args.receiptFile = positional;
|
|
577
|
+
else if (sub === "show")
|
|
578
|
+
args.receiptTaskId = positional;
|
|
489
579
|
else
|
|
490
580
|
args.issuer = positional;
|
|
491
581
|
index = 3;
|
|
@@ -506,6 +596,28 @@ export function parseArgs(argv) {
|
|
|
506
596
|
args.judgeSubcommand = sub;
|
|
507
597
|
index = 2;
|
|
508
598
|
}
|
|
599
|
+
else if (head === "gov-id") {
|
|
600
|
+
args.command = head;
|
|
601
|
+
const sub = argv[1];
|
|
602
|
+
if (sub === undefined || !isGovIdSubcommand(sub)) {
|
|
603
|
+
return {
|
|
604
|
+
ok: false,
|
|
605
|
+
message: `\`makine gov-id\` needs one of ${GOV_ID_SUBCOMMANDS.join(", ")}.`,
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
args.govIdSubcommand = sub;
|
|
609
|
+
const positional = argv[2];
|
|
610
|
+
if (positional !== undefined && !positional.startsWith("-")) {
|
|
611
|
+
if (sub === "detection" || sub === "business-hints")
|
|
612
|
+
args.govIdChoice = positional;
|
|
613
|
+
else
|
|
614
|
+
args.govIdVendor = positional;
|
|
615
|
+
index = 3;
|
|
616
|
+
}
|
|
617
|
+
else {
|
|
618
|
+
index = 2;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
509
621
|
else if (head === "suggestions") {
|
|
510
622
|
args.command = head;
|
|
511
623
|
const sub = argv[1];
|
|
@@ -566,6 +678,30 @@ export function parseArgs(argv) {
|
|
|
566
678
|
args.workflowsSubcommand = sub;
|
|
567
679
|
index = 2;
|
|
568
680
|
}
|
|
681
|
+
else if (head === "agents") {
|
|
682
|
+
args.command = head;
|
|
683
|
+
const sub = argv[1];
|
|
684
|
+
if (sub === undefined || !isAgentsSubcommand(sub)) {
|
|
685
|
+
return {
|
|
686
|
+
ok: false,
|
|
687
|
+
message: `\`makine agents\` needs one of ${AGENTS_SUBCOMMANDS.join(", ")}.`,
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
args.agentsSubcommand = sub;
|
|
691
|
+
index = 2;
|
|
692
|
+
}
|
|
693
|
+
else if (head === "runs") {
|
|
694
|
+
args.command = head;
|
|
695
|
+
const sub = argv[1];
|
|
696
|
+
if (sub === undefined || !isRunsSubcommand(sub)) {
|
|
697
|
+
return {
|
|
698
|
+
ok: false,
|
|
699
|
+
message: `\`makine runs\` needs one of ${RUNS_SUBCOMMANDS.join(", ")}.`,
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
args.runsSubcommand = sub;
|
|
703
|
+
index = 2;
|
|
704
|
+
}
|
|
569
705
|
else if (head === "baseline") {
|
|
570
706
|
args.command = head;
|
|
571
707
|
const sub = argv[1];
|
|
@@ -735,6 +871,30 @@ export function parseArgs(argv) {
|
|
|
735
871
|
case "--refresh":
|
|
736
872
|
args.refresh = true;
|
|
737
873
|
break;
|
|
874
|
+
case "--out":
|
|
875
|
+
// The flag switch is shared by every command, so another command would otherwise take
|
|
876
|
+
// `--out` and silently drop it.
|
|
877
|
+
if (args.command !== "receipts" && args.command !== "runs") {
|
|
878
|
+
throw new CliUsageError("`--out` only applies to `makine receipts show` and `makine runs download`.");
|
|
879
|
+
}
|
|
880
|
+
if (needsValue(token, next))
|
|
881
|
+
args.out = next;
|
|
882
|
+
index += 1;
|
|
883
|
+
break;
|
|
884
|
+
case "--format":
|
|
885
|
+
if (args.command !== "runs") {
|
|
886
|
+
throw new CliUsageError("`--format` only applies to `makine runs download`.");
|
|
887
|
+
}
|
|
888
|
+
if (needsValue(token, next))
|
|
889
|
+
args.format = next;
|
|
890
|
+
index += 1;
|
|
891
|
+
break;
|
|
892
|
+
case "--force":
|
|
893
|
+
if (args.command !== "runs") {
|
|
894
|
+
throw new CliUsageError("`--force` only applies to `makine runs download`.");
|
|
895
|
+
}
|
|
896
|
+
args.force = true;
|
|
897
|
+
break;
|
|
738
898
|
case "--system":
|
|
739
899
|
if (needsValue(token, next))
|
|
740
900
|
args.system = next;
|
|
@@ -743,8 +903,8 @@ export function parseArgs(argv) {
|
|
|
743
903
|
case "--input":
|
|
744
904
|
// The flag switch is shared by every command, so a command that cannot act on `--input`
|
|
745
905
|
// would otherwise take it and drop it.
|
|
746
|
-
if (args.command !== "run") {
|
|
747
|
-
throw new CliUsageError("`--input` only applies to `makine run`.");
|
|
906
|
+
if (args.command !== "run" && args.command !== "runs") {
|
|
907
|
+
throw new CliUsageError("`--input` only applies to `makine run` and `makine runs submit`.");
|
|
748
908
|
}
|
|
749
909
|
if (needsValue(token, next))
|
|
750
910
|
args.input = next;
|
|
@@ -903,6 +1063,19 @@ export function parseArgs(argv) {
|
|
|
903
1063
|
case "--acknowledge-egress":
|
|
904
1064
|
args.acknowledgeEgress = true;
|
|
905
1065
|
break;
|
|
1066
|
+
case "--artifact":
|
|
1067
|
+
if (needsValue(token, next))
|
|
1068
|
+
(args.artifacts ??= []).push(next);
|
|
1069
|
+
index += 1;
|
|
1070
|
+
break;
|
|
1071
|
+
case "--credential-stdin":
|
|
1072
|
+
args.credentialStdin = true;
|
|
1073
|
+
break;
|
|
1074
|
+
case "--executor":
|
|
1075
|
+
if (needsValue(token, next))
|
|
1076
|
+
args.executor = next;
|
|
1077
|
+
index += 1;
|
|
1078
|
+
break;
|
|
906
1079
|
default:
|
|
907
1080
|
throw new CliUsageError(`Unknown option \`${token}\`. Try \`makine help\`.`);
|
|
908
1081
|
}
|
|
@@ -1026,9 +1199,10 @@ export async function runCli(argv, io) {
|
|
|
1026
1199
|
});
|
|
1027
1200
|
return ok ? EXIT.ACCEPTED : EXIT.USAGE;
|
|
1028
1201
|
}
|
|
1029
|
-
if (args.command === "receipts") {
|
|
1202
|
+
if (args.command === "receipts" && args.receiptsSubcommand !== "show") {
|
|
1030
1203
|
// Offline: the counterparty verifying a receipt has no Makine workspace, so neither a Gateway
|
|
1031
1204
|
// address nor a key may be demanded. `trust --origin` fetches the issuer's own origin, not ours.
|
|
1205
|
+
// `show` is the exception and falls through to the address and credential below.
|
|
1032
1206
|
const outcome = await runReceipts({
|
|
1033
1207
|
subcommand: args.receiptsSubcommand,
|
|
1034
1208
|
...(args.issuer === undefined ? {} : { name: args.issuer }),
|
|
@@ -1111,6 +1285,18 @@ export async function runCli(argv, io) {
|
|
|
1111
1285
|
}, { out: io.out, err: io.err });
|
|
1112
1286
|
return ACCEPT_EXIT[outcome];
|
|
1113
1287
|
}
|
|
1288
|
+
if (args.command === "receipts") {
|
|
1289
|
+
// Only `show` reaches here; the other three returned above, before any address was demanded.
|
|
1290
|
+
const outcome = await runReceiptsShow({
|
|
1291
|
+
...(args.receiptTaskId === undefined ? {} : { taskId: args.receiptTaskId }),
|
|
1292
|
+
...(args.out === undefined ? {} : { out: args.out }),
|
|
1293
|
+
}, {
|
|
1294
|
+
baseUrl,
|
|
1295
|
+
apiKey,
|
|
1296
|
+
...(io.fetchImpl === undefined ? {} : { fetchImpl: io.fetchImpl }),
|
|
1297
|
+
}, { out: io.out, err: io.err });
|
|
1298
|
+
return RECEIPTS_SHOW_EXIT[outcome];
|
|
1299
|
+
}
|
|
1114
1300
|
if (args.command === "reviews") {
|
|
1115
1301
|
const outcome = await runReviews({
|
|
1116
1302
|
subcommand: args.reviewsSubcommand,
|
|
@@ -1199,6 +1385,24 @@ export async function runCli(argv, io) {
|
|
|
1199
1385
|
});
|
|
1200
1386
|
return JUDGE_EXIT[outcome];
|
|
1201
1387
|
}
|
|
1388
|
+
if (args.command === "gov-id") {
|
|
1389
|
+
const outcome = await runGovId({
|
|
1390
|
+
subcommand: args.govIdSubcommand,
|
|
1391
|
+
...(args.govIdVendor === undefined ? {} : { vendor: args.govIdVendor }),
|
|
1392
|
+
...(args.govIdChoice === undefined ? {} : { choice: args.govIdChoice }),
|
|
1393
|
+
yes: args.yes,
|
|
1394
|
+
json: args.json,
|
|
1395
|
+
}, {
|
|
1396
|
+
baseUrl,
|
|
1397
|
+
apiKey,
|
|
1398
|
+
...(io.fetchImpl === undefined ? {} : { fetchImpl: io.fetchImpl }),
|
|
1399
|
+
}, {
|
|
1400
|
+
out: io.out,
|
|
1401
|
+
err: io.err,
|
|
1402
|
+
confirm: io.readCredentialImpl ?? ((prompt) => readConfirmationLine(prompt)),
|
|
1403
|
+
});
|
|
1404
|
+
return GOV_ID_EXIT[outcome];
|
|
1405
|
+
}
|
|
1202
1406
|
if (args.command === "suggestions") {
|
|
1203
1407
|
const outcome = await runSuggestions({
|
|
1204
1408
|
subcommand: args.suggestionsSubcommand,
|
|
@@ -1290,6 +1494,69 @@ export async function runCli(argv, io) {
|
|
|
1290
1494
|
});
|
|
1291
1495
|
return WORKFLOWS_EXIT[outcome];
|
|
1292
1496
|
}
|
|
1497
|
+
if (args.command === "agents") {
|
|
1498
|
+
const outcome = await runAgents({
|
|
1499
|
+
subcommand: args.agentsSubcommand,
|
|
1500
|
+
...(args.prompt[0] === undefined ? {} : { target: args.prompt[0] }),
|
|
1501
|
+
...(args.name === undefined ? {} : { name: args.name }),
|
|
1502
|
+
...(args.artifacts === undefined ? {} : { artifacts: args.artifacts }),
|
|
1503
|
+
...(args.credentialStdin === undefined ? {} : { credentialStdin: args.credentialStdin }),
|
|
1504
|
+
...(args.acknowledgeEgress === undefined
|
|
1505
|
+
? {}
|
|
1506
|
+
: { acknowledgeEgress: args.acknowledgeEgress }),
|
|
1507
|
+
yes: args.yes,
|
|
1508
|
+
json: args.json,
|
|
1509
|
+
}, {
|
|
1510
|
+
baseUrl,
|
|
1511
|
+
apiKey,
|
|
1512
|
+
explicitKey,
|
|
1513
|
+
...(io.fetchImpl === undefined ? {} : { fetchImpl: io.fetchImpl }),
|
|
1514
|
+
}, {
|
|
1515
|
+
out: io.out,
|
|
1516
|
+
err: io.err,
|
|
1517
|
+
readCredential: io.readCredentialImpl ?? readCredentialFromStdin,
|
|
1518
|
+
confirm: io.readCredentialImpl ?? ((prompt) => readConfirmationLine(prompt)),
|
|
1519
|
+
});
|
|
1520
|
+
return AGENTS_EXIT[outcome];
|
|
1521
|
+
}
|
|
1522
|
+
if (args.command === "runs") {
|
|
1523
|
+
// The file is read here, as `workflows define` reads its definition, so the command module
|
|
1524
|
+
// stays a pure function of what it was given.
|
|
1525
|
+
let inputJson;
|
|
1526
|
+
if (args.input !== undefined) {
|
|
1527
|
+
try {
|
|
1528
|
+
inputJson = (io.readFileImpl ?? ((path) => readFileSync(path, "utf8")))(args.input);
|
|
1529
|
+
}
|
|
1530
|
+
catch (error) {
|
|
1531
|
+
io.err(`Cannot read --input ${args.input}: ${error instanceof Error ? error.message : String(error)}`);
|
|
1532
|
+
return EXIT.USAGE;
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
const outcome = await runRuns({
|
|
1536
|
+
subcommand: args.runsSubcommand,
|
|
1537
|
+
...(args.prompt[0] === undefined ? {} : { target: args.prompt[0] }),
|
|
1538
|
+
...(args.executor === undefined ? {} : { executor: args.executor }),
|
|
1539
|
+
...(args.contract === undefined ? {} : { contract: args.contract }),
|
|
1540
|
+
...(inputJson === undefined ? {} : { input: inputJson }),
|
|
1541
|
+
...(args.format === undefined ? {} : { format: args.format }),
|
|
1542
|
+
...(args.out === undefined ? {} : { out: args.out }),
|
|
1543
|
+
...(args.force === undefined ? {} : { force: args.force }),
|
|
1544
|
+
...(args.wait === undefined ? {} : { wait: args.wait }),
|
|
1545
|
+
...(args.timeoutMinutes === undefined ? {} : { timeoutMinutes: args.timeoutMinutes }),
|
|
1546
|
+
json: args.json,
|
|
1547
|
+
}, {
|
|
1548
|
+
baseUrl,
|
|
1549
|
+
apiKey,
|
|
1550
|
+
explicitKey,
|
|
1551
|
+
...(io.fetchImpl === undefined ? {} : { fetchImpl: io.fetchImpl }),
|
|
1552
|
+
}, {
|
|
1553
|
+
out: io.out,
|
|
1554
|
+
err: io.err,
|
|
1555
|
+
...(io.sleepImpl === undefined ? {} : { sleep: io.sleepImpl }),
|
|
1556
|
+
...(io.nowMsImpl === undefined ? {} : { nowMs: io.nowMsImpl }),
|
|
1557
|
+
});
|
|
1558
|
+
return RUNS_EXIT[outcome];
|
|
1559
|
+
}
|
|
1293
1560
|
if (args.command === "baseline") {
|
|
1294
1561
|
const baseline = new MakineBaselineClient({
|
|
1295
1562
|
baseUrl,
|
|
@@ -1474,6 +1741,14 @@ const RECEIPTS_EXIT = {
|
|
|
1474
1741
|
// A receipt that did not verify is not an error in the tool; it is the answer.
|
|
1475
1742
|
unverified: EXIT.RESULT_NOT_ACCEPTED,
|
|
1476
1743
|
};
|
|
1744
|
+
const RECEIPTS_SHOW_EXIT = {
|
|
1745
|
+
ok: EXIT.ACCEPTED,
|
|
1746
|
+
usage: EXIT.USAGE,
|
|
1747
|
+
// A run with no receipt, and a run nobody has, are both answers rather than tool errors.
|
|
1748
|
+
refused: EXIT.RESULT_NOT_ACCEPTED,
|
|
1749
|
+
auth: EXIT.AUTH,
|
|
1750
|
+
unavailable: EXIT.UNREACHABLE,
|
|
1751
|
+
};
|
|
1477
1752
|
const JUDGE_EXIT = {
|
|
1478
1753
|
ok: EXIT.ACCEPTED,
|
|
1479
1754
|
usage: EXIT.USAGE,
|
|
@@ -1481,6 +1756,13 @@ const JUDGE_EXIT = {
|
|
|
1481
1756
|
auth: EXIT.AUTH,
|
|
1482
1757
|
unavailable: EXIT.UNREACHABLE,
|
|
1483
1758
|
};
|
|
1759
|
+
const GOV_ID_EXIT = {
|
|
1760
|
+
ok: EXIT.ACCEPTED,
|
|
1761
|
+
usage: EXIT.USAGE,
|
|
1762
|
+
refused: EXIT.RESULT_NOT_ACCEPTED,
|
|
1763
|
+
auth: EXIT.AUTH,
|
|
1764
|
+
unavailable: EXIT.UNREACHABLE,
|
|
1765
|
+
};
|
|
1484
1766
|
const SUGGESTIONS_EXIT = {
|
|
1485
1767
|
ok: EXIT.ACCEPTED,
|
|
1486
1768
|
usage: EXIT.USAGE,
|
|
@@ -1537,6 +1819,25 @@ const WORKFLOWS_EXIT = {
|
|
|
1537
1819
|
auth: EXIT.AUTH,
|
|
1538
1820
|
unavailable: EXIT.UNREACHABLE,
|
|
1539
1821
|
};
|
|
1822
|
+
const AGENTS_EXIT = {
|
|
1823
|
+
ok: EXIT.ACCEPTED,
|
|
1824
|
+
usage: EXIT.USAGE,
|
|
1825
|
+
refused: EXIT.RESULT_NOT_ACCEPTED,
|
|
1826
|
+
auth: EXIT.AUTH,
|
|
1827
|
+
unavailable: EXIT.UNREACHABLE,
|
|
1828
|
+
};
|
|
1829
|
+
/**
|
|
1830
|
+
* `not_accepted` is the run's own verdict, which is what a CI step branches on; a refusal of the
|
|
1831
|
+
* submission itself is the same class of outcome, because Makine answered and the answer was no.
|
|
1832
|
+
*/
|
|
1833
|
+
const RUNS_EXIT = {
|
|
1834
|
+
ok: EXIT.ACCEPTED,
|
|
1835
|
+
usage: EXIT.USAGE,
|
|
1836
|
+
not_accepted: EXIT.RESULT_NOT_ACCEPTED,
|
|
1837
|
+
refused: EXIT.RESULT_NOT_ACCEPTED,
|
|
1838
|
+
auth: EXIT.AUTH,
|
|
1839
|
+
unavailable: EXIT.UNREACHABLE,
|
|
1840
|
+
};
|
|
1540
1841
|
const BASELINE_EXIT = {
|
|
1541
1842
|
ok: EXIT.ACCEPTED,
|
|
1542
1843
|
usage: EXIT.USAGE,
|