@nickyzj2023/ai 1.6.3 → 1.6.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.
package/dist/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { i as runAgent, n as get_weather_default, r as get_time_default } from "./src-Bh2ZFPb4.mjs";
1
+ import { i as runAgent, n as get_weather_default, r as get_time_default } from "./src-BtaIXKLo.mjs";
2
2
  import { a as listModels, t as defineModel } from "./helper-DJw58Gmz.mjs";
3
3
  import { n as loadMCPTools } from "./mcp-BBjcb8es.mjs";
4
4
  import { compactStr, extractErrorMessage, isObject, to } from "@nickyzj2023/utils";
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { a as stream, i as runAgent, n as get_weather_default, r as get_time_default, t as compact } from "./src-Bh2ZFPb4.mjs";
1
+ import { a as stream, i as runAgent, n as get_weather_default, r as get_time_default, t as compact } from "./src-BtaIXKLo.mjs";
2
2
  import { a as listModels, i as estimateTokens, n as defineTool, r as estimateTextTokens, t as defineModel } from "./helper-DJw58Gmz.mjs";
3
3
  export { compact, defineModel, defineTool, estimateTextTokens, estimateTokens, get_time_default as getTime, get_weather_default as getWeather, listModels, runAgent, stream };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nickyzj2023/ai",
3
- "version": "1.6.3",
3
+ "version": "1.6.4",
4
4
  "description": "我的“pi”,参考了pi-from-scratch",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -30,15 +30,15 @@
30
30
  "access": "public"
31
31
  },
32
32
  "devDependencies": {
33
- "@biomejs/biome": "^2.5.12",
34
- "@types/node": "^26.5.0",
33
+ "@biomejs/biome": "^2.5.15",
34
+ "@types/node": "^26.6.4",
35
35
  "tsdown": "^0.22.14",
36
36
  "typescript": "^7.0.2"
37
37
  },
38
38
  "dependencies": {
39
- "@modelcontextprotocol/sdk": "^1.30.0",
39
+ "@modelcontextprotocol/sdk": "^1.32.0",
40
40
  "@nickyzj2023/utils": "^1.0.95",
41
- "@wterm/markdown": "^0.5.0"
41
+ "@wterm/markdown": "^0.5.4"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "tsdown",
@@ -114,14 +114,15 @@ async function* runAgent(model, messages, tools) {
114
114
  startTime ||= Date.now();
115
115
  switch (e.type) {
116
116
  case "reasoning_delta":
117
- reasoning += e.delta;
118
117
  yield e;
118
+ reasoning += e.delta;
119
119
  break;
120
120
  case "content_delta":
121
- content += e.delta;
122
121
  yield e;
122
+ content += e.delta;
123
123
  break;
124
124
  case "tool_call":
125
+ yield e;
125
126
  toolCalls.push({
126
127
  id: e.id,
127
128
  type: "function",
@@ -130,7 +131,6 @@ async function* runAgent(model, messages, tools) {
130
131
  arguments: e.args
131
132
  }
132
133
  });
133
- yield e;
134
134
  break;
135
135
  case "error":
136
136
  yield e;