@openviking/react 0.1.3 → 0.1.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.
Files changed (200) hide show
  1. package/LICENSE.arco-design +21 -0
  2. package/README.md +25 -15
  3. package/dist/0~0.js +19 -0
  4. package/dist/2~0.js +2267 -29
  5. package/dist/2~0.js.LICENSE.txt +23 -0
  6. package/dist/3c~0.js +2206 -0
  7. package/dist/3~0.js +1205 -1982
  8. package/dist/4~0.js +18 -0
  9. package/dist/9~0.js +43 -0
  10. package/dist/{1~0.js → ae~0.js} +5 -24
  11. package/dist/ark-message-list-view~0.js +530 -119
  12. package/dist/a~0.js +1289 -10
  13. package/dist/c7~0.js +38 -2
  14. package/dist/ck~0.js +23 -0
  15. package/dist/client/provider.d.ts +5 -3
  16. package/dist/client/types.d.ts +5 -5
  17. package/dist/client.js +2 -1
  18. package/dist/components/agent-connect/agent-connect-copy.d.ts +19 -33
  19. package/dist/components/agent-connect/agent-connect-design.d.ts +1935 -167
  20. package/dist/components/agent-connect/agent-connect-instructions.d.ts +135 -0
  21. package/dist/components/agent-connect/locales/en-US.d.ts +20 -0
  22. package/dist/components/agent-connect/locales/zh-CN.d.ts +3 -0
  23. package/dist/components/agent-connect/style.css +14 -2
  24. package/dist/components/agent-connect/types.d.ts +2 -1
  25. package/dist/components/directory-tour/directory-tour.d.ts +3 -0
  26. package/dist/components/directory-tour/index.d.ts +3 -0
  27. package/dist/components/directory-tour/locales/en-US.d.ts +3 -0
  28. package/dist/components/directory-tour/locales/zh-CN.d.ts +3 -0
  29. package/dist/components/directory-tour/steps.d.ts +5 -0
  30. package/dist/components/directory-tour/style.css +237 -0
  31. package/dist/components/directory-tour/style.js +0 -0
  32. package/dist/components/directory-tour/types.d.ts +42 -0
  33. package/dist/components/directory-tour/use-tour-anchor.d.ts +5 -0
  34. package/dist/components/directory-tour/use-tour-position.d.ts +12 -0
  35. package/dist/components/directory-tour.js +40 -0
  36. package/dist/components/file-browser-entries/file-browser-entries.d.ts +5 -5
  37. package/dist/components/file-browser-entries/labels.d.ts +3 -0
  38. package/dist/components/file-browser-entries/locales/en-US.d.ts +6 -0
  39. package/dist/components/file-browser-entries/locales/zh-CN.d.ts +6 -0
  40. package/dist/components/file-browser-entries/style.css +752 -2
  41. package/dist/components/file-browser-entries/types.d.ts +34 -16
  42. package/dist/components/file-preview/file-preview-adapters.d.ts +2 -1
  43. package/dist/components/file-preview/file-preview-body.d.ts +2 -1
  44. package/dist/components/file-preview/file-preview-breadcrumb-menu.d.ts +2 -1
  45. package/dist/components/file-preview/file-preview-breadcrumb.d.ts +2 -1
  46. package/dist/components/file-preview/file-preview-directory.d.ts +2 -1
  47. package/dist/components/file-preview/file-preview-handle-adapters.d.ts +2 -1
  48. package/dist/components/file-preview/file-preview-header.d.ts +6 -2
  49. package/dist/components/file-preview/file-preview-image-frame.d.ts +5 -0
  50. package/dist/components/file-preview/file-preview-labels.d.ts +2 -14
  51. package/dist/components/file-preview/file-preview-level-tabs.d.ts +7 -0
  52. package/dist/components/file-preview/file-preview-markdown-images.d.ts +13 -0
  53. package/dist/components/file-preview/file-preview-panels.d.ts +5 -2
  54. package/dist/components/file-preview/file-preview-viewer.d.ts +2 -1
  55. package/dist/components/file-preview/file-preview.d.ts +0 -1
  56. package/dist/components/file-preview/index.d.ts +2 -1
  57. package/dist/components/file-preview/locales/en-US.d.ts +16 -0
  58. package/dist/components/file-preview/locales/zh-CN.d.ts +16 -0
  59. package/dist/components/file-preview/style.css +160 -2
  60. package/dist/components/file-preview/types.d.ts +34 -10
  61. package/dist/components/file-preview/use-file-preview-levels.d.ts +7 -0
  62. package/dist/components/file-preview/use-file-preview-view-state.d.ts +15 -0
  63. package/dist/components/file-preview.js +1 -1
  64. package/dist/components/file-tree/file-tree-info-labels.d.ts +0 -15
  65. package/dist/components/file-tree/file-tree-labels.d.ts +4 -0
  66. package/dist/components/file-tree/file-tree-row-shared.d.ts +2 -12
  67. package/dist/components/file-tree/file-tree-toolbar.d.ts +11 -0
  68. package/dist/components/file-tree/locales/en-US.d.ts +69 -0
  69. package/dist/components/file-tree/locales/zh-CN.d.ts +69 -0
  70. package/dist/components/file-tree/style.css +143 -15
  71. package/dist/components/file-tree/types.d.ts +38 -10
  72. package/dist/components/file-tree/use-file-tree-actions.d.ts +4 -1
  73. package/dist/components/scope-switcher/labels.d.ts +3 -0
  74. package/dist/components/scope-switcher/locales/en-US.d.ts +8 -0
  75. package/dist/components/scope-switcher/locales/zh-CN.d.ts +8 -0
  76. package/dist/components/scope-switcher/scope-panel.d.ts +1 -1
  77. package/dist/components/scope-switcher/scope-switcher.d.ts +1 -1
  78. package/dist/components/scope-switcher/style.css +14 -2
  79. package/dist/components/scope-switcher/types.d.ts +11 -5
  80. package/dist/components/style.css +9851 -6812
  81. package/dist/components/tui/locales/en-US.d.ts +35 -0
  82. package/dist/components/tui/locales/zh-CN.d.ts +35 -0
  83. package/dist/components/tui/style.css +310 -18
  84. package/dist/components/tui/tui-copy-button.d.ts +1 -1
  85. package/dist/components/tui/tui-empty.d.ts +25 -0
  86. package/dist/components/tui/tui-labels.d.ts +2 -2
  87. package/dist/components/tui/tui.d.ts +1 -1
  88. package/dist/components/tui/types.d.ts +35 -12
  89. package/dist/components/tui.js +1 -1
  90. package/dist/components/viking-bot/ark-adapter.d.ts +2 -0
  91. package/dist/components/viking-bot/ark-message-body.d.ts +1 -7
  92. package/dist/components/viking-bot/ark-message-list-view.d.ts +1 -1
  93. package/dist/components/viking-bot/ark-message-row.d.ts +3 -1
  94. package/dist/components/viking-bot/bot-popover.d.ts +9 -0
  95. package/dist/components/viking-bot/capabilities.d.ts +49 -0
  96. package/dist/components/viking-bot/composer-attachments.d.ts +13 -0
  97. package/dist/components/viking-bot/composer-controls.d.ts +10 -0
  98. package/dist/components/viking-bot/composer-footer.d.ts +17 -0
  99. package/dist/components/viking-bot/composer-references.d.ts +20 -0
  100. package/dist/components/viking-bot/composer-text.d.ts +10 -0
  101. package/dist/components/viking-bot/index.d.ts +3 -1
  102. package/dist/components/viking-bot/interaction/ask-human-fields.d.ts +1 -1
  103. package/dist/components/viking-bot/interaction/labels.d.ts +2 -1
  104. package/dist/components/viking-bot/interaction/locales/en-US.d.ts +17 -0
  105. package/dist/components/viking-bot/interaction/locales/zh-CN.d.ts +17 -0
  106. package/dist/components/viking-bot/interaction/types.d.ts +8 -3
  107. package/dist/components/viking-bot/interaction/viking-bot-interaction.d.ts +1 -1
  108. package/dist/components/viking-bot/labels.d.ts +2 -0
  109. package/dist/components/viking-bot/locales/en-US.d.ts +40 -0
  110. package/dist/components/viking-bot/locales/zh-CN.d.ts +40 -0
  111. package/dist/components/viking-bot/markdown-links.d.ts +27 -0
  112. package/dist/components/viking-bot/message-activity.d.ts +7 -0
  113. package/dist/components/viking-bot/message-code-block.d.ts +8 -0
  114. package/dist/components/viking-bot/message-footer.d.ts +8 -0
  115. package/dist/components/viking-bot/message-markdown.d.ts +9 -0
  116. package/dist/components/viking-bot/model.d.ts +37 -3
  117. package/dist/components/viking-bot/quick-input-tracker.d.ts +16 -0
  118. package/dist/components/viking-bot/quick-inputs.d.ts +6 -0
  119. package/dist/components/viking-bot/reference-picker.d.ts +16 -0
  120. package/dist/components/viking-bot/session-actions.d.ts +11 -0
  121. package/dist/components/viking-bot/style.css +1486 -48
  122. package/dist/components/viking-bot/tool-activity.d.ts +9 -0
  123. package/dist/components/viking-bot/tool-result-links.d.ts +6 -0
  124. package/dist/components/viking-bot/types.d.ts +21 -9
  125. package/dist/components/viking-bot/use-quick-input.d.ts +17 -0
  126. package/dist/components/viking-bot/viking-bot.d.ts +1 -6
  127. package/dist/components/viking-bot/welcome.d.ts +8 -0
  128. package/dist/components/viking-bot.js +1 -1
  129. package/dist/c~0.js +533 -66
  130. package/dist/e~0.js +333 -0
  131. package/dist/file-preview-viewer~0.js +90 -8
  132. package/dist/f~0.js +39 -47
  133. package/dist/h~0.js +5 -1
  134. package/dist/icons/console-icons.d.ts +12 -0
  135. package/dist/icons/index.d.ts +2 -0
  136. package/dist/icons/viking-bot-icons.d.ts +6 -0
  137. package/dist/icons.js +1 -0
  138. package/dist/index.d.ts +2 -0
  139. package/dist/index.js +2 -1
  140. package/dist/k~0.js +1 -0
  141. package/dist/lg~0.js +155 -0
  142. package/dist/lk~0.js +37 -8
  143. package/dist/l~0.js +102 -119
  144. package/dist/modules/console/command-messages.d.ts +19 -0
  145. package/dist/modules/console/command-parser.d.ts +15 -0
  146. package/dist/modules/console/command-specs.d.ts +15 -0
  147. package/dist/modules/console/commands.d.ts +6 -0
  148. package/dist/modules/console/console-history.d.ts +10 -0
  149. package/dist/modules/console/console-toolbar.d.ts +18 -0
  150. package/dist/modules/console/console.d.ts +1 -3
  151. package/dist/modules/console/controller.d.ts +17 -0
  152. package/dist/modules/console/index.d.ts +2 -0
  153. package/dist/modules/console/labels.d.ts +61 -0
  154. package/dist/modules/console/locales/en-US.d.ts +49 -0
  155. package/dist/modules/console/locales/zh-CN.d.ts +3 -0
  156. package/dist/modules/console/localize-records.d.ts +11 -0
  157. package/dist/modules/console/results.d.ts +2 -0
  158. package/dist/modules/console/style.css +10905 -15
  159. package/dist/modules/console/types.d.ts +59 -80
  160. package/dist/modules/console/use-console.d.ts +3 -0
  161. package/dist/modules/console.js +1 -1
  162. package/dist/modules/file-browser/file-browser-detail.d.ts +2 -1
  163. package/dist/modules/file-browser/file-browser-labels.d.ts +11 -12
  164. package/dist/modules/file-browser/file-browser-toolbar.d.ts +3 -4
  165. package/dist/modules/file-browser/file-browser-tree-pane.d.ts +7 -5
  166. package/dist/modules/file-browser/file-browser.d.ts +1 -1
  167. package/dist/modules/file-browser/fs-read-directory.d.ts +2 -6
  168. package/dist/modules/file-browser/locales/en-US.d.ts +25 -0
  169. package/dist/modules/file-browser/locales/zh-CN.d.ts +25 -0
  170. package/dist/modules/file-browser/style.css +1581 -126
  171. package/dist/modules/file-browser/types.d.ts +38 -29
  172. package/dist/modules/file-browser/use-file-browser.d.ts +6 -1
  173. package/dist/modules/file-browser/use-fs-preview.d.ts +15 -1
  174. package/dist/modules/scope-cascade/labels.d.ts +6 -0
  175. package/dist/modules/scope-cascade/locales/en-US.d.ts +6 -0
  176. package/dist/modules/scope-cascade/locales/zh-CN.d.ts +3 -0
  177. package/dist/modules/scope-cascade/scope-cascade.d.ts +1 -1
  178. package/dist/modules/scope-cascade/style.css +14 -2
  179. package/dist/modules/scope-cascade/types.d.ts +3 -0
  180. package/dist/modules/style.css +15853 -3484
  181. package/dist/nx~0.js +15 -0
  182. package/dist/n~0.js +238 -83
  183. package/dist/o~0.js +10 -7
  184. package/dist/p~0.js +27 -0
  185. package/dist/rslib-runtime~0.js +42 -0
  186. package/dist/r~0.js +152 -0
  187. package/dist/shared/components/drawer/drawer.d.ts +13 -0
  188. package/dist/shared/components/drawer/index.d.ts +1 -0
  189. package/dist/shared/components/overlay/use-overlay-position.d.ts +2 -2
  190. package/dist/shared/components/tooltip/use-portal-theme.d.ts +3 -0
  191. package/dist/shared/locale.d.ts +6 -0
  192. package/dist/style.css +26056 -10636
  193. package/dist/u~0.js +75 -58
  194. package/dist/viking-bot-composer~0.js +434 -77
  195. package/dist/viking-bot-interaction~0.js +11 -11
  196. package/package.json +13 -4
  197. package/dist/30~0.js +0 -1332
  198. package/dist/components/tui/tui-labels-zh.d.ts +0 -2
  199. package/dist/modules/file-browser/tree-info-copy.d.ts +0 -15
  200. package/dist/modules/file-browser/tree-info-copy.zh-CN.d.ts +0 -15
@@ -0,0 +1,15 @@
1
+ interface CommandToken {
2
+ value: string;
3
+ literal: boolean;
4
+ }
5
+ /** Parses arguments as data; never invokes a shell. */
6
+ export declare function tokenize(input: string): CommandToken[];
7
+ export interface Argument {
8
+ name: string;
9
+ kind?: 'uri' | 'integer' | 'boolean';
10
+ optional?: boolean;
11
+ choices?: readonly string[];
12
+ min?: number;
13
+ }
14
+ export declare function parseArguments(tokens: readonly CommandToken[], positional: readonly Argument[], flags?: readonly Argument[]): Record<string, string | number | boolean>;
15
+ export {};
@@ -0,0 +1,15 @@
1
+ import type enUS from './locales/en-US.js';
2
+ import type { OvRequestSpec } from '../../client/types.js';
3
+ import type { TuiSkeletonKind } from '../../components/tui/index.js';
4
+ import type { Argument } from './command-parser.js';
5
+ type Values = Record<string, string | number | boolean>;
6
+ export interface CommandSpec {
7
+ name: keyof typeof enUS.commands;
8
+ positional?: readonly Argument[];
9
+ flags?: readonly Argument[];
10
+ skeleton?: TuiSkeletonKind;
11
+ request?: (values: Values) => OvRequestSpec;
12
+ }
13
+ /** One catalogue drives validation, execution, completion and help. */
14
+ export declare const COMMAND_SPECS: readonly CommandSpec[];
15
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { OvClient, OvRequestOptions } from '../../client/types.js';
2
+ import type { TuiCommandDefinition, TuiRecordContent } from '../../components/tui/index.js';
3
+ import type { Locale } from '../../shared/locale.js';
4
+ export declare function consoleCommands(locale: Locale): readonly TuiCommandDefinition[];
5
+ export declare function createCommandHelp(locale: Locale): TuiRecordContent;
6
+ export declare function executeCommand(input: string, client: OvClient, options: OvRequestOptions, locale: Locale): Promise<TuiRecordContent>;
@@ -0,0 +1,10 @@
1
+ import type { Locale } from '../../shared/locale.js';
2
+ import type { TuiRecord } from '../../components/tui/index.js';
3
+ import type { consoleLabels } from './labels.js';
4
+ export declare function ConsoleHistory({ records, isExecuting, locale, labels, onRecall, }: {
5
+ records: readonly TuiRecord[];
6
+ isExecuting: boolean;
7
+ locale: Locale;
8
+ labels: ReturnType<typeof consoleLabels>;
9
+ onRecall: (command: string) => void;
10
+ }): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import type { Locale } from '../../shared/locale.js';
2
+ import type { ReactNode } from 'react';
3
+ import type { TuiRecord } from '../../components/tui/index.js';
4
+ import type { ConsoleMode } from './types.js';
5
+ import type { consoleLabels } from './labels.js';
6
+ export declare function ConsoleToolbar({ mode, panelId, locale, labels, records, isExecuting, onModeChange, onClear, onRecall, children, conversationActions, }: {
7
+ mode: ConsoleMode;
8
+ panelId: string;
9
+ locale: Locale;
10
+ labels: ReturnType<typeof consoleLabels>;
11
+ records: readonly TuiRecord[];
12
+ isExecuting: boolean;
13
+ onModeChange: (mode: ConsoleMode) => void;
14
+ onClear: () => void;
15
+ onRecall: (command: string) => void;
16
+ children?: ReactNode;
17
+ conversationActions?: ReactNode;
18
+ }): import("react").JSX.Element;
@@ -1,4 +1,2 @@
1
1
  import type { ConsoleProps } from './types.js';
2
- export type { ConsoleLabels, ConsoleMode, ConsoleProps, ConsoleSlots, } from './types.js';
3
- /** 占位组件:渲染一个带模块名的空容器,真实实现随模块 Hook 与组合视图迁入。 */
4
- export declare function Console({ className, style, labels }: ConsoleProps): import("react").JSX.Element;
2
+ export declare function Console({ mode, defaultMode, locale, quickCommands, scopeKey, requestOptions, onModeChange, onOpenUri, conversation, slots, labels: overrides, className, ...rest }: ConsoleProps): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import type { Locale } from '../../shared/locale.js';
2
+ import { type ConsoleRecord } from './command-messages.js';
3
+ import type { OvClient, OvRequestOptions } from '../../client/types.js';
4
+ import type { ConsoleState } from './types.js';
5
+ export declare function createConsoleController(client: OvClient, options?: OvRequestOptions): {
6
+ subscribe: (listener: () => void) => () => void;
7
+ getSnapshot: () => Omit<ConsoleState, "records"> & {
8
+ records: readonly ConsoleRecord[];
9
+ };
10
+ start(): () => void;
11
+ execute: (input?: string, locale?: Locale) => Promise<void>;
12
+ cancel: () => void | undefined;
13
+ clear: () => void;
14
+ setCommand: (command: string) => void;
15
+ setConversationDraft: (conversationDraft: string) => void;
16
+ retry: (locale: Locale) => Promise<void>;
17
+ };
@@ -1 +1,3 @@
1
1
  export * from './console.js';
2
+ export { useConsole } from './use-console.js';
3
+ export type { ConsoleLabels, ConsoleMode, ConsoleOptions, ConsoleResult, ConsoleState, ConsoleProps, ConsoleSlots, } from './types.js';
@@ -0,0 +1,61 @@
1
+ import { type Locale } from '../../shared/locale.js';
2
+ import type { ConsoleLabels } from './types.js';
3
+ export declare function resolveConsoleLocale(locale: Locale): {
4
+ labels: {
5
+ conversation: string;
6
+ command: string;
7
+ mode: string;
8
+ description: string;
9
+ clear: string;
10
+ history: string;
11
+ emptyHistory: string;
12
+ };
13
+ commands: {
14
+ grep: string;
15
+ glob: string;
16
+ help: string;
17
+ clear: string;
18
+ health: string;
19
+ status: string;
20
+ ls: string;
21
+ tree: string;
22
+ stat: string;
23
+ read: string;
24
+ abstract: string;
25
+ overview: string;
26
+ find: string;
27
+ search: string;
28
+ mkdir: string;
29
+ cp: string;
30
+ mv: string;
31
+ rm: string;
32
+ write: string;
33
+ 'task list': string;
34
+ 'task status': string;
35
+ 'task cancel': string;
36
+ };
37
+ availableCommands: string;
38
+ messages: {
39
+ cancelled: () => string;
40
+ unknownCommand: () => string;
41
+ shellSyntax: () => string;
42
+ unclosedQuote: () => string;
43
+ unexpectedArgument: (value: string) => string;
44
+ duplicateArgument: (value: string) => string;
45
+ missingValue: (value: string) => string;
46
+ expectedUri: (value: string) => string;
47
+ invalidArgument: (value: string) => string;
48
+ missingArgument: (value: string) => string;
49
+ };
50
+ };
51
+ export declare function consoleLabels(locale: Locale, overrides?: ConsoleLabels): {
52
+ conversation: string;
53
+ command: string;
54
+ mode: string;
55
+ description: string;
56
+ clear: string;
57
+ history: string;
58
+ emptyHistory: string;
59
+ tui: import("../../components/tui/types.js").TuiLabels;
60
+ vikingBot: import("../../components/viking-bot/model.js").VikingBotLabels;
61
+ };
@@ -0,0 +1,49 @@
1
+ declare const messages: {
2
+ labels: {
3
+ conversation: string;
4
+ command: string;
5
+ mode: string;
6
+ description: string;
7
+ clear: string;
8
+ history: string;
9
+ emptyHistory: string;
10
+ };
11
+ commands: {
12
+ grep: string;
13
+ glob: string;
14
+ help: string;
15
+ clear: string;
16
+ health: string;
17
+ status: string;
18
+ ls: string;
19
+ tree: string;
20
+ stat: string;
21
+ read: string;
22
+ abstract: string;
23
+ overview: string;
24
+ find: string;
25
+ search: string;
26
+ mkdir: string;
27
+ cp: string;
28
+ mv: string;
29
+ rm: string;
30
+ write: string;
31
+ 'task list': string;
32
+ 'task status': string;
33
+ 'task cancel': string;
34
+ };
35
+ availableCommands: string;
36
+ messages: {
37
+ cancelled: () => string;
38
+ unknownCommand: () => string;
39
+ shellSyntax: () => string;
40
+ unclosedQuote: () => string;
41
+ unexpectedArgument: (value: string) => string;
42
+ duplicateArgument: (value: string) => string;
43
+ missingValue: (value: string) => string;
44
+ expectedUri: (value: string) => string;
45
+ invalidArgument: (value: string) => string;
46
+ missingArgument: (value: string) => string;
47
+ };
48
+ };
49
+ export default messages;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US.js';
2
+ declare const messages: typeof enUS;
3
+ export default messages;
@@ -0,0 +1,11 @@
1
+ import type { Locale } from '../../shared/locale.js';
2
+ import { type ConsoleRecord } from './command-messages.js';
3
+ /** Format library notices without changing server output or execution state. */
4
+ export declare function localizeConsoleRecords(records: readonly ConsoleRecord[], locale: Locale): {
5
+ id: string;
6
+ command: string;
7
+ status: import("../../components/tui/types.js").TuiRecordStatus;
8
+ content?: import("../../components/tui/types.js").TuiRecordContent;
9
+ createdAt?: string;
10
+ createdAtMs?: number;
11
+ }[];
@@ -0,0 +1,2 @@
1
+ import type { TuiRecordContent } from '../../components/tui/index.js';
2
+ export declare function formatResult(name: string, data: unknown, values: Record<string, string | number | boolean>): TuiRecordContent;