@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.
- package/LICENSE.arco-design +21 -0
- package/README.md +27 -15
- package/dist/0~0.js +19 -0
- package/dist/28~0.js +15 -0
- package/dist/2~0.js +2270 -29
- package/dist/2~0.js.LICENSE.txt +23 -0
- package/dist/3c~0.js +2208 -0
- package/dist/3~0.js +1207 -1982
- package/dist/4~0.js +18 -0
- package/dist/9~0.js +43 -0
- package/dist/{1~0.js → ae~0.js} +11 -26
- package/dist/ark-message-list-view~0.js +530 -119
- package/dist/a~0.js +1300 -14
- package/dist/c7~0.js +38 -2
- package/dist/ck~0.js +23 -0
- package/dist/client/provider.d.ts +15 -9
- package/dist/client/types.d.ts +5 -5
- package/dist/client.js +2 -1
- package/dist/components/agent-connect/agent-connect-code-block.d.ts +14 -0
- package/dist/components/agent-connect/agent-connect-copy.d.ts +22 -33
- package/dist/components/agent-connect/agent-connect-design.d.ts +1936 -168
- package/dist/components/agent-connect/agent-connect-installer.d.ts +1 -0
- package/dist/components/agent-connect/agent-connect-instructions-view.d.ts +4 -6
- package/dist/components/agent-connect/agent-connect-instructions.d.ts +148 -0
- package/dist/components/agent-connect/agent-connect-markdown.d.ts +8 -2
- package/dist/components/agent-connect/agent-connect-mask.d.ts +10 -0
- package/dist/components/agent-connect/agent-connect.d.ts +1 -1
- package/dist/components/agent-connect/locales/en-US.d.ts +23 -0
- package/dist/components/agent-connect/locales/zh-CN.d.ts +3 -0
- package/dist/components/agent-connect/style.css +129 -3
- package/dist/components/agent-connect/types.d.ts +7 -4
- package/dist/components/agent-connect/use-agent-connect-copy.d.ts +6 -0
- package/dist/components/directory-tour/directory-tour.d.ts +3 -0
- package/dist/components/directory-tour/index.d.ts +3 -0
- package/dist/components/directory-tour/locales/en-US.d.ts +3 -0
- package/dist/components/directory-tour/locales/zh-CN.d.ts +3 -0
- package/dist/components/directory-tour/steps.d.ts +5 -0
- package/dist/components/directory-tour/style.css +237 -0
- package/dist/components/directory-tour/style.js +0 -0
- package/dist/components/directory-tour/types.d.ts +43 -0
- package/dist/components/directory-tour/use-tour-anchor.d.ts +5 -0
- package/dist/components/directory-tour/use-tour-position.d.ts +12 -0
- package/dist/components/directory-tour.js +40 -0
- package/dist/components/file-browser-entries/file-browser-entries.d.ts +5 -5
- package/dist/components/file-browser-entries/labels.d.ts +3 -0
- package/dist/components/file-browser-entries/locales/en-US.d.ts +6 -0
- package/dist/components/file-browser-entries/locales/zh-CN.d.ts +6 -0
- package/dist/components/file-browser-entries/style.css +866 -2
- package/dist/components/file-browser-entries/types.d.ts +34 -16
- package/dist/components/file-preview/file-preview-adapters.d.ts +2 -1
- package/dist/components/file-preview/file-preview-body.d.ts +2 -1
- package/dist/components/file-preview/file-preview-breadcrumb-menu.d.ts +2 -1
- package/dist/components/file-preview/file-preview-breadcrumb.d.ts +2 -1
- package/dist/components/file-preview/file-preview-directory.d.ts +2 -1
- package/dist/components/file-preview/file-preview-handle-adapters.d.ts +2 -1
- package/dist/components/file-preview/file-preview-header.d.ts +6 -2
- package/dist/components/file-preview/file-preview-image-frame.d.ts +5 -0
- package/dist/components/file-preview/file-preview-labels.d.ts +2 -14
- package/dist/components/file-preview/file-preview-level-tabs.d.ts +7 -0
- package/dist/components/file-preview/file-preview-markdown-images.d.ts +13 -0
- package/dist/components/file-preview/file-preview-panels.d.ts +5 -2
- package/dist/components/file-preview/file-preview-viewer.d.ts +2 -1
- package/dist/components/file-preview/file-preview.d.ts +0 -1
- package/dist/components/file-preview/index.d.ts +2 -1
- package/dist/components/file-preview/locales/en-US.d.ts +16 -0
- package/dist/components/file-preview/locales/zh-CN.d.ts +16 -0
- package/dist/components/file-preview/style.css +160 -2
- package/dist/components/file-preview/types.d.ts +34 -10
- package/dist/components/file-preview/use-file-preview-levels.d.ts +7 -0
- package/dist/components/file-preview/use-file-preview-view-state.d.ts +15 -0
- package/dist/components/file-preview.js +1 -1
- package/dist/components/file-tree/file-tree-info-labels.d.ts +0 -15
- package/dist/components/file-tree/file-tree-labels.d.ts +4 -0
- package/dist/components/file-tree/file-tree-row-shared.d.ts +2 -12
- package/dist/components/file-tree/file-tree-toolbar.d.ts +11 -0
- package/dist/components/file-tree/locales/en-US.d.ts +69 -0
- package/dist/components/file-tree/locales/zh-CN.d.ts +69 -0
- package/dist/components/file-tree/style.css +143 -15
- package/dist/components/file-tree/types.d.ts +38 -10
- package/dist/components/file-tree/use-file-tree-actions.d.ts +4 -1
- package/dist/components/scope-switcher/labels.d.ts +3 -0
- package/dist/components/scope-switcher/locales/en-US.d.ts +8 -0
- package/dist/components/scope-switcher/locales/zh-CN.d.ts +8 -0
- package/dist/components/scope-switcher/scope-panel.d.ts +1 -1
- package/dist/components/scope-switcher/scope-switcher.d.ts +2 -2
- package/dist/components/scope-switcher/style.css +14 -2
- package/dist/components/scope-switcher/types.d.ts +12 -6
- package/dist/components/style.css +10030 -6763
- package/dist/components/tui/locales/en-US.d.ts +35 -0
- package/dist/components/tui/locales/zh-CN.d.ts +35 -0
- package/dist/components/tui/style.css +310 -18
- package/dist/components/tui/tui-copy-button.d.ts +1 -1
- package/dist/components/tui/tui-empty.d.ts +25 -0
- package/dist/components/tui/tui-labels.d.ts +2 -2
- package/dist/components/tui/tui.d.ts +1 -1
- package/dist/components/tui/types.d.ts +35 -12
- package/dist/components/tui.js +1 -1
- package/dist/components/viking-bot/ark-adapter.d.ts +2 -0
- package/dist/components/viking-bot/ark-message-body.d.ts +1 -7
- package/dist/components/viking-bot/ark-message-list-view.d.ts +4 -1
- package/dist/components/viking-bot/ark-message-row.d.ts +3 -1
- package/dist/components/viking-bot/bot-popover.d.ts +9 -0
- package/dist/components/viking-bot/capabilities.d.ts +49 -0
- package/dist/components/viking-bot/composer-attachments.d.ts +13 -0
- package/dist/components/viking-bot/composer-controls.d.ts +10 -0
- package/dist/components/viking-bot/composer-footer.d.ts +17 -0
- package/dist/components/viking-bot/composer-references.d.ts +20 -0
- package/dist/components/viking-bot/composer-text.d.ts +10 -0
- package/dist/components/viking-bot/index.d.ts +3 -1
- package/dist/components/viking-bot/interaction/ask-human-fields.d.ts +1 -1
- package/dist/components/viking-bot/interaction/labels.d.ts +2 -1
- package/dist/components/viking-bot/interaction/locales/en-US.d.ts +17 -0
- package/dist/components/viking-bot/interaction/locales/zh-CN.d.ts +17 -0
- package/dist/components/viking-bot/interaction/types.d.ts +8 -3
- package/dist/components/viking-bot/interaction/viking-bot-interaction.d.ts +1 -1
- package/dist/components/viking-bot/labels.d.ts +2 -0
- package/dist/components/viking-bot/locales/en-US.d.ts +40 -0
- package/dist/components/viking-bot/locales/zh-CN.d.ts +40 -0
- package/dist/components/viking-bot/markdown-links.d.ts +27 -0
- package/dist/components/viking-bot/message-activity.d.ts +7 -0
- package/dist/components/viking-bot/message-code-block.d.ts +8 -0
- package/dist/components/viking-bot/message-footer.d.ts +8 -0
- package/dist/components/viking-bot/message-markdown.d.ts +9 -0
- package/dist/components/viking-bot/model.d.ts +37 -3
- package/dist/components/viking-bot/quick-input-tracker.d.ts +16 -0
- package/dist/components/viking-bot/quick-inputs.d.ts +6 -0
- package/dist/components/viking-bot/reference-picker.d.ts +16 -0
- package/dist/components/viking-bot/session-actions.d.ts +11 -0
- package/dist/components/viking-bot/style.css +1486 -48
- package/dist/components/viking-bot/tool-activity.d.ts +9 -0
- package/dist/components/viking-bot/tool-result-links.d.ts +6 -0
- package/dist/components/viking-bot/types.d.ts +20 -8
- package/dist/components/viking-bot/use-quick-input.d.ts +17 -0
- package/dist/components/viking-bot/viking-bot.d.ts +1 -6
- package/dist/components/viking-bot/welcome.d.ts +8 -0
- package/dist/components/viking-bot.js +1 -1
- package/dist/c~0.js +550 -69
- package/dist/e~0.js +335 -0
- package/dist/file-preview-viewer~0.js +90 -8
- package/dist/f~0.js +49 -51
- package/dist/h~0.js +5 -1
- package/dist/icons/console-icons.d.ts +12 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/viking-bot-icons.d.ts +6 -0
- package/dist/icons.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/dist/k~0.js +1 -0
- package/dist/lg~0.js +155 -0
- package/dist/lk~0.js +40 -8
- package/dist/l~0.js +170 -181
- package/dist/modules/console/command-messages.d.ts +19 -0
- package/dist/modules/console/command-parser.d.ts +15 -0
- package/dist/modules/console/command-specs.d.ts +15 -0
- package/dist/modules/console/commands.d.ts +6 -0
- package/dist/modules/console/console-history.d.ts +10 -0
- package/dist/modules/console/console-toolbar.d.ts +18 -0
- package/dist/modules/console/console.d.ts +1 -3
- package/dist/modules/console/controller.d.ts +17 -0
- package/dist/modules/console/index.d.ts +2 -0
- package/dist/modules/console/labels.d.ts +61 -0
- package/dist/modules/console/locales/en-US.d.ts +49 -0
- package/dist/modules/console/locales/zh-CN.d.ts +3 -0
- package/dist/modules/console/localize-records.d.ts +11 -0
- package/dist/modules/console/results.d.ts +2 -0
- package/dist/modules/console/style.css +10905 -15
- package/dist/modules/console/types.d.ts +59 -80
- package/dist/modules/console/use-console.d.ts +3 -0
- package/dist/modules/console.js +1 -1
- package/dist/modules/file-browser/file-browser-detail.d.ts +2 -1
- package/dist/modules/file-browser/file-browser-labels.d.ts +11 -12
- package/dist/modules/file-browser/file-browser-toolbar.d.ts +3 -4
- package/dist/modules/file-browser/file-browser-tree-pane.d.ts +7 -5
- package/dist/modules/file-browser/file-browser.d.ts +1 -1
- package/dist/modules/file-browser/fs-read-directory.d.ts +2 -6
- package/dist/modules/file-browser/locales/en-US.d.ts +25 -0
- package/dist/modules/file-browser/locales/zh-CN.d.ts +25 -0
- package/dist/modules/file-browser/style.css +1695 -126
- package/dist/modules/file-browser/types.d.ts +38 -29
- package/dist/modules/file-browser/use-file-browser.d.ts +6 -1
- package/dist/modules/file-browser/use-fs-preview.d.ts +15 -1
- package/dist/modules/scope-cascade/labels.d.ts +6 -0
- package/dist/modules/scope-cascade/locales/en-US.d.ts +6 -0
- package/dist/modules/scope-cascade/locales/zh-CN.d.ts +3 -0
- package/dist/modules/scope-cascade/scope-cascade.d.ts +2 -2
- package/dist/modules/scope-cascade/style.css +14 -2
- package/dist/modules/scope-cascade/types.d.ts +3 -0
- package/dist/modules/style.css +15938 -3455
- package/dist/nx~0.js +15 -0
- package/dist/n~0.js +240 -83
- package/dist/o~0.js +10 -7
- package/dist/p~0.js +27 -0
- package/dist/rslib-runtime~0.js +42 -0
- package/dist/r~0.js +152 -0
- package/dist/shared/components/drawer/drawer.d.ts +13 -0
- package/dist/shared/components/drawer/index.d.ts +1 -0
- package/dist/shared/components/overlay/use-overlay-position.d.ts +2 -2
- package/dist/shared/components/tooltip/use-portal-theme.d.ts +3 -0
- package/dist/shared/locale-context.d.ts +8 -0
- package/dist/shared/locale.d.ts +6 -0
- package/dist/style.css +26339 -10577
- package/dist/u~0.js +397 -152
- package/dist/viking-bot-composer~0.js +436 -77
- package/dist/viking-bot-interaction~0.js +13 -11
- package/package.json +15 -4
- package/dist/30~0.js +0 -1332
- package/dist/components/tui/tui-labels-zh.d.ts +0 -2
- package/dist/modules/file-browser/tree-info-copy.d.ts +0 -15
- package/dist/modules/file-browser/tree-info-copy.zh-CN.d.ts +0 -15
|
@@ -2,13 +2,15 @@ import type { VikingBotMessage, VikingBotStreamingState } from './model.js';
|
|
|
2
2
|
import type { VikingBotMessageListProps } from './types.js';
|
|
3
3
|
type Labels = NonNullable<VikingBotMessageListProps['labels']>;
|
|
4
4
|
/** 单条消息。One message. */
|
|
5
|
-
export declare function VikingBotMessageRow({ message, labels, onOpenUri, onCopy, onMessageAction, renderMessage, }: {
|
|
5
|
+
export declare function VikingBotMessageRow({ message, labels, onOpenUri, onCopy, onMessageAction, renderMessage, showTime, locale, }: {
|
|
6
6
|
message: VikingBotMessage;
|
|
7
7
|
labels: Labels;
|
|
8
8
|
onOpenUri?: (uri: string) => void;
|
|
9
9
|
onCopy?: (text: string) => void;
|
|
10
10
|
onMessageAction?: (messageId: string, actionKey: string) => void;
|
|
11
11
|
renderMessage?: (message: VikingBotMessage) => React.ReactNode;
|
|
12
|
+
showTime?: boolean;
|
|
13
|
+
locale?: string;
|
|
12
14
|
}): import("react").JSX.Element;
|
|
13
15
|
/** 助手仍在生成时的单元。The in-flight assistant unit. */
|
|
14
16
|
export declare function VikingBotStreamingRow({ streaming, labels, onOpenUri, }: {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/** Private non-modal popover shared by history and the reference toolbar. */
|
|
3
|
+
export declare function BotPopover({ label, trigger: renderTrigger, children, placement, onOpen, }: {
|
|
4
|
+
label: string;
|
|
5
|
+
trigger: (props: ButtonHTMLAttributes<HTMLButtonElement>) => ReactNode;
|
|
6
|
+
children: (close: () => void) => ReactNode;
|
|
7
|
+
placement?: 'top' | 'bottom';
|
|
8
|
+
onOpen?: () => void;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { FileTreeRow } from '../file-tree/index.js';
|
|
3
|
+
/** A host-provided prompt. Selecting it fills the draft; it never sends it. */
|
|
4
|
+
export interface VikingBotQuickInput {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
prompt: string;
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/** A selected reference, kept separately from the editable text. */
|
|
11
|
+
export interface VikingBotReference {
|
|
12
|
+
uri: string;
|
|
13
|
+
name: string;
|
|
14
|
+
type: 'file' | 'directory';
|
|
15
|
+
}
|
|
16
|
+
/** The host owns loading, hierarchy expansion and selected references. */
|
|
17
|
+
export interface VikingBotReferences {
|
|
18
|
+
rows: readonly FileTreeRow[];
|
|
19
|
+
selected: readonly VikingBotReference[];
|
|
20
|
+
onChange: (references: readonly VikingBotReference[]) => void;
|
|
21
|
+
onQueryChange?: (query: string) => void;
|
|
22
|
+
onExpand?: (uri: string) => void;
|
|
23
|
+
isLoading?: boolean;
|
|
24
|
+
error?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface VikingBotSession {
|
|
27
|
+
id: string;
|
|
28
|
+
title: string;
|
|
29
|
+
/** ISO date from the host's session API. Omit when unavailable. */
|
|
30
|
+
updatedAt?: string;
|
|
31
|
+
}
|
|
32
|
+
/** Session persistence and requests belong to the host. */
|
|
33
|
+
export interface VikingBotSessions {
|
|
34
|
+
items: readonly VikingBotSession[];
|
|
35
|
+
currentId?: string;
|
|
36
|
+
isLoading?: boolean;
|
|
37
|
+
error?: string;
|
|
38
|
+
hasMore?: boolean;
|
|
39
|
+
onOpenHistory?: () => void;
|
|
40
|
+
onLoadMore?: () => void;
|
|
41
|
+
onSelect: (id: string) => void;
|
|
42
|
+
onNew: () => void;
|
|
43
|
+
}
|
|
44
|
+
export interface VikingBotInputFeatures {
|
|
45
|
+
quickInputs?: readonly VikingBotQuickInput[];
|
|
46
|
+
/** Override the default draft filling behavior. */
|
|
47
|
+
onQuickInputSelect?: (input: VikingBotQuickInput) => void;
|
|
48
|
+
references?: VikingBotReferences;
|
|
49
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { VikingBotAttachment, VikingBotLabels } from './model.js';
|
|
2
|
+
export declare function ComposerFileButton({ accept, disabled, label, onFiles, }: {
|
|
3
|
+
accept?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
label: string;
|
|
6
|
+
onFiles: (files: readonly File[]) => void;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export declare function ComposerAttachments({ items, onRemove, disabled, labels, }: {
|
|
9
|
+
items: readonly VikingBotAttachment[];
|
|
10
|
+
onRemove?: (item: VikingBotAttachment) => void;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
labels: Required<VikingBotLabels>;
|
|
13
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SenderProps } from '@ark-design/ui/sender';
|
|
2
|
+
import type { ButtonHTMLAttributes } from 'react';
|
|
3
|
+
type SubmitProps = Parameters<NonNullable<SenderProps['renderSubmit']>>[0];
|
|
4
|
+
export declare function VikingBotSubmit({ onSend, onStop, sending, tip, className, label, ...props }: SubmitProps & {
|
|
5
|
+
label: string;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
export declare function VikingBotAttach({ label, ...props }: ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
8
|
+
label: string;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Locale } from '../../shared/locale.js';
|
|
2
|
+
import type { ReactNode, RefObject } from 'react';
|
|
3
|
+
import type { SenderInstance } from '@ark-design/ui/sender';
|
|
4
|
+
import type { VikingBotLabels } from './model.js';
|
|
5
|
+
import type { VikingBotReferences } from './capabilities.js';
|
|
6
|
+
export declare function ComposerFooter({ locale, references, senderRef, labels, disabled, filesDisabled, accept, onFiles, actions, submit, }: {
|
|
7
|
+
senderRef: RefObject<SenderInstance | null>;
|
|
8
|
+
locale: Locale;
|
|
9
|
+
labels: Required<VikingBotLabels>;
|
|
10
|
+
references?: VikingBotReferences;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
filesDisabled?: boolean;
|
|
13
|
+
accept?: string;
|
|
14
|
+
onFiles?: (files: readonly File[]) => void;
|
|
15
|
+
actions?: ReactNode;
|
|
16
|
+
submit: ReactNode;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Locale } from '../../shared/locale.js';
|
|
2
|
+
import type { RefObject } from 'react';
|
|
3
|
+
import type { SenderInstance } from '@ark-design/ui/sender';
|
|
4
|
+
import type { VikingBotReferences, VikingBotReference } from './capabilities.js';
|
|
5
|
+
import type { VikingBotLabels } from './model.js';
|
|
6
|
+
import type { MentionConfig } from './reference-picker.js';
|
|
7
|
+
export declare function selectReference(config: VikingBotReferences, item: VikingBotReference): void;
|
|
8
|
+
export declare function composerMention(config: VikingBotReferences | undefined, disabled: boolean, labels: VikingBotLabels, locale: Locale): MentionConfig | undefined;
|
|
9
|
+
export declare function ReferenceButton({ locale, config, disabled, labels, senderRef, }: {
|
|
10
|
+
config: VikingBotReferences;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
labels: Required<VikingBotLabels>;
|
|
13
|
+
locale: Locale;
|
|
14
|
+
senderRef: RefObject<SenderInstance | null>;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export declare function ReferenceTags({ config, labels, disabled, }: {
|
|
17
|
+
config?: VikingBotReferences;
|
|
18
|
+
labels: Required<VikingBotLabels>;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RichTextValue, SenderInstance } from '@ark-design/ui/sender';
|
|
2
|
+
/** Plain text excludes attachment/tag values, matching the controlled draft. */
|
|
3
|
+
export declare const toPlainText: (content: RichTextValue[]) => string;
|
|
4
|
+
export declare function toRichText(text: string): RichTextValue[];
|
|
5
|
+
/** Sender.setValue dispatches synchronous content events; these are not user edits. */
|
|
6
|
+
export declare function writeComposerText(sender: SenderInstance | null, text: string, writing: {
|
|
7
|
+
current: boolean;
|
|
8
|
+
}): void;
|
|
9
|
+
/** Read the real editor caret in the same text coordinate space as the draft. */
|
|
10
|
+
export declare function composerCaret(sender: SenderInstance | null): number | undefined;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { VikingBot } from './viking-bot.js';
|
|
2
|
+
export { VikingBotSessionActions } from './session-actions.js';
|
|
3
|
+
export type { VikingBotQuickInput, VikingBotReference, VikingBotReferences, VikingBotSession, VikingBotSessions, VikingBotInputFeatures, } from './capabilities.js';
|
|
2
4
|
export { VikingBotComposer } from './lazy-composer.js';
|
|
3
5
|
export { VikingBotMessageList } from './viking-bot-message-list.js';
|
|
4
6
|
export { VikingBotInteraction, DEFAULT_INTERACTION_LABELS, } from './interaction/index.js';
|
|
5
7
|
export type { InteractionLabels } from './interaction/index.js';
|
|
6
8
|
export { DEFAULT_LABELS } from './labels.js';
|
|
7
9
|
export { groupByActivity, groupMessages, messageText, } from './message-groups.js';
|
|
8
|
-
export type { VikingBotAttachment, VikingBotAttachmentPart, VikingBotContextPart, VikingBotDraft, VikingBotImagePart, VikingBotIterationPart, VikingBotLabels, VikingBotMessage, VikingBotMessagePart, VikingBotReasoningPart, VikingBotStreamingState, VikingBotTextPart, VikingBotToolPart, VikingBotToolResultPart, } from './model.js';
|
|
10
|
+
export type { VikingBotAttachment, VikingBotAttachmentPart, VikingBotContextPart, VikingBotDraft, VikingBotImagePart, VikingBotIterationPart, VikingBotLabels, VikingBotMessage, VikingBotMessagePart, VikingBotReasoningPart, VikingBotStreamingState, VikingBotTextPart, VikingBotToolPart, VikingBotToolResultPart, VikingBotToolResultLink, } from './model.js';
|
|
9
11
|
export type { VikingBotComposerProps, VikingBotComposerRef, VikingBotMessageListProps, VikingBotProps, } from './types.js';
|
|
10
12
|
export type { VikingBotInteractionAnswer, VikingBotInteractionLabels, VikingBotInteractionOption, VikingBotInteractionProps, VikingBotInteractionRenderContext, VikingBotInteractionRequest, VikingBotRepairOption, VikingBotScheduleValue, } from './interaction/types.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AskHumanField, AskHumanValue } from '@ark-design/ui/ask-human';
|
|
2
2
|
import type { VikingBotInteractionAnswer, VikingBotInteractionRequest } from './types.js';
|
|
3
3
|
/** 把请求转成 AskHuman 的字段描述。 */
|
|
4
|
-
export declare const toFields: (request: VikingBotInteractionRequest) => AskHumanField[];
|
|
4
|
+
export declare const toFields: (request: VikingBotInteractionRequest, other: string) => AskHumanField[];
|
|
5
5
|
/** 把 AskHuman 的提交值转回交互答案。 */
|
|
6
6
|
export declare const toAnswer: (request: VikingBotInteractionRequest, value: AskHumanValue) => VikingBotInteractionAnswer;
|
|
7
7
|
/** 按 request 计算 AskHuman 的初始答案,保证预填值与提交值一致。 */
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { VikingBotInteractionLabels } from './types.js';
|
|
2
|
+
import { type Locale } from '../../../shared/locale.js';
|
|
2
3
|
/** 内部完整文案类型,从公开类型派生,保证宿主可覆盖每一处文案。 */
|
|
3
4
|
export type InteractionLabels = Required<Omit<VikingBotInteractionLabels, 'progress'>> & {
|
|
4
5
|
progress: (index: number, total: number) => string;
|
|
5
6
|
};
|
|
6
|
-
/** 内置交互区文案。Built-in interaction copy. */
|
|
7
7
|
export declare const DEFAULT_INTERACTION_LABELS: InteractionLabels;
|
|
8
|
+
export declare function resolveInteractionLabels(locale: Locale, labels?: VikingBotInteractionLabels): InteractionLabels;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
answer: string;
|
|
3
|
+
title: string;
|
|
4
|
+
submit: string;
|
|
5
|
+
cancel: string;
|
|
6
|
+
other: string;
|
|
7
|
+
submitted: string;
|
|
8
|
+
cancelled: string;
|
|
9
|
+
progress: (index: number, total: number) => string;
|
|
10
|
+
scheduleNone: string;
|
|
11
|
+
scheduleDaily: string;
|
|
12
|
+
scheduleWeekly: string;
|
|
13
|
+
scheduleTime: string;
|
|
14
|
+
scheduleWeekday: string;
|
|
15
|
+
weekdays: string[];
|
|
16
|
+
};
|
|
17
|
+
export default messages;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
answer: string;
|
|
3
|
+
title: string;
|
|
4
|
+
submit: string;
|
|
5
|
+
cancel: string;
|
|
6
|
+
other: string;
|
|
7
|
+
submitted: string;
|
|
8
|
+
cancelled: string;
|
|
9
|
+
progress: (index: number, total: number) => string;
|
|
10
|
+
scheduleNone: string;
|
|
11
|
+
scheduleDaily: string;
|
|
12
|
+
scheduleWeekly: string;
|
|
13
|
+
scheduleTime: string;
|
|
14
|
+
scheduleWeekday: string;
|
|
15
|
+
weekdays: string[];
|
|
16
|
+
};
|
|
17
|
+
export default messages;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Locale } from '../../../shared/locale.js';
|
|
1
2
|
import type { ReactNode } from 'react';
|
|
2
3
|
/** 可选项。An option offered by a question. */
|
|
3
4
|
export interface VikingBotInteractionOption {
|
|
@@ -120,11 +121,13 @@ export type VikingBotInteractionAnswer = {
|
|
|
120
121
|
value: unknown;
|
|
121
122
|
};
|
|
122
123
|
/**
|
|
123
|
-
*
|
|
124
|
-
* Copy of the interaction area. The component ships English defaults; a host
|
|
124
|
+
* 交互区文案。组件内置中英文文案,宿主可按需覆盖。
|
|
125
|
+
* Copy of the interaction area. The component ships Chinese and English defaults; a host
|
|
125
126
|
* overrides any field it needs.
|
|
126
127
|
*/
|
|
127
128
|
export interface VikingBotInteractionLabels {
|
|
129
|
+
/** 文本答案的无障碍名称。Accessible name of a text answer. */
|
|
130
|
+
answer?: string;
|
|
128
131
|
/** 区域标题,缺省为「待确认」。Area title, "Needs your input" by default. */
|
|
129
132
|
title?: string;
|
|
130
133
|
/** 提交按钮。Submit button. */
|
|
@@ -161,6 +164,8 @@ export interface VikingBotInteractionLabels {
|
|
|
161
164
|
export interface VikingBotInteractionProps {
|
|
162
165
|
/** 当前问题。The current question. */
|
|
163
166
|
request: VikingBotInteractionRequest;
|
|
167
|
+
/** 可选文案语言;继承上层,最终默认英文。Optional locale; inherits or defaults to en-US. */
|
|
168
|
+
locale?: Locale;
|
|
164
169
|
/**
|
|
165
170
|
* 问题的稳定身份;变化时重置表单状态。省略时按 `request.kind` 与序号判定。
|
|
166
171
|
* Stable identity of the question; changes reset the form state. Defaults to
|
|
@@ -183,6 +188,6 @@ export interface VikingBotInteractionProps {
|
|
|
183
188
|
onSubmit?: (answer: VikingBotInteractionAnswer) => void | Promise<void>;
|
|
184
189
|
/** 放弃本次交互。Abandons this interaction. */
|
|
185
190
|
onCancel?: () => void;
|
|
186
|
-
/**
|
|
191
|
+
/** 可替换文案,未提供的项使用当前 locale 的内置文案。Replaceable copy; omitted fields follow locale. */
|
|
187
192
|
labels?: VikingBotInteractionLabels;
|
|
188
193
|
}
|
|
@@ -6,4 +6,4 @@ import type { VikingBotInteractionProps } from './types.js';
|
|
|
6
6
|
* The pending-interaction area. Ark's AskHuman renders the form; when a question
|
|
7
7
|
* needs a tree picker or an uploader, `custom` hands rendering to the host.
|
|
8
8
|
*/
|
|
9
|
-
export declare function VikingBotInteractionView({ request, className, requestKey, index, total, disabled, submitting, error, onSubmit, onCancel, labels: overrides, }: VikingBotInteractionProps): import("react").JSX.Element;
|
|
9
|
+
export declare function VikingBotInteractionView({ request, className, requestKey, index, total, disabled, submitting, error, onSubmit, onCancel, locale: localeProp, labels: overrides, }: VikingBotInteractionProps): import("react").JSX.Element;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import type { VikingBotLabels } from './model.js';
|
|
2
|
+
import { type Locale } from '../../shared/locale.js';
|
|
2
3
|
export declare const DEFAULT_LABELS: Required<VikingBotLabels>;
|
|
4
|
+
export declare function resolveVikingBotLabels(locale: Locale, labels?: VikingBotLabels): Required<VikingBotLabels>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
activityRunning: string;
|
|
3
|
+
activityCompleted: string;
|
|
4
|
+
toolInput: string;
|
|
5
|
+
toolOutput: string;
|
|
6
|
+
similarity: string;
|
|
7
|
+
sessionHistory: string;
|
|
8
|
+
newSession: string;
|
|
9
|
+
emptySessions: string;
|
|
10
|
+
loading: string;
|
|
11
|
+
loadMore: string;
|
|
12
|
+
reference: string;
|
|
13
|
+
searchReferences: string;
|
|
14
|
+
emptyReferences: string;
|
|
15
|
+
removeReference: string;
|
|
16
|
+
expandReference: string;
|
|
17
|
+
collapseReference: string;
|
|
18
|
+
welcomeTitle: string;
|
|
19
|
+
welcomeDescription: string;
|
|
20
|
+
placeholder: string;
|
|
21
|
+
send: string;
|
|
22
|
+
stop: string;
|
|
23
|
+
attach: string;
|
|
24
|
+
removeAttachment: string;
|
|
25
|
+
copy: string;
|
|
26
|
+
copied: string;
|
|
27
|
+
reasoning: string;
|
|
28
|
+
thinking: string;
|
|
29
|
+
tool: string;
|
|
30
|
+
toolPending: string;
|
|
31
|
+
toolRunning: string;
|
|
32
|
+
toolCompleted: string;
|
|
33
|
+
toolError: string;
|
|
34
|
+
context: string;
|
|
35
|
+
empty: string;
|
|
36
|
+
retry: string;
|
|
37
|
+
scrollToLatest: string;
|
|
38
|
+
unavailable: string;
|
|
39
|
+
};
|
|
40
|
+
export default messages;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
activityRunning: string;
|
|
3
|
+
activityCompleted: string;
|
|
4
|
+
toolInput: string;
|
|
5
|
+
toolOutput: string;
|
|
6
|
+
similarity: string;
|
|
7
|
+
sessionHistory: string;
|
|
8
|
+
newSession: string;
|
|
9
|
+
emptySessions: string;
|
|
10
|
+
loading: string;
|
|
11
|
+
loadMore: string;
|
|
12
|
+
reference: string;
|
|
13
|
+
searchReferences: string;
|
|
14
|
+
emptyReferences: string;
|
|
15
|
+
removeReference: string;
|
|
16
|
+
expandReference: string;
|
|
17
|
+
collapseReference: string;
|
|
18
|
+
welcomeTitle: string;
|
|
19
|
+
welcomeDescription: string;
|
|
20
|
+
placeholder: string;
|
|
21
|
+
send: string;
|
|
22
|
+
stop: string;
|
|
23
|
+
attach: string;
|
|
24
|
+
removeAttachment: string;
|
|
25
|
+
copy: string;
|
|
26
|
+
copied: string;
|
|
27
|
+
reasoning: string;
|
|
28
|
+
thinking: string;
|
|
29
|
+
tool: string;
|
|
30
|
+
toolPending: string;
|
|
31
|
+
toolRunning: string;
|
|
32
|
+
toolCompleted: string;
|
|
33
|
+
toolError: string;
|
|
34
|
+
context: string;
|
|
35
|
+
empty: string;
|
|
36
|
+
retry: string;
|
|
37
|
+
scrollToLatest: string;
|
|
38
|
+
unavailable: string;
|
|
39
|
+
};
|
|
40
|
+
export default messages;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
interface MarkdownNode {
|
|
2
|
+
type?: string;
|
|
3
|
+
value?: string;
|
|
4
|
+
url?: string;
|
|
5
|
+
children?: MarkdownNode[];
|
|
6
|
+
}
|
|
7
|
+
/** Preserve normal Markdown navigation while rejecting executable URL schemes. */
|
|
8
|
+
export declare function safeMarkdownHref(value?: string): string | undefined;
|
|
9
|
+
/** Only resource URIs enter the host callback; other schemes stay with Markdown. */
|
|
10
|
+
export declare function resourceHref(value?: string): string | undefined;
|
|
11
|
+
export declare function resourceText(value: string, prose?: boolean): {
|
|
12
|
+
start: number;
|
|
13
|
+
end: number;
|
|
14
|
+
uri: string;
|
|
15
|
+
}[];
|
|
16
|
+
/** Transform AST nodes rather than synthesizing HTML from response text. */
|
|
17
|
+
export declare function linkResourceNodes(node: MarkdownNode): MarkdownNode;
|
|
18
|
+
export declare const resourceAstPlugin: {
|
|
19
|
+
name: string;
|
|
20
|
+
config: {};
|
|
21
|
+
before: () => void;
|
|
22
|
+
after: () => void;
|
|
23
|
+
beforeEach: () => void;
|
|
24
|
+
afterEach: () => void;
|
|
25
|
+
modifier: (ast: unknown) => void;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { VikingBotLabels, VikingBotMessagePart } from './model.js';
|
|
2
|
+
/** Ark owns the disclosure, completion collapse and execution status header. */
|
|
3
|
+
export declare function MessageActivity({ parts, labels, onOpenUri, }: {
|
|
4
|
+
parts: readonly VikingBotMessagePart[];
|
|
5
|
+
labels: VikingBotLabels;
|
|
6
|
+
onOpenUri?: (uri: string) => void;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { VikingBotLabels } from './model.js';
|
|
2
|
+
/** Ark owns highlighting and clipboard feedback; only the host's resource links are added. */
|
|
3
|
+
export declare function MessageCodeBlock({ code, language, labels, onOpenUri, }: {
|
|
4
|
+
code: string;
|
|
5
|
+
language?: string;
|
|
6
|
+
labels: VikingBotLabels;
|
|
7
|
+
onOpenUri?: (uri: string) => void;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { VikingBotLabels, VikingBotMessage } from './model.js';
|
|
2
|
+
export declare function MessageFooter({ message, showTime, labels, locale, onCopy, }: {
|
|
3
|
+
message: VikingBotMessage;
|
|
4
|
+
showTime?: boolean;
|
|
5
|
+
labels: VikingBotLabels;
|
|
6
|
+
locale?: string;
|
|
7
|
+
onCopy?: (text: string) => void;
|
|
8
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { VikingBotLabels } from './model.js';
|
|
2
|
+
/** Shared Ark renderer for answers, retaining the reference version's link slots. */
|
|
3
|
+
export declare function MessageMarkdown({ text, streaming, user, labels, onOpenUri, }: {
|
|
4
|
+
text: string;
|
|
5
|
+
streaming?: boolean;
|
|
6
|
+
user?: boolean;
|
|
7
|
+
labels: VikingBotLabels;
|
|
8
|
+
onOpenUri?: (uri: string) => void;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { VikingBotReference } from './capabilities.js';
|
|
2
3
|
/**
|
|
3
4
|
* 片段类型判别值。两种宿主风格共用这一层:宿主在接入层把各自的流事件
|
|
4
5
|
* 归一化成这些片段,组件不依赖任一方协议。
|
|
@@ -12,9 +13,8 @@ export interface VikingBotTextPart {
|
|
|
12
13
|
/** 文本内容。Text content. */
|
|
13
14
|
text: string;
|
|
14
15
|
/**
|
|
15
|
-
* 文本格式,缺省为 `plain
|
|
16
|
-
* Text format, `
|
|
17
|
-
* managed-agent tool output is plain text.
|
|
16
|
+
* 文本格式,缺省为 `markdown`。逐字展示时显式传 `plain`。
|
|
17
|
+
* Text format, `markdown` by default. Pass `plain` for literal text.
|
|
18
18
|
*/
|
|
19
19
|
format?: 'plain' | 'markdown';
|
|
20
20
|
}
|
|
@@ -55,6 +55,12 @@ export interface VikingBotContextPart {
|
|
|
55
55
|
/** 引用摘要。Reference abstract. */
|
|
56
56
|
abstract?: string;
|
|
57
57
|
}
|
|
58
|
+
/** Host-normalized resource links returned by a tool. */
|
|
59
|
+
export interface VikingBotToolResultLink {
|
|
60
|
+
uri: string;
|
|
61
|
+
label?: string;
|
|
62
|
+
score?: number;
|
|
63
|
+
}
|
|
58
64
|
/** 工具调用片段。A tool call part. */
|
|
59
65
|
export interface VikingBotToolPart {
|
|
60
66
|
/** 片段类型。Part type. */
|
|
@@ -69,8 +75,13 @@ export interface VikingBotToolPart {
|
|
|
69
75
|
input?: Record<string, unknown>;
|
|
70
76
|
/** 调用输出文本。Call output text. */
|
|
71
77
|
output?: string;
|
|
78
|
+
/** Normalized result cards; the host adapts its search response. */
|
|
79
|
+
results?: readonly VikingBotToolResultLink[];
|
|
72
80
|
/** 调用耗时,单位毫秒。Call duration in milliseconds. */
|
|
73
81
|
durationMs?: number;
|
|
82
|
+
/** Execution timestamps for the activity duration. */
|
|
83
|
+
startedAt?: number | string;
|
|
84
|
+
completedAt?: number | string;
|
|
74
85
|
/** 所属执行块标识。Owning activity block. */
|
|
75
86
|
groupId?: string;
|
|
76
87
|
/** MCP 服务名,火山版按服务分组展示。MCP server name; the managed agent groups by it. */
|
|
@@ -91,6 +102,8 @@ export interface VikingBotToolResultPart {
|
|
|
91
102
|
name: string;
|
|
92
103
|
/** 工具输出文本。Tool output text. */
|
|
93
104
|
output: string;
|
|
105
|
+
/** Normalized result cards, replacing the raw output presentation. */
|
|
106
|
+
results?: readonly VikingBotToolResultLink[];
|
|
94
107
|
/** 该结果是否为错误。Whether the result is an error. */
|
|
95
108
|
isError?: boolean;
|
|
96
109
|
/** 所属执行块标识。Owning activity block. */
|
|
@@ -206,9 +219,30 @@ export interface VikingBotDraft {
|
|
|
206
219
|
text: string;
|
|
207
220
|
/** 附带的附件。Attached files. */
|
|
208
221
|
attachments: readonly VikingBotAttachment[];
|
|
222
|
+
/** Selected context, separate from editable text. Omitted when references are not configured. */
|
|
223
|
+
references?: readonly VikingBotReference[];
|
|
209
224
|
}
|
|
210
225
|
/** 可替换文案,组件内置英文默认值。Replaceable copy; the component ships English defaults. */
|
|
211
226
|
export interface VikingBotLabels {
|
|
227
|
+
activityRunning?: string;
|
|
228
|
+
activityCompleted?: string;
|
|
229
|
+
toolInput?: string;
|
|
230
|
+
toolOutput?: string;
|
|
231
|
+
similarity?: string;
|
|
232
|
+
sessionHistory?: string;
|
|
233
|
+
emptySessions?: string;
|
|
234
|
+
loading?: string;
|
|
235
|
+
loadMore?: string;
|
|
236
|
+
reference?: string;
|
|
237
|
+
searchReferences?: string;
|
|
238
|
+
emptyReferences?: string;
|
|
239
|
+
removeReference?: string;
|
|
240
|
+
expandReference?: string;
|
|
241
|
+
collapseReference?: string;
|
|
242
|
+
/** 欢迎标题。Welcome heading. */
|
|
243
|
+
welcomeTitle?: string;
|
|
244
|
+
/** 欢迎说明。Welcome description. */
|
|
245
|
+
welcomeDescription?: string;
|
|
212
246
|
/** 输入框占位文本。Input placeholder. */
|
|
213
247
|
placeholder?: string;
|
|
214
248
|
/** 发送按钮文案。Send button label. */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface PromptRange {
|
|
2
|
+
from: number;
|
|
3
|
+
to: number;
|
|
4
|
+
}
|
|
5
|
+
export interface PromptSnapshot {
|
|
6
|
+
text: string;
|
|
7
|
+
range: PromptRange | undefined;
|
|
8
|
+
}
|
|
9
|
+
/** Instance-local ownership metadata; never locates a prompt by matching its text. */
|
|
10
|
+
export declare function createQuickInputTracker(initial: string, previous?: PromptSnapshot): {
|
|
11
|
+
snapshot: () => PromptSnapshot;
|
|
12
|
+
edit: (next: string, caret?: number) => void;
|
|
13
|
+
release(): void;
|
|
14
|
+
insert(value: string, prompt: string): string;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { VikingBotQuickInput } from './capabilities.js';
|
|
2
|
+
export declare function QuickInputs({ items, onSelect, disabled, }: {
|
|
3
|
+
items?: readonly VikingBotQuickInput[];
|
|
4
|
+
onSelect: (item: VikingBotQuickInput) => void;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Locale } from '../../shared/locale.js';
|
|
2
|
+
import type { SenderProps } from '@ark-design/ui/sender';
|
|
3
|
+
import type { VikingBotLabels } from './model.js';
|
|
4
|
+
import type { VikingBotReference, VikingBotReferences } from './capabilities.js';
|
|
5
|
+
export type MentionConfig = NonNullable<NonNullable<SenderProps['richTextAreaProps']>['mentionConfig']>;
|
|
6
|
+
type Editor = Parameters<NonNullable<MentionConfig['render']>>[0]['editor'];
|
|
7
|
+
/** The same host-owned tree serves the toolbar and Sender's mention extension. */
|
|
8
|
+
export declare function ReferencePicker({ config, locale, query: externalQuery, editor, onSelect, labels: overrides, }: {
|
|
9
|
+
config: VikingBotReferences;
|
|
10
|
+
locale: Locale;
|
|
11
|
+
query?: string;
|
|
12
|
+
editor?: Editor;
|
|
13
|
+
onSelect: (reference: VikingBotReference) => void;
|
|
14
|
+
labels?: VikingBotLabels;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Locale } from '../../shared/locale.js';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { VikingBotLabels } from './model.js';
|
|
4
|
+
import type { VikingBotSessions } from './capabilities.js';
|
|
5
|
+
/** Session controls can be used alone by a host's shared header. */
|
|
6
|
+
export declare function VikingBotSessionActions({ sessions, extra, labels: overrides, locale: localeProp, }: {
|
|
7
|
+
sessions?: VikingBotSessions;
|
|
8
|
+
extra?: ReactNode;
|
|
9
|
+
labels?: VikingBotLabels;
|
|
10
|
+
locale?: Locale;
|
|
11
|
+
}): import("react").JSX.Element;
|