@openviking/react 0.1.3 → 0.1.5

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.
Files changed (209) hide show
  1. package/LICENSE.arco-design +21 -0
  2. package/README.md +27 -15
  3. package/dist/0~0.js +19 -0
  4. package/dist/28~0.js +15 -0
  5. package/dist/2~0.js +2270 -29
  6. package/dist/2~0.js.LICENSE.txt +23 -0
  7. package/dist/3c~0.js +2208 -0
  8. package/dist/3~0.js +1207 -1982
  9. package/dist/4~0.js +18 -0
  10. package/dist/9~0.js +43 -0
  11. package/dist/{1~0.js → ae~0.js} +11 -26
  12. package/dist/ark-message-list-view~0.js +530 -119
  13. package/dist/a~0.js +1300 -14
  14. package/dist/c7~0.js +38 -2
  15. package/dist/ck~0.js +23 -0
  16. package/dist/client/provider.d.ts +15 -9
  17. package/dist/client/types.d.ts +5 -5
  18. package/dist/client.js +2 -1
  19. package/dist/components/agent-connect/agent-connect-code-block.d.ts +14 -0
  20. package/dist/components/agent-connect/agent-connect-copy.d.ts +22 -33
  21. package/dist/components/agent-connect/agent-connect-design.d.ts +1936 -168
  22. package/dist/components/agent-connect/agent-connect-installer.d.ts +1 -0
  23. package/dist/components/agent-connect/agent-connect-instructions-view.d.ts +4 -6
  24. package/dist/components/agent-connect/agent-connect-instructions.d.ts +148 -0
  25. package/dist/components/agent-connect/agent-connect-markdown.d.ts +8 -2
  26. package/dist/components/agent-connect/agent-connect-mask.d.ts +10 -0
  27. package/dist/components/agent-connect/agent-connect.d.ts +1 -1
  28. package/dist/components/agent-connect/locales/en-US.d.ts +23 -0
  29. package/dist/components/agent-connect/locales/zh-CN.d.ts +3 -0
  30. package/dist/components/agent-connect/style.css +129 -3
  31. package/dist/components/agent-connect/types.d.ts +7 -4
  32. package/dist/components/agent-connect/use-agent-connect-copy.d.ts +6 -0
  33. package/dist/components/directory-tour/directory-tour.d.ts +3 -0
  34. package/dist/components/directory-tour/index.d.ts +3 -0
  35. package/dist/components/directory-tour/locales/en-US.d.ts +3 -0
  36. package/dist/components/directory-tour/locales/zh-CN.d.ts +3 -0
  37. package/dist/components/directory-tour/steps.d.ts +5 -0
  38. package/dist/components/directory-tour/style.css +237 -0
  39. package/dist/components/directory-tour/style.js +0 -0
  40. package/dist/components/directory-tour/types.d.ts +43 -0
  41. package/dist/components/directory-tour/use-tour-anchor.d.ts +5 -0
  42. package/dist/components/directory-tour/use-tour-position.d.ts +12 -0
  43. package/dist/components/directory-tour.js +40 -0
  44. package/dist/components/file-browser-entries/file-browser-entries.d.ts +5 -5
  45. package/dist/components/file-browser-entries/labels.d.ts +3 -0
  46. package/dist/components/file-browser-entries/locales/en-US.d.ts +6 -0
  47. package/dist/components/file-browser-entries/locales/zh-CN.d.ts +6 -0
  48. package/dist/components/file-browser-entries/style.css +866 -2
  49. package/dist/components/file-browser-entries/types.d.ts +34 -16
  50. package/dist/components/file-preview/file-preview-adapters.d.ts +2 -1
  51. package/dist/components/file-preview/file-preview-body.d.ts +2 -1
  52. package/dist/components/file-preview/file-preview-breadcrumb-menu.d.ts +2 -1
  53. package/dist/components/file-preview/file-preview-breadcrumb.d.ts +2 -1
  54. package/dist/components/file-preview/file-preview-directory.d.ts +2 -1
  55. package/dist/components/file-preview/file-preview-handle-adapters.d.ts +2 -1
  56. package/dist/components/file-preview/file-preview-header.d.ts +6 -2
  57. package/dist/components/file-preview/file-preview-image-frame.d.ts +5 -0
  58. package/dist/components/file-preview/file-preview-labels.d.ts +2 -14
  59. package/dist/components/file-preview/file-preview-level-tabs.d.ts +7 -0
  60. package/dist/components/file-preview/file-preview-markdown-images.d.ts +13 -0
  61. package/dist/components/file-preview/file-preview-panels.d.ts +5 -2
  62. package/dist/components/file-preview/file-preview-viewer.d.ts +2 -1
  63. package/dist/components/file-preview/file-preview.d.ts +0 -1
  64. package/dist/components/file-preview/index.d.ts +2 -1
  65. package/dist/components/file-preview/locales/en-US.d.ts +16 -0
  66. package/dist/components/file-preview/locales/zh-CN.d.ts +16 -0
  67. package/dist/components/file-preview/style.css +160 -2
  68. package/dist/components/file-preview/types.d.ts +34 -10
  69. package/dist/components/file-preview/use-file-preview-levels.d.ts +7 -0
  70. package/dist/components/file-preview/use-file-preview-view-state.d.ts +15 -0
  71. package/dist/components/file-preview.js +1 -1
  72. package/dist/components/file-tree/file-tree-info-labels.d.ts +0 -15
  73. package/dist/components/file-tree/file-tree-labels.d.ts +4 -0
  74. package/dist/components/file-tree/file-tree-row-shared.d.ts +2 -12
  75. package/dist/components/file-tree/file-tree-toolbar.d.ts +11 -0
  76. package/dist/components/file-tree/locales/en-US.d.ts +69 -0
  77. package/dist/components/file-tree/locales/zh-CN.d.ts +69 -0
  78. package/dist/components/file-tree/style.css +143 -15
  79. package/dist/components/file-tree/types.d.ts +38 -10
  80. package/dist/components/file-tree/use-file-tree-actions.d.ts +4 -1
  81. package/dist/components/scope-switcher/labels.d.ts +3 -0
  82. package/dist/components/scope-switcher/locales/en-US.d.ts +8 -0
  83. package/dist/components/scope-switcher/locales/zh-CN.d.ts +8 -0
  84. package/dist/components/scope-switcher/scope-panel.d.ts +1 -1
  85. package/dist/components/scope-switcher/scope-switcher.d.ts +2 -2
  86. package/dist/components/scope-switcher/style.css +14 -2
  87. package/dist/components/scope-switcher/types.d.ts +12 -6
  88. package/dist/components/style.css +10030 -6763
  89. package/dist/components/tui/locales/en-US.d.ts +35 -0
  90. package/dist/components/tui/locales/zh-CN.d.ts +35 -0
  91. package/dist/components/tui/style.css +310 -18
  92. package/dist/components/tui/tui-copy-button.d.ts +1 -1
  93. package/dist/components/tui/tui-empty.d.ts +25 -0
  94. package/dist/components/tui/tui-labels.d.ts +2 -2
  95. package/dist/components/tui/tui.d.ts +1 -1
  96. package/dist/components/tui/types.d.ts +35 -12
  97. package/dist/components/tui.js +1 -1
  98. package/dist/components/viking-bot/ark-adapter.d.ts +2 -0
  99. package/dist/components/viking-bot/ark-message-body.d.ts +1 -7
  100. package/dist/components/viking-bot/ark-message-list-view.d.ts +4 -1
  101. package/dist/components/viking-bot/ark-message-row.d.ts +3 -1
  102. package/dist/components/viking-bot/bot-popover.d.ts +9 -0
  103. package/dist/components/viking-bot/capabilities.d.ts +49 -0
  104. package/dist/components/viking-bot/composer-attachments.d.ts +13 -0
  105. package/dist/components/viking-bot/composer-controls.d.ts +10 -0
  106. package/dist/components/viking-bot/composer-footer.d.ts +17 -0
  107. package/dist/components/viking-bot/composer-references.d.ts +20 -0
  108. package/dist/components/viking-bot/composer-text.d.ts +10 -0
  109. package/dist/components/viking-bot/index.d.ts +3 -1
  110. package/dist/components/viking-bot/interaction/ask-human-fields.d.ts +1 -1
  111. package/dist/components/viking-bot/interaction/labels.d.ts +2 -1
  112. package/dist/components/viking-bot/interaction/locales/en-US.d.ts +17 -0
  113. package/dist/components/viking-bot/interaction/locales/zh-CN.d.ts +17 -0
  114. package/dist/components/viking-bot/interaction/types.d.ts +8 -3
  115. package/dist/components/viking-bot/interaction/viking-bot-interaction.d.ts +1 -1
  116. package/dist/components/viking-bot/labels.d.ts +2 -0
  117. package/dist/components/viking-bot/locales/en-US.d.ts +40 -0
  118. package/dist/components/viking-bot/locales/zh-CN.d.ts +40 -0
  119. package/dist/components/viking-bot/markdown-links.d.ts +27 -0
  120. package/dist/components/viking-bot/message-activity.d.ts +7 -0
  121. package/dist/components/viking-bot/message-code-block.d.ts +8 -0
  122. package/dist/components/viking-bot/message-footer.d.ts +8 -0
  123. package/dist/components/viking-bot/message-markdown.d.ts +9 -0
  124. package/dist/components/viking-bot/model.d.ts +37 -3
  125. package/dist/components/viking-bot/quick-input-tracker.d.ts +16 -0
  126. package/dist/components/viking-bot/quick-inputs.d.ts +6 -0
  127. package/dist/components/viking-bot/reference-picker.d.ts +16 -0
  128. package/dist/components/viking-bot/session-actions.d.ts +11 -0
  129. package/dist/components/viking-bot/style.css +1486 -48
  130. package/dist/components/viking-bot/tool-activity.d.ts +9 -0
  131. package/dist/components/viking-bot/tool-result-links.d.ts +6 -0
  132. package/dist/components/viking-bot/types.d.ts +20 -8
  133. package/dist/components/viking-bot/use-quick-input.d.ts +17 -0
  134. package/dist/components/viking-bot/viking-bot.d.ts +1 -6
  135. package/dist/components/viking-bot/welcome.d.ts +8 -0
  136. package/dist/components/viking-bot.js +1 -1
  137. package/dist/c~0.js +550 -69
  138. package/dist/e~0.js +335 -0
  139. package/dist/file-preview-viewer~0.js +90 -8
  140. package/dist/f~0.js +49 -51
  141. package/dist/h~0.js +5 -1
  142. package/dist/icons/console-icons.d.ts +12 -0
  143. package/dist/icons/index.d.ts +2 -0
  144. package/dist/icons/viking-bot-icons.d.ts +6 -0
  145. package/dist/icons.js +1 -0
  146. package/dist/index.d.ts +2 -0
  147. package/dist/index.js +2 -1
  148. package/dist/k~0.js +1 -0
  149. package/dist/lg~0.js +155 -0
  150. package/dist/lk~0.js +40 -8
  151. package/dist/l~0.js +170 -181
  152. package/dist/modules/console/command-messages.d.ts +19 -0
  153. package/dist/modules/console/command-parser.d.ts +15 -0
  154. package/dist/modules/console/command-specs.d.ts +15 -0
  155. package/dist/modules/console/commands.d.ts +6 -0
  156. package/dist/modules/console/console-history.d.ts +10 -0
  157. package/dist/modules/console/console-toolbar.d.ts +18 -0
  158. package/dist/modules/console/console.d.ts +1 -3
  159. package/dist/modules/console/controller.d.ts +17 -0
  160. package/dist/modules/console/index.d.ts +2 -0
  161. package/dist/modules/console/labels.d.ts +61 -0
  162. package/dist/modules/console/locales/en-US.d.ts +49 -0
  163. package/dist/modules/console/locales/zh-CN.d.ts +3 -0
  164. package/dist/modules/console/localize-records.d.ts +11 -0
  165. package/dist/modules/console/results.d.ts +2 -0
  166. package/dist/modules/console/style.css +10905 -15
  167. package/dist/modules/console/types.d.ts +59 -80
  168. package/dist/modules/console/use-console.d.ts +3 -0
  169. package/dist/modules/console.js +1 -1
  170. package/dist/modules/file-browser/file-browser-detail.d.ts +2 -1
  171. package/dist/modules/file-browser/file-browser-labels.d.ts +11 -12
  172. package/dist/modules/file-browser/file-browser-toolbar.d.ts +3 -4
  173. package/dist/modules/file-browser/file-browser-tree-pane.d.ts +7 -5
  174. package/dist/modules/file-browser/file-browser.d.ts +1 -1
  175. package/dist/modules/file-browser/fs-read-directory.d.ts +2 -6
  176. package/dist/modules/file-browser/locales/en-US.d.ts +25 -0
  177. package/dist/modules/file-browser/locales/zh-CN.d.ts +25 -0
  178. package/dist/modules/file-browser/style.css +1695 -126
  179. package/dist/modules/file-browser/types.d.ts +38 -29
  180. package/dist/modules/file-browser/use-file-browser.d.ts +6 -1
  181. package/dist/modules/file-browser/use-fs-preview.d.ts +15 -1
  182. package/dist/modules/scope-cascade/labels.d.ts +6 -0
  183. package/dist/modules/scope-cascade/locales/en-US.d.ts +6 -0
  184. package/dist/modules/scope-cascade/locales/zh-CN.d.ts +3 -0
  185. package/dist/modules/scope-cascade/scope-cascade.d.ts +2 -2
  186. package/dist/modules/scope-cascade/style.css +14 -2
  187. package/dist/modules/scope-cascade/types.d.ts +3 -0
  188. package/dist/modules/style.css +15938 -3455
  189. package/dist/nx~0.js +15 -0
  190. package/dist/n~0.js +240 -83
  191. package/dist/o~0.js +10 -7
  192. package/dist/p~0.js +27 -0
  193. package/dist/rslib-runtime~0.js +42 -0
  194. package/dist/r~0.js +152 -0
  195. package/dist/shared/components/drawer/drawer.d.ts +13 -0
  196. package/dist/shared/components/drawer/index.d.ts +1 -0
  197. package/dist/shared/components/overlay/use-overlay-position.d.ts +2 -2
  198. package/dist/shared/components/tooltip/use-portal-theme.d.ts +3 -0
  199. package/dist/shared/locale-context.d.ts +8 -0
  200. package/dist/shared/locale.d.ts +6 -0
  201. package/dist/style.css +26339 -10577
  202. package/dist/u~0.js +397 -152
  203. package/dist/viking-bot-composer~0.js +436 -77
  204. package/dist/viking-bot-interaction~0.js +13 -11
  205. package/package.json +15 -4
  206. package/dist/30~0.js +0 -1332
  207. package/dist/components/tui/tui-labels-zh.d.ts +0 -2
  208. package/dist/modules/file-browser/tree-info-copy.d.ts +0 -15
  209. package/dist/modules/file-browser/tree-info-copy.zh-CN.d.ts +0 -15
@@ -1,101 +1,80 @@
1
- import type { OvRequestOptions } from '../../client/index.js';
1
+ import type { Locale } from '../../shared/locale.js';
2
2
  import type { HTMLAttributes, ReactNode } from 'react';
3
- /**
4
- * 面板模式。对话与命令共用同一面板,切换时各自保留状态。
5
- * Panel mode. Conversation and commands share one panel, each keeping its own
6
- * state when the mode switches.
7
- */
3
+ import type { OvRequestOptions } from '../../client/types.js';
4
+ import type { TuiCommandDefinition, TuiLabels, TuiRecord } from '../../components/tui/index.js';
5
+ import type { VikingBotLabels, VikingBotProps } from '../../components/viking-bot/index.js';
8
6
  export type ConsoleMode = 'conversation' | 'command';
9
- /** 交互面板模块的插槽。Slots of the console module. */
10
7
  export interface ConsoleSlots {
11
- /**
12
- * 面板顶部工具栏。模式切换由模块渲染,这里放宿主专属入口。
13
- * Panel toolbar. The module renders the mode switch; put host-specific
14
- * entries here.
15
- */
16
8
  toolbar?: ReactNode;
17
- /**
18
- * 对话模式下输入区上方的附加内容,例如当前资源上下文。
19
- * Extra content above the composer in conversation mode, for example the
20
- * current resource context.
21
- */
22
9
  conversationContext?: ReactNode;
23
- /**
24
- * 命令模式下的命令帮助内容。省略时由模块按宿主声明的命令生成。
25
- * Command help in command mode. When omitted, the module derives it from the
26
- * commands the host declares.
27
- */
28
10
  commandHelp?: ReactNode;
29
11
  }
30
- /** 交互面板模块的可替换文案。Replaceable copy of the console module. */
31
12
  export interface ConsoleLabels {
32
- /**
33
- * 占位说明。缺省为 `Placeholder. Functionality is not available yet.`。
34
- * Placeholder description. Defaults to "Placeholder. Functionality is not
35
- * available yet.".
36
- */
13
+ /** Conversation welcome description. */
37
14
  description?: string;
38
- /** 对话模式名称。Conversation mode label. */
39
15
  conversation?: string;
40
- /** 命令模式名称。Command mode label. */
41
16
  command?: string;
42
- /** 会话加载失败提示。Session load failure message. */
43
- error?: string;
44
- /** 重试按钮文案。Retry button label. */
45
- retry?: string;
17
+ clear?: string;
18
+ history?: string;
19
+ emptyHistory?: string;
20
+ /** 终端空态标题,转交 Tui 的 `emptyTitle`。Terminal empty-state heading, mapped to Tui `emptyTitle`. */
21
+ commandTitle?: string;
22
+ /** 终端空态说明,转交 Tui 的 `emptyDescription`。Terminal empty-state description, mapped to Tui `emptyDescription`. */
23
+ commandDescription?: string;
24
+ /** 快捷命令引导文案,转交 Tui 的 `quickStart`。Quick-command label, mapped to Tui `quickStart`. */
25
+ quickStart?: string;
26
+ mode?: string;
27
+ tui?: TuiLabels;
28
+ vikingBot?: VikingBotLabels;
46
29
  }
47
- /**
48
- * 交互面板模块的属性。
49
- *
50
- * 模块自己通过 Hook 取数,props 里没有会话与命令记录:宿主给配置、受控模式、
51
- * 插槽与文案。打开资源通过回调交给宿主,与文件浏览模块的联动不依赖对方的私有
52
- * 状态。
53
- *
54
- * Props of the console module.
55
- *
56
- * The module loads its own data through a Hook, so no prop carries sessions or
57
- * command records: the host supplies configuration, the controlled mode, slots
58
- * and copy. Opening a resource goes back to the host through a callback, and
59
- * coordination with the file browser never reaches into the other module's
60
- * private state.
61
- */
62
- export interface ConsoleProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect' | 'children'> {
63
- /**
64
- * 受控的当前模式。传入时由宿主决定模式,模块只上报切换意图。
65
- * The controlled mode. When given, the host owns the mode and the module only
66
- * reports switch intent.
67
- */
30
+ /** Options shared by Console and useConsole. */
31
+ export interface ConsoleOptions {
32
+ locale?: Locale;
68
33
  mode?: ConsoleMode;
69
- /**
70
- * 非受控时的初始模式,缺省为 `conversation`。
71
- * Initial mode when uncontrolled; defaults to `conversation`.
72
- */
34
+ /** Initial uncontrolled mode. Defaults to VikingBot ('conversation'). */
73
35
  defaultMode?: ConsoleMode;
74
- /**
75
- * 模式变化后触发。
76
- * Called after the mode changes.
77
- */
36
+ /** Change with the identity when using dynamic credential/identity functions. */
37
+ scopeKey?: string;
78
38
  onModeChange?: (mode: ConsoleMode) => void;
39
+ requestOptions?: OvRequestOptions;
40
+ }
41
+ export interface ConsoleProps extends ConsoleOptions, Omit<HTMLAttributes<HTMLDivElement>, 'onSelect' | 'children'> {
42
+ /** 可选文案语言;继承上层,最终默认英文。Optional locale; inherits or defaults to en-US. */
43
+ locale?: Locale;
79
44
  /**
80
- * 资源成功打开后触发,参数为资源 URI;失败时不触发。
81
- * Called after a resource opens successfully, with its URI; not called on
82
- * failure.
45
+ * 终端空态展示的快捷命令名称,按数组顺序取自命令目录,未命中的名称跳过,
46
+ * 重复名称只保留首次出现。
47
+ * 省略时使用默认集合;传空数组不展示内置空态。
48
+ * Quick command names shown in the terminal empty state, resolved from the
49
+ * command catalogue in array order with unknown names skipped. Omitted uses
50
+ * the default set; an empty array shows no built-in empty state.
83
51
  */
52
+ quickCommands?: readonly string[];
53
+ /** Host-owned conversation state/capabilities. Omit draft callbacks to use Console's local draft. */
54
+ conversation?: Partial<VikingBotProps>;
55
+ /** Reports navigation intent; the host opens the resource. */
84
56
  onOpenUri?: (uri: string) => void;
85
- /**
86
- * 插槽,见 {@link ConsoleSlots}。
87
- * Slots, see {@link ConsoleSlots}.
88
- */
89
57
  slots?: ConsoleSlots;
90
- /**
91
- * 可替换文案,缺省为英文。
92
- * Replaceable copy; English by default.
93
- */
94
58
  labels?: ConsoleLabels;
95
- /**
96
- * 请求配置覆盖,逐字段覆盖最近的 Provider。
97
- * Request configuration override, applied field by field over the nearest
98
- * Provider.
99
- */
100
- requestOptions?: OvRequestOptions;
59
+ }
60
+ /** Local state. Records and drafts are never persisted by the module. */
61
+ export interface ConsoleState {
62
+ records: readonly TuiRecord[];
63
+ command: string;
64
+ conversationDraft: string;
65
+ isExecuting: boolean;
66
+ error?: unknown;
67
+ failedCommand?: string;
68
+ }
69
+ /** Data and operations available independently of Console's view. */
70
+ export interface ConsoleResult extends ConsoleState {
71
+ mode: ConsoleMode;
72
+ commands: readonly TuiCommandDefinition[];
73
+ setMode: (mode: ConsoleMode) => void;
74
+ setCommand: (command: string) => void;
75
+ setConversationDraft: (draft: string) => void;
76
+ execute: (command?: string) => Promise<void>;
77
+ retry: () => Promise<void>;
78
+ cancel: () => void;
79
+ clear: () => void;
101
80
  }
@@ -0,0 +1,3 @@
1
+ import type { ConsoleOptions, ConsoleResult } from './types.js';
2
+ /** Native command execution and draft orchestration, with or without Console. */
3
+ export declare function useConsole({ mode: controlledMode, defaultMode, locale: localeProp, scopeKey, onModeChange, requestOptions, }?: ConsoleOptions): ConsoleResult;
@@ -1 +1 @@
1
- export { Console } from "../a~0.js";
1
+ export { Console, useConsole } from "../a~0.js";
@@ -1,3 +1,4 @@
1
+ import type { Locale } from '../../shared/locale.js';
1
2
  import { type FilePreviewTab } from '../../components/file-preview/index.js';
2
3
  import type { FileBrowserLabels } from './types.js';
3
4
  /**
@@ -16,7 +17,7 @@ import type { FileBrowserLabels } from './types.js';
16
17
  export interface FileBrowserDetailProps {
17
18
  tabs: readonly FilePreviewTab[];
18
19
  activeKey: string | null;
19
- locale?: 'en-US' | 'zh-CN';
20
+ locale: Locale;
20
21
  labels?: FileBrowserLabels['preview'];
21
22
  footer?: string;
22
23
  /** 分段器与图标按钮的文案。Copy for the segmented control and icon buttons. */
@@ -1,28 +1,27 @@
1
+ import { type Locale } from '../../shared/locale.js';
1
2
  import type { FilePreviewLabels } from '../../components/file-preview/index.js';
2
3
  import type { FileTreeLabels } from '../../components/file-tree/index.js';
3
4
  import type { FileBrowserLabels } from './types.js';
4
5
  /** 模块外壳自己渲染的文案,其余透传给树与预览。 */
5
- type ShellLabels = Omit<FileBrowserLabels, 'tree' | 'preview'>;
6
+ export type ShellLabels = Omit<FileBrowserLabels, 'tree' | 'preview' | 'entries'>;
6
7
  /**
7
8
  * 模块外壳的内置文案。树与预览的默认值留在各自组件里,模块不重复一份。
8
9
  * Built-in copy of the module shell. The tree and the preview keep their own
9
10
  * defaults, so the module does not duplicate them.
10
11
  */
11
- export declare const DEFAULT_LABELS: Required<ShellLabels>;
12
12
  /** 解析后的外壳文案,外加透传给两个组件的文案。 */
13
13
  export interface ResolvedLabels extends Required<ShellLabels> {
14
14
  tree: FileTreeLabels | undefined;
15
15
  previewLabels: FileBrowserLabels['preview'];
16
16
  }
17
17
  /** 逐项合并默认文案;树与预览的文案原样透传,缺省由组件自己兜底。 */
18
- export declare function resolveLabels(labels: FileBrowserLabels | undefined): ResolvedLabels;
19
- /**
20
- * 预览组件的文案:模块自己的那几项叠在宿主透传的之上。组件那份英文默认值只在
21
- * 宿主完全不传时才会用到,模块不能让它在中文界面里漏出来。
22
- *
23
- * The preview component's copy: the module's own fields layered over what the host
24
- * passed through. The component's English defaults only apply when a host passes
25
- * nothing, and must not leak into a Chinese interface.
26
- */
18
+ export declare function resolveLabels(labels: FileBrowserLabels | undefined, locale: Locale): ResolvedLabels;
19
+ /** Shared shell labels followed by explicit preview overrides. */
27
20
  export declare function resolvePreviewLabels(text: ResolvedLabels): FilePreviewLabels;
28
- export {};
21
+ export declare const DEFAULT_LABELS: Required<ShellLabels>;
22
+ /** Summary titles are derived from the module resource, including host overrides. */
23
+ export declare function resolveSummaryLabels(locale: Locale, labels?: FileBrowserLabels): {
24
+ l0: string;
25
+ l1: string;
26
+ failure: string;
27
+ };
@@ -1,9 +1,8 @@
1
1
  /**
2
- * 搜索行:搜索框与刷新按钮。两者都是模块自己的,宿主入口在上一行的
3
- * `toolbarActions` 里。
2
+ * 搜索行:搜索框与刷新按钮。内置的连接与导入入口位于上一行。
4
3
  *
5
- * The search row: the search box and the refresh button. Both belong to the module;
6
- * host entries live in `toolbarActions` on the row above.
4
+ * The search row: the search box and refresh button. Built-in connection and import
5
+ * entries occupy the row above.
7
6
  */
8
7
  export interface FileBrowserToolbarProps {
9
8
  searchId: string;
@@ -1,20 +1,22 @@
1
- import type { ReactNode } from 'react';
1
+ import type { Locale } from '../../shared/locale.js';
2
+ import type { FileBrowserEntriesProps } from '../../components/file-browser-entries/index.js';
2
3
  import type { FileTreeLabels } from '../../components/file-tree/index.js';
3
4
  import type { FileBrowserApi } from './types.js';
4
5
  /**
5
- * 左栏:宿主入口条、搜索行与目录树。
6
+ * 左栏:内置入口条、搜索行与目录树。
6
7
  *
7
8
  * 宽度由外层的可拖拽分隔条决定,因此这里只铺满自己的盒子,不设宽度;树内容
8
9
  * 比栏宽时横向滚动,而不是把名称截成省略号。
9
10
  *
10
- * The left column: the host's entries, the search row and the tree.
11
+ * The left column: the built-in entries, the search row and the tree.
11
12
  *
12
13
  * The width comes from the draggable divider outside, so this only fills its own
13
14
  * box. When the tree is wider than the column it scrolls sideways rather than
14
15
  * truncating names into ellipses.
15
16
  */
16
17
  export interface FileBrowserTreePaneProps {
17
- toolbarActions?: ReactNode;
18
+ entries: Pick<FileBrowserEntriesProps, 'agentConnect' | 'onImportResources' | 'renderImportResources' | 'labels'>;
19
+ locale: Locale;
18
20
  searchId: string;
19
21
  browser: FileBrowserApi;
20
22
  treeLabels: FileTreeLabels | undefined;
@@ -27,4 +29,4 @@ export interface FileBrowserTreePaneProps {
27
29
  /** 失败态里的重试按钮。Retry button of the failure state. */
28
30
  retryLabel: string;
29
31
  }
30
- export declare function FileBrowserTreePane({ toolbarActions, searchId, browser, treeLabels, searchPlaceholder, refreshLabel, searchLoading, searchEmpty, searchErrorLabel, retryLabel, }: FileBrowserTreePaneProps): import("react").JSX.Element;
32
+ export declare function FileBrowserTreePane({ entries, locale, searchId, browser, treeLabels, searchPlaceholder, refreshLabel, searchLoading, searchEmpty, searchErrorLabel, retryLabel, }: FileBrowserTreePaneProps): import("react").JSX.Element;
@@ -12,4 +12,4 @@ export type { FileBrowserActions, FileBrowserApi, FileBrowserLabels, FileBrowser
12
12
  * tree; loading and coordination live in {@link useFileBrowser}, and this only
13
13
  * assembles the view.
14
14
  */
15
- export declare function FileBrowser({ uri, defaultUri, rootUri, defaultExpandedUri, locale, toolbarActions, onUriChange, labels, requestOptions, className, style, ...rest }: FileBrowserProps): import("react").JSX.Element;
15
+ export declare function FileBrowser({ uri, defaultUri, rootUri, defaultExpandedUri, locale: localeProp, agentConnect, onUriChange, onImportResources, renderImportResources, labels, requestOptions, className, style, ...rest }: FileBrowserProps): import("react").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import type { OvClient, OvRequestOptions } from '../../client/types.js';
2
- import type { FilePreviewDirectoryTab } from '../../components/file-preview/index.js';
2
+ import { type DirectorySummary } from './fs-model.js';
3
3
  /**
4
4
  * 读目录的两级摘要,各自成一个页签:L0 是摘要,L1 是总览。
5
5
  *
@@ -13,8 +13,4 @@ import type { FilePreviewDirectoryTab } from '../../components/file-preview/inde
13
13
  * other; when both are empty the tabs still appear, so the user sees that the
14
14
  * directory exists but has no generated content instead of blank space.
15
15
  */
16
- export declare function readDirectory(client: OvClient, uri: string, options: OvRequestOptions, labels: {
17
- l0: string;
18
- l1: string;
19
- failure: string;
20
- }, openParent?: (uri: string) => Promise<void>): Promise<FilePreviewDirectoryTab>;
16
+ export declare function readDirectory(client: OvClient, uri: string, options: OvRequestOptions): Promise<DirectorySummary>;
@@ -0,0 +1,25 @@
1
+ declare const messages: {
2
+ formatCharacterCount: (count: number) => string;
3
+ empty: string;
4
+ error: string;
5
+ retry: string;
6
+ refresh: string;
7
+ searchPlaceholder: string;
8
+ searchEmpty: string;
9
+ searchFailed: string;
10
+ loading: string;
11
+ searchLoading: string;
12
+ previewMode: string;
13
+ sourceMode: string;
14
+ copyPath: string;
15
+ copyContent: string;
16
+ download: string;
17
+ history: string;
18
+ viewSwitch: string;
19
+ resizeTree: string;
20
+ l0Summary: string;
21
+ l1Overview: string;
22
+ summaryEmpty: string;
23
+ summaryFailed: string;
24
+ };
25
+ export default messages;
@@ -0,0 +1,25 @@
1
+ declare const messages: {
2
+ formatCharacterCount: (count: number) => string;
3
+ empty: string;
4
+ error: string;
5
+ retry: string;
6
+ refresh: string;
7
+ searchPlaceholder: string;
8
+ searchEmpty: string;
9
+ searchFailed: string;
10
+ loading: string;
11
+ searchLoading: string;
12
+ previewMode: string;
13
+ sourceMode: string;
14
+ copyPath: string;
15
+ copyContent: string;
16
+ download: string;
17
+ history: string;
18
+ viewSwitch: string;
19
+ resizeTree: string;
20
+ l0Summary: string;
21
+ l1Overview: string;
22
+ summaryEmpty: string;
23
+ summaryFailed: string;
24
+ };
25
+ export default messages;