@tano.page/workbench 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/package.json +21 -8
  2. package/src/App.vue +76 -17
  3. package/src/appearance/appearance.ts +14 -4
  4. package/src/appearance/components/ThemePresetPreview.vue +52 -8
  5. package/src/appearance/interface-font.ts +99 -0
  6. package/src/appearance/theme.ts +26 -10
  7. package/src/appearance/use-interface-font.ts +30 -0
  8. package/src/assets/mail-provider-icons/NOTICE.txt +27 -0
  9. package/src/assets/mail-provider-icons/aliyun-mail.svg +3 -0
  10. package/src/assets/mail-provider-icons/gmail.svg +1 -0
  11. package/src/assets/mail-provider-icons/icloud.svg +12 -0
  12. package/src/assets/mail-provider-icons/netease-126.svg +5 -0
  13. package/src/assets/mail-provider-icons/netease-163.svg +5 -0
  14. package/src/assets/mail-provider-icons/qq.svg +9 -0
  15. package/src/assets/mail-provider-icons/tencent-exmail.svg +4 -0
  16. package/src/assistant/components/AssistantChangeList.vue +98 -21
  17. package/src/assistant/components/AssistantPanel.vue +424 -7
  18. package/src/assistant/components/PluginToolProposalCard.vue +235 -0
  19. package/src/assistant/engine.ts +56 -3
  20. package/src/assistant/files.ts +5 -13
  21. package/src/assistant/inbox.ts +1 -148
  22. package/src/assistant/locales/de-DE.json +4 -1
  23. package/src/assistant/locales/en-US.json +4 -1
  24. package/src/assistant/locales/es-ES.json +4 -1
  25. package/src/assistant/locales/ja-JP.json +4 -1
  26. package/src/assistant/locales/zh-CN.json +4 -1
  27. package/src/assistant/locales/zh-TW.json +4 -1
  28. package/src/assistant/mention-autocomplete.ts +69 -0
  29. package/src/assistant/prompts.ts +7 -0
  30. package/src/assistant/results.ts +20 -86
  31. package/src/assistant/store.ts +319 -12
  32. package/src/assistant/structures.ts +7 -5
  33. package/src/assistant/tasks.ts +3 -5
  34. package/src/assistant/workspace-bridge.ts +1 -1
  35. package/src/composables/use-document-actions.ts +38 -20
  36. package/src/composables/use-file-tree-controller.ts +7 -12
  37. package/src/composables/use-workbench-history.ts +2 -4
  38. package/src/composables/use-workbench-modals.ts +6 -1
  39. package/src/composables/use-workbench-outline.ts +0 -5
  40. package/src/composables/use-workbench-shortcuts.ts +26 -22
  41. package/src/data-tables/data-tables.ts +1 -2
  42. package/src/documents/components/DocumentHistoryPanel.vue +3 -1
  43. package/src/features.ts +1 -0
  44. package/src/fonts/Inter-Latin-Italic.woff2 +0 -0
  45. package/src/fonts/Inter-Latin.woff2 +0 -0
  46. package/src/fonts/TanoUISansSC-Bold.woff2 +0 -0
  47. package/src/fonts/TanoUISansSC-Medium.woff2 +0 -0
  48. package/src/fonts/TanoUISansSC-Regular.woff2 +0 -0
  49. package/src/help/help-milestones.ts +3 -5
  50. package/src/i18n/locales/de-DE.json +349 -3
  51. package/src/i18n/locales/en-US.json +349 -2
  52. package/src/i18n/locales/es-ES.json +349 -3
  53. package/src/i18n/locales/ja-JP.json +348 -2
  54. package/src/i18n/locales/zh-TW.json +348 -2
  55. package/src/mail/components/MailAccountDialog.vue +449 -0
  56. package/src/mail/components/MailComposerDialog.vue +325 -0
  57. package/src/mail/components/MailProviderIcon.vue +30 -0
  58. package/src/mail/components/MailWorkspaceView.vue +820 -0
  59. package/src/mail/components/SidebarMail.vue +133 -0
  60. package/src/mail/mail-avatar.ts +17 -0
  61. package/src/mail/mail-bridge.ts +68 -0
  62. package/src/mail/mail-calendar.ts +208 -0
  63. package/src/mail/mail-markdown.ts +195 -0
  64. package/src/mail/types.ts +226 -0
  65. package/src/objects/components/ObjectDetailModal.vue +1001 -0
  66. package/src/objects/workspace-objects.ts +1 -1
  67. package/src/plan-sync/types.ts +6 -3
  68. package/src/plans/calendar-interaction.ts +194 -0
  69. package/src/plans/calendar.ts +63 -7
  70. package/src/plans/components/CalendarDayPopover.vue +172 -39
  71. package/src/plans/components/CalendarView.vue +1736 -276
  72. package/src/plans/components/PlanArchiveDialog.vue +295 -0
  73. package/src/plans/components/PlanDateField.vue +6 -4
  74. package/src/plans/components/PlanDetailPanel.vue +227 -32
  75. package/src/plans/components/PlanEventList.vue +16 -4
  76. package/src/plans/components/SidebarPlan.vue +22 -15
  77. package/src/plans/components/TaskRepeatControls.vue +169 -30
  78. package/src/plans/local-reminders.ts +149 -0
  79. package/src/plans/personal-plans.ts +10 -1
  80. package/src/plans/plan-date.ts +8 -1
  81. package/src/plans/plan-migration.ts +95 -0
  82. package/src/plans/recurrence.ts +95 -0
  83. package/src/plans/task-repeat.ts +8 -8
  84. package/src/plans/timeline-layout.ts +92 -0
  85. package/src/plugins/assistant-bridge.ts +520 -0
  86. package/src/plugins/attachment-reader.ts +3 -1
  87. package/src/plugins/cache-storage.ts +42 -2
  88. package/src/plugins/components/PluginAutomations.vue +3 -3
  89. package/src/plugins/components/PluginCatalogBrowser.vue +17 -8
  90. package/src/plugins/components/PluginChangeSummary.vue +16 -3
  91. package/src/plugins/components/PluginConnections.vue +1 -1
  92. package/src/plugins/components/PluginCustomView.vue +2 -2
  93. package/src/plugins/components/PluginDetailPage.vue +129 -54
  94. package/src/plugins/components/PluginDocumentSlot.vue +63 -0
  95. package/src/plugins/components/PluginExplorer.vue +15 -21
  96. package/src/plugins/components/PluginImportDialog.vue +410 -0
  97. package/src/plugins/components/PluginInstaller.vue +39 -145
  98. package/src/plugins/components/PluginListItem.vue +3 -0
  99. package/src/plugins/components/PluginMaintenance.vue +21 -6
  100. package/src/plugins/components/PluginRuntimePanel.vue +3 -3
  101. package/src/plugins/components/PluginSettingsForm.vue +111 -0
  102. package/src/plugins/components/PluginStatusBar.vue +161 -0
  103. package/src/plugins/components/PluginSurface.vue +18 -6
  104. package/src/plugins/components/PluginUiDialog.vue +452 -0
  105. package/src/plugins/excalidraw/bundle.tano-plugin.json +1 -1
  106. package/src/plugins/excalidraw/manifest.json +12 -1
  107. package/src/plugins/host.ts +662 -43
  108. package/src/plugins/native.ts +2 -10
  109. package/src/plugins/overlay-mapping.ts +125 -0
  110. package/src/plugins/packages.ts +73 -1
  111. package/src/plugins/plugin-permissions.ts +57 -0
  112. package/src/plugins/plugin-sdk.ts +174 -8
  113. package/src/plugins/policy.ts +53 -3
  114. package/src/plugins/presentation-preview/bundle.tano-plugin.json +1 -1
  115. package/src/plugins/presentation-preview/manifest.json +2 -1
  116. package/src/plugins/queries.ts +3 -1
  117. package/src/plugins/sandbox.ts +15 -1
  118. package/src/plugins/use-plugin-actions.ts +67 -20
  119. package/src/plugins/user-plugins.ts +254 -0
  120. package/src/plugins/word-preview/bundle.tano-plugin.json +1 -1
  121. package/src/plugins/word-preview/manifest.json +13 -1
  122. package/src/plugins/workbench.ts +175 -2
  123. package/src/plugins/worker.js +105 -8
  124. package/src/plugins/workspace-plugin-runtime.ts +23 -7
  125. package/src/plugins/workspace-plugins.ts +212 -21
  126. package/src/runtime.ts +101 -3
  127. package/src/settings/components/SettingsAppearancePage.vue +46 -0
  128. package/src/settings/components/SettingsDocumentsPage.vue +0 -1
  129. package/src/settings/components/settings-search.ts +2 -3
  130. package/src/shell/components/SidebarNavigation.vue +22 -2
  131. package/src/shell/components/WorkbenchContextMenus.vue +21 -8
  132. package/src/shell/components/WorkbenchModals.vue +27 -46
  133. package/src/shell/components/WorkbenchPanes.vue +267 -84
  134. package/src/shell/components/WorkspaceBreadcrumb.vue +6 -14
  135. package/src/shell/components/WorkspaceViewSwitcher.vue +12 -7
  136. package/src/shell/use-workbench.ts +116 -145
  137. package/src/shell/workbench-async-components.ts +14 -5
  138. package/src/stores/mail.ts +414 -0
  139. package/src/stores/plan-sync.ts +2 -1
  140. package/src/stores/plans.ts +2 -9
  141. package/src/stores/workspace-knowledge.ts +1 -113
  142. package/src/stores/workspace-plugins-state.ts +537 -14
  143. package/src/stores/workspace-tabs-layout.ts +5 -43
  144. package/src/stores/workspace.ts +69 -66
  145. package/src/styles/agent-diff-modals.css +0 -7
  146. package/src/styles/dark-theme.css +3 -3
  147. package/src/styles/inspector.css +0 -59
  148. package/src/styles/layout-themes.css +346 -0
  149. package/src/styles/mail.css +1568 -0
  150. package/src/styles/mobile.css +2 -2
  151. package/src/styles/recent-and-media.css +0 -17
  152. package/src/styles/theme-contract.css +3 -3
  153. package/src/styles/workbench-shell.css +110 -17
  154. package/src/styles/workspace-states.css +9 -33
  155. package/src/styles.css +1 -1
  156. package/src/tabs/components/DesktopTabs.vue +0 -3
  157. package/src/tabs/components/NewTabPicker.vue +10 -4
  158. package/src/tabs/tab-label.ts +0 -1
  159. package/src/workspace/components/WorkspaceGeneralSettings.vue +0 -13
  160. package/src/workspace/components/WorkspaceIconPicker.vue +28 -6
  161. package/src/workspace/workspace-comments.ts +11 -151
  162. package/src/workspace/workspace-welcome.ts +1 -1
  163. package/src/documents/components/FormulaMenu.vue +0 -50
  164. package/src/files/components/FileDatabasePage.vue +0 -152
  165. package/src/files/components/FolderHomeIcon.vue +0 -12
  166. package/src/objects/components/ObjectDatabasePage.vue +0 -100
  167. package/src/objects/components/ObjectPanel.vue +0 -554
  168. package/src/plans/components/PersonalPlanDialog.vue +0 -105
  169. package/src/shell/components/WorkspaceViewPage.vue +0 -127
  170. package/src/shell/components/WorkspaceViewTab.vue +0 -24
  171. package/src/styles/object-panel.css +0 -163
  172. package/src/workspace/components/GitInspectionPanel.vue +0 -35
  173. package/src/workspace/components/WorkspaceSyncPanel.vue +0 -50
  174. package/src/workspace/welcome-slogans.ts +0 -11
  175. package/src/workspace/workspace-git.ts +0 -35
  176. package/src/workspace/workspace-sync.ts +0 -46
  177. package/src/workspace/workspace-views.ts +0 -48
@@ -17,7 +17,7 @@ import { recordHelpCompleted } from '../help/help-checklist';
17
17
  import { t } from '../i18n/i18n';
18
18
  import { dockLayout, layoutPanes, reconcileLayout, type PaneDrop } from '../shell/pane-layout';
19
19
  import { bundledPluginCatalog } from '../plugins/plugin-catalog';
20
- import { pluginViewKey, type PluginWorkbenchView } from '../plugins/workbench';
20
+ import { isPluginPreviewTab, type PluginWorkbenchView } from '../plugins/workbench';
21
21
  import type { WorkbenchViewTab } from '../runtime';
22
22
  import { useTabNavigation } from '../tabs/tab-navigation';
23
23
  import {
@@ -28,7 +28,6 @@ import {
28
28
  type WindowLayouts,
29
29
  } from '../windows/layout';
30
30
  import { PLUGINS_TAB_ID, type InstalledObjectPlugin } from '../plugins/workspace-plugins';
31
- import type { WorkspaceViewRecord } from '../workspace/workspace-views';
32
31
  import type { DocumentTab } from './workspace';
33
32
 
34
33
  export interface WorkspaceTabsLayoutDeps {
@@ -37,7 +36,6 @@ export interface WorkspaceTabsLayoutDeps {
37
36
  documents: Ref<OpenDocument[]>;
38
37
  documentIndex: ReturnType<typeof useDocumentIndex>;
39
38
  dataTables: ReturnType<typeof createDataTableController>;
40
- workspaceViews: Ref<WorkspaceViewRecord[]>;
41
39
  installedPlugins: Ref<InstalledObjectPlugin[]>;
42
40
  pluginViews: Ref<PluginWorkbenchView[]>;
43
41
  activePluginSidebar: Ref<string>;
@@ -48,7 +46,6 @@ export interface WorkspaceTabsLayoutDeps {
48
46
  tables: boolean;
49
47
  plugins: boolean;
50
48
  objects: boolean;
51
- views: boolean;
52
49
  relations: boolean;
53
50
  capabilities: boolean;
54
51
  }>;
@@ -79,7 +76,6 @@ export function createWorkspaceTabsLayout(deps: WorkspaceTabsLayoutDeps) {
79
76
  documents,
80
77
  documentIndex,
81
78
  dataTables,
82
- workspaceViews,
83
79
  installedPlugins,
84
80
  pluginViews,
85
81
  activePluginSidebar,
@@ -99,15 +95,6 @@ export function createWorkspaceTabsLayout(deps: WorkspaceTabsLayoutDeps) {
99
95
  } = deps;
100
96
 
101
97
  const views = shallowRef<ReadonlyMap<string, WorkbenchViewTab>>(new Map());
102
- const workspaceViewTabPrefix = 'workspace-view:';
103
- const workspaceViewTabId = (id: string) => `${workspaceViewTabPrefix}${id}`;
104
- const workspaceViewId = (id: string) =>
105
- id.startsWith(workspaceViewTabPrefix) ? id.slice(workspaceViewTabPrefix.length) : undefined;
106
- const isWorkspaceViewTab = (id: string) => !!workspaceViewId(id);
107
- const hasWorkspaceViewTab = (id: string) => {
108
- const viewId = workspaceViewId(id);
109
- return viewId !== undefined && workspaceViews.value.some((record) => record.view.id === viewId);
110
- };
111
98
  const isDirectoryTab = (id: string) => id.startsWith('directory:');
112
99
  function directoryForTab(id: string) {
113
100
  if (!isDirectoryTab(id)) return undefined;
@@ -126,8 +113,6 @@ export function createWorkspaceTabsLayout(deps: WorkspaceTabsLayoutDeps) {
126
113
  ? (installedPlugins.value.find((item) => `plugin:${item.manifest.id}` === id)?.manifest ??
127
114
  bundledPluginCatalog.find((item) => `plugin:${item.manifest.id}` === id)?.manifest)
128
115
  : undefined;
129
- const wordPreviewTab = pluginViewKey('word-preview', 'document');
130
- const presentationPreviewTab = pluginViewKey('presentation-preview', 'slides');
131
116
  const attachmentForTab = (id: string) =>
132
117
  id.startsWith('attachment:') ? fileRegistry.value?.get(id.slice('attachment:'.length)) : undefined;
133
118
  const isNavigationPage = (id: string) =>
@@ -136,10 +121,8 @@ export function createWorkspaceTabsLayout(deps: WorkspaceTabsLayoutDeps) {
136
121
  id === GRAPH_TAB_ID ||
137
122
  id === PLUGINS_TAB_ID ||
138
123
  isTableTab(id) ||
139
- hasWorkspaceViewTab(id) ||
140
124
  id.startsWith('attachment:') ||
141
- id === wordPreviewTab ||
142
- id === presentationPreviewTab;
125
+ isPluginPreviewTab(id, installedPlugins.value);
143
126
  const isBuiltinTab = (id: string) =>
144
127
  isDirectoryTab(id) ||
145
128
  id.startsWith('blank:') ||
@@ -148,8 +131,7 @@ export function createWorkspaceTabsLayout(deps: WorkspaceTabsLayoutDeps) {
148
131
  id === GRAPH_TAB_ID ||
149
132
  id === PLUGINS_TAB_ID ||
150
133
  id === CALENDAR_TAB_ID ||
151
- isTableTab(id) ||
152
- hasWorkspaceViewTab(id);
134
+ isTableTab(id);
153
135
  const isUtilityTab = (id: string) =>
154
136
  isBuiltinTab(id) ||
155
137
  views.value.has(id) ||
@@ -393,7 +375,7 @@ export function createWorkspaceTabsLayout(deps: WorkspaceTabsLayoutDeps) {
393
375
  busy: () => busy.value,
394
376
  available: (id) => {
395
377
  if (id.startsWith('attachment:')) return !!attachmentForTab(id);
396
- if (id === wordPreviewTab || id === presentationPreviewTab)
378
+ if (isPluginPreviewTab(id, installedPlugins.value))
397
379
  return pluginViews.value.some((view) => view.key === id);
398
380
  const file = fileRegistry.value?.get(id);
399
381
  return (
@@ -455,18 +437,6 @@ export function createWorkspaceTabsLayout(deps: WorkspaceTabsLayoutDeps) {
455
437
  if (!definitions.some((view) => view.location === 'sidebar' && view.key === activePluginSidebar.value))
456
438
  activePluginSidebar.value = '';
457
439
  });
458
- watch(workspaceViews, (definitions) => {
459
- if (workspaceLoading.value.views) return;
460
- const keys = new Set(definitions.map((record) => workspaceViewTabId(record.view.id)));
461
- const remaining = tabIds.value.filter((id) => !isWorkspaceViewTab(id) || keys.has(id));
462
- if (remaining.length !== tabIds.value.length) {
463
- for (const id of tabIds.value) if (!remaining.includes(id)) removeTabNavigation(id);
464
- tabIds.value = remaining;
465
- if (isWorkspaceViewTab(activeId.value) && !keys.has(activeId.value))
466
- activeId.value = tabIds.value[0] ?? '';
467
- }
468
- });
469
-
470
440
  const active = computed(() => documentIndex.byId.value.get(tabTarget(activeId.value)));
471
441
  const tabs = computed<DocumentTab[]>(() =>
472
442
  tabIds.value.map((id) => {
@@ -483,9 +453,6 @@ export function createWorkspaceTabsLayout(deps: WorkspaceTabsLayoutDeps) {
483
453
  : undefined;
484
454
  const tablePath = tableFile ? displayPath(tableFile) : table?.path;
485
455
  const directory = directoryForTab(targetId);
486
- const workspaceView = workspaceViews.value.find(
487
- (record) => workspaceViewTabId(record.view.id) === targetId,
488
- );
489
456
  return {
490
457
  id,
491
458
  pluginDetail: pluginDetailManifest(targetId),
@@ -499,13 +466,12 @@ export function createWorkspaceTabsLayout(deps: WorkspaceTabsLayoutDeps) {
499
466
  ? displayPath(attachment)
500
467
  : tableFile
501
468
  ? displayPath(tableFile)
502
- : (workspaceView?.path ?? tablePath ?? (attachmentPreview ? '附件不可用' : '')))),
469
+ : (tablePath ?? (attachmentPreview ? '附件不可用' : '')))),
503
470
  blank: id.startsWith('blank:'),
504
471
  graph: id === GRAPH_TAB_ID,
505
472
  plugins: id === PLUGINS_TAB_ID,
506
473
  calendar: id === CALENDAR_TAB_ID,
507
474
  view: views.value.get(id),
508
- workspaceView,
509
475
  pluginView: pluginViews.value.find((view) => view.key === id && view.location === 'tab'),
510
476
  document,
511
477
  attachmentPreview,
@@ -643,11 +609,7 @@ export function createWorkspaceTabsLayout(deps: WorkspaceTabsLayoutDeps) {
643
609
 
644
610
  return {
645
611
  views,
646
- workspaceViewTabId,
647
- isWorkspaceViewTab,
648
612
  pluginDetailManifest,
649
- wordPreviewTab,
650
- presentationPreviewTab,
651
613
  attachmentForTab,
652
614
  isNavigationPage,
653
615
  isUtilityTab,
@@ -21,7 +21,7 @@ import {
21
21
  } from '@tano/protocol';
22
22
  import { createWorkspaceAssistantBridge } from '../assistant/workspace-bridge';
23
23
  import { createDataTableController } from '../data-tables/data-table-controller';
24
- import { isTableTab, TABLES_TAB_ID, tableFileId, tableTabId } from '../data-tables/data-tables';
24
+ import { isTableTab, tableFileId, tableTabId } from '../data-tables/data-tables';
25
25
  import { GRAPH_TAB_ID } from '../documents/document-graph';
26
26
  import { useDocumentIndex } from '../documents/document-index';
27
27
  import { createDocumentSession, documentDirty as dirty, type OpenDocument } from '../documents/document-session';
@@ -30,7 +30,11 @@ import { recordHelpCompleted } from '../help/help-checklist';
30
30
  import { createHelpEditQueue } from '../help/help-edit-queue';
31
31
  import { optimisticFiles } from '../files/optimistic-files';
32
32
  import { layoutPanes, restoreLayout } from '../shell/pane-layout';
33
- import type { PluginWorkbenchView } from '../plugins/workbench';
33
+ import {
34
+ resolvePluginFileHandler,
35
+ type PluginWorkbenchFileHandler,
36
+ type PluginWorkbenchView,
37
+ } from '../plugins/workbench';
34
38
  import { useWorkbenchRuntime, type WorkbenchViewTab } from '../runtime';
35
39
  import { SessionJournal } from '../shell/session-journal';
36
40
  import {
@@ -42,7 +46,6 @@ import {
42
46
  import { WorkspaceLifecycle } from '../workspace/workspace-lifecycle';
43
47
  import { PLUGINS_TAB_ID, type InstalledObjectPlugin } from '../plugins/workspace-plugins';
44
48
  import { readStartupWorkspace, rememberStartupWorkspace } from '../workspace/workspace-startup';
45
- import type { WorkspaceViewRecord } from '../workspace/workspace-views';
46
49
  import { addWorkspaceWelcome, workspaceWelcomePath } from '../workspace/workspace-welcome';
47
50
  import { createWorkspaceFileOps } from './workspace-file-ops';
48
51
  import { createWorkspaceKnowledge } from './workspace-knowledge';
@@ -60,7 +63,6 @@ export interface DocumentTab {
60
63
  plugins: boolean;
61
64
  calendar: boolean;
62
65
  view?: WorkbenchViewTab;
63
- workspaceView?: WorkspaceViewRecord;
64
66
  directory?: { path: string; name: string; missing: boolean };
65
67
  pluginView?: PluginWorkbenchView;
66
68
  pluginDetail?: PluginManifest;
@@ -114,7 +116,6 @@ export const useWorkspaceStore = defineStore('workspace', () => {
114
116
  tables: false,
115
117
  plugins: false,
116
118
  objects: false,
117
- views: false,
118
119
  relations: false,
119
120
  capabilities: false,
120
121
  });
@@ -247,7 +248,7 @@ export const useWorkspaceStore = defineStore('workspace', () => {
247
248
  report,
248
249
  });
249
250
 
250
- // 2. Knowledge (objects, relations, workspace views/databases, metadata, templates, repeats, references)
251
+ // 2. Knowledge (objects, relations, metadata, templates, repeats, references)
251
252
  const knowledge = createWorkspaceKnowledge({
252
253
  adapter,
253
254
  workspace,
@@ -262,7 +263,6 @@ export const useWorkspaceStore = defineStore('workspace', () => {
262
263
  loadWorkspacePart,
263
264
  refreshPlugins: (current) => plugins.refreshPlugins(current),
264
265
  disposePluginExecutor: () => plugins.pluginExecutor.dispose(),
265
- openWorkspaceView: (id, options) => openWorkspaceView(id, options),
266
266
  });
267
267
 
268
268
  // 3. Plugins state (plugin runtime, host/executor/developer, pluginCall, OAuth/connections/packages)
@@ -301,7 +301,6 @@ export const useWorkspaceStore = defineStore('workspace', () => {
301
301
  documents,
302
302
  documentIndex,
303
303
  dataTables,
304
- workspaceViews: knowledge.workspaceViews,
305
304
  installedPlugins,
306
305
  pluginViews: plugins.pluginViews,
307
306
  activePluginSidebar,
@@ -842,11 +841,9 @@ export const useWorkspaceStore = defineStore('workspace', () => {
842
841
  ...new Set([
843
842
  ...requested.filter(
844
843
  (id) =>
845
- id !== TABLES_TAB_ID &&
846
- (planned.has(id) ||
847
- tabsLayout.isUtilityTab(id) ||
848
- tabsLayout.isWorkspaceViewTab(id) ||
849
- id.startsWith('plugin:')),
844
+ planned.has(id) ||
845
+ tabsLayout.isUtilityTab(id) ||
846
+ id.startsWith('plugin:'),
850
847
  ),
851
848
  ...planned,
852
849
  ]),
@@ -918,7 +915,7 @@ export const useWorkspaceStore = defineStore('workspace', () => {
918
915
  ]);
919
916
  // Resolve legacy table identities only after table records are available.
920
917
  for (const id of saved.tabs ?? [])
921
- if (isTableTab(id) && id !== TABLES_TAB_ID)
918
+ if (isTableTab(id))
922
919
  remapped.set(id, tableTabId(dataTableFileId(tableFileId(id))));
923
920
  const byId = new Map(documents.value.map((doc) => [doc.id, doc]));
924
921
  documents.value = pendingDocs
@@ -928,8 +925,7 @@ export const useWorkspaceStore = defineStore('workspace', () => {
928
925
  ?.map((id) => remapped.get(id) ?? id)
929
926
  .filter(
930
927
  (id) =>
931
- id !== TABLES_TAB_ID &&
932
- (tabsLayout.isUtilityTab(id) || documents.value.some((doc) => doc.id === id)),
928
+ tabsLayout.isUtilityTab(id) || documents.value.some((doc) => doc.id === id),
933
929
  );
934
930
  tabIds.value = [...new Set([...(restored ?? []), ...documents.value.map((doc) => doc.id)])];
935
931
  const currentActive = remapped.get(activeId.value) ?? activeId.value;
@@ -1077,22 +1073,26 @@ export const useWorkspaceStore = defineStore('workspace', () => {
1077
1073
  recordHelpCompleted('folder-home');
1078
1074
  }
1079
1075
 
1080
- /** The bundled drawing plugin handles its own Markdown; disabled plugins keep source access. */
1081
- function drawingPluginHandles(file: FileEntry) {
1082
- return (
1083
- file.kind === 'file' &&
1084
- /\.excalidraw\.md$/i.test(file.path) &&
1085
- !!workspace.value &&
1086
- plugins.pluginRuntime.value.some(
1087
- (plugin) => plugin.id === 'excalidraw' && plugin.status === 'running',
1088
- )
1089
- );
1076
+ /** Running plugins that declare fileHandlers can handle compound-suffix Markdown or attachments. */
1077
+ function fileEditorHandler(file: FileEntry) {
1078
+ if (file.kind !== 'file' || !workspace.value || !isMarkdown(file.path)) return undefined;
1079
+ return resolvePluginFileHandler(file.path, 'editor', plugins.pluginFileHandlers.value);
1080
+ }
1081
+ function filePreviewHandler(file: FileEntry) {
1082
+ if (
1083
+ file.kind !== 'file' ||
1084
+ !workspace.value ||
1085
+ isMarkdown(file.path) ||
1086
+ isDataTableFilePath(file.path)
1087
+ )
1088
+ return undefined;
1089
+ return resolvePluginFileHandler(file.path, 'preview', plugins.pluginFileHandlers.value);
1090
1090
  }
1091
- async function openDrawingPlugin(file: FileEntry) {
1091
+ async function openFileWithEditorHandler(file: FileEntry, handler: PluginWorkbenchFileHandler) {
1092
1092
  const currentWorkspace = workspace.value;
1093
1093
  if (!currentWorkspace) return false;
1094
1094
  try {
1095
- await plugins.pluginExecutor.invoke('excalidraw', 'command', 'open', {
1095
+ await plugins.pluginExecutor.invoke(handler.pluginId, 'command', handler.command, {
1096
1096
  workspaceId: currentWorkspace.id,
1097
1097
  fileId: file.id,
1098
1098
  });
@@ -1102,17 +1102,17 @@ export const useWorkspaceStore = defineStore('workspace', () => {
1102
1102
  return false;
1103
1103
  }
1104
1104
  }
1105
- function officePluginId(file: FileEntry) {
1106
- return /\.pptx?$/i.test(file.path)
1107
- ? 'presentation-preview'
1108
- : /\.docx?$/i.test(file.path)
1109
- ? 'word-preview'
1110
- : undefined;
1105
+ function hasMarkdownFileHandler(file: FileEntry) {
1106
+ return !!fileEditorHandler(file);
1111
1107
  }
1112
1108
 
1113
- async function openFile(file: FileEntry, options?: { historyIndex?: number }) {
1114
- if (file.kind === 'file' && officePluginId(file)) return openAttachment(file, options);
1115
- if (drawingPluginHandles(file) && (await openDrawingPlugin(file))) return;
1109
+ async function openFile(
1110
+ file: FileEntry,
1111
+ options?: { historyIndex?: number; rawSource?: boolean },
1112
+ ) {
1113
+ if (filePreviewHandler(file)) return openAttachment(file, options);
1114
+ const editorHandler = options?.rawSource ? undefined : fileEditorHandler(file);
1115
+ if (editorHandler && (await openFileWithEditorHandler(file, editorHandler))) return;
1116
1116
  const creationAtRequest = fileOps.getCreationRevision();
1117
1117
  const request = ++fileOpenRevision;
1118
1118
  const paneId = tabsLayout.activePaneId.value;
@@ -1159,10 +1159,11 @@ export const useWorkspaceStore = defineStore('workspace', () => {
1159
1159
  }
1160
1160
  }
1161
1161
 
1162
- async function openFileInNewTab(file: FileEntry) {
1162
+ async function openFileInNewTab(file: FileEntry, options?: { rawSource?: boolean }) {
1163
1163
  try {
1164
- if (file.kind === 'file' && officePluginId(file)) return openAttachmentInNewTab(file);
1165
- if (drawingPluginHandles(file) && (await openDrawingPlugin(file))) return;
1164
+ if (filePreviewHandler(file)) return openAttachmentInNewTab(file);
1165
+ const editorHandler = options?.rawSource ? undefined : fileEditorHandler(file);
1166
+ if (editorHandler && (await openFileWithEditorHandler(file, editorHandler))) return;
1166
1167
  await serial(async () => {
1167
1168
  if (file.kind === 'file' && isDataTableFilePath(file.path)) {
1168
1169
  const target = tableTabId(dataTableFileId(file.id));
@@ -1211,17 +1212,11 @@ export const useWorkspaceStore = defineStore('workspace', () => {
1211
1212
  const activation = tabsLayout.getActivationRevision();
1212
1213
  const current = () => request === fileOpenRevision && !busy.value && !disposed;
1213
1214
  const target = `attachment:${file.id}`;
1214
- const pluginId = officePluginId(file);
1215
- const viewTab =
1216
- pluginId === 'word-preview' ? tabsLayout.wordPreviewTab : tabsLayout.presentationPreviewTab;
1215
+ const handler = filePreviewHandler(file);
1217
1216
  const usePlugin =
1218
- !!pluginId &&
1219
- plugins.pluginRuntime.value.some(
1220
- (plugin) => plugin.id === pluginId && plugin.status === 'running',
1221
- ) &&
1222
- plugins.pluginViews.value.some((view) => view.key === viewTab);
1223
- const id = usePlugin ? viewTab : target;
1224
- // The bundled viewers share a tab per plugin, while history follows individual files.
1217
+ !!handler && plugins.pluginViews.value.some((view) => view.key === handler.viewKey);
1218
+ const id = usePlugin && handler ? handler.viewKey : target;
1219
+ // Preview plugins share one tab per view while navigation history follows individual files.
1225
1220
  const opened = await openPageTab(id, {
1226
1221
  ...options,
1227
1222
  target,
@@ -1230,6 +1225,7 @@ export const useWorkspaceStore = defineStore('workspace', () => {
1230
1225
  if (
1231
1226
  !opened ||
1232
1227
  !usePlugin ||
1228
+ !handler ||
1233
1229
  !current() ||
1234
1230
  activeId.value !== id ||
1235
1231
  workspace.value?.id !== workspaceId
@@ -1237,7 +1233,7 @@ export const useWorkspaceStore = defineStore('workspace', () => {
1237
1233
  return;
1238
1234
  const previewActivation = tabsLayout.getActivationRevision();
1239
1235
  try {
1240
- await plugins.pluginExecutor.invoke(pluginId, 'command', 'open', {
1236
+ await plugins.pluginExecutor.invoke(handler.pluginId, 'command', handler.command, {
1241
1237
  workspaceId,
1242
1238
  fileId: file.id,
1243
1239
  viewAlreadyOpen: true,
@@ -1366,14 +1362,6 @@ export const useWorkspaceStore = defineStore('workspace', () => {
1366
1362
  if (path && !entry) return;
1367
1363
  await openPageTab(path ? `directory:${entry!.id}` : 'directory:/', options);
1368
1364
  }
1369
- async function openWorkspaceView(
1370
- id: string,
1371
- options?: { newTab?: boolean; historyIndex?: number },
1372
- ) {
1373
- if (!knowledge.workspaceViews.value.some((record) => record.view.id === id))
1374
- throw new Error('工作区视图已不存在,请刷新后重试');
1375
- await openPageTab(tabsLayout.workspaceViewTabId(id), options);
1376
- }
1377
1365
  async function openPluginDetail(
1378
1366
  pluginId: string,
1379
1367
  options?: { newTab?: boolean; historyIndex?: number },
@@ -1667,7 +1655,10 @@ export const useWorkspaceStore = defineStore('workspace', () => {
1667
1655
  resizeSplit: tabsLayout.resizeSplit,
1668
1656
  installedPlugins,
1669
1657
  installedPluginWorkspace: plugins.installedPluginWorkspace,
1658
+ personalCodePluginPolicy: plugins.personalCodePluginPolicy,
1670
1659
  pluginRuntime: plugins.pluginRuntime,
1660
+ pluginHostEnvironment: plugins.pluginHostEnvironment,
1661
+ userPluginIntegrities: plugins.userPluginIntegrities,
1671
1662
  canManagePlugins: plugins.canManagePlugins,
1672
1663
  canManageSettings: policy.canManageSettings,
1673
1664
  authorizePlugin: plugins.pluginServices.authorizePlugin,
@@ -1698,7 +1689,6 @@ export const useWorkspaceStore = defineStore('workspace', () => {
1698
1689
  relations: knowledge.relations,
1699
1690
  relationError: knowledge.relationError,
1700
1691
  relationDefinitions: knowledge.relationDefinitions,
1701
- relationIndex: knowledge.relationIndex,
1702
1692
  createRelation: knowledge.createRelation,
1703
1693
  removeRelation: knowledge.removeRelation,
1704
1694
  setRelationSource: knowledge.setRelationSource,
@@ -1728,12 +1718,7 @@ export const useWorkspaceStore = defineStore('workspace', () => {
1728
1718
  fileRegistry,
1729
1719
  readFileMetadata: knowledge.readFileMetadata,
1730
1720
  updateFileMetadata: knowledge.updateFileMetadata,
1731
- createFileDatabase: knowledge.createFileDatabase,
1732
- saveFileDatabase: knowledge.saveFileDatabase,
1733
- createObjectDatabase: knowledge.createObjectDatabase,
1734
1721
  deleteObject: knowledge.deleteObject,
1735
- workspaceViews: knowledge.workspaceViews,
1736
- workspaceViewErrors: knowledge.workspaceViewErrors,
1737
1722
  displayPath,
1738
1723
  fileMutationPending: fileMutations.pending,
1739
1724
  documents,
@@ -1774,18 +1759,36 @@ export const useWorkspaceStore = defineStore('workspace', () => {
1774
1759
  openFilesInNewTabsAt,
1775
1760
  createBlankTab: tabsLayout.createBlankTab,
1776
1761
  openGraphTab,
1777
- openWorkspaceView,
1778
1762
  openPluginsTab,
1779
1763
  openPluginDetail,
1780
1764
  openCalendarTab: tabsLayout.openCalendarTab,
1781
1765
  registerViews: tabsLayout.registerViews,
1782
1766
  pluginViews: plugins.pluginViews,
1783
1767
  pluginCommands: plugins.pluginCommands,
1768
+ pluginFileHandlers: plugins.pluginFileHandlers,
1769
+ pluginSlashCommands: plugins.pluginSlashCommands,
1770
+ pluginCodeBlockRenderers: plugins.pluginCodeBlockRenderers,
1771
+ pluginDecorationsFor: plugins.pluginDecorationsFor,
1772
+ pluginStatusBarItems: plugins.pluginStatusBarItems,
1773
+ hasMarkdownFileHandler,
1784
1774
  activePluginSidebar,
1775
+ activeDocumentPluginSidebar: plugins.activeDocumentPluginSidebar,
1776
+ activePluginDialog: plugins.activePluginDialog,
1777
+ resolvePluginDialog: plugins.resolvePluginDialog,
1778
+ pluginToasts: plugins.pluginToasts,
1779
+ dismissPluginToast: plugins.dismissPluginToast,
1785
1780
  pluginSettingsRequest: plugins.pluginSettingsRequest,
1786
1781
  pluginSettingsPages: plugins.pluginSettingsPages,
1787
1782
  openPluginView: plugins.openPluginView,
1788
1783
  interactWithPlugin: plugins.interactWithPlugin,
1784
+ pluginContextProviders: plugins.pluginContextProviders,
1785
+ invokePluginAssistantTool: plugins.invokePluginAssistantTool,
1786
+ queryPluginAssistantContext: plugins.queryPluginAssistantContext,
1787
+ setPluginAiRunner: plugins.setPluginAiRunner,
1788
+ overlaySnapshot: plugins.overlaySnapshot,
1789
+ setSafeMode: plugins.setSafeMode,
1790
+ pluginHomeTabView: plugins.pluginHomeTabView,
1791
+ pluginNewTabView: plugins.pluginNewTabView,
1789
1792
  openViewTab: tabsLayout.openViewTab,
1790
1793
  readGraphDocument,
1791
1794
  assistantSnapshot: assistantBridge.assistantSnapshot,
@@ -211,13 +211,6 @@
211
211
  .change-diff > .panel-hint {
212
212
  padding: 10px 14px;
213
213
  }
214
- .activity-diff-button {
215
- display: block;
216
- color: #5f5e5b;
217
- font-size: 12px;
218
- margin: 6px 0;
219
- text-decoration: underline;
220
- }
221
214
  @media (max-width: 720px) {
222
215
  .agent-history {
223
216
  grid-template-columns: 155px minmax(0, 1fr);
@@ -88,16 +88,16 @@
88
88
  box-shadow: var(--overlay-shadow);
89
89
  }
90
90
  :root[data-theme='dark'] :is(
91
- .modal, .settings-dialog, .object-panel, .import-dialog, .plan-detail-panel,
91
+ .modal, .settings-dialog, .object-detail-panel, .import-dialog, .plan-detail-panel,
92
92
  .plan-connections, .assistant-connection-dialog, .assistant-panel-floating,
93
- .plugin-dialog, .new-tab-picker, .personal-plan-dialog, .document-history-dialog,
93
+ .plugin-dialog, .new-tab-picker, .document-history-dialog,
94
94
  .selection-todo-dialog
95
95
  ) {
96
96
  border-color: var(--line-strong);
97
97
  box-shadow: var(--dialog-shadow);
98
98
  }
99
99
  :root[data-theme='dark'] :is(
100
- .modal-backdrop, .object-panel-backdrop, .plan-detail-backdrop,
100
+ .modal-backdrop, .object-detail-backdrop, .plan-detail-backdrop,
101
101
  .plan-connections-backdrop, .selection-todo-backdrop, .new-tab-backdrop
102
102
  ) {
103
103
  background: #00000066;
@@ -244,65 +244,6 @@
244
244
  vertical-align: top;
245
245
  margin-top: 14px;
246
246
  }
247
- .inspector-footer {
248
- font-size: 12px;
249
- display: flex;
250
- align-items: center;
251
- gap: 7px;
252
- color: var(--muted);
253
- margin: auto 22px 22px;
254
- padding-top: 20px;
255
- }
256
- .live-dot {
257
- width: 5px;
258
- height: 5px;
259
- background: var(--green);
260
- border-radius: 50%;
261
- }
262
- .activity-list {
263
- padding: 0 17px 15px;
264
- }
265
- .activity-explainer {
266
- font-size: 12px;
267
- color: var(--muted);
268
- line-height: 1.9;
269
- margin: 20px 0 24px;
270
- }
271
- .activity-item {
272
- display: flex;
273
- gap: 9px;
274
- margin: 0 0 23px;
275
- }
276
- .activity-icon {
277
- height: 24px;
278
- width: 24px;
279
- border-radius: 50%;
280
- background: var(--surface);
281
- color: var(--text-secondary);
282
- display: grid;
283
- place-items: center;
284
- flex-shrink: 0;
285
- }
286
- .activity-icon.conflict {
287
- background: var(--warning-bg);
288
- color: var(--warning);
289
- }
290
- .activity-item strong {
291
- font-size: 12px;
292
- font-weight: 500;
293
- color: var(--text-secondary);
294
- }
295
- .activity-item p {
296
- font-size: 12px;
297
- color: var(--muted);
298
- word-break: break-all;
299
- line-height: 1.7;
300
- margin: 5px 0;
301
- }
302
- .activity-item time {
303
- font-size: 12px;
304
- color: var(--muted);
305
- }
306
247
  .creation-status {
307
248
  margin: 8px 24px;
308
249
  color: var(--text-secondary);