@huyooo/ai-chat-frontend-vue 0.3.30 → 0.3.32

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.
@@ -32,7 +32,7 @@ import type { ChatMessage, ContentPart } from '../types';
32
32
  export declare function useChat(options: UseChatOptions): {
33
33
  sessions: import("vue").Ref<{
34
34
  id: string;
35
- appId: string | null;
35
+ chatScope: string | null;
36
36
  userId: string | null;
37
37
  title: string;
38
38
  model: string;
@@ -44,7 +44,7 @@ export declare function useChat(options: UseChatOptions): {
44
44
  updatedAt: Date;
45
45
  }[], SessionRecord[] | {
46
46
  id: string;
47
- appId: string | null;
47
+ chatScope: string | null;
48
48
  userId: string | null;
49
49
  title: string;
50
50
  model: string;
@@ -68,6 +68,7 @@ export declare function useChat(options: UseChatOptions): {
68
68
  toolCallId: string;
69
69
  toolName: string;
70
70
  renderName: string;
71
+ extensionId?: string | undefined;
71
72
  };
72
73
  } | {
73
74
  [x: string]: unknown;
@@ -95,6 +96,7 @@ export declare function useChat(options: UseChatOptions): {
95
96
  toolCallId: string;
96
97
  toolName: string;
97
98
  renderName: string;
99
+ extensionId?: string | undefined;
98
100
  };
99
101
  } | {
100
102
  type: "zhipu_search";
@@ -104,20 +106,21 @@ export declare function useChat(options: UseChatOptions): {
104
106
  toolCallId: string;
105
107
  toolName: string;
106
108
  renderName: string;
109
+ extensionId?: string | undefined;
107
110
  };
108
111
  } | {
109
112
  type: "tool_call";
110
113
  id: string;
111
114
  name: string;
115
+ displayName?: string | undefined;
116
+ toolName?: string | undefined;
117
+ extensionId?: string | undefined;
112
118
  args?: Record<string, unknown> | undefined;
113
119
  status: "pending" | "running" | "done" | "error" | "cancelled" | "skipped";
114
- approvalReason?: import("@huyooo/ai-chat-shared").ToolApprovalReason | undefined;
115
- approvalPolicy?: import("@huyooo/ai-chat-shared").AssetApprovalPolicy | undefined;
116
- sideEffectLevel?: import("@huyooo/ai-chat-shared").AssetSideEffectLevel | undefined;
117
- hostDependency?: import("@huyooo/ai-chat-shared").AssetHostDependency | undefined;
118
- riskSummary?: string | undefined;
119
- riskTags?: string[] | undefined;
120
- riskSignals?: string[] | undefined;
120
+ confirmationReason?: import("@huyooo/ai-chat-shared").ToolConfirmationReason | undefined;
121
+ summary?: string | undefined;
122
+ details?: string[] | undefined;
123
+ tags?: string[] | undefined;
121
124
  output?: {
122
125
  stdout?: string | undefined;
123
126
  stderr?: string | undefined;
@@ -138,6 +141,7 @@ export declare function useChat(options: UseChatOptions): {
138
141
  type: "error";
139
142
  message: string;
140
143
  category?: string | undefined;
144
+ code?: string | undefined;
141
145
  retryable?: boolean | undefined;
142
146
  } | {
143
147
  type: "plan";
@@ -147,11 +151,15 @@ export declare function useChat(options: UseChatOptions): {
147
151
  toolCallId: string;
148
152
  toolName: string;
149
153
  renderName: string;
154
+ extensionId?: string | undefined;
150
155
  };
151
156
  } | {
152
157
  type: "compact";
153
158
  status: "running" | "done" | "failed";
154
159
  model?: string | undefined;
160
+ modelLabel?: string | undefined;
161
+ strategy?: import("../types").CompressionStrategy | undefined;
162
+ error?: string | undefined;
155
163
  estimatedTokens?: number | undefined;
156
164
  budget?: number | undefined;
157
165
  tokensBeforeCompact?: number | undefined;
@@ -164,9 +172,13 @@ export declare function useChat(options: UseChatOptions): {
164
172
  type: "content_compress";
165
173
  status: "running" | "done" | "failed";
166
174
  model?: string | undefined;
175
+ modelLabel?: string | undefined;
176
+ strategy?: import("../types").CompressionStrategy | undefined;
177
+ error?: string | undefined;
167
178
  summary?: string | undefined;
168
179
  originalTokens?: number | undefined;
169
180
  compressedTokens?: number | undefined;
181
+ budget?: number | undefined;
170
182
  duration?: number | undefined;
171
183
  })[];
172
184
  atContextItems?: ({
@@ -276,6 +288,7 @@ export declare function useChat(options: UseChatOptions): {
276
288
  copyMessage: (messageId: string) => Promise<void>;
277
289
  regenerateMessage: (messageIndex: number) => void;
278
290
  resendFromIndex: (index: number, text: string, atContextItems?: import("@huyooo/ai-chat-types").AtContextItem[]) => Promise<void>;
291
+ allowToolForSession: (sessionId: string, toolKey: string) => void;
279
292
  queuedMessages: import("vue").ComputedRef<{
280
293
  id: string;
281
294
  text: string;
@@ -327,17 +340,16 @@ export declare function useChat(options: UseChatOptions): {
327
340
  setModel: (value: string) => void;
328
341
  setWebSearch: (value: boolean) => void;
329
342
  setThinking: (value: boolean) => void;
330
- setWorkingDirectory: (dir: string) => void;
331
343
  retryToolCall: (messageId: string, toolCallId: string) => Promise<void>;
332
344
  /** 从存储重新拉取聊天能力与偏好(与设置页保存后保持会话侧一致) */
333
345
  reloadCapabilities: () => Promise<void>;
334
- autoRunConfig: import("vue").Ref<{
335
- mode?: import("@huyooo/ai-chat-core").AutoRunMode | undefined;
336
- }, import("@huyooo/ai-chat-core").AutoRunConfig | {
337
- mode?: import("@huyooo/ai-chat-core").AutoRunMode | undefined;
346
+ toolRunConfig: import("vue").Ref<{
347
+ preference: import("@huyooo/ai-chat-core").ToolRunPreference;
348
+ }, import("@huyooo/ai-chat-core").ToolRunConfig | {
349
+ preference: import("@huyooo/ai-chat-core").ToolRunPreference;
338
350
  }>;
339
- loadAutoRunConfig: (force?: boolean) => Promise<void>;
340
- saveAutoRunConfig: (config: import("@huyooo/ai-chat-core").AutoRunConfig) => Promise<void>;
351
+ loadToolRunConfig: (force?: boolean) => Promise<void>;
352
+ saveToolRunConfig: (config: import("@huyooo/ai-chat-core").ToolRunConfig) => Promise<void>;
341
353
  enabledTools: import("vue").ComputedRef<string[] | undefined>;
342
354
  capabilityExtensions: import("vue").ComputedRef<import("@huyooo/ai-chat-types").ChatCapabilityExtensionGroup[]>;
343
355
  setToolsChatEnabled: (items: Array<{
@@ -0,0 +1,24 @@
1
+ /**
2
+ * 消息列表 stick-to-bottom
3
+ *
4
+ * 与 ui InfiniteLoading 同一思路:底部哨兵 + IntersectionObserver。
5
+ * - 哨兵在滚动容器内可见 → 锁定跟随
6
+ * - 哨兵离开(用户上滑)→ 停跟
7
+ * - 内容增高且仍锁定 → 瞬时 scrollTop 贴底(ResizeObserver,避免只靠 IO 时增高把哨兵顶出视口后误停)
8
+ */
9
+ import { type Ref } from 'vue';
10
+ export declare function useStickToBottom(options: {
11
+ containerRef: Ref<HTMLElement | null>;
12
+ contentRef: Ref<HTMLElement | null>;
13
+ anchorRef: Ref<HTMLElement | null>;
14
+ sessionId: Ref<string | null | undefined>;
15
+ visible: Ref<boolean> | (() => boolean);
16
+ messages: Ref<unknown>;
17
+ isLoading: Ref<boolean>;
18
+ }): {
19
+ isAtBottom: Ref<boolean, boolean>;
20
+ /** 模板 @scroll 可空绑;逻辑已由 IO 承担 */
21
+ handleContainerScroll: () => void;
22
+ scrollToBottom: () => void;
23
+ scrollToBottomSmooth: () => void;
24
+ };