natureco-cli 2.23.29 → 2.23.31
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/README.md +94 -11
- package/bin/natureco.js +495 -94
- package/package.json +1 -1
- package/src/commands/acp.js +39 -0
- package/src/commands/admin-rpc.js +302 -0
- package/src/commands/agent.js +280 -0
- package/src/commands/agents.js +114 -30
- package/src/commands/approvals.js +214 -0
- package/src/commands/backup.js +124 -0
- package/src/commands/bonjour.js +167 -0
- package/src/commands/browser.js +815 -0
- package/src/commands/capability.js +237 -0
- package/src/commands/channels.js +422 -267
- package/src/commands/chat.js +5 -8
- package/src/commands/clawbot.js +19 -0
- package/src/commands/clickclack.js +130 -0
- package/src/commands/code.js +3 -2
- package/src/commands/commitments.js +148 -0
- package/src/commands/completion.js +84 -0
- package/src/commands/config.js +219 -30
- package/src/commands/configure.js +110 -0
- package/src/commands/crestodian.js +92 -0
- package/src/commands/cron.js +239 -19
- package/src/commands/daemon.js +90 -0
- package/src/commands/dashboard.js +47 -374
- package/src/commands/device-pair.js +248 -0
- package/src/commands/devices.js +137 -0
- package/src/commands/directory.js +179 -0
- package/src/commands/dns.js +196 -0
- package/src/commands/docs.js +136 -0
- package/src/commands/doctor.js +143 -492
- package/src/commands/exec-policy.js +80 -0
- package/src/commands/gateway-server.js +1155 -24
- package/src/commands/gateway.js +492 -249
- package/src/commands/health.js +148 -0
- package/src/commands/help.js +24 -25
- package/src/commands/hooks.js +141 -87
- package/src/commands/imessage.js +128 -14
- package/src/commands/infer.js +1474 -0
- package/src/commands/irc.js +64 -15
- package/src/commands/logs.js +122 -99
- package/src/commands/mattermost.js +114 -12
- package/src/commands/mcp.js +121 -309
- package/src/commands/memory-cmd.js +134 -1
- package/src/commands/memory.js +128 -0
- package/src/commands/message.js +720 -134
- package/src/commands/migrate.js +213 -2
- package/src/commands/models.js +39 -1
- package/src/commands/node.js +98 -0
- package/src/commands/nodes.js +362 -0
- package/src/commands/oc-path.js +200 -0
- package/src/commands/onboard.js +129 -0
- package/src/commands/open-prose.js +67 -0
- package/src/commands/pairing.js +108 -107
- package/src/commands/path.js +206 -0
- package/src/commands/plugins.js +35 -1
- package/src/commands/policy.js +176 -0
- package/src/commands/proxy.js +306 -0
- package/src/commands/qr.js +70 -0
- package/src/commands/reset.js +101 -94
- package/src/commands/sandbox.js +125 -0
- package/src/commands/secrets.js +201 -0
- package/src/commands/sessions.js +110 -51
- package/src/commands/setup.js +102 -543
- package/src/commands/signal.js +447 -18
- package/src/commands/skills.js +67 -1
- package/src/commands/sms.js +123 -19
- package/src/commands/status.js +101 -127
- package/src/commands/system.js +53 -0
- package/src/commands/tasks.js +208 -100
- package/src/commands/terminal.js +139 -0
- package/src/commands/thread-ownership.js +157 -0
- package/src/commands/transcripts.js +95 -0
- package/src/commands/tui.js +41 -0
- package/src/commands/uninstall.js +73 -92
- package/src/commands/update.js +146 -91
- package/src/commands/voice.js +82 -0
- package/src/commands/vydra.js +98 -0
- package/src/commands/webhooks.js +58 -66
- package/src/commands/wiki.js +783 -0
- package/src/commands/workboard.js +207 -0
- package/src/tools/audio_understanding.js +154 -0
- package/src/tools/browser.js +112 -0
- package/src/tools/canvas.js +104 -0
- package/src/tools/document_extract.js +84 -0
- package/src/tools/duckduckgo.js +54 -0
- package/src/tools/exa_search.js +66 -0
- package/src/tools/firecrawl.js +104 -0
- package/src/tools/image_generation.js +99 -0
- package/src/tools/llm_task.js +118 -0
- package/src/tools/media_understanding.js +128 -0
- package/src/tools/music_generation.js +113 -0
- package/src/tools/parallel_search.js +77 -0
- package/src/tools/phone_control.js +80 -0
- package/src/tools/phone_control_enhanced.js +184 -0
- package/src/tools/searxng.js +61 -0
- package/src/tools/speech_to_text.js +135 -0
- package/src/tools/text_to_speech.js +105 -0
- package/src/tools/thread_ownership.js +88 -0
- package/src/tools/video_generation.js +72 -0
- package/src/tools/web_readability.js +104 -0
- package/src/utils/agents-md.js +85 -0
- package/src/utils/api.js +39 -40
- package/src/utils/format.js +144 -0
- package/src/utils/headless.js +2 -1
- package/src/utils/memory.js +200 -0
- package/src/utils/parallel-tools.js +106 -0
- package/src/utils/sub-agent.js +148 -0
- package/src/utils/token-budget.js +304 -0
- package/src/utils/tool-runner.js +7 -5
- package/src/utils/web-fetch.js +107 -0
package/src/commands/sessions.js
CHANGED
|
@@ -1,70 +1,129 @@
|
|
|
1
|
+
const chalk = require('chalk');
|
|
1
2
|
const fs = require('fs');
|
|
2
3
|
const path = require('path');
|
|
3
4
|
const os = require('os');
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (!
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
|
|
6
|
+
const SESSIONS_DIR = path.join(os.homedir(), '.natureco', 'sessions');
|
|
7
|
+
|
|
8
|
+
function ensureDir(dir) {
|
|
9
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function sessions(args) {
|
|
13
|
+
const [action, ...params] = args || [];
|
|
14
|
+
|
|
15
|
+
if (!action || action === 'list') return cmdList();
|
|
16
|
+
if (action === 'show') return cmdShow(params[0]);
|
|
17
|
+
if (action === 'cleanup') return cmdCleanup();
|
|
18
|
+
if (action === 'prune') return cmdPrune(parseInt(params[0], 10));
|
|
19
|
+
|
|
20
|
+
console.log(chalk.red(`\n Unknown sessions action: ${action}\n`));
|
|
21
|
+
console.log(chalk.gray(' Usage: natureco sessions <action> [params]'));
|
|
22
|
+
console.log(chalk.gray(' Actions: list, show <id>, cleanup, prune <days>\n'));
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function getSessions() {
|
|
27
|
+
ensureDir(SESSIONS_DIR);
|
|
28
|
+
const files = fs.readdirSync(SESSIONS_DIR).filter(f => f.endsWith('.json'));
|
|
29
|
+
const sessions = [];
|
|
30
|
+
for (const file of files) {
|
|
31
|
+
const fp = path.join(SESSIONS_DIR, file);
|
|
32
|
+
try {
|
|
33
|
+
const data = JSON.parse(fs.readFileSync(fp, 'utf8'));
|
|
34
|
+
sessions.push({ id: path.basename(file, '.json'), file, data });
|
|
35
|
+
} catch {}
|
|
17
36
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
37
|
+
return sessions;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function cmdList() {
|
|
41
|
+
const sessions = getSessions();
|
|
42
|
+
|
|
43
|
+
console.log(chalk.cyan(`\n Sessions (${sessions.length})\n`));
|
|
44
|
+
console.log(chalk.gray(' ' + '─'.repeat(48)));
|
|
45
|
+
|
|
46
|
+
if (sessions.length === 0) {
|
|
47
|
+
console.log(chalk.gray(' No sessions found.\n'));
|
|
48
|
+
return;
|
|
26
49
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
50
|
+
|
|
51
|
+
for (const s of sessions) {
|
|
52
|
+
const msgCount = (s.data.messages || []).length;
|
|
53
|
+
const preview = s.data.preview || s.data.id || s.id;
|
|
54
|
+
const updated = s.data.updatedAt || s.data.savedAt || '';
|
|
55
|
+
console.log(` ${chalk.white(s.id)}`);
|
|
56
|
+
console.log(chalk.gray(` Messages: ${msgCount} · ${preview.toString().slice(0, 60)}`));
|
|
57
|
+
if (updated) console.log(chalk.gray(` Updated: ${updated.slice(0, 10)}`));
|
|
58
|
+
}
|
|
59
|
+
console.log('');
|
|
30
60
|
}
|
|
31
61
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
62
|
+
function cmdShow(id) {
|
|
63
|
+
if (!id) {
|
|
64
|
+
console.log(chalk.red('\n Usage: natureco sessions show <id>\n'));
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const sessions = getSessions();
|
|
69
|
+
const found = sessions.find(s => s.id.includes(id));
|
|
70
|
+
|
|
71
|
+
if (!found) {
|
|
72
|
+
console.log(chalk.yellow(`\n Session not found: ${id}\n`));
|
|
36
73
|
return;
|
|
37
74
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
75
|
+
|
|
76
|
+
console.log(chalk.cyan(`\n Session: ${found.id}\n`));
|
|
77
|
+
console.log(chalk.gray(' ' + '─'.repeat(48)));
|
|
78
|
+
const msgs = found.data.messages || [];
|
|
79
|
+
console.log(` ${chalk.white('Messages:')} ${chalk.cyan(msgs.length)}`);
|
|
80
|
+
for (const msg of msgs.slice(-10)) {
|
|
81
|
+
const role = msg.role === 'user' ? chalk.green('You') : chalk.cyan('Bot');
|
|
82
|
+
const content = (msg.content || '').slice(0, 200);
|
|
83
|
+
console.log(` ${role}: ${chalk.white(content)}`);
|
|
84
|
+
}
|
|
85
|
+
if (msgs.length > 10) console.log(chalk.gray(` ... and ${msgs.length - 10} more`));
|
|
86
|
+
console.log('');
|
|
42
87
|
}
|
|
43
88
|
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
89
|
+
function cmdCleanup() {
|
|
90
|
+
const sessions = getSessions();
|
|
91
|
+
let removed = 0;
|
|
92
|
+
|
|
93
|
+
for (const s of sessions) {
|
|
94
|
+
const msgs = s.data.messages || [];
|
|
95
|
+
if (msgs.length === 0) {
|
|
96
|
+
try {
|
|
97
|
+
fs.unlinkSync(path.join(SESSIONS_DIR, s.file));
|
|
98
|
+
removed++;
|
|
99
|
+
} catch {}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
console.log(chalk.gray(`\n Cleaned up ${removed} empty session(s).\n`));
|
|
48
104
|
}
|
|
49
105
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
console.log(chalk.red(`\n ❌ Oturum bulunamadı: ${sessionId}\n`));
|
|
106
|
+
function cmdPrune(days) {
|
|
107
|
+
if (!days || isNaN(days) || days < 1) {
|
|
108
|
+
console.log(chalk.red('\n Usage: natureco sessions prune <days>\n'));
|
|
54
109
|
process.exit(1);
|
|
55
110
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
111
|
+
|
|
112
|
+
const cutoff = Date.now() - days * 86400000;
|
|
113
|
+
const sessions = getSessions();
|
|
114
|
+
let removed = 0;
|
|
115
|
+
|
|
116
|
+
for (const s of sessions) {
|
|
117
|
+
const ts = s.data.updatedAt || s.data.savedAt || '';
|
|
118
|
+
if (ts && new Date(ts).getTime() < cutoff) {
|
|
119
|
+
try {
|
|
120
|
+
fs.unlinkSync(path.join(SESSIONS_DIR, s.file));
|
|
121
|
+
removed++;
|
|
122
|
+
} catch {}
|
|
123
|
+
}
|
|
60
124
|
}
|
|
61
|
-
|
|
62
|
-
console.log(chalk.
|
|
63
|
-
console.log(chalk.gray(` ${data.savedAt} · ${data.messages.length} mesaj\n`));
|
|
64
|
-
data.messages.forEach((msg, i) => {
|
|
65
|
-
console.log(chalk.white(` ${msg.role === 'user' ? 'You' : 'Bot'}: ${msg.content?.slice(0, 200)}`));
|
|
66
|
-
});
|
|
67
|
-
console.log();
|
|
125
|
+
|
|
126
|
+
console.log(chalk.gray(`\n Pruned ${removed} session(s) older than ${days} day(s).\n`));
|
|
68
127
|
}
|
|
69
128
|
|
|
70
129
|
module.exports = sessions;
|