@acsetra/runner 0.1.89 → 0.1.90
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/bin/runner.js +1 -1
- package/lib/grammar.json +118 -3
- package/lib/grammar_info.js +2 -1
- package/lib/help.js +2 -2
- package/lib/verbs.js +6 -0
- package/package.json +1 -1
package/bin/runner.js
CHANGED
|
@@ -190,7 +190,7 @@ async function main() {
|
|
|
190
190
|
const argv = process.argv.slice(2);
|
|
191
191
|
if (!argv.length || ["-h", "--help"].includes(argv[0])) { console.log(renderTop()); return 0; }
|
|
192
192
|
const [cmd, ...rest] = argv;
|
|
193
|
-
if (["version", "--version", "-V"].includes(cmd)) { console.log("runner (@acsetra/runner) 0.1.
|
|
193
|
+
if (["version", "--version", "-V"].includes(cmd)) { console.log("runner (@acsetra/runner) 0.1.90"); return 0; }
|
|
194
194
|
|
|
195
195
|
// help — top-level, `help <topic>`, and per-verb `<cmd> … --help` (lexical, before toOp)
|
|
196
196
|
if (cmd === "help") {
|
package/lib/grammar.json
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"int_args": [
|
|
26
26
|
"at",
|
|
27
27
|
"days",
|
|
28
|
+
"limit",
|
|
28
29
|
"max_bytes",
|
|
29
30
|
"ordinal",
|
|
30
31
|
"rate",
|
|
@@ -36,10 +37,12 @@
|
|
|
36
37
|
"backoff"
|
|
37
38
|
],
|
|
38
39
|
"bool_args": [
|
|
40
|
+
"all_routes",
|
|
39
41
|
"atomic",
|
|
40
42
|
"auth_flow",
|
|
41
43
|
"autoplay",
|
|
42
44
|
"controls",
|
|
45
|
+
"disabled",
|
|
43
46
|
"enabled",
|
|
44
47
|
"force",
|
|
45
48
|
"if_absent",
|
|
@@ -217,6 +220,29 @@
|
|
|
217
220
|
"record.replay": [
|
|
218
221
|
"operation_namespace",
|
|
219
222
|
"operation_id"
|
|
223
|
+
],
|
|
224
|
+
"schedule.set": [
|
|
225
|
+
"code",
|
|
226
|
+
"pipeline",
|
|
227
|
+
"cron"
|
|
228
|
+
],
|
|
229
|
+
"schedule.show": [
|
|
230
|
+
"code"
|
|
231
|
+
],
|
|
232
|
+
"schedule.occurrences": [
|
|
233
|
+
"code"
|
|
234
|
+
],
|
|
235
|
+
"schedule.pause": [
|
|
236
|
+
"code"
|
|
237
|
+
],
|
|
238
|
+
"schedule.resume": [
|
|
239
|
+
"code"
|
|
240
|
+
],
|
|
241
|
+
"schedule.run_now": [
|
|
242
|
+
"code"
|
|
243
|
+
],
|
|
244
|
+
"schedule.remove": [
|
|
245
|
+
"code"
|
|
220
246
|
]
|
|
221
247
|
},
|
|
222
248
|
"planes": [
|
|
@@ -226,6 +252,7 @@
|
|
|
226
252
|
"css",
|
|
227
253
|
"head",
|
|
228
254
|
"record",
|
|
255
|
+
"schedule",
|
|
229
256
|
"set"
|
|
230
257
|
],
|
|
231
258
|
"short": {
|
|
@@ -529,6 +556,40 @@
|
|
|
529
556
|
"replay",
|
|
530
557
|
"record.replay"
|
|
531
558
|
]
|
|
559
|
+
],
|
|
560
|
+
"schedule": [
|
|
561
|
+
[
|
|
562
|
+
"set",
|
|
563
|
+
"schedule.set"
|
|
564
|
+
],
|
|
565
|
+
[
|
|
566
|
+
"list",
|
|
567
|
+
"schedule.list"
|
|
568
|
+
],
|
|
569
|
+
[
|
|
570
|
+
"show",
|
|
571
|
+
"schedule.show"
|
|
572
|
+
],
|
|
573
|
+
[
|
|
574
|
+
"occurrences",
|
|
575
|
+
"schedule.occurrences"
|
|
576
|
+
],
|
|
577
|
+
[
|
|
578
|
+
"pause",
|
|
579
|
+
"schedule.pause"
|
|
580
|
+
],
|
|
581
|
+
[
|
|
582
|
+
"resume",
|
|
583
|
+
"schedule.resume"
|
|
584
|
+
],
|
|
585
|
+
[
|
|
586
|
+
"run_now",
|
|
587
|
+
"schedule.run_now"
|
|
588
|
+
],
|
|
589
|
+
[
|
|
590
|
+
"remove",
|
|
591
|
+
"schedule.remove"
|
|
592
|
+
]
|
|
532
593
|
]
|
|
533
594
|
},
|
|
534
595
|
"group_aliases": {
|
|
@@ -931,6 +992,59 @@
|
|
|
931
992
|
"record.replay": {
|
|
932
993
|
"desc": "the stored terminal result of an operation (namespace + id)",
|
|
933
994
|
"kw": []
|
|
995
|
+
},
|
|
996
|
+
"schedule.set": {
|
|
997
|
+
"desc": "create/update an org-catalog five-field cron schedule for the explicit target scope",
|
|
998
|
+
"scope": "required",
|
|
999
|
+
"kw": [
|
|
1000
|
+
"label",
|
|
1001
|
+
"timezone",
|
|
1002
|
+
"input",
|
|
1003
|
+
"overlap",
|
|
1004
|
+
"misfire",
|
|
1005
|
+
"disabled"
|
|
1006
|
+
]
|
|
1007
|
+
},
|
|
1008
|
+
"schedule.list": {
|
|
1009
|
+
"desc": "list schedules for this target; --all-routes lists the org catalog",
|
|
1010
|
+
"scope": "required",
|
|
1011
|
+
"kw": [
|
|
1012
|
+
"all_routes"
|
|
1013
|
+
]
|
|
1014
|
+
},
|
|
1015
|
+
"schedule.show": {
|
|
1016
|
+
"desc": "show one target-addressed schedule",
|
|
1017
|
+
"scope": "required",
|
|
1018
|
+
"kw": []
|
|
1019
|
+
},
|
|
1020
|
+
"schedule.occurrences": {
|
|
1021
|
+
"desc": "list durable occurrence and launch receipts, newest first",
|
|
1022
|
+
"scope": "required",
|
|
1023
|
+
"kw": [
|
|
1024
|
+
"limit"
|
|
1025
|
+
]
|
|
1026
|
+
},
|
|
1027
|
+
"schedule.pause": {
|
|
1028
|
+
"desc": "pause one schedule and clear its next firing",
|
|
1029
|
+
"scope": "required",
|
|
1030
|
+
"kw": []
|
|
1031
|
+
},
|
|
1032
|
+
"schedule.resume": {
|
|
1033
|
+
"desc": "revalidate and resume one schedule, rebinding its routed pipeline when detached",
|
|
1034
|
+
"scope": "required",
|
|
1035
|
+
"kw": []
|
|
1036
|
+
},
|
|
1037
|
+
"schedule.run_now": {
|
|
1038
|
+
"desc": "enqueue once without moving the cron clock; --operation-id makes retries idempotent",
|
|
1039
|
+
"scope": "required",
|
|
1040
|
+
"kw": [
|
|
1041
|
+
"operation_id"
|
|
1042
|
+
]
|
|
1043
|
+
},
|
|
1044
|
+
"schedule.remove": {
|
|
1045
|
+
"desc": "delete one schedule and its occurrence history",
|
|
1046
|
+
"scope": "required",
|
|
1047
|
+
"kw": []
|
|
934
1048
|
}
|
|
935
1049
|
},
|
|
936
1050
|
"verbs_doc": {
|
|
@@ -1027,8 +1141,8 @@
|
|
|
1027
1141
|
"desc": "reconstruct a pipeline from its rows"
|
|
1028
1142
|
},
|
|
1029
1143
|
"run": {
|
|
1030
|
-
"usage": "run <pipeline> -i '{json}'",
|
|
1031
|
-
"desc": "test-run a pipeline
|
|
1144
|
+
"usage": "run <pipeline> [-i '{json}'] [--at scope | -S scope]",
|
|
1145
|
+
"desc": "test-run a pipeline; --at/-S deterministically selects the deepest ancestor route, while an unscoped run selects the globally deepest route and errors on a deepest tie"
|
|
1032
1146
|
},
|
|
1033
1147
|
"runs": {
|
|
1034
1148
|
"usage": "runs <launch_id>",
|
|
@@ -1108,7 +1222,8 @@
|
|
|
1108
1222
|
"backend": {
|
|
1109
1223
|
"groups": [
|
|
1110
1224
|
"set",
|
|
1111
|
-
"record"
|
|
1225
|
+
"record",
|
|
1226
|
+
"schedule"
|
|
1112
1227
|
],
|
|
1113
1228
|
"verbs": [
|
|
1114
1229
|
"signin",
|
package/lib/grammar_info.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Node mirror of acsetra_cli/grammar_info.py: reads the INSTALLED manifest
|
|
3
3
|
// (lib/grammar.json), renders one JSON payload with every operation's positional
|
|
4
4
|
// order, the named argument a bare `--json` fills, `-b` bodies, flag coercion
|
|
5
|
-
// types, and short aliases. grammar_version is the sha256 of the manifest bytes
|
|
5
|
+
// types, scope requirement, and short aliases. grammar_version is the sha256 of the manifest bytes
|
|
6
6
|
// — the same hash the server's context pack reports.
|
|
7
7
|
import crypto from "node:crypto";
|
|
8
8
|
import fs from "node:fs";
|
|
@@ -33,6 +33,7 @@ function opEntry(op) {
|
|
|
33
33
|
pos: [...(GRAMMAR.pos[op] || [])],
|
|
34
34
|
json: op in GRAMMAR.primary_json ? GRAMMAR.primary_json[op] : null,
|
|
35
35
|
body: Boolean(doc.body),
|
|
36
|
+
scope: doc.scope || "optional",
|
|
36
37
|
flags: Object.fromEntries(kw.map(k => [k, vtype(k)])),
|
|
37
38
|
short: Object.fromEntries(kw.filter(k => k in rev)
|
|
38
39
|
.map(k => ["-" + rev[k], "--" + k.replace(/_/g, "-")])),
|
package/lib/help.js
CHANGED
|
@@ -54,7 +54,7 @@ export function renderOp(op) {
|
|
|
54
54
|
if (prim) parts.push(`--json '{${prim}}'`);
|
|
55
55
|
if (body) parts.push("-b <code|->");
|
|
56
56
|
for (const k of kw) parts.push(usageFlag(k));
|
|
57
|
-
parts.push("[-S scope]");
|
|
57
|
+
parts.push(doc.scope === "required" ? "-S <scope>" : "[-S scope]");
|
|
58
58
|
|
|
59
59
|
const out = ["Usage:", " " + parts.join(" "), ""];
|
|
60
60
|
if (doc.desc) out.push(doc.desc, "");
|
|
@@ -115,7 +115,7 @@ export function renderTop() {
|
|
|
115
115
|
out.push("Authoring (planes — run `r <group> --help` for subcommands)",
|
|
116
116
|
" r app create <name> ; r apps",
|
|
117
117
|
" r auth <app> require home.acsetra.com sign-in to use an app",
|
|
118
|
-
" r set | css | asset | behavior | component | head <subverb> …",
|
|
118
|
+
" r set | css | asset | behavior | component | head | schedule <subverb> …",
|
|
119
119
|
" r pipe <code> -S <scope> -w c:l ; r w <code> <tier> …",
|
|
120
120
|
" r ls | inspect <set> | read <code> | show <pipe>",
|
|
121
121
|
" r run <pipe> -i '{…}' ; r runs <id> ; r doctor <app> ; r compile <app>",
|
package/lib/verbs.js
CHANGED
|
@@ -126,6 +126,12 @@ export function toOp(verb, rest) {
|
|
|
126
126
|
const { positionals, flags } = walk(rest);
|
|
127
127
|
const args = { pipeline: positionals[0] || flags.pipeline };
|
|
128
128
|
if ("input" in flags) args.input = coerce("input", flags.input);
|
|
129
|
+
if (flags.scope !== undefined && flags.at !== undefined && flags.scope !== flags.at) {
|
|
130
|
+
throw new VerbError("run received different --at and -S/--scope values");
|
|
131
|
+
}
|
|
132
|
+
if (flags.scope !== undefined || flags.at !== undefined) {
|
|
133
|
+
args.scope = flags.scope !== undefined ? flags.scope : flags.at;
|
|
134
|
+
}
|
|
129
135
|
return ["run", args];
|
|
130
136
|
}
|
|
131
137
|
if (verb === "runs") { const { positionals } = walk(rest); return ["runs", { launch: positionals[0] }]; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acsetra/runner",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.90",
|
|
4
4
|
"description": "Runner CLI — author and run hosted Runner apps from your terminal (the `runner` command).",
|
|
5
5
|
"keywords": ["runner", "acsetra", "cli", "agent", "low-code"],
|
|
6
6
|
"license": "MIT",
|