cnagent 2.2.16 → 2.2.17
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/bin/cn-cron +12 -0
- package/package.json +3 -2
- package/tools/dist/cn.js +7 -65
package/bin/cn-cron
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# cn-cron - Run cn sync cycle with logging
|
|
3
|
+
# Installed by: npm install -g cnagent
|
|
4
|
+
# Usage: */5 * * * * cn-cron /path/to/hub
|
|
5
|
+
|
|
6
|
+
set -e
|
|
7
|
+
|
|
8
|
+
HUB="${1:-$(pwd)}"
|
|
9
|
+
LOG="/var/log/cn-$(date +%Y%m%d).log"
|
|
10
|
+
|
|
11
|
+
cd "$HUB"
|
|
12
|
+
exec cn sync >> "$LOG" 2>&1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnagent",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.17",
|
|
4
4
|
"description": "Coherent Network agent CLI — everything runs through cn",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cn-agent",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"url": "https://github.com/usurobor/cn-agent.git"
|
|
19
19
|
},
|
|
20
20
|
"bin": {
|
|
21
|
-
"cn": "bin/cn"
|
|
21
|
+
"cn": "bin/cn",
|
|
22
|
+
"cn-cron": "bin/cn-cron"
|
|
22
23
|
},
|
|
23
24
|
"files": [
|
|
24
25
|
"bin/",
|
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.
|
|
13658
|
+
var version = "2.2.17";
|
|
13659
13659
|
module2.exports = {
|
|
13660
13660
|
starts_with,
|
|
13661
13661
|
strip_prefix,
|
|
@@ -37657,7 +37657,7 @@ function update_cron(hub_path) {
|
|
|
37657
37657
|
/* String_literal */
|
|
37658
37658
|
11
|
|
37659
37659
|
),
|
|
37660
|
-
_0: "*/5 * * * *
|
|
37660
|
+
_0: "*/5 * * * * cn-cron ",
|
|
37661
37661
|
_1: {
|
|
37662
37662
|
TAG: (
|
|
37663
37663
|
/* String */
|
|
@@ -37667,71 +37667,13 @@ function update_cron(hub_path) {
|
|
|
37667
37667
|
/* No_padding */
|
|
37668
37668
|
0
|
|
37669
37669
|
),
|
|
37670
|
-
_1:
|
|
37671
|
-
|
|
37672
|
-
|
|
37673
|
-
|
|
37674
|
-
),
|
|
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
|
-
}
|
|
37731
|
-
}
|
|
37670
|
+
_1: (
|
|
37671
|
+
/* End_of_format */
|
|
37672
|
+
0
|
|
37673
|
+
)
|
|
37732
37674
|
}
|
|
37733
37675
|
},
|
|
37734
|
-
_1: "*/5 * * * *
|
|
37676
|
+
_1: "*/5 * * * * cn-cron %s"
|
|
37735
37677
|
}), hub_path);
|
|
37736
37678
|
console.log(color("36", "Updating crontab (5 min intervals)..."));
|
|
37737
37679
|
const cmd2 = Curry._1(Stdlib__Printf.sprintf({
|