natureco-cli 5.62.0 → 5.64.0
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/CHANGELOG.md +34 -1
- package/bin/natureco.js +10 -3
- package/package.json +8 -5
- package/scripts/benchmark-startup.js +26 -0
- package/src/commands/backup.js +3 -3
- package/src/commands/chat.js +17 -17
- package/src/commands/code.js +49 -14
- package/src/commands/code_v5.js +15 -1
- package/src/commands/gateway-server.js +128 -24
- package/src/commands/git.js +2 -2
- package/src/commands/pairing.js +2 -22
- package/src/commands/repl.js +118 -112
- package/src/tools/agentic-runner.js +41 -33
- package/src/tools/memory_write.js +16 -12
- package/src/tools/structural_patch.js +25 -0
- package/src/tools/workflow.js +10 -2
- package/src/utils/agent-core.js +51 -0
- package/src/utils/agent-workspace.js +24 -0
- package/src/utils/api.js +12 -8
- package/src/utils/channel-sdk.js +212 -0
- package/src/utils/code-intelligence.js +69 -0
- package/src/utils/coding-session.js +54 -0
- package/src/utils/delivery-store.js +34 -0
- package/src/utils/i18n.js +7 -1
- package/src/utils/json-schema.js +43 -0
- package/src/utils/lsp-client.js +129 -0
- package/src/utils/memory-record.js +49 -0
- package/src/utils/pairing-store.js +55 -0
- package/src/utils/pattern-detector.js +13 -3
- package/src/utils/plugin-registry.js +3 -3
- package/src/utils/process-errors.js +14 -7
- package/src/utils/runtime-health.js +28 -0
- package/src/utils/secret-store.js +90 -0
- package/src/utils/secure-sync.js +63 -0
- package/src/utils/skill-lifecycle.js +59 -0
- package/src/utils/structural-patch.js +68 -0
- package/src/utils/sub-agent.js +13 -2
- package/src/utils/test-failure-analyzer.js +64 -0
- package/src/utils/tool-execution-gateway.js +56 -0
- package/src/utils/tool-manifest.js +31 -0
- package/src/utils/tool-path-policy.js +49 -0
- package/src/utils/tool-result.js +17 -0
- package/src/utils/tool-runner.js +81 -53
- package/src/utils/tools.js +30 -42
package/src/utils/tools.js
CHANGED
|
@@ -5,18 +5,16 @@
|
|
|
5
5
|
* v5.7.17: Emoji + toolset + check_fn + registry entegrasyonu.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const {
|
|
11
|
-
const
|
|
8
|
+
const { globalRegistry } = require('./registry');
|
|
9
|
+
const sandbox = require('./sandbox');
|
|
10
|
+
const { executeThroughGateway } = require('./tool-execution-gateway');
|
|
11
|
+
const { loadToolManifest } = require('./tool-manifest');
|
|
12
12
|
|
|
13
13
|
// Lazy config read — avoids circular deps
|
|
14
14
|
function _getSandboxLevel() {
|
|
15
15
|
try { return sandbox.getLevel(require('./config').getConfig()); } catch { return 'none'; }
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
const TOOLS_DIR = path.join(__dirname, '..', 'tools');
|
|
19
|
-
|
|
20
18
|
// ── Emoji map (central, tek kaynak) ──────────────────────────────────────
|
|
21
19
|
const EMOJI_MAP = {
|
|
22
20
|
// File operations
|
|
@@ -174,7 +172,7 @@ function getToolsForProvider(allTools, providerUrl) {
|
|
|
174
172
|
|
|
175
173
|
function loadToolDefinitions() {
|
|
176
174
|
const tools = [];
|
|
177
|
-
const
|
|
175
|
+
const manifest = loadToolManifest();
|
|
178
176
|
|
|
179
177
|
let isGroq = false;
|
|
180
178
|
try {
|
|
@@ -197,20 +195,19 @@ function loadToolDefinitions() {
|
|
|
197
195
|
'soul', 'memory', 'memory_write', 'memory_search', 'filesystem', 'grep_search'
|
|
198
196
|
]);
|
|
199
197
|
|
|
200
|
-
for (const
|
|
201
|
-
try {
|
|
202
|
-
const
|
|
203
|
-
const
|
|
204
|
-
const toolName = mod.name || path.basename(file, '.js');
|
|
198
|
+
for (const entry of manifest.values()) {
|
|
199
|
+
try {
|
|
200
|
+
const mod = entry.module;
|
|
201
|
+
const toolName = entry.name;
|
|
205
202
|
|
|
206
203
|
if (isGroq && !GROQ_ALLOWED.has(toolName)) continue;
|
|
207
204
|
if (disabledTools.has(toolName)) continue;
|
|
208
205
|
|
|
209
206
|
const meta = {
|
|
210
207
|
name: toolName,
|
|
211
|
-
description:
|
|
212
|
-
parameters:
|
|
213
|
-
execute:
|
|
208
|
+
description: entry.description,
|
|
209
|
+
parameters: entry.inputSchema,
|
|
210
|
+
execute: entry.execute,
|
|
214
211
|
emoji: EMOJI_MAP[toolName] || '',
|
|
215
212
|
toolset: TOOLSET_MAP[toolName] || 'general',
|
|
216
213
|
checkFn: CHECK_FN_MAP[toolName] || null,
|
|
@@ -290,33 +287,24 @@ function toOpenAIFormat(toolDefs) {
|
|
|
290
287
|
});
|
|
291
288
|
}
|
|
292
289
|
|
|
293
|
-
async function executeTool(toolName, args, toolDefs) {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
try {
|
|
314
|
-
const result = await tool.execute(args || {});
|
|
315
|
-
return { result };
|
|
316
|
-
} catch (e) {
|
|
317
|
-
return { error: e.message || String(e) };
|
|
318
|
-
}
|
|
319
|
-
}
|
|
290
|
+
async function executeTool(toolName, args, toolDefs) {
|
|
291
|
+
return executeThroughGateway({
|
|
292
|
+
toolName,
|
|
293
|
+
args: args || {},
|
|
294
|
+
resolveTool: name => (toolDefs || []).find(tool => tool.name === name),
|
|
295
|
+
checkAvailability: ({ tool }) => !tool.checkFn || _cachedCheckFn(tool.checkFn, tool.name)
|
|
296
|
+
? true
|
|
297
|
+
: { allowed: false, reason: `${toolName} şu anda kullanılamıyor (check_fn engelledi)` },
|
|
298
|
+
policyChecks: [({ args: safeArgs }) => {
|
|
299
|
+
if (toolName !== 'bash' && toolName !== 'shell_command') return true;
|
|
300
|
+
const level = _getSandboxLevel();
|
|
301
|
+
if (level === 'strict' && sandbox.isNetworkCommand(safeArgs.command || '')) {
|
|
302
|
+
return { allowed: false, reason: 'strict sandbox: network komutları engellendi. Daha düşük sandbox seviyesi kullanın.' };
|
|
303
|
+
}
|
|
304
|
+
return true;
|
|
305
|
+
}],
|
|
306
|
+
});
|
|
307
|
+
}
|
|
320
308
|
|
|
321
309
|
module.exports = {
|
|
322
310
|
loadToolDefinitions, toOpenAIFormat, executeTool, getToolsForProvider,
|