@openviking/react 0.1.0 → 0.1.2
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/README.md +57 -34
- package/dist/3~0.js +2117 -0
- package/dist/ark-message-list-view~0.js +310 -0
- package/dist/a~0.js +21 -0
- package/dist/c7~0.js +24 -0
- package/dist/client/client.d.ts +12 -0
- package/dist/client/errors.d.ts +30 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/options.d.ts +101 -0
- package/dist/client/provider.d.ts +52 -0
- package/dist/client/types.d.ts +160 -0
- package/dist/client.js +239 -0
- package/dist/components/agent-connect/agent-connect-copy.d.ts +34 -0
- package/dist/components/agent-connect/agent-connect-design.d.ts +1781 -0
- package/dist/components/agent-connect/agent-connect-detail.d.ts +13 -0
- package/dist/components/agent-connect/agent-connect-installer.d.ts +3 -0
- package/dist/components/agent-connect/agent-connect-instructions-view.d.ts +14 -0
- package/dist/components/agent-connect/agent-connect-instructions.d.ts +145 -0
- package/dist/components/agent-connect/agent-connect-markdown.d.ts +3 -0
- package/dist/components/agent-connect/agent-connect.d.ts +4 -1
- package/dist/components/agent-connect/content-en.d.ts +137 -0
- package/dist/components/agent-connect/content-zh.d.ts +137 -0
- package/dist/components/agent-connect/index.d.ts +1 -0
- package/dist/components/agent-connect/style.css +503 -0
- package/dist/components/agent-connect/types.d.ts +29 -0
- package/dist/components/agent-connect.js +1 -0
- package/dist/components/file-preview/file-preview-adapters.d.ts +33 -0
- package/dist/components/file-preview/file-preview-body.d.ts +27 -0
- package/dist/components/file-preview/file-preview-breadcrumb-menu.d.ts +16 -0
- package/dist/components/file-preview/file-preview-breadcrumb.d.ts +21 -0
- package/dist/components/file-preview/file-preview-copy-path.d.ts +12 -0
- package/dist/components/file-preview/file-preview-editor.d.ts +22 -0
- package/dist/components/file-preview/file-preview-handle-adapters.d.ts +26 -0
- package/dist/components/file-preview/file-preview-header.d.ts +25 -0
- package/dist/components/file-preview/file-preview-labels.d.ts +16 -0
- package/dist/components/file-preview/file-preview-lazy-viewer.d.ts +3 -0
- package/dist/components/file-preview/file-preview-path.d.ts +30 -0
- package/dist/components/file-preview/file-preview-source.d.ts +24 -0
- package/dist/components/file-preview/file-preview-state.d.ts +28 -0
- package/dist/components/file-preview/file-preview-tab-row.d.ts +16 -0
- package/dist/components/file-preview/file-preview-viewer.d.ts +31 -0
- package/dist/components/file-preview/file-preview.d.ts +14 -1
- package/dist/components/file-preview/index.d.ts +1 -0
- package/dist/components/file-preview/style.css +4139 -0
- package/dist/components/file-preview/types.d.ts +516 -0
- package/dist/components/file-preview/use-file-preview-actions-context.d.ts +23 -0
- package/dist/components/file-preview/use-file-preview-actions.d.ts +19 -0
- package/dist/components/file-preview/use-file-preview-editing.d.ts +32 -0
- package/dist/components/file-preview/use-file-preview-ids.d.ts +24 -0
- package/dist/components/file-preview.js +1 -0
- package/dist/components/file-tree/file-tree-body.d.ts +18 -0
- package/dist/components/file-tree/file-tree-entry-row.d.ts +12 -0
- package/dist/components/file-tree/file-tree-icons.d.ts +15 -0
- package/dist/components/file-tree/file-tree-info-labels.d.ts +21 -0
- package/dist/components/file-tree/file-tree-info-tooltip.d.ts +43 -0
- package/dist/components/file-tree/file-tree-info.d.ts +29 -0
- package/dist/components/file-tree/file-tree-keyboard.d.ts +14 -0
- package/dist/components/file-tree/file-tree-row-context.d.ts +46 -0
- package/dist/components/file-tree/file-tree-row-shared.d.ts +11 -0
- package/dist/components/file-tree/file-tree-spinner.d.ts +10 -0
- package/dist/components/file-tree/file-tree-state-row.d.ts +7 -0
- package/dist/components/file-tree/file-tree-tooltip-surface.d.ts +22 -0
- package/dist/components/file-tree/file-tree-tooltip.d.ts +17 -0
- package/dist/components/file-tree/file-tree.d.ts +15 -1
- package/dist/components/file-tree/index.d.ts +1 -0
- package/dist/components/file-tree/style.css +410 -0
- package/dist/components/file-tree/types.d.ts +589 -0
- package/dist/components/file-tree/use-file-tree-actions.d.ts +17 -0
- package/dist/components/file-tree.js +1 -0
- package/dist/components/scope-switcher/index.d.ts +1 -0
- package/dist/components/scope-switcher/scope-keyboard.d.ts +2 -0
- package/dist/components/scope-switcher/scope-panel.d.ts +11 -0
- package/dist/components/scope-switcher/scope-selector.d.ts +2 -0
- package/dist/components/scope-switcher/scope-switcher.d.ts +6 -1
- package/dist/components/scope-switcher/style.css +452 -0
- package/dist/components/scope-switcher/types.d.ts +489 -0
- package/dist/components/scope-switcher.js +3 -0
- package/dist/components/style.css +14249 -18
- package/dist/components/tui/command-catalog.d.ts +58 -0
- package/dist/components/tui/command-completion.d.ts +19 -0
- package/dist/components/tui/command-definitions.d.ts +10 -0
- package/dist/components/tui/command-input.d.ts +16 -0
- package/dist/components/tui/index.d.ts +1 -0
- package/dist/components/tui/style.css +1552 -0
- package/dist/components/tui/tui-assist.d.ts +15 -0
- package/dist/components/tui/tui-code-block.d.ts +8 -0
- package/dist/components/tui/tui-command-help.d.ts +9 -0
- package/dist/components/tui/tui-command-text.d.ts +6 -0
- package/dist/components/tui/tui-composer.d.ts +24 -0
- package/dist/components/tui/tui-copy-button.d.ts +9 -0
- package/dist/components/tui/tui-input-mirror.d.ts +14 -0
- package/dist/components/tui/tui-labels-zh.d.ts +2 -0
- package/dist/components/tui/tui-labels.d.ts +5 -0
- package/dist/components/tui/tui-markdown-renderers.d.ts +10 -0
- package/dist/components/tui/tui-markdown.d.ts +6 -0
- package/dist/components/tui/tui-param-hint.d.ts +7 -0
- package/dist/components/tui/tui-record-time.d.ts +11 -0
- package/dist/components/tui/tui-record.d.ts +13 -0
- package/dist/components/tui/tui-resource-preview.d.ts +10 -0
- package/dist/components/tui/tui-resource-tree.d.ts +10 -0
- package/dist/components/tui/tui-result-header.d.ts +7 -0
- package/dist/components/tui/tui-result-text.d.ts +5 -0
- package/dist/components/tui/tui-search-list.d.ts +8 -0
- package/dist/components/tui/tui-skeleton.d.ts +6 -0
- package/dist/components/tui/tui-status-card.d.ts +7 -0
- package/dist/components/tui/tui-text.d.ts +10 -0
- package/dist/components/tui/tui-uri-text.d.ts +19 -0
- package/dist/components/tui/tui-write-result.d.ts +7 -0
- package/dist/components/tui/tui.d.ts +11 -1
- package/dist/components/tui/types.d.ts +527 -0
- package/dist/components/tui/use-tui-assist-position.d.ts +3 -0
- package/dist/components/tui/use-tui-completion.d.ts +14 -0
- package/dist/components/tui/use-tui-composer-keyboard.d.ts +25 -0
- package/dist/components/tui.js +1 -0
- package/dist/components/viking-bot/ark-adapter.d.ts +45 -0
- package/dist/components/viking-bot/ark-message-body.d.ts +16 -0
- package/dist/components/viking-bot/ark-message-list-view.d.ts +7 -0
- package/dist/components/viking-bot/ark-message-row.d.ts +19 -0
- package/dist/components/viking-bot/index.d.ts +10 -0
- package/dist/components/viking-bot/interaction/ask-human-fields.d.ts +10 -0
- package/dist/components/viking-bot/interaction/index.d.ts +4 -0
- package/dist/components/viking-bot/interaction/labels.d.ts +7 -0
- package/dist/components/viking-bot/interaction/lazy-interaction.d.ts +3 -0
- package/dist/components/viking-bot/interaction/schedule-input.d.ts +13 -0
- package/dist/components/viking-bot/interaction/style.css +189 -0
- package/dist/components/viking-bot/interaction/types.d.ts +188 -0
- package/dist/components/viking-bot/interaction/viking-bot-interaction.d.ts +9 -0
- package/dist/components/viking-bot/interaction.js +2 -0
- package/dist/components/viking-bot/labels.d.ts +2 -0
- package/dist/components/viking-bot/lazy-composer.d.ts +3 -0
- package/dist/components/viking-bot/message-groups.d.ts +12 -0
- package/dist/components/viking-bot/model.d.ts +252 -0
- package/dist/components/viking-bot/render-part.d.ts +12 -0
- package/dist/components/viking-bot/style.css +7133 -0
- package/dist/components/viking-bot/types.d.ts +140 -0
- package/dist/components/viking-bot/viking-bot-composer.d.ts +6 -0
- package/dist/components/viking-bot/viking-bot-message-list.d.ts +3 -0
- package/dist/components/viking-bot/viking-bot.d.ts +16 -1
- package/dist/components/viking-bot.js +4 -0
- package/dist/c~0.js +201 -0
- package/dist/file-preview-viewer~0.js +191 -0
- package/dist/f~0.js +356 -0
- package/dist/g~0.js +1207 -0
- package/dist/h~0.js +58 -0
- package/dist/icons/file-type-icon.d.ts +31 -0
- package/dist/icons/index.d.ts +33 -23
- package/dist/icons/nextjs-icon.d.ts +19 -0
- package/dist/icons.js +1 -25
- package/dist/index.d.ts +16 -2
- package/dist/index.js +8 -1
- package/dist/k~0.js +1440 -0
- package/dist/lk~0.js +233 -0
- package/dist/l~0.js +44 -0
- package/dist/modules/console/console.d.ts +4 -0
- package/dist/modules/console/index.d.ts +1 -0
- package/dist/modules/console/style.css +111 -0
- package/dist/modules/console/types.d.ts +101 -0
- package/dist/modules/console.js +1 -0
- package/dist/modules/file-browser/file-browser-toolbar-button.d.ts +10 -0
- package/dist/modules/file-browser/file-browser.d.ts +6 -0
- package/dist/modules/file-browser/index.d.ts +1 -0
- package/dist/modules/file-browser/style.css +158 -0
- package/dist/modules/file-browser/types.d.ts +101 -0
- package/dist/modules/file-browser.js +1 -0
- package/dist/modules/scope-cascade/controller.d.ts +6 -0
- package/dist/modules/scope-cascade/index.d.ts +3 -0
- package/dist/modules/scope-cascade/scope-cascade.d.ts +3 -0
- package/dist/modules/scope-cascade/style.css +456 -0
- package/dist/modules/scope-cascade/style.js +0 -0
- package/dist/modules/scope-cascade/types.d.ts +39 -0
- package/dist/modules/scope-cascade/use-scope-cascade.d.ts +5 -0
- package/dist/modules/scope-cascade.js +1 -0
- package/dist/modules/style.css +808 -0
- package/dist/modules/style.js +0 -0
- package/dist/n~0.js +727 -0
- package/dist/shared/components/tooltip/index.d.ts +1 -0
- package/dist/shared/components/tooltip/tooltip.d.ts +25 -0
- package/dist/shared/components/tooltip/types.d.ts +42 -0
- package/dist/shared/components/tooltip/use-tooltip-position.d.ts +38 -0
- package/dist/style.css +15138 -18
- package/dist/u~0.js +1601 -0
- package/dist/viking-bot-composer~0.js +164 -0
- package/dist/viking-bot-interaction~0.js +284 -0
- package/dist/w~0.js +19 -0
- package/package.json +46 -22
- package/dist/components/resource-import/resource-import.d.ts +0 -1
- package/dist/components/resource-import/style.css +0 -2
- package/dist/components/status-badge/status-badge.d.ts +0 -8
- package/dist/components/status-badge/style.css +0 -37
- package/dist/components/status-badge.js +0 -30
- /package/dist/components/{resource-import → viking-bot/interaction}/style.js +0 -0
- /package/dist/{components/status-badge → modules/console}/style.js +0 -0
- /package/dist/{components/resource-import.js → modules/file-browser/style.js} +0 -0
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { TuiCommandDefinition, TuiCommandGroup } from './command-catalog.js';
|
|
3
|
+
/**
|
|
4
|
+
* 一条执行记录的状态。
|
|
5
|
+
* Status of one execution record.
|
|
6
|
+
*/
|
|
7
|
+
export type TuiRecordStatus =
|
|
8
|
+
/**
|
|
9
|
+
* 执行中。
|
|
10
|
+
* Still running.
|
|
11
|
+
*/
|
|
12
|
+
'pending'
|
|
13
|
+
/**
|
|
14
|
+
* 执行成功。
|
|
15
|
+
* Finished successfully.
|
|
16
|
+
*/
|
|
17
|
+
| 'success'
|
|
18
|
+
/**
|
|
19
|
+
* 执行失败。
|
|
20
|
+
* Finished with an error.
|
|
21
|
+
*/
|
|
22
|
+
| 'error';
|
|
23
|
+
/** 检索结果卡片中的一行。One row of a search result card. */
|
|
24
|
+
export interface TuiSearchResultItem {
|
|
25
|
+
/**
|
|
26
|
+
* 行唯一标识。
|
|
27
|
+
* Unique row key.
|
|
28
|
+
*/
|
|
29
|
+
id: string;
|
|
30
|
+
/**
|
|
31
|
+
* 主标题。
|
|
32
|
+
* Primary title.
|
|
33
|
+
*/
|
|
34
|
+
title: string;
|
|
35
|
+
/**
|
|
36
|
+
* 次要标签,例如路径或文件类型。
|
|
37
|
+
* Secondary label, for example a path or file type.
|
|
38
|
+
*/
|
|
39
|
+
metaLabel?: string;
|
|
40
|
+
/**
|
|
41
|
+
* 标题旁的内容层级标签。
|
|
42
|
+
* Content level label next to the title.
|
|
43
|
+
*/
|
|
44
|
+
levelLabel?: string;
|
|
45
|
+
/**
|
|
46
|
+
* 分数旁的结果类型标签。
|
|
47
|
+
* Result type label next to the score.
|
|
48
|
+
*/
|
|
49
|
+
typeLabel?: string;
|
|
50
|
+
/**
|
|
51
|
+
* 宿主计算出的分数,显示在右侧。
|
|
52
|
+
* Score rendered on the right when the host computes one.
|
|
53
|
+
*/
|
|
54
|
+
scoreLabel?: string;
|
|
55
|
+
/**
|
|
56
|
+
* 悬停或键盘聚焦分数时展示的详情;仅在提供 `scoreLabel` 时显示。
|
|
57
|
+
* Details shown on score hover or keyboard focus; requires `scoreLabel`.
|
|
58
|
+
*/
|
|
59
|
+
scoreDetails?: ReactNode;
|
|
60
|
+
/**
|
|
61
|
+
* 标题下方的摘录。
|
|
62
|
+
* Short excerpt shown under the title.
|
|
63
|
+
*/
|
|
64
|
+
preview?: string;
|
|
65
|
+
/**
|
|
66
|
+
* 该结果对应的资源 URI,可用于打开。
|
|
67
|
+
* URI of the result, which can be opened.
|
|
68
|
+
*/
|
|
69
|
+
uri?: string;
|
|
70
|
+
}
|
|
71
|
+
/** 资源树行内的一条键值明细。One key/value detail row inside a resource tree item. */
|
|
72
|
+
export interface TuiResourceTreeDetailRow {
|
|
73
|
+
/**
|
|
74
|
+
* 明细标签。
|
|
75
|
+
* Detail label.
|
|
76
|
+
*/
|
|
77
|
+
label: string;
|
|
78
|
+
/**
|
|
79
|
+
* 明细值。
|
|
80
|
+
* Detail value.
|
|
81
|
+
*/
|
|
82
|
+
value: string;
|
|
83
|
+
}
|
|
84
|
+
/** 资源树结果卡片中的一行。One row of a resource tree card. */
|
|
85
|
+
export interface TuiResourceTreeItem {
|
|
86
|
+
/**
|
|
87
|
+
* 行唯一标识。
|
|
88
|
+
* Unique row key.
|
|
89
|
+
*/
|
|
90
|
+
id: string;
|
|
91
|
+
/**
|
|
92
|
+
* 主标题。
|
|
93
|
+
* Primary title.
|
|
94
|
+
*/
|
|
95
|
+
title: string;
|
|
96
|
+
/**
|
|
97
|
+
* 次要标签。
|
|
98
|
+
* Secondary label.
|
|
99
|
+
*/
|
|
100
|
+
metaLabel?: string;
|
|
101
|
+
/**
|
|
102
|
+
* 行内展示的键值明细。
|
|
103
|
+
* Key/value rows shown inside the item.
|
|
104
|
+
*/
|
|
105
|
+
detailRows?: readonly TuiResourceTreeDetailRow[];
|
|
106
|
+
/**
|
|
107
|
+
* 该资源对应的 URI,可用于打开。
|
|
108
|
+
* URI of the resource, which can be opened.
|
|
109
|
+
*/
|
|
110
|
+
uri?: string;
|
|
111
|
+
}
|
|
112
|
+
/** 状态卡片中的一行键值。One key/value row of a status card. */
|
|
113
|
+
export interface TuiStatusRow {
|
|
114
|
+
/**
|
|
115
|
+
* 行标签。
|
|
116
|
+
* Row label.
|
|
117
|
+
*/
|
|
118
|
+
label: string;
|
|
119
|
+
/**
|
|
120
|
+
* 行内容,由宿主渲染。
|
|
121
|
+
* Row content, rendered by the host.
|
|
122
|
+
*/
|
|
123
|
+
value: ReactNode;
|
|
124
|
+
/**
|
|
125
|
+
* 展示形态:单行、长文本或多行等宽文本。
|
|
126
|
+
* Display form: inline, long text or preformatted text.
|
|
127
|
+
*/
|
|
128
|
+
variant?:
|
|
129
|
+
/**
|
|
130
|
+
* 单行展示。
|
|
131
|
+
* Rendered on a single line.
|
|
132
|
+
*/
|
|
133
|
+
'inline'
|
|
134
|
+
/**
|
|
135
|
+
* 长文本,自动换行。
|
|
136
|
+
* Long text that wraps.
|
|
137
|
+
*/
|
|
138
|
+
| 'long-text'
|
|
139
|
+
/**
|
|
140
|
+
* 多行等宽文本。
|
|
141
|
+
* Multi-line preformatted text.
|
|
142
|
+
*/
|
|
143
|
+
| 'pre';
|
|
144
|
+
}
|
|
145
|
+
/** 通用文本结果。A general text result. */
|
|
146
|
+
export interface TuiTextContent {
|
|
147
|
+
/**
|
|
148
|
+
* 变体标记,固定为 `text`。
|
|
149
|
+
* Variant discriminator, always `text`.
|
|
150
|
+
*/
|
|
151
|
+
variant: 'text';
|
|
152
|
+
/**
|
|
153
|
+
* 文本正文。
|
|
154
|
+
* Text body.
|
|
155
|
+
*/
|
|
156
|
+
text: string;
|
|
157
|
+
/**
|
|
158
|
+
* 文本格式,缺省为 `plain`。
|
|
159
|
+
* Text format; defaults to `plain`.
|
|
160
|
+
*/
|
|
161
|
+
format?: 'plain' | 'markdown';
|
|
162
|
+
}
|
|
163
|
+
/** 检索结果列表。A list of search results. */
|
|
164
|
+
export interface TuiSearchListContent {
|
|
165
|
+
/**
|
|
166
|
+
* 变体标记,固定为 `search-list`。
|
|
167
|
+
* Variant discriminator, always `search-list`.
|
|
168
|
+
*/
|
|
169
|
+
variant: 'search-list';
|
|
170
|
+
/**
|
|
171
|
+
* 结果行。
|
|
172
|
+
* Result rows.
|
|
173
|
+
*/
|
|
174
|
+
items: readonly TuiSearchResultItem[];
|
|
175
|
+
/**
|
|
176
|
+
* 列表上方的汇总信息,由宿主渲染。
|
|
177
|
+
* Summary above the list, rendered by the host.
|
|
178
|
+
*/
|
|
179
|
+
summary?: ReactNode;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* 单个资源的预览结果,例如读取一个文件。
|
|
183
|
+
*
|
|
184
|
+
* A preview of one resource, for example reading a file.
|
|
185
|
+
*/
|
|
186
|
+
export interface TuiResourcePreviewContent {
|
|
187
|
+
/**
|
|
188
|
+
* 变体标记,固定为 `resource-preview`。
|
|
189
|
+
* Variant discriminator, always `resource-preview`.
|
|
190
|
+
*/
|
|
191
|
+
variant: 'resource-preview';
|
|
192
|
+
/**
|
|
193
|
+
* 资源标题。
|
|
194
|
+
* Resource title.
|
|
195
|
+
*/
|
|
196
|
+
title: string;
|
|
197
|
+
/**
|
|
198
|
+
* 正文,通常是文件内容。
|
|
199
|
+
* Body, usually the file content.
|
|
200
|
+
*/
|
|
201
|
+
content: string;
|
|
202
|
+
/**
|
|
203
|
+
* 标题下方的元信息,例如类型与大小,按顺序以分隔符连接展示。
|
|
204
|
+
* Metadata under the title, for example type and size, joined in order.
|
|
205
|
+
*/
|
|
206
|
+
meta?: readonly string[];
|
|
207
|
+
/**
|
|
208
|
+
* 没有 `meta` 时使用的单行说明。
|
|
209
|
+
* Single-line description used when `meta` is absent.
|
|
210
|
+
*/
|
|
211
|
+
description?: string;
|
|
212
|
+
/**
|
|
213
|
+
* 资源自身的 URI,显示为可点击入口。
|
|
214
|
+
* The resource's own URI, rendered as an openable entry.
|
|
215
|
+
*/
|
|
216
|
+
uri?: string;
|
|
217
|
+
/**
|
|
218
|
+
* 点击 URI 时跳转到的位置;省略时使用 `uri`。
|
|
219
|
+
* Where clicking the URI navigates to; `uri` is used when omitted.
|
|
220
|
+
*/
|
|
221
|
+
navigationUri?: string;
|
|
222
|
+
}
|
|
223
|
+
/** 资源树结果。A resource tree result. */
|
|
224
|
+
export interface TuiResourceTreeContent {
|
|
225
|
+
/**
|
|
226
|
+
* 变体标记,固定为 `resource-tree`。
|
|
227
|
+
* Variant discriminator, always `resource-tree`.
|
|
228
|
+
*/
|
|
229
|
+
variant: 'resource-tree';
|
|
230
|
+
/**
|
|
231
|
+
* 资源行。
|
|
232
|
+
* Resource rows.
|
|
233
|
+
*/
|
|
234
|
+
items: readonly TuiResourceTreeItem[];
|
|
235
|
+
/**
|
|
236
|
+
* 卡片标题。
|
|
237
|
+
* Card title.
|
|
238
|
+
*/
|
|
239
|
+
title?: string;
|
|
240
|
+
}
|
|
241
|
+
/** 状态卡片。A status card. */
|
|
242
|
+
export interface TuiStatusContent {
|
|
243
|
+
/**
|
|
244
|
+
* 变体标记,固定为 `status`。
|
|
245
|
+
* Variant discriminator, always `status`.
|
|
246
|
+
*/
|
|
247
|
+
variant: 'status';
|
|
248
|
+
/**
|
|
249
|
+
* 键值行。
|
|
250
|
+
* Key/value rows.
|
|
251
|
+
*/
|
|
252
|
+
rows: readonly TuiStatusRow[];
|
|
253
|
+
/**
|
|
254
|
+
* 卡片标题。
|
|
255
|
+
* Card title.
|
|
256
|
+
*/
|
|
257
|
+
title?: string;
|
|
258
|
+
}
|
|
259
|
+
/** 写入结果。A write result. */
|
|
260
|
+
export interface TuiWriteResultContent {
|
|
261
|
+
/**
|
|
262
|
+
* 变体标记,固定为 `write-result`。
|
|
263
|
+
* Variant discriminator, always `write-result`.
|
|
264
|
+
*/
|
|
265
|
+
variant: 'write-result';
|
|
266
|
+
/**
|
|
267
|
+
* 结果行,由宿主渲染。
|
|
268
|
+
* Result lines, rendered by the host.
|
|
269
|
+
*/
|
|
270
|
+
lines: readonly ReactNode[];
|
|
271
|
+
/**
|
|
272
|
+
* 卡片标题。
|
|
273
|
+
* Card title.
|
|
274
|
+
*/
|
|
275
|
+
title?: string;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* 命令帮助结果:按分组列出可用命令。
|
|
279
|
+
*
|
|
280
|
+
* A command-help result: available commands listed in groups.
|
|
281
|
+
*/
|
|
282
|
+
export interface TuiCommandHelpContent {
|
|
283
|
+
/**
|
|
284
|
+
* 变体标记,固定为 `command-help`。
|
|
285
|
+
* Variant discriminator, always `command-help`.
|
|
286
|
+
*/
|
|
287
|
+
variant: 'command-help';
|
|
288
|
+
/**
|
|
289
|
+
* 命令分组。
|
|
290
|
+
* Command groups.
|
|
291
|
+
*/
|
|
292
|
+
sections: readonly TuiCommandHelpSection[];
|
|
293
|
+
}
|
|
294
|
+
/** 命令帮助中的一组命令。One group of commands in the help result. */
|
|
295
|
+
export interface TuiCommandHelpSection {
|
|
296
|
+
/**
|
|
297
|
+
* 分组唯一标识。
|
|
298
|
+
* Unique section key.
|
|
299
|
+
*/
|
|
300
|
+
key: string;
|
|
301
|
+
/**
|
|
302
|
+
* 分组标题。
|
|
303
|
+
* Section title.
|
|
304
|
+
*/
|
|
305
|
+
label: string;
|
|
306
|
+
/**
|
|
307
|
+
* 该组下的命令。
|
|
308
|
+
* Commands in this group.
|
|
309
|
+
*/
|
|
310
|
+
items: readonly TuiCommandHelpItem[];
|
|
311
|
+
}
|
|
312
|
+
/** 命令帮助中的一条命令。One command in the help result. */
|
|
313
|
+
export interface TuiCommandHelpItem {
|
|
314
|
+
/**
|
|
315
|
+
* 命令唯一标识。
|
|
316
|
+
* Unique command key.
|
|
317
|
+
*/
|
|
318
|
+
key: string;
|
|
319
|
+
/**
|
|
320
|
+
* 用于显示和填入的命令文本。
|
|
321
|
+
* Command text used for display and insertion.
|
|
322
|
+
*/
|
|
323
|
+
name: string;
|
|
324
|
+
/**
|
|
325
|
+
* 命令说明。
|
|
326
|
+
* Command description.
|
|
327
|
+
*/
|
|
328
|
+
description?: string;
|
|
329
|
+
}
|
|
330
|
+
/** 命令结果内容。Command result content. */
|
|
331
|
+
export type TuiRecordContent = TuiTextContent | TuiSearchListContent | TuiResourcePreviewContent | TuiResourceTreeContent | TuiStatusContent | TuiWriteResultContent | TuiCommandHelpContent;
|
|
332
|
+
/** 一条执行记录。One execution record. */
|
|
333
|
+
export interface TuiRecord {
|
|
334
|
+
/**
|
|
335
|
+
* 记录唯一标识。
|
|
336
|
+
* Unique record key.
|
|
337
|
+
*/
|
|
338
|
+
id: string;
|
|
339
|
+
/**
|
|
340
|
+
* 提交的命令文本,显示在结果上方。
|
|
341
|
+
* The submitted command text, echoed above the result.
|
|
342
|
+
*/
|
|
343
|
+
command: string;
|
|
344
|
+
/**
|
|
345
|
+
* 当前记录的执行状态;不控制其他命令的提交。
|
|
346
|
+
* Execution status of this record; does not control other submissions.
|
|
347
|
+
*/
|
|
348
|
+
status: TuiRecordStatus;
|
|
349
|
+
/**
|
|
350
|
+
* 执行结果,进行中时省略。
|
|
351
|
+
* Execution result, omitted while pending.
|
|
352
|
+
*/
|
|
353
|
+
content?: TuiRecordContent;
|
|
354
|
+
/**
|
|
355
|
+
* 未提供有效 createdAtMs 时使用的展示时间,不解析为日期。
|
|
356
|
+
* Display text used without a valid createdAtMs; never parsed as a date.
|
|
357
|
+
*/
|
|
358
|
+
createdAt?: string;
|
|
359
|
+
/**
|
|
360
|
+
* 发送时的 Unix 毫秒时间戳,优先在客户端格式化为相对时间或本地日期。
|
|
361
|
+
* Unix timestamp in milliseconds; preferred for relative time or local date display on the client.
|
|
362
|
+
*/
|
|
363
|
+
createdAtMs?: number;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* 可替换的界面文案,默认英文。
|
|
367
|
+
* Replaceable interface copy, defaulting to English.
|
|
368
|
+
*/
|
|
369
|
+
export interface TuiLabels {
|
|
370
|
+
/**
|
|
371
|
+
* 输入框占位文本。
|
|
372
|
+
* Input placeholder.
|
|
373
|
+
*/
|
|
374
|
+
placeholder?: string;
|
|
375
|
+
/**
|
|
376
|
+
* `disabled` 为 `true` 时展示的不可用提示;文案本身不控制禁用状态。
|
|
377
|
+
* Unavailable message shown when `disabled` is `true`; copy does not control
|
|
378
|
+
* the disabled state.
|
|
379
|
+
*/
|
|
380
|
+
unavailableMessage?: string;
|
|
381
|
+
/**
|
|
382
|
+
* 底部发送快捷键的说明文案。
|
|
383
|
+
* Label for the send keyboard shortcut.
|
|
384
|
+
*/
|
|
385
|
+
send?: string;
|
|
386
|
+
/** 全部指令快捷键说明。Label for the all-commands shortcut. */
|
|
387
|
+
allCommands?: string;
|
|
388
|
+
/** 历史指令快捷键说明。Label for recalling commands from the current records. */
|
|
389
|
+
historyCommands?: string;
|
|
390
|
+
/**
|
|
391
|
+
* 建议列表的无障碍名称。
|
|
392
|
+
* Accessible name of the suggestion list.
|
|
393
|
+
*/
|
|
394
|
+
suggestions?: string;
|
|
395
|
+
/**
|
|
396
|
+
* 无匹配建议时的提示。
|
|
397
|
+
* Message shown when no suggestion matches.
|
|
398
|
+
*/
|
|
399
|
+
noSuggestions?: string;
|
|
400
|
+
/**
|
|
401
|
+
* 等待中的状态文本。
|
|
402
|
+
* Text for the pending state.
|
|
403
|
+
*/
|
|
404
|
+
pending?: string;
|
|
405
|
+
/**
|
|
406
|
+
* 执行成功状态文本。
|
|
407
|
+
* Text for the success status.
|
|
408
|
+
*/
|
|
409
|
+
success?: string;
|
|
410
|
+
/**
|
|
411
|
+
* 执行失败状态文本。
|
|
412
|
+
* Text for the error status.
|
|
413
|
+
*/
|
|
414
|
+
error?: string;
|
|
415
|
+
/**
|
|
416
|
+
* 复制按钮文案。
|
|
417
|
+
* Copy button label.
|
|
418
|
+
*/
|
|
419
|
+
copy?: string;
|
|
420
|
+
/**
|
|
421
|
+
* 复制成功提示。
|
|
422
|
+
* Message shown after a successful copy.
|
|
423
|
+
*/
|
|
424
|
+
copied?: string;
|
|
425
|
+
/**
|
|
426
|
+
* 无记录时的提示。
|
|
427
|
+
* Message shown when there are no records.
|
|
428
|
+
*/
|
|
429
|
+
empty?: string;
|
|
430
|
+
/** 无返回结果时的提示。Message for an empty command result. */
|
|
431
|
+
noResult?: string;
|
|
432
|
+
/** 刚刚发送的时间文案。Time label for a just-sent record. */
|
|
433
|
+
justNow?: string;
|
|
434
|
+
/** 命令帮助的标题与操作提示。Command-help heading and hint. */
|
|
435
|
+
availableCommands?: string;
|
|
436
|
+
helpHint?: string;
|
|
437
|
+
/** 参数帮助标题、示例与空参数提示。Parameter help headings and empty copy. */
|
|
438
|
+
parameters?: string;
|
|
439
|
+
examples?: string;
|
|
440
|
+
noParameters?: string;
|
|
441
|
+
/** 参数表列名与必填值。Parameter columns and required values. */
|
|
442
|
+
parameter?: string;
|
|
443
|
+
required?: string;
|
|
444
|
+
description?: string;
|
|
445
|
+
defaultValue?: string;
|
|
446
|
+
yes?: string;
|
|
447
|
+
no?: string;
|
|
448
|
+
/** 资源列表分页。Resource list pagination. */
|
|
449
|
+
loadMore?: string;
|
|
450
|
+
/** 资源表格的名称列。Resource identity column heading. */
|
|
451
|
+
resource?: string;
|
|
452
|
+
/** 格式化已过去的整分钟。Formats elapsed whole minutes. */
|
|
453
|
+
formatMinutesAgo?: (minutes: number) => string;
|
|
454
|
+
/** 格式化已过去的整小时。Formats elapsed whole hours. */
|
|
455
|
+
formatHoursAgo?: (hours: number) => string;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* 当前命令记录、结果与输入区的公开接口;会话、历史面板和外层工具栏由宿主组合。
|
|
459
|
+
* 提供命令补全、参数提示与帮助。
|
|
460
|
+
* Public interface for current command records, results and input. The host
|
|
461
|
+
* composes session controls, history panels and surrounding toolbars separately.
|
|
462
|
+
* Provides command completion, parameter hints and help.
|
|
463
|
+
*/
|
|
464
|
+
export interface TuiProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onCopy' | 'onSubmit'> {
|
|
465
|
+
/**
|
|
466
|
+
* 当前展示的执行记录,按提交顺序排列;会话与历史切换后由宿主更新。
|
|
467
|
+
* Currently displayed execution records in submission order, updated by the
|
|
468
|
+
* host when switching sessions or historical results.
|
|
469
|
+
*/
|
|
470
|
+
records: readonly TuiRecord[];
|
|
471
|
+
/**
|
|
472
|
+
* 受控的输入值。
|
|
473
|
+
* Controlled input value.
|
|
474
|
+
*/
|
|
475
|
+
value: string;
|
|
476
|
+
/**
|
|
477
|
+
* 是否禁用命令输入与提交,缺省为 `false`。
|
|
478
|
+
* 禁用时的提示文案由 `labels.unavailableMessage` 提供。
|
|
479
|
+
* Whether command input and submission are disabled; defaults to `false`.
|
|
480
|
+
* Disabled copy comes from `labels.unavailableMessage`.
|
|
481
|
+
*/
|
|
482
|
+
disabled?: boolean;
|
|
483
|
+
/**
|
|
484
|
+
* 无记录时展示的完整空态节点,可包含标题、说明与快捷入口。
|
|
485
|
+
* 省略时展示 `labels.empty`,传 `null` 时隐藏空态内容。
|
|
486
|
+
* Complete empty-state node when there are no records; may include a
|
|
487
|
+
* heading, description and shortcuts. Omission shows `labels.empty`;
|
|
488
|
+
* passing `null` hides empty-state content.
|
|
489
|
+
*/
|
|
490
|
+
emptyState?: ReactNode;
|
|
491
|
+
/** 内置界面文案的语言,默认英文;命令文案由宿主提供。 */
|
|
492
|
+
locale?: 'en' | 'zh';
|
|
493
|
+
/** 宿主提供的命令目录;省略时无候选和参数帮助,仍可提交文本。 */
|
|
494
|
+
commands?: readonly TuiCommandDefinition[];
|
|
495
|
+
/** 宿主提供的分组名称与顺序;未声明的组按目录顺序追加。 */
|
|
496
|
+
commandGroups?: readonly TuiCommandGroup[];
|
|
497
|
+
/**
|
|
498
|
+
* 输入值变化时触发,包括接受命令或示例;行内占位不改变值,也不提交。省略时输入框
|
|
499
|
+
* 只读,用于展示历史记录。
|
|
500
|
+
* Invoked when the input changes, including accepted commands and examples; filling the input does not submit a command. Omission makes the input
|
|
501
|
+
* read-only, for showing history.
|
|
502
|
+
*/
|
|
503
|
+
onValueChange?: (value: string) => void;
|
|
504
|
+
/**
|
|
505
|
+
* 用户显式提交时上报命令意图,宿主负责请求、权限和执行,并通过 records 回填状态。
|
|
506
|
+
* Reports an explicit submission intent. The host owns requests, permissions
|
|
507
|
+
* and execution, and supplies subsequent status through records. Omission disables submission.
|
|
508
|
+
*/
|
|
509
|
+
onSubmit?: (command: string) => void;
|
|
510
|
+
/**
|
|
511
|
+
* 点击资源 URI 时触发,由宿主接管打开;覆盖输入区、命令记录和结果中的链接。
|
|
512
|
+
* Called when a resource URI is activated in the input, command echo or results;
|
|
513
|
+
* the host owns navigation. Without a handler, text links use their native href.
|
|
514
|
+
*/
|
|
515
|
+
onOpenUri?: (uri: string) => void;
|
|
516
|
+
/**
|
|
517
|
+
* 复制成功后触发,参数为已复制的文本;复制失败时不触发。
|
|
518
|
+
* Called after copying succeeds, with the copied text; not called on failure.
|
|
519
|
+
*/
|
|
520
|
+
onCopy?: (text: string) => void;
|
|
521
|
+
/**
|
|
522
|
+
* 统一的界面文案与引导提示;仅替换展示内容,不改变可用性。
|
|
523
|
+
* Interface copy and guidance; replaces display content without changing
|
|
524
|
+
* availability.
|
|
525
|
+
*/
|
|
526
|
+
labels?: TuiLabels;
|
|
527
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TuiCommandDefinition, TuiCommandGroup } from './command-catalog.js';
|
|
2
|
+
import type { TuiCommandInputMatch } from './command-input.js';
|
|
3
|
+
import type { TuiCommandQuery } from './command-completion.js';
|
|
4
|
+
import type { TuiCommandSection } from './command-definitions.js';
|
|
5
|
+
export interface TuiCompletion {
|
|
6
|
+
query: TuiCommandQuery;
|
|
7
|
+
suggestions: readonly TuiCommandSection[];
|
|
8
|
+
options: readonly TuiCommandDefinition[];
|
|
9
|
+
activeInput: TuiCommandInputMatch | undefined;
|
|
10
|
+
showSuggestions: boolean;
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** 由受控输入和宿主目录推导补全,无取数、执行或状态镜像。 */
|
|
14
|
+
export declare function useTuiCompletion(value: string, enabled: boolean, commands: readonly TuiCommandDefinition[], groups?: readonly TuiCommandGroup[], paletteScope?: string | null): TuiCompletion;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { KeyboardEvent, RefObject } from 'react';
|
|
2
|
+
import type { TuiInlineCompletion } from './command-completion.js';
|
|
3
|
+
import type { TuiCompletion } from './use-tui-completion.js';
|
|
4
|
+
interface KeyboardOptions {
|
|
5
|
+
inputRef: RefObject<HTMLTextAreaElement | null>;
|
|
6
|
+
value: string;
|
|
7
|
+
history: readonly string[];
|
|
8
|
+
completion: TuiCompletion;
|
|
9
|
+
inline: TuiInlineCompletion | undefined;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
readOnly: boolean;
|
|
12
|
+
canSubmit: boolean;
|
|
13
|
+
activeIndex: number;
|
|
14
|
+
onActiveIndexChange: (index: number | ((current: number) => number)) => void;
|
|
15
|
+
onValueChange?: (value: string) => void;
|
|
16
|
+
onSubmit?: (command: string) => void;
|
|
17
|
+
onDismiss: (value: string) => void;
|
|
18
|
+
onRequestPalette: () => void;
|
|
19
|
+
}
|
|
20
|
+
/** 编辑、补全和历史互斥处理;普通 Tab 留在编辑器,Shift+Tab 可移出。 */
|
|
21
|
+
export declare function useTuiComposerKeyboard({ inputRef, value, history, completion, inline, disabled, readOnly, canSubmit, activeIndex, onActiveIndexChange, onValueChange, onSubmit, onDismiss, onRequestPalette, }: KeyboardOptions): {
|
|
22
|
+
change: (next: string) => void;
|
|
23
|
+
handleKeyDown: (event: KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
package/dist/components/tui.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tui } from "../3~0.js";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ActivityTimelineItem } from '@ark-design/ui/activity-timeline';
|
|
2
|
+
import type { VikingBotMessage, VikingBotMessagePart, VikingBotStreamingState } from './model.js';
|
|
3
|
+
/**
|
|
4
|
+
* 把归一化片段映射成 Ark 的渲染输入。两种宿主的流事件在接入层就已经变成
|
|
5
|
+
* 这里的片段,因此映射只做形态转换,不再判断来源协议。
|
|
6
|
+
*
|
|
7
|
+
* Maps normalized parts onto Ark's render inputs. Both hosts already turn their
|
|
8
|
+
* own stream events into these parts in their integration layer, so this only
|
|
9
|
+
* converts shape and never inspects a source protocol.
|
|
10
|
+
*/
|
|
11
|
+
/** 消息渲染单元的标识,供 Ark 列表做 key 与测量。 */
|
|
12
|
+
export interface VikingBotRenderItem {
|
|
13
|
+
/** 唯一标识。Stable key. */
|
|
14
|
+
id: string;
|
|
15
|
+
/** 来源消息;流式单元没有对应消息。Source message; the streaming unit has none. */
|
|
16
|
+
message?: VikingBotMessage;
|
|
17
|
+
/** 助手仍在生成时追加的片段。Parts appended while streaming. */
|
|
18
|
+
streaming?: VikingBotStreamingState;
|
|
19
|
+
}
|
|
20
|
+
/** 一轮回复的时间线条目,由推理与工具片段聚合而来。 */
|
|
21
|
+
export interface VikingBotActivityGroup {
|
|
22
|
+
/** 执行块标识。Activity block key. */
|
|
23
|
+
id: string;
|
|
24
|
+
/** 条目。Items. */
|
|
25
|
+
items: ActivityTimelineItem[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 把片段聚合成执行块:带 `groupId` 的相邻推理与工具片段归为一组,
|
|
29
|
+
* 其余片段原样保留,由调用方按类型分别渲染。
|
|
30
|
+
*/
|
|
31
|
+
export declare function groupActivityParts(parts: readonly VikingBotMessagePart[]): {
|
|
32
|
+
groups: Map<string, VikingBotActivityGroup>;
|
|
33
|
+
order: string[];
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* 把消息列表展平成 Ark 列表的渲染单元,流式片段插到 `insertIndex` 指定位置。
|
|
37
|
+
*
|
|
38
|
+
* 插入位置在原始消息序列上确定:调用方先按原始下标切分,再分别合并两侧,
|
|
39
|
+
* 避免先合并再适配导致下标含义改变、把边界两侧的助手消息并到一起。
|
|
40
|
+
*
|
|
41
|
+
* Flattens the messages into Ark render items, inserting the streaming unit at
|
|
42
|
+
* `insertIndex`. The boundary is resolved against the original sequence so
|
|
43
|
+
* merging on either side cannot shift its meaning.
|
|
44
|
+
*/
|
|
45
|
+
export declare function toRenderItems(messages: readonly VikingBotMessage[], streaming?: VikingBotStreamingState, group?: (messages: readonly VikingBotMessage[]) => VikingBotMessage[]): VikingBotRenderItem[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { VikingBotMessage } from './model.js';
|
|
2
|
+
import type { VikingBotMessageListProps } from './types.js';
|
|
3
|
+
type Labels = NonNullable<VikingBotMessageListProps['labels']>;
|
|
4
|
+
/** Markdown 或纯文本正文。A Markdown or plain-text body. */
|
|
5
|
+
export declare function MessageText({ text, streaming, format, }: {
|
|
6
|
+
text: string;
|
|
7
|
+
streaming?: boolean;
|
|
8
|
+
format?: 'plain' | 'markdown';
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
/** 消息正文:执行块在前,其余片段按顺序渲染。 */
|
|
11
|
+
export declare function MessageBody({ message, labels, onOpenUri, }: {
|
|
12
|
+
message: VikingBotMessage;
|
|
13
|
+
labels: Labels;
|
|
14
|
+
onOpenUri?: (uri: string) => void;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { VikingBotMessageListProps } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Ark 渲染的消息列表。只在懒加载边界之后加载,因此可以静态引用 Ark。
|
|
4
|
+
* The Ark-rendered message list. Loaded behind the lazy boundary, so it may
|
|
5
|
+
* import Ark statically.
|
|
6
|
+
*/
|
|
7
|
+
export declare function VikingBotMessageListView({ messages, className, streaming, footer, listKey, onOpenUri, onCopy, onMessageAction, renderMessage, labels: overrides, }: VikingBotMessageListProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { VikingBotMessage, VikingBotStreamingState } from './model.js';
|
|
2
|
+
import type { VikingBotMessageListProps } from './types.js';
|
|
3
|
+
type Labels = NonNullable<VikingBotMessageListProps['labels']>;
|
|
4
|
+
/** 单条消息。One message. */
|
|
5
|
+
export declare function VikingBotMessageRow({ message, labels, onOpenUri, onCopy, onMessageAction, renderMessage, }: {
|
|
6
|
+
message: VikingBotMessage;
|
|
7
|
+
labels: Labels;
|
|
8
|
+
onOpenUri?: (uri: string) => void;
|
|
9
|
+
onCopy?: (text: string) => void;
|
|
10
|
+
onMessageAction?: (messageId: string, actionKey: string) => void;
|
|
11
|
+
renderMessage?: (message: VikingBotMessage) => React.ReactNode;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
/** 助手仍在生成时的单元。The in-flight assistant unit. */
|
|
14
|
+
export declare function VikingBotStreamingRow({ streaming, labels, onOpenUri, }: {
|
|
15
|
+
streaming: VikingBotStreamingState;
|
|
16
|
+
labels: Labels;
|
|
17
|
+
onOpenUri?: (uri: string) => void;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { VikingBot } from './viking-bot.js';
|
|
2
|
+
export { VikingBotComposer } from './lazy-composer.js';
|
|
3
|
+
export { VikingBotMessageList } from './viking-bot-message-list.js';
|
|
4
|
+
export { VikingBotInteraction, DEFAULT_INTERACTION_LABELS, } from './interaction/index.js';
|
|
5
|
+
export type { InteractionLabels } from './interaction/index.js';
|
|
6
|
+
export { DEFAULT_LABELS } from './labels.js';
|
|
7
|
+
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';
|
|
9
|
+
export type { VikingBotComposerProps, VikingBotComposerRef, VikingBotMessageListProps, VikingBotProps, } from './types.js';
|
|
10
|
+
export type { VikingBotInteractionAnswer, VikingBotInteractionLabels, VikingBotInteractionOption, VikingBotInteractionProps, VikingBotInteractionRenderContext, VikingBotInteractionRequest, VikingBotRepairOption, VikingBotScheduleValue, } from './interaction/types.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AskHumanField, AskHumanValue } from '@ark-design/ui/ask-human';
|
|
2
|
+
import type { VikingBotInteractionAnswer, VikingBotInteractionRequest } from './types.js';
|
|
3
|
+
/** 把请求转成 AskHuman 的字段描述。 */
|
|
4
|
+
export declare const toFields: (request: VikingBotInteractionRequest) => AskHumanField[];
|
|
5
|
+
/** 把 AskHuman 的提交值转回交互答案。 */
|
|
6
|
+
export declare const toAnswer: (request: VikingBotInteractionRequest, value: AskHumanValue) => VikingBotInteractionAnswer;
|
|
7
|
+
/** 按 request 计算 AskHuman 的初始答案,保证预填值与提交值一致。 */
|
|
8
|
+
export declare const toDefaultValue: (request: VikingBotInteractionRequest) => AskHumanValue | undefined;
|
|
9
|
+
/** 选择类问题必须选中有效选项;其他类型按自身初始值即可提交。 */
|
|
10
|
+
export declare const isValidAnswer: (request: VikingBotInteractionRequest, value: AskHumanValue) => boolean;
|