@openviking/react 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.arco-design +21 -0
- package/README.md +25 -15
- package/dist/0~0.js +19 -0
- package/dist/2~0.js +2267 -29
- package/dist/2~0.js.LICENSE.txt +23 -0
- package/dist/3c~0.js +2206 -0
- package/dist/3~0.js +1205 -1982
- package/dist/4~0.js +18 -0
- package/dist/9~0.js +43 -0
- package/dist/{1~0.js → ae~0.js} +5 -24
- package/dist/ark-message-list-view~0.js +530 -119
- package/dist/a~0.js +1289 -10
- package/dist/c7~0.js +38 -2
- package/dist/ck~0.js +23 -0
- package/dist/client/provider.d.ts +5 -3
- package/dist/client/types.d.ts +5 -5
- package/dist/client.js +2 -1
- package/dist/components/agent-connect/agent-connect-copy.d.ts +19 -33
- package/dist/components/agent-connect/agent-connect-design.d.ts +1935 -167
- package/dist/components/agent-connect/agent-connect-instructions.d.ts +135 -0
- package/dist/components/agent-connect/locales/en-US.d.ts +20 -0
- package/dist/components/agent-connect/locales/zh-CN.d.ts +3 -0
- package/dist/components/agent-connect/style.css +14 -2
- package/dist/components/agent-connect/types.d.ts +2 -1
- 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 +42 -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 +752 -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 +1 -1
- package/dist/components/scope-switcher/style.css +14 -2
- package/dist/components/scope-switcher/types.d.ts +11 -5
- package/dist/components/style.css +9851 -6812
- 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 +1 -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 +21 -9
- 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 +533 -66
- package/dist/e~0.js +333 -0
- package/dist/file-preview-viewer~0.js +90 -8
- package/dist/f~0.js +39 -47
- 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 +37 -8
- package/dist/l~0.js +102 -119
- 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 +1581 -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 +1 -1
- package/dist/modules/scope-cascade/style.css +14 -2
- package/dist/modules/scope-cascade/types.d.ts +3 -0
- package/dist/modules/style.css +15853 -3484
- package/dist/nx~0.js +15 -0
- package/dist/n~0.js +238 -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.d.ts +6 -0
- package/dist/style.css +26056 -10636
- package/dist/u~0.js +75 -58
- package/dist/viking-bot-composer~0.js +434 -77
- package/dist/viking-bot-interaction~0.js +11 -11
- package/package.json +13 -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
package/dist/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export { AgentConnect } from "./u~0.js";
|
|
2
2
|
export { Console } from "./a~0.js";
|
|
3
|
+
export { DirectoryTour } from "./e~0.js";
|
|
3
4
|
export { FileBrowser } from "./l~0.js";
|
|
4
5
|
export { FileBrowserEntries } from "./2~0.js";
|
|
5
6
|
export { FileTree } from "./n~0.js";
|
|
6
7
|
export { ScopeCascade } from "./lk~0.js";
|
|
7
8
|
export { ScopeSelector, ScopeSwitcher } from "./f~0.js";
|
|
8
|
-
export { Tui } from "./
|
|
9
|
+
export { Tui } from "./3c~0.js";
|
|
9
10
|
export { VikingBot } from "./c~0.js";
|
package/dist/k~0.js
CHANGED
package/dist/lg~0.js
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { removereact } from "./4~0.js";
|
|
4
|
+
const SvgBulb = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
width: "1em",
|
|
7
|
+
height: "1em",
|
|
8
|
+
fill: "currentColor",
|
|
9
|
+
display: "block",
|
|
10
|
+
overflow: "visible",
|
|
11
|
+
preserveAspectRatio: "none",
|
|
12
|
+
viewBox: "0 0 24 24",
|
|
13
|
+
...props,
|
|
14
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
15
|
+
stroke: "#000",
|
|
16
|
+
strokeLinecap: "round",
|
|
17
|
+
strokeLinejoin: "round",
|
|
18
|
+
strokeWidth: 1.6,
|
|
19
|
+
d: "M10 17.659V20a2 2 0 1 0 4 0v-2.341M12 2v1m-9 9H2m3.5-6.5-.6-.6m13.6.6.6-.6M22 12h-1m-3 0a6 6 0 1 1-12 0 6 6 0 0 1 12 0"
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
const bulbreact = SvgBulb;
|
|
23
|
+
const SvgBook = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
24
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
25
|
+
width: "1em",
|
|
26
|
+
height: "1em",
|
|
27
|
+
fill: "none",
|
|
28
|
+
display: "block",
|
|
29
|
+
overflow: "visible",
|
|
30
|
+
preserveAspectRatio: "none",
|
|
31
|
+
viewBox: "0 0 14.333 13",
|
|
32
|
+
...props,
|
|
33
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
34
|
+
stroke: "currentColor",
|
|
35
|
+
strokeLinecap: "round",
|
|
36
|
+
strokeLinejoin: "round",
|
|
37
|
+
d: "M7.167 4.767c0-1.494 0-2.24.29-2.811.256-.502.664-.91 1.166-1.165C9.193.5 9.94.5 11.433.5h.267c.747 0 1.12 0 1.405.145.251.128.455.332.583.583.145.285.145.659.145 1.405v5.734c0 .746 0 1.12-.145 1.405-.128.25-.332.455-.583.583-.285.145-.658.145-1.405.145h-.916c-.835 0-1.253 0-1.632.115a2.7 2.7 0 0 0-.918.492c-.306.251-.538.598-1 1.293l-.067.1-.067-.1c-.463-.695-.695-1.042-1-1.293a2.7 2.7 0 0 0-.919-.492c-.379-.115-.796-.115-1.631-.115h-.917c-.746 0-1.12 0-1.405-.145a1.33 1.33 0 0 1-.583-.583C.5 9.487.5 9.113.5 8.367V2.633c0-.746 0-1.12.145-1.405.128-.25.332-.455.583-.583C1.513.5 1.887.5 2.633.5H2.9c1.493 0 2.24 0 2.81.29.502.256.91.664 1.166 1.166.29.57.29 1.317.29 2.81m0 7.733V4.767"
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
const bookreact = SvgBook;
|
|
41
|
+
const SvgVideo = (props)=>/*#__PURE__*/ jsxs("svg", {
|
|
42
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
43
|
+
width: "1em",
|
|
44
|
+
height: "1em",
|
|
45
|
+
fill: "currentColor",
|
|
46
|
+
display: "block",
|
|
47
|
+
overflow: "visible",
|
|
48
|
+
preserveAspectRatio: "none",
|
|
49
|
+
viewBox: "0 0 24 24",
|
|
50
|
+
...props,
|
|
51
|
+
children: [
|
|
52
|
+
/*#__PURE__*/ jsx("path", {
|
|
53
|
+
d: "M11.439 7.302c.548-.022 1.036.013 1.505.183A3.75 3.75 0 0 1 14.77 8.91v.001c.279.413.43.878.542 1.415.109.529.19 1.19.29 2.011l.414 3.373.132 1.118c.035.336.062.636.073.906.022.548-.013 1.036-.184 1.505a3.75 3.75 0 0 1-1.426 1.825c-.414.278-.878.431-1.416.543-.528.11-1.19.19-2.011.29l-3.373.414c-.822.1-1.483.182-2.023.204-.48.02-.913-.005-1.327-.125l-.177-.058a3.75 3.75 0 0 1-1.651-1.187l-.176-.24c-.278-.413-.43-.878-.542-1.415a14 14 0 0 1-.148-.895l-.143-1.116-.413-3.374-.133-1.117a14 14 0 0 1-.072-.905c-.022-.548.013-1.037.183-1.505a3.75 3.75 0 0 1 1.426-1.826h.001c.413-.278.877-.43 1.414-.542.53-.11 1.19-.19 2.013-.29l3.374-.414 1.116-.133q.502-.055.906-.072m.06 1.499c-.232.01-.495.032-.806.065l-1.093.13-3.375.412c-.846.104-1.436.178-1.89.272-.445.092-.696.193-.88.317a2.25 2.25 0 0 0-.856 1.095l-.001-.001c-.076.21-.111.477-.093.932.01.232.032.495.065.806l.13 1.093v.001l.412 3.374.14 1.092c.043.31.085.571.132.799.092.445.193.696.317.88a2.25 2.25 0 0 0 1.094.855h.001c.208.076.476.113.932.095.463-.019 1.053-.091 1.9-.195l3.373-.414c.846-.103 1.436-.176 1.89-.27.445-.092.696-.193.88-.317.394-.266.694-.65.857-1.095.076-.209.112-.476.094-.93-.02-.465-.091-1.055-.195-1.902l-.414-3.374c-.103-.846-.176-1.436-.27-1.89-.092-.446-.193-.697-.316-.88a2.25 2.25 0 0 0-1.096-.856v-.001c-.21-.076-.478-.111-.932-.093"
|
|
54
|
+
}),
|
|
55
|
+
/*#__PURE__*/ jsx("path", {
|
|
56
|
+
d: "M12.018 2.006c.54.022 1.2.104 2.022.205l3.374.413c.822.101 1.483.182 2.012.291.537.111 1.001.264 1.415.542a3.75 3.75 0 0 1 1.315 1.553l.112.274.058.177c.12.414.144.848.125 1.327q-.018.404-.072.905l-.133 1.118-.413 3.373c-.1.822-.182 1.483-.291 2.011-.112.538-.264 1.002-.542 1.415a3.75 3.75 0 0 1-1.819 1.423l-.006.004h-.001a2 2 0 0 1-.235.074.75.75 0 0 1-.379-1.45 1 1 0 0 0 .093-.03l.008-.003.164-.067a2.25 2.25 0 0 0 .93-.79c.125-.184.226-.435.318-.88.094-.454.167-1.044.27-1.89l.415-3.373c.104-.846.175-1.437.194-1.9.018-.455-.018-.723-.094-.931l-.067-.165a2.25 2.25 0 0 0-.788-.93c-.184-.125-.435-.226-.881-.318-.455-.094-1.045-.167-1.89-.272l-3.375-.413c-.846-.104-1.435-.175-1.9-.194-.454-.018-.723.017-.932.093h.001a2.25 2.25 0 0 0-1.095.856v.002c-.085.124-.158.28-.224.505a.751.751 0 0 1-1.44-.423c.1-.337.232-.643.422-.924a3.75 3.75 0 0 1 1.823-1.424l.002-.001c.469-.17.956-.205 1.504-.183M6.911 17.207l-.557-3.964a.75.75 0 0 1 1.057-.785l3.36 1.55c.497.227.59.892.176 1.248l-2.804 2.415a.75.75 0 0 1-1.232-.464"
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
const videoreact = SvgVideo;
|
|
61
|
+
const SvgReport = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
62
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
63
|
+
width: "1em",
|
|
64
|
+
height: "1em",
|
|
65
|
+
fill: "currentColor",
|
|
66
|
+
display: "block",
|
|
67
|
+
overflow: "visible",
|
|
68
|
+
preserveAspectRatio: "none",
|
|
69
|
+
viewBox: "0 0 14 14",
|
|
70
|
+
...props,
|
|
71
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
72
|
+
d: "M2 9.388V4.612c0-.533 0-.965.026-1.313.027-.355.085-.669.223-.96l.089-.17c.22-.384.535-.696.912-.902l.103-.051c.243-.112.504-.163.794-.188C4.472 1 4.875 1 5.373 1h2.538c.42 0 .707-.003.984.068l.173.052q.257.09.488.241l.09.062c.204.154.39.357.65.635l.716.767.206.221c.19.207.333.377.444.571l.089.169q.122.257.185.54l.022.112c.044.263.042.548.042.941v4.009c0 .533 0 .965-.026 1.313-.024.31-.07.59-.175.85l-.048.11c-.192.404-.484.741-.843.977l-.158.094c-.272.149-.566.21-.897.24A15 15 0 0 1 8.627 13H5.373c-.498 0-.9 0-1.226-.029a2.4 2.4 0 0 1-.794-.187l-.103-.052a2.36 2.36 0 0 1-.912-.902l-.089-.168c-.138-.292-.196-.606-.223-.96C2 10.351 2 9.921 2 9.387m5.602-1.613.098.011a.51.51 0 0 1 .383.504.51.51 0 0 1-.383.505l-.098.01h-2.41c-.265 0-.48-.23-.48-.515 0-.284.215-.515.48-.515zm1.206-2.58.096.01c.22.048.385.256.385.505a.51.51 0 0 1-.385.504l-.096.01H5.192c-.265 0-.48-.23-.48-.514s.215-.515.48-.515zM2.962 9.388c0 .55 0 .932.023 1.23.022.29.063.454.121.576l.051.098c.128.222.31.404.53.523l.093.043c.104.04.241.07.445.087.277.024.634.025 1.148.025h3.254c.514 0 .87 0 1.148-.025.272-.024.425-.068.539-.13l.09-.055c.209-.137.378-.332.49-.566l.04-.101c.038-.111.064-.258.081-.476a18 18 0 0 0 .023-1.23V5.38c0-.373-.002-.56-.017-.693l-.02-.12a1.5 1.5 0 0 0-.107-.313l-.051-.097a1.4 1.4 0 0 0-.16-.219l-.35-.384-.717-.767a6 6 0 0 0-.47-.477l-.093-.07a1.3 1.3 0 0 0-.283-.14l-.1-.03c-.14-.036-.294-.04-.76-.04H5.374c-.514.001-.87.002-1.148.026-.204.018-.34.046-.445.086l-.094.044c-.218.12-.401.3-.529.523l-.05.098c-.059.122-.1.286-.122.577-.023.297-.023.679-.023 1.23z"
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
const reportreact = SvgReport;
|
|
76
|
+
const SvgHistory = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
77
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
78
|
+
width: "1em",
|
|
79
|
+
height: "1em",
|
|
80
|
+
fill: "none",
|
|
81
|
+
display: "block",
|
|
82
|
+
overflow: "visible",
|
|
83
|
+
preserveAspectRatio: "none",
|
|
84
|
+
viewBox: "0 0 12.667 12.667",
|
|
85
|
+
...props,
|
|
86
|
+
children: /*#__PURE__*/ jsxs("g", {
|
|
87
|
+
stroke: "currentColor",
|
|
88
|
+
strokeLinecap: "round",
|
|
89
|
+
strokeLinejoin: "round",
|
|
90
|
+
children: [
|
|
91
|
+
/*#__PURE__*/ jsx("path", {
|
|
92
|
+
d: "M1.03 1.295v2.122h2.122"
|
|
93
|
+
}),
|
|
94
|
+
/*#__PURE__*/ jsx("path", {
|
|
95
|
+
d: "M.5 6.333a5.833 5.833 0 0 0 5.833 5.834v0a5.833 5.833 0 1 0-5.052-8.75"
|
|
96
|
+
}),
|
|
97
|
+
/*#__PURE__*/ jsx("path", {
|
|
98
|
+
d: "M6.335 2.833v3.503l2.473 2.473"
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
})
|
|
102
|
+
});
|
|
103
|
+
const historyreact = SvgHistory;
|
|
104
|
+
const SvgNewSession = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
105
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
106
|
+
width: "1em",
|
|
107
|
+
height: "1em",
|
|
108
|
+
fill: "none",
|
|
109
|
+
display: "block",
|
|
110
|
+
overflow: "visible",
|
|
111
|
+
preserveAspectRatio: "none",
|
|
112
|
+
viewBox: "1.5 1.65 13 13",
|
|
113
|
+
...props,
|
|
114
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
115
|
+
stroke: "currentColor",
|
|
116
|
+
strokeLinecap: "round",
|
|
117
|
+
strokeLinejoin: "round",
|
|
118
|
+
d: "M8 9V5M6 7h4m-5.333 5v1.557c0 .355 0 .533.072.624.064.08.16.126.261.126.117 0 .256-.112.533-.334l1.59-1.272c.325-.26.488-.39.669-.482q.24-.123.507-.178C8.5 12 8.706 12 9.123 12H10.8c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C14 10.48 14 9.92 14 8.8V5.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C12.48 2 11.92 2 10.8 2H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 3.52 2 4.08 2 5.2v4.133c0 .62 0 .93.068 1.185a2 2 0 0 0 1.414 1.414c.255.068.565.068 1.185.068"
|
|
119
|
+
})
|
|
120
|
+
});
|
|
121
|
+
const new_sessionreact = SvgNewSession;
|
|
122
|
+
const SvgTool = (props)=>/*#__PURE__*/ jsx("svg", {
|
|
123
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
124
|
+
fill: "none",
|
|
125
|
+
stroke: "currentColor",
|
|
126
|
+
strokeWidth: 4,
|
|
127
|
+
viewBox: "0 0 48 48",
|
|
128
|
+
...props,
|
|
129
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
130
|
+
d: "M19.994 11.035c3.66-3.659 9.094-4.46 13.531-2.405a.1.1 0 0 1 .028.16l-6.488 6.488a1 1 0 0 0 0 1.414l4.243 4.243a1 1 0 0 0 1.414 0l6.488-6.488a.1.1 0 0 1 .16.028c2.056 4.437 1.254 9.872-2.405 13.53-3.695 3.696-9.2 4.477-13.66 2.347L12.923 40.733a1 1 0 0 1-1.414 0L7.266 36.49a1 1 0 0 1 0-1.414l10.382-10.382c-2.13-4.46-1.349-9.965 2.346-13.66Z"
|
|
131
|
+
})
|
|
132
|
+
});
|
|
133
|
+
const toolreact = SvgTool;
|
|
134
|
+
const icons = {
|
|
135
|
+
bulb: bulbreact,
|
|
136
|
+
book: bookreact,
|
|
137
|
+
video: videoreact,
|
|
138
|
+
report: reportreact,
|
|
139
|
+
history: historyreact,
|
|
140
|
+
newSession: new_sessionreact,
|
|
141
|
+
remove: removereact,
|
|
142
|
+
tool: toolreact
|
|
143
|
+
};
|
|
144
|
+
function VikingBotIcon({ name, 'aria-label': ariaLabel, ...props }) {
|
|
145
|
+
const Icon = icons[name];
|
|
146
|
+
return /*#__PURE__*/ jsx(Icon, {
|
|
147
|
+
width: 16,
|
|
148
|
+
height: 16,
|
|
149
|
+
"aria-hidden": ariaLabel ? void 0 : true,
|
|
150
|
+
"aria-label": ariaLabel,
|
|
151
|
+
focusable: "false",
|
|
152
|
+
...props
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
export { VikingBotIcon, historyreact, new_sessionreact };
|
package/dist/lk~0.js
CHANGED
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState, useSyncExternalStore } from "react";
|
|
3
|
+
import { resolveLocale } from "./nx~0.js";
|
|
3
4
|
import { ScopeSelector, ScopeSwitcher } from "./f~0.js";
|
|
5
|
+
const messages = {
|
|
6
|
+
levelNames: [
|
|
7
|
+
'Library',
|
|
8
|
+
'Space',
|
|
9
|
+
'User'
|
|
10
|
+
],
|
|
11
|
+
error: 'Unable to load options',
|
|
12
|
+
retry: 'Retry'
|
|
13
|
+
};
|
|
14
|
+
const en_US = messages;
|
|
15
|
+
const zh_CN_messages = {
|
|
16
|
+
levelNames: [
|
|
17
|
+
'知识库',
|
|
18
|
+
'数据空间',
|
|
19
|
+
'用户'
|
|
20
|
+
],
|
|
21
|
+
error: '选项加载失败',
|
|
22
|
+
retry: '重试'
|
|
23
|
+
};
|
|
24
|
+
const zh_CN = zh_CN_messages;
|
|
25
|
+
function resolveScopeCascadeLabels(locale) {
|
|
26
|
+
return resolveLocale({
|
|
27
|
+
'en-US': en_US,
|
|
28
|
+
'zh-CN': zh_CN
|
|
29
|
+
}, locale);
|
|
30
|
+
}
|
|
4
31
|
const indices = [
|
|
5
32
|
0,
|
|
6
33
|
1,
|
|
@@ -154,9 +181,11 @@ function ConnectedLevel(props) {
|
|
|
154
181
|
state: state
|
|
155
182
|
}, state.scopeKey);
|
|
156
183
|
}
|
|
157
|
-
function LevelView({ level, state, name, labels, retryLabel }) {
|
|
184
|
+
function LevelView({ level, locale, state, name, labels, retryLabel }) {
|
|
158
185
|
const [keyword, setKeyword] = useState('');
|
|
186
|
+
const text = resolveScopeCascadeLabels(locale);
|
|
159
187
|
return /*#__PURE__*/ jsx(ScopeSelector, {
|
|
188
|
+
locale: locale,
|
|
160
189
|
labels: labels,
|
|
161
190
|
kind: "selectable",
|
|
162
191
|
identity: {
|
|
@@ -189,39 +218,39 @@ function LevelView({ level, state, name, labels, retryLabel }) {
|
|
|
189
218
|
slots: {
|
|
190
219
|
errorFallback: /*#__PURE__*/ jsxs(Fragment, {
|
|
191
220
|
children: [
|
|
192
|
-
labels?.error ??
|
|
221
|
+
labels?.error ?? text.error,
|
|
193
222
|
' ',
|
|
194
223
|
/*#__PURE__*/ jsx("button", {
|
|
195
224
|
type: "button",
|
|
196
225
|
onClick: level.refresh,
|
|
197
|
-
children: retryLabel ??
|
|
226
|
+
children: retryLabel ?? text.retry
|
|
198
227
|
})
|
|
199
228
|
]
|
|
200
229
|
})
|
|
201
230
|
}
|
|
202
231
|
});
|
|
203
232
|
}
|
|
204
|
-
function ScopeCascade({ controller, labels, levelNames =
|
|
205
|
-
'Library',
|
|
206
|
-
'Space',
|
|
207
|
-
'User'
|
|
208
|
-
], retryLabel, ...props }) {
|
|
233
|
+
function ScopeCascade({ controller, locale, labels, levelNames = resolveScopeCascadeLabels(locale).levelNames, retryLabel, ...props }) {
|
|
209
234
|
return /*#__PURE__*/ jsxs(ScopeSwitcher, {
|
|
210
235
|
...props,
|
|
236
|
+
locale: locale,
|
|
211
237
|
children: [
|
|
212
238
|
/*#__PURE__*/ jsx(ConnectedLevel, {
|
|
239
|
+
locale: locale,
|
|
213
240
|
level: controller.levels[0],
|
|
214
241
|
name: levelNames[0],
|
|
215
242
|
labels: labels,
|
|
216
243
|
retryLabel: retryLabel
|
|
217
244
|
}),
|
|
218
245
|
/*#__PURE__*/ jsx(ConnectedLevel, {
|
|
246
|
+
locale: locale,
|
|
219
247
|
level: controller.levels[1],
|
|
220
248
|
name: levelNames[1],
|
|
221
249
|
labels: labels,
|
|
222
250
|
retryLabel: retryLabel
|
|
223
251
|
}),
|
|
224
252
|
/*#__PURE__*/ jsx(ConnectedLevel, {
|
|
253
|
+
locale: locale,
|
|
225
254
|
level: controller.levels[2],
|
|
226
255
|
name: levelNames[2],
|
|
227
256
|
labels: labels,
|
package/dist/l~0.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { FilePreview as file_preview_FilePreview } from "./3~0.js";
|
|
4
|
+
import { Tooltip } from "./r~0.js";
|
|
4
5
|
import { getFileTypeColor, resolveFileTypeIconKey, FolderIcon, getFileTypeIcon } from "./k~0.js";
|
|
6
|
+
import { FileBrowserEntries } from "./2~0.js";
|
|
5
7
|
import { FileTree as file_tree_FileTree } from "./n~0.js";
|
|
6
|
-
import {
|
|
8
|
+
import { resolveLocale } from "./nx~0.js";
|
|
9
|
+
import { OV_PATHS } from "./ck~0.js";
|
|
10
|
+
import { useOvClient } from "./ae~0.js";
|
|
7
11
|
function clampResizableWidth(width, min, max) {
|
|
8
12
|
const rounded = Math.round(width);
|
|
9
13
|
const lower = Math.max(min, rounded);
|
|
@@ -315,13 +319,14 @@ function directoryIcon() {
|
|
|
315
319
|
className: "ov-file-tree__file-type-icon"
|
|
316
320
|
});
|
|
317
321
|
}
|
|
318
|
-
function FileBrowserTreePane({
|
|
322
|
+
function FileBrowserTreePane({ entries, locale, searchId, browser, treeLabels, searchPlaceholder, refreshLabel, searchLoading, searchEmpty, searchErrorLabel, retryLabel }) {
|
|
319
323
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
320
324
|
children: [
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
+
/*#__PURE__*/ jsx(FileBrowserEntries, {
|
|
326
|
+
...entries,
|
|
327
|
+
locale: locale,
|
|
328
|
+
className: "ov-file-browser__entries"
|
|
329
|
+
}),
|
|
325
330
|
/*#__PURE__*/ jsx(FileBrowserToolbar, {
|
|
326
331
|
searchId: searchId,
|
|
327
332
|
query: browser.query,
|
|
@@ -335,6 +340,7 @@ function FileBrowserTreePane({ toolbarActions, searchId, browser, treeLabels, se
|
|
|
335
340
|
/*#__PURE__*/ jsx("div", {
|
|
336
341
|
className: "ov-file-browser__tree-scroll",
|
|
337
342
|
children: /*#__PURE__*/ jsx(file_tree_FileTree, {
|
|
343
|
+
locale: locale,
|
|
338
344
|
rows: browser.rows,
|
|
339
345
|
selectedId: browser.selectedId,
|
|
340
346
|
isReady: browser.isReady,
|
|
@@ -373,7 +379,8 @@ function FileBrowserTreePane({ toolbarActions, searchId, browser, treeLabels, se
|
|
|
373
379
|
]
|
|
374
380
|
});
|
|
375
381
|
}
|
|
376
|
-
const
|
|
382
|
+
const messages = {
|
|
383
|
+
formatCharacterCount: (count)=>`${count.toLocaleString('en-US')} ${1 === count ? 'character' : 'characters'}`,
|
|
377
384
|
empty: 'Select a file to preview',
|
|
378
385
|
error: 'Failed to load the directory',
|
|
379
386
|
retry: 'Retry',
|
|
@@ -396,10 +403,39 @@ const DEFAULT_LABELS = {
|
|
|
396
403
|
summaryEmpty: 'No summary generated yet',
|
|
397
404
|
summaryFailed: 'The summary could not be loaded.'
|
|
398
405
|
};
|
|
399
|
-
|
|
406
|
+
const en_US = messages;
|
|
407
|
+
const zh_CN_messages = {
|
|
408
|
+
formatCharacterCount: (count)=>`${count.toLocaleString('zh-CN')} 个字符`,
|
|
409
|
+
empty: '选择一个文件查看内容',
|
|
410
|
+
error: '目录加载失败',
|
|
411
|
+
retry: '重试',
|
|
412
|
+
refresh: '刷新',
|
|
413
|
+
searchPlaceholder: '搜索文件 ⌘+K...',
|
|
414
|
+
searchEmpty: '没有匹配的资源',
|
|
415
|
+
searchFailed: '搜索失败',
|
|
416
|
+
loading: '加载中…',
|
|
417
|
+
searchLoading: '搜索中…',
|
|
418
|
+
previewMode: '预览',
|
|
419
|
+
sourceMode: '源码',
|
|
420
|
+
copyPath: '复制路径',
|
|
421
|
+
copyContent: '复制正文',
|
|
422
|
+
download: '下载',
|
|
423
|
+
history: '版本历史',
|
|
424
|
+
viewSwitch: '切换视图',
|
|
425
|
+
resizeTree: '调整目录树宽度',
|
|
426
|
+
l0Summary: 'L0 摘要',
|
|
427
|
+
l1Overview: 'L1 总览',
|
|
428
|
+
summaryEmpty: '暂无生成内容',
|
|
429
|
+
summaryFailed: '摘要加载失败。'
|
|
430
|
+
};
|
|
431
|
+
const zh_CN = zh_CN_messages;
|
|
432
|
+
const LOCALES = {
|
|
433
|
+
'en-US': en_US,
|
|
434
|
+
'zh-CN': zh_CN
|
|
435
|
+
};
|
|
436
|
+
function resolveLabels(labels, locale) {
|
|
400
437
|
return {
|
|
401
|
-
...
|
|
402
|
-
...labels,
|
|
438
|
+
...resolveLocale(LOCALES, locale, labels),
|
|
403
439
|
tree: labels?.tree,
|
|
404
440
|
previewLabels: labels?.preview
|
|
405
441
|
};
|
|
@@ -412,84 +448,12 @@ function resolvePreviewLabels(text) {
|
|
|
412
448
|
...text.previewLabels
|
|
413
449
|
};
|
|
414
450
|
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
userRoot: '当前用户的上下文数据',
|
|
418
|
-
memories: '跨会话沉淀的长期记忆',
|
|
419
|
-
peers: '按应用或工作区隔离的上下文',
|
|
420
|
-
privacy: '密钥等敏感配置',
|
|
421
|
-
userResources: '该用户的私有知识资料',
|
|
422
|
-
sessions: '对话与任务运行记录',
|
|
423
|
-
skills: 'Agent 可用的技能与工具',
|
|
424
|
-
profile: '用户身份与背景',
|
|
425
|
-
preferences: '个性化偏好',
|
|
426
|
-
entities: '人物、项目、组织等实体',
|
|
427
|
-
events: '按日期归档的关键事件',
|
|
428
|
-
identity: 'Agent 名称与人设',
|
|
429
|
-
soul: 'Agent 行为准则与边界',
|
|
430
|
-
cases: '用于训练经验的交互案例',
|
|
431
|
-
trajectories: '可复用的任务执行轨迹',
|
|
432
|
-
experiences: '自动提炼的执行经验',
|
|
433
|
-
sharedResources: 'Agent 可引用的外部资料',
|
|
434
|
-
agentRoot: 'Agent 的能力、工具与经验',
|
|
435
|
-
agentEndpoints: '账号内共享的通信端点配置',
|
|
436
|
-
agentPayments: '账号内共享的支付能力配置',
|
|
437
|
-
agentSkills: '账号内可调用的技能定义',
|
|
438
|
-
agentTools: '账号内共享的工具配置',
|
|
439
|
-
memoryRoot: '长期记忆与累积信息',
|
|
440
|
-
resourceRoot: 'Agent 可引用的外部知识',
|
|
441
|
-
sessionRoot: '用户的原始会话记录',
|
|
442
|
-
systemRoot: '系统内置资源'
|
|
443
|
-
},
|
|
444
|
-
triggerBehavior: {
|
|
445
|
-
userRoot: '根据当前用户身份自动建立,无需手动创建',
|
|
446
|
-
memories: '提交会话、主动要求记住信息,或从会话中持续抽取',
|
|
447
|
-
peers: '以特定 peer 身份连接时建立,按 peer_id 隔离记忆与资料',
|
|
448
|
-
userResources: '导入资料时上传到该用户的私有资源目录',
|
|
449
|
-
sessions: '会话调用 OpenViking 时建立,消息、工具调用与归档持续写入',
|
|
450
|
-
skills: '作为个人技能被创建、安装或导入',
|
|
451
|
-
profile: '对话中出现稳定、明确的用户背景或工作方式',
|
|
452
|
-
preferences: '用户明确表达某个偏好、习惯或风格',
|
|
453
|
-
entities: '对话中出现值得保留的人物、项目或组织',
|
|
454
|
-
events: '对话中出现重要决定、承诺、安排、进展或结果',
|
|
455
|
-
identity: '首次记忆抽取时初始化,之后由写入操作更新',
|
|
456
|
-
soul: '首次记忆抽取时初始化,之后由写入操作调整',
|
|
457
|
-
cases: '提交了任务明确、执行结果可评估的会话',
|
|
458
|
-
trajectories: '提交了包含决策、工具调用或多步执行的任务',
|
|
459
|
-
experiences: '从任务案例与执行轨迹中提炼',
|
|
460
|
-
sharedResources: '导入资料时上传到共享资源空间',
|
|
461
|
-
agentEndpoints: '为账号注册集成端点时配置',
|
|
462
|
-
agentPayments: '为账号开通支付能力时配置',
|
|
463
|
-
agentSkills: '作为共享技能安装或导入,供所有 Agent 使用',
|
|
464
|
-
agentTools: '为账号注册工具时配置'
|
|
465
|
-
},
|
|
466
|
-
field: {
|
|
467
|
-
description: '说明',
|
|
468
|
-
triggerBehavior: '触发行为',
|
|
469
|
-
path: '路径'
|
|
470
|
-
}
|
|
471
|
-
};
|
|
472
|
-
function resolveTreeLabels(locale, hostLabels) {
|
|
473
|
-
if ('zh-CN' !== locale) return hostLabels;
|
|
474
|
-
const hostInfo = hostLabels?.info;
|
|
451
|
+
function resolveSummaryLabels(locale, labels) {
|
|
452
|
+
const text = resolveLabels(labels, locale);
|
|
475
453
|
return {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
...hostInfo,
|
|
480
|
-
description: {
|
|
481
|
-
...TREE_INFO_LABELS_ZH_CN.description,
|
|
482
|
-
...hostInfo?.description
|
|
483
|
-
},
|
|
484
|
-
triggerBehavior: {
|
|
485
|
-
...TREE_INFO_LABELS_ZH_CN.triggerBehavior,
|
|
486
|
-
...hostInfo?.triggerBehavior
|
|
487
|
-
},
|
|
488
|
-
field: {
|
|
489
|
-
...TREE_INFO_LABELS_ZH_CN.field,
|
|
490
|
-
...hostInfo?.field
|
|
491
|
-
}
|
|
492
|
-
}
|
|
454
|
+
l0: text.l0Summary,
|
|
455
|
+
l1: text.l1Overview,
|
|
456
|
+
failure: text.summaryFailed
|
|
493
457
|
};
|
|
494
458
|
}
|
|
495
459
|
function useContainerWidth() {
|
|
@@ -730,7 +694,7 @@ function toBinaryTab(uri, name, file, icon, openParent) {
|
|
|
730
694
|
}
|
|
731
695
|
};
|
|
732
696
|
}
|
|
733
|
-
async function readDirectory(client, uri, options
|
|
697
|
+
async function readDirectory(client, uri, options) {
|
|
734
698
|
const read = (path)=>client.request({
|
|
735
699
|
method: 'GET',
|
|
736
700
|
path,
|
|
@@ -756,12 +720,12 @@ async function readDirectory(client, uri, options, labels, openParent) {
|
|
|
756
720
|
if (aborted && !aborted.ok) throw aborted.cause;
|
|
757
721
|
if (!abstractResult.ok && !overviewResult.ok) throw abstractResult.cause;
|
|
758
722
|
const reason = (result)=>result.ok ? void 0 : result.cause instanceof Error ? result.cause.message : String(result.cause);
|
|
759
|
-
return
|
|
723
|
+
return {
|
|
760
724
|
abstract: abstractResult.ok ? abstractResult.text : '',
|
|
761
725
|
overview: overviewResult.ok ? overviewResult.text : '',
|
|
762
726
|
abstractError: reason(abstractResult),
|
|
763
727
|
overviewError: reason(overviewResult)
|
|
764
|
-
}
|
|
728
|
+
};
|
|
765
729
|
}
|
|
766
730
|
async function resolveIsDirectory(client, uri, options) {
|
|
767
731
|
try {
|
|
@@ -784,22 +748,19 @@ function abortError() {
|
|
|
784
748
|
return error;
|
|
785
749
|
}
|
|
786
750
|
const MAX_LINES = 2000;
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
l1: 'L1 Overview',
|
|
790
|
-
failure: 'The summary could not be loaded.'
|
|
791
|
-
};
|
|
792
|
-
function useFsPreview({ client, uri, resourceType = 'file', labels = DEFAULT_SUMMARY_LABELS, openParent, generation = 0, requestOptions }) {
|
|
751
|
+
function useFsPreview({ client, uri, resourceType = 'file', labels = resolveSummaryLabels('en-US'), formatCharacterCount = resolveLabels(void 0, 'en-US').formatCharacterCount, openParent, generation = 0, requestOptions }) {
|
|
752
|
+
const [directory, setDirectory] = useState(null);
|
|
793
753
|
const [tabs, setTabs] = useState(null);
|
|
794
754
|
const [activeKey, setActiveKey] = useState(null);
|
|
795
755
|
const [error, setError] = useState(null);
|
|
796
|
-
const [
|
|
756
|
+
const [characterCount, setCharacterCount] = useState();
|
|
797
757
|
useEffect(()=>{
|
|
758
|
+
setDirectory(null);
|
|
798
759
|
if (!client || !uri) {
|
|
799
760
|
setTabs(null);
|
|
800
761
|
setActiveKey(null);
|
|
801
762
|
setError(null);
|
|
802
|
-
|
|
763
|
+
setCharacterCount(void 0);
|
|
803
764
|
return;
|
|
804
765
|
}
|
|
805
766
|
const controller = new AbortController();
|
|
@@ -809,7 +770,7 @@ function useFsPreview({ client, uri, resourceType = 'file', labels = DEFAULT_SUM
|
|
|
809
770
|
setActiveKey(uri);
|
|
810
771
|
setActiveKey(null);
|
|
811
772
|
setError(null);
|
|
812
|
-
|
|
773
|
+
setCharacterCount(void 0);
|
|
813
774
|
const options = {
|
|
814
775
|
...requestOptions,
|
|
815
776
|
signal: controller.signal
|
|
@@ -817,16 +778,29 @@ function useFsPreview({ client, uri, resourceType = 'file', labels = DEFAULT_SUM
|
|
|
817
778
|
const read = (async ()=>{
|
|
818
779
|
const isDir = 'unknown' === resourceType ? await resolveIsDirectory(client, uri, options) : 'directory' === resourceType;
|
|
819
780
|
if (controller.signal.aborted) throw abortError();
|
|
820
|
-
return isDir ?
|
|
781
|
+
return isDir ? {
|
|
782
|
+
summary: await readDirectory(client, uri, options)
|
|
783
|
+
} : {
|
|
784
|
+
tab: await readFile(client, uri, options, openParent)
|
|
785
|
+
};
|
|
821
786
|
})();
|
|
822
|
-
read.then((
|
|
787
|
+
read.then((result)=>{
|
|
823
788
|
if (controller.signal.aborted) return;
|
|
789
|
+
if (result.summary) {
|
|
790
|
+
setDirectory({
|
|
791
|
+
uri,
|
|
792
|
+
summary: result.summary
|
|
793
|
+
});
|
|
794
|
+
setActiveKey(uri);
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
const tab = result.tab;
|
|
824
798
|
setTabs([
|
|
825
799
|
tab
|
|
826
800
|
]);
|
|
827
801
|
setActiveKey(tab.key);
|
|
828
|
-
const body =
|
|
829
|
-
|
|
802
|
+
const body = tab.source.content ?? '';
|
|
803
|
+
setCharacterCount(body.length);
|
|
830
804
|
}, (cause)=>{
|
|
831
805
|
if (isAbort(cause) || controller.signal.aborted) return;
|
|
832
806
|
setTabs([]);
|
|
@@ -837,16 +811,19 @@ function useFsPreview({ client, uri, resourceType = 'file', labels = DEFAULT_SUM
|
|
|
837
811
|
client,
|
|
838
812
|
uri,
|
|
839
813
|
resourceType,
|
|
840
|
-
labels,
|
|
841
814
|
openParent,
|
|
842
815
|
generation,
|
|
843
816
|
requestOptions
|
|
844
817
|
]);
|
|
818
|
+
const directoryTab = directory?.uri === uri ? toDirectoryTab(directory.uri, directory.summary, labels, openParent, directoryIcon()) : void 0;
|
|
819
|
+
const count = directoryTab ? (directoryTab.levels[0].source.content ?? '').length : characterCount;
|
|
845
820
|
return {
|
|
846
|
-
tabs
|
|
821
|
+
tabs: directoryTab ? [
|
|
822
|
+
directoryTab
|
|
823
|
+
] : tabs,
|
|
847
824
|
activeKey,
|
|
848
825
|
error,
|
|
849
|
-
footer,
|
|
826
|
+
footer: void 0 === count ? void 0 : formatCharacterCount(count),
|
|
850
827
|
setActiveKey
|
|
851
828
|
};
|
|
852
829
|
}
|
|
@@ -1262,7 +1239,7 @@ function useFsTree({ client, rootUri, defaultExpandedUri, requestOptions }) {
|
|
|
1262
1239
|
...state
|
|
1263
1240
|
};
|
|
1264
1241
|
}
|
|
1265
|
-
function useFileBrowser({ rootUri, controlled = false, summaryLabels, defaultExpandedUri, currentUri, requestOptions, onUriChange }) {
|
|
1242
|
+
function useFileBrowser({ rootUri, locale = 'en-US', controlled = false, summaryLabels, formatCharacterCount, defaultExpandedUri, currentUri, requestOptions, onUriChange }) {
|
|
1266
1243
|
const client = useOvClient();
|
|
1267
1244
|
const [query, setQuery] = useState('');
|
|
1268
1245
|
const [pendingUri, setPendingUri] = useState(currentUri);
|
|
@@ -1297,7 +1274,8 @@ function useFileBrowser({ rootUri, controlled = false, summaryLabels, defaultExp
|
|
|
1297
1274
|
client,
|
|
1298
1275
|
uri: activeUri,
|
|
1299
1276
|
resourceType,
|
|
1300
|
-
labels: summaryLabels,
|
|
1277
|
+
labels: summaryLabels ?? resolveSummaryLabels(locale),
|
|
1278
|
+
formatCharacterCount: formatCharacterCount ?? resolveLabels(void 0, locale).formatCharacterCount,
|
|
1301
1279
|
openParent,
|
|
1302
1280
|
generation: refreshGeneration,
|
|
1303
1281
|
requestOptions
|
|
@@ -1371,13 +1349,13 @@ function useFileBrowser({ rootUri, controlled = false, summaryLabels, defaultExp
|
|
|
1371
1349
|
actions
|
|
1372
1350
|
};
|
|
1373
1351
|
}
|
|
1374
|
-
function FileBrowser({ uri, defaultUri, rootUri = 'viking://', defaultExpandedUri, locale,
|
|
1352
|
+
function FileBrowser({ uri, defaultUri, rootUri = 'viking://', defaultExpandedUri, locale, agentConnect, onUriChange, onImportResources, renderImportResources, labels, requestOptions, className, style, ...rest }) {
|
|
1375
1353
|
const [internalUri, setInternalUri] = useState(()=>defaultUri ?? null);
|
|
1376
1354
|
const [preferredTreeWidth, setPreferredTreeWidth] = useState(352);
|
|
1377
1355
|
const searchId = useId();
|
|
1378
1356
|
const isControlled = void 0 !== uri;
|
|
1379
1357
|
const currentUri = isControlled ? uri : internalUri;
|
|
1380
|
-
const text = resolveLabels(labels);
|
|
1358
|
+
const text = resolveLabels(labels, locale);
|
|
1381
1359
|
const { ref: layoutRef, width: layoutWidth } = useContainerWidth();
|
|
1382
1360
|
const treeMaxWidth = resolveTreeMaxWidth(layoutWidth);
|
|
1383
1361
|
const treeWidth = Math.min(preferredTreeWidth, treeMaxWidth);
|
|
@@ -1397,17 +1375,16 @@ function FileBrowser({ uri, defaultUri, rootUri = 'viking://', defaultExpandedUr
|
|
|
1397
1375
|
text.l1Overview,
|
|
1398
1376
|
text.summaryFailed
|
|
1399
1377
|
]);
|
|
1400
|
-
const previewLabels = useMemo(()=>resolvePreviewLabels(resolveLabels(labels)), [
|
|
1401
|
-
labels
|
|
1402
|
-
|
|
1403
|
-
const treeLabels = useMemo(()=>resolveTreeLabels(locale, text.tree), [
|
|
1404
|
-
locale,
|
|
1405
|
-
text.tree
|
|
1378
|
+
const previewLabels = useMemo(()=>resolvePreviewLabels(resolveLabels(labels, locale)), [
|
|
1379
|
+
labels,
|
|
1380
|
+
locale
|
|
1406
1381
|
]);
|
|
1407
1382
|
const browser = useFileBrowser({
|
|
1408
1383
|
rootUri,
|
|
1384
|
+
locale,
|
|
1409
1385
|
controlled: isControlled,
|
|
1410
1386
|
summaryLabels,
|
|
1387
|
+
formatCharacterCount: text.formatCharacterCount,
|
|
1411
1388
|
defaultExpandedUri,
|
|
1412
1389
|
currentUri,
|
|
1413
1390
|
requestOptions,
|
|
@@ -1428,10 +1405,16 @@ function FileBrowser({ uri, defaultUri, rootUri = 'viking://', defaultExpandedUr
|
|
|
1428
1405
|
/*#__PURE__*/ jsx("div", {
|
|
1429
1406
|
className: "ov-file-browser__tree",
|
|
1430
1407
|
children: /*#__PURE__*/ jsx(FileBrowserTreePane, {
|
|
1431
|
-
|
|
1408
|
+
entries: {
|
|
1409
|
+
agentConnect,
|
|
1410
|
+
onImportResources,
|
|
1411
|
+
renderImportResources,
|
|
1412
|
+
labels: labels?.entries
|
|
1413
|
+
},
|
|
1432
1414
|
searchId: searchId,
|
|
1433
1415
|
browser: browser,
|
|
1434
|
-
treeLabels:
|
|
1416
|
+
treeLabels: text.tree,
|
|
1417
|
+
locale: locale,
|
|
1435
1418
|
searchPlaceholder: text.searchPlaceholder,
|
|
1436
1419
|
refreshLabel: text.refresh,
|
|
1437
1420
|
searchLoading: text.searchLoading,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { TuiRecord } from '../../components/tui/index.js';
|
|
2
|
+
import type { Locale } from '../../shared/locale.js';
|
|
3
|
+
import { resolveConsoleLocale } from './labels.js';
|
|
4
|
+
export interface ConsoleMessage {
|
|
5
|
+
code: keyof ReturnType<typeof resolveConsoleLocale>['messages'];
|
|
6
|
+
value?: string;
|
|
7
|
+
usage?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Internal metadata is formatted by the Hook and never exposed in its records. */
|
|
10
|
+
export type ConsoleRecord = TuiRecord & {
|
|
11
|
+
localMessage?: ConsoleMessage;
|
|
12
|
+
};
|
|
13
|
+
export declare function formatConsoleMessage(message: ConsoleMessage, locale: Locale): string;
|
|
14
|
+
export declare class ConsoleCommandError extends Error implements ConsoleMessage {
|
|
15
|
+
readonly code: ConsoleMessage['code'];
|
|
16
|
+
readonly value?: string | undefined;
|
|
17
|
+
readonly usage?: string | undefined;
|
|
18
|
+
constructor(code: ConsoleMessage['code'], value?: string | undefined, usage?: string | undefined, locale?: Locale);
|
|
19
|
+
}
|