cnagent 2.1.18 → 2.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/tools/dist/cn.js +60 -48
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnagent",
3
- "version": "2.1.18",
3
+ "version": "2.1.19",
4
4
  "description": "Coherent Network agent CLI — everything runs through cn",
5
5
  "keywords": [
6
6
  "cn-agent",
package/tools/dist/cn.js CHANGED
@@ -11908,6 +11908,12 @@ var require_cn_lib = __commonJS({
11908
11908
  function non_empty(s) {
11909
11909
  return Stdlib__String2.trim(s) !== "";
11910
11910
  }
11911
+ var Inbox = {};
11912
+ var Outbox = {};
11913
+ var Peer = {};
11914
+ var Queue = {};
11915
+ var Mca = {};
11916
+ var Gtd = {};
11911
11917
  function string_of_agent_op(id) {
11912
11918
  switch (id.TAG) {
11913
11919
  case /* Ack */
@@ -12140,19 +12146,19 @@ var require_cn_lib = __commonJS({
12140
12146
  case /* Inbox */
12141
12147
  1:
12142
12148
  switch (t._0) {
12143
- case /* In_check */
12149
+ case /* Check */
12144
12150
  0:
12145
12151
  return "inbox check";
12146
- case /* In_process */
12152
+ case /* Process */
12147
12153
  1:
12148
12154
  return "inbox process";
12149
- case /* In_flush */
12155
+ case /* Flush */
12150
12156
  2:
12151
12157
  return "inbox flush";
12152
12158
  }
12153
12159
  case /* Outbox */
12154
12160
  2:
12155
- if (t._0 === /* Out_check */
12161
+ if (t._0 === /* Check */
12156
12162
  0) {
12157
12163
  return "outbox check";
12158
12164
  } else {
@@ -12165,13 +12171,13 @@ var require_cn_lib = __commonJS({
12165
12171
  /* tag */
12166
12172
  typeof n$1 === "number" || typeof n$1 === "string"
12167
12173
  ) {
12168
- if (n$1 === /* P_list */
12174
+ if (n$1 === /* List */
12169
12175
  0) {
12170
12176
  return "peer list";
12171
12177
  } else {
12172
12178
  return "peer sync";
12173
12179
  }
12174
- } else if (n$1.TAG === /* P_add */
12180
+ } else if (n$1.TAG === /* Add */
12175
12181
  0) {
12176
12182
  return "peer add " + n$1._0;
12177
12183
  } else {
@@ -12179,7 +12185,7 @@ var require_cn_lib = __commonJS({
12179
12185
  }
12180
12186
  case /* Queue */
12181
12187
  4:
12182
- if (t._0 === /* Q_list */
12188
+ if (t._0 === /* List */
12183
12189
  0) {
12184
12190
  return "queue list";
12185
12191
  } else {
@@ -12209,19 +12215,19 @@ var require_cn_lib = __commonJS({
12209
12215
  9:
12210
12216
  const t$1 = t._0;
12211
12217
  switch (t$1.TAG) {
12212
- case /* G_delete */
12218
+ case /* Delete */
12213
12219
  0:
12214
12220
  return "delete " + t$1._0;
12215
- case /* G_defer */
12221
+ case /* Defer */
12216
12222
  1:
12217
12223
  return "defer " + t$1._0;
12218
- case /* G_delegate */
12224
+ case /* Delegate */
12219
12225
  2:
12220
12226
  return "delegate " + (t$1._0 + (" " + t$1._1));
12221
- case /* G_do */
12227
+ case /* Do */
12222
12228
  3:
12223
12229
  return "do " + t$1._0;
12224
- case /* G_done */
12230
+ case /* Done */
12225
12231
  4:
12226
12232
  return "done " + t$1._0;
12227
12233
  }
@@ -12263,7 +12269,7 @@ var require_cn_lib = __commonJS({
12263
12269
  function parse_inbox_cmd(param) {
12264
12270
  if (!param) {
12265
12271
  return (
12266
- /* In_check */
12272
+ /* Check */
12267
12273
  0
12268
12274
  );
12269
12275
  }
@@ -12273,7 +12279,7 @@ var require_cn_lib = __commonJS({
12273
12279
  return;
12274
12280
  } else {
12275
12281
  return (
12276
- /* In_check */
12282
+ /* Check */
12277
12283
  0
12278
12284
  );
12279
12285
  }
@@ -12282,7 +12288,7 @@ var require_cn_lib = __commonJS({
12282
12288
  return;
12283
12289
  } else {
12284
12290
  return (
12285
- /* In_flush */
12291
+ /* Flush */
12286
12292
  2
12287
12293
  );
12288
12294
  }
@@ -12291,7 +12297,7 @@ var require_cn_lib = __commonJS({
12291
12297
  return;
12292
12298
  } else {
12293
12299
  return (
12294
- /* In_process */
12300
+ /* Process */
12295
12301
  1
12296
12302
  );
12297
12303
  }
@@ -12302,7 +12308,7 @@ var require_cn_lib = __commonJS({
12302
12308
  function parse_outbox_cmd(param) {
12303
12309
  if (!param) {
12304
12310
  return (
12305
- /* Out_check */
12311
+ /* Check */
12306
12312
  0
12307
12313
  );
12308
12314
  }
@@ -12312,7 +12318,7 @@ var require_cn_lib = __commonJS({
12312
12318
  return;
12313
12319
  } else {
12314
12320
  return (
12315
- /* Out_check */
12321
+ /* Check */
12316
12322
  0
12317
12323
  );
12318
12324
  }
@@ -12321,7 +12327,7 @@ var require_cn_lib = __commonJS({
12321
12327
  return;
12322
12328
  } else {
12323
12329
  return (
12324
- /* Out_flush */
12330
+ /* Flush */
12325
12331
  1
12326
12332
  );
12327
12333
  }
@@ -12332,7 +12338,7 @@ var require_cn_lib = __commonJS({
12332
12338
  function parse_peer_cmd(param) {
12333
12339
  if (!param) {
12334
12340
  return (
12335
- /* P_list */
12341
+ /* List */
12336
12342
  0
12337
12343
  );
12338
12344
  }
@@ -12346,7 +12352,7 @@ var require_cn_lib = __commonJS({
12346
12352
  if (match$1 && !match$1.tl) {
12347
12353
  return {
12348
12354
  TAG: (
12349
- /* P_add */
12355
+ /* Add */
12350
12356
  0
12351
12357
  ),
12352
12358
  _0: match2.hd,
@@ -12360,7 +12366,7 @@ var require_cn_lib = __commonJS({
12360
12366
  return;
12361
12367
  } else {
12362
12368
  return (
12363
- /* P_list */
12369
+ /* List */
12364
12370
  0
12365
12371
  );
12366
12372
  }
@@ -12369,7 +12375,7 @@ var require_cn_lib = __commonJS({
12369
12375
  if (match$2 && !match$2.tl) {
12370
12376
  return {
12371
12377
  TAG: (
12372
- /* P_remove */
12378
+ /* Remove */
12373
12379
  1
12374
12380
  ),
12375
12381
  _0: match$2.hd
@@ -12382,7 +12388,7 @@ var require_cn_lib = __commonJS({
12382
12388
  return;
12383
12389
  } else {
12384
12390
  return (
12385
- /* P_sync */
12391
+ /* Sync */
12386
12392
  1
12387
12393
  );
12388
12394
  }
@@ -12393,7 +12399,7 @@ var require_cn_lib = __commonJS({
12393
12399
  function parse_queue_cmd(param) {
12394
12400
  if (!param) {
12395
12401
  return (
12396
- /* Q_list */
12402
+ /* List */
12397
12403
  0
12398
12404
  );
12399
12405
  }
@@ -12403,7 +12409,7 @@ var require_cn_lib = __commonJS({
12403
12409
  return;
12404
12410
  } else {
12405
12411
  return (
12406
- /* Q_clear */
12412
+ /* Clear */
12407
12413
  1
12408
12414
  );
12409
12415
  }
@@ -12412,7 +12418,7 @@ var require_cn_lib = __commonJS({
12412
12418
  return;
12413
12419
  } else {
12414
12420
  return (
12415
- /* Q_list */
12421
+ /* List */
12416
12422
  0
12417
12423
  );
12418
12424
  }
@@ -12423,7 +12429,7 @@ var require_cn_lib = __commonJS({
12423
12429
  function parse_mca_cmd(param) {
12424
12430
  if (!param) {
12425
12431
  return (
12426
- /* M_list */
12432
+ /* List */
12427
12433
  0
12428
12434
  );
12429
12435
  }
@@ -12437,7 +12443,7 @@ var require_cn_lib = __commonJS({
12437
12443
  )) {
12438
12444
  return {
12439
12445
  TAG: (
12440
- /* M_add */
12446
+ /* Add */
12441
12447
  0
12442
12448
  ),
12443
12449
  _0: Stdlib__String2.concat(" ", rest)
@@ -12450,7 +12456,7 @@ var require_cn_lib = __commonJS({
12450
12456
  return;
12451
12457
  } else {
12452
12458
  return (
12453
- /* M_list */
12459
+ /* List */
12454
12460
  0
12455
12461
  );
12456
12462
  }
@@ -12468,7 +12474,7 @@ var require_cn_lib = __commonJS({
12468
12474
  if (match2) {
12469
12475
  return {
12470
12476
  TAG: (
12471
- /* G_defer */
12477
+ /* Defer */
12472
12478
  1
12473
12479
  ),
12474
12480
  _0: match2.hd,
@@ -12486,7 +12492,7 @@ var require_cn_lib = __commonJS({
12486
12492
  if (match$2 && !match$2.tl) {
12487
12493
  return {
12488
12494
  TAG: (
12489
- /* G_delegate */
12495
+ /* Delegate */
12490
12496
  2
12491
12497
  ),
12492
12498
  _0: match$1.hd,
@@ -12500,7 +12506,7 @@ var require_cn_lib = __commonJS({
12500
12506
  if (match$3 && !match$3.tl) {
12501
12507
  return {
12502
12508
  TAG: (
12503
- /* G_delete */
12509
+ /* Delete */
12504
12510
  0
12505
12511
  ),
12506
12512
  _0: match$3.hd
@@ -12513,7 +12519,7 @@ var require_cn_lib = __commonJS({
12513
12519
  if (match$4 && !match$4.tl) {
12514
12520
  return {
12515
12521
  TAG: (
12516
- /* G_do */
12522
+ /* Do */
12517
12523
  3
12518
12524
  ),
12519
12525
  _0: match$4.hd
@@ -12526,7 +12532,7 @@ var require_cn_lib = __commonJS({
12526
12532
  if (match$5 && !match$5.tl) {
12527
12533
  return {
12528
12534
  TAG: (
12529
- /* G_done */
12535
+ /* Done */
12530
12536
  4
12531
12537
  ),
12532
12538
  _0: match$5.hd
@@ -13260,12 +13266,18 @@ var require_cn_lib = __commonJS({
13260
13266
  );
13261
13267
  }
13262
13268
  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 process Queue inbox \xE2\x86\x92 input.md \xE2\x86\x92 wake agent\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 # Hub management\n init [name] Create new hub\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";
13263
- var version = "2.1.18";
13269
+ var version = "2.1.19";
13264
13270
  module2.exports = {
13265
13271
  starts_with,
13266
13272
  strip_prefix,
13267
13273
  ends_with,
13268
13274
  non_empty,
13275
+ Inbox,
13276
+ Outbox,
13277
+ Peer,
13278
+ Queue,
13279
+ Mca,
13280
+ Gtd,
13269
13281
  string_of_agent_op,
13270
13282
  parse_agent_op,
13271
13283
  extract_ops,
@@ -34374,15 +34386,15 @@ if (cmd !== void 0) {
34374
34386
  case /* Inbox */
34375
34387
  1:
34376
34388
  switch (cmd._0) {
34377
- case /* In_check */
34389
+ case /* Check */
34378
34390
  0:
34379
34391
  inbox_check(hub_path$1, name);
34380
34392
  break;
34381
- case /* In_process */
34393
+ case /* Process */
34382
34394
  1:
34383
34395
  inbox_process(hub_path$1);
34384
34396
  break;
34385
- case /* In_flush */
34397
+ case /* Flush */
34386
34398
  2:
34387
34399
  inbox_flush(hub_path$1, name);
34388
34400
  break;
@@ -34390,7 +34402,7 @@ if (cmd !== void 0) {
34390
34402
  break;
34391
34403
  case /* Outbox */
34392
34404
  2:
34393
- if (cmd._0 === /* Out_check */
34405
+ if (cmd._0 === /* Check */
34394
34406
  0) {
34395
34407
  outbox_check(hub_path$1);
34396
34408
  } else {
@@ -34404,13 +34416,13 @@ if (cmd !== void 0) {
34404
34416
  /* tag */
34405
34417
  typeof n === "number" || typeof n === "string"
34406
34418
  ) {
34407
- if (n === /* P_list */
34419
+ if (n === /* List */
34408
34420
  0) {
34409
34421
  run_peer_list(hub_path$1);
34410
34422
  } else {
34411
34423
  run_peer_sync(hub_path$1);
34412
34424
  }
34413
- } else if (n.TAG === /* P_add */
34425
+ } else if (n.TAG === /* Add */
34414
34426
  0) {
34415
34427
  run_peer_add(hub_path$1, n._0, n._1);
34416
34428
  } else {
@@ -34419,7 +34431,7 @@ if (cmd !== void 0) {
34419
34431
  break;
34420
34432
  case /* Queue */
34421
34433
  4:
34422
- if (cmd._0 === /* Q_list */
34434
+ if (cmd._0 === /* List */
34423
34435
  0) {
34424
34436
  run_queue_list(hub_path$1);
34425
34437
  } else {
@@ -34454,23 +34466,23 @@ if (cmd !== void 0) {
34454
34466
  9:
34455
34467
  const t = cmd._0;
34456
34468
  switch (t.TAG) {
34457
- case /* G_delete */
34469
+ case /* Delete */
34458
34470
  0:
34459
34471
  gtd_delete(hub_path$1, t._0);
34460
34472
  break;
34461
- case /* G_defer */
34473
+ case /* Defer */
34462
34474
  1:
34463
34475
  gtd_defer(hub_path$1, t._0, t._1);
34464
34476
  break;
34465
- case /* G_delegate */
34477
+ case /* Delegate */
34466
34478
  2:
34467
34479
  gtd_delegate(hub_path$1, name, t._0, t._1);
34468
34480
  break;
34469
- case /* G_do */
34481
+ case /* Do */
34470
34482
  3:
34471
34483
  gtd_do(hub_path$1, t._0);
34472
34484
  break;
34473
- case /* G_done */
34485
+ case /* Done */
34474
34486
  4:
34475
34487
  gtd_done(hub_path$1, t._0);
34476
34488
  break;