cnagent 2.2.12 → 2.2.13

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 +36 -21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnagent",
3
- "version": "2.2.12",
3
+ "version": "2.2.13",
4
4
  "description": "Coherent Network agent CLI — everything runs through cn",
5
5
  "keywords": [
6
6
  "cn-agent",
package/tools/dist/cn.js CHANGED
@@ -13618,7 +13618,7 @@ var require_cn_lib = __commonJS({
13618
13618
  );
13619
13619
  }
13620
13620
  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 # 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";
13621
- var version = "2.2.12";
13621
+ var version = "2.2.13";
13622
13622
  module2.exports = {
13623
13623
  starts_with,
13624
13624
  strip_prefix,
@@ -28230,8 +28230,7 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
28230
28230
  return p.name === to_peer;
28231
28231
  }), peers);
28232
28232
  if (peer !== void 0) {
28233
- const clone_path = peer.clone;
28234
- if (clone_path !== void 0) {
28233
+ if (peer.clone !== void 0) {
28235
28234
  const thread_name = Path.basename(file, ".md");
28236
28235
  const branch_name = Curry._2(Stdlib__Printf.sprintf({
28237
28236
  TAG: (
@@ -28273,7 +28272,7 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
28273
28272
  }
28274
28273
  },
28275
28274
  _1: "%s/%s"
28276
- }), name, thread_name);
28275
+ }), to_peer, thread_name);
28277
28276
  if (dry_run_mode.contents) {
28278
28277
  console.log(color("2", Curry._3(Stdlib__Printf.sprintf({
28279
28278
  TAG: (
@@ -28349,10 +28348,9 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
28349
28348
  }), file, to_peer, branch_name)));
28350
28349
  return file;
28351
28350
  }
28352
- const match2 = exec_in(clone_path, "git checkout main 2>/dev/null || git checkout master");
28351
+ const match2 = exec_in(hub_path, "git checkout main 2>/dev/null || git checkout master");
28353
28352
  if (match2 !== void 0) {
28354
- exec_in(clone_path, "git pull --ff-only 2>/dev/null || true");
28355
- exec_in(clone_path, Curry._2(Stdlib__Printf.sprintf({
28353
+ exec_in(hub_path, Curry._2(Stdlib__Printf.sprintf({
28356
28354
  TAG: (
28357
28355
  /* Format */
28358
28356
  0
@@ -28397,11 +28395,11 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
28397
28395
  },
28398
28396
  _1: "git checkout -b %s 2>/dev/null || git checkout %s"
28399
28397
  }), branch_name, branch_name));
28400
- const peer_thread_dir = Path.join(clone_path, "threads/in");
28401
- ensure_dir(peer_thread_dir);
28402
- const prim0 = Path.join(peer_thread_dir, file);
28398
+ const thread_dir = Path.join(hub_path, "threads/in");
28399
+ ensure_dir(thread_dir);
28400
+ const prim0 = Path.join(thread_dir, file);
28403
28401
  Fs.writeFileSync(prim0, content);
28404
- exec_in(clone_path, Curry._1(Stdlib__Printf.sprintf({
28402
+ exec_in(hub_path, Curry._1(Stdlib__Printf.sprintf({
28405
28403
  TAG: (
28406
28404
  /* Format */
28407
28405
  0
@@ -28439,7 +28437,7 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
28439
28437
  },
28440
28438
  _1: "git add 'threads/in/%s'"
28441
28439
  }), file));
28442
- exec_in(clone_path, Curry._2(Stdlib__Printf.sprintf({
28440
+ exec_in(hub_path, Curry._2(Stdlib__Printf.sprintf({
28443
28441
  TAG: (
28444
28442
  /* Format */
28445
28443
  0
@@ -28494,7 +28492,7 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
28494
28492
  },
28495
28493
  _1: "git commit -m '%s: %s'"
28496
28494
  }), name, thread_name));
28497
- exec_in(clone_path, Curry._1(Stdlib__Printf.sprintf({
28495
+ exec_in(hub_path, Curry._1(Stdlib__Printf.sprintf({
28498
28496
  TAG: (
28499
28497
  /* Format */
28500
28498
  0
@@ -28529,7 +28527,7 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
28529
28527
  },
28530
28528
  _1: "git push -u origin %s -f"
28531
28529
  }), branch_name));
28532
- exec_in(clone_path, "git checkout main 2>/dev/null || git checkout master");
28530
+ exec_in(hub_path, "git checkout main 2>/dev/null || git checkout master");
28533
28531
  const prim1 = Cn_lib.update_frontmatter(content, {
28534
28532
  hd: [
28535
28533
  "sent",
@@ -28543,7 +28541,7 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
28543
28541
  const prim0$1 = Path.join(sent_dir, file);
28544
28542
  Fs.writeFileSync(prim0$1, prim1);
28545
28543
  Fs.unlinkSync(file_path);
28546
- log_action(hub_path, "outbox.send", Curry._2(Stdlib__Printf.sprintf({
28544
+ log_action(hub_path, "outbox.send", Curry._3(Stdlib__Printf.sprintf({
28547
28545
  TAG: (
28548
28546
  /* Format */
28549
28547
  0
@@ -28578,16 +28576,33 @@ function send_thread(hub_path, name, peers, outbox_dir, sent_dir, file) {
28578
28576
  /* No_padding */
28579
28577
  0
28580
28578
  ),
28581
- _1: (
28582
- /* End_of_format */
28583
- 0
28584
- )
28579
+ _1: {
28580
+ TAG: (
28581
+ /* String_literal */
28582
+ 11
28583
+ ),
28584
+ _0: " branch:",
28585
+ _1: {
28586
+ TAG: (
28587
+ /* String */
28588
+ 2
28589
+ ),
28590
+ _0: (
28591
+ /* No_padding */
28592
+ 0
28593
+ ),
28594
+ _1: (
28595
+ /* End_of_format */
28596
+ 0
28597
+ )
28598
+ }
28599
+ }
28585
28600
  }
28586
28601
  }
28587
28602
  }
28588
28603
  },
28589
- _1: "to:%s thread:%s"
28590
- }), to_peer, file));
28604
+ _1: "to:%s thread:%s branch:%s"
28605
+ }), to_peer, file, branch_name));
28591
28606
  console.log(ok(Curry._2(Stdlib__Printf.sprintf({
28592
28607
  TAG: (
28593
28608
  /* Format */