@vibe-forge/core 0.7.1 → 0.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibe-forge/core",
3
- "version": "0.7.1",
3
+ "version": "0.7.4",
4
4
  "imports": {
5
5
  "#~/*.js": {
6
6
  "__vibe-forge__": {
@@ -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
 
@@ -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: 对 routed model service 通过本地代理写入 Responses API `max_output_tokens`
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'; message: string }
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 }