@nextclaw/ncp-agent-runtime 0.3.2 → 0.3.4

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -6
  2. package/package.json +3 -3
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 *runLoop(llmInput, ctx, options) {
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
- if (schemaIssues.length > 0) {
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: schemaIssues
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 *tapStream(stream, onChunk) {
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.2",
3
+ "version": "0.3.4",
4
4
  "private": false,
5
5
  "description": "Default agent runtime implementation built on NCP interfaces.",
6
6
  "type": "module",
@@ -15,14 +15,14 @@
15
15
  "dist"
16
16
  ],
17
17
  "dependencies": {
18
- "@nextclaw/ncp": "0.4.2"
18
+ "@nextclaw/ncp": "0.4.4"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/node": "^20.17.6",
22
22
  "prettier": "^3.3.3",
23
23
  "tsup": "^8.3.5",
24
24
  "typescript": "^5.6.3",
25
- "vitest": "^2.1.2"
25
+ "vitest": "^4.1.2"
26
26
  },
27
27
  "scripts": {
28
28
  "build": "tsup src/index.ts --format esm --dts --out-dir dist",