Skip to content

Commit 9de13f6

Browse files
committed
chore: bump dependencies & migrate for xsai
1 parent 71b283d commit 9de13f6

File tree

14 files changed

+990
-1188
lines changed

14 files changed

+990
-1188
lines changed

docs/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
"docs:preview": "vitepress preview"
1313
},
1414
"devDependencies": {
15-
"@unocss/eslint-config": "^0.65.3",
16-
"@unocss/eslint-plugin": "^0.65.3",
17-
"unocss": "^0.65.3",
18-
"vite": "^6.0.7",
19-
"vite-plugin-inspect": "^0.10.6",
20-
"vitepress": "^1.5.0",
15+
"@unocss/eslint-config": "^0.65.4",
16+
"@unocss/eslint-plugin": "^0.65.4",
17+
"unocss": "^0.65.4",
18+
"vite": "^6.0.11",
19+
"vite-plugin-inspect": "^10.1.0",
20+
"vitepress": "^1.6.3",
2121
"vue": "^3.5.13"
2222
}
2323
}

examples/neuri/documentations-from-unit-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "module",
44
"version": "0.0.19",
55
"private": true,
6-
"packageManager": "[email protected].3",
6+
"packageManager": "[email protected].4",
77
"description": "",
88
"author": "",
99
"license": "ISC",

examples/neuri/weather-query/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "module",
44
"version": "0.0.19",
55
"private": true,
6-
"packageManager": "[email protected].3",
6+
"packageManager": "[email protected].4",
77
"description": "",
88
"author": "",
99
"license": "ISC",
@@ -18,8 +18,8 @@
1818
"@typeschema/valibot": "^0.14.0",
1919
"@typeschema/zod": "^0.14.0",
2020
"neuri": "workspace:^",
21-
"openai": "^4.77.3",
22-
"valibot": "^1.0.0-beta.10",
21+
"openai": "^4.82.0",
22+
"valibot": "^1.0.0-beta.14",
2323
"zod": "^3.24.1"
2424
},
2525
"devDependencies": {

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "module",
44
"version": "0.0.19",
55
"private": true,
6-
"packageManager": "[email protected].3",
6+
"packageManager": "[email protected].4",
77
"description": "Simple and easy agent framework, include various of structured data manipulation, agent and function compositing, code editing, fs and more!",
88
"author": {
99
"name": "Lingtic.io Neuri Team",
@@ -36,19 +36,19 @@
3636
"test": "vitest --coverage",
3737
"test:ui": "vitest --ui --coverage --coverage.enabled=true",
3838
"test:run": "vitest run",
39-
"typecheck": "tsc --noEmit"
39+
"typecheck": "pnpm -r --filter=./packages/* run typecheck"
4040
},
4141
"devDependencies": {
42-
"@antfu/eslint-config": "^3.12.1",
43-
"@antfu/ni": "^0.23.2",
44-
"@types/node": "^22.10.5",
42+
"@antfu/eslint-config": "^3.16.0",
43+
"@antfu/ni": "^23.3.1",
44+
"@types/node": "^22.13.0",
4545
"@vitest/coverage-v8": "2.1.8",
46-
"bumpp": "^9.9.2",
47-
"eslint": "^9.17.0",
48-
"typescript": "^5.7.2",
46+
"bumpp": "^9.11.1",
47+
"eslint": "^9.19.0",
48+
"typescript": "^5.7.3",
4949
"unbuild": "3.0.0-rc.11",
50-
"vite": "^6.0.7",
51-
"vitest": "^2.1.8"
50+
"vite": "^6.0.11",
51+
"vitest": "^3.0.4"
5252
},
5353
"workspaces": [
5454
"packages/*",

packages/format-code/package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,18 @@
4444
"dev": "unbuild --stub",
4545
"stub": "unbuild --stub",
4646
"build": "unbuild",
47-
"package:publish": "pnpm publish --access public --no-git-checks"
47+
"package:publish": "pnpm publish --access public --no-git-checks",
48+
"typecheck": "tsc --noEmit"
4849
},
4950
"dependencies": {
50-
"@guiiai/logg": "^1.0.6",
51-
"@shikijs/core": "^1.26.1",
52-
"@shikijs/engine-oniguruma": "^1.26.1",
51+
"@guiiai/logg": "^1.0.7",
52+
"@shikijs/core": "^1.29.2",
53+
"@shikijs/engine-oniguruma": "^1.29.2",
5354
"@shikijs/vscode-textmate": "^10.0.1",
54-
"shiki": "^1.26.1",
55-
"tm-grammars": "^1.22.1"
55+
"shiki": "^1.29.2",
56+
"tm-grammars": "^1.22.10"
5657
},
5758
"devDependencies": {
58-
"@types/node": "^22.10.5"
59+
"@types/node": "^22.13.0"
5960
}
6061
}

packages/neuri/package.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,30 @@
4848
"dev": "unbuild --stub",
4949
"stub": "unbuild --stub",
5050
"build": "unbuild",
51-
"package:publish": "pnpm publish --access public --no-git-checks"
51+
"package:publish": "pnpm publish --access public --no-git-checks",
52+
"typecheck": "tsc --noEmit"
5253
},
5354
"dependencies": {
54-
"@guiiai/logg": "^1.0.6",
55+
"@guiiai/logg": "^1.0.7",
5556
"@typeschema/main": "^0.14.1",
56-
"@xsai/generate-text": "^0.0.24",
57-
"@xsai/providers": "^0.0.24",
58-
"@xsai/shared-chat": "^0.0.24",
59-
"@xsai/stream-text": "^0.0.24",
60-
"@xsai/tool": "^0.0.24",
57+
"@xsai/generate-text": "^0.0.30",
58+
"@xsai/providers": "^0.0.30",
59+
"@xsai/shared-chat": "^0.0.30",
60+
"@xsai/stream-text": "^0.0.30",
61+
"@xsai/tool": "^0.0.30",
62+
"@xsai/utils-chat": "^0.0.30",
6163
"defu": "^6.1.4",
6264
"nanoid": "^5.0.9",
63-
"openai": "^4.77.3"
65+
"openai": "^4.82.0"
6466
},
6567
"devDependencies": {
6668
"@gcornut/valibot-json-schema": "^0.42.0",
6769
"@types/mdast": "^4.0.4",
68-
"@types/node": "^22.10.5",
70+
"@types/node": "^22.13.0",
6971
"@typeschema/zod": "^0.14.0",
7072
"json-schema": "^0.4.0",
7173
"remark": "^15.0.1",
72-
"valibot": "^1.0.0-beta.10",
74+
"valibot": "^1.0.0-beta.14",
7375
"zod": "^3.24.1",
7476
"zod-to-json-schema": "^3.24.1"
7577
}

packages/neuri/src/openai/messages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { ToolMessage } from '@xsai/shared-chat'
22
import type { ResolvedToolCall } from './types'
3-
import { message } from '@xsai/shared-chat'
3+
import { message } from '@xsai/utils-chat'
44

55
export function tool<P = any, R = any>(message: string, toolCall: ResolvedToolCall<P, R>): ToolMessage {
66
return {

packages/neuri/src/openai/stream.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { env } from 'node:process'
22
import { describe, expect, it } from 'vitest'
33
import { messages, system, user } from './messages'
4-
import { stream, type StreamChunk } from './stream'
4+
import { type ChunkResult, stream } from './stream'
55

66
describe('stream', async () => {
77
it('it works', async () => {
@@ -25,7 +25,7 @@ describe('stream', async () => {
2525
}
2626

2727
const readChunk = async () => {
28-
const readChunkParts: StreamChunk[] = []
28+
const readChunkParts: ChunkResult[] = []
2929
for await (const chunk of res.chunkStream()) {
3030
readChunkParts.push(chunk)
3131
}

packages/neuri/src/openai/stream.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type { StreamTextOptions, StreamTextResponse } from '@xsai/stream-text'
1+
import type { StreamTextOptions, ChunkResult as XSAIChunkResult } from '@xsai/stream-text'
22
import { streamText } from '@xsai/stream-text'
33

4-
export interface StreamChunk extends StreamTextResponse {
4+
export interface ChunkResult extends XSAIChunkResult {
55
textPart: () => string
66
}
77

@@ -30,13 +30,13 @@ export interface StreamResponse {
3030
*
3131
* @returns The completion response as a stream of chunks.
3232
*/
33-
chunkStream: () => AsyncGenerator<StreamChunk, void, unknown>
33+
chunkStream: () => AsyncGenerator<ChunkResult, void, unknown>
3434
/**
3535
* Get the completion response as a stream of chunks.
3636
*
3737
* @returns The completion response as a stream of chunks.
3838
*/
39-
chunks: () => Promise<StreamChunk[]>
39+
chunks: () => Promise<ChunkResult[]>
4040
}
4141

4242
interface PipeHook<F, T> {
@@ -85,9 +85,9 @@ export async function stream(params: StreamTextOptions): Promise<StreamResponse>
8585
})
8686
})
8787

88-
const chunkStreamHooks: PipeHook<StreamTextResponse, StreamChunk>[] = []
89-
const accumulatedChunks = new Promise<StreamChunk[]>((resolve) => {
90-
const chunks: StreamChunk[] = []
88+
const chunkStreamHooks: PipeHook<XSAIChunkResult, ChunkResult>[] = []
89+
const accumulatedChunks = new Promise<ChunkResult[]>((resolve) => {
90+
const chunks: ChunkResult[] = []
9191
chunkStreamHooks.push({
9292
onChunk: (chunk) => { chunks.push(chunk) },
9393
onDone: () => { resolve(chunks) },
@@ -105,7 +105,7 @@ export async function stream(params: StreamTextOptions): Promise<StreamResponse>
105105
),
106106
chunkStream: () => asyncIteratorFromReadableStream(
107107
res.chunkStream,
108-
async (value: StreamTextResponse): Promise<StreamChunk> => {
108+
async (value: XSAIChunkResult): Promise<ChunkResult> => {
109109
return {
110110
...value,
111111
textPart: () => {

packages/neuri/src/openai/types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import type { GenerateTextResponseUsage } from '@xsai/generate-text'
21
import type { ProviderOptions } from '@xsai/providers'
3-
import type { AssistantMessageResponse, FinishReason, Message, ToolCall, Tool as UpstreamTool } from '@xsai/shared-chat'
2+
import type { AssistantMessageResponse, FinishReason, Message, ToolCall, Tool as UpstreamTool, Usage } from '@xsai/shared-chat'
43

54
export interface Choice {
65
finish_reason: FinishReason
@@ -15,7 +14,7 @@ export interface ChatCompletionsResponse {
1514
model: string
1615
object: 'chat.completion'
1716
system_fingerprint: string
18-
usage: GenerateTextResponseUsage
17+
usage: Usage
1918
}
2019

2120
export type Tool = Omit<UpstreamTool, 'execute'>

0 commit comments

Comments
 (0)