Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

feat(web-studio): add scheduled resource sync management (#3909)

yufeng42a7ff088aaf
diff --git a/web-studio/README.md b/web-studio/README.md
index 7eb395a37..a2a459e91 100644
--- a/web-studio/README.md
+++ b/web-studio/README.md
@@ -144,6 +144,7 @@ It formats the OpenAPI document, normalizes operation IDs, and runs `@hey-api/op
```text
src/routes/ TanStack Router routes
src/routes/<page>/ Top-level page modules
+src/routes/<page>/*.ts Explicit public feature entry points for cross-route reuse
src/routes/<page>/-* Page-private components, hooks, schemas, and helpers
src/components/ui/ Shared base UI primitives
src/components/ Shared app components
@@ -155,7 +156,7 @@ src/styles.css Global CSS and design tokens
types/ov-server/ Supplemental typed server-result subsets
```
-Keep route-specific implementation colocated under the corresponding route directory. User-visible copy belongs in both `src/i18n/locales/en.ts` and `src/i18n/locales/zh-CN.ts`.
+Keep route-specific implementation colocated under the corresponding route directory. Cross-route consumers must import an explicit public feature entry point instead of reaching into a `-*` module. User-visible copy belongs in both `src/i18n/locales/en.ts` and `src/i18n/locales/zh-CN.ts`.
## Deployment
diff --git a/web-studio/src/components/app-shell.tsx b/web-studio/src/components/app-shell.tsx
index 2cf72bb1f..05f0b01ad 100644
--- a/web-studio/src/components/app-shell.tsx
+++ b/web-studio/src/components/app-shell.tsx
@@ -6,6 +6,7 @@ import {
BracesIcon,
ChevronRightIcon,
ClipboardListIcon,
+ Clock3Icon,
HomeIcon,
GithubIcon,
KeyRoundIcon,
@@ -128,6 +129,13 @@ const NAV_ITEMS: readonly NavItem[] = [
titleKey: 'navigation.tasks.title',
to: '/tasks',
},
+ {
+ icon: Clock3Icon,
+ id: 'watches',
+ section: 'operations',
+ titleKey: 'navigation.watches.title',
+ to: '/watches',
+ },
{
icon: MonitorUpIcon,
id: 'monitoring',
diff --git a/web-studio/src/i18n/locales/en.ts b/web-studio/src/i18n/locales/en.ts
index f480dcf01..6110e0210 100644
--- a/web-studio/src/i18n/locales/en.ts
+++ b/web-studio/src/i18n/locales/en.ts
@@ -1,1606 +1,11 @@
+import workspace from './en/workspace'
+import resources from './en/resources'
+import activity from './en/activity'
+
const en = {
- appShell: {
- footer: {
- agentIntegrations: 'Agent Integrations',
- connection: 'Connection Settings',
- docs: 'Documentation',
- github: 'GitHub',
- sdkApi: 'SDK & API',
- users: 'User Management',
- },
- header: {
- currentUser: {
- account: 'Account',
- accountSummary: 'Account · {{account}}',
- openMenu: 'View current user {{user}}',
- signedInAs: 'Current data identity',
- unset: 'Not set',
- user: 'User',
- },
- defaultTitle: 'OpenViking Studio',
- },
- navigation: {
- home: {
- title: 'Home',
- },
- crossDeviceVerify: {
- title: 'OAuth verify',
- },
- operations: {
- title: 'Operations',
- },
- requestLogs: {
- title: 'Request Logs',
- },
- monitoring: {
- title: 'Monitoring',
- },
- skills: {
- title: 'Skills',
- },
- tasks: {
- title: 'Task Center',
- },
- retrieval: {
- title: 'Retrieval',
- },
- sessions: {
- title: 'Sessions',
- },
- playground: {
- title: 'Playground',
- },
- },
- sidebar: {
- groups: {
- operations: 'Activity',
- resources: 'Resources',
- settings: 'Settings',
- workspace: 'Workspace',
- },
- loadingSessions: 'Loading...',
- noSessions: 'No sessions',
- workspaceGroupLabel: 'OpenViking Studio',
- },
- },
- monitoringPage: {
- title: 'Monitoring',
- description: 'View real-time health for OpenViking components.',
- version: 'v{{version}}',
- refresh: 'Refresh',
- updatedAt: 'Updated at {{time}}',
- loading: 'Loading monitoring data...',
- loadFailed: 'Could not load monitoring data',
- health: {
- healthy: 'Healthy',
- unhealthy: 'Unhealthy',
- },
- summary: {
- healthy: 'All components are healthy',
- unhealthy: 'Some components need attention',
- components: '{{healthy}} of {{total}} components healthy',
- },
- tabs: {
- label: 'Monitoring type',
- overview: 'Overview',
- queue: 'Task queue',
- vikingdb: 'VectorDB',
- models: 'Models',
- filesystem: 'Filesystem',
- lock: 'Locks',
- retrieval: 'Retrieval',
- },
- detail: {
- noData: 'No monitoring data',
- descriptions: {
- queue: 'Resource processing, semantic generation, and session queues.',
- vikingdb: 'Vector storage and indexing service.',
- models: 'VLM, embedding, and rerank model services.',
- filesystem: 'OpenViking filesystem and mount services.',
- lock: 'Transaction locks and concurrency control.',
- retrieval: 'Context retrieval service.',
- },
- },
- offline: {
- title: 'OpenViking is not connected',
- description:
- 'Configure the server URL and credentials to view monitoring data.',
- action: 'Open connection settings',
- },
- },
- skillsPage: {
- title: 'Skills',
- description:
- 'View Agent skills available to the current user and workspace.',
- refresh: 'Refresh',
- loading: 'Loading skills...',
- empty: 'No skills available',
- emptyDescription:
- 'User and shared skills will appear here after they are added.',
- loadFailed: 'Could not load skills',
- networkError:
- 'Could not connect to the OpenViking service. Check the server URL and connection status.',
- connectionSettings: 'Open connection settings',
- detail: 'Details',
- viewDetail: 'View {{name}} details',
- detailLoading: 'Loading skill details...',
- detailLoadFailed: 'Could not load skill details',
- directory: 'Directory',
- none: 'None',
- metrics: {
- files: 'Files',
- scope: 'Scope',
- },
- sections: {
- allowedTools: 'Allowed tools',
- content: 'SKILL.md',
- description: 'Description',
- files: 'Files',
- overview: 'Overview',
- tags: 'Tags',
- },
- scopes: {
- user: 'User skill',
- agent: 'Shared skill',
- },
- },
- tasksPage: {
- title: 'Task Center',
- description:
- 'Track background work such as resource processing, session commits, and reindexing.',
- refresh: 'Refresh',
- loading: 'Loading tasks...',
- empty: 'No background tasks',
- emptyDescription:
- 'Asynchronous work will appear here with its status and update time.',
- emptyFiltered: 'No matching tasks',
- emptyFilteredDescription: 'Adjust or clear the filters to see other tasks.',
- loadFailed: 'Could not load tasks',
- detail: {
- title: 'Task details',
- loading: 'Loading task details...',
- loadFailed: 'Could not load task details',
- retry: 'Retry',
- openLabel: 'View details for task {{taskId}}',
- fields: {
- status: 'Task status',
- type: 'Task type',
- stage: 'Current stage',
- resource: 'Resource',
- createdAt: 'Created',
- updatedAt: 'Updated',
- },
- error: 'Failure reason',
- result: 'Result',
- noResult: 'No result yet',
- noResultDescription:
- 'Results returned by the API will appear here when the task completes.',
- noResultFailedDescription:
- 'This task did not return a result. See the failure reason above.',
- noResultCancelledDescription:
- 'This task was cancelled before it returned a result.',
- },
- filters: {
- label: 'Filter',
- type: 'Task type',
- status: 'Task status',
- allTypes: 'All types',
- allStatuses: 'All statuses',
- clear: 'Clear filters',
- },
- pagination: {
- next: 'Next',
- page: 'Page {{page}}',
- pageSize: 'Rows per page',
- pageSizeValue: '{{count}} per page',
- previous: 'Previous',
- scope:
- 'Showing the latest {{count}} tasks (the API returns at most {{limit}})',
- },
- table: {
- task: 'Task',
- type: 'Type',
- resource: 'Resource',
- createdAt: 'Created',
- status: 'Status',
- },
- status: {
- cancelled: 'Cancelled',
- cancelling: 'Cancelling',
- completed: 'Completed',
- failed: 'Failed',
- pending: 'Pending',
- running: 'Running',
- unknown: 'Unknown',
- },
- types: {
- session_commit: 'Session commit',
- add_resource: 'Resource processing',
- add_skill: 'Skill import',
- connector_import: 'Connector import',
- admin_reindex: 'Reindex',
- snapshot_restore_reindex: 'Snapshot reindex',
- legacy_migration: 'Legacy migration',
- legacy_cleanup: 'Legacy cleanup',
- },
- },
- accountSwitcher: {
- create: 'Create account',
- dialog: {
- accountLabel: 'Account',
- accountPlaceholder: 'team-account',
- adminLabel: 'Initial admin user',
- cancel: 'Cancel',
- description:
- 'Create a workspace and its first administrator. Studio switches to it after creation.',
- submit: 'Create and switch',
- title: 'Create account',
- },
- empty: 'No matching accounts',
- errors: {
- loadAccounts: 'Could not load accounts',
- noCreatedKey:
- 'The account was created, but the server did not return a data credential.',
- noUsableKey:
- 'This account has no plaintext user API key available for data access.',
- noUsers: 'This account has no available users.',
- },
- loading: 'Loading accounts...',
- manualSwitch: {
- description:
- 'The server did not expose a plaintext credential for {{account}}. Enter a User API Key from that account.',
- hint: 'Studio only verifies the key and switches the active data identity. It will not modify or rotate the server credential.',
- keyLabel: 'User API Key',
- keyPlaceholder: 'Paste a User API Key for the target account',
- manageOnly: 'Manage without a User Key',
- submit: 'Verify and switch',
- title: 'Enter a User API Key',
- },
- memberCount: '{{count}} users',
- searchPlaceholder: 'Search accounts',
- toast: {
- created: 'Created and switched to {{account}}',
- createdSwitchFailed:
- 'Created {{account}}, but data identity switching failed: {{error}}. The Account remains available for management.',
- managementSwitched:
- 'Switched management to {{account}}. Select or create a User Key before opening tenant data.',
- switched: 'Switched to {{account}}',
- },
- unset: 'No account selected',
- },
- common: {
- action: {
- cancel: 'Cancel',
- saveConnection: 'Save Connection',
- showAdvancedIdentityFields: 'Show Advanced Identity Fields',
- },
- errorBoundary: {
- description:
- 'An unhandled exception occurred while rendering the route. Try again first; if it persists, inspect the error details below.',
- reload: 'Reload Page',
- retry: 'Retry',
- title: 'Something went wrong',
- },
- language: {
- current: 'Current',
- label: 'Language',
- },
- theme: {
- toggle: 'Toggle theme',
- },
- },
- connection: {
- devMode: {
- description:
- 'This server provides identity automatically, so account, user, and API key are usually not required.',
- title: 'Server-managed identity',
- },
- dialog: {
- title: 'Connection & Identity',
- },
- identitySummary: {
- dev: 'Server-managed identity',
- named: '{{identity}}',
- unset: 'Identity not set',
- },
- fields: {
- accountId: {
- label: 'Account',
- placeholder: 'default',
- },
- apiKey: {
- label: 'API Key',
- placeholder: 'Enter X-API-Key or Bearer token',
- },
- adminApiKey: {
- label: 'Admin API key',
- placeholder: 'Root or account-admin key',
- },
- baseUrl: {
- label: 'Service URL',
- placeholder: 'http://127.0.0.1:1933',
- },
- credentials: {
- title: 'Identity & Credentials',
- },
- dataApiKey: {
- label: 'User API key',
- },
- userId: {
- label: 'User',
- placeholder: 'default',
- },
- },
- },
- settings: {
- actions: {
- addAccount: 'Add account',
- addUser: 'Add user',
- cancel: 'Cancel',
- changeRole: 'Change the role for {{user}}',
- confirmRemoveUser: 'Delete user',
- confirmRoleChange: 'Confirm change',
- copy: 'Copy',
- currentIdentity: 'Current identity',
- refresh: 'Refresh',
- regenerate: 'Regenerate',
- removeUser: 'Delete {{user}}',
- save: 'Save',
- switchIdentity: 'Switch identity',
- use: 'Use',
- },
- connection: {
- accountListLimited:
- 'This key cannot list all accounts, but it can still manage the selected account if it has account-admin access.',
- adminError: 'Could not verify the Root API Key: {{message}}',
- description:
- 'Use a User API Key for tenant data APIs and an optional Root or account-admin key for control APIs.',
- devMode:
- 'Development mode is active — identity is automatic and no API key is required.',
- keyGuide: {
- control: {
- primary:
- 'Your User API Key already enables the Playground and data access. Regular users do not need a control credential.',
- secondary:
- 'To switch Accounts or manage users, request a Root Key from the deployment admin or an Admin Key from the current Account admin. The Root Key is stored at server.root_api_key in the server-side ov.conf.',
- title: 'Need to manage Accounts or users?',
- },
- data: {
- primary:
- 'The Root/Admin API Key is mainly for management. The Playground and tenant data APIs require a User API Key bound to a user identity.',
- secondary:
- 'Select or create a user in User Management, or regenerate its key, then use it as the User API Key.',
- title: 'A User API Key is still required',
- },
- empty: {
- primary:
- 'Regular users should request a User API Key from their Account admin.',
- secondary:
- 'Deployment admins can find the Root API Key at server.root_api_key in the server-side ov.conf. Add it here, then create or regenerate a User Key in User Management.',
- title: 'No OpenViking API Key yet?',
- },
- learnMore: 'Learn how to get an API Key',
- trusted: {
- primary:
- 'This trusted server enforces Root Key validation. The browser needs the same Root API Key for management and tenant data requests.',
- secondary:
- 'Request the Root Key from the deployment admin; it is stored at server.root_api_key in the server-side ov.conf. Trusted-mode data identity comes from Account/User assertions and does not need a User API Key.',
- title: 'This trusted server requires a Root API Key',
- },
- },
- rootHint: 'Lists accounts and users, and mints or rotates keys.',
- title: 'Connection settings',
- unsupportedAuthMode: {
- description:
- 'Web Studio does not support the {{mode}} authentication mode. Please use the {{ov}} CLI or Python SDK to interact with this server.',
- primary: 'This server is configured with {{mode}} authentication.',
- title: 'Unsupported authentication mode',
- },
- userHint: 'Used by the Playground and tenant data APIs.',
- },
- connectionPage: {
- description:
- 'Configure the OpenViking server connection, control credential, and active data credential.',
- title: 'Connection settings',
- },
- dialogs: {
- addAccount: {
- description:
- 'Create a workspace account and its first admin user. The new key will be shown once.',
- title: 'Add account',
- },
- addUser: {
- currentAccountDescription:
- 'Create a user in {{accountId}}. The generated key is shown only once.',
- description:
- 'Register a user under an existing account. The generated key will be shown once.',
- title: 'Add user',
- },
- changeRole: {
- description:
- 'Change the role for {{account}} / {{user}} to {{role}}. The new permissions take effect immediately.',
- title: 'Change user role?',
- },
- regenerate: {
- description:
- 'Regenerate the API key for {{account}} / {{user}}. The current key stops working immediately.',
- title: 'Regenerate API key?',
- },
- removeUser: {
- description:
- 'Remove {{user}} from {{account}}? Their API key stops working immediately. This action cannot be undone.',
- title: 'Delete user?',
- },
- },
- empty: {
- adminDescription:
- 'Use a root or account admin API key to list users, copy keys, add identities, or regenerate credentials.',
- adminTitle: 'Admin access required',
- usersDescription: 'Create a user to mint the first API key.',
- usersTitle: 'No users in the selected accounts',
- },
- fields: {
- account: 'Account',
- adminUser: 'Admin user',
- adminApiKey: 'Admin API key',
- apiKey: 'API key',
- baseUrl: 'Server URL',
- dataApiKey: 'User API key',
- rootApiKey: 'Root or Admin API Key',
- userApiKey: 'User API Key',
- role: 'Role',
- user: 'User',
- },
- health: {
- admin: 'Admin control',
- data: 'Data access',
- state: {
- checking: 'Checking',
- error: 'Error',
- ok: 'OK',
- skipped: 'Not checked',
- },
- },
- keyResult: {
- description:
- 'Copy it now. OpenViking may only show a prefix after you leave this state.',
- dismiss: 'Dismiss',
- title: 'New API key',
- },
- loading: 'Loading identities...',
- management: {
- accountFilter: 'Accounts',
- accessDeniedDescription:
- 'User management requires a validated Root or Account Admin API key.',
- accessDeniedTitle: 'User management unavailable',
- currentAccountDescription:
- 'Manage users and access credentials in the {{account}} workspace.',
- description:
- 'Review users and credentials for selected accounts, then add users or rotate keys from the web UI.',
- memberListDescription:
- '"Switch identity" uses that user for data pages such as Playground and Retrieval without changing the active Root/Admin management credential.',
- memberListDescriptionRoot:
- 'You can change member roles here. "Switch identity" only changes the user used by data pages such as Playground and Retrieval; it does not change the active Root management credential.',
- memberListTitle: 'Workspace members',
- cannotRemoveCurrentIdentity: 'The active identity cannot be deleted.',
- cannotRemoveLastManager:
- 'The last workspace administrator cannot be deleted.',
- noUsableKey:
- 'This user has no plaintext API key available for data access.',
- openConnection: 'Open connection settings',
- title: 'User management',
- },
- page: {
- adminDescription:
- 'Configure the active OpenViking Studio identity and manage accounts, users, and API keys.',
- description:
- 'Configure the OpenViking Studio server URL and API key, then view data for the current identity.',
- title: 'Connection & Identity',
- },
- placeholders: {
- account: 'team-account',
- adminApiKey: 'Root or account-admin key',
- apiKey: 'Enter X-API-Key or Bearer token',
- baseUrl: 'http://127.0.0.1:1933',
- devModeApiKey: '[dev mode, no api key required]',
- userApiKey: 'User API key',
- user: 'default',
- },
- roles: {
- admin: 'Admin',
- root: 'Root',
- user: 'User',
- },
- serverMode: {
- api_key: 'API key mode',
- checking: 'Checking...',
- dev: 'Development mode',
- ldap: 'LDAP mode',
- offline: 'Offline',
- oidc: 'OIDC mode',
- trusted: 'Trusted mode',
- },
- stats: {
- accounts: 'Total accounts',
- apiKeys: 'Visible API keys',
- users: 'Users',
- },
- table: {
- account: 'Account',
- actions: 'Actions',
- apiKey: 'API key',
- role: 'Role',
- user: 'User',
- },
- toast: {
- accountCreated: 'Account created',
- connectionSaved: 'Connection saved',
- copyFailed: 'Copy failed',
- copied: 'Copied',
- dataKeySelected: 'Data access identity switched',
- keyRegenerated: 'API key regenerated',
- roleUpdated: "{{user}}'s role changed to {{role}}",
- userCreated: 'User created',
- userRemoved: '{{user}} deleted',
- },
- },
- home: {
- contextCommits: {
- description:
- 'Groups resource, skill, session message, and session commit writes into 4-hour buckets. Hover a cell for details.',
- empty: 'No context commits in the last year',
- hourRange: '{{start}}-{{end}}',
- legend: {
- high: 'High',
- intense: 'Intense',
- low: 'Low',
- medium: 'Medium',
- more: 'More',
- none: 'Less',
- title: 'Commit intensity',
- },
- operations: {
- addResource: 'Resource writes',
- addSkill: 'Skill writes',
- sessionAddMessage: 'Session messages',
- sessionCommit: 'Session commits',
- },
- stats: {
- activeDays: 'Active days',
- peakDay: 'Peak day',
- recentDay: 'Recent commit',
- },
- title: 'Context Commit Stats',
- yearlyEmpty: 'No context commits',
- yearlyTotal: '{{count}} context commits',
- tooltip: {
- total: 'Total commits',
- },
- },
- contextData: {
- description:
- 'Includes files, skills, and user memories to show the current context resource scale.',
- files: 'Files',
- memories: 'Memories',
- skills: 'Skills',
- title: 'Context Data Volume',
- },
- page: {
- description:
- 'Aligned with the product overview: menu entries, context data volume, today tokens, today retrievals, agent access, token trend, and context commit stats.',
- eyebrow: 'OpenViking Studio',
- settings: 'Connection & Settings',
- title: 'Overview',
- },
- requestFailed: 'Request failed',
- todayRetrievals: {
- description:
- 'Shows successful semantic retrieval calls for find() and search() today. Resets at midnight.',
- find: 'find',
- search: 'search',
- title: 'Retrievals Today',
- },
- todayTokens: {
- description:
- 'Shows real-time token consumption today. Resets at midnight.',
- embeddingInput: 'Embedding input tokens',
- title: 'Tokens Today',
- vlmInput: 'VLM input tokens',
- vlmOutput: 'VLM output tokens',
- },
- tokenTrend: {
- description:
- 'Shows daily token usage over the last 14 days, including VLM input, VLM output, and embedding input.',
- empty: 'No token usage in the last 14 days',
- title: 'Total Token Consumption',
- },
- usageDisabled:
- 'Usage/Audit is not initialized, so live usage stats are unavailable.',
- usageAccessRequired:
- 'Current connection has no admin/root role. Configure an API key with Console Usage/Audit access in Connection & Identity.',
- },
- operations: {
- page: {
- placeholder: 'Operations dashboard is under construction.',
- },
- },
- requestLogs: {
- accessRequired: {
- description:
- 'Current connection has no admin/root role. Configure an API key with Console Usage/Audit access in Connection & Identity.',
- title: 'Admin access required',
- },
- clear: 'Clear',
- description:
- 'Inspect server-side audited API requests for the current identity, including status, latency, and request identifiers.',
- disabled: {
- description:
- 'Usage/Audit is not initialized, so server-side request logs are unavailable.',
- title: 'Audit logs unavailable',
- },
- empty: {
- description: 'Start your first audited API call!',
- filteredDescription:
- 'Adjust the query or status filter to broaden the visible log entries.',
- filteredTitle: 'No matching requests',
- title: 'No logs yet',
- upload: 'Upload File',
- },
- error: {
- description: 'Failed to load audited request logs from the server.',
- title: 'Request failed',
- },
- eyebrow: 'Playground telemetry',
- filters: {
- all: 'All logs',
- apiTypePlaceholder: 'API type',
- error: 'Error logs',
- requestIdPlaceholder: 'Exact Request ID',
- statusCodePlaceholder: 'Status code',
- },
- loading: 'Loading request logs...',
- metrics: {
- successRate: 'Success rate',
- total: 'Total calls',
- },
- pagination: {
- next: 'Next',
- pageSize: 'Rows per page',
- pageSizeValue: '{{count}} / page',
- previous: 'Previous',
- summary: '{{total}} total, page {{page}} / {{pageCount}}',
- },
- query: 'Query',
- refresh: 'Refresh',
- reset: 'Reset',
- searchPlaceholder: 'Filter method, path, or status',
- scope: {
- currentIdentity: 'Current scope: Current API key identity',
- currentIdentityWithName:
- 'Current scope: Current API key identity ({{identity}})',
- },
- status: {
- error: 'ERR',
- pending: 'PENDING',
- success: 'OK',
- },
- table: {
- accountId: 'Account ID',
- apiType: 'API Type',
- duration: 'Duration',
- method: 'Method',
- path: 'Path',
- requestId: 'Request ID',
- status: 'Status',
- time: 'Time',
- title: 'Captured requests',
- userId: 'User ID',
- },
- title: 'Request Logs',
- },
- addResource: {
- title: 'Add Resource',
- description:
- 'Upload a local file to the server. File type is auto-detected via magic bytes.',
- dropzone: {
- title: 'Drag & drop a file here, or click to select',
- hint: 'Up to 10 files at a time.',
- supportedFormats:
- 'Supports PDF, Word, PPTX, Excel, Markdown, code files, images, and more',
- },
- fileInfo: {
- name: 'File',
- size: 'Size',
- type: 'Type',
- unknown: 'Unknown type',
- remove: 'Remove',
- },
- targetUri: 'Target URI',
- 'targetUri.placeholder': 'viking://resources/',
- 'targetUri.hint':
- 'Choose where to store this resource. Defaults to viking://resources/.',
- 'targetUri.browse': 'Browse',
- advancedOptions: 'Advanced Options',
- upload: 'Upload File',
- 'upload.processing': 'File uploaded, processing...',
- uploading: 'Uploading\u2026',
- result: {
- success: 'Upload complete!',
- skippedFiles: '{{count}} file(s) skipped (unsupported format)',
- },
- cancelUpload: 'Cancel',
- startProcessing: 'Start Processing',
- success: 'Resource added successfully',
- fileBlocked: '"{{name}}" is not a supported file type.',
- fileTooLarge: '"{{name}}" exceeds the {{size}} file size limit.',
- tooManyFiles: 'Only the first {{count}} files were kept.',
- error: 'Request Failed',
- dirPicker: {
- title: 'Select Directory',
- select: 'Select',
- cancel: 'Cancel',
- empty: 'Empty directory',
- error: 'Failed to load directory',
- selected: 'Selected:',
- },
- mode: {
- upload: 'Upload File',
- remote: 'Remote URL',
- },
- remoteUrl: 'Remote URL',
- 'remoteUrl.placeholder': 'https://github.com/org/repo',
- 'remoteUrl.hint':
- 'HTTP(S) URL, Git repository, or other remote resource address.',
- strict: 'Strict Mode',
- 'strict.hint':
- 'When enabled, the server will reject files with unsupported or unrecognized types instead of skipping them silently.',
- directlyUploadMedia: 'Directly Upload Media',
- 'directlyUploadMedia.hint':
- 'When enabled, media files (images, audio, video) are stored as-is. When disabled, media files are processed through AI vision/audio pipeline for content extraction first.',
- createParent: 'Auto-create Parent Folder',
- 'createParent.hint':
- 'When enabled, automatically creates the parent directory if it does not exist.',
- reason: 'Reason',
- 'reason.placeholder': 'Why are you adding this resource?',
- instruction: 'Instruction',
- 'instruction.placeholder':
- 'Special processing instructions for this resource.',
- directoryScan: {
- title: 'Directory Scan Options',
- ignoreDirs: 'Ignore Directories',
- 'ignoreDirs.placeholder': 'node_modules, .git, __pycache__',
- include: 'Include Pattern',
- 'include.placeholder': '*.py, *.md',
- exclude: 'Exclude Pattern',
- 'exclude.placeholder': '*.log, *.tmp',
- },
- },
- resources: {
- processingTasks: {
- title: 'File Processing Tasks',
- empty: 'No processing tasks',
- toggleError: 'Toggle error details',
- columns: {
- fileName: 'File Name',
- status: 'Status',
- size: 'Size',
- },
- status: {
- cancelled: 'Cancelled',
- processing: 'Processing',
- success: 'Processed',
- failed: 'Processing failed',
- },
- },
- searchPalette: {
- ariaLabel: 'Search',
- openContainingDirectory: 'Open containing directory',
- placeholder: 'Search',
- scope: {
- global: 'Search scope: Global',
- current: 'Search scope: {{name}}',
- resetToGlobal: 'Click to reset to global search',
- },
- scopeState: {
- validatingTitle: 'Validating search scope',
- validatingPrefix: 'Checking whether',
- validatingSuffix: 'exists',
- switchTitle: 'Switch search scope',
- switchPrefix: 'Press',
- switchMiddle: 'to switch to',
- invalidTitle: 'Search scope not found',
- invalidPrefix: 'Path',
- invalidSuffix: 'is inaccessible and cannot be switched to',
- },
- empty: {
- title: 'Search files and directories',
- },
- browseDirHint: {
- before: 'Enter',
- after: 'to browse directories',
- },
- globalScopeHint: {
- before: 'Enter',
- after: 'to switch search scope to global',
- },
- error: 'Search failed',
- emptyResults: {
- title: 'No matching files or directories found',
- subtitle: 'Try another keyword?',
- },
- footer: {
- dirMode: {
- select: 'Select',
- level: 'Level',
- confirm: 'Confirm',
- cancel: 'Cancel',
- },
- resultMode: {
- navigate: 'Navigate',
- open: 'Open',
- close: 'Close',
- count: '{{count}} results',
- },
- },
- },
- dirBrowser: {
- back: 'Back',
- loading: 'Loading directory',
- filesSection: 'Files',
- error: 'Failed to load directory',
- empty: {
- title: 'Empty directory',
- subtitle:
- 'There are currently no subdirectories to expand at this level',
- },
- },
- filePreview: {
- cancel: 'Cancel',
- edit: 'Edit',
- emptyFile: '(empty file)',
- emptyPrompt: 'Select a file to preview it here',
- formattingJson: 'Formatting JSON...',
- imageFailed: 'Image failed to load.',
- imageLoading: 'Loading image...',
- largeFileSkipped: 'This file is large and was not loaded automatically.',
- jsonFormatFailed: 'JSON formatting failed. Showing the raw content.',
- loadFile: 'Load anyway',
- loadingContent: 'Reading content...',
- loadingEditor: 'Loading editor...',
- markdownPreview: 'Preview',
- markdownSource: 'Source',
- noDirectoryContext: 'No abstract or overview available for this folder.',
- save: 'Save',
- selectDirectoryContext: 'Select a chip to show folder context.',
- unsupportedBinary: 'Binary files do not support text preview.',
- jsonl: {
- collapse: 'Collapse',
- dialogMode: 'Dialog',
- emptyJsonl: 'Empty JSONL.',
- emptyMessage: 'Empty message',
- expand: 'Expand',
- noArguments: 'No arguments',
- rawMode: 'JSONL',
- recordCount: '{{count}} record',
- recordCount_other: '{{count}} records',
- toolcall: 'toolcall',
- },
- },
- },
- retrieval: {
- title: 'Retrieval',
- searchPlaceholder: 'Search context',
- placeholders: {
- find: 'Enter a semantic query',
- search: 'Enter a question to interpret with session context',
- grep: 'Enter a regular expression or exact text',
- glob: 'Enter a file pattern, for example **/*.md',
- },
- send: 'Search',
- controls: {
- function: 'Retrieval Function',
- modes: {
- find: 'find',
- search: 'search',
- grep: 'grep',
- glob: 'glob',
- },
- ignoreCase: 'Ignore case',
- resultCount: 'Results',
- path: 'Path',
- pathPlaceholder: '/',
- scope: 'Scope',
- customScope: 'Custom scope',
- customScopePlaceholder: 'resources/project or viking://...',
- effectiveScope: 'Scope',
- allContexts: 'All contexts',
- scopes: {
- all: {
- label: 'All contexts',
- },
- resources: {
- label: 'Resources',
- },
- custom: {
- label: 'Custom URI',
- },
- },
- sessionId: 'Session ID',
- sessionPlaceholder: 'session_id (optional)',
- },
- advanced: {
- title: 'More filters',
- contextTypes: 'Context types',
- levels: 'Content levels',
- scoreThreshold: 'Minimum relevance',
- tags: 'Search tags',
- tagsPlaceholder: 'For example env=prod, team=search',
- tagsInvalid: 'Tags must use key=value format, separated by commas',
- timeRange: 'Time range',
- since: 'Start, e.g. 7d',
- until: 'End, e.g. 2026-07-27',
- anyTime: 'Any time',
- quickRange: 'Quick range',
- last24Hours: 'Last 24 hours',
- last7Days: 'Last 7 days',
- last30Days: 'Last 30 days',
- customRange: 'Custom dates',
- startDate: 'Start date',
- endDate: 'End date',
- clearTimeRange: 'Clear time range',
- timeField: 'Time field',
- updatedAt: 'Updated time',
- createdAt: 'Created time',
- provenance: 'Include retrieval provenance',
- reset: 'Reset filters',
- },
- detail: {
- score: 'Score',
- level: 'Level',
- openPlayground: 'Open in Playground',
- uri: 'URI',
- summary: 'Summary',
- noSummary: 'No summary available',
- matchReason: 'Match reason',
- },
- results: {
- title: 'Search Results',
- topN: 'Search Results (Top{{count}})',
- line: 'Line {{line}}',
- lineLabel: 'Line',
- score: 'Score',
- uri: 'URI',
- description: 'Description',
- provenance: 'Retrieval provenance ({{count}})',
- },
- types: {
- resource: 'Resources',
- memory: 'Memories',
- skill: 'Skills',
- },
- queryPlan: {
- title: '{{count}} planned queries',
- more: '+{{count}} more',
- },
- loading: {
- vector: 'Searching vector indexes...',
- scan: 'Scanning context hierarchy...',
- match: 'Matching semantic context...',
- rerank: 'Reranking results...',
- },
- empty: {
- checking: 'Checking retrievable context...',
- readyTitle: 'Retrievable context is available',
- readyDescription: 'Enter a keyword and press Enter to search',
- title: 'No retrievable context yet',
- description: 'Upload your first resource to get started.',
- upload: 'Upload File',
- },
- error: {
- title: 'Search failed',
- fallback: 'The request could not be completed. Please try again.',
- network:
- 'The OpenViking service could not be reached. Check the connection URL, service status, or CORS configuration.',
- code: 'Error code',
- status: 'HTTP status',
- requestId: 'Request ID',
- },
- noResults: {
- title: 'No matching content found',
- subtitle: 'Try another keyword or adjust the path scope',
- },
- },
- sessions: {
- page: {
- placeholder: 'Sessions and Bot workspace is under construction.',
- },
- threadList: {
- title: 'Sessions',
- newSession: 'New Session',
- count: '{{count}} session',
- count_other: '{{count}} sessions',
- loading: 'Loading sessions...',
- emptyTitle: 'No sessions yet',
- emptyDescription: 'Select the plus button to start a new conversation.',
- deleteSession: 'Delete “{{title}}”',
- deleteConfirmTitle: 'Delete session?',
- deleteConfirmDescription:
- '“{{title}}” and its conversation history will be permanently deleted. This action cannot be undone.',
- cancel: 'Cancel',
- confirmDelete: 'Delete',
- deleting: 'Deleting...',
- deleteSuccess: 'Session deleted',
- deleteFailed: 'Could not delete session: {{error}}',
- shortcut: '⌘ N to create a new session',
- },
- chat: {
- copy: 'Copy',
- emptyDescription: 'Explore your knowledge base and start a conversation.',
- placeholder: 'Type a message...',
- emptyState: 'Select or create a session to start chatting.',
- thinking: 'Thinking...',
- reasoning: 'Reasoning',
- iteration: 'Round {{count}}',
- toolCall: 'Tool call',
- toolInput: 'Input',
- toolResult: 'Result',
- loadMoreRefs: 'Load {{count}} more ({{remaining}} remaining)',
- relativeTime: {
- justNow: 'Just now',
- minutesAgo: '{{count}} minute ago',
- minutesAgo_other: '{{count}} minutes ago',
- hoursAgo: '{{count}} hour ago',
- hoursAgo_other: '{{count}} hours ago',
- daysAgo: '{{count}} day ago',
- daysAgo_other: '{{count}} days ago',
- },
- toolStatus: {
- completed: 'Completed',
- failed: 'Failed',
- running: 'Running...',
- },
- send: 'Send',
- cancel: 'Stop',
- },
- impact: {
- title: 'Memory impact',
- open: 'View memory changes caused by this session',
- description: '{{changes}} memory changes across {{commits}} commits',
- kinds: {
- add: 'Added',
- update: 'Updated',
- delete: 'Deleted',
- },
- allTypes: 'All',
- filterByType: 'Filter by memory type',
- before: 'Before',
- after: 'After',
- addedContent: 'Added content',
- deletedContent: 'Deleted content',
- emptyContent: 'No content to display',
- loading: 'Loading memory changes...',
- loadFailed: 'Could not load memory changes',
- retry: 'Retry',
- empty: 'This session commit did not produce any memory changes.',
- },
- empty: {
- description: 'Select a session from the list or create a new one.',
- title: 'No session selected',
- },
- },
- oauth: {
- identityPicker: {
- useCurrent: 'Authorize as the current identity',
- noCurrent:
- 'No identity set. Open Connection & Identity to sign in first, or use a different API key below.',
- useSelect: 'Authorize a specific account / user',
- selectAccountLabel: 'Account',
- selectUserLabel: 'User',
- selectNoKey:
- 'This user has no API key. Pick another user or regenerate a key in Connection & Identity.',
- selectAccountAdminHint:
- 'You can authorize users in your own account only.',
- useCustom: 'Use a different API key',
- customKeyLabel: 'API key',
- customKeyPlaceholder: 'Paste an API key (not persisted)',
- },
- consent: {
- title: 'Authorize {{clientName}}',
- loading: 'Loading authorization request…',
- expired:
- 'This authorization has expired or is no longer valid. Restart the flow from your MCP client.',
- missingPending:
- 'Missing authorization id. Open the link your MCP client gave you.',
- requestSummary:
- '{{clientName}} is requesting access to your OpenViking workspace.',
- redirectLabel: 'Redirect',
- scopesLabel: 'Scopes',
- scopesNone: '(none)',
- signInRequired:
- 'Sign in to OpenViking Studio (Connection & Identity) or paste an API key below to authorize this client.',
- openConnectionSettings: 'Open Connection & Identity',
- authorize: 'Authorize',
- deny: 'Deny',
- useAnotherDevice: 'Use another device →',
- waitingRedirect: 'Authorized — redirecting back to the client…',
- verifying: 'Verifying…',
- denying: 'Denying…',
- denied: 'Denied. You can close this tab.',
- verifyError: 'Authorization failed: {{message}}',
- noApiKey: 'No API key available. Select an identity or paste a key.',
- },
- verify: {
- title: 'Cross-device verify',
- description:
- 'Enter the 6-character code shown on the device that started the MCP client login.',
- codeLabel: 'Verification code',
- codePlaceholder: '6-character code',
- submit: 'Authorize',
- success:
- 'Authorized for {{clientName}}. You can close this tab and return to the original device.',
- successUnknownClient:
- 'Authorized. You can close this tab and return to the original device.',
- verifyError: 'Authorization failed: {{message}}',
- noApiKey: 'No API key available. Select an identity or paste a key.',
- signInRequired:
- 'Sign in to OpenViking Studio (Connection & Identity) or paste an API key below to verify.',
- },
- },
- playground: {
- copyUri: 'Copy current URI',
- copied: 'URI copied',
- copyFailed: 'Copy failed',
- resizeContext: 'Resize context tree width',
- resizeAction: 'Resize Terminal and Agent width',
- readFailed: 'Failed to read {{uri}}',
- tabs: {
- terminal: 'Terminal',
- agent: 'Agent',
- },
- addResource: {
- title: 'Add resource',
- description:
- 'After it finishes, the context tree on the left refreshes and the Terminal on the right can locate the new resource.',
- submitted: 'Resource add task submitted',
- },
- explorer: {
- title: 'Context tree',
- addResource: 'Add resource',
- abstractLevel: 'L0',
- empty: 'empty',
- loading: 'loading',
- overviewLevel: 'L1',
- search: 'Search context',
- refresh: 'Refresh tree',
- namespaces: {
- agent: 'Agent capabilities, tools, and experience',
- user: 'Personalized user memories',
- resources: 'External resources the Agent can reference',
- },
- },
- agent: {
- history: 'Session history',
- newSession: 'New session',
- creating: 'Creating Playground session...',
- detectingBot: 'Detecting bot mode...',
- createFailed: 'Failed to create session: {{error}}',
- retry: 'Retry',
- botDisabledFooter: 'Enable bot mode to chat with the Agent',
- historyTitle: 'Agent session history',
- historyDescription:
- 'Only sessions used by the Agent panel are shown here; a new session opens a blank Agent context.',
- loadingSessions: 'Loading sessions...',
- noSessions: 'No session history yet',
- createTimeout:
- 'Creating the Playground session timed out. Check your connection settings and try again.',
- newSessionTitle: 'New Playground session',
- botPrompt: {
- title: 'Please enable bot mode',
- description:
- 'The current service has not enabled Agent chat. Start the service in bot mode and try again.',
- command: 'openviking-server --with-bot',
- retry: 'Detect again',
- },
- empty: {
- heading: 'Agent actions sync with the tree on the left',
- body: 'After you send a question, `viking://` files in the tool call output become clickable links — click to locate them on the left and open them in the middle.',
- prompts: [
- 'Summarize the current directory',
- 'Recursively find related docs',
- 'Explain how this resource relates to the project',
- ],
- },
- },
- terminal: {
- header: 'Terminal',
- history: 'Command history',
- historyTitle: 'Command history',
- historyDescription: 'Review commands run in this browser.',
- clearHistory: 'Clear command history',
- noHistory: 'No command history',
- welcomeTitle: 'Terminal connected to the context tree',
- welcomeBody:
- 'Run /status, /ls, /search, /read, /add-resource. /search is global by default; add --scope . to use the current directory, or --scope viking://resources/... to limit it to a directory.',
- scopeLabel: 'cwd: {{uri}}',
- globalScope: 'global',
- opened: 'Resource opened',
- onlineTitle: 'Service online',
- onlineBody:
- 'OpenViking API responded normally; found {{count}} nodes under the root.',
- lsBody: 'Showing {{count}} nodes under {{uri}}.',
- fileEmpty: 'File is empty; opened in the middle preview.',
- searchUsage: 'Usage: {{name}} <query> [--scope .|viking://resources/...]',
- searchScopeLine: 'Search scope: {{scope}}',
- helpParameters: 'Parameters',
- helpExamples: 'Examples',
- helpSubcommands: 'Subcommands',
- noParameters: 'No parameters',
- currentScopeAction: 'Use current directory',
- readUsage: 'Usage: /read viking://resources/...',
- enterUri: 'Please enter a viking:// URI',
- hits: 'Hit {{resources}} resources, {{memories}} memories, {{skills}} skills.',
- addResourceBody:
- 'Opened the add-resource dialog. After submitting, the left tree refreshes; use /ls or /search to keep locating new content.',
- addResourceTitle: 'Add resource',
- sessionUsage:
- 'Usage: /session [current|list|create|switch|get|context|messages|archive|commit|extract|message|used|tool-results|tool-result|tool-search|delete] ...',
- sessionDeleteUsage: 'Usage: /session delete <session_id>',
- sessionMissing:
- 'No active session. Open the Agent panel to create one, or pass a session_id.',
- sessionCurrentBody: 'Current active session: {{id}}',
- sessionListBody: '{{count}} sessions.',
- sessionCreatedBody: 'Created and switched to session: {{id}}',
- sessionSwitchedBody: 'Switched to session: {{id}}',
- sessionDeletedBody: 'Deleted session: {{id}}',
- sessionMessageAddedBody: 'Added a message to session {{id}}.',
- unknownCommand:
- 'Unknown command. Available: /status, /ls, /search, /find, /read, /session, /add-resource.',
- commandFailed: 'Command failed',
- running: 'Running command...',
- placeholder: 'Enter a CLI command, e.g. /status',
- suggestionsTitle: 'Command suggestions',
- suggestionsHint: '↑↓ select · Tab complete · Enter run',
- quickStart: {
- title: 'Quick start',
- addResource: {
- title: 'Add a resource',
- command: '/add-resource',
- code: 'Import docs or files into viking://resources',
- },
- addMemory: {
- title: 'Add memory',
- command: 'Agent remembers from chat',
- code: 'Send a message in the Agent panel, then commit the session',
- },
- find: {
- title: 'Find related context',
- command: '/find openviking value',
- code: 'Search resources, memories, and skills from the current scope',
- },
- },
- commandGroups: {
- core: 'Core commands',
- filesystem: 'Filesystem',
- search: 'Search and summaries',
- status: 'Status',
- resource: 'Resource paths',
- history: 'History',
- },
- commandParameters: {
- query: {
- name: 'query',
- description: 'Keywords or a semantic question to search for.',
- },
- scope: {
- name: '--scope <.|uri>',
- description:
- 'Optional. Omit for global search; pass . for the current directory; pass uri for a specific directory.',
- },
- sessionAction: {
- name: 'subcommand',
- description:
- 'current, list, create, switch, get, context, messages, archive, commit, extract, message, used, tool-results, tool-result, tool-search, delete.',
- },
- sessionId: {
- name: 'session_id',
- description:
- 'Optional. Most subcommands use the current Agent session when omitted; delete requires an explicit ID.',
- },
- archiveId: {
- name: 'archive_id',
- description: 'Required when reading an archive.',
- },
- messageRole: {
- name: 'role',
- description: 'For the message subcommand. Use user or assistant.',
- },
- messageContent: {
- name: 'content',
- description:
- 'For the message subcommand. Text to append to the session.',
- },
- contexts: {
- name: '--context uri',
- description:
- 'Repeatable for the used subcommand. Records context actually used.',
- },
- skillJson: {
- name: '--skill-json JSON',
- description: 'For the used subcommand. Records skill usage details.',
- },
- keepRecent: {
- name: '--keep-recent count',
- description:
- 'For commit. Keep the most recent N live messages after commit.',
- },
- tokenBudget: {
- name: '--token-budget count',
- description:
- 'For context. Limits the token budget for assembled session context.',
- },
- toolName: {
- name: '--tool-name name',
- description: 'For tool-results. Filter by tool name.',
- },
- toolResultId: {
- name: 'tool_result_id',
- description:
- 'Required when reading or searching an externalized tool result.',
- },
- limit: {
- name: '--limit count',
- description: 'Limits tool result list, read, or search results.',
- },
- offset: {
- name: '--offset count',
- description: 'For tool-result. Read from a character offset.',
- },
- contextChars: {
- name: '--context-chars count',
- description:
- 'For tool-search. Controls context length around matches.',
- },
- timeout: {
- name: '--timeout seconds',
- description: 'Optional. Maximum time to wait for service readiness.',
- },
- uri: {
- name: 'uri',
- description:
- 'A viking:// resource path. It may be optional or required by command usage.',
- },
- },
- commandExamples: {
- status: {
- default: {
- code: '/status',
- description: 'Check Agent and API connectivity',
- },
- },
- ls: {
- current: {
- code: '/ls',
- description: 'List the current directory',
- },
- target: {
- code: '/ls viking://resources/',
- description: 'List a specified directory',
- },
- },
- search: {
- global: {
- code: '/search agent',
- description: 'Search globally',
- },
- current: {
- code: '/search agent --scope .',
- description: 'Use the highlighted directory',
- },
- scoped: {
- code: '/search agent --scope viking://resources/',
- description: 'Search only within a directory',
- },
- },
- find: {
- global: {
- code: '/find agent',
- description: 'Find related resources globally',
- },
- current: {
- code: '/find agent --scope .',
- description: 'Use the highlighted directory',
- },
- scoped: {
- code: '/find agent --scope viking://resources/',
- description: 'Find only within a directory',
- },
- },
- read: {
- file: {
- code: '/read viking://resources/file.md',
- description: 'Read and open a file',
- },
- },
- addResource: {
- default: {
- code: '/add-resource',
- description: 'Open the add-resource form',
- },
- },
- session: {
- current: {
- code: '/session',
- description: 'Show the current active session',
- },
- list: {
- code: '/session list',
- description: 'List all sessions',
- },
- create: {
- code: '/session create [session_id]',
- description: 'Create and switch to a new session',
- },
- switch: {
- code: '/session switch <session_id>',
- description: 'Switch the Agent panel session',
- },
- get: {
- code: '/session get [session_id]',
- description: 'Show session metadata',
- },
- context: {
- code: '/session context [session_id] --token-budget 8000',
- description: 'Read assembled session context',
- },
- messages: {
- code: '/session messages [session_id]',
- description: 'Read session messages',
- },
- archive: {
- code: '/session archive [session_id] <archive_id>',
- description: 'Read an archive',
- },
- commit: {
- code: '/session commit [session_id] --keep-recent 10',
- description: 'Archive and trigger memory extraction',
- },
- extract: {
- code: '/session extract [session_id]',
- description: 'Extract memories from a session',
- },
- message: {
- code: '/session message [session_id] user hello',
- description: 'Append a message to a session',
- },
- used: {
- code: '/session used [session_id] --context viking://resources/...',
- description: 'Record actually used context or skill',
- },
- toolResults: {
- code: '/session tool-results [session_id] --limit 20',
- description: 'List externalized tool results',
- },
- toolResult: {
- code: '/session tool-result [session_id] <tool_result_id>',
- description: 'Read one tool result',
- },
- toolSearch: {
- code: '/session tool-search [session_id] <tool_result_id> query',
- description: 'Search inside a tool result',
- },
- delete: {
- code: '/session delete <session_id>',
- description: 'Delete a session',
- },
- },
- tree: {
- current: {
- code: '/tree',
- description: 'Show the current directory tree',
- },
- target: {
- code: '/tree viking://resources/',
- description: 'Show a specified directory tree',
- },
- },
- stat: {
- target: {
- code: '/stat viking://resources/file.md',
- description: 'Show resource metadata',
- },
- },
- abstract: {
- target: {
- code: '/abstract viking://resources/',
- description: 'Read the directory abstract',
- },
- },
- overview: {
- target: {
- code: '/overview viking://resources/',
- description: 'Read the directory overview',
- },
- },
- health: {
- default: {
- code: '/health',
- description: 'Show backend health',
- },
- },
- wait: {
- default: {
- code: '/wait',
- description: 'Wait for service readiness',
- },
- timeout: {
- code: '/wait --timeout 30',
- description: 'Set wait time in seconds',
- },
- },
- },
- resourceSuggestion: 'Resource path',
- historySuggestion: 'History',
- groupLabels: {
- resources: 'resource',
- memories: 'memory',
- skills: 'skill',
- },
- commands: {
- status: {
- description: 'Check connection',
- usage: '/status',
- },
- ls: {
- description: 'View resources',
- usage: '/ls [viking://resources/...]',
- },
- search: {
- description: 'Semantic search',
- usage: '/search <query>',
- },
- find: {
- description: 'Find related resources',
- usage: '/find <query>',
- },
- read: {
- description: 'Read a resource file',
- usage: '/read viking://resources/.../file.md',
- },
- addResource: {
- description: 'Add external resources',
- usage: '/add-resource',
- },
- session: {
- description: 'Manage Agent sessions',
- usage: '/session subcommand',
- },
- tree: {
- description: 'Show directory tree',
- usage: '/tree [viking://resources/...]',
- },
- stat: {
- description: 'Show resource metadata',
- usage: '/stat viking://resources/...',
- },
- abstract: {
- description: 'Read directory abstract',
- usage: '/abstract viking://resources/...',
- },
- overview: {
- description: 'Read directory overview',
- usage: '/overview viking://resources/...',
- },
- health: {
- description: 'Show backend health',
- usage: '/health',
- },
- wait: {
- description: 'Wait for service readiness',
- usage: '/wait [--timeout seconds]',
- },
- },
- },
- },
+ ...workspace,
+ ...resources,
+ ...activity,
} as const
export default en
diff --git a/web-studio/src/i18n/locales/en/activity.ts b/web-studio/src/i18n/locales/en/activity.ts
new file mode 100644
index 000000000..632f65d7a
--- /dev/null
+++ b/web-studio/src/i18n/locales/en/activity.ts
@@ -0,0 +1,595 @@
+const activity = {
+ sessions: {
+ page: {
+ placeholder: 'Sessions and Bot workspace is under construction.',
+ },
+ threadList: {
+ title: 'Sessions',
+ newSession: 'New Session',
+ count: '{{count}} session',
+ count_other: '{{count}} sessions',
+ loading: 'Loading sessions...',
+ emptyTitle: 'No sessions yet',
+ emptyDescription: 'Select the plus button to start a new conversation.',
+ deleteSession: 'Delete “{{title}}”',
+ deleteConfirmTitle: 'Delete session?',
+ deleteConfirmDescription:
+ '“{{title}}” and its conversation history will be permanently deleted. This action cannot be undone.',
+ cancel: 'Cancel',
+ confirmDelete: 'Delete',
+ deleting: 'Deleting...',
+ deleteSuccess: 'Session deleted',
+ deleteFailed: 'Could not delete session: {{error}}',
+ shortcut: '⌘ N to create a new session',
+ },
+ chat: {
+ copy: 'Copy',
+ emptyDescription: 'Explore your knowledge base and start a conversation.',
+ placeholder: 'Type a message...',
+ emptyState: 'Select or create a session to start chatting.',
+ thinking: 'Thinking...',
+ reasoning: 'Reasoning',
+ iteration: 'Round {{count}}',
+ toolCall: 'Tool call',
+ toolInput: 'Input',
+ toolResult: 'Result',
+ loadMoreRefs: 'Load {{count}} more ({{remaining}} remaining)',
+ relativeTime: {
+ justNow: 'Just now',
+ minutesAgo: '{{count}} minute ago',
+ minutesAgo_other: '{{count}} minutes ago',
+ hoursAgo: '{{count}} hour ago',
+ hoursAgo_other: '{{count}} hours ago',
+ daysAgo: '{{count}} day ago',
+ daysAgo_other: '{{count}} days ago',
+ },
+ toolStatus: {
+ completed: 'Completed',
+ failed: 'Failed',
+ running: 'Running...',
+ },
+ send: 'Send',
+ cancel: 'Stop',
+ },
+ impact: {
+ title: 'Memory impact',
+ open: 'View memory changes caused by this session',
+ description: '{{changes}} memory changes across {{commits}} commits',
+ kinds: {
+ add: 'Added',
+ update: 'Updated',
+ delete: 'Deleted',
+ },
+ allTypes: 'All',
+ filterByType: 'Filter by memory type',
+ before: 'Before',
+ after: 'After',
+ addedContent: 'Added content',
+ deletedContent: 'Deleted content',
+ emptyContent: 'No content to display',
+ loading: 'Loading memory changes...',
+ loadFailed: 'Could not load memory changes',
+ retry: 'Retry',
+ empty: 'This session commit did not produce any memory changes.',
+ },
+ empty: {
+ description: 'Select a session from the list or create a new one.',
+ title: 'No session selected',
+ },
+ },
+ oauth: {
+ identityPicker: {
+ useCurrent: 'Authorize as the current identity',
+ noCurrent:
+ 'No identity set. Open Connection & Identity to sign in first, or use a different API key below.',
+ useSelect: 'Authorize a specific account / user',
+ selectAccountLabel: 'Account',
+ selectUserLabel: 'User',
+ selectNoKey:
+ 'This user has no API key. Pick another user or regenerate a key in Connection & Identity.',
+ selectAccountAdminHint:
+ 'You can authorize users in your own account only.',
+ useCustom: 'Use a different API key',
+ customKeyLabel: 'API key',
+ customKeyPlaceholder: 'Paste an API key (not persisted)',
+ },
+ consent: {
+ title: 'Authorize {{clientName}}',
+ loading: 'Loading authorization request…',
+ expired:
+ 'This authorization has expired or is no longer valid. Restart the flow from your MCP client.',
+ missingPending:
+ 'Missing authorization id. Open the link your MCP client gave you.',
+ requestSummary:
+ '{{clientName}} is requesting access to your OpenViking workspace.',
+ redirectLabel: 'Redirect',
+ scopesLabel: 'Scopes',
+ scopesNone: '(none)',
+ signInRequired:
+ 'Sign in to OpenViking Studio (Connection & Identity) or paste an API key below to authorize this client.',
+ openConnectionSettings: 'Open Connection & Identity',
+ authorize: 'Authorize',
+ deny: 'Deny',
+ useAnotherDevice: 'Use another device →',
+ waitingRedirect: 'Authorized — redirecting back to the client…',
+ verifying: 'Verifying…',
+ denying: 'Denying…',
+ denied: 'Denied. You can close this tab.',
+ verifyError: 'Authorization failed: {{message}}',
+ noApiKey: 'No API key available. Select an identity or paste a key.',
+ },
+ verify: {
+ title: 'Cross-device verify',
+ description:
+ 'Enter the 6-character code shown on the device that started the MCP client login.',
+ codeLabel: 'Verification code',
+ codePlaceholder: '6-character code',
+ submit: 'Authorize',
+ success:
+ 'Authorized for {{clientName}}. You can close this tab and return to the original device.',
+ successUnknownClient:
+ 'Authorized. You can close this tab and return to the original device.',
+ verifyError: 'Authorization failed: {{message}}',
+ noApiKey: 'No API key available. Select an identity or paste a key.',
+ signInRequired:
+ 'Sign in to OpenViking Studio (Connection & Identity) or paste an API key below to verify.',
+ },
+ },
+ playground: {
+ copyUri: 'Copy current URI',
+ copied: 'URI copied',
+ copyFailed: 'Copy failed',
+ resizeContext: 'Resize context tree width',
+ resizeAction: 'Resize Terminal and Agent width',
+ readFailed: 'Failed to read {{uri}}',
+ tabs: {
+ terminal: 'Terminal',
+ agent: 'Agent',
+ },
+ addResource: {
+ title: 'Add resource',
+ description:
+ 'After it finishes, the context tree on the left refreshes and the Terminal on the right can locate the new resource.',
+ submitted: 'Resource add task submitted',
+ },
+ explorer: {
+ title: 'Context tree',
+ addResource: 'Add resource',
+ abstractLevel: 'L0',
+ empty: 'empty',
+ loading: 'loading',
+ overviewLevel: 'L1',
+ search: 'Search context',
+ refresh: 'Refresh tree',
+ namespaces: {
+ agent: 'Agent capabilities, tools, and experience',
+ user: 'Personalized user memories',
+ resources: 'External resources the Agent can reference',
+ },
+ },
+ agent: {
+ history: 'Session history',
+ newSession: 'New session',
+ creating: 'Creating Playground session...',
+ detectingBot: 'Detecting bot mode...',
+ createFailed: 'Failed to create session: {{error}}',
+ retry: 'Retry',
+ botDisabledFooter: 'Enable bot mode to chat with the Agent',
+ historyTitle: 'Agent session history',
+ historyDescription:
+ 'Only sessions used by the Agent panel are shown here; a new session opens a blank Agent context.',
+ loadingSessions: 'Loading sessions...',
+ noSessions: 'No session history yet',
+ createTimeout:
+ 'Creating the Playground session timed out. Check your connection settings and try again.',
+ newSessionTitle: 'New Playground session',
+ botPrompt: {
+ title: 'Please enable bot mode',
+ description:
+ 'The current service has not enabled Agent chat. Start the service in bot mode and try again.',
+ command: 'openviking-server --with-bot',
+ retry: 'Detect again',
+ },
+ empty: {
+ heading: 'Agent actions sync with the tree on the left',
+ body: 'After you send a question, `viking://` files in the tool call output become clickable links — click to locate them on the left and open them in the middle.',
+ prompts: [
+ 'Summarize the current directory',
+ 'Recursively find related docs',
+ 'Explain how this resource relates to the project',
+ ],
+ },
+ },
+ terminal: {
+ header: 'Terminal',
+ history: 'Command history',
+ historyTitle: 'Command history',
+ historyDescription: 'Review commands run in this browser.',
+ clearHistory: 'Clear command history',
+ noHistory: 'No command history',
+ welcomeTitle: 'Terminal connected to the context tree',
+ welcomeBody:
+ 'Run /status, /ls, /search, /read, /add-resource. /search is global by default; add --scope . to use the current directory, or --scope viking://resources/... to limit it to a directory.',
+ scopeLabel: 'cwd: {{uri}}',
+ globalScope: 'global',
+ opened: 'Resource opened',
+ onlineTitle: 'Service online',
+ onlineBody:
+ 'OpenViking API responded normally; found {{count}} nodes under the root.',
+ lsBody: 'Showing {{count}} nodes under {{uri}}.',
+ fileEmpty: 'File is empty; opened in the middle preview.',
+ searchUsage: 'Usage: {{name}} <query> [--scope .|viking://resources/...]',
+ searchScopeLine: 'Search scope: {{scope}}',
+ helpParameters: 'Parameters',
+ helpExamples: 'Examples',
+ helpSubcommands: 'Subcommands',
+ noParameters: 'No parameters',
+ currentScopeAction: 'Use current directory',
+ readUsage: 'Usage: /read viking://resources/...',
+ enterUri: 'Please enter a viking:// URI',
+ hits: 'Hit {{resources}} resources, {{memories}} memories, {{skills}} skills.',
+ addResourceBody:
+ 'Opened the add-resource dialog. After submitting, the left tree refreshes; use /ls or /search to keep locating new content.',
+ addResourceTitle: 'Add resource',
+ sessionUsage:
+ 'Usage: /session [current|list|create|switch|get|context|messages|archive|commit|extract|message|used|tool-results|tool-result|tool-search|delete] ...',
+ sessionDeleteUsage: 'Usage: /session delete <session_id>',
+ sessionMissing:
+ 'No active session. Open the Agent panel to create one, or pass a session_id.',
+ sessionCurrentBody: 'Current active session: {{id}}',
+ sessionListBody: '{{count}} sessions.',
+ sessionCreatedBody: 'Created and switched to session: {{id}}',
+ sessionSwitchedBody: 'Switched to session: {{id}}',
+ sessionDeletedBody: 'Deleted session: {{id}}',
+ sessionMessageAddedBody: 'Added a message to session {{id}}.',
+ unknownCommand:
+ 'Unknown command. Available: /status, /ls, /search, /find, /read, /session, /add-resource.',
+ commandFailed: 'Command failed',
+ running: 'Running command...',
+ placeholder: 'Enter a CLI command, e.g. /status',
+ suggestionsTitle: 'Command suggestions',
+ suggestionsHint: '↑↓ select · Tab complete · Enter run',
+ quickStart: {
+ title: 'Quick start',
+ addResource: {
+ title: 'Add a resource',
+ command: '/add-resource',
+ code: 'Import docs or files into viking://resources',
+ },
+ addMemory: {
+ title: 'Add memory',
+ command: 'Agent remembers from chat',
+ code: 'Send a message in the Agent panel, then commit the session',
+ },
+ find: {
+ title: 'Find related context',
+ command: '/find openviking value',
+ code: 'Search resources, memories, and skills from the current scope',
+ },
+ },
+ commandGroups: {
+ core: 'Core commands',
+ filesystem: 'Filesystem',
+ search: 'Search and summaries',
+ status: 'Status',
+ resource: 'Resource paths',
+ history: 'History',
+ },
+ commandParameters: {
+ query: {
+ name: 'query',
+ description: 'Keywords or a semantic question to search for.',
+ },
+ scope: {
+ name: '--scope <.|uri>',
+ description:
+ 'Optional. Omit for global search; pass . for the current directory; pass uri for a specific directory.',
+ },
+ sessionAction: {
+ name: 'subcommand',
+ description:
+ 'current, list, create, switch, get, context, messages, archive, commit, extract, message, used, tool-results, tool-result, tool-search, delete.',
+ },
+ sessionId: {
+ name: 'session_id',
+ description:
+ 'Optional. Most subcommands use the current Agent session when omitted; delete requires an explicit ID.',
+ },
+ archiveId: {
+ name: 'archive_id',
+ description: 'Required when reading an archive.',
+ },
+ messageRole: {
+ name: 'role',
+ description: 'For the message subcommand. Use user or assistant.',
+ },
+ messageContent: {
+ name: 'content',
+ description:
+ 'For the message subcommand. Text to append to the session.',
+ },
+ contexts: {
+ name: '--context uri',
+ description:
+ 'Repeatable for the used subcommand. Records context actually used.',
+ },
+ skillJson: {
+ name: '--skill-json JSON',
+ description: 'For the used subcommand. Records skill usage details.',
+ },
+ keepRecent: {
+ name: '--keep-recent count',
+ description:
+ 'For commit. Keep the most recent N live messages after commit.',
+ },
+ tokenBudget: {
+ name: '--token-budget count',
+ description:
+ 'For context. Limits the token budget for assembled session context.',
+ },
+ toolName: {
+ name: '--tool-name name',
+ description: 'For tool-results. Filter by tool name.',
+ },
+ toolResultId: {
+ name: 'tool_result_id',
+ description:
+ 'Required when reading or searching an externalized tool result.',
+ },
+ limit: {
+ name: '--limit count',
+ description: 'Limits tool result list, read, or search results.',
+ },
+ offset: {
+ name: '--offset count',
+ description: 'For tool-result. Read from a character offset.',
+ },
+ contextChars: {
+ name: '--context-chars count',
+ description:
+ 'For tool-search. Controls context length around matches.',
+ },
+ timeout: {
+ name: '--timeout seconds',
+ description: 'Optional. Maximum time to wait for service readiness.',
+ },
+ uri: {
+ name: 'uri',
+ description:
+ 'A viking:// resource path. It may be optional or required by command usage.',
+ },
+ },
+ commandExamples: {
+ status: {
+ default: {
+ code: '/status',
+ description: 'Check Agent and API connectivity',
+ },
+ },
+ ls: {
+ current: {
+ code: '/ls',
+ description: 'List the current directory',
+ },
+ target: {
+ code: '/ls viking://resources/',
+ description: 'List a specified directory',
+ },
+ },
+ search: {
+ global: {
+ code: '/search agent',
+ description: 'Search globally',
+ },
+ current: {
+ code: '/search agent --scope .',
+ description: 'Use the highlighted directory',
+ },
+ scoped: {
+ code: '/search agent --scope viking://resources/',
+ description: 'Search only within a directory',
+ },
+ },
+ find: {
+ global: {
+ code: '/find agent',
+ description: 'Find related resources globally',
+ },
+ current: {
+ code: '/find agent --scope .',
+ description: 'Use the highlighted directory',
+ },
+ scoped: {
+ code: '/find agent --scope viking://resources/',
+ description: 'Find only within a directory',
+ },
+ },
+ read: {
+ file: {
+ code: '/read viking://resources/file.md',
+ description: 'Read and open a file',
+ },
+ },
+ addResource: {
+ default: {
+ code: '/add-resource',
+ description: 'Open the add-resource form',
+ },
+ },
+ session: {
+ current: {
+ code: '/session',
+ description: 'Show the current active session',
+ },
+ list: {
+ code: '/session list',
+ description: 'List all sessions',
+ },
+ create: {
+ code: '/session create [session_id]',
+ description: 'Create and switch to a new session',
+ },
+ switch: {
+ code: '/session switch <session_id>',
+ description: 'Switch the Agent panel session',
+ },
+ get: {
+ code: '/session get [session_id]',
+ description: 'Show session metadata',
+ },
+ context: {
+ code: '/session context [session_id] --token-budget 8000',
+ description: 'Read assembled session context',
+ },
+ messages: {
+ code: '/session messages [session_id]',
+ description: 'Read session messages',
+ },
+ archive: {
+ code: '/session archive [session_id] <archive_id>',
+ description: 'Read an archive',
+ },
+ commit: {
+ code: '/session commit [session_id] --keep-recent 10',
+ description: 'Archive and trigger memory extraction',
+ },
+ extract: {
+ code: '/session extract [session_id]',
+ description: 'Extract memories from a session',
+ },
+ message: {
+ code: '/session message [session_id] user hello',
+ description: 'Append a message to a session',
+ },
+ used: {
+ code: '/session used [session_id] --context viking://resources/...',
+ description: 'Record actually used context or skill',
+ },
+ toolResults: {
+ code: '/session tool-results [session_id] --limit 20',
+ description: 'List externalized tool results',
+ },
+ toolResult: {
+ code: '/session tool-result [session_id] <tool_result_id>',
+ description: 'Read one tool result',
+ },
+ toolSearch: {
+ code: '/session tool-search [session_id] <tool_result_id> query',
+ description: 'Search inside a tool result',
+ },
+ delete: {
+ code: '/session delete <session_id>',
+ description: 'Delete a session',
+ },
+ },
+ tree: {
+ current: {
+ code: '/tree',
+ description: 'Show the current directory tree',
+ },
+ target: {
+ code: '/tree viking://resources/',
+ description: 'Show a specified directory tree',
+ },
+ },
+ stat: {
+ target: {
+ code: '/stat viking://resources/file.md',
+ description: 'Show resource metadata',
+ },
+ },
+ abstract: {
+ target: {
+ code: '/abstract viking://resources/',
+ description: 'Read the directory abstract',
+ },
+ },
+ overview: {
+ target: {
+ code: '/overview viking://resources/',
+ description: 'Read the directory overview',
+ },
+ },
+ health: {
+ default: {
+ code: '/health',
+ description: 'Show backend health',
+ },
+ },
+ wait: {
+ default: {
+ code: '/wait',
+ description: 'Wait for service readiness',
+ },
+ timeout: {
+ code: '/wait --timeout 30',
+ description: 'Set wait time in seconds',
+ },
+ },
+ },
+ resourceSuggestion: 'Resource path',
+ historySuggestion: 'History',
+ groupLabels: {
+ resources: 'resource',
+ memories: 'memory',
+ skills: 'skill',
+ },
+ commands: {
+ status: {
+ description: 'Check connection',
+ usage: '/status',
+ },
+ ls: {
+ description: 'View resources',
+ usage: '/ls [viking://resources/...]',
+ },
+ search: {
+ description: 'Semantic search',
+ usage: '/search <query>',
+ },
+ find: {
+ description: 'Find related resources',
+ usage: '/find <query>',
+ },
+ read: {
+ description: 'Read a resource file',
+ usage: '/read viking://resources/.../file.md',
+ },
+ addResource: {
+ description: 'Add external resources',
+ usage: '/add-resource',
+ },
+ session: {
+ description: 'Manage Agent sessions',
+ usage: '/session subcommand',
+ },
+ tree: {
+ description: 'Show directory tree',
+ usage: '/tree [viking://resources/...]',
+ },
+ stat: {
+ description: 'Show resource metadata',
+ usage: '/stat viking://resources/...',
+ },
+ abstract: {
+ description: 'Read directory abstract',
+ usage: '/abstract viking://resources/...',
+ },
+ overview: {
+ description: 'Read directory overview',
+ usage: '/overview viking://resources/...',
+ },
+ health: {
+ description: 'Show backend health',
+ usage: '/health',
+ },
+ wait: {
+ description: 'Wait for service readiness',
+ usage: '/wait [--timeout seconds]',
+ },
+ },
+ },
+ },
+} as const
+
+export default activity
diff --git a/web-studio/src/i18n/locales/en/resources.ts b/web-studio/src/i18n/locales/en/resources.ts
new file mode 100644
index 000000000..c05c50b3f
--- /dev/null
+++ b/web-studio/src/i18n/locales/en/resources.ts
@@ -0,0 +1,401 @@
+const resources = {
+ operations: {
+ page: {
+ placeholder: 'Operations dashboard is under construction.',
+ },
+ },
+ requestLogs: {
+ accessRequired: {
+ description:
+ 'Current connection has no admin/root role. Configure an API key with Console Usage/Audit access in Connection & Identity.',
+ title: 'Admin access required',
+ },
+ clear: 'Clear',
+ description:
+ 'Inspect server-side audited API requests for the current identity, including status, latency, and request identifiers.',
+ disabled: {
+ description:
+ 'Usage/Audit is not initialized, so server-side request logs are unavailable.',
+ title: 'Audit logs unavailable',
+ },
+ empty: {
+ description: 'Start your first audited API call!',
+ filteredDescription:
+ 'Adjust the query or status filter to broaden the visible log entries.',
+ filteredTitle: 'No matching requests',
+ title: 'No logs yet',
+ upload: 'Upload File',
+ },
+ error: {
+ description: 'Failed to load audited request logs from the server.',
+ title: 'Request failed',
+ },
+ eyebrow: 'Playground telemetry',
+ filters: {
+ all: 'All logs',
+ apiTypePlaceholder: 'API type',
+ error: 'Error logs',
+ requestIdPlaceholder: 'Exact Request ID',
+ statusCodePlaceholder: 'Status code',
+ },
+ loading: 'Loading request logs...',
+ metrics: {
+ successRate: 'Success rate',
+ total: 'Total calls',
+ },
+ pagination: {
+ next: 'Next',
+ pageSize: 'Rows per page',
+ pageSizeValue: '{{count}} / page',
+ previous: 'Previous',
+ summary: '{{total}} total, page {{page}} / {{pageCount}}',
+ },
+ query: 'Query',
+ refresh: 'Refresh',
+ reset: 'Reset',
+ searchPlaceholder: 'Filter method, path, or status',
+ scope: {
+ currentIdentity: 'Current scope: Current API key identity',
+ currentIdentityWithName:
+ 'Current scope: Current API key identity ({{identity}})',
+ },
+ status: {
+ error: 'ERR',
+ pending: 'PENDING',
+ success: 'OK',
+ },
+ table: {
+ accountId: 'Account ID',
+ apiType: 'API Type',
+ duration: 'Duration',
+ method: 'Method',
+ path: 'Path',
+ requestId: 'Request ID',
+ status: 'Status',
+ time: 'Time',
+ title: 'Captured requests',
+ userId: 'User ID',
+ },
+ title: 'Request Logs',
+ },
+ addResource: {
+ title: 'Add Resource',
+ description:
+ 'Upload a local file to the server. File type is auto-detected via magic bytes.',
+ dropzone: {
+ title: 'Drag & drop a file here, or click to select',
+ hint: 'Up to 10 files at a time.',
+ supportedFormats:
+ 'Supports PDF, Word, PPTX, Excel, Markdown, code files, images, and more',
+ },
+ fileInfo: {
+ name: 'File',
+ size: 'Size',
+ type: 'Type',
+ unknown: 'Unknown type',
+ remove: 'Remove',
+ },
+ targetUri: 'Target URI',
+ 'targetUri.placeholder': 'viking://resources/',
+ 'targetUri.hint':
+ 'Choose where to store this resource. Defaults to viking://resources/.',
+ 'targetUri.browse': 'Browse',
+ advancedOptions: 'Advanced Options',
+ upload: 'Upload File',
+ 'upload.processing': 'File uploaded, processing...',
+ uploading: 'Uploading\u2026',
+ result: {
+ success: 'Upload complete!',
+ skippedFiles: '{{count}} file(s) skipped (unsupported format)',
+ },
+ cancelUpload: 'Cancel',
+ startProcessing: 'Start Processing',
+ success: 'Resource added successfully',
+ fileBlocked: '"{{name}}" is not a supported file type.',
+ fileTooLarge: '"{{name}}" exceeds the {{size}} file size limit.',
+ tooManyFiles: 'Only the first {{count}} files were kept.',
+ error: 'Request Failed',
+ dirPicker: {
+ title: 'Select Directory',
+ select: 'Select',
+ cancel: 'Cancel',
+ empty: 'Empty directory',
+ error: 'Failed to load directory',
+ selected: 'Selected:',
+ },
+ mode: {
+ upload: 'Upload File',
+ remote: 'Remote URL',
+ },
+ remoteUrl: 'Remote URL',
+ 'remoteUrl.placeholder': 'https://github.com/org/repo',
+ 'remoteUrl.hint':
+ 'HTTP(S) URL, Git repository, or other remote resource address.',
+ watch: {
+ enabled: 'Scheduled Sync',
+ hint: 'Periodically check this remote resource and import its latest content.',
+ interval: 'Sync interval (minutes)',
+ intervalHint: 'For example, 60 for hourly or 1440 for daily.',
+ },
+ strict: 'Strict Mode',
+ 'strict.hint':
+ 'When enabled, the server will reject files with unsupported or unrecognized types instead of skipping them silently.',
+ directlyUploadMedia: 'Directly Upload Media',
+ 'directlyUploadMedia.hint':
+ 'When enabled, media files (images, audio, video) are stored as-is. When disabled, media files are processed through AI vision/audio pipeline for content extraction first.',
+ createParent: 'Auto-create Parent Folder',
+ 'createParent.hint':
+ 'When enabled, automatically creates the parent directory if it does not exist.',
+ reason: 'Reason',
+ 'reason.placeholder': 'Why are you adding this resource?',
+ instruction: 'Instruction',
+ 'instruction.placeholder':
+ 'Special processing instructions for this resource.',
+ directoryScan: {
+ title: 'Directory Scan Options',
+ ignoreDirs: 'Ignore Directories',
+ 'ignoreDirs.placeholder': 'node_modules, .git, __pycache__',
+ include: 'Include Pattern',
+ 'include.placeholder': '*.py, *.md',
+ exclude: 'Exclude Pattern',
+ 'exclude.placeholder': '*.log, *.tmp',
+ },
+ },
+ resources: {
+ processingTasks: {
+ title: 'File Processing Tasks',
+ empty: 'No processing tasks',
+ toggleError: 'Toggle error details',
+ columns: {
+ fileName: 'File Name',
+ status: 'Status',
+ size: 'Size',
+ },
+ status: {
+ cancelled: 'Cancelled',
+ processing: 'Processing',
+ success: 'Processed',
+ failed: 'Processing failed',
+ },
+ },
+ searchPalette: {
+ ariaLabel: 'Search',
+ openContainingDirectory: 'Open containing directory',
+ placeholder: 'Search',
+ scope: {
+ global: 'Search scope: Global',
+ current: 'Search scope: {{name}}',
+ resetToGlobal: 'Click to reset to global search',
+ },
+ scopeState: {
+ validatingTitle: 'Validating search scope',
+ validatingPrefix: 'Checking whether',
+ validatingSuffix: 'exists',
+ switchTitle: 'Switch search scope',
+ switchPrefix: 'Press',
+ switchMiddle: 'to switch to',
+ invalidTitle: 'Search scope not found',
+ invalidPrefix: 'Path',
+ invalidSuffix: 'is inaccessible and cannot be switched to',
+ },
+ empty: {
+ title: 'Search files and directories',
+ },
+ browseDirHint: {
+ before: 'Enter',
+ after: 'to browse directories',
+ },
+ globalScopeHint: {
+ before: 'Enter',
+ after: 'to switch search scope to global',
+ },
+ error: 'Search failed',
+ emptyResults: {
+ title: 'No matching files or directories found',
+ subtitle: 'Try another keyword?',
+ },
+ footer: {
+ dirMode: {
+ select: 'Select',
+ level: 'Level',
+ confirm: 'Confirm',
+ cancel: 'Cancel',
+ },
+ resultMode: {
+ navigate: 'Navigate',
+ open: 'Open',
+ close: 'Close',
+ count: '{{count}} results',
+ },
+ },
+ },
+ dirBrowser: {
+ back: 'Back',
+ loading: 'Loading directory',
+ filesSection: 'Files',
+ error: 'Failed to load directory',
+ empty: {
+ title: 'Empty directory',
+ subtitle:
+ 'There are currently no subdirectories to expand at this level',
+ },
+ },
+ filePreview: {
+ cancel: 'Cancel',
+ edit: 'Edit',
+ emptyFile: '(empty file)',
+ emptyPrompt: 'Select a file to preview it here',
+ formattingJson: 'Formatting JSON...',
+ imageFailed: 'Image failed to load.',
+ imageLoading: 'Loading image...',
+ largeFileSkipped: 'This file is large and was not loaded automatically.',
+ jsonFormatFailed: 'JSON formatting failed. Showing the raw content.',
+ loadFile: 'Load anyway',
+ loadingContent: 'Reading content...',
+ loadingEditor: 'Loading editor...',
+ markdownPreview: 'Preview',
+ markdownSource: 'Source',
+ noDirectoryContext: 'No abstract or overview available for this folder.',
+ save: 'Save',
+ selectDirectoryContext: 'Select a chip to show folder context.',
+ unsupportedBinary: 'Binary files do not support text preview.',
+ jsonl: {
+ collapse: 'Collapse',
+ dialogMode: 'Dialog',
+ emptyJsonl: 'Empty JSONL.',
+ emptyMessage: 'Empty message',
+ expand: 'Expand',
+ noArguments: 'No arguments',
+ rawMode: 'JSONL',
+ recordCount: '{{count}} record',
+ recordCount_other: '{{count}} records',
+ toolcall: 'toolcall',
+ },
+ },
+ },
+ retrieval: {
+ title: 'Retrieval',
+ searchPlaceholder: 'Search context',
+ placeholders: {
+ find: 'Enter a semantic query',
+ search: 'Enter a question to interpret with session context',
+ grep: 'Enter a regular expression or exact text',
+ glob: 'Enter a file pattern, for example **/*.md',
+ },
+ send: 'Search',
+ controls: {
+ function: 'Retrieval Function',
+ modes: {
+ find: 'find',
+ search: 'search',
+ grep: 'grep',
+ glob: 'glob',
+ },
+ ignoreCase: 'Ignore case',
+ resultCount: 'Results',
+ path: 'Path',
+ pathPlaceholder: '/',
+ scope: 'Scope',
+ customScope: 'Custom scope',
+ customScopePlaceholder: 'resources/project or viking://...',
+ effectiveScope: 'Scope',
+ allContexts: 'All contexts',
+ scopes: {
+ all: {
+ label: 'All contexts',
+ },
+ resources: {
+ label: 'Resources',
+ },
+ custom: {
+ label: 'Custom URI',
+ },
+ },
+ sessionId: 'Session ID',
+ sessionPlaceholder: 'session_id (optional)',
+ },
+ advanced: {
+ title: 'More filters',
+ contextTypes: 'Context types',
+ levels: 'Content levels',
+ scoreThreshold: 'Minimum relevance',
+ tags: 'Search tags',
+ tagsPlaceholder: 'For example env=prod, team=search',
+ tagsInvalid: 'Tags must use key=value format, separated by commas',
+ timeRange: 'Time range',
+ since: 'Start, e.g. 7d',
+ until: 'End, e.g. 2026-07-27',
+ anyTime: 'Any time',
+ quickRange: 'Quick range',
+ last24Hours: 'Last 24 hours',
+ last7Days: 'Last 7 days',
+ last30Days: 'Last 30 days',
+ customRange: 'Custom dates',
+ startDate: 'Start date',
+ endDate: 'End date',
+ clearTimeRange: 'Clear time range',
+ timeField: 'Time field',
+ updatedAt: 'Updated time',
+ createdAt: 'Created time',
+ provenance: 'Include retrieval provenance',
+ reset: 'Reset filters',
+ },
+ detail: {
+ score: 'Score',
+ level: 'Level',
+ openPlayground: 'Open in Playground',
+ uri: 'URI',
+ summary: 'Summary',
+ noSummary: 'No summary available',
+ matchReason: 'Match reason',
+ },
+ results: {
+ title: 'Search Results',
+ topN: 'Search Results (Top{{count}})',
+ line: 'Line {{line}}',
+ lineLabel: 'Line',
+ score: 'Score',
+ uri: 'URI',
+ description: 'Description',
+ provenance: 'Retrieval provenance ({{count}})',
+ },
+ types: {
+ resource: 'Resources',
+ memory: 'Memories',
+ skill: 'Skills',
+ },
+ queryPlan: {
+ title: '{{count}} planned queries',
+ more: '+{{count}} more',
+ },
+ loading: {
+ vector: 'Searching vector indexes...',
+ scan: 'Scanning context hierarchy...',
+ match: 'Matching semantic context...',
+ rerank: 'Reranking results...',
+ },
+ empty: {
+ checking: 'Checking retrievable context...',
+ readyTitle: 'Retrievable context is available',
+ readyDescription: 'Enter a keyword and press Enter to search',
+ title: 'No retrievable context yet',
+ description: 'Upload your first resource to get started.',
+ upload: 'Upload File',
+ },
+ error: {
+ title: 'Search failed',
+ fallback: 'The request could not be completed. Please try again.',
+ network:
+ 'The OpenViking service could not be reached. Check the connection URL, service status, or CORS configuration.',
+ code: 'Error code',
+ status: 'HTTP status',
+ requestId: 'Request ID',
+ },
+ noResults: {
+ title: 'No matching content found',
+ subtitle: 'Try another keyword or adjust the path scope',
+ },
+ },
+} as const
+
+export default resources
diff --git a/web-studio/src/i18n/locales/en/workspace.ts b/web-studio/src/i18n/locales/en/workspace.ts
new file mode 100644
index 000000000..07a03bf5f
--- /dev/null
+++ b/web-studio/src/i18n/locales/en/workspace.ts
@@ -0,0 +1,718 @@
+const workspace = {
+ appShell: {
+ footer: {
+ agentIntegrations: 'Agent Integrations',
+ connection: 'Connection Settings',
+ docs: 'Documentation',
+ github: 'GitHub',
+ sdkApi: 'SDK & API',
+ users: 'User Management',
+ },
+ header: {
+ currentUser: {
+ account: 'Account',
+ accountSummary: 'Account · {{account}}',
+ openMenu: 'View current user {{user}}',
+ signedInAs: 'Current data identity',
+ unset: 'Not set',
+ user: 'User',
+ },
+ defaultTitle: 'OpenViking Studio',
+ },
+ navigation: {
+ home: {
+ title: 'Home',
+ },
+ crossDeviceVerify: {
+ title: 'OAuth verify',
+ },
+ operations: {
+ title: 'Operations',
+ },
+ requestLogs: {
+ title: 'Request Logs',
+ },
+ monitoring: {
+ title: 'Monitoring',
+ },
+ skills: {
+ title: 'Skills',
+ },
+ tasks: {
+ title: 'Task Center',
+ },
+ watches: {
+ title: 'Scheduled Sync',
+ },
+ retrieval: {
+ title: 'Retrieval',
+ },
+ sessions: {
+ title: 'Sessions',
+ },
+ playground: {
+ title: 'Playground',
+ },
+ },
+ sidebar: {
+ groups: {
+ operations: 'Activity',
+ resources: 'Resources',
+ settings: 'Settings',
+ workspace: 'Workspace',
+ },
+ loadingSessions: 'Loading...',
+ noSessions: 'No sessions',
+ workspaceGroupLabel: 'OpenViking Studio',
+ },
+ },
+ monitoringPage: {
+ title: 'Monitoring',
+ description: 'View real-time health for OpenViking components.',
+ version: 'v{{version}}',
+ refresh: 'Refresh',
+ updatedAt: 'Updated at {{time}}',
+ loading: 'Loading monitoring data...',
+ loadFailed: 'Could not load monitoring data',
+ health: {
+ healthy: 'Healthy',
+ unhealthy: 'Unhealthy',
+ },
+ summary: {
+ healthy: 'All components are healthy',
+ unhealthy: 'Some components need attention',
+ components: '{{healthy}} of {{total}} components healthy',
+ },
+ tabs: {
+ label: 'Monitoring type',
+ overview: 'Overview',
+ queue: 'Task queue',
+ vikingdb: 'VectorDB',
+ models: 'Models',
+ filesystem: 'Filesystem',
+ lock: 'Locks',
+ retrieval: 'Retrieval',
+ },
+ detail: {
+ noData: 'No monitoring data',
+ descriptions: {
+ queue: 'Resource processing, semantic generation, and session queues.',
+ vikingdb: 'Vector storage and indexing service.',
+ models: 'VLM, embedding, and rerank model services.',
+ filesystem: 'OpenViking filesystem and mount services.',
+ lock: 'Transaction locks and concurrency control.',
+ retrieval: 'Context retrieval service.',
+ },
+ },
+ offline: {
+ title: 'OpenViking is not connected',
+ description:
+ 'Configure the server URL and credentials to view monitoring data.',
+ action: 'Open connection settings',
+ },
+ },
+ skillsPage: {
+ title: 'Skills',
+ description:
+ 'View Agent skills available to the current user and workspace.',
+ refresh: 'Refresh',
+ loading: 'Loading skills...',
+ empty: 'No skills available',
+ emptyDescription:
+ 'User and shared skills will appear here after they are added.',
+ loadFailed: 'Could not load skills',
+ networkError:
+ 'Could not connect to the OpenViking service. Check the server URL and connection status.',
+ connectionSettings: 'Open connection settings',
+ detail: 'Details',
+ viewDetail: 'View {{name}} details',
+ detailLoading: 'Loading skill details...',
+ detailLoadFailed: 'Could not load skill details',
+ directory: 'Directory',
+ none: 'None',
+ metrics: {
+ files: 'Files',
+ scope: 'Scope',
+ },
+ sections: {
+ allowedTools: 'Allowed tools',
+ content: 'SKILL.md',
+ description: 'Description',
+ files: 'Files',
+ overview: 'Overview',
+ tags: 'Tags',
+ },
+ scopes: {
+ user: 'User skill',
+ agent: 'Shared skill',
+ },
+ },
+ tasksPage: {
+ title: 'Task Center',
+ description:
+ 'Track background work such as resource processing, session commits, and reindexing.',
+ refresh: 'Refresh',
+ loading: 'Loading tasks...',
+ empty: 'No background tasks',
+ emptyDescription:
+ 'Asynchronous work will appear here with its status and update time.',
+ emptyFiltered: 'No matching tasks',
+ emptyFilteredDescription: 'Adjust or clear the filters to see other tasks.',
+ loadFailed: 'Could not load tasks',
+ detail: {
+ title: 'Task details',
+ loading: 'Loading task details...',
+ loadFailed: 'Could not load task details',
+ retry: 'Retry',
+ openLabel: 'View details for task {{taskId}}',
+ fields: {
+ status: 'Task status',
+ type: 'Task type',
+ stage: 'Current stage',
+ resource: 'Resource',
+ createdAt: 'Created',
+ updatedAt: 'Updated',
+ },
+ error: 'Failure reason',
+ result: 'Result',
+ noResult: 'No result yet',
+ noResultDescription:
+ 'Results returned by the API will appear here when the task completes.',
+ noResultFailedDescription:
+ 'This task did not return a result. See the failure reason above.',
+ noResultCancelledDescription:
+ 'This task was cancelled before it returned a result.',
+ },
+ filters: {
+ label: 'Filter',
+ type: 'Task type',
+ status: 'Task status',
+ allTypes: 'All types',
+ allStatuses: 'All statuses',
+ clear: 'Clear filters',
+ },
+ pagination: {
+ next: 'Next',
+ page: 'Page {{page}}',
+ pageSize: 'Rows per page',
+ pageSizeValue: '{{count}} per page',
+ previous: 'Previous',
+ scope:
+ 'Showing the latest {{count}} tasks (the API returns at most {{limit}})',
+ },
+ table: {
+ task: 'Task',
+ type: 'Type',
+ resource: 'Resource',
+ createdAt: 'Created',
+ status: 'Status',
+ },
+ status: {
+ cancelled: 'Cancelled',
+ cancelling: 'Cancelling',
+ completed: 'Completed',
+ failed: 'Failed',
+ pending: 'Pending',
+ running: 'Running',
+ unknown: 'Unknown',
+ },
+ types: {
+ session_commit: 'Session commit',
+ add_resource: 'Resource processing',
+ add_skill: 'Skill import',
+ connector_import: 'Connector import',
+ admin_reindex: 'Reindex',
+ snapshot_restore_reindex: 'Snapshot reindex',
+ legacy_migration: 'Legacy migration',
+ legacy_cleanup: 'Legacy cleanup',
+ },
+ },
+ watchesPage: {
+ title: 'Scheduled Sync',
+ description:
+ 'Keep remote resources current with recurring Watch tasks and manage their schedules.',
+ refresh: 'Refresh',
+ add: 'Add',
+ adding: 'Adding...',
+ loading: 'Loading scheduled syncs...',
+ loadFailed: 'Could not load scheduled syncs',
+ empty: 'No scheduled syncs',
+ emptyDescription:
+ 'Add a remote resource and enable scheduled sync to get started.',
+ never: 'Not synced yet',
+ cancel: 'Cancel',
+ save: 'Save',
+ creation: {
+ title: 'Creating scheduled sync',
+ description:
+ 'The resource was submitted in the background. The list will refresh automatically.',
+ },
+ columns: {
+ resource: 'Resource',
+ source: 'Source',
+ status: 'Status',
+ interval: 'Interval',
+ lastRun: 'Last sync',
+ nextRun: 'Next sync',
+ actions: 'Actions',
+ },
+ status: {
+ active: 'Enabled',
+ disabled: 'Disabled',
+ },
+ actions: {
+ trigger: 'Sync now',
+ syncing: 'Syncing...',
+ disable: 'Disable',
+ enable: 'Enable',
+ more: 'More',
+ history: 'Processing history',
+ edit: 'Edit',
+ delete: 'Delete',
+ },
+ interval: {
+ minutes_one: 'Every minute',
+ minutes_other: 'Every {{count}} minutes',
+ hours_one: 'Every hour',
+ hours_other: 'Every {{count}} hours',
+ days_one: 'Every day',
+ days_other: 'Every {{count}} days',
+ },
+ addDialog: {
+ title: 'Add scheduled sync',
+ description:
+ 'Add a remote resource and configure how often OpenViking checks for updates.',
+ },
+ editDialog: {
+ title: 'Edit scheduled sync',
+ interval: 'Interval (minutes)',
+ intervalHint: 'For example, 60 for hourly or 1440 for daily.',
+ reason: 'Reason (optional)',
+ reasonPlaceholder: 'Why should this resource stay synchronized?',
+ instruction: 'Processing instruction (optional)',
+ instructionPlaceholder:
+ 'Special processing instructions for this resource.',
+ },
+ deleteDialog: {
+ title: 'Delete scheduled sync?',
+ description:
+ 'The resource {{uri}} will remain available, but it will no longer update automatically.',
+ },
+ history: {
+ title: 'Processing history',
+ description:
+ 'Background tasks filtered by this resource. Results may include the initial import, manual processing, and scheduled syncs.',
+ loading: 'Loading processing history...',
+ loadFailed: 'Could not load processing history',
+ empty: 'No processing history',
+ emptyDescription:
+ 'No background processing tasks were found for this resource.',
+ stage: 'Stage',
+ },
+ toast: {
+ creating: 'Creating scheduled sync. Please wait...',
+ created: 'Scheduled sync added',
+ createTimeout: 'The new task is not visible yet. Refresh again shortly.',
+ updated: 'Scheduled sync updated',
+ triggered: 'Sync scheduled',
+ deleted: 'Scheduled sync deleted',
+ },
+ },
+ accountSwitcher: {
+ create: 'Create account',
+ dialog: {
+ accountLabel: 'Account',
+ accountPlaceholder: 'team-account',
+ adminLabel: 'Initial admin user',
+ cancel: 'Cancel',
+ description:
+ 'Create a workspace and its first administrator. Studio switches to it after creation.',
+ submit: 'Create and switch',
+ title: 'Create account',
+ },
+ empty: 'No matching accounts',
+ errors: {
+ loadAccounts: 'Could not load accounts',
+ noCreatedKey:
+ 'The account was created, but the server did not return a data credential.',
+ noUsableKey:
+ 'This account has no plaintext user API key available for data access.',
+ noUsers: 'This account has no available users.',
+ },
+ loading: 'Loading accounts...',
+ manualSwitch: {
+ description:
+ 'The server did not expose a plaintext credential for {{account}}. Enter a User API Key from that account.',
+ hint: 'Studio only verifies the key and switches the active data identity. It will not modify or rotate the server credential.',
+ keyLabel: 'User API Key',
+ keyPlaceholder: 'Paste a User API Key for the target account',
+ manageOnly: 'Manage without a User Key',
+ submit: 'Verify and switch',
+ title: 'Enter a User API Key',
+ },
+ memberCount: '{{count}} users',
+ searchPlaceholder: 'Search accounts',
+ toast: {
+ created: 'Created and switched to {{account}}',
+ createdSwitchFailed:
+ 'Created {{account}}, but data identity switching failed: {{error}}. The Account remains available for management.',
+ managementSwitched:
+ 'Switched management to {{account}}. Select or create a User Key before opening tenant data.',
+ switched: 'Switched to {{account}}',
+ },
+ unset: 'No account selected',
+ },
+ common: {
+ action: {
+ cancel: 'Cancel',
+ saveConnection: 'Save Connection',
+ showAdvancedIdentityFields: 'Show Advanced Identity Fields',
+ },
+ errorBoundary: {
+ description:
+ 'An unhandled exception occurred while rendering the route. Try again first; if it persists, inspect the error details below.',
+ reload: 'Reload Page',
+ retry: 'Retry',
+ title: 'Something went wrong',
+ },
+ language: {
+ current: 'Current',
+ label: 'Language',
+ },
+ theme: {
+ toggle: 'Toggle theme',
+ },
+ },
+ connection: {
+ devMode: {
+ description:
+ 'This server provides identity automatically, so account, user, and API key are usually not required.',
+ title: 'Server-managed identity',
+ },
+ dialog: {
+ title: 'Connection & Identity',
+ },
+ identitySummary: {
+ dev: 'Server-managed identity',
+ named: '{{identity}}',
+ unset: 'Identity not set',
+ },
+ fields: {
+ accountId: {
+ label: 'Account',
+ placeholder: 'default',
+ },
+ apiKey: {
+ label: 'API Key',
+ placeholder: 'Enter X-API-Key or Bearer token',
+ },
+ adminApiKey: {
+ label: 'Admin API key',
+ placeholder: 'Root or account-admin key',
+ },
+ baseUrl: {
+ label: 'Service URL',
+ placeholder: 'http://127.0.0.1:1933',
+ },
+ credentials: {
+ title: 'Identity & Credentials',
+ },
+ dataApiKey: {
+ label: 'User API key',
+ },
+ userId: {
+ label: 'User',
+ placeholder: 'default',
+ },
+ },
+ },
+ settings: {
+ actions: {
+ addAccount: 'Add account',
+ addUser: 'Add user',
+ cancel: 'Cancel',
+ changeRole: 'Change the role for {{user}}',
+ confirmRemoveUser: 'Delete user',
+ confirmRoleChange: 'Confirm change',
+ copy: 'Copy',
+ currentIdentity: 'Current identity',
+ refresh: 'Refresh',
+ regenerate: 'Regenerate',
+ removeUser: 'Delete {{user}}',
+ save: 'Save',
+ switchIdentity: 'Switch identity',
+ use: 'Use',
+ },
+ connection: {
+ accountListLimited:
+ 'This key cannot list all accounts, but it can still manage the selected account if it has account-admin access.',
+ adminError: 'Could not verify the Root API Key: {{message}}',
+ description:
+ 'Use a User API Key for tenant data APIs and an optional Root or account-admin key for control APIs.',
+ devMode:
+ 'Development mode is active — identity is automatic and no API key is required.',
+ keyGuide: {
+ control: {
+ primary:
+ 'Your User API Key already enables the Playground and data access. Regular users do not need a control credential.',
+ secondary:
+ 'To switch Accounts or manage users, request a Root Key from the deployment admin or an Admin Key from the current Account admin. The Root Key is stored at server.root_api_key in the server-side ov.conf.',
+ title: 'Need to manage Accounts or users?',
+ },
+ data: {
+ primary:
+ 'The Root/Admin API Key is mainly for management. The Playground and tenant data APIs require a User API Key bound to a user identity.',
+ secondary:
+ 'Select or create a user in User Management, or regenerate its key, then use it as the User API Key.',
+ title: 'A User API Key is still required',
+ },
+ empty: {
+ primary:
+ 'Regular users should request a User API Key from their Account admin.',
+ secondary:
+ 'Deployment admins can find the Root API Key at server.root_api_key in the server-side ov.conf. Add it here, then create or regenerate a User Key in User Management.',
+ title: 'No OpenViking API Key yet?',
+ },
+ learnMore: 'Learn how to get an API Key',
+ trusted: {
+ primary:
+ 'This trusted server enforces Root Key validation. The browser needs the same Root API Key for management and tenant data requests.',
+ secondary:
+ 'Request the Root Key from the deployment admin; it is stored at server.root_api_key in the server-side ov.conf. Trusted-mode data identity comes from Account/User assertions and does not need a User API Key.',
+ title: 'This trusted server requires a Root API Key',
+ },
+ },
+ rootHint: 'Lists accounts and users, and mints or rotates keys.',
+ title: 'Connection settings',
+ unsupportedAuthMode: {
+ description:
+ 'Web Studio does not support the {{mode}} authentication mode. Please use the {{ov}} CLI or Python SDK to interact with this server.',
+ primary: 'This server is configured with {{mode}} authentication.',
+ title: 'Unsupported authentication mode',
+ },
+ userHint: 'Used by the Playground and tenant data APIs.',
+ },
+ connectionPage: {
+ description:
+ 'Configure the OpenViking server connection, control credential, and active data credential.',
+ title: 'Connection settings',
+ },
+ dialogs: {
+ addAccount: {
+ description:
+ 'Create a workspace account and its first admin user. The new key will be shown once.',
+ title: 'Add account',
+ },
+ addUser: {
+ currentAccountDescription:
+ 'Create a user in {{accountId}}. The generated key is shown only once.',
+ description:
+ 'Register a user under an existing account. The generated key will be shown once.',
+ title: 'Add user',
+ },
+ changeRole: {
+ description:
+ 'Change the role for {{account}} / {{user}} to {{role}}. The new permissions take effect immediately.',
+ title: 'Change user role?',
+ },
+ regenerate: {
+ description:
+ 'Regenerate the API key for {{account}} / {{user}}. The current key stops working immediately.',
+ title: 'Regenerate API key?',
+ },
+ removeUser: {
+ description:
+ 'Remove {{user}} from {{account}}? Their API key stops working immediately. This action cannot be undone.',
+ title: 'Delete user?',
+ },
+ },
+ empty: {
+ adminDescription:
+ 'Use a root or account admin API key to list users, copy keys, add identities, or regenerate credentials.',
+ adminTitle: 'Admin access required',
+ usersDescription: 'Create a user to mint the first API key.',
+ usersTitle: 'No users in the selected accounts',
+ },
+ fields: {
+ account: 'Account',
+ adminUser: 'Admin user',
+ adminApiKey: 'Admin API key',
+ apiKey: 'API key',
+ baseUrl: 'Server URL',
+ dataApiKey: 'User API key',
+ rootApiKey: 'Root or Admin API Key',
+ userApiKey: 'User API Key',
+ role: 'Role',
+ user: 'User',
+ },
+ health: {
+ admin: 'Admin control',
+ data: 'Data access',
+ state: {
+ checking: 'Checking',
+ error: 'Error',
+ ok: 'OK',
+ skipped: 'Not checked',
+ },
+ },
+ keyResult: {
+ description:
+ 'Copy it now. OpenViking may only show a prefix after you leave this state.',
+ dismiss: 'Dismiss',
+ title: 'New API key',
+ },
+ loading: 'Loading identities...',
+ management: {
+ accountFilter: 'Accounts',
+ accessDeniedDescription:
+ 'User management requires a validated Root or Account Admin API key.',
+ accessDeniedTitle: 'User management unavailable',
+ currentAccountDescription:
+ 'Manage users and access credentials in the {{account}} workspace.',
+ description:
+ 'Review users and credentials for selected accounts, then add users or rotate keys from the web UI.',
+ memberListDescription:
+ '"Switch identity" uses that user for data pages such as Playground and Retrieval without changing the active Root/Admin management credential.',
+ memberListDescriptionRoot:
+ 'You can change member roles here. "Switch identity" only changes the user used by data pages such as Playground and Retrieval; it does not change the active Root management credential.',
+ memberListTitle: 'Workspace members',
+ cannotRemoveCurrentIdentity: 'The active identity cannot be deleted.',
+ cannotRemoveLastManager:
+ 'The last workspace administrator cannot be deleted.',
+ noUsableKey:
+ 'This user has no plaintext API key available for data access.',
+ openConnection: 'Open connection settings',
+ title: 'User management',
+ },
+ page: {
+ adminDescription:
+ 'Configure the active OpenViking Studio identity and manage accounts, users, and API keys.',
+ description:
+ 'Configure the OpenViking Studio server URL and API key, then view data for the current identity.',
+ title: 'Connection & Identity',
+ },
+ placeholders: {
+ account: 'team-account',
+ adminApiKey: 'Root or account-admin key',
+ apiKey: 'Enter X-API-Key or Bearer token',
+ baseUrl: 'http://127.0.0.1:1933',
+ devModeApiKey: '[dev mode, no api key required]',
+ userApiKey: 'User API key',
+ user: 'default',
+ },
+ roles: {
+ admin: 'Admin',
+ root: 'Root',
+ user: 'User',
+ },
+ serverMode: {
+ api_key: 'API key mode',
+ checking: 'Checking...',
+ dev: 'Development mode',
+ ldap: 'LDAP mode',
+ offline: 'Offline',
+ oidc: 'OIDC mode',
+ trusted: 'Trusted mode',
+ },
+ stats: {
+ accounts: 'Total accounts',
+ apiKeys: 'Visible API keys',
+ users: 'Users',
+ },
+ table: {
+ account: 'Account',
+ actions: 'Actions',
+ apiKey: 'API key',
+ role: 'Role',
+ user: 'User',
+ },
+ toast: {
+ accountCreated: 'Account created',
+ connectionSaved: 'Connection saved',
+ copyFailed: 'Copy failed',
+ copied: 'Copied',
+ dataKeySelected: 'Data access identity switched',
+ keyRegenerated: 'API key regenerated',
+ roleUpdated: "{{user}}'s role changed to {{role}}",
+ userCreated: 'User created',
+ userRemoved: '{{user}} deleted',
+ },
+ },
+ home: {
+ contextCommits: {
+ description:
+ 'Groups resource, skill, session message, and session commit writes into 4-hour buckets. Hover a cell for details.',
+ empty: 'No context commits in the last year',
+ hourRange: '{{start}}-{{end}}',
+ legend: {
+ high: 'High',
+ intense: 'Intense',
+ low: 'Low',
+ medium: 'Medium',
+ more: 'More',
+ none: 'Less',
+ title: 'Commit intensity',
+ },
+ operations: {
+ addResource: 'Resource writes',
+ addSkill: 'Skill writes',
+ sessionAddMessage: 'Session messages',
+ sessionCommit: 'Session commits',
+ },
+ stats: {
+ activeDays: 'Active days',
+ peakDay: 'Peak day',
+ recentDay: 'Recent commit',
+ },
+ title: 'Context Commit Stats',
+ yearlyEmpty: 'No context commits',
+ yearlyTotal: '{{count}} context commits',
+ tooltip: {
+ total: 'Total commits',
+ },
+ },
+ contextData: {
+ description:
+ 'Includes files, skills, and user memories to show the current context resource scale.',
+ files: 'Files',
+ memories: 'Memories',
+ skills: 'Skills',
+ title: 'Context Data Volume',
+ },
+ page: {
+ description:
+ 'Aligned with the product overview: menu entries, context data volume, today tokens, today retrievals, agent access, token trend, and context commit stats.',
+ eyebrow: 'OpenViking Studio',
+ settings: 'Connection & Settings',
+ title: 'Overview',
+ },
+ requestFailed: 'Request failed',
+ todayRetrievals: {
+ description:
+ 'Shows successful semantic retrieval calls for find() and search() today. Resets at midnight.',
+ find: 'find',
+ search: 'search',
+ title: 'Retrievals Today',
+ },
+ todayTokens: {
+ description:
+ 'Shows real-time token consumption today. Resets at midnight.',
+ embeddingInput: 'Embedding input tokens',
+ title: 'Tokens Today',
+ vlmInput: 'VLM input tokens',
+ vlmOutput: 'VLM output tokens',
+ },
+ tokenTrend: {
+ description:
+ 'Shows daily token usage over the last 14 days, including VLM input, VLM output, and embedding input.',
+ empty: 'No token usage in the last 14 days',
+ title: 'Total Token Consumption',
+ },
+ usageDisabled:
+ 'Usage/Audit is not initialized, so live usage stats are unavailable.',
+ usageAccessRequired:
+ 'Current connection has no admin/root role. Configure an API key with Console Usage/Audit access in Connection & Identity.',
+ },
+} as const
+
+export default workspace
diff --git a/web-studio/src/i18n/locales/zh-CN.ts b/web-studio/src/i18n/locales/zh-CN.ts
index 6368a9b88..deedcae5f 100644
--- a/web-studio/src/i18n/locales/zh-CN.ts
+++ b/web-studio/src/i18n/locales/zh-CN.ts
@@ -1,1555 +1,11 @@
+import workspace from './zh-CN/workspace'
+import resources from './zh-CN/resources'
+import activity from './zh-CN/activity'
+
const zhCN = {
- appShell: {
- footer: {
- agentIntegrations: 'Agent 接入',
- connection: '连接设置',
- docs: '文档站',
- github: 'GitHub',
- sdkApi: 'SDK 与 API',
- users: '用户管理',
- },
- header: {
- currentUser: {
- account: 'Account',
- accountSummary: 'Account · {{account}}',
- openMenu: '查看当前用户 {{user}}',
- signedInAs: '当前数据访问身份',
- unset: '未设置',
- user: 'User',
- },
- defaultTitle: 'OpenViking Studio',
- },
- navigation: {
- home: {
- title: '首页',
- },
- crossDeviceVerify: {
- title: 'OAuth 验证',
- },
- operations: {
- title: '运维',
- },
- requestLogs: {
- title: '请求日志',
- },
- monitoring: {
- title: '监控',
- },
- skills: {
- title: '技能',
- },
- tasks: {
- title: '任务中心',
- },
- retrieval: {
- title: '检索',
- },
- sessions: {
- title: '会话',
- },
- playground: {
- title: '实验场',
- },
- },
- sidebar: {
- groups: {
- operations: '活动',
- resources: '资源',
- settings: '设置',
- workspace: '工作区',
- },
- loadingSessions: '加载中...',
- noSessions: '暂无会话',
- workspaceGroupLabel: 'OpenViking Studio',
- },
- },
- monitoringPage: {
- title: '监控',
- description: '查看 OpenViking 各组件的实时健康状态。',
- version: 'v{{version}}',
- refresh: '刷新',
- updatedAt: '更新于 {{time}}',
- loading: '正在加载监控数据...',
- loadFailed: '监控数据加载失败',
- health: {
- healthy: '正常',
- unhealthy: '异常',
- },
- summary: {
- healthy: '所有组件运行正常',
- unhealthy: '部分组件需要关注',
- components: '{{healthy}} / {{total}} 个组件正常',
- },
- tabs: {
- label: '监控类型',
- overview: '总览',
- queue: '任务队列',
- vikingdb: 'VectorDB',
- models: '模型',
- filesystem: '文件系统',
- lock: '锁',
- retrieval: '检索',
- },
- detail: {
- noData: '暂无监控数据',
- descriptions: {
- queue: '资源处理、语义生成和会话提交队列。',
- vikingdb: '向量数据存储与索引服务。',
- models: 'VLM、Embedding 和 Rerank 模型服务。',
- filesystem: 'OpenViking 文件系统与挂载点。',
- lock: '事务锁与并发控制服务。',
- retrieval: '上下文检索服务。',
- },
- },
- offline: {
- title: '尚未连接 OpenViking 服务',
- description: '配置服务地址和访问凭证后即可查看监控数据。',
- action: '打开连接设置',
- },
- },
- skillsPage: {
- title: '技能',
- description: '查看当前用户和当前空间可用的 Agent 技能。',
- refresh: '刷新',
- loading: '正在加载技能...',
- empty: '暂无可用技能',
- emptyDescription: '添加技能后,会在这里按用户技能和共享技能统一展示。',
- loadFailed: '技能加载失败',
- networkError: '无法连接 OpenViking 服务,请检查服务地址和连接状态。',
- connectionSettings: '打开连接设置',
- detail: '详情',
- viewDetail: '查看 {{name}} 详情',
- detailLoading: '正在加载技能详情...',
- detailLoadFailed: '技能详情加载失败',
- directory: '目录',
- none: '无',
- metrics: {
- files: '文件',
- scope: '作用域',
- },
- sections: {
- allowedTools: '允许工具',
- content: 'SKILL.md',
- description: '简介',
- files: '文件',
- overview: 'Overview',
- tags: '标签',
- },
- scopes: {
- user: '用户技能',
- agent: '共享技能',
- },
- },
- tasksPage: {
- title: '任务中心',
- description: '集中查看资源处理、会话提交和 Reindex 等后台任务。',
- refresh: '刷新',
- loading: '正在加载任务...',
- empty: '暂无后台任务',
- emptyDescription: '异步任务启动后,会在这里显示执行状态和更新时间。',
- emptyFiltered: '没有匹配的任务',
- emptyFilteredDescription: '可以调整或清除筛选条件后重新查看。',
- loadFailed: '任务加载失败',
- detail: {
- title: '任务详情',
- loading: '正在加载任务详情...',
- loadFailed: '任务详情加载失败',
- retry: '重试',
- openLabel: '查看任务 {{taskId}} 的详情',
- fields: {
- status: '任务状态',
- type: '任务类型',
- stage: '当前阶段',
- resource: '关联资源',
- createdAt: '创建时间',
- updatedAt: '更新时间',
- },
- error: '失败原因',
- result: '执行结果',
- noResult: '暂无执行结果',
- noResultDescription: '任务完成后,接口返回的结果会显示在这里。',
- noResultFailedDescription: '该任务未返回结果,请查看上方失败原因。',
- noResultCancelledDescription: '该任务已取消,未返回执行结果。',
- },
- filters: {
- label: '筛选',
- type: '任务类型',
- status: '任务状态',
- allTypes: '全部类型',
- allStatuses: '全部状态',
- clear: '清除筛选',
- },
- pagination: {
- next: '下一页',
- page: '第 {{page}} 页',
- pageSize: '每页条数',
- pageSizeValue: '每页 {{count}} 条',
- previous: '上一页',
- scope: '当前展示最近 {{count}} 条任务(接口最多返回 {{limit}} 条)',
- },
- table: {
- task: '任务',
- type: '类型',
- resource: '关联资源',
- createdAt: '创建时间',
- status: '状态',
- },
- status: {
- cancelled: '已取消',
- cancelling: '取消中',
- completed: '已完成',
- failed: '失败',
- pending: '等待中',
- running: '进行中',
- unknown: '未知',
- },
- types: {
- session_commit: '会话提交',
- add_resource: '资源处理',
- add_skill: '技能导入',
- connector_import: '连接器导入',
- admin_reindex: 'Reindex',
- snapshot_restore_reindex: '快照恢复索引',
- legacy_migration: '旧数据迁移',
- legacy_cleanup: '旧数据清理',
- },
- },
- accountSwitcher: {
- create: '新建 Account',
- dialog: {
- accountLabel: 'Account',
- accountPlaceholder: 'team-account',
- adminLabel: '初始 Admin user',
- cancel: '取消',
- description:
- '创建一个新的空间和首个管理员。创建完成后将自动切换到该空间。',
- submit: '创建并切换',
- title: '新建 Account',
- },
- empty: '没有匹配的 Account',
- errors: {
- loadAccounts: '加载 Account 失败',
- noCreatedKey: 'Account 已创建,但服务端没有返回可用于切换的数据凭证。',
- noUsableKey: '该 Account 没有可用于数据访问的明文 User API Key。',
- noUsers: '该 Account 下没有可用用户。',
- },
- loading: '正在加载 Accounts...',
- manualSwitch: {
- description:
- '服务端没有返回 {{account}} 下的明文凭证。请输入该 Account 中任意用户的 User API Key。',
- hint: 'API Key 只用于校验并切换当前数据身份,不会修改或重新生成服务端凭证。',
- keyLabel: 'User API Key',
- keyPlaceholder: '粘贴目标 Account 的 User API Key',
- manageOnly: '仅管理该 Account',
- submit: '验证并切换',
- title: '输入 User API Key',
- },
- memberCount: '{{count}} 个用户',
- searchPlaceholder: '搜索 Account',
- toast: {
- created: '已创建并切换到 {{account}}',
- createdSwitchFailed:
- '{{account}} 已创建,但数据身份切换失败:{{error}}。仍可进入该 Account 管理用户。',
- managementSwitched:
- '管理空间已切换到 {{account}}。访问租户数据前,请先选择或创建 User Key。',
- switched: '已切换到 {{account}}',
- },
- unset: '未选择 Account',
- },
- common: {
- action: {
- cancel: '取消',
- saveConnection: '保存连接',
- showAdvancedIdentityFields: '显示高级身份字段',
- },
- errorBoundary: {
- description:
- '路由渲染过程中出现未处理异常。可以先重试一次;如果问题持续,查看下方错误信息继续排查。',
- reload: '刷新页面',
- retry: '重试',
- title: '页面发生错误',
- },
- language: {
- current: '当前',
- label: '语言',
- },
- theme: {
- toggle: '切换主题',
- },
- },
- connection: {
- devMode: {
- description:
- '当前服务会自动提供身份,通常不需要填写 account、user 和 API key。',
- title: '服务端托管身份',
- },
- dialog: {
- title: '连接与身份',
- },
- identitySummary: {
- dev: '服务端隐式身份',
- named: '{{identity}}',
- unset: '未设置身份',
- },
- fields: {
- accountId: {
- label: 'Account',
- placeholder: 'default',
- },
- apiKey: {
- label: 'API Key',
- placeholder: '输入 X-API-Key 或 Bearer token',
- },
- adminApiKey: {
- label: 'Admin API key',
- placeholder: 'Root 或 account-admin key',
- },
- baseUrl: {
- label: '服务地址',
- placeholder: 'http://127.0.0.1:1933',
- },
- credentials: {
- title: '身份与凭证',
- },
- dataApiKey: {
- label: 'User API key',
- },
- userId: {
- label: 'User',
- placeholder: 'default',
- },
- },
- },
- settings: {
- actions: {
- addAccount: '新增 account',
- addUser: '新增 user',
- cancel: '取消',
- changeRole: '修改 {{user}} 的角色',
- confirmRemoveUser: '删除用户',
- confirmRoleChange: '确认修改',
- copy: '复制',
- currentIdentity: '当前身份',
- refresh: '刷新',
- regenerate: '重新生成',
- removeUser: '删除 {{user}}',
- save: '保存',
- switchIdentity: '切换身份',
- use: '使用',
- },
- connection: {
- accountListLimited:
- '当前 key 不能列出所有 account;如果它有 account-admin 权限,仍可管理选中的 account。',
- adminError: '校验 Root API Key 失败:{{message}}',
- description:
- '租户数据 API 使用 User API Key;控制 API 可单独使用 Root 或 account-admin key。',
- devMode: '当前为开发模式 — 身份自动确定,无需 API key。',
- keyGuide: {
- control: {
- primary:
- '当前 User API Key 已可用于 Playground 和数据访问,普通用户无需配置控制凭证。',
- secondary:
- '如需切换 Account 或管理用户,请向部署管理员索取 Root Key,或向当前 Account 管理员索取 Admin Key。Root Key 位于服务端 ov.conf 的 server.root_api_key。',
- title: '需要管理 Account 或用户?',
- },
- data: {
- primary:
- 'Root/Admin API Key 主要用于管理操作,Playground 和租户数据访问需要绑定用户身份的 User API Key。',
- secondary:
- '请在「用户管理」中选择、创建用户或重新生成 User Key,然后将它用作 User API Key。',
- title: '还缺少 User API Key',
- },
- empty: {
- primary: '普通用户:请向当前 Account 管理员索取 User API Key。',
- secondary:
- '部署管理员:Root API Key 位于服务端 ov.conf 的 server.root_api_key;填入后可在「用户管理」中创建或重新生成 User Key。',
- title: '还没有 OpenViking API Key?',
- },
- learnMore: '查看 API Key 获取方式',
- trusted: {
- primary:
- '当前 Trusted 服务启用了 Root Key 校验,浏览器需要配置同一 Root API Key 才能访问管理和租户数据接口。',
- secondary:
- '请向部署管理员索取 Root Key;它位于服务端 ov.conf 的 server.root_api_key。Trusted 模式的数据身份由 Account/User 断言确定,不需要 User API Key。',
- title: 'Trusted 服务需要 Root API Key',
- },
- },
- rootHint: '用于列出 account / user,以及生成或轮换 key。',
- title: '连接设置',
- unsupportedAuthMode: {
- description:
- 'Web Studio 不支持 {{mode}} 认证模式。请使用 {{ov}} CLI 或 Python SDK 连接此服务器。',
- primary: '该服务器配置了 {{mode}} 认证。',
- title: '不支持的认证模式',
- },
- userHint: '供 Playground 和租户数据 API 使用。',
- },
- connectionPage: {
- description: '配置 OpenViking 服务连接、控制面凭证和当前数据访问凭证。',
- title: '连接设置',
- },
- dialogs: {
- addAccount: {
- description:
- '创建一个工作区 account 和第一个 admin user。新 key 只会在创建后展示一次。',
- title: '新增 account',
- },
- addUser: {
- currentAccountDescription:
- '在 {{accountId}} 空间下创建用户。生成的 key 只会在创建后展示一次。',
- description:
- '在已有 account 下注册 user。生成的 key 只会在创建后展示一次。',
- title: '新增 user',
- },
- changeRole: {
- description:
- '将 {{account}} / {{user}} 的角色修改为 {{role}}。新的权限会立即生效。',
- title: '修改用户角色?',
- },
- regenerate: {
- description:
- '要重新生成 {{account}} / {{user}} 的 API key 吗?当前 key 会立即失效。',
- title: '重新生成 API key?',
- },
- removeUser: {
- description:
- '确定从 {{account}} 空间移除 {{user}} 吗?该用户的 API Key 会立即失效,此操作不可撤销。',
- title: '删除用户?',
- },
- },
- empty: {
- adminDescription:
- '使用 root 或 account admin API key 后,可以列出用户、复制 key、新增身份或轮换凭证。',
- adminTitle: '需要 admin 权限',
- usersDescription: '创建一个 user 来生成第一个 API key。',
- usersTitle: '选中的 accounts 下没有 user',
- },
- fields: {
- account: 'Account',
- adminUser: 'Admin user',
- adminApiKey: 'Admin API key',
- apiKey: 'API key',
- baseUrl: '服务地址',
- dataApiKey: 'User API key',
- rootApiKey: 'Root or Admin API Key',
- userApiKey: 'User API Key',
- role: '角色',
- user: 'User',
- },
- health: {
- admin: '控制面权限',
- data: '数据访问',
- state: {
- checking: '检查中',
- error: '异常',
- ok: '正常',
- skipped: '未检查',
- },
- },
- keyResult: {
- description:
- '请现在复制保存。离开当前状态后,OpenViking 可能只展示前缀。',
- dismiss: '收起',
- title: '新的 API key',
- },
- loading: '正在加载身份...',
- management: {
- accountFilter: 'Accounts',
- accessDeniedDescription:
- '只有配置并通过校验的 Root 或 Account Admin API Key 才能管理用户。',
- accessDeniedTitle: '无用户管理权限',
- currentAccountDescription: '管理 {{account}} 空间下的用户和访问凭证。',
- description:
- '查看选中 accounts 下的 users 和凭证,并在网页端新增 user 或轮换 key。',
- memberListDescription:
- '“切换身份”会将该用户设为 Playground、检索等数据页面的访问身份,不会改变当前 Root/Admin 管理凭证。',
- memberListDescriptionRoot:
- '可直接修改成员角色;“切换身份”只会改变 Playground、检索等数据页面的访问身份,不会改变当前 Root 管理凭证。',
- memberListTitle: '空间成员',
- cannotRemoveCurrentIdentity: '不能删除当前正在使用的身份。',
- cannotRemoveLastManager: '不能删除空间内最后一个管理员。',
- noUsableKey: '该用户没有可用于数据访问的明文 API Key。',
- openConnection: '打开连接设置',
- title: '用户管理',
- },
- page: {
- adminDescription:
- '配置当前 OpenViking Studio 身份,并管理账号、用户和 API key。',
- description:
- '配置当前 OpenViking Studio 的服务地址和 API key,查看当前身份下的数据。',
- title: '连接与身份',
- },
- placeholders: {
- account: 'team-account',
- adminApiKey: 'Root 或 account-admin key',
- apiKey: '输入 X-API-Key 或 Bearer token',
- baseUrl: 'http://127.0.0.1:1933',
- devModeApiKey: '[dev mode,无需 API key]',
- userApiKey: 'User API key',
- user: 'default',
- },
- roles: {
- admin: 'Admin',
- root: 'Root',
- user: 'User',
- },
- serverMode: {
- api_key: 'API key 模式',
- checking: '检查中...',
- dev: '开发模式',
- ldap: 'LDAP 模式',
- offline: '离线',
- oidc: 'OIDC 模式',
- trusted: 'Trusted 模式',
- },
- stats: {
- accounts: 'Accounts 总数',
- apiKeys: '可见 API keys',
- users: 'Users',
- },
- table: {
- account: 'Account',
- actions: '操作',
- apiKey: 'API key',
- role: '角色',
- user: 'User',
- },
- toast: {
- accountCreated: 'Account 已创建',
- connectionSaved: '连接已保存',
- copyFailed: '复制失败',
- copied: '已复制',
- dataKeySelected: '已切换数据访问身份',
- keyRegenerated: 'API key 已重新生成',
- roleUpdated: '{{user}} 的角色已修改为 {{role}}',
- userCreated: 'User 已创建',
- userRemoved: '{{user}} 已删除',
- },
- },
- home: {
- contextCommits: {
- description:
- '按 4 小时聚合资源、技能、会话消息和提交写入,鼠标悬停可查看明细。',
- empty: '过去一年暂无上下文提交',
- hourRange: '{{start}}-{{end}}',
- legend: {
- high: '高',
- intense: '密集',
- low: '低',
- medium: '中',
- more: '多',
- none: '少',
- title: '提交强度',
- },
- operations: {
- addResource: '资源写入',
- addSkill: '技能写入',
- sessionAddMessage: '会话消息',
- sessionCommit: '会话提交',
- },
- stats: {
- activeDays: '活跃天数',
- peakDay: '峰值单日',
- recentDay: '最近提交',
- },
- title: '上下文提交统计',
- yearlyEmpty: '暂无上下文提交',
- yearlyTotal: '{{count}} 次上下文提交',
- tooltip: {
- total: '总提交',
- },
- },
- contextData: {
- description: '包含文件、技能与用户记忆,用于衡量当前上下文资源规模。',
- files: '文件',
- memories: '记忆',
- skills: '技能',
- title: '上下文数据量',
- },
- page: {
- description:
- '按产品需求对齐首页内容:菜单入口、上下文数据量、今日 tokens、今日检索、Agent 访问、tokens 趋势和上下文提交统计。',
- eyebrow: 'OpenViking Studio',
- settings: '连接与设置',
- title: 'Overview',
- },
- requestFailed: '请求失败',
- todayRetrievals: {
- description:
- '展示用户或 Agent 今日使用语义检索 find() 和 search() 的成功调用次数,每天零点刷新。',
- find: 'find',
- search: 'search',
- title: '今日检索次数',
- },
- todayTokens: {
- description: '展示今日实时 token 消耗,每天零点刷新。',
- embeddingInput: 'Embedding input tokens',
- title: '今日 Tokens 消耗',
- vlmInput: 'VLM input tokens',
- vlmOutput: 'VLM output tokens',
- },
- tokenTrend: {
- description:
- '展示最近 14 天每日 token 消耗,包含 VLM 输入、VLM 输出和 Embedding 输入。',
- empty: '最近 14 天暂无 token 消耗',
- title: 'tokens 总消耗统计',
- },
- usageDisabled: 'Usage/Audit 未初始化,暂无实时统计。',
- usageAccessRequired:
- '当前连接未获取到 admin/root 权限,无法显示 Usage/Audit 数据。请在连接与身份中配置具备 Console Usage/Audit 权限的 API Key。',
- },
- operations: {
- page: {
- placeholder: '运维面板能力尚未接入。',
- },
- },
- requestLogs: {
- accessRequired: {
- description:
- '当前连接未获取到 admin/root 权限,无法显示请求日志。请在连接与身份中配置具备 Console Usage/Audit 权限的 API Key。',
- title: '需要 admin 权限',
- },
- clear: '清空',
- description:
- '查看当前身份下服务端审计到的 API 请求,包括状态、耗时和请求标识。',
- disabled: {
- description: 'Usage/Audit 未初始化,暂无服务端请求日志。',
- title: '审计日志不可用',
- },
- empty: {
- description: '先开始您的第一次可审计调用吧!',
- filteredDescription: '调整搜索内容或状态筛选,扩大可见日志范围。',
- filteredTitle: '没有匹配的请求',
- title: '当前无日志信息',
- upload: '上传文件',
- },
- error: {
- description: '无法从服务端加载审计请求日志。',
- title: '请求失败',
- },
- eyebrow: 'Playground 遥测',
- filters: {
- all: '所有日志',
- apiTypePlaceholder: 'API 类型',
- error: '错误日志',
- requestIdPlaceholder: '精确 Request ID',
- statusCodePlaceholder: '状态码',
- },
- loading: '正在加载请求日志...',
- metrics: {
- successRate: '成功率',
- total: '总调用次数',
- },
- pagination: {
- next: '下一页',
- pageSize: '每页条数',
- pageSizeValue: '每页 {{count}} 条',
- previous: '上一页',
- summary: '共 {{total}} 条,第 {{page}} / {{pageCount}} 页',
- },
- query: '查询',
- refresh: '刷新',
- reset: '重置',
- searchPlaceholder: '筛选方法、路径或状态码',
- scope: {
- currentIdentity: '当前范围:当前 API key 身份',
- currentIdentityWithName: '当前范围:当前 API key 身份({{identity}})',
- },
- status: {
- error: 'ERR',
- pending: 'PENDING',
- success: 'OK',
- },
- table: {
- accountId: 'Account ID',
- apiType: 'API 类型',
- duration: '耗时',
- method: '方法',
- path: '路径',
- requestId: 'Request ID',
- status: '状态',
- time: '时间',
- title: '捕获的请求',
- userId: 'User ID',
- },
- title: '请求日志',
- },
- addResource: {
- title: '添加资源',
- description: '上传本地文件到服务器,文件类型通过 magic bytes 自动检测。',
- dropzone: {
- title: '拖拽文件到此处,或点击选择文件',
- hint: '每次最多上传 10 个文件。',
- supportedFormats:
- '支持 PDF、Word、PPTX、Excel、Markdown、代码文件、图片等',
- },
- fileInfo: {
- name: '文件',
- size: '大小',
- type: '类型',
- unknown: '未知类型',
- remove: '移除',
- },
- targetUri: '目标 URI',
- 'targetUri.placeholder': 'viking://resources/',
- 'targetUri.hint': '选择资源的存储位置,默认为 viking://resources/。',
- 'targetUri.browse': '浏览',
- advancedOptions: '高级选项',
- upload: '上传文件',
- 'upload.processing': '文件已上传,正在处理中...',
- uploading: '上传中…',
- result: {
- success: '上传完成!',
- skippedFiles: '{{count}} 个文件被跳过(不支持的格式)',
- },
- cancelUpload: '取消',
- startProcessing: '开始处理',
- success: '资源添加成功',
- fileBlocked: '"{{name}}" 不是支持的文件类型。',
- fileTooLarge: '"{{name}}" 超过 {{size}} 文件大小限制。',
- tooManyFiles: '仅保留前 {{count}} 个文件,其余已忽略。',
- error: '请求失败',
- dirPicker: {
- title: '选择目录',
- select: '选择',
- cancel: '取消',
- empty: '空目录',
- error: '加载目录失败',
- selected: '已选择:',
- },
- mode: {
- upload: '上传文件',
- remote: '远程资源',
- },
- remoteUrl: '远程资源地址',
- 'remoteUrl.placeholder': 'https://github.com/org/repo',
- 'remoteUrl.hint': 'HTTP(S) 链接、Git 仓库地址或其他远程资源地址。',
- strict: '严格模式',
- 'strict.hint':
- '开启时,服务器会拒绝不支持或无法识别类型的文件,而非静默跳过。',
- directlyUploadMedia: '直接上传媒体文件',
- 'directlyUploadMedia.hint':
- '开启时,媒体文件(图片、音频、视频)原样存储。关闭后,媒体文件会先通过 AI 视觉/音频管道提取内容再存储。',
- createParent: '自动创建父文件夹',
- 'createParent.hint': '开启时,若目标父目录不存在则自动创建。',
- reason: '添加原因',
- 'reason.placeholder': '为什么要添加这个资源?',
- instruction: '处理指令',
- 'instruction.placeholder': '针对该资源的特殊处理指令。',
- directoryScan: {
- title: '目录扫描选项',
- ignoreDirs: '忽略目录',
- 'ignoreDirs.placeholder': 'node_modules, .git, __pycache__',
- include: '包含模式',
- 'include.placeholder': '*.py, *.md',
- exclude: '排除模式',
- 'exclude.placeholder': '*.log, *.tmp',
- },
- },
- resources: {
- processingTasks: {
- title: '文件处理任务',
- empty: '暂无处理任务',
- toggleError: '展开或收起错误详情',
- columns: {
- fileName: '文件名',
- status: '状态',
- size: '大小',
- },
- status: {
- cancelled: '已取消',
- processing: '处理中',
- success: '处理成功',
- failed: '处理失败',
- },
- },
- searchPalette: {
- ariaLabel: '搜索',
- openContainingDirectory: '打开所在目录',
- placeholder: '搜索',
- scope: {
- global: '搜索范围: 全局',
- current: '搜索范围: {{name}}',
- resetToGlobal: '点击重置为全局搜索',
- },
- scopeState: {
- validatingTitle: '正在校验搜索范围',
- validatingPrefix: '正在检查',
- validatingSuffix: '是否存在',
- switchTitle: '切换搜索范围',
- switchPrefix: '按',
- switchMiddle: '切换到',
- invalidTitle: '搜索范围不存在',
- invalidPrefix: '路径',
- invalidSuffix: '无法访问,不能切换',
- },
- empty: {
- title: '搜索文件和目录',
- },
- browseDirHint: {
- before: '输入',
- after: '浏览目录结构',
- },
- globalScopeHint: {
- before: '输入',
- after: '切换搜索范围到全局',
- },
- error: '搜索出错',
- emptyResults: {
- title: '没有找到匹配的文件或目录',
- subtitle: '试试换个关键词?',
- },
- footer: {
- dirMode: {
- select: '选择',
- level: '层级',
- confirm: '确定',
- cancel: '取消',
- },
- resultMode: {
- navigate: '导航',
- open: '打开',
- close: '关闭',
- count: '{{count}} 个结果',
- },
- },
- },
- dirBrowser: {
- back: '返回上一级',
- loading: '正在加载目录',
- filesSection: '文件',
- error: '加载目录失败',
- empty: {
- title: '空目录',
- subtitle: '这一层目前没有可继续展开的子目录',
- },
- },
- filePreview: {
- cancel: '取消',
- edit: '编辑',
- emptyFile: '(空文件)',
- emptyPrompt: '选择文件后在这里预览',
- formattingJson: '正在格式化 JSON...',
- imageFailed: '图片加载失败。',
- imageLoading: '正在加载图片...',
- largeFileSkipped: '文件较大,默认不自动加载。',
- jsonFormatFailed: 'JSON 格式化失败,已显示原始内容。',
- loadFile: '仍然加载',
- loadingContent: '正在读取内容...',
- loadingEditor: '加载编辑器...',
- markdownPreview: '预览',
- markdownSource: '源码',
- noDirectoryContext: '这个目录暂无摘要或概览。',
- save: '保存',
- selectDirectoryContext: '选择一个标签查看目录上下文。',
- unsupportedBinary: '二进制文件不支持文本预览。',
- jsonl: {
- collapse: '收起',
- dialogMode: '对话',
- emptyJsonl: '空 JSONL。',
- emptyMessage: '空消息',
- expand: '展开',
- noArguments: '无参数',
- rawMode: 'JSONL',
- recordCount: '{{count}} 条记录',
- toolcall: '工具调用',
- },
- },
- },
- retrieval: {
- title: '检索',
- searchPlaceholder: '输入检索内容',
- placeholders: {
- find: '输入语义检索内容',
- search: '输入需要结合会话理解的问题',
- grep: '输入正则表达式或精确文本',
- glob: '输入文件模式,例如 **/*.md',
- },
- send: '检索',
- controls: {
- function: '检索函数',
- modes: {
- find: 'find',
- search: 'search',
- grep: 'grep',
- glob: 'glob',
- },
- ignoreCase: '忽略大小写',
- resultCount: '返回数量',
- path: '路径',
- pathPlaceholder: '/',
- scope: '检索范围',
- customScope: '自定义范围',
- customScopePlaceholder: 'resources/project 或 viking://...',
- effectiveScope: '范围',
- allContexts: '全部上下文',
- scopes: {
- all: {
- label: '全部上下文',
- },
- resources: {
- label: '资源库',
- },
- custom: {
- label: '自定义 URI',
- },
- },
- sessionId: 'Session ID',
- sessionPlaceholder: 'session_id(可选)',
- },
- advanced: {
- title: '更多筛选',
- contextTypes: '上下文类型',
- levels: '内容层级',
- scoreThreshold: '最低相关度',
- tags: '检索标签',
- tagsPlaceholder: '例如 env=prod, team=search',
- tagsInvalid: '标签必须使用 key=value 格式,多个标签用逗号分隔',
- timeRange: '时间范围',
- since: '开始时间,如 7d',
- until: '结束时间,如 2026-07-27',
- anyTime: '不限时间',
- quickRange: '快捷范围',
- last24Hours: '近 24 小时',
- last7Days: '近 7 天',
- last30Days: '近 30 天',
- customRange: '自定义日期',
- startDate: '开始日期',
- endDate: '结束日期',
- clearTimeRange: '清除时间范围',
- timeField: '时间字段',
- updatedAt: '更新时间',
- createdAt: '创建时间',
- provenance: '返回检索过程',
- reset: '重置筛选',
- },
- detail: {
- score: '相关度',
- level: '层级',
- openPlayground: '在 Playground 打开',
- uri: 'URI',
- summary: '摘要',
- noSummary: '暂无可展示的摘要',
- matchReason: '匹配原因',
- },
- results: {
- title: '检索结果',
- topN: '检索结果(Top{{count}})',
- line: '第 {{line}} 行',
- lineLabel: '行号',
- score: '相关度',
- uri: 'URI',
- description: '描述',
- provenance: '检索过程({{count}})',
- },
- types: {
- resource: 'Resources',
- memory: 'Memories',
- skill: 'Skills',
- },
- queryPlan: {
- title: '查询计划 {{count}} 条',
- more: '+{{count}} 条',
- },
- loading: {
- vector: '正在检索向量索引...',
- scan: '扫描知识库层级结构...',
- match: '匹配语义相关内容...',
- rerank: '对结果重排序...',
- },
- empty: {
- checking: '正在检查可检索上下文...',
- readyTitle: '已有可检索上下文',
- readyDescription: '输入关键词后按 Enter 开始检索',
- title: '当前还没有可检索的上下文',
- description: '先上传您的第一份资源吧~',
- upload: '上传文件',
- },
- error: {
- title: '检索失败',
- fallback: '请求未能完成,请稍后重试。',
- network:
- '请求未能到达 OpenViking 服务,请检查连接地址、服务状态或跨域配置。',
- code: '错误码',
- status: 'HTTP 状态',
- requestId: 'Request ID',
- },
- noResults: {
- title: '没有找到匹配的内容',
- subtitle: '试试换个关键词或调整路径范围',
- },
- },
- sessions: {
- page: {
- placeholder: '会话与 Bot 工作区能力尚未接入。',
- },
- threadList: {
- title: '会话',
- newSession: '新建会话',
- count: '{{count}} 个会话',
- loading: '正在加载会话...',
- emptyTitle: '还没有会话',
- emptyDescription: '点击右上角的加号开始一段新对话。',
- deleteSession: '删除“{{title}}”',
- deleteConfirmTitle: '删除会话?',
- deleteConfirmDescription:
- '“{{title}}”及其对话记录将被永久删除,此操作无法撤销。',
- cancel: '取消',
- confirmDelete: '删除',
- deleting: '正在删除...',
- deleteSuccess: '会话已删除',
- deleteFailed: '会话删除失败:{{error}}',
- shortcut: '⌘ N 新建会话',
- },
- chat: {
- copy: '复制',
- emptyDescription: '探索你的知识库,开始一段对话。',
- placeholder: '输入消息...',
- emptyState: '选择或创建一个会话开始聊天。',
- thinking: '思考中...',
- reasoning: '思考过程',
- iteration: '第 {{count}} 轮',
- toolCall: '工具调用',
- toolInput: '输入',
- toolResult: '结果',
- loadMoreRefs: '加载更多 {{count}} 条(剩余 {{remaining}} 条)',
- relativeTime: {
- justNow: '刚刚',
- minutesAgo: '{{count}} 分钟前',
- hoursAgo: '{{count}} 小时前',
- daysAgo: '{{count}} 天前',
- },
- toolStatus: {
- completed: '完成',
- failed: '失败',
- running: '执行中...',
- },
- send: '发送',
- cancel: '停止',
- },
- impact: {
- title: '记忆影响',
- open: '查看本次会话造成的记忆影响',
- description: '由 {{commits}} 次提交产生 {{changes}} 项记忆变更',
- kinds: {
- add: '新增',
- update: '更新',
- delete: '删除',
- },
- allTypes: '全部',
- filterByType: '按记忆分类筛选',
- before: '变更前',
- after: '变更后',
- addedContent: '新增内容',
- deletedContent: '删除内容',
- emptyContent: '没有可展示的内容',
- loading: '正在加载记忆变更...',
- loadFailed: '记忆变更加载失败',
- retry: '重试',
- empty: '本次会话提交没有产生记忆变更。',
- },
- empty: {
- description: '从左侧选择一个会话,或创建新会话。',
- title: '未选择会话',
- },
- },
- oauth: {
- identityPicker: {
- useCurrent: '以当前身份授权',
- noCurrent:
- '尚未配置身份。请先在“连接与身份”中登录,或在下方临时粘贴一个 API key。',
- useSelect: '授权指定的账号 / 用户',
- selectAccountLabel: '账号',
- selectUserLabel: '用户',
- selectNoKey:
- '该用户没有 API key,请选择其他用户,或在“连接与身份”中重新生成。',
- selectAccountAdminHint: '你只能为本账号下的用户授权。',
- useCustom: '使用其他 API key',
- customKeyLabel: 'API key',
- customKeyPlaceholder: '粘贴一个 API key(不会持久化)',
- },
- consent: {
- title: '授权 {{clientName}}',
- loading: '正在加载授权请求…',
- expired: '此次授权已过期或不再有效,请从 MCP 客户端重新发起。',
- missingPending: '缺少授权 ID,请打开 MCP 客户端给出的链接。',
- requestSummary: '{{clientName}} 请求访问你的 OpenViking 工作区。',
- redirectLabel: '回跳地址',
- scopesLabel: '权限范围',
- scopesNone: '(无)',
- signInRequired:
- '请先在“连接与身份”中登录 OpenViking Studio,或在下方临时粘贴 API key 完成授权。',
- openConnectionSettings: '打开连接与身份',
- authorize: '授权',
- deny: '拒绝',
- useAnotherDevice: '在另一台设备上授权 →',
- waitingRedirect: '已授权——正在回跳到客户端…',
- verifying: '正在验证…',
- denying: '正在拒绝…',
- denied: '已拒绝,可以关闭此页。',
- verifyError: '授权失败:{{message}}',
- noApiKey: '没有可用的 API key。请选择一个身份或粘贴 key。',
- },
- verify: {
- title: '跨设备验证',
- description: '请输入发起 MCP 客户端登录的那台设备上显示的 6 位验证码。',
- codeLabel: '验证码',
- codePlaceholder: '6 位验证码',
- submit: '授权',
- success: '已为 {{clientName}} 授权,可以关闭此页并回到原设备。',
- successUnknownClient: '已授权,可以关闭此页并回到原设备。',
- verifyError: '授权失败:{{message}}',
- noApiKey: '没有可用的 API key。请选择一个身份或粘贴 key。',
- signInRequired:
- '请先在“连接与身份”中登录 OpenViking Studio,或在下方临时粘贴 API key 完成授权。',
- },
- },
- playground: {
- copyUri: '复制当前 URI',
- copied: '已复制 URI',
- copyFailed: '复制失败',
- resizeContext: '调整上下文目录宽度',
- resizeAction: '调整 Terminal 和 Agent 宽度',
- readFailed: '无法读取 {{uri}}',
- tabs: {
- terminal: '终端',
- agent: 'Agent',
- },
- addResource: {
- title: '添加资源',
- description:
- '添加完成后左侧目录树会刷新,右侧 Terminal 可继续定位新资源。',
- submitted: '资源添加任务已提交',
- },
- explorer: {
- title: '上下文目录',
- addResource: '添加资源',
- abstractLevel: 'L0',
- empty: '空',
- loading: '加载中',
- overviewLevel: 'L1',
- search: '搜索上下文',
- refresh: '刷新目录',
- namespaces: {
- agent: 'Agent 的能力、工具和经验',
- user: '用户个性化记忆',
- resources: 'Agent 可引用的外部资源',
- },
- },
- agent: {
- history: '历史会话',
- newSession: '新建会话',
- creating: '正在创建 Playground 会话...',
- detectingBot: '正在检测 bot 模式...',
- createFailed: '创建会话失败:{{error}}',
- retry: '重试',
- botDisabledFooter: '开启 bot 模式后可使用 Agent 对话',
- historyTitle: 'Agent 会话历史',
- historyDescription:
- '这里只展示实验场右侧 Agent 使用过的会话;新建会话会开启一个空白 Agent 上下文。',
- loadingSessions: '正在加载会话...',
- noSessions: '暂无历史会话',
- createTimeout: '创建 Playground 会话超时,请检查连接设置后重试。',
- newSessionTitle: '新建 Playground 会话',
- botPrompt: {
- title: '请开启 bot 模式',
- description:
- '当前服务未启用 Agent 对话能力,请使用 bot 模式启动服务后重试。',
- command: 'openviking-server --with-bot',
- retry: '重新检测',
- },
- empty: {
- heading: 'Agent 动作会和左侧目录联动',
- body: '发送问题后,tool call 输出里的 `viking://` 文件会变成可点击链接,点击即可在左侧定位并在中间打开。',
- prompts: [
- '总结当前目录',
- '递归查找相关文档',
- '解释这个资源和项目的关系',
- ],
- },
- },
- terminal: {
- header: '终端',
- history: '命令历史',
- historyTitle: '命令历史',
- historyDescription: '查看当前浏览器中执行过的命令。',
- clearHistory: '清空命令历史',
- noHistory: '暂无命令历史',
- welcomeTitle: 'Terminal 已连接上下文目录',
- welcomeBody:
- '可执行 /status、/ls、/search、/read、/add-resource。/search 默认全局检索,可通过 --scope . 使用当前目录,或通过 --scope viking://resources/... 指定目录。',
- scopeLabel: '目录:{{uri}}',
- globalScope: '全局',
- opened: '已打开资源',
- onlineTitle: '服务在线',
- onlineBody: 'OpenViking API 正常响应,根目录下发现 {{count}} 个节点。',
- lsBody: '{{uri}} 下共展示 {{count}} 个节点。',
- fileEmpty: '文件为空,已在中间预览区打开。',
- searchUsage: '用法:{{name}} 查询词 [--scope .|viking://resources/...]',
- searchScopeLine: '搜索范围:{{scope}}',
- helpParameters: '参数',
- helpExamples: '示例',
- helpSubcommands: '子命令',
- noParameters: '无参数',
- currentScopeAction: '使用当前目录',
- readUsage: '用法:/read viking://resources/...',
- enterUri: '请输入 viking:// URI',
- hits: '命中 resources {{resources}} 条,memory {{memories}} 条,skill {{skills}} 条。',
- addResourceBody:
- '已打开添加资源弹窗。提交后左侧目录会刷新,也可以用 /ls 或 /search 继续定位新内容。',
- addResourceTitle: '添加资源',
- sessionUsage:
- '用法:/session [current|list|create|switch|get|context|messages|archive|commit|extract|message|used|tool-results|tool-result|tool-search|delete] ...',
- sessionDeleteUsage: '用法:/session delete <session_id>',
- sessionMissing:
- '当前没有 active session,请先打开 Agent 面板创建会话,或指定 session_id。',
- sessionCurrentBody: '当前 active session:{{id}}',
- sessionListBody: '共有 {{count}} 个 session。',
- sessionCreatedBody: '已创建并切换到 session:{{id}}',
- sessionSwitchedBody: '已切换到 session:{{id}}',
- sessionDeletedBody: '已删除 session:{{id}}',
- sessionMessageAddedBody: '已向 session {{id}} 添加消息。',
- unknownCommand:
- '未知命令。可用命令:/status、/ls、/search、/find、/read、/session、/add-resource。',
- commandFailed: '命令失败',
- running: '正在执行命令...',
- placeholder: '输入 CLI 命令,例如 /status',
- suggestionsTitle: '命令建议',
- suggestionsHint: '↑↓ 选择 · Tab 补全 · Enter 执行',
- quickStart: {
- title: '快速开始',
- addResource: {
- title: '添加资源',
- command: '/add-resource',
- code: '导入文档或文件到 viking://resources',
- },
- addMemory: {
- title: '添加记忆',
- command: 'Agent 对话后自动沉淀',
- code: '在 Agent 面板发送消息,然后提交会话',
- },
- find: {
- title: '查找相关上下文',
- command: '/find openviking 价值',
- code: '在当前范围内搜索资源、记忆和技能',
- },
- },
- commandGroups: {
- core: '核心命令',
- filesystem: '文件系统',
- search: '搜索与摘要',
- status: '状态',
- resource: '资源路径',
- history: '历史记录',
- },
- commandParameters: {
- query: {
- name: '查询词',
- description: '要检索的关键词或语义问题。',
- },
- scope: {
- name: '--scope <.|uri>',
- description:
- '可选。不填则全局搜索;传 . 使用当前目录;传 uri 使用指定目录。',
- },
- sessionAction: {
- name: '子命令',
- description:
- 'current、list、create、switch、get、context、messages、archive、commit、extract、message、used、tool-results、tool-result、tool-search、delete。',
- },
- sessionId: {
- name: 'session_id',
- description:
- '可选。省略时多数子命令使用当前 Agent session;delete 必须显式指定。',
- },
- archiveId: {
- name: 'archive_id',
- description: '读取 archive 时必填。',
- },
- messageRole: {
- name: 'role',
- description: 'message 子命令使用,支持 user 或 assistant。',
- },
- messageContent: {
- name: 'content',
- description: 'message 子命令使用,要追加到 session 的文本内容。',
- },
- contexts: {
- name: '--context uri',
- description: 'used 子命令可重复传入,记录本轮实际使用的上下文。',
- },
- skillJson: {
- name: '--skill-json JSON',
- description: 'used 子命令使用,记录实际使用的 skill 信息。',
- },
- keepRecent: {
- name: '--keep-recent 数量',
- description: 'commit 子命令使用,提交后保留最近 N 条 live messages。',
- },
- tokenBudget: {
- name: '--token-budget 数量',
- description: 'context 子命令使用,限制组装上下文的 token 预算。',
- },
- toolName: {
- name: '--tool-name 名称',
- description: 'tool-results 子命令使用,按工具名过滤。',
- },
- toolResultId: {
- name: 'tool_result_id',
- description: '读取或搜索外部化 tool result 时必填。',
- },
- limit: {
- name: '--limit 数量',
- description: 'tool result 列表、读取或搜索时限制返回数量。',
- },
- offset: {
- name: '--offset 数量',
- description: 'tool-result 子命令使用,从指定字符偏移开始读取。',
- },
- contextChars: {
- name: '--context-chars 数量',
- description: 'tool-search 子命令使用,控制命中上下文长度。',
- },
- timeout: {
- name: '--timeout 秒',
- description: '可选。等待服务就绪的最长时间。',
- },
- uri: {
- name: 'uri',
- description: '可选或必填的 viking:// 资源路径,取决于命令用法。',
- },
- },
- commandExamples: {
- status: {
- default: {
- code: '/status',
- description: '检查 Agent 和 API 连通状态',
- },
- },
- ls: {
- current: {
- code: '/ls',
- description: '列出当前目录',
- },
- target: {
- code: '/ls viking://resources/',
- description: '列出指定目录',
- },
- },
- search: {
- global: {
- code: '/search agent',
- description: '全局语义检索',
- },
- current: {
- code: '/search agent --scope .',
- description: '使用当前高亮目录',
- },
- scoped: {
- code: '/search agent --scope viking://resources/',
- description: '只在指定目录检索',
- },
- },
- find: {
- global: {
- code: '/find agent',
- description: '全局查找相关资源',
- },
- current: {
- code: '/find agent --scope .',
- description: '使用当前高亮目录',
- },
- scoped: {
- code: '/find agent --scope viking://resources/',
- description: '只在指定目录查找',
- },
- },
- read: {
- file: {
- code: '/read viking://resources/file.md',
- description: '读取并打开文件',
- },
- },
- addResource: {
- default: {
- code: '/add-resource',
- description: '打开添加资源表单',
- },
- },
- session: {
- current: {
- code: '/session',
- description: '查看当前 active session',
- },
- list: {
- code: '/session list',
- description: '列出所有 session',
- },
- create: {
- code: '/session create [session_id]',
- description: '创建并切换到新 session',
- },
- switch: {
- code: '/session switch <session_id>',
- description: '切换 Agent 面板会话',
- },
- get: {
- code: '/session get [session_id]',
- description: '查看 session 元信息',
- },
- context: {
- code: '/session context [session_id] --token-budget 8000',
- description: '读取组装后的 session context',
- },
- messages: {
- code: '/session messages [session_id]',
- description: '读取 session 消息列表',
- },
- archive: {
- code: '/session archive [session_id] <archive_id>',
- description: '读取指定 archive',
- },
- commit: {
- code: '/session commit [session_id] --keep-recent 10',
- description: '归档并触发记忆提取',
- },
- extract: {
- code: '/session extract [session_id]',
- description: '从 session 中提取记忆',
- },
- message: {
- code: '/session message [session_id] user hello',
- description: '向 session 追加消息',
- },
- used: {
- code: '/session used [session_id] --context viking://resources/...',
- description: '记录实际使用的上下文或 skill',
- },
- toolResults: {
- code: '/session tool-results [session_id] --limit 20',
- description: '列出外部化 tool results',
- },
- toolResult: {
- code: '/session tool-result [session_id] <tool_result_id>',
- description: '读取一个 tool result',
- },
- toolSearch: {
- code: '/session tool-search [session_id] <tool_result_id> query',
- description: '在 tool result 中搜索',
- },
- delete: {
- code: '/session delete <session_id>',
- description: '删除指定 session',
- },
- },
- tree: {
- current: {
- code: '/tree',
- description: '展示当前目录树',
- },
- target: {
- code: '/tree viking://resources/',
- description: '展示指定目录树',
- },
- },
- stat: {
- target: {
- code: '/stat viking://resources/file.md',
- description: '查看资源元信息',
- },
- },
- abstract: {
- target: {
- code: '/abstract viking://resources/',
- description: '读取目录摘要',
- },
- },
- overview: {
- target: {
- code: '/overview viking://resources/',
- description: '读取目录概览',
- },
- },
- health: {
- default: {
- code: '/health',
- description: '查看后端健康状态',
- },
- },
- wait: {
- default: {
- code: '/wait',
- description: '等待服务就绪',
- },
- timeout: {
- code: '/wait --timeout 30',
- description: '指定等待秒数',
- },
- },
- },
- resourceSuggestion: '资源路径',
- historySuggestion: '历史记录',
- groupLabels: {
- resources: '资源',
- memories: '记忆',
- skills: '技能',
- },
- commands: {
- status: {
- description: '检查连通状态',
- usage: '/status',
- },
- ls: {
- description: '查看已有资源',
- usage: '/ls [viking://resources/...]',
- },
- search: {
- description: '语义检索上下文',
- usage: '/search 查询词',
- },
- find: {
- description: '查找相关资源',
- usage: '/find 查询词',
- },
- read: {
- description: '读取资源文件',
- usage: '/read viking://resources/.../file.md',
- },
- addResource: {
- description: '添加外部资源',
- usage: '/add-resource',
- },
- session: {
- description: '管理 Agent 会话',
- usage: '/session 子命令',
- },
- tree: {
- description: '展示目录树',
- usage: '/tree [viking://resources/...]',
- },
- stat: {
- description: '查看资源元信息',
- usage: '/stat viking://resources/...',
- },
- abstract: {
- description: '读取目录摘要',
- usage: '/abstract viking://resources/...',
- },
- overview: {
- description: '读取目录概览',
- usage: '/overview viking://resources/...',
- },
- health: {
- description: '查看后端健康状态',
- usage: '/health',
- },
- wait: {
- description: '等待服务就绪',
- usage: '/wait [--timeout seconds]',
- },
- },
- },
- },
+ ...workspace,
+ ...resources,
+ ...activity,
} as const
export default zhCN
diff --git a/web-studio/src/i18n/locales/zh-CN/activity.ts b/web-studio/src/i18n/locales/zh-CN/activity.ts
new file mode 100644
index 000000000..4189e8050
--- /dev/null
+++ b/web-studio/src/i18n/locales/zh-CN/activity.ts
@@ -0,0 +1,575 @@
+const activity = {
+ sessions: {
+ page: {
+ placeholder: '会话与 Bot 工作区能力尚未接入。',
+ },
+ threadList: {
+ title: '会话',
+ newSession: '新建会话',
+ count: '{{count}} 个会话',
+ loading: '正在加载会话...',
+ emptyTitle: '还没有会话',
+ emptyDescription: '点击右上角的加号开始一段新对话。',
+ deleteSession: '删除“{{title}}”',
+ deleteConfirmTitle: '删除会话?',
+ deleteConfirmDescription:
+ '“{{title}}”及其对话记录将被永久删除,此操作无法撤销。',
+ cancel: '取消',
+ confirmDelete: '删除',
+ deleting: '正在删除...',
+ deleteSuccess: '会话已删除',
+ deleteFailed: '会话删除失败:{{error}}',
+ shortcut: '⌘ N 新建会话',
+ },
+ chat: {
+ copy: '复制',
+ emptyDescription: '探索你的知识库,开始一段对话。',
+ placeholder: '输入消息...',
+ emptyState: '选择或创建一个会话开始聊天。',
+ thinking: '思考中...',
+ reasoning: '思考过程',
+ iteration: '第 {{count}} 轮',
+ toolCall: '工具调用',
+ toolInput: '输入',
+ toolResult: '结果',
+ loadMoreRefs: '加载更多 {{count}} 条(剩余 {{remaining}} 条)',
+ relativeTime: {
+ justNow: '刚刚',
+ minutesAgo: '{{count}} 分钟前',
+ hoursAgo: '{{count}} 小时前',
+ daysAgo: '{{count}} 天前',
+ },
+ toolStatus: {
+ completed: '完成',
+ failed: '失败',
+ running: '执行中...',
+ },
+ send: '发送',
+ cancel: '停止',
+ },
+ impact: {
+ title: '记忆影响',
+ open: '查看本次会话造成的记忆影响',
+ description: '由 {{commits}} 次提交产生 {{changes}} 项记忆变更',
+ kinds: {
+ add: '新增',
+ update: '更新',
+ delete: '删除',
+ },
+ allTypes: '全部',
+ filterByType: '按记忆分类筛选',
+ before: '变更前',
+ after: '变更后',
+ addedContent: '新增内容',
+ deletedContent: '删除内容',
+ emptyContent: '没有可展示的内容',
+ loading: '正在加载记忆变更...',
+ loadFailed: '记忆变更加载失败',
+ retry: '重试',
+ empty: '本次会话提交没有产生记忆变更。',
+ },
+ empty: {
+ description: '从左侧选择一个会话,或创建新会话。',
+ title: '未选择会话',
+ },
+ },
+ oauth: {
+ identityPicker: {
+ useCurrent: '以当前身份授权',
+ noCurrent:
+ '尚未配置身份。请先在“连接与身份”中登录,或在下方临时粘贴一个 API key。',
+ useSelect: '授权指定的账号 / 用户',
+ selectAccountLabel: '账号',
+ selectUserLabel: '用户',
+ selectNoKey:
+ '该用户没有 API key,请选择其他用户,或在“连接与身份”中重新生成。',
+ selectAccountAdminHint: '你只能为本账号下的用户授权。',
+ useCustom: '使用其他 API key',
+ customKeyLabel: 'API key',
+ customKeyPlaceholder: '粘贴一个 API key(不会持久化)',
+ },
+ consent: {
+ title: '授权 {{clientName}}',
+ loading: '正在加载授权请求…',
+ expired: '此次授权已过期或不再有效,请从 MCP 客户端重新发起。',
+ missingPending: '缺少授权 ID,请打开 MCP 客户端给出的链接。',
+ requestSummary: '{{clientName}} 请求访问你的 OpenViking 工作区。',
+ redirectLabel: '回跳地址',
+ scopesLabel: '权限范围',
+ scopesNone: '(无)',
+ signInRequired:
+ '请先在“连接与身份”中登录 OpenViking Studio,或在下方临时粘贴 API key 完成授权。',
+ openConnectionSettings: '打开连接与身份',
+ authorize: '授权',
+ deny: '拒绝',
+ useAnotherDevice: '在另一台设备上授权 →',
+ waitingRedirect: '已授权——正在回跳到客户端…',
+ verifying: '正在验证…',
+ denying: '正在拒绝…',
+ denied: '已拒绝,可以关闭此页。',
+ verifyError: '授权失败:{{message}}',
+ noApiKey: '没有可用的 API key。请选择一个身份或粘贴 key。',
+ },
+ verify: {
+ title: '跨设备验证',
+ description: '请输入发起 MCP 客户端登录的那台设备上显示的 6 位验证码。',
+ codeLabel: '验证码',
+ codePlaceholder: '6 位验证码',
+ submit: '授权',
+ success: '已为 {{clientName}} 授权,可以关闭此页并回到原设备。',
+ successUnknownClient: '已授权,可以关闭此页并回到原设备。',
+ verifyError: '授权失败:{{message}}',
+ noApiKey: '没有可用的 API key。请选择一个身份或粘贴 key。',
+ signInRequired:
+ '请先在“连接与身份”中登录 OpenViking Studio,或在下方临时粘贴 API key 完成授权。',
+ },
+ },
+ playground: {
+ copyUri: '复制当前 URI',
+ copied: '已复制 URI',
+ copyFailed: '复制失败',
+ resizeContext: '调整上下文目录宽度',
+ resizeAction: '调整 Terminal 和 Agent 宽度',
+ readFailed: '无法读取 {{uri}}',
+ tabs: {
+ terminal: '终端',
+ agent: 'Agent',
+ },
+ addResource: {
+ title: '添加资源',
+ description:
+ '添加完成后左侧目录树会刷新,右侧 Terminal 可继续定位新资源。',
+ submitted: '资源添加任务已提交',
+ },
+ explorer: {
+ title: '上下文目录',
+ addResource: '添加资源',
+ abstractLevel: 'L0',
+ empty: '空',
+ loading: '加载中',
+ overviewLevel: 'L1',
+ search: '搜索上下文',
+ refresh: '刷新目录',
+ namespaces: {
+ agent: 'Agent 的能力、工具和经验',
+ user: '用户个性化记忆',
+ resources: 'Agent 可引用的外部资源',
+ },
+ },
+ agent: {
+ history: '历史会话',
+ newSession: '新建会话',
+ creating: '正在创建 Playground 会话...',
+ detectingBot: '正在检测 bot 模式...',
+ createFailed: '创建会话失败:{{error}}',
+ retry: '重试',
+ botDisabledFooter: '开启 bot 模式后可使用 Agent 对话',
+ historyTitle: 'Agent 会话历史',
+ historyDescription:
+ '这里只展示实验场右侧 Agent 使用过的会话;新建会话会开启一个空白 Agent 上下文。',
+ loadingSessions: '正在加载会话...',
+ noSessions: '暂无历史会话',
+ createTimeout: '创建 Playground 会话超时,请检查连接设置后重试。',
+ newSessionTitle: '新建 Playground 会话',
+ botPrompt: {
+ title: '请开启 bot 模式',
+ description:
+ '当前服务未启用 Agent 对话能力,请使用 bot 模式启动服务后重试。',
+ command: 'openviking-server --with-bot',
+ retry: '重新检测',
+ },
+ empty: {
+ heading: 'Agent 动作会和左侧目录联动',
+ body: '发送问题后,tool call 输出里的 `viking://` 文件会变成可点击链接,点击即可在左侧定位并在中间打开。',
+ prompts: [
+ '总结当前目录',
+ '递归查找相关文档',
+ '解释这个资源和项目的关系',
+ ],
+ },
+ },
+ terminal: {
+ header: '终端',
+ history: '命令历史',
+ historyTitle: '命令历史',
+ historyDescription: '查看当前浏览器中执行过的命令。',
+ clearHistory: '清空命令历史',
+ noHistory: '暂无命令历史',
+ welcomeTitle: 'Terminal 已连接上下文目录',
+ welcomeBody:
+ '可执行 /status、/ls、/search、/read、/add-resource。/search 默认全局检索,可通过 --scope . 使用当前目录,或通过 --scope viking://resources/... 指定目录。',
+ scopeLabel: '目录:{{uri}}',
+ globalScope: '全局',
+ opened: '已打开资源',
+ onlineTitle: '服务在线',
+ onlineBody: 'OpenViking API 正常响应,根目录下发现 {{count}} 个节点。',
+ lsBody: '{{uri}} 下共展示 {{count}} 个节点。',
+ fileEmpty: '文件为空,已在中间预览区打开。',
+ searchUsage: '用法:{{name}} 查询词 [--scope .|viking://resources/...]',
+ searchScopeLine: '搜索范围:{{scope}}',
+ helpParameters: '参数',
+ helpExamples: '示例',
+ helpSubcommands: '子命令',
+ noParameters: '无参数',
+ currentScopeAction: '使用当前目录',
+ readUsage: '用法:/read viking://resources/...',
+ enterUri: '请输入 viking:// URI',
+ hits: '命中 resources {{resources}} 条,memory {{memories}} 条,skill {{skills}} 条。',
+ addResourceBody:
+ '已打开添加资源弹窗。提交后左侧目录会刷新,也可以用 /ls 或 /search 继续定位新内容。',
+ addResourceTitle: '添加资源',
+ sessionUsage:
+ '用法:/session [current|list|create|switch|get|context|messages|archive|commit|extract|message|used|tool-results|tool-result|tool-search|delete] ...',
+ sessionDeleteUsage: '用法:/session delete <session_id>',
+ sessionMissing:
+ '当前没有 active session,请先打开 Agent 面板创建会话,或指定 session_id。',
+ sessionCurrentBody: '当前 active session:{{id}}',
+ sessionListBody: '共有 {{count}} 个 session。',
+ sessionCreatedBody: '已创建并切换到 session:{{id}}',
+ sessionSwitchedBody: '已切换到 session:{{id}}',
+ sessionDeletedBody: '已删除 session:{{id}}',
+ sessionMessageAddedBody: '已向 session {{id}} 添加消息。',
+ unknownCommand:
+ '未知命令。可用命令:/status、/ls、/search、/find、/read、/session、/add-resource。',
+ commandFailed: '命令失败',
+ running: '正在执行命令...',
+ placeholder: '输入 CLI 命令,例如 /status',
+ suggestionsTitle: '命令建议',
+ suggestionsHint: '↑↓ 选择 · Tab 补全 · Enter 执行',
+ quickStart: {
+ title: '快速开始',
+ addResource: {
+ title: '添加资源',
+ command: '/add-resource',
+ code: '导入文档或文件到 viking://resources',
+ },
+ addMemory: {
+ title: '添加记忆',
+ command: 'Agent 对话后自动沉淀',
+ code: '在 Agent 面板发送消息,然后提交会话',
+ },
+ find: {
+ title: '查找相关上下文',
+ command: '/find openviking 价值',
+ code: '在当前范围内搜索资源、记忆和技能',
+ },
+ },
+ commandGroups: {
+ core: '核心命令',
+ filesystem: '文件系统',
+ search: '搜索与摘要',
+ status: '状态',
+ resource: '资源路径',
+ history: '历史记录',
+ },
+ commandParameters: {
+ query: {
+ name: '查询词',
+ description: '要检索的关键词或语义问题。',
+ },
+ scope: {
+ name: '--scope <.|uri>',
+ description:
+ '可选。不填则全局搜索;传 . 使用当前目录;传 uri 使用指定目录。',
+ },
+ sessionAction: {
+ name: '子命令',
+ description:
+ 'current、list、create、switch、get、context、messages、archive、commit、extract、message、used、tool-results、tool-result、tool-search、delete。',
+ },
+ sessionId: {
+ name: 'session_id',
+ description:
+ '可选。省略时多数子命令使用当前 Agent session;delete 必须显式指定。',
+ },
+ archiveId: {
+ name: 'archive_id',
+ description: '读取 archive 时必填。',
+ },
+ messageRole: {
+ name: 'role',
+ description: 'message 子命令使用,支持 user 或 assistant。',
+ },
+ messageContent: {
+ name: 'content',
+ description: 'message 子命令使用,要追加到 session 的文本内容。',
+ },
+ contexts: {
+ name: '--context uri',
+ description: 'used 子命令可重复传入,记录本轮实际使用的上下文。',
+ },
+ skillJson: {
+ name: '--skill-json JSON',
+ description: 'used 子命令使用,记录实际使用的 skill 信息。',
+ },
+ keepRecent: {
+ name: '--keep-recent 数量',
+ description: 'commit 子命令使用,提交后保留最近 N 条 live messages。',
+ },
+ tokenBudget: {
+ name: '--token-budget 数量',
+ description: 'context 子命令使用,限制组装上下文的 token 预算。',
+ },
+ toolName: {
+ name: '--tool-name 名称',
+ description: 'tool-results 子命令使用,按工具名过滤。',
+ },
+ toolResultId: {
+ name: 'tool_result_id',
+ description: '读取或搜索外部化 tool result 时必填。',
+ },
+ limit: {
+ name: '--limit 数量',
+ description: 'tool result 列表、读取或搜索时限制返回数量。',
+ },
+ offset: {
+ name: '--offset 数量',
+ description: 'tool-result 子命令使用,从指定字符偏移开始读取。',
+ },
+ contextChars: {
+ name: '--context-chars 数量',
+ description: 'tool-search 子命令使用,控制命中上下文长度。',
+ },
+ timeout: {
+ name: '--timeout 秒',
+ description: '可选。等待服务就绪的最长时间。',
+ },
+ uri: {
+ name: 'uri',
+ description: '可选或必填的 viking:// 资源路径,取决于命令用法。',
+ },
+ },
+ commandExamples: {
+ status: {
+ default: {
+ code: '/status',
+ description: '检查 Agent 和 API 连通状态',
+ },
+ },
+ ls: {
+ current: {
+ code: '/ls',
+ description: '列出当前目录',
+ },
+ target: {
+ code: '/ls viking://resources/',
+ description: '列出指定目录',
+ },
+ },
+ search: {
+ global: {
+ code: '/search agent',
+ description: '全局语义检索',
+ },
+ current: {
+ code: '/search agent --scope .',
+ description: '使用当前高亮目录',
+ },
+ scoped: {
+ code: '/search agent --scope viking://resources/',
+ description: '只在指定目录检索',
+ },
+ },
+ find: {
+ global: {
+ code: '/find agent',
+ description: '全局查找相关资源',
+ },
+ current: {
+ code: '/find agent --scope .',
+ description: '使用当前高亮目录',
+ },
+ scoped: {
+ code: '/find agent --scope viking://resources/',
+ description: '只在指定目录查找',
+ },
+ },
+ read: {
+ file: {
+ code: '/read viking://resources/file.md',
+ description: '读取并打开文件',
+ },
+ },
+ addResource: {
+ default: {
+ code: '/add-resource',
+ description: '打开添加资源表单',
+ },
+ },
+ session: {
+ current: {
+ code: '/session',
+ description: '查看当前 active session',
+ },
+ list: {
+ code: '/session list',
+ description: '列出所有 session',
+ },
+ create: {
+ code: '/session create [session_id]',
+ description: '创建并切换到新 session',
+ },
+ switch: {
+ code: '/session switch <session_id>',
+ description: '切换 Agent 面板会话',
+ },
+ get: {
+ code: '/session get [session_id]',
+ description: '查看 session 元信息',
+ },
+ context: {
+ code: '/session context [session_id] --token-budget 8000',
+ description: '读取组装后的 session context',
+ },
+ messages: {
+ code: '/session messages [session_id]',
+ description: '读取 session 消息列表',
+ },
+ archive: {
+ code: '/session archive [session_id] <archive_id>',
+ description: '读取指定 archive',
+ },
+ commit: {
+ code: '/session commit [session_id] --keep-recent 10',
+ description: '归档并触发记忆提取',
+ },
+ extract: {
+ code: '/session extract [session_id]',
+ description: '从 session 中提取记忆',
+ },
+ message: {
+ code: '/session message [session_id] user hello',
+ description: '向 session 追加消息',
+ },
+ used: {
+ code: '/session used [session_id] --context viking://resources/...',
+ description: '记录实际使用的上下文或 skill',
+ },
+ toolResults: {
+ code: '/session tool-results [session_id] --limit 20',
+ description: '列出外部化 tool results',
+ },
+ toolResult: {
+ code: '/session tool-result [session_id] <tool_result_id>',
+ description: '读取一个 tool result',
+ },
+ toolSearch: {
+ code: '/session tool-search [session_id] <tool_result_id> query',
+ description: '在 tool result 中搜索',
+ },
+ delete: {
+ code: '/session delete <session_id>',
+ description: '删除指定 session',
+ },
+ },
+ tree: {
+ current: {
+ code: '/tree',
+ description: '展示当前目录树',
+ },
+ target: {
+ code: '/tree viking://resources/',
+ description: '展示指定目录树',
+ },
+ },
+ stat: {
+ target: {
+ code: '/stat viking://resources/file.md',
+ description: '查看资源元信息',
+ },
+ },
+ abstract: {
+ target: {
+ code: '/abstract viking://resources/',
+ description: '读取目录摘要',
+ },
+ },
+ overview: {
+ target: {
+ code: '/overview viking://resources/',
+ description: '读取目录概览',
+ },
+ },
+ health: {
+ default: {
+ code: '/health',
+ description: '查看后端健康状态',
+ },
+ },
+ wait: {
+ default: {
+ code: '/wait',
+ description: '等待服务就绪',
+ },
+ timeout: {
+ code: '/wait --timeout 30',
+ description: '指定等待秒数',
+ },
+ },
+ },
+ resourceSuggestion: '资源路径',
+ historySuggestion: '历史记录',
+ groupLabels: {
+ resources: '资源',
+ memories: '记忆',
+ skills: '技能',
+ },
+ commands: {
+ status: {
+ description: '检查连通状态',
+ usage: '/status',
+ },
+ ls: {
+ description: '查看已有资源',
+ usage: '/ls [viking://resources/...]',
+ },
+ search: {
+ description: '语义检索上下文',
+ usage: '/search 查询词',
+ },
+ find: {
+ description: '查找相关资源',
+ usage: '/find 查询词',
+ },
+ read: {
+ description: '读取资源文件',
+ usage: '/read viking://resources/.../file.md',
+ },
+ addResource: {
+ description: '添加外部资源',
+ usage: '/add-resource',
+ },
+ session: {
+ description: '管理 Agent 会话',
+ usage: '/session 子命令',
+ },
+ tree: {
+ description: '展示目录树',
+ usage: '/tree [viking://resources/...]',
+ },
+ stat: {
+ description: '查看资源元信息',
+ usage: '/stat viking://resources/...',
+ },
+ abstract: {
+ description: '读取目录摘要',
+ usage: '/abstract viking://resources/...',
+ },
+ overview: {
+ description: '读取目录概览',
+ usage: '/overview viking://resources/...',
+ },
+ health: {
+ description: '查看后端健康状态',
+ usage: '/health',
+ },
+ wait: {
+ description: '等待服务就绪',
+ usage: '/wait [--timeout seconds]',
+ },
+ },
+ },
+ },
+} as const
+
+export default activity
diff --git a/web-studio/src/i18n/locales/zh-CN/resources.ts b/web-studio/src/i18n/locales/zh-CN/resources.ts
new file mode 100644
index 000000000..4cf07ae76
--- /dev/null
+++ b/web-studio/src/i18n/locales/zh-CN/resources.ts
@@ -0,0 +1,391 @@
+const resources = {
+ operations: {
+ page: {
+ placeholder: '运维面板能力尚未接入。',
+ },
+ },
+ requestLogs: {
+ accessRequired: {
+ description:
+ '当前连接未获取到 admin/root 权限,无法显示请求日志。请在连接与身份中配置具备 Console Usage/Audit 权限的 API Key。',
+ title: '需要 admin 权限',
+ },
+ clear: '清空',
+ description:
+ '查看当前身份下服务端审计到的 API 请求,包括状态、耗时和请求标识。',
+ disabled: {
+ description: 'Usage/Audit 未初始化,暂无服务端请求日志。',
+ title: '审计日志不可用',
+ },
+ empty: {
+ description: '先开始您的第一次可审计调用吧!',
+ filteredDescription: '调整搜索内容或状态筛选,扩大可见日志范围。',
+ filteredTitle: '没有匹配的请求',
+ title: '当前无日志信息',
+ upload: '上传文件',
+ },
+ error: {
+ description: '无法从服务端加载审计请求日志。',
+ title: '请求失败',
+ },
+ eyebrow: 'Playground 遥测',
+ filters: {
+ all: '所有日志',
+ apiTypePlaceholder: 'API 类型',
+ error: '错误日志',
+ requestIdPlaceholder: '精确 Request ID',
+ statusCodePlaceholder: '状态码',
+ },
+ loading: '正在加载请求日志...',
+ metrics: {
+ successRate: '成功率',
+ total: '总调用次数',
+ },
+ pagination: {
+ next: '下一页',
+ pageSize: '每页条数',
+ pageSizeValue: '每页 {{count}} 条',
+ previous: '上一页',
+ summary: '共 {{total}} 条,第 {{page}} / {{pageCount}} 页',
+ },
+ query: '查询',
+ refresh: '刷新',
+ reset: '重置',
+ searchPlaceholder: '筛选方法、路径或状态码',
+ scope: {
+ currentIdentity: '当前范围:当前 API key 身份',
+ currentIdentityWithName: '当前范围:当前 API key 身份({{identity}})',
+ },
+ status: {
+ error: 'ERR',
+ pending: 'PENDING',
+ success: 'OK',
+ },
+ table: {
+ accountId: 'Account ID',
+ apiType: 'API 类型',
+ duration: '耗时',
+ method: '方法',
+ path: '路径',
+ requestId: 'Request ID',
+ status: '状态',
+ time: '时间',
+ title: '捕获的请求',
+ userId: 'User ID',
+ },
+ title: '请求日志',
+ },
+ addResource: {
+ title: '添加资源',
+ description: '上传本地文件到服务器,文件类型通过 magic bytes 自动检测。',
+ dropzone: {
+ title: '拖拽文件到此处,或点击选择文件',
+ hint: '每次最多上传 10 个文件。',
+ supportedFormats:
+ '支持 PDF、Word、PPTX、Excel、Markdown、代码文件、图片等',
+ },
+ fileInfo: {
+ name: '文件',
+ size: '大小',
+ type: '类型',
+ unknown: '未知类型',
+ remove: '移除',
+ },
+ targetUri: '目标 URI',
+ 'targetUri.placeholder': 'viking://resources/',
+ 'targetUri.hint': '选择资源的存储位置,默认为 viking://resources/。',
+ 'targetUri.browse': '浏览',
+ advancedOptions: '高级选项',
+ upload: '上传文件',
+ 'upload.processing': '文件已上传,正在处理中...',
+ uploading: '上传中…',
+ result: {
+ success: '上传完成!',
+ skippedFiles: '{{count}} 个文件被跳过(不支持的格式)',
+ },
+ cancelUpload: '取消',
+ startProcessing: '开始处理',
+ success: '资源添加成功',
+ fileBlocked: '"{{name}}" 不是支持的文件类型。',
+ fileTooLarge: '"{{name}}" 超过 {{size}} 文件大小限制。',
+ tooManyFiles: '仅保留前 {{count}} 个文件,其余已忽略。',
+ error: '请求失败',
+ dirPicker: {
+ title: '选择目录',
+ select: '选择',
+ cancel: '取消',
+ empty: '空目录',
+ error: '加载目录失败',
+ selected: '已选择:',
+ },
+ mode: {
+ upload: '上传文件',
+ remote: '远程资源',
+ },
+ remoteUrl: '远程资源地址',
+ 'remoteUrl.placeholder': 'https://github.com/org/repo',
+ 'remoteUrl.hint': 'HTTP(S) 链接、Git 仓库地址或其他远程资源地址。',
+ watch: {
+ enabled: '定时同步',
+ hint: '定期检查该远程资源,并导入最新内容。',
+ interval: '同步周期(分钟)',
+ intervalHint: '例如每小时填写 60,每天填写 1440。',
+ },
+ strict: '严格模式',
+ 'strict.hint':
+ '开启时,服务器会拒绝不支持或无法识别类型的文件,而非静默跳过。',
+ directlyUploadMedia: '直接上传媒体文件',
+ 'directlyUploadMedia.hint':
+ '开启时,媒体文件(图片、音频、视频)原样存储。关闭后,媒体文件会先通过 AI 视觉/音频管道提取内容再存储。',
+ createParent: '自动创建父文件夹',
+ 'createParent.hint': '开启时,若目标父目录不存在则自动创建。',
+ reason: '添加原因',
+ 'reason.placeholder': '为什么要添加这个资源?',
+ instruction: '处理指令',
+ 'instruction.placeholder': '针对该资源的特殊处理指令。',
+ directoryScan: {
+ title: '目录扫描选项',
+ ignoreDirs: '忽略目录',
+ 'ignoreDirs.placeholder': 'node_modules, .git, __pycache__',
+ include: '包含模式',
+ 'include.placeholder': '*.py, *.md',
+ exclude: '排除模式',
+ 'exclude.placeholder': '*.log, *.tmp',
+ },
+ },
+ resources: {
+ processingTasks: {
+ title: '文件处理任务',
+ empty: '暂无处理任务',
+ toggleError: '展开或收起错误详情',
+ columns: {
+ fileName: '文件名',
+ status: '状态',
+ size: '大小',
+ },
+ status: {
+ cancelled: '已取消',
+ processing: '处理中',
+ success: '处理成功',
+ failed: '处理失败',
+ },
+ },
+ searchPalette: {
+ ariaLabel: '搜索',
+ openContainingDirectory: '打开所在目录',
+ placeholder: '搜索',
+ scope: {
+ global: '搜索范围: 全局',
+ current: '搜索范围: {{name}}',
+ resetToGlobal: '点击重置为全局搜索',
+ },
+ scopeState: {
+ validatingTitle: '正在校验搜索范围',
+ validatingPrefix: '正在检查',
+ validatingSuffix: '是否存在',
+ switchTitle: '切换搜索范围',
+ switchPrefix: '按',
+ switchMiddle: '切换到',
+ invalidTitle: '搜索范围不存在',
+ invalidPrefix: '路径',
+ invalidSuffix: '无法访问,不能切换',
+ },
+ empty: {
+ title: '搜索文件和目录',
+ },
+ browseDirHint: {
+ before: '输入',
+ after: '浏览目录结构',
+ },
+ globalScopeHint: {
+ before: '输入',
+ after: '切换搜索范围到全局',
+ },
+ error: '搜索出错',
+ emptyResults: {
+ title: '没有找到匹配的文件或目录',
+ subtitle: '试试换个关键词?',
+ },
+ footer: {
+ dirMode: {
+ select: '选择',
+ level: '层级',
+ confirm: '确定',
+ cancel: '取消',
+ },
+ resultMode: {
+ navigate: '导航',
+ open: '打开',
+ close: '关闭',
+ count: '{{count}} 个结果',
+ },
+ },
+ },
+ dirBrowser: {
+ back: '返回上一级',
+ loading: '正在加载目录',
+ filesSection: '文件',
+ error: '加载目录失败',
+ empty: {
+ title: '空目录',
+ subtitle: '这一层目前没有可继续展开的子目录',
+ },
+ },
+ filePreview: {
+ cancel: '取消',
+ edit: '编辑',
+ emptyFile: '(空文件)',
+ emptyPrompt: '选择文件后在这里预览',
+ formattingJson: '正在格式化 JSON...',
+ imageFailed: '图片加载失败。',
+ imageLoading: '正在加载图片...',
+ largeFileSkipped: '文件较大,默认不自动加载。',
+ jsonFormatFailed: 'JSON 格式化失败,已显示原始内容。',
+ loadFile: '仍然加载',
+ loadingContent: '正在读取内容...',
+ loadingEditor: '加载编辑器...',
+ markdownPreview: '预览',
+ markdownSource: '源码',
+ noDirectoryContext: '这个目录暂无摘要或概览。',
+ save: '保存',
+ selectDirectoryContext: '选择一个标签查看目录上下文。',
+ unsupportedBinary: '二进制文件不支持文本预览。',
+ jsonl: {
+ collapse: '收起',
+ dialogMode: '对话',
+ emptyJsonl: '空 JSONL。',
+ emptyMessage: '空消息',
+ expand: '展开',
+ noArguments: '无参数',
+ rawMode: 'JSONL',
+ recordCount: '{{count}} 条记录',
+ toolcall: '工具调用',
+ },
+ },
+ },
+ retrieval: {
+ title: '检索',
+ searchPlaceholder: '输入检索内容',
+ placeholders: {
+ find: '输入语义检索内容',
+ search: '输入需要结合会话理解的问题',
+ grep: '输入正则表达式或精确文本',
+ glob: '输入文件模式,例如 **/*.md',
+ },
+ send: '检索',
+ controls: {
+ function: '检索函数',
+ modes: {
+ find: 'find',
+ search: 'search',
+ grep: 'grep',
+ glob: 'glob',
+ },
+ ignoreCase: '忽略大小写',
+ resultCount: '返回数量',
+ path: '路径',
+ pathPlaceholder: '/',
+ scope: '检索范围',
+ customScope: '自定义范围',
+ customScopePlaceholder: 'resources/project 或 viking://...',
+ effectiveScope: '范围',
+ allContexts: '全部上下文',
+ scopes: {
+ all: {
+ label: '全部上下文',
+ },
+ resources: {
+ label: '资源库',
+ },
+ custom: {
+ label: '自定义 URI',
+ },
+ },
+ sessionId: 'Session ID',
+ sessionPlaceholder: 'session_id(可选)',
+ },
+ advanced: {
+ title: '更多筛选',
+ contextTypes: '上下文类型',
+ levels: '内容层级',
+ scoreThreshold: '最低相关度',
+ tags: '检索标签',
+ tagsPlaceholder: '例如 env=prod, team=search',
+ tagsInvalid: '标签必须使用 key=value 格式,多个标签用逗号分隔',
+ timeRange: '时间范围',
+ since: '开始时间,如 7d',
+ until: '结束时间,如 2026-07-27',
+ anyTime: '不限时间',
+ quickRange: '快捷范围',
+ last24Hours: '近 24 小时',
+ last7Days: '近 7 天',
+ last30Days: '近 30 天',
+ customRange: '自定义日期',
+ startDate: '开始日期',
+ endDate: '结束日期',
+ clearTimeRange: '清除时间范围',
+ timeField: '时间字段',
+ updatedAt: '更新时间',
+ createdAt: '创建时间',
+ provenance: '返回检索过程',
+ reset: '重置筛选',
+ },
+ detail: {
+ score: '相关度',
+ level: '层级',
+ openPlayground: '在 Playground 打开',
+ uri: 'URI',
+ summary: '摘要',
+ noSummary: '暂无可展示的摘要',
+ matchReason: '匹配原因',
+ },
+ results: {
+ title: '检索结果',
+ topN: '检索结果(Top{{count}})',
+ line: '第 {{line}} 行',
+ lineLabel: '行号',
+ score: '相关度',
+ uri: 'URI',
+ description: '描述',
+ provenance: '检索过程({{count}})',
+ },
+ types: {
+ resource: 'Resources',
+ memory: 'Memories',
+ skill: 'Skills',
+ },
+ queryPlan: {
+ title: '查询计划 {{count}} 条',
+ more: '+{{count}} 条',
+ },
+ loading: {
+ vector: '正在检索向量索引...',
+ scan: '扫描知识库层级结构...',
+ match: '匹配语义相关内容...',
+ rerank: '对结果重排序...',
+ },
+ empty: {
+ checking: '正在检查可检索上下文...',
+ readyTitle: '已有可检索上下文',
+ readyDescription: '输入关键词后按 Enter 开始检索',
+ title: '当前还没有可检索的上下文',
+ description: '先上传您的第一份资源吧~',
+ upload: '上传文件',
+ },
+ error: {
+ title: '检索失败',
+ fallback: '请求未能完成,请稍后重试。',
+ network:
+ '请求未能到达 OpenViking 服务,请检查连接地址、服务状态或跨域配置。',
+ code: '错误码',
+ status: 'HTTP 状态',
+ requestId: 'Request ID',
+ },
+ noResults: {
+ title: '没有找到匹配的内容',
+ subtitle: '试试换个关键词或调整路径范围',
+ },
+ },
+} as const
+
+export default resources
diff --git a/web-studio/src/i18n/locales/zh-CN/workspace.ts b/web-studio/src/i18n/locales/zh-CN/workspace.ts
new file mode 100644
index 000000000..fc44d380f
--- /dev/null
+++ b/web-studio/src/i18n/locales/zh-CN/workspace.ts
@@ -0,0 +1,690 @@
+const workspace = {
+ appShell: {
+ footer: {
+ agentIntegrations: 'Agent 接入',
+ connection: '连接设置',
+ docs: '文档站',
+ github: 'GitHub',
+ sdkApi: 'SDK 与 API',
+ users: '用户管理',
+ },
+ header: {
+ currentUser: {
+ account: 'Account',
+ accountSummary: 'Account · {{account}}',
+ openMenu: '查看当前用户 {{user}}',
+ signedInAs: '当前数据访问身份',
+ unset: '未设置',
+ user: 'User',
+ },
+ defaultTitle: 'OpenViking Studio',
+ },
+ navigation: {
+ home: {
+ title: '首页',
+ },
+ crossDeviceVerify: {
+ title: 'OAuth 验证',
+ },
+ operations: {
+ title: '运维',
+ },
+ requestLogs: {
+ title: '请求日志',
+ },
+ monitoring: {
+ title: '监控',
+ },
+ skills: {
+ title: '技能',
+ },
+ tasks: {
+ title: '任务中心',
+ },
+ watches: {
+ title: '定时同步',
+ },
+ retrieval: {
+ title: '检索',
+ },
+ sessions: {
+ title: '会话',
+ },
+ playground: {
+ title: '实验场',
+ },
+ },
+ sidebar: {
+ groups: {
+ operations: '活动',
+ resources: '资源',
+ settings: '设置',
+ workspace: '工作区',
+ },
+ loadingSessions: '加载中...',
+ noSessions: '暂无会话',
+ workspaceGroupLabel: 'OpenViking Studio',
+ },
+ },
+ monitoringPage: {
+ title: '监控',
+ description: '查看 OpenViking 各组件的实时健康状态。',
+ version: 'v{{version}}',
+ refresh: '刷新',
+ updatedAt: '更新于 {{time}}',
+ loading: '正在加载监控数据...',
+ loadFailed: '监控数据加载失败',
+ health: {
+ healthy: '正常',
+ unhealthy: '异常',
+ },
+ summary: {
+ healthy: '所有组件运行正常',
+ unhealthy: '部分组件需要关注',
+ components: '{{healthy}} / {{total}} 个组件正常',
+ },
+ tabs: {
+ label: '监控类型',
+ overview: '总览',
+ queue: '任务队列',
+ vikingdb: 'VectorDB',
+ models: '模型',
+ filesystem: '文件系统',
+ lock: '锁',
+ retrieval: '检索',
+ },
+ detail: {
+ noData: '暂无监控数据',
+ descriptions: {
+ queue: '资源处理、语义生成和会话提交队列。',
+ vikingdb: '向量数据存储与索引服务。',
+ models: 'VLM、Embedding 和 Rerank 模型服务。',
+ filesystem: 'OpenViking 文件系统与挂载点。',
+ lock: '事务锁与并发控制服务。',
+ retrieval: '上下文检索服务。',
+ },
+ },
+ offline: {
+ title: '尚未连接 OpenViking 服务',
+ description: '配置服务地址和访问凭证后即可查看监控数据。',
+ action: '打开连接设置',
+ },
+ },
+ skillsPage: {
+ title: '技能',
+ description: '查看当前用户和当前空间可用的 Agent 技能。',
+ refresh: '刷新',
+ loading: '正在加载技能...',
+ empty: '暂无可用技能',
+ emptyDescription: '添加技能后,会在这里按用户技能和共享技能统一展示。',
+ loadFailed: '技能加载失败',
+ networkError: '无法连接 OpenViking 服务,请检查服务地址和连接状态。',
+ connectionSettings: '打开连接设置',
+ detail: '详情',
+ viewDetail: '查看 {{name}} 详情',
+ detailLoading: '正在加载技能详情...',
+ detailLoadFailed: '技能详情加载失败',
+ directory: '目录',
+ none: '无',
+ metrics: {
+ files: '文件',
+ scope: '作用域',
+ },
+ sections: {
+ allowedTools: '允许工具',
+ content: 'SKILL.md',
+ description: '简介',
+ files: '文件',
+ overview: 'Overview',
+ tags: '标签',
+ },
+ scopes: {
+ user: '用户技能',
+ agent: '共享技能',
+ },
+ },
+ tasksPage: {
+ title: '任务中心',
+ description: '集中查看资源处理、会话提交和 Reindex 等后台任务。',
+ refresh: '刷新',
+ loading: '正在加载任务...',
+ empty: '暂无后台任务',
+ emptyDescription: '异步任务启动后,会在这里显示执行状态和更新时间。',
+ emptyFiltered: '没有匹配的任务',
+ emptyFilteredDescription: '可以调整或清除筛选条件后重新查看。',
+ loadFailed: '任务加载失败',
+ detail: {
+ title: '任务详情',
+ loading: '正在加载任务详情...',
+ loadFailed: '任务详情加载失败',
+ retry: '重试',
+ openLabel: '查看任务 {{taskId}} 的详情',
+ fields: {
+ status: '任务状态',
+ type: '任务类型',
+ stage: '当前阶段',
+ resource: '关联资源',
+ createdAt: '创建时间',
+ updatedAt: '更新时间',
+ },
+ error: '失败原因',
+ result: '执行结果',
+ noResult: '暂无执行结果',
+ noResultDescription: '任务完成后,接口返回的结果会显示在这里。',
+ noResultFailedDescription: '该任务未返回结果,请查看上方失败原因。',
+ noResultCancelledDescription: '该任务已取消,未返回执行结果。',
+ },
+ filters: {
+ label: '筛选',
+ type: '任务类型',
+ status: '任务状态',
+ allTypes: '全部类型',
+ allStatuses: '全部状态',
+ clear: '清除筛选',
+ },
+ pagination: {
+ next: '下一页',
+ page: '第 {{page}} 页',
+ pageSize: '每页条数',
+ pageSizeValue: '每页 {{count}} 条',
+ previous: '上一页',
+ scope: '当前展示最近 {{count}} 条任务(接口最多返回 {{limit}} 条)',
+ },
+ table: {
+ task: '任务',
+ type: '类型',
+ resource: '关联资源',
+ createdAt: '创建时间',
+ status: '状态',
+ },
+ status: {
+ cancelled: '已取消',
+ cancelling: '取消中',
+ completed: '已完成',
+ failed: '失败',
+ pending: '等待中',
+ running: '进行中',
+ unknown: '未知',
+ },
+ types: {
+ session_commit: '会话提交',
+ add_resource: '资源处理',
+ add_skill: '技能导入',
+ connector_import: '连接器导入',
+ admin_reindex: 'Reindex',
+ snapshot_restore_reindex: '快照恢复索引',
+ legacy_migration: '旧数据迁移',
+ legacy_cleanup: '旧数据清理',
+ },
+ },
+ watchesPage: {
+ title: '定时同步',
+ description: '通过 Watch 任务定期检查远程资源更新,并集中管理同步计划。',
+ refresh: '刷新',
+ add: '添加',
+ adding: '添加中...',
+ loading: '正在加载定时同步...',
+ loadFailed: '定时同步加载失败',
+ empty: '暂无定时同步',
+ emptyDescription: '添加远程资源并开启定时同步后,会在这里显示。',
+ never: '尚未同步',
+ cancel: '取消',
+ save: '保存',
+ creation: {
+ title: '正在创建定时同步',
+ description: '资源已提交到后台,列表会自动刷新,请稍候。',
+ },
+ columns: {
+ resource: '资源',
+ source: '来源',
+ status: '状态',
+ interval: '同步周期',
+ lastRun: '上次同步',
+ nextRun: '下次同步',
+ actions: '操作',
+ },
+ status: {
+ active: '已启用',
+ disabled: '已关闭',
+ },
+ actions: {
+ trigger: '立即同步',
+ syncing: '同步中...',
+ disable: '关闭',
+ enable: '启用',
+ more: '更多',
+ history: '处理记录',
+ edit: '编辑',
+ delete: '删除',
+ },
+ interval: {
+ minutes_one: '每分钟',
+ minutes_other: '每 {{count}} 分钟',
+ hours_one: '每小时',
+ hours_other: '每 {{count}} 小时',
+ days_one: '每天',
+ days_other: '每 {{count}} 天',
+ },
+ addDialog: {
+ title: '添加定时同步',
+ description: '添加远程资源,并设置 OpenViking 检查更新的周期。',
+ },
+ editDialog: {
+ title: '编辑定时同步',
+ interval: '同步周期(分钟)',
+ intervalHint: '例如每小时填写 60,每天填写 1440。',
+ reason: '添加原因(可选)',
+ reasonPlaceholder: '为什么要持续同步这个资源?',
+ instruction: '处理指令(可选)',
+ instructionPlaceholder: '针对该资源的特殊处理指令。',
+ },
+ deleteDialog: {
+ title: '删除定时同步?',
+ description: '资源 {{uri}} 会继续保留,但不会再自动同步更新。',
+ },
+ history: {
+ title: '处理记录',
+ description:
+ '按当前资源筛选后台处理任务,其中可能包含首次导入、手动处理和定时同步。',
+ loading: '正在加载处理记录...',
+ loadFailed: '处理记录加载失败',
+ empty: '暂无处理记录',
+ emptyDescription: '该资源暂时没有可查询的后台处理任务。',
+ stage: '处理阶段',
+ },
+ toast: {
+ creating: '正在创建定时同步,请稍候...',
+ created: '定时同步已添加',
+ createTimeout: '暂未查询到新任务,请稍后手动刷新',
+ updated: '定时同步已更新',
+ triggered: '同步任务已调度',
+ deleted: '定时同步已删除',
+ },
+ },
+ accountSwitcher: {
+ create: '新建 Account',
+ dialog: {
+ accountLabel: 'Account',
+ accountPlaceholder: 'team-account',
+ adminLabel: '初始 Admin user',
+ cancel: '取消',
+ description:
+ '创建一个新的空间和首个管理员。创建完成后将自动切换到该空间。',
+ submit: '创建并切换',
+ title: '新建 Account',
+ },
+ empty: '没有匹配的 Account',
+ errors: {
+ loadAccounts: '加载 Account 失败',
+ noCreatedKey: 'Account 已创建,但服务端没有返回可用于切换的数据凭证。',
+ noUsableKey: '该 Account 没有可用于数据访问的明文 User API Key。',
+ noUsers: '该 Account 下没有可用用户。',
+ },
+ loading: '正在加载 Accounts...',
+ manualSwitch: {
+ description:
+ '服务端没有返回 {{account}} 下的明文凭证。请输入该 Account 中任意用户的 User API Key。',
+ hint: 'API Key 只用于校验并切换当前数据身份,不会修改或重新生成服务端凭证。',
+ keyLabel: 'User API Key',
+ keyPlaceholder: '粘贴目标 Account 的 User API Key',
+ manageOnly: '仅管理该 Account',
+ submit: '验证并切换',
+ title: '输入 User API Key',
+ },
+ memberCount: '{{count}} 个用户',
+ searchPlaceholder: '搜索 Account',
+ toast: {
+ created: '已创建并切换到 {{account}}',
+ createdSwitchFailed:
+ '{{account}} 已创建,但数据身份切换失败:{{error}}。仍可进入该 Account 管理用户。',
+ managementSwitched:
+ '管理空间已切换到 {{account}}。访问租户数据前,请先选择或创建 User Key。',
+ switched: '已切换到 {{account}}',
+ },
+ unset: '未选择 Account',
+ },
+ common: {
+ action: {
+ cancel: '取消',
+ saveConnection: '保存连接',
+ showAdvancedIdentityFields: '显示高级身份字段',
+ },
+ errorBoundary: {
+ description:
+ '路由渲染过程中出现未处理异常。可以先重试一次;如果问题持续,查看下方错误信息继续排查。',
+ reload: '刷新页面',
+ retry: '重试',
+ title: '页面发生错误',
+ },
+ language: {
+ current: '当前',
+ label: '语言',
+ },
+ theme: {
+ toggle: '切换主题',
+ },
+ },
+ connection: {
+ devMode: {
+ description:
+ '当前服务会自动提供身份,通常不需要填写 account、user 和 API key。',
+ title: '服务端托管身份',
+ },
+ dialog: {
+ title: '连接与身份',
+ },
+ identitySummary: {
+ dev: '服务端隐式身份',
+ named: '{{identity}}',
+ unset: '未设置身份',
+ },
+ fields: {
+ accountId: {
+ label: 'Account',
+ placeholder: 'default',
+ },
+ apiKey: {
+ label: 'API Key',
+ placeholder: '输入 X-API-Key 或 Bearer token',
+ },
+ adminApiKey: {
+ label: 'Admin API key',
+ placeholder: 'Root 或 account-admin key',
+ },
+ baseUrl: {
+ label: '服务地址',
+ placeholder: 'http://127.0.0.1:1933',
+ },
+ credentials: {
+ title: '身份与凭证',
+ },
+ dataApiKey: {
+ label: 'User API key',
+ },
+ userId: {
+ label: 'User',
+ placeholder: 'default',
+ },
+ },
+ },
+ settings: {
+ actions: {
+ addAccount: '新增 account',
+ addUser: '新增 user',
+ cancel: '取消',
+ changeRole: '修改 {{user}} 的角色',
+ confirmRemoveUser: '删除用户',
+ confirmRoleChange: '确认修改',
+ copy: '复制',
+ currentIdentity: '当前身份',
+ refresh: '刷新',
+ regenerate: '重新生成',
+ removeUser: '删除 {{user}}',
+ save: '保存',
+ switchIdentity: '切换身份',
+ use: '使用',
+ },
+ connection: {
+ accountListLimited:
+ '当前 key 不能列出所有 account;如果它有 account-admin 权限,仍可管理选中的 account。',
+ adminError: '校验 Root API Key 失败:{{message}}',
+ description:
+ '租户数据 API 使用 User API Key;控制 API 可单独使用 Root 或 account-admin key。',
+ devMode: '当前为开发模式 — 身份自动确定,无需 API key。',
+ keyGuide: {
+ control: {
+ primary:
+ '当前 User API Key 已可用于 Playground 和数据访问,普通用户无需配置控制凭证。',
+ secondary:
+ '如需切换 Account 或管理用户,请向部署管理员索取 Root Key,或向当前 Account 管理员索取 Admin Key。Root Key 位于服务端 ov.conf 的 server.root_api_key。',
+ title: '需要管理 Account 或用户?',
+ },
+ data: {
+ primary:
+ 'Root/Admin API Key 主要用于管理操作,Playground 和租户数据访问需要绑定用户身份的 User API Key。',
+ secondary:
+ '请在「用户管理」中选择、创建用户或重新生成 User Key,然后将它用作 User API Key。',
+ title: '还缺少 User API Key',
+ },
+ empty: {
+ primary: '普通用户:请向当前 Account 管理员索取 User API Key。',
+ secondary:
+ '部署管理员:Root API Key 位于服务端 ov.conf 的 server.root_api_key;填入后可在「用户管理」中创建或重新生成 User Key。',
+ title: '还没有 OpenViking API Key?',
+ },
+ learnMore: '查看 API Key 获取方式',
+ trusted: {
+ primary:
+ '当前 Trusted 服务启用了 Root Key 校验,浏览器需要配置同一 Root API Key 才能访问管理和租户数据接口。',
+ secondary:
+ '请向部署管理员索取 Root Key;它位于服务端 ov.conf 的 server.root_api_key。Trusted 模式的数据身份由 Account/User 断言确定,不需要 User API Key。',
+ title: 'Trusted 服务需要 Root API Key',
+ },
+ },
+ rootHint: '用于列出 account / user,以及生成或轮换 key。',
+ title: '连接设置',
+ unsupportedAuthMode: {
+ description:
+ 'Web Studio 不支持 {{mode}} 认证模式。请使用 {{ov}} CLI 或 Python SDK 连接此服务器。',
+ primary: '该服务器配置了 {{mode}} 认证。',
+ title: '不支持的认证模式',
+ },
+ userHint: '供 Playground 和租户数据 API 使用。',
+ },
+ connectionPage: {
+ description: '配置 OpenViking 服务连接、控制面凭证和当前数据访问凭证。',
+ title: '连接设置',
+ },
+ dialogs: {
+ addAccount: {
+ description:
+ '创建一个工作区 account 和第一个 admin user。新 key 只会在创建后展示一次。',
+ title: '新增 account',
+ },
+ addUser: {
+ currentAccountDescription:
+ '在 {{accountId}} 空间下创建用户。生成的 key 只会在创建后展示一次。',
+ description:
+ '在已有 account 下注册 user。生成的 key 只会在创建后展示一次。',
+ title: '新增 user',
+ },
+ changeRole: {
+ description:
+ '将 {{account}} / {{user}} 的角色修改为 {{role}}。新的权限会立即生效。',
+ title: '修改用户角色?',
+ },
+ regenerate: {
+ description:
+ '要重新生成 {{account}} / {{user}} 的 API key 吗?当前 key 会立即失效。',
+ title: '重新生成 API key?',
+ },
+ removeUser: {
+ description:
+ '确定从 {{account}} 空间移除 {{user}} 吗?该用户的 API Key 会立即失效,此操作不可撤销。',
+ title: '删除用户?',
+ },
+ },
+ empty: {
+ adminDescription:
+ '使用 root 或 account admin API key 后,可以列出用户、复制 key、新增身份或轮换凭证。',
+ adminTitle: '需要 admin 权限',
+ usersDescription: '创建一个 user 来生成第一个 API key。',
+ usersTitle: '选中的 accounts 下没有 user',
+ },
+ fields: {
+ account: 'Account',
+ adminUser: 'Admin user',
+ adminApiKey: 'Admin API key',
+ apiKey: 'API key',
+ baseUrl: '服务地址',
+ dataApiKey: 'User API key',
+ rootApiKey: 'Root or Admin API Key',
+ userApiKey: 'User API Key',
+ role: '角色',
+ user: 'User',
+ },
+ health: {
+ admin: '控制面权限',
+ data: '数据访问',
+ state: {
+ checking: '检查中',
+ error: '异常',
+ ok: '正常',
+ skipped: '未检查',
+ },
+ },
+ keyResult: {
+ description:
+ '请现在复制保存。离开当前状态后,OpenViking 可能只展示前缀。',
+ dismiss: '收起',
+ title: '新的 API key',
+ },
+ loading: '正在加载身份...',
+ management: {
+ accountFilter: 'Accounts',
+ accessDeniedDescription:
+ '只有配置并通过校验的 Root 或 Account Admin API Key 才能管理用户。',
+ accessDeniedTitle: '无用户管理权限',
+ currentAccountDescription: '管理 {{account}} 空间下的用户和访问凭证。',
+ description:
+ '查看选中 accounts 下的 users 和凭证,并在网页端新增 user 或轮换 key。',
+ memberListDescription:
+ '“切换身份”会将该用户设为 Playground、检索等数据页面的访问身份,不会改变当前 Root/Admin 管理凭证。',
+ memberListDescriptionRoot:
+ '可直接修改成员角色;“切换身份”只会改变 Playground、检索等数据页面的访问身份,不会改变当前 Root 管理凭证。',
+ memberListTitle: '空间成员',
+ cannotRemoveCurrentIdentity: '不能删除当前正在使用的身份。',
+ cannotRemoveLastManager: '不能删除空间内最后一个管理员。',
+ noUsableKey: '该用户没有可用于数据访问的明文 API Key。',
+ openConnection: '打开连接设置',
+ title: '用户管理',
+ },
+ page: {
+ adminDescription:
+ '配置当前 OpenViking Studio 身份,并管理账号、用户和 API key。',
+ description:
+ '配置当前 OpenViking Studio 的服务地址和 API key,查看当前身份下的数据。',
+ title: '连接与身份',
+ },
+ placeholders: {
+ account: 'team-account',
+ adminApiKey: 'Root 或 account-admin key',
+ apiKey: '输入 X-API-Key 或 Bearer token',
+ baseUrl: 'http://127.0.0.1:1933',
+ devModeApiKey: '[dev mode,无需 API key]',
+ userApiKey: 'User API key',
+ user: 'default',
+ },
+ roles: {
+ admin: 'Admin',
+ root: 'Root',
+ user: 'User',
+ },
+ serverMode: {
+ api_key: 'API key 模式',
+ checking: '检查中...',
+ dev: '开发模式',
+ ldap: 'LDAP 模式',
+ offline: '离线',
+ oidc: 'OIDC 模式',
+ trusted: 'Trusted 模式',
+ },
+ stats: {
+ accounts: 'Accounts 总数',
+ apiKeys: '可见 API keys',
+ users: 'Users',
+ },
+ table: {
+ account: 'Account',
+ actions: '操作',
+ apiKey: 'API key',
+ role: '角色',
+ user: 'User',
+ },
+ toast: {
+ accountCreated: 'Account 已创建',
+ connectionSaved: '连接已保存',
+ copyFailed: '复制失败',
+ copied: '已复制',
+ dataKeySelected: '已切换数据访问身份',
+ keyRegenerated: 'API key 已重新生成',
+ roleUpdated: '{{user}} 的角色已修改为 {{role}}',
+ userCreated: 'User 已创建',
+ userRemoved: '{{user}} 已删除',
+ },
+ },
+ home: {
+ contextCommits: {
+ description:
+ '按 4 小时聚合资源、技能、会话消息和提交写入,鼠标悬停可查看明细。',
+ empty: '过去一年暂无上下文提交',
+ hourRange: '{{start}}-{{end}}',
+ legend: {
+ high: '高',
+ intense: '密集',
+ low: '低',
+ medium: '中',
+ more: '多',
+ none: '少',
+ title: '提交强度',
+ },
+ operations: {
+ addResource: '资源写入',
+ addSkill: '技能写入',
+ sessionAddMessage: '会话消息',
+ sessionCommit: '会话提交',
+ },
+ stats: {
+ activeDays: '活跃天数',
+ peakDay: '峰值单日',
+ recentDay: '最近提交',
+ },
+ title: '上下文提交统计',
+ yearlyEmpty: '暂无上下文提交',
+ yearlyTotal: '{{count}} 次上下文提交',
+ tooltip: {
+ total: '总提交',
+ },
+ },
+ contextData: {
+ description: '包含文件、技能与用户记忆,用于衡量当前上下文资源规模。',
+ files: '文件',
+ memories: '记忆',
+ skills: '技能',
+ title: '上下文数据量',
+ },
+ page: {
+ description:
+ '按产品需求对齐首页内容:菜单入口、上下文数据量、今日 tokens、今日检索、Agent 访问、tokens 趋势和上下文提交统计。',
+ eyebrow: 'OpenViking Studio',
+ settings: '连接与设置',
+ title: 'Overview',
+ },
+ requestFailed: '请求失败',
+ todayRetrievals: {
+ description:
+ '展示用户或 Agent 今日使用语义检索 find() 和 search() 的成功调用次数,每天零点刷新。',
+ find: 'find',
+ search: 'search',
+ title: '今日检索次数',
+ },
+ todayTokens: {
+ description: '展示今日实时 token 消耗,每天零点刷新。',
+ embeddingInput: 'Embedding input tokens',
+ title: '今日 Tokens 消耗',
+ vlmInput: 'VLM input tokens',
+ vlmOutput: 'VLM output tokens',
+ },
+ tokenTrend: {
+ description:
+ '展示最近 14 天每日 token 消耗,包含 VLM 输入、VLM 输出和 Embedding 输入。',
+ empty: '最近 14 天暂无 token 消耗',
+ title: 'tokens 总消耗统计',
+ },
+ usageDisabled: 'Usage/Audit 未初始化,暂无实时统计。',
+ usageAccessRequired:
+ '当前连接未获取到 admin/root 权限,无法显示 Usage/Audit 数据。请在连接与身份中配置具备 Console Usage/Audit 权限的 API Key。',
+ },
+} as const
+
+export default workspace
diff --git a/web-studio/src/lib/watch-interval.ts b/web-studio/src/lib/watch-interval.ts
new file mode 100644
index 000000000..7bb1f5a2e
--- /dev/null
+++ b/web-studio/src/lib/watch-interval.ts
@@ -0,0 +1,4 @@
+export function parsePositiveMinutes(value: number | string): number | null {
+ const minutes = Number(value)
+ return Number.isFinite(minutes) && minutes > 0 ? minutes : null
+}
diff --git a/web-studio/src/routeTree.gen.ts b/web-studio/src/routeTree.gen.ts
index d9e68fc49..d883864d5 100644
--- a/web-studio/src/routeTree.gen.ts
+++ b/web-studio/src/routeTree.gen.ts
@@ -9,6 +9,7 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
+import { Route as WatchesRouteRouteImport } from './routes/watches/route'
import { Route as UsersRouteRouteImport } from './routes/users/route'
import { Route as TasksRouteRouteImport } from './routes/tasks/route'
import { Route as SkillsRouteRouteImport } from './routes/skills/route'
@@ -24,6 +25,11 @@ import { Route as SessionsIndexRouteImport } from './routes/sessions/index'
import { Route as OauthVerifyRouteImport } from './routes/oauth/verify'
import { Route as OauthConsentRouteImport } from './routes/oauth/consent'
+const WatchesRouteRoute = WatchesRouteRouteImport.update({
+ id: '/watches',
+ path: '/watches',
+ getParentRoute: () => rootRouteImport,
+} as any)
const UsersRouteRoute = UsersRouteRouteImport.update({
id: '/users',
path: '/users',
@@ -107,6 +113,7 @@ export interface FileRoutesByFullPath {
'/skills': typeof SkillsRouteRoute
'/tasks': typeof TasksRouteRoute
'/users': typeof UsersRouteRoute
+ '/watches': typeof WatchesRouteRoute
'/oauth/consent': typeof OauthConsentRoute
'/oauth/verify': typeof OauthVerifyRoute
'/sessions/': typeof SessionsIndexRoute
@@ -122,6 +129,7 @@ export interface FileRoutesByTo {
'/skills': typeof SkillsRouteRoute
'/tasks': typeof TasksRouteRoute
'/users': typeof UsersRouteRoute
+ '/watches': typeof WatchesRouteRoute
'/oauth/consent': typeof OauthConsentRoute
'/oauth/verify': typeof OauthVerifyRoute
'/sessions': typeof SessionsIndexRoute
@@ -139,6 +147,7 @@ export interface FileRoutesById {
'/skills': typeof SkillsRouteRoute
'/tasks': typeof TasksRouteRoute
'/users': typeof UsersRouteRoute
+ '/watches': typeof WatchesRouteRoute
'/oauth/consent': typeof OauthConsentRoute
'/oauth/verify': typeof OauthVerifyRoute
'/sessions/': typeof SessionsIndexRoute
@@ -157,6 +166,7 @@ export interface FileRouteTypes {
| '/skills'
| '/tasks'
| '/users'
+ | '/watches'
| '/oauth/consent'
| '/oauth/verify'
| '/sessions/'
@@ -172,6 +182,7 @@ export interface FileRouteTypes {
| '/skills'
| '/tasks'
| '/users'
+ | '/watches'
| '/oauth/consent'
| '/oauth/verify'
| '/sessions'
@@ -188,6 +199,7 @@ export interface FileRouteTypes {
| '/skills'
| '/tasks'
| '/users'
+ | '/watches'
| '/oauth/consent'
| '/oauth/verify'
| '/sessions/'
@@ -205,12 +217,20 @@ export interface RootRouteChildren {
SkillsRouteRoute: typeof SkillsRouteRoute
TasksRouteRoute: typeof TasksRouteRoute
UsersRouteRoute: typeof UsersRouteRoute
+ WatchesRouteRoute: typeof WatchesRouteRoute
OauthConsentRoute: typeof OauthConsentRoute
OauthVerifyRoute: typeof OauthVerifyRoute
}
declare module '@tanstack/react-router' {
interface FileRoutesByPath {
+ '/watches': {
+ id: '/watches'
+ path: '/watches'
+ fullPath: '/watches'
+ preLoaderRoute: typeof WatchesRouteRouteImport
+ parentRoute: typeof rootRouteImport
+ }
'/users': {
id: '/users'
path: '/users'
@@ -336,6 +356,7 @@ const rootRouteChildren: RootRouteChildren = {
SkillsRouteRoute: SkillsRouteRoute,
TasksRouteRoute: TasksRouteRoute,
UsersRouteRoute: UsersRouteRoute,
+ WatchesRouteRoute: WatchesRouteRoute,
OauthConsentRoute: OauthConsentRoute,
OauthVerifyRoute: OauthVerifyRoute,
}
diff --git a/web-studio/src/routes/resources/-components/add-resource-page.test.tsx b/web-studio/src/routes/resources/-components/add-resource-page.test.tsx
new file mode 100644
index 000000000..4d209de6f
--- /dev/null
+++ b/web-studio/src/routes/resources/-components/add-resource-page.test.tsx
@@ -0,0 +1,68 @@
+// @vitest-environment jsdom
+
+import { cleanup, fireEvent, render, screen } from '@testing-library/react'
+import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
+import { afterEach, describe, expect, it, vi } from 'vitest'
+
+import { AddResourceForm } from './add-resource-page'
+
+const uploadMocks = vi.hoisted(() => ({
+ enqueueUploads: vi.fn(),
+ resetRemote: vi.fn(),
+ startRemote: vi.fn(),
+}))
+
+vi.mock('react-i18next', () => ({
+ useTranslation: () => ({ t: (key: string) => key }),
+}))
+
+vi.mock('../-hooks/use-resource-upload', () => ({
+ useResourceUpload: () => ({
+ ...uploadMocks,
+ remoteState: {
+ error: null,
+ phase: 'idle',
+ remoteUrl: '',
+ skippedFiles: [],
+ taskId: null,
+ },
+ }),
+}))
+
+afterEach(() => {
+ cleanup()
+ vi.clearAllMocks()
+})
+
+describe('AddResourceForm watch options', () => {
+ it('submits watch_interval for a watched remote resource', () => {
+ const queryClient = new QueryClient({
+ defaultOptions: { queries: { retry: false } },
+ })
+ render(
+ <QueryClientProvider client={queryClient}>
+ <AddResourceForm initialMode="remote" initialWatchEnabled />
+ </QueryClientProvider>,
+ )
+
+ fireEvent.change(screen.getByRole('textbox', { name: 'remoteUrl' }), {
+ target: { value: 'https://github.com/volcengine/OpenViking' },
+ })
+ fireEvent.change(
+ screen.getByRole('spinbutton', { name: 'watch.interval' }),
+ { target: { value: '60' } },
+ )
+ fireEvent.click(screen.getByRole('button', { name: 'startProcessing' }))
+
+ expect(uploadMocks.startRemote).toHaveBeenCalledWith({
+ commonBody: expect.objectContaining({
+ parent: 'viking://resources/',
+ watch_interval: 60,
+ }),
+ onAccepted: undefined,
+ onCompleted: undefined,
+ onFailed: undefined,
+ url: 'https://github.com/volcengine/OpenViking',
+ })
+ })
+})
diff --git a/web-studio/src/routes/resources/-components/add-resource-page.tsx b/web-studio/src/routes/resources/-components/add-resource-page.tsx
index 382de0777..f60453207 100644
--- a/web-studio/src/routes/resources/-components/add-resource-page.tsx
+++ b/web-studio/src/routes/resources/-components/add-resource-page.tsx
@@ -24,6 +24,7 @@ import {
} from '#/components/ui/collapsible'
import { Input } from '#/components/ui/input'
import { Label } from '#/components/ui/label'
+import { Switch } from '#/components/ui/switch'
import { Textarea } from '#/components/ui/textarea'
import {
Tooltip,
@@ -31,7 +32,9 @@ import {
TooltipTrigger,
} from '#/components/ui/tooltip'
import { cn } from '#/lib/utils'
+import { parsePositiveMinutes } from '#/lib/watch-interval'
import { useResourceUpload } from '../-hooks/use-resource-upload'
+import type { RemoteStartResult } from '../-hooks/use-resource-upload'
import {
MAX_UPLOAD_FILES,
MAX_UPLOAD_FILE_SIZE_BYTES,
@@ -68,13 +71,25 @@ async function detectFileType(file: File): Promise<string | null> {
}
export function AddResourceForm({
+ initialMode = 'upload',
+ initialWatchEnabled = false,
+ onAccepted,
+ onCompleted,
+ onFailed,
onSubmitted,
-}: { onSubmitted?: () => void } = {}) {
+}: {
+ initialMode?: Mode
+ initialWatchEnabled?: boolean
+ onAccepted?: (result: RemoteStartResult) => void
+ onCompleted?: () => void
+ onFailed?: () => void
+ onSubmitted?: () => void
+} = {}) {
const { t } = useTranslation('addResource')
const { enqueueUploads, startRemote, resetRemote, remoteState } =
useResourceUpload()
- const [mode, setMode] = useState<Mode>('upload')
+ const [mode, setMode] = useState<Mode>(initialMode)
const [remoteUrl, setRemoteUrl] = useState('')
const [selectedFiles, setSelectedFiles] = useState<SelectedUploadFile[]>([])
const [targetUri, setTargetUri] = useState('viking://resources/')
@@ -86,6 +101,8 @@ export function AddResourceForm({
const [ignoreDirs, setIgnoreDirs] = useState('')
const [include, setInclude] = useState('')
const [exclude, setExclude] = useState('')
+ const [watchEnabled, setWatchEnabled] = useState(initialWatchEnabled)
+ const [watchInterval, setWatchInterval] = useState('1440')
const [advancedOpen, setAdvancedOpen] = useState(false)
const [dirPickerOpen, setDirPickerOpen] = useState(false)
@@ -178,6 +195,10 @@ export function AddResourceForm({
body.instruction = instruction.trim()
}
if (mode === 'remote') {
+ if (watchEnabled) {
+ const minutes = parsePositiveMinutes(watchInterval)
+ if (minutes !== null) body.watch_interval = minutes
+ }
if (ignoreDirs.trim()) {
body.ignore_dirs = ignoreDirs.trim()
}
@@ -205,7 +226,13 @@ export function AddResourceForm({
const url = remoteUrl.trim()
if (!url) return
- startRemote({ url, commonBody: buildCommonBody() })
+ startRemote({
+ url,
+ commonBody: buildCommonBody(),
+ onAccepted,
+ onCompleted,
+ onFailed,
+ })
onSubmitted?.()
}
@@ -213,11 +240,17 @@ export function AddResourceForm({
resetRemote()
setSelectedFiles([])
setRemoteUrl('')
- setMode('upload')
+ setMode(initialMode)
+ setWatchEnabled(initialWatchEnabled)
+ setWatchInterval('1440')
}
+ const hasValidWatchInterval =
+ !watchEnabled || parsePositiveMinutes(watchInterval) !== null
const canSubmit =
- activeMode === 'upload' ? selectedFiles.length > 0 : !!remoteUrl.trim()
+ activeMode === 'upload'
+ ? selectedFiles.length > 0
+ : !!remoteUrl.trim() && hasValidWatchInterval
return (
<div className="flex flex-col gap-6">
@@ -306,18 +339,58 @@ export function AddResourceForm({
) : null}
</div>
) : (
- <div className="space-y-2">
- <Label htmlFor="add-resource-remote-url">{t('remoteUrl')}</Label>
- <Input
- id="add-resource-remote-url"
- placeholder={t('remoteUrl.placeholder')}
- value={displayRemoteUrl}
- onChange={(e) => handleRemoteUrlChange(e.target.value)}
- disabled={remotePhase === 'processing'}
- />
- <p className="text-xs text-muted-foreground">
- {t('remoteUrl.hint')}
- </p>
+ <div className="space-y-4">
+ <div className="space-y-2">
+ <Label htmlFor="add-resource-remote-url">{t('remoteUrl')}</Label>
+ <Input
+ id="add-resource-remote-url"
+ placeholder={t('remoteUrl.placeholder')}
+ value={displayRemoteUrl}
+ onChange={(e) => handleRemoteUrlChange(e.target.value)}
+ disabled={remotePhase === 'processing'}
+ />
+ <p className="text-xs text-muted-foreground">
+ {t('remoteUrl.hint')}
+ </p>
+ </div>
+
+ <div className="rounded-lg border border-border/60 bg-muted/10 p-4">
+ <div className="flex items-start justify-between gap-4">
+ <div className="grid gap-1">
+ <Label htmlFor="add-resource-watch-enabled">
+ {t('watch.enabled')}
+ </Label>
+ <p className="text-xs leading-5 text-muted-foreground">
+ {t('watch.hint')}
+ </p>
+ </div>
+ <Switch
+ id="add-resource-watch-enabled"
+ checked={watchEnabled}
+ disabled={remotePhase === 'processing'}
+ onCheckedChange={setWatchEnabled}
+ />
+ </div>
+ {watchEnabled ? (
+ <div className="mt-4 grid gap-2 border-t border-border/50 pt-4">
+ <Label htmlFor="add-resource-watch-interval">
+ {t('watch.interval')}
+ </Label>
+ <Input
+ id="add-resource-watch-interval"
+ type="number"
+ min="1"
+ step="1"
+ value={watchInterval}
+ disabled={remotePhase === 'processing'}
+ onChange={(event) => setWatchInterval(event.target.value)}
+ />
+ <p className="text-xs text-muted-foreground">
+ {t('watch.intervalHint')}
+ </p>
+ </div>
+ ) : null}
+ </div>
</div>
)}
@@ -426,9 +499,7 @@ export function AddResourceForm({
<Info className="size-3.5 text-muted-foreground" />
}
/>
- <TooltipContent>
- {t('createParent.hint')}
- </TooltipContent>
+ <TooltipContent>{t('createParent.hint')}</TooltipContent>
</Tooltip>
</Label>
<Label className="flex items-center gap-2">
diff --git a/web-studio/src/routes/resources/-hooks/use-resource-upload.test.tsx b/web-studio/src/routes/resources/-hooks/use-resource-upload.test.tsx
new file mode 100644
index 000000000..6efaa52a2
--- /dev/null
+++ b/web-studio/src/routes/resources/-hooks/use-resource-upload.test.tsx
@@ -0,0 +1,153 @@
+// @vitest-environment jsdom
+
+import {
+ cleanup,
+ fireEvent,
+ render,
+ screen,
+ waitFor,
+} from '@testing-library/react'
+import { afterEach, describe, expect, it, vi } from 'vitest'
+
+import {
+ ResourceUploadProvider,
+ useResourceUpload,
+} from './use-resource-upload'
+
+const apiMocks = vi.hoisted(() => ({
+ getTasks: vi.fn(),
+ postResources: vi.fn(),
+}))
+
+vi.mock('#/lib/ov-client', () => ({
+ getOvResult: async (value: unknown) => value,
+ getTasks: apiMocks.getTasks,
+ isOvClientError: () => false,
+ postResources: apiMocks.postResources,
+ postResourcesTempUpload: vi.fn(),
+}))
+
+vi.mock('sonner', () => ({
+ toast: { error: vi.fn(), success: vi.fn() },
+}))
+
+afterEach(() => {
+ cleanup()
+ vi.clearAllMocks()
+})
+
+function UploadHarness({
+ onAccepted,
+ onCompleted,
+ onFailed,
+}: {
+ onAccepted: (result: {
+ rootUri: string | null
+ taskId: string | null
+ }) => void
+ onCompleted: () => void
+ onFailed?: () => void
+}) {
+ const { refreshTasks, startRemote } = useResourceUpload()
+
+ return (
+ <>
+ <button
+ type="button"
+ data-testid="start"
+ onClick={() =>
+ startRemote({
+ commonBody: { watch_interval: 60 },
+ onAccepted,
+ onCompleted,
+ onFailed,
+ url: 'https://github.com/volcengine/OpenViking',
+ })
+ }
+ />
+ <button
+ type="button"
+ data-testid="refresh"
+ onClick={() => void refreshTasks()}
+ />
+ </>
+ )
+}
+
+describe('ResourceUploadProvider remote completion', () => {
+ it('notifies after submission and again after the background task completes', async () => {
+ let taskStatus = 'processing'
+ apiMocks.getTasks.mockImplementation(() => [
+ {
+ created_at: 1,
+ result: { root_uri: 'viking://resources/OpenViking' },
+ status: taskStatus,
+ task_id: 'resource-task',
+ task_type: 'add_resource',
+ updated_at: 1,
+ },
+ ])
+ apiMocks.postResources.mockResolvedValue({
+ root_uri: 'viking://resources/OpenViking',
+ status: 'success',
+ task_id: 'resource-task',
+ })
+ const onAccepted = vi.fn()
+ const onCompleted = vi.fn()
+
+ render(
+ <ResourceUploadProvider>
+ <UploadHarness onAccepted={onAccepted} onCompleted={onCompleted} />
+ </ResourceUploadProvider>,
+ )
+
+ fireEvent.click(screen.getByTestId('start'))
+ await waitFor(() => expect(apiMocks.postResources).toHaveBeenCalledOnce())
+ await waitFor(() =>
+ expect(apiMocks.getTasks.mock.calls.length).toBeGreaterThan(1),
+ )
+ expect(onAccepted).toHaveBeenCalledWith({
+ rootUri: 'viking://resources/OpenViking',
+ taskId: 'resource-task',
+ })
+ expect(onCompleted).not.toHaveBeenCalled()
+
+ taskStatus = 'completed'
+ fireEvent.click(screen.getByTestId('refresh'))
+
+ await waitFor(() => expect(onCompleted).toHaveBeenCalledOnce())
+ })
+
+ it('notifies when the background task fails', async () => {
+ apiMocks.getTasks.mockResolvedValue([
+ {
+ created_at: 1,
+ error: 'Processing failed',
+ status: 'failed',
+ task_id: 'resource-task',
+ task_type: 'add_resource',
+ updated_at: 2,
+ },
+ ])
+ apiMocks.postResources.mockResolvedValue({
+ root_uri: 'viking://resources/OpenViking',
+ status: 'success',
+ task_id: 'resource-task',
+ })
+ const onFailed = vi.fn()
+
+ render(
+ <ResourceUploadProvider>
+ <UploadHarness
+ onAccepted={vi.fn()}
+ onCompleted={vi.fn()}
+ onFailed={onFailed}
+ />
+ </ResourceUploadProvider>,
+ )
+
+ fireEvent.click(screen.getByTestId('start'))
+
+ await waitFor(() => expect(onFailed).toHaveBeenCalledOnce())
+ })
+})
diff --git a/web-studio/src/routes/resources/-hooks/use-resource-upload.tsx b/web-studio/src/routes/resources/-hooks/use-resource-upload.tsx
index b89fc1561..6c515555c 100644
--- a/web-studio/src/routes/resources/-hooks/use-resource-upload.tsx
+++ b/web-studio/src/routes/resources/-hooks/use-resource-upload.tsx
@@ -9,11 +9,16 @@ import {
postResourcesTempUpload,
} from '#/lib/ov-client'
import { parseUploadError } from '../-lib/upload'
+import {
+ isUploadStatusActive,
+ mergeServerTasks,
+ normalizeTaskList,
+} from '../-lib/resource-upload-tasks'
import type {
AddResourceResult,
TempUploadResult,
} from '@ov-server/api/v1/resources'
-import type { TaskListResult, TaskRecord } from '@ov-server/api/v1/tasks'
+import type { TaskListResult } from '@ov-server/api/v1/tasks'
export type ResourceUploadTaskStatus =
| 'cancelled'
@@ -59,9 +64,17 @@ export type UploadBatchParams = {
commonBody: Record<string, unknown>
}
+export type RemoteStartResult = {
+ rootUri: string | null
+ taskId: string | null
+}
+
export type RemoteStartParams = {
url: string
commonBody: Record<string, unknown>
+ onAccepted?: (result: RemoteStartResult) => void
+ onCompleted?: () => void
+ onFailed?: () => void
}
type ResourceUploadContextValue = {
@@ -142,158 +155,6 @@ function createRemoteTaskName(url: string): string {
}
}
-function isTaskRecord(value: unknown): value is TaskRecord {
- return (
- isRecord(value) &&
- typeof value.task_id === 'string' &&
- typeof value.task_type === 'string' &&
- typeof value.status === 'string'
- )
-}
-
-function normalizeTaskList(value: unknown): TaskListResult {
- return Array.isArray(value) ? value.filter(isTaskRecord) : []
-}
-
-function isUploadStatusActive(status: ResourceUploadTaskStatus): boolean {
- return (
- status === 'pending' || status === 'uploading' || status === 'processing'
- )
-}
-
-function toEpochMillis(value: unknown, fallback: number): number {
- if (typeof value !== 'number' || !Number.isFinite(value)) {
- return fallback
- }
- return value > 10_000_000_000 ? Math.round(value) : Math.round(value * 1000)
-}
-
-function getResultString(record: TaskRecord, key: string): string | null {
- const value = record.result?.[key]
- return typeof value === 'string' && value.trim() ? value : null
-}
-
-function getTaskRootUri(record: TaskRecord): string | null {
- if (typeof record.resource_id === 'string' && record.resource_id.trim()) {
- return record.resource_id
- }
- return getResultString(record, 'root_uri')
-}
-
-function getNameFromUri(uri: string): string {
- const normalized = uri.replace(/\/+$/, '')
- const parts = normalized.split('/').filter(Boolean)
- return parts[parts.length - 1] || uri
-}
-
-function getServerTaskName(record: TaskRecord): string {
- const sourceName = getResultString(record, 'source_name')
- if (sourceName) {
- return sourceName
- }
-
- const rootUri = getTaskRootUri(record)
- if (rootUri) {
- return getNameFromUri(rootUri)
- }
-
- return record.task_id
-}
-
-function toUploadStatus(
- status: TaskRecord['status'],
-): ResourceUploadTaskStatus {
- if (status === 'completed') {
- return 'success'
- }
- if (status === 'failed') {
- return 'failed'
- }
- if (status === 'cancelled') {
- return 'cancelled'
- }
- return 'processing'
-}
-
-function mergeServerTask(
- record: TaskRecord,
- existing?: ResourceUploadTask,
-): ResourceUploadTask {
- const status = toUploadStatus(record.status)
- const rootUri = getTaskRootUri(record) ?? existing?.rootUri ?? null
- const createdAt =
- existing?.createdAt ?? toEpochMillis(record.created_at, Date.now())
- const updatedAt = toEpochMillis(record.updated_at, Date.now())
- const fileName =
- existing && existing.source !== 'server'
- ? existing.fileName
- : getServerTaskName(record)
- const isFinished =
- status === 'success' || status === 'failed' || status === 'cancelled'
-
- return {
- id: existing?.id ?? `server-${record.task_id}`,
- source: existing?.source ?? 'server',
- serverTaskId: record.task_id,
- fileName,
- fileSize: existing?.fileSize ?? null,
- fileType: existing?.fileType ?? null,
- status,
- progress: status === 'success' ? 100 : null,
- createdAt,
- finishedAt: isFinished ? (existing?.finishedAt ?? updatedAt) : null,
- errorCode:
- status === 'failed'
- ? (existing?.errorCode ?? 'SERVER_TASK_FAILED')
- : null,
- errorMessage:
- status === 'failed'
- ? record.error || existing?.errorMessage || 'Processing failed'
- : status === 'cancelled'
- ? record.error || 'Processing cancelled'
- : null,
- rootUri,
- }
-}
-
-function mergeServerTasks(
- previous: ResourceUploadTask[],
- serverTasks: TaskRecord[],
-): ResourceUploadTask[] {
- const previousByServerId = new Map<string, ResourceUploadTask>()
- for (const task of previous) {
- if (task.serverTaskId) {
- previousByServerId.set(task.serverTaskId, task)
- }
- }
-
- const serverTaskIds = new Set(serverTasks.map((task) => task.task_id))
- const consumedLocalIds = new Set<string>()
- const nextTasks = serverTasks.map((record) => {
- const existing = previousByServerId.get(record.task_id)
- if (existing) {
- consumedLocalIds.add(existing.id)
- }
- return mergeServerTask(record, existing)
- })
-
- for (const task of previous) {
- if (consumedLocalIds.has(task.id)) {
- continue
- }
- if (
- task.source === 'server' &&
- task.serverTaskId &&
- !serverTaskIds.has(task.serverTaskId)
- ) {
- continue
- }
- nextTasks.push(task)
- }
-
- return nextTasks
-}
-
export function useResourceUpload(): ResourceUploadContextValue {
const context = React.useContext(ResourceUploadContext)
if (!context) {
@@ -316,6 +177,9 @@ export function ResourceUploadProvider({
const remoteAbortRef = React.useRef<AbortController | null>(null)
const refreshInFlightRef = React.useRef(false)
const notifiedServerTaskIdsRef = React.useRef<Set<string>>(new Set())
+ const remoteCompletionCallbacksRef = React.useRef(
+ new Map<string, { onCompleted?: () => void; onFailed?: () => void }>(),
+ )
const uploadQueueRef = React.useRef<Promise<void>>(Promise.resolve())
const updateTask = React.useCallback(
@@ -563,7 +427,15 @@ export function ResourceUploadProvider({
? result.task_id
: null
+ params.onAccepted?.({ rootUri, taskId: serverTaskId })
+
if (serverTaskId) {
+ if (params.onCompleted || params.onFailed) {
+ remoteCompletionCallbacksRef.current.set(serverTaskId, {
+ onCompleted: params.onCompleted,
+ onFailed: params.onFailed,
+ })
+ }
updateTask(taskId, (task) => ({
...task,
serverTaskId,
@@ -583,6 +455,8 @@ export function ResourceUploadProvider({
return
}
+ params.onCompleted?.()
+
updateTask(taskId, (task) => ({
...task,
status: 'success',
@@ -601,6 +475,7 @@ export function ResourceUploadProvider({
toast.success(params.url)
} catch (error) {
if (controller.signal.aborted) {
+ params.onFailed?.()
updateTask(taskId, (task) => ({
...task,
status: 'failed',
@@ -613,6 +488,7 @@ export function ResourceUploadProvider({
}
const message = getErrorMessage(error)
const { errorCode, errorMessage } = parseUploadError(message)
+ params.onFailed?.()
updateTask(taskId, (task) => ({
...task,
@@ -718,6 +594,28 @@ export function ResourceUploadProvider({
}
}, [remoteState.phase, remoteState.taskId, tasks])
+ React.useEffect(() => {
+ for (const task of tasks) {
+ if (!task.serverTaskId || isUploadStatusActive(task.status)) {
+ continue
+ }
+
+ const callbacks = remoteCompletionCallbacksRef.current.get(
+ task.serverTaskId,
+ )
+ if (!callbacks) {
+ continue
+ }
+
+ remoteCompletionCallbacksRef.current.delete(task.serverTaskId)
+ if (task.status === 'success') {
+ callbacks.onCompleted?.()
+ } else {
+ callbacks.onFailed?.()
+ }
+ }
+ }, [tasks])
+
React.useEffect(() => {
for (const task of tasks) {
if (
diff --git a/web-studio/src/routes/resources/-lib/resource-upload-tasks.ts b/web-studio/src/routes/resources/-lib/resource-upload-tasks.ts
new file mode 100644
index 000000000..7626659a1
--- /dev/null
+++ b/web-studio/src/routes/resources/-lib/resource-upload-tasks.ts
@@ -0,0 +1,163 @@
+import type {
+ ResourceUploadTask,
+ ResourceUploadTaskStatus,
+} from '../-hooks/use-resource-upload'
+import type { TaskListResult, TaskRecord } from '@ov-server/api/v1/tasks'
+
+function isRecord(value: unknown): value is Record<string, unknown> {
+ return value !== null && typeof value === 'object' && !Array.isArray(value)
+}
+
+function isTaskRecord(value: unknown): value is TaskRecord {
+ return (
+ isRecord(value) &&
+ typeof value.task_id === 'string' &&
+ typeof value.task_type === 'string' &&
+ typeof value.status === 'string'
+ )
+}
+
+export function normalizeTaskList(value: unknown): TaskListResult {
+ return Array.isArray(value) ? value.filter(isTaskRecord) : []
+}
+
+export function isUploadStatusActive(
+ status: ResourceUploadTaskStatus,
+): boolean {
+ return (
+ status === 'pending' || status === 'uploading' || status === 'processing'
+ )
+}
+
+function toEpochMillis(value: unknown, fallback: number): number {
+ if (typeof value !== 'number' || !Number.isFinite(value)) {
+ return fallback
+ }
+ return value > 10_000_000_000 ? Math.round(value) : Math.round(value * 1000)
+}
+
+function getResultString(record: TaskRecord, key: string): string | null {
+ const value = record.result?.[key]
+ return typeof value === 'string' && value.trim() ? value : null
+}
+
+function getTaskRootUri(record: TaskRecord): string | null {
+ if (typeof record.resource_id === 'string' && record.resource_id.trim()) {
+ return record.resource_id
+ }
+ return getResultString(record, 'root_uri')
+}
+
+function getNameFromUri(uri: string): string {
+ const normalized = uri.replace(/\/+$/, '')
+ const parts = normalized.split('/').filter(Boolean)
+ return parts[parts.length - 1] || uri
+}
+
+function getServerTaskName(record: TaskRecord): string {
+ const sourceName = getResultString(record, 'source_name')
+ if (sourceName) {
+ return sourceName
+ }
+
+ const rootUri = getTaskRootUri(record)
+ if (rootUri) {
+ return getNameFromUri(rootUri)
+ }
+
+ return record.task_id
+}
+
+function toUploadStatus(
+ status: TaskRecord['status'],
+): ResourceUploadTaskStatus {
+ if (status === 'completed') {
+ return 'success'
+ }
+ if (status === 'failed') {
+ return 'failed'
+ }
+ if (status === 'cancelled') {
+ return 'cancelled'
+ }
+ return 'processing'
+}
+
+function mergeServerTask(
+ record: TaskRecord,
+ existing?: ResourceUploadTask,
+): ResourceUploadTask {
+ const status = toUploadStatus(record.status)
+ const rootUri = getTaskRootUri(record) ?? existing?.rootUri ?? null
+ const createdAt =
+ existing?.createdAt ?? toEpochMillis(record.created_at, Date.now())
+ const updatedAt = toEpochMillis(record.updated_at, Date.now())
+ const fileName =
+ existing && existing.source !== 'server'
+ ? existing.fileName
+ : getServerTaskName(record)
+ const isFinished =
+ status === 'success' || status === 'failed' || status === 'cancelled'
+
+ return {
+ id: existing?.id ?? `server-${record.task_id}`,
+ source: existing?.source ?? 'server',
+ serverTaskId: record.task_id,
+ fileName,
+ fileSize: existing?.fileSize ?? null,
+ fileType: existing?.fileType ?? null,
+ status,
+ progress: status === 'success' ? 100 : null,
+ createdAt,
+ finishedAt: isFinished ? (existing?.finishedAt ?? updatedAt) : null,
+ errorCode:
+ status === 'failed'
+ ? (existing?.errorCode ?? 'SERVER_TASK_FAILED')
+ : null,
+ errorMessage:
+ status === 'failed'
+ ? record.error || existing?.errorMessage || 'Processing failed'
+ : status === 'cancelled'
+ ? record.error || 'Processing cancelled'
+ : null,
+ rootUri,
+ }
+}
+
+export function mergeServerTasks(
+ previous: ResourceUploadTask[],
+ serverTasks: TaskRecord[],
+): ResourceUploadTask[] {
+ const previousByServerId = new Map<string, ResourceUploadTask>()
+ for (const task of previous) {
+ if (task.serverTaskId) {
+ previousByServerId.set(task.serverTaskId, task)
+ }
+ }
+
+ const serverTaskIds = new Set(serverTasks.map((task) => task.task_id))
+ const consumedLocalIds = new Set<string>()
+ const nextTasks = serverTasks.map((record) => {
+ const existing = previousByServerId.get(record.task_id)
+ if (existing) {
+ consumedLocalIds.add(existing.id)
+ }
+ return mergeServerTask(record, existing)
+ })
+
+ for (const task of previous) {
+ if (consumedLocalIds.has(task.id)) {
+ continue
+ }
+ if (
+ task.source === 'server' &&
+ task.serverTaskId &&
+ !serverTaskIds.has(task.serverTaskId)
+ ) {
+ continue
+ }
+ nextTasks.push(task)
+ }
+
+ return nextTasks
+}
diff --git a/web-studio/src/routes/resources/resource-upload.ts b/web-studio/src/routes/resources/resource-upload.ts
new file mode 100644
index 000000000..128b0f039
--- /dev/null
+++ b/web-studio/src/routes/resources/resource-upload.ts
@@ -0,0 +1,10 @@
+export { AddResourceForm } from './-components/add-resource-page'
+export {
+ ResourceUploadProvider,
+ useResourceUpload,
+} from './-hooks/use-resource-upload'
+export type {
+ RemoteStartResult,
+ ResourceUploadTask,
+ ResourceUploadTaskStatus,
+} from './-hooks/use-resource-upload'
diff --git a/web-studio/src/routes/tasks/-lib/task-record.test.ts b/web-studio/src/routes/tasks/-lib/task-record.test.ts
index 9134fc8c9..f24c122bb 100644
--- a/web-studio/src/routes/tasks/-lib/task-record.test.ts
+++ b/web-studio/src/routes/tasks/-lib/task-record.test.ts
@@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest'
import {
hasTaskResult,
+ isActiveTaskStatus,
normalizeTaskRecord,
normalizeTasks,
} from './task-record'
@@ -33,4 +34,12 @@ describe('task record helpers', () => {
expect(hasTaskResult([])).toBe(false)
expect(hasTaskResult({ archive_uri: 'viking://archive' })).toBe(true)
})
+
+ it('recognizes task statuses that still require polling', () => {
+ expect(isActiveTaskStatus('pending')).toBe(true)
+ expect(isActiveTaskStatus('running')).toBe(true)
+ expect(isActiveTaskStatus('cancelling')).toBe(true)
+ expect(isActiveTaskStatus('completed')).toBe(false)
+ expect(isActiveTaskStatus('failed')).toBe(false)
+ })
})
diff --git a/web-studio/src/routes/tasks/-lib/task-record.ts b/web-studio/src/routes/tasks/-lib/task-record.ts
index 776134846..e8d56fd8b 100644
--- a/web-studio/src/routes/tasks/-lib/task-record.ts
+++ b/web-studio/src/routes/tasks/-lib/task-record.ts
@@ -51,6 +51,15 @@ export function normalizeTaskStatus(status: string | undefined): TaskStatus {
return 'unknown'
}
+export function isActiveTaskStatus(status: string | undefined): boolean {
+ const normalized = normalizeTaskStatus(status)
+ return (
+ normalized === 'pending' ||
+ normalized === 'running' ||
+ normalized === 'cancelling'
+ )
+}
+
export function hasTaskResult(result: unknown): boolean {
if (result === null || result === undefined) {
return false
diff --git a/web-studio/src/routes/tasks/task-model.ts b/web-studio/src/routes/tasks/task-model.ts
new file mode 100644
index 000000000..89f91743b
--- /dev/null
+++ b/web-studio/src/routes/tasks/task-model.ts
@@ -0,0 +1,9 @@
+export {
+ hasTaskResult,
+ isActiveTaskStatus,
+ normalizeTaskRecord,
+ normalizeTasks,
+ normalizeTaskStatus,
+} from './-lib/task-record'
+export type { TaskRecord, TaskStatus } from './-lib/task-record'
+export { getTaskDate } from './-lib/task-time'
diff --git a/web-studio/src/routes/watches/-components/edit-watch-dialog.test.tsx b/web-studio/src/routes/watches/-components/edit-watch-dialog.test.tsx
new file mode 100644
index 000000000..6030c26f6
--- /dev/null
+++ b/web-studio/src/routes/watches/-components/edit-watch-dialog.test.tsx
@@ -0,0 +1,78 @@
+// @vitest-environment jsdom
+
+import { cleanup, fireEvent, render, screen } from '@testing-library/react'
+import { afterEach, describe, expect, it, vi } from 'vitest'
+
+import { EditWatchDialog, getWatchUpdateInput } from './edit-watch-dialog'
+import type { WatchTask } from '../-lib/api'
+
+vi.mock('react-i18next', () => ({
+ useTranslation: () => ({ t: (key: string) => key }),
+}))
+
+const watch: WatchTask = {
+ createdAt: '2026-08-10T00:00:00Z',
+ instruction: 'Keep headings',
+ isActive: true,
+ lastExecutionTime: null,
+ nextExecutionTime: '2026-08-11T00:00:00Z',
+ path: 'https://github.com/volcengine/OpenViking',
+ reason: 'Keep docs current',
+ taskId: 'watch-1',
+ toUri: 'viking://resources/OpenViking',
+ watchInterval: 1440,
+}
+
+afterEach(cleanup)
+
+describe('EditWatchDialog', () => {
+ it('submits changed interval, reason, and instruction fields', () => {
+ const onSubmit = vi.fn()
+ render(
+ <EditWatchDialog
+ watch={watch}
+ pending={false}
+ onOpenChange={vi.fn()}
+ onSubmit={onSubmit}
+ />,
+ )
+
+ expect(
+ screen.getByPlaceholderText('editDialog.reasonPlaceholder'),
+ ).toBeTruthy()
+ expect(
+ screen.getByPlaceholderText('editDialog.instructionPlaceholder'),
+ ).toBeTruthy()
+
+ fireEvent.change(
+ screen.getByRole('spinbutton', { name: 'editDialog.interval' }),
+ { target: { value: '60' } },
+ )
+ fireEvent.change(
+ screen.getByRole('textbox', { name: 'editDialog.reason' }),
+ { target: { value: 'Track upstream releases' } },
+ )
+ fireEvent.change(
+ screen.getByRole('textbox', { name: 'editDialog.instruction' }),
+ { target: { value: 'Preserve code examples' } },
+ )
+ fireEvent.click(screen.getByRole('button', { name: 'save' }))
+
+ expect(onSubmit).toHaveBeenCalledWith({
+ instruction: 'Preserve code examples',
+ reason: 'Track upstream releases',
+ watchInterval: 60,
+ })
+ })
+
+ it('keeps unchanged fields out of a partial update', () => {
+ expect(
+ getWatchUpdateInput(
+ watch,
+ watch.watchInterval,
+ 'New reason',
+ watch.instruction,
+ ),
+ ).toEqual({ reason: 'New reason' })
+ })
+})
diff --git a/web-studio/src/routes/watches/-components/edit-watch-dialog.tsx b/web-studio/src/routes/watches/-components/edit-watch-dialog.tsx
new file mode 100644
index 000000000..070272938
--- /dev/null
+++ b/web-studio/src/routes/watches/-components/edit-watch-dialog.tsx
@@ -0,0 +1,129 @@
+import * as React from 'react'
+import { useTranslation } from 'react-i18next'
+
+import { Button } from '#/components/ui/button'
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogHeader,
+ DialogTitle,
+} from '#/components/ui/dialog'
+import { Input } from '#/components/ui/input'
+import { Label } from '#/components/ui/label'
+import { Textarea } from '#/components/ui/textarea'
+import { parsePositiveMinutes } from '#/lib/watch-interval'
+
+import type { UpdateWatchInput, WatchTask } from '../-lib/api'
+
+type EditWatchDialogProps = {
+ onOpenChange: (open: boolean) => void
+ onSubmit: (input: UpdateWatchInput) => void
+ pending: boolean
+ watch: WatchTask | null
+}
+
+export function EditWatchDialog({
+ onOpenChange,
+ onSubmit,
+ pending,
+ watch,
+}: EditWatchDialogProps) {
+ const { t } = useTranslation('watchesPage')
+ const [intervalValue, setIntervalValue] = React.useState('')
+ const [reason, setReason] = React.useState('')
+ const [instruction, setInstruction] = React.useState('')
+
+ React.useEffect(() => {
+ setIntervalValue(watch ? String(watch.watchInterval) : '')
+ setReason(watch?.reason ?? '')
+ setInstruction(watch?.instruction ?? '')
+ }, [watch])
+
+ const interval = parsePositiveMinutes(intervalValue)
+ const input = getWatchUpdateInput(watch, interval, reason, instruction)
+ const canSubmit = interval !== null && Object.keys(input).length > 0
+
+ return (
+ <Dialog open={Boolean(watch)} onOpenChange={onOpenChange}>
+ <DialogContent>
+ <DialogHeader>
+ <DialogTitle>{t('editDialog.title')}</DialogTitle>
+ <DialogDescription className="break-all font-mono text-xs">
+ {watch?.toUri}
+ </DialogDescription>
+ </DialogHeader>
+ <div className="grid gap-4">
+ <div className="grid gap-2">
+ <Label htmlFor="watch-edit-interval">
+ {t('editDialog.interval')}
+ </Label>
+ <Input
+ id="watch-edit-interval"
+ type="number"
+ min="1"
+ step="1"
+ value={intervalValue}
+ onChange={(event) => setIntervalValue(event.target.value)}
+ />
+ <p className="text-xs text-muted-foreground">
+ {t('editDialog.intervalHint')}
+ </p>
+ </div>
+ <div className="grid gap-2">
+ <Label htmlFor="watch-edit-reason">{t('editDialog.reason')}</Label>
+ <Textarea
+ id="watch-edit-reason"
+ placeholder={t('editDialog.reasonPlaceholder')}
+ value={reason}
+ onChange={(event) => setReason(event.target.value)}
+ />
+ </div>
+ <div className="grid gap-2">
+ <Label htmlFor="watch-edit-instruction">
+ {t('editDialog.instruction')}
+ </Label>
+ <Textarea
+ id="watch-edit-instruction"
+ placeholder={t('editDialog.instructionPlaceholder')}
+ value={instruction}
+ onChange={(event) => setInstruction(event.target.value)}
+ />
+ </div>
+ </div>
+ <div className="flex justify-end gap-2">
+ <Button
+ type="button"
+ variant="outline"
+ disabled={pending}
+ onClick={() => onOpenChange(false)}
+ >
+ {t('cancel')}
+ </Button>
+ <Button
+ type="button"
+ disabled={!canSubmit || pending}
+ onClick={() => canSubmit && onSubmit(input)}
+ >
+ {t('save')}
+ </Button>
+ </div>
+ </DialogContent>
+ </Dialog>
+ )
+}
+
+export function getWatchUpdateInput(
+ watch: WatchTask | null,
+ watchInterval: number | null,
+ reason: string,
+ instruction: string,
+): UpdateWatchInput {
+ if (!watch || watchInterval === null) return {}
+
+ const input: UpdateWatchInput = {}
+ if (watchInterval !== watch.watchInterval) input.watchInterval = watchInterval
+ if (reason !== watch.reason) input.reason = reason
+ if (instruction !== watch.instruction) input.instruction = instruction
+ return input
+}
diff --git a/web-studio/src/routes/watches/-components/watch-history-sheet.tsx b/web-studio/src/routes/watches/-components/watch-history-sheet.tsx
new file mode 100644
index 000000000..695a7e3c2
--- /dev/null
+++ b/web-studio/src/routes/watches/-components/watch-history-sheet.tsx
@@ -0,0 +1,216 @@
+import type { ReactNode } from 'react'
+import { useQuery } from '@tanstack/react-query'
+import {
+ CheckCircle2Icon,
+ CircleDashedIcon,
+ CircleXIcon,
+ ClipboardListIcon,
+ LoaderCircleIcon,
+ RefreshCwIcon,
+} from 'lucide-react'
+import { useTranslation } from 'react-i18next'
+
+import { Badge } from '#/components/ui/badge'
+import { Button } from '#/components/ui/button'
+import {
+ Sheet,
+ SheetContent,
+ SheetDescription,
+ SheetHeader,
+ SheetTitle,
+} from '#/components/ui/sheet'
+import {
+ getTaskDate,
+ isActiveTaskStatus,
+ normalizeTaskStatus,
+} from '#/routes/tasks/task-model'
+import type { TaskRecord } from '#/routes/tasks/task-model'
+
+import { fetchWatchProcessingHistory } from '../-lib/api'
+import type { WatchTask } from '../-lib/api'
+
+type WatchHistorySheetProps = {
+ identityScopeKey: string
+ onOpenChange: (open: boolean) => void
+ open: boolean
+ watch: WatchTask | null
+}
+
+export function WatchHistorySheet({
+ identityScopeKey,
+ onOpenChange,
+ open,
+ watch,
+}: WatchHistorySheetProps) {
+ const { i18n, t } = useTranslation('watchesPage')
+ const { t: taskT } = useTranslation('tasksPage')
+ const historyQuery = useQuery({
+ enabled: open && Boolean(watch),
+ queryFn: () => fetchWatchProcessingHistory(watch?.toUri || ''),
+ queryKey: ['watch-processing-history', identityScopeKey, watch?.toUri],
+ refetchInterval: (query) =>
+ query.state.data?.some((task) => isActiveTaskStatus(task.status))
+ ? 3_000
+ : false,
+ })
+ const tasks = historyQuery.data ?? []
+
+ return (
+ <Sheet open={open} onOpenChange={onOpenChange}>
+ <SheetContent className="gap-0 data-[side=right]:sm:max-w-2xl">
+ <SheetHeader className="border-b px-6 py-5">
+ <div className="flex items-start justify-between gap-3 pr-10">
+ <div className="flex min-w-0 items-start gap-3">
+ <div className="flex size-9 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary ring-1 ring-primary/15">
+ <ClipboardListIcon className="size-4.5" />
+ </div>
+ <div className="min-w-0">
+ <SheetTitle className="text-lg">
+ {t('history.title')}
+ </SheetTitle>
+ <SheetDescription
+ className="truncate font-mono text-xs"
+ title={watch?.toUri}
+ >
+ {watch?.toUri}
+ </SheetDescription>
+ </div>
+ </div>
+ <Button
+ type="button"
+ variant="outline"
+ size="sm"
+ disabled={historyQuery.isFetching}
+ onClick={() => void historyQuery.refetch()}
+ >
+ <RefreshCwIcon
+ className={historyQuery.isFetching ? 'animate-spin' : undefined}
+ />
+ {t('refresh')}
+ </Button>
+ </div>
+ <p className="pt-2 text-xs leading-5 text-muted-foreground">
+ {t('history.description')}
+ </p>
+ </SheetHeader>
+
+ <div className="min-h-0 flex-1 overflow-y-auto px-6 py-5">
+ {historyQuery.isLoading ? (
+ <HistoryState icon={<LoaderCircleIcon className="animate-spin" />}>
+ {t('history.loading')}
+ </HistoryState>
+ ) : historyQuery.isError ? (
+ <HistoryState icon={<CircleXIcon className="text-destructive" />}>
+ <span>{t('history.loadFailed')}</span>
+ <span className="max-w-md text-xs text-muted-foreground">
+ {historyQuery.error instanceof Error
+ ? historyQuery.error.message
+ : String(historyQuery.error)}
+ </span>
+ </HistoryState>
+ ) : tasks.length === 0 ? (
+ <HistoryState icon={<ClipboardListIcon />}>
+ <span>{t('history.empty')}</span>
+ <span className="text-xs text-muted-foreground">
+ {t('history.emptyDescription')}
+ </span>
+ </HistoryState>
+ ) : (
+ <div className="grid gap-3">
+ {tasks.map((task, index) => {
+ const status = normalizeTaskStatus(task.status)
+ return (
+ <article
+ key={task.task_id || String(index)}
+ className="grid gap-3 rounded-xl border bg-card/50 p-4"
+ >
+ <div className="flex flex-wrap items-start justify-between gap-2">
+ <div className="min-w-0">
+ <p className="text-sm font-medium">
+ {formatTaskTime(task, i18n.resolvedLanguage)}
+ </p>
+ <p className="mt-1 truncate font-mono text-xs text-muted-foreground">
+ {task.task_id || '-'}
+ </p>
+ </div>
+ <TaskStatusBadge
+ task={task}
+ label={taskT(`status.${status}`)}
+ />
+ </div>
+ <div className="grid gap-1 text-xs">
+ <span className="text-muted-foreground">
+ {t('history.stage')}
+ </span>
+ <span>{task.stage || '-'}</span>
+ </div>
+ {task.error ? (
+ <p className="line-clamp-3 rounded-lg bg-destructive/5 px-3 py-2 font-mono text-xs leading-5 text-destructive">
+ {task.error}
+ </p>
+ ) : null}
+ </article>
+ )
+ })}
+ </div>
+ )}
+ </div>
+ </SheetContent>
+ </Sheet>
+ )
+}
+
+function TaskStatusBadge({ task, label }: { task: TaskRecord; label: string }) {
+ const status = normalizeTaskStatus(task.status)
+ const Icon =
+ status === 'completed'
+ ? CheckCircle2Icon
+ : status === 'failed' || status === 'cancelled'
+ ? CircleXIcon
+ : status === 'running' || status === 'cancelling'
+ ? LoaderCircleIcon
+ : CircleDashedIcon
+
+ return (
+ <Badge
+ variant={status === 'failed' ? 'destructive' : 'outline'}
+ className="font-normal"
+ >
+ <Icon
+ className={
+ status === 'running' || status === 'cancelling'
+ ? 'animate-spin'
+ : undefined
+ }
+ />
+ {label}
+ </Badge>
+ )
+}
+
+function HistoryState({
+ children,
+ icon,
+}: {
+ children: ReactNode
+ icon: ReactNode
+}) {
+ return (
+ <div className="flex min-h-64 flex-col items-center justify-center gap-2 text-center text-sm [&_svg]:size-7 [&_svg]:text-muted-foreground">
+ {icon}
+ {children}
+ </div>
+ )
+}
+
+function formatTaskTime(
+ task: TaskRecord,
+ language: string | undefined,
+): string {
+ const date = getTaskDate(task)
+ if (!date) return '-'
+ return new Intl.DateTimeFormat(language, {
+ dateStyle: 'medium',
+ timeStyle: 'medium',
+ }).format(date)
+}
diff --git a/web-studio/src/routes/watches/-lib/api.test.ts b/web-studio/src/routes/watches/-lib/api.test.ts
new file mode 100644
index 000000000..080d22d70
--- /dev/null
+++ b/web-studio/src/routes/watches/-lib/api.test.ts
@@ -0,0 +1,111 @@
+import { beforeEach, describe, expect, it, vi } from 'vitest'
+
+import {
+ deleteWatch,
+ fetchWatchProcessingHistory,
+ normalizeWatchList,
+ normalizeWatchTask,
+ triggerWatch,
+ updateWatch,
+} from './api'
+
+const clientMocks = vi.hoisted(() => ({
+ delete: vi.fn(),
+ get: vi.fn(),
+ patch: vi.fn(),
+ post: vi.fn(),
+ getTasks: vi.fn(),
+}))
+
+vi.mock('#/lib/ov-client', () => ({
+ getOvResult: async (value: unknown) => value,
+ getTasks: clientMocks.getTasks,
+ ovClient: { client: clientMocks },
+}))
+
+const watch = {
+ created_at: '2026-08-10T10:00:00',
+ instruction: 'Keep the docs current',
+ is_active: true,
+ last_execution_time: null,
+ next_execution_time: '2026-08-11T10:00:00',
+ path: 'https://github.com/volcengine/OpenViking',
+ reason: 'Track upstream changes',
+ task_id: 'watch-1',
+ to_uri: 'viking://resources/OpenViking',
+ watch_interval: 1440,
+}
+
+beforeEach(() => {
+ vi.clearAllMocks()
+})
+
+describe('watch API normalization', () => {
+ it('normalizes a watch task', () => {
+ expect(normalizeWatchTask(watch)).toEqual({
+ createdAt: '2026-08-10T10:00:00',
+ instruction: 'Keep the docs current',
+ isActive: true,
+ lastExecutionTime: null,
+ nextExecutionTime: '2026-08-11T10:00:00',
+ path: 'https://github.com/volcengine/OpenViking',
+ reason: 'Track upstream changes',
+ taskId: 'watch-1',
+ toUri: 'viking://resources/OpenViking',
+ watchInterval: 1440,
+ })
+ })
+
+ it('drops malformed tasks from list responses', () => {
+ expect(
+ normalizeWatchList({ tasks: [watch, { task_id: 'invalid' }] }),
+ ).toEqual([normalizeWatchTask(watch)])
+ })
+})
+
+describe('watch API operations', () => {
+ it('queries resource processing history by target URI', async () => {
+ clientMocks.getTasks.mockResolvedValue([])
+
+ await fetchWatchProcessingHistory('viking://resources/OpenViking')
+
+ expect(clientMocks.getTasks).toHaveBeenCalledWith({
+ query: {
+ limit: 200,
+ resource_id: 'viking://resources/OpenViking',
+ task_type: 'add_resource',
+ },
+ })
+ })
+
+ it('maps update fields to the REST request body', async () => {
+ clientMocks.patch.mockResolvedValue(watch)
+
+ await updateWatch('watch/1', { isActive: false, watchInterval: 60 })
+
+ expect(clientMocks.patch).toHaveBeenCalledWith({
+ body: { is_active: false, watch_interval: 60 },
+ url: '/api/v1/watches/watch%2F1',
+ })
+ })
+
+ it('triggers an immediate sync by encoded task ID', async () => {
+ clientMocks.post.mockResolvedValue({ scheduled: true })
+
+ await triggerWatch('watch/1')
+
+ expect(clientMocks.post).toHaveBeenCalledWith({
+ url: '/api/v1/watches/watch%2F1/trigger',
+ })
+ })
+
+ it('deletes a watch by encoded task ID', async () => {
+ clientMocks.delete.mockResolvedValue({ deleted: true })
+
+ await deleteWatch('watch/1')
+
+ expect(clientMocks.delete).toHaveBeenCalledWith({
+ url: '/api/v1/watches/watch%2F1',
+ })
+ })
+})
diff --git a/web-studio/src/routes/watches/-lib/api.ts b/web-studio/src/routes/watches/-lib/api.ts
new file mode 100644
index 000000000..b4b91df02
--- /dev/null
+++ b/web-studio/src/routes/watches/-lib/api.ts
@@ -0,0 +1,138 @@
+import { getOvResult, getTasks, ovClient } from '#/lib/ov-client'
+import { normalizeTasks } from '#/routes/tasks/task-model'
+import type { TaskRecord } from '#/routes/tasks/task-model'
+
+export type WatchTask = {
+ createdAt: string | null
+ instruction: string
+ isActive: boolean
+ lastExecutionTime: string | null
+ nextExecutionTime: string | null
+ path: string
+ reason: string
+ taskId: string
+ toUri: string
+ watchInterval: number
+}
+
+type WatchListResult = {
+ tasks?: unknown[]
+ total?: number
+}
+
+export type UpdateWatchInput = {
+ instruction?: string
+ isActive?: boolean
+ reason?: string
+ watchInterval?: number
+}
+
+function asRecord(value: unknown): Record<string, unknown> | null {
+ return value !== null && typeof value === 'object' && !Array.isArray(value)
+ ? (value as Record<string, unknown>)
+ : null
+}
+
+function optionalString(value: unknown): string | null {
+ return typeof value === 'string' && value.trim() ? value : null
+}
+
+export function normalizeWatchTask(value: unknown): WatchTask | null {
+ const task = asRecord(value)
+ const taskId = optionalString(task?.task_id)
+ const path = optionalString(task?.path)
+ const toUri = optionalString(task?.to_uri)
+ const watchInterval = task?.watch_interval
+
+ if (
+ !taskId ||
+ !path ||
+ !toUri ||
+ typeof watchInterval !== 'number' ||
+ !Number.isFinite(watchInterval)
+ ) {
+ return null
+ }
+
+ return {
+ createdAt: optionalString(task?.created_at),
+ instruction: optionalString(task?.instruction) ?? '',
+ isActive: task?.is_active === true,
+ lastExecutionTime: optionalString(task?.last_execution_time),
+ nextExecutionTime: optionalString(task?.next_execution_time),
+ path,
+ reason: optionalString(task?.reason) ?? '',
+ taskId,
+ toUri,
+ watchInterval,
+ }
+}
+
+export function normalizeWatchList(value: unknown): WatchTask[] {
+ const result = asRecord(value) as WatchListResult | null
+ const tasks = Array.isArray(result?.tasks) ? result.tasks : []
+ return tasks.flatMap((task) => {
+ const normalized = normalizeWatchTask(task)
+ return normalized ? [normalized] : []
+ })
+}
+
+export async function fetchWatches(): Promise<WatchTask[]> {
+ const result = await getOvResult<unknown>(
+ ovClient.client.get({
+ url: '/api/v1/watches',
+ }),
+ )
+ return normalizeWatchList(result)
+}
+
+export async function fetchWatchProcessingHistory(
+ toUri: string,
+): Promise<TaskRecord[]> {
+ const result = await getOvResult<unknown>(
+ getTasks({
+ query: {
+ limit: 200,
+ resource_id: toUri,
+ task_type: 'add_resource',
+ },
+ }),
+ )
+ return normalizeTasks(result)
+}
+
+export async function updateWatch(
+ taskId: string,
+ input: UpdateWatchInput,
+): Promise<void> {
+ const body: Record<string, unknown> = {}
+ if (input.watchInterval !== undefined) {
+ body.watch_interval = input.watchInterval
+ }
+ if (input.isActive !== undefined) body.is_active = input.isActive
+ if (input.reason !== undefined) body.reason = input.reason
+ if (input.instruction !== undefined) body.instruction = input.instruction
+
+ await getOvResult(
+ ovClient.client.patch({
+ body,
+ url: `/api/v1/watches/${encodeURIComponent(taskId)}`,
+ }),
+ )
+}
+
+export async function triggerWatch(taskId: string): Promise<void> {
+ await getOvResult(
+ ovClient.client.post({
+ url: `/api/v1/watches/${encodeURIComponent(taskId)}/trigger`,
+ }),
+ )
+}
+
+export async function deleteWatch(taskId: string): Promise<void> {
+ await getOvResult(
+ ovClient.client.delete({
+ url: `/api/v1/watches/${encodeURIComponent(taskId)}`,
+ }),
+ )
+}
diff --git a/web-studio/src/routes/watches/-lib/watch-discovery.test.ts b/web-studio/src/routes/watches/-lib/watch-discovery.test.ts
new file mode 100644
index 000000000..6de0052ad
--- /dev/null
+++ b/web-studio/src/routes/watches/-lib/watch-discovery.test.ts
@@ -0,0 +1,84 @@
+import { describe, expect, it } from 'vitest'
+
+import type { WatchTask } from './api'
+import {
+ getWatchRefetchInterval,
+ hasActiveWatchProcessing,
+ hasCompletedTriggeredWatchSync,
+ hasDiscoveredWatch,
+ hasWatchExecutionAdvanced,
+ normalizeWatchUri,
+ WATCH_DISCOVERY_INTERVAL_MS,
+} from './watch-discovery'
+
+const watch: WatchTask = {
+ createdAt: '2026-08-10T00:00:00Z',
+ instruction: '',
+ isActive: true,
+ lastExecutionTime: null,
+ nextExecutionTime: '2026-08-10T01:00:00Z',
+ path: 'https://github.com/volcengine/OpenViking',
+ reason: '',
+ taskId: 'watch-1',
+ toUri: 'viking://resources/OpenViking/',
+ watchInterval: 60,
+}
+
+describe('watch discovery', () => {
+ it('polls only while discovering a newly created watch', () => {
+ expect(getWatchRefetchInterval(true)).toBe(WATCH_DISCOVERY_INTERVAL_MS)
+ expect(getWatchRefetchInterval(false)).toBe(false)
+ })
+
+ it('normalizes trailing slashes before matching a created watch', () => {
+ expect(normalizeWatchUri('viking://resources/OpenViking///')).toBe(
+ 'viking://resources/OpenViking',
+ )
+ expect(hasDiscoveredWatch([watch], 'viking://resources/OpenViking')).toBe(
+ true,
+ )
+ })
+
+ it('keeps polling when the created watch is absent', () => {
+ expect(hasDiscoveredWatch([watch], 'viking://resources/another')).toBe(
+ false,
+ )
+ })
+
+ it('keeps the syncing state while resource processing is active', () => {
+ expect(hasActiveWatchProcessing([{ status: 'running' }])).toBe(true)
+ expect(hasActiveWatchProcessing([{ status: 'completed' }])).toBe(false)
+ })
+
+ it('finishes only after a newly triggered processing task is terminal', () => {
+ const baselineTaskIds = ['existing-task']
+ expect(
+ hasCompletedTriggeredWatchSync(
+ [{ status: 'completed', task_id: 'existing-task' }],
+ baselineTaskIds,
+ ),
+ ).toBe(false)
+ expect(
+ hasCompletedTriggeredWatchSync(
+ [{ status: 'running', task_id: 'triggered-task' }],
+ baselineTaskIds,
+ ),
+ ).toBe(false)
+ expect(
+ hasCompletedTriggeredWatchSync(
+ [{ status: 'completed', task_id: 'triggered-task' }],
+ baselineTaskIds,
+ ),
+ ).toBe(true)
+ })
+
+ it('detects completion from a newer watch execution time', () => {
+ expect(hasWatchExecutionAdvanced(null, null)).toBe(false)
+ expect(
+ hasWatchExecutionAdvanced('2026-08-10T01:00:00Z', '2026-08-10T01:00:00Z'),
+ ).toBe(false)
+ expect(
+ hasWatchExecutionAdvanced('2026-08-10T01:01:00Z', '2026-08-10T01:00:00Z'),
+ ).toBe(true)
+ })
+})
diff --git a/web-studio/src/routes/watches/-lib/watch-discovery.ts b/web-studio/src/routes/watches/-lib/watch-discovery.ts
new file mode 100644
index 000000000..e59648c51
--- /dev/null
+++ b/web-studio/src/routes/watches/-lib/watch-discovery.ts
@@ -0,0 +1,62 @@
+import type { WatchTask } from './api'
+import { isActiveTaskStatus } from '#/routes/tasks/task-model'
+import type { TaskRecord } from '#/routes/tasks/task-model'
+
+export const WATCH_DISCOVERY_INTERVAL_MS = 1_000
+
+export function getWatchRefetchInterval(
+ isDiscovering: boolean,
+): number | false {
+ return isDiscovering ? WATCH_DISCOVERY_INTERVAL_MS : false
+}
+
+export function normalizeWatchUri(uri: string): string {
+ return uri.replace(/\/+$/, '')
+}
+
+export function hasDiscoveredWatch(
+ watches: WatchTask[],
+ targetUri: string,
+): boolean {
+ const normalizedTarget = normalizeWatchUri(targetUri)
+ return watches.some(
+ (watch) => normalizeWatchUri(watch.toUri) === normalizedTarget,
+ )
+}
+
+export function hasActiveWatchProcessing(tasks: TaskRecord[]): boolean {
+ return tasks.some((task) => isActiveTaskStatus(task.status))
+}
+
+export function hasCompletedTriggeredWatchSync(
+ tasks: TaskRecord[],
+ baselineTaskIds: string[],
+): boolean {
+ const baseline = new Set(baselineTaskIds)
+ const triggeredTasks = tasks.filter(
+ (task) => task.task_id && !baseline.has(task.task_id),
+ )
+ if (triggeredTasks.length === 0) return false
+ if (hasActiveWatchProcessing(triggeredTasks)) return false
+ return triggeredTasks.every(
+ (task) =>
+ task.status === 'completed' ||
+ task.status === 'failed' ||
+ task.status === 'cancelled',
+ )
+}
+
+export function hasWatchExecutionAdvanced(
+ currentExecutionTime: string | null,
+ baselineExecutionTime: string | null,
+): boolean {
+ if (!currentExecutionTime) return false
+ if (!baselineExecutionTime) return true
+
+ const currentTime = Date.parse(currentExecutionTime)
+ const baselineTime = Date.parse(baselineExecutionTime)
+ if (Number.isFinite(currentTime) && Number.isFinite(baselineTime)) {
+ return currentTime > baselineTime
+ }
+ return currentExecutionTime !== baselineExecutionTime
+}
diff --git a/web-studio/src/routes/watches/route.test.tsx b/web-studio/src/routes/watches/route.test.tsx
new file mode 100644
index 000000000..33636cc2c
--- /dev/null
+++ b/web-studio/src/routes/watches/route.test.tsx
@@ -0,0 +1,272 @@
+// @vitest-environment jsdom
+
+import * as React from 'react'
+import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
+import {
+ cleanup,
+ fireEvent,
+ render,
+ screen,
+ waitFor,
+ act,
+} from '@testing-library/react'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+
+import { WatchManagementPage } from './route'
+import type { WatchTask } from './-lib/api'
+
+const apiMocks = vi.hoisted(() => ({
+ deleteWatch: vi.fn(),
+ fetchWatchProcessingHistory: vi.fn(),
+ fetchWatches: vi.fn(),
+ triggerWatch: vi.fn(),
+ updateWatch: vi.fn(),
+}))
+
+const toastMocks = vi.hoisted(() => ({
+ dismiss: vi.fn(),
+ error: vi.fn(),
+ loading: vi.fn(() => 'toast-1'),
+ success: vi.fn(),
+ warning: vi.fn(),
+}))
+
+vi.mock('react-i18next', () => ({
+ useTranslation: () => ({
+ i18n: { resolvedLanguage: 'en' },
+ t: (key: string) => key,
+ }),
+}))
+
+vi.mock('sonner', () => ({ toast: toastMocks }))
+
+vi.mock('#/hooks/use-app-connection', () => ({
+ useAppConnection: () => ({ identityScopeKey: 'default/default' }),
+}))
+
+vi.mock('#/routes/resources/resource-upload', () => ({
+ AddResourceForm: (props: {
+ onAccepted?: (result: { rootUri: string | null }) => void
+ onCompleted?: () => void
+ onFailed?: () => void
+ onSubmitted?: () => void
+ }) => (
+ <div>
+ <button
+ type="button"
+ data-testid="mock-submit"
+ onClick={() => {
+ props.onSubmitted?.()
+ props.onAccepted?.({ rootUri: watch.toUri })
+ }}
+ />
+ <button
+ type="button"
+ data-testid="mock-fail"
+ onClick={() => {
+ props.onSubmitted?.()
+ props.onFailed?.()
+ }}
+ />
+ </div>
+ ),
+ ResourceUploadProvider: ({ children }: { children: React.ReactNode }) =>
+ children,
+}))
+
+vi.mock('./-components/edit-watch-dialog', () => ({
+ EditWatchDialog: () => null,
+}))
+
+vi.mock('./-components/watch-history-sheet', () => ({
+ WatchHistorySheet: () => null,
+}))
+
+vi.mock('./-lib/api', () => apiMocks)
+
+const watch: WatchTask = {
+ createdAt: '2026-08-10T00:00:00Z',
+ instruction: '',
+ isActive: true,
+ lastExecutionTime: null,
+ nextExecutionTime: '2026-08-11T00:00:00Z',
+ path: 'https://github.com/volcengine/OpenViking',
+ reason: '',
+ taskId: 'watch-1',
+ toUri: 'viking://resources/OpenViking',
+ watchInterval: 1440,
+}
+
+function renderPage() {
+ const queryClient = new QueryClient({
+ defaultOptions: {
+ mutations: { retry: false },
+ queries: { retry: false },
+ },
+ })
+ const result = render(
+ <QueryClientProvider client={queryClient}>
+ <WatchManagementPage />
+ </QueryClientProvider>,
+ )
+ return { ...result, queryClient }
+}
+
+beforeEach(() => {
+ apiMocks.fetchWatches.mockResolvedValue([watch])
+ apiMocks.fetchWatchProcessingHistory.mockResolvedValue([
+ { status: 'running', task_id: 'processing-1' },
+ ])
+ apiMocks.triggerWatch.mockResolvedValue(undefined)
+ apiMocks.updateWatch.mockResolvedValue(undefined)
+})
+
+afterEach(() => {
+ cleanup()
+ vi.clearAllMocks()
+ vi.useRealTimers()
+})
+
+describe('WatchManagementPage', () => {
+ it('shows edit as a direct row action', async () => {
+ renderPage()
+
+ expect(
+ await screen.findByRole('button', { name: 'actions.edit' }),
+ ).toBeDefined()
+ })
+
+ it('keeps Sync now disabled and labelled as syncing while processing is active', async () => {
+ const existingTask = { status: 'completed', task_id: 'existing-task' }
+ const runningTask = { status: 'running', task_id: 'triggered-task' }
+ const completedTask = { status: 'completed', task_id: 'triggered-task' }
+ apiMocks.fetchWatchProcessingHistory
+ .mockResolvedValueOnce([existingTask])
+ .mockResolvedValue([runningTask, existingTask])
+ const { queryClient } = renderPage()
+
+ fireEvent.click(
+ await screen.findByRole('button', { name: 'actions.trigger' }),
+ )
+
+ const syncingButton = await screen.findByRole('button', {
+ name: 'actions.syncing',
+ })
+ expect((syncingButton as HTMLButtonElement).disabled).toBe(true)
+ expect(apiMocks.triggerWatch).toHaveBeenCalledWith(watch.taskId)
+
+ apiMocks.fetchWatchProcessingHistory.mockResolvedValue([
+ completedTask,
+ existingTask,
+ ])
+ await queryClient.invalidateQueries({
+ queryKey: ['watch-sync-progress', 'default/default'],
+ })
+
+ expect(
+ await screen.findByRole('button', { name: 'actions.trigger' }),
+ ).toBeDefined()
+ })
+
+ it('falls back to the watch execution time when the task baseline fails', async () => {
+ apiMocks.fetchWatchProcessingHistory.mockRejectedValueOnce(
+ new Error('history unavailable'),
+ )
+ const { queryClient } = renderPage()
+
+ fireEvent.click(
+ await screen.findByRole('button', { name: 'actions.trigger' }),
+ )
+
+ expect(
+ await screen.findByRole('button', { name: 'actions.syncing' }),
+ ).toBeDefined()
+ expect(apiMocks.triggerWatch).toHaveBeenCalledWith(watch.taskId)
+
+ apiMocks.fetchWatches.mockResolvedValue([
+ { ...watch, lastExecutionTime: '2026-08-10T01:00:00Z' },
+ ])
+ await queryClient.invalidateQueries({
+ queryKey: ['watches', 'default/default'],
+ })
+
+ expect(
+ await screen.findByRole('button', { name: 'actions.trigger' }),
+ ).toBeDefined()
+ })
+
+ it('updates the enabled state and reports mutation failures', async () => {
+ apiMocks.updateWatch.mockRejectedValueOnce(new Error('update failed'))
+ renderPage()
+
+ fireEvent.click(
+ await screen.findByRole('switch', { name: 'actions.disable' }),
+ )
+
+ await waitFor(() =>
+ expect(apiMocks.updateWatch).toHaveBeenCalledWith(watch.taskId, {
+ isActive: false,
+ }),
+ )
+ await waitFor(() =>
+ expect(toastMocks.error).toHaveBeenCalledWith('update failed'),
+ )
+ })
+
+ it('disables manual sync when the scheduled sync is disabled', async () => {
+ apiMocks.fetchWatches.mockResolvedValue([{ ...watch, isActive: false }])
+ renderPage()
+
+ const statusSwitch = await screen.findByRole('switch', {
+ name: 'actions.enable',
+ })
+ const syncButton = screen.getByRole('button', { name: 'actions.trigger' })
+
+ expect(
+ (statusSwitch as HTMLButtonElement).getAttribute('aria-checked'),
+ ).toBe('false')
+ expect((syncButton as HTMLButtonElement).disabled).toBe(true)
+ expect(screen.getByText('status.disabled')).toBeDefined()
+ })
+
+ it('enters creation state after submitting a new watch', async () => {
+ apiMocks.fetchWatches.mockResolvedValue([])
+ renderPage()
+
+ fireEvent.click(await screen.findByRole('button', { name: 'add' }))
+ fireEvent.click(screen.getByTestId('mock-submit'))
+
+ expect(screen.getByRole('status').textContent).toContain('creation.title')
+ expect(toastMocks.loading).toHaveBeenCalledWith('toast.creating')
+ })
+
+ it('clears creation state when resource submission fails', async () => {
+ renderPage()
+
+ fireEvent.click(await screen.findByRole('button', { name: 'add' }))
+ fireEvent.click(screen.getByTestId('mock-fail'))
+
+ expect(screen.queryByRole('status')).toBeNull()
+ expect(toastMocks.dismiss).toHaveBeenCalledWith('toast-1')
+ })
+
+ it('warns and clears creation state when discovery times out', async () => {
+ vi.useFakeTimers()
+ apiMocks.fetchWatches.mockResolvedValue([])
+ renderPage()
+
+ await vi.advanceTimersByTimeAsync(0)
+ fireEvent.click(screen.getByRole('button', { name: 'add' }))
+ fireEvent.click(screen.getByTestId('mock-submit'))
+ expect(screen.getByRole('status')).toBeDefined()
+ await act(async () => {})
+ await act(async () => {
+ await vi.advanceTimersByTimeAsync(60_000)
+ })
+
+ expect(screen.queryByRole('status')).toBeNull()
+ expect(toastMocks.warning).toHaveBeenCalledWith('toast.createTimeout', {
+ id: 'toast-1',
+ })
+ })
+})
diff --git a/web-studio/src/routes/watches/route.tsx b/web-studio/src/routes/watches/route.tsx
new file mode 100644
index 000000000..263f623b6
--- /dev/null
+++ b/web-studio/src/routes/watches/route.tsx
@@ -0,0 +1,708 @@
+import * as React from 'react'
+import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
+import { createFileRoute } from '@tanstack/react-router'
+import {
+ Clock3Icon,
+ EllipsisIcon,
+ HistoryIcon,
+ PencilIcon,
+ PlusIcon,
+ RefreshCwIcon,
+ RotateCwIcon,
+ Trash2Icon,
+} from 'lucide-react'
+import { useTranslation } from 'react-i18next'
+import { toast } from 'sonner'
+
+import {
+ AlertDialog,
+ AlertDialogAction,
+ AlertDialogCancel,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogTitle,
+} from '#/components/ui/alert-dialog'
+import { Button } from '#/components/ui/button'
+import { Card } from '#/components/ui/card'
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogHeader,
+ DialogTitle,
+} from '#/components/ui/dialog'
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+} from '#/components/ui/dropdown-menu'
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
+} from '#/components/ui/table'
+import { Switch } from '#/components/ui/switch'
+import { useAppConnection } from '#/hooks/use-app-connection'
+import {
+ AddResourceForm,
+ ResourceUploadProvider,
+} from '#/routes/resources/resource-upload'
+
+import { EditWatchDialog } from './-components/edit-watch-dialog'
+import { WatchHistorySheet } from './-components/watch-history-sheet'
+import {
+ deleteWatch,
+ fetchWatchProcessingHistory,
+ fetchWatches,
+ triggerWatch,
+ updateWatch,
+} from './-lib/api'
+import type { UpdateWatchInput, WatchTask } from './-lib/api'
+import {
+ getWatchRefetchInterval,
+ hasCompletedTriggeredWatchSync,
+ hasDiscoveredWatch,
+ hasWatchExecutionAdvanced,
+ normalizeWatchUri,
+} from './-lib/watch-discovery'
+
+const WATCH_DISCOVERY_TIMEOUT_MS = 60_000
+
+type PendingWatch = {
+ expiresAt: number
+ identityScopeKey: string
+ toUri: string
+}
+
+type PendingWatchSync = {
+ baselineExecutionTime: string | null
+ baselineTaskIds: string[] | null
+ identityScopeKey: string
+ syncId: number
+ taskId: string
+ toUri: string
+}
+
+export const Route = createFileRoute('/watches')({
+ component: WatchesRoute,
+})
+
+function WatchesRoute() {
+ return (
+ <ResourceUploadProvider>
+ <WatchManagementPage />
+ </ResourceUploadProvider>
+ )
+}
+
+export function WatchManagementPage() {
+ const { i18n, t } = useTranslation('watchesPage')
+ const { identityScopeKey } = useAppConnection()
+ const queryClient = useQueryClient()
+ const [addOpen, setAddOpen] = React.useState(false)
+ const [isCreatingWatch, setIsCreatingWatch] = React.useState(false)
+ const watchCreationPendingRef = React.useRef(false)
+ const watchCreationTargetRef = React.useRef<string | null>(null)
+ const watchCreationToastRef = React.useRef<string | number | null>(null)
+ const [pendingWatch, setPendingWatch] = React.useState<PendingWatch | null>(
+ null,
+ )
+ const [pendingSync, setPendingSync] = React.useState<PendingWatchSync | null>(
+ null,
+ )
+ const [editingWatch, setEditingWatch] = React.useState<WatchTask | null>(null)
+ const [deletingWatch, setDeletingWatch] = React.useState<WatchTask | null>(
+ null,
+ )
+ const [historyWatch, setHistoryWatch] = React.useState<WatchTask | null>(null)
+ const watchesQuery = useQuery({
+ queryFn: fetchWatches,
+ queryKey: ['watches', identityScopeKey],
+ refetchInterval: getWatchRefetchInterval(
+ pendingWatch?.identityScopeKey === identityScopeKey ||
+ pendingSync?.identityScopeKey === identityScopeKey,
+ ),
+ })
+ const watches = watchesQuery.data ?? []
+ const syncTasksQuery = useQuery({
+ enabled:
+ pendingSync?.identityScopeKey === identityScopeKey &&
+ pendingSync.baselineTaskIds !== null,
+ queryFn: () => fetchWatchProcessingHistory(pendingSync?.toUri ?? ''),
+ queryKey: [
+ 'watch-sync-progress',
+ identityScopeKey,
+ pendingSync?.taskId,
+ pendingSync?.syncId,
+ ],
+ refetchInterval:
+ pendingSync?.identityScopeKey === identityScopeKey &&
+ pendingSync.baselineTaskIds !== null
+ ? 1_000
+ : false,
+ })
+
+ const refreshWatches = React.useCallback(async () => {
+ await queryClient.invalidateQueries({
+ queryKey: ['watches', identityScopeKey],
+ })
+ }, [identityScopeKey, queryClient])
+
+ const beginWatchCreation = React.useCallback(() => {
+ watchCreationPendingRef.current = true
+ watchCreationTargetRef.current = null
+ setIsCreatingWatch(true)
+ watchCreationToastRef.current = toast.loading(t('toast.creating'))
+ }, [t])
+
+ const finishWatchCreation = React.useCallback(() => {
+ if (!watchCreationPendingRef.current) return
+ watchCreationPendingRef.current = false
+ watchCreationTargetRef.current = null
+ setIsCreatingWatch(false)
+ toast.success(t('toast.created'), {
+ id: watchCreationToastRef.current ?? undefined,
+ })
+ watchCreationToastRef.current = null
+ }, [t])
+
+ const failWatchCreation = React.useCallback(() => {
+ watchCreationPendingRef.current = false
+ watchCreationTargetRef.current = null
+ setIsCreatingWatch(false)
+ if (watchCreationToastRef.current !== null) {
+ toast.dismiss(watchCreationToastRef.current)
+ watchCreationToastRef.current = null
+ }
+ }, [])
+
+ const discoverWatch = React.useCallback(
+ ({ rootUri }: { rootUri: string | null }) => {
+ void refreshWatches()
+ if (!rootUri) return
+ watchCreationTargetRef.current = normalizeWatchUri(rootUri)
+ setPendingWatch({
+ expiresAt: Date.now() + WATCH_DISCOVERY_TIMEOUT_MS,
+ identityScopeKey,
+ toUri: normalizeWatchUri(rootUri),
+ })
+ },
+ [identityScopeKey, refreshWatches],
+ )
+
+ React.useEffect(() => {
+ if (
+ pendingWatch?.identityScopeKey === identityScopeKey &&
+ hasDiscoveredWatch(watches, pendingWatch.toUri)
+ ) {
+ finishWatchCreation()
+ setPendingWatch(null)
+ }
+ }, [finishWatchCreation, identityScopeKey, pendingWatch, watches])
+
+ React.useEffect(() => {
+ if (!pendingWatch) return undefined
+ const expiresAt = pendingWatch.expiresAt
+ const timeout = window.setTimeout(
+ () => {
+ watchCreationPendingRef.current = false
+ watchCreationTargetRef.current = null
+ setIsCreatingWatch(false)
+ toast.warning(t('toast.createTimeout'), {
+ id: watchCreationToastRef.current ?? undefined,
+ })
+ watchCreationToastRef.current = null
+ setPendingWatch((current) =>
+ current?.expiresAt === expiresAt ? null : current,
+ )
+ },
+ Math.max(0, pendingWatch.expiresAt - Date.now()),
+ )
+ return () => window.clearTimeout(timeout)
+ }, [pendingWatch, t])
+
+ React.useEffect(() => {
+ if (pendingSync?.identityScopeKey !== identityScopeKey) return
+
+ const historyShowsCompletion =
+ syncTasksQuery.isFetched &&
+ !syncTasksQuery.isFetching &&
+ !syncTasksQuery.isError &&
+ pendingSync.baselineTaskIds !== null &&
+ hasCompletedTriggeredWatchSync(
+ syncTasksQuery.data ?? [],
+ pendingSync.baselineTaskIds,
+ )
+
+ const currentWatch = watches.find(
+ (watch) => watch.taskId === pendingSync.taskId,
+ )
+ const watchShowsCompletion =
+ pendingSync.baselineTaskIds === null &&
+ hasWatchExecutionAdvanced(
+ currentWatch?.lastExecutionTime ?? null,
+ pendingSync.baselineExecutionTime,
+ )
+
+ if (historyShowsCompletion || watchShowsCompletion) {
+ setPendingSync(null)
+ }
+ }, [identityScopeKey, pendingSync, syncTasksQuery, watches])
+
+ const updateMutation = useMutation({
+ mutationFn: ({
+ input,
+ taskId,
+ }: {
+ input: UpdateWatchInput
+ taskId: string
+ }) => updateWatch(taskId, input),
+ onSuccess: async () => {
+ await refreshWatches()
+ setEditingWatch(null)
+ toast.success(t('toast.updated'))
+ },
+ onError: (error) => toast.error(getErrorMessage(error)),
+ })
+ const triggerMutation = useMutation({
+ mutationFn: ({
+ taskId,
+ }: {
+ baselineExecutionTime: string | null
+ taskId: string
+ toUri: string
+ }) => triggerWatch(taskId),
+ onMutate: async ({ baselineExecutionTime, taskId, toUri }) => {
+ const syncId = Date.now()
+ setPendingSync({
+ baselineExecutionTime,
+ baselineTaskIds: null,
+ identityScopeKey,
+ syncId,
+ taskId,
+ toUri,
+ })
+ try {
+ const baselineTasks = await fetchWatchProcessingHistory(toUri)
+ setPendingSync((current) =>
+ current?.syncId === syncId
+ ? {
+ ...current,
+ baselineTaskIds: baselineTasks.flatMap((task) =>
+ task.task_id ? [task.task_id] : [],
+ ),
+ }
+ : current,
+ )
+ } catch {
+ // Fall back to the Watch execution time while the trigger proceeds.
+ }
+ },
+ onSuccess: async () => {
+ await Promise.all([
+ refreshWatches(),
+ queryClient.invalidateQueries({
+ queryKey: ['watch-sync-progress', identityScopeKey],
+ }),
+ ])
+ toast.success(t('toast.triggered'))
+ },
+ onError: (error) => {
+ setPendingSync(null)
+ toast.error(getErrorMessage(error))
+ },
+ })
+ const deleteMutation = useMutation({
+ mutationFn: deleteWatch,
+ onSuccess: async () => {
+ await refreshWatches()
+ setDeletingWatch(null)
+ toast.success(t('toast.deleted'))
+ },
+ onError: (error) => toast.error(getErrorMessage(error)),
+ })
+
+ const formatTime = (value: string | null) => {
+ if (!value) return t('never')
+ const date = new Date(value)
+ if (Number.isNaN(date.getTime())) return value
+ return new Intl.DateTimeFormat(i18n.resolvedLanguage, {
+ dateStyle: 'medium',
+ timeStyle: 'short',
+ }).format(date)
+ }
+
+ return (
+ <div className="flex w-full min-w-0 flex-col gap-5">
+ <header className="flex flex-wrap items-start justify-between gap-3">
+ <div className="grid gap-1.5">
+ <h1 className="text-2xl font-semibold tracking-tight">
+ {t('title')}
+ </h1>
+ <p className="max-w-3xl text-sm leading-6 text-muted-foreground">
+ {t('description')}
+ </p>
+ </div>
+ <div className="flex items-center gap-2">
+ <Button
+ type="button"
+ variant="outline"
+ size="sm"
+ disabled={watchesQuery.isFetching}
+ onClick={() => void watchesQuery.refetch()}
+ >
+ <RefreshCwIcon
+ className={watchesQuery.isFetching ? 'animate-spin' : undefined}
+ />
+ {t('refresh')}
+ </Button>
+ <Button
+ type="button"
+ size="sm"
+ disabled={isCreatingWatch}
+ onClick={() => setAddOpen(true)}
+ >
+ <PlusIcon />
+ {t(isCreatingWatch ? 'adding' : 'add')}
+ </Button>
+ </div>
+ </header>
+
+ {isCreatingWatch ? (
+ <div
+ role="status"
+ aria-live="polite"
+ className="flex items-start gap-3 rounded-xl border border-sky-500/25 bg-sky-500/10 px-4 py-3 text-sky-800 dark:text-sky-300"
+ >
+ <RefreshCwIcon className="mt-0.5 size-4 shrink-0 animate-spin" />
+ <div className="grid gap-0.5">
+ <p className="text-sm font-medium">{t('creation.title')}</p>
+ <p className="text-xs leading-5 text-sky-700/80 dark:text-sky-300/75">
+ {t('creation.description')}
+ </p>
+ </div>
+ </div>
+ ) : null}
+
+ <Card className="overflow-hidden py-0">
+ {watchesQuery.isLoading ? (
+ <PageState icon={<RefreshCwIcon className="animate-spin" />}>
+ {t('loading')}
+ </PageState>
+ ) : watchesQuery.isError ? (
+ <PageState icon={<Clock3Icon />}>
+ <span>{t('loadFailed')}</span>
+ <span className="max-w-xl text-xs text-muted-foreground">
+ {getErrorMessage(watchesQuery.error)}
+ </span>
+ </PageState>
+ ) : watches.length === 0 ? (
+ <PageState icon={<Clock3Icon />}>
+ <span>{t('empty')}</span>
+ <span className="text-xs text-muted-foreground">
+ {t('emptyDescription')}
+ </span>
+ </PageState>
+ ) : (
+ <Table>
+ <TableHeader>
+ <TableRow>
+ <TableHead className="min-w-56">
+ {t('columns.resource')}
+ </TableHead>
+ <TableHead className="min-w-52">
+ {t('columns.source')}
+ </TableHead>
+ <TableHead>{t('columns.status')}</TableHead>
+ <TableHead>{t('columns.interval')}</TableHead>
+ <TableHead className="min-w-40">
+ {t('columns.lastRun')}
+ </TableHead>
+ <TableHead className="min-w-40">
+ {t('columns.nextRun')}
+ </TableHead>
+ <TableHead className="min-w-40 text-right">
+ {t('columns.actions')}
+ </TableHead>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {watches.map((watch) => {
+ const isSyncing =
+ pendingSync?.identityScopeKey === identityScopeKey &&
+ pendingSync.taskId === watch.taskId
+
+ return (
+ <TableRow key={watch.taskId}>
+ <TableCell>
+ <div
+ className="max-w-72 truncate font-mono text-xs"
+ title={watch.toUri}
+ >
+ {watch.toUri}
+ </div>
+ </TableCell>
+ <TableCell>
+ <div
+ className="max-w-64 truncate text-xs"
+ title={watch.path}
+ >
+ {watch.path}
+ </div>
+ </TableCell>
+ <TableCell>
+ <div className="flex items-center gap-2">
+ <Switch
+ size="sm"
+ checked={watch.isActive}
+ disabled={updateMutation.isPending}
+ aria-label={t(
+ watch.isActive
+ ? 'actions.disable'
+ : 'actions.enable',
+ )}
+ onCheckedChange={(checked) =>
+ updateMutation.mutate({
+ input: { isActive: checked },
+ taskId: watch.taskId,
+ })
+ }
+ />
+ <span className="text-xs text-muted-foreground">
+ {t(
+ watch.isActive
+ ? 'status.active'
+ : 'status.disabled',
+ )}
+ </span>
+ </div>
+ </TableCell>
+ <TableCell>
+ {formatInterval(watch.watchInterval, t)}
+ </TableCell>
+ <TableCell className="text-xs text-muted-foreground">
+ {formatTime(watch.lastExecutionTime)}
+ </TableCell>
+ <TableCell className="text-xs text-muted-foreground">
+ {formatTime(watch.nextExecutionTime)}
+ </TableCell>
+ <TableCell className="whitespace-nowrap">
+ <div className="flex flex-wrap justify-end gap-1">
+ <ActionButton
+ label={t(
+ isSyncing ? 'actions.syncing' : 'actions.trigger',
+ )}
+ disabled={
+ !watch.isActive ||
+ triggerMutation.isPending ||
+ pendingSync !== null
+ }
+ onClick={() =>
+ triggerMutation.mutate({
+ baselineExecutionTime: watch.lastExecutionTime,
+ taskId: watch.taskId,
+ toUri: watch.toUri,
+ })
+ }
+ >
+ <RotateCwIcon
+ className={isSyncing ? 'animate-spin' : undefined}
+ />
+ </ActionButton>
+ <ActionButton
+ label={t('actions.edit')}
+ disabled={updateMutation.isPending}
+ onClick={() => setEditingWatch(watch)}
+ >
+ <PencilIcon />
+ </ActionButton>
+ <DropdownMenu>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ type="button"
+ size="sm"
+ variant="ghost"
+ className="h-8 px-2 text-xs"
+ aria-label={t('actions.more')}
+ title={t('actions.more')}
+ />
+ }
+ >
+ <EllipsisIcon />
+ <span>{t('actions.more')}</span>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end">
+ <DropdownMenuItem
+ onClick={() => setHistoryWatch(watch)}
+ >
+ <HistoryIcon />
+ {t('actions.history')}
+ </DropdownMenuItem>
+ <DropdownMenuItem
+ variant="destructive"
+ disabled={deleteMutation.isPending}
+ onClick={() => setDeletingWatch(watch)}
+ >
+ <Trash2Icon />
+ {t('actions.delete')}
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </div>
+ </TableCell>
+ </TableRow>
+ )
+ })}
+ </TableBody>
+ </Table>
+ )}
+ </Card>
+
+ <Dialog open={addOpen} onOpenChange={setAddOpen}>
+ <DialogContent className="max-h-[min(86vh,760px)] gap-0 overflow-hidden p-0 sm:max-w-4xl">
+ <DialogHeader className="border-b px-6 py-5">
+ <DialogTitle className="text-xl">
+ {t('addDialog.title')}
+ </DialogTitle>
+ <DialogDescription>{t('addDialog.description')}</DialogDescription>
+ </DialogHeader>
+ <div className="max-h-[calc(min(86vh,760px)-6rem)] overflow-y-auto px-6 py-5">
+ <AddResourceForm
+ initialMode="remote"
+ initialWatchEnabled
+ onAccepted={discoverWatch}
+ onCompleted={() => {
+ void refreshWatches()
+ if (watchCreationTargetRef.current === null) {
+ finishWatchCreation()
+ }
+ }}
+ onFailed={failWatchCreation}
+ onSubmitted={() => {
+ beginWatchCreation()
+ setAddOpen(false)
+ }}
+ />
+ </div>
+ </DialogContent>
+ </Dialog>
+
+ <WatchHistorySheet
+ identityScopeKey={identityScopeKey}
+ open={historyWatch !== null}
+ watch={historyWatch}
+ onOpenChange={(open) => {
+ if (!open) setHistoryWatch(null)
+ }}
+ />
+
+ <EditWatchDialog
+ watch={editingWatch}
+ pending={updateMutation.isPending}
+ onOpenChange={(open) => !open && setEditingWatch(null)}
+ onSubmit={(input) => {
+ if (!editingWatch) return
+ updateMutation.mutate({
+ input,
+ taskId: editingWatch.taskId,
+ })
+ }}
+ />
+
+ <AlertDialog
+ open={Boolean(deletingWatch)}
+ onOpenChange={(open) => !open && setDeletingWatch(null)}
+ >
+ <AlertDialogContent>
+ <AlertDialogHeader>
+ <AlertDialogTitle>{t('deleteDialog.title')}</AlertDialogTitle>
+ <AlertDialogDescription>
+ {t('deleteDialog.description', {
+ uri: deletingWatch?.toUri ?? '',
+ })}
+ </AlertDialogDescription>
+ </AlertDialogHeader>
+ <AlertDialogFooter>
+ <AlertDialogCancel disabled={deleteMutation.isPending}>
+ {t('cancel')}
+ </AlertDialogCancel>
+ <AlertDialogAction
+ disabled={deleteMutation.isPending}
+ onClick={(event) => {
+ event.preventDefault()
+ if (deletingWatch) {
+ deleteMutation.mutate(deletingWatch.taskId)
+ }
+ }}
+ >
+ {t('actions.delete')}
+ </AlertDialogAction>
+ </AlertDialogFooter>
+ </AlertDialogContent>
+ </AlertDialog>
+ </div>
+ )
+}
+
+function ActionButton({
+ children,
+ disabled,
+ label,
+ onClick,
+}: {
+ children: React.ReactNode
+ disabled?: boolean
+ label: string
+ onClick: () => void
+}) {
+ return (
+ <Button
+ type="button"
+ size="sm"
+ variant="ghost"
+ className="h-8 px-2 text-xs"
+ title={label}
+ aria-label={label}
+ disabled={disabled}
+ onClick={onClick}
+ >
+ {children}
+ <span>{label}</span>
+ </Button>
+ )
+}
+
+function PageState({
+ children,
+ icon,
+}: {
+ children: React.ReactNode
+ icon: React.ReactNode
+}) {
+ return (
+ <div className="flex min-h-64 flex-col items-center justify-center gap-2 px-6 text-center text-sm [&_svg]:size-7 [&_svg]:text-muted-foreground">
+ {icon}
+ {children}
+ </div>
+ )
+}
+
+function formatInterval(
+ minutes: number,
+ t: ReturnType<typeof useTranslation<'watchesPage'>>['t'],
+): string {
+ if (minutes % 1440 === 0) return t('interval.days', { count: minutes / 1440 })
+ if (minutes % 60 === 0) return t('interval.hours', { count: minutes / 60 })
+ return t('interval.minutes', { count: minutes })
+}
+
+function getErrorMessage(error: unknown): string {
+ return error instanceof Error ? error.message : String(error)
+}
diff --git a/web-studio/vite.config.ts b/web-studio/vite.config.ts
index 825087799..523d26fe0 100644
--- a/web-studio/vite.config.ts
+++ b/web-studio/vite.config.ts
@@ -12,7 +12,11 @@ const config = defineConfig({
devtools(),
tsconfigPaths({ projects: ['./tsconfig.json'] }),
tailwindcss(),
- tanstackRouter({ target: 'react', autoCodeSplitting: true }),
+ tanstackRouter({
+ target: 'react',
+ autoCodeSplitting: true,
+ routeFileIgnorePattern: '(resource-upload|task-model|route\\.test)\\.',
+ }),
viteReact(),
],
})