nextclaw 0.17.9 → 0.17.10
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/dist/cli/index.js +43 -57
- package/package.json +11 -11
package/dist/cli/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import { request } from "node:http";
|
|
|
19
19
|
import { request as request$1 } from "node:https";
|
|
20
20
|
import { setImmediate as setImmediate$1, setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
21
21
|
import chokidar from "chokidar";
|
|
22
|
-
import { DefaultNcpAgentRuntime, LocalAssetStore, buildAssetContentPath, buildNcpUserContent } from "@nextclaw/ncp-agent-runtime";
|
|
22
|
+
import { DefaultNcpAgentRuntime, LocalAssetStore, buildAssetContentPath, buildNcpUserContent, buildOpenAiFunctionTool } from "@nextclaw/ncp-agent-runtime";
|
|
23
23
|
import { McpNcpToolRegistryAdapter } from "@nextclaw/ncp-mcp";
|
|
24
24
|
import { NCP_INTERNAL_VISIBILITY_METADATA_KEY, NcpEventType, readAssistantReasoningNormalizationMode, readAssistantReasoningNormalizationModeFromMetadata, sanitizeAssistantReplyTags, writeAssistantReasoningNormalizationModeToMetadata } from "@nextclaw/ncp";
|
|
25
25
|
import { DefaultNcpAgentBackend, createAgentClientFromServer } from "@nextclaw/ncp-toolkit";
|
|
@@ -10409,48 +10409,39 @@ var AssetPutTool = class {
|
|
|
10409
10409
|
description = "Put a normal file path or base64 bytes into the managed asset store.";
|
|
10410
10410
|
parameters = {
|
|
10411
10411
|
type: "object",
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
type: "string",
|
|
10417
|
-
description: "Existing local file path to put into the asset store."
|
|
10418
|
-
},
|
|
10419
|
-
fileName: {
|
|
10420
|
-
type: "string",
|
|
10421
|
-
description: "Optional asset file name override."
|
|
10422
|
-
},
|
|
10423
|
-
mimeType: {
|
|
10424
|
-
type: "string",
|
|
10425
|
-
description: "Optional mime type override."
|
|
10426
|
-
}
|
|
10412
|
+
properties: {
|
|
10413
|
+
path: {
|
|
10414
|
+
type: "string",
|
|
10415
|
+
description: "Existing local file path to put into the asset store."
|
|
10427
10416
|
},
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
description: "Base64 file bytes. Use together with fileName when no source path exists."
|
|
10436
|
-
},
|
|
10437
|
-
fileName: {
|
|
10438
|
-
type: "string",
|
|
10439
|
-
description: "Asset file name. Required when using bytesBase64."
|
|
10440
|
-
},
|
|
10441
|
-
mimeType: {
|
|
10442
|
-
type: "string",
|
|
10443
|
-
description: "Optional mime type override."
|
|
10444
|
-
}
|
|
10417
|
+
bytesBase64: {
|
|
10418
|
+
type: "string",
|
|
10419
|
+
description: "Base64 file bytes. Use together with fileName when no source path exists."
|
|
10420
|
+
},
|
|
10421
|
+
fileName: {
|
|
10422
|
+
type: "string",
|
|
10423
|
+
description: "Optional asset file name override. Required when using bytesBase64."
|
|
10445
10424
|
},
|
|
10446
|
-
|
|
10447
|
-
|
|
10448
|
-
|
|
10425
|
+
mimeType: {
|
|
10426
|
+
type: "string",
|
|
10427
|
+
description: "Optional mime type override."
|
|
10428
|
+
}
|
|
10429
|
+
},
|
|
10430
|
+
additionalProperties: false
|
|
10449
10431
|
};
|
|
10450
10432
|
constructor(assetStore, contentBasePath) {
|
|
10451
10433
|
this.assetStore = assetStore;
|
|
10452
10434
|
this.contentBasePath = contentBasePath;
|
|
10453
10435
|
}
|
|
10436
|
+
validateArgs = (args) => {
|
|
10437
|
+
const path = readOptionalString$5(args.path);
|
|
10438
|
+
const bytesBase64 = readOptionalString$5(args.bytesBase64);
|
|
10439
|
+
const fileName = readOptionalString$5(args.fileName);
|
|
10440
|
+
if (path && bytesBase64) return ["Provide either path, or bytesBase64 + fileName, not both."];
|
|
10441
|
+
if (path) return [];
|
|
10442
|
+
if (bytesBase64) return fileName ? [] : ["fileName is required when using bytesBase64."];
|
|
10443
|
+
return ["Provide either path, or bytesBase64 + fileName."];
|
|
10444
|
+
};
|
|
10454
10445
|
execute = async (args) => {
|
|
10455
10446
|
const path = readOptionalString$5(args?.path);
|
|
10456
10447
|
const fileName = readOptionalString$5(args?.fileName);
|
|
@@ -10541,11 +10532,12 @@ var AssetStatTool = class {
|
|
|
10541
10532
|
};
|
|
10542
10533
|
};
|
|
10543
10534
|
function createAssetTools(params) {
|
|
10535
|
+
const { assetStore } = params;
|
|
10544
10536
|
const contentBasePath = params.contentBasePath ?? "/api/ncp/assets/content";
|
|
10545
10537
|
return [
|
|
10546
|
-
new AssetPutTool(
|
|
10547
|
-
new AssetExportTool(
|
|
10548
|
-
new AssetStatTool(
|
|
10538
|
+
new AssetPutTool(assetStore, contentBasePath),
|
|
10539
|
+
new AssetExportTool(assetStore),
|
|
10540
|
+
new AssetStatTool(assetStore, contentBasePath)
|
|
10549
10541
|
];
|
|
10550
10542
|
}
|
|
10551
10543
|
//#endregion
|
|
@@ -11247,19 +11239,20 @@ function readRequestedAgentId(metadata) {
|
|
|
11247
11239
|
return normalizeString(metadata.agent_id)?.toLowerCase() ?? normalizeString(metadata.agentId)?.toLowerCase() ?? null;
|
|
11248
11240
|
}
|
|
11249
11241
|
function resolveAgentProfile(params) {
|
|
11250
|
-
const
|
|
11251
|
-
const
|
|
11252
|
-
const
|
|
11242
|
+
const { config, requestMetadata, storedAgentId } = params;
|
|
11243
|
+
const { agents: { defaults }, search: searchConfig, tools: { restrictToWorkspace, exec: { timeout: execTimeoutSeconds } } } = config;
|
|
11244
|
+
const defaultAgentId = resolveDefaultAgentProfileId(config);
|
|
11245
|
+
const profile = findEffectiveAgentProfile(config, normalizeString(storedAgentId)?.toLowerCase() ?? readRequestedAgentId(requestMetadata) ?? defaultAgentId) ?? findEffectiveAgentProfile(config, defaultAgentId);
|
|
11253
11246
|
if (!profile) throw new Error(`default agent profile not found: ${defaultAgentId}`);
|
|
11254
11247
|
return {
|
|
11255
11248
|
agentId: profile.id,
|
|
11256
|
-
workspace: getWorkspacePath(profile.workspace ??
|
|
11257
|
-
model: profile.model ??
|
|
11258
|
-
maxIterations: profile.maxToolIterations ??
|
|
11259
|
-
contextTokens: profile.contextTokens ??
|
|
11260
|
-
restrictToWorkspace
|
|
11261
|
-
searchConfig
|
|
11262
|
-
execTimeoutSeconds
|
|
11249
|
+
workspace: getWorkspacePath(profile.workspace ?? defaults.workspace),
|
|
11250
|
+
model: profile.model ?? defaults.model,
|
|
11251
|
+
maxIterations: profile.maxToolIterations ?? defaults.maxToolIterations,
|
|
11252
|
+
contextTokens: profile.contextTokens ?? defaults.contextTokens,
|
|
11253
|
+
restrictToWorkspace,
|
|
11254
|
+
searchConfig,
|
|
11255
|
+
execTimeoutSeconds
|
|
11263
11256
|
};
|
|
11264
11257
|
}
|
|
11265
11258
|
function shouldAppendTimeHint(content) {
|
|
@@ -11307,14 +11300,7 @@ function filterTools(toolDefinitions, requestedToolNames) {
|
|
|
11307
11300
|
return filtered.length > 0 ? filtered : void 0;
|
|
11308
11301
|
}
|
|
11309
11302
|
function buildRequestedOpenAiTools(toolDefinitions, requestedToolNames) {
|
|
11310
|
-
return filterTools(toolDefinitions.map(
|
|
11311
|
-
type: "function",
|
|
11312
|
-
function: {
|
|
11313
|
-
name: tool.name,
|
|
11314
|
-
description: tool.description,
|
|
11315
|
-
parameters: tool.parameters
|
|
11316
|
-
}
|
|
11317
|
-
})), requestedToolNames);
|
|
11303
|
+
return filterTools(toolDefinitions.map(buildOpenAiFunctionTool), requestedToolNames);
|
|
11318
11304
|
}
|
|
11319
11305
|
var NextclawNcpContextBuilder = class {
|
|
11320
11306
|
inputBudgetPruner = new InputBudgetPruner();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nextclaw",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.10",
|
|
4
4
|
"description": "Lightweight personal AI assistant with CLI, multi-provider routing, and channel integrations.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
"chokidar": "^3.6.0",
|
|
41
41
|
"commander": "^12.1.0",
|
|
42
42
|
"yaml": "^2.8.1",
|
|
43
|
+
"@nextclaw/core": "0.12.5",
|
|
44
|
+
"@nextclaw/ncp-agent-runtime": "0.3.10",
|
|
43
45
|
"@nextclaw/ncp": "0.5.0",
|
|
44
|
-
"@nextclaw/
|
|
45
|
-
"@nextclaw/
|
|
46
|
-
"@nextclaw/ncp-
|
|
47
|
-
"@nextclaw/ncp-
|
|
48
|
-
"@nextclaw/
|
|
49
|
-
"@nextclaw/
|
|
50
|
-
"@nextclaw/
|
|
51
|
-
"@nextclaw/remote": "0.1.81",
|
|
52
|
-
"@nextclaw/runtime": "0.2.36"
|
|
46
|
+
"@nextclaw/openclaw-compat": "1.0.5",
|
|
47
|
+
"@nextclaw/mcp": "0.1.70",
|
|
48
|
+
"@nextclaw/ncp-toolkit": "0.5.5",
|
|
49
|
+
"@nextclaw/ncp-mcp": "0.1.72",
|
|
50
|
+
"@nextclaw/server": "0.12.5",
|
|
51
|
+
"@nextclaw/remote": "0.1.82",
|
|
52
|
+
"@nextclaw/runtime": "0.2.37"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/node": "^20.17.6",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"tsx": "^4.19.2",
|
|
58
58
|
"typescript": "^5.6.3",
|
|
59
59
|
"vitest": "^4.1.2",
|
|
60
|
-
"@nextclaw/ui": "0.12.
|
|
60
|
+
"@nextclaw/ui": "0.12.7"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"dev": "tsx watch --tsconfig tsconfig.json src/cli/index.ts",
|