cnagent 2.2.9 → 2.2.10

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 +29 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnagent",
3
- "version": "2.2.9",
3
+ "version": "2.2.10",
4
4
  "description": "Coherent Network agent CLI — everything runs through cn",
5
5
  "keywords": [
6
6
  "cn-agent",
package/tools/dist/cn.js CHANGED
@@ -12071,18 +12071,38 @@ var require_cn_lib = __commonJS({
12071
12071
  /* '|' */
12072
12072
  124
12073
12073
  );
12074
- if (i$4 !== void 0) {
12074
+ if (i$4 === void 0) {
12075
+ return;
12076
+ }
12077
+ const peer = Stdlib__String2.sub(value, 0, i$4);
12078
+ const rest = Stdlib__String2.sub(value, i$4 + 1 | 0, (value.length - i$4 | 0) - 1 | 0);
12079
+ const j = Stdlib__String2.index_opt(
12080
+ rest,
12081
+ /* '|' */
12082
+ 124
12083
+ );
12084
+ if (j === void 0) {
12075
12085
  return {
12076
12086
  TAG: (
12077
12087
  /* Send */
12078
12088
  4
12079
12089
  ),
12080
- _0: Stdlib__String2.sub(value, 0, i$4),
12081
- _1: Stdlib__String2.sub(value, i$4 + 1 | 0, (value.length - i$4 | 0) - 1 | 0)
12090
+ _0: peer,
12091
+ _1: rest,
12092
+ _2: void 0
12082
12093
  };
12083
- } else {
12084
- return;
12085
12094
  }
12095
+ const message = Stdlib__String2.sub(rest, 0, j);
12096
+ const body = Stdlib__String2.sub(rest, j + 1 | 0, (rest.length - j | 0) - 1 | 0);
12097
+ return {
12098
+ TAG: (
12099
+ /* Send */
12100
+ 4
12101
+ ),
12102
+ _0: peer,
12103
+ _1: message,
12104
+ _2: body
12105
+ };
12086
12106
  case "mca":
12087
12107
  case "surface":
12088
12108
  return {
@@ -13598,7 +13618,7 @@ var require_cn_lib = __commonJS({
13598
13618
  );
13599
13619
  }
13600
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";
13601
- var version = "2.2.9";
13621
+ var version = "2.2.10";
13602
13622
  module2.exports = {
13603
13623
  starts_with,
13604
13624
  strip_prefix,
@@ -30792,6 +30812,7 @@ function execute_op(hub_path, name, input_id, op) {
30792
30812
  return;
30793
30813
  case /* Send */
30794
30814
  4:
30815
+ const body_opt = op._2;
30795
30816
  const msg$5 = op._1;
30796
30817
  const peer = op._0;
30797
30818
  const outbox_dir = Path.join(hub_path, "threads/outbox");
@@ -30804,6 +30825,7 @@ function execute_op(hub_path, name, input_id, op) {
30804
30825
  msg$5
30805
30826
  );
30806
30827
  const first_line = match2 ? match2.hd : msg$5;
30828
+ const body = body_opt !== void 0 ? body_opt : msg$5;
30807
30829
  const content = Curry._5(Stdlib__Printf.sprintf({
30808
30830
  TAG: (
30809
30831
  /* Format */
@@ -30909,7 +30931,7 @@ function execute_op(hub_path, name, input_id, op) {
30909
30931
  }
30910
30932
  },
30911
30933
  _1: "---\nto: %s\ncreated: %s\nfrom: %s\n---\n\n# %s\n\n%s\n"
30912
- }), peer, (/* @__PURE__ */ new Date()).toISOString(), name, first_line, msg$5);
30934
+ }), peer, (/* @__PURE__ */ new Date()).toISOString(), name, first_line, body);
30913
30935
  const prim0 = Path.join(outbox_dir, file_name);
30914
30936
  Fs.writeFileSync(prim0, content);
30915
30937
  log_action(hub_path, "op.send", Curry._2(Stdlib__Printf.sprintf({