@openviking/react 0.1.1 → 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 +18 -15
- package/dist/3~0.js +2113 -4
- package/dist/ark-message-list-view~0.js +310 -0
- package/dist/c7~0.js +24 -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 +3 -3
- 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/style.css +495 -6
- package/dist/components/agent-connect/types.d.ts +20 -166
- package/dist/components/file-preview/file-preview-adapters.d.ts +33 -0
- package/dist/components/file-preview/file-preview-body.d.ts +24 -12
- 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 +23 -14
- package/dist/components/file-preview/file-preview-labels.d.ts +15 -4
- 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 +8 -11
- package/dist/components/file-preview/style.css +3984 -128
- package/dist/components/file-preview/types.d.ts +250 -169
- 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 +21 -2
- package/dist/components/file-preview/use-file-preview-ids.d.ts +24 -0
- package/dist/components/file-preview.js +1 -442
- package/dist/components/file-tree/file-tree-body.d.ts +8 -4
- package/dist/components/file-tree/file-tree-entry-row.d.ts +9 -3
- package/dist/components/file-tree/file-tree-icons.d.ts +12 -5
- 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 +8 -4
- package/dist/components/file-tree/file-tree-row-context.d.ts +31 -9
- 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 +9 -3
- package/dist/components/file-tree/file-tree.d.ts +12 -1
- package/dist/components/file-tree/style.css +225 -57
- package/dist/components/file-tree/types.d.ts +183 -0
- package/dist/components/file-tree/use-file-tree-actions.d.ts +7 -0
- package/dist/components/file-tree.js +1 -1
- package/dist/components/scope-switcher/scope-panel.d.ts +9 -3
- package/dist/components/scope-switcher/scope-selector.d.ts +1 -1
- package/dist/components/scope-switcher/scope-switcher.d.ts +1 -1
- package/dist/components/scope-switcher/style.css +282 -76
- package/dist/components/scope-switcher/types.d.ts +230 -108
- package/dist/components/style.css +13845 -372
- 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/style.css +1543 -5
- 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 +10 -2
- package/dist/components/tui/types.d.ts +57 -15
- 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/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 +7135 -0
- package/dist/components/viking-bot/style.js +0 -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 -0
- 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 +149 -77
- 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 +2 -2
- package/dist/index.js +1 -1
- package/dist/k~0.js +1440 -0
- package/dist/lk~0.js +25 -12
- package/dist/modules/console/style.css +83 -1
- package/dist/modules/file-browser/style.css +89 -6
- package/dist/modules/scope-cascade/style.css +282 -76
- package/dist/modules/style.css +533 -110
- package/dist/n~0.js +434 -206
- 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 +14451 -474
- package/dist/u~0.js +1597 -4
- 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 +18 -10
- package/dist/components/file-preview/file-preview-icons.d.ts +0 -2
- package/dist/components/file-preview/file-preview-operations.d.ts +0 -1
- package/dist/components/file-tree/file-tree-dom.d.ts +0 -4
- package/dist/components/file-tree/file-tree-labels.d.ts +0 -5
- package/dist/components/file-tree/file-tree-rows.d.ts +0 -12
- package/dist/i~0.js +0 -21
- package/dist/modules/task-center/columns.d.ts +0 -129
- package/dist/modules/task-center/index.d.ts +0 -1
- package/dist/modules/task-center/style.css +0 -29
- package/dist/modules/task-center/task-center.d.ts +0 -4
- package/dist/modules/task-center/types.d.ts +0 -168
- package/dist/modules/task-center.js +0 -1
- /package/dist/{modules/task-center → components/viking-bot/interaction}/style.js +0 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
.ov-viking-bot__interaction {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
border-top: 1px solid var(--ov-viking-bot-border);
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
flex: none;
|
|
6
|
+
gap: 8px;
|
|
7
|
+
padding: 12px;
|
|
8
|
+
display: flex;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ov-viking-bot__interaction-header {
|
|
12
|
+
color: var(--ov-viking-bot-text-muted);
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: 8px;
|
|
16
|
+
font-size: 12px;
|
|
17
|
+
display: flex;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ov-viking-bot__interaction-title {
|
|
21
|
+
color: var(--ov-viking-bot-text);
|
|
22
|
+
font-weight: 500;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ov-viking-bot__interaction-progress {
|
|
26
|
+
font-variant-numeric: tabular-nums;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.ov-viking-bot__interaction-question {
|
|
30
|
+
margin: 0;
|
|
31
|
+
font-size: 13px;
|
|
32
|
+
line-height: 1.6;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ov-viking-bot__interaction-error {
|
|
36
|
+
color: var(--ov-viking-bot-danger);
|
|
37
|
+
margin: 0;
|
|
38
|
+
font-size: 12px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.ov-viking-bot__interaction-options {
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
gap: 4px;
|
|
44
|
+
margin: 0;
|
|
45
|
+
padding: 0;
|
|
46
|
+
list-style: none;
|
|
47
|
+
display: flex;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ov-viking-bot__interaction-option {
|
|
51
|
+
border-radius: var(--ov-viking-bot-radius);
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
align-items: center;
|
|
54
|
+
gap: 6px;
|
|
55
|
+
padding: 4px 6px;
|
|
56
|
+
display: flex;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ov-viking-bot__interaction-option:hover {
|
|
60
|
+
background: var(--ov-viking-bot-surface-hover);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ov-viking-bot__interaction-option:focus-within {
|
|
64
|
+
outline: 2px solid var(--ov-viking-bot-focus);
|
|
65
|
+
outline-offset: 1px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.ov-viking-bot__interaction {
|
|
69
|
+
--ov-viking-bot-radius: 6px;
|
|
70
|
+
--ov-viking-bot-text: var(--ov-ui-color-text-1, var(--ov-ui-text-1-default, #0b0b0f));
|
|
71
|
+
--ov-viking-bot-text-muted: var(--ov-ui-color-text-3, var(--ov-ui-text-3-default, #6e718c));
|
|
72
|
+
--ov-viking-bot-accent: var(--ov-ui-color-primary, var(--ov-ui-primary-default, #5252ff));
|
|
73
|
+
--ov-viking-bot-accent-hover: var(--ov-ui-color-primary-hover, var(--ov-ui-primary-hover-default, #7075ff));
|
|
74
|
+
--ov-viking-bot-on-accent: var(--ov-ui-color-bg-1, var(--ov-ui-bg-1-default, #fff));
|
|
75
|
+
--ov-viking-bot-border: var(--ov-ui-color-border-2, var(--ov-ui-border-2-default, #e1e4f2));
|
|
76
|
+
--ov-viking-bot-border-strong: var(--ov-ui-color-border-3, var(--ov-ui-border-3-default, #d7daea));
|
|
77
|
+
--ov-viking-bot-bg: var(--ov-ui-color-bg-1, var(--ov-ui-bg-1-default, #fff));
|
|
78
|
+
--ov-viking-bot-primary-light: var(--ov-ui-color-primary-light, var(--ov-ui-primary-light-default, #f5f7ff));
|
|
79
|
+
--ov-viking-bot-surface: var(--ov-ui-color-bg-4, var(--ov-ui-bg-4-default, #f6f7fa));
|
|
80
|
+
--ov-viking-bot-surface-hover: var(--ov-ui-color-bg-5, var(--ov-ui-bg-5-default, #f1f2f9));
|
|
81
|
+
--ov-viking-bot-focus: var(--ov-ui-color-focus, var(--ov-ui-focus-default, #5252ff));
|
|
82
|
+
--ov-viking-bot-danger: var(--ov-ui-color-status-error, var(--ov-ui-status-error-default, #c43838));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.ov-viking-bot__interaction-option input[type="radio"] {
|
|
86
|
+
box-sizing: border-box;
|
|
87
|
+
appearance: none;
|
|
88
|
+
border: 1px solid var(--ov-viking-bot-border-strong);
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
background: none;
|
|
91
|
+
border-radius: 50%;
|
|
92
|
+
flex: none;
|
|
93
|
+
width: 14px;
|
|
94
|
+
height: 14px;
|
|
95
|
+
margin: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.ov-viking-bot__interaction-option input[type="radio"]:checked {
|
|
99
|
+
border: 4px solid var(--ov-viking-bot-accent);
|
|
100
|
+
background: var(--ov-viking-bot-on-accent);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.ov-viking-bot__interaction-option input[type="radio"]:disabled {
|
|
104
|
+
cursor: not-allowed;
|
|
105
|
+
opacity: .5;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.ov-viking-bot__interaction-option small {
|
|
109
|
+
color: var(--ov-viking-bot-text-muted);
|
|
110
|
+
font-size: 11px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.ov-viking-bot__interaction-option code {
|
|
114
|
+
background: var(--ov-viking-bot-surface);
|
|
115
|
+
border-radius: 4px;
|
|
116
|
+
padding: 0 4px;
|
|
117
|
+
font-size: 11px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.ov-viking-bot__interaction-input {
|
|
121
|
+
box-sizing: border-box;
|
|
122
|
+
border: 1px solid var(--ov-viking-bot-border);
|
|
123
|
+
border-radius: var(--ov-viking-bot-radius);
|
|
124
|
+
width: 100%;
|
|
125
|
+
min-width: 0;
|
|
126
|
+
color: inherit;
|
|
127
|
+
font: inherit;
|
|
128
|
+
background: none;
|
|
129
|
+
padding: 6px 8px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.ov-viking-bot__interaction-input:focus-visible {
|
|
133
|
+
outline: 2px solid var(--ov-viking-bot-focus);
|
|
134
|
+
outline-offset: -1px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.ov-viking-bot__interaction-input:disabled {
|
|
138
|
+
background: var(--ov-viking-bot-surface);
|
|
139
|
+
color: var(--ov-viking-bot-text-muted);
|
|
140
|
+
cursor: not-allowed;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
textarea.ov-viking-bot__interaction-input {
|
|
144
|
+
resize: vertical;
|
|
145
|
+
min-height: 72px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.ov-viking-bot__interaction-hint {
|
|
149
|
+
color: var(--ov-viking-bot-text-muted);
|
|
150
|
+
font-size: 11px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.ov-viking-bot__interaction-submit, .ov-viking-bot__interaction-cancel {
|
|
154
|
+
border: 1px solid var(--ov-viking-bot-border);
|
|
155
|
+
border-radius: var(--ov-viking-bot-radius);
|
|
156
|
+
color: var(--ov-viking-bot-text);
|
|
157
|
+
font: inherit;
|
|
158
|
+
cursor: pointer;
|
|
159
|
+
background: none;
|
|
160
|
+
align-self: flex-start;
|
|
161
|
+
padding: 4px 14px;
|
|
162
|
+
font-size: 12px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.ov-viking-bot__interaction-submit {
|
|
166
|
+
border-color: var(--ov-viking-bot-accent);
|
|
167
|
+
background: var(--ov-viking-bot-accent);
|
|
168
|
+
color: var(--ov-viking-bot-on-accent);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.ov-viking-bot__interaction-submit:hover:not(:disabled) {
|
|
172
|
+
border-color: var(--ov-viking-bot-accent-hover);
|
|
173
|
+
background: var(--ov-viking-bot-accent-hover);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.ov-viking-bot__interaction-cancel:hover:not(:disabled) {
|
|
177
|
+
background: var(--ov-viking-bot-surface-hover);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.ov-viking-bot__interaction-submit:focus-visible, .ov-viking-bot__interaction-cancel:focus-visible {
|
|
181
|
+
outline: 2px solid var(--ov-viking-bot-focus);
|
|
182
|
+
outline-offset: 2px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.ov-viking-bot__interaction-submit:disabled, .ov-viking-bot__interaction-cancel:disabled {
|
|
186
|
+
opacity: .5;
|
|
187
|
+
cursor: not-allowed;
|
|
188
|
+
}
|
|
189
|
+
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/** 可选项。An option offered by a question. */
|
|
3
|
+
export interface VikingBotInteractionOption {
|
|
4
|
+
/** 选项值。Option value. */
|
|
5
|
+
value: string;
|
|
6
|
+
/** 选项主文案。Primary label. */
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
/** 选项下方的说明。Description shown under the label. */
|
|
9
|
+
description?: ReactNode;
|
|
10
|
+
/** 选项后附加的等宽片段,例如命令。Monospace snippet after the label. */
|
|
11
|
+
code?: string;
|
|
12
|
+
}
|
|
13
|
+
/** 定时值。A schedule value. */
|
|
14
|
+
export type VikingBotScheduleValue = {
|
|
15
|
+
/** 不启用。Disabled. */
|
|
16
|
+
mode: 'none';
|
|
17
|
+
} | {
|
|
18
|
+
/** 每天。Daily. */
|
|
19
|
+
mode: 'daily';
|
|
20
|
+
/** 时间,`HH:mm`。Time as `HH:mm`. */
|
|
21
|
+
time: string;
|
|
22
|
+
} | {
|
|
23
|
+
/** 每周。Weekly. */
|
|
24
|
+
mode: 'weekly';
|
|
25
|
+
/** 时间,`HH:mm`。Time as `HH:mm`. */
|
|
26
|
+
time: string;
|
|
27
|
+
/** 星期,1 为周一。Weekday, 1 is Monday. */
|
|
28
|
+
weekday: 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
29
|
+
};
|
|
30
|
+
/** 修复候选。A repair candidate. */
|
|
31
|
+
export interface VikingBotRepairOption {
|
|
32
|
+
/** 候选标识。Candidate key. */
|
|
33
|
+
id: string;
|
|
34
|
+
/** 候选文案。Candidate label. */
|
|
35
|
+
label: string;
|
|
36
|
+
/** 来源说明。Source description. */
|
|
37
|
+
description?: string;
|
|
38
|
+
}
|
|
39
|
+
/** 自定义问题的渲染上下文。Render context for a custom question. */
|
|
40
|
+
export interface VikingBotInteractionRenderContext {
|
|
41
|
+
/** 是否禁用提交。Whether submission is disabled. */
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
/** 是否正在提交。Whether a submission is in flight. */
|
|
44
|
+
submitting?: boolean;
|
|
45
|
+
/** 上报答案;由宿主转成它自己的协议。Reports an answer; the host adapts it. */
|
|
46
|
+
submit: (value: unknown) => void | Promise<void>;
|
|
47
|
+
/** 放弃本次交互。Abandons this interaction. */
|
|
48
|
+
cancel: () => void;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 一次待确认的交互。组件内置 `choice`、`text`、`schedule`、`repair` 四种表单;
|
|
52
|
+
* 需要树选择器、上传等宿主能力时用 `custom` 自行渲染。
|
|
53
|
+
* One pending interaction. The component ships `choice`, `text`, `schedule` and
|
|
54
|
+
* `repair`; use `custom` when the form needs host capabilities such as a tree
|
|
55
|
+
* picker or an upload.
|
|
56
|
+
*/
|
|
57
|
+
export type VikingBotInteractionRequest = {
|
|
58
|
+
/** 单选。Single choice. */
|
|
59
|
+
kind: 'choice';
|
|
60
|
+
/** 问题文案。Question copy. */
|
|
61
|
+
question?: ReactNode;
|
|
62
|
+
/** 选项。Options. */
|
|
63
|
+
options: readonly VikingBotInteractionOption[];
|
|
64
|
+
/** 是否提供「其他」输入项。Whether an inline "other" input is offered. */
|
|
65
|
+
allowCustomInput?: boolean | {
|
|
66
|
+
placeholder?: string;
|
|
67
|
+
};
|
|
68
|
+
} | {
|
|
69
|
+
/** 文本输入。Free text. */
|
|
70
|
+
kind: 'text';
|
|
71
|
+
/** 问题文案。Question copy. */
|
|
72
|
+
question?: ReactNode;
|
|
73
|
+
/** 初始值。Initial value. */
|
|
74
|
+
initialValue?: string;
|
|
75
|
+
/** 补充说明。Extra description. */
|
|
76
|
+
description?: ReactNode;
|
|
77
|
+
/** 是否多行。Whether the input is multiline. */
|
|
78
|
+
multiline?: boolean;
|
|
79
|
+
} | {
|
|
80
|
+
/** 定时。Schedule. */
|
|
81
|
+
kind: 'schedule';
|
|
82
|
+
/** 问题文案。Question copy. */
|
|
83
|
+
question?: ReactNode;
|
|
84
|
+
/** 时区。Time zone. */
|
|
85
|
+
timezone?: string;
|
|
86
|
+
/** 初始值。Initial value. */
|
|
87
|
+
initialValue: VikingBotScheduleValue;
|
|
88
|
+
} | {
|
|
89
|
+
/** 从候选修复项中选择。Pick one repair candidate. */
|
|
90
|
+
kind: 'repair';
|
|
91
|
+
/** 问题文案。Question copy. */
|
|
92
|
+
question?: ReactNode;
|
|
93
|
+
/** 候选。Candidates. */
|
|
94
|
+
options: readonly VikingBotRepairOption[];
|
|
95
|
+
/** 初始选中的候选标识。Initially selected candidate key. */
|
|
96
|
+
initialValue?: string;
|
|
97
|
+
} | {
|
|
98
|
+
/** 由宿主渲染。Rendered by the host. */
|
|
99
|
+
kind: 'custom';
|
|
100
|
+
/** 问题文案。Question copy. */
|
|
101
|
+
question?: ReactNode;
|
|
102
|
+
/** 渲染函数。Renderer. */
|
|
103
|
+
render: (context: VikingBotInteractionRenderContext) => ReactNode;
|
|
104
|
+
};
|
|
105
|
+
/** 交互答案。An interaction answer. */
|
|
106
|
+
export type VikingBotInteractionAnswer = {
|
|
107
|
+
kind: 'choice';
|
|
108
|
+
value: string;
|
|
109
|
+
} | {
|
|
110
|
+
kind: 'text';
|
|
111
|
+
value: string;
|
|
112
|
+
} | {
|
|
113
|
+
kind: 'schedule';
|
|
114
|
+
value: VikingBotScheduleValue;
|
|
115
|
+
} | {
|
|
116
|
+
kind: 'repair';
|
|
117
|
+
value: string;
|
|
118
|
+
} | {
|
|
119
|
+
kind: 'custom';
|
|
120
|
+
value: unknown;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* 交互区文案。组件内置英文默认值,宿主可按需覆盖。
|
|
124
|
+
* Copy of the interaction area. The component ships English defaults; a host
|
|
125
|
+
* overrides any field it needs.
|
|
126
|
+
*/
|
|
127
|
+
export interface VikingBotInteractionLabels {
|
|
128
|
+
/** 区域标题,缺省为「待确认」。Area title, "Needs your input" by default. */
|
|
129
|
+
title?: string;
|
|
130
|
+
/** 提交按钮。Submit button. */
|
|
131
|
+
submit?: string;
|
|
132
|
+
/** 取消按钮。Cancel button. */
|
|
133
|
+
cancel?: string;
|
|
134
|
+
/** 「其他」输入项文案。Label of the "other" input. */
|
|
135
|
+
other?: string;
|
|
136
|
+
/** 提交成功提示。Shown after a successful submission. */
|
|
137
|
+
submitted?: string;
|
|
138
|
+
/** 取消提示。Shown after cancelling. */
|
|
139
|
+
cancelled?: string;
|
|
140
|
+
/** 步骤进度,接收当前序号与总数。Step progress, given index and total. */
|
|
141
|
+
progress?: (index: number, total: number) => string;
|
|
142
|
+
/** 不启用定时的选项文案。Label of the "no schedule" option. */
|
|
143
|
+
scheduleNone?: string;
|
|
144
|
+
/** 每天的选项文案。Label of the daily option. */
|
|
145
|
+
scheduleDaily?: string;
|
|
146
|
+
/** 每周的选项文案。Label of the weekly option. */
|
|
147
|
+
scheduleWeekly?: string;
|
|
148
|
+
/** 时间输入的无障碍名称。Accessible name of the time input. */
|
|
149
|
+
scheduleTime?: string;
|
|
150
|
+
/** 星期选择的无障碍名称。Accessible name of the weekday select. */
|
|
151
|
+
scheduleWeekday?: string;
|
|
152
|
+
/** 星期名称,按周一至周日排列。Weekday names, Monday first. */
|
|
153
|
+
weekdays?: readonly string[];
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* 待确认交互区。宿主从自己的流里算出问题,这里只负责表单与状态;
|
|
157
|
+
* 答案通过 `onSubmit` 上报,宿主决定怎么发回去。
|
|
158
|
+
* The pending-interaction area. The host derives the question from its own
|
|
159
|
+
* stream; this renders the form and its state, and reports the answer.
|
|
160
|
+
*/
|
|
161
|
+
export interface VikingBotInteractionProps {
|
|
162
|
+
/** 当前问题。The current question. */
|
|
163
|
+
request: VikingBotInteractionRequest;
|
|
164
|
+
/**
|
|
165
|
+
* 问题的稳定身份;变化时重置表单状态。省略时按 `request.kind` 与序号判定。
|
|
166
|
+
* Stable identity of the question; changes reset the form state. Defaults to
|
|
167
|
+
* the request kind plus the step index.
|
|
168
|
+
*/
|
|
169
|
+
requestKey?: string;
|
|
170
|
+
/** 附加到根元素的类名。Class name applied to the root element. */
|
|
171
|
+
className?: string;
|
|
172
|
+
/** 当前步骤序号,从 0 开始。Current step index, starting at 0. */
|
|
173
|
+
index?: number;
|
|
174
|
+
/** 步骤总数。Total number of steps. */
|
|
175
|
+
total?: number;
|
|
176
|
+
/** 是否禁用。Whether the form is disabled. */
|
|
177
|
+
disabled?: boolean;
|
|
178
|
+
/** 是否正在提交。Whether a submission is in flight. */
|
|
179
|
+
submitting?: boolean;
|
|
180
|
+
/** 提交失败的原因。Why the last submission failed. */
|
|
181
|
+
error?: ReactNode;
|
|
182
|
+
/** 上报答案。Reports an answer. */
|
|
183
|
+
onSubmit?: (answer: VikingBotInteractionAnswer) => void | Promise<void>;
|
|
184
|
+
/** 放弃本次交互。Abandons this interaction. */
|
|
185
|
+
onCancel?: () => void;
|
|
186
|
+
/** 可替换文案,缺省为英文。Replaceable copy; English by default. */
|
|
187
|
+
labels?: VikingBotInteractionLabels;
|
|
188
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { VikingBotInteractionProps } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* 待确认交互区。表单由 Ark 的 AskHuman 渲染;需要树选择器、上传器等宿主
|
|
4
|
+
* 能力时,`custom` 直接交给宿主渲染。
|
|
5
|
+
*
|
|
6
|
+
* The pending-interaction area. Ark's AskHuman renders the form; when a question
|
|
7
|
+
* needs a tree picker or an uploader, `custom` hands rendering to the host.
|
|
8
|
+
*/
|
|
9
|
+
export declare function VikingBotInteractionView({ request, className, requestKey, index, total, disabled, submitting, error, onSubmit, onCancel, labels: overrides, }: VikingBotInteractionProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { VikingBotMessage, VikingBotMessagePart } from './model.js';
|
|
2
|
+
/** 把 `viking://` 地址从片段里抽出来,用于渲染可点击引用。 */
|
|
3
|
+
export declare function collectUris(parts: readonly VikingBotMessagePart[]): string[];
|
|
4
|
+
/** 把连续消息按轮次合并,便于渲染同一轮的助手步骤。 */
|
|
5
|
+
export declare function groupMessages(messages: readonly VikingBotMessage[]): VikingBotMessage[];
|
|
6
|
+
/** 取消息的纯文本,用于复制。Plain text of a message, used for copying. */
|
|
7
|
+
export declare function messageText(message: VikingBotMessage): string;
|
|
8
|
+
/** 同一执行块的片段归到一组,供折叠块使用。Groups parts of one activity block. */
|
|
9
|
+
export declare function groupByActivity(parts: readonly VikingBotMessagePart[]): {
|
|
10
|
+
groupId?: string;
|
|
11
|
+
parts: VikingBotMessagePart[];
|
|
12
|
+
}[];
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 片段类型判别值。两种宿主风格共用这一层:宿主在接入层把各自的流事件
|
|
4
|
+
* 归一化成这些片段,组件不依赖任一方协议。
|
|
5
|
+
* Part discriminators shared by both host styles. Each host normalizes its own
|
|
6
|
+
* stream events into these parts; the component depends on neither protocol.
|
|
7
|
+
*/
|
|
8
|
+
/** 纯文本片段。A plain text part. */
|
|
9
|
+
export interface VikingBotTextPart {
|
|
10
|
+
/** 片段类型。Part type. */
|
|
11
|
+
type: 'text';
|
|
12
|
+
/** 文本内容。Text content. */
|
|
13
|
+
text: string;
|
|
14
|
+
/**
|
|
15
|
+
* 文本格式,缺省为 `plain`。开源版的回答是 Markdown,火山版的工具输出是纯文本。
|
|
16
|
+
* Text format, `plain` by default. Open-source answers are Markdown while
|
|
17
|
+
* managed-agent tool output is plain text.
|
|
18
|
+
*/
|
|
19
|
+
format?: 'plain' | 'markdown';
|
|
20
|
+
}
|
|
21
|
+
/** 推理过程片段。A reasoning part. */
|
|
22
|
+
export interface VikingBotReasoningPart {
|
|
23
|
+
/** 片段类型。Part type. */
|
|
24
|
+
type: 'reasoning';
|
|
25
|
+
/** 推理文本。Reasoning text. */
|
|
26
|
+
text: string;
|
|
27
|
+
/** 是否仍在生成。Whether the reasoning is still being generated. */
|
|
28
|
+
running?: boolean;
|
|
29
|
+
/** 所属执行块标识,同组片段合并展示。Owning activity block; same group collapses together. */
|
|
30
|
+
groupId?: string;
|
|
31
|
+
/** 开始时间,毫秒或 ISO 字符串。Start time in milliseconds or ISO text. */
|
|
32
|
+
startedAt?: number | string;
|
|
33
|
+
/** 结束时间。End time. */
|
|
34
|
+
completedAt?: number | string;
|
|
35
|
+
/** 耗时,单位毫秒。Duration in milliseconds. */
|
|
36
|
+
durationMs?: number;
|
|
37
|
+
}
|
|
38
|
+
/** Agent 循环的迭代标记。An agent-loop iteration marker. */
|
|
39
|
+
export interface VikingBotIterationPart {
|
|
40
|
+
/** 片段类型。Part type. */
|
|
41
|
+
type: 'iteration';
|
|
42
|
+
/** 迭代轮次。Iteration number. */
|
|
43
|
+
iteration: number;
|
|
44
|
+
}
|
|
45
|
+
/** 上下文引用片段。A context reference part. */
|
|
46
|
+
export interface VikingBotContextPart {
|
|
47
|
+
/** 片段类型。Part type. */
|
|
48
|
+
type: 'context';
|
|
49
|
+
/** 被引用的资源 URI。URI of the referenced resource. */
|
|
50
|
+
uri: string;
|
|
51
|
+
/** 引用类别。Reference category. */
|
|
52
|
+
contextType: 'memory' | 'resource' | 'skill';
|
|
53
|
+
/** 引用显示名称,缺省时由 URI 推导。Display label, derived from the URI when omitted. */
|
|
54
|
+
label?: string;
|
|
55
|
+
/** 引用摘要。Reference abstract. */
|
|
56
|
+
abstract?: string;
|
|
57
|
+
}
|
|
58
|
+
/** 工具调用片段。A tool call part. */
|
|
59
|
+
export interface VikingBotToolPart {
|
|
60
|
+
/** 片段类型。Part type. */
|
|
61
|
+
type: 'tool';
|
|
62
|
+
/** 工具调用唯一标识。Unique tool call key. */
|
|
63
|
+
id: string;
|
|
64
|
+
/** 工具名称。Tool name. */
|
|
65
|
+
name: string;
|
|
66
|
+
/** 调用状态。Call status. */
|
|
67
|
+
status: 'pending' | 'running' | 'completed' | 'error';
|
|
68
|
+
/** 调用入参。Call input. */
|
|
69
|
+
input?: Record<string, unknown>;
|
|
70
|
+
/** 调用输出文本。Call output text. */
|
|
71
|
+
output?: string;
|
|
72
|
+
/** 调用耗时,单位毫秒。Call duration in milliseconds. */
|
|
73
|
+
durationMs?: number;
|
|
74
|
+
/** 所属执行块标识。Owning activity block. */
|
|
75
|
+
groupId?: string;
|
|
76
|
+
/** MCP 服务名,火山版按服务分组展示。MCP server name; the managed agent groups by it. */
|
|
77
|
+
server?: string;
|
|
78
|
+
/** 该调用对应的后端接口,用于展示可点击的接口标签。Backend endpoint, shown as a tag. */
|
|
79
|
+
endpoint?: {
|
|
80
|
+
method: string;
|
|
81
|
+
path: string;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/** 工具结果片段,与调用分开以保留到达顺序。A tool result part, kept apart to preserve arrival order. */
|
|
85
|
+
export interface VikingBotToolResultPart {
|
|
86
|
+
/** 片段类型。Part type. */
|
|
87
|
+
type: 'tool_result';
|
|
88
|
+
/** 对应的工具调用标识。Id of the tool call this result belongs to. */
|
|
89
|
+
id: string;
|
|
90
|
+
/** 工具名称。Tool name. */
|
|
91
|
+
name: string;
|
|
92
|
+
/** 工具输出文本。Tool output text. */
|
|
93
|
+
output: string;
|
|
94
|
+
/** 该结果是否为错误。Whether the result is an error. */
|
|
95
|
+
isError?: boolean;
|
|
96
|
+
/** 所属执行块标识。Owning activity block. */
|
|
97
|
+
groupId?: string;
|
|
98
|
+
}
|
|
99
|
+
/** 图片片段。An image part. */
|
|
100
|
+
export interface VikingBotImagePart {
|
|
101
|
+
/** 片段类型。Part type. */
|
|
102
|
+
type: 'image';
|
|
103
|
+
/** 图片地址。Image source. */
|
|
104
|
+
src: string;
|
|
105
|
+
/** 图片说明,用作无障碍替代文本。Accessible alt text. */
|
|
106
|
+
alt?: string;
|
|
107
|
+
/** 图片细节等级。Image detail level. */
|
|
108
|
+
detail?: string;
|
|
109
|
+
}
|
|
110
|
+
/** 附件片段。An attachment part. */
|
|
111
|
+
export interface VikingBotAttachmentPart {
|
|
112
|
+
/** 片段类型。Part type. */
|
|
113
|
+
type: 'attachment';
|
|
114
|
+
/** 文件名。File name. */
|
|
115
|
+
name: string;
|
|
116
|
+
/** 附件对应的资源 URI。URI of the attachment resource. */
|
|
117
|
+
uri?: string;
|
|
118
|
+
/** 附件预览地址。Attachment preview URL. */
|
|
119
|
+
previewUrl?: string;
|
|
120
|
+
/** MIME 类型。MIME type. */
|
|
121
|
+
mimeType?: string;
|
|
122
|
+
}
|
|
123
|
+
/** 消息中的一个内容片段。One content part of a message. */
|
|
124
|
+
export type VikingBotMessagePart = VikingBotTextPart | VikingBotReasoningPart | VikingBotIterationPart | VikingBotContextPart | VikingBotToolPart | VikingBotToolResultPart | VikingBotImagePart | VikingBotAttachmentPart;
|
|
125
|
+
/** 一条消息。A single message. */
|
|
126
|
+
export interface VikingBotMessage {
|
|
127
|
+
/** 消息唯一标识。Unique message key. */
|
|
128
|
+
id: string;
|
|
129
|
+
/**
|
|
130
|
+
* 消息角色。开源版只有 user 和 assistant;火山版额外有 system 提示与
|
|
131
|
+
* tool 独立块,因此这里保留四类。
|
|
132
|
+
* Message role. The open-source host has user and assistant only; the managed
|
|
133
|
+
* agent also emits system notices and standalone tool blocks.
|
|
134
|
+
*/
|
|
135
|
+
role: 'user' | 'assistant' | 'system' | 'tool';
|
|
136
|
+
/** 消息的内容片段。Content parts of the message. */
|
|
137
|
+
parts: readonly VikingBotMessagePart[];
|
|
138
|
+
/** 把连续消息归入同一轮次。Groups consecutive messages into one turn. */
|
|
139
|
+
turnId?: string;
|
|
140
|
+
/** 消息创建时间。Message creation time. */
|
|
141
|
+
createdAt?: string;
|
|
142
|
+
/** 该助手消息是否仍在生成中。Whether the assistant message is still being written. */
|
|
143
|
+
streaming?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* system 消息的语气,缺省为 `info`;`error` 用于连接中断等提示。
|
|
146
|
+
* Tone of a system message, `info` by default; `error` for failures.
|
|
147
|
+
*/
|
|
148
|
+
tone?: 'info' | 'error';
|
|
149
|
+
/**
|
|
150
|
+
* 合并后的消息携带的原始动作清单;合并时保留每条消息自己的 messageId,
|
|
151
|
+
* 渲染时按原始消息回传,避免把动作挂到错误的消息上。
|
|
152
|
+
* Actions carried by the messages this one merged, each keeping its original
|
|
153
|
+
* message id so the host receives the right one.
|
|
154
|
+
*/
|
|
155
|
+
actions?: readonly {
|
|
156
|
+
/** 原始消息标识。Original message key. */
|
|
157
|
+
messageId: string;
|
|
158
|
+
/** 该消息声明的动作。Action declared by that message. */
|
|
159
|
+
action: NonNullable<VikingBotMessage['action']>;
|
|
160
|
+
}[];
|
|
161
|
+
/**
|
|
162
|
+
* 消息级动作,由宿主声明。火山版用它在助手消息下挂「提交会话」。
|
|
163
|
+
* Message-level action declared by the host. The managed agent uses it for
|
|
164
|
+
* the memory-commit control under an assistant message.
|
|
165
|
+
*/
|
|
166
|
+
action?: {
|
|
167
|
+
/** 动作标识。Action key. */
|
|
168
|
+
key: string;
|
|
169
|
+
/** 动作文案。Action label. */
|
|
170
|
+
label?: ReactNode;
|
|
171
|
+
/** 动作状态。Action status. */
|
|
172
|
+
status?: 'idle' | 'pending' | 'submitted' | 'success' | 'error';
|
|
173
|
+
/** 不可用时的说明。Reason shown when unavailable. */
|
|
174
|
+
disabledReason?: string;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/** 助手仍在生成时的增量片段。Parts appended while the assistant is still streaming. */
|
|
178
|
+
export interface VikingBotStreamingState {
|
|
179
|
+
/** 已生成的片段。Parts generated so far. */
|
|
180
|
+
parts: readonly VikingBotMessagePart[];
|
|
181
|
+
/** 在 `messages` 中的哪个位置之后追加。Index the parts are appended after. */
|
|
182
|
+
insertIndex?: number;
|
|
183
|
+
/** 当前迭代轮次。Current iteration number. */
|
|
184
|
+
iteration: number;
|
|
185
|
+
}
|
|
186
|
+
/** 一个附件。One attachment. */
|
|
187
|
+
export interface VikingBotAttachment {
|
|
188
|
+
/** 附件唯一标识。Unique attachment key. */
|
|
189
|
+
key: string;
|
|
190
|
+
/** 文件名。File name. */
|
|
191
|
+
name: string;
|
|
192
|
+
/** 本地对象 URL 或宿主解析出的预览地址。Local object URL or a host-resolved preview link. */
|
|
193
|
+
previewUrl?: string;
|
|
194
|
+
/** MIME 类型。MIME type. */
|
|
195
|
+
mimeType?: string;
|
|
196
|
+
/** 字节大小,未知时为 `null`。Size in bytes, or `null` when unknown. */
|
|
197
|
+
sizeBytes?: number | null;
|
|
198
|
+
/** 上传状态。Upload status. */
|
|
199
|
+
status?: 'pending' | 'uploading' | 'ready' | 'error';
|
|
200
|
+
/** 上传失败时的提示。Message shown when the upload failed. */
|
|
201
|
+
errorMessage?: string;
|
|
202
|
+
}
|
|
203
|
+
/** 宿主组装好、等待发送的内容。A message composed by the host, waiting to be sent. */
|
|
204
|
+
export interface VikingBotDraft {
|
|
205
|
+
/** 文本内容。Text content. */
|
|
206
|
+
text: string;
|
|
207
|
+
/** 附带的附件。Attached files. */
|
|
208
|
+
attachments: readonly VikingBotAttachment[];
|
|
209
|
+
}
|
|
210
|
+
/** 可替换文案,组件内置英文默认值。Replaceable copy; the component ships English defaults. */
|
|
211
|
+
export interface VikingBotLabels {
|
|
212
|
+
/** 输入框占位文本。Input placeholder. */
|
|
213
|
+
placeholder?: string;
|
|
214
|
+
/** 发送按钮文案。Send button label. */
|
|
215
|
+
send?: string;
|
|
216
|
+
/** 停止按钮文案。Stop button label. */
|
|
217
|
+
stop?: string;
|
|
218
|
+
/** 添加附件按钮文案。Attach button label. */
|
|
219
|
+
attach?: string;
|
|
220
|
+
/** 移除附件按钮文案。Remove-attachment button label. */
|
|
221
|
+
removeAttachment?: string;
|
|
222
|
+
/** 复制按钮文案。Copy button label. */
|
|
223
|
+
copy?: string;
|
|
224
|
+
/** 复制成功提示。Message shown after a successful copy. */
|
|
225
|
+
copied?: string;
|
|
226
|
+
/** 推理块标题。Heading of the reasoning block. */
|
|
227
|
+
reasoning?: string;
|
|
228
|
+
/** 生成中的提示。Message shown while generating. */
|
|
229
|
+
thinking?: string;
|
|
230
|
+
/** 工具调用标题。Heading of a tool call. */
|
|
231
|
+
tool?: string;
|
|
232
|
+
/** 工具待执行状态。Text for a pending tool call. */
|
|
233
|
+
toolPending?: string;
|
|
234
|
+
/** 工具执行中状态。Text for a running tool call. */
|
|
235
|
+
toolRunning?: string;
|
|
236
|
+
/** 工具执行成功状态。Text for a completed tool call. */
|
|
237
|
+
toolCompleted?: string;
|
|
238
|
+
/** 工具执行失败状态。Text for a failed tool call. */
|
|
239
|
+
toolError?: string;
|
|
240
|
+
/** 上下文引用标题。Heading of a context reference. */
|
|
241
|
+
context?: string;
|
|
242
|
+
/** 无消息时的提示。Message shown when there are no messages. */
|
|
243
|
+
empty?: string;
|
|
244
|
+
/** 新建会话按钮文案。New-session button label. */
|
|
245
|
+
newSession?: string;
|
|
246
|
+
/** 重试按钮文案。Retry button label. */
|
|
247
|
+
retry?: string;
|
|
248
|
+
/** 回到最新消息按钮文案。Scroll-to-latest button label. */
|
|
249
|
+
scrollToLatest?: string;
|
|
250
|
+
/** 不可用时的提示。Message shown while the bot is unavailable. */
|
|
251
|
+
unavailable?: string;
|
|
252
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { VikingBotLabels, VikingBotMessagePart } from './model.js';
|
|
2
|
+
/** 片段渲染所需的最小上下文。Context a part renderer needs. */
|
|
3
|
+
export interface PartContext {
|
|
4
|
+
/** 内置文案。Built-in copy. */
|
|
5
|
+
labels: VikingBotLabels;
|
|
6
|
+
/** 打开资源引用。Opens a resource reference. */
|
|
7
|
+
onOpenUri?: (uri: string) => void;
|
|
8
|
+
/** 复制文本。Copies text. */
|
|
9
|
+
onCopy?: (text: string) => void;
|
|
10
|
+
}
|
|
11
|
+
/** 渲染一个片段。Renders one part. */
|
|
12
|
+
export declare function renderPart(part: VikingBotMessagePart, context: PartContext): import("react").JSX.Element;
|