@nextclaw/ncp-agent-runtime 0.3.3 → 0.3.5
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/index.js +7 -6
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1070,7 +1070,7 @@ var DefaultNcpAgentRuntime = class {
|
|
|
1070
1070
|
* RunFinished is emitted only when the entire loop completes (no more tool calls).
|
|
1071
1071
|
* The stream encoder does not emit RunFinished; it only converts chunks to NCP events.
|
|
1072
1072
|
*/
|
|
1073
|
-
async *
|
|
1073
|
+
runLoop = async function* (llmInput, ctx, options) {
|
|
1074
1074
|
const roundCollector = new DefaultNcpRoundCollector(this.reasoningNormalizationMode);
|
|
1075
1075
|
let currentInput = llmInput;
|
|
1076
1076
|
let done = false;
|
|
@@ -1096,12 +1096,13 @@ var DefaultNcpAgentRuntime = class {
|
|
|
1096
1096
|
});
|
|
1097
1097
|
} else {
|
|
1098
1098
|
const schemaIssues = validateToolArgs(parsedArgs.value, tool?.parameters);
|
|
1099
|
-
|
|
1099
|
+
const validationIssues = schemaIssues.length > 0 ? schemaIssues : typeof tool?.validateArgs === "function" ? tool.validateArgs(parsedArgs.value) : [];
|
|
1100
|
+
if (validationIssues.length > 0) {
|
|
1100
1101
|
result = createInvalidToolArgumentsResult({
|
|
1101
1102
|
toolCallId: toolCall.toolCallId,
|
|
1102
1103
|
toolName: toolCall.toolName,
|
|
1103
1104
|
rawArgumentsText: parsedArgs.rawText,
|
|
1104
|
-
issues:
|
|
1105
|
+
issues: validationIssues
|
|
1105
1106
|
});
|
|
1106
1107
|
} else {
|
|
1107
1108
|
args = parsedArgs.value;
|
|
@@ -1143,13 +1144,13 @@ var DefaultNcpAgentRuntime = class {
|
|
|
1143
1144
|
toolResults
|
|
1144
1145
|
);
|
|
1145
1146
|
}
|
|
1146
|
-
}
|
|
1147
|
-
async *
|
|
1147
|
+
};
|
|
1148
|
+
tapStream = async function* (stream, onChunk) {
|
|
1148
1149
|
for await (const chunk of stream) {
|
|
1149
1150
|
onChunk(chunk);
|
|
1150
1151
|
yield chunk;
|
|
1151
1152
|
}
|
|
1152
|
-
}
|
|
1153
|
+
};
|
|
1153
1154
|
};
|
|
1154
1155
|
export {
|
|
1155
1156
|
DefaultNcpAgentRuntime,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextclaw/ncp-agent-runtime",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Default agent runtime implementation built on NCP interfaces.",
|
|
6
6
|
"type": "module",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@nextclaw/ncp": "0.4.
|
|
18
|
+
"@nextclaw/ncp": "0.4.5"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/node": "^20.17.6",
|