@acsetra/runner 0.1.87 → 0.1.89
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 +88 -6
- package/lib/verbs.js +5 -2
- 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.89"); 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
|
@@ -7,13 +7,19 @@
|
|
|
7
7
|
"config_schema",
|
|
8
8
|
"decls",
|
|
9
9
|
"input",
|
|
10
|
+
"items",
|
|
10
11
|
"meta",
|
|
11
12
|
"overrides",
|
|
12
13
|
"parts",
|
|
14
|
+
"patches",
|
|
13
15
|
"props",
|
|
16
|
+
"replace_meta",
|
|
17
|
+
"requires",
|
|
14
18
|
"schema",
|
|
15
19
|
"spec",
|
|
16
20
|
"storage",
|
|
21
|
+
"targets",
|
|
22
|
+
"tests",
|
|
17
23
|
"tree"
|
|
18
24
|
],
|
|
19
25
|
"int_args": [
|
|
@@ -30,11 +36,14 @@
|
|
|
30
36
|
"backoff"
|
|
31
37
|
],
|
|
32
38
|
"bool_args": [
|
|
39
|
+
"atomic",
|
|
33
40
|
"auth_flow",
|
|
34
41
|
"autoplay",
|
|
35
42
|
"controls",
|
|
36
43
|
"enabled",
|
|
37
44
|
"force",
|
|
45
|
+
"if_absent",
|
|
46
|
+
"include_deleted",
|
|
38
47
|
"keep",
|
|
39
48
|
"map",
|
|
40
49
|
"muted",
|
|
@@ -53,7 +62,9 @@
|
|
|
53
62
|
"component.set": "tree",
|
|
54
63
|
"component.set_route": "props",
|
|
55
64
|
"behavior.attach": "config",
|
|
56
|
-
"head.set": "attrs"
|
|
65
|
+
"head.set": "attrs",
|
|
66
|
+
"record.transact": "targets",
|
|
67
|
+
"record.commit": "patches"
|
|
57
68
|
},
|
|
58
69
|
"pos": {
|
|
59
70
|
"set.create": [
|
|
@@ -191,6 +202,21 @@
|
|
|
191
202
|
],
|
|
192
203
|
"head.remove": [
|
|
193
204
|
"code"
|
|
205
|
+
],
|
|
206
|
+
"record.get": [
|
|
207
|
+
"set_code",
|
|
208
|
+
"code"
|
|
209
|
+
],
|
|
210
|
+
"record.commit": [
|
|
211
|
+
"set_code",
|
|
212
|
+
"code"
|
|
213
|
+
],
|
|
214
|
+
"record.transact": [
|
|
215
|
+
"operation_id"
|
|
216
|
+
],
|
|
217
|
+
"record.replay": [
|
|
218
|
+
"operation_namespace",
|
|
219
|
+
"operation_id"
|
|
194
220
|
]
|
|
195
221
|
},
|
|
196
222
|
"planes": [
|
|
@@ -199,6 +225,7 @@
|
|
|
199
225
|
"component",
|
|
200
226
|
"css",
|
|
201
227
|
"head",
|
|
228
|
+
"record",
|
|
202
229
|
"set"
|
|
203
230
|
],
|
|
204
231
|
"short": {
|
|
@@ -484,6 +511,24 @@
|
|
|
484
511
|
"validate",
|
|
485
512
|
"head.validate"
|
|
486
513
|
]
|
|
514
|
+
],
|
|
515
|
+
"record": [
|
|
516
|
+
[
|
|
517
|
+
"get",
|
|
518
|
+
"record.get"
|
|
519
|
+
],
|
|
520
|
+
[
|
|
521
|
+
"commit",
|
|
522
|
+
"record.commit"
|
|
523
|
+
],
|
|
524
|
+
[
|
|
525
|
+
"transact",
|
|
526
|
+
"record.transact"
|
|
527
|
+
],
|
|
528
|
+
[
|
|
529
|
+
"replay",
|
|
530
|
+
"record.replay"
|
|
531
|
+
]
|
|
487
532
|
]
|
|
488
533
|
},
|
|
489
534
|
"group_aliases": {
|
|
@@ -494,7 +539,7 @@
|
|
|
494
539
|
},
|
|
495
540
|
"ops_doc": {
|
|
496
541
|
"set.create": {
|
|
497
|
-
"desc": "create a value set (mint your own plane/registry)",
|
|
542
|
+
"desc": "create a value set (mint your own plane/registry) — born a keyed record set: point reads, field patches, revisions/etags, durable receipts; never the legacy whole-collection path",
|
|
498
543
|
"kw": [
|
|
499
544
|
"label",
|
|
500
545
|
"kind",
|
|
@@ -502,12 +547,13 @@
|
|
|
502
547
|
]
|
|
503
548
|
},
|
|
504
549
|
"set.put": {
|
|
505
|
-
"desc": "write/merge a row (--json is the row meta; MERGES unless --replace
|
|
550
|
+
"desc": "write/merge a row (--json is the row meta). Every set you mint is a keyed record set: each sent key lands as ONE atomic field patch (disjoint edits compose, a stale edit of a changed field conflicts); MERGES unless --replace; --etag makes the write conditional",
|
|
506
551
|
"kw": [
|
|
507
552
|
"label",
|
|
508
553
|
"ordinal",
|
|
509
554
|
"enabled",
|
|
510
|
-
"replace"
|
|
555
|
+
"replace",
|
|
556
|
+
"etag"
|
|
511
557
|
]
|
|
512
558
|
},
|
|
513
559
|
"set.declare_schema": {
|
|
@@ -853,6 +899,38 @@
|
|
|
853
899
|
"head.validate": {
|
|
854
900
|
"desc": "re-check every head entry",
|
|
855
901
|
"kw": []
|
|
902
|
+
},
|
|
903
|
+
"record.get": {
|
|
904
|
+
"desc": "ONE row by code with its record_id / revision / etag (the keyed point read)",
|
|
905
|
+
"kw": [
|
|
906
|
+
"include_deleted"
|
|
907
|
+
]
|
|
908
|
+
},
|
|
909
|
+
"record.commit": {
|
|
910
|
+
"desc": "atomic commit on one record (--json is the patches list: [{op:set|unset|increment|add_unique|remove_value|test, path:'/field', value}]); action create|patch|replace|delete|restore; expected_etag makes it conditional; items=[…] is a one-row batch with per-item outcomes",
|
|
911
|
+
"kw": [
|
|
912
|
+
"action",
|
|
913
|
+
"tests",
|
|
914
|
+
"items",
|
|
915
|
+
"batch_policy",
|
|
916
|
+
"expected_etag",
|
|
917
|
+
"expected_revision",
|
|
918
|
+
"operation_id",
|
|
919
|
+
"label",
|
|
920
|
+
"ordinal",
|
|
921
|
+
"replace_meta",
|
|
922
|
+
"if_absent"
|
|
923
|
+
]
|
|
924
|
+
},
|
|
925
|
+
"record.transact": {
|
|
926
|
+
"desc": "several records, ONE operation: <operation_id> names it (a uuid you mint; retry = replay), --json is the targets list [{set_code, code, action?, patches?|items?, expected_etag?, requires?:[{target, item_id?}]}]; --atomic is all-or-none, else one outcome per target",
|
|
927
|
+
"kw": [
|
|
928
|
+
"atomic"
|
|
929
|
+
]
|
|
930
|
+
},
|
|
931
|
+
"record.replay": {
|
|
932
|
+
"desc": "the stored terminal result of an operation (namespace + id)",
|
|
933
|
+
"kw": []
|
|
856
934
|
}
|
|
857
935
|
},
|
|
858
936
|
"verbs_doc": {
|
|
@@ -990,7 +1068,10 @@
|
|
|
990
1068
|
" llm [--provider openai] [--model M] one model call (keys injected server-side)",
|
|
991
1069
|
" [--system-from K] [--user-from ask] [-k/--keys a,b]",
|
|
992
1070
|
" pipeline -P/--calls CODE|SCOPE/CODE run an EXISTING pipeline of this org as this step",
|
|
993
|
-
" (a real child launch; -s '{\"pick\":[
|
|
1071
|
+
" (a real child launch; -s '{\"pick\":[…],\"input\":{…}}' shapes its input)",
|
|
1072
|
+
" batch -s '{\"over\":\"items\",\"each\":{\"tier\":…,\"spec\":{…}},\"concurrency\":8}'",
|
|
1073
|
+
" ONE run fans a sub-worker over a list: bounded (default 8, max 32), one item's",
|
|
1074
|
+
" failure is its own {error,index}, the answer counts ok/failed — never loop ctx.run"
|
|
994
1075
|
]
|
|
995
1076
|
},
|
|
996
1077
|
"op": {
|
|
@@ -1026,7 +1107,8 @@
|
|
|
1026
1107
|
},
|
|
1027
1108
|
"backend": {
|
|
1028
1109
|
"groups": [
|
|
1029
|
-
"set"
|
|
1110
|
+
"set",
|
|
1111
|
+
"record"
|
|
1030
1112
|
],
|
|
1031
1113
|
"verbs": [
|
|
1032
1114
|
"signin",
|
package/lib/verbs.js
CHANGED
|
@@ -45,7 +45,9 @@ function walk(rest) {
|
|
|
45
45
|
if (tok === "--json") {
|
|
46
46
|
const blob = rest[++i]; i++;
|
|
47
47
|
const obj = blob.startsWith("@") ? JSON.parse(fs.readFileSync(blob.slice(1), "utf8")) : JSON.parse(blob);
|
|
48
|
-
flags.__json
|
|
48
|
+
if (!Array.isArray(obj) && flags.__json && !Array.isArray(flags.__json)) Object.assign(flags.__json, obj);
|
|
49
|
+
else flags.__json = obj; // an object, or a LIST primary (patches / targets)
|
|
50
|
+
continue;
|
|
49
51
|
}
|
|
50
52
|
if (tok.startsWith("--") || (tok.startsWith("-") && tok.length === 2 && !/\d/.test(tok[1]))) {
|
|
51
53
|
let name = tok.replace(/^-+/, "").replace(/-/g, "_");
|
|
@@ -75,7 +77,8 @@ function assemble(op, positionals, flags) {
|
|
|
75
77
|
const blob = flags.__json; delete flags.__json;
|
|
76
78
|
const prim = PRIMARY_JSON[op];
|
|
77
79
|
if (prim && !(prim in args)) args[prim] = blob;
|
|
78
|
-
else Object.assign(args, blob);
|
|
80
|
+
else if (!Array.isArray(blob)) Object.assign(args, blob);
|
|
81
|
+
else throw new VerbError(`\`${op}\` takes --json as an object of named args (a list is only the primary payload of ops like record.commit / record.transact)`);
|
|
79
82
|
}
|
|
80
83
|
delete flags.__body;
|
|
81
84
|
for (const [k, v] of Object.entries(flags)) args[k] = coerce(k, v);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acsetra/runner",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.89",
|
|
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",
|