@openviking/react 0.1.5 → 0.1.7
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 +15 -11
- package/dist/2~0.js +6 -5
- package/dist/37~0.js +27 -0
- package/dist/3c~0.js +24 -12
- package/dist/3~0.js +19 -9
- package/dist/ae~0.js +8 -1
- package/dist/ark-message-list-view~0.js +9 -4
- package/dist/a~0.js +13 -7
- package/dist/c7r~0.js +50 -0
- package/dist/ck~0.js +7 -0
- package/dist/client/paths.d.ts +10 -0
- package/dist/client/provider.d.ts +6 -1
- package/dist/components/agent-connect/style.css +268 -37
- package/dist/components/directory-tour/style.css +265 -21
- package/dist/components/directory-tour.js +1 -1
- package/dist/components/experience-dashboard/dashboard-tabs.d.ts +11 -0
- package/dist/components/experience-dashboard/experience-dashboard.d.ts +2 -0
- package/dist/components/experience-dashboard/experience-impact.d.ts +11 -0
- package/dist/components/experience-dashboard/experience-list.d.ts +9 -0
- package/dist/components/experience-dashboard/experience-pagination.d.ts +8 -0
- package/dist/components/experience-dashboard/experience-tests.d.ts +6 -0
- package/dist/components/experience-dashboard/experience-trajectories.d.ts +6 -0
- package/dist/components/experience-dashboard/index.d.ts +2 -0
- package/dist/components/experience-dashboard/labels.d.ts +2 -0
- package/dist/components/experience-dashboard/style.css +914 -0
- package/dist/components/experience-dashboard/style.js +0 -0
- package/dist/components/experience-dashboard/types.d.ts +106 -0
- package/dist/components/experience-dashboard.js +1 -0
- package/dist/components/file-browser-entries/style.css +463 -86
- package/dist/components/file-preview/style.css +267 -78
- package/dist/components/file-tree/file-tree-toolbar.d.ts +3 -3
- package/dist/components/file-tree/locales/en-US.d.ts +3 -0
- package/dist/components/file-tree/locales/zh-CN.d.ts +3 -0
- package/dist/components/file-tree/style.css +372 -88
- package/dist/components/file-tree/types.d.ts +13 -4
- package/dist/components/scope-switcher/style.css +412 -39
- package/dist/components/style.css +9326 -4553
- package/dist/components/tui/style.css +385 -67
- package/dist/components/viking-bot/interaction/style.css +143 -22
- package/dist/components/viking-bot/style.css +1075 -278
- package/dist/components/wiki-dashboard/index.d.ts +2 -0
- package/dist/components/wiki-dashboard/labels.d.ts +2 -0
- package/dist/components/wiki-dashboard/style.css +956 -0
- package/dist/components/wiki-dashboard/style.js +0 -0
- package/dist/components/wiki-dashboard/types.d.ts +92 -0
- package/dist/components/wiki-dashboard/wiki-action-button.d.ts +9 -0
- package/dist/components/wiki-dashboard/wiki-conflict-card.d.ts +15 -0
- package/dist/components/wiki-dashboard/wiki-dashboard.d.ts +2 -0
- package/dist/components/wiki-dashboard/wiki-file-icon.d.ts +3 -0
- package/dist/components/wiki-dashboard/wiki-severity-filter.d.ts +8 -0
- package/dist/components/wiki-dashboard.js +1 -0
- package/dist/c~0.js +16 -8
- package/dist/ep~0.js +345 -0
- package/dist/e~0.js +33 -328
- package/dist/fj~0.js +507 -0
- package/dist/fl~0.js +709 -0
- package/dist/f~0.js +12 -27
- package/dist/icons/index.d.ts +28 -0
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -1
- package/dist/k~0.js +277 -1
- package/dist/lk~0.js +56 -14
- package/dist/l~0.js +2786 -446
- package/dist/modules/console/index.d.ts +1 -2
- package/dist/modules/console/style.css +1787 -346
- package/dist/modules/console.js +1 -1
- package/dist/modules/file-browser/acl/acl-add-principal.d.ts +12 -0
- package/dist/modules/file-browser/acl/acl-candidate.d.ts +8 -0
- package/dist/modules/file-browser/acl/acl-client.d.ts +13 -0
- package/dist/modules/file-browser/acl/acl-confirmation.d.ts +6 -0
- package/dist/modules/file-browser/acl/acl-entry.d.ts +13 -0
- package/dist/modules/file-browser/acl/acl-labels.d.ts +47 -0
- package/dist/modules/file-browser/acl/acl-menu.d.ts +10 -0
- package/dist/modules/file-browser/acl/acl-modal.d.ts +17 -0
- package/dist/modules/file-browser/acl/acl-model.d.ts +17 -0
- package/dist/modules/file-browser/acl/acl-principal-tabs.d.ts +6 -0
- package/dist/modules/file-browser/acl/acl-tag.d.ts +7 -0
- package/dist/modules/file-browser/acl/locales/en-US.d.ts +44 -0
- package/dist/modules/file-browser/acl/locales/zh-CN.d.ts +44 -0
- package/dist/modules/file-browser/acl/use-acl-principals.d.ts +17 -0
- package/dist/modules/file-browser/acl/use-acl-report.d.ts +27 -0
- package/dist/modules/file-browser/acl-types.d.ts +86 -0
- package/dist/modules/file-browser/dashboard-data.d.ts +9 -0
- package/dist/modules/file-browser/dashboard-indicator.d.ts +8 -0
- package/dist/modules/file-browser/dashboard-labels.d.ts +9 -0
- package/dist/modules/file-browser/dashboard-model.d.ts +17 -0
- package/dist/modules/file-browser/dashboard-resource.d.ts +12 -0
- package/dist/modules/file-browser/experience-dashboard-pane.d.ts +8 -0
- package/dist/modules/file-browser/experience-data.d.ts +31 -0
- package/dist/modules/file-browser/file-browser-detail.d.ts +4 -1
- package/dist/modules/file-browser/file-browser-labels.d.ts +1 -1
- package/dist/modules/file-browser/file-browser-search.d.ts +20 -0
- package/dist/modules/file-browser/file-browser-toolbar.d.ts +3 -10
- package/dist/modules/file-browser/file-browser-tree-pane.d.ts +4 -7
- package/dist/modules/file-browser/file-browser.d.ts +1 -1
- package/dist/modules/file-browser/fs-directories.d.ts +9 -0
- package/dist/modules/file-browser/fs-lines.d.ts +36 -0
- package/dist/modules/file-browser/fs-memory-fields.d.ts +65 -0
- package/dist/modules/file-browser/fs-model.d.ts +15 -3
- package/dist/modules/file-browser/fs-read-file.d.ts +14 -0
- package/dist/modules/file-browser/index.d.ts +3 -2
- package/dist/modules/file-browser/locales/en-US.d.ts +5 -0
- package/dist/modules/file-browser/locales/zh-CN.d.ts +5 -0
- package/dist/modules/file-browser/style.css +4033 -483
- package/dist/modules/file-browser/types.d.ts +82 -20
- package/dist/modules/file-browser/use-browser-dashboards.d.ts +31 -0
- package/dist/modules/file-browser/use-dashboard-query.d.ts +9 -0
- package/dist/modules/file-browser/use-experience-dashboard.d.ts +27 -0
- package/dist/modules/file-browser/use-file-browser-acl.d.ts +15 -0
- package/dist/modules/file-browser/use-file-browser.d.ts +6 -51
- package/dist/modules/file-browser/use-fs-tree.d.ts +3 -0
- package/dist/modules/file-browser/use-wiki-dashboard.d.ts +17 -0
- package/dist/modules/file-browser/wiki-conflicts.d.ts +12 -0
- package/dist/modules/file-browser/wiki-dashboard-pane.d.ts +14 -0
- package/dist/modules/file-browser.js +1 -1
- package/dist/modules/scope-cascade/controller.d.ts +2 -2
- package/dist/modules/scope-cascade/index.d.ts +1 -2
- package/dist/modules/scope-cascade/scope-cascade.d.ts +1 -1
- package/dist/modules/scope-cascade/style.css +581 -39
- package/dist/modules/scope-cascade/types.d.ts +8 -3
- package/dist/modules/scope-cascade/use-scope-cascade.d.ts +2 -2
- package/dist/modules/scope-cascade.js +1 -1
- package/dist/modules/style.css +13589 -7966
- package/dist/n~0.js +73 -165
- package/dist/rt~0.js +255 -0
- package/dist/r~0.js +18 -39
- package/dist/shared/components/button/button.d.ts +20 -0
- package/dist/shared/components/input/input.d.ts +17 -0
- package/dist/shared/components/modal/locales/en-US.d.ts +4 -0
- package/dist/shared/components/modal/locales/zh-CN.d.ts +4 -0
- package/dist/shared/components/modal/modal.d.ts +2 -0
- package/dist/shared/components/modal/types.d.ts +18 -0
- package/dist/shared/components/overlay/lock-body-scroll.d.ts +1 -0
- package/dist/shared/components/popover/popover.d.ts +1 -1
- package/dist/shared/components/popover/types.d.ts +7 -1
- package/dist/shared/dashboard/dashboard-state.d.ts +12 -0
- package/dist/static/image/dashboard-background.png +0 -0
- package/dist/style.css +16088 -5602
- package/dist/s~0.js +16 -0
- package/dist/u~0.js +15 -6
- package/dist/viking-bot-composer~0.js +30 -12
- package/dist/viking-bot-interaction~0.js +2 -1
- package/package.json +14 -3
- package/dist/o~0.js +0 -106
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
English / [中文](README_CN.md)
|
|
4
4
|
|
|
5
|
-
Public UI components, composed modules
|
|
5
|
+
Public UI components, composed modules accept optional `locale: 'zh-CN' | 'en-US'`. Props override the nearest module or Provider; without a configured language, they use `en-US`. Existing `labels` override individual fields; omitted fields follow the current locale and update when it changes. Hosts still provide business content, slots and callback messages.
|
|
6
6
|
|
|
7
|
-
React foundations for OpenViking AI application interfaces: build tooling, documentation, layered directories, and scoped styles. FileTree, Tui and FilePreview provide working views, alongside five file-type icons. FileBrowser
|
|
7
|
+
React foundations for OpenViking AI application interfaces: build tooling, documentation, layered directories, and scoped styles. FileTree, Tui and FilePreview provide working views, alongside five file-type icons. FileBrowser coordinates browsing, previews and dashboards; Console provides a native command panel; ScopeCascade provides an integrated cascade selector.
|
|
8
8
|
|
|
9
9
|
This package inherits the repository's AGPL-3.0-only license. The release workflow publishes it to npm when a `react@<version>` tag matches the version in this package's manifest.
|
|
10
10
|
|
|
@@ -19,15 +19,15 @@ This package inherits the repository's AGPL-3.0-only license. The release workfl
|
|
|
19
19
|
| [components/scope-switcher](./src/components/scope-switcher/README.md) | `@openviking/react/components/scope-switcher` | Stateless scope layout and independent ScopeSelector options, panels and search |
|
|
20
20
|
| [components/agent-connect](./src/components/agent-connect/README.md) | `@openviking/react/components/agent-connect` | Fixed Figma connection view with original icons, built-in copy and clipboard feedback |
|
|
21
21
|
| [components/viking-bot](./src/components/viking-bot/README.md) | `@openviking/react/components/viking-bot` | Controlled conversation views, session controls, Markdown replies and composer |
|
|
22
|
-
| [modules](./src/modules/README.md) | `@openviking/react/modules/<module>` | Console panel and ScopeCascade Hooks and composition, plus
|
|
22
|
+
| [modules](./src/modules/README.md) | `@openviking/react/modules/<module>` | Console panel and ScopeCascade Hooks and composition, plus FileBrowser and independent dashboards |
|
|
23
23
|
| [client](./src/client/index.ts) | `@openviking/react/client` | Framework-neutral request client: `createOvClient`, `OvClient`, `OvClientError` |
|
|
24
24
|
| [hooks](./src/hooks/README.md), [utils](./src/utils/README.md) | Internal only | Cross-module Hooks and pure utilities |
|
|
25
25
|
|
|
26
|
-
Components implement their reviewed contracts incrementally. FileTree renders every documented row type with keyboard interaction; FilePreview implements the tab shell, header actions and the plain-text preview and editing foundation, with its body not yet wired to FileViewer. ScopeSwitcher is a stateless layout container; independently rendered ScopeSelector children own visibility, with host-owned per-level data subscriptions, search and requests. Tui renders records, results and the input. AgentConnect follows the Figma layout with built-in bilingual agent and developer integration content, host-provided credentials and locale, optional controlled selection and clipboard feedback. VikingBot provides a working view pending design review. Limits are described in each component's own docs. The package also ships five file-type icons.
|
|
26
|
+
Components implement their reviewed contracts incrementally. FileTree renders every documented row type with keyboard interaction; FilePreview implements the tab shell, header actions and the plain-text preview and editing foundation, with its body not yet wired to FileViewer. ScopeSwitcher is a stateless layout container; independently rendered ScopeSelector children own visibility, with host-owned per-level data subscriptions, search and requests. Tui renders records, results and the input. AgentConnect follows the Figma layout with built-in bilingual agent and developer integration content, host-provided credentials and locale, optional controlled selection and clipboard feedback. VikingBot provides a working view pending design review. Limits are described in each component's own docs. The package also ships five file-type icons, `ArrowRightIcon` and the three scope-level icons (`LibraryIcon`, `SpaceIcon`, `UserIcon`).
|
|
27
27
|
|
|
28
|
-
Components receive view data and state through props and express user intent through callbacks, following the [component directory conventions](./src/components/AGENTS.md). [modules](./src/modules/README.md) plan Hooks and views per business capability: Hooks load data, hold state and expose operations, and composite views wire them into components. Full pages and product-specific flows belong to the host; the admin console is out of scope for this phase. `console` exports a native command panel; its orchestration Hook stays internal and conversation data and callbacks are supplied by the host. `file-browser`
|
|
28
|
+
Components receive view data and state through props and express user intent through callbacks, following the [component directory conventions](./src/components/AGENTS.md). [modules](./src/modules/README.md) plan Hooks and views per business capability: Hooks load data, hold state and expose operations, and composite views wire them into components. Full pages and product-specific flows belong to the host; the admin console is out of scope for this phase. `console` exports a native command panel; its orchestration Hook stays internal and conversation data and callbacks are supplied by the host. `file-browser` provides browsing, preview and dashboard coordination.
|
|
29
29
|
|
|
30
|
-
Modules consume the native OpenViking API through a shared Client by default, with the Provider supplying `baseURL`, headers and other configuration, and
|
|
30
|
+
Modules consume the native OpenViking API through a shared Client by default, with the Provider supplying `baseURL`, headers and other configuration, and module views overriding individual fields through `requestOptions`. Standard integration needs no per-module Adapter; nonstandard gateways are adapted at the host's request boundary. The request contract — `OvRequestOptions`, `OvClient` and `OvClientError` — comes from the `@openviking/react/client` subpath, which ships a `fetch`-based `createOvClient`; the Provider is exported from the same subpath. Native module Hooks share this request boundary. ScopeCascade instead accepts three host API adapters and needs no Provider. See [request conventions](./src/modules/README.md#request-conventions-and-default-configuration).
|
|
31
31
|
|
|
32
32
|
Tui preserves JSON numeric tokens when indenting output. Structured resource links allow only `viking://`, `https://`, and `http://`; other targets render as text. Resource tables retain entry titles, native links and metadata. Output follows updates only near the bottom or after explicit submission. Read-only and disabled consoles cannot submit or insert help commands. `labels.resource` customizes the resource identity column.
|
|
33
33
|
|
|
@@ -41,9 +41,11 @@ The same props are consumed by different hosts. Hosts differ in flows and interf
|
|
|
41
41
|
- Icons, extension tabs, extra fields and toolbar actions come in as slots or nodes; components bind to no third-party UI library.
|
|
42
42
|
- List components render the rows or items the caller has already expanded; paging, loading, error and empty states come from module Hooks or the host.
|
|
43
43
|
|
|
44
|
+
`WikiDashboard` is exported from `@openviking/react/components/wiki-dashboard`; `ExperienceDashboard` from `@openviking/react/components/experience-dashboard`. Both are pure UI components receiving display data and state; FileBrowser owns native loading and response adaptation. Components and main Props types also appear at the package root. FileBrowser detects Wiki/experience entries, with `dashboardKinds` and `renderDashboard` for host permissions and gateway data. Each component exports `style.css`; FileBrowser styles include both boards. See the [dashboard docs](../../docs/docs/en/components/index.mdx).
|
|
45
|
+
|
|
44
46
|
## Public entries and styles
|
|
45
47
|
|
|
46
|
-
- The root entry exports each component and each business module placeholder with its main Props type (`<Component>Props`) only — currently `FileTree`, `Tui`, `ScopeSwitcher`, `ScopeSelector`, `ScopeCascade`, `AgentConnect` and Console
|
|
48
|
+
- The root entry exports each component and each business module placeholder with its main Props type (`<Component>Props`) only — currently `FileTree`, `Tui`, `ScopeSwitcher`, `ScopeSelector`, `ScopeCascade`, `AgentConnect` and Console, FileBrowser, WikiDashboard and ExperienceDashboard. Row types, option types, handles and label bags come from the `components/<component>` and `modules/<module>` subpaths. `FilePreview` is not on the root entry: its types reference the optional `@ark-design/ui`, and putting it there would make that peer required. ScopeCascade exports a working three-level composition with internal per-level subscriptions from `modules/scope-cascade`; Console exports its panel from `modules/console` and keeps its orchestration Hook internal; FileBrowser provides browsing and dashboard coordination. No aggregate `@openviking/react/components` or `@openviking/react/modules` JavaScript entry. Package exports are listed explicitly and internal files stay closed.
|
|
47
49
|
- Components expose only the explicitly listed layered subpaths, with no legacy path aliases.
|
|
48
50
|
- JS entries share implementations and never load CSS implicitly. Whole-package, component-set and single-module stylesheets are built from the same source, so import the scope you need.
|
|
49
51
|
|
|
@@ -55,7 +57,7 @@ The same props are consumed by different hosts. Hosts differ in flows and interf
|
|
|
55
57
|
| Business module set | `@openviking/react/modules/style.css` |
|
|
56
58
|
| Single business module | `@openviking/react/modules/<module>/style.css` |
|
|
57
59
|
|
|
58
|
-
Each CSS entry works
|
|
60
|
+
Each CSS entry works independently and includes the component styles it depends on. Business Hooks remain internal; no headless Hook entry is exposed.
|
|
59
61
|
|
|
60
62
|
```tsx
|
|
61
63
|
import { FileBrowser } from '@openviking/react/modules/file-browser';
|
|
@@ -67,7 +69,7 @@ import '@openviking/react/modules/file-browser/style.css';
|
|
|
67
69
|
/>;
|
|
68
70
|
```
|
|
69
71
|
|
|
70
|
-
|
|
72
|
+
Console accepts its documented panel props; native command execution uses Provider request configuration and starts only on explicit submission.
|
|
71
73
|
|
|
72
74
|
Experience dashboards belong to preview extensions; task progress starts inside its owning module; API Key display controls are reused on demand while credential creation and management belong to the host. No separate modules are added for these now.
|
|
73
75
|
|
|
@@ -79,7 +81,7 @@ import { PdfIcon } from '@openviking/react/icons';
|
|
|
79
81
|
<PdfIcon width={20} height={20} className="file-icon" alt="PDF" />;
|
|
80
82
|
```
|
|
81
83
|
|
|
82
|
-
Icons render as
|
|
84
|
+
Icons render as inline SVG. Decorative icons stay `aria-hidden`, while an icon that conveys meaning on its own can take an `aria-label`. SVGs are inlined into the build output, and hosts consume them directly from the package exports. `LibraryIcon`, `SpaceIcon` and `UserIcon` are the scope-level defaults; `ScopeCascade`'s default view applies them automatically when an adapter returns no `icon`.
|
|
83
85
|
|
|
84
86
|
React and ReactDOM are peer dependencies (`^18.2.0 || ^19.0.0`), automatically externalized by Rslib. Rslib emits shared ESM JavaScript and declarations, plus independently built CSS entries. The public `@openviking/react/style.css` entry resolves to `dist/style.css`. Styles are scoped and do not reset application styles.
|
|
85
87
|
|
|
@@ -87,7 +89,7 @@ From `frontend/`, run `npm run build:lib` to generate `packages/react/dist/`. Se
|
|
|
87
89
|
|
|
88
90
|
### ScopeCascade
|
|
89
91
|
|
|
90
|
-
Pass three stable API
|
|
92
|
+
Pass three stable API adapters directly to `<ScopeCascade {...api} onChange={handleSelection} />`. Adapters return `{ id, label }` options and receive an `AbortSignal`. The component owns requests, descendant resets, loading, retries and stale-response protection. `onChange` reports a complete `{ libraryId, spaceId, userId }` identity or `null` while incomplete. Import the component and Props from `@openviking/react/modules/scope-cascade` and its CSS from the corresponding `/style.css` entry.
|
|
91
93
|
|
|
92
94
|
## Maintaining built-in copy
|
|
93
95
|
|
|
@@ -96,3 +98,5 @@ Built-in translations live alongside each component or module in `locales/en-US.
|
|
|
96
98
|
Dynamic messages use typed formatter functions; dates and numbers use `Intl`. `npm test` checks matching keys, string placeholders and formatter arity across languages, while type checking validates parameter types. Undefined `labels` entries inherit the selected language; empty strings remain explicit overrides.
|
|
97
99
|
|
|
98
100
|
Set `locale` on `OpenVikingProvider` for a subtree. Optional module and component Props override the nearest scope, then fall back to `en-US`. Standalone Hooks also inherit the Provider. The private `src/shared/locale-context.tsx` is shared across public entries and remains separate from request-client configuration, so language changes preserve requests and state.
|
|
101
|
+
|
|
102
|
+
The internal Input, Button, Modal and Drawer adapt Arco Design logic (MIT); its notice ships in `LICENSE.arco-design`. Input and Button visual rules are adapted from the console's `@arco-design/theme-ve-o-aml-design@0.0.36` (MIT), rather than Arco's default skin. They have no public component entry.
|
package/dist/2~0.js
CHANGED
|
@@ -8,6 +8,7 @@ import { resolveLocale } from "./nx~0.js";
|
|
|
8
8
|
import { removereact } from "./4~0.js";
|
|
9
9
|
import { usePortalTheme } from "./9~0.js";
|
|
10
10
|
import { useLocale } from "./28~0.js";
|
|
11
|
+
import { button_Button } from "./e~0.js";
|
|
11
12
|
import { AgentConnect } from "./u~0.js";
|
|
12
13
|
import * as __rspack_external_react from "react";
|
|
13
14
|
__webpack_require__.add({
|
|
@@ -2282,8 +2283,8 @@ function FileBrowserEntries({ locale: localeProp, agentConnect, onConnectAgent,
|
|
|
2282
2283
|
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
2283
2284
|
const text = resolveFileBrowserEntriesLabels(locale, labels);
|
|
2284
2285
|
const showConnect = Boolean(agentConnect || onConnectAgent);
|
|
2285
|
-
const importButton = /*#__PURE__*/ jsxs(
|
|
2286
|
-
|
|
2286
|
+
const importButton = /*#__PURE__*/ jsxs(button_Button, {
|
|
2287
|
+
htmlType: "button",
|
|
2287
2288
|
className: "ov-file-browser-entries__entry",
|
|
2288
2289
|
onClick: onImportResources,
|
|
2289
2290
|
children: [
|
|
@@ -2308,9 +2309,9 @@ function FileBrowserEntries({ locale: localeProp, agentConnect, onConnectAgent,
|
|
|
2308
2309
|
className
|
|
2309
2310
|
].filter(Boolean).join(' '),
|
|
2310
2311
|
children: [
|
|
2311
|
-
showConnect ? /*#__PURE__*/ jsxs(
|
|
2312
|
+
showConnect ? /*#__PURE__*/ jsxs(button_Button, {
|
|
2312
2313
|
ref: triggerRef,
|
|
2313
|
-
|
|
2314
|
+
htmlType: "button",
|
|
2314
2315
|
className: "ov-file-browser-entries__entry",
|
|
2315
2316
|
"aria-haspopup": agentConnect ? 'dialog' : void 0,
|
|
2316
2317
|
"aria-controls": agentConnect ? drawerId : void 0,
|
|
@@ -2360,4 +2361,4 @@ function FileBrowserEntries({ locale: localeProp, agentConnect, onConnectAgent,
|
|
|
2360
2361
|
]
|
|
2361
2362
|
});
|
|
2362
2363
|
}
|
|
2363
|
-
export { FileBrowserEntries };
|
|
2364
|
+
export { FileBrowserEntries, es2015, lockBodyScroll };
|
package/dist/37~0.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
function DashboardState({ state = {}, empty, loading, failed, retry }) {
|
|
3
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
4
|
+
className: "ov-dashboard-state",
|
|
5
|
+
"aria-busy": state.loading,
|
|
6
|
+
children: [
|
|
7
|
+
/*#__PURE__*/ jsx("p", {
|
|
8
|
+
"aria-live": "polite",
|
|
9
|
+
children: state.loading ? loading : state.error ? failed : empty
|
|
10
|
+
}),
|
|
11
|
+
state.error ? /*#__PURE__*/ jsxs(Fragment, {
|
|
12
|
+
children: [
|
|
13
|
+
/*#__PURE__*/ jsx("p", {
|
|
14
|
+
children: state.error.message
|
|
15
|
+
}),
|
|
16
|
+
/*#__PURE__*/ jsx("button", {
|
|
17
|
+
type: "button",
|
|
18
|
+
disabled: !state.onRetry,
|
|
19
|
+
onClick: state.onRetry,
|
|
20
|
+
children: retry
|
|
21
|
+
})
|
|
22
|
+
]
|
|
23
|
+
}) : null
|
|
24
|
+
]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export { DashboardState };
|
package/dist/3c~0.js
CHANGED
|
@@ -5,7 +5,8 @@ import remark_gfm from "remark-gfm";
|
|
|
5
5
|
import { ArrowRightIcon } from "./k~0.js";
|
|
6
6
|
import { resolveLocale } from "./nx~0.js";
|
|
7
7
|
import { checkreact } from "./0~0.js";
|
|
8
|
-
import { Tooltip } from "./
|
|
8
|
+
import { Tooltip } from "./rt~0.js";
|
|
9
|
+
import { button_Button } from "./e~0.js";
|
|
9
10
|
import { useLocale } from "./28~0.js";
|
|
10
11
|
function getTuiCommandInputText(command) {
|
|
11
12
|
return command.inputText?.trim() || command.name;
|
|
@@ -965,13 +966,19 @@ function TuiEmptyRegion({ emptyState, commands, labels, disabled, onPick }) {
|
|
|
965
966
|
height: 14,
|
|
966
967
|
focusable: "false"
|
|
967
968
|
}),
|
|
968
|
-
/*#__PURE__*/
|
|
969
|
-
className: "ov-tui__empty-
|
|
970
|
-
children:
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
969
|
+
/*#__PURE__*/ jsxs("span", {
|
|
970
|
+
className: "ov-tui__empty-content",
|
|
971
|
+
children: [
|
|
972
|
+
/*#__PURE__*/ jsx("span", {
|
|
973
|
+
className: "ov-tui__empty-name",
|
|
974
|
+
children: command.name
|
|
975
|
+
}),
|
|
976
|
+
/*#__PURE__*/ jsx("span", {
|
|
977
|
+
className: "ov-tui__empty-desc",
|
|
978
|
+
title: command.summary ?? command.description,
|
|
979
|
+
children: command.summary ?? command.description
|
|
980
|
+
})
|
|
981
|
+
]
|
|
975
982
|
})
|
|
976
983
|
]
|
|
977
984
|
})
|
|
@@ -1164,8 +1171,11 @@ function TuiCopyButton({ text, label, copiedLabel, onCopy, className }) {
|
|
|
1164
1171
|
};
|
|
1165
1172
|
return /*#__PURE__*/ jsx(Tooltip, {
|
|
1166
1173
|
content: copied ? copiedLabel : label,
|
|
1167
|
-
children: /*#__PURE__*/ jsx(
|
|
1168
|
-
|
|
1174
|
+
children: /*#__PURE__*/ jsx(button_Button, {
|
|
1175
|
+
size: "mini",
|
|
1176
|
+
type: "text",
|
|
1177
|
+
iconOnly: true,
|
|
1178
|
+
htmlType: "button",
|
|
1169
1179
|
className: [
|
|
1170
1180
|
'ov-tui__copy',
|
|
1171
1181
|
className
|
|
@@ -1531,8 +1541,10 @@ function TuiResourceTree({ content, onOpenUri, loadMoreLabel, noResultLabel, res
|
|
|
1531
1541
|
})
|
|
1532
1542
|
}, item.id))
|
|
1533
1543
|
}),
|
|
1534
|
-
hiddenCount > 0 ? /*#__PURE__*/ jsxs(
|
|
1535
|
-
|
|
1544
|
+
hiddenCount > 0 ? /*#__PURE__*/ jsxs(button_Button, {
|
|
1545
|
+
size: "small",
|
|
1546
|
+
type: "default",
|
|
1547
|
+
htmlType: "button",
|
|
1536
1548
|
className: "ov-tui__load-more",
|
|
1537
1549
|
onClick: ()=>setVisibleCount((count)=>count + PAGE_SIZE),
|
|
1538
1550
|
children: [
|
package/dist/3~0.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment as external_react_Fragment, Suspense, forwardRef, lazy, useCallback, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { button_Button } from "./e~0.js";
|
|
4
|
+
import { Tooltip } from "./rt~0.js";
|
|
4
5
|
import { resolveLocale, mergeLabels } from "./nx~0.js";
|
|
5
6
|
import { useLocale } from "./28~0.js";
|
|
6
7
|
function FilePreviewImageFrame({ children }) {
|
|
@@ -37,8 +38,10 @@ function FilePreviewEditor({ draft, text, loading, failed, saveFailed, saving, o
|
|
|
37
38
|
className: "ov-file-preview__state-title",
|
|
38
39
|
children: text.loadFailed
|
|
39
40
|
}),
|
|
40
|
-
/*#__PURE__*/ jsx(
|
|
41
|
-
|
|
41
|
+
/*#__PURE__*/ jsx(button_Button, {
|
|
42
|
+
size: "small",
|
|
43
|
+
type: "default",
|
|
44
|
+
htmlType: "button",
|
|
42
45
|
className: "ov-file-preview__button",
|
|
43
46
|
onClick: onCancel,
|
|
44
47
|
children: text.leaveEditing
|
|
@@ -140,8 +143,10 @@ function LoadFailedState({ text, description, onRetry }) {
|
|
|
140
143
|
return /*#__PURE__*/ jsx(StatePanel, {
|
|
141
144
|
title: text.loadFailed,
|
|
142
145
|
description: description,
|
|
143
|
-
action: onRetry ? /*#__PURE__*/ jsx(
|
|
144
|
-
|
|
146
|
+
action: onRetry ? /*#__PURE__*/ jsx(button_Button, {
|
|
147
|
+
size: "small",
|
|
148
|
+
type: "default",
|
|
149
|
+
htmlType: "button",
|
|
145
150
|
className: "ov-file-preview__button",
|
|
146
151
|
onClick: onRetry,
|
|
147
152
|
children: text.retry
|
|
@@ -151,8 +156,10 @@ function LoadFailedState({ text, description, onRetry }) {
|
|
|
151
156
|
function UnsupportedState({ text, onDownload }) {
|
|
152
157
|
return /*#__PURE__*/ jsx(StatePanel, {
|
|
153
158
|
title: text.unsupported,
|
|
154
|
-
action: onDownload ? /*#__PURE__*/ jsx(
|
|
155
|
-
|
|
159
|
+
action: onDownload ? /*#__PURE__*/ jsx(button_Button, {
|
|
160
|
+
size: "small",
|
|
161
|
+
type: "default",
|
|
162
|
+
htmlType: "button",
|
|
156
163
|
className: "ov-file-preview__button",
|
|
157
164
|
onClick: onDownload,
|
|
158
165
|
children: text.download
|
|
@@ -451,8 +458,11 @@ function FilePreviewBreadcrumb({ hiddenPathLabel, segments, title, canOpen, disa
|
|
|
451
458
|
function FilePreviewCopyPath({ label, disabled, onClick }) {
|
|
452
459
|
return /*#__PURE__*/ jsx(Tooltip, {
|
|
453
460
|
content: label,
|
|
454
|
-
children: /*#__PURE__*/ jsx(
|
|
455
|
-
|
|
461
|
+
children: /*#__PURE__*/ jsx(button_Button, {
|
|
462
|
+
size: "small",
|
|
463
|
+
type: "text",
|
|
464
|
+
iconOnly: true,
|
|
465
|
+
htmlType: "button",
|
|
456
466
|
className: "ov-file-preview__action",
|
|
457
467
|
"aria-label": label,
|
|
458
468
|
disabled: disabled,
|
package/dist/ae~0.js
CHANGED
|
@@ -488,4 +488,11 @@ function useOvClient() {
|
|
|
488
488
|
function useOvSignal() {
|
|
489
489
|
return useContext(OvClientContext)?.base.signal;
|
|
490
490
|
}
|
|
491
|
-
|
|
491
|
+
function useOvIdentity(options) {
|
|
492
|
+
const base = useContext(OvClientContext)?.base.identity;
|
|
493
|
+
return {
|
|
494
|
+
accountId: options?.accountId ?? base?.accountId,
|
|
495
|
+
userId: options?.userId ?? base?.userId
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
export { OpenVikingProvider, OvClientError, createOvClient, isOvClientError, useOvClient, useOvIdentity, useOvSignal };
|
|
@@ -9,6 +9,7 @@ import { DocumentIcon } from "./k~0.js";
|
|
|
9
9
|
import { VikingBotIcon } from "./lg~0.js";
|
|
10
10
|
import { groupActivityParts, mergeToolResults, resolveVikingBotLabels, toRenderItems } from "./c~0.js";
|
|
11
11
|
import { groupByActivity, messageText, groupMessages } from "./h~0.js";
|
|
12
|
+
import { button_Button } from "./e~0.js";
|
|
12
13
|
const PREFIX = '#viking-uri=';
|
|
13
14
|
const RESOURCE = /viking:\/\/[^\s<>"'`]+/gi;
|
|
14
15
|
const PROSE_RESOURCE = /viking:\/\/[^\s<>"'`,。;!?)\]]+/gi;
|
|
@@ -532,8 +533,10 @@ function MessageFooter({ message, showTime, labels, locale, onCopy }) {
|
|
|
532
533
|
dateTime: message.createdAt,
|
|
533
534
|
children: time
|
|
534
535
|
}) : null,
|
|
535
|
-
canCopy ? onCopy ? /*#__PURE__*/ jsx(
|
|
536
|
-
|
|
536
|
+
canCopy ? onCopy ? /*#__PURE__*/ jsx(button_Button, {
|
|
537
|
+
size: "mini",
|
|
538
|
+
type: "text",
|
|
539
|
+
htmlType: "button",
|
|
537
540
|
className: "ov-viking-bot__copy",
|
|
538
541
|
onClick: ()=>onCopy(text),
|
|
539
542
|
children: labels.copy
|
|
@@ -560,8 +563,10 @@ function MessageActions({ message, onMessageAction }) {
|
|
|
560
563
|
if (0 === actions.length) return null;
|
|
561
564
|
return /*#__PURE__*/ jsx("div", {
|
|
562
565
|
className: "ov-viking-bot__message-actions",
|
|
563
|
-
children: actions.map(({ messageId, action })=>/*#__PURE__*/ jsx(
|
|
564
|
-
|
|
566
|
+
children: actions.map(({ messageId, action })=>/*#__PURE__*/ jsx(button_Button, {
|
|
567
|
+
size: "small",
|
|
568
|
+
type: "default",
|
|
569
|
+
htmlType: "button",
|
|
565
570
|
className: "ov-viking-bot__message-action",
|
|
566
571
|
disabled: Boolean(action.disabledReason) || 'pending' === action.status || 'success' === action.status,
|
|
567
572
|
title: action.disabledReason,
|
package/dist/a~0.js
CHANGED
|
@@ -5,8 +5,8 @@ import { resolveLocale, mergeLabels } from "./nx~0.js";
|
|
|
5
5
|
import { useOvSignal, useOvClient, createOvClient, isOvClientError } from "./ae~0.js";
|
|
6
6
|
import { useLocale, LocaleProvider } from "./28~0.js";
|
|
7
7
|
import { new_sessionreact, historyreact } from "./lg~0.js";
|
|
8
|
-
import { useOverlayPosition } from "./
|
|
9
|
-
import {
|
|
8
|
+
import { Tooltip, useOverlayPosition } from "./rt~0.js";
|
|
9
|
+
import { button_Button } from "./e~0.js";
|
|
10
10
|
import { VikingBotSessionActions, VikingBot } from "./c~0.js";
|
|
11
11
|
import { Tui } from "./3c~0.js";
|
|
12
12
|
const command_specs_uri = {
|
|
@@ -1066,9 +1066,12 @@ function ConsoleHistory({ records, isExecuting, locale, labels, onRecall }) {
|
|
|
1066
1066
|
/*#__PURE__*/ jsx(Tooltip, {
|
|
1067
1067
|
content: labels.history,
|
|
1068
1068
|
className: "ov-console__action-tooltip",
|
|
1069
|
-
children: /*#__PURE__*/ jsx(
|
|
1069
|
+
children: /*#__PURE__*/ jsx(button_Button, {
|
|
1070
|
+
size: "small",
|
|
1071
|
+
type: "text",
|
|
1072
|
+
iconOnly: true,
|
|
1070
1073
|
...invoker,
|
|
1071
|
-
|
|
1074
|
+
htmlType: "button",
|
|
1072
1075
|
className: "ov-console__action",
|
|
1073
1076
|
"aria-label": labels.history,
|
|
1074
1077
|
"aria-haspopup": "dialog",
|
|
@@ -1181,9 +1184,12 @@ function ConsoleToolbar({ mode, panelId, locale, labels, records, isExecuting, o
|
|
|
1181
1184
|
/*#__PURE__*/ jsx(Tooltip, {
|
|
1182
1185
|
content: labels.clear,
|
|
1183
1186
|
className: "ov-console__action-tooltip",
|
|
1184
|
-
children: /*#__PURE__*/ jsx(
|
|
1187
|
+
children: /*#__PURE__*/ jsx(button_Button, {
|
|
1188
|
+
size: "small",
|
|
1189
|
+
type: "text",
|
|
1190
|
+
iconOnly: true,
|
|
1185
1191
|
className: "ov-console__action",
|
|
1186
|
-
|
|
1192
|
+
htmlType: "button",
|
|
1187
1193
|
"aria-label": labels.clear,
|
|
1188
1194
|
onClick: ()=>{
|
|
1189
1195
|
setSessionVersion((version)=>version + 1);
|
|
@@ -1304,4 +1310,4 @@ function Console({ mode, defaultMode, locale: localeProp, quickCommands = DEFAUL
|
|
|
1304
1310
|
})
|
|
1305
1311
|
});
|
|
1306
1312
|
}
|
|
1307
|
-
export { Console
|
|
1313
|
+
export { Console };
|
package/dist/c7r~0.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
const input_Input = /*#__PURE__*/ forwardRef(function({ size = 'default', prefix, suffix, className, style, disabled, ...rest }, ref) {
|
|
4
|
+
return /*#__PURE__*/ jsxs("span", {
|
|
5
|
+
role: "presentation",
|
|
6
|
+
className: [
|
|
7
|
+
'ov-input',
|
|
8
|
+
`ov-input--${size}`,
|
|
9
|
+
disabled && 'ov-input--disabled',
|
|
10
|
+
className
|
|
11
|
+
].filter(Boolean).join(' '),
|
|
12
|
+
style: style,
|
|
13
|
+
onMouseDown: (event)=>{
|
|
14
|
+
if (event.target !== event.currentTarget.querySelector('input')) event.preventDefault();
|
|
15
|
+
},
|
|
16
|
+
onClick: (event)=>{
|
|
17
|
+
const input = event.currentTarget.querySelector('input');
|
|
18
|
+
if (!disabled && !event.defaultPrevented && event.target !== input) input?.focus();
|
|
19
|
+
},
|
|
20
|
+
children: [
|
|
21
|
+
null != prefix ? /*#__PURE__*/ jsx("span", {
|
|
22
|
+
className: "ov-input__affix",
|
|
23
|
+
"aria-hidden": "true",
|
|
24
|
+
children: prefix
|
|
25
|
+
}) : null,
|
|
26
|
+
/*#__PURE__*/ jsx("input", {
|
|
27
|
+
...rest,
|
|
28
|
+
ref: ref,
|
|
29
|
+
disabled: disabled,
|
|
30
|
+
className: "ov-input__element"
|
|
31
|
+
}),
|
|
32
|
+
null != suffix ? /*#__PURE__*/ jsx("span", {
|
|
33
|
+
className: "ov-input__affix",
|
|
34
|
+
"aria-hidden": "true",
|
|
35
|
+
children: suffix
|
|
36
|
+
}) : null
|
|
37
|
+
]
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
const input_TextArea = /*#__PURE__*/ forwardRef(function({ className, ...rest }, ref) {
|
|
41
|
+
return /*#__PURE__*/ jsx("textarea", {
|
|
42
|
+
...rest,
|
|
43
|
+
ref: ref,
|
|
44
|
+
className: [
|
|
45
|
+
'ov-textarea',
|
|
46
|
+
className
|
|
47
|
+
].filter(Boolean).join(' ')
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
export { input_Input, input_TextArea };
|
package/dist/ck~0.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
const OV_PATHS = {
|
|
2
|
+
acl: '/api/v1/acl',
|
|
2
3
|
fsLs: '/api/v1/fs/ls',
|
|
4
|
+
fsAttrs: '/api/v1/fs/attrs',
|
|
5
|
+
compileConfigs: '/api/v1/compile/configs',
|
|
6
|
+
experienceTrajectories: '/api/v1/agent-evolution/experiences/trajectories',
|
|
7
|
+
experienceOutcomes: '/api/v1/agent-evolution/experiences/outcomes',
|
|
3
8
|
fsStat: '/api/v1/fs/stat',
|
|
4
9
|
fsTree: '/api/v1/fs/tree',
|
|
5
10
|
fsMkdir: '/api/v1/fs/mkdir',
|
|
@@ -17,6 +22,8 @@ const OV_PATHS = {
|
|
|
17
22
|
botChatStream: '/bot/v1/chat/stream'
|
|
18
23
|
};
|
|
19
24
|
const OV_PATH_BUILDERS = {
|
|
25
|
+
accountUsers: (accountId)=>`/api/v1/admin/accounts/${encodeURIComponent(accountId)}/users`,
|
|
26
|
+
accountGroups: (accountId)=>`/api/v1/admin/accounts/${encodeURIComponent(accountId)}/groups`,
|
|
20
27
|
session: (sessionId)=>`${OV_PATHS.sessions}/${encodeURIComponent(sessionId)}`,
|
|
21
28
|
sessionMessages: (sessionId)=>`${OV_PATH_BUILDERS.session(sessionId)}/messages`
|
|
22
29
|
};
|
package/dist/client/paths.d.ts
CHANGED
|
@@ -16,8 +16,14 @@
|
|
|
16
16
|
* `verbatimModuleSyntax` cannot use.
|
|
17
17
|
*/
|
|
18
18
|
export declare const OV_PATHS: {
|
|
19
|
+
/** 资源访问控制。Resource access control. */
|
|
20
|
+
readonly acl: '/api/v1/acl';
|
|
19
21
|
/** 列出目录内容。List directory contents. */
|
|
20
22
|
readonly fsLs: '/api/v1/fs/ls';
|
|
23
|
+
readonly fsAttrs: '/api/v1/fs/attrs';
|
|
24
|
+
readonly compileConfigs: '/api/v1/compile/configs';
|
|
25
|
+
readonly experienceTrajectories: '/api/v1/agent-evolution/experiences/trajectories';
|
|
26
|
+
readonly experienceOutcomes: '/api/v1/agent-evolution/experiences/outcomes';
|
|
21
27
|
/** 读取条目状态。Read an entry's status. */
|
|
22
28
|
readonly fsStat: '/api/v1/fs/stat';
|
|
23
29
|
/** 读取目录树。Read a directory tree. */
|
|
@@ -57,6 +63,10 @@ export type OvPath = (typeof OV_PATHS)[keyof typeof OV_PATHS];
|
|
|
57
63
|
* containing `/` is not read as a path separator.
|
|
58
64
|
*/
|
|
59
65
|
export declare const OV_PATH_BUILDERS: {
|
|
66
|
+
/** 账号用户目录(可关闭凭证返回)。Account user directory. */
|
|
67
|
+
readonly accountUsers: (accountId: string) => string;
|
|
68
|
+
/** 账号用户组目录。Account group directory. */
|
|
69
|
+
readonly accountGroups: (accountId: string) => string;
|
|
60
70
|
/** 单个会话。One session. */
|
|
61
71
|
readonly session: (sessionId: string) => string;
|
|
62
72
|
/** 会话的消息。Messages of one session. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { Locale } from '../shared/locale.js';
|
|
3
|
-
import type { OvClient, OvClientOptions } from './types.js';
|
|
3
|
+
import type { OvClient, OvClientOptions, OvRequestOptions } from './types.js';
|
|
4
4
|
/**
|
|
5
5
|
* {@link OpenVikingProvider} 的属性。请求字段与 {@link OvClientOptions} 同形,另可设置界面语言:
|
|
6
6
|
* 服务地址、身份与作用域、Cookie 策略,都按字段传值。
|
|
@@ -56,3 +56,8 @@ export declare function OpenVikingProvider({ baseURL, apiKey, accountId, userId,
|
|
|
56
56
|
export declare function useOvClient(): OvClient | null;
|
|
57
57
|
/** Internal: modules compose their request lifetime with the inherited signal. */
|
|
58
58
|
export declare function useOvSignal(): AbortSignal | undefined;
|
|
59
|
+
/** Internal identity inheritance for account-scoped principal directories. */
|
|
60
|
+
export declare function useOvIdentity(options?: OvRequestOptions): {
|
|
61
|
+
accountId: import("./types.js").OvIdentityValue | undefined;
|
|
62
|
+
userId: import("./types.js").OvIdentityValue | undefined;
|
|
63
|
+
};
|