@huyooo/ai-chat-types 0.2.38 → 0.2.41

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _huyooo_ai_chat_core_events from '@huyooo/ai-chat-core/events';
2
- export { AbortEvent, ChatEvent, ChatEventType, DoneEvent, ErrorCategory, ErrorDetails, ErrorEvent, PlanStep, PlanStepStatus, SearchEndEvent, SearchEvent, SearchResult, SearchResultEvent, SearchStartEvent, SideEffect, StatusEvent, StepEndEvent, StepEvent, StepStartEvent, TextDeltaEvent, TextEvent, ThinkingDeltaEvent, ThinkingEndEvent, ThinkingEvent, ThinkingStartEvent, TokenUsage, ToolApprovalRequestEvent, ToolCallInfo, ToolCallOutputEvent, ToolCallResultEvent, ToolCallStartEvent, ToolCallStatus, ToolErrorShape, ToolEvent, createAbort, createApiError, createDone, createError, createParseError, createRateLimitError, createSearchEnd, createSearchResult, createSearchStart, createStepEnd, createStepStart, createTextDelta, createThinkingDelta, createThinkingEnd, createThinkingStart, createThrowableToolError, createTimeoutError, createToolCallOutput, createToolCallResult, createToolCallStart, createToolError, isAbortEvent, isErrorEvent, isRetryableError, isSearchEvent, isStatusEvent, isStepEvent, isTextEvent, isThinkingEvent, isThrowableToolError, isToolEvent } from '@huyooo/ai-chat-core/events';
2
+ export { AbortEvent, ChatEvent, ChatEventType, DoneEvent, ErrorCategory, ErrorDetails, ErrorEvent, PlanStep, PlanStepStatus, SearchEndEvent, SearchEvent, SearchResult, SearchResultEvent, SearchStartEvent, StatusEvent, StepEndEvent, StepEvent, StepStartEvent, TextDeltaEvent, TextEvent, ThinkingDeltaEvent, ThinkingEndEvent, ThinkingEvent, ThinkingStartEvent, TokenUsage, ToolApprovalRequestEvent, ToolCallInfo, ToolCallOutputEvent, ToolCallResultEvent, ToolCallStartEvent, ToolCallStatus, ToolErrorShape, ToolEvent, ToolUIShape, createAbort, createApiError, createDone, createError, createParseError, createRateLimitError, createSearchEnd, createSearchResult, createSearchStart, createStepEnd, createStepStart, createTextDelta, createThinkingDelta, createThinkingEnd, createThinkingStart, createTimeoutError, createToolCallOutput, createToolCallResult, createToolCallStart, createToolError, isAbortEvent, isErrorEvent, isRetryableError, isSearchEvent, isStatusEvent, isStepEvent, isTextEvent, isThinkingEvent, isThrowableToolError, isToolEvent } from '@huyooo/ai-chat-core/events';
3
3
  import { ModelOption, ChatEvent } from '@huyooo/ai-chat-core';
4
4
  export { AutoRunConfig, AutoRunMode, McpConnectionInfo, McpConnectionStatus, McpServerConfig, ModelOption, ProviderType, ThinkingMode } from '@huyooo/ai-chat-core';
5
5
 
@@ -127,7 +127,12 @@ interface ToolExecutionResult {
127
127
  success: boolean;
128
128
  result: string;
129
129
  error?: string;
130
- resultType?: string;
130
+ /** 工具 UI 声明(成功时) */
131
+ ui?: {
132
+ type: 'render' | 'action';
133
+ name: string;
134
+ props?: Record<string, unknown>;
135
+ };
131
136
  toolError?: _huyooo_ai_chat_core_events.ToolErrorShape;
132
137
  }
133
138
  /** ASR 会话配置 */
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{createThinkingStart as o,createThinkingDelta as e,createThinkingEnd as r,createSearchStart as t,createSearchResult as a,createSearchEnd as c,createToolCallStart as h,createToolCallResult as i,createToolCallOutput as m,createTextDelta as p,createDone as f,createError as n,createApiError as s,createRateLimitError as u,createToolError as v,createTimeoutError as x,createParseError as y,createAbort as b,createStepStart as d,createStepEnd as g,isThinkingEvent as j,isSearchEvent as k,isToolEvent as l,isTextEvent as q,isStatusEvent as w,isErrorEvent as z,isAbortEvent as A,isStepEvent as B,isRetryableError as C,createThrowableToolError as D,isThrowableToolError as E}from"@huyooo/ai-chat-core/events";export{b as createAbort,s as createApiError,f as createDone,n as createError,y as createParseError,u as createRateLimitError,c as createSearchEnd,a as createSearchResult,t as createSearchStart,g as createStepEnd,d as createStepStart,p as createTextDelta,e as createThinkingDelta,r as createThinkingEnd,o as createThinkingStart,D as createThrowableToolError,x as createTimeoutError,m as createToolCallOutput,i as createToolCallResult,h as createToolCallStart,v as createToolError,A as isAbortEvent,z as isErrorEvent,C as isRetryableError,k as isSearchEvent,w as isStatusEvent,B as isStepEvent,q as isTextEvent,j as isThinkingEvent,E as isThrowableToolError,l as isToolEvent};
1
+ import{createThinkingStart as o,createThinkingDelta as e,createThinkingEnd as r,createSearchStart as t,createSearchResult as a,createSearchEnd as c,createToolCallStart as h,createToolCallResult as i,createToolCallOutput as m,createTextDelta as p,createDone as f,createError as n,createApiError as s,createRateLimitError as u,createToolError as v,createTimeoutError as x,createParseError as y,createAbort as b,createStepStart as d,createStepEnd as g,isThinkingEvent as j,isSearchEvent as k,isToolEvent as l,isTextEvent as q,isStatusEvent as w,isErrorEvent as z,isAbortEvent as A,isStepEvent as B,isRetryableError as C,isThrowableToolError as D}from"@huyooo/ai-chat-core/events";export{b as createAbort,s as createApiError,f as createDone,n as createError,y as createParseError,u as createRateLimitError,c as createSearchEnd,a as createSearchResult,t as createSearchStart,g as createStepEnd,d as createStepStart,p as createTextDelta,e as createThinkingDelta,r as createThinkingEnd,o as createThinkingStart,x as createTimeoutError,m as createToolCallOutput,i as createToolCallResult,h as createToolCallStart,v as createToolError,A as isAbortEvent,z as isErrorEvent,C as isRetryableError,k as isSearchEvent,w as isStatusEvent,B as isStepEvent,q as isTextEvent,j as isThinkingEvent,D as isThrowableToolError,l as isToolEvent};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huyooo/ai-chat-types",
3
- "version": "0.2.38",
3
+ "version": "0.2.41",
4
4
  "description": "AI Chat 通用类型定义 - 支持 Electron/Web/CLI 多端",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -23,7 +23,7 @@
23
23
  "test:watch": "vitest"
24
24
  },
25
25
  "dependencies": {
26
- "@huyooo/ai-chat-core": "^0.2.38"
26
+ "@huyooo/ai-chat-core": "^0.2.41"
27
27
  },
28
28
  "devDependencies": {
29
29
  "tsup": "^8.0.0",
package/src/index.ts CHANGED
@@ -26,7 +26,7 @@ export type {
26
26
  ErrorCategory,
27
27
  ErrorDetails,
28
28
  ToolErrorShape,
29
- SideEffect,
29
+ ToolUIShape,
30
30
 
31
31
  // 思考事件
32
32
  ThinkingStartEvent,
@@ -98,7 +98,6 @@ export {
98
98
  isAbortEvent,
99
99
  isStepEvent,
100
100
  isRetryableError,
101
- createThrowableToolError,
102
101
  isThrowableToolError,
103
102
  } from '@huyooo/ai-chat-core/events'
104
103
 
@@ -259,7 +258,8 @@ export interface ToolExecutionResult {
259
258
  success: boolean
260
259
  result: string
261
260
  error?: string
262
- resultType?: string
261
+ /** 工具 UI 声明(成功时) */
262
+ ui?: { type: 'render' | 'action'; name: string; props?: Record<string, unknown> }
263
263
  toolError?: import('@huyooo/ai-chat-core/events').ToolErrorShape
264
264
  }
265
265