cnagent 2.2.15 → 2.2.16

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 +95 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnagent",
3
- "version": "2.2.15",
3
+ "version": "2.2.16",
4
4
  "description": "Coherent Network agent CLI — everything runs through cn",
5
5
  "keywords": [
6
6
  "cn-agent",
package/tools/dist/cn.js CHANGED
@@ -13655,7 +13655,7 @@ var require_cn_lib = __commonJS({
13655
13655
  );
13656
13656
  }
13657
13657
  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 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";
13658
- var version = "2.2.15";
13658
+ var version = "2.2.16";
13659
13659
  module2.exports = {
13660
13660
  starts_with,
13661
13661
  strip_prefix,
@@ -26528,8 +26528,44 @@ function log_action(hub_path, action, details) {
26528
26528
  action,
26529
26529
  details
26530
26530
  };
26531
+ const date_str = Stdlib__String.sub((/* @__PURE__ */ new Date()).toISOString(), 0, 10).replace(/-/g, "");
26532
+ const log_file = Curry._1(Stdlib__Printf.sprintf({
26533
+ TAG: (
26534
+ /* Format */
26535
+ 0
26536
+ ),
26537
+ _0: {
26538
+ TAG: (
26539
+ /* String_literal */
26540
+ 11
26541
+ ),
26542
+ _0: "cn-",
26543
+ _1: {
26544
+ TAG: (
26545
+ /* String */
26546
+ 2
26547
+ ),
26548
+ _0: (
26549
+ /* No_padding */
26550
+ 0
26551
+ ),
26552
+ _1: {
26553
+ TAG: (
26554
+ /* String_literal */
26555
+ 11
26556
+ ),
26557
+ _0: ".log",
26558
+ _1: (
26559
+ /* End_of_format */
26560
+ 0
26561
+ )
26562
+ }
26563
+ }
26564
+ },
26565
+ _1: "cn-%s.log"
26566
+ }), date_str);
26531
26567
  const prim1 = JSON.stringify(entry) + "\n";
26532
- const prim0 = Path.join(logs_dir, "cn.log");
26568
+ const prim0 = Path.join(logs_dir, log_file);
26533
26569
  Fs.appendFileSync(prim0, prim1);
26534
26570
  }
26535
26571
  function load_peers(hub_path) {
@@ -37636,15 +37672,66 @@ function update_cron(hub_path) {
37636
37672
  /* String_literal */
37637
37673
  11
37638
37674
  ),
37639
- _0: " && cn sync && cn process >> /var/log/cn.log 2>&1",
37640
- _1: (
37641
- /* End_of_format */
37642
- 0
37643
- )
37675
+ _0: " && cn sync && cn process >> /var/log/cn-$(date +\\",
37676
+ _1: {
37677
+ TAG: (
37678
+ /* Char_literal */
37679
+ 12
37680
+ ),
37681
+ _0: (
37682
+ /* '%' */
37683
+ 37
37684
+ ),
37685
+ _1: {
37686
+ TAG: (
37687
+ /* String_literal */
37688
+ 11
37689
+ ),
37690
+ _0: "Y\\",
37691
+ _1: {
37692
+ TAG: (
37693
+ /* Char_literal */
37694
+ 12
37695
+ ),
37696
+ _0: (
37697
+ /* '%' */
37698
+ 37
37699
+ ),
37700
+ _1: {
37701
+ TAG: (
37702
+ /* String_literal */
37703
+ 11
37704
+ ),
37705
+ _0: "m\\",
37706
+ _1: {
37707
+ TAG: (
37708
+ /* Char_literal */
37709
+ 12
37710
+ ),
37711
+ _0: (
37712
+ /* '%' */
37713
+ 37
37714
+ ),
37715
+ _1: {
37716
+ TAG: (
37717
+ /* String_literal */
37718
+ 11
37719
+ ),
37720
+ _0: "d).log 2>&1",
37721
+ _1: (
37722
+ /* End_of_format */
37723
+ 0
37724
+ )
37725
+ }
37726
+ }
37727
+ }
37728
+ }
37729
+ }
37730
+ }
37644
37731
  }
37645
37732
  }
37646
37733
  },
37647
- _1: "*/5 * * * * cd %s && cn sync && cn process >> /var/log/cn.log 2>&1"
37734
+ _1: "*/5 * * * * cd %s && cn sync && cn process >> /var/log/cn-$(date +\\%%Y\\%%m\\%%d).log 2>&1"
37648
37735
  }), hub_path);
37649
37736
  console.log(color("36", "Updating crontab (5 min intervals)..."));
37650
37737
  const cmd2 = Curry._1(Stdlib__Printf.sprintf({