@blueking/chat-x 0.0.49-beta.2 → 0.0.49-beta.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,5 +1,4 @@
1
1
  import type { AIFileInfo, ArtifactUrlResult } from '../../../../../ag-ui/types/file';
2
- import type { ResolveArtifactUrlsOptions } from '../../../../../composables/use-artifact-preview';
3
2
  import type { ArtifactPreviewRendererKind } from './preview-strategy';
4
3
  export type ArtifactPreviewPayload = {
5
4
  content: string;
@@ -8,15 +7,14 @@ export type ArtifactPreviewPayload = {
8
7
  status: ArtifactPreviewStatus;
9
8
  };
10
9
  export type ArtifactPreviewStatus = 'empty' | 'error' | 'idle' | 'loading' | 'ready';
11
- export type ArtifactPreviewLoadOptions = ResolveArtifactUrlsOptions;
12
10
  export declare const useArtifactPreviewLoader: (options: {
13
11
  canResolve: () => boolean;
14
12
  getFile: () => AIFileInfo | undefined;
15
- resolveUrls: (file: AIFileInfo, options?: ResolveArtifactUrlsOptions) => Promise<ArtifactUrlResult>;
13
+ resolveUrls: (file: AIFileInfo) => Promise<ArtifactUrlResult>;
16
14
  }) => {
17
15
  content: import("vue").ShallowRef<string, string>;
18
16
  dispose: () => void;
19
- load: (loadOptions?: ArtifactPreviewLoadOptions) => Promise<void>;
17
+ load: () => Promise<void>;
20
18
  previewUrl: import("vue").ShallowRef<string, string>;
21
19
  renderer: import("vue").ShallowRef<ArtifactPreviewRendererKind, ArtifactPreviewRendererKind>;
22
20
  status: import("vue").ShallowRef<ArtifactPreviewStatus, ArtifactPreviewStatus>;
@@ -4,17 +4,10 @@ import type { AIFileInfo, ArtifactUrlResult, OnArtifactClick } from '../ag-ui/ty
4
4
  export declare const ARTIFACT_PREVIEW_TOKEN: unique symbol;
5
5
  /** 文件产物侧栏 Tab 的保留唯一标识(固定 Tab,不可关闭) */
6
6
  export declare const FILE_ARTIFACT_TAB_NAME = "file-artifact";
7
- /** 临时链接缓存有效期(短于后端 token 常见 10 分钟时效) */
8
- export declare const ARTIFACT_URL_CACHE_TTL_MS: number;
9
7
  export type OpenArtifactPreviewPayload = {
10
8
  /** 被点击的文件 */
11
9
  file: AIFileInfo;
12
10
  };
13
- /** resolveArtifactUrls 可选参数 */
14
- export type ResolveArtifactUrlsOptions = {
15
- /** 为 true 时跳过 TTL 缓存,强制重新取链(如预览重试) */
16
- force?: boolean;
17
- };
18
11
  /**
19
12
  * 会话级文件产物:以 outputId 为会话内唯一键(同 outputId 视为同一文件)。
20
13
  * 拍平去重后即为 AIFileInfo,此处用别名标明语义。
@@ -27,8 +20,8 @@ type ArtifactPreviewContext = {
27
20
  canResolveArtifactUrl: ComputedRef<boolean>;
28
21
  /** 由文件卡片触发:命中文件并弹出/切换到文件产物侧栏 */
29
22
  openPreview: (payload: OpenArtifactPreviewPayload) => void;
30
- /** 解析 download_url / preview_url:TTL 内复用缓存;force 时强制刷新;并发去重 */
31
- resolveArtifactUrls: (file: AIFileInfo, options?: ResolveArtifactUrlsOptions) => Promise<ArtifactUrlResult>;
23
+ /** 解析 download_url / preview_url:每次重新取链;同文件并发去重 */
24
+ resolveArtifactUrls: (file: AIFileInfo) => Promise<ArtifactUrlResult>;
32
25
  /** 直接设置命中文件 outputId(侧栏列表内切换用) */
33
26
  setActiveArtifactId: (id: string) => void;
34
27
  };
@@ -36,7 +29,7 @@ type ArtifactPreviewContext = {
36
29
  export declare const triggerArtifactDownload: (url: string, fileName: string) => void;
37
30
  /**
38
31
  * 文件产物预览 Provider(在 ChatContainer 内使用)。
39
- * 维护「命中文件」状态,并封装 onArtifactClick 取链(TTL 缓存 + 并发去重);
32
+ * 维护「命中文件」状态,并封装 onArtifactClick 取链(每次重新获取 + 并发去重);
40
33
  * 打开侧栏 Tab 的副作用由外部 onOpen 注入。
41
34
  */
42
35
  export declare const useArtifactPreviewProvider: (options: {
@@ -48,7 +41,7 @@ export declare const useArtifactPreviewProvider: (options: {
48
41
  activeArtifactId: import("vue").ShallowRef<string, string>;
49
42
  canResolveArtifactUrl: ComputedRef<boolean>;
50
43
  openPreview: (payload: OpenArtifactPreviewPayload) => void;
51
- resolveArtifactUrls: (file: AIFileInfo, resolveOptions?: ResolveArtifactUrlsOptions) => Promise<ArtifactUrlResult>;
44
+ resolveArtifactUrls: (file: AIFileInfo) => Promise<ArtifactUrlResult>;
52
45
  setActiveArtifactId: (id: string) => void;
53
46
  };
54
47
  /** 文件产物预览 Consumer(在深层文件卡片中使用),无 Provider 时返回 undefined 兜底 */
@@ -1,18 +1,25 @@
1
1
  import { type ComputedRef, type MaybeRef } from 'vue';
2
2
  export declare const CONTAINER_SCROLL_TOKEN: unique symbol;
3
3
  export declare const SHOW_SCROLL_BOTTOM_BTN_DISTANCE = 100;
4
+ /**
5
+ * 距底部超过该距离时视为大跨度定位(首屏渲染、切换会话、异步内容撑高),
6
+ * 此时直接瞬时贴底;平滑滚动只用于流式输出过程中的小幅跟随。
7
+ */
8
+ export declare const INSTANT_SCROLL_DISTANCE = 600;
4
9
  export type ContainerScrollData = {
5
10
  autoScrollEnabled: boolean;
6
11
  isScrollBottom: boolean;
12
+ jumpToBottom: () => void;
7
13
  scrollBottomHeight: number;
8
- toScrollBottom: () => void;
14
+ toScrollBottom: (behavior?: ScrollBehavior) => void;
9
15
  toScrollTop: () => void;
10
16
  };
11
17
  export declare const useContainerScrollProvider: (containerRef: MaybeRef<HTMLElement | null>, bottomRef: MaybeRef<HTMLElement | null>) => {
12
18
  autoScrollEnabled: import("vue").ShallowRef<boolean, boolean>;
13
19
  isScrollBottom: import("vue").ShallowRef<boolean, boolean>;
14
20
  scrollBottomHeight: import("vue").ShallowRef<number, number>;
15
- toScrollBottom: () => void;
21
+ jumpToBottom: () => void;
22
+ toScrollBottom: (behavior?: ScrollBehavior) => void;
16
23
  toScrollTop: () => void;
17
24
  debouncedShowScrollBottomBtn: import("vue").Ref<boolean, boolean>;
18
25
  };