@vibe-forge/core 0.7.1 → 0.7.3
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/package.json +1 -1
- package/src/adapter/type.ts +8 -0
- package/src/config/types.ts +14 -0
- package/src/ws.ts +2 -2
package/package.json
CHANGED
package/src/adapter/type.ts
CHANGED
|
@@ -6,10 +6,18 @@ import type { ChatMessage, ChatMessageContent } from '../types'
|
|
|
6
6
|
|
|
7
7
|
export type AdapterMessageContent = ChatMessageContent
|
|
8
8
|
|
|
9
|
+
export interface AdapterErrorData {
|
|
10
|
+
message: string
|
|
11
|
+
code?: string
|
|
12
|
+
details?: unknown
|
|
13
|
+
fatal?: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
9
16
|
export type AdapterOutputEvent =
|
|
10
17
|
| { type: 'init'; data: SessionInitInfo }
|
|
11
18
|
| { type: 'summary'; data: SessionSummaryInfo }
|
|
12
19
|
| { type: 'message'; data: ChatMessage }
|
|
20
|
+
| { type: 'error'; data: AdapterErrorData }
|
|
13
21
|
| { type: 'exit'; data: { exitCode?: number; stderr?: string } }
|
|
14
22
|
| { type: 'stop'; data?: ChatMessage }
|
|
15
23
|
|
package/src/config/types.ts
CHANGED
|
@@ -34,6 +34,20 @@ export interface ModelServiceConfig {
|
|
|
34
34
|
* 模型服务支持的模型别名
|
|
35
35
|
*/
|
|
36
36
|
modelsAlias?: Record<string, string[]>
|
|
37
|
+
/**
|
|
38
|
+
* 模型服务超时(毫秒)。
|
|
39
|
+
* - Codex: 映射为 `stream_idle_timeout_ms`
|
|
40
|
+
* - Claude Code Router: 映射为全局 `API_TIMEOUT_MS`
|
|
41
|
+
* - OpenCode: 映射为 provider `timeout` / `chunkTimeout`
|
|
42
|
+
*/
|
|
43
|
+
timeoutMs?: number
|
|
44
|
+
/**
|
|
45
|
+
* 模型服务默认最大输出 token。
|
|
46
|
+
* - Codex: 映射为 `turn/start.maxOutputTokens`
|
|
47
|
+
* - Claude Code Router: 映射为 `maxtoken` transformer
|
|
48
|
+
* - OpenCode: 映射为 model `options.maxOutputTokens` / `limit.output`
|
|
49
|
+
*/
|
|
50
|
+
maxOutputTokens?: number
|
|
37
51
|
/**
|
|
38
52
|
* 拓展配置,由下游自行消费
|
|
39
53
|
*/
|
package/src/ws.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { SessionInfo } from './adapter/index.js'
|
|
1
|
+
import type { AdapterErrorData, SessionInfo } from './adapter/index.js'
|
|
2
2
|
import type { AskUserQuestionParams, ChatMessage } from './types.js'
|
|
3
3
|
|
|
4
4
|
export type WSEvent =
|
|
5
|
-
| { type: 'error';
|
|
5
|
+
| { type: 'error'; data: AdapterErrorData; message?: string }
|
|
6
6
|
| { type: 'message'; message: ChatMessage }
|
|
7
7
|
| { type: 'session_info'; info: SessionInfo }
|
|
8
8
|
| { type: 'tool_result'; toolCallId: string; output: any; isError: boolean }
|