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
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
const chalk = require('chalk');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
|
|
6
|
+
const MEMORY_DIR = path.join(os.homedir(), '.natureco', 'memory');
|
|
7
|
+
const INDEX_FILE = path.join(MEMORY_DIR, 'index.json');
|
|
8
|
+
|
|
9
|
+
function ensureDir(dir) {
|
|
10
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function memory(args) {
|
|
14
|
+
const [action, ...params] = args || [];
|
|
15
|
+
|
|
16
|
+
if (!action || action === 'status') return cmdStatus();
|
|
17
|
+
if (action === 'index') return cmdIndex();
|
|
18
|
+
if (action === 'search') return cmdSearch(params.join(' '));
|
|
19
|
+
|
|
20
|
+
console.log(chalk.red(`\n Unknown memory action: ${action}\n`));
|
|
21
|
+
console.log(chalk.gray(' Usage: natureco memory <action> [params]'));
|
|
22
|
+
console.log(chalk.gray(' Actions: status, index, search <query>\n'));
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function cmdStatus() {
|
|
27
|
+
ensureDir(MEMORY_DIR);
|
|
28
|
+
const files = fs.readdirSync(MEMORY_DIR).filter(f => f.endsWith('.json'));
|
|
29
|
+
let totalSize = 0;
|
|
30
|
+
|
|
31
|
+
for (const file of files) {
|
|
32
|
+
const fp = path.join(MEMORY_DIR, file);
|
|
33
|
+
try { totalSize += fs.statSync(fp).size; } catch {}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
console.log(chalk.cyan('\n Memory Store Status\n'));
|
|
37
|
+
console.log(chalk.gray(' ' + '─'.repeat(48)));
|
|
38
|
+
console.log(` ${chalk.white('Files:')} ${chalk.cyan(files.length)}`);
|
|
39
|
+
console.log(` ${chalk.white('Size:')} ${chalk.cyan(formatSize(totalSize))}`);
|
|
40
|
+
console.log(` ${chalk.white('Location:')} ${chalk.gray(MEMORY_DIR)}`);
|
|
41
|
+
console.log(chalk.gray(' ' + '─'.repeat(48)));
|
|
42
|
+
console.log('');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function cmdIndex() {
|
|
46
|
+
ensureDir(MEMORY_DIR);
|
|
47
|
+
const files = fs.readdirSync(MEMORY_DIR).filter(f => f.endsWith('.json'));
|
|
48
|
+
const index = [];
|
|
49
|
+
|
|
50
|
+
for (const file of files) {
|
|
51
|
+
const fp = path.join(MEMORY_DIR, file);
|
|
52
|
+
try {
|
|
53
|
+
const data = JSON.parse(fs.readFileSync(fp, 'utf8'));
|
|
54
|
+
index.push({
|
|
55
|
+
file,
|
|
56
|
+
keywords: extractKeywords(data),
|
|
57
|
+
size: fs.statSync(fp).size,
|
|
58
|
+
updated: fs.statSync(fp).mtime.toISOString(),
|
|
59
|
+
});
|
|
60
|
+
} catch {}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
fs.writeFileSync(INDEX_FILE, JSON.stringify(index, null, 2), 'utf8');
|
|
64
|
+
console.log(chalk.green(`\n Index rebuilt: ${index.length} entries\n`));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function cmdSearch(query) {
|
|
68
|
+
if (!query) {
|
|
69
|
+
console.log(chalk.red('\n Usage: natureco memory search <query>\n'));
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (!fs.existsSync(MEMORY_DIR)) {
|
|
74
|
+
console.log(chalk.yellow('\n No memory directory found.\n'));
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const files = fs.readdirSync(MEMORY_DIR).filter(f => f.endsWith('.json'));
|
|
79
|
+
const lower = query.toLowerCase();
|
|
80
|
+
let results = [];
|
|
81
|
+
|
|
82
|
+
for (const file of files) {
|
|
83
|
+
const fp = path.join(MEMORY_DIR, file);
|
|
84
|
+
try {
|
|
85
|
+
const content = fs.readFileSync(fp, 'utf8');
|
|
86
|
+
if (content.toLowerCase().includes(lower)) {
|
|
87
|
+
const data = JSON.parse(content);
|
|
88
|
+
results.push({ file, data });
|
|
89
|
+
}
|
|
90
|
+
} catch {}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (results.length === 0) {
|
|
94
|
+
console.log(chalk.yellow(`\n No results for "${query}"\n`));
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
console.log(chalk.cyan(`\n Found ${results.length} memory file(s) for "${query}"\n`));
|
|
99
|
+
for (const r of results) {
|
|
100
|
+
console.log(` ${chalk.white(r.file)}`);
|
|
101
|
+
const keys = Object.keys(r.data).filter(k => {
|
|
102
|
+
const v = typeof r.data[k] === 'string' ? r.data[k] : JSON.stringify(r.data[k]);
|
|
103
|
+
return v.toLowerCase().includes(lower);
|
|
104
|
+
});
|
|
105
|
+
for (const k of keys) {
|
|
106
|
+
console.log(chalk.gray(` ${k}: ${r.data[k]}`));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
console.log('');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function extractKeywords(data) {
|
|
113
|
+
const words = new Set();
|
|
114
|
+
for (const val of Object.values(data)) {
|
|
115
|
+
if (typeof val === 'string') {
|
|
116
|
+
val.split(/\s+/).filter(w => w.length > 3).forEach(w => words.add(w.toLowerCase()));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return [...words];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function formatSize(bytes) {
|
|
123
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
124
|
+
if (bytes < 1048576) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
125
|
+
return `${(bytes / 1048576).toFixed(1)} MB`;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
module.exports = memory;
|