cnagent 2.2.9 → 2.2.11
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/README.md +12 -14
- package/package.json +1 -1
- package/tools/dist/cn.js +1696 -680
- package/tools/dist/inbox.js +205 -55
package/tools/dist/inbox.js
CHANGED
|
@@ -24855,18 +24855,15 @@ var require_inbox_lib = __commonJS({
|
|
|
24855
24855
|
function report_result(param) {
|
|
24856
24856
|
if (param.TAG !== /* Fetched */
|
|
24857
24857
|
0) {
|
|
24858
|
-
return
|
|
24859
|
-
|
|
24860
|
-
|
|
24861
|
-
|
|
24862
|
-
),
|
|
24863
|
-
_0: {
|
|
24858
|
+
return [
|
|
24859
|
+
/* Skip */
|
|
24860
|
+
2,
|
|
24861
|
+
Curry2._2(Stdlib__Printf2.sprintf({
|
|
24864
24862
|
TAG: (
|
|
24865
|
-
/*
|
|
24866
|
-
|
|
24863
|
+
/* Format */
|
|
24864
|
+
0
|
|
24867
24865
|
),
|
|
24868
|
-
_0:
|
|
24869
|
-
_1: {
|
|
24866
|
+
_0: {
|
|
24870
24867
|
TAG: (
|
|
24871
24868
|
/* String */
|
|
24872
24869
|
2
|
|
@@ -24906,25 +24903,22 @@ var require_inbox_lib = __commonJS({
|
|
|
24906
24903
|
}
|
|
24907
24904
|
}
|
|
24908
24905
|
}
|
|
24909
|
-
}
|
|
24910
|
-
|
|
24911
|
-
|
|
24912
|
-
|
|
24906
|
+
},
|
|
24907
|
+
_1: "%s (%s)"
|
|
24908
|
+
}), param._0, param._1)
|
|
24909
|
+
];
|
|
24913
24910
|
}
|
|
24914
24911
|
const name = param._0;
|
|
24915
24912
|
if (param._1) {
|
|
24916
|
-
return
|
|
24917
|
-
|
|
24918
|
-
|
|
24919
|
-
|
|
24920
|
-
),
|
|
24921
|
-
_0: {
|
|
24913
|
+
return [
|
|
24914
|
+
/* Alert */
|
|
24915
|
+
1,
|
|
24916
|
+
Curry2._2(Stdlib__Printf2.sprintf({
|
|
24922
24917
|
TAG: (
|
|
24923
|
-
/*
|
|
24924
|
-
|
|
24918
|
+
/* Format */
|
|
24919
|
+
0
|
|
24925
24920
|
),
|
|
24926
|
-
_0:
|
|
24927
|
-
_1: {
|
|
24921
|
+
_0: {
|
|
24928
24922
|
TAG: (
|
|
24929
24923
|
/* String */
|
|
24930
24924
|
2
|
|
@@ -24969,23 +24963,20 @@ var require_inbox_lib = __commonJS({
|
|
|
24969
24963
|
}
|
|
24970
24964
|
}
|
|
24971
24965
|
}
|
|
24972
|
-
}
|
|
24973
|
-
|
|
24974
|
-
|
|
24975
|
-
|
|
24966
|
+
},
|
|
24967
|
+
_1: "%s (%d inbound)"
|
|
24968
|
+
}), name, Stdlib__List2.length(param._1))
|
|
24969
|
+
];
|
|
24976
24970
|
} else {
|
|
24977
|
-
return
|
|
24978
|
-
|
|
24979
|
-
|
|
24980
|
-
|
|
24981
|
-
),
|
|
24982
|
-
_0: {
|
|
24971
|
+
return [
|
|
24972
|
+
/* Ok */
|
|
24973
|
+
0,
|
|
24974
|
+
Curry2._1(Stdlib__Printf2.sprintf({
|
|
24983
24975
|
TAG: (
|
|
24984
|
-
/*
|
|
24985
|
-
|
|
24976
|
+
/* Format */
|
|
24977
|
+
0
|
|
24986
24978
|
),
|
|
24987
|
-
_0:
|
|
24988
|
-
_1: {
|
|
24979
|
+
_0: {
|
|
24989
24980
|
TAG: (
|
|
24990
24981
|
/* String */
|
|
24991
24982
|
2
|
|
@@ -25005,12 +24996,77 @@ var require_inbox_lib = __commonJS({
|
|
|
25005
24996
|
0
|
|
25006
24997
|
)
|
|
25007
24998
|
}
|
|
25008
|
-
}
|
|
25009
|
-
|
|
25010
|
-
|
|
25011
|
-
|
|
24999
|
+
},
|
|
25000
|
+
_1: "%s (no inbound)"
|
|
25001
|
+
}), name)
|
|
25002
|
+
];
|
|
25012
25003
|
}
|
|
25013
25004
|
}
|
|
25005
|
+
function format_report2(param) {
|
|
25006
|
+
let prefix2;
|
|
25007
|
+
switch (param[0]) {
|
|
25008
|
+
case /* Ok */
|
|
25009
|
+
0:
|
|
25010
|
+
prefix2 = "[ok]";
|
|
25011
|
+
break;
|
|
25012
|
+
case /* Alert */
|
|
25013
|
+
1:
|
|
25014
|
+
prefix2 = "[!]";
|
|
25015
|
+
break;
|
|
25016
|
+
case /* Skip */
|
|
25017
|
+
2:
|
|
25018
|
+
prefix2 = "[-]";
|
|
25019
|
+
break;
|
|
25020
|
+
}
|
|
25021
|
+
return Curry2._2(Stdlib__Printf2.sprintf({
|
|
25022
|
+
TAG: (
|
|
25023
|
+
/* Format */
|
|
25024
|
+
0
|
|
25025
|
+
),
|
|
25026
|
+
_0: {
|
|
25027
|
+
TAG: (
|
|
25028
|
+
/* String_literal */
|
|
25029
|
+
11
|
|
25030
|
+
),
|
|
25031
|
+
_0: " ",
|
|
25032
|
+
_1: {
|
|
25033
|
+
TAG: (
|
|
25034
|
+
/* String */
|
|
25035
|
+
2
|
|
25036
|
+
),
|
|
25037
|
+
_0: (
|
|
25038
|
+
/* No_padding */
|
|
25039
|
+
0
|
|
25040
|
+
),
|
|
25041
|
+
_1: {
|
|
25042
|
+
TAG: (
|
|
25043
|
+
/* Char_literal */
|
|
25044
|
+
12
|
|
25045
|
+
),
|
|
25046
|
+
_0: (
|
|
25047
|
+
/* ' ' */
|
|
25048
|
+
32
|
|
25049
|
+
),
|
|
25050
|
+
_1: {
|
|
25051
|
+
TAG: (
|
|
25052
|
+
/* String */
|
|
25053
|
+
2
|
|
25054
|
+
),
|
|
25055
|
+
_0: (
|
|
25056
|
+
/* No_padding */
|
|
25057
|
+
0
|
|
25058
|
+
),
|
|
25059
|
+
_1: (
|
|
25060
|
+
/* End_of_format */
|
|
25061
|
+
0
|
|
25062
|
+
)
|
|
25063
|
+
}
|
|
25064
|
+
}
|
|
25065
|
+
}
|
|
25066
|
+
},
|
|
25067
|
+
_1: " %s %s"
|
|
25068
|
+
}), prefix2, param[1]);
|
|
25069
|
+
}
|
|
25014
25070
|
function collect_alerts(results) {
|
|
25015
25071
|
return Stdlib__List2.filter_map((function(param) {
|
|
25016
25072
|
if (param.TAG !== /* Fetched */
|
|
@@ -26271,6 +26327,7 @@ var require_inbox_lib = __commonJS({
|
|
|
26271
26327
|
make_peer,
|
|
26272
26328
|
filter_branches,
|
|
26273
26329
|
report_result,
|
|
26330
|
+
format_report: format_report2,
|
|
26274
26331
|
collect_alerts,
|
|
26275
26332
|
collect_branches,
|
|
26276
26333
|
format_alerts,
|
|
@@ -26299,6 +26356,76 @@ var Process$1 = {};
|
|
|
26299
26356
|
var Child_process$1 = {};
|
|
26300
26357
|
var Fs$1 = {};
|
|
26301
26358
|
var Path$1 = {};
|
|
26359
|
+
var Str = {};
|
|
26360
|
+
var check = String.fromCodePoint(10003);
|
|
26361
|
+
var cross = String.fromCodePoint(10007);
|
|
26362
|
+
var lightning = String.fromCodePoint(9889);
|
|
26363
|
+
var dot = String.fromCodePoint(183);
|
|
26364
|
+
function format_report(param) {
|
|
26365
|
+
let prefix;
|
|
26366
|
+
switch (param[0]) {
|
|
26367
|
+
case /* Ok */
|
|
26368
|
+
0:
|
|
26369
|
+
prefix = check;
|
|
26370
|
+
break;
|
|
26371
|
+
case /* Alert */
|
|
26372
|
+
1:
|
|
26373
|
+
prefix = lightning;
|
|
26374
|
+
break;
|
|
26375
|
+
case /* Skip */
|
|
26376
|
+
2:
|
|
26377
|
+
prefix = dot;
|
|
26378
|
+
break;
|
|
26379
|
+
}
|
|
26380
|
+
return Curry._2(Stdlib__Printf.sprintf({
|
|
26381
|
+
TAG: (
|
|
26382
|
+
/* Format */
|
|
26383
|
+
0
|
|
26384
|
+
),
|
|
26385
|
+
_0: {
|
|
26386
|
+
TAG: (
|
|
26387
|
+
/* String_literal */
|
|
26388
|
+
11
|
|
26389
|
+
),
|
|
26390
|
+
_0: " ",
|
|
26391
|
+
_1: {
|
|
26392
|
+
TAG: (
|
|
26393
|
+
/* String */
|
|
26394
|
+
2
|
|
26395
|
+
),
|
|
26396
|
+
_0: (
|
|
26397
|
+
/* No_padding */
|
|
26398
|
+
0
|
|
26399
|
+
),
|
|
26400
|
+
_1: {
|
|
26401
|
+
TAG: (
|
|
26402
|
+
/* Char_literal */
|
|
26403
|
+
12
|
|
26404
|
+
),
|
|
26405
|
+
_0: (
|
|
26406
|
+
/* ' ' */
|
|
26407
|
+
32
|
|
26408
|
+
),
|
|
26409
|
+
_1: {
|
|
26410
|
+
TAG: (
|
|
26411
|
+
/* String */
|
|
26412
|
+
2
|
|
26413
|
+
),
|
|
26414
|
+
_0: (
|
|
26415
|
+
/* No_padding */
|
|
26416
|
+
0
|
|
26417
|
+
),
|
|
26418
|
+
_1: (
|
|
26419
|
+
/* End_of_format */
|
|
26420
|
+
0
|
|
26421
|
+
)
|
|
26422
|
+
}
|
|
26423
|
+
}
|
|
26424
|
+
}
|
|
26425
|
+
},
|
|
26426
|
+
_1: " %s %s"
|
|
26427
|
+
}), prefix, param[1]);
|
|
26428
|
+
}
|
|
26302
26429
|
function run_cmd(cmd) {
|
|
26303
26430
|
try {
|
|
26304
26431
|
return Child_process.execSync(cmd, {
|
|
@@ -26481,7 +26608,7 @@ function run_check(hub_path, my_name, peers) {
|
|
|
26481
26608
|
return check_peer_inbound(hub_path, param);
|
|
26482
26609
|
}), peers);
|
|
26483
26610
|
Stdlib__List.iter((function(r) {
|
|
26484
|
-
console.log(Inbox_lib.report_result(r));
|
|
26611
|
+
console.log(format_report(Inbox_lib.report_result(r)));
|
|
26485
26612
|
}), results);
|
|
26486
26613
|
const alerts = Inbox_lib.collect_alerts(results);
|
|
26487
26614
|
console.log("");
|
|
@@ -26525,7 +26652,7 @@ function execute_action(hub_path, action) {
|
|
|
26525
26652
|
return false;
|
|
26526
26653
|
}
|
|
26527
26654
|
} catch (exn) {
|
|
26528
|
-
console.log(Curry.
|
|
26655
|
+
console.log(Curry._2(Stdlib__Printf.sprintf({
|
|
26529
26656
|
TAG: (
|
|
26530
26657
|
/* Format */
|
|
26531
26658
|
0
|
|
@@ -26535,7 +26662,7 @@ function execute_action(hub_path, action) {
|
|
|
26535
26662
|
/* String_literal */
|
|
26536
26663
|
11
|
|
26537
26664
|
),
|
|
26538
|
-
_0: "
|
|
26665
|
+
_0: " ",
|
|
26539
26666
|
_1: {
|
|
26540
26667
|
TAG: (
|
|
26541
26668
|
/* String */
|
|
@@ -26545,14 +26672,31 @@ function execute_action(hub_path, action) {
|
|
|
26545
26672
|
/* No_padding */
|
|
26546
26673
|
0
|
|
26547
26674
|
),
|
|
26548
|
-
_1:
|
|
26549
|
-
|
|
26550
|
-
|
|
26551
|
-
|
|
26675
|
+
_1: {
|
|
26676
|
+
TAG: (
|
|
26677
|
+
/* String_literal */
|
|
26678
|
+
11
|
|
26679
|
+
),
|
|
26680
|
+
_0: " Failed: ",
|
|
26681
|
+
_1: {
|
|
26682
|
+
TAG: (
|
|
26683
|
+
/* String */
|
|
26684
|
+
2
|
|
26685
|
+
),
|
|
26686
|
+
_0: (
|
|
26687
|
+
/* No_padding */
|
|
26688
|
+
0
|
|
26689
|
+
),
|
|
26690
|
+
_1: (
|
|
26691
|
+
/* End_of_format */
|
|
26692
|
+
0
|
|
26693
|
+
)
|
|
26694
|
+
}
|
|
26695
|
+
}
|
|
26552
26696
|
}
|
|
26553
26697
|
},
|
|
26554
|
-
_1: "
|
|
26555
|
-
}), Inbox_lib.string_of_atomic_action(action)));
|
|
26698
|
+
_1: " %s Failed: %s"
|
|
26699
|
+
}), cross, Inbox_lib.string_of_atomic_action(action)));
|
|
26556
26700
|
return false;
|
|
26557
26701
|
}
|
|
26558
26702
|
}
|
|
@@ -26804,9 +26948,9 @@ function materialize_branch(hub_path, my_name, peer, branch) {
|
|
|
26804
26948
|
_1: "Materializing %s..."
|
|
26805
26949
|
}), branch));
|
|
26806
26950
|
if (execute_actions(hub_path, actions)) {
|
|
26807
|
-
console.log("
|
|
26951
|
+
console.log(" " + (check + " Thread created"));
|
|
26808
26952
|
} else {
|
|
26809
|
-
console.log("
|
|
26953
|
+
console.log(" " + (cross + " Failed to create thread"));
|
|
26810
26954
|
}
|
|
26811
26955
|
}
|
|
26812
26956
|
function run_process(hub_path, my_name, peers) {
|
|
@@ -27146,10 +27290,10 @@ function run_flush(hub_path, _my_name, _peers) {
|
|
|
27146
27290
|
},
|
|
27147
27291
|
_1: "rm %s"
|
|
27148
27292
|
}), thread_path));
|
|
27149
|
-
console.log("
|
|
27293
|
+
console.log(" " + (check + " Done (thread removed)"));
|
|
27150
27294
|
processed.contents = processed.contents + 1 | 0;
|
|
27151
27295
|
} else {
|
|
27152
|
-
console.log("
|
|
27296
|
+
console.log(" " + (cross + " Execution failed"));
|
|
27153
27297
|
skipped.contents = skipped.contents + 1 | 0;
|
|
27154
27298
|
}
|
|
27155
27299
|
return;
|
|
@@ -27403,6 +27547,12 @@ module.exports = {
|
|
|
27403
27547
|
Child_process: Child_process$1,
|
|
27404
27548
|
Fs: Fs$1,
|
|
27405
27549
|
Path: Path$1,
|
|
27550
|
+
Str,
|
|
27551
|
+
check,
|
|
27552
|
+
cross,
|
|
27553
|
+
lightning,
|
|
27554
|
+
dot,
|
|
27555
|
+
format_report,
|
|
27406
27556
|
run_cmd,
|
|
27407
27557
|
find_inbound_from_peer,
|
|
27408
27558
|
check_peer_inbound,
|