@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.
Files changed (200) hide show
  1. package/LICENSE.arco-design +21 -0
  2. package/README.md +25 -15
  3. package/dist/0~0.js +19 -0
  4. package/dist/2~0.js +2267 -29
  5. package/dist/2~0.js.LICENSE.txt +23 -0
  6. package/dist/3c~0.js +2206 -0
  7. package/dist/3~0.js +1205 -1982
  8. package/dist/4~0.js +18 -0
  9. package/dist/9~0.js +43 -0
  10. package/dist/{1~0.js → ae~0.js} +5 -24
  11. package/dist/ark-message-list-view~0.js +530 -119
  12. package/dist/a~0.js +1289 -10
  13. package/dist/c7~0.js +38 -2
  14. package/dist/ck~0.js +23 -0
  15. package/dist/client/provider.d.ts +5 -3
  16. package/dist/client/types.d.ts +5 -5
  17. package/dist/client.js +2 -1
  18. package/dist/components/agent-connect/agent-connect-copy.d.ts +19 -33
  19. package/dist/components/agent-connect/agent-connect-design.d.ts +1935 -167
  20. package/dist/components/agent-connect/agent-connect-instructions.d.ts +135 -0
  21. package/dist/components/agent-connect/locales/en-US.d.ts +20 -0
  22. package/dist/components/agent-connect/locales/zh-CN.d.ts +3 -0
  23. package/dist/components/agent-connect/style.css +14 -2
  24. package/dist/components/agent-connect/types.d.ts +2 -1
  25. package/dist/components/directory-tour/directory-tour.d.ts +3 -0
  26. package/dist/components/directory-tour/index.d.ts +3 -0
  27. package/dist/components/directory-tour/locales/en-US.d.ts +3 -0
  28. package/dist/components/directory-tour/locales/zh-CN.d.ts +3 -0
  29. package/dist/components/directory-tour/steps.d.ts +5 -0
  30. package/dist/components/directory-tour/style.css +237 -0
  31. package/dist/components/directory-tour/style.js +0 -0
  32. package/dist/components/directory-tour/types.d.ts +42 -0
  33. package/dist/components/directory-tour/use-tour-anchor.d.ts +5 -0
  34. package/dist/components/directory-tour/use-tour-position.d.ts +12 -0
  35. package/dist/components/directory-tour.js +40 -0
  36. package/dist/components/file-browser-entries/file-browser-entries.d.ts +5 -5
  37. package/dist/components/file-browser-entries/labels.d.ts +3 -0
  38. package/dist/components/file-browser-entries/locales/en-US.d.ts +6 -0
  39. package/dist/components/file-browser-entries/locales/zh-CN.d.ts +6 -0
  40. package/dist/components/file-browser-entries/style.css +752 -2
  41. package/dist/components/file-browser-entries/types.d.ts +34 -16
  42. package/dist/components/file-preview/file-preview-adapters.d.ts +2 -1
  43. package/dist/components/file-preview/file-preview-body.d.ts +2 -1
  44. package/dist/components/file-preview/file-preview-breadcrumb-menu.d.ts +2 -1
  45. package/dist/components/file-preview/file-preview-breadcrumb.d.ts +2 -1
  46. package/dist/components/file-preview/file-preview-directory.d.ts +2 -1
  47. package/dist/components/file-preview/file-preview-handle-adapters.d.ts +2 -1
  48. package/dist/components/file-preview/file-preview-header.d.ts +6 -2
  49. package/dist/components/file-preview/file-preview-image-frame.d.ts +5 -0
  50. package/dist/components/file-preview/file-preview-labels.d.ts +2 -14
  51. package/dist/components/file-preview/file-preview-level-tabs.d.ts +7 -0
  52. package/dist/components/file-preview/file-preview-markdown-images.d.ts +13 -0
  53. package/dist/components/file-preview/file-preview-panels.d.ts +5 -2
  54. package/dist/components/file-preview/file-preview-viewer.d.ts +2 -1
  55. package/dist/components/file-preview/file-preview.d.ts +0 -1
  56. package/dist/components/file-preview/index.d.ts +2 -1
  57. package/dist/components/file-preview/locales/en-US.d.ts +16 -0
  58. package/dist/components/file-preview/locales/zh-CN.d.ts +16 -0
  59. package/dist/components/file-preview/style.css +160 -2
  60. package/dist/components/file-preview/types.d.ts +34 -10
  61. package/dist/components/file-preview/use-file-preview-levels.d.ts +7 -0
  62. package/dist/components/file-preview/use-file-preview-view-state.d.ts +15 -0
  63. package/dist/components/file-preview.js +1 -1
  64. package/dist/components/file-tree/file-tree-info-labels.d.ts +0 -15
  65. package/dist/components/file-tree/file-tree-labels.d.ts +4 -0
  66. package/dist/components/file-tree/file-tree-row-shared.d.ts +2 -12
  67. package/dist/components/file-tree/file-tree-toolbar.d.ts +11 -0
  68. package/dist/components/file-tree/locales/en-US.d.ts +69 -0
  69. package/dist/components/file-tree/locales/zh-CN.d.ts +69 -0
  70. package/dist/components/file-tree/style.css +143 -15
  71. package/dist/components/file-tree/types.d.ts +38 -10
  72. package/dist/components/file-tree/use-file-tree-actions.d.ts +4 -1
  73. package/dist/components/scope-switcher/labels.d.ts +3 -0
  74. package/dist/components/scope-switcher/locales/en-US.d.ts +8 -0
  75. package/dist/components/scope-switcher/locales/zh-CN.d.ts +8 -0
  76. package/dist/components/scope-switcher/scope-panel.d.ts +1 -1
  77. package/dist/components/scope-switcher/scope-switcher.d.ts +1 -1
  78. package/dist/components/scope-switcher/style.css +14 -2
  79. package/dist/components/scope-switcher/types.d.ts +11 -5
  80. package/dist/components/style.css +9851 -6812
  81. package/dist/components/tui/locales/en-US.d.ts +35 -0
  82. package/dist/components/tui/locales/zh-CN.d.ts +35 -0
  83. package/dist/components/tui/style.css +310 -18
  84. package/dist/components/tui/tui-copy-button.d.ts +1 -1
  85. package/dist/components/tui/tui-empty.d.ts +25 -0
  86. package/dist/components/tui/tui-labels.d.ts +2 -2
  87. package/dist/components/tui/tui.d.ts +1 -1
  88. package/dist/components/tui/types.d.ts +35 -12
  89. package/dist/components/tui.js +1 -1
  90. package/dist/components/viking-bot/ark-adapter.d.ts +2 -0
  91. package/dist/components/viking-bot/ark-message-body.d.ts +1 -7
  92. package/dist/components/viking-bot/ark-message-list-view.d.ts +1 -1
  93. package/dist/components/viking-bot/ark-message-row.d.ts +3 -1
  94. package/dist/components/viking-bot/bot-popover.d.ts +9 -0
  95. package/dist/components/viking-bot/capabilities.d.ts +49 -0
  96. package/dist/components/viking-bot/composer-attachments.d.ts +13 -0
  97. package/dist/components/viking-bot/composer-controls.d.ts +10 -0
  98. package/dist/components/viking-bot/composer-footer.d.ts +17 -0
  99. package/dist/components/viking-bot/composer-references.d.ts +20 -0
  100. package/dist/components/viking-bot/composer-text.d.ts +10 -0
  101. package/dist/components/viking-bot/index.d.ts +3 -1
  102. package/dist/components/viking-bot/interaction/ask-human-fields.d.ts +1 -1
  103. package/dist/components/viking-bot/interaction/labels.d.ts +2 -1
  104. package/dist/components/viking-bot/interaction/locales/en-US.d.ts +17 -0
  105. package/dist/components/viking-bot/interaction/locales/zh-CN.d.ts +17 -0
  106. package/dist/components/viking-bot/interaction/types.d.ts +8 -3
  107. package/dist/components/viking-bot/interaction/viking-bot-interaction.d.ts +1 -1
  108. package/dist/components/viking-bot/labels.d.ts +2 -0
  109. package/dist/components/viking-bot/locales/en-US.d.ts +40 -0
  110. package/dist/components/viking-bot/locales/zh-CN.d.ts +40 -0
  111. package/dist/components/viking-bot/markdown-links.d.ts +27 -0
  112. package/dist/components/viking-bot/message-activity.d.ts +7 -0
  113. package/dist/components/viking-bot/message-code-block.d.ts +8 -0
  114. package/dist/components/viking-bot/message-footer.d.ts +8 -0
  115. package/dist/components/viking-bot/message-markdown.d.ts +9 -0
  116. package/dist/components/viking-bot/model.d.ts +37 -3
  117. package/dist/components/viking-bot/quick-input-tracker.d.ts +16 -0
  118. package/dist/components/viking-bot/quick-inputs.d.ts +6 -0
  119. package/dist/components/viking-bot/reference-picker.d.ts +16 -0
  120. package/dist/components/viking-bot/session-actions.d.ts +11 -0
  121. package/dist/components/viking-bot/style.css +1486 -48
  122. package/dist/components/viking-bot/tool-activity.d.ts +9 -0
  123. package/dist/components/viking-bot/tool-result-links.d.ts +6 -0
  124. package/dist/components/viking-bot/types.d.ts +21 -9
  125. package/dist/components/viking-bot/use-quick-input.d.ts +17 -0
  126. package/dist/components/viking-bot/viking-bot.d.ts +1 -6
  127. package/dist/components/viking-bot/welcome.d.ts +8 -0
  128. package/dist/components/viking-bot.js +1 -1
  129. package/dist/c~0.js +533 -66
  130. package/dist/e~0.js +333 -0
  131. package/dist/file-preview-viewer~0.js +90 -8
  132. package/dist/f~0.js +39 -47
  133. package/dist/h~0.js +5 -1
  134. package/dist/icons/console-icons.d.ts +12 -0
  135. package/dist/icons/index.d.ts +2 -0
  136. package/dist/icons/viking-bot-icons.d.ts +6 -0
  137. package/dist/icons.js +1 -0
  138. package/dist/index.d.ts +2 -0
  139. package/dist/index.js +2 -1
  140. package/dist/k~0.js +1 -0
  141. package/dist/lg~0.js +155 -0
  142. package/dist/lk~0.js +37 -8
  143. package/dist/l~0.js +102 -119
  144. package/dist/modules/console/command-messages.d.ts +19 -0
  145. package/dist/modules/console/command-parser.d.ts +15 -0
  146. package/dist/modules/console/command-specs.d.ts +15 -0
  147. package/dist/modules/console/commands.d.ts +6 -0
  148. package/dist/modules/console/console-history.d.ts +10 -0
  149. package/dist/modules/console/console-toolbar.d.ts +18 -0
  150. package/dist/modules/console/console.d.ts +1 -3
  151. package/dist/modules/console/controller.d.ts +17 -0
  152. package/dist/modules/console/index.d.ts +2 -0
  153. package/dist/modules/console/labels.d.ts +61 -0
  154. package/dist/modules/console/locales/en-US.d.ts +49 -0
  155. package/dist/modules/console/locales/zh-CN.d.ts +3 -0
  156. package/dist/modules/console/localize-records.d.ts +11 -0
  157. package/dist/modules/console/results.d.ts +2 -0
  158. package/dist/modules/console/style.css +10905 -15
  159. package/dist/modules/console/types.d.ts +59 -80
  160. package/dist/modules/console/use-console.d.ts +3 -0
  161. package/dist/modules/console.js +1 -1
  162. package/dist/modules/file-browser/file-browser-detail.d.ts +2 -1
  163. package/dist/modules/file-browser/file-browser-labels.d.ts +11 -12
  164. package/dist/modules/file-browser/file-browser-toolbar.d.ts +3 -4
  165. package/dist/modules/file-browser/file-browser-tree-pane.d.ts +7 -5
  166. package/dist/modules/file-browser/file-browser.d.ts +1 -1
  167. package/dist/modules/file-browser/fs-read-directory.d.ts +2 -6
  168. package/dist/modules/file-browser/locales/en-US.d.ts +25 -0
  169. package/dist/modules/file-browser/locales/zh-CN.d.ts +25 -0
  170. package/dist/modules/file-browser/style.css +1581 -126
  171. package/dist/modules/file-browser/types.d.ts +38 -29
  172. package/dist/modules/file-browser/use-file-browser.d.ts +6 -1
  173. package/dist/modules/file-browser/use-fs-preview.d.ts +15 -1
  174. package/dist/modules/scope-cascade/labels.d.ts +6 -0
  175. package/dist/modules/scope-cascade/locales/en-US.d.ts +6 -0
  176. package/dist/modules/scope-cascade/locales/zh-CN.d.ts +3 -0
  177. package/dist/modules/scope-cascade/scope-cascade.d.ts +1 -1
  178. package/dist/modules/scope-cascade/style.css +14 -2
  179. package/dist/modules/scope-cascade/types.d.ts +3 -0
  180. package/dist/modules/style.css +15853 -3484
  181. package/dist/nx~0.js +15 -0
  182. package/dist/n~0.js +238 -83
  183. package/dist/o~0.js +10 -7
  184. package/dist/p~0.js +27 -0
  185. package/dist/rslib-runtime~0.js +42 -0
  186. package/dist/r~0.js +152 -0
  187. package/dist/shared/components/drawer/drawer.d.ts +13 -0
  188. package/dist/shared/components/drawer/index.d.ts +1 -0
  189. package/dist/shared/components/overlay/use-overlay-position.d.ts +2 -2
  190. package/dist/shared/components/tooltip/use-portal-theme.d.ts +3 -0
  191. package/dist/shared/locale.d.ts +6 -0
  192. package/dist/style.css +26056 -10636
  193. package/dist/u~0.js +75 -58
  194. package/dist/viking-bot-composer~0.js +434 -77
  195. package/dist/viking-bot-interaction~0.js +11 -11
  196. package/package.json +13 -4
  197. package/dist/30~0.js +0 -1332
  198. package/dist/components/tui/tui-labels-zh.d.ts +0 -2
  199. package/dist/modules/file-browser/tree-info-copy.d.ts +0 -15
  200. package/dist/modules/file-browser/tree-info-copy.zh-CN.d.ts +0 -15
package/dist/nx~0.js ADDED
@@ -0,0 +1,15 @@
1
+ function mergeLabels(defaults, overrides) {
2
+ const result = {
3
+ ...defaults
4
+ };
5
+ for (const key of Object.keys(overrides ?? {})){
6
+ const value = overrides?.[key];
7
+ if (null != value) result[key] = value;
8
+ }
9
+ return result;
10
+ }
11
+ function resolveLocale(messages, locale = 'en-US', overrides) {
12
+ const defaults = messages[locale] ?? messages['en-US'];
13
+ return overrides ? mergeLabels(defaults, overrides) : defaults;
14
+ }
15
+ export { mergeLabels, resolveLocale };
package/dist/n~0.js CHANGED
@@ -1,8 +1,163 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { cloneElement, forwardRef, useCallback, useEffect, useId, useImperativeHandle, useRef, useState } from "react";
3
3
  import { createPortal } from "react-dom";
4
+ import { resolveLocale, mergeLabels } from "./nx~0.js";
4
5
  import { FolderOpenIcon, FolderIcon, ChevronRightIcon, DocumentIcon } from "./k~0.js";
5
6
  import { useOverlayPosition } from "./o~0.js";
7
+ import { searchreact } from "./p~0.js";
8
+ const messages = {
9
+ search: 'Search files…',
10
+ refresh: 'Refresh file tree',
11
+ empty: 'No files yet',
12
+ error: 'Failed to load',
13
+ retry: 'Retry',
14
+ loadMore: 'Load more',
15
+ loading: 'Loading…',
16
+ expand: 'Expand {name}',
17
+ collapse: 'Collapse {name}',
18
+ info: {
19
+ description: {
20
+ userRoot: 'Context data for the current user',
21
+ memories: 'Long-term memory accumulated across sessions',
22
+ peers: 'Context isolated per application or workspace',
23
+ privacy: 'Keys and other sensitive configuration',
24
+ userResources: 'Private knowledge of this user',
25
+ sessions: 'Conversation and task execution records',
26
+ skills: 'Skills and tools available to the agent',
27
+ profile: 'User identity and background',
28
+ preferences: 'Personalized user preferences',
29
+ entities: 'People, projects, organizations and other entities',
30
+ events: 'Key events archived by date',
31
+ identity: 'Agent name and persona',
32
+ soul: 'Agent behaviour guidelines and boundaries',
33
+ cases: 'Interaction cases used to train experience',
34
+ trajectories: 'Reusable task execution trajectories',
35
+ experiences: 'Execution experience distilled automatically',
36
+ sharedResources: 'External resources the agent can reference',
37
+ agentRoot: 'Agent capabilities, tools and experience',
38
+ agentEndpoints: 'Communication endpoints shared across the account',
39
+ agentPayments: 'Payment capabilities shared across the account',
40
+ agentSkills: 'Skill definitions callable across the account',
41
+ agentTools: 'Tool configuration shared across the account',
42
+ memoryRoot: 'Long-term memory and accumulated information',
43
+ resourceRoot: 'External knowledge the agent can reference',
44
+ sessionRoot: 'Raw session records of the user',
45
+ systemRoot: 'Built-in system resources'
46
+ },
47
+ triggerBehavior: {
48
+ userRoot: 'Created from the current user identity; no manual setup needed',
49
+ memories: 'Committed sessions, explicit requests to remember, or continuous extraction from sessions',
50
+ peers: 'Created when connecting as a specific peer, isolating memory and material per peer_id',
51
+ userResources: 'Imported material, uploaded to this user’s private resource directory',
52
+ sessions: 'Created when a session calls OpenViking; messages, tool calls and archives are saved continuously',
53
+ skills: 'Created, installed or imported as a personal skill',
54
+ profile: 'A stable, explicit user background or working style appears in conversation',
55
+ preferences: 'The user explicitly states a specific preference, habit or style',
56
+ entities: 'A person, project or organization worth keeping appears in conversation',
57
+ events: 'An important decision, commitment, arrangement, progress or result appears in dialogue',
58
+ identity: 'Initialized on the first memory extraction run; later updated by write operations',
59
+ soul: 'Initialized on the first memory extraction run; later adjusted by write operations',
60
+ cases: 'A session with a clear task and an evaluable execution result is committed',
61
+ trajectories: 'A task containing decisions, tool calls or multi-step execution is committed',
62
+ experiences: 'Distilled from task cases and execution trajectories',
63
+ sharedResources: 'Imported material, uploaded to a shared resource space',
64
+ agentEndpoints: 'Configured when an integration endpoint is registered for the account',
65
+ agentPayments: 'Configured when a payment capability is enabled for the account',
66
+ agentSkills: 'Installed or imported as a shared skill available to every agent',
67
+ agentTools: 'Configured when a tool is registered for the account'
68
+ },
69
+ field: {
70
+ description: "Description",
71
+ triggerBehavior: 'Trigger',
72
+ path: 'Path'
73
+ }
74
+ }
75
+ };
76
+ const en_US = messages;
77
+ const zh_CN_messages = {
78
+ search: '搜索文件…',
79
+ refresh: '刷新文件树',
80
+ empty: '暂无文件',
81
+ error: '加载失败',
82
+ retry: '重试',
83
+ loadMore: '加载更多',
84
+ loading: '加载中…',
85
+ expand: '展开 {name}',
86
+ collapse: '收起 {name}',
87
+ info: {
88
+ description: {
89
+ userRoot: '当前用户的上下文数据',
90
+ memories: '跨会话沉淀的长期记忆',
91
+ peers: '按应用或工作区隔离的上下文',
92
+ privacy: '密钥等敏感配置',
93
+ userResources: '该用户的私有知识资料',
94
+ sessions: '对话与任务运行记录',
95
+ skills: 'Agent 可用的技能与工具',
96
+ profile: '用户身份与背景',
97
+ preferences: '个性化偏好',
98
+ entities: '人物、项目、组织等实体',
99
+ events: '按日期归档的关键事件',
100
+ identity: 'Agent 名称与人设',
101
+ soul: 'Agent 行为准则与边界',
102
+ cases: '用于训练经验的交互案例',
103
+ trajectories: '可复用的任务执行轨迹',
104
+ experiences: '自动提炼的执行经验',
105
+ sharedResources: 'Agent 可引用的外部资料',
106
+ agentRoot: 'Agent 的能力、工具与经验',
107
+ agentEndpoints: '账号内共享的通信端点配置',
108
+ agentPayments: '账号内共享的支付能力配置',
109
+ agentSkills: '账号内可调用的技能定义',
110
+ agentTools: '账号内共享的工具配置',
111
+ memoryRoot: '长期记忆与累积信息',
112
+ resourceRoot: 'Agent 可引用的外部知识',
113
+ sessionRoot: '用户的原始会话记录',
114
+ systemRoot: '系统内置资源'
115
+ },
116
+ triggerBehavior: {
117
+ userRoot: '根据当前用户身份自动建立,无需手动创建',
118
+ memories: '提交会话、主动要求记住信息,或从会话中持续抽取',
119
+ peers: '以特定 peer 身份连接时建立,按 peer_id 隔离记忆与资料',
120
+ userResources: '导入资料时上传到该用户的私有资源目录',
121
+ sessions: '会话调用 OpenViking 时建立,消息、工具调用与归档持续写入',
122
+ skills: '作为个人技能被创建、安装或导入',
123
+ profile: '对话中出现稳定、明确的用户背景或工作方式',
124
+ preferences: '用户明确表达某个偏好、习惯或风格',
125
+ entities: '对话中出现值得保留的人物、项目或组织',
126
+ events: '对话中出现重要决定、承诺、安排、进展或结果',
127
+ identity: '首次记忆抽取时初始化,之后由写入操作更新',
128
+ soul: '首次记忆抽取时初始化,之后由写入操作调整',
129
+ cases: '提交了任务明确、执行结果可评估的会话',
130
+ trajectories: '提交了包含决策、工具调用或多步执行的任务',
131
+ experiences: '从任务案例与执行轨迹中提炼',
132
+ sharedResources: '导入资料时上传到共享资源空间',
133
+ agentEndpoints: '为账号注册集成端点时配置',
134
+ agentPayments: '为账号开通支付能力时配置',
135
+ agentSkills: '作为共享技能安装或导入,供所有 Agent 使用',
136
+ agentTools: '为账号注册工具时配置'
137
+ },
138
+ field: {
139
+ description: '说明',
140
+ triggerBehavior: '触发行为',
141
+ path: '路径'
142
+ }
143
+ }
144
+ };
145
+ const zh_CN = zh_CN_messages;
146
+ const LOCALES = {
147
+ 'en-US': en_US,
148
+ 'zh-CN': zh_CN
149
+ };
150
+ function resolveFileTreeLabels(locale = 'en-US', labels) {
151
+ const defaults = resolveLocale(LOCALES, locale);
152
+ return {
153
+ ...mergeLabels(defaults, labels),
154
+ info: {
155
+ description: mergeLabels(defaults.info.description, labels?.info?.description),
156
+ triggerBehavior: mergeLabels(defaults.info.triggerBehavior, labels?.info?.triggerBehavior),
157
+ field: mergeLabels(defaults.info.field, labels?.info?.field)
158
+ }
159
+ };
160
+ }
6
161
  function FileTreeFolderIcon({ open }) {
7
162
  return /*#__PURE__*/ jsxs("span", {
8
163
  className: "ov-file-tree__folder",
@@ -113,68 +268,10 @@ function resolveFileTreeInfoKey(uri) {
113
268
  function showsInlineDescription(key) {
114
269
  return null !== key && !TOOLTIP_ONLY_KEYS.has(key);
115
270
  }
116
- const DESCRIPTION = {
117
- userRoot: 'Context data for the current user',
118
- memories: 'Long-term memory accumulated across sessions',
119
- peers: 'Context isolated per application or workspace',
120
- privacy: 'Keys and other sensitive configuration',
121
- userResources: 'Private knowledge of this user',
122
- sessions: 'Conversation and task execution records',
123
- skills: 'Skills and tools available to the agent',
124
- profile: 'User identity and background',
125
- preferences: 'Personalized user preferences',
126
- entities: 'People, projects, organizations and other entities',
127
- events: 'Key events archived by date',
128
- identity: 'Agent name and persona',
129
- soul: 'Agent behaviour guidelines and boundaries',
130
- cases: 'Interaction cases used to train experience',
131
- trajectories: 'Reusable task execution trajectories',
132
- experiences: 'Execution experience distilled automatically',
133
- sharedResources: 'External resources the agent can reference',
134
- agentRoot: 'Agent capabilities, tools and experience',
135
- agentEndpoints: 'Communication endpoints shared across the account',
136
- agentPayments: 'Payment capabilities shared across the account',
137
- agentSkills: 'Skill definitions callable across the account',
138
- agentTools: 'Tool configuration shared across the account',
139
- memoryRoot: 'Long-term memory and accumulated information',
140
- resourceRoot: 'External knowledge the agent can reference',
141
- sessionRoot: 'Raw session records of the user',
142
- systemRoot: 'Built-in system resources'
143
- };
144
- const TRIGGER_BEHAVIOR = {
145
- userRoot: 'Created from the current user identity; no manual setup needed',
146
- memories: 'Committed sessions, explicit requests to remember, or continuous extraction from sessions',
147
- peers: 'Created when connecting as a specific peer, isolating memory and material per peer_id',
148
- userResources: 'Imported material, uploaded to this user’s private resource directory',
149
- sessions: 'Created when a session calls OpenViking; messages, tool calls and archives are saved continuously',
150
- skills: 'Created, installed or imported as a personal skill',
151
- profile: 'A stable, explicit user background or working style appears in conversation',
152
- preferences: 'The user explicitly states a specific preference, habit or style',
153
- entities: 'A person, project or organization worth keeping appears in conversation',
154
- events: 'An important decision, commitment, arrangement, progress or result appears in dialogue',
155
- identity: 'Initialized on the first memory extraction run; later updated by write operations',
156
- soul: 'Initialized on the first memory extraction run; later adjusted by write operations',
157
- cases: 'A session with a clear task and an evaluable execution result is committed',
158
- trajectories: 'A task containing decisions, tool calls or multi-step execution is committed',
159
- experiences: 'Distilled from task cases and execution trajectories',
160
- sharedResources: 'Imported material, uploaded to a shared resource space',
161
- agentEndpoints: 'Configured when an integration endpoint is registered for the account',
162
- agentPayments: 'Configured when a payment capability is enabled for the account',
163
- agentSkills: 'Installed or imported as a shared skill available to every agent',
164
- agentTools: 'Configured when a tool is registered for the account'
165
- };
166
- const DEFAULT_INFO_LABELS = {
167
- description: DESCRIPTION,
168
- triggerBehavior: TRIGGER_BEHAVIOR,
169
- field: {
170
- description: "Description",
171
- triggerBehavior: 'Trigger',
172
- path: 'Path'
173
- }
174
- };
271
+ const DEFAULT_INFO_LABELS = en_US.info;
175
272
  function resolveInfoCopy(key, hostLabels) {
176
- const description = hostLabels?.description?.[key] ?? DESCRIPTION[key] ?? void 0;
177
- const triggerBehavior = hostLabels?.triggerBehavior?.[key] ?? TRIGGER_BEHAVIOR[key] ?? void 0;
273
+ const description = hostLabels?.description?.[key] ?? DEFAULT_INFO_LABELS.description?.[key] ?? void 0;
274
+ const triggerBehavior = hostLabels?.triggerBehavior?.[key] ?? DEFAULT_INFO_LABELS.triggerBehavior?.[key] ?? void 0;
178
275
  return {
179
276
  description: description || void 0,
180
277
  triggerBehavior: triggerBehavior || void 0
@@ -390,11 +487,10 @@ function FileTreeTooltipContent({ row, infoLabels, renderRowTooltip }) {
390
487
  copy: copy
391
488
  });
392
489
  }
393
- const INDENT = 16;
394
- const CHEVRON_SIZE = 16;
490
+ const INDENT = 'var(--ov-ui-file-tree-indent, 20px)';
395
491
  function rowStyle(depth) {
396
492
  return {
397
- paddingLeft: depth * INDENT
493
+ paddingLeft: `calc(2px + ${depth} * ${INDENT})`
398
494
  };
399
495
  }
400
496
  function Guides({ depth }) {
@@ -405,7 +501,7 @@ function Guides({ depth }) {
405
501
  "aria-hidden": "true",
406
502
  className: "ov-file-tree__guide",
407
503
  style: {
408
- left: level * INDENT + CHEVRON_SIZE / 2
504
+ left: `calc(10px + ${level} * ${INDENT})`
409
505
  }
410
506
  }, level))
411
507
  });
@@ -482,6 +578,7 @@ function FileTreeRowView({ row, ctx }) {
482
578
  }),
483
579
  /*#__PURE__*/ jsxs("span", {
484
580
  className: "ov-file-tree__label-group",
581
+ "data-description": Boolean(description) || void 0,
485
582
  children: [
486
583
  /*#__PURE__*/ jsx("span", {
487
584
  className: "ov-file-tree__label",
@@ -710,9 +807,63 @@ function handleRowKeyDown(event, { root, row, onSelect, onToggleExpand }) {
710
807
  return;
711
808
  }
712
809
  }
810
+ function FileTreeToolbar({ search, refresh, text, refreshing, onSearch, onRefresh }) {
811
+ if (!search && !refresh) return null;
812
+ const searchDisabled = !onSearch || 'object' == typeof search && search.disabled;
813
+ const refreshDisabled = !onRefresh || 'object' == typeof refresh && refresh.disabled;
814
+ const busy = refreshing || 'object' == typeof refresh && refresh.loading;
815
+ return /*#__PURE__*/ jsxs("div", {
816
+ className: "ov-file-tree__controls",
817
+ children: [
818
+ search ? /*#__PURE__*/ jsxs("button", {
819
+ type: "button",
820
+ className: "ov-file-tree__search",
821
+ disabled: Boolean(searchDisabled),
822
+ onClick: onSearch,
823
+ title: text.search,
824
+ children: [
825
+ /*#__PURE__*/ jsx(searchreact, {
826
+ width: 16,
827
+ height: 16,
828
+ "aria-hidden": "true"
829
+ }),
830
+ /*#__PURE__*/ jsx("span", {
831
+ className: "ov-file-tree__search-label",
832
+ children: text.search
833
+ })
834
+ ]
835
+ }) : null,
836
+ refresh ? /*#__PURE__*/ jsx("button", {
837
+ type: "button",
838
+ className: "ov-file-tree__refresh",
839
+ "aria-label": text.refresh,
840
+ title: text.refresh,
841
+ "aria-busy": Boolean(busy),
842
+ disabled: Boolean(refreshDisabled || busy),
843
+ onClick: onRefresh,
844
+ children: /*#__PURE__*/ jsx("svg", {
845
+ "aria-hidden": "true",
846
+ width: 14,
847
+ height: 14,
848
+ viewBox: "0 0 16 16",
849
+ fill: "none",
850
+ className: busy ? 'ov-file-tree__refresh-spinning' : void 0,
851
+ children: /*#__PURE__*/ jsx("path", {
852
+ d: "M13 6a5.2 5.2 0 1 0 .15 3.5M13 2.5V6H9.5",
853
+ stroke: "currentColor",
854
+ strokeWidth: "1.5",
855
+ strokeLinecap: "round",
856
+ strokeLinejoin: "round"
857
+ })
858
+ })
859
+ }) : null
860
+ ]
861
+ });
862
+ }
713
863
  function useFileTreeActions(props) {
714
864
  const pending = useRef(new Set());
715
- const { select, toggleExpand, loadMore, retry, openRetentionSettings } = props.operations ?? {};
865
+ const [refreshing, setRefreshing] = useState(false);
866
+ const { select, toggleExpand, loadMore, retry, openRetentionSettings, search, refresh } = props.operations ?? {};
716
867
  async function run(key, execute, notify, value) {
717
868
  if (pending.current.has(key)) return;
718
869
  pending.current.add(key);
@@ -726,6 +877,13 @@ function useFileTreeActions(props) {
726
877
  notify?.(value);
727
878
  }
728
879
  return {
880
+ refreshing,
881
+ onSearch: search ? ()=>void run('search', search, props.onSearch, void 0) : void 0,
882
+ onRefresh: refresh ? ()=>{
883
+ if (pending.current.has('refresh')) return;
884
+ setRefreshing(true);
885
+ run('refresh', refresh, props.onRefresh, void 0).finally(()=>setRefreshing(false));
886
+ } : void 0,
729
887
  onSelect: select ? (row)=>void run(`select:${row.id}`, select, props.onSelect, row) : void 0,
730
888
  onToggleExpand: toggleExpand ? (row)=>void run(`toggle:${row.id}`, toggleExpand, props.onToggleExpand, row) : void 0,
731
889
  onLoadMore: loadMore ? (row)=>void run(`load:${row.id}`, loadMore, props.onLoadMore, row) : void 0,
@@ -743,32 +901,21 @@ function FileTreeSpinner({ className, ...rest }) {
743
901
  ].filter(Boolean).join(' ')
744
902
  });
745
903
  }
746
- const DEFAULT_LABELS = {
747
- empty: 'No files yet',
748
- error: 'Failed to load',
749
- retry: 'Retry',
750
- loadMore: 'Load more',
751
- loading: 'Loading…',
752
- expand: 'Expand {name}',
753
- collapse: 'Collapse {name}'
754
- };
755
904
  function findRow(root, id) {
756
905
  return root?.querySelector(`[${FILE_TREE_ROW_ATTRIBUTE}="${CSS.escape(id)}"]`) ?? null;
757
906
  }
758
- const file_tree_FileTree = /*#__PURE__*/ forwardRef(function({ rows, operations, selectedId, isReady = true, loadingFallback, errorFallback, emptyFallback, slots, labels, getRowAttributes, renderDashboard, renderRowTooltip, renderRowIcon, onSelect, onToggleExpand, onLoadMore, onRetry, onOpenRetentionSettings, className, ...rest }, ref) {
907
+ const file_tree_FileTree = /*#__PURE__*/ forwardRef(function({ rows, locale, operations, selectedId, search, refresh, isReady = true, loadingFallback, errorFallback, emptyFallback, slots, labels, getRowAttributes, renderDashboard, renderRowTooltip, renderRowIcon, onSelect, onToggleExpand, onLoadMore, onRetry, onOpenRetentionSettings, onSearch, onRefresh, className, ...rest }, ref) {
759
908
  const rootRef = useRef(null);
760
- const text = {
761
- ...DEFAULT_LABELS,
762
- ...labels,
763
- info: labels?.info ?? DEFAULT_LABELS.info
764
- };
909
+ const text = resolveFileTreeLabels(locale, labels);
765
910
  const actions = useFileTreeActions({
766
911
  operations,
767
912
  onSelect,
768
913
  onToggleExpand,
769
914
  onLoadMore,
770
915
  onRetry,
771
- onOpenRetentionSettings
916
+ onOpenRetentionSettings,
917
+ onSearch,
918
+ onRefresh
772
919
  });
773
920
  useImperativeHandle(ref, ()=>({
774
921
  getRowElement: (id)=>findRow(rootRef.current, id),
@@ -784,7 +931,7 @@ const file_tree_FileTree = /*#__PURE__*/ forwardRef(function({ rows, operations,
784
931
  }), []);
785
932
  const ctx = {
786
933
  text,
787
- infoLabels: labels?.info,
934
+ infoLabels: text.info,
788
935
  selectedId,
789
936
  getRowAttributes,
790
937
  renderDashboard,
@@ -811,6 +958,14 @@ const file_tree_FileTree = /*#__PURE__*/ forwardRef(function({ rows, operations,
811
958
  className: "ov-file-tree__toolbar",
812
959
  children: slots.toolbar
813
960
  }) : null,
961
+ /*#__PURE__*/ jsx(FileTreeToolbar, {
962
+ search: search,
963
+ refresh: refresh,
964
+ text: text,
965
+ refreshing: actions.refreshing,
966
+ onSearch: actions.onSearch,
967
+ onRefresh: actions.onRefresh
968
+ }),
814
969
  /*#__PURE__*/ jsx("div", {
815
970
  role: "tree",
816
971
  "aria-label": rest['aria-label'],
package/dist/o~0.js CHANGED
@@ -1,4 +1,5 @@
1
- import { useLayoutEffect, useState } from "react";
1
+ import { useEffect, useLayoutEffect, useState } from "react";
2
+ const usePositionEffect = "u" < typeof window ? useEffect : useLayoutEffect;
2
3
  const OVERLAY_OFFSET = 6;
3
4
  const VIEWPORT_MARGIN = 8;
4
5
  const OPPOSITE = {
@@ -7,7 +8,7 @@ const OPPOSITE = {
7
8
  left: 'right',
8
9
  right: 'left'
9
10
  };
10
- function resolvePosition(trigger, surface, placement) {
11
+ function resolvePosition(trigger, surface, placement, alignment = 'center') {
11
12
  const viewportWidth = window.innerWidth;
12
13
  const viewportHeight = window.innerHeight;
13
14
  const fits = (side)=>{
@@ -20,7 +21,7 @@ function resolvePosition(trigger, surface, placement) {
20
21
  const clamp = (value, size, limit)=>Math.min(Math.max(value, VIEWPORT_MARGIN), limit - size - VIEWPORT_MARGIN);
21
22
  if ('top' === side || 'bottom' === side) {
22
23
  const top = 'top' === side ? trigger.top - surface.height - OVERLAY_OFFSET : trigger.bottom + OVERLAY_OFFSET;
23
- const left = trigger.left + trigger.width / 2 - surface.width / 2;
24
+ const left = 'end' === alignment ? trigger.right - surface.width : trigger.left + trigger.width / 2 - surface.width / 2;
24
25
  return {
25
26
  top: clamp(top, surface.height, viewportHeight),
26
27
  left: clamp(left, surface.width, viewportWidth),
@@ -35,13 +36,13 @@ function resolvePosition(trigger, surface, placement) {
35
36
  placement: side
36
37
  };
37
38
  }
38
- function useOverlayPosition(open, triggerRef, surface, placement) {
39
+ function useOverlayPosition(open, triggerRef, surface, placement, alignment = 'center') {
39
40
  const [position, setPosition] = useState({
40
41
  top: 0,
41
42
  left: 0,
42
43
  placement
43
44
  });
44
- useLayoutEffect(()=>{
45
+ usePositionEffect(()=>{
45
46
  if (!open) return;
46
47
  const trigger = triggerRef.current;
47
48
  if (!trigger || !surface) return;
@@ -78,7 +79,7 @@ function useOverlayPosition(open, triggerRef, surface, placement) {
78
79
  const next = resolvePosition(triggerRect, {
79
80
  width: surfaceRect.width,
80
81
  height: surfaceRect.height
81
- }, placement);
82
+ }, placement, alignment);
82
83
  setPosition((previous)=>previous.top === next.top && previous.left === next.left && previous.placement === next.placement ? previous : next);
83
84
  };
84
85
  update();
@@ -89,6 +90,7 @@ function useOverlayPosition(open, triggerRef, surface, placement) {
89
90
  return ()=>{
90
91
  observer.disconnect();
91
92
  themeObserver.disconnect();
93
+ written.forEach((name)=>surface.style.removeProperty(name));
92
94
  window.removeEventListener('scroll', update, true);
93
95
  window.removeEventListener('resize', update);
94
96
  };
@@ -96,7 +98,8 @@ function useOverlayPosition(open, triggerRef, surface, placement) {
96
98
  open,
97
99
  placement,
98
100
  surface,
99
- triggerRef
101
+ triggerRef,
102
+ alignment
100
103
  ]);
101
104
  return position;
102
105
  }
package/dist/p~0.js ADDED
@@ -0,0 +1,27 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import "react";
3
+ const SvgSearch = (props)=>/*#__PURE__*/ jsx("svg", {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ width: 16,
6
+ height: 16,
7
+ fill: "none",
8
+ viewBox: "0 0 16 16",
9
+ ...props,
10
+ children: /*#__PURE__*/ jsxs("g", {
11
+ stroke: "currentColor",
12
+ strokeWidth: 1.2,
13
+ children: [
14
+ /*#__PURE__*/ jsx("circle", {
15
+ cx: 7.167,
16
+ cy: 7.167,
17
+ r: 4.667
18
+ }),
19
+ /*#__PURE__*/ jsx("path", {
20
+ strokeLinecap: "round",
21
+ d: "m10.667 10.667 3 3"
22
+ })
23
+ ]
24
+ })
25
+ });
26
+ const searchreact = SvgSearch;
27
+ export { searchreact };
@@ -0,0 +1,42 @@
1
+ var __webpack_modules__ = {};
2
+ var __webpack_module_cache__ = {};
3
+ function __webpack_require__(moduleId) {
4
+ var cachedModule = __webpack_module_cache__[moduleId];
5
+ if (void 0 !== cachedModule) return cachedModule.exports;
6
+ var module = __webpack_module_cache__[moduleId] = {
7
+ exports: {}
8
+ };
9
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
10
+ return module.exports;
11
+ }
12
+ __webpack_require__.m = __webpack_modules__;
13
+ (()=>{
14
+ __webpack_require__.n = (module)=>{
15
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
16
+ __webpack_require__.d(getter, {
17
+ a: getter
18
+ });
19
+ return getter;
20
+ };
21
+ })();
22
+ (()=>{
23
+ __webpack_require__.d = (exports, getters, values)=>{
24
+ var define = (defs, kind)=>{
25
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
26
+ enumerable: true,
27
+ [kind]: defs[key]
28
+ });
29
+ };
30
+ define(getters, "get");
31
+ define(values, "value");
32
+ };
33
+ })();
34
+ (()=>{
35
+ __webpack_require__.add = function(modules) {
36
+ Object.assign(__webpack_require__.m, modules);
37
+ };
38
+ })();
39
+ (()=>{
40
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
41
+ })();
42
+ export { __webpack_require__ };