@opentiny/tiny-robot 0.4.0-alpha.3 → 0.4.0-alpha.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.
@@ -1,13 +1,14 @@
1
- import { B as b, a, b as r, c as u, d as t, u as n, e as B, f as l, g as d, h as o } from "../index2.js";
1
+ import { B as a, a as b, b as u, c as r, d as l, u as t, e as n, f as B, g as o, h as d, i } from "../index2.js";
2
2
  export {
3
- b as Bubble,
4
- a as BubbleList,
5
- r as BubbleProvider,
6
- u as BubbleRendererMatchPriority,
7
- t as BubbleRenderers,
8
- n as useBubbleBoxRenderer,
9
- B as useBubbleContentRenderer,
10
- l as useBubbleStateChangeFn,
11
- d as useMessageContent,
12
- o as useOmitMessageFields
3
+ a as Bubble,
4
+ b as BubbleList,
5
+ u as BubbleProvider,
6
+ r as BubbleRendererMatchPriority,
7
+ l as BubbleRenderers,
8
+ t as useBubbleBoxRenderer,
9
+ n as useBubbleContentRenderer,
10
+ B as useBubbleStateChangeFn,
11
+ o as useMessageContent,
12
+ d as useOmitMessageFields,
13
+ i as useToolCall
13
14
  };
package/dist/index.d.ts CHANGED
@@ -2264,7 +2264,9 @@ export declare const BubbleRenderers: {
2264
2264
  open?: boolean;
2265
2265
  }>;
2266
2266
  contentIndex?: number;
2267
- }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
2267
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
2268
+ detailRef: HTMLParagraphElement;
2269
+ }, any>;
2268
2270
  Text: DefineComponent< {
2269
2271
  message: BubbleMessage<ChatMessageContent, Record<string, unknown>>;
2270
2272
  contentIndex?: number;
@@ -2274,19 +2276,21 @@ export declare const BubbleRenderers: {
2274
2276
  }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
2275
2277
  Tool: DefineComponent<BubbleContentRendererProps<ChatMessageContent, {
2276
2278
  toolCall?: Record<string, {
2277
- status?: "success" | "running" | "failed" | "cancelled";
2279
+ status?: ToolCallStatus;
2278
2280
  open?: boolean;
2279
2281
  }>;
2280
2282
  }> & {
2281
- toolIndex: number;
2283
+ toolCallIndex: number;
2282
2284
  }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<BubbleContentRendererProps<ChatMessageContent, {
2283
2285
  toolCall?: Record<string, {
2284
- status?: "success" | "running" | "failed" | "cancelled";
2286
+ status?: ToolCallStatus;
2285
2287
  open?: boolean;
2286
2288
  }>;
2287
2289
  }> & {
2288
- toolIndex: number;
2289
- }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
2290
+ toolCallIndex: number;
2291
+ }> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
2292
+ detailRef: HTMLDivElement;
2293
+ }, HTMLDivElement>;
2290
2294
  ToolRole: DefineComponent< {
2291
2295
  message: BubbleMessage<string, Record<string, unknown>>;
2292
2296
  contentIndex?: number;
@@ -3412,7 +3416,7 @@ export declare type ThemeType = 'light' | 'dark';
3412
3416
  /**
3413
3417
  * 工具调用接口(支持 OpenAI 格式)
3414
3418
  */
3415
- declare interface ToolCall {
3419
+ export declare interface ToolCall {
3416
3420
  id: string;
3417
3421
  type: 'function' | string;
3418
3422
  function: {
@@ -3422,6 +3426,10 @@ declare interface ToolCall {
3422
3426
  [x: string]: any;
3423
3427
  }
3424
3428
 
3429
+ declare type ToolCallStatus = (typeof toolCallStatus)[number];
3430
+
3431
+ declare const toolCallStatus: readonly ["running", "success", "failed", "cancelled"];
3432
+
3425
3433
  declare interface TooltipContentProps {
3426
3434
  show?: boolean;
3427
3435
  content: string;
@@ -3455,6 +3463,12 @@ export declare function useAutoScroll(target: MaybeComputedElementRef, source: M
3455
3463
  bottomThreshold?: number;
3456
3464
  }): {
3457
3465
  scrollToBottom: (behavior?: ScrollBehavior) => Promise<void>;
3466
+ arrivedState: {
3467
+ left: boolean;
3468
+ right: boolean;
3469
+ top: boolean;
3470
+ bottom: boolean;
3471
+ };
3458
3472
  };
3459
3473
 
3460
3474
  export declare function useBubbleBoxRenderer(messages: MaybeRefOrGetter<BubbleMessage[]>, contentIndex?: number): ComputedRef<{
@@ -3503,6 +3517,28 @@ export declare const useTheme: () => {
3503
3517
  setColorMode: (mode: ColorMode) => boolean;
3504
3518
  };
3505
3519
 
3520
+ export declare const useToolCall: (props: BubbleContentRendererProps<ChatMessageContent, {
3521
+ toolCall?: Record<string, {
3522
+ status?: ToolCallStatus;
3523
+ open?: boolean;
3524
+ }>;
3525
+ }> & {
3526
+ toolCallIndex: number;
3527
+ }) => {
3528
+ toolCall: ComputedRef<ToolCall | undefined>;
3529
+ toolCallWithResult: Readonly<Ref< {
3530
+ readonly arguments?: any;
3531
+ readonly result?: any;
3532
+ }, {
3533
+ readonly arguments?: any;
3534
+ readonly result?: any;
3535
+ }>>;
3536
+ state: ComputedRef< {
3537
+ status: "success" | "running" | "failed" | "cancelled" | undefined;
3538
+ open: boolean | undefined;
3539
+ }>;
3540
+ };
3541
+
3506
3542
  export declare function useTouchDevice(): {
3507
3543
  isTouchDevice: Ref<boolean, boolean>;
3508
3544
  };
package/dist/index.js CHANGED
@@ -1,20 +1,20 @@
1
1
  import z from "./attachments/index.js";
2
2
  import { B as b, a as x, b as S } from "./index2.js";
3
- import { c as ve, d as fe, i as _e, u as ge, e as he, f as De, g as Te, h as Fe } from "./index2.js";
3
+ import { c as ve, d as fe, j as _e, u as ge, e as he, f as De, g as Te, h as Fe, i as ze } from "./index2.js";
4
4
  import E from "./container/index.js";
5
5
  import P from "./conversations/index.js";
6
6
  import B from "./drag-overlay/index.js";
7
- import L from "./dropdown-menu/index.js";
8
- import C from "./feedback/index.js";
7
+ import C from "./dropdown-menu/index.js";
8
+ import L from "./feedback/index.js";
9
9
  import { H as y } from "./index3.js";
10
- import { u as be } from "./index3.js";
10
+ import { u as xe } from "./index3.js";
11
11
  import O from "./icon-button/index.js";
12
- import { Prompt as M, Prompts as A } from "./prompts/index.js";
13
- import H from "./sender/index.js";
14
- import j, { SuggestionPillButton as R } from "./suggestion-pills/index.js";
12
+ import { Prompt as M, Prompts as j } from "./prompts/index.js";
13
+ import A from "./sender/index.js";
14
+ import H, { SuggestionPillButton as R } from "./suggestion-pills/index.js";
15
15
  import w from "./suggestion-popover/index.js";
16
16
  import k from "./theme-provider/index.js";
17
- import { useTheme as Se } from "./theme-provider/index.js";
17
+ import { useTheme as Ee } from "./theme-provider/index.js";
18
18
  import W from "./welcome/index.js";
19
19
  import $ from "./mcp-server-picker/index.js";
20
20
  import I from "./mcp-add-form/index.js";
@@ -151,14 +151,14 @@ const ue = {
151
151
  E,
152
152
  P,
153
153
  B,
154
- L,
155
154
  C,
155
+ L,
156
156
  y,
157
157
  O,
158
158
  M,
159
+ j,
159
160
  A,
160
161
  H,
161
- j,
162
162
  R,
163
163
  w,
164
164
  k,
@@ -183,17 +183,17 @@ export {
183
183
  E as Container,
184
184
  P as Conversations,
185
185
  B as DragOverlay,
186
- L as DropdownMenu,
187
- C as Feedback,
186
+ C as DropdownMenu,
187
+ L as Feedback,
188
188
  y as History,
189
189
  O as IconButton,
190
190
  I as McpAddForm,
191
191
  $ as McpServerPicker,
192
192
  M as Prompt,
193
- A as Prompts,
194
- H as Sender,
193
+ j as Prompts,
194
+ A as Sender,
195
195
  R as SuggestionPillButton,
196
- j as SuggestionPills,
196
+ H as SuggestionPills,
197
197
  w as SuggestionPopover,
198
198
  k as ThemeProvider,
199
199
  z as TrAttachments,
@@ -203,17 +203,17 @@ export {
203
203
  E as TrContainer,
204
204
  P as TrConversations,
205
205
  B as TrDragOverlay,
206
- L as TrDropdownMenu,
207
- C as TrFeedback,
206
+ C as TrDropdownMenu,
207
+ L as TrFeedback,
208
208
  y as TrHistory,
209
209
  O as TrIconButton,
210
210
  I as TrMcpAddForm,
211
211
  $ as TrMcpServerPicker,
212
212
  M as TrPrompt,
213
- A as TrPrompts,
214
- H as TrSender,
213
+ j as TrPrompts,
214
+ A as TrSender,
215
215
  R as TrSuggestionPillButton,
216
- j as TrSuggestionPills,
216
+ H as TrSuggestionPills,
217
217
  w as TrSuggestionPopover,
218
218
  k as TrThemeProvider,
219
219
  W as TrWelcome,
@@ -225,7 +225,8 @@ export {
225
225
  De as useBubbleStateChangeFn,
226
226
  Te as useMessageContent,
227
227
  Fe as useOmitMessageFields,
228
- Se as useTheme,
229
- be as useTouchDevice,
228
+ Ee as useTheme,
229
+ ze as useToolCall,
230
+ xe as useTouchDevice,
230
231
  ue as vDropzone
231
232
  };