@kevisual/ai 0.0.27 → 0.0.29

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/agent.d.ts CHANGED
@@ -14,6 +14,7 @@ type Route = Partial<RouteInfo>;
14
14
  type AgentResult = {
15
15
  result: GenerateTextResult<Record<string, any>, any>;
16
16
  messages: ModelMessage[];
17
+ outputText: string;
17
18
  };
18
19
  declare const reCallAgent: (opts: {
19
20
  messages?: ModelMessage[];
package/dist/agent.js CHANGED
@@ -24,10 +24,10 @@ var createTools = async (opts) => {
24
24
  const { app, token } = opts;
25
25
  const tools = {};
26
26
  for (const route of app.routes) {
27
- const id = route.id;
27
+ const rid = route.rid;
28
28
  const _tool = await createTool(app, { path: route.path, key: route.key, token });
29
- if (_tool && id) {
30
- tools[id] = _tool;
29
+ if (_tool && rid) {
30
+ tools[rid] = _tool;
31
31
  }
32
32
  }
33
33
  return tools;
@@ -44,7 +44,8 @@ var reCallAgent = async (opts) => {
44
44
  messages.push(...result.response.messages);
45
45
  return reCallAgent({ messages, tools, languageModel });
46
46
  }
47
- return { result, messages };
47
+ let outputText = result.output;
48
+ return { result, messages, outputText };
48
49
  };
49
50
  var runAgent = async (opts) => {
50
51
  const { app, languageModel } = opts;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevisual/ai",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
4
4
  "description": "AI Center Services",
5
5
  "main": "index.js",
6
6
  "basename": "/root/ai-center-services",
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",
28
28
  "license": "MIT",
29
- "packageManager": "pnpm@10.32.0",
29
+ "packageManager": "pnpm@10.33.0",
30
30
  "type": "module",
31
31
  "publishConfig": {
32
32
  "registry": "https://registry.npmjs.org/",
@@ -40,34 +40,34 @@
40
40
  "./src/*": "./src/*"
41
41
  },
42
42
  "devDependencies": {
43
- "@kevisual/code-builder": "^0.0.6",
44
- "@kevisual/router": "0.1.0",
43
+ "@kevisual/code-builder": "^0.0.7",
44
+ "@kevisual/router": "0.2.5",
45
45
  "@kevisual/types": "^0.0.12",
46
46
  "@kevisual/use-config": "^1.0.30",
47
- "@types/bun": "^1.3.10",
47
+ "@types/bun": "^1.3.11",
48
48
  "@types/crypto-js": "^4.2.2",
49
49
  "@types/formidable": "^3.5.0",
50
- "@types/node": "^25.4.0",
50
+ "@types/node": "^25.5.2",
51
51
  "cross-env": "^10.1.0",
52
52
  "crypto-js": "^4.2.0",
53
- "dayjs": "^1.11.19",
54
- "dotenv": "^17.3.1",
53
+ "dayjs": "^1.11.20",
54
+ "dotenv": "^17.4.1",
55
55
  "formidable": "^3.5.4",
56
- "openai": "6.27.0",
56
+ "openai": "6.33.0",
57
57
  "pm2": "^6.0.14",
58
58
  "rimraf": "^6.1.3",
59
- "typescript": "^5.9.3",
60
- "vite": "^7.3.1"
59
+ "typescript": "^6.0.2",
60
+ "vite": "^8.0.4"
61
61
  },
62
62
  "dependencies": {
63
- "@ai-sdk/anthropic": "^3.0.58",
64
- "@ai-sdk/openai": "^3.0.41",
65
- "@ai-sdk/openai-compatible": "^2.0.35",
63
+ "@ai-sdk/anthropic": "^3.0.66",
64
+ "@ai-sdk/openai": "^3.0.50",
65
+ "@ai-sdk/openai-compatible": "^2.0.38",
66
66
  "@kevisual/js-filter": "^0.0.6",
67
67
  "@kevisual/logger": "^0.0.4",
68
68
  "@kevisual/permission": "^0.0.4",
69
- "@kevisual/query": "^0.0.53",
70
- "ai": "^6.0.116",
69
+ "@kevisual/query": "^0.0.55",
70
+ "ai": "^6.0.146",
71
71
  "zod": "^4.3.6"
72
72
  }
73
73
  }
@@ -25,10 +25,10 @@ export const createTools = async (opts: { app: QueryRouterServer | App, token?:
25
25
  const { app, token } = opts;
26
26
  const tools: Record<string, any> = {};
27
27
  for (const route of app.routes) {
28
- const id = route.id!;
28
+ const rid = route.rid!;
29
29
  const _tool = await createTool(app, { path: route.path!, key: route.key!, token });
30
- if (_tool && id) {
31
- tools[id] = _tool;
30
+ if (_tool && rid) {
31
+ tools[rid] = _tool;
32
32
  }
33
33
  }
34
34
  return tools;
@@ -37,6 +37,7 @@ type Route = Partial<RouteInfo>
37
37
  type AgentResult = {
38
38
  result: GenerateTextResult<Record<string, any>, any>,
39
39
  messages: ModelMessage[],
40
+ outputText: string,
40
41
  }
41
42
  export const reCallAgent = async (opts: { messages?: ModelMessage[], tools?: Record<string, any>, languageModel: LanguageModel }): Promise<AgentResult> => {
42
43
  const { messages = [], tools = {}, languageModel } = opts;
@@ -50,7 +51,8 @@ export const reCallAgent = async (opts: { messages?: ModelMessage[], tools?: Rec
50
51
  messages.push(...result.response.messages);
51
52
  return reCallAgent({ messages, tools, languageModel });
52
53
  }
53
- return { result, messages };
54
+ let outputText = result.output
55
+ return { result, messages, outputText };
54
56
  }
55
57
  export const runAgent = async (opts: { app: QueryRouterServer | App, messages?: ModelMessage[], routes?: Route[], query?: string, languageModel: LanguageModel, token: string }) => {
56
58
  const { app, languageModel } = opts;