@openviking/react 0.1.8-beta.12.1.g83d24ca4fc6f → 0.1.8-beta.13.1.g5043e1f3169a

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.
Files changed (74) hide show
  1. package/dist/{ae~0.js → 10~0.js} +42 -1
  2. package/dist/2~0.js +1 -1
  3. package/dist/3c~0.js +117 -79
  4. package/dist/3~0.js +37 -39
  5. package/dist/ark-message-list-view~0.js +2 -3
  6. package/dist/a~0.js +640 -205
  7. package/dist/client/paths.d.ts +13 -0
  8. package/dist/client.js +1 -2
  9. package/dist/components/agent-connect/style.css +29 -0
  10. package/dist/components/agent-connect/types.d.ts +4 -1
  11. package/dist/components/api-key-login-form/style.css +29 -0
  12. package/dist/components/directory-tour/illustrations.d.ts +3 -0
  13. package/dist/components/directory-tour/style.css +86 -8
  14. package/dist/components/directory-tour/tour-card.d.ts +2 -5
  15. package/dist/components/directory-tour/types.d.ts +3 -1
  16. package/dist/components/directory-tour/use-tour-anchor.d.ts +1 -1
  17. package/dist/components/directory-tour.js +3 -3
  18. package/dist/components/email-login-form/style.css +29 -0
  19. package/dist/components/experience-dashboard/style.css +29 -0
  20. package/dist/components/file-browser-entries/style.css +87 -0
  21. package/dist/components/file-preview/file-preview-frontmatter.d.ts +2 -0
  22. package/dist/components/file-preview/style.css +89 -9
  23. package/dist/components/file-tree/file-tree-root-order.d.ts +3 -0
  24. package/dist/components/file-tree/style.css +29 -0
  25. package/dist/components/file-tree/types.d.ts +9 -6
  26. package/dist/components/invitation-confirmation/style.css +29 -0
  27. package/dist/components/login-method-selector/style.css +29 -0
  28. package/dist/components/password-reset-request-form/style.css +29 -0
  29. package/dist/components/password-setup-form/style.css +29 -0
  30. package/dist/components/scope-switcher/style.css +29 -0
  31. package/dist/components/style.css +865 -33
  32. package/dist/components/tui/style.css +119 -16
  33. package/dist/components/tui/tui-empty.d.ts +1 -1
  34. package/dist/components/viking-bot/capabilities.d.ts +2 -0
  35. package/dist/components/viking-bot/locales/en-US.d.ts +2 -0
  36. package/dist/components/viking-bot/locales/zh-CN.d.ts +2 -0
  37. package/dist/components/viking-bot/model.d.ts +2 -0
  38. package/dist/components/viking-bot/session-actions.d.ts +3 -1
  39. package/dist/components/viking-bot/session-meta.d.ts +8 -0
  40. package/dist/components/viking-bot/style.css +136 -0
  41. package/dist/components/wiki-dashboard/style.css +29 -0
  42. package/dist/c~0.js +101 -7
  43. package/dist/er~0.js +40 -0
  44. package/dist/e~0.js +543 -37
  45. package/dist/file-preview-viewer~0.js +32 -0
  46. package/dist/fj~0.js +1 -1
  47. package/dist/fl~0.js +1 -1
  48. package/dist/icons.js +1 -2
  49. package/dist/index.js +1 -1
  50. package/dist/k~0.js +193 -2
  51. package/dist/l5~0.js +22 -9
  52. package/dist/lk~0.js +1 -1
  53. package/dist/modules/console/command-parser.d.ts +3 -0
  54. package/dist/modules/console/command-specs.d.ts +1 -0
  55. package/dist/modules/console/commands.d.ts +3 -1
  56. package/dist/modules/console/core-command-specs.d.ts +2 -0
  57. package/dist/modules/console/labels.d.ts +56 -1
  58. package/dist/modules/console/locales/en-US.d.ts +56 -1
  59. package/dist/modules/console/style.css +317 -16
  60. package/dist/modules/console/types.d.ts +4 -0
  61. package/dist/modules/file-browser/file-browser-tree-pane.d.ts +2 -1
  62. package/dist/modules/file-browser/style.css +317 -18
  63. package/dist/modules/scope-cascade/style.css +29 -0
  64. package/dist/modules/style.css +692 -34
  65. package/dist/n~0.js +70 -6
  66. package/dist/static/svg/cancel.svg +5 -0
  67. package/dist/static/svg/save.svg +5 -0
  68. package/dist/style.css +1586 -67
  69. package/dist/u~0.js +10 -6
  70. package/dist/viking-bot-composer~0.js +2 -3
  71. package/package.json +3 -2
  72. package/dist/ck~0.js +0 -30
  73. package/dist/ep~0.js +0 -493
  74. package/dist/lg~0.js +0 -195
@@ -495,4 +495,45 @@ function useOvIdentity(options) {
495
495
  userId: options?.userId ?? base?.userId
496
496
  };
497
497
  }
498
- export { OpenVikingProvider, OvClientError, createOvClient, isOvClientError, useOvClient, useOvIdentity, useOvSignal };
498
+ const OV_PATHS = {
499
+ health: '/health',
500
+ systemStatus: '/api/v1/system/status',
501
+ acl: '/api/v1/acl',
502
+ resources: '/api/v1/resources',
503
+ skills: '/api/v1/skills',
504
+ fsLs: '/api/v1/fs/ls',
505
+ fsAttrs: '/api/v1/fs/attrs',
506
+ compile: '/api/v1/compile',
507
+ compileConfigs: '/api/v1/compile/configs',
508
+ experienceTrajectories: '/api/v1/agent-evolution/experiences/trajectories',
509
+ experienceOutcomes: '/api/v1/agent-evolution/experiences/outcomes',
510
+ fsStat: '/api/v1/fs/stat',
511
+ fsTree: '/api/v1/fs/tree',
512
+ fsMkdir: '/api/v1/fs/mkdir',
513
+ fsMv: '/api/v1/fs/mv',
514
+ fsCp: '/api/v1/fs/cp',
515
+ fsRm: '/api/v1/fs',
516
+ contentRead: '/api/v1/content/read',
517
+ contentAbstract: '/api/v1/content/abstract',
518
+ contentOverview: '/api/v1/content/overview',
519
+ contentDownload: '/api/v1/content/download',
520
+ contentWrite: '/api/v1/content/write',
521
+ searchGlob: '/api/v1/search/glob',
522
+ searchFind: '/api/v1/search/find',
523
+ searchQuery: '/api/v1/search/search',
524
+ searchGrep: '/api/v1/search/grep',
525
+ sessions: '/api/v1/sessions',
526
+ tasks: '/api/v1/tasks',
527
+ botChat: '/bot/v1/chat',
528
+ botChatStream: '/bot/v1/chat/stream'
529
+ };
530
+ const OV_PATH_BUILDERS = {
531
+ accountUsers: (accountId)=>`/api/v1/admin/accounts/${encodeURIComponent(accountId)}/users`,
532
+ accountGroups: (accountId)=>`/api/v1/admin/accounts/${encodeURIComponent(accountId)}/groups`,
533
+ session: (sessionId)=>`${OV_PATHS.sessions}/${encodeURIComponent(sessionId)}`,
534
+ sessionMessages: (sessionId)=>`${OV_PATH_BUILDERS.session(sessionId)}/messages`,
535
+ sessionCommit: (sessionId)=>`${OV_PATH_BUILDERS.session(sessionId)}/commit`,
536
+ task: (taskId)=>`${OV_PATHS.tasks}/${encodeURIComponent(taskId)}`,
537
+ taskCancel: (taskId)=>`${OV_PATH_BUILDERS.task(taskId)}/cancel`
538
+ };
539
+ export { OV_PATHS, OV_PATH_BUILDERS, OpenVikingProvider, OvClientError, createOvClient, isOvClientError, useOvClient, useOvIdentity, useOvSignal };
package/dist/2~0.js CHANGED
@@ -8,7 +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
+ import { button_Button } from "./er~0.js";
12
12
  import { AgentConnect } from "./u~0.js";
13
13
  import * as __rspack_external_react from "react";
14
14
  __webpack_require__.add({
package/dist/3c~0.js CHANGED
@@ -2,11 +2,11 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Children, createContext, isValidElement, useCallback, useContext, useEffect, useId, useMemo, useRef, useState, useSyncExternalStore } from "react";
3
3
  import react_markdown, { defaultUrlTransform } from "react-markdown";
4
4
  import remark_gfm from "remark-gfm";
5
- import { ArrowRightIcon } from "./k~0.js";
6
5
  import { resolveLocale } from "./nx~0.js";
7
- import { checkreact } from "./0~0.js";
8
6
  import { Tooltip } from "./rt~0.js";
9
- import { button_Button } from "./e~0.js";
7
+ import { ArrowRightIcon } from "./k~0.js";
8
+ import { checkreact } from "./0~0.js";
9
+ import { button_Button } from "./er~0.js";
10
10
  import { useLocale } from "./28~0.js";
11
11
  function getTuiCommandInputText(command) {
12
12
  return command.inputText?.trim() || command.name;
@@ -80,12 +80,9 @@ function TuiParamHint({ command, labels, onPick }) {
80
80
  /*#__PURE__*/ jsxs("div", {
81
81
  className: "ov-tui__hint-head",
82
82
  children: [
83
- /*#__PURE__*/ jsxs("code", {
83
+ /*#__PURE__*/ jsx("code", {
84
84
  className: "ov-tui__hint-name",
85
- children: [
86
- "/",
87
- command.name
88
- ]
85
+ children: getTuiCommandInputText(command)
89
86
  }),
90
87
  /*#__PURE__*/ jsx("span", {
91
88
  className: "ov-tui__hint-desc",
@@ -921,82 +918,27 @@ function TuiComposer({ anchorRef, assistId, onFocus, onDismiss, onRequestPalette
921
918
  ]
922
919
  });
923
920
  }
924
- function pickTuiCommands(shortcuts = [], commands) {
925
- const byName = new Map(commands.map((command)=>[
926
- command.name,
927
- command
928
- ]));
929
- const firstByName = new Map();
930
- for (const shortcut of shortcuts)if (!firstByName.has(shortcut.name)) firstByName.set(shortcut.name, shortcut);
931
- return [
932
- ...firstByName.values()
933
- ].flatMap((shortcut)=>{
934
- const command = byName.get(shortcut.name);
935
- return command ? [
936
- {
937
- ...command,
938
- value: shortcut.value
939
- }
940
- ] : [];
941
- });
942
- }
943
- function TuiEmptyRegion({ emptyState, commands, labels, disabled, onPick }) {
944
- if (void 0 !== emptyState) return null === emptyState ? null : /*#__PURE__*/ jsx("div", {
945
- className: "ov-tui__empty",
946
- children: emptyState
947
- });
948
- if (!commands.length) return null;
949
- return /*#__PURE__*/ jsxs("div", {
950
- className: "ov-tui__empty ov-tui__empty--hero",
921
+ const SvgCliTitle = (props)=>/*#__PURE__*/ jsxs("svg", {
922
+ xmlns: "http://www.w3.org/2000/svg",
923
+ width: 245,
924
+ height: 40,
925
+ fill: "none",
926
+ viewBox: "0 0 245 40",
927
+ ...props,
951
928
  children: [
952
- /*#__PURE__*/ jsx("h3", {
953
- className: "ov-tui__empty-title",
954
- children: labels.emptyTitle
955
- }),
956
- /*#__PURE__*/ jsx("p", {
957
- className: "ov-tui__empty-subtitle",
958
- children: labels.emptyDescription
959
- }),
960
- /*#__PURE__*/ jsx("p", {
961
- className: "ov-tui__empty-quick-label",
962
- children: labels.quickStart
929
+ /*#__PURE__*/ jsx("path", {
930
+ fill: "currentColor",
931
+ fillOpacity: 0.8,
932
+ d: "M10.207 31.375q-2.637 0-4.336-.363-1.7-.352-2.66-1.313-.95-.96-1.336-2.765-.375-1.806-.375-4.7v-.468q0-2.391.234-4.008.235-1.629.809-2.649t1.559-1.558q.996-.54 2.496-.727 1.5-.2 3.609-.199h4.723q2.11 0 3.61.2 1.5.186 2.483.726.997.54 1.57 1.558.575 1.02.81 2.649.234 1.617.234 4.008v.468q0 2.895-.387 4.7-.375 1.805-1.336 2.765-.95.96-2.648 1.313-1.7.363-4.336.363zm0-1.945h4.723q1.675 0 2.824-.117t1.863-.504a2.5 2.5 0 0 0 1.102-1.172q.386-.786.527-2.098.14-1.313.14-3.305v-.468q0-2.062-.14-3.399-.141-1.335-.527-2.11-.375-.773-1.102-1.124-.715-.364-1.863-.457a32 32 0 0 0-2.824-.106h-4.723q-1.676 0-2.824.106-1.148.093-1.875.457-.715.352-1.102 1.125-.375.773-.515 2.11-.141 1.335-.141 3.398v.468q0 1.992.14 3.305.141 1.312.516 2.098.387.785 1.102 1.172.727.386 1.875.503a29 29 0 0 0 2.824.118m31.762-5.25q0-1.676-.176-2.684-.164-1.008-.738-1.512-.574-.515-1.793-.691-1.208-.176-3.305-.176-1.91 0-3.094.176t-1.816.691q-.633.504-.867 1.512-.235 1.008-.235 2.684 0 1.734.235 2.777t.867 1.57q.633.516 1.816.692 1.184.165 3.094.164 2.097 0 3.305-.164 1.218-.176 1.793-.692.575-.527.738-1.57.176-1.043.176-2.777M27.695 35.5v-18h2.25v1.535q.855-1.137 2.344-1.465 1.5-.328 3.668-.328 2.274 0 3.844.235 1.581.234 2.554.937.974.703 1.418 2.086.446 1.383.446 3.68 0 2.367-.446 3.785-.445 1.418-1.418 2.133-.973.703-2.554.925-1.57.235-3.844.235-2.168 0-3.668-.328-1.488-.329-2.344-1.477V35.5zm35.606-8.508q0 1.512-.457 2.38-.445.866-1.371 1.265-.926.397-2.367.504-1.43.117-3.41.117-2.263 0-3.844-.235-1.57-.223-2.543-.925-.962-.716-1.407-2.133-.433-1.418-.433-3.785 0-2.297.422-3.68.434-1.383 1.394-2.086t2.52-.937q1.57-.235 3.832-.235 2.59 0 4.289.363 1.699.364 2.531 1.383.844 1.02.844 2.989v2.894H49.73q.011 1.5.21 2.402.2.903.797 1.36.598.457 1.782.61 1.194.14 3.175.14 1.782 0 2.871-.07 1.103-.07 1.664-.305.575-.246.774-.727.2-.48.2-1.289zm-7.664-7.875q-1.91 0-3.082.14-1.161.142-1.77.552-.609.398-.832 1.195-.21.796-.223 2.098h11.415v-1.125q0-.844-.2-1.395-.187-.562-.75-.879-.563-.328-1.664-.457-1.09-.129-2.894-.129M67.266 31V17.5h2.25v1.793q.504-.68 1.242-1.137.75-.456 1.992-.68 1.254-.234 3.281-.234 2.649 0 4.172.516 1.535.516 2.18 1.84t.644 3.75V31h-2.261v-7.652q0-1.383-.235-2.227t-.808-1.277q-.563-.434-1.559-.575-.996-.152-2.531-.152-2.345 0-3.68.387-1.336.387-1.887 1.219-.55.82-.55 2.144V31zm28.726 0L86.29 13h2.578l8.625 16.406L106.117 13h2.543l-9.668 18zm16 0V18.25h2.25V31zm0-15.75V13h2.25v2.25zm6.32 15.75V13h2.25v10.395l8.965-5.895h3.411l-9.528 6.34 9.902 7.16h-3.351l-9.399-6.926V31zm17.5 0V18.25h2.25V31zm0-15.75V13h2.25v2.25zM142.109 31V17.5h2.25v1.793q.504-.68 1.243-1.137.75-.456 1.992-.68 1.254-.234 3.281-.234 2.649 0 4.172.516 1.535.516 2.18 1.84.644 1.324.644 3.75V31h-2.262v-7.652q0-1.383-.234-2.227t-.809-1.277q-.562-.434-1.558-.575-.996-.152-2.531-.152-2.344 0-3.68.387t-1.887 1.219q-.55.82-.551 2.144V31zm28.012 5.145q-1.793 0-3.269-.094-1.465-.083-2.52-.422-1.055-.328-1.629-1.055-.574-.715-.574-1.968h2.25q0 .82.633 1.171.644.352 1.922.422 1.277.07 3.187.07 1.418 0 2.426-.093 1.008-.083 1.641-.504.644-.422.937-1.418.305-.984.305-2.777v-.317q-.82 1.054-2.262 1.395-1.43.34-3.551.34-2.191 0-3.738-.247-1.547-.257-2.52-.96-.96-.704-1.406-2.04-.445-1.335-.445-3.492 0-2.297.445-3.68.446-1.382 1.406-2.074.973-.703 2.52-.925 1.547-.235 3.738-.235 2.121 0 3.551.317 1.442.305 2.262 1.37V17.5h2.25v12.07q-.048 2.227-.563 3.54-.516 1.323-1.476 1.968-.95.657-2.344.856-1.383.21-3.176.21m5.309-11.989q0-1.676-.211-2.672-.2-1.008-.797-1.511-.586-.515-1.746-.68-1.148-.176-3.059-.176-2.016 0-3.199.176-1.171.164-1.746.68-.575.504-.75 1.511-.165.996-.164 2.672 0 1.524.164 2.485.175.96.738 1.476.575.516 1.758.715 1.183.188 3.199.188 1.91 0 3.059-.188 1.16-.2 1.746-.715.597-.516.797-1.476.21-.962.211-2.485m14.117-1.922v-.468q0-2.391.234-4.008.235-1.629.809-2.649t1.558-1.558q.996-.54 2.497-.727 1.5-.2 3.609-.199h4.723q2.413 0 4.066.234 1.664.223 2.672.903 1.02.668 1.476 1.98.457 1.301.457 3.457h-2.25q0-1.7-.304-2.637-.305-.949-1.032-1.37-.714-.423-1.957-.516-1.242-.106-3.128-.106h-4.723q-1.676 0-2.824.106-1.149.093-1.875.457-.715.352-1.102 1.125-.375.773-.515 2.11-.141 1.335-.141 3.398v.468q0 1.992.141 3.305.14 1.312.515 2.098.387.785 1.102 1.172.726.386 1.875.503a29 29 0 0 0 2.824.118h4.723q1.886 0 3.128-.082t1.957-.48q.727-.4 1.032-1.325.304-.938.304-2.625h2.25q0 2.157-.457 3.445-.456 1.29-1.476 1.946-1.008.644-2.672.855-1.653.21-4.066.211h-4.723q-2.637 0-4.336-.363-1.7-.352-2.66-1.313-.95-.96-1.336-2.765-.375-1.806-.375-4.7M216.445 31V13h2.25v16.125h14.25V31z"
963
933
  }),
964
- /*#__PURE__*/ jsx("ul", {
965
- className: "ov-tui__empty-list",
966
- children: commands.map((command)=>/*#__PURE__*/ jsx("li", {
967
- className: "ov-tui__empty-item",
968
- children: /*#__PURE__*/ jsxs("button", {
969
- type: "button",
970
- className: "ov-tui__empty-action",
971
- disabled: disabled,
972
- onClick: ()=>onPick(command.value),
973
- children: [
974
- /*#__PURE__*/ jsx(ArrowRightIcon, {
975
- width: 14,
976
- height: 14,
977
- focusable: "false"
978
- }),
979
- /*#__PURE__*/ jsxs("span", {
980
- className: "ov-tui__empty-content",
981
- children: [
982
- /*#__PURE__*/ jsx("span", {
983
- className: "ov-tui__empty-name",
984
- children: command.name
985
- }),
986
- /*#__PURE__*/ jsx("span", {
987
- className: "ov-tui__empty-desc",
988
- title: command.summary ?? command.description,
989
- children: command.summary ?? command.description
990
- })
991
- ]
992
- })
993
- ]
994
- })
995
- }, command.name))
934
+ /*#__PURE__*/ jsx("path", {
935
+ fill: "currentColor",
936
+ d: "M237 12h8v20h-8z",
937
+ opacity: 0.13
996
938
  })
997
939
  ]
998
940
  });
999
- }
941
+ const cli_titlereact = SvgCliTitle;
1000
942
  const messages = {
1001
943
  placeholder: '>_ Enter CLI commands, e.g. ov find OpenViking',
1002
944
  unavailableMessage: 'Commands are unavailable right now.',
@@ -1071,9 +1013,105 @@ const LOCALES = {
1071
1013
  'en-US': en_US,
1072
1014
  'zh-CN': zh_CN
1073
1015
  };
1016
+ const DEFAULT_TUI_LABELS = en_US;
1074
1017
  function resolveTuiLabels(labels, locale = 'en-US') {
1075
1018
  return resolveLocale(LOCALES, locale, labels);
1076
1019
  }
1020
+ function pickTuiCommands(shortcuts = [], commands) {
1021
+ const byName = new Map(commands.map((command)=>[
1022
+ command.name,
1023
+ command
1024
+ ]));
1025
+ const firstByName = new Map();
1026
+ for (const shortcut of shortcuts)if (!firstByName.has(shortcut.name)) firstByName.set(shortcut.name, shortcut);
1027
+ return [
1028
+ ...firstByName.values()
1029
+ ].flatMap((shortcut)=>{
1030
+ const command = byName.get(shortcut.name);
1031
+ return command ? [
1032
+ {
1033
+ ...command,
1034
+ value: shortcut.value
1035
+ }
1036
+ ] : [];
1037
+ });
1038
+ }
1039
+ function TuiEmptyRegion({ emptyState, commands, labels, disabled, onPick }) {
1040
+ if (void 0 !== emptyState) return null === emptyState ? null : /*#__PURE__*/ jsx("div", {
1041
+ className: "ov-tui__empty",
1042
+ children: emptyState
1043
+ });
1044
+ if (!commands.length) return null;
1045
+ const showTitleArtwork = labels.emptyTitle === DEFAULT_TUI_LABELS.emptyTitle;
1046
+ return /*#__PURE__*/ jsxs("div", {
1047
+ className: "ov-tui__empty ov-tui__empty--hero",
1048
+ children: [
1049
+ /*#__PURE__*/ jsx("h3", {
1050
+ className: "ov-tui__empty-title",
1051
+ "data-artwork": showTitleArtwork || void 0,
1052
+ children: showTitleArtwork ? /*#__PURE__*/ jsxs(Fragment, {
1053
+ children: [
1054
+ /*#__PURE__*/ jsx("span", {
1055
+ className: "ov-tui__empty-title-label",
1056
+ children: labels.emptyTitle
1057
+ }),
1058
+ /*#__PURE__*/ jsx(cli_titlereact, {
1059
+ className: "ov-tui__empty-title-artwork",
1060
+ "aria-hidden": "true",
1061
+ focusable: "false"
1062
+ })
1063
+ ]
1064
+ }) : labels.emptyTitle
1065
+ }),
1066
+ /*#__PURE__*/ jsx("p", {
1067
+ className: "ov-tui__empty-subtitle",
1068
+ children: labels.emptyDescription
1069
+ }),
1070
+ /*#__PURE__*/ jsx("p", {
1071
+ className: "ov-tui__empty-quick-label",
1072
+ children: labels.quickStart
1073
+ }),
1074
+ /*#__PURE__*/ jsx("ul", {
1075
+ className: "ov-tui__empty-list",
1076
+ children: commands.map((command)=>/*#__PURE__*/ jsx("li", {
1077
+ className: "ov-tui__empty-item",
1078
+ children: /*#__PURE__*/ jsx(Tooltip, {
1079
+ content: command.description,
1080
+ placement: "top",
1081
+ disabled: disabled,
1082
+ className: "ov-tui__quick-tooltip",
1083
+ children: /*#__PURE__*/ jsxs("button", {
1084
+ type: "button",
1085
+ className: "ov-tui__empty-action",
1086
+ disabled: disabled,
1087
+ onClick: ()=>onPick(command.value),
1088
+ children: [
1089
+ /*#__PURE__*/ jsx(ArrowRightIcon, {
1090
+ width: 14,
1091
+ height: 14,
1092
+ focusable: "false"
1093
+ }),
1094
+ /*#__PURE__*/ jsxs("span", {
1095
+ className: "ov-tui__empty-content",
1096
+ children: [
1097
+ /*#__PURE__*/ jsx("span", {
1098
+ className: "ov-tui__empty-name",
1099
+ children: command.name
1100
+ }),
1101
+ /*#__PURE__*/ jsx("span", {
1102
+ className: "ov-tui__empty-desc",
1103
+ children: command.summary ?? command.description
1104
+ })
1105
+ ]
1106
+ })
1107
+ ]
1108
+ })
1109
+ })
1110
+ }, command.name))
1111
+ })
1112
+ ]
1113
+ });
1114
+ }
1077
1115
  function TuiCommandHelp({ content, onPick, labels }) {
1078
1116
  return /*#__PURE__*/ jsxs("div", {
1079
1117
  className: "ov-tui__help",
package/dist/3~0.js CHANGED
@@ -1,6 +1,6 @@
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 { button_Button } from "./e~0.js";
3
+ import { button_Button } from "./er~0.js";
4
4
  import { WikiEditIcon } from "./k~0.js";
5
5
  import { Tooltip } from "./rt~0.js";
6
6
  import { resolveLocale, mergeLabels } from "./nx~0.js";
@@ -226,13 +226,41 @@ function FilePreviewBody({ fileTab, text, locale, viewMode, editing, onViewModeC
226
226
  }
227
227
  function FilePreviewToolbar({ actions, text, extraActions }) {
228
228
  const [copyResult, setCopyResult] = useState();
229
- if (actions.editing) return null;
230
- const hasActions = actions.canCopyContent || actions.canEdit || actions.canDownload || extraActions;
229
+ const hasActions = actions.editing || actions.canCopyContent || actions.canEdit || actions.canDownload || extraActions;
231
230
  if (!actions.canSwitchView && !hasActions) return null;
232
231
  const copyLabel = void 0 === copyResult ? text.copyContent : copyResult ? text.copied : text.copyFailed;
233
232
  return /*#__PURE__*/ jsxs("div", {
234
233
  className: "ov-file-preview__toolbar",
235
234
  children: [
235
+ actions.editing ? /*#__PURE__*/ jsxs("div", {
236
+ className: "ov-file-preview__edit-actions",
237
+ children: [
238
+ /*#__PURE__*/ jsx(button_Button, {
239
+ size: "small",
240
+ type: "default",
241
+ className: "ov-file-preview__edit-action",
242
+ icon: /*#__PURE__*/ jsx("span", {
243
+ "aria-hidden": "true",
244
+ className: "ov-file-preview__edit-icon ov-file-preview__edit-icon--cancel"
245
+ }),
246
+ disabled: actions.busy,
247
+ onClick: actions.cancelEditing,
248
+ children: text.leaveEditing
249
+ }),
250
+ /*#__PURE__*/ jsx(button_Button, {
251
+ size: "small",
252
+ type: "primary",
253
+ className: "ov-file-preview__edit-action",
254
+ icon: /*#__PURE__*/ jsx("span", {
255
+ "aria-hidden": "true",
256
+ className: "ov-file-preview__edit-icon ov-file-preview__edit-icon--save"
257
+ }),
258
+ loading: actions.busy,
259
+ onClick: ()=>void actions.saveEditing(),
260
+ children: text.save
261
+ })
262
+ ]
263
+ }) : null,
236
264
  actions.canSwitchView ? /*#__PURE__*/ jsx("div", {
237
265
  className: "ov-file-preview__switch",
238
266
  role: "group",
@@ -244,7 +272,7 @@ function FilePreviewToolbar({ actions, text, extraActions }) {
244
272
  type: "button",
245
273
  className: "ov-file-preview__switch-item",
246
274
  "aria-pressed": actions.viewMode === mode,
247
- disabled: actions.busy,
275
+ disabled: actions.busy || actions.editing,
248
276
  onClick: ()=>actions.setViewMode(mode),
249
277
  children: 'preview' === mode ? text.previewMode : text.sourceMode
250
278
  }, mode))
@@ -572,12 +600,9 @@ function FilePreviewBreadcrumb({ hiddenPathLabel, segments, title, canOpen, disa
572
600
  function FilePreviewCopyPath({ label, disabled, onClick }) {
573
601
  return /*#__PURE__*/ jsx(Tooltip, {
574
602
  content: label,
575
- children: /*#__PURE__*/ jsx(button_Button, {
576
- size: "small",
577
- type: "text",
578
- iconOnly: true,
579
- htmlType: "button",
580
- className: "ov-file-preview__action",
603
+ children: /*#__PURE__*/ jsx("button", {
604
+ type: "button",
605
+ className: "ov-file-preview__action ov-file-preview__action--copy-path",
581
606
  "aria-label": label,
582
607
  disabled: disabled,
583
608
  onClick: onClick,
@@ -863,33 +888,6 @@ function FilePreviewPanels({ levelKey, onLevelChange, contentTab, directoryTab,
863
888
  text: text,
864
889
  onOpenParent: (uri)=>void actions.openParent(activeTab, uri)
865
890
  }),
866
- editing.editing && fileTab.slots?.actions === void 0 ? /*#__PURE__*/ jsxs("div", {
867
- className: "ov-file-preview__edit-toolbar",
868
- children: [
869
- /*#__PURE__*/ jsx("span", {
870
- children: text.editFile
871
- }),
872
- /*#__PURE__*/ jsxs("div", {
873
- className: "ov-file-preview__toolbar",
874
- children: [
875
- /*#__PURE__*/ jsx(button_Button, {
876
- size: "small",
877
- type: "default",
878
- disabled: editing.saving,
879
- onClick: actionContext.cancelEditing,
880
- children: text.leaveEditing
881
- }),
882
- /*#__PURE__*/ jsx(button_Button, {
883
- size: "small",
884
- type: "primary",
885
- loading: editing.saving,
886
- onClick: ()=>void actionContext.saveEditing(),
887
- children: text.save
888
- })
889
- ]
890
- })
891
- ]
892
- }) : null,
893
891
  /*#__PURE__*/ jsx("div", {
894
892
  className: "ov-file-preview__body",
895
893
  children: /*#__PURE__*/ jsx(FilePreviewBody, {
@@ -1014,9 +1012,9 @@ const zh_CN_messages = {
1014
1012
  viewSwitch: '显示模式',
1015
1013
  edit: '编辑',
1016
1014
  editFile: '编辑文件',
1017
- save: '保存',
1015
+ save: '保存编辑',
1018
1016
  editor: '编辑正文',
1019
- leaveEditing: '取消',
1017
+ leaveEditing: '取消编辑',
1020
1018
  retry: '重试',
1021
1019
  loadFailed: '文件加载失败',
1022
1020
  saveFailed: '保存失败',
@@ -6,11 +6,10 @@ import { Fragment as external_react_Fragment, useEffect, useMemo, useState } fro
6
6
  import { ActivityTimeline } from "@ark-design/ui/activity-timeline";
7
7
  import { MDRenderer } from "@ark-design/ui/markdown-renderer";
8
8
  import { UserMessageFileList } from "@ark-design/ui/user-message-file-list";
9
- import { DocumentIcon } from "./k~0.js";
10
- import { VikingBotIcon } from "./lg~0.js";
9
+ import { VikingBotIcon, DocumentIcon } from "./k~0.js";
11
10
  import { groupActivityParts, mergeToolResults, resolveVikingBotLabels, toRenderItems } from "./c~0.js";
12
11
  import { groupByActivity, messageText, groupMessages } from "./h~0.js";
13
- import { button_Button } from "./e~0.js";
12
+ import { button_Button } from "./er~0.js";
14
13
  const PREFIX = '#viking-uri=';
15
14
  const RESOURCE = /viking:\/\/[^\s<>"'`]+/gi;
16
15
  const PROSE_RESOURCE = /viking:\/\/[^\s<>"'`,。;!?)\]]+/gi;