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,80 @@
|
|
|
1
|
+
const chalk = require('chalk');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
|
|
6
|
+
const POLICY_FILE = path.join(os.homedir(), '.natureco', 'exec-policy.json');
|
|
7
|
+
|
|
8
|
+
const PRESETS = {
|
|
9
|
+
strict: { allowCommands: false, allowScripts: false, timeout: 10000, sandbox: 'strict', approvals: 'all' },
|
|
10
|
+
permissive: { allowCommands: true, allowScripts: true, timeout: 60000, sandbox: 'none', approvals: 'none' },
|
|
11
|
+
default: { allowCommands: true, allowScripts: false, timeout: 30000, sandbox: 'isolated', approvals: 'write' },
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
function loadPolicy() {
|
|
15
|
+
if (!fs.existsSync(POLICY_FILE)) return { ...PRESETS.default };
|
|
16
|
+
try { return JSON.parse(fs.readFileSync(POLICY_FILE, 'utf8')); }
|
|
17
|
+
catch { return { ...PRESETS.default }; }
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function savePolicy(policy) {
|
|
21
|
+
const dir = path.dirname(POLICY_FILE);
|
|
22
|
+
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
23
|
+
fs.writeFileSync(POLICY_FILE, JSON.stringify(policy, null, 2), 'utf8');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function execPolicy(args) {
|
|
27
|
+
const [action, ...params] = args || [];
|
|
28
|
+
|
|
29
|
+
if (!action || action === 'show') return cmdShow();
|
|
30
|
+
if (action === 'preset') return cmdPreset(params[0]);
|
|
31
|
+
if (action === 'set') return cmdSet(params[0], params.slice(1).join(' '));
|
|
32
|
+
|
|
33
|
+
console.log(chalk.red(`\n Unknown exec-policy action: ${action}\n`));
|
|
34
|
+
console.log(chalk.gray(' Usage: natureco exec-policy <action> [params]'));
|
|
35
|
+
console.log(chalk.gray(' Actions: show, preset <name>, set <key> <value>\n'));
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function cmdShow() {
|
|
40
|
+
const policy = loadPolicy();
|
|
41
|
+
|
|
42
|
+
console.log(chalk.cyan('\n Execution Policy\n'));
|
|
43
|
+
console.log(chalk.gray(' ' + '─'.repeat(48)));
|
|
44
|
+
for (const [key, val] of Object.entries(policy)) {
|
|
45
|
+
const display = typeof val === 'boolean' ? (val ? chalk.green('yes') : chalk.red('no')) : chalk.white(val);
|
|
46
|
+
console.log(` ${chalk.white(key)}: ${display}`);
|
|
47
|
+
}
|
|
48
|
+
console.log('');
|
|
49
|
+
console.log(chalk.gray(' Presets: strict, permissive, default\n'));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function cmdPreset(name) {
|
|
53
|
+
if (!name || !PRESETS[name]) {
|
|
54
|
+
console.log(chalk.red(`\n Unknown preset: ${name}\n`));
|
|
55
|
+
console.log(chalk.gray(' Available presets: strict, permissive, default\n'));
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
savePolicy({ ...PRESETS[name] });
|
|
60
|
+
console.log(chalk.green(`\n Policy set to "${name}" preset.\n`));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function cmdSet(key, value) {
|
|
64
|
+
if (!key || value === undefined) {
|
|
65
|
+
console.log(chalk.red('\n Usage: natureco exec-policy set <key> <value>\n'));
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const policy = loadPolicy();
|
|
70
|
+
|
|
71
|
+
if (value === 'true') value = true;
|
|
72
|
+
else if (value === 'false') value = false;
|
|
73
|
+
else if (!isNaN(value)) value = Number(value);
|
|
74
|
+
|
|
75
|
+
policy[key] = value;
|
|
76
|
+
savePolicy(policy);
|
|
77
|
+
console.log(chalk.green(`\n Policy "${key}" set to ${JSON.stringify(value)}.\n`));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
module.exports = execPolicy;
|