cnagent 2.2.18 → 2.2.19
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/package.json +1 -1
- package/tools/dist/cn.js +79 -141
package/package.json
CHANGED
package/tools/dist/cn.js
CHANGED
|
@@ -13667,7 +13667,7 @@ var require_cn_lib = __commonJS({
|
|
|
13667
13667
|
);
|
|
13668
13668
|
}
|
|
13669
13669
|
var help_text = "cn - Coherent Network agent CLI\n\nUsage: cn <command> [options]\n\nCommands:\n # Agent decisions (output)\n delete <thread> GTD: discard\n defer <thread> GTD: postpone\n delegate <t> <peer> GTD: forward\n do <thread> GTD: claim/start\n done <thread> GTD: complete \xE2\x86\x92 archive\n reply <thread> <msg> Append to thread\n send <peer> <msg> Message to peer (or self)\n \n # cn operations (orchestrator)\n sync Fetch inbound + send outbound\n in Queue inbox \xE2\x86\x92 input.md \xE2\x86\x92 wake agent (alias: inbound, process)\n queue [list|clear] View or clear the task queue\n mca [list|add <desc>] Surface MCAs for community pickup\n inbox List inbox threads\n outbox List outbox threads\n next Get next inbox item (with cadence)\n read <thread> Read thread with cadence\n \n # Thread creation\n adhoc <title> Create adhoc thread\n daily Create/show daily reflection\n weekly Create/show weekly reflection\n \n # Hub management\n init [name] Create new hub\n setup System setup (logrotate + cron) \xE2\x80\x94 run with sudo\n status Show hub state\n commit [msg] Stage + commit\n push Push to origin\n save [msg] Commit + push\n peer Manage peers\n doctor Health check\n update Update cn to latest version\n\nAliases:\n i = inbox, o = outbox, s = status, d = doctor\n\nFlags:\n --help, -h Show help\n --version, -V Show version\n --json Machine-readable output\n --quiet, -q Minimal output\n --dry-run Show what would happen\n\nActor Model:\n cn runs on cron (every 5 min). It:\n 1. Syncs peers \xE2\x86\x92 queues new inbox items to state/queue/\n 2. If input.md empty \xE2\x86\x92 pops from queue \xE2\x86\x92 writes input.md \xE2\x86\x92 wakes agent\n Agent reads input.md, processes, deletes when done.\n";
|
|
13670
|
-
var version = "2.2.
|
|
13670
|
+
var version = "2.2.19";
|
|
13671
13671
|
module2.exports = {
|
|
13672
13672
|
starts_with,
|
|
13673
13673
|
strip_prefix,
|
|
@@ -26532,53 +26532,7 @@ function find_hub_path(_dir) {
|
|
|
26532
26532
|
}
|
|
26533
26533
|
;
|
|
26534
26534
|
}
|
|
26535
|
-
function log_action(
|
|
26536
|
-
const logs_dir = Path.join(hub_path, "logs");
|
|
26537
|
-
ensure_dir(logs_dir);
|
|
26538
|
-
const entry = {
|
|
26539
|
-
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
26540
|
-
action,
|
|
26541
|
-
details
|
|
26542
|
-
};
|
|
26543
|
-
const date_str = Stdlib__String.sub((/* @__PURE__ */ new Date()).toISOString(), 0, 10).replace(/-/g, "");
|
|
26544
|
-
const log_file = Curry._1(Stdlib__Printf.sprintf({
|
|
26545
|
-
TAG: (
|
|
26546
|
-
/* Format */
|
|
26547
|
-
0
|
|
26548
|
-
),
|
|
26549
|
-
_0: {
|
|
26550
|
-
TAG: (
|
|
26551
|
-
/* String_literal */
|
|
26552
|
-
11
|
|
26553
|
-
),
|
|
26554
|
-
_0: "cn-",
|
|
26555
|
-
_1: {
|
|
26556
|
-
TAG: (
|
|
26557
|
-
/* String */
|
|
26558
|
-
2
|
|
26559
|
-
),
|
|
26560
|
-
_0: (
|
|
26561
|
-
/* No_padding */
|
|
26562
|
-
0
|
|
26563
|
-
),
|
|
26564
|
-
_1: {
|
|
26565
|
-
TAG: (
|
|
26566
|
-
/* String_literal */
|
|
26567
|
-
11
|
|
26568
|
-
),
|
|
26569
|
-
_0: ".log",
|
|
26570
|
-
_1: (
|
|
26571
|
-
/* End_of_format */
|
|
26572
|
-
0
|
|
26573
|
-
)
|
|
26574
|
-
}
|
|
26575
|
-
}
|
|
26576
|
-
},
|
|
26577
|
-
_1: "cn-%s.log"
|
|
26578
|
-
}), date_str);
|
|
26579
|
-
const prim1 = JSON.stringify(entry) + "\n";
|
|
26580
|
-
const prim0 = Path.join(logs_dir, log_file);
|
|
26581
|
-
Fs.appendFileSync(prim0, prim1);
|
|
26535
|
+
function log_action(_hub_path, _action, _details) {
|
|
26582
26536
|
}
|
|
26583
26537
|
function load_peers(hub_path) {
|
|
26584
26538
|
const peers_path = Path.join(hub_path, "state/peers.md");
|
|
@@ -26797,7 +26751,6 @@ function delete_remote_branch(hub_path, branch) {
|
|
|
26797
26751
|
}), branch);
|
|
26798
26752
|
const match2 = exec_in(hub_path, cmd2);
|
|
26799
26753
|
if (match2 !== void 0) {
|
|
26800
|
-
log_action(hub_path, "branch.delete", branch);
|
|
26801
26754
|
console.log(color("2", Curry._1(Stdlib__Printf.sprintf({
|
|
26802
26755
|
TAG: (
|
|
26803
26756
|
/* Format */
|
|
@@ -27201,7 +27154,7 @@ function reject_orphan_branch(hub_path, peer_name, branch) {
|
|
|
27201
27154
|
const prim0 = Path.join(outbox_dir, filename);
|
|
27202
27155
|
Fs.writeFileSync(prim0, content);
|
|
27203
27156
|
}
|
|
27204
|
-
|
|
27157
|
+
Curry._3(Stdlib__Printf.sprintf({
|
|
27205
27158
|
TAG: (
|
|
27206
27159
|
/* Format */
|
|
27207
27160
|
0
|
|
@@ -27269,7 +27222,7 @@ function reject_orphan_branch(hub_path, peer_name, branch) {
|
|
|
27269
27222
|
}
|
|
27270
27223
|
},
|
|
27271
27224
|
_1: "branch:%s peer:%s author:%s reason:orphan"
|
|
27272
|
-
}), branch, peer_name, author)
|
|
27225
|
+
}), branch, peer_name, author);
|
|
27273
27226
|
console.log(fail(Curry._2(Stdlib__Printf.sprintf({
|
|
27274
27227
|
TAG: (
|
|
27275
27228
|
/* Format */
|
|
@@ -28053,7 +28006,7 @@ function materialize_branch(clone_path, hub_path, inbox_dir, peer_name, branch)
|
|
|
28053
28006
|
};
|
|
28054
28007
|
const prim1 = Cn_lib.update_frontmatter(content, meta);
|
|
28055
28008
|
Fs.writeFileSync(inbox_path, prim1);
|
|
28056
|
-
|
|
28009
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
28057
28010
|
TAG: (
|
|
28058
28011
|
/* Format */
|
|
28059
28012
|
0
|
|
@@ -28090,7 +28043,7 @@ function materialize_branch(clone_path, hub_path, inbox_dir, peer_name, branch)
|
|
|
28090
28043
|
}
|
|
28091
28044
|
},
|
|
28092
28045
|
_1: "%s trigger:%s"
|
|
28093
|
-
}), inbox_file, trigger)
|
|
28046
|
+
}), inbox_file, trigger);
|
|
28094
28047
|
delete_remote_branch(clone_path, branch);
|
|
28095
28048
|
return inbox_file;
|
|
28096
28049
|
}), files);
|
|
@@ -28631,7 +28584,7 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
|
|
|
28631
28584
|
const prim0$1 = Path.join(sent_dir, file);
|
|
28632
28585
|
Fs.writeFileSync(prim0$1, prim1);
|
|
28633
28586
|
Fs.unlinkSync(file_path);
|
|
28634
|
-
|
|
28587
|
+
Curry._3(Stdlib__Printf.sprintf({
|
|
28635
28588
|
TAG: (
|
|
28636
28589
|
/* Format */
|
|
28637
28590
|
0
|
|
@@ -28692,7 +28645,7 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
|
|
|
28692
28645
|
}
|
|
28693
28646
|
},
|
|
28694
28647
|
_1: "to:%s thread:%s branch:%s"
|
|
28695
|
-
}), to_peer, file, branch_name)
|
|
28648
|
+
}), to_peer, file, branch_name);
|
|
28696
28649
|
console.log(ok(Curry._2(Stdlib__Printf.sprintf({
|
|
28697
28650
|
TAG: (
|
|
28698
28651
|
/* Format */
|
|
@@ -28740,7 +28693,7 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
|
|
|
28740
28693
|
}), to_peer, file)));
|
|
28741
28694
|
return file;
|
|
28742
28695
|
}
|
|
28743
|
-
|
|
28696
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
28744
28697
|
TAG: (
|
|
28745
28698
|
/* Format */
|
|
28746
28699
|
0
|
|
@@ -28791,7 +28744,7 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
|
|
|
28791
28744
|
}
|
|
28792
28745
|
},
|
|
28793
28746
|
_1: "to:%s thread:%s error:checkout failed"
|
|
28794
|
-
}), to_peer, file)
|
|
28747
|
+
}), to_peer, file);
|
|
28795
28748
|
console.log(fail(Curry._1(Stdlib__Printf.sprintf({
|
|
28796
28749
|
TAG: (
|
|
28797
28750
|
/* Format */
|
|
@@ -28822,7 +28775,7 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
|
|
|
28822
28775
|
}), file)));
|
|
28823
28776
|
return;
|
|
28824
28777
|
}
|
|
28825
|
-
|
|
28778
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
28826
28779
|
TAG: (
|
|
28827
28780
|
/* Format */
|
|
28828
28781
|
0
|
|
@@ -28873,7 +28826,7 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
|
|
|
28873
28826
|
}
|
|
28874
28827
|
},
|
|
28875
28828
|
_1: "thread:%s to:%s reason:no clone path"
|
|
28876
|
-
}), file, to_peer)
|
|
28829
|
+
}), file, to_peer);
|
|
28877
28830
|
console.log(fail(Curry._1(Stdlib__Printf.sprintf({
|
|
28878
28831
|
TAG: (
|
|
28879
28832
|
/* Format */
|
|
@@ -28904,7 +28857,7 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
|
|
|
28904
28857
|
}), to_peer)));
|
|
28905
28858
|
return;
|
|
28906
28859
|
}
|
|
28907
|
-
|
|
28860
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
28908
28861
|
TAG: (
|
|
28909
28862
|
/* Format */
|
|
28910
28863
|
0
|
|
@@ -28955,7 +28908,7 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
|
|
|
28955
28908
|
}
|
|
28956
28909
|
},
|
|
28957
28910
|
_1: "thread:%s to:%s reason:unknown peer"
|
|
28958
|
-
}), file, to_peer)
|
|
28911
|
+
}), file, to_peer);
|
|
28959
28912
|
console.log(fail(Curry._1(Stdlib__Printf.sprintf({
|
|
28960
28913
|
TAG: (
|
|
28961
28914
|
/* Format */
|
|
@@ -28986,7 +28939,7 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
|
|
|
28986
28939
|
}), to_peer)));
|
|
28987
28940
|
return;
|
|
28988
28941
|
}
|
|
28989
|
-
|
|
28942
|
+
Curry._1(Stdlib__Printf.sprintf({
|
|
28990
28943
|
TAG: (
|
|
28991
28944
|
/* Format */
|
|
28992
28945
|
0
|
|
@@ -29020,7 +28973,7 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
|
|
|
29020
28973
|
}
|
|
29021
28974
|
},
|
|
29022
28975
|
_1: "thread:%s reason:no recipient"
|
|
29023
|
-
}), file)
|
|
28976
|
+
}), file);
|
|
29024
28977
|
console.log(warn(Curry._1(Stdlib__Printf.sprintf({
|
|
29025
28978
|
TAG: (
|
|
29026
28979
|
/* Format */
|
|
@@ -29384,7 +29337,6 @@ function gtd_delete(hub_path, thread_id) {
|
|
|
29384
29337
|
const path = find_thread(hub_path, thread_id);
|
|
29385
29338
|
if (path !== void 0) {
|
|
29386
29339
|
Fs.unlinkSync(path);
|
|
29387
|
-
log_action(hub_path, "gtd.delete", thread_id);
|
|
29388
29340
|
console.log(ok(Curry._1(Stdlib__Printf.sprintf({
|
|
29389
29341
|
TAG: (
|
|
29390
29342
|
/* Format */
|
|
@@ -29470,7 +29422,7 @@ function gtd_defer(hub_path, thread_id, until) {
|
|
|
29470
29422
|
const prim0 = Path.join(deferred_dir, Path.basename(path));
|
|
29471
29423
|
Fs.writeFileSync(prim0, prim1);
|
|
29472
29424
|
Fs.unlinkSync(path);
|
|
29473
|
-
|
|
29425
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
29474
29426
|
TAG: (
|
|
29475
29427
|
/* Format */
|
|
29476
29428
|
0
|
|
@@ -29507,7 +29459,7 @@ function gtd_defer(hub_path, thread_id, until) {
|
|
|
29507
29459
|
}
|
|
29508
29460
|
},
|
|
29509
29461
|
_1: "%s until:%s"
|
|
29510
|
-
}), thread_id, until_str)
|
|
29462
|
+
}), thread_id, until_str);
|
|
29511
29463
|
const suffix = until !== void 0 ? " until " + until : "";
|
|
29512
29464
|
console.log(ok(Curry._2(Stdlib__Printf.sprintf({
|
|
29513
29465
|
TAG: (
|
|
@@ -29609,7 +29561,7 @@ function gtd_delegate(hub_path, name, thread_id, peer) {
|
|
|
29609
29561
|
const prim0 = Path.join(outbox_dir, Path.basename(path));
|
|
29610
29562
|
Fs.writeFileSync(prim0, prim1);
|
|
29611
29563
|
Fs.unlinkSync(path);
|
|
29612
|
-
|
|
29564
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
29613
29565
|
TAG: (
|
|
29614
29566
|
/* Format */
|
|
29615
29567
|
0
|
|
@@ -29646,7 +29598,7 @@ function gtd_delegate(hub_path, name, thread_id, peer) {
|
|
|
29646
29598
|
}
|
|
29647
29599
|
},
|
|
29648
29600
|
_1: "%s to:%s"
|
|
29649
|
-
}), thread_id, peer)
|
|
29601
|
+
}), thread_id, peer);
|
|
29650
29602
|
console.log(ok(Curry._2(Stdlib__Printf.sprintf({
|
|
29651
29603
|
TAG: (
|
|
29652
29604
|
/* Format */
|
|
@@ -29743,7 +29695,6 @@ function gtd_do(hub_path, thread_id) {
|
|
|
29743
29695
|
const prim0 = Path.join(doing_dir, Path.basename(path));
|
|
29744
29696
|
Fs.writeFileSync(prim0, prim1);
|
|
29745
29697
|
Fs.unlinkSync(path);
|
|
29746
|
-
log_action(hub_path, "gtd.do", thread_id);
|
|
29747
29698
|
console.log(ok(Curry._1(Stdlib__Printf.sprintf({
|
|
29748
29699
|
TAG: (
|
|
29749
29700
|
/* Format */
|
|
@@ -29822,7 +29773,6 @@ function gtd_done(hub_path, thread_id) {
|
|
|
29822
29773
|
const prim0 = Path.join(archived_dir, Path.basename(path));
|
|
29823
29774
|
Fs.writeFileSync(prim0, prim1);
|
|
29824
29775
|
Fs.unlinkSync(path);
|
|
29825
|
-
log_action(hub_path, "gtd.done", thread_id);
|
|
29826
29776
|
console.log(ok(Curry._1(Stdlib__Printf.sprintf({
|
|
29827
29777
|
TAG: (
|
|
29828
29778
|
/* Format */
|
|
@@ -30271,7 +30221,6 @@ function run_commit(hub_path, name, msg) {
|
|
|
30271
30221
|
_1: 'git commit -m "%s"'
|
|
30272
30222
|
}), escaped));
|
|
30273
30223
|
if (match2 !== void 0) {
|
|
30274
|
-
log_action(hub_path, "commit", message);
|
|
30275
30224
|
console.log(ok(Curry._1(Stdlib__Printf.sprintf({
|
|
30276
30225
|
TAG: (
|
|
30277
30226
|
/* Format */
|
|
@@ -30301,7 +30250,7 @@ function run_commit(hub_path, name, msg) {
|
|
|
30301
30250
|
_1: "Committed: %s"
|
|
30302
30251
|
}), message)));
|
|
30303
30252
|
} else {
|
|
30304
|
-
|
|
30253
|
+
Curry._1(Stdlib__Printf.sprintf({
|
|
30305
30254
|
TAG: (
|
|
30306
30255
|
/* Format */
|
|
30307
30256
|
0
|
|
@@ -30328,7 +30277,7 @@ function run_commit(hub_path, name, msg) {
|
|
|
30328
30277
|
}
|
|
30329
30278
|
},
|
|
30330
30279
|
_1: "error:%s"
|
|
30331
|
-
}), message)
|
|
30280
|
+
}), message);
|
|
30332
30281
|
console.log(fail("Commit failed"));
|
|
30333
30282
|
}
|
|
30334
30283
|
}
|
|
@@ -30365,7 +30314,6 @@ function run_push(hub_path) {
|
|
|
30365
30314
|
_1: "git push origin %s"
|
|
30366
30315
|
}), branch$1));
|
|
30367
30316
|
if (match2 !== void 0) {
|
|
30368
|
-
log_action(hub_path, "push", branch$1);
|
|
30369
30317
|
console.log(ok(Curry._1(Stdlib__Printf.sprintf({
|
|
30370
30318
|
TAG: (
|
|
30371
30319
|
/* Format */
|
|
@@ -30395,7 +30343,6 @@ function run_push(hub_path) {
|
|
|
30395
30343
|
_1: "Pushed to origin/%s"
|
|
30396
30344
|
}), branch$1)));
|
|
30397
30345
|
} else {
|
|
30398
|
-
log_action(hub_path, "push", "error");
|
|
30399
30346
|
console.log(fail("Push failed"));
|
|
30400
30347
|
}
|
|
30401
30348
|
return;
|
|
@@ -30504,7 +30451,7 @@ function run_send(hub_path, peer, message) {
|
|
|
30504
30451
|
}), peer, (/* @__PURE__ */ new Date()).toISOString(), first_line, message);
|
|
30505
30452
|
const prim0 = Path.join(outbox_dir, file_name);
|
|
30506
30453
|
Fs.writeFileSync(prim0, content);
|
|
30507
|
-
|
|
30454
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
30508
30455
|
TAG: (
|
|
30509
30456
|
/* Format */
|
|
30510
30457
|
0
|
|
@@ -30548,7 +30495,7 @@ function run_send(hub_path, peer, message) {
|
|
|
30548
30495
|
}
|
|
30549
30496
|
},
|
|
30550
30497
|
_1: "to:%s thread:%s"
|
|
30551
|
-
}), peer, slug)
|
|
30498
|
+
}), peer, slug);
|
|
30552
30499
|
console.log(ok(Curry._2(Stdlib__Printf.sprintf({
|
|
30553
30500
|
TAG: (
|
|
30554
30501
|
/* Format */
|
|
@@ -30645,7 +30592,7 @@ function run_reply(hub_path, thread_id, message) {
|
|
|
30645
30592
|
_1: "\n\n## Reply (%s)\n\n%s"
|
|
30646
30593
|
}), (/* @__PURE__ */ new Date()).toISOString(), message);
|
|
30647
30594
|
Fs.appendFileSync(path, reply);
|
|
30648
|
-
|
|
30595
|
+
Curry._1(Stdlib__Printf.sprintf({
|
|
30649
30596
|
TAG: (
|
|
30650
30597
|
/* Format */
|
|
30651
30598
|
0
|
|
@@ -30672,7 +30619,7 @@ function run_reply(hub_path, thread_id, message) {
|
|
|
30672
30619
|
}
|
|
30673
30620
|
},
|
|
30674
30621
|
_1: "thread:%s"
|
|
30675
|
-
}), thread_id)
|
|
30622
|
+
}), thread_id);
|
|
30676
30623
|
console.log(ok(Curry._1(Stdlib__Printf.sprintf({
|
|
30677
30624
|
TAG: (
|
|
30678
30625
|
/* Format */
|
|
@@ -31472,7 +31419,7 @@ function queue_add(hub_path, id, from, content) {
|
|
|
31472
31419
|
_1: "---\nid: %s\nfrom: %s\nqueued: %s\n---\n\n%s"
|
|
31473
31420
|
}), id, from, (/* @__PURE__ */ new Date()).toISOString(), content);
|
|
31474
31421
|
Fs.writeFileSync(file_path, queued_content);
|
|
31475
|
-
|
|
31422
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
31476
31423
|
TAG: (
|
|
31477
31424
|
/* Format */
|
|
31478
31425
|
0
|
|
@@ -31516,7 +31463,7 @@ function queue_add(hub_path, id, from, content) {
|
|
|
31516
31463
|
}
|
|
31517
31464
|
},
|
|
31518
31465
|
_1: "id:%s from:%s"
|
|
31519
|
-
}), id, from)
|
|
31466
|
+
}), id, from);
|
|
31520
31467
|
return file_name;
|
|
31521
31468
|
}
|
|
31522
31469
|
function queue_pop(hub_path) {
|
|
@@ -31583,7 +31530,6 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
31583
31530
|
switch (op.TAG) {
|
|
31584
31531
|
case /* Ack */
|
|
31585
31532
|
0:
|
|
31586
|
-
log_action(hub_path, "op.ack", input_id);
|
|
31587
31533
|
console.log(ok(Curry._1(Stdlib__Printf.sprintf({
|
|
31588
31534
|
TAG: (
|
|
31589
31535
|
/* Format */
|
|
@@ -31615,8 +31561,6 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
31615
31561
|
return;
|
|
31616
31562
|
case /* Done */
|
|
31617
31563
|
1:
|
|
31618
|
-
const id = op._0;
|
|
31619
|
-
log_action(hub_path, "op.done", id);
|
|
31620
31564
|
console.log(ok(Curry._1(Stdlib__Printf.sprintf({
|
|
31621
31565
|
TAG: (
|
|
31622
31566
|
/* Format */
|
|
@@ -31644,13 +31588,13 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
31644
31588
|
}
|
|
31645
31589
|
},
|
|
31646
31590
|
_1: "Done: %s"
|
|
31647
|
-
}),
|
|
31591
|
+
}), op._0)));
|
|
31648
31592
|
return;
|
|
31649
31593
|
case /* Fail */
|
|
31650
31594
|
2:
|
|
31651
31595
|
const reason = op._1;
|
|
31652
|
-
const id
|
|
31653
|
-
|
|
31596
|
+
const id = op._0;
|
|
31597
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
31654
31598
|
TAG: (
|
|
31655
31599
|
/* Format */
|
|
31656
31600
|
0
|
|
@@ -31694,7 +31638,7 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
31694
31638
|
}
|
|
31695
31639
|
},
|
|
31696
31640
|
_1: "id:%s reason:%s"
|
|
31697
|
-
}), id
|
|
31641
|
+
}), id, reason);
|
|
31698
31642
|
console.log(warn(Curry._2(Stdlib__Printf.sprintf({
|
|
31699
31643
|
TAG: (
|
|
31700
31644
|
/* Format */
|
|
@@ -31739,12 +31683,12 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
31739
31683
|
}
|
|
31740
31684
|
},
|
|
31741
31685
|
_1: "Failed: %s - %s"
|
|
31742
|
-
}), id
|
|
31686
|
+
}), id, reason)));
|
|
31743
31687
|
return;
|
|
31744
31688
|
case /* Reply */
|
|
31745
31689
|
3:
|
|
31746
|
-
const id$
|
|
31747
|
-
const path = find_thread(hub_path, id$
|
|
31690
|
+
const id$1 = op._0;
|
|
31691
|
+
const path = find_thread(hub_path, id$1);
|
|
31748
31692
|
if (path !== void 0) {
|
|
31749
31693
|
const reply = Curry._2(Stdlib__Printf.sprintf({
|
|
31750
31694
|
TAG: (
|
|
@@ -31792,7 +31736,7 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
31792
31736
|
_1: "\n\n## Reply (%s)\n\n%s"
|
|
31793
31737
|
}), (/* @__PURE__ */ new Date()).toISOString(), op._1);
|
|
31794
31738
|
Fs.appendFileSync(path, reply);
|
|
31795
|
-
|
|
31739
|
+
Curry._1(Stdlib__Printf.sprintf({
|
|
31796
31740
|
TAG: (
|
|
31797
31741
|
/* Format */
|
|
31798
31742
|
0
|
|
@@ -31819,7 +31763,7 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
31819
31763
|
}
|
|
31820
31764
|
},
|
|
31821
31765
|
_1: "thread:%s"
|
|
31822
|
-
}), id$
|
|
31766
|
+
}), id$1);
|
|
31823
31767
|
console.log(ok(Curry._1(Stdlib__Printf.sprintf({
|
|
31824
31768
|
TAG: (
|
|
31825
31769
|
/* Format */
|
|
@@ -31847,10 +31791,10 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
31847
31791
|
}
|
|
31848
31792
|
},
|
|
31849
31793
|
_1: "Replied to %s"
|
|
31850
|
-
}), id$
|
|
31794
|
+
}), id$1)));
|
|
31851
31795
|
return;
|
|
31852
31796
|
}
|
|
31853
|
-
|
|
31797
|
+
Curry._1(Stdlib__Printf.sprintf({
|
|
31854
31798
|
TAG: (
|
|
31855
31799
|
/* Format */
|
|
31856
31800
|
0
|
|
@@ -31884,7 +31828,7 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
31884
31828
|
}
|
|
31885
31829
|
},
|
|
31886
31830
|
_1: "thread:%s (not found)"
|
|
31887
|
-
}), id$
|
|
31831
|
+
}), id$1);
|
|
31888
31832
|
console.log(warn(Curry._1(Stdlib__Printf.sprintf({
|
|
31889
31833
|
TAG: (
|
|
31890
31834
|
/* Format */
|
|
@@ -31912,7 +31856,7 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
31912
31856
|
}
|
|
31913
31857
|
},
|
|
31914
31858
|
_1: "Thread not found for reply: %s"
|
|
31915
|
-
}), id$
|
|
31859
|
+
}), id$1)));
|
|
31916
31860
|
return;
|
|
31917
31861
|
case /* Send */
|
|
31918
31862
|
4:
|
|
@@ -32038,7 +31982,7 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
32038
31982
|
}), peer, (/* @__PURE__ */ new Date()).toISOString(), name, first_line, body);
|
|
32039
31983
|
const prim0 = Path.join(outbox_dir, file_name);
|
|
32040
31984
|
Fs.writeFileSync(prim0, content);
|
|
32041
|
-
|
|
31985
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
32042
31986
|
TAG: (
|
|
32043
31987
|
/* Format */
|
|
32044
31988
|
0
|
|
@@ -32082,7 +32026,7 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
32082
32026
|
}
|
|
32083
32027
|
},
|
|
32084
32028
|
_1: "to:%s thread:%s"
|
|
32085
|
-
}), peer, slug)
|
|
32029
|
+
}), peer, slug);
|
|
32086
32030
|
console.log(ok(Curry._1(Stdlib__Printf.sprintf({
|
|
32087
32031
|
TAG: (
|
|
32088
32032
|
/* Format */
|
|
@@ -32115,8 +32059,8 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
32115
32059
|
case /* Delegate */
|
|
32116
32060
|
5:
|
|
32117
32061
|
const peer$1 = op._1;
|
|
32118
|
-
const id$
|
|
32119
|
-
const path$1 = find_thread(hub_path, id$
|
|
32062
|
+
const id$2 = op._0;
|
|
32063
|
+
const path$1 = find_thread(hub_path, id$2);
|
|
32120
32064
|
if (path$1 !== void 0) {
|
|
32121
32065
|
const outbox_dir$1 = Path.join(hub_path, "threads/mail/outbox");
|
|
32122
32066
|
ensure_dir(outbox_dir$1);
|
|
@@ -32146,7 +32090,7 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
32146
32090
|
const prim0$1 = Path.join(outbox_dir$1, Path.basename(path$1));
|
|
32147
32091
|
Fs.writeFileSync(prim0$1, prim1);
|
|
32148
32092
|
Fs.unlinkSync(path$1);
|
|
32149
|
-
|
|
32093
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
32150
32094
|
TAG: (
|
|
32151
32095
|
/* Format */
|
|
32152
32096
|
0
|
|
@@ -32183,7 +32127,7 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
32183
32127
|
}
|
|
32184
32128
|
},
|
|
32185
32129
|
_1: "%s to:%s"
|
|
32186
|
-
}), id$
|
|
32130
|
+
}), id$2, peer$1);
|
|
32187
32131
|
console.log(ok(Curry._2(Stdlib__Printf.sprintf({
|
|
32188
32132
|
TAG: (
|
|
32189
32133
|
/* Format */
|
|
@@ -32228,7 +32172,7 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
32228
32172
|
}
|
|
32229
32173
|
},
|
|
32230
32174
|
_1: "Delegated %s to %s"
|
|
32231
|
-
}), id$
|
|
32175
|
+
}), id$2, peer$1)));
|
|
32232
32176
|
return;
|
|
32233
32177
|
}
|
|
32234
32178
|
console.log(warn(Curry._1(Stdlib__Printf.sprintf({
|
|
@@ -32258,12 +32202,12 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
32258
32202
|
}
|
|
32259
32203
|
},
|
|
32260
32204
|
_1: "Thread not found for delegate: %s"
|
|
32261
|
-
}), id$
|
|
32205
|
+
}), id$2)));
|
|
32262
32206
|
return;
|
|
32263
32207
|
case /* Defer */
|
|
32264
32208
|
6:
|
|
32265
|
-
const id$
|
|
32266
|
-
const path$2 = find_thread(hub_path, id$
|
|
32209
|
+
const id$3 = op._0;
|
|
32210
|
+
const path$2 = find_thread(hub_path, id$3);
|
|
32267
32211
|
if (path$2 !== void 0) {
|
|
32268
32212
|
const deferred_dir = Path.join(hub_path, "threads/deferred");
|
|
32269
32213
|
ensure_dir(deferred_dir);
|
|
@@ -32288,7 +32232,7 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
32288
32232
|
const prim0$2 = Path.join(deferred_dir, Path.basename(path$2));
|
|
32289
32233
|
Fs.writeFileSync(prim0$2, prim1$1);
|
|
32290
32234
|
Fs.unlinkSync(path$2);
|
|
32291
|
-
|
|
32235
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
32292
32236
|
TAG: (
|
|
32293
32237
|
/* Format */
|
|
32294
32238
|
0
|
|
@@ -32325,7 +32269,7 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
32325
32269
|
}
|
|
32326
32270
|
},
|
|
32327
32271
|
_1: "%s until:%s"
|
|
32328
|
-
}), id$
|
|
32272
|
+
}), id$3, until_str);
|
|
32329
32273
|
console.log(ok(Curry._1(Stdlib__Printf.sprintf({
|
|
32330
32274
|
TAG: (
|
|
32331
32275
|
/* Format */
|
|
@@ -32353,7 +32297,7 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
32353
32297
|
}
|
|
32354
32298
|
},
|
|
32355
32299
|
_1: "Deferred %s"
|
|
32356
|
-
}), id$
|
|
32300
|
+
}), id$3)));
|
|
32357
32301
|
return;
|
|
32358
32302
|
}
|
|
32359
32303
|
console.log(warn(Curry._1(Stdlib__Printf.sprintf({
|
|
@@ -32383,15 +32327,14 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
32383
32327
|
}
|
|
32384
32328
|
},
|
|
32385
32329
|
_1: "Thread not found for defer: %s"
|
|
32386
|
-
}), id$
|
|
32330
|
+
}), id$3)));
|
|
32387
32331
|
return;
|
|
32388
32332
|
case /* Delete */
|
|
32389
32333
|
7:
|
|
32390
|
-
const id$
|
|
32391
|
-
const path$3 = find_thread(hub_path, id$
|
|
32334
|
+
const id$4 = op._0;
|
|
32335
|
+
const path$3 = find_thread(hub_path, id$4);
|
|
32392
32336
|
if (path$3 !== void 0) {
|
|
32393
32337
|
Fs.unlinkSync(path$3);
|
|
32394
|
-
log_action(hub_path, "op.delete", id$5);
|
|
32395
32338
|
console.log(ok(Curry._1(Stdlib__Printf.sprintf({
|
|
32396
32339
|
TAG: (
|
|
32397
32340
|
/* Format */
|
|
@@ -32419,9 +32362,9 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
32419
32362
|
}
|
|
32420
32363
|
},
|
|
32421
32364
|
_1: "Deleted %s"
|
|
32422
|
-
}), id$
|
|
32365
|
+
}), id$4)));
|
|
32423
32366
|
} else {
|
|
32424
|
-
|
|
32367
|
+
Curry._1(Stdlib__Printf.sprintf({
|
|
32425
32368
|
TAG: (
|
|
32426
32369
|
/* Format */
|
|
32427
32370
|
0
|
|
@@ -32448,7 +32391,7 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
32448
32391
|
}
|
|
32449
32392
|
},
|
|
32450
32393
|
_1: "%s (not found)"
|
|
32451
|
-
}), id$
|
|
32394
|
+
}), id$4);
|
|
32452
32395
|
console.log(color("36", Curry._1(Stdlib__Printf.sprintf({
|
|
32453
32396
|
TAG: (
|
|
32454
32397
|
/* Format */
|
|
@@ -32476,7 +32419,7 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
32476
32419
|
}
|
|
32477
32420
|
},
|
|
32478
32421
|
_1: "Thread already gone: %s"
|
|
32479
|
-
}), id$
|
|
32422
|
+
}), id$4)));
|
|
32480
32423
|
}
|
|
32481
32424
|
return;
|
|
32482
32425
|
case /* Surface */
|
|
@@ -32625,7 +32568,7 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
32625
32568
|
}), slug$1, name, (/* @__PURE__ */ new Date()).toISOString(), desc);
|
|
32626
32569
|
const prim0$3 = Path.join(dir, file_name$1);
|
|
32627
32570
|
Fs.writeFileSync(prim0$3, content$3);
|
|
32628
|
-
|
|
32571
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
32629
32572
|
TAG: (
|
|
32630
32573
|
/* Format */
|
|
32631
32574
|
0
|
|
@@ -32669,7 +32612,7 @@ function execute_op(hub_path, name, input_id, op) {
|
|
|
32669
32612
|
}
|
|
32670
32613
|
},
|
|
32671
32614
|
_1: "id:%s desc:%s"
|
|
32672
|
-
}), slug$1, desc)
|
|
32615
|
+
}), slug$1, desc);
|
|
32673
32616
|
console.log(ok(Curry._1(Stdlib__Printf.sprintf({
|
|
32674
32617
|
TAG: (
|
|
32675
32618
|
/* Format */
|
|
@@ -32758,7 +32701,7 @@ function archive_io_pair(hub_path, name) {
|
|
|
32758
32701
|
}), ops);
|
|
32759
32702
|
Fs.unlinkSync(inp);
|
|
32760
32703
|
Fs.unlinkSync(outp);
|
|
32761
|
-
|
|
32704
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
32762
32705
|
TAG: (
|
|
32763
32706
|
/* Format */
|
|
32764
32707
|
0
|
|
@@ -32810,7 +32753,7 @@ function archive_io_pair(hub_path, name) {
|
|
|
32810
32753
|
}
|
|
32811
32754
|
},
|
|
32812
32755
|
_1: "trigger:%s ops:%d"
|
|
32813
|
-
}), trigger, Stdlib__List.length(ops))
|
|
32756
|
+
}), trigger, Stdlib__List.length(ops));
|
|
32814
32757
|
console.log(ok(Curry._2(Stdlib__Printf.sprintf({
|
|
32815
32758
|
TAG: (
|
|
32816
32759
|
/* Format */
|
|
@@ -33026,7 +32969,7 @@ function feed_next_input(hub_path) {
|
|
|
33026
32969
|
return param[1];
|
|
33027
32970
|
}
|
|
33028
32971
|
}), meta), "unknown");
|
|
33029
|
-
|
|
32972
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
33030
32973
|
TAG: (
|
|
33031
32974
|
/* Format */
|
|
33032
32975
|
0
|
|
@@ -33070,7 +33013,7 @@ function feed_next_input(hub_path) {
|
|
|
33070
33013
|
}
|
|
33071
33014
|
},
|
|
33072
33015
|
_1: "id:%s from:%s"
|
|
33073
|
-
}), id, from)
|
|
33016
|
+
}), id, from);
|
|
33074
33017
|
console.log(ok(Curry._2(Stdlib__Printf.sprintf({
|
|
33075
33018
|
TAG: (
|
|
33076
33019
|
/* Format */
|
|
@@ -33369,7 +33312,7 @@ function run_queue_clear(hub_path) {
|
|
|
33369
33312
|
const prim = Path.join(dir, file);
|
|
33370
33313
|
Fs.unlinkSync(prim);
|
|
33371
33314
|
}), items);
|
|
33372
|
-
|
|
33315
|
+
Curry._1(Stdlib__Printf.sprintf({
|
|
33373
33316
|
TAG: (
|
|
33374
33317
|
/* Format */
|
|
33375
33318
|
0
|
|
@@ -33404,7 +33347,7 @@ function run_queue_clear(hub_path) {
|
|
|
33404
33347
|
}
|
|
33405
33348
|
},
|
|
33406
33349
|
_1: "count:%d"
|
|
33407
|
-
}), Stdlib__List.length(items))
|
|
33350
|
+
}), Stdlib__List.length(items));
|
|
33408
33351
|
console.log(ok(Curry._1(Stdlib__Printf.sprintf({
|
|
33409
33352
|
TAG: (
|
|
33410
33353
|
/* Format */
|
|
@@ -33596,7 +33539,7 @@ function run_mca_add(hub_path, name, description) {
|
|
|
33596
33539
|
_1: "---\nid: %s\nsurfaced-by: %s\ncreated: %s\nstatus: open\n---\n\n# MCA\n\n%s\n"
|
|
33597
33540
|
}), slug, name, (/* @__PURE__ */ new Date()).toISOString(), description);
|
|
33598
33541
|
Fs.writeFileSync(file_path, content);
|
|
33599
|
-
|
|
33542
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
33600
33543
|
TAG: (
|
|
33601
33544
|
/* Format */
|
|
33602
33545
|
0
|
|
@@ -33640,7 +33583,7 @@ function run_mca_add(hub_path, name, description) {
|
|
|
33640
33583
|
}
|
|
33641
33584
|
},
|
|
33642
33585
|
_1: "id:%s desc:%s"
|
|
33643
|
-
}), slug, description)
|
|
33586
|
+
}), slug, description);
|
|
33644
33587
|
console.log(ok(Curry._1(Stdlib__Printf.sprintf({
|
|
33645
33588
|
TAG: (
|
|
33646
33589
|
/* Format */
|
|
@@ -35417,7 +35360,7 @@ function run_out(hub_path, name, gtd) {
|
|
|
35417
35360
|
Fs.writeFileSync(inp, "");
|
|
35418
35361
|
Fs.writeFileSync(outp, "");
|
|
35419
35362
|
console.log(ok("State cleared"));
|
|
35420
|
-
|
|
35363
|
+
Curry._3(Stdlib__Printf.sprintf({
|
|
35421
35364
|
TAG: (
|
|
35422
35365
|
/* Format */
|
|
35423
35366
|
0
|
|
@@ -35478,7 +35421,7 @@ function run_out(hub_path, name, gtd) {
|
|
|
35478
35421
|
}
|
|
35479
35422
|
},
|
|
35480
35423
|
_1: "id:%s gtd:%s run:%s"
|
|
35481
|
-
}), id, gtd_type, run_dir)
|
|
35424
|
+
}), id, gtd_type, run_dir);
|
|
35482
35425
|
console.log(ok(Curry._2(Stdlib__Printf.sprintf({
|
|
35483
35426
|
TAG: (
|
|
35484
35427
|
/* Format */
|
|
@@ -35954,7 +35897,7 @@ function queue_mca_review(hub_path, name) {
|
|
|
35954
35897
|
return Stdlib__Option.value(param, arg);
|
|
35955
35898
|
})(Stdlib__Option.map(Stdlib__String.trim, exec_in(hub_path, "git rev-parse HEAD")));
|
|
35956
35899
|
queue_add(hub_path, trigger, "system", body);
|
|
35957
|
-
|
|
35900
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
35958
35901
|
TAG: (
|
|
35959
35902
|
/* Format */
|
|
35960
35903
|
0
|
|
@@ -36006,7 +35949,7 @@ function queue_mca_review(hub_path, name) {
|
|
|
36006
35949
|
}
|
|
36007
35950
|
},
|
|
36008
35951
|
_1: "trigger:%s count:%d"
|
|
36009
|
-
}), trigger, Stdlib__List.length(mcas))
|
|
35952
|
+
}), trigger, Stdlib__List.length(mcas));
|
|
36010
35953
|
console.log(ok(Curry._2(Stdlib__Printf.sprintf({
|
|
36011
35954
|
TAG: (
|
|
36012
35955
|
/* Format */
|
|
@@ -36147,19 +36090,15 @@ function auto_save(hub_path, name) {
|
|
|
36147
36090
|
_1: 'git commit -m "%s"'
|
|
36148
36091
|
}), msg));
|
|
36149
36092
|
if (match2 !== void 0) {
|
|
36150
|
-
log_action(hub_path, "auto-save.commit", msg);
|
|
36151
36093
|
console.log(ok("Auto-committed changes"));
|
|
36152
36094
|
const match$1 = exec_in(hub_path, "git push");
|
|
36153
36095
|
if (match$1 !== void 0) {
|
|
36154
|
-
log_action(hub_path, "auto-save.push", "success");
|
|
36155
36096
|
console.log(ok("Auto-pushed to origin"));
|
|
36156
36097
|
} else {
|
|
36157
|
-
log_action(hub_path, "auto-save.push", "failed");
|
|
36158
36098
|
console.log(warn("Auto-push failed"));
|
|
36159
36099
|
}
|
|
36160
36100
|
return;
|
|
36161
36101
|
}
|
|
36162
|
-
log_action(hub_path, "auto-save.commit", "failed");
|
|
36163
36102
|
console.log(warn("Auto-commit failed"));
|
|
36164
36103
|
}
|
|
36165
36104
|
function run_inbound(hub_path, name) {
|
|
@@ -37139,7 +37078,7 @@ function run_peer_add(hub_path, peer_name, url) {
|
|
|
37139
37078
|
const prim1 = format_peers_md(updated);
|
|
37140
37079
|
const prim0 = Path.join(hub_path, "state/peers.md");
|
|
37141
37080
|
Fs.writeFileSync(prim0, prim1);
|
|
37142
|
-
|
|
37081
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
37143
37082
|
TAG: (
|
|
37144
37083
|
/* Format */
|
|
37145
37084
|
0
|
|
@@ -37183,7 +37122,7 @@ function run_peer_add(hub_path, peer_name, url) {
|
|
|
37183
37122
|
}
|
|
37184
37123
|
},
|
|
37185
37124
|
_1: "name:%s hub:%s"
|
|
37186
|
-
}), peer_name, url)
|
|
37125
|
+
}), peer_name, url);
|
|
37187
37126
|
console.log(ok(Curry._1(Stdlib__Printf.sprintf({
|
|
37188
37127
|
TAG: (
|
|
37189
37128
|
/* Format */
|
|
@@ -37255,7 +37194,6 @@ function run_peer_remove(hub_path, peer_name) {
|
|
|
37255
37194
|
const prim1 = format_peers_md(updated);
|
|
37256
37195
|
const prim0 = Path.join(hub_path, "state/peers.md");
|
|
37257
37196
|
Fs.writeFileSync(prim0, prim1);
|
|
37258
|
-
log_action(hub_path, "peer.remove", peer_name);
|
|
37259
37197
|
console.log(ok(Curry._1(Stdlib__Printf.sprintf({
|
|
37260
37198
|
TAG: (
|
|
37261
37199
|
/* Format */
|
|
@@ -37532,7 +37470,7 @@ function inbox_flush(hub_path, _name) {
|
|
|
37532
37470
|
const prim0 = Path.join(archived_dir, file);
|
|
37533
37471
|
Fs.writeFileSync(prim0, prim1);
|
|
37534
37472
|
Fs.unlinkSync(file_path);
|
|
37535
|
-
|
|
37473
|
+
Curry._2(Stdlib__Printf.sprintf({
|
|
37536
37474
|
TAG: (
|
|
37537
37475
|
/* Format */
|
|
37538
37476
|
0
|
|
@@ -37576,7 +37514,7 @@ function inbox_flush(hub_path, _name) {
|
|
|
37576
37514
|
}
|
|
37577
37515
|
},
|
|
37578
37516
|
_1: "branch:%s file:%s"
|
|
37579
|
-
}), branch, file)
|
|
37517
|
+
}), branch, file);
|
|
37580
37518
|
console.log(ok(Curry._1(Stdlib__Printf.sprintf({
|
|
37581
37519
|
TAG: (
|
|
37582
37520
|
/* Format */
|